about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/nlohmann_json
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/nlohmann_json')
-rw-r--r--nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix b/nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix
new file mode 100644
index 000000000000..eb737c0757d9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub, cmake
+}:
+
+stdenv.mkDerivation rec {
+  name = "nlohmann_json-${version}";
+  version = "3.5.0";
+
+  src = fetchFromGitHub {
+    owner = "nlohmann";
+    repo = "json";
+    rev = "v${version}";
+    sha256 = "1jq522d48bvfrxr4f6jnijwx2dwqfb8w9k636j4kxlg1hka27lji";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  enableParallelBuilding = true;
+
+  cmakeFlags = [
+    "-DBuildTests=${if doCheck then "ON" else "OFF"}"
+  ];
+
+  doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
+
+  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;
+  };
+}