diff options
Diffstat (limited to 'dev-util/ccache')
-rw-r--r-- | dev-util/ccache/Manifest | 11 | ||||
-rw-r--r-- | dev-util/ccache/ccache-3.7.10.ebuild | 76 | ||||
-rw-r--r-- | dev-util/ccache/ccache-3.7.11.ebuild | 76 | ||||
-rw-r--r-- | dev-util/ccache/ccache-4.10-r1.ebuild | 142 | ||||
-rw-r--r-- | dev-util/ccache/ccache-4.8.3.ebuild | 131 | ||||
-rw-r--r-- | dev-util/ccache/ccache-4.9.1-r1.ebuild | 132 | ||||
-rw-r--r-- | dev-util/ccache/files/ccache-3.7.10-objdump.patch | 15 | ||||
-rw-r--r-- | dev-util/ccache/files/ccache-4.0-objdump.patch | 12 | ||||
-rw-r--r-- | dev-util/ccache/files/ccache-4.10-avoid-run-user.patch | 34 | ||||
-rw-r--r-- | dev-util/ccache/files/ccache-4.10-blake3.patch | 79 | ||||
-rw-r--r-- | dev-util/ccache/files/ccache-4.10-unittest-httplib.patch | 12 | ||||
-rw-r--r-- | dev-util/ccache/files/ccache-4.8-avoid-run-user.patch | 34 | ||||
-rw-r--r-- | dev-util/ccache/files/ccache-4.9-avoid-run-user.patch | 34 | ||||
-rw-r--r-- | dev-util/ccache/files/ccache-4.9.1-distcc.patch | 38 | ||||
-rw-r--r-- | dev-util/ccache/files/ccache-config-3 | 2 | ||||
-rw-r--r-- | dev-util/ccache/metadata.xml | 9 |
16 files changed, 666 insertions, 171 deletions
diff --git a/dev-util/ccache/Manifest b/dev-util/ccache/Manifest index bbbced185e5a..e53c67e2f5fa 100644 --- a/dev-util/ccache/Manifest +++ b/dev-util/ccache/Manifest @@ -1,2 +1,9 @@ -DIST ccache-3.7.10.tar.xz 353792 BLAKE2B d7c06ee55a79afb4b72cdc20ec3d6413a5417301c63a0c822a4f82e6b9542c7a9cdf9f1bbd60a4698c335fdddfadcb9d674bff02c6dad1c2df9932212fdf6477 SHA512 64b0d42af7fd2dfdda65668b04dbd16807a22324e336e61f6c6a91c00110fb535c7ac9062a9c14c924a7ddaf42247f69a43d83dd0fd187ce3b0737158b5bb8fc -DIST ccache-3.7.11.tar.xz 354160 BLAKE2B 46fc5d65d6224bb796db7632b35ccca1089e5fed36eeb2ba231cf4c1aaa94be10bf0504f6ef565ce11673e527e09dee64583a764062ca7fea38364d790dd8cc1 SHA512 47b71b3ab4b89bf9b6f6d15941c22d2207b369922f51f9a8fbf4e86554325053dccce669e1c1ed3c0019a7e0a3d610f399e52d3fee68b56111aa7c1b24132c11 +DIST ccache-4.10-docs.tar.xz 82900 BLAKE2B 0d0ef988bb21bc05642c2d5ea42bdf9c87c190464d3bddc08a8bf281b003670a50a07a88bf31731a781d5454be09b87168bc8df3b239b93f4e3d3e3f667e9094 SHA512 c1030e76dea6eaeed5548dda80a766bb9c944f8e1223157eb7a227f08f80f48a8fece4e1a99beced4c6075b40ec7de3df662111c95f9390624f6e9a3b04c1083 +DIST ccache-4.10.tar.xz 411272 BLAKE2B 55e4efa41a53a664e8dfa25cd2b21dda80bf7847c467cf361058aaf06425a5c494d9e5b71e70f7d9327a6d57672af271946ad4e24fbd99f49c0bb8c256a9a2a5 SHA512 8bc8451a5e66300cb26ef7c1348d1b47e164ede17eab7f5f857a584a9def599c5c752d5591017a5e5b9673f108bb7a4a5bd59368e379fed9531e833fca8808a4 +DIST ccache-4.10.tar.xz.asc 833 BLAKE2B 4cdd6ce059ab54dca39365120b74e675a5a8c16e280f2e812d7a81feecda4283b63f84bf921d8b18493e348de38850facc95d48f0631e9ae46f33d7154a01f21 SHA512 faa3177d07a63746fe1dac1e748124d85207aa51d55894523e88074bf3b02deba7e961d2f7de48265acc6898bdd083bb48cb65631b02d9f7bdb7a27364d0fc4c +DIST ccache-4.8-docs.tar.xz 80280 BLAKE2B e8e00dd10a00670ff3a0c3f5ab0966469fa5246de64724e24d0287020d4636fb5a1f59421aaa094d05b88bd20efd2a4a06e46dfb957bcf77ad2ea61fd02551c9 SHA512 e0036a7f86b458028c6e24158f95b62e40d9f659031e16adc59c067096bb728f1cb583a2edecaf2118f15b8e00f028fa6f1cfa2466fba76b7c870cca93a883eb +DIST ccache-4.8.3.tar.xz 569724 BLAKE2B 53211db0e516eea9739b8f05bf6a3db678b4b5cff7af741469360556da20a320e4a40253ca9e51568045a394d3497b428413ff6cf77f4273aa4906357b427d1f SHA512 e0e344cd215de67fe060b36fb1b902bab61454477624fbe41d2ec57fdd721cec9c8920ca834f0ef0ccfeedb961b17143f18197497557887d88911ff66e330478 +DIST ccache-4.8.3.tar.xz.asc 833 BLAKE2B e800b7bdce705db3ced97f0fe008e8391811f9c7c49e815b6cd2cf220cf1107f3941d29d7bcdd10f79da4e6cad9766243e482011aeb5a170e1c5920b6ebdd726 SHA512 2e2298a3cf800d9de669f560269bd07ca2b76f761198af10f7174759ea95a23518dedce83f481bdd392bb60adbd736e5dd2c21af88beb761c0f589f685737586 +DIST ccache-4.9-docs.tar.xz 82684 BLAKE2B bc3517803cac75a0124358f740e3f4f4b923341277b77cb9ac7649520bbf19a65a51ebf324cc886f98e606bd29681ca3956073a85b737159792e068d529e299c SHA512 870d15dc9e3a0557dfe533862927ff8e90730678439b576e782f79f1f69c5bb499ff4c7e397a7eca059691ec5f89412594e32c74209a58003a6f55002c00d467 +DIST ccache-4.9.1.tar.xz 583764 BLAKE2B 9ebaf335fda54666e4bfc8f2c402f2b908b3922f3898b6a739b0256481256c6121546021b80fd2dbc93f3aea254db63a8624b97b2820b88e73e502a243bf2562 SHA512 5ae4537a7e546b779c80f5adadce1349a84da3a47b255bda06cb2678ee5403307f013c08c8541a21f6f1fb36a0b64bdbcf785fbd2fcfe3009150117250e75b0b +DIST ccache-4.9.1.tar.xz.asc 833 BLAKE2B a157b0c2c0777732d9a51fb7519f561fac098bbac9ba33fe453b210a6e9a34372b5d00b0fa940d2b783ab0eb48e7bc98707de884b191d83120d9ad8239c9fb76 SHA512 43605eca0f9a62565486c6c7ff622fc4d18a400518aa9c9e3c9d865a99c40c63a6a09d42ccd3428d28575c4de8a69be89c93830d26261d3479792e67179d0839 diff --git a/dev-util/ccache/ccache-3.7.10.ebuild b/dev-util/ccache/ccache-3.7.10.ebuild deleted file mode 100644 index ef3ee0cf4101..000000000000 --- a/dev-util/ccache/ccache-3.7.10.ebuild +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit toolchain-funcs - -DESCRIPTION="fast compiler cache" -HOMEPAGE="https://ccache.dev/" -SRC_URI="https://github.com/ccache/ccache/releases/download/v${PV}/ccache-${PV}.tar.xz" - -LICENSE="GPL-3" -SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86" -IUSE="test" - -DEPEND="app-arch/xz-utils - sys-libs/zlib" -RDEPEND="${DEPEND} - dev-util/shadowman - sys-apps/gentoo-functions" -# clang-specific tests use dev-libs/elfutils to compare objects for equality. -# Let's pull in the dependency unconditionally. -DEPEND+=" - test? ( dev-libs/elfutils )" - -RESTRICT="!test? ( test )" - -PATCHES=( - "${FILESDIR}"/${PN}-3.5-nvcc-test.patch - "${FILESDIR}"/${P}-objdump.patch -) - -src_prepare() { - default - - sed \ - -e "/^EPREFIX=/s:'':'${EPREFIX}':" \ - "${FILESDIR}"/ccache-config-3 > ccache-config || die - - # mainly used in tests - tc-export OBJDUMP -} - -src_configure() { - econf --without-bundled-zlib -} - -src_compile() { - emake V=1 -} - -src_test() { - emake check V=1 -} - -src_install() { - DOCS=( doc/{AUTHORS,MANUAL,NEWS}.adoc CONTRIBUTING.md README.md ) - default - - dobin ccache-config - insinto /usr/share/shadowman/tools - newins - ccache <<<"${EPREFIX}/usr/lib/ccache/bin" -} - -pkg_prerm() { - if [[ -z ${REPLACED_BY_VERSION} && ${ROOT:-/} == / ]] ; then - eselect compiler-shadow remove ccache - fi -} - -pkg_postinst() { - if [[ ${ROOT:-/} == / ]]; then - eselect compiler-shadow update ccache - fi -} diff --git a/dev-util/ccache/ccache-3.7.11.ebuild b/dev-util/ccache/ccache-3.7.11.ebuild deleted file mode 100644 index b3947b5c5445..000000000000 --- a/dev-util/ccache/ccache-3.7.11.ebuild +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit toolchain-funcs - -DESCRIPTION="fast compiler cache" -HOMEPAGE="https://ccache.dev/" -SRC_URI="https://github.com/ccache/ccache/releases/download/v${PV}/ccache-${PV}.tar.xz" - -LICENSE="GPL-3" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" -IUSE="test" - -DEPEND="app-arch/xz-utils - sys-libs/zlib" -RDEPEND="${DEPEND} - dev-util/shadowman - sys-apps/gentoo-functions" -# clang-specific tests use dev-libs/elfutils to compare objects for equality. -# Let's pull in the dependency unconditionally. -DEPEND+=" - test? ( dev-libs/elfutils )" - -RESTRICT="!test? ( test )" - -PATCHES=( - "${FILESDIR}"/${PN}-3.5-nvcc-test.patch - "${FILESDIR}"/${PN}-3.7.10-objdump.patch -) - -src_prepare() { - default - - sed \ - -e "/^EPREFIX=/s:'':'${EPREFIX}':" \ - "${FILESDIR}"/ccache-config-3 > ccache-config || die - - # mainly used in tests - tc-export OBJDUMP -} - -src_configure() { - econf --without-bundled-zlib -} - -src_compile() { - emake V=1 -} - -src_test() { - emake check V=1 -} - -src_install() { - DOCS=( doc/{AUTHORS,MANUAL,NEWS}.adoc CONTRIBUTING.md README.md ) - default - - dobin ccache-config - insinto /usr/share/shadowman/tools - newins - ccache <<<"${EPREFIX}/usr/lib/ccache/bin" -} - -pkg_prerm() { - if [[ -z ${REPLACED_BY_VERSION} && ${ROOT:-/} == / ]] ; then - eselect compiler-shadow remove ccache - fi -} - -pkg_postinst() { - if [[ ${ROOT:-/} == / ]]; then - eselect compiler-shadow update ccache - fi -} diff --git a/dev-util/ccache/ccache-4.10-r1.ebuild b/dev-util/ccache/ccache-4.10-r1.ebuild new file mode 100644 index 000000000000..7507908b00db --- /dev/null +++ b/dev-util/ccache/ccache-4.10-r1.ebuild @@ -0,0 +1,142 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# XXX: We don't use CCACHE_* for these vars like we do in e.g. cmake/libabigail/qemu +# because Portage unsets them. Aaaah! +# +# Generate using https://github.com/thesamesam/sam-gentoo-scripts/blob/main/niche/generate-ccache-docs +# Set to 1 if prebuilt, 0 if not +# (the construct below is to allow overriding from env for script) +: ${MY_DOCS_PREBUILT:=1} + +MY_DOCS_PREBUILT_DEV=sam +MY_DOCS_VERSION=$(ver_cut 1-2) +# Default to generating docs (inc. man pages) if no prebuilt; overridden later +# See bug #784815 +MY_DOCS_USEFLAG="+doc" + +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/joelrosdahl.asc +inherit cmake toolchain-funcs flag-o-matic prefix verify-sig + +DESCRIPTION="Fast compiler cache" +HOMEPAGE="https://ccache.dev/" +SRC_URI="https://github.com/ccache/ccache/releases/download/v${PV}/${P}.tar.xz" +SRC_URI+=" verify-sig? ( https://github.com/ccache/ccache/releases/download/v${PV}/${P}.tar.xz.asc )" +if [[ ${MY_DOCS_PREBUILT} == 1 ]] ; then + SRC_URI+=" !doc? ( https://dev.gentoo.org/~${MY_DOCS_PREBUILT_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${MY_DOCS_VERSION}-docs.tar.xz )" + MY_DOCS_USEFLAG="doc" +fi + +# https://ccache.dev/license.html +# ccache, blake3, NonstdSpan, tl-expected +LICENSE="GPL-3+ || ( CC0-1.0 Apache-2.0 ) Boost-1.0 CC0-1.0" +LICENSE+=" elibc_mingw? ( LGPL-3 ISC PSF-2 )" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +# Enable 'static-c++' by default to make 'gcc' ebuild Just Work: bug #761220 +IUSE="${MY_DOCS_USEFLAG} redis +static-c++ test" +RESTRICT="!test? ( test )" + +# TODO: package NonstdSpan, TlExpected +# TODO: upstream httplib patch +DEPEND=" + >=app-arch/zstd-1.3.4:= + >=dev-cpp/cpp-httplib-0.10.6:= + >=dev-libs/blake3-1.4.0:= + >=dev-libs/libfmt-8.0.0:= + >=dev-libs/xxhash-0.8.0 + redis? ( >=dev-libs/hiredis-0.13.3:= ) +" +RDEPEND=" + ${DEPEND} + dev-util/shadowman + sys-apps/gentoo-functions +" +# Needed for eselect calls in pkg_* +IDEPEND="dev-util/shadowman" + +# clang-specific tests use dev-libs/elfutils to compare objects for equality. +# Let's pull in the dependency unconditionally. +BDEPEND=" + doc? ( dev-ruby/asciidoctor ) + test? ( + >=dev-cpp/doctest-2.4.6 + dev-libs/elfutils + ) + verify-sig? ( sec-keys/openpgp-keys-joelrosdahl ) +" + +DOCS=( doc/{AUTHORS,MANUAL,NEWS}.adoc CONTRIBUTING.md README.md ) + +PATCHES=( + "${FILESDIR}"/${PN}-3.5-nvcc-test.patch + "${FILESDIR}"/${PN}-4.0-objdump.patch + "${FILESDIR}"/${PN}-4.10-avoid-run-user.patch + "${FILESDIR}"/${PN}-4.10-unittest-httplib.patch + "${FILESDIR}"/${P}-blake3.patch +) + +src_unpack() { + # Avoid aborting on the doc tarball + if use verify-sig ; then + verify-sig_verify_detached "${DISTDIR}"/${P}.tar.xz{,.asc} + fi + + default +} + +src_prepare() { + cmake_src_prepare + + cp "${FILESDIR}"/ccache-config-3 ccache-config || die + eprefixify ccache-config +} + +src_configure() { + # Mainly used in tests + tc-export CC OBJDUMP + + # Avoid dependency on libstdc++.so. Useful for cases when + # we would like to use ccache to build older gcc which injects + # into ccache locally built (possibly outdated) libstdc++ + # See bug #761220 for examples. + # + # Ideally gcc should not use LD_PRELOAD to avoid this type of failure. + use static-c++ && append-ldflags -static-libstdc++ + + local mycmakeargs=( + -DENABLE_DOCUMENTATION=$(usex doc) + -DENABLE_TESTING=$(usex test) + -DDEPS=LOCAL + -DREDIS_STORAGE_BACKEND=$(usex redis) + ) + + cmake_src_configure +} + +src_install() { + cmake_src_install + + dobin ccache-config + insinto /usr/share/shadowman/tools + newins - ccache <<<"${EPREFIX}/usr/lib/ccache/bin" + + # If USE=doc, there'll be newly generated docs which we install instead. + if ! use doc && [[ ${MY_DOCS_PREBUILT} == 1 ]] ; then + doman "${WORKDIR}"/${PN}-${MY_DOCS_VERSION}-docs/doc/*.[0-8] + fi +} + +pkg_prerm() { + if [[ -z ${REPLACED_BY_VERSION} && -z ${ROOT} ]] ; then + eselect compiler-shadow remove ccache + fi +} + +pkg_postinst() { + if [[ -z ${ROOT} ]] ; then + eselect compiler-shadow update ccache + fi +} diff --git a/dev-util/ccache/ccache-4.8.3.ebuild b/dev-util/ccache/ccache-4.8.3.ebuild new file mode 100644 index 000000000000..8c1e04988bf3 --- /dev/null +++ b/dev-util/ccache/ccache-4.8.3.ebuild @@ -0,0 +1,131 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# XXX: We don't use CCACHE_* for these vars like we do in e.g. cmake/libabigail/qemu +# because Portage unsets them. Aaaah! +# +# Generate using https://github.com/thesamesam/sam-gentoo-scripts/blob/main/niche/generate-ccache-docs +# Set to 1 if prebuilt, 0 if not +# (the construct below is to allow overriding from env for script) +: ${MY_DOCS_PREBUILT:=1} + +MY_DOCS_PREBUILT_DEV=sam +MY_DOCS_VERSION=$(ver_cut 1-2) +# Default to generating docs (inc. man pages) if no prebuilt; overridden later +# See bug #784815 +MY_DOCS_USEFLAG="+doc" + +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/joelrosdahl.asc +inherit cmake toolchain-funcs flag-o-matic prefix verify-sig + +DESCRIPTION="Fast compiler cache" +HOMEPAGE="https://ccache.dev/" +SRC_URI="https://github.com/ccache/ccache/releases/download/v${PV}/${P}.tar.xz" +SRC_URI+=" verify-sig? ( https://github.com/ccache/ccache/releases/download/v${PV}/${P}.tar.xz.asc )" +if [[ ${MY_DOCS_PREBUILT} == 1 ]] ; then + SRC_URI+=" !doc? ( https://dev.gentoo.org/~${MY_DOCS_PREBUILT_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${MY_DOCS_VERSION}-docs.tar.xz )" + MY_DOCS_USEFLAG="doc" +fi + +# https://ccache.dev/license.html +LICENSE="GPL-3+ GPL-3 MIT BSD Boost-1.0 BSD-2 || ( CC0-1.0 Apache-2.0 )" +LICENSE+=" elibc_mingw? ( LGPL-3 ISC PSF-2 )" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" +# Enable 'static-c++' by default to make 'gcc' ebuild Just Work: bug #761220 +IUSE="${MY_DOCS_USEFLAG} redis +static-c++ test" +RESTRICT="!test? ( test )" + +DEPEND=" + app-arch/zstd:= + redis? ( dev-libs/hiredis:= ) +" +RDEPEND=" + ${DEPEND} + dev-util/shadowman + sys-apps/gentoo-functions +" +# Needed for eselect calls in pkg_* +IDEPEND="dev-util/shadowman" + +# clang-specific tests use dev-libs/elfutils to compare objects for equality. +# Let's pull in the dependency unconditionally. +DEPEND+=" test? ( dev-libs/elfutils )" +BDEPEND=" + doc? ( dev-ruby/asciidoctor ) + verify-sig? ( sec-keys/openpgp-keys-joelrosdahl ) +" + +DOCS=( doc/{AUTHORS,MANUAL,NEWS}.adoc CONTRIBUTING.md README.md ) + +PATCHES=( + "${FILESDIR}"/${PN}-3.5-nvcc-test.patch + "${FILESDIR}"/${PN}-4.0-objdump.patch + "${FILESDIR}"/${PN}-4.8-avoid-run-user.patch +) + +src_unpack() { + # Avoid aborting on the doc tarball + if use verify-sig ; then + verify-sig_verify_detached "${DISTDIR}"/${P}.tar.xz{,.asc} + fi + + default +} + +src_prepare() { + cmake_src_prepare + + cp "${FILESDIR}"/ccache-config-3 ccache-config || die + eprefixify ccache-config +} + +src_configure() { + # Mainly used in tests + tc-export CC OBJDUMP + + # Avoid dependency on libstdc++.so. Useful for cases when + # we would like to use ccache to build older gcc which injects + # into ccache locally built (possibly outdated) libstdc++ + # See bug #761220 for examples. + # + # Ideally gcc should not use LD_PRELOAD to avoid this type of failure. + use static-c++ && append-ldflags -static-libstdc++ + + local mycmakeargs=( + -DENABLE_DOCUMENTATION=$(usex doc) + -DENABLE_TESTING=$(usex test) + -DZSTD_FROM_INTERNET=OFF + -DHIREDIS_FROM_INTERNET=OFF + -DREDIS_STORAGE_BACKEND=$(usex redis) + ) + + cmake_src_configure +} + +src_install() { + cmake_src_install + + dobin ccache-config + insinto /usr/share/shadowman/tools + newins - ccache <<<"${EPREFIX}/usr/lib/ccache/bin" + + # If USE=doc, there'll be newly generated docs which we install instead. + if ! use doc && [[ ${MY_DOCS_PREBUILT} == 1 ]] ; then + doman "${WORKDIR}"/${PN}-${MY_DOCS_VERSION}-docs/doc/*.[0-8] + fi +} + +pkg_prerm() { + if [[ -z ${REPLACED_BY_VERSION} && -z ${ROOT} ]] ; then + eselect compiler-shadow remove ccache + fi +} + +pkg_postinst() { + if [[ -z ${ROOT} ]] ; then + eselect compiler-shadow update ccache + fi +} diff --git a/dev-util/ccache/ccache-4.9.1-r1.ebuild b/dev-util/ccache/ccache-4.9.1-r1.ebuild new file mode 100644 index 000000000000..222324b909eb --- /dev/null +++ b/dev-util/ccache/ccache-4.9.1-r1.ebuild @@ -0,0 +1,132 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# XXX: We don't use CCACHE_* for these vars like we do in e.g. cmake/libabigail/qemu +# because Portage unsets them. Aaaah! +# +# Generate using https://github.com/thesamesam/sam-gentoo-scripts/blob/main/niche/generate-ccache-docs +# Set to 1 if prebuilt, 0 if not +# (the construct below is to allow overriding from env for script) +: ${MY_DOCS_PREBUILT:=1} + +MY_DOCS_PREBUILT_DEV=sam +MY_DOCS_VERSION=$(ver_cut 1-2) +# Default to generating docs (inc. man pages) if no prebuilt; overridden later +# See bug #784815 +MY_DOCS_USEFLAG="+doc" + +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/joelrosdahl.asc +inherit cmake toolchain-funcs flag-o-matic prefix verify-sig + +DESCRIPTION="Fast compiler cache" +HOMEPAGE="https://ccache.dev/" +SRC_URI="https://github.com/ccache/ccache/releases/download/v${PV}/${P}.tar.xz" +SRC_URI+=" verify-sig? ( https://github.com/ccache/ccache/releases/download/v${PV}/${P}.tar.xz.asc )" +if [[ ${MY_DOCS_PREBUILT} == 1 ]] ; then + SRC_URI+=" !doc? ( https://dev.gentoo.org/~${MY_DOCS_PREBUILT_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${MY_DOCS_VERSION}-docs.tar.xz )" + MY_DOCS_USEFLAG="doc" +fi + +# https://ccache.dev/license.html +LICENSE="GPL-3+ GPL-3 MIT BSD Boost-1.0 BSD-2 || ( CC0-1.0 Apache-2.0 )" +LICENSE+=" elibc_mingw? ( LGPL-3 ISC PSF-2 )" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" +# Enable 'static-c++' by default to make 'gcc' ebuild Just Work: bug #761220 +IUSE="${MY_DOCS_USEFLAG} redis +static-c++ test" +RESTRICT="!test? ( test )" + +DEPEND=" + app-arch/zstd:= + redis? ( dev-libs/hiredis:= ) +" +RDEPEND=" + ${DEPEND} + dev-util/shadowman + sys-apps/gentoo-functions +" +# Needed for eselect calls in pkg_* +IDEPEND="dev-util/shadowman" + +# clang-specific tests use dev-libs/elfutils to compare objects for equality. +# Let's pull in the dependency unconditionally. +DEPEND+=" test? ( dev-libs/elfutils )" +BDEPEND=" + doc? ( dev-ruby/asciidoctor ) + verify-sig? ( sec-keys/openpgp-keys-joelrosdahl ) +" + +DOCS=( doc/{AUTHORS,MANUAL,NEWS}.adoc CONTRIBUTING.md README.md ) + +PATCHES=( + "${FILESDIR}"/${PN}-3.5-nvcc-test.patch + "${FILESDIR}"/${PN}-4.0-objdump.patch + "${FILESDIR}"/${PN}-4.9-avoid-run-user.patch + "${FILESDIR}"/${P}-distcc.patch +) + +src_unpack() { + # Avoid aborting on the doc tarball + if use verify-sig ; then + verify-sig_verify_detached "${DISTDIR}"/${P}.tar.xz{,.asc} + fi + + default +} + +src_prepare() { + cmake_src_prepare + + cp "${FILESDIR}"/ccache-config-3 ccache-config || die + eprefixify ccache-config +} + +src_configure() { + # Mainly used in tests + tc-export CC OBJDUMP + + # Avoid dependency on libstdc++.so. Useful for cases when + # we would like to use ccache to build older gcc which injects + # into ccache locally built (possibly outdated) libstdc++ + # See bug #761220 for examples. + # + # Ideally gcc should not use LD_PRELOAD to avoid this type of failure. + use static-c++ && append-ldflags -static-libstdc++ + + local mycmakeargs=( + -DENABLE_DOCUMENTATION=$(usex doc) + -DENABLE_TESTING=$(usex test) + -DZSTD_FROM_INTERNET=OFF + -DHIREDIS_FROM_INTERNET=OFF + -DREDIS_STORAGE_BACKEND=$(usex redis) + ) + + cmake_src_configure +} + +src_install() { + cmake_src_install + + dobin ccache-config + insinto /usr/share/shadowman/tools + newins - ccache <<<"${EPREFIX}/usr/lib/ccache/bin" + + # If USE=doc, there'll be newly generated docs which we install instead. + if ! use doc && [[ ${MY_DOCS_PREBUILT} == 1 ]] ; then + doman "${WORKDIR}"/${PN}-${MY_DOCS_VERSION}-docs/doc/*.[0-8] + fi +} + +pkg_prerm() { + if [[ -z ${REPLACED_BY_VERSION} && -z ${ROOT} ]] ; then + eselect compiler-shadow remove ccache + fi +} + +pkg_postinst() { + if [[ -z ${ROOT} ]] ; then + eselect compiler-shadow update ccache + fi +} diff --git a/dev-util/ccache/files/ccache-3.7.10-objdump.patch b/dev-util/ccache/files/ccache-3.7.10-objdump.patch deleted file mode 100644 index bad334a5c546..000000000000 --- a/dev-util/ccache/files/ccache-3.7.10-objdump.patch +++ /dev/null @@ -1,15 +0,0 @@ -Allow ${CHOST}-objdump (or any other override) ---- a/test/suites/debug_prefix_map.bash -+++ b/test/suites/debug_prefix_map.bash -@@ -24,9 +24,9 @@ objdump_cmd() { - if $HOST_OS_APPLE; then - xcrun dwarfdump -r0 $1 - elif $HOST_OS_FREEBSD; then -- objdump -W $1 -+ ${OBJDUMP-objdump} -W $1 - else -- objdump -g $1 -+ ${OBJDUMP-objdump} -g $1 - fi - } - diff --git a/dev-util/ccache/files/ccache-4.0-objdump.patch b/dev-util/ccache/files/ccache-4.0-objdump.patch new file mode 100644 index 000000000000..af48e997f50b --- /dev/null +++ b/dev-util/ccache/files/ccache-4.0-objdump.patch @@ -0,0 +1,12 @@ +Allow ${CHOST}-objdump (or any other override) +--- a/test/run ++++ b/test/run +@@ -133,7 +133,7 @@ objdump_cmd() { + # back to brute force and ignorance. + strings "$1" + else +- objdump -W "$file" ++ ${OBJDUMP-objdump} -W "$file" + fi + } + diff --git a/dev-util/ccache/files/ccache-4.10-avoid-run-user.patch b/dev-util/ccache/files/ccache-4.10-avoid-run-user.patch new file mode 100644 index 000000000000..d60cc365f25d --- /dev/null +++ b/dev-util/ccache/files/ccache-4.10-avoid-run-user.patch @@ -0,0 +1,34 @@ +Gentoo's sandbox does not whitelist this path by default yet. + +(4.1 update: +https://github.com/ccache/ccache/issues/984 +https://github.com/ccache/ccache/issues/1044 +https://github.com/ccache/ccache/commit/a0edd4294f6a5a2d3f0c7b01273736f975f250e1 +https://github.com/ccache/ccache/commit/ef2e922f9642f943199138447b29ec53fa63ea68 +... gets us closer, but not there yet.) + +And see https://github.com/ccache/ccache/discussions/1086#discussioncomment-3327565. + +https://bugs.gentoo.org/837362 for 4.6 issue. +https://bugs.gentoo.org/883799 and https://bugs.gentoo.org/887019 fo 4.8 issue. +--- a/src/ccache/Config.cpp ++++ b/src/ccache/Config.cpp +@@ -1193,17 +1193,5 @@ Config::check_key_tables_consistency() + std::string + Config::default_temporary_dir() const + { +- static const std::string run_user_tmp_dir = [] { +-#ifndef _WIN32 +- const char* const xdg_runtime_dir = getenv("XDG_RUNTIME_DIR"); +- if (xdg_runtime_dir && DirEntry(xdg_runtime_dir).is_directory()) { +- auto dir = FMT("{}/ccache-tmp", xdg_runtime_dir); +- if (fs::create_directories(dir) && access(dir.c_str(), W_OK) == 0) { +- return dir; +- } +- } +-#endif +- return std::string(); +- }(); +- return !run_user_tmp_dir.empty() ? run_user_tmp_dir : m_cache_dir + "/tmp"; ++ return m_cache_dir + "/tmp"; + } diff --git a/dev-util/ccache/files/ccache-4.10-blake3.patch b/dev-util/ccache/files/ccache-4.10-blake3.patch new file mode 100644 index 000000000000..5789051200eb --- /dev/null +++ b/dev-util/ccache/files/ccache-4.10-blake3.patch @@ -0,0 +1,79 @@ +https://github.com/ccache/ccache/pull/1464 + +From d159306db8398da233df6481ac3fd83460ef0f0b Mon Sep 17 00:00:00 2001 +From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> +Date: Thu, 30 May 2024 19:26:41 +0800 +Subject: [PATCH 1/4] Fix detection of system blake3 + +The existing code mistakenly always rejects the system version as too old because it doesn't parse the version from the header correctly. + +This change fixes that. +--- a/cmake/FindBlake3.cmake ++++ b/cmake/FindBlake3.cmake +@@ -8,7 +8,7 @@ else() + find_library(BLAKE3_LIBRARY blake3) + if(BLAKE3_INCLUDE_DIR) + file(READ "${BLAKE3_INCLUDE_DIR}/blake3.h" _blake3_h) +- string(REGEX MATCH "#define _blake3_version_string \"([0-9]+).([0-9]+).*([0-9]+)\"" _ "${_blake3_h}") ++ string(REGEX MATCH "#define BLAKE3_VERSION_STRING \"([0-9]+).([0-9]+).*([0-9]+)\"" _ "${_blake3_h}") + set(_blake3_version_string "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}") + if(NOT "${CMAKE_MATCH_0}" STREQUAL "" AND "${_blake3_version_string}" VERSION_GREATER_EQUAL "${Blake3_FIND_VERSION}") + if(BLAKE3_LIBRARY) + +From fa4046966e71011587364b0241255130b62858fb Mon Sep 17 00:00:00 2001 +From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> +Date: Thu, 30 May 2024 19:43:11 +0800 +Subject: [PATCH 2/4] Fix blake3 include in Hash.hpp + +System installations of blake3 install the `blake3.h` header directly into the `include` directory and not into a `blake3` subdirectory. +--- a/src/ccache/Hash.hpp ++++ b/src/ccache/Hash.hpp +@@ -21,7 +21,7 @@ + #include <ccache/util/PathString.hpp> + #include <ccache/util/conversion.hpp> + +-#include <blake3/blake3.h> ++#include <blake3.h> + #include <nonstd/span.hpp> + #include <tl/expected.hpp> + + +From 36f8eeea1cb986440f51c1eee9db563493103462 Mon Sep 17 00:00:00 2001 +From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> +Date: Thu, 30 May 2024 19:44:53 +0800 +Subject: [PATCH 3/4] Fix include path for bundled blake3 + +We modified the include directive for `blake3.h` in `Hash.hpp`, so we need this in order for builds that use the bundled blake3 to keep working. +--- a/src/third_party/blake3/CMakeLists.txt ++++ b/src/third_party/blake3/CMakeLists.txt +@@ -7,7 +7,7 @@ add_library( + "${CMAKE_CURRENT_SOURCE_DIR}/blake3/blake3_portable.c" + ) + +-target_include_directories(dep_blake3 INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}") ++target_include_directories(dep_blake3 INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/blake3") + target_link_libraries(dep_blake3 PRIVATE standard_settings) + + if(MSVC) + +From 8cc68bc6f3ec8dadcb6a1244c76d865536f91be7 Mon Sep 17 00:00:00 2001 +From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> +Date: Thu, 30 May 2024 19:52:59 +0800 +Subject: [PATCH 4/4] Fix `clang-format` failure + +--- a/src/ccache/Hash.hpp ++++ b/src/ccache/Hash.hpp +@@ -21,10 +21,11 @@ + #include <ccache/util/PathString.hpp> + #include <ccache/util/conversion.hpp> + +-#include <blake3.h> + #include <nonstd/span.hpp> + #include <tl/expected.hpp> + ++#include <blake3.h> ++ + #include <array> + #include <cstdint> + #include <cstdio> + diff --git a/dev-util/ccache/files/ccache-4.10-unittest-httplib.patch b/dev-util/ccache/files/ccache-4.10-unittest-httplib.patch new file mode 100644 index 000000000000..2689ba7fcbde --- /dev/null +++ b/dev-util/ccache/files/ccache-4.10-unittest-httplib.patch @@ -0,0 +1,12 @@ +TODO: send upstream (in Gentoo, we don't rename it to cpp-httplib, so need to check for that as a library too) +--- a/cmake/FindCppHttplib.cmake ++++ b/cmake/FindCppHttplib.cmake +@@ -12,7 +12,7 @@ else() + if(NOT "${CMAKE_MATCH_0}" STREQUAL "" AND "${_cpphttplib_version_string}" VERSION_GREATER_EQUAL "${CppHttplib_FIND_VERSION}") + # Some dists like Fedora package cpp-httplib as a single header while some + # dists like Debian package it as a traditional library. +- find_library(CPPHTTPLIB_LIBRARY cpp-httplib) ++ find_library(CPPHTTPLIB_LIBRARY httplib) + if(CPPHTTPLIB_LIBRARY) + message(STATUS "Using system CppHttplib (${CPPHTTPLIB_LIBRARY})") + add_library(dep_cpphttplib UNKNOWN IMPORTED) diff --git a/dev-util/ccache/files/ccache-4.8-avoid-run-user.patch b/dev-util/ccache/files/ccache-4.8-avoid-run-user.patch new file mode 100644 index 000000000000..51371464509c --- /dev/null +++ b/dev-util/ccache/files/ccache-4.8-avoid-run-user.patch @@ -0,0 +1,34 @@ +Gentoo's sandbox does not whitelist this path by default yet. + +(4.1 update: +https://github.com/ccache/ccache/issues/984 +https://github.com/ccache/ccache/issues/1044 +https://github.com/ccache/ccache/commit/a0edd4294f6a5a2d3f0c7b01273736f975f250e1 +https://github.com/ccache/ccache/commit/ef2e922f9642f943199138447b29ec53fa63ea68 +... gets us closer, but not there yet.) + +And see https://github.com/ccache/ccache/discussions/1086#discussioncomment-3327565. + +https://bugs.gentoo.org/837362 for 4.6 issue. +https://bugs.gentoo.org/883799 and https://bugs.gentoo.org/887019 fo 4.8 issue. +--- a/src/Config.cpp ++++ b/src/Config.cpp +@@ -1147,17 +1147,5 @@ Config::check_key_tables_consistency() + std::string + Config::default_temporary_dir() const + { +- static const std::string run_user_tmp_dir = [] { +-#ifndef _WIN32 +- const char* const xdg_runtime_dir = getenv("XDG_RUNTIME_DIR"); +- if (xdg_runtime_dir && Stat::stat(xdg_runtime_dir).is_directory()) { +- auto dir = FMT("{}/ccache-tmp", xdg_runtime_dir); +- if (Util::create_dir(dir) && access(dir.c_str(), W_OK) == 0) { +- return dir; +- } +- } +-#endif +- return std::string(); +- }(); +- return !run_user_tmp_dir.empty() ? run_user_tmp_dir : m_cache_dir + "/tmp"; ++ return m_cache_dir + "/tmp"; + } diff --git a/dev-util/ccache/files/ccache-4.9-avoid-run-user.patch b/dev-util/ccache/files/ccache-4.9-avoid-run-user.patch new file mode 100644 index 000000000000..ccce18b9d573 --- /dev/null +++ b/dev-util/ccache/files/ccache-4.9-avoid-run-user.patch @@ -0,0 +1,34 @@ +Gentoo's sandbox does not whitelist this path by default yet. + +(4.1 update: +https://github.com/ccache/ccache/issues/984 +https://github.com/ccache/ccache/issues/1044 +https://github.com/ccache/ccache/commit/a0edd4294f6a5a2d3f0c7b01273736f975f250e1 +https://github.com/ccache/ccache/commit/ef2e922f9642f943199138447b29ec53fa63ea68 +... gets us closer, but not there yet.) + +And see https://github.com/ccache/ccache/discussions/1086#discussioncomment-3327565. + +https://bugs.gentoo.org/837362 for 4.6 issue. +https://bugs.gentoo.org/883799 and https://bugs.gentoo.org/887019 fo 4.8 issue. +--- a/src/Config.cpp ++++ b/src/Config.cpp +@@ -1194,17 +1194,5 @@ Config::check_key_tables_consistency() + std::string + Config::default_temporary_dir() const + { +- static const std::string run_user_tmp_dir = [] { +-#ifndef _WIN32 +- const char* const xdg_runtime_dir = getenv("XDG_RUNTIME_DIR"); +- if (xdg_runtime_dir && DirEntry(xdg_runtime_dir).is_directory()) { +- auto dir = FMT("{}/ccache-tmp", xdg_runtime_dir); +- if (fs::create_directories(dir) && access(dir.c_str(), W_OK) == 0) { +- return dir; +- } +- } +-#endif +- return std::string(); +- }(); +- return !run_user_tmp_dir.empty() ? run_user_tmp_dir : m_cache_dir + "/tmp"; ++ return m_cache_dir + "/tmp"; + } diff --git a/dev-util/ccache/files/ccache-4.9.1-distcc.patch b/dev-util/ccache/files/ccache-4.9.1-distcc.patch new file mode 100644 index 000000000000..412e2562ae76 --- /dev/null +++ b/dev-util/ccache/files/ccache-4.9.1-distcc.patch @@ -0,0 +1,38 @@ +https://bugs.gentoo.org/927740 +https://github.com/ccache/ccache/issues/1406 +https://github.com/ccache/ccache/commit/33d390bb249ddf1a6b3bdecede71b12c70000da3 + +From 33d390bb249ddf1a6b3bdecede71b12c70000da3 Mon Sep 17 00:00:00 2001 +From: Joel Rosdahl <joel@rosdahl.net> +Date: Wed, 21 Feb 2024 20:25:03 +0100 +Subject: [PATCH] fix: Allow nonexistent include files in preprocessor mode + +After 43c3a44aadcb nonexistent include files found in the preprocessed +output would increment "Could not read or parse input file" and fall +back to just running the compiler. This made ccache not attempt +preprocessor mode for generated code with #line header referencing files +that can't be found, e.g. in an out-of-source build scenario. + +Fix this by just disabling direct mode, restoring the pre-43c3a44aadcb +behavior in such cases. + +Fixes #1406. + +(cherry picked from commit 08da6cd4da41fa213d387f52e3cf1d1f2a42366b) +--- a/src/ccache.cpp ++++ b/src/ccache.cpp +@@ -352,7 +352,12 @@ remember_include_file(Context& ctx, + + DirEntry dir_entry(path, DirEntry::LogOnError::yes); + if (!dir_entry.exists()) { +- return tl::unexpected(Statistic::bad_input_file); ++ if (ctx.config.direct_mode()) { ++ LOG("Include file {} does not exist, disabling direct mode", ++ dir_entry.path()); ++ ctx.config.set_direct_mode(false); ++ } ++ return {}; + } + if (dir_entry.is_directory()) { + // Ignore directory, typically $PWD. + diff --git a/dev-util/ccache/files/ccache-config-3 b/dev-util/ccache/files/ccache-config-3 index 7f604f0016ef..631d671794d8 100644 --- a/dev-util/ccache/files/ccache-config-3 +++ b/dev-util/ccache/files/ccache-config-3 @@ -11,7 +11,7 @@ # # Additional features to come; this provides a starting point -EPREFIX='' +EPREFIX='@GENTOO_PORTAGE_EPREFIX@' . "${EPREFIX}"/lib/gentoo/functions.sh 2>/dev/null || { ebegin() { echo " * $* ..."; } diff --git a/dev-util/ccache/metadata.xml b/dev-util/ccache/metadata.xml index e27519ca728a..7adfcf18b9bf 100644 --- a/dev-util/ccache/metadata.xml +++ b/dev-util/ccache/metadata.xml @@ -1,12 +1,19 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <maintainer type="project"> <email>toolchain@gentoo.org</email> <name>Gentoo Toolchain Project</name> </maintainer> + <use> + <flag name="redis">Enable Redis backend for storage via <pkg>dev-libs/hiredis</pkg></flag> + <flag name="static-c++">Avoid dynamic dependency on gcc's libstdc++.</flag> + </use> <longdescription lang="en"> ccache acts as a caching pre-processor to C/C++ compilers, improving compilation time when recompiling previously compiled source. </longdescription> + <upstream> + <remote-id type="github">ccache/ccache</remote-id> + </upstream> </pkgmetadata> |