1 |
|
# Copyright 1999-2022 Gentoo Authors
|
|
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
|
6 |
# XXX: We don't use CCACHE_* for these vars like we do in e.g. cmake/libabigail/qemu
|
|
7 |
# because Portage unsets them. Aaaah!
|
|
8 |
#
|
|
9 |
# Generate using https://github.com/thesamesam/sam-gentoo-scripts/blob/main/niche/generate-ccache-docs
|
|
10 |
# Set to 1 if prebuilt, 0 if not
|
|
11 |
# (the construct below is to allow overriding from env for script)
|
|
12 |
: ${MY_DOCS_PREBUILT:=1}
|
|
13 |
|
|
14 |
MY_DOCS_PREBUILT_DEV=sam
|
|
15 |
MY_DOCS_VERSION=$(ver_cut 1-2)
|
|
16 |
# Default to generating docs (inc. man pages) if no prebuilt; overridden later
|
|
17 |
# See bug #784815
|
|
18 |
MY_DOCS_USEFLAG="+doc"
|
|
19 |
|
6 |
20 |
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/joelrosdahl.asc
|
7 |
21 |
inherit cmake toolchain-funcs flag-o-matic verify-sig
|
8 |
22 |
|
... | ... | |
10 |
24 |
HOMEPAGE="https://ccache.dev/"
|
11 |
25 |
SRC_URI="https://github.com/ccache/ccache/releases/download/v${PV}/${P}.tar.xz"
|
12 |
26 |
SRC_URI+=" verify-sig? ( https://github.com/ccache/ccache/releases/download/v${PV}/${P}.tar.xz.asc )"
|
|
27 |
if [[ ${MY_DOCS_PREBUILT} == 1 ]] ; then
|
|
28 |
SRC_URI+=" !doc? ( https://dev.gentoo.org/~${MY_DOCS_PREBUILT_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${MY_DOCS_VERSION}-docs.tar.xz )"
|
|
29 |
MY_DOCS_USEFLAG="doc"
|
|
30 |
fi
|
13 |
31 |
|
14 |
32 |
LICENSE="GPL-3 LGPL-3"
|
15 |
33 |
SLOT="0"
|
16 |
34 |
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
|
17 |
35 |
# Enable 'static-c++' by default to make 'gcc' ebuild Just Work: bug #761220
|
18 |
|
IUSE="doc redis +static-c++ test"
|
|
36 |
IUSE="${MY_DOCS_USEFLAG} redis +static-c++ test"
|
19 |
37 |
RESTRICT="!test? ( test )"
|
20 |
38 |
|
21 |
|
DEPEND="app-arch/zstd:=
|
22 |
|
redis? ( dev-libs/hiredis:= )"
|
23 |
|
RDEPEND="${DEPEND}
|
|
39 |
DEPEND="
|
|
40 |
app-arch/zstd:=
|
|
41 |
redis? ( dev-libs/hiredis:= )
|
|
42 |
"
|
|
43 |
RDEPEND="
|
|
44 |
${DEPEND}
|
24 |
45 |
dev-util/shadowman
|
25 |
|
sys-apps/gentoo-functions"
|
|
46 |
sys-apps/gentoo-functions
|
|
47 |
"
|
26 |
48 |
# Needed for eselect calls in pkg_*
|
27 |
49 |
IDEPEND="dev-util/shadowman"
|
28 |
50 |
|
29 |
51 |
# clang-specific tests use dev-libs/elfutils to compare objects for equality.
|
30 |
52 |
# Let's pull in the dependency unconditionally.
|
31 |
53 |
DEPEND+=" test? ( dev-libs/elfutils )"
|
32 |
|
BDEPEND=" doc? ( dev-ruby/asciidoctor )
|
33 |
|
verify-sig? ( sec-keys/openpgp-keys-joelrosdahl )"
|
|
54 |
BDEPEND="
|
|
55 |
doc? ( dev-ruby/asciidoctor )
|
|
56 |
verify-sig? ( sec-keys/openpgp-keys-joelrosdahl )
|
|
57 |
"
|
34 |
58 |
|
35 |
59 |
DOCS=( doc/{AUTHORS,MANUAL,NEWS}.adoc CONTRIBUTING.md README.md )
|
36 |
60 |
|
37 |
61 |
PATCHES=(
|
38 |
62 |
"${FILESDIR}"/${PN}-3.5-nvcc-test.patch
|
39 |
63 |
"${FILESDIR}"/${PN}-4.0-objdump.patch
|
|
64 |
"${FILESDIR}"/${PN}-4.8-avoid-run-user.patch
|
|
65 |
"${FILESDIR}"/${P}-gcc-ice-workaround.patch
|
40 |
66 |
)
|
41 |
67 |
|
|
68 |
src_unpack() {
|
|
69 |
# Avoid aborting on the doc tarball
|
|
70 |
if use verify-sig ; then
|
|
71 |
verify-sig_verify_detached "${DISTDIR}"/${P}.tar.xz{,.asc}
|
|
72 |
fi
|
|
73 |
|
|
74 |
default
|
|
75 |
}
|
|
76 |
|
42 |
77 |
src_prepare() {
|
43 |
78 |
cmake_src_prepare
|
44 |
79 |
|
... | ... | |
76 |
111 |
dobin ccache-config
|
77 |
112 |
insinto /usr/share/shadowman/tools
|
78 |
113 |
newins - ccache <<<"${EPREFIX}/usr/lib/ccache/bin"
|
|
114 |
|
|
115 |
# If USE=doc, there'll be newly generated docs which we install instead.
|
|
116 |
if ! use doc && [[ ${MY_DOCS_PREBUILT} == 1 ]] ; then
|
|
117 |
doman "${WORKDIR}"/${PN}-${MY_DOCS_VERSION}-docs/doc/*.[0-8]
|
|
118 |
fi
|
79 |
119 |
}
|
80 |
120 |
|
81 |
121 |
pkg_prerm() {
|