From b41ac15d94c275328237acd5f1f780fec81efbbe1271350c52e4dbf8e81618c9 Mon Sep 17 00:00:00 2001 From: Johannes Segitz Date: Mon, 11 Nov 2019 07:03:37 +0000 Subject: [PATCH] Accepting request 744322 from home:mcepl:branches:security:SELinux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add python3.8-compat.patch which makes build possible even with Python 3.8, which doesn’t automatically adds -lpython OBS-URL: https://build.opensuse.org/request/show/744322 OBS-URL: https://build.opensuse.org/package/show/security:SELinux/libselinux?expand=0&rev=117 --- libselinux-bindings.changes | 6 ++++++ libselinux-bindings.spec | 5 ++++- python3.8-compat.patch | 14 ++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 python3.8-compat.patch diff --git a/libselinux-bindings.changes b/libselinux-bindings.changes index d98be7d..54f4673 100644 --- a/libselinux-bindings.changes +++ b/libselinux-bindings.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Oct 30 17:21:00 CET 2019 - Matej Cepl + +- Add python3.8-compat.patch which makes build possible even with + Python 3.8, which doesn’t automatically adds -lpython + ------------------------------------------------------------------- Tue May 28 08:28:03 UTC 2019 - Martin Liška diff --git a/libselinux-bindings.spec b/libselinux-bindings.spec index 61ee87d..961c478 100644 --- a/libselinux-bindings.spec +++ b/libselinux-bindings.spec @@ -31,6 +31,9 @@ Source1: selinux-ready Source2: baselibs.conf # PATCH-FIX-UPSTREAM Include for readv prototype Patch4: readv-proto.patch +# PATCH-FIX-UPSTREAM python3.8-compat.patch mcepl@suse.com +# Make linking working even when default pkg-config doesn’t provide -lpython +Patch5: python3.8-compat.patch BuildRequires: libsepol-devel-static >= %{libsepol_ver} BuildRequires: pcre-devel BuildRequires: python-rpm-macros @@ -75,7 +78,7 @@ language. %prep %setup -q -n libselinux-%{version} -%patch4 -p1 +%autopatch -p1 %build %define _lto_cflags %{nil} diff --git a/python3.8-compat.patch b/python3.8-compat.patch new file mode 100644 index 0000000..45c7fc9 --- /dev/null +++ b/python3.8-compat.patch @@ -0,0 +1,14 @@ +--- a/src/Makefile ++++ b/src/Makefile +@@ -13,7 +13,11 @@ LIBDIR ?= $(PREFIX)/lib + SHLIBDIR ?= /lib + INCLUDEDIR ?= $(PREFIX)/include + PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX)) ++ifeq ($(shell $(PKG_CONFIG) --exists $(PYPREFIX)-embed && echo true), true) ++PYLIBS ?= $(shell $(PKG_CONFIG) --libs $(PYPREFIX)-embed) ++else + PYLIBS ?= $(shell $(PKG_CONFIG) --libs $(PYPREFIX)) ++endif + PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib(plat_specific=1, prefix='$(PREFIX)'))") + PYCEXT ?= $(shell $(PYTHON) -c 'import imp;print([s for s,m,t in imp.get_suffixes() if t == imp.C_EXTENSION][0])') + RUBYINC ?= $(shell $(RUBY) -e 'puts "-I" + RbConfig::CONFIG["rubyarchhdrdir"] + " -I" + RbConfig::CONFIG["rubyhdrdir"]')