2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, automake, autoconf, libtool
|
2015-05-20 05:43:48 +01:00
|
|
|
|
|
|
|
# Optional Dependencies
|
|
|
|
, lz4 ? null, snappy ? null, zlib ? null, bzip2 ? null, db ? null
|
|
|
|
, gperftools ? null, leveldb ? null
|
2015-04-08 21:02:56 +01:00
|
|
|
}:
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
with lib;
|
2015-05-20 05:43:48 +01:00
|
|
|
let
|
2017-04-17 21:48:10 +01:00
|
|
|
mkFlag = trueStr: falseStr: cond: name: val: "--"
|
|
|
|
+ (if cond then trueStr else falseStr)
|
|
|
|
+ name
|
|
|
|
+ optionalString (val != null && cond != false) "=${val}";
|
2015-06-01 19:52:03 +01:00
|
|
|
mkEnable = mkFlag "enable-" "disable-";
|
|
|
|
mkWith = mkFlag "with-" "without-";
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
shouldUsePkg = pkg: if pkg != null && lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;
|
2015-06-01 19:52:03 +01:00
|
|
|
|
2015-05-20 05:43:48 +01: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 21:02:56 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "wiredtiger";
|
2019-10-09 00:30:42 +01:00
|
|
|
version = "3.2.1";
|
2015-04-08 21:02:56 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "wiredtiger";
|
|
|
|
owner = "wiredtiger";
|
|
|
|
rev = version;
|
2019-10-09 00:30:42 +01:00
|
|
|
sha256 = "04j2zw8b9jym43r682rh4kpdippxx7iw3ry16nxlbybzar9kgk83";
|
2015-04-08 21:02:56 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ automake autoconf libtool ];
|
2015-05-20 05:43:48 +01:00
|
|
|
buildInputs = [ optLz4 optSnappy optZlib optBzip2 optDb optGperftools optLeveldb ];
|
2015-04-08 21:02:56 +01:00
|
|
|
|
|
|
|
configureFlags = [
|
2015-05-20 05:43:48 +01: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 21:02:56 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
./autogen.sh
|
|
|
|
'';
|
|
|
|
|
2015-05-20 05:43:48 +01:00
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://wiredtiger.com/";
|
2015-04-08 21:02:56 +01:00
|
|
|
description = "";
|
|
|
|
license = licenses.gpl2;
|
2015-04-17 14:32:25 +01:00
|
|
|
platforms = intersectLists platforms.unix platforms.x86_64;
|
2015-04-08 21:02:56 +01:00
|
|
|
};
|
|
|
|
}
|