pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/textproc/libxml2 textproc/(py-)libxml2: Fix compilatio...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/229d68086c60
branches:  trunk
changeset: 441669:229d68086c60
user:      js <js%pkgsrc.org@localhost>
date:      Sun Nov 08 23:31:44 2020 +0000

description:
textproc/(py-)libxml2: Fix compilation with Python 3.9

diffstat:

 textproc/libxml2/distinfo                      |   5 +-
 textproc/libxml2/patches/patch-python-types.c  |  52 ++++++++++++++++++++++++++
 textproc/libxml2/patches/patch-python_libxml.c |  23 ++++++++++-
 3 files changed, 76 insertions(+), 4 deletions(-)

diffs (111 lines):

diff -r 18a0c4870b4f -r 229d68086c60 textproc/libxml2/distinfo
--- a/textproc/libxml2/distinfo Sun Nov 08 21:59:09 2020 +0000
+++ b/textproc/libxml2/distinfo Sun Nov 08 23:31:44 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.133 2020/11/05 17:45:55 adam Exp $
+$NetBSD: distinfo,v 1.134 2020/11/08 23:31:44 js Exp $
 
 SHA1 (libxml2-2.9.10.tar.gz) = db6592ec9ca9708c4e71bf6bfd907bbb5cd40644
 RMD160 (libxml2-2.9.10.tar.gz) = 455f81e1f121c63dac96802de7f83ce4483f1afe
@@ -10,7 +10,8 @@
 SHA1 (patch-doc_examples_Makefile.in) = 4eede9719724f94402e850ee6d6043a74aaf62b2
 SHA1 (patch-encoding.c) = 62b3343f0a0ea51e3fb8eb693e495520eefb6ffd
 SHA1 (patch-parser.c) = 9dcda6b8bc71c1abb095fc2c840ac40c1ae04a33
-SHA1 (patch-python_libxml.c) = cfa07b4f3dfddb501c2ba210bb32b8ee14e3df9d
+SHA1 (patch-python-types.c) = d3c93a1c68956bc7da4f81a8fcbf1e6bad580bef
+SHA1 (patch-python_libxml.c) = c092f10787be1bb43764cc0bef4ffd35bbe6ec94
 SHA1 (patch-python_libxml.py) = 869a72ae5ba2e27e6d46552878890acb22337675
 SHA1 (patch-python_libxml2.py) = 209d105b0f3aedb834091390a7c6819705108e34
 SHA1 (patch-python_setup.py) = 7771fd02ee6779463f1d3321f099d7e6d19cd1b1
diff -r 18a0c4870b4f -r 229d68086c60 textproc/libxml2/patches/patch-python-types.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/libxml2/patches/patch-python-types.c     Sun Nov 08 23:31:44 2020 +0000
@@ -0,0 +1,52 @@
+$NetBSD: patch-python-types.c,v 1.1 2020/11/08 23:31:44 js Exp $
+
+Fix compilation with Python 3.9.
+
+--- python/types.c.orig        2019-10-22 18:46:01.000000000 +0000
++++ python/types.c
+@@ -602,16 +602,16 @@ libxml_xmlXPathObjectPtrConvert(PyObject
+     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
+           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
+       ret = xmlXPathWrapString(str);
+ #endif
+ #endif
+-    } else if PyList_Check (obj) {
++    } else if (PyList_Check (obj)) {
+         int i;
+         PyObject *node;
+         xmlNodePtr cur;
diff -r 18a0c4870b4f -r 229d68086c60 textproc/libxml2/patches/patch-python_libxml.c
--- a/textproc/libxml2/patches/patch-python_libxml.c    Sun Nov 08 21:59:09 2020 +0000
+++ b/textproc/libxml2/patches/patch-python_libxml.c    Sun Nov 08 23:31:44 2020 +0000
@@ -1,11 +1,30 @@
-$NetBSD: patch-python_libxml.c,v 1.1 2019/01/09 13:40:50 wiz Exp $
+$NetBSD: patch-python_libxml.c,v 1.2 2020/11/08 23:31:44 js Exp $
 
 Avoid returning invalid UTF-8 strings to python.
 Based on https://bugzilla.opensuse.org/attachment.cgi?id=746044&action=edit
 Fixes https://github.com/itstool/itstool/issues/22
+Fix compilation with Python 3.9.
 
---- python/libxml.c.orig       2016-06-07 10:04:14.000000000 +0000
+--- python/libxml.c.orig       2019-10-22 18:46:01.000000000 +0000
 +++ python/libxml.c
+@@ -294,7 +294,7 @@ xmlPythonFileReadRaw (void * context, ch
+       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 
+       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;
 @@ -1620,6 +1620,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
      PyObject *message;
      PyObject *result;



Home | Main Index | Thread Index | Old Index