;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013-2016, 2018-2019, 2022 Ludovic Courtès ;;; Copyright © 2013, 2015 Andreas Enge ;;; Copyright © 2015 Eric Bavier ;;; Copyright © 2015 Sou Bunnbu ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ricardo Wurmus ;;; Copyright © 2015, 2016, 2017 Mark H Weaver ;;; Copyright © 2015, 2016, 2017, 2018, 2020, 2021 Efraim Flashner ;;; Copyright © 2015 Raimon Grau ;;; Copyright © 2016 Mathieu Lirzin ;;; Copyright © 2016, 2017 Leo Famulari ;;; Copyright © 2016 Ben Woodcroft ;;; Copyright © 2016 Jan Nieuwenhuizen ;;; Copyright © 2016, 2017 Nikita ;;; Copyright © 2016–2021 Tobias Geerinckx-Rice ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke ;;; Copyright © 2017 Adriano Peluso ;;; Copyright © 2017 Gregor Giesen ;;; Copyright © 2017 Alex Vong ;;; Copyright © 2017 Petter ;;; Copyright © 2017 Stefan Reichör ;;; Copyright © 2018 Pierre Neidhardt ;;; Copyright © 2018 Jack Hill ;;; Copyright © 2019 Giacomo Leidi ;;; Copyright © 2020 Paul Garlick ;;; Copyright © 2020 Edouard Klein ;;; Copyright © 2020 Brett Gilio ;;; Copyright © 2020 Pierre Langlois ;;; Copyright © 2021 Michael Rohleder ;;; Copyright © 2021 Maxim Cournoyer ;;; Copyright © 2021 Julien Lepiller ;;; Copyright © 2021 Felix Gruber ;;; Copyright © 2021 Guillaume Le Vaillant ;;; Copyright © 2021 David Larsson ;;; Copyright © 2021 Matthew James Kraai ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages xml) #:use-module (gnu packages) #:use-module (gnu packages base) #:use-module (gnu packages autotools) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages curl) #:use-module (gnu packages docbook) #:use-module (gnu packages documentation) #:use-module (gnu packages gettext) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) #:use-module (gnu packages gnupg) #:use-module (gnu packages graphviz) #:use-module (gnu packages gtk) #:use-module (gnu packages java) #:use-module (gnu packages nss) #:use-module (gnu packages perl) #:use-module (gnu packages perl-check) #:use-module (gnu packages python) #:use-module (gnu packages tls) #:use-module (gnu packages web) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix build-system ant) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system meson) #:use-module (guix build-system perl) #:use-module (guix build-system python) #:use-module (guix utils) #:use-module (gnu packages linux) #:use-module (gnu packages pkg-config)) (define-public libxmlb (package (name "libxmlb") (version "0.3.8") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/hughsie/libxmlb") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0znz2y1ig2kvlda44a3kxa8x7f222nbg50rjz6nlngzka0ccsgxx")))) (build-system meson-build-system) (arguments `(#:glib-or-gtk? #t)) (native-inputs (list gobject-introspection gtk-doc/stable pkg-config)) (inputs (list appstream-glib glib)) (synopsis "Library to help create and query binary XML blobs") (description "Libxmlb library takes XML source, and converts it to a structured binary representation with a deduplicated string table; where the strings have the NULs included. This allows an application to mmap the binary XML file, do an XPath query and return some strings without actually parsing the entire document.") (home-page "https://github.com/hughsie/libxmlb") (license license:lgpl2.1+))) (define-public expat (package (name "expat") (version "2.4.1") (replacement expat/fixed) (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 "0spvyb9d3hijs4ys3x64cfmilsynl8kv6clfahv8d4lvp86js0yg"))))) (build-system gnu-build-system) (arguments '(#:phases (modify-phases %standard-phases (add-after 'install 'move-static-library (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out")) (static (assoc-ref outputs "static"))) (mkdir-p (string-append static "/lib")) (link (string-append out "/lib/libexpat.a") (string-append static "/lib/libexpat.a")) (delete-file (string-append out "/lib/libexpat.a")) (substitute* (string-append out "/lib/libexpat.la") (("old_library=.*") "old_library=''")))))))) (outputs '("out" "static")) (home-page "https://libexpat.github.io/") (synopsis "Stream-oriented XML parser library written in C") (description "Expat is an XML parser library written in C. It is a 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.7") (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 "0zbss0dssn17mjmvk17qfi5cmvm0lcyzs62cwvqr219hhl864xcq"))))))) (define-public libebml (package (name "libebml") (version "1.4.2") (source (origin (method url-fetch) (uri (string-append "https://dl.matroska.org/downloads/libebml/" "libebml-" version ".tar.xz")) (sha256 (base32 "1wmri5c94b02q2z32bqlpfs4vbw0n0c602321wigna2qw1y27is1")))) (build-system cmake-build-system) (arguments `(#:configure-flags (list "-DBUILD_SHARED_LIBS=YES") #:tests? #f)) ; no test suite (home-page "https://matroska-org.github.io/libebml/") (synopsis "C++ library to parse EBML files") (description "libebml is a C++ library to read and write @dfn{EBML} (Extensible Binary Meta Language) files. EBML was designed to be a simplified binary extension of XML for the purpose of storing and manipulating data in a hierarchical form with variable field lengths.") (license license:lgpl2.1))) (define-public libxml2 (package (name "libxml2") (version "2.9.12") (source (origin (method url-fetch) (uri (string-append "ftp://xmlsoft.org/libxml2/libxml2-" version ".tar.gz")) (sha256 (base32 "14hxwzmf5xqppx77z7i0ni9lpzg1a84dqpf8j8l1fvy570g6imn8")) (patches (search-patches "libxml2-parent-pointers.patch" "libxml2-terminating-newline.patch" "libxml2-xpath-recursion-limit.patch")))) (build-system gnu-build-system) (outputs '("out" "static" "doc")) (arguments `(#:phases (modify-phases %standard-phases (add-after 'install 'use-other-outputs (lambda* (#:key outputs #:allow-other-keys) (let ((src (assoc-ref outputs "out")) (doc (string-append (assoc-ref outputs "doc") "/share")) (dst (string-append (assoc-ref outputs "static") "/lib"))) (mkdir-p doc) (mkdir-p dst) (for-each (lambda (dir) (rename-file (string-append src "/share/" dir) (string-append doc "/" dir))) '("doc" "gtk-doc")) (for-each (lambda (ar) (rename-file ar (string-append dst "/" (basename ar)))) (find-files (string-append src "/lib") "\\.a$")) ;; Remove reference to the static library from the .la ;; file such that Libtool does the right thing when both ;; the shared and static variants are available. (substitute* (string-append src "/lib/libxml2.la") (("^old_library='libxml2.a'") "old_library=''")))))))) (home-page "http://www.xmlsoft.org/") (synopsis "C parser for XML") (inputs (list xz)) (propagated-inputs (list zlib)) ; libxml2.la says '-lz'. (native-inputs (list perl)) ;; $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 (variable "XML_CATALOG_FILES") (separator " ") (files '("xml")) (file-pattern "^catalog\\.xml$") (file-type 'regular)))) (search-paths native-search-paths) (description "Libxml2 is the XML C parser and toolkit developed for the Gnome project (but it is usable outside of the Gnome platform).") (license license:x11))) (define-public libxml2-xpath0 (package/inherit libxml2 (name "libxml2-xpath0") (source (origin (inherit (package-source libxml2)) (patches (append (search-patches "libxml2-xpath0-Add-option-xpath0.patch") (origin-patches (package-source libxml2)))))) (description "Libxml2-xpath0 is like libxml2 but with a patch applied that provides an @code{--xpath0} option to @command{xmllint} that enables it to output XPath results with a null delimiter."))) (define-public libxlsxwriter (package (name "libxlsxwriter") (version "1.0.3") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/jmcnamara/libxlsxwriter") (commit (string-append "RELEASE_" version)))) (file-name (git-file-name name version)) (sha256 (base32 "14c5rgx87nhzasr0j7mcfr1w7ifz0gmdiqy2xq59di5xvcdrpxpv")) (modules '((guix build utils))) (snippet ;; Remove bundled minizip source '(begin (delete-file-recursively "third_party/minizip") #t)))) (build-system gnu-build-system) (arguments `(#:test-target "test" #:make-flags (list (string-append "CC=" ,(cc-for-target)) (string-append "PREFIX=" (assoc-ref %outputs "out")) "USE_STANDARD_TMPFILE=1" "USE_SYSTEM_MINIZIP=1") #:phases (modify-phases %standard-phases (delete 'configure)))) ; no configure script (native-inputs (list python-pytest)) (inputs (list minizip)) (home-page "https://github.com/jmcnamara/libxlsxwriter") (synopsis "C library for creating Excel XLSX files") (description "Libxlsxwriter is a C library that can be used to write text, numbers, 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 python2-libxml2 (package-with-python2 python-libxml2)) (define-public libxslt (package (name "libxslt") (version "1.1.34") (source (origin (method url-fetch) (uri (string-append "ftp://xmlsoft.org/libxslt/libxslt-" version ".tar.gz")) (sha256 (base32 "0zrzz6kjdyavspzik6fbkpvfpbd25r2qg6py5nnjaabrsr3bvccq")) (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))))) (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))) (native-inputs (list pkg-config)) (description "Libxslt is an XSLT C library developed for the GNOME project. It is based on libxml for XML parsing, tree manipulation and XPath support.") (license license:x11))) (define-public openjade (package (name "openjade") (version "1.3.2") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/openjade/openjade/" version "/" name "-" version ".tar.gz")) (sha256 (base32 "1l92sfvx1f0wmkbvzv1385y1gb3hh010xksi1iyviyclrjb7jb8x")))) (build-system gnu-build-system) (arguments `(#:configure-flags (list (string-append "--enable-spincludedir=" (assoc-ref %build-inputs "opensp") "/include/OpenSP") (string-append "--enable-splibdir=" (assoc-ref %build-inputs "opensp") "/lib") ;; Workaround segfaults in OpenJade (see: ;; https://bugs.launchpad.net/ubuntu/+source/openjade/+bug/1869734). "CXXFLAGS=-O0") #:parallel-build? #f ;build fails otherwise ;; The test suite fails with diff errors between the actual and ;; expected results, like: (char (uri (string-append "mirror://debian/pool/main/x/xmlto/" "xmlto_" version ".orig.tar.bz2")) (file-name (string-append name "-" version ".tar.bz2")) (sha256 (base32 "0xhj8b2pwp4vhl9y16v3dpxpsakkflfamr191mprzsspg4xdyc0i")))) (build-system gnu-build-system) (arguments ;; Make sure the reference to util-linux's 'getopt' is kept in 'xmlto'. '(#:configure-flags (list (string-append "GETOPT=" (assoc-ref %build-inputs "util-linux") "/bin/getopt")))) (native-inputs (list util-linux)) (inputs (list util-linux ; for 'getopt' libxml2 ; for 'xmllint' libxslt)) ; for 'xsltproc' (home-page "http://cyberelk.net/tim/software/xmlto/") (synopsis "Front-end to an XSL toolchain") (description "Xmlto is a front-end to an XSL toolchain. It chooses an appropriate stylesheet for the conversion you want and applies it using an external XSL-T processor. It also performs any necessary post-processing.") (license license:gpl2+))) (define-public xmlsec (package (name "xmlsec") (version "1.2.32") (source (origin (method url-fetch) (uri (string-append "https://www.aleksey.com/xmlsec/download/" "xmlsec1-" version ".tar.gz")) (sha256 (base32 "0hy0nwz57n9r5wwab9xa66gzwlwvzs54nhlfn3jh8q13acl710z3")))) (build-system gnu-build-system) (propagated-inputs ; according to xmlsec1.pc (list libxml2 libxslt)) (inputs (list gnutls libgcrypt libltdl)) (native-inputs (list pkg-config)) (home-page "https://www.aleksey.com/xmlsec/") (synopsis "XML Security Library") (description "The XML Security Library is a C library based on Libxml2. It supports XML security standards such as XML Signature, XML Encryption, Canonical XML (part of Libxml2) and Exclusive Canonical XML (part of Libxml2).") (license (license:x11-style "file://COPYING" "See 'COPYING' in the distribution.")))) (define-public xmlsec-nss (package/inherit xmlsec (name "xmlsec-nss") (native-inputs ;; For tests. `(("nss:bin" ,nss "bin") ; for certutil ,@(package-native-inputs xmlsec))) (inputs `(("nss" ,nss) ("libltdl" ,libltdl))) (arguments ;; NSS no longer supports MD5 since 3.59, don't attempt to use it. '(#:configure-flags '("--disable-md5"))) (synopsis "XML Security Library (using NSS instead of GnuTLS)"))) (define-public xmlsec-openssl (package/inherit xmlsec (name "xmlsec-openssl") (inputs `(("openssl" ,openssl) ("libltdl" ,libltdl))) (synopsis "XML Security Library (using OpenSSL instead of GnuTLS)"))) (define-public minixml (package (name "minixml") (version "3.3") (source (origin (method url-fetch) (uri (string-append "https://github.com/michaelrsweet/mxml/" "releases/download/v" version "/mxml-" version ".tar.gz")) (sha256 (base32 "1n1xzvhnsjsgsqaq1rg9zilwf0b2rydsadbxzy64z3lydwv7dybw")))) (build-system gnu-build-system) (arguments `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out") "/lib")) #:tests? #f)) ; tests are run during build (home-page "https://www.msweet.org/mxml/") (synopsis "Small XML parsing library") (description "Mini-XML is a small C library to read and write XML files and strings in UTF-8 and UTF-16 encoding.") ;; LGPL 2.0+ with additional exceptions for static linking (license license:lgpl2.0+))) ;; TinyXML is an unmaintained piece of software, so the patches and build ;; system massaging have no upstream potential. (define-public tinyxml (package (name "tinyxml") (version "2.6.2") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/tinyxml/tinyxml/" version "/tinyxml_" (string-join (string-split version #\.) "_") ".tar.gz")) (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 "14smciid19lvkxqznfig77jxn5s4iq3jpb47vh5a6zcaqp7gvg8m")) (patches (search-patches "tinyxml-use-stl.patch")))) (build-system gnu-build-system) ;; This library is missing *a lot* of the steps to make it usable, so we ;; have to add them here, like every other distro must do. (arguments `(#:phases (modify-phases %standard-phases (delete 'configure) (add-after 'build 'build-shared-library (lambda _ (invoke "g++" "-Wall" "-O2" "-shared" "-fpic" "tinyxml.cpp" "tinyxmlerror.cpp" "tinyxmlparser.cpp" "tinystr.cpp" "-o" "libtinyxml.so"))) (replace 'check (lambda _ (invoke "./xmltest"))) (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (include (string-append out "/include")) (lib (string-append out "/lib")) (pkgconfig (string-append out "/lib/pkgconfig")) (doc (string-append out "/share/doc"))) ;; Install libs and headers. (install-file "libtinyxml.so" lib) (install-file "tinystr.h" include) (install-file "tinyxml.h" include) ;; Generate and install pkg-config file. (mkdir-p pkgconfig) ;; Software such as Kodi expect this file to be present, but ;; it's not provided in the source code. (call-with-output-file (string-append pkgconfig "/tinyxml.pc") (lambda (port) (format port "prefix=~a exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: TinyXML Description: A simple, small, C++ XML parser Version: ~a Libs: -L${libdir} -ltinyxml Cflags: -I${includedir} " out ,version))) ;; Install docs. (mkdir-p doc) (copy-recursively "docs" (string-append doc "tinyxml")) #t)))))) (synopsis "Small XML parser for C++") (description "TinyXML is a small and simple XML parsing library for the C++ programming language.") (home-page "http://www.grinninglizard.com/tinyxml/index.html") (license license:zlib))) (define-public tinyxml2 (package (name "tinyxml2") (version "8.0.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/leethomason/tinyxml2") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0raa8r2hsagk7gjlqjwax95ib8d47ba79n91r4aws2zg8y6ssv1d")))) (build-system cmake-build-system) (synopsis "Small XML parser for C++") (description "TinyXML2 is a small and simple XML parsing library for the C++ programming language.") (home-page "http://www.grinninglizard.com/tinyxml2/") (license license:zlib))) (define-public xmlstarlet (package (name "xmlstarlet") (version "1.6.1") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/xmlstar/xmlstarlet/" version "/xmlstarlet-" version ".tar.gz")) (sha256 (base32 "1jp737nvfcf6wyb54fla868yrr39kcbijijmjpyk4lrpyg23in0m")))) (build-system gnu-build-system) (arguments '(#:phases (modify-phases %standard-phases (add-before 'check 'drop-failing-tests (lambda _ ;; FIXME: Why are these tests failing. (substitute* "Makefile" (("^examples/schema1\\\\") "\\") (("^examples/valid1\\\\") "\\")) #t)) (add-after 'install 'symlink-xmlstarlet (lambda* (#:key outputs #:allow-other-keys) ;; Other distros usually either rename or symlink the `xml' binary ;; as `xmlstarlet', let's do it as well for compatibility. (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin"))) (symlink "xml" (string-append bin "/xmlstarlet")) #t)))))) (inputs (list libxslt libxml2)) (home-page "http://xmlstar.sourceforge.net/") (synopsis "Command line XML toolkit") (description "XMLStarlet is a set of command line utilities which can be used to transform, query, validate, and edit XML documents. XPath is used to match and extract data, and elements can be added, deleted or modified using XSLT and EXSLT.") (license license:x11))) (define-public html-xml-utils (package (name "html-xml-utils") (version "7.9") (source (origin (method url-fetch) (uri (string-append "https://www.w3.org/Tools/HTML-XML-utils/html-xml-utils-" version ".tar.gz")) (sha256 (base32 "0gs3xvdbzhk5k12i95p5d4fgkkaldnlv45sch7pnncb0lrpcjsnq")))) (build-system gnu-build-system) (home-page "https://www.w3.org/Tools/HTML-XML-utils/") (synopsis "Command line utilities to manipulate HTML and XML files") (description "HTML-XML-utils provides a number of simple utilities for manipulating and converting HTML and XML files in various ways. The suite consists of the following tools: @itemize @item @command{asc2xml} convert from @code{UTF-8} to @code{&#nnn;} entities @item @command{xml2asc} convert from @code{&#nnn;} entities to @code{UTF-8} @item @command{hxaddid} add IDs to selected elements @item @command{hxcite} replace bibliographic references by hyperlinks @item @command{hxcite} mkbib - expand references and create bibliography @item @command{hxclean} apply heuristics to correct an HTML file @item @command{hxcopy} copy an HTML file while preserving relative links @item @command{hxcount} count elements and attributes in HTML or XML files @item @command{hxextract} extract selected elements @item @command{hxincl} expand included HTML or XML files @item @command{hxindex} create an alphabetically sorted index @item @command{hxmkbib} create bibliography from a template @item @command{hxmultitoc} create a table of contents for a set of HTML files @item @command{hxname2id} move some @code{ID=} or @code{NAME=} from A elements to their parents @item @command{hxnormalize} pretty-print an HTML file @item @command{hxnsxml} convert output of hxxmlns back to normal XML @item @command{hxnum} number section headings in an HTML file @item @command{hxpipe} convert XML to a format easier to parse with Perl or AWK @item @command{hxprintlinks} number links and add table of URLs at end of an HTML file @item @command{hxprune} remove marked elements from an HTML file @item @command{hxref} generate cross-references @item @command{hxselect} extract elements that match a (CSS) selector @item @command{hxtoc} insert a table of contents in an HTML file @item @command{hxuncdata} replace CDATA sections by character entities @item @command{hxunent} replace HTML predefined character entities to @code{UTF-8} @item @command{hxunpipe} convert output of pipe back to XML format @item @command{hxunxmlns} replace \"global names\" by XML Namespace prefixes @item @command{hxwls} list links in an HTML file @item @command{hxxmlns} replace XML Namespace prefixes by \"global names\" @end itemize ") (license license:expat))) (define-public xlsx2csv (package (name "xlsx2csv") (version "0.7.4") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/dilshod/xlsx2csv") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "168dm6p7w6pvgd87yb9hcxv9y0liv6mxgril202nfva68cp8y939")))) (build-system python-build-system) (arguments `(#:python ,python-2 ; use python-2 for the test script #:phases (modify-phases %standard-phases (replace 'check (lambda _ (substitute* "test/run" ;; Run tests with `python' only. (("^(PYTHON_VERSIONS = ).*" all m) (string-append m "['']"))) (invoke "test/run")))))) (home-page "https://github.com/dilshod/xlsx2csv") (synopsis "XLSX to CSV converter") (description "Xlsx2csv is a program to convert Microsoft Excel 2007 XML (XLSX and XLSM) format spreadsheets into plaintext @dfn{comma separated values} (CSV) files. It is designed to be fast and to handle large input files.") (license license:gpl2+))) (define-public python-defusedxml (package (name "python-defusedxml") (version "0.6.0") (source (origin (method url-fetch) (uri (pypi-uri "defusedxml" version)) (sha256 (base32 "1xbp8fivl3wlbyg2jrvs4lalaqv1xp9a9f29p75wdx2s2d6h717n")))) (build-system python-build-system) (home-page "https://bitbucket.org/tiran/defusedxml") (synopsis "XML bomb protection for Python stdlib modules") (description "Defusedxml provides XML bomb protection for Python stdlib modules.") (license license:psfl))) (define-public freexl (package (name "freexl") (version "1.0.6") (source (origin (method url-fetch) (uri (string-append "https://www.gaia-gis.it/gaia-sins/" "freexl-" version ".tar.gz")) (sha256 (base32 "08pwj17l0lgp6zms9nmpawdxpvhzrslklbd53s4b430k7mxbbs1x")))) (build-system gnu-build-system) (home-page "https://www.gaia-gis.it/fossil/freexl/index") (synopsis "Read Excel files") (description "FreeXL is a C library to extract valid data from within an Excel (.xls) spreadsheet.") ;; Any of these licenses may be picked. (license (list license:gpl2+ license:lgpl2.1+ license:mpl1.1)))) (define-public xerces-c (package (name "xerces-c") (version "3.2.3") (source (origin (method url-fetch) (uri (string-append "mirror://apache/xerces/c/3/sources/" "xerces-c-" version ".tar.xz")) (sha256 (base32 "0jf1khvlssg31vkxbc25dxjxcxm56xb8nywj1sypj6hxzjlrkz0j")))) (build-system gnu-build-system) (arguments (let ((system (or (%current-target-system) (%current-system)))) (if (string-prefix? "x86_64" system) '() '(#:configure-flags '("--disable-sse2"))))) (native-inputs (list perl)) (home-page "https://xerces.apache.org/xerces-c/") (synopsis "Validating XML parser library for C++") (description "Xerces-C++ is a validating XML parser written in a portable subset of C++. Xerces-C++ makes it easy to give your application the ability to read and write XML data. A shared library is provided for parsing, generating, manipulating, and validating XML documents using the DOM, SAX, and SAX2 APIs.") (license license:asl2.0))) (define-public xlsxio (package (name "xlsxio") (version "0.2.29") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/brechtsanders/xlsxio") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0jr6ggzhd8aakdvppcl8scy9j9jafg82zbzr4ih996sz8lrj90fn")))) (native-inputs (list expat gnu-make minizip which)) (build-system gnu-build-system) (arguments `(#:phases (modify-phases %standard-phases (delete 'configure) (delete 'check) (replace 'install (lambda* (#:key outputs #:allow-other-keys) (invoke "make" "install" (string-append "PREFIX=" (assoc-ref outputs "out")))))))) (synopsis "C library for reading and writing .xlsx files") (description "XLSX I/O aims to provide a C library for reading and writing .xlsx files. The .xlsx file format is the native format used by Microsoft(R) Excel(TM) since version 2007.") (home-page "https://github.com/brechtsanders/xlsxio") (license license:expat))) (define-public java-simple-xml (package (name "java-simple-xml") (version "2.7.1") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/simple/simple-xml-" version ".zip")) (sha256 (base32 "0w19k1awslmihpwsxwjbg89hv0vjhk4k3i0vrfchy3mqknd988y5")) (patches (search-patches "java-simple-xml-fix-tests.patch")))) (build-system ant-build-system) (arguments `(#:build-target "build" #:test-target "test" #:phases (modify-phases %standard-phases (replace 'install (install-jars "jar")) (add-before 'check 'disable-failing-test (lambda _ ;; This test sometimes fails with an out of memory exception (delete-file "test/src/org/simpleframework/xml/core/NoAnnotationsRequiredTest.java")))))) (native-inputs (list unzip)) (home-page "http://simple.sourceforge.net/") (synopsis "XML serialization framework for Java") (description "Simple is a high performance XML serialization and configuration framework for Java. Its goal is to provide an XML framework that enables rapid development of XML configuration and communication systems. This framework aids the development of XML systems with minimal effort and reduced errors. It offers full object serialization and deserialization, maintaining each reference encountered.") (license license:asl2.0))) (define-public perl-xml-xpathengine (package (name "perl-xml-xpathengine") (version "0.14") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/M/MI/MIROD/" "XML-XPathEngine-" version ".tar.gz")) (sha256 (base32 "0r72na14bmsxfd16s9nlza155amqww0k8wsa9x2a3sqbpp5ppznj")))) (build-system perl-build-system) (home-page "https://metacpan.org/release/XML-XPathEngine") (synopsis "Re-usable XPath engine for DOM-like trees") (description "This module provides an XPath engine, that can be re-used by other modules/classes that implement trees. In order to use the XPath engine, nodes in the user module need to mimic DOM nodes. The degree of similitude between the user tree and a DOM dictates how much of the XPath features can be used. A module implementing all of the DOM should be able to use this module very easily (you might need to add the @code{cmp} method on nodes in order to get ordered result sets).") (license license:perl-license))) (define-public perl-tree-xpathengine (package (name "perl-tree-xpathengine") (version "0.05") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/M/MI/MIROD/" "Tree-XPathEngine-" version ".tar.gz")) (sha256 (base32 "1vbbw8wxm79r3xbra8narw1dqvm34510q67wbmg2zmj6zd1k06r9")))) (build-system perl-build-system) (home-page "https://metacpan.org/release/Tree-XPathEngine") (synopsis "Re-usable XPath engine") (description "This module provides an XPath engine, that can be re-used by other module/classes that implement trees. It is designed to be compatible with @code{Class::XPath}, ie it passes its tests if you replace @code{Class::XPath} by @code{Tree::XPathEngine}.") (license license:perl-license))) (define-public perl-xml-filter-buffertext (package (name "perl-xml-filter-buffertext") (version "1.01") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/R/RB/RBERJON/" "XML-Filter-BufferText-" version ".tar.gz")) (sha256 (base32 "0p5785c1dsk6kdp505vapb5h54k8krrz8699hpgm9igf7dni5llg")))) (build-system perl-build-system) (propagated-inputs (list perl-xml-sax-base)) (home-page "https://metacpan.org/release/XML-Filter-BufferText") (synopsis "Filter to put all characters() in one event") (description "This is a very simple filter. One common cause of grief (and programmer error) is that XML parsers aren't required to provide character events in one chunk. They can, but are not forced to, and most don't. This filter does the trivial but oft-repeated task of putting all characters into a single event.") (license license:perl-license))) (define-public perl-xml-sax-writer (package (name "perl-xml-sax-writer") (version "0.57") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/P/PE/PERIGRIN/" "XML-SAX-Writer-" version ".tar.gz")) (sha256 (base32 "1w1cd1ybxdvhmnxdlkywi3x5ka3g4md42kyynksjc09vyizd0q9x")))) (build-system perl-build-system) (propagated-inputs (list perl-libxml perl-xml-filter-buffertext perl-xml-namespacesupport perl-xml-sax-base)) (home-page "https://metacpan.org/release/XML-SAX-Writer") (synopsis "SAX2 XML Writer") (description "This is an XML writer that understands SAX2. It is based on @code{XML::Handler::YAWriter}.") (license license:perl-license))) (define-public perl-xml-handler-yawriter (package (name "perl-xml-handler-yawriter") (version "0.23") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/K/KR/KRAEHE/" "XML-Handler-YAWriter-" version ".tar.gz")) (sha256 (base32 "11d45a1sz862va9rry3p2m77pwvq3kpsvgwhc5ramh9mbszbnk77")))) (build-system perl-build-system) (propagated-inputs (list perl-libxml)) (home-page "https://metacpan.org/release/XML-Handler-YAWriter") (synopsis "Yet another Perl SAX XML Writer") (description "YAWriter implements Yet Another @code{XML::Handler::Writer}. It provides a flexible escaping technique and pretty printing.") (license license:perl-license))) (define-public perl-xml-twig (package (name "perl-xml-twig") (version "3.52") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/M/MI/MIROD/" "XML-Twig-" version ".tar.gz")) (sha256 (base32 "1bc0hrz4jp6199hi29sdxmb9gyy45whla9hd19yqfasgq8k5ixzy")))) (build-system perl-build-system) (inputs (list expat)) (propagated-inputs (list perl-html-tidy perl-html-tree perl-io-captureoutput perl-io-string perl-io-stringy perl-libxml perl-xml-filter-buffertext perl-xml-handler-yawriter perl-xml-parser perl-xml-sax-writer perl-xml-simple perl-xml-xpathengine perl-test-pod perl-tree-xpathengine)) (home-page "https://metacpan.org/release/XML-Twig") (synopsis "Perl module for processing huge XML documents in tree mode") (description "@code{XML::Twig} is an XML transformation module. Its strong points: can be used to process huge documents while still being in tree mode; not bound by DOM or SAX, so it is very perlish and offers a very comprehensive set of methods; simple to use; DWIMs as much as possible. What it doesn't offer: full SAX support (it can export SAX, but only reads XML), full XPath support (unless you use @code{XML::Twig::XPath}), nor DOM support.") (license license:perl-license))) ;; TODO: Debian builds several jars out of this: jaxp-1.4.jar, ;; xml-apis.jar and xml-apis-1.4.01.jar. (define-public java-jaxp (package (name "java-jaxp") (version "1.4.01") (source (origin (method url-fetch) (uri (string-append "mirror://apache/xerces/xml-commons/source/" "xml-commons-external-" version "-src.tar.gz")) (sha256 (base32 "0rhq32a7dl9yik7zx9h0naz2iz068qgcdiayak91wp4wr26xhjyk")))) (build-system ant-build-system) (arguments `(#:jar-name "jaxp.jar" #:jdk ,icedtea-8 #:source-dir ".." #:tests? #f)); no tests (home-page "http://xerces.apache.org/xml-commons/") (synopsis "Java XML parser and transformer APIs (DOM, SAX, JAXP, TrAX)") (description "Jaxp from the Apache XML Commons project is used by the Xerces-J XML parser and Xalan-J XSLT processor and specifies these APIs: @itemize @item Document Object Model (DOM) @item Simple API for XML (SAX) @item Java APIs for XML Processing (JAXP) @item Transformation API for XML (TrAX) @item Document Object Model (DOM) Load and Save @item JSR 206 Java API for XML Processing @end itemize") (license (list license:asl2.0 license:w3c ;; Files under org.w3c license:public-domain)))) ;; org.xml.sax (define-public java-apache-xml-commons-resolver (package (name "java-apache-xml-commons-resolver") (version "1.2") (source (origin (method url-fetch) (uri (string-append "mirror://apache/xerces/xml-commons/" "xml-commons-resolver-" version ".tar.gz")) (sha256 (base32 "1zhy4anc3fg9f8y348bj88vmab15aavrg6nf419ifb25asyygnsm")) (modules '((guix build utils))) (snippet '(begin (for-each delete-file (find-files "." ".*\\.(jar|zip)")) #t)))) (build-system ant-build-system) (arguments `(#:jar-name (string-append "xml-resolver.jar") #:tests? #f)); no tests (inputs (list java-junit)) (home-page "http://xerces.apache.org/xml-commons/") (synopsis "Catalog-based entity and URI resolution") (description "The resolver class implements the full semantics of OASIS Technical Resolution 9401:1997 (Amendment 2 to TR 9401) catalogs and the 06 Aug 2001 Committee Specification of OASIS XML Catalogs. It also includes a framework of classes designed to read catalog files in a number of formats: @itemize @item The plain-text flavor described by TR9401. @item The XCatalog XML format defined by John Cowan @item The XML Catalog format defined by the OASIS Entity Resolution Technical Committee. @end itemize") (license license:asl2.0))) ;; Jaxen requires java-dom4j and java-xom that in turn require jaxen. ;; This package is a bootstrap version without dependencies on dom4j and xom. (define java-jaxen-bootstrap (package (name "java-jaxen-bootstrap") (version "1.1.6") (source (origin (method url-fetch) ;; No release on github (uri (string-append "https://repo1.maven.org/maven2/jaxen/jaxen/" version "/jaxen-" version "-sources.jar")) (sha256 (base32 "18pa8mks3gfhazmkyil8wsp6j1g1x7rggqxfv4k2mnixkrj5x1kx")))) (build-system ant-build-system) (arguments `(#:jar-name "jaxen.jar" #:source-dir "src" #:tests? #f; no tests #:phases (modify-phases %standard-phases (add-before 'build 'remove-dom4j (lambda _ (delete-file-recursively "src/org/jaxen/dom4j") (delete-file-recursively "src/org/jaxen/xom") #t))))) (inputs `(("java-jdom" ,java-jdom))) (home-page "https://github.com/jaxen-xpath/jaxen") (synopsis "XPath library") (description "Jaxen is an XPath library written in Java. It is adaptable to many different object models, including DOM, XOM, dom4j, and JDOM. It is also possible to write adapters that treat non-XML trees such as compiled Java byte code or Java beans as XML, thus enabling you to query these trees with XPath too.") (license license:bsd-3))) (define-public java-jaxen (package (inherit java-jaxen-bootstrap) (name "java-jaxen") (inputs (list java-jdom java-xom java-dom4j)))) (define-public java-xom (package (name "java-xom") (version "127") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/elharo/xom") (commit (string-append "XOM_" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1jh6y03g5zzdhsb5jm6ms1xnamr460qmn96y3w6aw0ikfwqlg0bq")) (modules '((guix build utils))) (snippet '(begin (for-each delete-file (find-files "." "\\.jar$")) #t)))) (build-system ant-build-system) (arguments `(#:jar-name "xom.jar" #:jdk ,icedtea-8 #:tests? #f ; no tests #:phases (modify-phases %standard-phases (add-after 'unpack 'make-git-checkout-writable (lambda _ (for-each make-file-writable (find-files ".")) #t)) (add-before 'configure 'fix-tagsoup-dep (lambda _ ;; FIXME: Where is tagsoup source? (delete-file "src/nu/xom/tools/XHTMLJavaDoc.java") #t))))) (inputs (list java-jdom java-junit java-classpathx-servletapi java-jaxen-bootstrap java-xerces)) (home-page "https://xom.nu/") (synopsis "XML Object Model") (description "XOM is a new XML Object Model for processing XML with Java that strives for correctness and simplicity.") ;; 2.1 only (license license:lgpl2.1))) (define-public java-xsdlib (package (name "java-xsdlib") (version "2013.2") (source (origin (method url-fetch) (uri (string-append "https://repo1.maven.org/maven2/com/sun/msv/" "datatype/xsd/xsdlib/" version "/xsdlib-" version "-sources.jar")) (sha256 (base32 "185i48p1xp09wbq03i9zgfl701qa262rq46yf4cajzmk3336kqim")))) (build-system ant-build-system) (arguments `(#:tests? #f; no tests #:jar-name "xsdlib.jar" #:jdk ,icedtea-8)) (inputs (list java-xerces)) (home-page (string-append "https://web.archive.org/web/20161127144537/" "https://msv.java.net//")) (synopsis "Sun Multi-Schema Validator") (description "Xsdlib contains an implementation of sun.com.msv, an XML validator.") (license license:bsd-2))) (define-public java-xpp3 (package (name "java-xpp3") (version "1.1.4") (source (origin (method url-fetch) (uri (string-append "http://www.extreme.indiana.edu/dist/" "java-repository/xpp3/distributions/xpp3-" version "_src.tgz")) (sha256 (base32 "1b99zrhyij5qwyhilyjdl1ykxvhk902vsvflh6gx4fir8hfvdl5p")) (modules '((guix build utils))) (snippet '(begin ;; Delete bundled jar archives. (for-each delete-file (find-files "." ".*\\.jar")) #t)))) (build-system ant-build-system) (arguments `(#:tests? #f; no tests #:build-target "jar" #:phases (modify-phases %standard-phases (replace 'install (install-jars "build"))))) (home-page "http://www.extreme.indiana.edu/xgws/xsoap/xpp/") (synopsis "Streaming pull XML parser") (description "Xml Pull Parser (in short XPP) is a streaming pull XML parser and should be used when there is a need to process quickly and efficiently all input elements (for example in SOAP processors). This package is a stable XmlPull parsing engine that is based on ideas from XPP and in particular XPP2 but completely revised and rewritten to take the best advantage of JIT JVMs.") (license (license:non-copyleft "file://LICENSE.txt")))) (define-public java-xmlpull2 (package (name "java-xmlpull2") (version "2.1.10") (source (origin (method url-fetch) ;; Unfortunately, archive.org does not have a copy of this file. (uri (string-append "https://ftp.fau.de/gentoo/distfiles/" "PullParser" version ".tgz")) (sha256 (base32 "1kw9nhyqb7bzhn2zjbwlpi5vp5rzj89amzi3hadw2acyh2dmd0md")) (modules '((guix build utils))) (snippet '(begin ;; Delete bundled jar archives. (for-each delete-file (find-files "." ".*\\.jar")) #t)))) (build-system ant-build-system) (arguments `(#:tests? #f; no tests #:build-target "impl" #:phases (modify-phases %standard-phases (replace 'install (install-jars "build/lib"))))) (home-page (string-append "https://web.archive.org/web/20210225153105/" "https://www.extreme.indiana.edu/")) (synopsis "Streaming pull XML parser") (description "Xml Pull Parser (in short XPP) is a streaming pull XML parser and should be used when there is a need to process quickly and efficiently all input elements (for example in SOAP processors). This package is in maintenance mode.") (license (license:non-copyleft "file:///LICENSE.txt")))) (define-public java-xmlpull-api-v1 (package (name "java-xmlpull-api-v1") (version "1.1.3.4b") (source (origin ;; The package is originally from Extreme! Lab, but the website ;; is now gone. This repositories contains the sources of the ;; latest version. (method git-fetch) (uri (git-reference (url "https://github.com/aslom/xmlpull-api-v1") ;; No releases, this is the latest commit (commit "abeaa4aa87b2625af70c32f658f44e11355fe568"))) (file-name (git-file-name name version)) (sha256 (base32 "15bdqxfncnakskna4m9gsh4f9iczxy83qxn2anqiqd15z406a5ih")) (modules '((guix build utils))) (snippet `(begin (delete-file-recursively "lib") (mkdir-p "lib") ;; prevents a failure in "dist_lite" (substitute* "build.xml" (("README.html") "README.md")))))) (build-system ant-build-system) (arguments `(#:test-target "junit" #:build-target "dist" #:phases (modify-phases %standard-phases (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (doc (string-append out "/share/doc/" ,name "-" ,version)) (java (string-append out "/share/java")) (project (string-append "xmlpull_" ,(string-join (string-split version #\.) "_")))) (mkdir-p doc) (copy-recursively (string-append "build/dist/" project "/doc/") doc) (mkdir-p java) (copy-file (string-append "build/dist/" project "/" project ".jar") (string-append java "/" project ".jar"))) ))))) (home-page "https://github.com/aslom/xmlpull-api-v1") (synopsis "XML pull parsing API") (description "XmlPull v1 API is a simple to use XML pull parsing API. XML pull parsing allows incremental (sometimes called streaming) parsing of XML where application is in control - the parsing can be interrupted at any given moment and resumed when application is ready to consume more input.") (license license:public-domain))) (define-public java-dom4j (package (name "java-dom4j") (version "2.1.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/dom4j/dom4j") (commit (string-append "version-" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0q907srj9v4hwicpcrn4slyld5npf2jv7hzchsgrg29q2xmbwkdl")) (modules '((guix build utils))) (snippet '(begin ;; Delete bundled jar archives. (for-each delete-file (find-files "." ".*\\.jar")) #t)))) (build-system ant-build-system) (arguments `(#:jar-name "dom4j.jar" #:jdk ,icedtea-8 #:source-dir "src/main/java" ;; FIXME: Requires xalan, but xalan depends on java-cup which has a ;; dependency on itself through jflex. #:tests? #f #:phases (modify-phases %standard-phases (add-before 'build 'copy-jaxen-sources ;; java-jaxen-bootstrap is not enough. These files have a circular ;; dependency and there is no subset of dom4j that would allow ;; breaking the circle. (lambda* (#:key inputs #:allow-other-keys) (mkdir-p "jaxen-sources") (with-directory-excursion "jaxen-sources" (system* "jar" "xf" (assoc-ref inputs "java-jaxen-sources"))) (mkdir-p "src/main/java/org/jaxen/dom4j") (copy-file "jaxen-sources/org/jaxen/dom4j/DocumentNavigator.java" "src/main/java/org/jaxen/dom4j/DocumentNavigator.java") (copy-file "jaxen-sources/org/jaxen/dom4j/Dom4jXPath.java" "src/main/java/org/jaxen/dom4j/Dom4jXPath.java") #t)) (add-before 'build 'fix-old-xpp2 (lambda _ ;; This package normally depends on xpp2 2.0, but version 2.1.10 ;; is the only version whose source code is published. (substitute* "src/main/java/org/dom4j/xpp/ProxyXmlStartTag.java" (("public void resetStartTag") "public boolean removeAttributeByRawName(String name) {\n return false;\n }\n public boolean removeAttributeByName(String name, String name2) {\n return false;\n }\n\npublic void resetStartTag") (("Atttribute") "Attribute")) #t))))) (inputs `(("java-jaxen-bootstrap" ,java-jaxen-bootstrap) ("java-jaxen-sources" ,(package-source java-jaxen-bootstrap)) ("java-xmlpull2" ,java-xmlpull2) ("java-xpp3" ,java-xpp3) ("java-xsdlib" ,java-xsdlib))) (native-inputs (list java-testng java-xerces)) (home-page "https://dom4j.github.io/") (synopsis "Flexible XML framework for Java") (description "Dom4j is a flexible XML framework for Java. DOM4J works with DOM, SAX, XPath, and XSLT. It can parse large XML documents with very low memory footprint.") ;; some BSD-like 5-clause license (license (license:non-copyleft "file://LICENSE")))) (define-public java-kxml2 (package (name "java-kxml2") (version "2.4.2") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/stefanhaustein/kxml2") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0g6d8c9r9sh3x04sf4wdpgwvhkqvk11k3kq9skx91i60h4vn01hg")))) (build-system ant-build-system) (arguments `(#:jar-name "kxml2.jar" #:source-dir "src/main/java" #:test-include (list "TestWb.java") ;; Test failure: it was expected to get an XML entity but got the ;; equivalent Unicode character instead. #:tests? #f #:phases (modify-phases %standard-phases (add-after 'unpack 'make-git-checkout-writable (lambda _ (for-each make-file-writable (find-files ".")) #t)) (add-before 'build 'copy-resources (lambda _ (copy-recursively "src/main/resources" "build/classes") #t))))) (inputs (list java-xpp3)) (native-inputs (list java-junit)) (home-page "http://kxml.org") (synopsis "XML pull parser") (description "kXML is a small XML pull parser, specially designed for constrained environments such as Applets, Personal Java or devices compliant with the Mobile Information Device Profile (MIDP).") (license license:expat))) (define-public java-stax (package (name "java-stax") (version "1.2.0") (source (origin (method url-fetch) (uri (string-append "https://repo1.maven.org/maven2/stax/stax/" version "/stax-" version "-sources.jar")) (sha256 (base32 "04ba4qvbrps45j8bldbakxq31k7gjlsay9pppa9yn13fr00q586z")))) (build-system ant-build-system) (arguments `(#:jar-name "stax.jar" #:tests? #f; no tests #:phases (modify-phases %standard-phases (add-before 'configure 'fix-utf8 (lambda _ ;; This file is ISO-8859-1 but java expects UTF-8. ;; Remove special characters in comments. (with-fluids ((%default-port-encoding "ISO-8859-1")) (substitute* "src/com/wutka/dtd/Scanner.java" (("//.*") "\n"))) #t))))) (home-page "https://repo1.maven.org/maven2/stax/stax/") (synopsis "Streaming API for XML") (description "This package provides the reference implementation of the @dfn{Streaming API for XML} (StAX). It is used for streaming XML data to and from a Java application. It provides a standard pull parser interface.") (license license:asl2.0))) (define-public java-jettison (package (name "java-jettison") (version "1.3.7") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/codehaus/jettison") (commit (string-append "jettison-" version)))) (file-name (git-file-name name version)) (sha256 (base32 "15sydmi5chdh4126qc7v8bsrp7fp4ldaya8a05iby4pq2324q0qw")))) (build-system ant-build-system) (arguments `(#:jar-name "jettison.jar" #:source-dir "src/main/java" #:test-exclude (list "**/Abstract*.java" ;; Abstract classes "**/DOMTest.java" "**/BadgerFishDOMTest.java" "**/MappedDOMTest.java"))) (native-inputs (list java-junit)) (home-page "https://github.com/codehaus/jettison") (synopsis "StAX implementation for JSON") (description "Jettison is a Java library for converting XML to JSON and vice-versa with the help of the @dfn{Streaming API for XML} (StAX). It implements @code{XMLStreamWriter} and @code{XMLStreamReader} and supports @code{Mapped} and @code{BadgerFish} conventions.") (license license:asl2.0))) (define-public java-jdom2 (package (name "java-jdom") (version "2.0.6") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/hunterhacker/jdom") (commit (string-append "JDOM-" version)))) (file-name (git-file-name name version)) (sha256 (base32 "14vv1kxrsdvwi4cz3rx6r48w5y6fvk9cymil8qhvxwp56xxrgxiq")))) (build-system ant-build-system) (arguments `(#:build-target "package" #:tests? #f ; tests are run as part of the build process #:phases (modify-phases %standard-phases (replace 'install (install-jars "build"))))) (home-page "http://jdom.org/") (synopsis "Access, manipulate, and output XML data") (description "Jdom is a Java-based solution for accessing, manipulating, and outputting XML data from Java code.") (license license:bsd-4))) (define-public java-xstream (package (name "java-xstream") (version "1.4.16") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/x-stream/xstream") (commit (string-append "XSTREAM_" (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version))))) (file-name (git-file-name name version)) (sha256 (base32 "16k2mc63h2fw7lxv74qmhg4p8q9hfrw114daa6nxwnpv08cnq755")))) (build-system ant-build-system) (arguments `(#:jar-name "xstream.jar" ;; FIXME: Tests are not in a java subdirectory as assumed by ant-build-system. #:tests? #f #:jdk ,icedtea-8 #:source-dir "xstream/src/java")) (inputs `(("java-jdom" ,java-jdom) ("java-jdom2" ,java-jdom2) ("java-cglib" ,java-cglib) ("java-joda-time" ,java-joda-time) ("java-jettison" ,java-jettison) ("java-xom" ,java-xom) ("java-mxparser" ,java-mxparser) ("java-xpp3" ,java-xpp3) ("java-dom4j" ,java-dom4j) ("java-stax2-api" ,java-stax2-api) ("java-woodstox-core" ,java-woodstox-core) ("java-kxml2" ,java-kxml2) ("java-stax" ,java-stax))) (home-page "https://x-stream.github.io") (synopsis "XML serialization library") (description "XStream is a simple library to serialize Java objects to XML and back again.") (license license:bsd-3))) (define-public java-mxparser (package (name "java-mxparser") (version "1.2.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/x-stream/mxparser") (commit (string-append "v-" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0i3jrjbz4hgf62fm1ix7nlcmhi4kcv4flqsfvh7a3l2v7nsp5ryb")))) (build-system ant-build-system) (arguments `(#:jar-name "mxparser.jar" #:source-dir "src/main/java" #:test-dir "src/test" #:phases (modify-phases %standard-phases (add-before 'build 'copy-resources (lambda _ (copy-recursively "src/main/resources" "build/classes") #t))))) (propagated-inputs (list java-xmlpull-api-v1)) (native-inputs (list java-junit)) (home-page "https://github.com/x-stream/mxparser") (synopsis "Streaming pull XML parser forked from @code{java-xpp3}") (description "Xml Pull Parser (in short XPP) is a streaming pull XML parser and should be used when there is a need to process quickly and efficiently all input elements (for example in SOAP processors). This package is a stable XmlPull parsing engine that is based on ideas from XPP and in particular XPP2 but completely revised and rewritten to take the best advantage of JIT JVMs. MXParser is a fork of xpp3_min 1.1.7 containing only the parser with merged changes of the Plexus fork. It is an implementation of the XMLPULL V1 API (parser only).") (license (license:non-copyleft "file://LICENSE.txt")))) (define-public xmlrpc-c (package (name "xmlrpc-c") (version "1.43.08") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/xmlrpc-c/Xmlrpc-c%20Super%20Stable/" version "/xmlrpc-c-" version ".tgz")) (sha256 (base32 "18zwbj6i2hpcn5riiyp8i6rml0sfv60dd7phw1x8g4r4lj2bbxf9")))) (build-system gnu-build-system) (inputs (list curl)) (native-inputs (list ;; For tools, if ever needed. perl)) (arguments `(#:make-flags ; Add $libdir to the RUNPATH of all the executables. (list (string-append "LDFLAGS_PERSONAL=-Wl,-rpath=" %output "/lib")) #:phases (modify-phases %standard-phases (add-after 'unpack 'fix-/bin/sh-in-tests (lambda _ (substitute* "GNUmakefile" (("#! /bin/sh") (which "sh"))) #t))))) (home-page "http://xmlrpc-c.sourceforge.net/") (synopsis "Lightweight RPC library based on XML and HTTP") (description "XML-RPC is a quick-and-easy way to make procedure calls over the Internet. It converts the procedure call into an XML document, sends it to a remote server using HTTP, and gets back the response as XML. This library provides a modular implementation of XML-RPC for C and C++.") (license (list license:psfl license:expat)))) (define-public opensp (package (name "opensp") (version "1.5.2") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/openjade/opensp/" version "/OpenSP-" version ".tar.gz")) (sha256 (base32 "1khpasr6l0a8nfz6kcf3s81vgdab8fm2dj291n5r2s53k228kx2p")))) (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))) (arguments `( ;; 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))))) ;; $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 (variable "SGML_CATALOG_FILES") (separator ":") (files '("sgml")) (file-pattern "^catalog$|^CATALOG$|^.*\\.cat$") (file-type 'regular)))) (home-page "http://openjade.sourceforge.net/") (synopsis "Suite of SGML/XML processing tools") (description "OpenSP is an object-oriented toolkit for SGML parsing and entity management. It is a fork of James Clark's SP suite. The tools it contains can be used to parse, validate, and normalize SGML and XML files. The central program included in this package is @code{onsgmls}, which replaces @code{sgmls}, @code{ospam}, @code{ospent}, @code{osgmlnorm}, and @code{osx}.") (license ;; expat license with added clause regarding advertising (license:non-copyleft "file://COPYING" "See COPYING in the distribution.")))) (define-public python-elementpath (package (name "python-elementpath") (version "2.0.3") (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") (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 ElementTree library and for the @uref{http://lxml.de, lxml.etree} library. For lxml.etree this package can be useful for providing XPath 2.0 selectors, because lxml.etree already has its own implementation of XPath 1.0.") (license license:expat))) (define-public python-lxml (package (name "python-lxml") (version "4.6.3") (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)"))))) (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases (replace 'check (lambda _ (invoke "make" "test")))))) (inputs (list libxml2 libxslt)) (home-page "https://lxml.de/") (synopsis "Python XML processing library") (description "The lxml XML toolkit is a Pythonic binding for the C libraries 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-public python2-lxml (package-with-python2 python-lxml)) (define-public python-untangle ;; The latest tagged release is from 2014; use the latest commit. (let ((revision "1") (commit "fb916a9621175d000a3b0ca9322d3b3ebf8570c0")) (package (name "python-untangle") ;; PyPI currently offers some untagged 1.1.1 version. (version (git-version "1.1.1" revision commit)) (source (origin (method git-fetch) ;no tests in pypi archive (uri (git-reference (url "https://github.com/stchris/untangle") (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"))))))) (home-page "http://0chris.com/untangle") (synopsis "XML to Python objects conversion library") (description "@code{untangle} is a tiny Python library which converts an XML document to a Python object.") (license license:expat)))) (define-public python-xmlschema (package (name "python-xmlschema") (version "1.2.5") (source (origin ;; Unit tests are not distributed with the PyPI archive. (method git-fetch) (uri (git-reference (url "https://github.com/sissaschool/xmlschema") (commit (string-append "v" version)))) (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~%"))))))) (native-inputs (list python-lxml)) ;for tests (propagated-inputs (list python-elementpath)) (home-page "https://github.com/sissaschool/xmlschema") (synopsis "XML Schema validator and data conversion library") (description "The @code{xmlschema} library is an implementation of @url{https://www.w3.org/2001/XMLSchema, XML Schema} for Python. It has full support for the XSD 1.0 and 1.1 standards, an XPath-based API for finding schema's elements and attributes; and can encode and decode XML data to JSON and other formats.") (license license:expat))) (define-public python-xmltodict (package (name "python-xmltodict") (version "0.12.0") (source (origin (method url-fetch) (uri (pypi-uri "xmltodict" version)) (sha256 (base32 "08cadlb9vsb4pmzc99lz3a2lx6qcfazyvgk10pcqijvyxlwcdn2h")))) (build-system python-build-system) (native-inputs (list python-coverage python-nose)) (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 @code{OrderedDict}.") (license license:expat)))