Date: Tuesday, April 11, 2023 @ 22:08:04
  Author: heftig
Revision: 1444765

2.10.4-1

Added:
  lib32-libxml2/trunk/0001-Fix-python3-unicode-errors.patch
  lib32-libxml2/trunk/0002-HACK-Don-t-run-fuzzing-tests.patch
Modified:
  lib32-libxml2/trunk/PKGBUILD

-----------------------------------------+
 0001-Fix-python3-unicode-errors.patch   |   57 ++++++++++++++++++++++++++++++
 0002-HACK-Don-t-run-fuzzing-tests.patch |   29 +++++++++++++++
 PKGBUILD                                |   55 ++++++++++++++++++++--------
 3 files changed, 125 insertions(+), 16 deletions(-)

Added: 0001-Fix-python3-unicode-errors.patch
===================================================================
--- 0001-Fix-python3-unicode-errors.patch                               (rev 0)
+++ 0001-Fix-python3-unicode-errors.patch       2023-04-11 22:08:04 UTC (rev 
1444765)
@@ -0,0 +1,57 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <[email protected]>
+Date: Tue, 11 Apr 2023 21:55:36 +0000
+Subject: [PATCH] Fix python3 unicode errors
+
+Patch taken from Fedora at
+https://src.fedoraproject.org/rpms/libxml2/raw/c1fa5c85e9d3a0b7340aaf34d2e5134cf47f5d66/f/libxml2-2.9.8-python3-unicode-errors.patch
+
+Works around https://bugzilla.gnome.org/show_bug.cgi?id=789714
+and https://gitlab.gnome.org/GNOME/libxml2/-/issues/64
+---
+ python/libxml.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/python/libxml.c b/python/libxml.c
+index e071e824ca39..9d476f4fcd92 100644
+--- a/python/libxml.c
++++ b/python/libxml.c
+@@ -1621,28 +1621,37 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx, 
const char *msg,
+     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);
+ #endif
+ 
+ 
+     if (libxml_xmlPythonErrorFuncHandler == NULL) {
+         va_start(ap, msg);
+         vfprintf(stderr, msg, ap);
+         va_end(ap);
+     } else {
+         va_start(ap, msg);
+         if (vsnprintf(str, 999, msg, ap) >= 998)
+           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);
+     }

Added: 0002-HACK-Don-t-run-fuzzing-tests.patch
===================================================================
--- 0002-HACK-Don-t-run-fuzzing-tests.patch                             (rev 0)
+++ 0002-HACK-Don-t-run-fuzzing-tests.patch     2023-04-11 22:08:04 UTC (rev 
1444765)
@@ -0,0 +1,29 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <[email protected]>
+Date: Tue, 11 Apr 2023 21:59:24 +0000
+Subject: [PATCH] HACK: Don't run fuzzing tests
+
+They take way too long.
+---
+ Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 316109b16148..3ef672fe911f 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -2,12 +2,12 @@
+ 
+ ACLOCAL_AMFLAGS = -I m4
+ 
+-SUBDIRS = include . doc example fuzz xstc
++SUBDIRS = include . doc example xstc
+ if WITH_PYTHON
+ SUBDIRS += python
+ endif
+ 
+-DIST_SUBDIRS = include . doc example fuzz python xstc
++DIST_SUBDIRS = include . doc example python xstc
+ 
+ AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include 
-DSYSCONFDIR='"$(sysconfdir)"'
+ 

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-04-11 21:57:53 UTC (rev 1444764)
+++ PKGBUILD    2023-04-11 22:08:04 UTC (rev 1444765)
@@ -5,9 +5,11 @@
 # Contributor: John Proctor <[email protected]>
 
 pkgbase=lib32-libxml2
-pkgname=(lib32-libxml2)
-pkgver=2.10.3
-pkgrel=2
+pkgname=(
+  lib32-libxml2
+)
+pkgver=2.10.4
+pkgrel=1
 pkgdesc="XML C parser and toolkit (32-bit)"
 url="https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home";
 arch=(x86_64)
@@ -20,10 +22,19 @@
 )
 makedepends=(
   git
+  python
 )
-_commit=f507d167f1755b7eaea09fb1a44d29aab828b6d1  # tags/v2.10.3^0
-source=("git+https://gitlab.gnome.org/GNOME/libxml2.git#commit=$_commit";)
-sha256sums=('SKIP')
+_commit=223cb03a5d27b1b2393b266a8657443d046139d6  # tags/v2.10.4^0
+source=(
+  "git+https://gitlab.gnome.org/GNOME/libxml2.git#commit=$_commit";
+  0001-Fix-python3-unicode-errors.patch
+  0002-HACK-Don-t-run-fuzzing-tests.patch
+  https://www.w3.org/XML/Test/xmlts20130923.tar.gz
+)
+b2sums=('SKIP'
+        
'ec5a0955906c5fdd4bc65248bdb46f315460f4b2208bf37c49f55ef7468585786bdf563aa3e9357370d4f1ff947a6d4467869eeb2ca6b77ca5e40ffa45213a13'
+        
'ec247c8caad963307d8f487176fde518cfb087bbff3f10c2a5846b90a04c9909c2f0e6aaf8ded4784f46586eafb16df493caf1debc20ff10014f03b1f1f8241d'
+        
'63a47bc69278ef510cd0b3779aed729e1b309e30efa0015d28ed051cc03f9dfddb447ab57b07b3393e8f47393d15473b0e199c34cb1f5f746b15ddfaa55670be')
 
 pkgver() {
   cd libxml2
@@ -33,10 +44,31 @@
 prepare() {
   cd libxml2
 
+  # Use xmlconf from conformance test suite
+  ln -s ../xmlconf
+
+  # https://gitlab.gnome.org/GNOME/libxml2/-/issues/64
+  git apply -3 ../0001-Fix-python3-unicode-errors.patch
+
+  # Do not run fuzzing tests
+  git apply -3 ../0002-HACK-Don-t-run-fuzzing-tests.patch
+
   NOCONFIGURE=1 ./autogen.sh
 }
 
 build() {
+  local configure_options=(
+    --prefix=/usr
+    --libdir=/usr/lib32
+    --sysconfdir=/etc
+    --localstatedir=/var
+    --without-history
+    --with-icu
+    --without-python
+    --with-threads
+    --disable-static
+  )
+
   export CC="gcc -m32"
   export CXX="g++ -m32"
   export PKG_CONFIG="i686-pc-linux-gnu-pkg-config"
@@ -43,16 +75,7 @@
 
   cd libxml2
 
-  ./configure \
-    --prefix=/usr \
-    --libdir=/usr/lib32 \
-    --sysconfdir=/etc \
-    --localstatedir=/var \
-    --with-threads \
-    --without-history \
-    --without-python \
-    --with-icu \
-    --disable-static
+  ./configure "${configure_options[@]}"
   sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
   make
 }

Reply via email to