btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / wi / wiredtiger / package.nix
bloba87afd7ee09fc15d7fb75ef739ba266bf2829556
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
6 }:
8 let
9   shouldUsePkg = pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null;
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;
19 stdenv.mkDerivation rec {
20   pname = "wiredtiger";
21   version = "3.2.1";
23   src = fetchFromGitHub {
24     repo = "wiredtiger";
25     owner = "wiredtiger";
26     rev = version;
27     sha256 = "04j2zw8b9jym43r682rh4kpdippxx7iw3ry16nxlbybzar9kgk83";
28   };
30   nativeBuildInputs = [ automake autoconf libtool ];
31   buildInputs = [ optLz4 optSnappy optZlib optBzip2 optDb optGperftools optLeveldb ];
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   ];
49   preConfigure = ''
50     ./autogen.sh
51   '';
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   };