diff options
Diffstat (limited to 'gnu/packages/xml.scm')
-rw-r--r-- | gnu/packages/xml.scm | 159 |
1 files changed, 65 insertions, 94 deletions
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm index 8d86848a1c..fc3c1839b2 100644 --- a/gnu/packages/xml.scm +++ b/gnu/packages/xml.scm @@ -5,7 +5,7 @@ ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2015, 2016, 2017 Mark H Weaver <mhw@netris.org> -;;; Copyright © 2015, 2016, 2017, 2018, 2020, 2021 Efraim Flashner <efraim@flashner.co.il> +;;; Copyright © 2015-2018, 2020-2022 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2015 Raimon Grau <raimonster@gmail.com> ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org> ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name> @@ -13,7 +13,7 @@ ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org> ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is> ;;; Copyright © 2016–2022 Tobias Geerinckx-Rice <me@tobias.gr> -;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke <marius@gnu.org> +;;; Copyright © 2016-2022 Marius Bakke <marius@gnu.org> ;;; Copyright © 2017 Adriano Peluso <catonano@gmail.com> ;;; Copyright © 2017 Gregor Giesen <giesen@zaehlwerk.net> ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com> @@ -80,6 +80,7 @@ #:use-module (guix build-system meson) #:use-module (guix build-system perl) #:use-module (guix build-system python) + #:use-module (guix deprecation) #:use-module (guix utils) #:use-module (gnu packages linux) #:use-module (gnu packages pkg-config)) @@ -117,8 +118,7 @@ the entire document.") (define-public expat (package (name "expat") - (version "2.4.1") - (replacement expat/fixed) + (version "2.5.0") (source (let ((dot->underscore (lambda (c) (if (char=? #\. c) #\_ c)))) (origin (method url-fetch) @@ -130,7 +130,7 @@ the entire document.") "/expat-" version ".tar.xz"))) (sha256 (base32 - "0spvyb9d3hijs4ys3x64cfmilsynl8kv6clfahv8d4lvp86js0yg"))))) + "1gnwihpfz4x18rwd6cbrdggmfqjzwsdfh1gpmc0ph21c4gq2097g"))))) (build-system gnu-build-system) (arguments '(#:phases (modify-phases %standard-phases @@ -154,23 +154,6 @@ stream-oriented parser in which an application registers handlers for things the parser might find in the XML document (like start tags).") (license license:expat))) -(define expat/fixed - (package - (inherit expat) - (version "2.4.9") - (source (let ((dot->underscore (lambda (c) (if (char=? #\. c) #\_ c)))) - (origin - (method url-fetch) - (uri (list (string-append "mirror://sourceforge/expat/expat/" - version "/expat-" version ".tar.xz") - (string-append - "https://github.com/libexpat/libexpat/releases/download/R_" - (string-map dot->underscore version) - "/expat-" version ".tar.xz"))) - (sha256 - (base32 - "0m03zh7al39mx4rf0s2bgdn77r658qqf9k3a7bwx6z2wzql0g33f"))))))) - (define-public libebml (package (name "libebml") @@ -195,20 +178,19 @@ binary extension of XML for the purpose of storing and manipulating data in a hierarchical form with variable field lengths.") (license license:lgpl2.1))) +;; Note: Remember to check python-libxml2 when updating this package. (define-public libxml2 (package (name "libxml2") - (version "2.9.12") + (version "2.9.14") (source (origin (method url-fetch) - (uri (string-append "ftp://xmlsoft.org/libxml2/libxml2-" - version ".tar.gz")) + (uri (string-append "https://download.gnome.org/sources/libxml2/" + (version-major+minor version)"/libxml2-" + version ".tar.xz")) (sha256 (base32 - "14hxwzmf5xqppx77z7i0ni9lpzg1a84dqpf8j8l1fvy570g6imn8")) - (patches (search-patches "libxml2-parent-pointers.patch" - "libxml2-terminating-newline.patch" - "libxml2-xpath-recursion-limit.patch")))) + "1vnzk33wfms348lgz9pvkq9li7jm44pvm73lbr3w1khwgljlmmv0")))) (build-system gnu-build-system) (outputs '("out" "static" "doc")) (arguments @@ -224,7 +206,7 @@ hierarchical form with variable field lengths.") (for-each (lambda (dir) (rename-file (string-append src "/share/" dir) (string-append doc "/" dir))) - '("doc" "gtk-doc")) + '("gtk-doc")) (for-each (lambda (ar) (rename-file ar (string-append dst "/" (basename ar)))) @@ -267,6 +249,35 @@ project (but it is usable outside of the Gnome platform).") provides an @code{--xpath0} option to @command{xmllint} that enables it to output XPath results with a null delimiter."))) +(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)))))) + (build-system python-build-system) + (outputs '("out")) + (arguments + (list + ;; XXX: Tests are specified in 'Makefile.am', but not in 'setup.py'. + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'configure + (lambda* (#:key inputs #:allow-other-keys) + (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)) + (synopsis "Python bindings for the libxml2 library"))) + (define-public libxlsxwriter (package (name "libxlsxwriter") @@ -309,49 +320,18 @@ formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.") (license (list license:bsd-2 license:public-domain)))) ; third_party/md5 -(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)))))) - (build-system python-build-system) - (outputs '("out")) - (arguments - `(;; XXX: Tests are specified in 'Makefile.am', but not in 'setup.py'. - #:tests? #f - #:phases - (modify-phases %standard-phases - (add-before - 'build 'configure - (lambda* (#:key inputs #:allow-other-keys) - (chdir "python") - (let ((glibc (assoc-ref inputs ,(if (%current-target-system) - "cross-libc" "libc"))) - (libxml2 (assoc-ref inputs "libxml2"))) - (substitute* "setup.py" - ;; For 'libxml2/libxml/tree.h'. - (("ROOT = r'/usr'") - (format #f "ROOT = r'~a'" libxml2)) - ;; For 'iconv.h'. - (("/opt/include") - (string-append glibc "/include"))))))))) - (inputs `(("libxml2" ,libxml2))) - (synopsis "Python bindings for the libxml2 library"))) - (define-public libxslt (package (name "libxslt") - (version "1.1.34") + (version "1.1.37") (source (origin (method url-fetch) - (uri (string-append "ftp://xmlsoft.org/libxslt/libxslt-" - version ".tar.gz")) + (uri (string-append "https://download.gnome.org/sources" + "/libxslt/" (version-major+minor version) + "/libxslt-" version ".tar.xz")) (sha256 (base32 - "0zrzz6kjdyavspzik6fbkpvfpbd25r2qg6py5nnjaabrsr3bvccq")) + "1d1s2bk0m6d7bzml9w90ycl0jlpcy4v07595cwaddk17h3f2fjrs")) (patches (search-patches "libxslt-generated-ids.patch")))) (build-system gnu-build-system) (arguments @@ -363,14 +343,20 @@ formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.") (substitute* "tests/Makefile" (("exslt plugins fuzz") "exslt plugins")) - #t))))) + ;; Also disable Python tests since they require + ;; python-libxml2 which would introduce a + ;; circular dependency. + (substitute* "python/Makefile" + (("cd tests && \\$\\(MAKE\\) tests") + "$(info Python tests are disabled by Guix.)"))))))) (home-page "http://xmlsoft.org/XSLT/index.html") (synopsis "C library for applying XSLT stylesheets to XML documents") - (inputs `(("libgcrypt" ,libgcrypt) - ("libxml2" ,libxml2) - ("python" ,python-minimal-wrapper) - ("zlib" ,zlib) - ("xz" ,xz))) + (inputs + (list libgcrypt + libxml2 + python-minimal-wrapper + zlib + xz)) (native-inputs (list pkg-config)) (description @@ -1853,26 +1839,20 @@ because lxml.etree already has its own implementation of XPath 1.0.") (define-public python-lxml (package (name "python-lxml") - (version "4.6.3") + (version "4.9.1") (source (origin (method url-fetch) (uri (pypi-uri "lxml" version)) (sha256 - (base32 "0s14r1w2x9sdlcsw8mxiqgw4rz5zs5lpqpxrfyn4a1mkndqqbdrr")) - ;; Adapt a test to libxml2 2.9.12, taken from this commit: - ;; https://github.com/lxml/lxml/commit/852ed1092bd80b6b9a51db24371047e - (modules '((guix build utils))) - (snippet - '(substitute* "src/lxml/tests/test_etree.py" - (("self\\.assertEqual\\(\\{'hha': None\\}, el\\.nsmap\\)") - "self.assertEqual({}, el.nsmap)"))))) + (base32 "0grczyrrq2rbwhvpri15cyhv330s494vbz3js3jky8xp5c2rnx7y")))) (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases (replace 'check - (lambda _ - (invoke "make" "test")))))) + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "make" "test"))))))) (inputs (list libxml2 libxslt)) (home-page "https://lxml.de/") @@ -1882,17 +1862,8 @@ because lxml.etree already has its own implementation of XPath 1.0.") libxml2 and libxslt.") (license license:bsd-3))) ; and a few more, see LICENSES.txt -(define-public python-lxml-4.7 - (package - (inherit python-lxml) - (version "4.7.1") - (source - (origin - (inherit (package-source python-lxml)) - (uri (pypi-uri "lxml" version)) - (sha256 - (base32 - "090viyanaki4q7w7i000xl0qh4in52bkl3qal55sz2bbm8w3hqd1")))))) +(define-deprecated python-lxml-4.7 python-lxml) +(export python-lxml-4.7) (define-public python-untangle ;; The latest tagged release is from 2014; use the latest commit. |