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