about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/wiredtiger
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/wiredtiger')
-rw-r--r--nixpkgs/pkgs/development/libraries/wiredtiger/default.nix60
1 files changed, 60 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/wiredtiger/default.nix b/nixpkgs/pkgs/development/libraries/wiredtiger/default.nix
new file mode 100644
index 000000000000..69fc38c9a74e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wiredtiger/default.nix
@@ -0,0 +1,60 @@
+{ lib, stdenv, fetchFromGitHub, automake, autoconf, libtool
+
+# Optional Dependencies
+, lz4 ? null, snappy ? null, zlib ? null, bzip2 ? null, db ? null
+, gperftools ? null, leveldb ? null
+}:
+
+with lib;
+let
+  shouldUsePkg = pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null;
+
+  optLz4 = shouldUsePkg lz4;
+  optSnappy = shouldUsePkg snappy;
+  optZlib = shouldUsePkg zlib;
+  optBzip2 = shouldUsePkg bzip2;
+  optDb = shouldUsePkg db;
+  optGperftools = shouldUsePkg gperftools;
+  optLeveldb = shouldUsePkg leveldb;
+in
+stdenv.mkDerivation rec {
+  pname = "wiredtiger";
+  version = "3.2.1";
+
+  src = fetchFromGitHub {
+    repo = "wiredtiger";
+    owner = "wiredtiger";
+    rev = version;
+    sha256 = "04j2zw8b9jym43r682rh4kpdippxx7iw3ry16nxlbybzar9kgk83";
+  };
+
+  nativeBuildInputs = [ automake autoconf libtool ];
+  buildInputs = [ optLz4 optSnappy optZlib optBzip2 optDb optGperftools optLeveldb ];
+
+  configureFlags = [
+    (withFeature   false                   "attach")
+    (withFeatureAs true                    "builtins" "")
+    (enableFeature (optBzip2 != null)      "bzip2")
+    (enableFeature false                   "diagnostic")
+    (enableFeature false                   "java")
+    (enableFeature (optLeveldb != null)    "leveldb")
+    (enableFeature false                   "python")
+    (enableFeature (optSnappy != null)     "snappy")
+    (enableFeature (optLz4 != null)        "lz4")
+    (enableFeature (optGperftools != null) "tcmalloc")
+    (enableFeature (optZlib != null)       "zlib")
+    (withFeatureAs (optDb != null)         "berkeleydb" optDb)
+    (withFeature   false                   "helium")
+  ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  meta = {
+    homepage = "http://wiredtiger.com/";
+    description = "";
+    license = licenses.gpl2;
+    platforms = intersectLists platforms.unix platforms.x86_64;
+  };
+}