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