1 { lib, stdenv, fetchurl, autoreconfHook
6 # Options from inherited versions
9 , license ? lib.licenses.sleepycat
13 stdenv.mkDerivation (rec {
18 url = "https://download.oracle.com/berkeley-db/${pname}-${version}.tar.gz";
22 # The provided configure script features `main` returning implicit `int`, which causes
23 # configure checks to work incorrectly with clang 16.
24 nativeBuildInputs = [ autoreconfHook ];
26 patches = extraPatches;
28 outputs = [ "bin" "out" "dev" ];
30 # Required when regenerated the configure script to make sure the vendored macros are found.
31 autoreconfFlags = [ "-fi" "-Iaclocal" "-Iaclocal_java" ];
35 # Upstream’s `dist/s_config` cats everything into `aclocal.m4`, but that doesn’t work with
36 # autoreconfHook, so cat `config.m4` to another file. Otherwise, it won’t be found by `aclocal`.
37 cat aclocal/config.m4 >> aclocal/options.m4
40 # This isn’t pretty. The version information is kept separate from the configure script.
41 # After the configure script is regenerated, the version information has to be replaced with the
42 # contents of `dist/RELEASE`.
52 "DB_VERSION_FULL_STRING"
53 "DB_VERSION_UNIQUE_NAME"
57 for var in "''${vars[@]}"; do
58 sed -e "s/__EDIT_''${var}__/''${!var}/g" -i configure
66 (if cxxSupport then "--enable-cxx" else "--disable-cxx")
67 (if compat185 then "--enable-compat185" else "--disable-compat185")
69 ++ lib.optional dbmSupport "--enable-dbm"
70 ++ lib.optional stdenv.isFreeBSD "--with-pic";
74 configureScript=../dist/configure
81 enableParallelBuilding = true;
86 make examples_c examples_cxx
90 homepage = "https://www.oracle.com/database/technologies/related/berkeleydb.html";
91 description = "Berkeley DB";
93 platforms = platforms.unix;