Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 434250 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/portage/dev-util/ccache/ccache-3.1.9.ebuild (-27 / +29 lines)
Lines 1-10 Link Here
1
# Copyright 1999-2013 Gentoo Foundation
1
# Copyright 1999-2013 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/dev-util/ccache/ccache-3.1.9.ebuild,v 1.15 2013/04/24 05:44:24 dirtyepic Exp $
3
# $Header: /var/cvsroot/gentoo-x86/dev-util/ccache/ccache-3.1.8.ebuild,v 1.9 2012/12/17 17:51:11 ago Exp $
4
4
5
EAPI="4"
5
EAPI=5
6
6
7
inherit multilib eutils
7
inherit multilib eutils readme.gentoo
8
8
9
DESCRIPTION="fast compiler cache"
9
DESCRIPTION="fast compiler cache"
10
HOMEPAGE="http://ccache.samba.org/"
10
HOMEPAGE="http://ccache.samba.org/"
Lines 12-21 Link Here
12
12
13
LICENSE="GPL-3"
13
LICENSE="GPL-3"
14
SLOT="0"
14
SLOT="0"
15
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
15
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~x64-solaris ~x86-solaris"
16
IUSE=""
16
IUSE="clang icc"
17
17
18
RDEPEND="sys-libs/zlib"
18
RDEPEND="sys-libs/zlib
19
	clang? ( sys-devel/clang )
20
	icc? ( dev-lang/icc )"
19
DEPEND="${RDEPEND}
21
DEPEND="${RDEPEND}
20
	app-arch/xz-utils"
22
	app-arch/xz-utils"
21
23
Lines 26-32 Link Here
26
	epatch "${FILESDIR}"/${P}-test-gcc-4.8.patch #461966
28
	epatch "${FILESDIR}"/${P}-test-gcc-4.8.patch #461966
27
	sed \
29
	sed \
28
		-e "/^LIBDIR=/s:lib:$(get_libdir):" \
30
		-e "/^LIBDIR=/s:lib:$(get_libdir):" \
29
		"${FILESDIR}"/ccache-config > ccache-config || die
31
		-e "/^EPREFIX=/s:'':'${EPREFIX}':" \
32
		"${FILESDIR}"/ccache-config-2 > ccache-config || die
33
34
	DOC_CONTENTS="To use ccache with **non-Portage** C compiling, add
35
		${EROOT}usr/$(get_libdir)/ccache/bin to the beginning of your path, before ${EROOT}usr/bin.
36
		Portage 2.0.46-r11+ will automatically take advantage of ccache with
37
		no additional steps.  If this is your first install of ccache, type
38
		something like this to set a maximum cache size of 2GB:\\n# ccache -M 2G\\n
39
		If you are upgrading from an older version than 3.x you should clear all of your caches like so:\\n
40
		# CCACHE_DIR='${CCACHE_DIR:-${PORTAGE_TMPDIR}/ccache}' ccache -C"
