From 6ba91da085f30cec77287139c2919281ee62ffe9 Mon Sep 17 00:00:00 2001 From: Arthur Zamarin Date: Sun, 5 Sep 2021 20:17:24 +0300 Subject: dev-libs/crc32c: add 1.1.1, enable tests Signed-off-by: Arthur Zamarin --- dev-libs/crc32c/Manifest | 1 + dev-libs/crc32c/crc32c-1.1.1.ebuild | 40 ++++++++++++++++++++++ .../files/crc32c-1.1.1-system-testdeps.patch | 21 ++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 dev-libs/crc32c/crc32c-1.1.1.ebuild create mode 100644 dev-libs/crc32c/files/crc32c-1.1.1-system-testdeps.patch (limited to 'dev-libs/crc32c') 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 -- cgit v1.2.3-65-gdbad