summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-arch/snappy')
-rw-r--r--app-arch/snappy/Manifest3
-rw-r--r--app-arch/snappy/files/snappy-1.1.7-0001-cmake-Add-missing-linking-to-GTEST_LIBRARIES.patch30
-rw-r--r--app-arch/snappy/files/snappy-1.1.9-clang-werror.patch16
-rw-r--r--app-arch/snappy/files/snappy-1.1.9_external_gtest.patch34
-rw-r--r--app-arch/snappy/files/snappy-1.1.9_remove-no-rtti.patch35
-rw-r--r--app-arch/snappy/files/snappy-1.2.0_external-gtest.patch46
-rw-r--r--app-arch/snappy/files/snappy-1.2.0_no-werror.patch24
-rw-r--r--app-arch/snappy/files/snappy-1.2.0_remove-no-rtti.patch32
-rw-r--r--app-arch/snappy/metadata.xml21
-rw-r--r--app-arch/snappy/snappy-1.1.10-r1.ebuild49
-rw-r--r--app-arch/snappy/snappy-1.1.8.ebuild64
-rw-r--r--app-arch/snappy/snappy-1.2.0-r1.ebuild49
12 files changed, 300 insertions, 103 deletions
diff --git a/app-arch/snappy/Manifest b/app-arch/snappy/Manifest
index 0995e291b707..284181c5cc40 100644
--- a/app-arch/snappy/Manifest
+++ b/app-arch/snappy/Manifest
@@ -1 +1,2 @@
-DIST snappy-1.1.8.tar.gz 1096137 BLAKE2B e21f2ea23727f118920b7f67981354194f12d1d61eaa18eb1cb2f4285fabafdd221b88cf1e3b3261634f65469a714d3efe6b218c0b1e9d41639cdeb21097d75e SHA512 efe18ff1b3edda1b4b6cefcbc6da8119c05d63afdbf7a784f3490353c74dced76baed7b5f1aa34b99899729192b9d657c33c76de4b507a51553fa8001ae75c1c
+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.1.7-0001-cmake-Add-missing-linking-to-GTEST_LIBRARIES.patch b/app-arch/snappy/files/snappy-1.1.7-0001-cmake-Add-missing-linking-to-GTEST_LIBRARIES.patch
deleted file mode 100644
index f4fdd4727488..000000000000
--- a/app-arch/snappy/files/snappy-1.1.7-0001-cmake-Add-missing-linking-to-GTEST_LIBRARIES.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 1c9f699a6275f085ad710c9ae940e096ce552452 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Mon, 31 Jul 2017 20:49:22 +0200
-Subject: [PATCH] cmake: Add missing linking to GTEST_LIBRARIES
-
-Since the snappy_unittest target uses gtest routines (when available),
-it needs to link to gtest explicitly. Otherwise, the build fails due
-to unavailable gtest symbols.
----
- CMakeLists.txt | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 3f534b1..3a44aa9 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -119,6 +119,9 @@ if(SNAPPY_BUILD_TESTS)
- )
- target_compile_definitions(snappy_unittest PRIVATE -DHAVE_CONFIG_H)
-- target_link_libraries(snappy_unittest snappy ${GFLAGS_LIBRARIES})
-+ target_link_libraries(snappy_unittest
-+ snappy
-+ ${GFLAGS_LIBRARIES}
-+ ${GTEST_LIBRARIES})
-
- if(HAVE_LIBZ)
- target_link_libraries(snappy_unittest z)
---
-2.14.1
-
diff --git a/app-arch/snappy/files/snappy-1.1.9-clang-werror.patch b/app-arch/snappy/files/snappy-1.1.9-clang-werror.patch
new file mode 100644
index 000000000000..e89a8305e731
--- /dev/null
+++ b/app-arch/snappy/files/snappy-1.1.9-clang-werror.patch
@@ -0,0 +1,16 @@
+--- 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 C++ exceptions.
+ string(REGEX REPLACE "-fexceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
diff --git a/app-arch/snappy/files/snappy-1.1.9_external_gtest.patch b/app-arch/snappy/files/snappy-1.1.9_external_gtest.patch
new file mode 100644
index 000000000000..8aa4c1eabd22
--- /dev/null
+++ b/app-arch/snappy/files/snappy-1.1.9_external_gtest.patch
@@ -0,0 +1,34 @@
+From 9c1283f6022647a6ea39c1388321d6029fcdf80c Mon Sep 17 00:00:00 2001
+From: "Azamat H. Hackimov" <azamat.hackimov@gmail.com>
+Date: Wed, 5 May 2021 21:19:22 +0300
+Subject: [PATCH] Use external GTest framework
+
+---
+ CMakeLists.txt | 11 ++---------
+ 1 file changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 672561e..fc830fe 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -291,15 +291,8 @@ if(SNAPPY_BUILD_TESTS)
+ 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)
++ find_package(GTest REQUIRED)
++ include(GoogleTest)
+
+ add_executable(snappy_unittest "")
+ target_sources(snappy_unittest
+--
+2.26.3
+
diff --git a/app-arch/snappy/files/snappy-1.1.9_remove-no-rtti.patch b/app-arch/snappy/files/snappy-1.1.9_remove-no-rtti.patch
new file mode 100644
index 000000000000..16528b59457c
--- /dev/null
+++ b/app-arch/snappy/files/snappy-1.1.9_remove-no-rtti.patch
@@ -0,0 +1,35 @@
+From 516fdcca6606502e2d562d20c01b225c8d066739 Mon Sep 17 00:00:00 2001
+From: holmes1412 <liyingxin1412@gmail.com>
+Date: Fri, 28 May 2021 21:46:53 +0800
+Subject: [PATCH] remove Disable-RTTI flags for the convenient of derivation
+
+---
+ CMakeLists.txt | 8 --------
+ 1 file changed, 8 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 672561e..31afaa0 100644
+--- 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")
+@@ -76,10 +72,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
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/metadata.xml b/app-arch/snappy/metadata.xml
index e5215ea6cd04..f228393d37be 100644
--- a/app-arch/snappy/metadata.xml
+++ b/app-arch/snappy/metadata.xml
@@ -1,15 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <maintainer type='person'>
- <email>mgorny@gentoo.org</email>
- <name>Michał Górny</name>
+ <maintainer type="person" proxied="yes">
+ <email>azamat.hackimov@gmail.com</email>
+ <name>Azamat H. Hackimov</name>
</maintainer>
- <longdescription lang="en">Snappy is a compression/decompression library. It does not aim for
- maximum compression, or compatibility with any other compression
- library; instead, it aims for very high speeds and reasonable
- compression.</longdescription>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription lang="en">Snappy is a compression/decompression library.
+ It does not aim for maximum compression, or compatibility with any
+ other compression library; instead, it aims for very high speeds and
+ reasonable compression.</longdescription>
<upstream>
+ <remote-id type="cpe">cpe:/a:google:snappy</remote-id>
<remote-id type="github">google/snappy</remote-id>
</upstream>
</pkgmetadata>
diff --git a/app-arch/snappy/snappy-1.1.10-r1.ebuild b/app-arch/snappy/snappy-1.1.10-r1.ebuild
new file mode 100644
index 000000000000..83cd13e6ac21
--- /dev/null
+++ b/app-arch/snappy/snappy-1.1.10-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2023 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.1.9_external_gtest.patch"
+ "${FILESDIR}/${PN}-1.1.9-clang-werror.patch"
+ "${FILESDIR}/${PN}-1.1.9_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
+}
diff --git a/app-arch/snappy/snappy-1.1.8.ebuild b/app-arch/snappy/snappy-1.1.8.ebuild
deleted file mode 100644
index bb233447d5e7..000000000000
--- a/app-arch/snappy/snappy-1.1.8.ebuild
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-CMAKE_ECLASS=cmake
-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"
-SLOT="0/${PV%%.*}"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 s390 ~sparc x86 ~amd64-linux ~x86-linux"
-IUSE="test"
-RESTRICT="!test? ( test )"
-
-# all test dependencies are optional:
-# - gflags-2.2 is supposedly needed for command-line option parsing
-# but it's a huge hack and does not work,
-# - gtest probably gives nicer output,
-# - compression libraries are used for benchmarks which we do not run.
-DEPEND="test? ( dev-cpp/gtest )"
-
-# AUTHORS is useless, ChangeLog is stale
-DOCS=( format_description.txt framing_format.txt NEWS README.md )
-
-src_prepare() {
- local PATCHES=(
- "${FILESDIR}"/snappy-1.1.7-0001-cmake-Add-missing-linking-to-GTEST_LIBRARIES.patch
- )
-
- # command-line option parsing does not work at all, so just force
- # it off
- sed -i -e '/run_microbenchmarks/s:true:false:' snappy-test.cc || die
-
- cmake_src_prepare
-}
-
-multilib_src_configure() {
- # TODO: would be nice to make unittest build conditional
- # but it is not a priority right now
- local mycmakeargs=(
- -DBUILD_SHARED_LIBS=ON
-
- # use gtest for tests only
- -DCMAKE_DISABLE_FIND_PACKAGE_GTest=$(usex '!test')
- # gflags does not work anyway
- -DCMAKE_DISABLE_FIND_PACKAGE_Gflags=ON
-
- # we do not want to run benchmarks, and those are only used
- # for benchmarks
- -DHAVE_LIBZ=NO
- -DHAVE_LIBLZO2=NO
- )
- cmake_src_configure
-}
-
-multilib_src_test() {
- # run tests directly to get verbose output
- cd "${S}" || die
- "${BUILD_DIR}"/snappy_unittest || die
-}
diff --git a/app-arch/snappy/snappy-1.2.0-r1.ebuild b/app-arch/snappy/snappy-1.2.0-r1.ebuild
new file mode 100644
index 000000000000..a2331f1ef08a
--- /dev/null
+++ b/app-arch/snappy/snappy-1.2.0-r1.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%%.*}.2"
+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
+}