[crux-commits] ports/opt (3.6): python3-libxml2: add patch and update footprint for python 3.9

crux at crux.nu crux at crux.nu
Sat Aug 29 13:37:49 UTC 2020


commit 20d1643cd3fa56372d42b177a564435aba36c045
Author: Juergen Daubert <jue at jue.li>
Date:   Sat Aug 29 13:36:58 2020 +0000

    python3-libxml2: add patch and update footprint for python 3.9

diff --git a/python3-libxml2/.footprint b/python3-libxml2/.footprint
index 28433404c..2275aace3 100644
--- a/python3-libxml2/.footprint
+++ b/python3-libxml2/.footprint
@@ -1,11 +1,11 @@
 drwxr-xr-x	root/root	usr/
 drwxr-xr-x	root/root	usr/lib/
-drwxr-xr-x	root/root	usr/lib/python3.8/
-drwxr-xr-x	root/root	usr/lib/python3.8/site-packages/
-drwxr-xr-x	root/root	usr/lib/python3.8/site-packages/__pycache__/
--rw-r--r--	root/root	usr/lib/python3.8/site-packages/__pycache__/drv_libxml2.cpython-38.pyc
--rw-r--r--	root/root	usr/lib/python3.8/site-packages/__pycache__/libxml2.cpython-38.pyc
--rw-r--r--	root/root	usr/lib/python3.8/site-packages/drv_libxml2.py
--rw-r--r--	root/root	usr/lib/python3.8/site-packages/libxml2.py
--rw-r--r--	root/root	usr/lib/python3.8/site-packages/libxml2_python-2.9.10-py3.8.egg-info
--rwxr-xr-x	root/root	usr/lib/python3.8/site-packages/libxml2mod.cpython-38-x86_64-linux-gnu.so
+drwxr-xr-x	root/root	usr/lib/python3.9/
+drwxr-xr-x	root/root	usr/lib/python3.9/site-packages/
+drwxr-xr-x	root/root	usr/lib/python3.9/site-packages/__pycache__/
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/__pycache__/drv_libxml2.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/__pycache__/libxml2.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/drv_libxml2.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/libxml2.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/libxml2_python-2.9.10-py3.9.egg-info
+-rwxr-xr-x	root/root	usr/lib/python3.9/site-packages/libxml2mod.cpython-39-x86_64-linux-gnu.so
diff --git a/python3-libxml2/.signature b/python3-libxml2/.signature
index 83416495b..a038f09d1 100644
--- a/python3-libxml2/.signature
+++ b/python3-libxml2/.signature
@@ -1,5 +1,6 @@
 untrusted comment: verify with /etc/ports/opt.pub
-RWSE3ohX2g5d/ab0/zan/fuAITSenZBx8OossuptqIHbtEjPlJa6k5nlGpuBsaYBo21pITOkQOM9covyoFz3pe+IgGEV3FjZ0A8=
-SHA256 (Pkgfile) = 1e091e43e8ef3763167532bceef73468f4a0a3967456ef25593d30aa9dbc5c1a
-SHA256 (.footprint) = 543e3215c6df6e134c7adbf794787979a50ed06aa4d8959effa6d4ae360e1770
+RWSE3ohX2g5d/S8T8JmBaR7dxN/DCezZD246WpiuIiEq6jbo/+d01Gp24270nou5RP4oOOahjefk8dCLr16Odsu5m2EDtX++nA0=
+SHA256 (Pkgfile) = cfb24f486aac36710d7ab01fbb4f27475df60ef175843189572cf8741a0a01b1
+SHA256 (.footprint) = 1c25762c69245ad543c9cdf58b304085b225e0cac2a759f22db56f923f10d46e
 SHA256 (libxml2-2.9.10.tar.gz) = aafee193ffb8fe0c82d4afef6ef91972cbaf5feea100edc2f262750611b4be1f
+SHA256 (python3.9.patch) = 8150a23d01966bff1dbf110294012756f5a3a29bf4f671f0e07b84d4307e4bce
diff --git a/python3-libxml2/Pkgfile b/python3-libxml2/Pkgfile
index 45c5034a0..a29e1d258 100644
--- a/python3-libxml2/Pkgfile
+++ b/python3-libxml2/Pkgfile
@@ -6,10 +6,12 @@
 name=python3-libxml2
 version=2.9.10
 release=2
