aboutsummaryrefslogtreecommitdiffstats
path: root/main/libxml2
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2020-01-21 08:14:26 +0100
committerLeo <thinkabit.ukim@gmail.com>2020-01-21 08:27:04 +0100
commit27191e341677f460d277a4c7849a1ca4874d49ac (patch)
tree7442bcde5193c489e89edc3ae4ba70fbff6afcc6 /main/libxml2
parent77da6c3e8e001c9902ef2a34db72bdde47ae8c9e (diff)
downloadaports-27191e341677f460d277a4c7849a1ca4874d49ac.tar.bz2
aports-27191e341677f460d277a4c7849a1ca4874d49ac.tar.xz
main/libxml2: finish removing python2 bits
Diffstat (limited to 'main/libxml2')
-rw-r--r--main/libxml2/APKBUILD28
-rw-r--r--main/libxml2/libxml2-2.9.8-python3-unicode-errors.patch34
2 files changed, 41 insertions, 21 deletions
diff --git a/main/libxml2/APKBUILD b/main/libxml2/APKBUILD
index 48c32ae6ab..6ccf346f25 100644
--- a/main/libxml2/APKBUILD
+++ b/main/libxml2/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=libxml2
pkgver=2.9.10
-pkgrel=1
+pkgrel=2
pkgdesc="XML parsing library, version 2"
url="http://www.xmlsoft.org/"
arch="all"
@@ -15,6 +15,7 @@ subpackages="$pkgname-dbg $pkgname-doc $pkgname-dev $pkgname-utils
options="!strip"
source="http://xmlsoft.org/sources/libxml2-$pkgver.tar.gz
revert-Make-xmlFreeNodeList-non-recursive.patch
+ libxml2-2.9.8-python3-unicode-errors.patch
"
# secfixes:
@@ -39,11 +40,9 @@ prepare() {
# We don't build libxml2 with icu.
rm test/icu_parse_test.xml
-
- cp -ra "$builddir" "$builddir"-python2
}
-libxml2_configure() {
+build() {
./configure \
--build=$CBUILD \
--host=$CHOST \
@@ -53,31 +52,17 @@ libxml2_configure() {
--infodir=/usr/share/info \
--with-lzma \
--with-zlib \
- "$@"
-}
-
-build() {
- cd "$builddir"
- libxml2_configure \
--with-python=/usr/bin/python3
make
- msg "build python2"
- cd "$builddir"-python2
- libxml2_configure \
- --with-python=/usr/bin/python2
- make
}
check() {
- rm "$builddir"-python2/test/ebcdic_566012.xml
- make -C "$builddir"-python2 runtests
+ rm -f test/ebcdic_566012.xml
+ make runtests
}
package() {
- cd "$builddir"
-
make -j1 DESTDIR="$pkgdir" install
- make -j1 -C "$builddir"-python2/python DESTDIR="$pkgdir" install
# We don't need static lib for python bindings.
rm "$pkgdir"/usr/lib/python*/site-packages/*.a
@@ -102,4 +87,5 @@ utils() {
}
sha512sums="0adfd12bfde89cbd6296ba6e66b6bed4edb814a74b4265bda34d95c41d9d92c696ee7adb0c737aaf9cc6e10426a31a35079b2a23d26c074e299858da12c072ed libxml2-2.9.10.tar.gz
-347178e432379d543683cba21b902e7305202c03e8dbd724ae395963d677096a5cfc4e345e208d498163ca5174683c167610fc2b297090476038bc2bb7c84b4f revert-Make-xmlFreeNodeList-non-recursive.patch"
+347178e432379d543683cba21b902e7305202c03e8dbd724ae395963d677096a5cfc4e345e208d498163ca5174683c167610fc2b297090476038bc2bb7c84b4f revert-Make-xmlFreeNodeList-non-recursive.patch
+a205c97fa1488fb8907cfa08b5f82e2055c80b86213dc3cc5c4b526fe6aa786bcc4e4eeb226c44635a1d021307b39e3940f706c42fb60e9e3e9b490a84164df7 libxml2-2.9.8-python3-unicode-errors.patch"
diff --git a/main/libxml2/libxml2-2.9.8-python3-unicode-errors.patch b/main/libxml2/libxml2-2.9.8-python3-unicode-errors.patch
new file mode 100644
index 0000000000..e87dcdedf8
--- /dev/null
+++ b/main/libxml2/libxml2-2.9.8-python3-unicode-errors.patch
@@ -0,0 +1,34 @@
+Index: libxml2-2.9.5/python/libxml.c
+===================================================================
+--- libxml2-2.9.5.orig/python/libxml.c
++++ libxml2-2.9.5/python/libxml.c
+@@ -1620,6 +1620,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+ PyObject *message;
+ PyObject *result;
+ char str[1000];
++ unsigned char *ptr = (unsigned char *)str;
+
+ #ifdef DEBUG_ERROR
+ printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
+@@ -1636,12 +1637,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+ str[999] = 0;
+ va_end(ap);
+
++#if PY_MAJOR_VERSION >= 3
++ /* Ensure the error string doesn't start at UTF8 continuation. */
++ while (*ptr && (*ptr & 0xc0) == 0x80)
++ ptr++;
++#endif
++
+ list = PyTuple_New(2);
+ PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
+ Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
+- message = libxml_charPtrConstWrap(str);
++ message = libxml_charPtrConstWrap(ptr);
+ PyTuple_SetItem(list, 1, message);
+ result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
++ /* Forget any errors caused in the error handler. */
++ PyErr_Clear();
+ Py_XDECREF(list);
+ Py_XDECREF(result);
+ }