diff options
Diffstat (limited to 'gnu/packages/xml.scm')
-rw-r--r-- | gnu/packages/xml.scm | 275 |
1 files changed, 120 insertions, 155 deletions
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm index 0b26a63e85..2bc4f66c01 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> @@ -27,7 +27,7 @@ ;;; Copyright © 2020 Brett Gilio <brettg@gnu.org> ;;; Copyright © 2020 Pierre Langlois <pierre.langlois@gmx.com> ;;; Copyright © 2021 Michael Rohleder <mike@rohleder.de> -;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com> +;;; Copyright © 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu> ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net> ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net> @@ -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,68 +320,51 @@ 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 - `(#:phases (modify-phases %standard-phases - (add-before 'check 'disable-fuzz-tests - (lambda _ - ;; Disable libFuzzer tests, because they require - ;; instrumentation builds of libxml2 and libxslt. - (substitute* "tests/Makefile" - (("exslt plugins fuzz") - "exslt plugins")) - #t))))) + (list #:phases + #~(modify-phases %standard-phases + (add-before 'check 'disable-fuzz-tests + (lambda _ + ;; Disable libFuzzer tests, because they require + ;; instrumentation builds of libxml2 and libxslt. + (substitute* "tests/Makefile" + (("exslt plugins fuzz") + "exslt plugins")) + ;; 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.)"))))) + #:configure-flags + (if (%current-target-system) + ;; 'configure.ac' uses 'AM_PATH_PYTHON', which looks for + ;; 'python' in $PATH and tries to run it. Skip all that when + ;; cross-compiling. + #~'("--without-python") + #~'()))) (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 @@ -1747,60 +1741,46 @@ modular implementation of XML-RPC for C and C++.") (outputs '("out" "doc")) (build-system gnu-build-system) (native-inputs - `(("docbook-xml" ,docbook-xml-4.1.2) - ("docbook-xsl" ,docbook-xsl) - ("libxml2" ,libxml2) ;for XML_CATALOG_DIR - ("xmlto" ,xmlto) - ;; Dependencies to regenerate the 'configure' script. - ("autoconf" ,autoconf) - ("automake" ,automake) - ("gettext" ,gettext-minimal) - ("libtool" ,libtool))) + (list docbook-xml-4.1.2 + docbook-xsl + libxml2 ;for XML_CATALOG_DIR + xmlto + ;; Dependencies to regenerate the 'configure' script. + autoconf + automake + gettext-minimal + libtool)) (arguments - `( ;; Note: we cannot use '--enable-full-doc-build' as this would require - ;; Openjade, which in turn requires this package. + (list + ;; Note: we cannot use '--enable-full-doc-build' as this would require + ;; Openjade, which in turn requires this package. - ;; Skip the tests that are known to fail (see: - ;; https://sourceforge.net/p/openjade/mailman/message/6182316/) - #:make-flags '("TESTS_THAT_FAIL=") - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'patch-docbook-paths - (lambda* (#:key inputs #:allow-other-keys) - (let ((xmldoc (string-append (assoc-ref inputs "docbook-xml") - "/xml/dtd/docbook")) - (xsldoc (string-append (assoc-ref inputs "docbook-xsl") - "/xml/xsl/docbook-xsl-" - ,(package-version docbook-xsl)))) - (substitute* (find-files "docsrc" "\\.xml$") - (("/usr/share/sgml/docbook/xml-dtd-4.1.2") xmldoc) - (("http://.*/docbookx\\.dtd") - (string-append xmldoc "/docbookx.dtd"))) - #t))) - (add-after 'patch-docbook-paths 'delete-configure - ;; The configure script in the release was made with an older - ;; Autoconf and lacks support for the `--docdir' option. - (lambda _ - (delete-file "configure") - #t)) - (add-after 'delete-configure 'honor-docdir - ;; docdir is not honored due to being hardcoded in the various - ;; Makefile.am (see: https://sourceforge.net/p/openjade/bugs/147/). - (lambda _ - (substitute* '("Makefile.am" "doc/Makefile.am" "docsrc/Makefile.am") - (("^docdir = .*") "docdir = @docdir@\n")) - #t)) - (add-after 'delete-configure 'fix-tests-makefile.am - ;; Remove the trailing $(SHELL) from the TESTS_ENVIRONMENT variable - ;; definition. Otherwise, when targets are built using - ;; "$(am__check_pre) $(LOG_DRIVER) [...]", there would be two - ;; $(SHELL) expansion which fails the build. - (lambda _ - (substitute* "tests/Makefile.am" - (("^\tOSGMLNORM=`echo osgmlnorm\\|sed '\\$\\(transform\\)'`\\\\") - "\tOSGMLNORM=`echo osgmlnorm|sed '$(transform)'`") - (("^\t\\$\\(SHELL\\)\n") "")) - #t))))) + ;; Skip the tests that are known to fail (see: + ;; https://sourceforge.net/p/openjade/mailman/message/6182316/) + #:make-flags #~(list "TESTS_THAT_FAIL=") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'delete-configure + ;; The configure script in the release was made with an older + ;; Autoconf and lacks support for the `--docdir' option. + (lambda _ + (delete-file "configure"))) + (add-after 'delete-configure 'honor-docdir + ;; docdir is not honored due to being hardcoded in the various + ;; Makefile.am (see: https://sourceforge.net/p/openjade/bugs/147/). + (lambda _ + (substitute* '("Makefile.am" "doc/Makefile.am" "docsrc/Makefile.am") + (("^docdir = .*") "docdir = @docdir@\n")))) + (add-after 'delete-configure 'fix-tests-makefile.am + ;; Remove the trailing $(SHELL) from the TESTS_ENVIRONMENT variable + ;; definition. Otherwise, when targets are built using + ;; "$(am__check_pre) $(LOG_DRIVER) [...]", there would be two + ;; $(SHELL) expansion which fails the build. + (lambda _ + (substitute* "tests/Makefile.am" + (("^\tOSGMLNORM=`echo osgmlnorm\\|sed '\\$\\(transform\\)'`\\\\") + "\tOSGMLNORM=`echo osgmlnorm|sed '$(transform)'`") + (("^\t\\$\\(SHELL\\)\n") ""))))))) ;; $SGML_CATALOG_FILES lists 'catalog' or 'CATALOG' or '*.cat' files found ;; under the 'sgml' sub-directory of any given package. (native-search-paths (list (search-path-specification @@ -1853,26 +1833,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 +1856,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. |