mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-12 14:16:55 -05:00
gnu: Add crc32c.
* gnu/packages/cpp.scm (crc32c): New variable. * gnu/packages/patches/crc32c-unbundle-googletest.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it here. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This commit is contained in:
parent
7bcfdebc55
commit
dc07a4ce6c
3 changed files with 60 additions and 0 deletions
|
@ -997,6 +997,7 @@ dist_patch_DATA = \
|
|||
%D%/packages/patches/cpuinfo-system-libraries.patch \
|
||||
%D%/packages/patches/cpulimit-with-glib-2.32.patch \
|
||||
%D%/packages/patches/crawl-upgrade-saves.patch \
|
||||
%D%/packages/patches/crc32c-unbundle-googletest.patch \
|
||||
%D%/packages/patches/crda-optional-gcrypt.patch \
|
||||
%D%/packages/patches/clucene-contribs-lib.patch \
|
||||
%D%/packages/patches/cube-nocheck.patch \
|
||||
|
|
|
@ -1916,3 +1916,41 @@ (define-public cpp-mustache
|
|||
templated string type for compatibility with any STL-like string (std::string,
|
||||
std::wstring, etc).")
|
||||
(license license:boost1.0)))
|
||||
|
||||
(define-public crc32c
|
||||
(package
|
||||
(name "crc32c")
|
||||
(version "1.1.2")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/google/crc32c")
|
||||
(commit version)))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"0966lyy3w5cnrs0c0fkma4hga51k54hns72l4n76944awqssap7j"))
|
||||
(patches (search-patches "crc32c-unbundle-googletest.patch"))))
|
||||
(build-system cmake-build-system)
|
||||
(arguments
|
||||
(list #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON"
|
||||
"-DCRC32C_BUILD_BENCHMARKS=OFF"
|
||||
"-DCRC32C_USE_GLOG=OFF"
|
||||
(string-append
|
||||
"-DCRC32C_BUILD_TESTS="
|
||||
;; TODO: perhaps infer #:tests?
|
||||
(if #$(%current-target-system)
|
||||
"OFF" "ON")))
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-after 'unpack 'make-reproducible
|
||||
(lambda _
|
||||
(substitute* "CMakeLists.txt"
|
||||
(("if\\(HAVE_SSE42\\)") "if(FALSE)")))))))
|
||||
(native-inputs (list googletest))
|
||||
(home-page "https://github.com/google/crc32c")
|
||||
(synopsis "Cyclic redundancy check")
|
||||
(description
|
||||
"This package provides architecture-specific implementations of the
|
||||
CRC32C algorithm, which is specified in RFC 3720, section 12.1.")
|
||||
(license license:bsd-3)))
|
||||
|
|
21
gnu/packages/patches/crc32c-unbundle-googletest.patch
Normal file
21
gnu/packages/patches/crc32c-unbundle-googletest.patch
Normal file
|
@ -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
|
Loading…
Reference in a new issue