From 15139620f32cd384361481e5dc2b6999f5f63a6d Mon Sep 17 00:00:00 2001 From: Martin Gieseking Date: Sat, 15 May 2021 15:41:09 +0200 Subject: [PATCH] updated to vesrion 1.1.9 --- .gitignore | 1 + snappy-gtest.patch | 12 ----------- snappy-inline.patch | 12 +++++++++++ snappy-thirdparty.patch | 48 +++++++++++++++++++++++++++++++++++++++++ snappy.spec | 24 ++++++++++++++------- sources | 2 +- 6 files changed, 78 insertions(+), 21 deletions(-) delete mode 100644 snappy-gtest.patch create mode 100644 snappy-inline.patch create mode 100644 snappy-thirdparty.patch diff --git a/.gitignore b/.gitignore index 8eb997f..ab9d4fe 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /snappy-1.1.4.tar.gz /snappy-1.1.7.tar.gz /snappy-1.1.8.tar.gz +/snappy-1.1.9.tar.gz diff --git a/snappy-gtest.patch b/snappy-gtest.patch deleted file mode 100644 index c553fc3..0000000 --- a/snappy-gtest.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -212,7 +212,7 @@ - "snappy-test.cc" - ) - target_compile_definitions(snappy_unittest PRIVATE -DHAVE_CONFIG_H) -- target_link_libraries(snappy_unittest snappy ${GFLAGS_LIBRARIES}) -+ target_link_libraries(snappy_unittest snappy ${GTEST_LIBRARIES} ${GFLAGS_LIBRARIES}) - - if(HAVE_LIBZ) - target_link_libraries(snappy_unittest z) diff --git a/snappy-inline.patch b/snappy-inline.patch new file mode 100644 index 0000000..46ed425 --- /dev/null +++ b/snappy-inline.patch @@ -0,0 +1,12 @@ +diff -r fd16c2ca3237 snappy.cc +--- a/snappy.cc Sat May 15 15:06:59 2021 +0200 ++++ b/snappy.cc Sat May 15 15:07:31 2021 +0200 +@@ -1014,7 +1014,7 @@ + } + + SNAPPY_ATTRIBUTE_ALWAYS_INLINE +-size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { ++inline size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { + const uint8_t*& ip = *ip_p; + // This section is crucial for the throughput of the decompression loop. + // The latency of an iteration is fundamentally constrained by the diff --git a/snappy-thirdparty.patch b/snappy-thirdparty.patch new file mode 100644 index 0000000..894fbe9 --- /dev/null +++ b/snappy-thirdparty.patch @@ -0,0 +1,48 @@ +diff -r efdeda5cdfa2 CMakeLists.txt +--- a/CMakeLists.txt Sat May 15 14:50:17 2021 +0200 ++++ b/CMakeLists.txt Sat May 15 14:54:41 2021 +0200 +@@ -284,29 +284,12 @@ + if(SNAPPY_BUILD_TESTS) + enable_testing() + +- # Prevent overriding the parent project's compiler/linker settings on Windows. +- set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +- set(install_gtest OFF) +- set(install_gmock OFF) +- set(build_gmock ON) +- +- # This project is tested using GoogleTest. +- add_subdirectory("third_party/googletest") +- +- # GoogleTest triggers a missing field initializers warning. +- if(SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS) +- set_property(TARGET gtest +- APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers) +- set_property(TARGET gmock +- APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers) +- endif(SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS) +- + add_executable(snappy_unittest "") + target_sources(snappy_unittest + PRIVATE + "snappy_unittest.cc" + ) +- target_link_libraries(snappy_unittest snappy_test_support gmock_main gtest) ++ target_link_libraries(snappy_unittest snappy_test_support gtest_main gtest) + + add_test( + NAME snappy_unittest +@@ -327,12 +310,11 @@ + PRIVATE + "snappy_benchmark.cc" + ) +- target_link_libraries(snappy_benchmark snappy_test_support benchmark_main) ++ target_link_libraries(snappy_benchmark snappy_test_support benchmark_main benchmark) + + # This project uses Google benchmark for benchmarking. + set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE) + set(BENCHMARK_ENABLE_EXCEPTIONS OFF CACHE BOOL "" FORCE) +- add_subdirectory("third_party/benchmark") + endif(SNAPPY_BUILD_BENCHMARKS) + + if(SNAPPY_FUZZING_BUILD) diff --git a/snappy.spec b/snappy.spec index 3503341..15ee494 100644 --- a/snappy.spec +++ b/snappy.spec @@ -1,19 +1,23 @@ %global __cmake_in_source_build 1 Name: snappy -Version: 1.1.8 -Release: 5%{?dist} +Version: 1.1.9 +Release: 1%{?dist} Summary: Fast compression and decompression library License: BSD URL: https://github.com/google/snappy Source0: https://github.com/google/snappy/releases/download/%{version}/%{name}-%{version}.tar.gz -# add missing dependency on gtest to snappy_unittest -Patch0: %{name}-gtest.patch +# Remove dependency on bundled gtest and google-benchmark. +Patch0: %{name}-thirdparty.patch -BuildRequires: make +# Prevent compiler error due to missing 'inline'. +Patch1: %{name}-inline.patch + +BuildRequires: make BuildRequires: cmake BuildRequires: gcc-c++ +BuildRequires: google-benchmark-devel BuildRequires: gtest-devel %description @@ -37,8 +41,8 @@ developing applications that use %{name}. %prep -%setup -q -%patch0 -p1 +%autosetup + %build %cmake . @@ -75,7 +79,8 @@ ctest -V %{?_smp_mflags} %files -%doc AUTHORS COPYING NEWS README.md +%license COPYING +%doc AUTHORS NEWS README.md %{_libdir}/libsnappy.so.* %files devel @@ -87,6 +92,9 @@ ctest -V %{?_smp_mflags} %changelog +* Sat May 15 2021 Martin Gieseking - 1.1.9-1 +- Updated to new release. + * Wed Jan 27 2021 Fedora Release Engineering - 1.1.8-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/sources b/sources index 39ac64a..37f768d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (snappy-1.1.8.tar.gz) = efe18ff1b3edda1b4b6cefcbc6da8119c05d63afdbf7a784f3490353c74dced76baed7b5f1aa34b99899729192b9d657c33c76de4b507a51553fa8001ae75c1c +SHA512 (snappy-1.1.9.tar.gz) = f1f8a90f5f7f23310423574b1d8c9acb84c66ea620f3999d1060395205e5760883476837aba02f0aa913af60819e34c625d8308c18a5d7a9c4e190f35968b024