blob: 6dd3ec3a9aa8a352bdfc161c8161b5489abfc93f [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
2HOMEPAGE = "http://ldb.samba.org"
3SECTION = "libs"
Andrew Geissler9aee5002022-03-30 16:27:02 +00004LICENSE = "LGPL-3.0-or-later & LGPL-2.1-or-later & GPL-3.0-or-later"
Andrew Geissler595f6302022-01-24 19:11:47 +00005
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
Patrick Williams03907ee2022-05-01 06:28:52 -050035SRC_URI[md5sum] = "6824f69ea3bb58cb8a3be4c179e7569a"
36SRC_URI[sha256sum] = "9ef39700ff05b3e8f5801d2a39fe1ba023218650f81c9d377caca22f49076807"
Andrew Geissler595f6302022-01-24 19:11:47 +000037
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"
Patrick Williams03907ee2022-05-01 06:28:52 -050071
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}