all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#64012] [PATCH] gnu: libxml2: Update to 2.11.4
@ 2023-06-12  8:03 Andy Tai
  2023-06-12  8:47 ` [bug#64012] [PATCH v2] " Andy Tai
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Andy Tai @ 2023-06-12  8:03 UTC (permalink / raw)
  To: 64012; +Cc: Andy Tai

* gnu/packages/xml.scm (libxml2): Update to 2.11.4
* 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                          | 11 ++---
 3 files changed, 4 insertions(+), 48 deletions(-)
 delete mode 100644 gnu/packages/patches/python-libxml2-utf8.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index ce16d37e2b..6f0fee2d34 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -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    \
diff --git a/gnu/packages/patches/python-libxml2-utf8.patch b/gnu/packages/patches/python-libxml2-utf8.patch
deleted file mode 100644
index e39672faa1..0000000000
--- a/gnu/packages/patches/python-libxml2-utf8.patch
+++ /dev/null
@@ -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);
-     }
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 8d9974b825..bbb91fbe6b 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -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,10 +253,7 @@ (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"))
     (arguments

base-commit: 6fe9a004dba2d4ddf69ff6f1714af15ffaa7e62a
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#64012] [PATCH v2] gnu: libxml2: Update to 2.11.4
  2023-06-12  8:03 [bug#64012] [PATCH] gnu: libxml2: Update to 2.11.4 Andy Tai
@ 2023-06-12  8:47 ` Andy Tai
  2023-06-12 18:40   ` Liliana Marie Prikler
  2023-06-13  5:01 ` [bug#64012] [PATCH v3] gnu: libxml2: Add version 2.11.4 Andy Tai
  2023-06-14  6:04 ` [bug#64012] [PATCH v4 1/3] " Andy Tai
  2 siblings, 1 reply; 11+ messages in thread
From: Andy Tai @ 2023-06-12  8:47 UTC (permalink / raw)
  To: 64012; +Cc: Andy Tai

* 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

diff --git a/gnu/local.mk b/gnu/local.mk
index ce16d37e2b..6f0fee2d34 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -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    \
diff --git a/gnu/packages/patches/python-libxml2-utf8.patch b/gnu/packages/patches/python-libxml2-utf8.patch
deleted file mode 100644
index e39672faa1..0000000000
--- a/gnu/packages/patches/python-libxml2-utf8.patch
+++ /dev/null
@@ -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);
-     }
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 8d9974b825..314efbfb28 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -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")))

base-commit: 6fe9a004dba2d4ddf69ff6f1714af15ffaa7e62a
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#64012] [PATCH v2] gnu: libxml2: Update to 2.11.4
  2023-06-12  8:47 ` [bug#64012] [PATCH v2] " Andy Tai
@ 2023-06-12 18:40   ` Liliana Marie Prikler
  2023-06-12 18:52     ` Andy Tai
  0 siblings, 1 reply; 11+ messages in thread
From: Liliana Marie Prikler @ 2023-06-12 18:40 UTC (permalink / raw)
  To: Andy Tai, 64012

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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#64012] [PATCH v2] gnu: libxml2: Update to 2.11.4
  2023-06-12 18:40   ` Liliana Marie Prikler
@ 2023-06-12 18:52     ` Andy Tai
  2023-06-12 19:38       ` Liliana Marie Prikler
  0 siblings, 1 reply; 11+ messages in thread
From: Andy Tai @ 2023-06-12 18:52 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: 64012

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 897 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#64012] [PATCH v2] gnu: libxml2: Update to 2.11.4
  2023-06-12 18:52     ` Andy Tai
@ 2023-06-12 19:38       ` Liliana Marie Prikler
  0 siblings, 0 replies; 11+ messages in thread
From: Liliana Marie Prikler @ 2023-06-12 19:38 UTC (permalink / raw)
  To: Andy Tai; +Cc: 64012

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




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#64012] [PATCH v3] gnu: libxml2: Add version 2.11.4
  2023-06-12  8:03 [bug#64012] [PATCH] gnu: libxml2: Update to 2.11.4 Andy Tai
  2023-06-12  8:47 ` [bug#64012] [PATCH v2] " Andy Tai
@ 2023-06-13  5:01 ` Andy Tai
  2023-06-13 18:26   ` Liliana Marie Prikler
  2023-06-14  6:04 ` [bug#64012] [PATCH v4 1/3] " Andy Tai
  2 siblings, 1 reply; 11+ messages in thread
From: Andy Tai @ 2023-06-13  5:01 UTC (permalink / raw)
  To: 64012, liliana.prikler; +Cc: Andy Tai

* gnu/packages/xml.scm (libxml2-next): Version 2.11.4 as new variable
  (python-libxml2-next): Version 2.11.4 as new variable

* gnu/packages/glib.scm (itstool) [inputs]: Switch to libxml2-next
  and python-libxml2-next
---
 gnu/packages/glib.scm |  5 +++-
 gnu/packages/xml.scm  | 64 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index e988e8dc87..40dbd8f951 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -674,7 +674,10 @@ (define itstool
                "1jl7gsr7aclb9nvqazr039m86y7f7ivfhl2pixcrbfqjkb97r6kb"))))
     (build-system gnu-build-system)
     (inputs
-     (list libxml2 python-libxml2 python))
+     (list libxml2-next python-libxml2-next python))
+    ;; libxml2-next contains upstream fix for crash on UTF-8 data
+    ;; https://gitlab.gnome.org/GNOME/libxml2/-/commit/76c6da420923f2721a2e16adfcef8707a2454a1b
+    ;; so we change dependency to the new libxml2 version
     (arguments
      (list
       #:phases
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 8d9974b825..74976f7402 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -191,6 +191,9 @@ (define-public libxml2
              (sha256
               (base32
                "1vnzk33wfms348lgz9pvkq9li7jm44pvm73lbr3w1khwgljlmmv0"))))
+                     ;; TODO: remove once migrated to libxml2-next as upstream has
+                     ;; proper fix in libxml2 2.11.4
+                     ;; defined as libxml2-next below for now
     (build-system gnu-build-system)
     (outputs '("out" "static" "doc"))
     (arguments
@@ -249,6 +252,25 @@ (define-public libxml2-xpath0
 provides an @code{--xpath0} option to @command{xmllint} that enables it
 to output XPath results with a null delimiter.")))
 
+
+;; libxml2-next contains upstream fix for itstool crash on UTF-8 data
+;; https://gitlab.gnome.org/GNOME/libxml2/-/commit/76c6da420923f2721a2e16adfcef8707a2454a1b
+;; so we need to being in the new libxml2 version
+;; for itstool to depend on to avoid crash
+(define-public libxml2-next
+  (package/inherit libxml2
+    (version "2.11.4")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://download.gnome.org/sources/libxml2/"
+                    (version-major+minor version) "/libxml2-" version
+                    ".tar.xz"))
+              (sha256 (base32
+                       "1xspgyswllk26g7jg95pnkfk1gqpzna28fm1kir3kwdki9ziszkk"))))
+    (native-inputs (list perl python-minimal-wrapper pkg-config))))
+
+
 (define-public python-libxml2
   (package/inherit libxml2
     (name "python-libxml2")
@@ -278,6 +300,48 @@ (define-public python-libxml2
     (inputs (list libxml2))
     (synopsis "Python bindings for the libxml2 library")))
 
+(define-public python-libxml2-next
+  (package/inherit python-libxml2
+    (version "2.11.4")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://download.gnome.org/sources/libxml2/"
+                    (version-major+minor version) "/libxml2-" version
+                    ".tar.xz"))
+              (sha256 (base32
+                       "1xspgyswllk26g7jg95pnkfk1gqpzna28fm1kir3kwdki9ziszkk"))))
+
+    (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")))
+                                   (substitute* "setup.py"
+                                     ;; The build system ignores C_INCLUDE_PATH & co, so
+                                     ;; provide the absolute directory name.
+                                     (("/opt/include")
+                                      (dirname libxml2-headers)))))))))
+    (inputs (list libxml2-next))))
+
 (define-public libxlsxwriter
   (package
     (name "libxlsxwriter")

base-commit: 6fe9a004dba2d4ddf69ff6f1714af15ffaa7e62a
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#64012] [PATCH v3] gnu: libxml2: Add version 2.11.4
  2023-06-13  5:01 ` [bug#64012] [PATCH v3] gnu: libxml2: Add version 2.11.4 Andy Tai
@ 2023-06-13 18:26   ` Liliana Marie Prikler
  2023-06-15 18:31     ` Andy Tai
  0 siblings, 1 reply; 11+ messages in thread
From: Liliana Marie Prikler @ 2023-06-13 18:26 UTC (permalink / raw)
  To: Andy Tai, 64012

Am Montag, dem 12.06.2023 um 22:01 -0700 schrieb Andy Tai:
> * gnu/packages/xml.scm (libxml2-next): Version 2.11.4 as new variable
>   (python-libxml2-next): Version 2.11.4 as new variable
One patch per package, please :)

> * gnu/packages/glib.scm (itstool) [inputs]: Switch to libxml2-next
>   and python-libxml2-next
Still a world rebuild as far as I can see.  Use grafts :)


Cheers




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#64012] [PATCH v4 1/3] gnu: libxml2: Add version 2.11.4
  2023-06-12  8:03 [bug#64012] [PATCH] gnu: libxml2: Update to 2.11.4 Andy Tai
  2023-06-12  8:47 ` [bug#64012] [PATCH v2] " Andy Tai
  2023-06-13  5:01 ` [bug#64012] [PATCH v3] gnu: libxml2: Add version 2.11.4 Andy Tai
@ 2023-06-14  6:04 ` Andy Tai
  2023-06-14  6:04   ` [bug#64012] [PATCH v4 2/3] Ignu: python-libxml2: " Andy Tai
  2023-06-14  6:04   ` [bug#64012] [PATCH v4 3/3] gnu: itstool: Add version depending on needed fix Andy Tai
  2 siblings, 2 replies; 11+ messages in thread
From: Andy Tai @ 2023-06-14  6:04 UTC (permalink / raw)
  To: 64012; +Cc: Andy Tai

* gnu/packages/xml.scm (libxml2-next): Version 2.11.4 as new variable
---
 gnu/packages/xml.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 8d9974b825..eaaa93fe14 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -191,6 +191,9 @@ (define-public libxml2
              (sha256
               (base32
                "1vnzk33wfms348lgz9pvkq9li7jm44pvm73lbr3w1khwgljlmmv0"))))
+                     ;; TODO: remove once migrated to libxml2-next as upstream has
+                     ;; proper fix in libxml2 2.11.4
+                     ;; defined as libxml2-next below for now
     (build-system gnu-build-system)
     (outputs '("out" "static" "doc"))
     (arguments
@@ -249,6 +252,25 @@ (define-public libxml2-xpath0
 provides an @code{--xpath0} option to @command{xmllint} that enables it
 to output XPath results with a null delimiter.")))
 
+
+;; libxml2-next contains upstream fix for itstool crash on UTF-8 data
+;; https://gitlab.gnome.org/GNOME/libxml2/-/commit/76c6da420923f2721a2e16adfcef8707a2454a1b
+;; so we need to being in the new libxml2 version
+;; for itstool to depend on to avoid crash
+(define-public libxml2-next
+  (package/inherit libxml2
+    (version "2.11.4")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://download.gnome.org/sources/libxml2/"
+                    (version-major+minor version) "/libxml2-" version
+                    ".tar.xz"))
+              (sha256 (base32
+                       "1xspgyswllk26g7jg95pnkfk1gqpzna28fm1kir3kwdki9ziszkk"))))
+    (native-inputs (list perl python-minimal-wrapper pkg-config))))
+
+
 (define-public python-libxml2
   (package/inherit libxml2
     (name "python-libxml2")

base-commit: 6fe9a004dba2d4ddf69ff6f1714af15ffaa7e62a
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#64012] [PATCH v4 2/3] Ignu: python-libxml2: Add version 2.11.4
  2023-06-14  6:04 ` [bug#64012] [PATCH v4 1/3] " Andy Tai
@ 2023-06-14  6:04   ` Andy Tai
  2023-06-14  6:04   ` [bug#64012] [PATCH v4 3/3] gnu: itstool: Add version depending on needed fix Andy Tai
  1 sibling, 0 replies; 11+ messages in thread
From: Andy Tai @ 2023-06-14  6:04 UTC (permalink / raw)
  To: 64012; +Cc: Andy Tai

* gnu/packages/xml.scm (python-libxml2-next): Version 2.11.4 as new variable
---
 gnu/packages/xml.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index eaaa93fe14..74976f7402 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -300,6 +300,48 @@ (define-public python-libxml2
     (inputs (list libxml2))
     (synopsis "Python bindings for the libxml2 library")))
 
+(define-public python-libxml2-next
+  (package/inherit python-libxml2
+    (version "2.11.4")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://download.gnome.org/sources/libxml2/"
+                    (version-major+minor version) "/libxml2-" version
+                    ".tar.xz"))
+              (sha256 (base32
+                       "1xspgyswllk26g7jg95pnkfk1gqpzna28fm1kir3kwdki9ziszkk"))))
+
+    (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")))
+                                   (substitute* "setup.py"
+                                     ;; The build system ignores C_INCLUDE_PATH & co, so
+                                     ;; provide the absolute directory name.
+                                     (("/opt/include")
+                                      (dirname libxml2-headers)))))))))
+    (inputs (list libxml2-next))))
+
 (define-public libxlsxwriter
   (package
     (name "libxlsxwriter")
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#64012] [PATCH v4 3/3] gnu: itstool: Add version depending on needed fix
  2023-06-14  6:04 ` [bug#64012] [PATCH v4 1/3] " Andy Tai
  2023-06-14  6:04   ` [bug#64012] [PATCH v4 2/3] Ignu: python-libxml2: " Andy Tai
@ 2023-06-14  6:04   ` Andy Tai
  1 sibling, 0 replies; 11+ messages in thread
From: Andy Tai @ 2023-06-14  6:04 UTC (permalink / raw)
  To: 64012; +Cc: Andy Tai

* gnu/packages/glib.scm (itstool-with-utf8-fix): New variable
  [inputs]: Switch to libxml2-next and python-libxml2-next
---
 gnu/packages/glib.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index e988e8dc87..c0df750b9b 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -705,6 +705,18 @@ (define itstool
 translated.")
     (license license:gpl3+)))
 
+
+;; libxml2-next contains upstream fix for itstool crash on UTF-8 data
+;; https://gitlab.gnome.org/GNOME/libxml2/-/commit/76c6da420923f2721a2e16adfcef8707a2454a1b
+;; so we need to have an itstool based the new libxml2 version
+;; for itstool to avoid crash
+(define-public itstool-with-utf8-fix
+  (package/inherit itstool
+    (name "itstool-with-utf8-fix")
+    (inputs
+     (list libxml2-next python-libxml2-next python))))
+
+
 (define dbus-glib
   (package
     (name "dbus-glib")
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#64012] [PATCH v3] gnu: libxml2: Add version 2.11.4
  2023-06-13 18:26   ` Liliana Marie Prikler
@ 2023-06-15 18:31     ` Andy Tai
  0 siblings, 0 replies; 11+ messages in thread
From: Andy Tai @ 2023-06-15 18:31 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: 64012

[-- Attachment #1: Type: text/plain, Size: 506 bytes --]

Liliana, in patch v4 I create three new variables including a new itstool
which shall have nothing depending on them.  Guix QA still shows it will
cause rebuilding of more than 8000 packages.  I cannot make sense of this.

On Tue, Jun 13, 2023 at 2:33 PM Liliana Marie Prikler <
liliana.prikler@gmail.com> wrote:

> > * gnu/packages/glib.scm (itstool) [inputs]: Switch to libxml2-next
> >   and python-libxml2-next
> Still a world rebuild as far as I can see.  Use grafts :)
>
>
> Cheers
>

[-- Attachment #2: Type: text/html, Size: 931 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-06-15 18:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12  8:03 [bug#64012] [PATCH] gnu: libxml2: Update to 2.11.4 Andy Tai
2023-06-12  8:47 ` [bug#64012] [PATCH v2] " Andy Tai
2023-06-12 18:40   ` Liliana Marie Prikler
2023-06-12 18:52     ` Andy Tai
2023-06-12 19:38       ` Liliana Marie Prikler
2023-06-13  5:01 ` [bug#64012] [PATCH v3] gnu: libxml2: Add version 2.11.4 Andy Tai
2023-06-13 18:26   ` Liliana Marie Prikler
2023-06-15 18:31     ` Andy Tai
2023-06-14  6:04 ` [bug#64012] [PATCH v4 1/3] " Andy Tai
2023-06-14  6:04   ` [bug#64012] [PATCH v4 2/3] Ignu: python-libxml2: " Andy Tai
2023-06-14  6:04   ` [bug#64012] [PATCH v4 3/3] gnu: itstool: Add version depending on needed fix Andy Tai

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.