Revert detection of system pytalloc-util for python3

This commit is contained in:
Lukas Slebodnik 2017-06-03 11:47:51 +02:00
parent f5da48cc61
commit d5b8e3f89f
3 changed files with 178 additions and 0 deletions

View File

@ -0,0 +1,66 @@
From f9d6bc97b003249a9e0ebb222ba3ee6a7bea1caa Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn@redhat.com>
Date: Sat, 3 Jun 2017 11:50:26 +0200
Subject: [PATCH 1/2] Revert "waf: disable-python - align talloc's wscript"
This reverts commit dcba0b19757b64164577722976b3da7622ff3955.
---
lib/talloc/wscript | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index df7e6be55939a1aa9004e2decb65768387fb4b60..af939104a173208a0e9206b721a514d5b752a655 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -32,6 +32,9 @@ def set_options(opt):
opt.add_option('--enable-talloc-compat1',
help=("Build talloc 1.x.x compat library [False]"),
action="store_true", dest='TALLOC_COMPAT1', default=False)
+ opt.add_option('--disable-python',
+ help=("disable the pytalloc module"),
+ action="store_true", dest='disable_python', default=False)
def configure(conf):
@@ -43,6 +46,8 @@ def configure(conf):
conf.define('TALLOC_BUILD_VERSION_MINOR', int(VERSION.split('.')[1]))
conf.define('TALLOC_BUILD_VERSION_RELEASE', int(VERSION.split('.')[2]))
+ conf.env.disable_python = getattr(Options.options, 'disable_python', False)
+
conf.env.TALLOC_COMPAT1 = False
if conf.env.standalone_talloc:
conf.env.TALLOC_COMPAT1 = Options.options.TALLOC_COMPAT1
@@ -137,7 +142,7 @@ def build(bld):
private_library=private_library,
manpages='man/talloc.3')
- if not bld.CONFIG_SET('USING_SYSTEM_PYTALLOC_UTIL'):
+ if not bld.CONFIG_SET('USING_SYSTEM_PYTALLOC_UTIL') and not bld.env.disable_python:
for env in bld.gen_python_environments(['PKGCONFIGDIR']):
name = bld.pyembed_libname('pytalloc-util')
@@ -151,19 +156,16 @@ def build(bld):
abi_match='pytalloc_* _pytalloc_*',
private_library=private_library,
public_headers=('' if private_library else 'pytalloc.h'),
- pc_files='pytalloc-util.pc',
- enabled=bld.PYTHON_BUILD_IS_ENABLED()
+ pc_files='pytalloc-util.pc'
)
bld.SAMBA_PYTHON('pytalloc',
'pytalloc.c',
deps='talloc ' + name,
- enabled=bld.PYTHON_BUILD_IS_ENABLED(),
realname='talloc.so')
bld.SAMBA_PYTHON('test_pytalloc',
'test_pytalloc.c',
deps='pytalloc',
- enabled=bld.PYTHON_BUILD_IS_ENABLED(),
realname='_test_pytalloc.so',
install=False)
--
2.13.0

View File

