nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv
2, fetchurl
3, python3
4, pkg-config
5, readline
6, tdb
7, talloc
8, tevent
9, popt
10, libxslt
11, docbook-xsl-nons
12, docbook_xml_dtd_42
13, cmocka
14, wafHook
15, libxcrypt
16}:
17
18stdenv.mkDerivation rec {
19 pname = "ldb";
20 version = "2.6.2";
21
22 src = fetchurl {
23 url = "mirror://samba/ldb/${pname}-${version}.tar.gz";
24 hash = "sha256-XLxjw1KTwjSzn5S6n/yonW0HiSXX+QIfgIZz3t8tkl4=";
25 };
26
27 outputs = [ "out" "dev" ];
28
29 nativeBuildInputs = [
30 pkg-config
31 python3
32 wafHook
33 libxslt
34 docbook-xsl-nons
35 docbook_xml_dtd_42
36 tdb
37 tevent
38 ];
39
40 buildInputs = [
41 python3
42 readline # required to build python
43 tdb
44 talloc
45 tevent
46 popt
47 cmocka
48 libxcrypt
49 ];
50
51 # otherwise the configure script fails with
52 # PYTHONHASHSEED=1 missing! Don't use waf directly, use ./configure and make!
53 preConfigure = ''
54 export PKGCONFIG="$PKG_CONFIG"
55 export PYTHONHASHSEED=1
56 '';
57
58 wafPath = "buildtools/bin/waf";
59
60 wafConfigureFlags = [
61 "--bundled-libraries=NONE"
62 "--builtin-libraries=replace"
63 "--without-ldb-lmdb"
64 ];
65
66 # python-config from build Python gives incorrect values when cross-compiling.
67 # If python-config is not found, the build falls back to using the sysconfig
68 # module, which works correctly in all cases.
69 PYTHON_CONFIG = "/invalid";
70
71 stripDebugList = [ "bin" "lib" "modules" ];
72
73 meta = with lib; {
74 broken = stdenv.isDarwin;
75 description = "A LDAP-like embedded database";
76 homepage = "https://ldb.samba.org/";
77 license = licenses.lgpl3Plus;
78 platforms = platforms.all;
79 };
80}