6 , staticOnly ? stdenv.hostPlatform.isStatic
9 stdenv.mkDerivation rec {
13 src = fetchFromGitHub {
17 sha256 = "0c383p7vkfq9rblww6mqxz8sygycyl27rr0j3bzb8l8ga71710ii";
18 fetchSubmodules = true;
21 nativeBuildInputs = [ cmake ];
22 buildInputs = [ gflags ];
24 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isAarch64 "-march=armv8-a+crc";
28 "-DCRC32C_BUILD_TESTS=1"
29 "-DCRC32C_BUILD_BENCHMARKS=0"
32 "-DBUILD_SHARED_LIBS=${if staticOnly then "0" else "1"}"
36 doInstallCheck = true;
38 installCheckPhase = ''
39 runHook preInstallCheck
43 runHook postInstallCheck
47 # fix bogus include paths
48 for f in $(find $out/lib/cmake -name '*.cmake'); do
49 substituteInPlace "$f" --replace "\''${_IMPORT_PREFIX}/$out/include" "\''${_IMPORT_PREFIX}/include"
54 homepage = "https://github.com/google/crc32c";
55 description = "CRC32C implementation with support for CPU-specific acceleration instructions";
56 license = with licenses; [ bsd3 ];
57 maintainers = with maintainers; [ cpcloud ];