summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-util/ccache/Manifest2
-rw-r--r--dev-util/ccache/ccache-4.10.2.ebuild139
2 files changed, 141 insertions, 0 deletions
diff --git a/dev-util/ccache/Manifest b/dev-util/ccache/Manifest
index 3b73146a5785..415ffb7cd3b7 100644
--- a/dev-util/ccache/Manifest
+++ b/dev-util/ccache/Manifest
@@ -1,6 +1,8 @@
DIST ccache-4.10-docs.tar.xz 82900 BLAKE2B 0d0ef988bb21bc05642c2d5ea42bdf9c87c190464d3bddc08a8bf281b003670a50a07a88bf31731a781d5454be09b87168bc8df3b239b93f4e3d3e3f667e9094 SHA512 c1030e76dea6eaeed5548dda80a766bb9c944f8e1223157eb7a227f08f80f48a8fece4e1a99beced4c6075b40ec7de3df662111c95f9390624f6e9a3b04c1083
DIST ccache-4.10.1.tar.xz 485228 BLAKE2B 875914cf89bd696e240e93bb8146339b60a96ec5584b9908578abffe1d8f1b5604907e34a578916d291186fb742907b3d5d75f7a0e9775822ffd206358d44535 SHA512 98ad98ddc2d05d5779e507190df838317b41bc9b196aa20a43bba21700712b671c581ce7379094625dc6411e720cc7f5cb03d4d3b1df925cb5ce614363dea373
DIST ccache-4.10.1.tar.xz.asc 833 BLAKE2B 0d072b247a09e3823636f69bec81031f2ab02ee6aaf545b7dfd71d39b66c60d47e80bf01e0b53ef674234044c724f2b8fd05698f4166fe4ac76bbf915b9a7089 SHA512 aaf008593cfb26050a6548421249f60a74ecc98b65140a18304a162d9d2d754742e4a35a0aa216a5d12fdac435dc530808b70c6916c1a20c0d7dd25eaf7d4988
+DIST ccache-4.10.2.tar.xz 485460 BLAKE2B 7352b8b48ed889e1f251ae59cb7cd9d01d7d3226b58a7823be176907dc074ff22ca5d6a271e2caede7d97a65457b9067b48e9d39ab833bf45fb055eb3bfe7607 SHA512 3815c71d7266c32839acb306763268018acc58b3bbbd9ec79fc101e4217c1720d2ad2f01645bf69168c1c61d27700b6f3bb755cfa82689cca69824f015653f3c
+DIST ccache-4.10.2.tar.xz.asc 833 BLAKE2B 4a975aa1e8c9c12cf4df60b31cea10023e8e8efb561608dd652ecef2a0e575b41c5f6cfc551b0f3bd860e3b4a59061fcf870a67f5625f6a82cab104045ac2e57 SHA512 4afcc08563f0dfc8ccfd0797ea2cc26227b253415b9b9fe8ed90ef47e5b8d1dbcb8cbdd17ebf95acd6a367260f6a405764d0d0c5432cfbe2dce4d098b2a7a1b9
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
diff --git a/dev-util/ccache/ccache-4.10.2.ebuild b/dev-util/ccache/ccache-4.10.2.ebuild
new file mode 100644
index 000000000000..f50d51039e24
--- /dev/null
+++ b/dev-util/ccache/ccache-4.10.2.ebuild
@@ -0,0 +1,139 @@
+# 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 ~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 )"
+
+# TODO: package NonstdSpan, TlExpected
+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
+)
+
+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
+}