nixpkgs/pkgs/development/libraries/db/generic.nix

57 lines
1.2 KiB
Nix
Raw Normal View History

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