3
0
Fork 0
forked from mirrors/nixpkgs

nlohmann_json: enable checkPhase

This commit is contained in:
Shamrock Lee 2021-09-08 02:30:30 +08:00
parent 18bd22822c
commit 1172c99c50

View file

@ -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}";
# A test cause the build to timeout https://github.com/nlohmann/json/issues/1816
#doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
doCheck = false;
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
# skip tests that require git or modify “installed files”
preCheck = ''
checkFlagsArray+=("ARGS=-LE 'not_reproducible|git_required'")
'';
postInstall = "rm -rf $out/lib64";