Commit 946fad44 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Initial commit

parents
all:
tar xf libxml2-2.9.8.tar.gz
patch -Np1 -d libxml2-2.9.8 < libxml2-2.9.8-python3_hack-1.patch
cd libxml2-2.9.8 && sed -i '/_PyVerify_fd/,+1d' python/types.c
cd libxml2-2.9.8 && ./configure --build=$(CLFS_TARGET) --prefix=/usr --disable-static --with-history --with-python=/usr/bin/python3 --with-threads
$(MAKE) -C libxml2-2.9.8
cd libxml2-2.9.8 && tar xf ../xmlts20130923.tar.gz
if [[ ! "$(BUILD_OPTIONS)" =~ no-tests ]] ; then \
$(MAKE) -C libxml2-2.9.8 check ; \
rm /missing.xml ; \
fi
$(MAKE) -C libxml2-2.9.8 install
rm -rf libxml2-2.9.8
diff -uNr libxml2-2.9.8/python/libxml.c libxml2-2.9.8-python3_hack-1/python/libxml.c
--- libxml2-2.9.8/python/libxml.c 2016-06-07 19:34:14.000000000 +0930
+++ libxml2-2.9.8-python3_hack-1/python/libxml.c 2018-06-17 23:18:38.255187110 +0930
@@ -1620,6 +1620,7 @@
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 @@
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);
}
bin
/usr/bin/.*
headers
/usr/include/.*
autoconf
/usr/share/aclocal/.*
doc
/usr/share/gtk-doc/.*
/usr/share/doc/.*
man
/usr/share/man/.*
bytecode
/.*\.py[oc]
lib
/usr/lib/lib.*
/usr/lib/.*\.sh
/usr/lib/python3.*/.*\.(py|so|la)
/usr/lib/cmake/.*
pkg
/usr/lib/pkgconfig/.*
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment