summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Junghans <ottxor@gentoo.org>2013-09-13 14:25:31 +0000
committerChristoph Junghans <ottxor@gentoo.org>2013-09-13 14:25:31 +0000
commitc73f47d434c38c443af165cb68b5d7093c25228d (patch)
treee29ba45d912e777a0d0009f8ee52ccaa5f06c40a /dev-util/ccache
parentrevbump -> EAPI 5, add test invocation, deps for tests. remove old (diff)
downloadgentoo-2-c73f47d434c38c443af165cb68b5d7093c25228d.tar.gz
gentoo-2-c73f47d434c38c443af165cb68b5d7093c25228d.tar.bz2
gentoo-2-c73f47d434c38c443af165cb68b5d7093c25228d.zip
added prefix support (bug #484012)
(Portage version: 2.2.1/cvs/Linux x86_64, signed Manifest commit with key C2000586)
Diffstat (limited to 'dev-util/ccache')
-rw-r--r--dev-util/ccache/ChangeLog8
-rw-r--r--dev-util/ccache/ccache-3.1.9-r1.ebuild63
-rw-r--r--dev-util/ccache/files/ccache-config-296
3 files changed, 166 insertions, 1 deletions
diff --git a/dev-util/ccache/ChangeLog b/dev-util/ccache/ChangeLog
index ffc94ae34bd2..b6fe7b37c217 100644
--- a/dev-util/ccache/ChangeLog
+++ b/dev-util/ccache/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for dev-util/ccache
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/ccache/ChangeLog,v 1.123 2013/04/24 05:44:24 dirtyepic Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/ccache/ChangeLog,v 1.124 2013/09/13 14:25:31 ottxor Exp $
+
+*ccache-3.1.9-r1 (13 Sep 2013)
+
+ 13 Sep 2013; Christoph Junghans <ottxor@gentoo.org> +ccache-3.1.9-r1.ebuild,
+ +files/ccache-config-2:
+ added prefix support (bug #484012)
24 Apr 2013; Ryan Hill <dirtyepic@gentoo.org> ccache-3.1.9.ebuild,
-files/ccache-3.1.9-test-gcc-3.8.patch,
diff --git a/dev-util/ccache/ccache-3.1.9-r1.ebuild b/dev-util/ccache/ccache-3.1.9-r1.ebuild
new file mode 100644
index 000000000000..531727144b00
--- /dev/null
+++ b/dev-util/ccache/ccache-3.1.9-r1.ebuild
@@ -0,0 +1,63 @@
+# 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-r1.ebuild,v 1.1 2013/09/13 14:25:31 ottxor Exp $
+
+EAPI="4"
+
+inherit multilib eutils
+
+DESCRIPTION="fast compiler cache"
+HOMEPAGE="http://ccache.samba.org/"
+SRC_URI="http://samba.org/ftp/ccache/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+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=""
+
+RDEPEND="sys-libs/zlib"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils"
+
+src_prepare() {
+ # make sure we always use system zlib
+ rm -rf zlib
+ epatch "${FILESDIR}"/${PN}-3.1.7-no-perl.patch #421609
+ epatch "${FILESDIR}"/${P}-test-gcc-4.8.patch #461966
+ sed \
+ -e "/^LIBDIR=/s:lib:$(get_libdir):" \
+ -e "/^EPREFIX=/s:'':'${EPREFIX}':" \
+ "${FILESDIR}"/ccache-config-2 > ccache-config || die
+}
+
+src_install() {
+ default
+ dodoc AUTHORS.txt MANUAL.txt NEWS.txt README.txt
+
+ dobin ccache-config
+}
+
+pkg_postinst() {
+ "${EROOT}"/usr/bin/ccache-config --install-links
+ "${EROOT}"/usr/bin/ccache-config --install-links ${CHOST}
+
+ # nuke broken symlinks from previous versions that shouldn't exist
+ 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"
+
+ if [[ -z ${REPLACING_VERSIONS} ]] ; then
+ elog "To use ccache with **non-Portage** C compiling, add"
+ elog "${EPREFIX}/usr/$(get_libdir)/ccache/bin to the beginning of your path, before ${EPREFIX}/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
+}
diff --git a/dev-util/ccache/files/ccache-config-2 b/dev-util/ccache/files/ccache-config-2
new file mode 100644
index 000000000000..406405662458
--- /dev/null
+++ b/dev-util/ccache/files/ccache-config-2
@@ -0,0 +1,96 @@
+#!/bin/sh
+#
+# ccache-config - helper script for ccache and its ebuild
+#
+# Copyright 2003-2013 Superlucidity Services, LLC
+# Copyright 2013 Gentoo Foundation
+# This program licensed under the GNU GPL version 2.
+#
+# This script developed by Zachary T Welch at Superlucidity Services, LLC
+# it was cloned from the distcc-config script
+#
+# Additional features to come; this provides a starting point
+
+EPREFIX=''
+
+. "${EPREFIX}"/etc/init.d/functions.sh 2>/dev/null || {
+ ebegin() { echo " * $* ..."; }
+ eend() {
+ local r=${1:-$?}
+ [ ${r} -eq 0 ] && echo " [ OK ]" || echo " [ !! ]"
+ return $r
+ }
+}
+
+LIBDIR="lib"
+
+# this should be getopt'd someday (override with CC_QUIET=1)
+CC_VERBOSE=1
+unset _CC_QUIET
+c_quiet() {
+ [ -n "${CC_QUIET:-${_CC_QUIET}}" ] || [ -z "${CC_VERBOSE}" ]
+}
+
+c_ebegin() { c_quiet || ebegin "$@" ; }
+c_eend() { c_quiet || eend "$@" ; }
+
+###
+# the following functions manage the ccache symlinks
+# they allow the user or other scripts (namely gcc-config) to
+# automatically update ccache's links when upgrading toolchains
+#
+cc_path() {
+ echo ${ROOT%/}${EPREFIX}/usr/${LIBDIR}/ccache/bin/$1
+}
+cc_remove_link() {
+ local t=$(cc_path "$1")
+ if [ -L ${t} ]; then
+ c_ebegin "Removing ${t}"
+ rm -f "${t}"
+ c_eend
+ fi
+}
+cc_install_link() {
+ # Search the PATH for the specified compiler
+ # then create shadow link in /usr/lib/ccache/bin to ccache
+
+ if [ -n "$(type -p ${1})" ]; then
+ # first be sure any old link is removed
+ _CC_QUIET=1
+ cc_remove_link "${1}"
+ unset _CC_QUIET
+
+ # then create the new link
+ local t=$(cc_path "$1")
+ c_ebegin "Creating ccache shadow link ${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
+ if [ -n "${2}" ] ; then
+ # gcc-config doesnt install ${CHOST}-cc, so until
+ # it does, don't install a ccache symlink for it
+ [ "${a}" = "cc" ] && continue
+ a="${2}-${a}"
+ fi
+ eval "cc_${1}_link" "${a}"
+ done
+}
+
+###
+# main routine
+
+case "${1}" in
+ --install-links )
+ cc_links install "${2}"
+ ;;
+ --remove-links )
+ cc_links remove "${2}"
+ ;;
+ * )
+ echo "usage: ${0} {--install-links|--remove-links} [ CHOST ]"
+ ;;
+esac