3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix
Remy Goldschmidt 854d16d74e nlohmann_json: 2.0.2 -> 2.0.3
`cmake` should be in `nativeBuildInputs` as it is only required at build time. For obvious reasons we can't have the tests running during a cross-compile. I figured I'd update the package version while I was at it, though these changes have also been tested independently of the version update.
2016-09-02 17:23:46 -05:00

33 lines
793 B
Nix

{ stdenv, fetchFromGitHub, cmake }:
stdenv.mkDerivation rec {
name = "nlohmann_json-${version}";
version = "2.0.3";
src = fetchFromGitHub {
owner = "nlohmann";
repo = "json";
rev = "v${version}";
sha256 = "192mg2y93g9q0jdn3fdffydpxk19nsrcv92kfip6srkdkwja18ri";
};
nativeBuildInputs = [ cmake ];
doCheck = true;
checkTarget = "test";
crossAttrs = {
cmakeFlags = "-DBuildTests=OFF";
doCheck = false;
} // stdenv.lib.optionalAttrs (stdenv.cross.libc == "msvcrt") {
cmakeFlags = "-DBuildTests=OFF -DCMAKE_SYSTEM_NAME=Windows";
};
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;
};
}