2020-09-21 15:09:15 +02:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake, gflags
|
2021-01-03 22:40:14 +01:00
|
|
|
, staticOnly ? stdenv.hostPlatform.isStatic
|
|
|
|
}:
|
2020-09-21 15:09:15 +02:00
|
|
|
|
2019-07-31 21:51:15 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "crc32c";
|
|
|
|
version = "1.1.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "crc32c";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "1sazkis9rzbrklfrvk7jn1mqywnq4yghmzg94mxd153h8b1sb149";
|
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ gflags ];
|
2021-01-21 18:00:13 +01:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isAarch64 "-march=armv8-a+crc";
|
2020-09-21 15:09:15 +02:00
|
|
|
cmakeFlags = lib.optionals (!staticOnly) [ "-DBUILD_SHARED_LIBS=1" ];
|
2019-07-31 21:51:15 +02:00
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/google/crc32c";
|
2019-07-31 21:51:15 +02:00
|
|
|
description = "CRC32C implementation with support for CPU-specific acceleration instructions";
|
|
|
|
license = with licenses; [ bsd3 ];
|
|
|
|
maintainers = with maintainers; [ andir ];
|
|
|
|
};
|
|
|
|
}
|