-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
/
default.nix
47 lines (40 loc) · 1.13 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ stdenv
, lib
, fetchFromGitHub
, cmake
}:
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.5";
src = fetchFromGitHub {
owner = "nlohmann";
repo = "json";
rev = "v${version}";
sha256 = "DTsZrdB9GcaNkx7ZKxcgCA3A9ShM5icSF0xyGguJNbk=";
};
nativeBuildInputs = [ cmake ];
cmakeFlags = [
"-DBuildTests=${if doCheck then "ON" else "OFF"}"
"-DJSON_MultipleHeaders=ON"
] ++ lib.optional doCheck "-DJSON_TestDataDirectory=${testData}";
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";
meta = with lib; {
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;
};
}