1 { lib, stdenv, fetchFromGitHub, automake, autoconf, libtool
3 # Optional Dependencies
4 , lz4 ? null, snappy ? null, zlib ? null, bzip2 ? null, db ? null
5 , gperftools ? null, leveldb ? null
10 mkFlag = trueStr: falseStr: cond: name: val: "--"
11 + (if cond then trueStr else falseStr)
13 + optionalString (val != null && cond != false) "=${val}";
14 mkEnable = mkFlag "enable-" "disable-";
15 mkWith = mkFlag "with-" "without-";
17 shouldUsePkg = pkg: if pkg != null && lib.any (lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;
19 optLz4 = shouldUsePkg lz4;
20 optSnappy = shouldUsePkg snappy;
21 optZlib = shouldUsePkg zlib;
22 optBzip2 = shouldUsePkg bzip2;
23 optDb = shouldUsePkg db;
24 optGperftools = shouldUsePkg gperftools;
25 optLeveldb = shouldUsePkg leveldb;
27 stdenv.mkDerivation rec {
31 src = fetchFromGitHub {
35 sha256 = "04j2zw8b9jym43r682rh4kpdippxx7iw3ry16nxlbybzar9kgk83";
38 nativeBuildInputs = [ automake autoconf libtool ];
39 buildInputs = [ optLz4 optSnappy optZlib optBzip2 optDb optGperftools optLeveldb ];
42 (mkWith false "attach" null)
43 (mkWith true "builtins" "")
44 (mkEnable (optBzip2 != null) "bzip2" null)
45 (mkEnable false "diagnostic" null)
46 (mkEnable false "java" null)
47 (mkEnable (optLeveldb != null) "leveldb" null)
48 (mkEnable false "python" null)
49 (mkEnable (optSnappy != null) "snappy" null)
50 (mkEnable (optLz4 != null) "lz4" null)
51 (mkEnable (optGperftools != null) "tcmalloc" null)
52 (mkEnable (optZlib != null) "zlib" null)
53 (mkWith (optDb != null) "berkeleydb" optDb)
54 (mkWith false "helium" null)
62 homepage = "http://wiredtiger.com/";
64 license = licenses.gpl2;
65 platforms = intersectLists platforms.unix platforms.x86_64;