2017-06-28 13:23:34 -07:00
|
|
|
{ stdenv, fetchFromGitHub, cmake
|
|
|
|
}:
|
2016-08-04 14:34:23 -07:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-03-20 06:48:13 -07:00
|
|
|
pname = "nlohmann_json";
|
2019-10-22 10:12:57 -07:00
|
|
|
version = "3.7.0";
|
2016-08-04 14:34:23 -07:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nlohmann";
|
|
|
|
repo = "json";
|
|
|
|
rev = "v${version}";
|
2019-10-22 10:12:57 -07:00
|
|
|
sha256 = "0v7xih4zjixxxfvkfbs7a8j9qcvpwlsv4vrkbyns3hc7b44nb8ap";
|
2016-08-04 14:34:23 -07:00
|
|
|
};
|
|
|
|
|
2016-09-02 15:23:46 -07:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2016-08-04 14:34:23 -07:00
|
|
|
|
2017-02-02 02:13:04 -08:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2018-07-23 12:47:09 -07:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBuildTests=${if doCheck then "ON" else "OFF"}"
|
2019-10-22 10:12:57 -07:00
|
|
|
"-DJSON_MultipleHeaders=ON"
|
2018-07-23 12:47:09 -07:00
|
|
|
];
|
2016-09-02 15:23:46 -07:00
|
|
|
|
2018-08-08 11:57:55 -07:00
|
|
|
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
|
|
|
|
2019-10-22 10:12:57 -07:00
|
|
|
postInstall = "rm -rf $out/lib64";
|
|
|
|
|
2016-08-04 14:34:23 -07:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Header only C++ library for the JSON file format";
|
|
|
|
homepage = https://github.com/nlohmann/json;
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|