@ -0,0 +1,107 @@
From c8f013a451cb3ed1917dc9183833978a39f25c05 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn@redhat.com>
Date: Sat, 3 Jun 2017 11:50:48 +0200
Subject: [PATCH 2/2] Revert "talloc: use the system pytalloc-util for python3
as well"
This reverts commit f5cafee0c7a96396798d2b229ff3f9dced1d74f3.
---
lib/talloc/pytalloc-util.pc.in | 4 ++--
lib/talloc/wscript | 44 ++++++++++++++----------------------------
2 files changed, 16 insertions(+), 32 deletions(-)
diff --git a/lib/talloc/pytalloc-util.pc.in b/lib/talloc/pytalloc-util.pc.in
index 06f83e26aa43b3eafd0364c1603673742c2de63b..b87c94edf20c5325d3cde598bfa914bd478ed815 100644
--- a/lib/talloc/pytalloc-util.pc.in
+++ b/lib/talloc/pytalloc-util.pc.in
@@ -3,9 +3,9 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
-Name: pytalloc-util@PYTHON_SO_ABI_FLAG@
+Name: pytalloc-util
Description: Utility functions for using talloc objects with Python
Version: @TALLOC_VERSION@
-Libs: @LIB_RPATH@ -L${libdir} -lpytalloc-util@PYTHON_LIBNAME_SO_ABI_FLAG@
+Libs: @LIB_RPATH@ -L${libdir} -lpytalloc-util@PYTHON_SO_ABI_FLAG@
Cflags: -I${includedir}
URL: http://talloc.samba.org/
diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index af939104a173208a0e9206b721a514d5b752a655..7f9bad743555b442be30a91bf50cb361bfa0de18 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -48,24 +48,20 @@ def configure(conf):
conf.env.disable_python = getattr(Options.options, 'disable_python', False)
+ if not conf.env.standalone_talloc:
+ if conf.CHECK_BUNDLED_SYSTEM_PKG('talloc', minversion=VERSION,
+ implied_deps='replace'):
+ conf.define('USING_SYSTEM_TALLOC', 1)
+ if conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
+ implied_deps='talloc replace'):
+ conf.define('USING_SYSTEM_PYTALLOC_UTIL', 1)
+
conf.env.TALLOC_COMPAT1 = False
if conf.env.standalone_talloc:
conf.env.TALLOC_COMPAT1 = Options.options.TALLOC_COMPAT1
- conf.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
- conf.env.TALLOC_VERSION = VERSION
conf.CHECK_XSLTPROC_MANPAGES()
- conf.CHECK_HEADERS('sys/auxv.h')
- conf.CHECK_FUNCS('getauxval')
-
- conf.SAMBA_CONFIG_H()
-
- conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
-
- # We need to set everything non-python up before here, because
- # SAMBA_CHECK_PYTHON makes a copy of conf and we need it set up correctly
-
if not conf.env.disable_python:
# also disable if we don't have the python libs installed
conf.SAMBA_CHECK_PYTHON(mandatory=False, version=(2,4,2))
@@ -74,32 +70,20 @@ def configure(conf):
Logs.warn('Disabling pytalloc-util as python devel libs not found')
conf.env.disable_python = True
- if not conf.env.standalone_talloc:
- if conf.CHECK_BUNDLED_SYSTEM_PKG('talloc', minversion=VERSION,
- implied_deps='replace'):
- conf.define('USING_SYSTEM_TALLOC', 1)
+ conf.CHECK_HEADERS('sys/auxv.h')
+ conf.CHECK_FUNCS('getauxval')
- using_system_pytalloc_util = True
- if not conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
- implied_deps='talloc replace'):
- using_system_pytalloc_util = False
+ conf.SAMBA_CONFIG_H()
- # We need to get a pytalloc-util for all the python versions
- # we are building for
- if conf.env['EXTRA_PYTHON']:
- name = 'pytalloc-util' + conf.all_envs['extrapython']['PYTHON_SO_ABI_FLAG']
- if not conf.CHECK_BUNDLED_SYSTEM_PKG(name, minversion=VERSION,
- implied_deps='talloc replace'):
- using_system_pytalloc_util = False
-
- if using_system_pytalloc_util:
- conf.define('USING_SYSTEM_PYTALLOC_UTIL', 1)
+ conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
def build(bld):
bld.RECURSE('lib/replace')
if bld.env.standalone_talloc:
+ bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
+ bld.env.TALLOC_VERSION = VERSION
private_library = False
# should we also install the symlink to libtalloc1.so here?
--
2.13.0

View File

@ -47,6 +47,8 @@ BuildRequires: python3-tevent
%endif
# Patches
Patch0001: 0001-Revert-waf-disable-python-align-talloc-s-wscript.patch
Patch0002: 0002-Revert-talloc-use-the-system-pytalloc-util-for-pytho.patch
%description
An extensible library that implements an LDAP like API to access remote LDAP
@ -132,6 +134,8 @@ Development files for the Python bindings for the LDB library
%prep
%setup -q -n ldb-%{version}
%patch0001 -p1
%patch0002 -p1
%build
@ -156,6 +160,7 @@ doxygen Doxyfile
make install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT%{_libdir}/libldb.a
rm -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/pyldb-util.cpython*
# Shared libraries need to be marked executable for
# rpmbuild to strip them and include them in debuginfo