diff options
author | Sam James <sam@gentoo.org> | 2024-05-31 19:45:57 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-05-31 19:45:57 +0100 |
commit | 0862af03fc9715f548e1332b40664432aeea616d (patch) | |
tree | 04510d9b4eebde046d5ee624bc71deab41b71729 /dev-util/ccache | |
parent | dev-lang/python: skip known failing tests on musl (diff) | |
download | gentoo-0862af03fc9715f548e1332b40664432aeea616d.tar.gz gentoo-0862af03fc9715f548e1332b40664432aeea616d.tar.bz2 gentoo-0862af03fc9715f548e1332b40664432aeea616d.zip |
dev-util/ccache: unbundle blake3 too
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util/ccache')
-rw-r--r-- | dev-util/ccache/ccache-4.10-r1.ebuild (renamed from dev-util/ccache/ccache-4.10.ebuild) | 5 | ||||
-rw-r--r-- | dev-util/ccache/files/ccache-4.10-blake3.patch | 79 |
2 files changed, 82 insertions, 2 deletions
diff --git a/dev-util/ccache/ccache-4.10.ebuild b/dev-util/ccache/ccache-4.10-r1.ebuild index cf2714cb487b..a52907e3e3e0 100644 --- a/dev-util/ccache/ccache-4.10.ebuild +++ b/dev-util/ccache/ccache-4.10-r1.ebuild @@ -34,17 +34,17 @@ fi 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 ~sparc ~x86" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~m68k ~mips ~riscv ~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: figure out why blake3 can't be found # 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:= ) @@ -75,6 +75,7 @@ PATCHES=( "${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() { 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> + |