Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 38 lines 905 B view raw
1{ 2 stdenv, 3 lib, 4 fetchFromGitHub, 5 cmake, 6}: 7 8stdenv.mkDerivation rec { 9 pname = "cjson"; 10 version = "1.7.18"; 11 12 src = fetchFromGitHub { 13 owner = "DaveGamble"; 14 repo = "cJSON"; 15 rev = "v${version}"; 16 sha256 = "sha256-UgUWc/+Zie2QNijxKK5GFe4Ypk97EidG8nTiiHhn5Ys="; 17 }; 18 19 nativeBuildInputs = [ cmake ]; 20 21 cmakeFlags = lib.optional (stdenv.cc.isClang && !stdenv.hostPlatform.isDarwin) ( 22 lib.cmakeBool "ENABLE_CUSTOM_COMPILER_FLAGS" false 23 ); 24 25 # cJSON actually uses C99 standard, not C89 26 # https://github.com/DaveGamble/cJSON/issues/275 27 postPatch = '' 28 substituteInPlace CMakeLists.txt --replace -std=c89 -std=c99 29 ''; 30 31 meta = with lib; { 32 homepage = "https://github.com/DaveGamble/cJSON"; 33 description = "Ultralightweight JSON parser in ANSI C"; 34 license = licenses.mit; 35 maintainers = [ maintainers.matthiasbeyer ]; 36 platforms = platforms.unix; 37 }; 38}