summaryrefslogtreecommitdiff
path: root/gnu/packages/xml.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/xml.scm')
-rw-r--r--gnu/packages/xml.scm489
1 files changed, 489 insertions, 0 deletions
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 57bf8b1fa6..12a68abae3 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -40,6 +40,7 @@
#:use-module (gnu packages autotools)
#:use-module (gnu packages compression)
#:use-module (gnu packages gnupg)
+ #:use-module (gnu packages java)
#:use-module (gnu packages perl)
#:use-module (gnu packages perl-check)
#:use-module (gnu packages python)
@@ -1469,3 +1470,491 @@ 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
+ `(("java-junit" ,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
+ `(("java-jdom" ,java-jdom)
+ ("java-xom" ,java-xom)
+ ("java-dom4j" ,java-dom4j)))))
+
+(define-public java-xom
+ (package
+ (name "java-xom")
+ (version "127")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/elharo/xom/archive/XOM_"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "04m69db1irqja12a9rfxrac8cbn9psqa1k136wh4ls4pxfsdr5wg"))
+ (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-before 'configure 'fix-tagsoup-dep
+ (lambda _
+ ;; FIXME: Where is tagsoup source?
+ (delete-file "src/nu/xom/tools/XHTMLJavaDoc.java")
+ #t)))))
+ (inputs
+ `(("java-jdom" ,java-jdom)
+ ("java-junit" ,java-junit)
+ ("java-classpathx-servletapi" ,java-classpathx-servletapi)
+ ("java-jaxen-bootstrap" ,java-jaxen-bootstrap)
+ ("java-xerces" ,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 "http://central.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
+ `(("java-xerces" ,java-xerces)))
+ (home-page "http://central.maven.org/maven2/com/sun/msv/datatype/xsd/xsdlib/")
+ (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)
+ (uri (string-append "http://www.extreme.indiana.edu/xgws/xsoap/"
+ "PullParser/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 "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 in maintenance mode.")
+ (license (license:non-copyleft "file:///LICENSE.txt"))))
+
+(define-public java-dom4j
+ (package
+ (name "java-dom4j")
+ (version "2.1.0")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/dom4j/dom4j/archive/"
+ "version-" version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "101drpnw6agmcvsi1jrfi0kn97r7liazrh5jbrip9vx26axn2fx9"))
+ (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
+ `(("java-testng" ,java-testng)
+ ("java-xerces" ,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 url-fetch)
+ (uri (string-append "https://github.com/stefanhaustein/kxml2/archive/v"
+ version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "17kh04qf3vll1xx6sv06xlazw2hxa8qdmzyday9r6z2191jlj74w"))))
+ (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-before 'build 'copy-resources
+ (lambda _
+ (copy-recursively "src/main/resources" "build/classes"))))))
+ (inputs
+ `(("java-xpp3" ,java-xpp3)))
+ (native-inputs
+ `(("java-junit" ,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 url-fetch)
+ (uri (string-append "https://github.com/codehaus/jettison/archive/"
+ "jettison-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0rdhfyxywvga5wiwasc04iqnxyixn3rd8wj01c9ymhvwc3h6dpqg"))))
+ (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
+ `(("java-junit" ,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 url-fetch)
+ (uri (string-append "https://github.com/hunterhacker/jdom/archive/JDOM-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0p8n7inqq2a25wk9ljinl3ixlx1x2la9qaman8ngd75xxjb02yc1"))))
+ (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.10")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/x-stream/xstream/archive/XSTREAM_"
+ (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
+ ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "10zbkam05wirxipvgrjimdwsyqrwl4a0n7lhvxbsssqpv727469g"))))
+ (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-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)))