diff options
Diffstat (limited to 'gnu/packages/xml.scm')
-rw-r--r-- | gnu/packages/xml.scm | 239 |
1 files changed, 119 insertions, 120 deletions
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm index ea4fb3a77d..26a63ea06b 100644 --- a/gnu/packages/xml.scm +++ b/gnu/packages/xml.scm @@ -37,6 +37,8 @@ ;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr> ;;; Copyright © 2024 gemmaro <gemmaro.dev@gmail.com> ;;; Copyright © 2025 Antoine Côté <antoine.cote@posteo.net> +;;; Copyright © 2025 John Kehayias <john.kehayias@protonmail.com> +;;; Copyright © 2025 Remco van 't Veer <remco@remworks.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -188,19 +190,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.14") + (version "2.14.6") (source (origin - (method url-fetch) - (uri (string-append "mirror://gnome/sources/libxml2/" - (version-major+minor version)"/libxml2-" - version ".tar.xz")) - (sha256 - (base32 - "1vnzk33wfms348lgz9pvkq9li7jm44pvm73lbr3w1khwgljlmmv0")))) + (method url-fetch) + (uri (string-append "mirror://gnome/sources/libxml2/" + (version-major+minor version)"/libxml2-" + version ".tar.xz")) + (sha256 + (base32 + "0fi0jysncjpvhvp29qcx3bydndapwphgkx7ial5kzf7ymyh5ir3w")) + (patches (search-patches "python-libxml2-utf8.patch")))) (build-system gnu-build-system) (outputs '("out" "static" "doc")) (arguments @@ -218,6 +220,13 @@ hierarchical form with variable field lengths.") (string-append "/bin/" file)) ".")) '("config.guess" "config.sub"))))) #~()) + (add-before 'configure 'configure-python + (lambda _ + (substitute* "python/setup.py.in" + ;; The build system ignores C_INCLUDE_PATH & co, so + ;; provide the absolute directory name. + (("/opt/include") + (string-append #$output "/include/libxml2"))))) (add-after 'install 'use-other-outputs (lambda _ (let ((doc (string-append #$output:doc "/share/")) @@ -240,12 +249,14 @@ hierarchical form with variable field lengths.") (("^old_library='libxml2.a'") "old_library=''")))))))) (home-page "http://www.xmlsoft.org/") (synopsis "C parser for XML") - (inputs (list xz)) + ;; TODO: Remove python, xz and zlib when upgrading. + ;; See https://codeberg.org/guix/guix/pulls/3161#issuecomment-7521193 + (inputs (list python-minimal xz)) (propagated-inputs (list zlib)) ; libxml2.la says '-lz'. (native-inputs (append (if (target-loongarch64?) (list config) '()) - (list perl))) + (list perl pkg-config python-minimal))) (native-search-paths (list $SGML_CATALOG_FILES $XML_CATALOG_FILES)) (search-paths native-search-paths) @@ -254,22 +265,23 @@ hierarchical form with variable field lengths.") project (but it is usable outside of the Gnome platform).") (license license:x11))) -(define-public libxml2-next - (package - (inherit libxml2) - (name "libxml2") - (version "2.14.5") - (source (origin - (method url-fetch) - (uri (string-append "mirror://gnome/sources/libxml2/" - (version-major+minor version)"/libxml2-" - version ".tar.xz")) - (sha256 - (base32 - "0jylv2kkyzih710blg24al7b43iaqg6xsfn52qy865knagrhdl03")))) - (native-inputs (modify-inputs (package-native-inputs libxml2) - (append pkg-config - python-minimal))))) +;; This is an old version (the most recent that works) of libxml2 solely for +;; building librsvg-2.40. +;; XXX: Remove once Rust (and thus newer librsvg) is supported on all +;; platforms. +(define-public libxml2-2.11 + (hidden-package + (package + (inherit libxml2) + (version "2.11.9") + (source (origin + (inherit (package-source libxml2)) + (uri (string-append "mirror://gnome/sources/libxml2/" + (version-major+minor version)"/libxml2-" + version ".tar.xz")) + (sha256 + (base32 + "17w0a622466k2hi5nln276la6rzfr9xaip3lqj71hmyvxyhmf0bq"))))))) (define-public libxml2-xpath0 (package/inherit libxml2 @@ -285,33 +297,7 @@ 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"))) + (deprecated-package "python-libxml2" libxml2)) (define-public libxlsxwriter (package @@ -358,7 +344,7 @@ formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.") (define-public libxslt (package (name "libxslt") - (version "1.1.37") + (version "1.1.43") (source (origin (method url-fetch) (uri (string-append "mirror://gnome/sources" @@ -366,8 +352,7 @@ formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.") "/libxslt-" version ".tar.xz")) (sha256 (base32 - "1d1s2bk0m6d7bzml9w90ycl0jlpcy4v07595cwaddk17h3f2fjrs")) - (patches (search-patches "libxslt-generated-ids.patch")))) + "0fhqy01x99iia8306czakxza4spzyn88w4bin4sw5bx57hw6ngas")))) (build-system gnu-build-system) (arguments (list #:phases @@ -394,14 +379,15 @@ formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.") #~'()))) (home-page "http://xmlsoft.org/XSLT/index.html") (synopsis "C library for applying XSLT stylesheets to XML documents") + (native-inputs (list pkg-config)) (inputs (list libgcrypt - libxml2 + libxml2 ;TODO: Remove after propagated python-minimal-wrapper zlib xz)) - (native-inputs - (list pkg-config)) + ;; TODO: Uncomment in an upcoming world rebuild + ;;(propagated-inputs (list libxml2)) ;libxml2-0.pc 'Requires' it (native-search-paths %libxslt-search-paths) (description "Libxslt is an XSLT C library developed for the GNOME project. It is @@ -676,10 +662,11 @@ with XML in Perl. libxml-perl software works in combination with ;; Remove patch with update to version 2.0210. (patches (search-patches "perl-xml-libxml-fix-function-prototypes.patch")))) (build-system perl-build-system) + (arguments '(#:tests? #f)) ;FIXME: 2 test failures since updating libxml2 (propagated-inputs (list perl-xml-namespacesupport perl-xml-sax)) (inputs - (list libxml2)) + (list libxml2-2.11)) (home-page "https://metacpan.org/release/XML-LibXML") (synopsis "Perl interface to libxml2") (description "This module implements a Perl interface to the libxml2 @@ -712,7 +699,7 @@ XML parser and the high performance DOM implementation.") (define-public perl-xml-libxslt (package (name "perl-xml-libxslt") - (version "1.96") + (version "2.003000") (source (origin (method url-fetch) @@ -720,14 +707,13 @@ XML parser and the high performance DOM implementation.") "XML-LibXSLT-" version ".tar.gz")) (sha256 (base32 - "0wyl8klgr65j8y8fzgwz9jlvfjwvxazna8j3dg9gksd2v973fpia")) - ;; Remove patch with update to version 2.003000. - (patches (search-patches "perl-xml-libxslt-fix-configure.patch")))) + "11s5spf0x5h6qzajfsza28m62z50cilcpvl4iffyafzmfbp5makw")))) (build-system perl-build-system) - (inputs - (list libxslt)) - (propagated-inputs - (list perl-xml-libxml)) + (native-inputs (list pkg-config)) + ;; FIXME: libxml2-2.11 is used instead of latest, due to test failures + ;; (see: <https://github.com/shlomif/perl-XML-LibXSLT/issues/8>). + (inputs (list libxml2-2.11 libxslt)) + (propagated-inputs (list perl-xml-libxml)) (home-page "https://metacpan.org/release/XML-LibXSLT") (synopsis "Perl bindings to GNOME libxslt library") (description "This Perl module is an interface to the GNOME project's @@ -1210,14 +1196,14 @@ XSL-T processor. It also performs any necessary post-processing.") (define-public xmlsec (package (name "xmlsec") - (version "1.2.37") + (version "1.3.7") (source (origin (method url-fetch) (uri (string-append "https://www.aleksey.com/xmlsec/download/" "xmlsec1-" version ".tar.gz")) (sha256 (base32 - "0747w8mnnyawvvzlvhjpkwm3998c7l5f1hjy1gfvsmhydp5zp3az")))) + "1shk40mpaqaf05skgyxa7qxgcarjd6i1fadn2sk0b8lakfv96bnq")))) (build-system gnu-build-system) (propagated-inputs ; according to xmlsec1.pc (list libxml2 libxslt)) @@ -1409,7 +1395,7 @@ C++ programming language.") (symlink "xml" (string-append bin "/xmlstarlet")) #t)))))) (inputs - (list libxslt libxml2)) + (list libxslt libxml2-2.11)) (home-page "https://xmlstar.sourceforge.net/") (synopsis "Command line XML toolkit") (description "XMLStarlet is a set of command line utilities which can be @@ -1863,22 +1849,32 @@ The central program included in this package is @code{onsgmls}, which replaces (define-public python-elementpath (package (name "python-elementpath") - (version "2.0.3") + (version "5.0.4") (source (origin (method url-fetch) (uri (pypi-uri "elementpath" version)) (sha256 (base32 - "1kxx573ywqfh6j6aih2i6hhsya6kz79qq4bgz6yskwk6b18jyr8z")))) - (build-system python-build-system) - ;; The test suite is not run, to avoid a dependency cycle with - ;; python-xmlschema. - (arguments `(#:tests? #f)) - (home-page - "https://github.com/sissaschool/elementpath") - (synopsis - "XPath 1.0/2.0 parsers and selectors for ElementTree and lxml") + "1yr5ka198p1c1yw0dpmvz5mvxr6b29mz64hb2vxax53fbmb97vc5")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-backend #~'unittest + #:phases + #~(modify-phases %standard-phases + ;; 10 tests fail with: locale.Error: unsupported locale setting. + (add-before 'check 'set-locales + (lambda* (#:key inputs #:allow-other-keys) + (setenv "GUIX_LOCPATH" + (search-input-directory inputs "lib/locale"))))))) + (native-inputs + (list glibc-locales + python-setuptools + python-lxml + python-xmlschema-bootstrap)) + (home-page "https://github.com/sissaschool/elementpath") + (synopsis "XPath 1.0/2.0 parsers and selectors for ElementTree and lxml") (description "The proposal of this package is to provide XPath 1.0 and 2.0 selectors for Python's ElementTree XML data structures, both for the standard @@ -1891,20 +1887,22 @@ because lxml.etree already has its own implementation of XPath 1.0.") (define-public python-lxml (package (name "python-lxml") - (version "5.2.2") + (version "6.0.1") (source (origin (method url-fetch) (uri (pypi-uri "lxml" version)) (sha256 - (base32 "11yvrzlswlh81z6lpmds2is2jd3wkigpwj6mcfcaggl0h64w8bdv")))) - (build-system python-build-system) + (base32 "14064h0pxdsx36nhyjzrw0v16ygz977qf6l0ydnh5p97pwp8hfib")))) + (build-system pyproject-build-system) (arguments `(#:phases (modify-phases %standard-phases (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? (invoke "make" "test"))))))) + (native-inputs + (list python-setuptools)) (inputs (list libxml2 libxslt)) (home-page "https://lxml.de/") @@ -1927,7 +1925,8 @@ libxml2 and libxslt.") (sha256 (base32 "03l86qr5xzvz0jcbk669sj8nbw1fjshmf0b7l83gl5cfnx81wm5i")))) (arguments - (list #:phases + (list #:tests? #f ;some tests fail with newer libxml2 + #:phases #~(modify-phases %standard-phases (add-after 'unpack 'relax-gcc-14-strictness (lambda _ @@ -1940,13 +1939,13 @@ libxml2 and libxslt.") (define-public python-lxml-html-clean (package (name "python-lxml-html-clean") - (version "0.4.2") + (version "0.4.3") (source (origin (method url-fetch) (uri (pypi-uri "lxml_html_clean" version)) (sha256 - (base32 "1cxwrrv4kdkxwkwm12a6rh38xmb415257g31yjmk0m5rbmxiwaci")))) + (base32 "134xppqi8y8qfl54vxfgx8852mw2mix15axy0z43dy00bf993py9")))) (build-system pyproject-build-system) (arguments (list @@ -1961,7 +1960,7 @@ libxml2 and libxslt.") "tests/test_clean.txt" "tests/test_autolink.txt"))))))) (propagated-inputs (list python-lxml)) - (native-inputs (list python-setuptools python-wheel)) + (native-inputs (list python-setuptools)) (home-page "https://github.com/fedora-python/lxml_html_clean/") (synopsis "Remove superfluous content from HTML files") (description "This package provides a Cleaner for cleaning up HTML pages. @@ -1971,13 +1970,12 @@ content, it is not appropriate for security sensitive environments.") (license license:bsd-3))) (define-public python-untangle - ;; The latest tagged release is from 2014; use the latest commit. - (let ((revision "1") - (commit "fb916a9621175d000a3b0ca9322d3b3ebf8570c0")) + ;; The latest tagged release is from 2022; use the latest commit. + (let ((revision "2") + (commit "7eec044b6c78f58cc6d8f183b2f9a511bfc334f8")) (package (name "python-untangle") - ;; PyPI currently offers some untagged 1.1.1 version. - (version (git-version "1.1.1" revision commit)) + (version (git-version "1.2.1" revision commit)) (source (origin (method git-fetch) ;no tests in pypi archive @@ -1986,13 +1984,13 @@ content, it is not appropriate for security sensitive environments.") (commit commit))) (file-name (git-file-name name version)) (sha256 - (base32 "0dn2jz9ajncbqx3pdlgqaxmngl6pdiaz03nj8mkddasckdq9lbrh")))) - (build-system python-build-system) - (arguments (list #:phases #~(modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "python" "tests/tests.py"))))))) + (base32 "0pcwcrga8cgrqyyzfj01vkqv3xrzl0a8xa5yfi06byk6d85rv6zf")))) + (build-system pyproject-build-system) + (native-inputs + (list python-poetry-core + python-pytest)) + (propagated-inputs + (list python-defusedxml)) (home-page "http://0chris.com/untangle") (synopsis "XML to Python objects conversion library") (description "@code{untangle} is a tiny Python library which converts an @@ -2002,7 +2000,7 @@ XML document to a Python object.") (define-public python-xmlschema (package (name "python-xmlschema") - (version "1.2.5") + (version "4.1.0") (source (origin ;; Unit tests are not distributed with the PyPI archive. (method git-fetch) @@ -2012,22 +2010,12 @@ XML document to a Python object.") (file-name (git-file-name name version)) (sha256 (base32 - "0rsa75x86gdjalvy4riq7613szb616hff80crx006chyppzdkxmq")))) - (build-system python-build-system) - (arguments - '(#:phases - (modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (if tests? - ;; Disable test_export_remote__issue_187, which is known to - ;; fail (see: - ;; https://github.com/sissaschool/xmlschema/issues/206). - (invoke "python" "-m" "unittest" "-v" - "-k" "not test_export_remote__issue_187") - (format #t "test suite not run~%"))))))) + "1bgih9vad1iij8lffddas74gx8kx7qn0b5hr056hmhg5vbiyayyy")))) + (build-system pyproject-build-system) + (arguments (list #:test-backend #~'unittest)) (native-inputs - (list python-lxml)) ;for tests + (list python-lxml + python-setuptools)) (propagated-inputs (list python-elementpath)) (home-page "https://github.com/sissaschool/xmlschema") @@ -2040,20 +2028,31 @@ finding schema's elements and attributes; and can encode and decode XML data to JSON and other formats.") (license license:expat))) +(define-public python-xmlschema-bootstrap + (hidden-package + (package/inherit python-xmlschema + (arguments + (list #:tests? #f + #:phases + #~(modify-phases %standard-phases + (delete 'sanity-check)))) + (propagated-inputs '())))) + (define-public python-xmltodict (package (name "python-xmltodict") - (version "0.12.0") + (version "0.14.2") (source (origin (method url-fetch) (uri (pypi-uri "xmltodict" version)) (sha256 (base32 - "08cadlb9vsb4pmzc99lz3a2lx6qcfazyvgk10pcqijvyxlwcdn2h")))) + "0lx521w5nlmb937fxym5m38hxar354wfdpfik54kf3i1pcl7q7i0")))) (build-system pyproject-build-system) (native-inputs - (list python-coverage python-nose python-setuptools python-wheel)) + (list python-pytest + python-setuptools)) (home-page "https://github.com/martinblech/xmltodict") (synopsis "Work with XML like you are working with JSON") (description "This package provides a Python library to convert XML to |