diff options
author | Azamat H. Hackimov <azamat.hackimov@gmail.com> | 2024-04-11 10:37:20 +0300 |
---|---|---|
committer | Yixun Lan <dlan@gentoo.org> | 2024-04-11 21:43:46 +0000 |
commit | c0d78de715336d80f4a759dd0c7ca60ed7e2a5cf (patch) | |
tree | c7a41d03a3afeecbc0c24c7ef9c0fb0bb8efecd7 /app-arch | |
parent | app-arch/snappy: drop 1.1.9-r1 (diff) | |
download | gentoo-c0d78de715336d80f4a759dd0c7ca60ed7e2a5cf.tar.gz gentoo-c0d78de715336d80f4a759dd0c7ca60ed7e2a5cf.tar.bz2 gentoo-c0d78de715336d80f4a759dd0c7ca60ed7e2a5cf.zip |
app-arch/snappy: add 1.2.0
Closes: https://github.com/gentoo/gentoo/pull/36205
Signed-off-by: Azamat H. Hackimov <azamat.hackimov@gmail.com>
Signed-off-by: Yixun Lan <dlan@gentoo.org>
Diffstat (limited to 'app-arch')
-rw-r--r-- | app-arch/snappy/Manifest | 1 | ||||
-rw-r--r-- | app-arch/snappy/files/snappy-1.2.0_external-gtest.patch | 46 | ||||
-rw-r--r-- | app-arch/snappy/files/snappy-1.2.0_no-werror.patch | 24 | ||||
-rw-r--r-- | app-arch/snappy/files/snappy-1.2.0_remove-no-rtti.patch | 32 | ||||
-rw-r--r-- | app-arch/snappy/snappy-1.2.0.ebuild | 49 |
5 files changed, 152 insertions, 0 deletions
diff --git a/app-arch/snappy/Manifest b/app-arch/snappy/Manifest index 24675ae6e384..284181c5cc40 100644 --- a/app-arch/snappy/Manifest +++ b/app-arch/snappy/Manifest @@ -1 +1,2 @@ DIST snappy-1.1.10.tar.gz 1105312 BLAKE2B 5195335fb1883974d290e7dca2b6d928bde2b183f3f61bca9da28855b39fd9a4ee1c24014322d238d2ec94f3a3a55fd43110c88283e85865272226e11cbb4834 SHA512 3578597f1d4ec09104ce0296b825b013590351230dfe56c635081fd282ce7a13a34caf2c283ac77bd24065e2d27af6db068d1f84b98cec2fd39a0e37a0d77070 +DIST snappy-1.2.0.tar.gz 1107265 BLAKE2B 327b60ea032ceb004c5f5e36a0013dc2a44258ec303d0701cf23446904b83e72a66b7e59866a7331c7751a08ce6ec6b871bc056efa6eeb86733d4640569d8072 SHA512 5b3b4e73ff24295885ff9f3d75ccb090e6c7dba40d4965f0892163aa9876296e61590d62023a32d750949268af8ce89df93273b02179d5b3a55de00966a3ae0a diff --git a/app-arch/snappy/files/snappy-1.2.0_external-gtest.patch b/app-arch/snappy/files/snappy-1.2.0_external-gtest.patch new file mode 100644 index 000000000000..6d929821ba0b --- /dev/null +++ b/app-arch/snappy/files/snappy-1.2.0_external-gtest.patch @@ -0,0 +1,46 @@ +From 4e6c67832f53b126d1e54b9398b88f23e75846f3 Mon Sep 17 00:00:00 2001 +From: "Azamat H. Hackimov" <azamat.hackimov@gmail.com> +Date: Thu, 11 Apr 2024 10:05:30 +0300 +Subject: [PATCH 1/3] Use external GTest suite + +--- + CMakeLists.txt | 22 ++-------------------- + 1 file changed, 2 insertions(+), 20 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 85afe58..e23d2ca 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -319,27 +319,9 @@ endif(SNAPPY_BUILD_TESTS OR SNAPPY_BUILD_BENCHMARKS) + 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) +- +- if(SNAPPY_HAVE_NO_IMPLICIT_INT_FLOAT_CONVERSION) +- set_property(TARGET gtest +- APPEND PROPERTY COMPILE_OPTIONS -Wno-implicit-int-float-conversion) +- endif(SNAPPY_HAVE_NO_IMPLICIT_INT_FLOAT_CONVERSION) ++ find_package(GTest REQUIRED) ++ include(GoogleTest) + + add_executable(snappy_unittest "") + target_sources(snappy_unittest +-- +2.43.2 + diff --git a/app-arch/snappy/files/snappy-1.2.0_no-werror.patch b/app-arch/snappy/files/snappy-1.2.0_no-werror.patch new file mode 100644 index 000000000000..813ff7a59136 --- /dev/null +++ b/app-arch/snappy/files/snappy-1.2.0_no-werror.patch @@ -0,0 +1,24 @@ +From 8a262c4de10c4a7e07db41779fd7ca1565d92631 Mon Sep 17 00:00:00 2001 +From: "Azamat H. Hackimov" <azamat.hackimov@gmail.com> +Date: Thu, 11 Apr 2024 10:06:47 +0300 +Subject: [PATCH 2/3] Don't use -Werror + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -66,13 +66,6 @@ else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") + endif(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra") + +- # Use -Werror for clang only. +- if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- if(NOT CMAKE_CXX_FLAGS MATCHES "-Werror") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") +- endif(NOT CMAKE_CXX_FLAGS MATCHES "-Werror") +- endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- + # Disable sign comparison warnings. Matches upcoming Bazel setup. + if(NOT CMAKE_CXX_FLAGS MATCHES "-Wno-sign-compare") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-compare") +-- +2.43.2 + diff --git a/app-arch/snappy/files/snappy-1.2.0_remove-no-rtti.patch b/app-arch/snappy/files/snappy-1.2.0_remove-no-rtti.patch new file mode 100644 index 000000000000..dcfeae45cfbb --- /dev/null +++ b/app-arch/snappy/files/snappy-1.2.0_remove-no-rtti.patch @@ -0,0 +1,32 @@ +From 012ff3ef652027abd1a422268cf9f164b386f340 Mon Sep 17 00:00:00 2001 +From: "Azamat H. Hackimov" <azamat.hackimov@gmail.com> +Date: Thu, 11 Apr 2024 10:07:45 +0300 +Subject: [PATCH 3/3] Don't disable RTTI + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -51,10 +51,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + string(REGEX REPLACE "/EH[a-z]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHs-c-") + add_definitions(-D_HAS_EXCEPTIONS=0) +- +- # Disable RTTI. +- string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") + else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Use -Wall for clang and gcc. + if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall") +@@ -88,10 +84,6 @@ else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Disable C++ exceptions. + string(REGEX REPLACE "-fexceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") +- +- # Disable RTTI. +- string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") + endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + + # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make +-- +2.43.2 + diff --git a/app-arch/snappy/snappy-1.2.0.ebuild b/app-arch/snappy/snappy-1.2.0.ebuild new file mode 100644 index 000000000000..c1a06ba97416 --- /dev/null +++ b/app-arch/snappy/snappy-1.2.0.ebuild @@ -0,0 +1,49 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake-multilib + +DESCRIPTION="A high-speed compression/decompression library by Google" +HOMEPAGE="https://github.com/google/snappy" +SRC_URI="https://github.com/google/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +# ${PV%%.*}.FUDGE where FUDGE is incremented if ABI is broken without a new SONAME +# Please use abidiff on bumps. +SLOT="0/${PV%%.*}.1" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos" +IUSE="cpu_flags_x86_avx cpu_flags_x86_avx2 test" +RESTRICT="!test? ( test )" + +DEPEND="test? ( dev-cpp/gtest )" + +DOCS=( format_description.txt framing_format.txt NEWS README.md ) + +PATCHES=( + "${FILESDIR}/${PN}-1.2.0_external-gtest.patch" + "${FILESDIR}/${PN}-1.2.0_no-werror.patch" + "${FILESDIR}/${PN}-1.2.0_remove-no-rtti.patch" +) + +multilib_src_configure() { + local mycmakeargs=( + -DCMAKE_CXX_STANDARD=14 # Latest gtest needs -std=c++14 or newer + -DSNAPPY_BUILD_TESTS=$(usex test) + -DSNAPPY_REQUIRE_AVX=$(usex cpu_flags_x86_avx) + -DSNAPPY_REQUIRE_AVX2=$(usex cpu_flags_x86_avx2) + -DSNAPPY_BUILD_BENCHMARKS=OFF + # Options below are related to benchmarking, that we disable. + -DHAVE_LIBZ=NO + -DHAVE_LIBLZO2=NO + -DHAVE_LIBLZ4=NO + ) + cmake_src_configure +} + +multilib_src_test() { + # run tests directly to get verbose output + cd "${S}" || die + "${BUILD_DIR}"/snappy_unittest || die +} |