projects/guix·blob dexed · refs

1012 lines · 39.0 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2017, 2021, 2023 Ricardo Wurmus <[email protected]>
3;;; Copyright © 2017, 2018, 2021 Julien Lepiller <[email protected]>
4;;; Copyright © 2018 Gábor Boskovits <[email protected]>
5;;; Copyright © 2019, 2021 Tobias Geerinckx-Rice <[email protected]>
6;;; Copyright © 2020 Vincent Legoll <[email protected]>
7;;; Copyright © 2021 Léo Le Bouter <[email protected]>
8;;; Copyright © 2022 Christopher Baines <[email protected]>
9;;; Copyright © 2023 Frank Pursel <[email protected]>
10;;; Copyright © 2024, 2025 Hartmut Goebel <[email protected]>
11;;;
12;;; This file is part of GNU Guix.
13;;;
14;;; GNU Guix is free software; you can redistribute it and/or modify it
15;;; under the terms of the GNU General Public License as published by
16;;; the Free Software Foundation; either version 3 of the License, or (at
17;;; your option) any later version.
18;;;
19;;; GNU Guix is distributed in the hope that it will be useful, but
20;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22;;; GNU General Public License for more details.
23;;;
24;;; You should have received a copy of the GNU General Public License
25;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27(define-module (gnu packages java-xml)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages check)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages gtk)
33 #:use-module (gnu packages java)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix gexp)
36 #:use-module (guix packages)
37 #:use-module (guix bzr-download)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix build-system ant)
41 #:use-module (guix utils))
42
43(define-public java-jericho-html
44 (package
45 (name "java-jericho-html")
46 (version "3.4")
47 (source (origin
48 (method bzr-fetch)
49 (uri (bzr-reference (url (string-append
50 "http://jerichohtml.bzr.sourceforge.net/"
51 "bzr/jerichohtml"))
52 (revision (string-append "tag:" version))))
53 (file-name (string-append name "-" version "-checkout"))
54 (sha256
55 (base32
56 "1zsf4i33jn05pma4y1658d6avhw7x4c12ggs96szhc06b7bxs8j0"))
57 (modules '((guix build utils)))
58 (snippet '(begin
59 (format #t "~%~a~%" "Removing sourced jar files.")
60 (for-each (lambda (jarf)
61 (delete-file jarf)
62 (format #t "Deleted: ~a~%" jarf))
63 (find-files "." "\\.jar$"))))))
64 (build-system ant-build-system)
65 (arguments
66 `(#:jar-name (string-append ,name ".jar")
67 #:phases (modify-phases %standard-phases
68 (add-before 'build 'add-ant-env-options
69 (lambda* _
70 (setenv "ANT_OPTS" "-Dfile.encoding=iso-8859-1")
71 (let ((match-str (string-append "jerichohtml-"
72 ,version)))
73 (substitute* "build.xml"
74 ((match-str)
75 "")))))
76 (add-after 'build 'check-prep
77 (lambda* (#:key source #:allow-other-keys)
78 (mkdir-p "src/test/java"))))))
79 (native-inputs (list
80 java-commons-logging-minimal
81 java-junit
82 java-log4j-api
83 java-slf4j-api))
84 (home-page "http://jericho.htmlparser.net/docs/index.html")
85 (synopsis "Java HTML Parser library")
86 (description
87 "This Java library allowing analysis and manipulation of
88parts of an HTML document, including server-side tags, while
89reproducing verbatim any unrecognised or invalid HTML. It also
90provides high-level HTML form manipulation functions.")
91 (license (list license:lgpl2.1+ license:asl2.0 license:epl1.0))))
92
93(define-public java-simple-xml
94 (package
95 (name "java-simple-xml")
96 (version "2.7.1")
97 (source (origin
98 (method url-fetch)
99 (uri (string-append "mirror://sourceforge/simple/simple-xml-"
100 version ".zip"))
101 (sha256
102 (base32
103 "0w19k1awslmihpwsxwjbg89hv0vjhk4k3i0vrfchy3mqknd988y5"))
104 (patches (search-patches "java-simple-xml-fix-tests.patch"))))
105 (build-system ant-build-system)
106 (arguments
107 `(#:build-target "build"
108 #:test-target "test"
109 #:phases
110 (modify-phases %standard-phases
111 (replace 'install (install-jars "jar"))
112 (add-before 'check 'disable-failing-test
113 (lambda _
114 ;; This test sometimes fails with an out of memory exception
115 (delete-file
116 "test/src/org/simpleframework/xml/core/NoAnnotationsRequiredTest.java"))))))
117 (native-inputs
118 (list unzip))
119 (home-page "https://simple.sourceforge.net/")
120 (synopsis "XML serialization framework for Java")
121 (description "Simple is a high performance XML serialization and
122configuration framework for Java. Its goal is to provide an XML framework
123that enables rapid development of XML configuration and communication systems.
124This framework aids the development of XML systems with minimal effort and
125reduced errors. It offers full object serialization and deserialization,
126maintaining each reference encountered.")
127 (license license:asl2.0)))
128
129;; TODO: Debian builds several jars out of this: jaxp-1.4.jar,
130;; xml-apis.jar and xml-apis-1.4.01.jar.
131(define-public java-jaxp
132 (package
133 (name "java-jaxp")
134 (version "1.4.01")
135 (source
136 (origin
137 (method url-fetch)
138 (uri (string-append "mirror://apache/xerces/xml-commons/source/"
139 "xml-commons-external-" version "-src.tar.gz"))
140 (sha256
141 (base32 "0rhq32a7dl9yik7zx9h0naz2iz068qgcdiayak91wp4wr26xhjyk"))))
142 (build-system ant-build-system)
143 (arguments
144 `(#:jar-name "jaxp.jar"
145 #:jdk ,icedtea-8
146 #:source-dir ".."
147 #:tests? #f)); no tests
148 (home-page "https://xerces.apache.org/xml-commons/")
149 (synopsis "Java XML parser and transformer APIs (DOM, SAX, JAXP, TrAX)")
150 (description "Jaxp from the Apache XML Commons project is used by
151the Xerces-J XML parser and Xalan-J XSLT processor and specifies these APIs:
152
153@itemize
154@item Document Object Model (DOM)
155@item Simple API for XML (SAX)
156@item Java APIs for XML Processing (JAXP)
157@item Transformation API for XML (TrAX)
158@item Document Object Model (DOM) Load and Save
159@item JSR 206 Java API for XML Processing
160@end itemize")
161 (license (list license:asl2.0
162 license:w3c ;; Files under org.w3c
163 license:public-domain)))) ;; org.xml.sax
164
165(define-public java-apache-xml-commons-resolver
166 (package
167 (name "java-apache-xml-commons-resolver")
168 (version "1.2")
169 (source
170 (origin
171 (method url-fetch)
172 (uri (string-append "mirror://apache/xerces/xml-commons/"
173 "xml-commons-resolver-" version ".tar.gz"))
174 (sha256
175 (base32 "1zhy4anc3fg9f8y348bj88vmab15aavrg6nf419ifb25asyygnsm"))
176 (modules '((guix build utils)))
177 (snippet
178 '(begin
179 (for-each delete-file (find-files "." ".*\\.(jar|zip)"))
180 #t))))
181 (build-system ant-build-system)
182 (arguments
183 `(#:jar-name (string-append "xml-resolver.jar")
184 #:tests? #f)); no tests
185 (inputs
186 (list java-junit))
187 (home-page "https://xerces.apache.org/xml-commons/")
188 (synopsis "Catalog-based entity and URI resolution")
189 (description "The resolver class implements the full semantics of OASIS Technical
190Resolution 9401:1997 (Amendment 2 to TR 9401) catalogs and the 06 Aug
1912001 Committee Specification of OASIS XML Catalogs.
192
193It also includes a framework of classes designed to read catalog files
194in a number of formats:
195
196@itemize
197@item The plain-text flavor described by TR9401.
198@item The XCatalog XML format defined by John Cowan
199@item The XML Catalog format defined by the OASIS Entity Resolution
200 Technical Committee.
201@end itemize")
202 (license license:asl2.0)))
203
204;; Jaxen requires java-dom4j and java-xom that in turn require jaxen.
205;; This package is a bootstrap version without dependencies on dom4j and xom.
206(define java-jaxen-bootstrap
207 (package
208 (name "java-jaxen-bootstrap")
209 (version "1.1.6")
210 (source (origin
211 (method url-fetch)
212 ;; No release on github
213 (uri (string-append "https://repo1.maven.org/maven2/jaxen/jaxen/"
214 version "/jaxen-" version "-sources.jar"))
215 (sha256
216 (base32
217 "18pa8mks3gfhazmkyil8wsp6j1g1x7rggqxfv4k2mnixkrj5x1kx"))))
218 (build-system ant-build-system)
219 (arguments
220 `(#:jar-name "jaxen.jar"
221 #:source-dir "src"
222 #:tests? #f; no tests
223 #:phases
224 (modify-phases %standard-phases
225 (add-before 'build 'remove-dom4j
226 (lambda _
227 (delete-file-recursively "src/org/jaxen/dom4j")
228 (delete-file-recursively "src/org/jaxen/xom")
229 #t)))))
230 (inputs
231 `(("java-jdom" ,java-jdom)))
232 (home-page "https://github.com/jaxen-xpath/jaxen")
233 (synopsis "XPath library")
234 (description "Jaxen is an XPath library written in Java. It is adaptable
235to many different object models, including DOM, XOM, dom4j, and JDOM. It is
236also possible to write adapters that treat non-XML trees such as compiled
237Java byte code or Java beans as XML, thus enabling you to query these trees
238with XPath too.")
239 (license license:bsd-3)))
240
241(define-public java-jaxen
242 (package
243 (inherit java-jaxen-bootstrap)
244 (name "java-jaxen")
245 (arguments
246 (strip-keyword-arguments
247 '(#:phases) ;; remove any phases added by java-jaxen-bootstrap
248 (package-arguments java-jaxen-bootstrap)))
249 (inputs
250 (list java-jdom java-xom java-dom4j))))
251
252(define-public java-xom
253 (package
254 (name "java-xom")
255 (version "127")
256 (source (origin
257 (method git-fetch)
258 (uri (git-reference
259 (url "https://github.com/elharo/xom")
260 (commit (string-append "XOM_" version))))
261 (file-name (git-file-name name version))
262 (sha256
263 (base32
264 "1jh6y03g5zzdhsb5jm6ms1xnamr460qmn96y3w6aw0ikfwqlg0bq"))
265 (modules '((guix build utils)))
266 (snippet
267 '(begin
268 (for-each delete-file
269 (find-files "." "\\.jar$"))
270 #t))))
271 (build-system ant-build-system)
272 (arguments
273 `(#:jar-name "xom.jar"
274 #:jdk ,icedtea-8
275 #:tests? #f ; no tests
276 #:phases
277 (modify-phases %standard-phases
278 (add-after 'unpack 'make-git-checkout-writable
279 (lambda _
280 (for-each make-file-writable (find-files "."))
281 #t))
282 (add-before 'configure 'fix-tagsoup-dep
283 (lambda _
284 ;; FIXME: Where is tagsoup source?
285 (delete-file "src/nu/xom/tools/XHTMLJavaDoc.java")
286 #t)))))
287 (inputs
288 (list java-jdom java-junit java-classpathx-servletapi
289 java-jaxen-bootstrap java-xerces))
290 (home-page "https://xom.nu/")
291 (synopsis "XML Object Model")
292 (description "XOM is a new XML Object Model for processing XML with Java
293that strives for correctness and simplicity.")
294 ;; 2.1 only
295 (license license:lgpl2.1)))
296
297(define-public java-xsdlib
298 (package
299 (name "java-xsdlib")
300 (version "2013.2")
301 (source (origin
302 (method url-fetch)
303 (uri (string-append "https://repo1.maven.org/maven2/com/sun/msv/"
304 "datatype/xsd/xsdlib/" version "/xsdlib-"
305 version "-sources.jar"))
306 (sha256
307 (base32
308 "185i48p1xp09wbq03i9zgfl701qa262rq46yf4cajzmk3336kqim"))))
309 (build-system ant-build-system)
310 (arguments
311 `(#:tests? #f; no tests
312 #:jar-name "xsdlib.jar"
313 #:jdk ,icedtea-8))
314 (inputs
315 (list java-xerces))
316 (home-page (string-append "https://web.archive.org/web/20161127144537/"
317 "https://msv.java.net//"))
318 (synopsis "Sun Multi-Schema Validator")
319 (description "Xsdlib contains an implementation of sun.com.msv, an XML
320validator.")
321 (license license:bsd-2)))
322
323(define-public java-xpp3
324 (package
325 (name "java-xpp3")
326 (version "1.1.4")
327 (source (origin
328 (method url-fetch)
329 (uri (string-append
330 "https://ci.guix.gnu.org/file/"
331 "xpp3-1.1.4_src.tgz"
332 "/sha256/"
333 "1b99zrhyij5qwyhilyjdl1ykxvhk902vsvflh6gx4fir8hfvdl5p"))
334 (file-name (string-append name "-" version "_src.tgz"))
335 (sha256
336 (base32
337 "1b99zrhyij5qwyhilyjdl1ykxvhk902vsvflh6gx4fir8hfvdl5p"))
338 (modules '((guix build utils)))
339 (snippet
340 '(begin ;; Delete bundled jar archives.
341 (for-each delete-file (find-files "." ".*\\.jar"))
342 #t))))
343 (build-system ant-build-system)
344 (arguments
345 `(#:tests? #f; no tests
346 #:build-target "jar"
347 #:phases
348 (modify-phases %standard-phases
349 (replace 'install (install-jars "build")))))
350 (home-page "http://www.extreme.indiana.edu/xgws/xsoap/xpp/")
351 (synopsis "Streaming pull XML parser")
352 (description "Xml Pull Parser (in short XPP) is a streaming pull XML
353parser and should be used when there is a need to process quickly and
354efficiently all input elements (for example in SOAP processors). This
355package is a stable XmlPull parsing engine that is based on ideas from XPP
356and in particular XPP2 but completely revised and rewritten to take the best
357advantage of JIT JVMs.")
358 (license (license:non-copyleft "file://LICENSE.txt"))))
359
360(define-public java-xmlpull2
361 (package
362 (name "java-xmlpull2")
363 (version "2.1.10")
364 (source (origin
365 (method url-fetch)
366 ;; Unfortunately, archive.org does not have a copy of this file.
367 (uri (string-append "https://ftp.fau.de/gentoo/distfiles/"
368 "PullParser" version ".tgz"))
369 (sha256
370 (base32
371 "1kw9nhyqb7bzhn2zjbwlpi5vp5rzj89amzi3hadw2acyh2dmd0md"))
372 (modules '((guix build utils)))
373 (snippet
374 '(begin ;; Delete bundled jar archives.
375 (for-each delete-file (find-files "." ".*\\.jar"))
376 #t))))
377 (build-system ant-build-system)
378 (arguments
379 `(#:tests? #f; no tests
380 #:build-target "impl"
381 #:phases
382 (modify-phases %standard-phases
383 (replace 'install (install-jars "build/lib")))))
384 (home-page (string-append "https://web.archive.org/web/20210225153105/"
385 "https://www.extreme.indiana.edu/"))
386 (synopsis "Streaming pull XML parser")
387 (description "Xml Pull Parser (in short XPP) is a streaming pull XML
388parser and should be used when there is a need to process quickly and
389efficiently all input elements (for example in SOAP processors). This
390package is in maintenance mode.")
391 (license (license:non-copyleft "file:///LICENSE.txt"))))
392
393(define-public java-xmlpull-api-v1
394 (package
395 (name "java-xmlpull-api-v1")
396 (version "1.1.3.4b")
397 (source (origin
398 ;; The package is originally from Extreme! Lab, but the website
399 ;; is now gone. This repositories contains the sources of the
400 ;; latest version.
401 (method git-fetch)
402 (uri (git-reference
403 (url "https://github.com/aslom/xmlpull-api-v1")
404 ;; No releases, this is the latest commit
405 (commit "abeaa4aa87b2625af70c32f658f44e11355fe568")))
406 (file-name (git-file-name name version))
407 (sha256
408 (base32
409 "15bdqxfncnakskna4m9gsh4f9iczxy83qxn2anqiqd15z406a5ih"))
410 (modules '((guix build utils)))
411 (snippet
412 `(begin
413 (delete-file-recursively "lib")
414 (mkdir-p "lib")
415 ;; prevents a failure in "dist_lite"
416 (substitute* "build.xml"
417 (("README.html") "README.md"))))))
418 (build-system ant-build-system)
419 (arguments
420 `(#:test-target "junit"
421 #:build-target "dist"
422 #:phases
423 (modify-phases %standard-phases
424 (replace 'install
425 (lambda* (#:key outputs #:allow-other-keys)
426 (let* ((out (assoc-ref outputs "out"))
427 (doc (string-append out "/share/doc/" ,name "-" ,version))
428 (java (string-append out "/share/java"))
429 (project (string-append
430 "xmlpull_"
431 ,(string-join (string-split version #\.) "_"))))
432 (mkdir-p doc)
433 (copy-recursively (string-append "build/dist/" project "/doc/")
434 doc)
435 (mkdir-p java)
436 (copy-file (string-append "build/dist/" project "/" project ".jar")
437 (string-append java "/" project ".jar")))
438 )))))
439 (home-page "https://github.com/aslom/xmlpull-api-v1")
440 (synopsis "XML pull parsing API")
441 (description "XmlPull v1 API is a simple to use XML pull parsing API. XML
442pull parsing allows incremental (sometimes called streaming) parsing of XML
443where application is in control - the parsing can be interrupted at any given
444moment and resumed when application is ready to consume more input.")
445 (license license:public-domain)))
446
447(define-public java-dom4j
448 (package
449 (name "java-dom4j")
450 (version "2.1.1")
451 (source (origin
452 (method git-fetch)
453 (uri (git-reference
454 (url "https://github.com/dom4j/dom4j")
455 (commit (string-append "version-" version))))
456 (file-name (git-file-name name version))
457 (sha256
458 (base32
459 "0q907srj9v4hwicpcrn4slyld5npf2jv7hzchsgrg29q2xmbwkdl"))
460 (modules '((guix build utils)))
461 (snippet
462 '(begin ;; Delete bundled jar archives.
463 (for-each delete-file (find-files "." ".*\\.jar"))
464 #t))))
465 (build-system ant-build-system)
466 (arguments
467 `(#:jar-name "dom4j.jar"
468 #:jdk ,icedtea-8
469 #:source-dir "src/main/java"
470 ;; FIXME: Requires xalan, but xalan depends on java-cup which has a
471 ;; dependency on itself through jflex.
472 #:tests? #f
473 #:phases
474 (modify-phases %standard-phases
475 (add-before 'build 'copy-jaxen-sources
476 ;; java-jaxen-bootstrap is not enough. These files have a circular
477 ;; dependency and there is no subset of dom4j that would allow
478 ;; breaking the circle.
479 (lambda* (#:key inputs #:allow-other-keys)
480 (mkdir-p "jaxen-sources")
481 (with-directory-excursion "jaxen-sources"
482 (system* "jar" "xf" (assoc-ref inputs "java-jaxen-sources")))
483 (mkdir-p "src/main/java/org/jaxen/dom4j")
484 (copy-file "jaxen-sources/org/jaxen/dom4j/DocumentNavigator.java"
485 "src/main/java/org/jaxen/dom4j/DocumentNavigator.java")
486 (copy-file "jaxen-sources/org/jaxen/dom4j/Dom4jXPath.java"
487 "src/main/java/org/jaxen/dom4j/Dom4jXPath.java")
488 #t))
489 (add-before 'build 'fix-old-xpp2
490 (lambda _
491 ;; This package normally depends on xpp2 2.0, but version 2.1.10
492 ;; is the only version whose source code is published.
493 (substitute* "src/main/java/org/dom4j/xpp/ProxyXmlStartTag.java"
494 (("public void resetStartTag")
495 "public boolean removeAttributeByRawName(String name) {\n
496 return false;\n
497}\n
498public boolean removeAttributeByName(String name, String name2) {\n
499 return false;\n
500}\n\npublic void resetStartTag")
501 (("Atttribute") "Attribute"))
502 #t)))))
503 (inputs
504 `(("java-jaxen-bootstrap" ,java-jaxen-bootstrap)
505 ("java-jaxen-sources" ,(package-source java-jaxen-bootstrap))
506 ("java-xmlpull2" ,java-xmlpull2)
507 ("java-xpp3" ,java-xpp3)
508 ("java-xsdlib" ,java-xsdlib)))
509 (native-inputs
510 (list java-testng java-xerces))
511 (home-page "https://dom4j.github.io/")
512 (synopsis "Flexible XML framework for Java")
513 (description "Dom4j is a flexible XML framework for Java. DOM4J works
514with DOM, SAX, XPath, and XSLT. It can parse large XML documents with very
515low memory footprint.")
516 ;; some BSD-like 5-clause license
517 (license (license:non-copyleft "file://LICENSE"))))
518
519(define-public java-kxml2
520 (package
521 (name "java-kxml2")
522 (version "2.4.2")
523 (source (origin
524 (method git-fetch)
525 (uri (git-reference
526 (url "https://github.com/stefanhaustein/kxml2")
527 (commit (string-append "v" version))))
528 (file-name (git-file-name name version))
529 (sha256
530 (base32
531 "0g6d8c9r9sh3x04sf4wdpgwvhkqvk11k3kq9skx91i60h4vn01hg"))))
532 (build-system ant-build-system)
533 (arguments
534 `(#:jar-name "kxml2.jar"
535 #:source-dir "src/main/java"
536 #:test-include (list "TestWb.java")
537 ;; Test failure: it was expected to get an XML entity but got the
538 ;; equivalent Unicode character instead.
539 #:tests? #f
540 #:phases
541 (modify-phases %standard-phases
542 (add-after 'unpack 'make-git-checkout-writable
543 (lambda _
544 (for-each make-file-writable (find-files "."))
545 #t))
546 (add-before 'build 'copy-resources
547 (lambda _
548 (copy-recursively "src/main/resources" "build/classes")
549 #t)))))
550 (inputs
551 (list java-xpp3))
552 (native-inputs
553 (list java-junit))
554 (home-page "http://kxml.org")
555 (synopsis "XML pull parser")
556 (description "kXML is a small XML pull parser, specially designed for
557constrained environments such as Applets, Personal Java or devices compliant
558with the Mobile Information Device Profile (MIDP).")
559 (license license:expat)))
560
561(define-public java-stax
562 (package
563 (name "java-stax")
564 (version "1.2.0")
565 (source (origin
566 (method url-fetch)
567 (uri (string-append "https://repo1.maven.org/maven2/stax/stax/"
568 version "/stax-" version "-sources.jar"))
569 (sha256
570 (base32
571 "04ba4qvbrps45j8bldbakxq31k7gjlsay9pppa9yn13fr00q586z"))))
572 (build-system ant-build-system)
573 (arguments
574 `(#:jar-name "stax.jar"
575 #:tests? #f; no tests
576 #:phases
577 (modify-phases %standard-phases
578 (add-before 'configure 'fix-utf8
579 (lambda _
580 ;; This file is ISO-8859-1 but java expects UTF-8.
581 ;; Remove special characters in comments.
582 (with-fluids ((%default-port-encoding "ISO-8859-1"))
583 (substitute* "src/com/wutka/dtd/Scanner.java"
584 (("//.*") "\n")))
585 #t)))))
586 (home-page "https://repo1.maven.org/maven2/stax/stax/")
587 (synopsis "Streaming API for XML")
588 (description "This package provides the reference implementation of the
589@dfn{Streaming API for XML} (StAX). It is used for streaming XML data to
590and from a Java application. It provides a standard pull parser interface.")
591 (license license:asl2.0)))
592
593(define-public java-jettison
594 (package
595 (name "java-jettison")
596 (version "1.3.7")
597 (source (origin
598 (method git-fetch)
599 (uri (git-reference
600 (url "https://github.com/codehaus/jettison")
601 (commit (string-append "jettison-" version))))
602 (file-name (git-file-name name version))
603 (sha256
604 (base32
605 "15sydmi5chdh4126qc7v8bsrp7fp4ldaya8a05iby4pq2324q0qw"))))
606 (build-system ant-build-system)
607 (arguments
608 `(#:jar-name "jettison.jar"
609 #:source-dir "src/main/java"
610 #:test-exclude (list "**/Abstract*.java"
611 ;; Abstract classes
612 "**/DOMTest.java"
613 "**/BadgerFishDOMTest.java"
614 "**/MappedDOMTest.java")))
615 (native-inputs
616 (list java-junit))
617 (home-page "https://github.com/codehaus/jettison")
618 (synopsis "StAX implementation for JSON")
619 (description "Jettison is a Java library for converting XML to JSON and
620vice-versa with the help of the @dfn{Streaming API for XML} (StAX). It
621implements @code{XMLStreamWriter} and @code{XMLStreamReader} and supports
622@code{Mapped} and @code{BadgerFish} conventions.")
623 (license license:asl2.0)))
624
625(define-public java-jdom2
626 (package
627 (name "java-jdom")
628 (version "2.0.6.1")
629 (source (origin
630 (method git-fetch)
631 (uri (git-reference
632 (url "https://github.com/hunterhacker/jdom")
633 (commit (string-append "JDOM-" version))))
634 (file-name (git-file-name name version))
635 (sha256
636 (base32
637 "1r4pwl0z7hm45v9l2wbq3fjmqi13zmwzbrggyqizrwv31kghhx56"))))
638 (build-system ant-build-system)
639 (arguments
640 `(#:build-target "package"
641 #:tests? #f ; tests are run as part of the build process
642 #:phases
643 (modify-phases %standard-phases
644 (replace 'install
645 (install-jars "build")))))
646 (home-page "http://jdom.org/")
647 (synopsis "Access, manipulate, and output XML data")
648 (description "Jdom is a Java-based solution for accessing, manipulating, and
649outputting XML data from Java code.")
650 (license license:bsd-4)))
651
652(define-public java-xstream
653 (package
654 (name "java-xstream")
655 (version "1.4.16")
656 (source
657 (origin
658 (method git-fetch)
659 (uri (git-reference
660 (url "https://github.com/x-stream/xstream")
661 (commit (string-append
662 "XSTREAM_"
663 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
664 version)))))
665 (file-name (git-file-name name version))
666 (sha256
667 (base32 "16k2mc63h2fw7lxv74qmhg4p8q9hfrw114daa6nxwnpv08cnq755"))))
668 (build-system ant-build-system)
669 (arguments
670 `(#:jar-name "xstream.jar"
671 ;; FIXME: Tests are not in a java subdirectory as assumed by ant-build-system.
672 #:tests? #f
673 #:jdk ,icedtea-8
674 #:source-dir "xstream/src/java"))
675 (inputs
676 `(("java-jdom" ,java-jdom)
677 ("java-jdom2" ,java-jdom2)
678 ("java-cglib" ,java-cglib)
679 ("java-joda-time" ,java-joda-time)
680 ("java-jettison" ,java-jettison)
681 ("java-xom" ,java-xom)
682 ("java-mxparser" ,java-mxparser)
683 ("java-xpp3" ,java-xpp3)
684 ("java-dom4j" ,java-dom4j)
685 ("java-stax2-api" ,java-stax2-api)
686 ("java-woodstox-core" ,java-woodstox-core)
687 ("java-kxml2" ,java-kxml2)
688 ("java-stax" ,java-stax)))
689 (home-page "https://x-stream.github.io")
690 (synopsis "XML serialization library")
691 (description "XStream is a simple library to serialize Java objects to XML
692and back again.")
693 (license license:bsd-3)))
694
695(define-public java-mxparser
696 (package
697 (name "java-mxparser")
698 (version "1.2.1")
699 (source
700 (origin
701 (method git-fetch)
702 (uri (git-reference
703 (url "https://github.com/x-stream/mxparser")
704 (commit (string-append "v-" version))))
705 (file-name (git-file-name name version))
706 (sha256
707 (base32 "0i3jrjbz4hgf62fm1ix7nlcmhi4kcv4flqsfvh7a3l2v7nsp5ryb"))))
708 (build-system ant-build-system)
709 (arguments
710 `(#:jar-name "mxparser.jar"
711 #:source-dir "src/main/java"
712 #:test-dir "src/test"
713 #:phases
714 (modify-phases %standard-phases
715 (add-before 'build 'copy-resources
716 (lambda _
717 (copy-recursively "src/main/resources" "build/classes")
718 #t)))))
719 (propagated-inputs
720 (list java-xmlpull-api-v1))
721 (native-inputs
722 (list java-junit))
723 (home-page "https://github.com/x-stream/mxparser")
724 (synopsis "Streaming pull XML parser forked from @code{java-xpp3}")
725 (description "Xml Pull Parser (in short XPP) is a streaming pull XML
726parser and should be used when there is a need to process quickly and
727efficiently all input elements (for example in SOAP processors). This
728package is a stable XmlPull parsing engine that is based on ideas from XPP
729and in particular XPP2 but completely revised and rewritten to take the best
730advantage of JIT JVMs.
731
732MXParser is a fork of xpp3_min 1.1.7 containing only the parser with merged
733changes of the Plexus fork. It is an implementation of the XMLPULL V1 API
734(parser only).")
735 (license (license:non-copyleft "file://LICENSE.txt"))))
736
737;;; ----- Apache Axiom ------
738
739(define %axiom-version "1.4.0")
740
741(define axiom-source
742 (let ((version %axiom-version))
743 (origin
744 (method url-fetch)
745 (uri (string-append "mirror://apache/ws/axiom/" version
746 "/axiom-" version "-src.zip"))
747 (sha256
748 (base32
749 "0wig9s1s089d0zq8kjny1f34za23vb47k515iab72bnkq62bbm8y")))))
750
751(define-public java-axiom-api
752 (package
753 (name "java-axiom-api")
754 (version %axiom-version)
755 (source axiom-source)
756 (build-system ant-build-system)
757 (arguments
758 `(#:source-dir "axiom-api/src/main"
759 #:test-dir "axiom-api/src/test"
760 #:tests? #f ;; tests requre too many yet unpackaged packages
761 #:jar-name "axiom-api.jar"))
762 (native-inputs
763 (list java-axiom-base64-utils
764 java-axiom-xml-utils
765 java-commons-logging-minimal
766 java-jakarta-activation-api
767 java-jaxen
768 java-mime4j-core
769 java-osgi-framework
770 java-osgi-util-tracker
771 java-stax2-api
772 unzip))
773 (home-page "https://ws.apache.org/axiom/")
774 (synopsis "API for Apache Axiom – StAX-based XML Infoset compliant object model")
775 (description "Apache Axiom provides an XML Infoset compliant object model
776implementation which supports on-demand building of the object tree. It
777supports a novel \"pull-through\" model which allows one to turn off the tree
778building and directly access the underlying pull event stream using the StAX
779API. It also has built in support for XML Optimized Packaging (XOP) and MTOM,
780the combination of which allows XML to carry binary data efficiently and in a
781transparent manner. The combination of these is an easy to use API with a very
782high performant architecture.
783
784This package provides the API for Apache Axiom.")
785 (license license:asl2.0)))
786
787(define-public java-axiom-base64-utils
788 (package
789 (name "java-axiom-base64-utils")
790 (version %axiom-version)
791 (source axiom-source)
792 (build-system ant-build-system)
793 (arguments
794 `(#:source-dir "components/base64-utils/src/main"
795 #:tests? #f ;; has no tests
796 #:jar-name "axiom-base64-utils.jar"))
797 (native-inputs
798 (list unzip))
799 (home-page "https://ws.apache.org/axiom/")
800 (synopsis "Apache Axiom base64 decoder and encoder")
801 (description "This package provides utility methods to work with base64
802encoded data.")
803 (license license:asl2.0)))
804
805(define-public java-axiom-core-mixins
806 (package
807 (name "java-axiom-core-mixins")
808 (version %axiom-version)
809 (source axiom-source)
810 (build-system ant-build-system)
811 (arguments
812 `(#:source-dir "mixins/core-mixins/src/main"
813 #:tests? #f ;; has no tests
814 #:jar-name "axiom-core-mixins.jar"))
815 (native-inputs
816 (list java-axiom-api
817 java-axiom-core-streams
818 java-axiom-xml-utils
819 java-axiom-weaver-annotations
820 unzip))
821 (home-page "https://ws.apache.org/axiom/")
822 (synopsis "Common classes for Apache Axiom core.")
823 (description "This package contains mixins and implementation classes used
824by core of Apache Axiom.")
825 (license license:asl2.0)))
826
827(define-public java-axiom-core-streams
828 (package
829 (name "java-axiom-core-streams")
830 (version %axiom-version)
831 (source axiom-source)
832 (build-system ant-build-system)
833 (arguments
834 `(#:source-dir "components/core-streams/src/main"
835 #:test-dir "components/core-streams/src/test"
836 #:tests? #f ;; require too many yet unpackaged packages
837 #:jar-name "axiom-core-streams.jar"))
838 (inputs
839 (list java-axiom-base64-utils
840 java-axiom-xml-utils
841 java-commons-logging-minimal
842 unzip))
843 (home-page "https://ws.apache.org/axiom/")
844 (synopsis "Stream classes used by Apache Axiom")
845 (description "This package provides stream classes used by the core or
846Apache Axiom.")
847 (license license:asl2.0)))
848
849(define-public java-axiom-dom-mixins
850 (package
851 (name "java-axiom-dom-mixins")
852 (version %axiom-version)
853 (source axiom-source)
854 (build-system ant-build-system)
855 (arguments
856 `(#:source-dir "mixins/dom-mixins/src/main"
857 #:test-dir "mixins/dom-mixins/src/test"
858 #:tests? #f ;; require too many yet unpackaged packages
859 #:jar-name "axiom-dom-mixins.jar"))
860 (native-inputs
861 (list java-axiom-api
862 java-axiom-core-mixins
863 java-axiom-om-mixins
864 java-axiom-xml-utils
865 java-axiom-weaver-annotations
866 unzip))
867 (home-page "https://ws.apache.org/axiom/")
868 (synopsis "Implementation of the Axiom API that also implements DOM")
869 (description "This package contains mixins and implementation classes for Apache Axiom that
870also implement DOM.")
871 (license license:asl2.0)))
872
873(define-public java-axiom-impl
874 (package
875 (name "java-axiom-impl")
876 (version %axiom-version)
877 (source axiom-source)
878 (build-system ant-build-system)
879 (arguments
880 `(#:source-dir "implementations/axiom-impl/src/main"
881 #:test-dir "implementations/axiom-impl/src/test"
882 #:tests? #f ;; tests require too many yet unpackaged packages
883 #:jar-name "axiom-impl.jar"))
884 (native-inputs
885 (list java-axiom-api
886 java-axiom-core-mixins
887 java-axiom-core-streams
888 java-axiom-om-mixins
889 java-axiom-weaver-annotations
890 java-commons-logging-minimal
891 java-woodstox-core
892 unzip))
893 (propagated-inputs
894 (list java-axiom-api))
895 (home-page "https://ws.apache.org/axiom/")
896 (synopsis "Default implementation of the Axiom API")
897 (description "Apache Axiom provides an XML Infoset compliant object model
898implementation which supports on-demand building of the object tree. It
899supports a novel \"pull-through\" model which allows one to turn off the tree
900building and directly access the underlying pull event stream using the StAX
901API. It also has built in support for XML Optimized Packaging (XOP) and MTOM,
902the combination of which allows XML to carry binary data efficiently and in a
903transparent manner. The combination of these is an easy to use API with a
904very high performant architecture.
905
906This package provides the API for Apache Axiom.")
907 (license license:asl2.0)))
908
909(define-public java-axiom-om-mixins
910 (package
911 (name "java-axiom-om-mixins")
912 (version %axiom-version)
913 (source axiom-source)
914 (build-system ant-build-system)
915 (arguments
916 `(#:source-dir "mixins/om-mixins/src/main"
917 #:test-dir "mixins/om-mixins/src/test"
918 #:tests? #f ;; tests requre too many yet unpackaged packages
919 #:jar-name "axiom-om-mixins.jar"))
920 (native-inputs
921 (list java-axiom-api
922 java-axiom-base64-utils
923 java-axiom-core-streams
924 java-axiom-core-mixins
925 java-axiom-xml-utils
926 java-axiom-weaver-annotations
927 java-commons-logging-minimal
928 unzip))
929 (home-page "https://ws.apache.org/axiom/")
930 (synopsis "Common classes for Apache Axiom LLOM and DOOM.")
931 (description "This package contains mixins and implementation classes
932shared by the object model implementations LLOM and DOOM.")
933 (license license:asl2.0)))
934
935(define-public java-axiom-weaver-annotations
936 (package
937 (name "java-axiom-weaver-annotations")
938 (version %axiom-version)
939 (source axiom-source)
940 (build-system ant-build-system)
941 (arguments
942 `(#:source-dir "axiom-weaver-annotations/src/main"
943 #:tests? #f ;; has no tests
944 #:jar-name "axiom-weaver-annotations.jar"))
945 (native-inputs
946 (list unzip))
947 (home-page "https://ws.apache.org/axiom/")
948 (synopsis "Annotation for Apache Axiom Weaver")
949 (description "This package provides annotation classes for Apache Axiom
950Weaver.")
951 (license license:asl2.0)))
952
953(define-public java-axiom-xml-utils
954 (package
955 (name "java-axiom-xml-utils")
956 (version %axiom-version)
957 (source axiom-source)
958 (build-system ant-build-system)
959 (arguments
960 `(#:source-dir "components/xml-utils/src/main"
961 #:test-dir "components/xml-utils/src/test"
962 #:tests? #f ;; require too many yet unpackaged packages
963 #:jar-name "axiom-xml-utils.jar"))
964 (native-inputs
965 (list unzip))
966 (home-page "https://ws.apache.org/axiom/")
967 (synopsis "XML utilities for Apache Axiom Weaver")
968 (description "This package provides XML utilities used by Apache Axiom
969Weaver, anyhow not depending on depending on the Axiom API.")
970 (license license:asl2.0)))
971
972;;; ----- Saxon HE ------
973
974(define-public java-saxon-he-10
975 ;; This is the last version not depending (indirectly via
976 ;; org.xmlresolver.xmlresolver and jing) on itself.
977 (package
978 (name "java-saxon-he")
979 (version "10.9")
980 ;; See <https://codeberg.org/guix/guix/pulls/5264#issuecomment-9492950> on
981 ;; why Maven Central is used in favor of
982 ;; <https://github.com/Saxonica/Saxon-HE> or
983 ;; <https://saxonica.plan.io/projects/saxonmirrorhe/repository>.
984 (source (origin
985 (method url-fetch)
986 (uri (string-append "https://repo1.maven.org/maven2/"
987 "net/sf/saxon/Saxon-HE/" version
988 "/Saxon-HE-" version "-sources.jar"))
989 (sha256
990 (base32
991 "17dx6w48ka3d1g20qisvafbc1rmnvfg0vnm8zfz4vkhqfjbkp6j8"))))
992 (build-system ant-build-system)
993 (arguments
994 `(#:tests? #f ;; tests are not included in release archives
995 #:jar-name "saxon-he.jar"))
996 (native-inputs (list unzip))
997 (inputs
998 (list java-axiom-impl
999 java-dom4j
1000 java-jdom2
1001 java-xom))
1002 (propagated-inputs ;; upstream delivers these in its distribution archive
1003 (list java-apache-xml-commons-resolver
1004 java-jline-2))
1005 (home-page "https://www.saxonica.com/")
1006 (synopsis "Saxon XSLT and XQuery Processor")
1007 (description "Saxon provides a XSLT 3.0, XQuery 3.1, and XPath 3.1
1008processor. This package provides the open source edition, called
1009\"Home Edition (HE)\" for Java. The Home Edition implements
1010aforementioned standards at the basic level of conformance defined by
1011W3C.")
1012 (license license:mpl2.0)))