Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 60 lines 2.0 kB view raw
1{ lib, stdenv, fetchFromGitHub, automake, autoconf, libtool 2 3# Optional Dependencies 4, lz4 ? null, snappy ? null, zlib ? null, bzip2 ? null, db ? null 5, gperftools ? null, leveldb ? null 6}: 7 8let 9 shouldUsePkg = pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null; 10 11 optLz4 = shouldUsePkg lz4; 12 optSnappy = shouldUsePkg snappy; 13 optZlib = shouldUsePkg zlib; 14 optBzip2 = shouldUsePkg bzip2; 15 optDb = shouldUsePkg db; 16 optGperftools = shouldUsePkg gperftools; 17 optLeveldb = shouldUsePkg leveldb; 18in 19stdenv.mkDerivation rec { 20 pname = "wiredtiger"; 21 version = "3.2.1"; 22 23 src = fetchFromGitHub { 24 repo = "wiredtiger"; 25 owner = "wiredtiger"; 26 rev = version; 27 sha256 = "04j2zw8b9jym43r682rh4kpdippxx7iw3ry16nxlbybzar9kgk83"; 28 }; 29 30 nativeBuildInputs = [ automake autoconf libtool ]; 31 buildInputs = [ optLz4 optSnappy optZlib optBzip2 optDb optGperftools optLeveldb ]; 32 33 configureFlags = [ 34 (lib.withFeature false "attach") 35 (lib.withFeatureAs true "builtins" "") 36 (lib.enableFeature (optBzip2 != null) "bzip2") 37 (lib.enableFeature false "diagnostic") 38 (lib.enableFeature false "java") 39 (lib.enableFeature (optLeveldb != null) "leveldb") 40 (lib.enableFeature false "python") 41 (lib.enableFeature (optSnappy != null) "snappy") 42 (lib.enableFeature (optLz4 != null) "lz4") 43 (lib.enableFeature (optGperftools != null) "tcmalloc") 44 (lib.enableFeature (optZlib != null) "zlib") 45 (lib.withFeatureAs (optDb != null) "berkeleydb" optDb) 46 (lib.withFeature false "helium") 47 ]; 48 49 preConfigure = '' 50 ./autogen.sh 51 ''; 52 53 meta = with lib; { 54 homepage = "http://wiredtiger.com/"; 55 description = ""; 56 mainProgram = "wt"; 57 license = licenses.gpl2; 58 platforms = intersectLists platforms.unix platforms.x86_64; 59 }; 60}