2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl
|
2020-04-24 23:36:52 +00:00
|
|
|
, cxxSupport ? true
|
|
|
|
, compat185 ? true
|
|
|
|
, dbmSupport ? false
|
|
|
|
|
|
|
|
# Options from inherited versions
|
|
|
|
, version, sha256
|
|
|
|
, extraPatches ? [ ]
|
2021-02-05 17:12:51 +00:00
|
|
|
, license ? lib.licenses.sleepycat
|
2020-04-24 23:36:52 +00:00
|
|
|
, drvArgs ? {}
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation (rec {
|
2022-01-13 20:06:32 +00:00
|
|
|
pname = "db";
|
|
|
|
inherit version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-01-13 20:06:32 +00:00
|
|
|
url = "https://download.oracle.com/berkeley-db/${pname}-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = extraPatches;
|
|
|
|
|
|
|
|
outputs = [ "bin" "out" "dev" ];
|
|
|
|
|
|
|
|
configureFlags =
|
|
|
|
[
|
|
|
|
(if cxxSupport then "--enable-cxx" else "--disable-cxx")
|
|
|
|
(if compat185 then "--enable-compat185" else "--disable-compat185")
|
|
|
|
]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional dbmSupport "--enable-dbm"
|
|
|
|
++ lib.optional stdenv.isFreeBSD "--with-pic";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cd build_unix
|
|
|
|
configureScript=../dist/configure
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
rm -rf $out/docs
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
make examples_c examples_cxx
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/index.html";
|
|
|
|
description = "Berkeley DB";
|
|
|
|
license = license;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
} // drvArgs)
|