diff --git a/srcpkgs/libxml2-python/patches/py39compat.patch b/srcpkgs/libxml2-python/patches/py39compat.patch new file mode 100644 index 00000000000..c5dbfabbaa4 --- /dev/null +++ b/srcpkgs/libxml2-python/patches/py39compat.patch @@ -0,0 +1,68 @@ +--- python/libxml.c.orig 2020-10-07 14:41:45.226029584 -0400 ++++ python/libxml.c 2020-10-07 14:42:58.965113111 -0400 +@@ -294,7 +294,7 @@ + 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 @@ + 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; +--- python/types.c.orig 2020-10-07 14:41:49.393034304 -0400 ++++ python/types.c 2020-10-07 14:42:23.496072934 -0400 +@@ -602,16 +602,16 @@ + 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 @@ + 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 @@ + ret = xmlXPathWrapString(str); + #endif + #endif +- } else if PyList_Check (obj) { ++ } else if (PyList_Check (obj)) { + int i; + PyObject *node; + xmlNodePtr cur; diff --git a/srcpkgs/libxml2-python/template b/srcpkgs/libxml2-python/template index dbd701f1fe4..4208519dac3 100644 --- a/srcpkgs/libxml2-python/template +++ b/srcpkgs/libxml2-python/template @@ -1,7 +1,7 @@ # Template file for 'libxml2-python' pkgname=libxml2-python version=2.9.10 -revision=2 +revision=3 wrksrc="${pkgname%-python}-${version}" build_wrksrc=python build_style=python-module @@ -15,8 +15,10 @@ homepage="http://www.xmlsoft.org/" distfiles="http://xmlsoft.org/sources/libxml2-${version}.tar.gz" checksum=aafee193ffb8fe0c82d4afef6ef91972cbaf5feea100edc2f262750611b4be1f -pre_build() { - sed "s:/usr/include:${XBPS_CROSS_BASE}/usr/include:" -i setup.py +post_patch() { + if [ "${CROSS_BUILD}" ]; then + vsed -i setup.py -e "s:/usr/include:${XBPS_CROSS_BASE}/usr/include:" + fi } post_install() {