2021-04-05 15:23:46 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nlohmann_json";
|
2020-12-25 13:55:36 +00:00
|
|
|
version = "3.9.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nlohmann";
|
|
|
|
repo = "json";
|
|
|
|
rev = "v${version}";
|
2020-12-25 13:55:36 +00:00
|
|
|
sha256 = "sha256-THordDPdH2qwk6lFTgeFmkl7iDuA/7YH71PTUe6vJCs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/nlohmann/json/pull/2690
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/nlohmann/json/commit/53a9850eebb88c6ff95f6042d08d5c0cc9d18097.patch";
|
|
|
|
sha256 = "k+Og00nXNg5IsFQY5fWD3xVQQXUFFTie44UXole0S1M=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBuildTests=${if doCheck then "ON" else "OFF"}"
|
|
|
|
"-DJSON_MultipleHeaders=ON"
|
|
|
|
];
|
|
|
|
|
|
|
|
# A test cause the build to timeout https://github.com/nlohmann/json/issues/1816
|
|
|
|
#doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
postInstall = "rm -rf $out/lib64";
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Header only C++ library for the JSON file format";
|
|
|
|
homepage = "https://github.com/nlohmann/json";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|