Fix build on 32 bit architectures

* lmdb is supported in ldb just on 64 bit architectures
This commit is contained in:
Lukas Slebodnik 2018-05-30 23:29:28 +02:00
parent 650490cad8
commit 0b97065b6b
2 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,60 @@
From 04e74153057d34b5dbdbc03f47d7684b4d4c1093 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn@fedoraproject.org>
Date: Wed, 30 May 2018 23:22:40 +0200
Subject: [PATCH] ldb: Run at least some tests on 32 bit machines
lmdb is supported only on 64 bit machines. But there also
unit tests which pass just with tdb on 32 bit architectures.
Signed-off-by: Lukas Slebodnik <lslebodn@fedoraproject.org>
---
lib/ldb/wscript | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/lib/ldb/wscript b/lib/ldb/wscript
index f5cb1e0ab28dc01e5b031c7c290bed26c7007676..03279772557284d96f5b8c81ed4a8513e5c65f17 100644
--- a/lib/ldb/wscript
+++ b/lib/ldb/wscript
@@ -518,10 +518,6 @@ def test(ctx):
env = samba_utils.LOAD_ENVIRONMENT()
ctx.env = env
- if not env.HAVE_LMDB:
- raise Utils.WafError('make test called, but ldb was built '
- '--without-ldb-lmdb')
-
test_prefix = "%s/st" % (Utils.g_module.blddir)
shutil.rmtree(test_prefix, ignore_errors=True)
os.makedirs(test_prefix)
@@ -537,9 +533,13 @@ def test(ctx):
tmp_dir = os.path.join(test_prefix, 'tmp')
if not os.path.exists(tmp_dir):
os.mkdir(tmp_dir)
- pyret = samba_utils.RUN_PYTHON_TESTS(
- ['tests/python/api.py', 'tests/python/index.py'],
- extra_env={'SELFTEST_PREFIX': test_prefix})
+
+ if env.HAVE_LMDB:
+ pyret = samba_utils.RUN_PYTHON_TESTS(
+ ['tests/python/api.py', 'tests/python/index.py'],
+ extra_env={'SELFTEST_PREFIX': test_prefix})
+ else:
+ pyret = 0
print("Python testsuite returned %d" % pyret)
cmocka_ret = 0
@@ -549,7 +549,10 @@ def test(ctx):
'ldb_tdb_guid_mod_op_test',
'ldb_msg_test',
'ldb_tdb_kv_ops_test',
- 'ldb_tdb_test',
+ 'ldb_tdb_test']
+
+ if env.HAVE_LMDB:
+ test_exes += [
'ldb_mdb_mod_op_test',
'ldb_lmdb_test',
# we don't want to run ldb_lmdb_size_test (which proves we can
--
2.17.0

View File

@ -50,6 +50,7 @@ BuildRequires: python3-tevent
# Patches
Patch0001: 0001-ldb-Fix-memory-leak-on-module-context.patch
Patch0002: 0002-ldb-Run-at-least-some-tests-on-32-bit-machines.patch
%description
An extensible library that implements an LDAP like API to access remote LDAP
@ -136,6 +137,7 @@ Development files for the Python bindings for the LDB library
%prep
%setup -q -n ldb-%{version}
%patch0001 -p3
%patch0002 -p3
%build
@ -184,7 +186,10 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_*
%dir %{_libdir}/ldb
%{_libdir}/libldb.so.*
%{_libdir}/ldb/libldb-key-value.so
# lmdb is not supported on 32 bit architectures
%if %{__isa_bits} == 64
%{_libdir}/ldb/libldb-mdb-int.so
%endif
%dir %{_libdir}/ldb/modules
%dir %{_libdir}/ldb/modules/ldb
%{_libdir}/ldb/modules/ldb/*.so