Update to 4.9.1

Use SPDX license, and license for bundled libraries
Unbundle libraries
Add bundled provides
This commit is contained in:
Orion Poplawski 2024-02-05 09:42:45 -07:00
parent c300ebc9d5
commit bd1676367f
4 changed files with 215 additions and 6 deletions

2
.gitignore vendored
View File

@ -21,3 +21,5 @@
/ccache-4.8.tar.gz
/ccache-4.8.2.tar.gz
/ccache-4.8.3.tar.gz
/ccache-4.9.tar.gz
/ccache-4.9.1.tar.gz

182
ccache-unbundle.patch Normal file
View File

@ -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 <unistd.h>
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)

View File

@ -12,27 +12,43 @@
%global relccache %(%abs2rel %{_bindir}/ccache %{_libdir}/ccache)
Name: ccache
Version: 4.8.3
Release: 3%{?dist}
Version: 4.9.1
Release: 1%{?dist}
Summary: C/C++ compiler cache
License: GPLv3+
# 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
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
# Uses a patched version and is missing on i686 in Fedora
#BuildRequires: blake3-devel
BuildRequires: cpp-httplib-devel
BuildRequires: doctest-devel
BuildRequires: expected-devel
BuildRequires: fmt-devel
BuildRequires: hiredis-devel
BuildRequires: libzstd-devel
BuildRequires: perl perl(File::Spec)
BuildRequires: xxhash-devel
# clang for additional tests
BuildRequires: clang clang-tools-extra
# coreutils for triggerin, triggerpostun
Requires: coreutils
# For groupadd
Requires(pre): shadow-utils
Provides: bundled(blake3) = 1.5.0
Provides: bundled(span-lite) = 0.10.3
Provides: bundled(cxxurl)
%description
ccache is a compiler cache. It speeds up recompilation of C/C++ code
@ -43,6 +59,11 @@ being done again. The main focus is to handle the GNU C/C++ compiler
%prep
%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' \
@ -56,8 +77,6 @@ sed -e 's|@LIBDIR@|%{_libdir}|g' -e 's|@CACHEDIR@|%{_var}/cache/ccache|g' \
%install
rm -rf $RPM_BUILD_ROOT
%cmake_install
install -Dpm 644 %{__cmake_builddir}/doc/ccache.1 $RPM_BUILD_ROOT%{_mandir}/man1/ccache.1
@ -217,6 +236,12 @@ getent group ccache >/dev/null || groupadd -r ccache || :
%changelog
* Tue Feb 06 2024 Orion Poplawski <orion@nwra.com> - 4.9.1-1
- Update to 4.9.1
- Unbundle some libraries
- Use SPDX license
- Add licenses for bundled code
* Tue Jan 23 2024 Fedora Release Engineering <releng@fedoraproject.org> - 4.8.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (ccache-4.8.3.tar.gz) = 65c870c25dff1a88c92b99e697312fcc2d61f6718fc1f20203ac2bc16975ff376d943bdb4462716a5b2d84081502fb18a93caac7739f75f37f3acc66fa468498
SHA512 (ccache-4.9.1.tar.gz) = 0945d46aaa8f76098356bed0a1258d1c8b19564247acc34ca3d71e0bd12e7edf095ad43e23c7459c8174be8ca6569c671da09a864edc57b77113bc1d5602cd28