2021-01-21 09:00:13 -08:00
|
|
|
{ lib, stdenv, fetchurl
|
2014-01-31 01:25:49 -08:00
|
|
|
, cxxSupport ? true
|
|
|
|
, compat185 ? true
|
2016-11-16 13:22:10 -08:00
|
|
|
, dbmSupport ? false
|
2014-01-31 01:25:49 -08:00
|
|
|
|
|
|
|
# Options from inherited versions
|
|
|
|
, version, sha256
|
2018-07-20 17:44:44 -07:00
|
|
|
, extraPatches ? [ ]
|
2021-01-21 09:00:13 -08:00
|
|
|
, license ? lib.licenses.sleepycat
|
2016-02-07 08:20:07 -08:00
|
|
|
, drvArgs ? {}
|
2014-01-31 01:25:49 -08:00
|
|
|
}:
|
|
|
|
|
2016-02-07 08:20:07 -08:00
|
|
|
stdenv.mkDerivation (rec {
|
2014-01-31 01:25:49 -08:00
|
|
|
name = "db-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 11:43:35 -07:00
|
|
|
url = "https://download.oracle.com/berkeley-db/${name}.tar.gz";
|
2014-01-31 01:25:49 -08:00
|
|
|
sha256 = sha256;
|
|
|
|
};
|
2014-03-24 18:01:24 -07:00
|
|
|
|
2014-01-31 01:25:49 -08:00
|
|
|
patches = extraPatches;
|
|
|
|
|
2018-05-22 06:47:28 -07:00
|
|
|
outputs = [ "bin" "out" "dev" ];
|
2018-04-16 05:10:42 -07:00
|
|
|
|
2016-11-16 13:22:10 -08:00
|
|
|
configureFlags =
|
|
|
|
[
|
|
|
|
(if cxxSupport then "--enable-cxx" else "--disable-cxx")
|
|
|
|
(if compat185 then "--enable-compat185" else "--disable-compat185")
|
|
|
|
]
|
2021-01-21 09:00:13 -08:00
|
|
|
++ lib.optional dbmSupport "--enable-dbm"
|
|
|
|
++ lib.optional stdenv.isFreeBSD "--with-pic";
|
2014-01-31 01:25:49 -08:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cd build_unix
|
|
|
|
configureScript=../dist/configure
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
rm -rf $out/docs
|
|
|
|
'';
|
|
|
|
|
2019-03-11 13:11:12 -07:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2016-11-13 13:48:52 -08:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
make examples_c examples_cxx
|
|
|
|
'';
|
|
|
|
|
2021-01-21 09:00:13 -08:00
|
|
|
meta = with lib; {
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/index.html";
|
2014-01-31 01:25:49 -08:00
|
|
|
description = "Berkeley DB";
|
|
|
|
license = license;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2016-02-07 08:20:07 -08:00
|
|
|
} // drvArgs)
|