linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / libraries / nlohmann_json / default.nix
blob41a967a5b709ab04d49e4235fbf30b28e7de653e
1 { lib, stdenv, fetchFromGitHub, fetchpatch, cmake
2 }:
4 stdenv.mkDerivation rec {
5   pname = "nlohmann_json";
6   version = "3.9.1";
8   src = fetchFromGitHub {
9     owner = "nlohmann";
10     repo = "json";
11     rev = "v${version}";
12     sha256 = "sha256-THordDPdH2qwk6lFTgeFmkl7iDuA/7YH71PTUe6vJCs=";
13   };
15   patches = [
16     # https://github.com/nlohmann/json/pull/2690
17     (fetchpatch {
18       url = "https://github.com/nlohmann/json/commit/53a9850eebb88c6ff95f6042d08d5c0cc9d18097.patch";
19       sha256 = "k+Og00nXNg5IsFQY5fWD3xVQQXUFFTie44UXole0S1M=";
20     })
21   ];
23   nativeBuildInputs = [ cmake ];
25   cmakeFlags = [
26     "-DBuildTests=${if doCheck then "ON" else "OFF"}"
27     "-DJSON_MultipleHeaders=ON"
28   ];
30   # A test cause the build to timeout https://github.com/nlohmann/json/issues/1816
31   #doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
32   doCheck = false;
34   postInstall = "rm -rf $out/lib64";
36   meta = with lib; {
37     description = "Header only C++ library for the JSON file format";
38     homepage = "https://github.com/nlohmann/json";
39     license = licenses.mit;
40     platforms = platforms.all;
41   };