Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/ccache/, dev-util/ccache/files/
Date: Fri, 20 May 2022 19:26:48
Message-Id: 1653074719.fe611282019feabd47b3bf0cca5e7630225666bb.mattst88@gentoo
1 commit: fe611282019feabd47b3bf0cca5e7630225666bb
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 20 18:59:57 2022 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Fri May 20 19:25:19 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe611282
7
8 dev-util/ccache: Version bump to 4.6.1
9
10 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
11
12 dev-util/ccache/Manifest | 2 +
13 dev-util/ccache/ccache-4.6.1.ebuild | 93 ++++++++++++++++++++++
14 .../ccache/files/ccache-4.6.1-avoid-run-user.patch | 28 +++++++
15 3 files changed, 123 insertions(+)
16
17 diff --git a/dev-util/ccache/Manifest b/dev-util/ccache/Manifest
18 index ddf19bb26242..7a1b44c369a5 100644
19 --- a/dev-util/ccache/Manifest
20 +++ b/dev-util/ccache/Manifest
21 @@ -1,3 +1,5 @@
22 DIST ccache-4.5.1.tar.xz 513008 BLAKE2B 637b6d36c169bc742efd165569879a47405c2884918ed3731186e8176c926fa0e8e9cd648756d501ae3b741c671e2399cfdb0bc216410bc64826d4fe00d69498 SHA512 267dcc6b41270eeffe029d13e58eca3399540037cc19dc58bb5ebeb7dcc51b201fbde91c9824eaee5b14fbf28bb7304b78d1340118bc72e56b80ff148575bc56
23 +DIST ccache-4.6.1.tar.xz 529040 BLAKE2B b4c1cae8b0c836c9e562488c79524ddbba4c995946e16f87c9b856e32961b454dd205bacdb030c283477be66d357b0fb5e67c9ad38715359b73f714aa73baee9 SHA512 361427ccecd74e8c25ca6a98ef3d3c125d81862196767eb383f6f8159fed8e1695cd5bc8731cb591c23c55352f0114a088b32a673717711efbfbb178a6c08c82
24 +DIST ccache-4.6.1.tar.xz.asc 833 BLAKE2B 2f9ca555a014cfc9dbc354f43d4db0d79f89a6f84c57a7b9452324854abb39cd21af1071404278c694212f38c3975c7fa702f7cc475e44f75e9b132e53088d5d SHA512 5494844f99232c5bc21f52db461f2a03d706e38bd73e147ebda89a4ce57fc2b80a920e42f7de539b9a5837ac8b515b309a29e045e479910c95a95d3c839b837d
25 DIST ccache-4.6.tar.xz 526084 BLAKE2B 2e43d0a3a004117e8c535ecb2f09c1273f5bec2b3704710abbc3034749438df33ef27db37d5bfbd48d83d60bdd3f738d3dbf356eff21166fee03780969dd1f24 SHA512 3a53fedfa91034ee876e1a4a672de25498fe53c6c80901bd4976049eb35e0479275ceb6627f0e8cf76d677d041d216f731daf4bad142e454e775b5e7f05e3e4e
26 DIST ccache-4.6.tar.xz.asc 833 BLAKE2B e0fc7677087006e3c6ac2bb7285915a56f233b4058c738c9d5967d29baf62b1b072ad2da4bf12f076440c68f39be77333d001d68703c32e26bd88a42b9e3ce71 SHA512 af09ffcdbba5e1e26047c7692dd0cf61f07869720d5849f59cbc0fe0f61c11aa419226d4d05061d23b5a03e8ec995e4d0e5af398af096bd19dbe35bf460eee0c
27
28 diff --git a/dev-util/ccache/ccache-4.6.1.ebuild b/dev-util/ccache/ccache-4.6.1.ebuild
29 new file mode 100644
30 index 000000000000..95ae40faf2de
31 --- /dev/null
32 +++ b/dev-util/ccache/ccache-4.6.1.ebuild
33 @@ -0,0 +1,93 @@
34 +# Copyright 1999-2022 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=8
38 +
39 +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/joelrosdahl.asc
40 +inherit cmake toolchain-funcs flag-o-matic verify-sig
41 +
42 +DESCRIPTION="Fast compiler cache"
43 +HOMEPAGE="https://ccache.dev/"
44 +SRC_URI="https://github.com/ccache/ccache/releases/download/v${PV}/${P}.tar.xz"
45 +SRC_URI+=" verify-sig? ( https://github.com/ccache/ccache/releases/download/v${PV}/${P}.tar.xz.asc )"
46 +
47 +LICENSE="GPL-3 LGPL-3"
48 +SLOT="0"
49 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
50 +# Enable 'static-c++' by default to make 'gcc' ebuild Just Work: bug #761220
51 +IUSE="doc redis +static-c++ test"
52 +RESTRICT="!test? ( test )"
53 +
54 +DEPEND="app-arch/zstd:=
55 + redis? ( dev-libs/hiredis:= )"
56 +RDEPEND="${DEPEND}
57 + dev-util/shadowman
58 + sys-apps/gentoo-functions"
59 +# Needed for eselect calls in pkg_*
60 +IDEPEND="dev-util/shadowman"
61 +
62 +# clang-specific tests use dev-libs/elfutils to compare objects for equality.
63 +# Let's pull in the dependency unconditionally.
64 +DEPEND+=" test? ( dev-libs/elfutils )"
65 +BDEPEND=" doc? ( dev-ruby/asciidoctor )
66 + verify-sig? ( sec-keys/openpgp-keys-joelrosdahl )"
67 +
68 +DOCS=( doc/{AUTHORS,MANUAL,NEWS}.adoc CONTRIBUTING.md README.md )
69 +
70 +PATCHES=(
71 + "${FILESDIR}"/${PN}-3.5-nvcc-test.patch
72 + "${FILESDIR}"/${PN}-4.0-objdump.patch
73 + "${FILESDIR}"/${PN}-4.6.1-avoid-run-user.patch
74 +)
75 +
76 +src_prepare() {
77 + cmake_src_prepare
78 +
79 + sed \
80 + -e "/^EPREFIX=/s:'':'${EPREFIX}':" \
81 + "${FILESDIR}"/ccache-config-3 > ccache-config || die
82 +}
83 +
84 +src_configure() {
85 + # Mainly used in tests
86 + tc-export CC OBJDUMP
87 +
88 + # Avoid dependency on libstdc++.so. Useful for cases when
89 + # we would like to use ccache to build older gcc which injects
90 + # into ccache locally built (possibly outdated) libstdc++
91 + # See bug #761220 for examples.
92 + #
93 + # Ideally gcc should not use LD_PRELOAD to avoid this type of failure.
94 + use static-c++ && append-ldflags -static-libstdc++
95 +
96 + local mycmakeargs=(
97 + -DENABLE_DOCUMENTATION=$(usex doc)
98 + -DENABLE_TESTING=$(usex test)
99 + -DZSTD_FROM_INTERNET=OFF
100 + -DREDIS_STORAGE_BACKEND=$(usex redis)
101 + )
102 +
103 + use redis && mycmakeargs+=( -DHIREDIS_FROM_INTERNET_DEFAULT=OFF )
104 +
105 + cmake_src_configure
106 +}
107 +
108 +src_install() {
109 + cmake_src_install
110 +
111 + dobin ccache-config
112 + insinto /usr/share/shadowman/tools
113 + newins - ccache <<<"${EPREFIX}/usr/lib/ccache/bin"
114 +}
115 +
116 +pkg_prerm() {
117 + if [[ -z ${REPLACED_BY_VERSION} && -z ${ROOT} ]] ; then
118 + eselect compiler-shadow remove ccache
119 + fi
120 +}
121 +
122 +pkg_postinst() {
123 + if [[ -z ${ROOT} ]] ; then
124 + eselect compiler-shadow update ccache
125 + fi
126 +}
127
128 diff --git a/dev-util/ccache/files/ccache-4.6.1-avoid-run-user.patch b/dev-util/ccache/files/ccache-4.6.1-avoid-run-user.patch
129 new file mode 100644
130 index 000000000000..9dce69c63518
131 --- /dev/null
132 +++ b/dev-util/ccache/files/ccache-4.6.1-avoid-run-user.patch
133 @@ -0,0 +1,28 @@
134 +Gentoo's sandbox does not whitelist this path by default yet.
135 +
136 +(4.1 update:
137 +https://github.com/ccache/ccache/issues/984
138 +https://github.com/ccache/ccache/issues/1044
139 +https://github.com/ccache/ccache/commit/a0edd4294f6a5a2d3f0c7b01273736f975f250e1
140 +https://github.com/ccache/ccache/commit/ef2e922f9642f943199138447b29ec53fa63ea68
141 +... gets us closer, but not there yet.)
142 +
143 +https://bugs.gentoo.org/837362 for 4.6 issue.
144 +--- a/src/Config.cpp
145 ++++ b/src/Config.cpp
146 +@@ -1039,14 +1039,5 @@ Config::check_key_tables_consistency()
147 + std::string
148 + Config::default_temporary_dir(const std::string& cache_dir)
149 + {
150 +- static const std::string run_user_tmp_dir = [] {
151 +-#ifdef HAVE_GETEUID
152 +- auto dir = FMT("/run/user/{}/ccache-tmp", geteuid());
153 +- if (Util::create_dir(dir) && access(dir.c_str(), W_OK) == 0) {
154 +- return dir;
155 +- }
156 +-#endif
157 +- return std::string();
158 +- }();
159 +- return !run_user_tmp_dir.empty() ? run_user_tmp_dir : cache_dir + "/tmp";
160 ++ return cache_dir + "/tmp";
161 + }