From 3c9db360007ac503a76fb640098e8607a0cca198 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sun, 14 Aug 2022 10:39:51 +0800 Subject: [PATCH] rapidjson: fix cross compilation, cleanup checkPhase --- .../libraries/rapidjson/default.nix | 23 +++++-------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/pkgs/development/libraries/rapidjson/default.nix b/pkgs/development/libraries/rapidjson/default.nix index 989a88f111e3..9d8db78e0215 100644 --- a/pkgs/development/libraries/rapidjson/default.nix +++ b/pkgs/development/libraries/rapidjson/default.nix @@ -5,6 +5,7 @@ , pkg-config , cmake , gtest +, valgrind }: stdenv.mkDerivation rec { @@ -36,24 +37,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config cmake ]; - cmakeFlags = [ - "-DGTEST_SOURCE_DIR=${gtest.dev}/include" - ] ++ lib.optionals (!doCheck) [ - "-DRAPIDJSON_BUILD_TESTS=OFF" - ]; - - nativeCheckInputs = [ - gtest - ]; - - checkPhase = '' - runHook preCheck - - ctest -E '.*valgrind.*' - - runHook postCheck - ''; + # for tests, adding gtest to checkInputs does not work + # https://github.com/NixOS/nixpkgs/pull/212200 + buildInputs = [ gtest ]; + cmakeFlags = [ "-DGTEST_SOURCE_DIR=${gtest.dev}/include" ]; + nativeCheckInputs = [ valgrind ]; doCheck = !stdenv.hostPlatform.isStatic; meta = with lib; {