From f6da9198396a515d12e2f9d41bc7d6b45aa28209 Mon Sep 17 00:00:00 2001 From: Harinn Date: Sat, 4 Apr 2026 02:07:15 +0700 Subject: [PATCH] gbenchmark: 1.9.4 -> 1.9.5 --- pkgs/by-name/gb/gbenchmark/package.nix | 35 +++++++++++++++++--------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/gb/gbenchmark/package.nix b/pkgs/by-name/gb/gbenchmark/package.nix index 6cc1617193ee..6c9097d041d7 100644 --- a/pkgs/by-name/gb/gbenchmark/package.nix +++ b/pkgs/by-name/gb/gbenchmark/package.nix @@ -5,18 +5,19 @@ cmake, ninja, gtest, + glibcLocales, prometheus-cpp, }: stdenv.mkDerivation (finalAttrs: { pname = "gbenchmark"; - version = "1.9.4"; + version = "1.9.5"; src = fetchFromGitHub { owner = "google"; repo = "benchmark"; - rev = "v${finalAttrs.version}"; - hash = "sha256-P7wJcKkIBoWtN9FCRticpBzYbEZPq71a0iW/2oDTZRU="; + tag = "v${finalAttrs.version}"; + hash = "sha256-Mm4pG7zMB00iof32CxreoNBFnduPZTMp3reHMCIAFPQ="; }; nativeBuildInputs = [ @@ -26,20 +27,30 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ gtest ]; + nativeCheckInputs = lib.optionals stdenv.hostPlatform.isLinux [ glibcLocales ]; + cmakeFlags = [ (lib.cmakeBool "BENCHMARK_USE_BUNDLED_GTEST" false) (lib.cmakeBool "BENCHMARK_ENABLE_WERROR" false) ]; - # We ran into issues with gtest 1.8.5 conditioning on - # `#if __has_cpp_attribute(maybe_unused)`, which was, for some - # reason, going through even when C++14 was being used and - # breaking the build on Darwin by triggering errors about using - # C++17 features. - # - # This might be a problem with our Clang, as it does not reproduce - # with Xcode, but we just work around it by silencing the warning. - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-c++17-attribute-extensions"; + env = { + # We ran into issues with gtest 1.8.5 conditioning on + # `#if __has_cpp_attribute(maybe_unused)`, which was, for some + # reason, going through even when C++14 was being used and + # breaking the build on Darwin by triggering errors about using + # C++17 features. + # + # This might be a problem with our Clang, as it does not reproduce + # with Xcode, but we just work around it by silencing the warning. + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-c++17-attribute-extensions"; + } + // lib.optionalAttrs stdenv.hostPlatform.isLinux { + # For test:locale_impermeability_test + LANG = "en_US.UTF-8"; + LC_ALL = "en_US.UTF-8"; + LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; + }; # Tests fail on 32-bit due to not enough precision doCheck = stdenv.hostPlatform.is64bit;