xref: /openbmc/openbmc/meta-openembedded/meta-networking/recipes-support/libldb/libldb_2.8.1.bb (revision 96e4b4e121e0e2da1535d7d537d6a982a6ff5bc0)
1SUMMARY = "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 cmocka"
7RDEPENDS:pyldb += "python3"
8
9export PYTHONHASHSEED = "1"
10export PYTHONARCHDIR = "${PYTHON_SITEPACKAGES_DIR}"
11
12SRC_URI = "http://samba.org/ftp/ldb/ldb-${PV}.tar.gz \
13           file://0001-do-not-import-target-module-while-cross-compile.patch \
14           file://0002-ldb-Add-configure-options-for-packages.patch \
15           file://0003-Fix-pyext_PATTERN-for-cross-compilation.patch \
16           file://run-ptest \
17          "
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[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
27PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
28PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
29PACKAGECONFIG[lmdb] = ",--without-ldb-lmdb,lmdb,"
30
31SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'ldap', '', 'file://avoid-openldap-unless-wanted.patch', d)}"
32
33LIC_FILES_CHKSUM = "file://pyldb.h;endline=24;md5=dfbd238cecad76957f7f860fbe9adade \
34                    file://man/ldb.3.xml;beginline=261;endline=262;md5=137f9fd61040c1505d1aa1019663fd08 \
35                    file://tools/ldbdump.c;endline=19;md5=a7d4fc5d1f75676b49df491575a86a42"
36
37SRC_URI[sha256sum] = "b68ce6eb0ccd2870fa3c8c334f2028b5d16606fd41308696c17b71959f7bf59f"
38
39inherit pkgconfig waf-samba ptest
40
41S = "${WORKDIR}/ldb-${PV}"
42
43# Cross_compile cannot use preforked process, since fork process earlier than point subproces.popen
44# to cross Popen
45export WAF_NO_PREFORK = "yes"
46
47EXTRA_OECONF += "--disable-rpath \
48                 --disable-rpath-install \
49                 --bundled-libraries=NONE \
50                 --builtin-libraries=replace \
51                 --with-modulesdir=${libdir}/ldb/modules \
52                 --with-privatelibdir=${libdir}/ldb \
53                 --with-libiconv=${STAGING_DIR_HOST}${prefix}\
54                "
55
56PACKAGES =+ "pyldb pyldb-dbg pyldb-dev"
57
58NOAUTOPACKAGEDEBUG = "1"
59
60FILES:${PN} += "${libdir}/ldb/*"
61FILES:${PN}-dbg += "${bindir}/.debug/* \
62                    ${libdir}/.debug/* \
63                    ${libdir}/ldb/.debug/* \
64                    ${libdir}/ldb/modules/ldb/.debug/*"
65
66FILES:pyldb = "${PYTHON_SITEPACKAGES_DIR}/* \
67               ${libdir}/libpyldb-util.*.so.* \
68              "
69FILES:pyldb-dbg = "${PYTHON_SITEPACKAGES_DIR}/.debug \
70                   ${libdir}/.debug/libpyldb-util.*.so.*"
71FILES:pyldb-dev = "${libdir}/libpyldb-util.*.so"
72
73# Prevent third_party/waf/waflib/Configure.py checking host's path which is
74# incorrect for cross building.
75export PREFIX = "/"
76export LIBDIR = "${libdir}"
77export BINDIR = "${bindir}"
78
79do_configure:prepend() {
80    # For a clean rebuild
81    rm -fr bin/
82}
83
84do_install_ptest() {
85    install -d ${D}${PTEST_PATH}/tests
86    install -m 0755 ${B}/bin/test_ldb_* ${D}${PTEST_PATH}/tests/
87}
88