30
}
41
}
31
42
32
src_install() {
43
src_install() {
Lines 34-62 Link Here
34
	dodoc AUTHORS.txt MANUAL.txt NEWS.txt README.txt
45
	dodoc AUTHORS.txt MANUAL.txt NEWS.txt README.txt
35
46
36
	dobin ccache-config
47
	dobin ccache-config
48
49
	readme.gentoo_create_doc
37
}
50
}
38
51
39
pkg_postinst() {
52
pkg_postinst() {
40
	"${ROOT}"/usr/bin/ccache-config --install-links
53
	"${EROOT}"/usr/bin/ccache-config --install-links
41
	"${ROOT}"/usr/bin/ccache-config --install-links ${CHOST}
54
	"${EROOT}"/usr/bin/ccache-config --install-links ${CHOST}
55
	use icc && "${EROOT}"/usr/bin/ccache-config --install-links icc
56
	use clang && "${EROOT}"/usr/bin/ccache-config --install-links clang
42
57
43
	# nuke broken symlinks from previous versions that shouldn't exist
58
	# nuke broken symlinks from previous versions that shouldn't exist
44
	rm -f "${ROOT}/usr/$(get_libdir)/ccache/bin/${CHOST}-cc"
59
	rm -f "${EROOT}/usr/$(get_libdir)/ccache/bin/${CHOST}-cc"
45
	[[ -d "${ROOT}/usr/$(get_libdir)/ccache.backup" ]] && \
60
	[[ -d "${EROOT}/usr/$(get_libdir)/ccache.backup" ]] && \
46
		rm -rf "${ROOT}/usr/$(get_libdir)/ccache.backup"
61
		rm -rf "${EROOT}/usr/$(get_libdir)/ccache.backup"
47
62
48
	if [[ -z ${REPLACING_VERSIONS} ]] ; then
63
	readme.gentoo_pkg_postinst
49
		elog "To use ccache with **non-Portage** C compiling, add"
50
		elog "/usr/$(get_libdir)/ccache/bin to the beginning of your path, before /usr/bin."
51
		elog "Portage 2.0.46-r11+ will automatically take advantage of ccache with"
52
		elog "no additional steps."
53
		elog
54
		elog "You might want to set a maximum cache size:"
55
		elog "# ccache -M 2G"
56
	fi
57
	if has_version "<${CATEGORY}/${PN}-3" ; then
58
		elog "If you are upgrading from an older version than 3.x you should clear"
59
		elog "all of your caches like so:"
60
		elog "# CCACHE_DIR='${CCACHE_DIR:-${PORTAGE_TMPDIR}/ccache}' ccache -C"
61
	fi
62
}
64
}
(-)/usr/portage/dev-util/ccache/files/ccache-config (-7 / +12 lines)
Lines 2-8 Link Here
2
#
2
#
3
# ccache-config - helper script for ccache and its ebuild
3
# ccache-config - helper script for ccache and its ebuild
4
#
4
#
5
# Copyright 2003-2010 Superlucidity Services, LLC
5
# Copyright 1999-2013 Superlucidity Services, LLC
6
# Copyright 2013-2013 Gentoo Foundation
6
# This program licensed under the GNU GPL version 2.
7
# This program licensed under the GNU GPL version 2.
7
#
8
#
8
# This script developed by Zachary T Welch at Superlucidity Services, LLC
9
# This script developed by Zachary T Welch at Superlucidity Services, LLC
Lines 10-16 Link Here
10
#
11
#
11
# Additional features to come; this provides a starting point
12
# Additional features to come; this provides a starting point
12
13
13
. /etc/init.d/functions.sh 2>/dev/null || {
14
EPREFIX=''
15
16
. "${EPREFIX}"/etc/init.d/functions.sh 2>/dev/null || {
14
	ebegin() { echo " * $* ..."; }
17
	ebegin() { echo " * $* ..."; }
15
	eend() {
18
	eend() {
16
		local r=${1:-$?}
19
		local r=${1:-$?}
Lines 37-43 Link Here
37
#  automatically update ccache's links when upgrading toolchains
40
#  automatically update ccache's links when upgrading toolchains
38
#
41
#
39
cc_path() {
42
cc_path() {
40
	echo ${ROOT%/}/usr/${LIBDIR}/ccache/bin/$1
43
	echo ${ROOT%/}${EPREFIX}/usr/${LIBDIR}/ccache/bin/$1
41
}
44
}
42
cc_remove_link() {
45
cc_remove_link() {
43
	local t=$(cc_path "$1")
46
	local t=$(cc_path "$1")
Lines 60-72 Link Here
60
		# then create the new link
63
		# then create the new link
61
		local t=$(cc_path "$1")
64
		local t=$(cc_path "$1")
62
		c_ebegin "Creating ccache shadow link ${t}"
65
		c_ebegin "Creating ccache shadow link ${t}"
63
		mkdir -p -m 0755 "${t%/*}" && ln -s /usr/bin/ccache "${t}"
66
		mkdir -p -m 0755 "${t%/*}" && ln -s "${EPREFIX}"/usr/bin/ccache "${t}"
64
		c_eend
67
		c_eend
65
	fi
68
	fi
66
}
69
}
67
cc_links() {
70
cc_links() {
68
	local a
71
	local a compilers="gcc cc c++ g++" 
69
	for a in gcc cc c++ g++ ; do
72
	[ "${2}" = icc ] && compilers="icc icpc" && set -- "$1"
73
	[ "${2}" = clang ] && compilers="clang clang++" && set -- "$1"
74
	for a in ${compilers} ; do
70
		if [ -n "${2}" ] ; then
75
		if [ -n "${2}" ] ; then
71
			# gcc-config doesnt install ${CHOST}-cc, so until
76
			# gcc-config doesnt install ${CHOST}-cc, so until
72
			# it does, don't install a ccache symlink for it
77
			# it does, don't install a ccache symlink for it
Lines 88-93 Link Here
88
		cc_links remove "${2}"
93
		cc_links remove "${2}"
89
		;;
94
		;;
90
	* )
95
	* )
91
		echo "usage: ${0} {--install-links|--remove-links} [ CHOST ]"
96
		echo "usage: ${0} {--install-links|--remove-links} [ CHOST|clang|icc ]"
92
		;;
97
		;;
93
esac
98
esac

Return to bug 434250