public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-arch/snappy/files/, app-arch/snappy/
@ 2021-06-03  9:12 Joonas Niilola
  0 siblings, 0 replies; 4+ messages in thread
From: Joonas Niilola @ 2021-06-03  9:12 UTC (permalink / raw
  To: gentoo-commits

commit:     a16aff822830ef6bd7bb40b14b5ad5853f155437
Author:     Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com>
AuthorDate: Wed May  5 18:28:17 2021 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Thu Jun  3 09:12:48 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a16aff82

app-arch/snappy: update to 1.1.9

Taking maitainership, cleanup ebuild.

Package-Manager: Portage-3.0.18, Repoman-3.0.2
Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/20692
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 app-arch/snappy/Manifest                           |  1 +
 .../snappy/files/snappy-1.1.9_external_gtest.patch | 34 +++++++++++
 .../snappy/files/snappy-1.1.9_gcc_inline.patch     | 67 ++++++++++++++++++++++
 app-arch/snappy/metadata.xml                       | 17 ++++--
 app-arch/snappy/snappy-1.1.9.ebuild                | 45 +++++++++++++++
 5 files changed, 159 insertions(+), 5 deletions(-)

diff --git a/app-arch/snappy/Manifest b/app-arch/snappy/Manifest
index 0995e291b70..6ecc06c8336 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.9.tar.gz 1102382 BLAKE2B 926d03156168e3d4800dc17144db3de2c182c6eb9970d87a00b94fb09b67e403479a64cbed75833b83fd03173c1bb8caaf248a55627e89fe2a34456f12ff3b42 SHA512 f1f8a90f5f7f23310423574b1d8c9acb84c66ea620f3999d1060395205e5760883476837aba02f0aa913af60819e34c625d8308c18a5d7a9c4e190f35968b024

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 00000000000..8aa4c1eabd2
--- /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_gcc_inline.patch b/app-arch/snappy/files/snappy-1.1.9_gcc_inline.patch
new file mode 100644
index 00000000000..04d35f56ee9
--- /dev/null
+++ b/app-arch/snappy/files/snappy-1.1.9_gcc_inline.patch
@@ -0,0 +1,67 @@
+From 0c716d435abe65250100c2caea0e5126ac4e14bd Mon Sep 17 00:00:00 2001
+From: "Georgi D. Sotirov" <gdsotirov@gmail.com>
+Date: Wed, 5 May 2021 14:16:46 +0300
+Subject: [PATCH] Add inline with SNAPPY_ATTRIBUTE_ALWAYS_INLINE
+
+Add inline with SNAPPY_ATTRIBUTE_ALWAYS_INLINE on AdvanceToNextTag to
+fix the following compilation errors and a warning with GCC:
+
+[  2%] Building CXX object CMakeFiles/snappy.dir/snappy.cc.o
+/usr/bin/c++   -DHAVE_CONFIG_H -Dsnappy_EXPORTS
+-I/tmp/snappy-1.1.9/build -I/tmp/snappy-1.1.9  -O3
+-march=i586 -mtune=i686 -Wall -Wextra -fno-exceptions -fno-rtti -O3
+-DNDEBUG -fPIC   -std=c++11 -o CMakeFiles/snappy.dir/snappy.cc.o -c
+/tmp/snappy-1.1.9/snappy.cc
+/tmp/snappy-1.1.9/snappy.cc:1017:8: warning: always_inline
+function might not be inlinable [-Wattributes]
+ size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) {
+        ^
+/tmp/snappy-1.1.9/snappy.cc: In function 'std::pair<const
+unsigned char*, int> snappy::DecompressBranchless(const uint8_t*, const
+uint8_t*, ptrdiff_t, T, ptrdiff_t) [with T = char*; uint8_t = unsigned
+char; ptrdiff_t = int]':
+/tmp/snappy-1.1.9/snappy.cc:1017:8: error: inlining failed in
+call to always_inline 'size_t snappy::AdvanceToNextTag(const uint8_t**,
+size_t*)': function body can be overwritten at link time
+/tmp/snappy-1.1.9/snappy.cc:1097:53: error: called from here
+         size_t tag_type = AdvanceToNextTag(&ip, &tag);
+                                                     ^
+/tmp/snappy-1.1.9/snappy.cc:1017:8: error: inlining failed in
+call to always_inline 'size_t snappy::AdvanceToNextTag(const uint8_t**,
+size_t*)': function body can be overwritten at link time
+ size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) {
+        ^
+/tmp/snappy-1.1.9/snappy.cc:1097:53: error: called from here
+         size_t tag_type = AdvanceToNextTag(&ip, &tag);
+                                                     ^
+/tmp/snappy-1.1.9/snappy.cc:1017:8: error: inlining failed in
+call to always_inline 'size_t snappy::AdvanceToNextTag(const uint8_t**,
+size_t*)': function body can be overwritten at link time
+ size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) {
+        ^
+/tmp/snappy-1.1.9/snappy.cc:1097:53: error: called from here
+         size_t tag_type = AdvanceToNextTag(&ip, &tag);
+                                                     ^
+CMakeFiles/snappy.dir/build.make:137: recipe for target
+'CMakeFiles/snappy.dir/snappy.cc.o' failed
+
+Just like with other functions using SNAPPY_ATTRIBUTE_ALWAYS_INLINE
+macro (i.e. __attribute__((always_inline)) ) it is necessary to use C++
+inline specifier.
+---
+ snappy.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/snappy.cc b/snappy.cc
+index 79dc0e8..51157be 100644
+--- a/snappy.cc
++++ b/snappy.cc
+@@ -1014,7 +1014,7 @@ void MemMove(ptrdiff_t dst, const void* src, size_t size) {
+ }
+ 
+ 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/app-arch/snappy/metadata.xml b/app-arch/snappy/metadata.xml
index c149214b310..9fbbf8bb934 100644
--- a/app-arch/snappy/metadata.xml
+++ b/app-arch/snappy/metadata.xml
@@ -1,11 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-	<!-- maintainer-needed -->
-	<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="person" proxied="yes">
+		<email>azamat.hackimov@gmail.com</email>
+		<name>Azamat H. Hackimov</name>
+	</maintainer>
+	<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="github">google/snappy</remote-id>
 	</upstream>

diff --git a/app-arch/snappy/snappy-1.1.9.ebuild b/app-arch/snappy/snappy-1.1.9.ebuild
new file mode 100644
index 00000000000..afb71c795da
--- /dev/null
+++ b/app-arch/snappy/snappy-1.1.9.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2021 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 ~x64-macos"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+DEPEND="test? ( dev-cpp/gtest )"
+
+DOCS=( format_description.txt framing_format.txt NEWS README.md )
+
+PATCHES=(
+	"${FILESDIR}/${P}_gcc_inline.patch"
+	"${FILESDIR}/${P}_external_gtest.patch"
+)
+
+multilib_src_configure() {
+	local mycmakeargs=(
+		-DSNAPPY_BUILD_TESTS=$(usex test)
+		-DSNAPPY_BUILD_BENCHMARKS=OFF
+		# we do not want to run benchmarks, and those are only used
+		# for benchmarks
+		-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
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-arch/snappy/files/, app-arch/snappy/
@ 2021-11-17  7:48 Joonas Niilola
  0 siblings, 0 replies; 4+ messages in thread
From: Joonas Niilola @ 2021-11-17  7:48 UTC (permalink / raw
  To: gentoo-commits

commit:     a34edd22137c9c34670aecd60ed75bbe65393c4a
Author:     Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com>
AuthorDate: Sun Oct 24 17:07:44 2021 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Nov 17 07:48:07 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a34edd22

app-arch/snappy: remove -fno-rtti option

Remove -fno-rtti option which may broke compilation of dependant
packages. Migrate to EAPI=8, minor cleanups.
Closes: https://bugs.gentoo.org/819909
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/22699
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 .../snappy/files/snappy-1.1.9_remove-no-rtti.patch | 35 +++++++++++++++++
 app-arch/snappy/snappy-1.1.9-r1.ebuild             | 45 ++++++++++++++++++++++
 2 files changed, 80 insertions(+)

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/snappy-1.1.9-r1.ebuild b/app-arch/snappy/snappy-1.1.9-r1.ebuild
new file mode 100644
index 000000000000..74b9e884e633
--- /dev/null
+++ b/app-arch/snappy/snappy-1.1.9-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2021 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"
+SLOT="0/${PV%%.*}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+DEPEND="test? ( dev-cpp/gtest )"
+
+DOCS=( format_description.txt framing_format.txt NEWS README.md )
+
+PATCHES=(
+	"${FILESDIR}/${P}_gcc_inline.patch"
+	"${FILESDIR}/${P}_external_gtest.patch"
+	"${FILESDIR}/${P}-clang-werror.patch"
+	"${FILESDIR}/${P}_remove-no-rtti.patch"
+)
+
+multilib_src_configure() {
+	local mycmakeargs=(
+		-DSNAPPY_BUILD_TESTS=$(usex test)
+		-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
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-arch/snappy/files/, app-arch/snappy/
@ 2022-08-19  8:14 Andreas Sturmlechner
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Sturmlechner @ 2022-08-19  8:14 UTC (permalink / raw
  To: gentoo-commits

commit:     b337a85f0aa53a1a01aa9062eb332d9948200d54
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 14 21:00:28 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Fri Aug 19 08:13:34 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b337a85f

app-arch/snappy: drop 1.1.8, 1.1.9

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 app-arch/snappy/Manifest                           |  1 -
 ...ke-Add-missing-linking-to-GTEST_LIBRARIES.patch | 30 ----------
 app-arch/snappy/snappy-1.1.8.ebuild                | 64 ----------------------
 app-arch/snappy/snappy-1.1.9.ebuild                | 46 ----------------
 4 files changed, 141 deletions(-)

diff --git a/app-arch/snappy/Manifest b/app-arch/snappy/Manifest
index 6ecc06c83362..6d2cae5cff27 100644
--- a/app-arch/snappy/Manifest
+++ b/app-arch/snappy/Manifest
@@ -1,2 +1 @@
-DIST snappy-1.1.8.tar.gz 1096137 BLAKE2B e21f2ea23727f118920b7f67981354194f12d1d61eaa18eb1cb2f4285fabafdd221b88cf1e3b3261634f65469a714d3efe6b218c0b1e9d41639cdeb21097d75e SHA512 efe18ff1b3edda1b4b6cefcbc6da8119c05d63afdbf7a784f3490353c74dced76baed7b5f1aa34b99899729192b9d657c33c76de4b507a51553fa8001ae75c1c
 DIST snappy-1.1.9.tar.gz 1102382 BLAKE2B 926d03156168e3d4800dc17144db3de2c182c6eb9970d87a00b94fb09b67e403479a64cbed75833b83fd03173c1bb8caaf248a55627e89fe2a34456f12ff3b42 SHA512 f1f8a90f5f7f23310423574b1d8c9acb84c66ea620f3999d1060395205e5760883476837aba02f0aa913af60819e34c625d8308c18a5d7a9c4e190f35968b024

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/snappy-1.1.8.ebuild b/app-arch/snappy/snappy-1.1.8.ebuild
deleted file mode 100644
index aeb144459747..000000000000
--- a/app-arch/snappy/snappy-1.1.8.ebuild
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 1999-2021 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 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
-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.1.9.ebuild b/app-arch/snappy/snappy-1.1.9.ebuild
deleted file mode 100644
index 0d7529657a0a..000000000000
--- a/app-arch/snappy/snappy-1.1.9.ebuild
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 1999-2021 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 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
-IUSE="test"
-RESTRICT="!test? ( test )"
-
-DEPEND="test? ( dev-cpp/gtest )"
-
-DOCS=( format_description.txt framing_format.txt NEWS README.md )
-
-PATCHES=(
-	"${FILESDIR}/${P}_gcc_inline.patch"
-	"${FILESDIR}/${P}_external_gtest.patch"
-	"${FILESDIR}/${PN}-1.1.9-clang-werror.patch"
-)
-
-multilib_src_configure() {
-	local mycmakeargs=(
-		-DSNAPPY_BUILD_TESTS=$(usex test)
-		-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
-}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-arch/snappy/files/, app-arch/snappy/
@ 2024-04-11 21:44 Yixun Lan
  0 siblings, 0 replies; 4+ messages in thread
From: Yixun Lan @ 2024-04-11 21:44 UTC (permalink / raw
  To: gentoo-commits

commit:     c0d78de715336d80f4a759dd0c7ca60ed7e2a5cf
Author:     Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com>
AuthorDate: Thu Apr 11 07:37:20 2024 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Thu Apr 11 21:43:46 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0d78de7

app-arch/snappy: add 1.2.0

Closes: https://github.com/gentoo/gentoo/pull/36205
Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com>
Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>

 app-arch/snappy/Manifest                           |  1 +
 .../snappy/files/snappy-1.2.0_external-gtest.patch | 46 ++++++++++++++++++++
 app-arch/snappy/files/snappy-1.2.0_no-werror.patch | 24 +++++++++++
 .../snappy/files/snappy-1.2.0_remove-no-rtti.patch | 32 ++++++++++++++
 app-arch/snappy/snappy-1.2.0.ebuild                | 49 ++++++++++++++++++++++
 5 files changed, 152 insertions(+)

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
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-11 21:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-03  9:12 [gentoo-commits] repo/gentoo:master commit in: app-arch/snappy/files/, app-arch/snappy/ Joonas Niilola
  -- strict thread matches above, loose matches on Subject: below --
2021-11-17  7:48 Joonas Niilola
2022-08-19  8:14 Andreas Sturmlechner
2024-04-11 21:44 Yixun Lan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox