Gentoo Archives: gentoo-commits

From: Christoph Junghans <kleiner_otti@×××.de>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: dev-util/ccache/, dev-util/ccache/files/
Date: Thu, 27 Dec 2012 21:44:37
Message-Id: 1356644634.5b2dc2b166fd66e6b471c7e57da69a7259ce3fbc.kleiner_otti@gentoo
1 commit: 5b2dc2b166fd66e6b471c7e57da69a7259ce3fbc
2 Author: Christoph Junghans <ottxor <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 27 21:43:54 2012 +0000
4 Commit: Christoph Junghans <kleiner_otti <AT> gmx <DOT> de>
5 CommitDate: Thu Dec 27 21:43:54 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=5b2dc2b1
7
8 added for testing
9
10 Package-Manager: portage-2.2.0_alpha149
11
12 ---
13 dev-util/ccache/ChangeLog | 9 ++
14 dev-util/ccache/ccache-3.1.8-r1.ebuild | 62 ++++++++++++++
15 dev-util/ccache/files/ccache-3.1.7-no-perl.patch | 15 ++++
16 dev-util/ccache/files/ccache-config-2 | 97 ++++++++++++++++++++++
17 dev-util/ccache/metadata.xml | 16 ++++
18 5 files changed, 199 insertions(+), 0 deletions(-)
19
20 diff --git a/dev-util/ccache/ChangeLog b/dev-util/ccache/ChangeLog
21 new file mode 100644
22 index 0000000..ec8d7a7
23 --- /dev/null
24 +++ b/dev-util/ccache/ChangeLog
25 @@ -0,0 +1,9 @@
26 +# ChangeLog for dev-util/ccache
27 +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
28 +# $Header: $
29 +
30 +*ccache-3.1.8-r1 (27 Dec 2012)
31 +
32 + 27 Dec 2012; Christoph Junghans <ottxor@g.o> +ccache-3.1.8-r1.ebuild,
33 + +files/ccache-3.1.7-no-perl.patch, +files/ccache-config-2, +metadata.xml:
34 + added for testing
35
36 diff --git a/dev-util/ccache/ccache-3.1.8-r1.ebuild b/dev-util/ccache/ccache-3.1.8-r1.ebuild
37 new file mode 100644
38 index 0000000..4cb9c24
39 --- /dev/null
40 +++ b/dev-util/ccache/ccache-3.1.8-r1.ebuild
41 @@ -0,0 +1,62 @@
42 +# Copyright 1999-2012 Gentoo Foundation
43 +# Distributed under the terms of the GNU General Public License v2
44 +# $Header: /var/cvsroot/gentoo-x86/dev-util/ccache/ccache-3.1.8.ebuild,v 1.9 2012/12/17 17:51:11 ago Exp $
45 +
46 +EAPI="4"
47 +
48 +inherit multilib eutils
49 +
50 +DESCRIPTION="fast compiler cache"
51 +HOMEPAGE="http://ccache.samba.org/"
52 +SRC_URI="http://samba.org/ftp/ccache/${P}.tar.xz"
53 +
54 +LICENSE="GPL-3"
55 +SLOT="0"
56 +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"
57 +IUSE="clang icc"
58 +
59 +RDEPEND="sys-libs/zlib
60 + clang? ( sys-devel/clang )
61 + icc? ( dev-lang/icc )"
62 +DEPEND="${RDEPEND}
63 + app-arch/xz-utils"
64 +
65 +src_prepare() {
66 + # make sure we always use system zlib
67 + rm -rf zlib
68 + epatch "${FILESDIR}"/${PN}-3.1.7-no-perl.patch #421609
69 + sed \
70 + -e "/^LIBDIR=/s:lib:$(get_libdir):" \
71 + -e "/^EPREFIX=/s:'':'${EPREFIX}':" \
72 + "${FILESDIR}"/ccache-config-2 > ccache-config || die
73 +}
74 +
75 +src_install() {
76 + default
77 + dodoc AUTHORS.txt MANUAL.txt NEWS.txt README.txt
78 +
79 + dobin ccache-config
80 +}
81 +
82 +pkg_postinst() {
83 + "${EROOT}"/usr/bin/ccache-config --install-links
84 + "${EROOT}"/usr/bin/ccache-config --install-links ${CHOST}
85 + use icc && "${EROOT}"/usr/bin/ccache-config --install-links icc
86 + use clang && "${EROOT}"/usr/bin/ccache-config --install-links clang
87 +
88 + # nuke broken symlinks from previous versions that shouldn't exist
89 + rm -f "${EROOT}/usr/$(get_libdir)/ccache/bin/${CHOST}-cc"
90 + [[ -d "${EROOT}/usr/$(get_libdir)/ccache.backup" ]] && \
91 + rm -rf "${EROOT}/usr/$(get_libdir)/ccache.backup"
92 +
93 + elog "To use ccache with **non-Portage** C compiling, add"
94 + elog "/usr/$(get_libdir)/ccache/bin to the beginning of your path, before /usr/bin."
95 + elog "Portage 2.0.46-r11+ will automatically take advantage of ccache with"
96 + elog "no additional steps. If this is your first install of ccache, type"
97 + elog "something like this to set a maximum cache size of 2GB:"
98 + elog "# ccache -M 2G"
99 + elog
100 + elog "If you are upgrading from an older version than 3.x you should clear"
101 + elog "all of your caches like so:"
102 + elog "# CCACHE_DIR='${CCACHE_DIR:-${PORTAGE_TMPDIR}/ccache}' ccache -C"
103 +}
104
105 diff --git a/dev-util/ccache/files/ccache-3.1.7-no-perl.patch b/dev-util/ccache/files/ccache-3.1.7-no-perl.patch
106 new file mode 100644
107 index 0000000..5abd15e
108 --- /dev/null
109 +++ b/dev-util/ccache/files/ccache-3.1.7-no-perl.patch
110 @@ -0,0 +1,15 @@
111 +avoid weak perl usage in tests
112 +
113 +https://bugs.gentoo.org/421609
114 +
115 +--- a/test.sh
116 ++++ b/test.sh
117 +@@ -1466,7 +1466,7 @@
118 + mkdir -p $dir
119 + i=0
120 + while [ $i -lt 10 ]; do
121 +- perl -e 'print "A" x 4017' >$dir/result$i-4017.o
122 ++ printf '%4017s' '' | tr ' ' 'A' >$dir/result$i-4017.o
123 + touch $dir/result$i-4017.stderr
124 + touch $dir/result$i-4017.d
125 + if [ $i -gt 5 ]; then
126
127 diff --git a/dev-util/ccache/files/ccache-config-2 b/dev-util/ccache/files/ccache-config-2
128 new file mode 100644
129 index 0000000..b0a111d
130 --- /dev/null
131 +++ b/dev-util/ccache/files/ccache-config-2
132 @@ -0,0 +1,97 @@
133 +#!/bin/sh
134 +#
135 +# ccache-config - helper script for ccache and its ebuild
136 +#
137 +# Copyright 2003-2012 Superlucidity Services, LLC
138 +# This program licensed under the GNU GPL version 2.
139 +#
140 +# This script developed by Zachary T Welch at Superlucidity Services, LLC
141 +# it was cloned from the distcc-config script
142 +#
143 +# Additional features to come; this provides a starting point
144 +
145 +EPREFIX=''
146 +
147 +. "${EPREFIX}"/etc/init.d/functions.sh 2>/dev/null || {
148 + ebegin() { echo " * $* ..."; }
149 + eend() {
150 + local r=${1:-$?}
151 + [ ${r} -eq 0 ] && echo " [ OK ]" || echo " [ !! ]"
152 + return $r
153 + }
154 +}
155 +
156 +LIBDIR="lib"
157 +
158 +# this should be getopt'd someday (override with CC_QUIET=1)
159 +CC_VERBOSE=1
160 +unset _CC_QUIET
161 +c_quiet() {
162 + [ -n "${CC_QUIET:-${_CC_QUIET}}" ] || [ -z "${CC_VERBOSE}" ]
163 +}
164 +
165 +c_ebegin() { c_quiet || ebegin "$@" ; }
166 +c_eend() { c_quiet || eend "$@" ; }
167 +
168 +###
169 +# the following functions manage the ccache symlinks
170 +# they allow the user or other scripts (namely gcc-config) to
171 +# automatically update ccache's links when upgrading toolchains
172 +#
173 +cc_path() {
174 + echo ${ROOT%/}${EPREFIX}/usr/${LIBDIR}/ccache/bin/$1
175 +}
176 +cc_remove_link() {
177 + local t=$(cc_path "$1")
178 + if [ -L ${t} ]; then
179 + c_ebegin "Removing ${t}"
180 + rm -f "${t}"
181 + c_eend
182 + fi
183 +}
184 +cc_install_link() {
185 + # Search the PATH for the specified compiler
186 + # then create shadow link in /usr/lib/ccache/bin to ccache
187 +
188 + if [ -n "$(type -p ${1})" ]; then
189 + # first be sure any old link is removed
190 + _CC_QUIET=1
191 + cc_remove_link "${1}"
192 + unset _CC_QUIET
193 +
194 + # then create the new link
195 + local t=$(cc_path "$1")
196 + c_ebegin "Creating ccache shadow link ${t}"
197 + mkdir -p -m 0755 "${t%/*}" && ln -s "${EPREFIX}"/usr/bin/ccache "${t}"
198 + c_eend
199 + fi
200 +}
201 +cc_links() {
202 + local a compilers="gcc cc c++ g++"
203 + [ "${2}" = icc ] && compilers="icc icpc" && set -- "$1"
204 + [ "${2}" = clang ] && compilers="clang " && set -- "$1"
205 + for a in ${compilers} ; do
206 + if [ -n "${2}" ] ; then
207 + # gcc-config doesnt install ${CHOST}-cc, so until
208 + # it does, don't install a ccache symlink for it
209 + [ "${a}" = "cc" ] && continue
210 + a="${2}-${a}"
211 + fi
212 + eval "cc_${1}_link" "${a}"
213 + done
214 +}
215 +
216 +###
217 +# main routine
218 +
219 +case "${1}" in
220 + --install-links )
221 + cc_links install "${2}"
222 + ;;
223 + --remove-links )
224 + cc_links remove "${2}"
225 + ;;
226 + * )
227 + echo "usage: ${0} {--install-links|--remove-links} [ CHOST|clang|icc ]"
228 + ;;
229 +esac
230
231 diff --git a/dev-util/ccache/metadata.xml b/dev-util/ccache/metadata.xml
232 new file mode 100644
233 index 0000000..399cfb0
234 --- /dev/null
235 +++ b/dev-util/ccache/metadata.xml
236 @@ -0,0 +1,16 @@
237 +<?xml version="1.0" encoding="UTF-8"?>
238 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
239 +<pkgmetadata>
240 + <herd>toolchain</herd>
241 + <maintainer>
242 + <email>robbat2@g.o</email>
243 + </maintainer>
244 + <longdescription lang="en">
245 + ccache acts as a caching pre-processor to C/C++ compilers, improving
246 + compilation time when recompiling previously compiled source.
247 + </longdescription>
248 + <use>
249 + <flag name='clang'>create links for <pkg>sys-devel/clang</pkg></flag>
250 + <flag name='icc'>create links for <pkg>dev-lang/icc</pkg></flag>
251 + </use>
252 +</pkgmetadata>