summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/libldb
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2023-10-12 19:56:14 +0800
committerKhem Raj <raj.khem@gmail.com>2023-10-12 08:06:57 -0700
commit4a07ee78c57950aaf2e0858c159ffa6454f7f28a (patch)
tree4dad4ae1e57c149f775101832d5ad89d2667443f /meta-networking/recipes-support/libldb
parent287386a51f8c2ed5ad3282d9481c56b7f546a4bf (diff)
downloadmeta-openembedded-4a07ee78c57950aaf2e0858c159ffa6454f7f28a.tar.gz
libldb: add ptest
* use external cmocka instead of bundled cmocka * add run-ptest script Ptest results: $ ptest-runner libldb START: ptest-runner 2023-10-12T11:49 BEGIN: /usr/lib/libldb/ptest PASS: test_ldb_dn PASS: test_ldb_qsort DURATION: 0 END: /usr/lib/libldb/ptest 2023-10-12T11:49 STOP: ptest-runner TOTAL: 1 FAIL: 0 Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-support/libldb')
-rw-r--r--meta-networking/recipes-support/libldb/libldb/cmocka-fix-musl-libc-conflicting-types-error.patch45
-rw-r--r--meta-networking/recipes-support/libldb/libldb/run-ptest17
-rw-r--r--meta-networking/recipes-support/libldb/libldb_2.7.2.bb14
3 files changed, 26 insertions, 50 deletions
diff --git a/meta-networking/recipes-support/libldb/libldb/cmocka-fix-musl-libc-conflicting-types-error.patch b/meta-networking/recipes-support/libldb/libldb/cmocka-fix-musl-libc-conflicting-types-error.patch
deleted file mode 100644
index 8e756d8d3..000000000
--- a/meta-networking/recipes-support/libldb/libldb/cmocka-fix-musl-libc-conflicting-types-error.patch
+++ /dev/null
@@ -1,45 +0,0 @@
1From a37eb0a46669592e32ed4e004abb2698ee4f90c5 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Wed, 25 Jul 2018 09:55:25 +0800
4Subject: [PATCH] cmocka: fix musl libc conflicting types error
5
6/third_party/cmocka/cmocka.h:126:28: error: conflicting types for 'uintptr_t'
7 typedef unsigned int uintptr_t;
8 ^~~~~~~~~
9use __DEFINED_uintptr_t in alltypes.h to check if uintptr already defined
10
11Upstream-Status: Pending
12
13Signed-off-by: Changqing Li <changqing.li@windriver.com>
14---
15 third_party/cmocka/cmocka.h | 7 +++----
16 1 file changed, 3 insertions(+), 4 deletions(-)
17
18diff --git a/third_party/cmocka/cmocka.h b/third_party/cmocka/cmocka.h
19index e6861c8..238201d 100644
20--- a/third_party/cmocka/cmocka.h
21+++ b/third_party/cmocka/cmocka.h
22@@ -111,7 +111,7 @@ typedef uintmax_t LargestIntegralType;
23 ((LargestIntegralType)(value))
24
25 /* Smallest integral type capable of holding a pointer. */
26-#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED)
27+#if !defined(__DEFINED_uintptr_t)
28 # if defined(_WIN32)
29 /* WIN32 is an ILP32 platform */
30 typedef unsigned int uintptr_t;
31@@ -135,9 +135,8 @@ typedef uintmax_t LargestIntegralType;
32 # endif /* __WORDSIZE */
33 # endif /* _WIN32 */
34
35-# define _UINTPTR_T
36-# define _UINTPTR_T_DEFINED
37-#endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */
38+# define __DEFINED_uintptr_t
39+#endif /* !defined(__DEFINED_uintptr_t) */
40
41 /* Perform an unsigned cast to uintptr_t. */
42 #define cast_to_pointer_integral_type(value) \
43--
442.25.1
45
diff --git a/meta-networking/recipes-support/libldb/libldb/run-ptest b/meta-networking/recipes-support/libldb/libldb/run-ptest
new file mode 100644
index 000000000..f0de0578c
--- /dev/null
+++ b/meta-networking/recipes-support/libldb/libldb/run-ptest
@@ -0,0 +1,17 @@
1#!/bin/sh
2
3ptestdir=$(dirname "$(readlink -f "$0")")
4cd "$ptestdir"/tests || exit
5
6tests="test_ldb_dn test_ldb_qsort"
7
8for f in $tests
9do
10 if test -x ./"$f"; then
11 if ./"$f" > ./"$f".out 2> ./"$f".err; then
12 echo "PASS: $f"
13 else
14 echo "FAIL: $f"
15 fi
16 fi
17done
diff --git a/meta-networking/recipes-support/libldb/libldb_2.7.2.bb b/meta-networking/recipes-support/libldb/libldb_2.7.2.bb
index daf0f73b8..c4b7602bf 100644
--- a/meta-networking/recipes-support/libldb/libldb_2.7.2.bb
+++ b/meta-networking/recipes-support/libldb/libldb_2.7.2.bb
@@ -3,7 +3,7 @@ HOMEPAGE = "https://ldb.samba.org"
3SECTION = "libs" 3SECTION = "libs"
4LICENSE = "LGPL-3.0-or-later & LGPL-2.1-or-later & GPL-3.0-or-later" 4LICENSE = "LGPL-3.0-or-later & LGPL-2.1-or-later & GPL-3.0-or-later"
5 5
6DEPENDS += "libtdb libtalloc libtevent popt" 6DEPENDS += "libtdb libtalloc libtevent popt cmocka"
7RDEPENDS:pyldb += "python3" 7RDEPENDS:pyldb += "python3"
8 8
9export PYTHONHASHSEED="1" 9export PYTHONHASHSEED="1"
@@ -12,10 +12,9 @@ SRC_URI = "http://samba.org/ftp/ldb/ldb-${PV}.tar.gz \
12 file://0001-do-not-import-target-module-while-cross-compile.patch \ 12 file://0001-do-not-import-target-module-while-cross-compile.patch \
13 file://0002-ldb-Add-configure-options-for-packages.patch \ 13 file://0002-ldb-Add-configure-options-for-packages.patch \
14 file://0003-Fix-pyext_PATTERN-for-cross-compilation.patch \ 14 file://0003-Fix-pyext_PATTERN-for-cross-compilation.patch \
15 file://run-ptest \
15 " 16 "
16 17
17SRC_URI:append:libc-musl = " file://cmocka-fix-musl-libc-conflicting-types-error.patch"
18
19PACKAGECONFIG ??= "\ 18PACKAGECONFIG ??= "\
20 ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)} \ 19 ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)} \
21 ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \ 20 ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
@@ -37,7 +36,7 @@ LIC_FILES_CHKSUM = "file://pyldb.h;endline=24;md5=dfbd238cecad76957f7f860fbe9ada
37 36
38SRC_URI[sha256sum] = "26ee72d647854e662d99643eb2b2d341655abf31f4990838d6650fb5cf9209c8" 37SRC_URI[sha256sum] = "26ee72d647854e662d99643eb2b2d341655abf31f4990838d6650fb5cf9209c8"
39 38
40inherit pkgconfig waf-samba 39inherit pkgconfig waf-samba ptest
41 40
42S = "${WORKDIR}/ldb-${PV}" 41S = "${WORKDIR}/ldb-${PV}"
43 42
@@ -47,7 +46,7 @@ export WAF_NO_PREFORK="yes"
47 46
48EXTRA_OECONF += "--disable-rpath \ 47EXTRA_OECONF += "--disable-rpath \
49 --disable-rpath-install \ 48 --disable-rpath-install \
50 --bundled-libraries=cmocka \ 49 --bundled-libraries=NONE \
51 --builtin-libraries=replace \ 50 --builtin-libraries=replace \
52 --with-modulesdir=${libdir}/ldb/modules \ 51 --with-modulesdir=${libdir}/ldb/modules \
53 --with-privatelibdir=${libdir}/ldb \ 52 --with-privatelibdir=${libdir}/ldb \
@@ -81,3 +80,8 @@ do_configure:prepend() {
81 # For a clean rebuild 80 # For a clean rebuild
82 rm -fr bin/ 81 rm -fr bin/
83} 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}