summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2021-09-05 20:17:24 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2021-09-05 20:17:31 +0300
commit6ba91da085f30cec77287139c2919281ee62ffe9 (patch)
tree0ea478b27228baa47898f13272e48b67b5dc059d
parentmedia-libs/sdl2-mixer: Backport patch to fix FluidSynth memory issue (diff)
downloadgentoo-6ba91da085f30cec77287139c2919281ee62ffe9.tar.gz
gentoo-6ba91da085f30cec77287139c2919281ee62ffe9.tar.bz2
gentoo-6ba91da085f30cec77287139c2919281ee62ffe9.zip
dev-libs/crc32c: add 1.1.1, enable tests
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r--dev-libs/crc32c/Manifest1
-rw-r--r--dev-libs/crc32c/crc32c-1.1.1.ebuild40
-rw-r--r--dev-libs/crc32c/files/crc32c-1.1.1-system-testdeps.patch21
3 files changed, 62 insertions, 0 deletions
diff --git a/dev-libs/crc32c/Manifest b/dev-libs/crc32c/Manifest
index 2c2ab2c4bfe1..8de75e4baf52 100644
--- a/dev-libs/crc32c/Manifest
+++ b/dev-libs/crc32c/Manifest
@@ -1 +1,2 @@
DIST crc32c-1.0.6.tar.gz 29596 BLAKE2B 5806e0a48cb3048c9b07abb75eb232491483176bbeb98bc11ad1b0ef7d4ce89929ad20b0354906fd67e8773541f9913f3948f1db9a3f3987fe7e2ca67e9d2467 SHA512 c30f6510d6348f15dcdddc06e375f21a69681cd615483d67628b32de747e5e98200fa49faf7e3fc30a1302991fd1f9c9a706c9eb4e13c9c6c09e74066474ea7b
+DIST crc32c-1.1.1.tar.gz 29829 BLAKE2B 5ffb0809e80d1fad81a77d96683d44142a7d84fc15ce18070cdcdb12fd9b67f7ec732a53d8af7dc4b77add859bf64c4fa8bc52a593830de931a7bd12c60498cc SHA512 c276160ec960a38cd535c998336472694819bc6eb37beb711bd43a31441d1808c8a14d3a1f0eccc780785b19f739a4a51f923867a20b0707c465e0cc03f457e9
diff --git a/dev-libs/crc32c/crc32c-1.1.1.ebuild b/dev-libs/crc32c/crc32c-1.1.1.ebuild
new file mode 100644
index 000000000000..e1e32e72d22f
--- /dev/null
+++ b/dev-libs/crc32c/crc32c-1.1.1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake
+
+DESCRIPTION="CRC32C implementation with support for CPU-specific acceleration instructions"
+HOMEPAGE="https://github.com/google/crc32c"
+SRC_URI="https://github.com/google/crc32c/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~riscv ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="test? ( dev-cpp/gtest )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.0.6-fix-big-endian.patch"
+ "${FILESDIR}/${PN}-1.1.1-system-testdeps.patch"
+)
+
+DOCS=( README.md )
+
+src_prepare() {
+ sed -e '/-Werror/d' -i CMakeLists.txt || die
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCRC32C_BUILD_TESTS=$(usex test)
+ -DCRC32C_BUILD_BENCHMARKS=OFF
+ -DCRC32C_USE_GLOG=OFF
+ )
+
+ cmake_src_configure
+}
diff --git a/dev-libs/crc32c/files/crc32c-1.1.1-system-testdeps.patch b/dev-libs/crc32c/files/crc32c-1.1.1-system-testdeps.patch
new file mode 100644
index 000000000000..da513c5d4eda
--- /dev/null
+++ b/dev-libs/crc32c/files/crc32c-1.1.1-system-testdeps.patch
@@ -0,0 +1,21 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8490728..c7f0952 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -315,15 +315,7 @@ if(CRC32C_BUILD_TESTS)
+ set(install_gmock OFF)
+
+ # This project is tested using GoogleTest.
+- add_subdirectory("third_party/googletest")
+-
+- # GoogleTest triggers a missing field initializers warning.
+- if(CRC32C_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(CRC32C_HAVE_NO_MISSING_FIELD_INITIALIZERS)
++ find_package(GTest REQUIRED)
+
+ add_executable(crc32c_tests "")
+ target_sources(crc32c_tests