[packages/python-pyxmpp] Rel 8. Fix build with current libxml2 and enable tests.
arekm
arekm at pld-linux.org
Wed Oct 21 20:43:02 CEST 2026
commit 6eec19ba3dd0e4c6a2bbced60124f2c64facbf00
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Wed Oct 21 20:42:35 2026 +0200
Rel 8. Fix build with current libxml2 and enable tests.
python-pyxmpp-libxml2.patch | 39 +++++++++++++++++++++++++++++++++++++++
python-pyxmpp.spec | 27 +++++++++++++++++++++++----
2 files changed, 62 insertions(+), 4 deletions(-)
---
diff --git a/python-pyxmpp.spec b/python-pyxmpp.spec
index 566bd17..d303f95 100644
--- a/python-pyxmpp.spec
+++ b/python-pyxmpp.spec
@@ -1,8 +1,11 @@
+# Conditional build:
+%bcond_without tests # unit tests
+
Summary: Jabber/XMPP package for Python
Summary(pl.UTF-8): Biblioteka Jabber/XMPP dla Pythona
Name: python-pyxmpp
Version: 1.1.2
-Release: 7
+Release: 8
License: LGPL v2.1
Group: Libraries/Python
Source0: https://files.pythonhosted.org/packages/source/p/pyxmpp/pyxmpp-%{version}.tar.gz
@@ -10,15 +13,22 @@ Source0: https://files.pythonhosted.org/packages/source/p/pyxmpp/pyxmpp-%{versio
Patch0: %{name}-openfire_bug.patch
Patch1: %{name}-xep-0203.patch
Patch2: tls.patch
+Patch3: %{name}-libxml2.patch
URL: https://pypi.org/project/pyxmpp/
-BuildRequires: libxml2-devel >= 2.6.19
+BuildRequires: libxml2-devel >= 1:2.6.19
BuildRequires: python-devel >= 1:2.6
BuildRequires: python-modules
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with tests}
+BuildRequires: python-dns >= 1.6.0
+BuildRequires: python-libxml2 >= 1:2.6.19
+BuildRequires: python-modules >= 1:2.7.13
+%endif
Requires: python-dns >= 1.6.0
-Requires: python-libxml2 >= 2.6.19
-Requires: python-modules >= 1:2.6
+Requires: python-libxml2 >= 1:2.6.19
+# tls.patch uses ssl.PROTOCOL_TLS, available since Python 2.7.13.
+Requires: python-modules >= 1:2.7.13
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -32,10 +42,19 @@ Ten pakiet udostępnia interfejs Pythona do protokołów XMPP i Jabber.
%patch -P0 -p1
%patch -P1 -p1
%patch -P2 -p1
+%patch -P3 -p1
%build
%py_build
+%if %{with tests}
+PYTHONPATH=$(echo "$PWD"/build-2/lib.*)
+export PYTHONPATH
+cd tests
+%{__python} -m unittest -v all.suite
+cd ..
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
diff --git a/python-pyxmpp-libxml2.patch b/python-pyxmpp-libxml2.patch
new file mode 100644
index 0000000..83c86dd
--- /dev/null
+++ b/python-pyxmpp-libxml2.patch
@@ -0,0 +1,39 @@
+# libxml2 no longer defines ATTRIBUTE_UNUSED for unused callback arguments.
+--- a/ext/xmlextra.c
++++ b/ext/xmlextra.c
+@@ -60,7 +60,7 @@
+
+ /* Tree manipulation functions */
+
+-static PyObject * remove_ns(ATTRIBUTE_UNUSED PyObject *self, PyObject *args) {
++static PyObject * remove_ns(PyObject *self, PyObject *args) {
+ PyObject *pyobj_tree,*pyobj_ns;
+ xmlNsPtr nsDef,prev;
+ xmlNodePtr node;
+@@ -164,7 +164,7 @@
+ return Py_None;
+ }
+
+-static PyObject * replace_ns(ATTRIBUTE_UNUSED PyObject *self, PyObject *args) {
++static PyObject * replace_ns(PyObject *self, PyObject *args) {
+ PyObject *pyobj_tree,*pyobj_old_ns,*pyobj_new_ns;
+ xmlNodePtr tree,node;
+ xmlAttrPtr attr;
+@@ -409,7 +409,7 @@
+ else Py_DECREF(obj);
+ }
+
+-static PyObject * sax_reader_new(ATTRIBUTE_UNUSED PyObject *self, PyObject *args) {
++static PyObject * sax_reader_new(PyObject *self, PyObject *args) {
+ SaxReaderObject *reader;
+ PyObject *handler;
+
+@@ -634,7 +634,7 @@
+ #define STREAM_DEBUG
+ #endif
+
+-static PyObject * preparsing_reader_new(ATTRIBUTE_UNUSED PyObject *self, PyObject *args) {
++static PyObject * preparsing_reader_new(PyObject *self, PyObject *args) {
+ PreparsingReaderObject *reader;
+ PyObject *handler;
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-pyxmpp.git/commitdiff/6eec19ba3dd0e4c6a2bbced60124f2c64facbf00
More information about the pld-cvs-commit
mailing list