blob: af5f0427d47f2e96868c092473d0f124cb70ee7e [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
2HOMEPAGE = "http://ldb.samba.org"
3SECTION = "libs"
4LICENSE = "LGPL-3.0-or-later & LGPL-2.1-or-later & GPL-3.0-or-later"
5
6DEPENDS += "libtdb libtalloc libtevent popt"
7RDEPENDS:pyldb += "python3"
8
9SRC_URI = "http://samba.org/ftp/ldb/ldb-${PV}.tar.gz \
10 file://0001-do-not-import-target-module-while-cross-compile.patch \
11 file://0002-ldb-Add-configure-options-for-packages.patch \
12 file://0001-Fix-pyext_PATTERN-for-cross-compilation.patch \
13 file://libldb-fix-musl-libc-conflict-type-error.patch \
14 "
15
16PACKAGECONFIG ??= "\
17 ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)} \
18 ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
19"
20PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
21PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
22PACKAGECONFIG[ldap] = ",,openldap"
23PACKAGECONFIG[libaio] = "--with-libaio,--without-libaio,libaio"
24PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
25PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
26PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
27PACKAGECONFIG[lmdb] = ",--without-ldb-lmdb,lmdb,"
28
29SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'ldap', '', 'file://0003-avoid-openldap-unless-wanted.patch', d)}"
30
31LIC_FILES_CHKSUM = "file://pyldb.h;endline=24;md5=dfbd238cecad76957f7f860fbe9adade \
32 file://man/ldb.3.xml;beginline=261;endline=262;md5=137f9fd61040c1505d1aa1019663fd08 \
33 file://tools/ldbdump.c;endline=19;md5=a7d4fc5d1f75676b49df491575a86a42"
34
35SRC_URI[md5sum] = "b01d6913a06901c22c5bc6caedc548ac"
36SRC_URI[sha256sum] = "f2e88dcab7b6007d92724b62f8a16e7c6e77275885c60eb4f87097e4aa4082c1"
37
38inherit pkgconfig waf-samba
39
40S = "${WORKDIR}/ldb-${PV}"
41
42#cross_compile cannot use preforked process, since fork process earlier than point subproces.popen
43#to cross Popen
44export WAF_NO_PREFORK="yes"
45
46EXTRA_OECONF += "--disable-rpath \
47 --disable-rpath-install \
48 --bundled-libraries=cmocka \
49 --builtin-libraries=replace \
50 --with-modulesdir=${libdir}/ldb/modules \
51 --with-privatelibdir=${libdir}/ldb \
52 --with-libiconv=${STAGING_DIR_HOST}${prefix}\
53 "
54
55PACKAGES =+ "pyldb pyldb-dbg pyldb-dev"
56
57NOAUTOPACKAGEDEBUG = "1"
58
59FILES:${PN} += "${libdir}/ldb/*"
60FILES:${PN}-dbg += "${bindir}/.debug/* \
61 ${libdir}/.debug/* \
62 ${libdir}/ldb/.debug/* \
63 ${libdir}/ldb/modules/ldb/.debug/*"
64
65FILES:pyldb = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/* \
66 ${libdir}/libpyldb-util.*.so.* \
67 "
68FILES:pyldb-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug \
69 ${libdir}/.debug/libpyldb-util.*.so.*"
70FILES:pyldb-dev = "${libdir}/libpyldb-util.*.so"
71
72# Prevent third_party/waf/waflib/Configure.py checking host's path which is
73# incorrect for cross building.
74export PREFIX = "/"
75export LIBDIR = "${libdir}"
76export BINDIR = "${bindir}"
77
78do_configure:prepend() {
79 # For a clean rebuild
80 rm -fr bin/
81}