2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchurl
|
|
|
|
, python3
|
|
|
|
, pkg-config
|
|
|
|
, readline
|
|
|
|
, tdb
|
|
|
|
, talloc
|
|
|
|
, tevent
|
|
|
|
, popt
|
|
|
|
, libxslt
|
|
|
|
, docbook-xsl-nons
|
|
|
|
, docbook_xml_dtd_42
|
|
|
|
, cmocka
|
|
|
|
, wafHook
|
2024-06-20 14:57:18 +00:00
|
|
|
, buildPackages
|
2023-02-16 17:41:37 +00:00
|
|
|
, libxcrypt
|
2024-04-21 15:54:59 +00:00
|
|
|
, testers
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "ldb";
|
2024-07-31 10:19:44 +00:00
|
|
|
version = "2.9.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-07-27 06:49:29 +00:00
|
|
|
url = "mirror://samba/ldb/ldb-${finalAttrs.version}.tar.gz";
|
2024-07-31 10:19:44 +00:00
|
|
|
hash = "sha256-yV5Nwy3qiGS3mJnuNAyf3yi0hvRku8OLqZFRoItJP5s=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
python3
|
|
|
|
wafHook
|
|
|
|
libxslt
|
|
|
|
docbook-xsl-nons
|
|
|
|
docbook_xml_dtd_42
|
2023-02-16 17:41:37 +00:00
|
|
|
tdb
|
|
|
|
tevent
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
python3
|
|
|
|
readline # required to build python
|
|
|
|
tdb
|
|
|
|
talloc
|
|
|
|
tevent
|
|
|
|
popt
|
|
|
|
cmocka
|
2023-02-16 17:41:37 +00:00
|
|
|
libxcrypt
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
# otherwise the configure script fails with
|
|
|
|
# PYTHONHASHSEED=1 missing! Don't use waf directly, use ./configure and make!
|
|
|
|
preConfigure = ''
|
|
|
|
export PKGCONFIG="$PKG_CONFIG"
|
|
|
|
export PYTHONHASHSEED=1
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
wafPath = "buildtools/bin/waf";
|
|
|
|
|
|
|
|
wafConfigureFlags = [
|
|
|
|
"--bundled-libraries=NONE"
|
|
|
|
"--builtin-libraries=replace"
|
|
|
|
"--without-ldb-lmdb"
|
2024-06-20 14:57:18 +00:00
|
|
|
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
|
|
|
"--cross-compile"
|
|
|
|
"--cross-execute=${stdenv.hostPlatform.emulator buildPackages}"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
# python-config from build Python gives incorrect values when cross-compiling.
|
|
|
|
# If python-config is not found, the build falls back to using the sysconfig
|
|
|
|
# module, which works correctly in all cases.
|
|
|
|
PYTHON_CONFIG = "/invalid";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stripDebugList = [ "bin" "lib" "modules" ];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
passthru.tests.pkg-config = testers.hasPkgConfigModules {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-09-26 11:04:55 +00:00
|
|
|
broken = stdenv.hostPlatform.isDarwin;
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "LDAP-like embedded database";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://ldb.samba.org/";
|
|
|
|
license = licenses.lgpl3Plus;
|
2024-04-21 15:54:59 +00:00
|
|
|
pkgConfigModules = [ "ldb" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2024-04-21 15:54:59 +00:00
|
|
|
})
|