Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 48 lines 1.0 kB view raw
1{ 2 stdenv, 3 lib, 4 fetchFromGitHub, 5 cmake, 6 cunit, 7}: 8 9stdenv.mkDerivation (finalAttrs: { 10 pname = "libdict"; 11 version = "1.0.4"; 12 13 src = fetchFromGitHub { 14 owner = "rtbrick"; 15 repo = "libdict"; 16 rev = finalAttrs.version; 17 hash = "sha256-GFK2yjtxAwwstoJQGCXxwNKxn3LL74FBxad7JdOn0pU="; 18 }; 19 20 nativeBuildInputs = [ 21 cmake 22 ]; 23 buildInputs = [ 24 cunit 25 ]; 26 27 cmakeFlags = [ 28 "-DLIBDICT_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" 29 "-DLIBDICT_SHARED=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" 30 ]; 31 32 env.NIX_CFLAGS_COMPILE = toString ( 33 lib.optionals stdenv.cc.isClang [ 34 "-Wno-error=strict-prototypes" 35 "-Wno-error=newline-eof" 36 ] 37 ); 38 39 doCheck = true; 40 41 meta = with lib; { 42 homepage = "https://github.com/rtbrick/libdict/"; 43 changelog = "https://github.com/rtbrick/libdict/releases/tag/${finalAttrs.version}"; 44 description = "C library of key-value data structures"; 45 license = licenses.bsd2; 46 teams = [ teams.wdz ]; 47 }; 48})