diff mbox series

[bug#64012,v3] gnu: libxml2: Add version 2.11.4

Message ID 536cd0b0eb1ac6f618f1b03ea722432e267b7bbd.1686632370.git.atai@atai.org
State New
Headers show
Series [bug#64012,v3] gnu: libxml2: Add version 2.11.4 | expand

Commit Message

Andy Tai June 13, 2023, 5:01 a.m. UTC
* 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(-)


base-commit: 6fe9a004dba2d4ddf69ff6f1714af15ffaa7e62a

Comments

Liliana Marie Prikler June 13, 2023, 6:26 p.m. UTC | #1
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
Andy Tai June 15, 2023, 6:31 p.m. UTC | #2
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
>
diff mbox series

Patch

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")