2015-04-08 20:02:56 +00:00
|
|
|
{ stdenv, fetchFromGitHub, automake, autoconf, libtool
|
2015-05-20 04:43:48 +00:00
|
|
|
|
|
|
|
# Optional Dependencies
|
|
|
|
, lz4 ? null, snappy ? null, zlib ? null, bzip2 ? null, db ? null
|
|
|
|
, gperftools ? null, leveldb ? null
|
2015-04-08 20:02:56 +00:00
|
|
|
}:
|
|
|
|
|
2015-06-01 18:52:03 +00:00
|
|
|
with stdenv.lib;
|
2015-05-20 04:43:48 +00:00
|
|
|
let
|
2015-06-01 18:52:03 +00:00
|
|
|
mkFlag = trueStr: falseStr: cond: name: val:
|
|
|
|
if cond == null then null else
|
|
|
|
"--${if cond != false then trueStr else falseStr}${name}${if val != null && cond != false then "=${val}" else ""}";
|
|
|
|
mkEnable = mkFlag "enable-" "disable-";
|
|
|
|
mkWith = mkFlag "with-" "without-";
|
|
|
|
mkOther = mkFlag "" "" true;
|
|
|
|
|
|
|
|
shouldUsePkg = pkg: if pkg != null && any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
|
|
|
|
|
2015-05-20 04:43:48 +00:00
|
|
|
optLz4 = shouldUsePkg lz4;
|
|
|
|
optSnappy = shouldUsePkg snappy;
|
|
|
|
optZlib = shouldUsePkg zlib;
|
|
|
|
optBzip2 = shouldUsePkg bzip2;
|
|
|
|
optDb = shouldUsePkg db;
|
|
|
|
optGperftools = shouldUsePkg gperftools;
|
|
|
|
optLeveldb = shouldUsePkg leveldb;
|
|
|
|
in
|
2015-04-08 20:02:56 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "wiredtiger-${version}";
|
2015-06-19 04:27:21 +00:00
|
|
|
version = "2.6.1";
|
2015-04-08 20:02:56 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "wiredtiger";
|
|
|
|
owner = "wiredtiger";
|
|
|
|
rev = version;
|
2015-06-19 04:27:21 +00:00
|
|
|
sha256 = "1nj319w3hvkq3za2dz9m0p1w683gycdb392v1jb910bhzpsq30pd";
|
2015-04-08 20:02:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ automake autoconf libtool ];
|
2015-05-20 04:43:48 +00:00
|
|
|
buildInputs = [ optLz4 optSnappy optZlib optBzip2 optDb optGperftools optLeveldb ];
|
2015-04-08 20:02:56 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
2015-05-20 04:43:48 +00:00
|
|
|
(mkWith false "attach" null)
|
|
|
|
(mkWith true "builtins" "")
|
|
|
|
(mkEnable (optBzip2 != null) "bzip2" null)
|
|
|
|
(mkEnable false "diagnostic" null)
|
|
|
|
(mkEnable false "java" null)
|
|
|
|
(mkEnable (optLeveldb != null) "leveldb" null)
|
|
|
|
(mkEnable false "python" null)
|
|
|
|
(mkEnable (optSnappy != null) "snappy" null)
|
|
|
|
(mkEnable (optLz4 != null) "lz4" null)
|
|
|
|
(mkEnable (optGperftools != null) "tcmalloc" null)
|
|
|
|
(mkEnable (optZlib != null) "zlib" null)
|
|
|
|
(mkWith (optDb != null) "berkeleydb" optDb)
|
|
|
|
(mkWith false "helium" null)
|
2015-04-08 20:02:56 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
./autogen.sh
|
|
|
|
'';
|
|
|
|
|
2015-07-23 22:47:16 +00:00
|
|
|
prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace api/leveldb/leveldb_wt.h --replace \
|
|
|
|
'#include "wiredtiger.h"' \
|
|
|
|
''$'#include "wiredtiger.h"\n#include "pthread.h"'
|
|
|
|
'';
|
|
|
|
|
2015-05-20 04:43:48 +00:00
|
|
|
meta = {
|
2015-04-08 20:02:56 +00:00
|
|
|
homepage = http://wiredtiger.com/;
|
|
|
|
description = "";
|
|
|
|
license = licenses.gpl2;
|
2015-04-17 13:32:25 +00:00
|
|
|
platforms = intersectLists platforms.unix platforms.x86_64;
|
2015-04-08 20:02:56 +00:00
|
|
|
maintainers = with maintainers; [ wkennington ];
|
|
|
|
};
|
|
|
|
}
|