[packages/libcomps] - up to 0.1.11
baggins
baggins at pld-linux.org
Sat Nov 2 21:09:28 CET 2019
commit 2efce5b59506bda8034d2c00a465308ec68057ce
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Sat Nov 2 21:07:58 2019 +0100
- up to 0.1.11
libcomps.spec | 14 ++++++++------
python-3.8.patch | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+), 6 deletions(-)
---
diff --git a/libcomps.spec b/libcomps.spec
index be9ac9d..8f1f71f 100644
--- a/libcomps.spec
+++ b/libcomps.spec
@@ -11,15 +11,16 @@
Summary: Comps XML file manipulation library
Summary(pl.UTF-8): Biblioteka operacji na plikach Comps XML
Name: libcomps
-Version: 0.1.8
-Release: 3
+Version: 0.1.11
+Release: 1
License: GPL v2+
Group: Libraries
#Source0Download: https://github.com/rpm-software-management/libcomps/releases
Source0: https://github.com/rpm-software-management/libcomps/archive/%{name}-%{version}.tar.gz
-# Source0-md5: 0461077e6720ea206af8d8bae004a0b7
+# Source0-md5: e63cf17441e1c7e167405e364fd52fdd
Patch0: %{name}-build.patch
Patch1: python-install-dir.patch
+Patch2: python-3.8.patch
URL: https://github.com/rpm-software-management/libcomps
BuildRequires: check-devel
BuildRequires: cmake >= 2.6
@@ -91,6 +92,7 @@ Wiązania Pythona 3.x do biblioteki libcomps.
%setup -qn %{name}-%{name}-%{version}
%patch0 -p1
%patch1 -p1
+%patch2 -p1
%build
install -d build
@@ -163,7 +165,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc README.md COPYING
-%attr(755,root,root) %{_libdir}/libcomps.so.0.1.6
+%attr(755,root,root) %{_libdir}/libcomps.so.0.1.11
%files devel
%defattr(644,root,root,755)
@@ -175,7 +177,7 @@ rm -rf $RPM_BUILD_ROOT
%if %{with python2}
%files -n python-libcomps
%defattr(644,root,root,755)
-%doc build/src/python/docs/html/{*.html,*.js,_images,_static}
+%doc build/src/python/docs/html/{*.html,*.js,_static}
%dir %{py_sitedir}/libcomps
%{py_sitedir}/libcomps/__init__.py[co]
%attr(755,root,root) %{py_sitedir}/libcomps/_libpycomps.so
@@ -183,7 +185,7 @@ rm -rf $RPM_BUILD_ROOT
%if %{with python3}
%files -n python3-libcomps
-%doc build-py3/src/python/docs/html/{*.html,*.js,_images,_static}
+%doc build-py3/src/python/docs/html/{*.html,*.js,_static}
%defattr(644,root,root,755)
%dir %{py3_sitedir}/libcomps
%{py3_sitedir}/libcomps/__init__.py
diff --git a/python-3.8.patch b/python-3.8.patch
new file mode 100644
index 0000000..2b7b58d
--- /dev/null
+++ b/python-3.8.patch
@@ -0,0 +1,50 @@
+From 45d0154a1e0bf167656d1ef4050de782452aad2c Mon Sep 17 00:00:00 2001
+From: Victor Stinner <vstinner at redhat.com>
+Date: Wed, 31 Jul 2019 15:03:36 +0200
+Subject: [PATCH] Fix Python method descriptors for Python 3.8
+
+The Python binding cannot be loaded in Python 3.8: import libcomps
+fails with:
+
+ Traceback (most recent call last):
+ File "src/python/src/python3/libcomps/__init__.py", line 1, in <module>
+ from ._libpycomps import *
+ SystemError: bad call flags
+
+Fedora bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1734777
+
+The problem are the following method descriptors of
+libcomps/src/python/src/pycomps.c:
+
+ {"categories_match", (PyCFunction)PyCOMPS_categories_match, METH_KEYWORDS,
+ PyCOMPS_validate__doc__},
+ {"environments_match", (PyCFunction)PyCOMPS_envs_match, METH_KEYWORDS,
+ PyCOMPS_validate__doc__},
+
+In Python 3.7, import didn't check descriptor flags (METH_KEYWORDS):
+these flags were only checked when the methods were called.
+
+In Python 3.8, the flags are checked at soon as the module is
+imported, which prevents the module to be imported.
+
+This change fix the two method descriptors.
+---
+ libcomps/src/python/src/pycomps.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libcomps/src/python/src/pycomps.c b/libcomps/src/python/src/pycomps.c
+index b34685c..293a338 100644
+--- a/libcomps/src/python/src/pycomps.c
++++ b/libcomps/src/python/src/pycomps.c
+@@ -766,9 +766,9 @@ PyDoc_STRVAR(PyCOMPS_arch_filter__doc__,
+ static PyMethodDef PyCOMPS_methods[] = {
+ {"groups_match", (PyCFunction)PyCOMPS_groups_match, METH_VARARGS | METH_KEYWORDS,
+ PyCOMPS_validate__doc__},
+- {"categories_match", (PyCFunction)PyCOMPS_categories_match, METH_KEYWORDS,
++ {"categories_match", (PyCFunction)PyCOMPS_categories_match, METH_VARARGS | METH_KEYWORDS,
+ PyCOMPS_validate__doc__},
+- {"environments_match", (PyCFunction)PyCOMPS_envs_match, METH_KEYWORDS,
++ {"environments_match", (PyCFunction)PyCOMPS_envs_match, METH_VARARGS | METH_KEYWORDS,
+ PyCOMPS_validate__doc__},
+ {"validate", (PyCFunction)PyCOMPS_validate, METH_NOARGS,
+ PyCOMPS_validate__doc__},
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/libcomps.git/commitdiff/2efce5b59506bda8034d2c00a465308ec68057ce
More information about the pld-cvs-commit
mailing list