blob: daf0f73b8959fa69ebaf3529992d5bf4f213df64 [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
Patrick Williams8e7b46e2023-05-01 14:19:06 -050038SRC_URI[sha256sum] = "26ee72d647854e662d99643eb2b2d341655abf31f4990838d6650fb5cf9209c8"
Andrew Geissler517393d2023-01-13 08:55:19 -060039
40inherit pkgconfig waf-samba
41
42S = "${WORKDIR}/ldb-${PV}"
43
44#cross_compile cannot use preforked process, since fork process earlier than point subproces.popen
45#to cross Popen
46export WAF_NO_PREFORK="yes"
47
48EXTRA_OECONF += "--disable-rpath \
49 --disable-rpath-install \
50 --bundled-libraries=cmocka \
51 --builtin-libraries=replace \
52 --with-modulesdir=${libdir}/ldb/modules \
53 --with-privatelibdir=${libdir}/ldb \
54 --with-libiconv=${STAGING_DIR_HOST}${prefix}\
55 "
56
57PACKAGES =+ "pyldb pyldb-dbg pyldb-dev"
58
59NOAUTOPACKAGEDEBUG = "1"
60
61FILES:${PN} += "${libdir}/ldb/*"
62FILES:${PN}-dbg += "${bindir}/.debug/* \
63 ${libdir}/.debug/* \
64 ${libdir}/ldb/.debug/* \
65 ${libdir}/ldb/modules/ldb/.debug/*"
66
67FILES:pyldb = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/* \
68 ${libdir}/libpyldb-util.*.so.* \
69 "
70FILES:pyldb-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug \
71 ${libdir}/.debug/libpyldb-util.*.so.*"
72FILES:pyldb-dev = "${libdir}/libpyldb-util.*.so"
73
74# Prevent third_party/waf/waflib/Configure.py checking host's path which is
75# incorrect for cross building.
76export PREFIX = "/"
77export LIBDIR = "${libdir}"
78export BINDIR = "${bindir}"
79
80do_configure:prepend() {
81 # For a clean rebuild
82 rm -fr bin/
83}