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
8with lib;
9let
10 shouldUsePkg = pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null;
11
12 optLz4 = shouldUsePkg lz4;
13 optSnappy = shouldUsePkg snappy;
14 optZlib = shouldUsePkg zlib;
15 optBzip2 = shouldUsePkg bzip2;
16 optDb = shouldUsePkg db;
17 optGperftools = shouldUsePkg gperftools;
18 optLeveldb = shouldUsePkg leveldb;
19in
20stdenv.mkDerivation rec {
21 pname = "wiredtiger";
22 version = "3.2.1";
23
24 src = fetchFromGitHub {
25 repo = "wiredtiger";
26 owner = "wiredtiger";
27 rev = version;
28 sha256 = "04j2zw8b9jym43r682rh4kpdippxx7iw3ry16nxlbybzar9kgk83";
29 };
30
31 nativeBuildInputs = [ automake autoconf libtool ];
32 buildInputs = [ optLz4 optSnappy optZlib optBzip2 optDb optGperftools optLeveldb ];
33
34 configureFlags = [
35 (withFeature false "attach")
36 (withFeatureAs true "builtins" "")
37 (enableFeature (optBzip2 != null) "bzip2")
38 (enableFeature false "diagnostic")
39 (enableFeature false "java")
40 (enableFeature (optLeveldb != null) "leveldb")
41 (enableFeature false "python")
42 (enableFeature (optSnappy != null) "snappy")
43 (enableFeature (optLz4 != null) "lz4")
44 (enableFeature (optGperftools != null) "tcmalloc")
45 (enableFeature (optZlib != null) "zlib")
46 (withFeatureAs (optDb != null) "berkeleydb" optDb)
47 (withFeature false "helium")
48 ];
49
50 preConfigure = ''
51 ./autogen.sh
52 '';
53
54 meta = {
55 homepage = "http://wiredtiger.com/";
56 description = "";
57 license = licenses.gpl2;
58 platforms = intersectLists platforms.unix platforms.x86_64;
59 };
60}