forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Taking maitainership, cleanup ebuild. Package-Manager: Portage-3.0.18, Repoman-3.0.2 Signed-off-by: Azamat H. Hackimov <[email protected]> Closes: gentoo#20692 Signed-off-by: Joonas Niilola <[email protected]>
- Loading branch information
1 parent
381d231
commit a16aff8
Showing
5 changed files
with
159 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
From 9c1283f6022647a6ea39c1388321d6029fcdf80c Mon Sep 17 00:00:00 2001 | ||
From: "Azamat H. Hackimov" <[email protected]> | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
From 0c716d435abe65250100c2caea0e5126ac4e14bd Mon Sep 17 00:00:00 2001 | ||
From: "Georgi D. Sotirov" <[email protected]> | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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>[email protected]</email> | ||
<name>Azamat H. Hackimov</name> | ||
</maintainer> | ||
<maintainer type="project" proxied="proxy"> | ||
<email>[email protected]</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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |