[bug#64012,v2] gnu: libxml2: Update to 2.11.4
Commit Message
* gnu/packages/xml.scm (libxml2): Update to 2.11.4
(python-libxml2) [arguments] phase: (configure): Invoke
autoge.sh explicitly first as now setup.py is generated
from autotools configure step
[inputs]: Add autotools so autotools configure step can run
* gnu/packages/patches/python-libxml2-utf8.patch: Remove as
patch no longer necessary; original issue fixed upstream
(see https://gitlab.gnome.org/GNOME/libxml2/-/commit/76c6da420923f2721a2e16adfcef8707a2454a1b)
* gnu/local.mk: Remove reference to deleted patch
---
gnu/local.mk | 1 -
.../patches/python-libxml2-utf8.patch | 40 -------------------
gnu/packages/xml.scm | 20 ++++++----
3 files changed, 13 insertions(+), 48 deletions(-)
delete mode 100644 gnu/packages/patches/python-libxml2-utf8.patch
base-commit: 6fe9a004dba2d4ddf69ff6f1714af15ffaa7e62a
Comments
Hi Andy,
Am Montag, dem 12.06.2023 um 01:47 -0700 schrieb Andy Tai:
> * gnu/packages/xml.scm (libxml2): Update to 2.11.4
That's a world rebuild. Use a graft instead.
> (python-libxml2) [arguments] phase: (configure): Invoke
> autoge.sh explicitly first as now setup.py is generated
> from autotools configure step
Use a pre-configure bootstrap phase instead to invoke autogen.sh.
Proper ChangeLog would be (python-libxml2)[#:phases]: Add ‘bootstrap’
or (python-libxml2)[arguments]<#:phases>: Add ‘bootstrap’.
> [inputs]: Add autotools so autotools configure step can run
You don't need to justify the obvious. When something about the patch
is not obvious, it ought to be explained before the ChangeLog.
> * gnu/packages/patches/python-libxml2-utf8.patch: Remove as
> patch no longer necessary; original issue fixed upstream
> (see
> https://gitlab.gnome.org/GNOME/libxml2/-/commit/76c6da420923f2721a2e16adfcef8707a2454a1b
> )
Removed file is enough.
> * gnu/local.mk: Remove reference to deleted patch
It's always nice to mention dist_patch_DATA :)
Cheers
On Mon, Jun 12, 2023 at 11:40 AM Liliana Marie Prikler <
liliana.prikler@gmail.com> wrote:
> Am Montag, dem 12.06.2023 um 01:47 -0700 schrieb Andy Tai:
> > * gnu/packages/xml.scm (libxml2): Update to 2.11.4
> That's a world rebuild. Use a graft instead.
>
Liliana, thanks for the review. Can you give more hints on how to use a
graft? I do not know how that is done, Thanks
Am Montag, dem 12.06.2023 um 11:52 -0700 schrieb Andy Tai:
>
>
> On Mon, Jun 12, 2023 at 11:40 AM Liliana Marie Prikler
> <liliana.prikler@gmail.com> wrote:
> > Am Montag, dem 12.06.2023 um 01:47 -0700 schrieb Andy Tai:
> > > * gnu/packages/xml.scm (libxml2): Update to 2.11.4
> > That's a world rebuild. Use a graft instead.
>
> Liliana, thanks for the review. Can you give more hints on how to
> use a graft? I do not know how that is done, Thanks
You add a (replacement some-other-variable) field to the existing
record and then
(define some-other-variable
(package (inherit existing)
...))
Cheers
@@ -1803,7 +1803,6 @@ dist_patch_DATA = \
%D%/packages/patches/python-pyfakefs-remove-bad-test.patch \
%D%/packages/patches/python-pyflakes-test-location.patch \
%D%/packages/patches/python-flint-includes.patch \
- %D%/packages/patches/python-libxml2-utf8.patch \
%D%/packages/patches/python-memcached-syntax-warnings.patch \
%D%/packages/patches/python-mox3-python3.6-compat.patch \
%D%/packages/patches/python-parso-unit-tests-in-3.10.patch \
deleted file mode 100644
@@ -1,40 +0,0 @@
-This patch fixes a crash in the libxml2 bindings for Python 3.x
-that 'itstool' stumbles upon when processing UTF-8 data:
-
- https://issues.guix.gnu.org/issue/37468
-
-Patch by Jan Matejek
-from <https://bugzilla.opensuse.org/show_bug.cgi?id=1065270>.
-
---- 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);
- }
@@ -182,7 +182,7 @@ (define-public libebml
(define-public libxml2
(package
(name "libxml2")
- (version "2.9.14")
+ (version "2.11.4")
(source (origin
(method url-fetch)
(uri (string-append "https://download.gnome.org/sources/libxml2/"
@@ -190,7 +190,7 @@ (define-public libxml2
version ".tar.xz"))
(sha256
(base32
- "1vnzk33wfms348lgz9pvkq9li7jm44pvm73lbr3w1khwgljlmmv0"))))
+ "1xspgyswllk26g7jg95pnkfk1gqpzna28fm1kir3kwdki9ziszkk"))))
(build-system gnu-build-system)
(outputs '("out" "static" "doc"))
(arguments
@@ -221,7 +221,7 @@ (define-public libxml2
(synopsis "C parser for XML")
(inputs (list xz))
(propagated-inputs (list zlib)) ; libxml2.la says '-lz'.
- (native-inputs (list perl))
+ (native-inputs (list perl python-minimal-wrapper pkg-config))
;; $XML_CATALOG_FILES lists 'catalog.xml' files found in under the 'xml'
;; sub-directory of any given package.
(native-search-paths (list (search-path-specification
@@ -253,20 +253,26 @@ (define-public python-libxml2
(package/inherit libxml2
(name "python-libxml2")
(source (origin
- (inherit (package-source libxml2))
- (patches
- (append (search-patches "python-libxml2-utf8.patch")
- (origin-patches (package-source libxml2))))))
+ (inherit (package-source libxml2))))
(build-system python-build-system)
(outputs '("out"))
+
+ (native-inputs (list pkg-config autoconf-wrapper automake libtool perl python-minimal-wrapper))
+ ; needed to generate setup.py
+
(arguments
(list
;; XXX: Tests are specified in 'Makefile.am', but not in 'setup.py'.
#:tests? #f
#:phases
#~(modify-phases %standard-phases
+ (add-after 'unpack 'set-env
+ (lambda _
+ (setenv "CONFIG_SHELL" (which "sh"))
+ #t))
(add-before 'build 'configure
(lambda* (#:key inputs #:allow-other-keys)
+ (invoke "sh" "autogen.sh")
(chdir "python")
(let ((libxml2-headers (search-input-directory
inputs "include/libxml2")))