diff --git a/.gitignore b/.gitignore index b0b7403..be4f5f7 100644 --- a/.gitignore +++ b/.gitignore @@ -23,11 +23,3 @@ /ccache-4.8.3.tar.gz /ccache-4.9.tar.gz /ccache-4.9.1.tar.gz -/ccache-4.10.tar.gz -/ccache-4.10.1.tar.gz -/ccache-4.10.2.tar.gz -/ccache-4.11.1.tar.gz -/ccache-4.11.2.tar.gz -/ccache-4.11.3.tar.gz -/ccache-4.12.1.tar.gz -/ccache-4.12.2.tar.gz diff --git a/ccache-unbundle.patch b/ccache-unbundle.patch new file mode 100644 index 0000000..3c85c02 --- /dev/null +++ b/ccache-unbundle.patch @@ -0,0 +1,182 @@ +diff -up ccache-4.9.1/CMakeLists.txt.unbundle ccache-4.9.1/CMakeLists.txt +--- ccache-4.9.1/CMakeLists.txt.unbundle 2024-02-05 12:29:52.000000000 -0700 ++++ ccache-4.9.1/CMakeLists.txt 2024-02-08 08:24:25.196673454 -0700 +@@ -86,6 +86,10 @@ include(GenerateVersionFile) + # Third party + # + ++find_package(PkgConfig REQUIRED) ++ ++pkg_check_modules(xxhash REQUIRED IMPORTED_TARGET libxxhash) ++ + set(ZSTD_FROM_INTERNET AUTO CACHE STRING "Download and use libzstd from the Internet") + set_property(CACHE ZSTD_FROM_INTERNET PROPERTY STRINGS AUTO ON OFF) + +diff -up ccache-4.9.1/src/CMakeLists.txt.unbundle ccache-4.9.1/src/CMakeLists.txt +--- ccache-4.9.1/src/CMakeLists.txt.unbundle 2024-02-05 12:29:52.000000000 -0700 ++++ ccache-4.9.1/src/CMakeLists.txt 2024-02-08 08:27:10.324913588 -0700 +@@ -14,6 +14,7 @@ set( + hashutil.cpp + language.cpp + version.cpp ++ third_party/url.cpp + ) + + if(INODE_CACHE_SUPPORTED) +@@ -45,10 +46,11 @@ if(CCACHE_EXTRA_LIBS) + endif() + + set(THREADS_PREFER_PTHREAD_FLAG ON) ++find_package(fmt REQUIRED) + find_package(Threads REQUIRED) + target_link_libraries( + ccache_framework +- PRIVATE standard_settings standard_warnings ZSTD::ZSTD Threads::Threads third_party ++ PRIVATE standard_settings standard_warnings blake3 fmt::fmt ZSTD::ZSTD Threads::Threads PkgConfig::xxhash + ) + + target_include_directories(ccache_framework PUBLIC ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) +@@ -57,7 +59,7 @@ if(REDIS_STORAGE_BACKEND) + target_compile_definitions(ccache_framework PUBLIC -DHAVE_REDIS_STORAGE_BACKEND) + target_link_libraries( + ccache_framework +- PUBLIC standard_settings standard_warnings HIREDIS::HIREDIS third_party ++ PUBLIC standard_settings standard_warnings HIREDIS::HIREDIS + ) + endif() + +diff -up ccache-4.9.1/src/hashutil.cpp.unbundle ccache-4.9.1/src/hashutil.cpp +--- ccache-4.9.1/src/hashutil.cpp.unbundle 2024-02-05 12:29:52.000000000 -0700 ++++ ccache-4.9.1/src/hashutil.cpp 2024-02-08 08:24:25.200673484 -0700 +@@ -37,7 +37,9 @@ + # include "InodeCache.hpp" + #endif + +-#include "third_party/blake3/blake3_cpu_supports_avx2.h" ++#ifdef HAVE_AVX2 ++# include "third_party/blake3/blake3_cpu_supports_avx2.h" ++#endif + + #ifdef HAVE_UNISTD_H + # include +diff -up ccache-4.9.1/src/third_party/CMakeLists.txt.unbundle ccache-4.9.1/src/third_party/CMakeLists.txt +--- ccache-4.9.1/src/third_party/CMakeLists.txt.unbundle 2024-02-05 12:29:52.000000000 -0700 ++++ ccache-4.9.1/src/third_party/CMakeLists.txt 2024-02-08 08:26:04.233417232 -0700 +@@ -1,58 +1,59 @@ +-add_library(third_party STATIC format.cpp httplib.cpp url.cpp xxhash.c) +-if(NOT MSVC) +- target_sources(third_party PRIVATE getopt_long.c) +-else() +- target_sources(third_party PRIVATE win32/getopt.c) +- target_compile_definitions(third_party PUBLIC -DSTATIC_GETOPT) +-endif() ++if(0) ++ add_library(third_party STATIC format.cpp httplib.cpp url.cpp xxhash.c) ++ if(NOT MSVC) ++ target_sources(third_party PRIVATE getopt_long.c) ++ else() ++ target_sources(third_party PRIVATE win32/getopt.c) ++ target_compile_definitions(third_party PUBLIC -DSTATIC_GETOPT) ++ endif() ++ file(GLOB headers *.h fmt/*.h nonstd/*.hpp) ++ target_sources(third_party PRIVATE ${headers}) ++ ++ set(xxhdispatchtest [=[ ++ #include "xxh_x86dispatch.c" ++ ++ int main() ++ { ++ XXH3_64bits_dispatch("foo", 3); ++ return 1; ++ } ++ ]=]) ++ ++ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/xxhdispatchtest.c" "${xxhdispatchtest}") ++ ++ try_compile(USE_XXH_DISPATCH ${CMAKE_CURRENT_BINARY_DIR} ++ "${CMAKE_CURRENT_BINARY_DIR}/xxhdispatchtest.c" ++ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CMAKE_CURRENT_SOURCE_DIR}" ++ COMPILE_DEFINITIONS "-DXXH_STATIC_LINKING_ONLY") ++ ++ target_compile_definitions(third_party INTERFACE "-DXXH_STATIC_LINKING_ONLY") ++ if(USE_XXH_DISPATCH) ++ target_sources(third_party PRIVATE xxh_x86dispatch.c) ++ target_compile_definitions(third_party INTERFACE "-DUSE_XXH_DISPATCH") ++ endif() ++ ++ # Treat third party headers as system files (no warning for those headers). ++ target_include_directories( ++ third_party ++ PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} SYSTEM ++ ) ++ ++ target_link_libraries(third_party PRIVATE standard_settings) ++endif () ++ + + if(WIN32) + target_sources(third_party PRIVATE win32/mktemp.c) ++ file(GLOB headers win32/*.h) ++ target_sources(third_party PRIVATE ${headers}) ++ ++ target_link_libraries(third_party PRIVATE ws2_32) + endif () + + if(ENABLE_TRACING) + target_sources(third_party PRIVATE minitrace.c) + endif() + +-file(GLOB headers *.h fmt/*.h nonstd/*.hpp win32/*.h) +-target_sources(third_party PRIVATE ${headers}) +- +-set(xxhdispatchtest [=[ +-#include "xxh_x86dispatch.c" +- +-int main() +-{ +- XXH3_64bits_dispatch("foo", 3); +- return 1; +-} +-]=]) +- +-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/xxhdispatchtest.c" "${xxhdispatchtest}") +- +-try_compile(USE_XXH_DISPATCH ${CMAKE_CURRENT_BINARY_DIR} +- "${CMAKE_CURRENT_BINARY_DIR}/xxhdispatchtest.c" +- CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CMAKE_CURRENT_SOURCE_DIR}" +- COMPILE_DEFINITIONS "-DXXH_STATIC_LINKING_ONLY") +- +-target_compile_definitions(third_party INTERFACE "-DXXH_STATIC_LINKING_ONLY") +-if(USE_XXH_DISPATCH) +- target_sources(third_party PRIVATE xxh_x86dispatch.c) +- target_compile_definitions(third_party INTERFACE "-DUSE_XXH_DISPATCH") +-endif() +- +-# Treat third party headers as system files (no warning for those headers). +-target_include_directories( +- third_party +- PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} SYSTEM +-) +- +-target_link_libraries(third_party PRIVATE standard_settings) +-target_link_libraries(third_party INTERFACE blake3) +- +-if(WIN32) +- target_link_libraries(third_party PRIVATE ws2_32) +-endif() +- + # Silence warning from winbase.h due to /Zc:preprocessor. + if(MSVC) + target_compile_options(third_party PRIVATE /wd5105) +diff -up ccache-4.9.1/unittest/CMakeLists.txt.unbundle ccache-4.9.1/unittest/CMakeLists.txt +--- ccache-4.9.1/unittest/CMakeLists.txt.unbundle 2024-02-05 12:29:52.000000000 -0700 ++++ ccache-4.9.1/unittest/CMakeLists.txt 2024-02-08 08:24:25.196673454 -0700 +@@ -59,7 +59,7 @@ endif() + + target_link_libraries( + unittest +- PRIVATE standard_settings standard_warnings ccache_framework third_party) ++ PRIVATE standard_settings standard_warnings ccache_framework PkgConfig::xxhash) + + target_include_directories(unittest PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${ccache_SOURCE_DIR}/src) + diff --git a/ccache.spec b/ccache.spec index f8d1589..83c2a97 100644 --- a/ccache.spec +++ b/ccache.spec @@ -12,12 +12,13 @@ %global relccache %(%abs2rel %{_bindir}/ccache %{_libdir}/ccache) Name: ccache -Version: 4.12.2 +Version: 4.9.1 Release: 1%{?dist} Summary: C/C++ compiler cache # See LICENSE.adoc for licenses of bundled codes # blake3 is Apache-2.0 +# minitrace.h is MIT # span.hpp is BSL-1.0 # url.cpp/hpp is MIT License: GPL-3.0-or-later AND Apache-2.0 AND BSL-1.0 AND MIT @@ -25,6 +26,7 @@ URL: http://ccache.dev/ Source0: https://github.com/ccache/ccache/releases/download/v%{version}/%{name}-%{version}.tar.gz Source1: %{name}.sh.in Source2: %{name}.csh.in +Patch1: ccache-unbundle.patch BuildRequires: /usr/bin/asciidoctor BuildRequires: cmake @@ -43,8 +45,9 @@ BuildRequires: clang clang-tools-extra # coreutils for triggerin, triggerpostun Requires: coreutils # For groupadd -Provides: bundled(blake3) = 1.5.1 -Provides: bundled(span-lite) = 0.11.0 +Requires(pre): shadow-utils +Provides: bundled(blake3) = 1.5.0 +Provides: bundled(span-lite) = 0.10.3 Provides: bundled(cxxurl) %description @@ -55,19 +58,17 @@ being done again. The main focus is to handle the GNU C/C++ compiler %prep -%autosetup -p1 -# win32-compat gets imported, but not used -rm -r src/third_party/{[ad-lo-tvy-z]*,cpp-httplib} +%setup -q +%patch -P1 -p1 -b .unbundle +find -name \*.[hc]pp \ + -exec sed -i -E -e 's,third_party/(fmt/|httplib.h|tl/expected.hpp|xxhash.h),\1,' \ + -e 's,third_party/doctest.h,doctest/doctest.h,' {} + +rm -r src/third_party/[ac-lo-tv-z]* src/third_party/minitrace.c sed -e 's|@LIBDIR@|%{_libdir}|g' -e 's|@CACHEDIR@|%{_var}/cache/ccache|g' \ %{SOURCE1} > %{name}.sh sed -e 's|@LIBDIR@|%{_libdir}|g' -e 's|@CACHEDIR@|%{_var}/cache/ccache|g' \ %{SOURCE2} > %{name}.csh -# Create a sysusers.d config file -cat >ccache.sysusers.conf < %{name}-%{version}.compilers -install -m0644 -D ccache.sysusers.conf %{buildroot}%{_sysusersdir}/ccache.conf - -install -m0644 README.md %{buildroot}%{_pkgdocdir}/ - %check %ctest @@ -224,62 +221,21 @@ done\ %ccache_trigger -p gcc-xtensa-linux-gnu xtensa-linux-gnu-gcc %ccache_trigger -p gcc-c++-xtensa-linux-gnu xtensa-linux-gnu-c++ xtensa-linux-gnu-g++ +%pre +getent group ccache >/dev/null || groupadd -r ccache || : %files -f %{name}-%{version}.compilers %license GPL-3.0.txt LICENSE.* -%{_pkgdocdir}/ +%doc doc/AUTHORS.* doc/MANUAL.* doc/NEWS.* README.md %config(noreplace) %{_sysconfdir}/profile.d/%{name}.*sh %{_bindir}/ccache %dir %{_libdir}/ccache/ %attr(2770,root,ccache) %dir %{_var}/cache/ccache/ %{_mandir}/man1/ccache.1* -%{_sysusersdir}/ccache.conf %changelog -* Thu Nov 27 2025 Orion Poplawski - 4.12.2-1 -- Update to 4.12.2 - -* Thu Oct 02 2025 Orion Poplawski - 4.12.1-1 -- Update to 4.12.1 - -* Wed Jul 23 2025 Fedora Release Engineering - 4.11.3-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Fri May 09 2025 Orion Poplawski - 4.11.3-1 -- Update to 4.11.3 - -* Tue Mar 25 2025 Orion Poplawski - 4.11.2-1 -- Update to 4.11.2 - -* Tue Mar 18 2025 Orion Poplawski - 4.11.1-1 -- Update to 4.11.1 - -* Tue Feb 11 2025 Zbigniew Jędrzejewski-Szmek - 4.10.2-3 -- Add sysusers.d config file to allow rpm to create users/groups automatically - -* Thu Jan 16 2025 Fedora Release Engineering - 4.10.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Wed Jul 31 2024 Orion Poplawski - 4.10.2-1 -- Update to 4.10.2 - -* Fri Jul 26 2024 Kefu Chai - 4.10.1-3 -- Rebuilt for fmt 11 - -* Wed Jul 17 2024 Fedora Release Engineering - 4.10.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Fri Jul 12 2024 Orion Poplawski - 4.10.1-1 -- Update to 4.10.1 - -* Sun Jun 02 2024 Orion Poplawski - 4.10-1 -- Update to 4.10 - -* Sat May 11 2024 Kevin Fenzi - 4.9.1-2 -- rebuild for hiredis soname bump - * Tue Feb 06 2024 Orion Poplawski - 4.9.1-1 - Update to 4.9.1 - Unbundle some libraries diff --git a/sources b/sources index a73b9cd..bcee6d1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ccache-4.12.2.tar.gz) = e078a393f41660e401c3a2795fe2c2784413fe9e15313e7a996cd321e0180d5b5b89faf723a4fe3e6414ee644de198707b6bf6d0f003bdf2cd49fad0288bdf73 +SHA512 (ccache-4.9.1.tar.gz) = 0945d46aaa8f76098356bed0a1258d1c8b19564247acc34ca3d71e0bd12e7edf095ad43e23c7459c8174be8ca6569c671da09a864edc57b77113bc1d5602cd28