summaryrefslogtreecommitdiff
path: root/gnu/packages/cpp.scm
diff options
context:
space:
mode:
authorHilton Chain <hako@ultrarare.space>2022-09-26 21:30:49 +0800
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2022-09-28 20:22:38 +0200
commitdc07a4ce6c34c2b61d0713a4a6ed89bc128783b4 (patch)
tree89a26245f1c13c53353a8f56e0f84d1cfea00de7 /gnu/packages/cpp.scm
parent7bcfdebc55f8b50d490201e63461d6533d60c19d (diff)
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>
Diffstat (limited to 'gnu/packages/cpp.scm')
-rw-r--r--gnu/packages/cpp.scm38
1 files changed, 38 insertions, 0 deletions
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 5e0646444c..805413cc61 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -1916,3 +1916,41 @@ and above. It is header only and has zero dependencies. It provides a
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)))