diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/nlohmann_json')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix b/nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix index 41a967a5b709..d8ae8fcaa4ae 100644 --- a/nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix +++ b/nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix @@ -1,41 +1,46 @@ -{ 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.9.1"; + version = "3.10.2"; src = fetchFromGitHub { owner = "nlohmann"; repo = "json"; rev = "v${version}"; - sha256 = "sha256-THordDPdH2qwk6lFTgeFmkl7iDuA/7YH71PTUe6vJCs="; + sha256 = "/OFNfukrIyfJmD0ko174aud9T6ZOesHANJjyfk4q/Vs="; }; - patches = [ - # https://github.com/nlohmann/json/pull/2690 - (fetchpatch { - url = "https://github.com/nlohmann/json/commit/53a9850eebb88c6ff95f6042d08d5c0cc9d18097.patch"; - sha256 = "k+Og00nXNg5IsFQY5fWD3xVQQXUFFTie44UXole0S1M="; - }) - ]; - nativeBuildInputs = [ cmake ]; 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"; meta = with lib; { - description = "Header only C++ library for the JSON file format"; - homepage = "https://github.com/nlohmann/json"; + description = "JSON for Modern C++"; + homepage = "https://json.nlohmann.me"; + changelog = "https://github.com/nlohmann/json/blob/develop/ChangeLog.md"; license = licenses.mit; platforms = platforms.all; }; |