Fix detection of HAVE_LARGEFILE with python2

+ use autosetup
+ rebase 2nd patch
This commit is contained in:
Lukas Slebodnik 2019-01-17 23:41:53 +01:00
parent d423db1bd0
commit 26bfbd96ca
3 changed files with 92 additions and 17 deletions

View File

@ -0,0 +1,75 @@
From 4b2829af05e4a1ebf2ba29d84cb43245e1577dd5 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn@fedoraproject.org>
Date: Thu, 17 Jan 2019 21:03:15 +0100
Subject: [PATCH] Fix detection of HAVE_LARGEFILE with python2
There is an assertion if "getconf LFS_CFLAGS" does not return empty string.
File "/builddir/build/BUILD/talloc-2.1.15/third_party/waf/waflib/Scripting.py", line 158, in waf_entry_point
run_commands()
File "/builddir/build/BUILD/talloc-2.1.15/third_party/waf/waflib/Scripting.py", line 251, in run_commands
ctx = run_command(cmd_name)
File "/builddir/build/BUILD/talloc-2.1.15/third_party/waf/waflib/Scripting.py", line 235, in run_command
ctx.execute()
File "/builddir/build/BUILD/talloc-2.1.15/third_party/waf/waflib/Configure.py", line 159, in execute
super(ConfigurationContext, self).execute()
File "/builddir/build/BUILD/talloc-2.1.15/third_party/waf/waflib/Context.py", line 204, in execute
self.recurse([os.path.dirname(g_module.root_path)])
File "/builddir/build/BUILD/talloc-2.1.15/third_party/waf/waflib/Context.py", line 286, in recurse
user_function(self)
File "/builddir/build/BUILD/talloc-2.1.15/wscript", line 37, in configure
conf.RECURSE('lib/replace')
File "./buildtools/wafsamba/samba_utils.py", line 33, in fun
return f(*k, **kw)
File "./buildtools/wafsamba/samba_utils.py", line 436, in RECURSE
return ctx.recurse(relpath)
File "/builddir/build/BUILD/talloc-2.1.15/third_party/waf/waflib/Context.py", line 286, in recurse
user_function(self)
File "/builddir/build/BUILD/talloc-2.1.15/third_party/waf/waflib/Utils.py", line 816, in wrap
ret = fun(*k)
File "/builddir/build/BUILD/talloc-2.1.15/lib/replace/wscript", line 30, in configure
conf.RECURSE('buildtools/wafsamba')
File "./buildtools/wafsamba/samba_utils.py", line 33, in fun
return f(*k, **kw)
File "./buildtools/wafsamba/samba_utils.py", line 436, in RECURSE
return ctx.recurse(relpath)
File "/builddir/build/BUILD/talloc-2.1.15/third_party/waf/waflib/Context.py", line 286, in recurse
user_function(self)
File "/builddir/build/BUILD/talloc-2.1.15/third_party/waf/waflib/Utils.py", line 816, in wrap
ret = fun(*k)
File "/builddir/build/BUILD/talloc-2.1.15/buildtools/wafsamba/wscript", line 481, in configure
if not conf.CHECK_LARGEFILE():
File "./buildtools/wafsamba/samba_utils.py", line 33, in fun
return f(*k, **kw)
File "./buildtools/wafsamba/samba_conftests.py", line 100, in CHECK_LARGEFILE
conf.DEFINE(flag_split[0], '1')
File "./buildtools/wafsamba/samba_utils.py", line 33, in fun
return f(*k, **kw)
File "./buildtools/wafsamba/samba_autoconf.py", line 20, in DEFINE
conf.define(d, v, quote=quote)
File "./buildtools/wafsamba/samba_utils.py", line 33, in fun
return f(*k, **kw)
File "./buildtools/wafsamba/samba_waf18.py", line 89, in define
assert key and isinstance(key, str)
AssertionError
Signed-off-by: Lukas Slebodnik <lslebodn@fedoraproject.org>
---
buildtools/wafsamba/samba_conftests.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py
index c0b9ae4929649692c9870edf28e8e0aa94fca113..af3b82e25f1366b74f57659978e272a075588447 100644
--- a/buildtools/wafsamba/samba_conftests.py
+++ b/buildtools/wafsamba/samba_conftests.py
@@ -86,6 +86,7 @@ def CHECK_LARGEFILE(conf, define='HAVE_LARGEFILE'):
'''see what we need for largefile support'''
getconf_cflags = conf.CHECK_COMMAND(['getconf', 'LFS_CFLAGS']);
if getconf_cflags is not False:
+ getconf_cflags = str(getconf_cflags)
if (conf.CHECK_CODE('return !(sizeof(off_t) >= 8)',
define='WORKING_GETCONF_LFS_CFLAGS',
execute=True,
--
2.20.1

View File

@ -1,4 +1,4 @@
From 04e74153057d34b5dbdbc03f47d7684b4d4c1093 Mon Sep 17 00:00:00 2001
From c161c5d4a3184c0ae9a33d977f061458337d4ca1 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
@ -8,25 +8,25 @@ unit tests which pass just with tdb on 32 bit architectures.
Signed-off-by: Lukas Slebodnik <lslebodn@fedoraproject.org>
---
lib/ldb/wscript | 19 +++++++++++--------
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):
diff --git a/wscript b/wscript
index ca0bf410f1029f33bab9b71514935011d57b1dbc..851344733645f51186d0b568f2741ac888a52660 100644
--- a/wscript
+++ b/wscript
@@ -540,10 +540,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 '
- raise Errors.WafError('make test called, but ldb was built '
- '--without-ldb-lmdb')
-
test_prefix = "%s/st" % (Utils.g_module.blddir)
test_prefix = "%s/st" % (Context.g_module.out)
shutil.rmtree(test_prefix, ignore_errors=True)
os.makedirs(test_prefix)
@@ -537,9 +533,13 @@ def test(ctx):
@@ -559,9 +555,13 @@ def test(ctx):
tmp_dir = os.path.join(test_prefix, 'tmp')
if not os.path.exists(tmp_dir):
os.mkdir(tmp_dir)
@ -43,7 +43,7 @@ index f5cb1e0ab28dc01e5b031c7c290bed26c7007676..03279772557284d96f5b8c81ed4a8513
print("Python testsuite returned %d" % pyret)
cmocka_ret = 0
@@ -549,7 +549,10 @@ def test(ctx):
@@ -572,7 +572,10 @@ def test(ctx):
'ldb_tdb_guid_mod_op_test',
'ldb_msg_test',
'ldb_tdb_kv_ops_test',
@ -56,5 +56,5 @@ index f5cb1e0ab28dc01e5b031c7c290bed26c7007676..03279772557284d96f5b8c81ed4a8513
'ldb_lmdb_test',
# we don't want to run ldb_lmdb_size_test (which proves we can
--
2.17.0
2.20.1

View File

@ -35,6 +35,10 @@ License: LGPLv3+
URL: http://ldb.samba.org/
Source: http://samba.org/ftp/ldb/ldb-%{version}.tar.gz
# Patches
Patch0001: 0001-Fix-detection-of-HAVE_LARGEFILE-with-python2.patch
Patch0002: 0002-ldb-Run-at-least-some-tests-on-32-bit-machines.patch
BuildRequires: gcc
BuildRequires: libtalloc-devel >= %{talloc_version}
BuildRequires: libtdb-devel >= %{tdb_version}
@ -61,9 +65,6 @@ BuildRequires: libcmocka-devel
Provides: bundled(libreplace)
# Patches
Patch0001: 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
servers, or use local tdb databases.
@ -147,8 +148,7 @@ Development files for the Python bindings for the LDB library
%endif
%prep
%setup -q -n ldb-%{version}
%patch0001 -p3
%autosetup -n ldb-%{version} -p1
%build