10 stdenv.mkDerivation rec {
14 src = fetchFromGitHub {
18 hash = "sha256-5cl1PIjhXaL58kSyWZXRWLq6BITS2BwEovPhwvk2e18=";
21 nativeBuildInputs = [ cmake ninja ];
23 buildInputs = [ gtest ];
26 (lib.cmakeBool "BENCHMARK_USE_BUNDLED_GTEST" false)
27 (lib.cmakeBool "BENCHMARK_ENABLE_WERROR" false)
30 # We ran into issues with gtest 1.8.5 conditioning on
31 # `#if __has_cpp_attribute(maybe_unused)`, which was, for some
32 # reason, going through even when C++14 was being used and
33 # breaking the build on Darwin by triggering errors about using
36 # This might be a problem with our Clang, as it does not reproduce
37 # with Xcode, but we just work around it by silencing the warning.
38 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-c++17-attribute-extensions";
40 # Tests fail on 32-bit due to not enough precision
41 doCheck = stdenv.hostPlatform.is64bit;
44 inherit prometheus-cpp;
48 description = "Microbenchmark support library";
49 homepage = "https://github.com/google/benchmark";
50 license = licenses.asl20;
51 platforms = platforms.linux ++ platforms.darwin ++ platforms.freebsd;
52 maintainers = with maintainers; [ abbradar ];