about summary refs log tree commit diff
path: root/pkgs/development/libraries/nlohmann_json
diff options
context:
space:
mode:
authorShamrock Lee <44064051+ShamrockLee@users.noreply.github.com>2021-09-08 02:30:30 +0800
committerShamrock Lee <44064051+ShamrockLee@users.noreply.github.com>2021-09-15 11:19:01 +0800
commit1172c99c506ed4c3c7c8f47d3b51fb195eca5d96 (patch)
treee374b685005799c3c87e053c2265b052eda61264 /pkgs/development/libraries/nlohmann_json
parent18bd22822c1054b74d165597ee504cece999cec8 (diff)
nlohmann_json: enable checkPhase
Diffstat (limited to 'pkgs/development/libraries/nlohmann_json')
-rw-r--r--pkgs/development/libraries/nlohmann_json/default.nix26
1 files changed, 19 insertions, 7 deletions
diff --git a/pkgs/development/libraries/nlohmann_json/default.nix b/pkgs/development/libraries/nlohmann_json/default.nix
index e152c4fa20a85..d8ae8fcaa4ae0 100644
--- a/pkgs/development/libraries/nlohmann_json/default.nix
+++ b/pkgs/development/libraries/nlohmann_json/default.nix
@@ -1,7 +1,16 @@
-{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake
+{ stdenv
+, lib
+, fetchFromGitHub
+, cmake
 }:
-
-stdenv.mkDerivation rec {
+let
+  testData = fetchFromGitHub {
+    owner = "nlohmann";
+    repo = "json_test_data";
+    rev = "v3.0.0";
+    sha256 = "O6p2PFB7c2KE9VqWvmTaFywbW1hSzAP5V42EuemX+ls=";
+  };
+in stdenv.mkDerivation rec {
   pname = "nlohmann_json";
   version = "3.10.2";
 
@@ -17,11 +26,14 @@ stdenv.mkDerivation rec {
   cmakeFlags = [
     "-DBuildTests=${if doCheck then "ON" else "OFF"}"
     "-DJSON_MultipleHeaders=ON"
-  ];
+  ] ++ lib.optional doCheck "-DJSON_TestDataDirectory=${testData}";
+
+  doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
 
-  # A test cause the build to timeout https://github.com/nlohmann/json/issues/1816
-  #doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
-  doCheck = false;
+  # skip tests that require git or modify “installed files”
+  preCheck = ''
+    checkFlagsArray+=("ARGS=-LE 'not_reproducible|git_required'")
+  '';
 
   postInstall = "rm -rf $out/lib64";