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.8.ebuild (-9 / +14 lines)
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 25-31 Link Here
25
	epatch "${FILESDIR}"/${PN}-3.1.7-no-perl.patch #421609
27
	epatch "${FILESDIR}"/${PN}-3.1.7-no-perl.patch #421609
26
	sed \
28
	sed \
27
		-e "/^LIBDIR=/s:lib:$(get_libdir):" \
29
		-e "/^LIBDIR=/s:lib:$(get_libdir):" \
28
		"${FILESDIR}"/ccache-config > ccache-config || die
30
		-e "/^EPREFIX=/s:'':'${EPREFIX}':" \
31
		"${FILESDIR}"/ccache-config-2 > ccache-config || die
29
}
32
}
30
33
31
src_install() {
34
src_install() {
Lines 36-48 Link Here
36
}
39
}
37
40
38
pkg_postinst() {
41
pkg_postinst() {
39
	"${ROOT}"/usr/bin/ccache-config --install-links
42
	"${EROOT}"/usr/bin/ccache-config --install-links
40
	"${ROOT}"/usr/bin/ccache-config --install-links ${CHOST}
43
	"${EROOT}"/usr/bin/ccache-config --install-links ${CHOST}
44
	use icc && "${EROOT}"/usr/bin/ccache-config --install-links icc
45
	use clang && "${EROOT}"/usr/bin/ccache-config --install-links clang
41
46
42
	# nuke broken symlinks from previous versions that shouldn't exist
47
	# nuke broken symlinks from previous versions that shouldn't exist
43
	rm -f "${ROOT}/usr/$(get_libdir)/ccache/bin/${CHOST}-cc"
48
	rm -f "${EROOT}/usr/$(get_libdir)/ccache/bin/${CHOST}-cc"
44
	[[ -d "${ROOT}/usr/$(get_libdir)/ccache.backup" ]] && \
49
	[[ -d "${EROOT}/usr/$(get_libdir)/ccache.backup" ]] && \
45
		rm -rf "${ROOT}/usr/$(get_libdir)/ccache.backup"
50
		rm -rf "${EROOT}/usr/$(get_libdir)/ccache.backup"
46
51
47
	elog "To use ccache with **non-Portage** C compiling, add"
52
	elog "To use ccache with **non-Portage** C compiling, add"
48
	elog "/usr/$(get_libdir)/ccache/bin to the beginning of your path, before /usr/bin."
53
	elog "/usr/$(get_libdir)/ccache/bin to the beginning of your path, before /usr/bin."
(-)/usr/portage/dev-util/ccache/files/ccache-config (-6 / +10 lines)
Lines 10-16 Link Here
10
#
10
#
11
# Additional features to come; this provides a starting point
11
# Additional features to come; this provides a starting point
12
12
13
. /etc/init.d/functions.sh 2>/dev/null || {
13
EPREFIX=''
14
15
. "${EPREFIX}"/etc/init.d/functions.sh 2>/dev/null || {
14
	ebegin() { echo " * $* ..."; }
16
	ebegin() { echo " * $* ..."; }
15
	eend() {
17
	eend() {
16
		local r=${1:-$?}
18
		local r=${1:-$?}
Lines 37-43 Link Here
37
#  automatically update ccache's links when upgrading toolchains
39
#  automatically update ccache's links when upgrading toolchains
38
#
40
#
39
cc_path() {
41
cc_path() {
40
	echo ${ROOT%/}/usr/${LIBDIR}/ccache/bin/$1
42
	echo ${ROOT%/}${EPREFIX}/usr/${LIBDIR}/ccache/bin/$1
41
}
43
}
42
cc_remove_link() {
44
cc_remove_link() {
43
	local t=$(cc_path "$1")
45
	local t=$(cc_path "$1")
Lines 60-72 Link Here
60
		# then create the new link
62
		# then create the new link
61
		local t=$(cc_path "$1")
63
		local t=$(cc_path "$1")
62
		c_ebegin "Creating ccache shadow link ${t}"
64
		c_ebegin "Creating ccache shadow link ${t}"
63
		mkdir -p -m 0755 "${t%/*}" && ln -s /usr/bin/ccache "${t}"
65
		mkdir -p -m 0755 "${t%/*}" && ln -s "${EPREFIX}"/usr/bin/ccache "${t}"
64
		c_eend
66
		c_eend
65
	fi
67
	fi
66
}
68
}
67
cc_links() {
69
cc_links() {
68
	local a
70
	local a compilers="gcc cc c++ g++" 
69
	for a in gcc cc c++ g++ ; do
71
	[ "${2}" = icc ] && compilers="icc icpc" && set -- "$1"
72
	[ "${2}" = clang ] && compilers="clang clang++" && set -- "$1"
73
	for a in ${compilers} ; do
70
		if [ -n "${2}" ] ; then
74
		if [ -n "${2}" ] ; then
71
			# gcc-config doesnt install ${CHOST}-cc, so until
75
			# gcc-config doesnt install ${CHOST}-cc, so until
72
			# it does, don't install a ccache symlink for it
76
			# it does, don't install a ccache symlink for it
Lines 88-93 Link Here
88
		cc_links remove "${2}"
92
		cc_links remove "${2}"
89
		;;
93
		;;
90
	* )
94
	* )
91
		echo "usage: ${0} {--install-links|--remove-links} [ CHOST ]"
95
		echo "usage: ${0} {--install-links|--remove-links} [ CHOST|clang|icc ]"
92
		;;
96
		;;
93
esac
97
esac

Return to bug 434250