-source=(ftp://xmlsoft.org/libxml2/libxml2-$version.tar.gz)
+source=(ftp://xmlsoft.org/libxml2/libxml2-$version.tar.gz
+        python3.9.patch)
 
 build () {
     cd libxml2-$version/python
+    patch -p2 -i $SRC/python3.9.patch
     /usr/bin/python3 setup.py build
     /usr/bin/python3 setup.py install --root=$PKG
 }
diff --git a/python3-libxml2/python3.9.patch b/python3-libxml2/python3.9.patch
new file mode 100644
index 000000000..7f14cddf8
--- /dev/null
+++ b/python3-libxml2/python3.9.patch
@@ -0,0 +1,86 @@
+commit e4fb36841800038c289997432ca547c9bfef9db1
+Author: Miro Hrončok <miro at hroncok.cz>
+Date:   Fri Feb 28 12:48:14 2020 +0100
+
+    Parenthesize Py<type>_Check() in ifs
+    
+    In C, if expressions should be parenthesized.
+    PyLong_Check, PyUnicode_Check etc. happened to expand to a parenthesized
+    expression before, but that's not API to rely on.
+    
+    Since Python 3.9.0a4 it needs to be parenthesized explicitly.
+    
+    Fixes https://gitlab.gnome.org/GNOME/libxml2/issues/149
+
+diff --git a/python/libxml.c b/python/libxml.c
+index bc676c4e..81e709f3 100644
+--- a/python/libxml.c
++++ b/python/libxml.c
+@@ -294,7 +294,7 @@ xmlPythonFileReadRaw (void * context, char * buffer, int len) {
+ 	lenread = PyBytes_Size(ret);
+ 	data = PyBytes_AsString(ret);
+ #ifdef PyUnicode_Check
+-    } else if PyUnicode_Check (ret) {
++    } else if (PyUnicode_Check (ret)) {
+ #if PY_VERSION_HEX >= 0x03030000
+         Py_ssize_t size;
+ 	const char *tmp;
+@@ -359,7 +359,7 @@ xmlPythonFileRead (void * context, char * buffer, int len) {
+ 	lenread = PyBytes_Size(ret);
+ 	data = PyBytes_AsString(ret);
+ #ifdef PyUnicode_Check
+-    } else if PyUnicode_Check (ret) {
++    } else if (PyUnicode_Check (ret)) {
+ #if PY_VERSION_HEX >= 0x03030000
+         Py_ssize_t size;
+ 	const char *tmp;
+diff --git a/python/types.c b/python/types.c
+index c2bafeb1..ed284ec7 100644
+--- a/python/types.c
++++ b/python/types.c
+@@ -602,16 +602,16 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
+     if (obj == NULL) {
+         return (NULL);
+     }
+-    if PyFloat_Check (obj) {
++    if (PyFloat_Check (obj)) {
+         ret = xmlXPathNewFloat((double) PyFloat_AS_DOUBLE(obj));
+-    } else if PyLong_Check(obj) {
++    } else if (PyLong_Check(obj)) {
+ #ifdef PyLong_AS_LONG
+         ret = xmlXPathNewFloat((double) PyLong_AS_LONG(obj));
+ #else
+         ret = xmlXPathNewFloat((double) PyInt_AS_LONG(obj));
+ #endif
+ #ifdef PyBool_Check
+-    } else if PyBool_Check (obj) {
++    } else if (PyBool_Check (obj)) {
+ 
+         if (obj == Py_True) {
+           ret = xmlXPathNewBoolean(1);
+@@ -620,14 +620,14 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
+           ret = xmlXPathNewBoolean(0);
+         }
+ #endif
+-    } else if PyBytes_Check (obj) {
++    } else if (PyBytes_Check (obj)) {
+         xmlChar *str;
+ 
+         str = xmlStrndup((const xmlChar *) PyBytes_AS_STRING(obj),
+                          PyBytes_GET_SIZE(obj));
+         ret = xmlXPathWrapString(str);
+ #ifdef PyUnicode_Check
+-    } else if PyUnicode_Check (obj) {
++    } else if (PyUnicode_Check (obj)) {
+ #if PY_VERSION_HEX >= 0x03030000
+         xmlChar *str;
+ 	const char *tmp;
+@@ -650,7 +650,7 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
+ 	ret = xmlXPathWrapString(str);
+ #endif
+ #endif
+-    } else if PyList_Check (obj) {
++    } else if (PyList_Check (obj)) {
+         int i;
+         PyObject *node;
+         xmlNodePtr cur;


More information about the crux-commits mailing list