Gentoo Archives: gentoo-dev

From: David Seifert <soap@g.o>
To: gentoo-dev@l.g.o
Cc: cluster@g.o, robbat2@g.o, toolchain@g.o, suse@g.o, llvm@g.o, "Michał Górny" <mgorny@g.o>
Subject: Re: [gentoo-dev] [PATCH 02/12] dev-util/ccache: Convert to EAPI=6
Date: Thu, 17 Aug 2017 08:49:09
Message-Id: 1502959733.7527.5.camel@gentoo.org
In Reply to: [gentoo-dev] [PATCH 02/12] dev-util/ccache: Convert to EAPI=6 by "Michał Górny"
1 On Thu, 2017-08-17 at 10:36 +0200, Michał Górny wrote:
2 > ---
3 >  dev-util/ccache/ccache-3.3.4-r1.ebuild | 68
4 > ++++++++++++++++++++++++++++++++++
5 >  1 file changed, 68 insertions(+)
6 >  create mode 100644 dev-util/ccache/ccache-3.3.4-r1.ebuild
7 >
8 > diff --git a/dev-util/ccache/ccache-3.3.4-r1.ebuild b/dev-
9 > util/ccache/ccache-3.3.4-r1.ebuild
10 > new file mode 100644
11 > index 000000000000..1ef1d45179d1
12 > --- /dev/null
13 > +++ b/dev-util/ccache/ccache-3.3.4-r1.ebuild
14 > @@ -0,0 +1,68 @@
15 > +# Copyright 1999-2017 Gentoo Foundation
16 > +# Distributed under the terms of the GNU General Public License v2
17 > +
18 > +EAPI=6
19 > +
20 > +inherit readme.gentoo-r1
21 > +
22 > +DESCRIPTION="fast compiler cache"
23 > +HOMEPAGE="http://ccache.samba.org/"
24 > +SRC_URI="https://samba.org/ftp/ccache/${P}.tar.xz"
25 > +
26 > +LICENSE="GPL-3"
27 > +SLOT="0"
28 > +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc
29 > ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-
30 > macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~x64-solaris
31 > ~x86-solaris"
32 > +IUSE=""
33 > +
34 > +DEPEND="app-arch/xz-utils
35 > + sys-libs/zlib"
36 > +RDEPEND="${DEPEND}
37 > + sys-apps/gentoo-functions"
38 > +
39 > +src_prepare() {
40 > + # make sure we always use system zlib
41 > + rm -rf zlib || die
42 > + eapply "${FILESDIR}"/${PN}-3.3-size-on-disk.patch #456178
43 > + eapply_user
44 > + sed \
45 > + -e "/^EPREFIX=/s:'':'${EPREFIX}':" \
46 > + "${FILESDIR}"/ccache-config-3 > ccache-config || die
47 > +}
48 > +
49 > +src_install() {
50 > + DOCS=( AUTHORS.txt MANUAL.txt NEWS.txt README.md )
51 > + default
52 > +
53 > + dobin ccache-config
54 > +
55 > + DOC_CONTENTS="
56 > +To use ccache with **non-Portage** C compiling, add
57 > +${EPREFIX}/usr/lib/ccache/bin to the beginning of your path, before
58 > ${EPREFIX}/usr/bin.
59 > +Portage 2.0.46-r11+ will automatically take advantage of ccache with
60 > +no additional steps.  If this is your first install of ccache, type
61 > +something like this to set a maximum cache size of 2GB:\\n
62 > +# ccache -M 2G\\n
63 > +If you are upgrading from an older version than 3.x you should clear
64 > all of your caches like so:\\n
65 > +# CCACHE_DIR='${CCACHE_DIR:-${PORTAGE_TMPDIR}/ccache}' ccache -C\\n
66 > +ccache now supports sys-devel/clang and dev-lang/icc, too!"
67 > +
68 > + readme.gentoo_create_doc
69 > +}
70 > +
71 > +pkg_prerm() {
72 > + if [[ -z ${REPLACED_BY_VERSION} ]] ; then
73 > + "${EROOT}"/usr/bin/ccache-config --remove-links
74 > + "${EROOT}"/usr/bin/ccache-config --remove-links
75 > ${CHOST}
76 > + fi
77 > +}
78 > +
79 > +pkg_postinst() {
80 > + "${EROOT}"/usr/bin/ccache-config --install-links
81 > + "${EROOT}"/usr/bin/ccache-config --install-links ${CHOST}
82 > +
83 > + # nuke broken symlinks from previous versions that shouldn't
84 > exist
85 > + rm -f "${EROOT}"/usr/lib/ccache/bin/${CHOST}-cc || die
86 > + rm -rf "${EROOT}"/usr/lib/ccache.backup || die
87 > +
88 > + readme.gentoo_print_elog
89 > +}
90
91 While I personally am not as uptight about 'local'ising variables, I
92 believe making DOC_CONTENTS local serves an important purpose: to dodge
93 any chance of people thinking it is allowed to leak into pkg_* phases
94 (i.e. the whole rationale of readme.gentoo-r1 in the first place). For
95 DOCS and friends its irrelevant, as their semantics are only import in
96 src_* phases.

Replies

Subject Author
Re: [gentoo-dev] [PATCH 02/12] dev-util/ccache: Convert to EAPI=6 "Michał Górny" <mgorny@g.o>