gnu: ganv-devel: Declare a source file-name.
[jackhill/guix/guix.git] / gnu / packages / java.scm
CommitLineData
0760e3a1 1;;; GNU Guix --- Functional package management for GNU
799c3c86 2;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
559239af 3;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
ea9e58ef
CZ
4;;; Copyright © 2016, 2017 Roel Janssen <roel@gnu.org>
5;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
9f68e74a 6;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
88f256a1 7;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
1d47ea86 8;;; Copyright © 2016, 2017, 2018 Alex Vong <alexvong1995@gmail.com>
f4548394 9;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
d0e9ded7
GB
10;;; Copyright © 2018 Gábor Boskovits <boskovits@gmail.com>
11;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
0760e3a1
RW
12;;;
13;;; This file is part of GNU Guix.
14;;;
15;;; GNU Guix is free software; you can redistribute it and/or modify it
16;;; under the terms of the GNU General Public License as published by
17;;; the Free Software Foundation; either version 3 of the License, or (at
18;;; your option) any later version.
19;;;
20;;; GNU Guix is distributed in the hope that it will be useful, but
21;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23;;; GNU General Public License for more details.
24;;;
25;;; You should have received a copy of the GNU General Public License
26;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28(define-module (gnu packages java)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
62c9bfaa 32 #:use-module (guix hg-download)
72885a4c 33 #:use-module (guix git-download)
78745d33 34 #:use-module (guix svn-download)
f6789047 35 #:use-module (guix utils)
068e476f 36 #:use-module (guix build-system ant)
0760e3a1 37 #:use-module (guix build-system gnu)
6a5829d9 38 #:use-module (guix build-system trivial)
0760e3a1
RW
39 #:use-module (gnu packages)
40 #:use-module (gnu packages attr)
41 #:use-module (gnu packages autotools)
42 #:use-module (gnu packages base)
43 #:use-module (gnu packages bash)
f21403e2 44 #:use-module (gnu packages certs)
0760e3a1
RW
45 #:use-module (gnu packages cpio)
46 #:use-module (gnu packages cups)
47 #:use-module (gnu packages compression)
48 #:use-module (gnu packages fontutils)
49 #:use-module (gnu packages gawk)
72885a4c 50 #:use-module (gnu packages gettext)
0760e3a1 51 #:use-module (gnu packages gcc)
8581c813 52 #:use-module (gnu packages gl)
0760e3a1
RW
53 #:use-module (gnu packages gnuzilla) ;nss
54 #:use-module (gnu packages ghostscript) ;lcms
55 #:use-module (gnu packages gnome)
56 #:use-module (gnu packages gtk)
6a5829d9 57 #:use-module (gnu packages guile)
afb5858d 58 #:use-module (gnu packages icu4c)
0760e3a1 59 #:use-module (gnu packages image)
c4fd86f9 60 #:use-module (gnu packages libffi)
0760e3a1 61 #:use-module (gnu packages linux) ;alsa
2f0d0418 62 #:use-module (gnu packages maths)
5766984b 63 #:use-module (gnu packages web)
0760e3a1 64 #:use-module (gnu packages wget)
0760e3a1
RW
65 #:use-module (gnu packages pkg-config)
66 #:use-module (gnu packages perl)
c4fd86f9 67 #:use-module (gnu packages popt)
89e34644 68 #:use-module (gnu packages kerberos)
0760e3a1
RW
69 #:use-module (gnu packages xml)
70 #:use-module (gnu packages xorg)
f6789047 71 #:use-module (gnu packages texinfo)
2d15f601
RW
72 #:use-module ((srfi srfi-1) #:select (fold alist-delete))
73 #:use-module (srfi srfi-11)
74 #:use-module (ice-9 match))
0760e3a1 75
e1ae3587
RW
76\f
77;;;
78;;; Java bootstrap toolchain.
79;;;
80
81;; The Java bootstrap begins with Jikes, a Java compiler written in C++. We
82;; use it to build the SableVM standard library and virtual machine, which are
83;; written in a simpler dialect of Java and C, respectively. This is
84;; sufficient to build an older version of Ant, which is needed to build an
85;; older version of ECJ, an incremental Java compiler, both of which are
86;; written in Java.
87;;
88;; ECJ is needed to build the latest release of GNU Classpath (0.99).
89;; Classpath (> 0.98) is a requirement for JamVM, a more modern implementation
90;; of the Java virtual machine.
91;;
92;; With JamVM we can build the latest development version of GNU Classpath,
93;; which has much more support for Java 1.6 than the latest release. Since
94;; the previous build of JamVM is limited by the use of GNU Classpath 0.99 we
95;; rebuild it with the latest development version of GNU Classpath.
96;;
97;; Finally, we use the bootstrap toolchain to build the OpenJDK with the
98;; Icedtea 1.x build framework. We then build the more recent JDKs Icedtea
99;; 2.x and Icedtea 3.x.
100
101(define jikes
102 (package
103 (name "jikes")
104 (version "1.22")
105 (source (origin
106 (method url-fetch)
107 (uri (string-append "mirror://sourceforge/jikes/Jikes/"
108 version "/jikes-" version ".tar.bz2"))
109 (sha256
110 (base32
111 "1qqldrp74pzpy5ly421srqn30qppmm9cvjiqdngk8hf47dv2rc0c"))))
112 (build-system gnu-build-system)
113 (home-page "http://jikes.sourceforge.net/")
114 (synopsis "Compiler for the Java language")
115 (description "Jikes is a compiler that translates Java source files as
116defined in The Java Language Specification into the bytecoded instruction set
117and binary format defined in The Java Virtual Machine Specification.")
118 (license license:ibmpl1.0)))
119
2551fee8
RW
120(define sablevm-classpath
121 (package
122 (name "sablevm-classpath")
123 (version "1.13")
124 (source (origin
125 (method url-fetch)
126 (uri (string-append "mirror://sourceforge/sablevm/sablevm/"
127 version "/sablevm-classpath-" version ".tar.gz"))
128 (sha256
129 (base32
130 "1qyhyfz8idghxdam16hdgpa24r2x4xbg9z8c8asa3chnd79h3zw2"))))
131 (build-system gnu-build-system)
132 (arguments
133 `(#:configure-flags
134 (list "--with-jikes"
135 "--disable-Werror"
136 "--disable-gmp"
137 "--disable-gtk-peer"
138 "--disable-plugin"
139 "--disable-dssi"
140 "--disable-alsa"
141 "--disable-gjdoc")))
142 (inputs
143 `(("gconf" ,gconf)
144 ("gtk+" ,gtk+-2)))
145 (native-inputs
146 `(("jikes" ,jikes)
147 ("fastjar" ,fastjar)
148 ("pkg-config" ,pkg-config)))
149 (home-page "http://sablevm.org/")
150 (synopsis "Java Virtual Machine")
151 (description "SableVM is a clean-room, highly portable and efficient Java
152virtual machine. Its goals are to be reasonably small, fast, and compliant
153with the various specifications (JVM specification, JNI, invocation interface,
154etc.). SableVM is no longer maintained.
155
156This package provides the classpath library.")
157 (license license:lgpl2.1+)))
57f6c50d
RW
158
159(define sablevm
160 (package
161 (name "sablevm")
162 (version "1.13")
163 (source (origin
164 (method url-fetch)
165 (uri (string-append "mirror://sourceforge/sablevm/sablevm/"
166 version "/sablevm-" version ".tar.gz"))
167 (sha256
168 (base32
169 "1jyg4bsym6igz94wps5443c7wiwlzinqzkchcw972nz4kf1cql6g"))))
170 (build-system gnu-build-system)
171 (arguments
c4fd86f9 172 `(#:configure-flags
799c3c86
RW
173 (list "--with-threading=switch" ; slower but prevents segfault
174 "--with-internal-libffi=no"
c4fd86f9
RW
175 "--with-internal-libpopt=no")
176 #:phases
57f6c50d 177 (modify-phases %standard-phases
ec7e9eea
RW
178 (add-after 'unpack 'remove-timestamp-for-reproducibility
179 (lambda _
180 (substitute* "src/sablevm/Makefile.in"
181 (("\\$\\(SVMCOMPILETIME\\)") "(unknown)"))
182 #t))
c4fd86f9
RW
183 (add-after 'unpack 'link-with-popt
184 (lambda _
185 (substitute* "src/sablevm/Makefile.in"
186 (("\\$\\(SVMADD\\)" match)
187 (string-append match " -lpopt")))
188 #t))
57f6c50d
RW
189 (add-after 'unpack 'patch-path-to-classpath
190 (lambda* (#:key inputs #:allow-other-keys)
191 (substitute* "Makefile.in"
192 (("@datadir@/sablevm-classpath")
193 (string-append (assoc-ref inputs "classpath")
194 "/share/sablevm-classpath")))
195 (substitute* "src/libsablevm/Makefile.in"
196 (("\\$\\(libdir\\)/sablevm-classpath")
197 (string-append (assoc-ref inputs "classpath")
198 "/lib/sablevm-classpath"))
199 (("\\$\\(datadir\\)/sablevm-classpath")
200 (string-append (assoc-ref inputs "classpath")
201 "/share/sablevm-classpath")))
202 #t)))))
203 (inputs
204 `(("classpath" ,sablevm-classpath)
205 ("jikes" ,jikes)
c4fd86f9
RW
206 ("zlib" ,zlib)
207 ("popt" ,popt)
208 ("libffi" ,libffi)))
57f6c50d
RW
209 (native-inputs
210 `(("libltdl" ,libltdl)))
211 (home-page "http://sablevm.org/")
212 (synopsis "Java Virtual Machine")
213 (description "SableVM is a clean-room, highly portable and efficient Java
214virtual machine. Its goals are to be reasonably small, fast, and compliant
215with the various specifications (JVM specification, JNI, invocation interface,
216etc.). SableVM is no longer maintained.
217
218This package provides the virtual machine.")
219 (license license:lgpl2.1+)))
2551fee8 220
5783bd77
RW
221(define ant-bootstrap
222 (package
223 (name "ant-bootstrap")
224 ;; The 1.10.x series requires Java 8. 1.9.0 and later use generics, which
225 ;; are not supported. The 1.8.x series is the last to use only features
226 ;; supported by Jikes, but it cannot seem to be built with sablevm.
227 (version "1.7.1")
228 (source (origin
229 (method url-fetch)
230 (uri (string-append "http://archive.apache.org/dist/"
231 "ant/source/apache-ant-"
232 version "-src.tar.bz2"))
233 (sha256
234 (base32
235 "19pvqvgkxgpgsqm4lvbki5sm0z84kxmykdqicvfad47gc1r9mi2d"))))
236 (build-system gnu-build-system)
237 (arguments
238 `(#:tests? #f ; no "check" target
239 #:phases
240 (modify-phases %standard-phases
241 (delete 'configure)
242 (replace 'build
243 (lambda* (#:key inputs #:allow-other-keys)
244 (setenv "JAVA_HOME"
245 (string-append (assoc-ref inputs "sablevm")
246 "/lib/sablevm"))
247 (setenv "JAVACMD"
248 (string-append (assoc-ref inputs "sablevm")
249 "/bin/java-sablevm"))
250 (setenv "JAVAC"
251 (string-append (assoc-ref inputs "sablevm")
252 "/bin/javac-sablevm"))
253
254 ;; Use jikes instead of javac for <javac ...> tags in build.xml
255 (setenv "ANT_OPTS" "-Dbuild.compiler=jikes")
256
257 ;; jikes produces lots of warnings, but they are not very
258 ;; interesting, so we silence them.
259 (setenv "$BOOTJAVAC_OPTS" "-nowarn")
260
261 ;; Disable tests because we are bootstrapping and thus don't have
262 ;; any of the dependencies required to build and run the tests.
263 (substitute* "build.xml"
264 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
265 (zero? (system* "bash" "bootstrap.sh"
266 (string-append "-Ddist.dir="
267 (assoc-ref %outputs "out"))))))
268 (delete 'install))))
269 (native-inputs
270 `(("jikes" ,jikes)
271 ("sablevm" ,sablevm)))
272 (home-page "http://ant.apache.org")
273 (synopsis "Build tool for Java")
274 (description
275 "Ant is a platform-independent build tool for Java. It is similar to
276make but is implemented using the Java language, requires the Java platform,
277and is best suited to building Java projects. Ant uses XML to describe the
278build process and its dependencies, whereas Make uses Makefile format.")
279 (license license:asl2.0)))
280
5461721f
RW
281;; Version 3.2.2 is the last version without a dependency on a full-fledged
282;; compiler for Java 1.5.
283(define ecj-bootstrap
284 (package
285 (name "ecj-bootstrap")
286 (version "3.2.2")
287 (source (origin
288 (method url-fetch)
289 (uri (string-append "http://archive.eclipse.org/eclipse/"
290 "downloads/drops/R-" version
291 "-200702121330/ecjsrc.zip"))
292 (sha256
293 (base32
294 "05hj82kxd23qaglsjkaqcj944riisjha7acf7h3ljhrjyljx8307"))))
295 ;; It would be so much easier if we could use the ant-build-system, but we
296 ;; cannot as we don't have ant at this point. We use ecj for
297 ;; bootstrapping the JDK.
298 (build-system gnu-build-system)
299 (arguments
300 `(#:modules ((guix build gnu-build-system)
301 (guix build utils)
302 (srfi srfi-1))
303 #:tests? #f ; there are no tests
304 #:phases
305 (modify-phases %standard-phases
306 (replace 'configure
307 (lambda* (#:key inputs #:allow-other-keys)
308 (setenv "CLASSPATH"
309 (string-join
310 (find-files (string-append (assoc-ref inputs "ant-bootstrap")
311 "/lib")
312 "\\.jar$")
313 ":"))
314 #t))
315 (replace 'build
316 (lambda* (#:key inputs #:allow-other-keys)
317 ;; The unpack phase enters the "org" directory by mistake.
318 (chdir "..")
319
320 ;; Create a simple manifest to make ecj executable.
321 (with-output-to-file "manifest"
322 (lambda _
323 (display "Manifest-Version: 1.0
324Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n")))
325
326 ;; Compile it all!
327 (and (zero? (apply system* "javac-sablevm"
328 (find-files "." "\\.java$")))
329 (zero? (system* "fastjar" "cvfm"
330 "ecj-bootstrap.jar" "manifest" ".")))))
331 (replace 'install
332 (lambda* (#:key outputs #:allow-other-keys)
333 (let ((share (string-append (assoc-ref outputs "out")
334 "/share/java/")))
335 (mkdir-p share)
336 (install-file "ecj-bootstrap.jar" share)
337 #t))))))
338 (native-inputs
339 `(("ant-bootstrap" ,ant-bootstrap)
340 ("unzip" ,unzip)
341 ("sablevm" ,sablevm)
342 ("fastjar" ,fastjar)))
343 (home-page "https://eclipse.org")
344 (synopsis "Eclipse Java development tools core batch compiler")
345 (description "This package provides the Eclipse Java core batch compiler
346for bootstrapping purposes. The @dfn{Eclipse compiler for Java} (ecj) is a
347requirement for all GNU Classpath releases after version 0.93.")
348 (license license:epl1.0)))
349
6a5829d9
RW
350(define ecj-javac-wrapper
351 (package (inherit ecj-bootstrap)
352 (name "ecj-javac-wrapper")
353 (source #f)
354 (build-system trivial-build-system)
355 (arguments
356 `(#:modules ((guix build utils))
357 #:builder
358 (let ((backend 'sablevm))
359 (use-modules (guix build utils))
360 (let* ((bin (string-append (assoc-ref %outputs "out") "/bin"))
361 (target (string-append bin "/javac"))
362 (guile (string-append (assoc-ref %build-inputs "guile")
363 "/bin/guile"))
364 (ecj (string-append (assoc-ref %build-inputs "ecj-bootstrap")
365 "/share/java/ecj-bootstrap.jar"))
366 (java (case backend
367 ((sablevm)
368 (string-append (assoc-ref %build-inputs "sablevm")
369 "/lib/sablevm/bin/java"))
370 ((jamvm)
371 (string-append (assoc-ref %build-inputs "jamvm")
372 "/bin/jamvm"))))
373 (bootcp (case backend
374 ((sablevm)
375 (let ((jvmlib (string-append
376 (assoc-ref %build-inputs "sablevm-classpath")
377 "/lib/sablevm")))
378 (string-append jvmlib "/jre/lib/rt.jar")))
379 ((jamvm)
380 (let ((jvmlib (string-append (assoc-ref %build-inputs "classpath")
381 "/share/classpath")))
382 (string-append jvmlib "/lib/glibj.zip:"
383 jvmlib "/lib/tools.zip"))))))
384 (mkdir-p bin)
385 (with-output-to-file target
386 (lambda _
387 (format #t "#!~a --no-auto-compile\n!#\n" guile)
388 (write
389 `(begin (use-modules (ice-9 match)
390 (ice-9 receive)
391 (ice-9 hash-table)
392 (srfi srfi-1)
393 (srfi srfi-26))
394 (define defaults
395 '(("-bootclasspath" ,bootcp)
396 ("-source" "1.5")
397 ("-target" "1.5")
398 ("-cp" ".")))
399 (define (main args)
400 (let ((classpath (getenv "CLASSPATH")))
401 (setenv "CLASSPATH"
402 (string-append ,ecj
403 (if classpath
404 (string-append ":" classpath)
405 ""))))
406 (receive (vm-args other-args)
407 ;; Separate VM arguments from arguments to ECJ.
408 (partition (cut string-prefix? "-J" <>)
409 (fold (lambda (default acc)
410 (if (member (first default) acc)
411 acc (append default acc)))
412 args defaults))
413 (apply system* ,java
414 (append
415 ;; Remove "-J" prefix
416 (map (cut string-drop <> 2) vm-args)
417 '("org.eclipse.jdt.internal.compiler.batch.Main")
418 (cons "-nowarn" other-args)))))
419 ;; Entry point
420 (let ((args (cdr (command-line))))
421 (if (null? args)
422 (format (current-error-port) "javac: no arguments given!\n")
423 (main args)))))))
424 (chmod target #o755)
425 #t))))
426 (native-inputs
427 `(("guile" ,guile-2.2)
428 ("ecj-bootstrap" ,ecj-bootstrap)
429 ("sablevm" ,sablevm)
430 ("sablevm-classpath" ,sablevm-classpath)))
431 (description "This package provides a wrapper around the @dfn{Eclipse
432compiler for Java} (ecj) with a command line interface that is compatible with
433the standard javac executable.")))
434
d3551e86
RW
435;; Note: All the tool wrappers (e.g. for javah, javac, etc) fail with
436;; java.lang.UnsupportedClassVersionError. They simply won't run on the old
437;; sablevm. We use Classpath 0.99 to build JamVM, on which the Classpath
438;; tools do run. Using these Classpath tools on JamVM we can then build the
439;; development version of GNU Classpath.
440(define classpath-on-sablevm
441 (package
442 (name "classpath")
443 (version "0.99")
444 (source (origin
445 (method url-fetch)
446 (uri (string-append "mirror://gnu/classpath/classpath-"
447 version ".tar.gz"))
448 (sha256
449 (base32
450 "1j7cby4k66f1nvckm48xcmh352b1d1b33qk7l6hi7dp9i9zjjagr"))))
451 (build-system gnu-build-system)
452 (arguments
453 `(#:configure-flags
454 (list (string-append "--with-ecj-jar="
455 (assoc-ref %build-inputs "ecj-bootstrap")
456 "/share/java/ecj-bootstrap.jar")
457 (string-append "JAVAC="
458 (assoc-ref %build-inputs "ecj-javac-wrapper")
459 "/bin/javac")
460 (string-append "JAVA="
461 (assoc-ref %build-inputs "sablevm")
462 "/bin/java-sablevm")
463 "GCJ_JAVAC_TRUE=no"
464 "ac_cv_prog_java_works=yes" ; trust me
465 "--disable-Werror"
466 "--disable-gmp"
467 "--disable-gtk-peer"
468 "--disable-gconf-peer"
469 "--disable-plugin"
470 "--disable-dssi"
471 "--disable-alsa"
472 "--disable-gjdoc")
473 #:phases
474 (modify-phases %standard-phases
475 (add-after 'install 'install-data
476 (lambda _ (zero? (system* "make" "install-data")))))))
477 (native-inputs
478 `(("ecj-bootstrap" ,ecj-bootstrap)
479 ("ecj-javac-wrapper" ,ecj-javac-wrapper)
480 ("fastjar" ,fastjar)
481 ("sablevm" ,sablevm)
482 ("sablevm-classpath" ,sablevm-classpath)
483 ("libltdl" ,libltdl)
484 ("pkg-config" ,pkg-config)))
485 (home-page "https://www.gnu.org/software/classpath/")
486 (synopsis "Essential libraries for Java")
487 (description "GNU Classpath is a project to create core class libraries
488for use with runtimes, compilers and tools for the Java programming
489language.")
490 ;; GPLv2 or later, with special linking exception.
491 (license license:gpl2+)))
5f4402c7
RW
492
493(define jamvm-bootstrap
494 (package
495 (name "jamvm")
496 (version "2.0.0")
497 (source (origin
498 (method url-fetch)
499 (uri (string-append "mirror://sourceforge/jamvm/jamvm/"
500 "JamVM%20" version "/jamvm-"
501 version ".tar.gz"))
502 (sha256
503 (base32
504 "1nl0zxz8y5x8gwsrm7n32bry4dx8x70p8z3s9jbdvs8avyb8whkn"))))
505 (build-system gnu-build-system)
506 (arguments
507 `(#:configure-flags
508 (list (string-append "--with-classpath-install-dir="
509 (assoc-ref %build-inputs "classpath")))))
510 (inputs
511 `(("classpath" ,classpath-on-sablevm)
512 ("ecj-javac-wrapper" ,ecj-javac-wrapper)
513 ("zlib" ,zlib)))
514 (home-page "http://jamvm.sourceforge.net/")
515 (synopsis "Small Java Virtual Machine")
516 (description "JamVM is a Java Virtual Machine conforming to the JVM
517specification edition 2 (blue book). It is extremely small. However, unlike
518other small VMs it supports the full spec, including object finalisation and
519JNI.")
520 (license license:gpl2+)))
d3551e86 521
04d7cae2
RW
522;; We need this because the tools provided by the latest release of GNU
523;; Classpath don't actually work with sablevm.
524(define classpath-jamvm-wrappers
525 (package (inherit classpath-on-sablevm)
526 (name "classpath-jamvm-wrappers")
527 (source #f)
528 (build-system trivial-build-system)
529 (arguments
530 `(#:modules ((guix build utils))
531 #:builder
532 (begin
533 (use-modules (guix build utils))
534 (let* ((bash (assoc-ref %build-inputs "bash"))
535 (jamvm (assoc-ref %build-inputs "jamvm"))
536 (classpath (assoc-ref %build-inputs "classpath"))
537 (bin (string-append (assoc-ref %outputs "out")
538 "/bin/")))
539 (mkdir-p bin)
540 (for-each (lambda (tool)
541 (with-output-to-file (string-append bin tool)
542 (lambda _
543 (format #t "#!~a/bin/sh
544~a/bin/jamvm -classpath ~a/share/classpath/tools.zip \
545gnu.classpath.tools.~a.~a $@"
546 bash jamvm classpath tool
547 (if (string=? "native2ascii" tool)
548 "Native2ASCII" "Main"))))
549 (chmod (string-append bin tool) #o755))
550 (list "javah"
551 "rmic"
552 "rmid"
553 "orbd"
554 "rmiregistry"
555 "native2ascii"))
556 #t))))
557 (native-inputs
558 `(("bash" ,bash)
559 ("jamvm" ,jamvm-bootstrap)
560 ("classpath" ,classpath-on-sablevm)))
561 (inputs '())
562 (synopsis "Executables from GNU Classpath")
563 (description "This package provides wrappers around the tools provided by
564the GNU Classpath library. They are executed by the JamVM virtual
565machine.")))
566
7292d694
RW
567(define ecj-javac-on-jamvm-wrapper
568 (package (inherit ecj-javac-wrapper)
569 (name "ecj-javac-on-jamvm-wrapper")
570 (arguments
571 `(#:modules ((guix build utils))
572 #:builder
573 ;; TODO: This builder is exactly the same as in ecj-javac-wrapper,
574 ;; except that the backend is 'jamvm here. Can we reuse the same
575 ;; builder somehow?
576 (let ((backend 'jamvm))
577 (use-modules (guix build utils))
578 (let* ((bin (string-append (assoc-ref %outputs "out") "/bin"))
579 (target (string-append bin "/javac"))
580 (guile (string-append (assoc-ref %build-inputs "guile")
581 "/bin/guile"))
582 (ecj (string-append (assoc-ref %build-inputs "ecj-bootstrap")
583 "/share/java/ecj-bootstrap.jar"))
584 (java (case backend
585 ((sablevm)
586 (string-append (assoc-ref %build-inputs "sablevm")
587 "/lib/sablevm/bin/java"))
588 ((jamvm)
589 (string-append (assoc-ref %build-inputs "jamvm")
590 "/bin/jamvm"))))
591 (bootcp (case backend
592 ((sablevm)
593 (let ((jvmlib (string-append
594 (assoc-ref %build-inputs "sablevm-classpath")
595 "/lib/sablevm")))
596 (string-append jvmlib "/jre/lib/rt.jar")))
597 ((jamvm)
598 (let ((jvmlib (string-append (assoc-ref %build-inputs "classpath")
599 "/share/classpath")))
600 (string-append jvmlib "/lib/glibj.zip:"
601 jvmlib "/lib/tools.zip"))))))
602 (mkdir-p bin)
603 (with-output-to-file target
604 (lambda _
605 (format #t "#!~a --no-auto-compile\n!#\n" guile)
606 (write
607 `(begin (use-modules (ice-9 match)
608 (ice-9 receive)
609 (ice-9 hash-table)
610 (srfi srfi-1)
611 (srfi srfi-26))
612 (define defaults
613 '(("-bootclasspath" ,bootcp)
614 ("-source" "1.5")
615 ("-target" "1.5")
616 ("-cp" ".")))
617 (define (main args)
618 (let ((classpath (getenv "CLASSPATH")))
619 (setenv "CLASSPATH"
620 (string-append ,ecj
621 (if classpath
622 (string-append ":" classpath)
623 ""))))
624 (receive (vm-args other-args)
625 ;; Separate VM arguments from arguments to ECJ.
626 (partition (cut string-prefix? "-J" <>)
627 (fold (lambda (default acc)
628 (if (member (first default) acc)
629 acc (append default acc)))
630 args defaults))
631 (apply system* ,java
632 (append
633 ;; Remove "-J" prefix
634 (map (cut string-drop <> 2) vm-args)
635 '("org.eclipse.jdt.internal.compiler.batch.Main")
636 (cons "-nowarn" other-args)))))
637 ;; Entry point
638 (let ((args (cdr (command-line))))
639 (if (null? args)
640 (format (current-error-port) "javac: no arguments given!\n")
641 (main args)))))))
642 (chmod target #o755)
643 #t))))
644 (native-inputs
645 `(("guile" ,guile-2.2)
646 ("ecj-bootstrap" ,ecj-bootstrap)
647 ("jamvm" ,jamvm-bootstrap)
648 ("classpath" ,classpath-on-sablevm)))
649 (description "This package provides a wrapper around the @dfn{Eclipse
650compiler for Java} (ecj) with a command line interface that is compatible with
651the standard javac executable. The tool runs on JamVM instead of SableVM.")))
652
72885a4c
RW
653;; The last release of GNU Classpath is 0.99 and it happened in 2012. Since
654;; then Classpath has gained much more support for Java 1.6.
655(define-public classpath-devel
656 (let ((commit "e7c13ee0cf2005206fbec0eca677f8cf66d5a103")
657 (revision "1"))
658 (package (inherit classpath-on-sablevm)
659 (version (string-append "0.99-" revision "." (string-take commit 9)))
660 (source (origin
661 (method git-fetch)
662 (uri (git-reference
5f13bf09 663 (url "https://git.savannah.gnu.org/git/classpath.git")
72885a4c 664 (commit commit)))
51988e3a 665 (file-name (string-append "classpath-" version "-checkout"))
72885a4c
RW
666 (sha256
667 (base32
668 "1v2rww76ww322mpg3s12a1kkc6gkp31bm9gcxs532h0wq285fiw4"))))
669 (arguments
93c103ab
RW
670 `(#:make-flags
671 ;; Ensure that the initial heap size is smaller than the maximum
672 ;; size. By default only Xmx is set, which can lead to invalid
673 ;; memory settings on some machines with a lot of memory.
674 '("JAVAC_MEM_OPT=-J-Xms512M -J-Xmx768M")
675 #:configure-flags
72885a4c
RW
676 (list (string-append "--with-ecj-jar="
677 (assoc-ref %build-inputs "ecj-bootstrap")
678 "/share/java/ecj-bootstrap.jar")
93c103ab 679 (string-append "--with-javac="
72885a4c
RW
680 (assoc-ref %build-inputs "ecj-javac-wrapper")
681 "/bin/javac")
682 (string-append "JAVA="
683 (assoc-ref %build-inputs "jamvm")
684 "/bin/jamvm")
685 "GCJ_JAVAC_TRUE=no"
686 "ac_cv_prog_java_works=yes" ; trust me
687 "--disable-Werror"
688 "--disable-gmp"
689 "--disable-gtk-peer"
690 "--disable-gconf-peer"
691 "--disable-plugin"
692 "--disable-dssi"
693 "--disable-alsa"
694 "--disable-gjdoc")
695 #:phases
696 (modify-phases %standard-phases
c427fda2 697 (add-after 'unpack 'bootstrap
72885a4c
RW
698 (lambda _
699 (zero? (system* "autoreconf" "-vif"))))
700 (add-after 'unpack 'remove-unsupported-annotations
701 (lambda _
702 (substitute* (find-files "java" "\\.java$")
703 (("@Override") ""))
704 #t))
705 (add-after 'install 'install-data
706 (lambda _ (zero? (system* "make" "install-data")))))))
707 (native-inputs
708 `(("autoconf" ,autoconf)
709 ("automake" ,automake)
710 ("libtool" ,libtool)
711 ("gettext" ,gettext-minimal)
712 ("texinfo" ,texinfo)
713 ("classpath-jamvm-wrappers" ,classpath-jamvm-wrappers) ; for javah
714 ("ecj-bootstrap" ,ecj-bootstrap)
715 ("ecj-javac-wrapper" ,ecj-javac-on-jamvm-wrapper)
716 ("fastjar" ,fastjar)
717 ("jamvm" ,jamvm-bootstrap)
718 ("libltdl" ,libltdl)
719 ("pkg-config" ,pkg-config))))))
720
8c6091e3
RW
721(define-public jamvm
722 (package (inherit jamvm-bootstrap)
723 (inputs
724 `(("classpath" ,classpath-devel)
725 ("ecj-javac-wrapper" ,ecj-javac-on-jamvm-wrapper)
726 ("zlib" ,zlib)))))
727
1bf56c72
RW
728(define ecj-javac-on-jamvm-wrapper-final
729 (package (inherit ecj-javac-on-jamvm-wrapper)
730 (native-inputs
731 `(("guile" ,guile-2.2)
732 ("ecj-bootstrap" ,ecj-bootstrap)
733 ("jamvm" ,jamvm)
734 ("classpath" ,classpath-devel)))))
735
98419316
RW
736;; The bootstrap JDK consisting of jamvm, classpath-devel,
737;; ecj-javac-on-jamvm-wrapper-final cannot build Icedtea 2.x directly, because
738;; it's written in Java 7. It can, however, build the unmaintained Icedtea
739;; 1.x, which uses Java 6 only.
740(define-public icedtea-6
741 (package
742 (name "icedtea")
743 (version "1.13.13")
744 (source (origin
745 (method url-fetch)
746 (uri (string-append
747 "http://icedtea.wildebeest.org/download/source/icedtea6-"
748 version ".tar.xz"))
749 (sha256
750 (base32
751 "0bg9sb4f7qbq77c0zf9m17p47ga0kf0r9622g9p12ysg26jd1ksg"))
752 (modules '((guix build utils)))
753 (snippet
754 '(substitute* "Makefile.in"
755 ;; do not leak information about the build host
756 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
757 "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
758 (build-system gnu-build-system)
759 (outputs '("out" ; Java Runtime Environment
760 "jdk" ; Java Development Kit
761 "doc")) ; all documentation
762 (arguments
763 `(;; There are many failing tests and many are known to fail upstream.
764 #:tests? #f
765
766 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
767 ;; gremlin) doesn't support it yet, so skip this phase.
768 #:validate-runpath? #f
769
770 #:modules ((guix build utils)
771 (guix build gnu-build-system)
772 (srfi srfi-19))
773
774 #:configure-flags
775 `("--enable-bootstrap"
776 "--enable-nss"
777 "--without-rhino"
778 "--with-parallel-jobs"
779 "--disable-downloading"
780 "--disable-tests"
781 ,(string-append "--with-ecj="
782 (assoc-ref %build-inputs "ecj")
783 "/share/java/ecj-bootstrap.jar")
784 ,(string-append "--with-jar="
785 (assoc-ref %build-inputs "fastjar")
786 "/bin/fastjar")
787 ,(string-append "--with-jdk-home="
788 (assoc-ref %build-inputs "classpath"))
789 ,(string-append "--with-java="
790 (assoc-ref %build-inputs "jamvm")
791 "/bin/jamvm"))
792 #:phases
793 (modify-phases %standard-phases
794 (replace 'unpack
795 (lambda* (#:key source inputs #:allow-other-keys)
796 (and (zero? (system* "tar" "xvf" source))
797 (begin
798 (chdir (string-append "icedtea6-" ,version))
799 (mkdir "openjdk")
800 (copy-recursively (assoc-ref inputs "openjdk-src") "openjdk")
801 ;; The convenient OpenJDK source bundle is no longer
802 ;; available for download, so we have to take the sources
803 ;; from the Mercurial repositories and change the Makefile
804 ;; to avoid tests for the OpenJDK zip archive.
805 (with-directory-excursion "openjdk"
806 (for-each (lambda (part)
807 (mkdir part)
808 (copy-recursively
809 (assoc-ref inputs
810 (string-append part "-src"))
811 part))
812 '("jdk" "hotspot" "corba"
813 "langtools" "jaxp" "jaxws")))
814 (substitute* "Makefile.in"
815 (("echo \"ERROR: No up-to-date OpenJDK zip available\"; exit -1;")
816 "echo \"trust me\";")
817 ;; The contents of the bootstrap directory must be
818 ;; writeable but when copying from the store they are
819 ;; not.
820 (("mkdir -p lib/rt" line)
821 (string-append line "; chmod -R u+w $(BOOT_DIR)")))
822 (zero? (system* "chmod" "-R" "u+w" "openjdk"))
823 #t))))
824 (add-after 'unpack 'use-classpath
825 (lambda* (#:key inputs #:allow-other-keys)
826 (let ((jvmlib (assoc-ref inputs "classpath")))
827 ;; Classpath does not provide rt.jar.
828 (substitute* "Makefile.in"
829 (("\\$\\(SYSTEM_JDK_DIR\\)/jre/lib/rt.jar")
830 (string-append jvmlib "/share/classpath/glibj.zip")))
831 ;; Make sure we can find all classes.
832 (setenv "CLASSPATH"
833 (string-append jvmlib "/share/classpath/glibj.zip:"
834 jvmlib "/share/classpath/tools.zip"))
835 (setenv "JAVACFLAGS"
836 (string-append "-cp "
837 jvmlib "/share/classpath/glibj.zip:"
838 jvmlib "/share/classpath/tools.zip")))
839 #t))
840 (add-after 'unpack 'patch-patches
841 (lambda _
842 ;; shebang in patches so that they apply cleanly
843 (substitute* '("patches/jtreg-jrunscript.patch"
844 "patches/hotspot/hs23/drop_unlicensed_test.patch")
845 (("#!/bin/sh") (string-append "#!" (which "sh"))))
846 #t))
847 (add-after 'unpack 'patch-paths
848 (lambda* (#:key inputs #:allow-other-keys)
849 ;; buildtree.make generates shell scripts, so we need to replace
850 ;; the generated shebang
851 (substitute* '("openjdk/hotspot/make/linux/makefiles/buildtree.make")
852 (("/bin/sh") (which "bash")))
853
854 (let ((corebin (string-append
855 (assoc-ref inputs "coreutils") "/bin/"))
856 (binbin (string-append
857 (assoc-ref inputs "binutils") "/bin/"))
858 (grepbin (string-append
859 (assoc-ref inputs "grep") "/bin/")))
860 (substitute* '("openjdk/jdk/make/common/shared/Defs-linux.gmk"
861 "openjdk/corba/make/common/shared/Defs-linux.gmk")
862 (("UNIXCOMMAND_PATH = /bin/")
863 (string-append "UNIXCOMMAND_PATH = " corebin))
864 (("USRBIN_PATH = /usr/bin/")
865 (string-append "USRBIN_PATH = " corebin))
866 (("DEVTOOLS_PATH *= */usr/bin/")
867 (string-append "DEVTOOLS_PATH = " corebin))
868 (("COMPILER_PATH *= */usr/bin/")
869 (string-append "COMPILER_PATH = "
870 (assoc-ref inputs "gcc") "/bin/"))
871 (("DEF_OBJCOPY *=.*objcopy")
872 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
873
874 ;; fix path to alsa header
875 (substitute* "openjdk/jdk/make/common/shared/Sanity.gmk"
876 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
877 (string-append "ALSA_INCLUDE="
878 (assoc-ref inputs "alsa-lib")
879 "/include/alsa/version.h")))
880
881 ;; fix hard-coded utility paths
882 (substitute* '("openjdk/jdk/make/common/shared/Defs-utils.gmk"
883 "openjdk/corba/make/common/shared/Defs-utils.gmk")
884 (("ECHO *=.*echo")
885 (string-append "ECHO = " (which "echo")))
886 (("^GREP *=.*grep")
887 (string-append "GREP = " (which "grep")))
888 (("EGREP *=.*egrep")
889 (string-append "EGREP = " (which "egrep")))
890 (("CPIO *=.*cpio")
891 (string-append "CPIO = " (which "cpio")))
892 (("READELF *=.*readelf")
893 (string-append "READELF = " (which "readelf")))
894 (("^ *AR *=.*ar")
895 (string-append "AR = " (which "ar")))
896 (("^ *TAR *=.*tar")
897 (string-append "TAR = " (which "tar")))
898 (("AS *=.*as")
899 (string-append "AS = " (which "as")))
900 (("LD *=.*ld")
901 (string-append "LD = " (which "ld")))
902 (("STRIP *=.*strip")
903 (string-append "STRIP = " (which "strip")))
904 (("NM *=.*nm")
905 (string-append "NM = " (which "nm")))
906 (("^SH *=.*sh")
907 (string-append "SH = " (which "bash")))
908 (("^FIND *=.*find")
909 (string-append "FIND = " (which "find")))
910 (("LDD *=.*ldd")
911 (string-append "LDD = " (which "ldd")))
912 (("NAWK *=.*(n|g)awk")
913 (string-append "NAWK = " (which "gawk")))
914 (("XARGS *=.*xargs")
915 (string-append "XARGS = " (which "xargs")))
916 (("UNZIP *=.*unzip")
917 (string-append "UNZIP = " (which "unzip")))
918 (("ZIPEXE *=.*zip")
919 (string-append "ZIPEXE = " (which "zip")))
920 (("SED *=.*sed")
921 (string-append "SED = " (which "sed"))))
922
923 ;; Some of these timestamps cause problems as they are more than
924 ;; 10 years ago, failing the build process.
925 (substitute*
926 "openjdk/jdk/src/share/classes/java/util/CurrencyData.properties"
927 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
928 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
929 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
930 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY"))
931 #t)))
932 (add-before 'configure 'set-additional-paths
933 (lambda* (#:key inputs #:allow-other-keys)
934 (setenv "CPATH"
935 (string-append (assoc-ref inputs "libxrender")
936 "/include/X11/extensions" ":"
937 (assoc-ref inputs "libxtst")
938 "/include/X11/extensions" ":"
939 (assoc-ref inputs "libxinerama")
940 "/include/X11/extensions" ":"
941 (or (getenv "CPATH") "")))
942 (setenv "ALT_CUPS_HEADERS_PATH"
943 (string-append (assoc-ref inputs "cups")
944 "/include"))
945 (setenv "ALT_FREETYPE_HEADERS_PATH"
946 (string-append (assoc-ref inputs "freetype")
947 "/include"))
948 (setenv "ALT_FREETYPE_LIB_PATH"
949 (string-append (assoc-ref inputs "freetype")
950 "/lib"))
951 #t))
952 (replace 'install
953 (lambda* (#:key outputs #:allow-other-keys)
954 (let ((doc (string-append (assoc-ref outputs "doc")
955 "/share/doc/icedtea"))
956 (jre (assoc-ref outputs "out"))
957 (jdk (assoc-ref outputs "jdk")))
958 (copy-recursively "openjdk.build/docs" doc)
959 (copy-recursively "openjdk.build/j2re-image" jre)
960 (copy-recursively "openjdk.build/j2sdk-image" jdk))
961 #t)))))
962 (native-inputs
963 `(("ant" ,ant-bootstrap)
964 ("alsa-lib" ,alsa-lib)
965 ("attr" ,attr)
966 ("classpath" ,classpath-devel)
967 ("coreutils" ,coreutils)
968 ("cpio" ,cpio)
969 ("cups" ,cups)
970 ("ecj" ,ecj-bootstrap)
971 ("ecj-javac" ,ecj-javac-on-jamvm-wrapper-final)
972 ("fastjar" ,fastjar)
973 ("fontconfig" ,fontconfig)
974 ("freetype" ,freetype)
975 ("gtk" ,gtk+-2)
976 ("gawk" ,gawk)
977 ("giflib" ,giflib)
978 ("grep" ,grep)
979 ("jamvm" ,jamvm)
980 ("lcms" ,lcms)
981 ("libjpeg" ,libjpeg)
982 ("libpng" ,libpng)
983 ("libtool" ,libtool)
984 ("libx11" ,libx11)
985 ("libxcomposite" ,libxcomposite)
986 ("libxi" ,libxi)
987 ("libxinerama" ,libxinerama)
988 ("libxrender" ,libxrender)
989 ("libxslt" ,libxslt) ;for xsltproc
990 ("libxt" ,libxt)
991 ("libxtst" ,libxtst)
992 ("mit-krb5" ,mit-krb5)
993 ("nss" ,nss)
994 ("nss-certs" ,nss-certs)
995 ("perl" ,perl)
996 ("pkg-config" ,pkg-config)
997 ("procps" ,procps) ;for "free", even though I'm not sure we should use it
998 ("unzip" ,unzip)
999 ("wget" ,wget)
1000 ("which" ,which)
1001 ("zip" ,zip)
1002 ("zlib" ,zlib)
1003 ("openjdk-src"
1004 ,(origin
1005 (method hg-fetch)
1006 (uri (hg-reference
1007 (url "http://hg.openjdk.java.net/jdk6/jdk6/")
1008 (changeset "jdk6-b41")))
1009 (sha256
1010 (base32
1011 "14q47yfg586fs64w30g8mk92m5dkxsvr36zzh0ra99xk5x0x96mv"))))
1012 ("jdk-src"
1013 ,(origin
1014 (method hg-fetch)
1015 (uri (hg-reference
1016 (url "http://hg.openjdk.java.net/jdk6/jdk6/jdk/")
1017 (changeset "jdk6-b41")))
1018 (sha256
1019 (base32
1020 "165824nhg1k1dx6zs9dny0j49rmk35jw5b13dmz8c77jfajml4v9"))))
1021 ("hotspot-src"
1022 ,(origin
1023 (method hg-fetch)
1024 (uri (hg-reference
1025 (url "http://hg.openjdk.java.net/jdk6/jdk6/hotspot/")
1026 (changeset "jdk6-b41")))
1027 (sha256
1028 (base32
1029 "07lc1z4k5dj9nrc1wvwmpvxr3xgxrdkdh53xb95skk5ij49yagfd"))))
1030 ("corba-src"
1031 ,(origin
1032 (method hg-fetch)
1033 (uri (hg-reference
1034 (url "http://hg.openjdk.java.net/jdk6/jdk6/corba/")
1035 (changeset "jdk6-b41")))
1036 (sha256
1037 (base32
1038 "1p9g1r9dnax2iwp7yb59qx7m4nmshqhwmrb2b8jj8zgbd9dl2i3q"))))
1039 ("langtools-src"
1040 ,(origin
1041 (method hg-fetch)
1042 (uri (hg-reference
1043 (url "http://hg.openjdk.java.net/jdk6/jdk6/langtools/")
1044 (changeset "jdk6-b41")))
1045 (sha256
1046 (base32
1047 "1x52wd67fynbbd9ild6fb4wvba3f5hhwk03qdjfazd0a1qr37z3d"))))
1048 ("jaxp-src"
1049 ,(origin
1050 (method hg-fetch)
1051 (uri (hg-reference
1052 (url "http://hg.openjdk.java.net/jdk6/jdk6/jaxp/")
1053 (changeset "jdk6-b41")))
1054 (sha256
1055 (base32
1056 "0shlqrvzpr4nrkmv215lbxnby63s3yvbdh1yxcayznsyqwa4nlxm"))))
1057 ("jaxws-src"
1058 ,(origin
1059 (method hg-fetch)
1060 (uri (hg-reference
1061 (url "http://hg.openjdk.java.net/jdk6/jdk6/jaxws/")
1062 (changeset "jdk6-b41")))
1063 (sha256
1064 (base32
1065 "0835lkw8vib1xhp8lxnybhlvzdh699hbi4mclxanydjk63zbpxk0"))))))
1066 (home-page "http://icedtea.classpath.org")
1067 (synopsis "Java development kit")
1068 (description
1069 "This package provides the OpenJDK built with the IcedTea build harness.
1070This version of the OpenJDK is no longer maintained and is only used for
1071bootstrapping purposes.")
1072 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
1073 ;; same license as both GNU Classpath and OpenJDK.
1074 (license license:gpl2+)))
1075
a243e12a 1076(define-public icedtea-7
6e7d8419 1077 (let* ((version "2.6.12")
f6789047
RW
1078 (drop (lambda (name hash)
1079 (origin
1080 (method url-fetch)
1081 (uri (string-append
d30ce4a7 1082 "http://icedtea.classpath.org/download/drops"
f6789047
RW
1083 "/icedtea7/" version "/" name ".tar.bz2"))
1084 (sha256 (base32 hash))))))
71053e14
RW
1085 (package
1086 (name "icedtea")
f6789047
RW
1087 (version version)
1088 (source (origin
1089 (method url-fetch)
1090 (uri (string-append
1091 "http://icedtea.wildebeest.org/download/source/icedtea-"
1092 version ".tar.xz"))
1093 (sha256
1094 (base32
6e7d8419 1095 "0s0zh0mj1sab99kb516lsgq3859vsc951phc565gwix4l5g9zppk"))
f6789047
RW
1096 (modules '((guix build utils)))
1097 (snippet
1098 '(substitute* "Makefile.in"
1099 ;; do not leak information about the build host
1100 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
1101 "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
71053e14
RW
1102 (build-system gnu-build-system)
1103 (outputs '("out" ; Java Runtime Environment
1104 "jdk" ; Java Development Kit
1105 "doc")) ; all documentation
f6789047
RW
1106 (arguments
1107 `(;; There are many test failures. Some are known to
1108 ;; fail upstream, others relate to not having an X
1109 ;; server running at test time, yet others are a
1110 ;; complete mystery to me.
1111
1112 ;; hotspot: passed: 241; failed: 45; error: 2
1113 ;; langtools: passed: 1,934; failed: 26
1114 ;; jdk: unknown
1115 #:tests? #f
71053e14
RW
1116
1117 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
1118 ;; gremlin) doesn't support it yet, so skip this phase.
1119 #:validate-runpath? #f
1120
f6789047
RW
1121 ;; Apparently, the C locale is needed for some of the tests.
1122 #:locale "C"
71053e14
RW
1123
1124 #:modules ((guix build utils)
1125 (guix build gnu-build-system)
1126 (ice-9 match)
1127 (ice-9 popen)
71053e14
RW
1128 (srfi srfi-19)
1129 (srfi srfi-26))
1130
1131 #:configure-flags
e2098e2d
RW
1132 ;; TODO: package pcsc and sctp, and add to inputs
1133 `("--disable-system-pcsc"
1134 "--disable-system-sctp"
1135 "--enable-bootstrap"
1136 "--enable-nss"
1137 "--without-rhino"
1138 "--disable-downloading"
1139 "--disable-tests" ;they are run in the check phase instead
1140 "--with-openjdk-src-dir=./openjdk.src"
1141 ,(string-append "--with-jdk-home="
1142 (assoc-ref %build-inputs "jdk")))
71053e14
RW
1143
1144 #:phases
1145 (modify-phases %standard-phases
1146 (replace 'unpack
1147 (lambda* (#:key source inputs #:allow-other-keys)
1148 (let ((target (string-append "icedtea-" ,version))
1149 (unpack (lambda* (name #:optional dir)
1150 (let ((dir (or dir
1151 (string-drop-right name 5))))
1152 (mkdir dir)
1153 (zero? (system* "tar" "xvf"
1154 (assoc-ref inputs name)
1155 "-C" dir
1156 "--strip-components=1"))))))
1157 (mkdir target)
1158 (and
1159 (zero? (system* "tar" "xvf" source
1160 "-C" target "--strip-components=1"))
1161 (chdir target)
1162 (unpack "openjdk-src" "openjdk.src")
1163 (with-directory-excursion "openjdk.src"
1164 (for-each unpack
1165 (filter (cut string-suffix? "-drop" <>)
1166 (map (match-lambda
1167 ((name . _) name))
1168 inputs))))
1169 #t))))
1170 (add-after 'unpack 'fix-x11-extension-include-path
1171 (lambda* (#:key inputs #:allow-other-keys)
1172 (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
1173 (((string-append "\\$\\(firstword \\$\\(wildcard "
1174 "\\$\\(OPENWIN_HOME\\)"
1175 "/include/X11/extensions\\).*$"))
1176 (string-append (assoc-ref inputs "libxrender")
1177 "/include/X11/extensions"
1178 " -I" (assoc-ref inputs "libxtst")
1179 "/include/X11/extensions"
1180 " -I" (assoc-ref inputs "libxinerama")
1181 "/include/X11/extensions"))
1182 (("\\$\\(wildcard /usr/include/X11/extensions\\)\\)") ""))
1183 #t))
1184 (add-after 'unpack 'patch-paths
1185 (lambda _
1186 ;; buildtree.make generates shell scripts, so we need to replace
1187 ;; the generated shebang
1188 (substitute* '("openjdk.src/hotspot/make/linux/makefiles/buildtree.make")
1189 (("/bin/sh") (which "bash")))
1190
1191 (let ((corebin (string-append
1192 (assoc-ref %build-inputs "coreutils") "/bin/"))
1193 (binbin (string-append
1194 (assoc-ref %build-inputs "binutils") "/bin/"))
1195 (grepbin (string-append
1196 (assoc-ref %build-inputs "grep") "/bin/")))
1197 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
1198 "openjdk.src/corba/make/common/shared/Defs-linux.gmk")
1199 (("UNIXCOMMAND_PATH = /bin/")
1200 (string-append "UNIXCOMMAND_PATH = " corebin))
1201 (("USRBIN_PATH = /usr/bin/")
1202 (string-append "USRBIN_PATH = " corebin))
1203 (("DEVTOOLS_PATH *= */usr/bin/")
1204 (string-append "DEVTOOLS_PATH = " corebin))
1205 (("COMPILER_PATH *= */usr/bin/")
1206 (string-append "COMPILER_PATH = "
1207 (assoc-ref %build-inputs "gcc") "/bin/"))
1208 (("DEF_OBJCOPY *=.*objcopy")
1209 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
1210
1211 ;; fix path to alsa header
1212 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
1213 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
1214 (string-append "ALSA_INCLUDE="
1215 (assoc-ref %build-inputs "alsa-lib")
1216 "/include/alsa/version.h")))
1217
1218 ;; fix hard-coded utility paths
1219 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-utils.gmk"
1220 "openjdk.src/corba/make/common/shared/Defs-utils.gmk")
1221 (("ECHO *=.*echo")
1222 (string-append "ECHO = " (which "echo")))
1223 (("^GREP *=.*grep")
1224 (string-append "GREP = " (which "grep")))
1225 (("EGREP *=.*egrep")
1226 (string-append "EGREP = " (which "egrep")))
1227 (("CPIO *=.*cpio")
1228 (string-append "CPIO = " (which "cpio")))
1229 (("READELF *=.*readelf")
1230 (string-append "READELF = " (which "readelf")))
1231 (("^ *AR *=.*ar")
1232 (string-append "AR = " (which "ar")))
1233 (("^ *TAR *=.*tar")
1234 (string-append "TAR = " (which "tar")))
1235 (("AS *=.*as")
1236 (string-append "AS = " (which "as")))
1237 (("LD *=.*ld")
1238 (string-append "LD = " (which "ld")))
1239 (("STRIP *=.*strip")
1240 (string-append "STRIP = " (which "strip")))
1241 (("NM *=.*nm")
1242 (string-append "NM = " (which "nm")))
1243 (("^SH *=.*sh")
1244 (string-append "SH = " (which "bash")))
1245 (("^FIND *=.*find")
1246 (string-append "FIND = " (which "find")))
1247 (("LDD *=.*ldd")
1248 (string-append "LDD = " (which "ldd")))
1249 (("NAWK *=.*(n|g)awk")
1250 (string-append "NAWK = " (which "gawk")))
1251 (("XARGS *=.*xargs")
1252 (string-append "XARGS = " (which "xargs")))
1253 (("UNZIP *=.*unzip")
1254 (string-append "UNZIP = " (which "unzip")))
1255 (("ZIPEXE *=.*zip")
1256 (string-append "ZIPEXE = " (which "zip")))
1257 (("SED *=.*sed")
1258 (string-append "SED = " (which "sed"))))
1259
1260 ;; Some of these timestamps cause problems as they are more than
1261 ;; 10 years ago, failing the build process.
1262 (substitute*
1263 "openjdk.src/jdk/src/share/classes/java/util/CurrencyData.properties"
1264 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
1265 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
1266 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
1267 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY")))
1268 #t))
1269 (add-before 'configure 'set-additional-paths
1270 (lambda* (#:key inputs #:allow-other-keys)
e2098e2d
RW
1271 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
1272 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
1273 (string-append "ALSA_INCLUDE="
1274 (assoc-ref inputs "alsa-lib")
1275 "/include/alsa/version.h")))
1276 (setenv "CC" "gcc")
1277 (setenv "CPATH"
1278 (string-append (assoc-ref inputs "libxcomposite")
1279 "/include/X11/extensions" ":"
1280 (assoc-ref inputs "libxrender")
1281 "/include/X11/extensions" ":"
1282 (assoc-ref inputs "libxtst")
1283 "/include/X11/extensions" ":"
1284 (assoc-ref inputs "libxinerama")
1285 "/include/X11/extensions" ":"
1286 (or (getenv "CPATH") "")))
1287 (setenv "ALT_OBJCOPY" (which "objcopy"))
1288 (setenv "ALT_CUPS_HEADERS_PATH"
1289 (string-append (assoc-ref inputs "cups")
1290 "/include"))
1291 (setenv "ALT_FREETYPE_HEADERS_PATH"
1292 (string-append (assoc-ref inputs "freetype")
1293 "/include"))
1294 (setenv "ALT_FREETYPE_LIB_PATH"
1295 (string-append (assoc-ref inputs "freetype")
1296 "/lib"))
71053e14
RW
1297 #t))
1298 (add-before 'check 'fix-test-framework
1299 (lambda _
1300 ;; Fix PATH in test environment
1301 (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
1302 (("PATH=/bin:/usr/bin")
1303 (string-append "PATH=" (getenv "PATH"))))
1304 (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
1305 (("/usr/bin/env") (which "env")))
1306 (substitute* "openjdk.src/hotspot/test/test_env.sh"
1307 (("/bin/rm") (which "rm"))
1308 (("/bin/cp") (which "cp"))
1309 (("/bin/mv") (which "mv")))
1310 #t))
1311 (add-before 'check 'fix-hotspot-tests
1312 (lambda _
1313 (with-directory-excursion "openjdk.src/hotspot/test/"
1314 (substitute* "jprt.config"
1315 (("PATH=\"\\$\\{path4sdk\\}\"")
1316 (string-append "PATH=" (getenv "PATH")))
1317 (("make=/usr/bin/make")
1318 (string-append "make=" (which "make"))))
1319 (substitute* '("runtime/6626217/Test6626217.sh"
1320 "runtime/7110720/Test7110720.sh")
1321 (("/bin/rm") (which "rm"))
1322 (("/bin/cp") (which "cp"))
1323 (("/bin/mv") (which "mv"))))
1324 #t))
1325 (add-before 'check 'fix-jdk-tests
1326 (lambda _
1327 (with-directory-excursion "openjdk.src/jdk/test/"
1328 (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
1329 (("/bin/pwd") (which "pwd")))
1330 (substitute* "com/sun/jdi/ShellScaffold.sh"
1331 (("/bin/kill") (which "kill")))
1332 (substitute* "start-Xvfb.sh"
1333 ;;(("/usr/bin/X11/Xvfb") (which "Xvfb"))
1334 (("/usr/bin/nohup") (which "nohup")))
1335 (substitute* "javax/security/auth/Subject/doAs/Test.sh"
1336 (("/bin/rm") (which "rm")))
1337 (substitute* "tools/launcher/MultipleJRE.sh"
1338 (("echo \"#!/bin/sh\"")
1339 (string-append "echo \"#!" (which "rm") "\""))
1340 (("/usr/bin/zip") (which "zip")))
1341 (substitute* "com/sun/jdi/OnThrowTest.java"
1342 (("#!/bin/sh") (string-append "#!" (which "sh"))))
1343 (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
1344 (("/usr/bin/uptime") (which "uptime")))
1345 (substitute* "java/lang/ProcessBuilder/Basic.java"
1346 (("/usr/bin/env") (which "env"))
1347 (("/bin/false") (which "false"))
1348 (("/bin/true") (which "true"))
1349 (("/bin/cp") (which "cp"))
1350 (("/bin/sh") (which "sh")))
1351 (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
1352 (("/bin/sh") (which "sh")))
1353 (substitute* "java/lang/ProcessBuilder/Zombies.java"
1354 (("/usr/bin/perl") (which "perl"))
1355 (("/bin/ps") (which "ps"))
1356 (("/bin/true") (which "true")))
1357 (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
1358 (("/usr/bin/tee") (which "tee")))
1359 (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
1360 (("/bin/true") (which "true")))
1361 (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
1362 (("/bin/cat") (which "cat")))
1363 (substitute* "java/lang/Runtime/exec/ExitValue.java"
1364 (("/bin/sh") (which "sh"))
1365 (("/bin/true") (which "true"))
1366 (("/bin/kill") (which "kill")))
1367 (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
1368 (("/usr/bin/echo") (which "echo")))
1369 (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
1370 (("/usr/bin/cat") (which "cat")))
1371 (substitute* "java/lang/Runtime/exec/SleepyCat.java"
1372 (("/bin/cat") (which "cat"))
1373 (("/bin/sleep") (which "sleep"))
1374 (("/bin/sh") (which "sh")))
1375 (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
1376 (("/bin/cat") (which "cat")))
1377 (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
1378 (("/bin/chmod") (which "chmod")))
1379 (substitute* "java/util/zip/ZipFile/Assortment.java"
1380 (("/bin/sh") (which "sh"))))
1381 #t))
1382 (replace 'check
1383 (lambda _
1384 ;; The "make check-*" targets always return zero, so we need to
1385 ;; check for errors in the associated log files to determine
1386 ;; whether any tests have failed.
1387 (use-modules (ice-9 rdelim))
1388 (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
1389 (checker (lambda (port)
1390 (let loop ()
1391 (let ((line (read-line port)))
1392 (cond
1393 ((eof-object? line) #t)
1394 ((regexp-exec error-pattern line) #f)
1395 (else (loop)))))))
1396 (run-test (lambda (test)
1397 (system* "make" test)
1398 (call-with-input-file
1399 (string-append "test/" test ".log")
1400 checker))))
1401 (or #t ; skip tests
1402 (and (run-test "check-hotspot")
1403 (run-test "check-langtools")
1404 (run-test "check-jdk"))))))
1405 (replace 'install
1406 (lambda* (#:key outputs #:allow-other-keys)
1407 (let ((doc (string-append (assoc-ref outputs "doc")
1408 "/share/doc/icedtea"))
1409 (jre (assoc-ref outputs "out"))
1410 (jdk (assoc-ref outputs "jdk")))
1411 (copy-recursively "openjdk.build/docs" doc)
1412 (copy-recursively "openjdk.build/j2re-image" jre)
1413 (copy-recursively "openjdk.build/j2sdk-image" jdk))
1414 #t))
491dc2fb
RJ
1415 ;; Some of the libraries in the lib/amd64 folder link to libjvm.so.
1416 ;; But that shared object is located in the server/ folder, so it
1417 ;; cannot be found. This phase creates a symbolic link in the
1418 ;; lib/amd64 folder so that the other libraries can find it.
1419 ;;
1420 ;; See:
1421 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1422 ;;
1423 ;; FIXME: Find the bug in the build system, so that this symlink is
1424 ;; not needed.
1425 (add-after 'install 'install-libjvm
1426 (lambda* (#:key inputs outputs #:allow-other-keys)
1427 (let* ((lib-path (string-append (assoc-ref outputs "out")
1428 "/lib/amd64")))
1429 (symlink (string-append lib-path "/server/libjvm.so")
1430 (string-append lib-path "/libjvm.so")))
1431 #t))
71053e14
RW
1432 ;; By default IcedTea only generates an empty keystore. In order to
1433 ;; be able to use certificates in Java programs we need to generate a
1434 ;; keystore from a set of certificates. For convenience we use the
1435 ;; certificates from the nss-certs package.
1436 (add-after 'install 'install-keystore
1437 (lambda* (#:key inputs outputs #:allow-other-keys)
1438 (let* ((keystore "cacerts")
1439 (certs-dir (string-append (assoc-ref inputs "nss-certs")
1440 "/etc/ssl/certs"))
1441 (keytool (string-append (assoc-ref outputs "jdk")
1442 "/bin/keytool")))
1443 (define (extract-cert file target)
1444 (call-with-input-file file
1445 (lambda (in)
1446 (call-with-output-file target
1447 (lambda (out)
1448 (let loop ((line (read-line in 'concat))
1449 (copying? #f))
1450 (cond
1451 ((eof-object? line) #t)
1452 ((string-prefix? "-----BEGIN" line)
1453 (display line out)
1454 (loop (read-line in 'concat) #t))
1455 ((string-prefix? "-----END" line)
1456 (display line out)
1457 #t)
1458 (else
1459 (when copying? (display line out))
1460 (loop (read-line in 'concat) copying?)))))))))
1461 (define (import-cert cert)
1462 (format #t "Importing certificate ~a\n" (basename cert))
1463 (let ((temp "tmpcert"))
1464 (extract-cert cert temp)
1465 (let ((port (open-pipe* OPEN_WRITE keytool
1466 "-import"
1467 "-alias" (basename cert)
1468 "-keystore" keystore
1469 "-storepass" "changeit"
1470 "-file" temp)))
1471 (display "yes\n" port)
1472 (when (not (zero? (status:exit-val (close-pipe port))))
1473 (format #t "failed to import ~a\n" cert)))
1474 (delete-file temp)))
1475
1476 ;; This is necessary because the certificate directory contains
1477 ;; files with non-ASCII characters in their names.
1478 (setlocale LC_ALL "en_US.utf8")
1479 (setenv "LC_ALL" "en_US.utf8")
1480
1481 (for-each import-cert (find-files certs-dir "\\.pem$"))
1482 (mkdir-p (string-append (assoc-ref outputs "out")
1483 "/lib/security"))
1484 (mkdir-p (string-append (assoc-ref outputs "jdk")
1485 "/jre/lib/security"))
1486
1487 ;; The cacerts files we are going to overwrite are chmod'ed as
1488 ;; read-only (444) in icedtea-8 (which derives from this
1489 ;; package). We have to change this so we can overwrite them.
1490 (chmod (string-append (assoc-ref outputs "out")
1491 "/lib/security/" keystore) #o644)
1492 (chmod (string-append (assoc-ref outputs "jdk")
1493 "/jre/lib/security/" keystore) #o644)
1494
1495 (install-file keystore
1496 (string-append (assoc-ref outputs "out")
1497 "/lib/security"))
1498 (install-file keystore
1499 (string-append (assoc-ref outputs "jdk")
1500 "/jre/lib/security"))
1501 #t))))))
f6789047 1502 (native-inputs
d9148890 1503 `(("openjdk-src"
f6789047 1504 ,(drop "openjdk"
6e7d8419 1505 "15qf3nfidgnigh2zny6djfp8bhfwjnwk9i06mxs2jbq6na953ql2"))
f6789047
RW
1506 ("corba-drop"
1507 ,(drop "corba"
6e7d8419 1508 "1phvn8fyl5mw2n2sn97f17nm442k75xsz2023bfw4h66ywzkqhqy"))
f6789047
RW
1509 ("jaxp-drop"
1510 ,(drop "jaxp"
6e7d8419 1511 "0j4ms6lmnfa2cwfh9yfqdfg1bnn3fc40ay4x6k8zqa8yvspik5w5"))
f6789047
RW
1512 ("jaxws-drop"
1513 ,(drop "jaxws"
6e7d8419 1514 "09sddj73k7n29s39hvdk14r130mvlknbxkpd2w58f34sq5sgpdrg"))
f6789047
RW
1515 ("jdk-drop"
1516 ,(drop "jdk"
6e7d8419 1517 "0q896zz8wyswmksy225q1k27nz3v3l27052dcvvpv20ryykz8yp7"))
f6789047
RW
1518 ("langtools-drop"
1519 ,(drop "langtools"
6e7d8419 1520 "0niicyfccim4a9is4akh87jd7wbl8jrazdaab957mcv9l1x3bnqc"))
f6789047
RW
1521 ("hotspot-drop"
1522 ,(drop "hotspot"
6e7d8419 1523 "1jw42qhbm3wfavk39304m53lmqipcllrvjqiab2f42mjs10i8gfx"))
e2098e2d 1524 ("ant" ,ant-bootstrap)
71053e14 1525 ("attr" ,attr)
71053e14
RW
1526 ("coreutils" ,coreutils)
1527 ("diffutils" ,diffutils) ;for tests
1528 ("gawk" ,gawk)
1529 ("grep" ,grep)
1530 ("libtool" ,libtool)
1531 ("pkg-config" ,pkg-config)
1532 ("wget" ,wget)
1533 ("which" ,which)
1534 ("cpio" ,cpio)
1535 ("zip" ,zip)
1536 ("unzip" ,unzip)
1537 ("fastjar" ,fastjar)
1538 ("libxslt" ,libxslt) ;for xsltproc
1539 ("nss-certs" ,nss-certs)
1540 ("perl" ,perl)
1541 ("procps" ,procps) ;for "free", even though I'm not sure we should use it
e2098e2d 1542 ("jdk" ,icedtea-6 "jdk")))
b711df02 1543 (inputs
71053e14
RW
1544 `(("alsa-lib" ,alsa-lib)
1545 ("cups" ,cups)
1546 ("libx11" ,libx11)
1547 ("libxcomposite" ,libxcomposite)
1548 ("libxt" ,libxt)
1549 ("libxtst" ,libxtst)
1550 ("libxi" ,libxi)
1551 ("libxinerama" ,libxinerama)
1552 ("libxrender" ,libxrender)
1553 ("libjpeg" ,libjpeg)
1554 ("libpng" ,libpng)
1555 ("mit-krb5" ,mit-krb5)
1556 ("nss" ,nss)
1557 ("giflib" ,giflib)
1558 ("fontconfig" ,fontconfig)
1559 ("freetype" ,freetype)
1560 ("lcms" ,lcms)
1561 ("zlib" ,zlib)
1562 ("gtk" ,gtk+-2)))
1563 (home-page "http://icedtea.classpath.org")
1564 (synopsis "Java development kit")
1565 (description
1566 "This package provides the Java development kit OpenJDK built with the
1567IcedTea build harness.")
1568 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
1569 ;; same license as both GNU Classpath and OpenJDK.
1570 (license license:gpl2+))))
d2540f80 1571
349a3147 1572(define-public icedtea-8
46dea124 1573 (let* ((version "3.6.0")
349a3147
RW
1574 (drop (lambda (name hash)
1575 (origin
1576 (method url-fetch)
1577 (uri (string-append
db531f73 1578 "http://icedtea.classpath.org/download/drops"
349a3147
RW
1579 "/icedtea8/" version "/" name ".tar.xz"))
1580 (sha256 (base32 hash))))))
1581 (package (inherit icedtea-7)
46dea124 1582 (version "3.6.0")
349a3147
RW
1583 (source (origin
1584 (method url-fetch)
1585 (uri (string-append
1586 "http://icedtea.wildebeest.org/download/source/icedtea-"
1587 version ".tar.xz"))
1588 (sha256
1589 (base32
46dea124 1590 "0zj192zrrxqh6j1ywc3399gk2ycay9w8pvzcvvr2kvdkb37ak86h"))
349a3147
RW
1591 (modules '((guix build utils)))
1592 (snippet
0c729ef4 1593 '(begin
f2785bd6
RW
1594 (substitute* '("configure"
1595 "acinclude.m4")
0c729ef4
RW
1596 ;; Do not embed build time
1597 (("(DIST_ID=\"Custom build).*$" _ prefix)
1598 (string-append prefix "\"\n"))
1599 ;; Do not leak information about the build host
1600 (("DIST_NAME=\"\\$build_os\"")
1601 "DIST_NAME=\"guix\""))
1602 #t))))
349a3147 1603 (arguments
f2785bd6
RW
1604 `(#:imported-modules
1605 ((guix build ant-build-system)
1606 (guix build syscalls)
1607 ,@%gnu-build-system-modules)
1608 ,@(substitute-keyword-arguments (package-arguments icedtea-7)
1609 ((#:modules modules)
1610 `((guix build utils)
1611 (guix build gnu-build-system)
1612 ((guix build ant-build-system) #:prefix ant:)
1613 (ice-9 match)
1614 (ice-9 popen)
1615 (srfi srfi-19)
1616 (srfi srfi-26)))
1617 ((#:configure-flags flags)
1618 `(let ((jdk (assoc-ref %build-inputs "jdk")))
1619 `( ;;"--disable-bootstrap"
1620 "--enable-bootstrap"
1621 "--enable-nss"
1622 "--disable-downloading"
1623 "--disable-system-pcsc"
1624 "--disable-system-sctp"
1625 "--disable-tests" ;they are run in the check phase instead
1626 "--with-openjdk-src-dir=./openjdk.src"
1627 ,(string-append "--with-jdk-home=" jdk))))
1628 ((#:phases phases)
1629 `(modify-phases ,phases
1630 (delete 'fix-x11-extension-include-path)
1631 (delete 'patch-paths)
1632 (delete 'set-additional-paths)
1633 (delete 'patch-patches)
1634 ;; Prevent the keytool from recording the current time when
1635 ;; adding certificates at build time.
1636 (add-after 'unpack 'patch-keystore
1637 (lambda _
1638 (substitute* "openjdk.src/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java"
1639 (("date = new Date\\(\\);")
1640 "\
1641date = (System.getenv(\"SOURCE_DATE_EPOCH\") != null) ?\
1642new Date(Long.parseLong(System.getenv(\"SOURCE_DATE_EPOCH\"))) :\
1643new Date();"))
1644 #t))
1645 (add-after 'unpack 'patch-jni-libs
1646 ;; Hardcode dynamically loaded libraries.
1647 (lambda _
1648 (let* ((library-path (search-path-as-string->list
1649 (getenv "LIBRARY_PATH")))
1650 (find-library (lambda (name)
1651 (search-path
1652 library-path
1653 (string-append "lib" name ".so")))))
1654 (for-each
1655 (lambda (file)
1656 (catch 'decoding-error
1657 (lambda ()
1658 (substitute* file
1659 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
1660 _ name version)
1661 (format #f "\"~a\"" (find-library name)))
1662 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
1663 (format #f "\"~a\"" (find-library name)))))
1664 (lambda _
1665 ;; Those are safe to skip.
1666 (format (current-error-port)
1667 "warning: failed to substitute: ~a~%"
1668 file))))
1669 (find-files "openjdk.src/jdk/src/solaris/native"
1670 "\\.c|\\.h"))
1671 #t)))
1672 (replace 'install
1673 (lambda* (#:key outputs #:allow-other-keys)
1674 (let ((doc (string-append (assoc-ref outputs "doc")
1675 "/share/doc/icedtea"))
1676 (jre (assoc-ref outputs "out"))
1677 (jdk (assoc-ref outputs "jdk")))
1678 (copy-recursively "openjdk.build/docs" doc)
1679 (copy-recursively "openjdk.build/images/j2re-image" jre)
1680 (copy-recursively "openjdk.build/images/j2sdk-image" jdk)
1681 ;; Install the nss.cfg file to JRE to enable SSL/TLS
1682 ;; support via NSS.
1683 (copy-file (string-append jdk "/jre/lib/security/nss.cfg")
1684 (string-append jre "/lib/security/nss.cfg"))
1685 #t)))
1686 (add-after 'install 'strip-jar-timestamps
1687 (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))))
349a3147
RW
1688 (native-inputs
1689 `(("jdk" ,icedtea-7 "jdk")
1690 ("openjdk-src"
1691 ,(drop "openjdk"
46dea124 1692 "0mqxh81kq05z4wydkik0yrr81ibf84xmwsdcw9n2gfrzs4f5jxnb"))
12eecbf0
LF
1693 ("aarch32-drop"
1694 ,(drop "aarch32"
46dea124 1695 "0b207g2n6kn510zf5vwh58bsxgqrmkvrna4p20r74v9cwcwx83n2"))
349a3147
RW
1696 ("corba-drop"
1697 ,(drop "corba"
46dea124 1698 "0qinc1q4w01nkr9klhfyd8caxvyrrfxjrz32nd7kgyja2bj8x7dd"))
349a3147
RW
1699 ("jaxp-drop"
1700 ,(drop "jaxp"
46dea124 1701 "07azrp3g86vk2laybmr5xfn0yrljkxs0rlm1q48385br225bgdxi"))
349a3147
RW
1702 ("jaxws-drop"
1703 ,(drop "jaxws"
46dea124 1704 "018fd2hq57zp3pq06wlxy5pabqcyk36xi8hk0d6xk3a90wsjvyik"))
349a3147
RW
1705 ("jdk-drop"
1706 ,(drop "jdk"
46dea124 1707 "0vs488kq5j2cc6kplc78jbhfxwq4fn06l34xrbq4d6y17777arg8"))
349a3147
RW
1708 ("langtools-drop"
1709 ,(drop "langtools"
46dea124 1710 "04f6d1wvck5jrpvrcw5gsbzxnihcry9zrf1v85czdm959q21zv9c"))
349a3147
RW
1711 ("hotspot-drop"
1712 ,(drop "hotspot"
46dea124 1713 "1mfgpzyr6zzy9klf8nn3z6d41fydb9ghpfpqzjq3cl95axfbdl1g"))
349a3147
RW
1714 ("nashorn-drop"
1715 ,(drop "nashorn"
46dea124 1716 "1a26cmzbs50gkh4rmmmxls7zljx62vfp1wq02gsfd5jqs4xvlibj"))
fd34d4f4
LF
1717 ("shenandoah-drop"
1718 ,(drop "shenandoah"
46dea124 1719 "11hmn9mwmvryfddcanzx3qffjm8bbiv18nwv3iy9cswrvxjy010f"))
349a3147 1720 ,@(fold alist-delete (package-native-inputs icedtea-7)
e2098e2d 1721 '("jdk" "openjdk-src" "corba-drop" "jaxp-drop" "jaxws-drop"
349a3147
RW
1722 "jdk-drop" "langtools-drop" "hotspot-drop")))))))
1723
a243e12a 1724(define-public icedtea icedtea-7)
068e476f 1725
5490480c 1726\f
8bbd0408
RW
1727(define-public ant/java8
1728 (package (inherit ant-bootstrap)
1729 (name "ant")
1730 (version "1.10.1")
1731 (source (origin
1732 (method url-fetch)
1733 (uri (string-append "mirror://apache/ant/source/apache-ant-"
1734 version "-src.tar.gz"))
1735 (sha256
1736 (base32
1737 "10p3dh77lkzzzcy32dk9azljixzadp46fggjfbvgkl8mmb8cxxv8"))
1738 (modules '((guix build utils)))
1739 (snippet
1740 '(begin
1741 (for-each delete-file
1742 (find-files "lib/optional" "\\.jar$"))
1743 #t))))
1744 (arguments
1745 (substitute-keyword-arguments (package-arguments ant-bootstrap)
1746 ((#:phases phases)
1747 `(modify-phases ,phases
1748 (add-after 'unpack 'remove-scripts
1749 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
1750 ;; wrappers.
1751 (lambda _
1752 (for-each delete-file
1753 (find-files "src/script"
1754 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))
1755 #t))
1756 (replace 'build
1757 (lambda* (#:key inputs outputs #:allow-other-keys)
1758 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
1759
1760 ;; Disable tests to avoid dependency on hamcrest-core, which needs
1761 ;; Ant to build. This is necessary in addition to disabling the
1762 ;; "check" phase, because the dependency on "test-jar" would always
1763 ;; result in the tests to be run.
1764 (substitute* "build.xml"
1765 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
1766 (zero? (system* "bash" "bootstrap.sh"
1767 (string-append "-Ddist.dir="
1768 (assoc-ref outputs "out"))))))))))
1769 (native-inputs
1770 `(("jdk" ,icedtea-8 "jdk")))))
1771
e441fc56
RW
1772;; The 1.9.x series is the last that can be built with GCJ. The 1.10.x series
1773;; requires Java 8.
1774(define-public ant
1775 (package (inherit ant/java8)
1776 (version "1.9.9")
1777 (source (origin
1778 (method url-fetch)
1779 (uri (string-append "mirror://apache/ant/source/apache-ant-"
1780 version "-src.tar.gz"))
1781 (sha256
1782 (base32
1783 "1k28mka0m3isy9yr8gz84kz1f3f879rwaxrd44vdn9xbfwvwk86n"))))
1784 (native-inputs
1785 `(("jdk" ,icedtea-7 "jdk")))))
1786
9ce7ac99
RW
1787(define-public ant-apache-bcel
1788 (package
1789 (inherit ant/java8)
1790 (name "ant-apache-bcel")
1791 (arguments
1792 (substitute-keyword-arguments (package-arguments ant/java8)
1793 ((#:phases phases)
1794 `(modify-phases ,phases
1795 (add-after 'unpack 'link-bcel
1796 (lambda* (#:key inputs #:allow-other-keys)
1797 (for-each (lambda (file)
1798 (symlink file
1799 (string-append "lib/optional/"
1800 (basename file))))
1801 (find-files (assoc-ref inputs "java-commons-bcel")
1802 "\\.jar$"))
1803 #t))
1804 (add-after 'build 'install
1805 (lambda* (#:key outputs #:allow-other-keys)
1806 (let* ((out (assoc-ref outputs "out"))
1807 (share (string-append out "/share/java"))
1808 (bin (string-append out "/bin"))
1809 (lib (string-append out "/lib")))
1810 (mkdir-p share)
1811 (install-file (string-append lib "/ant-apache-bcel.jar") share)
1812 (delete-file-recursively bin)
1813 (delete-file-recursively lib)
1814 #t)))))))
1815 (inputs
1816 `(("java-commons-bcel" ,java-commons-bcel)
1817 ,@(package-inputs ant/java8)))))
1818
fa6c4213
RW
1819(define-public ant-junit
1820 (package
1821 (inherit ant/java8)
1822 (name "ant-junit")
1823 (arguments
1824 (substitute-keyword-arguments (package-arguments ant/java8)
1825 ((#:phases phases)
1826 `(modify-phases ,phases
1827 (add-after 'unpack 'link-junit
1828 (lambda* (#:key inputs #:allow-other-keys)
1829 (for-each (lambda (file)
1830 (symlink file
1831 (string-append "lib/optional/"
1832 (basename file))))
1833 (find-files (assoc-ref inputs "java-junit")
1834 "\\.jar$"))
1835 #t))
1836 (add-after 'build 'install
1837 (lambda* (#:key outputs #:allow-other-keys)
1838 (let* ((out (assoc-ref outputs "out"))
1839 (share (string-append out "/share/java"))
1840 (bin (string-append out "/bin"))
1841 (lib (string-append out "/lib")))
1842 (mkdir-p share)
1843 (install-file (string-append lib "/ant-junit.jar") share)
1844 (delete-file-recursively bin)
1845 (delete-file-recursively lib)
1846 #t)))))))
1847 (inputs
1848 `(("java-junit" ,java-junit)
1849 ,@(package-inputs ant/java8)))))
1850
fc6e2727
RW
1851(define-public clojure
1852 (let* ((remove-archives '(begin
1853 (for-each delete-file
1854 (find-files "." ".*\\.(jar|zip)"))
1855 #t))
1856 (submodule (lambda (prefix version hash)
1857 (origin
1858 (method url-fetch)
1859 (uri (string-append "https://github.com/clojure/"
1860 prefix version ".tar.gz"))
1861 (sha256 (base32 hash))
1862 (modules '((guix build utils)))
1863 (snippet remove-archives)))))
1864 (package
1865 (name "clojure")
1d47ea86 1866 (version "1.9.0")
fc6e2727
RW
1867 (source
1868 (origin
1869 (method url-fetch)
1870 (uri
1d47ea86
AV
1871 (string-append "https://github.com/clojure/clojure/archive/clojure-"
1872 version ".tar.gz"))
fc6e2727 1873 (sha256
1d47ea86 1874 (base32 "0xjbzcw45z32vsn9pifp7ndysjzqswp5ig0jkjpivigh2ckkdzha"))
fc6e2727
RW
1875 (modules '((guix build utils)))
1876 (snippet remove-archives)))
1877 (build-system ant-build-system)
1878 (arguments
1879 `(#:modules ((guix build ant-build-system)
1880 (guix build utils)
1881 (ice-9 ftw)
1882 (ice-9 regex)
1883 (srfi srfi-1)
1884 (srfi srfi-26))
1885 #:test-target "test"
1886 #:phases
1887 (modify-phases %standard-phases
1888 (add-after 'unpack 'unpack-submodule-sources
1889 (lambda* (#:key inputs #:allow-other-keys)
1890 (for-each
1891 (lambda (name)
1892 (mkdir-p name)
1893 (with-directory-excursion name
1894 (or (zero? (system* "tar"
1895 ;; Use xz for repacked tarball.
1896 "--xz"
1897 "--extract"
1898 "--verbose"
1899 "--file" (assoc-ref inputs name)
1900 "--strip-components=1"))
1901 (error "failed to unpack tarball" name)))
1902 (copy-recursively (string-append name "/src/main/clojure/")
1903 "src/clj/"))
1d47ea86
AV
1904 '("core-specs-alpha-src"
1905 "data-generators-src"
1906 "spec-alpha-src"
fc6e2727
RW
1907 "test-check-src"
1908 "test-generative-src"
1d47ea86 1909 "tools-namespace-src"))
fc6e2727
RW
1910 #t))
1911 ;; The javadoc target is not built by default.
1912 (add-after 'build 'build-doc
1913 (lambda _
1914 (zero? (system* "ant" "javadoc"))))
1915 ;; Needed since no install target is provided.
1916 (replace 'install
1917 (lambda* (#:key outputs #:allow-other-keys)
1918 (let ((java-dir (string-append (assoc-ref outputs "out")
1919 "/share/java/")))
1920 ;; Install versioned to avoid collisions.
1921 (install-file (string-append "clojure-" ,version ".jar")
1922 java-dir)
1923 #t)))
1924 ;; Needed since no install-doc target is provided.
1925 (add-after 'install 'install-doc
1926 (lambda* (#:key outputs #:allow-other-keys)
1927 (let ((doc-dir (string-append (assoc-ref outputs "out")
1928 "/share/doc/clojure-"
1929 ,version "/")))
1930 (copy-recursively "doc/clojure" doc-dir)
1931 (copy-recursively "target/javadoc/"
1932 (string-append doc-dir "javadoc/"))
1933 (for-each (cut install-file <> doc-dir)
1934 (filter (cut string-match
1935 ".*\\.(html|markdown|md|txt)"
1936 <>)
1937 (scandir "./")))
1938 #t))))))
1939 ;; The native-inputs below are needed to run the tests.
1940 (native-inputs
1d47ea86
AV
1941 `(("core-specs-alpha-src"
1942 ,(submodule "core.specs.alpha/archive/core.specs.alpha-"
1943 "0.1.24"
1944 "0v2a0svf1ar2y42ajxwsjr7zmm5j7pp2zwrd2jh3k7xzd1p9x1fv"))
1945 ("data-generators-src"
fc6e2727
RW
1946 ,(submodule "data.generators/archive/data.generators-"
1947 "0.1.2"
1948 "0kki093jp4ckwxzfnw8ylflrfqs8b1i1wi9iapmwcsy328dmgzp1"))
1d47ea86
AV
1949 ("spec-alpha-src"
1950 ,(submodule "spec.alpha/archive/spec.alpha-"
1951 "0.1.143"
1952 "00alf0347licdn773w2jarpllyrbl52qz4d8mw61anjksacxylzz"))
fc6e2727
RW
1953 ("test-check-src"
1954 ,(submodule "test.check/archive/test.check-"
1955 "0.9.0"
1956 "0p0mnyhr442bzkz0s4k5ra3i6l5lc7kp6ajaqkkyh4c2k5yck1md"))
1957 ("test-generative-src"
1958 ,(submodule "test.generative/archive/test.generative-"
1959 "0.5.2"
1960 "1pjafy1i7yblc7ixmcpfq1lfbyf3jaljvkgrajn70sws9xs7a9f8"))
1961 ("tools-namespace-src"
1962 ,(submodule "tools.namespace/archive/tools.namespace-"
1963 "0.2.11"
1d47ea86 1964 "10baak8v0hnwz2hr33bavshm7y49mmn9zsyyms1dwjz45p5ymhy0"))))
fc6e2727
RW
1965 (home-page "https://clojure.org/")
1966 (synopsis "Lisp dialect running on the JVM")
1967 (description "Clojure is a dynamic, general-purpose programming language,
1968combining the approachability and interactive development of a scripting
1969language with an efficient and robust infrastructure for multithreaded
1970programming. Clojure is a compiled language, yet remains completely dynamic
1971– every feature supported by Clojure is supported at runtime. Clojure
1972provides easy access to the Java frameworks, with optional type hints and type
1973inference, to ensure that calls to Java can avoid reflection.
1974
1975Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy
1976and a powerful macro system. Clojure is predominantly a functional programming
1977language, and features a rich set of immutable, persistent data structures.
1978When mutable state is needed, Clojure offers a software transactional memory
1979system and reactive Agent system that ensure clean, correct, multithreaded
1980designs.")
1981 ;; Clojure is licensed under EPL1.0
1982 ;; ASM bytecode manipulation library is licensed under BSD-3
1983 ;; Guava Murmur3 hash implementation is licensed under APL2.0
1984 ;; src/clj/repl.clj is licensed under CPL1.0
1985 ;;
1986 ;; See readme.html or readme.txt for details.
1987 (license (list license:epl1.0
1988 license:bsd-3
1989 license:asl2.0
1990 license:cpl1.0)))))
1991
fc8d100b
RW
1992(define-public javacc
1993 (package
1994 (name "javacc")
1995 (version "7.0.3")
1996 (source (origin
1997 (method url-fetch)
1998 (uri (string-append "https://github.com/javacc/javacc/"
1999 "archive/" version ".tar.gz"))
2000 (file-name (string-append "javacc-" version ".tar.gz"))
2001 (sha256
2002 (base32
2003 "111xc9mnmc5a6qz6x3xbhqc07y1lg2b996ggzw0hrblg42zya9xf"))))
2004 (build-system ant-build-system)
2005 (arguments
2006 `(#:test-target "test"
2007 #:phases
2008 (modify-phases %standard-phases
2009 (add-after 'unpack 'delete-bundled-libs
2010 (lambda _
2011 (delete-file-recursively "lib") #t))
2012 (replace 'install (install-jars "target")))))
2013 (home-page "https://javacc.org/")
2014 (synopsis "Java parser generator")
2015 (description "Java Compiler Compiler (JavaCC) is the most popular parser
2016generator for use with Java applications. A parser generator is a tool that
2017reads a grammar specification and converts it to a Java program that can
2018recognize matches to the grammar. In addition to the parser generator itself,
2019JavaCC provides other standard capabilities related to parser generation such
2020as tree building (via a tool called JJTree included with JavaCC), actions,
2021debugging, etc.")
2022 (license license:bsd-3)))
2023
6688c41e
RW
2024(define-public javacc-4
2025 (package (inherit javacc)
2026 (version "4.1")
2027 (source (origin
2028 (method git-fetch)
2029 (uri (git-reference
2030 (url "https://github.com/javacc/javacc.git")
2031 (commit "release_41")))
2032 (file-name (string-append "javacc-" version "-checkout"))
2033 (sha256
2034 (base32
2035 "07ysav7j8r1c6h8qxrgqk6lwdp74ly0ad1935lragxml0qqc3ka0"))))
2036 ;; Tests fail with
2037 ;; /tmp/guix-build-javacc-4.1.drv-0/source/test/javacodeLA/build.xml:60:
2038 ;; JAVACODE failed
2039 (arguments
2040 `(#:tests? #f
2041 #:phases
2042 (modify-phases %standard-phases
2043 (add-after 'unpack 'delete-bundled-libs
2044 (lambda _
2045 (delete-file-recursively "lib") #t))
2046 (replace 'install (install-jars "bin/lib")))))))
2047
c1cb8576
RW
2048;; This is the last 3.x release of ECJ
2049(define-public java-ecj-3
2050 (package
2051 (name "java-ecj")
2052 (version "3.8.2")
2053 (source (origin
2054 (method url-fetch)
2055 (uri (string-append "http://archive.eclipse.org/eclipse/"
2056 "downloads/drops/R-" version
2057 "-201301310800/ecjsrc-" version ".jar"))
2058 (sha256
2059 (base32
2060 "01mdj14jw11g1jfnki4fi8229p0c6zzckd38zqy2w4m3cjcvsx04"))))
2061 (build-system ant-build-system)
2062 (arguments
2063 `(#:tests? #f ; none included
2064 #:jdk ,icedtea-7 ; doesn't build with JDK8+
2065 #:make-flags (list "-f" "src/build.xml")
2066 #:build-target "build"
2067 #:phases
2068 (modify-phases %standard-phases
2069 (add-after 'unpack 'fix-manifest
2070 (lambda _
2071 ;; Record the main class to make ecj executable.
2072 (with-atomic-file-replacement "src/META-INF/MANIFEST.MF"
2073 (lambda (in out)
2074 (display "Manifest-Version: 1.0
2075Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n"
2076 out)))))
2077 (replace 'install (install-jars ".")))))
2078 (home-page "https://eclipse.org")
2079 (synopsis "Eclipse Java development tools core batch compiler")
2080 (description "This package provides the Eclipse Java core batch compiler.")
2081 (license license:epl1.0)))
2082
f201b18e
RW
2083;; This is needed for java-cisd-args4j
2084(define-public java-ecj-3.5
2085 (package (inherit java-ecj-3)
2086 (version "3.5.1")
2087 (source (origin
2088 (method url-fetch/zipbomb)
2089 (uri (string-append "http://archive.eclipse.org/eclipse/"
2090 "downloads/drops/R-" version
2091 "-200909170800/ecjsrc-" version ".zip"))
2092 (sha256
2093 (base32
2094 "1vnl2mavisc567bip736xzsvvbjif5279wc4a7pbdik5wlir8qr7"))))
2095 (build-system ant-build-system)
2096 (arguments
2097 `(#:tests? #f ; none included
2098 #:jdk ,icedtea-7 ; doesn't build with JDK8+
2099 #:build-target "build"
2100 #:phases
2101 (modify-phases %standard-phases
2102 (add-after 'unpack 'fix-manifest
2103 (lambda _
2104 ;; Record the main class to make ecj executable.
2105 (with-atomic-file-replacement "META-INF/MANIFEST.MF"
2106 (lambda (in out)
2107 (dump-port in out)
2108 (display "Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n"
2109 out)))))
2110 (replace 'install (install-jars ".")))))
2111 (native-inputs
2112 `(("unzip" ,unzip)))))
2113
30d55473
RW
2114(define-public java-cisd-base
2115 (let ((revision 38938)
2116 (base-version "14.12.0"))
2117 (package
2118 (name "java-cisd-base")
2119 (version (string-append base-version "-" (number->string revision)))
2120 (source (origin
2121 (method svn-fetch)
2122 (uri (svn-reference
2123 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2124 "base/tags/release/"
2125 (version-major+minor base-version)
2126 ".x/" base-version "/base/"))
2127 (revision revision)))
2128 (file-name (string-append "java-cisd-base-" version "-checkout"))
2129 (sha256
2130 (base32
2131 "1i5adyf7nzclb0wydgwa1az04qliid8035vpahaandmkmigbnxiy"))
2132 (modules '((guix build utils)))
2133 (snippet
2134 '(begin
2135 ;; Delete included gradle jar
2136 (delete-file-recursively "gradle/wrapper")
2137 ;; Delete pre-built native libraries
2138 (delete-file-recursively "libs")
2139 #t))))
2140 (build-system ant-build-system)
2141 (arguments
2142 `(#:make-flags '("-file" "build/build.xml")
2143 #:test-target "jar-test"
2144 #:jdk ,icedtea-8
2145 #:phases
2146 (modify-phases %standard-phases
2147 (add-after 'unpack 'unpack-build-resources
2148 (lambda* (#:key inputs #:allow-other-keys)
2149 (copy-recursively (assoc-ref inputs "build-resources")
2150 "../build_resources")
2151 #t))
2152 (add-after 'unpack-build-resources 'fix-dependencies
2153 (lambda* (#:key inputs #:allow-other-keys)
2154 (substitute* "build/build.xml"
2155 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
2156 (string-append (assoc-ref inputs "java-testng")
2157 "/share/java/java-testng.jar"))
2158 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
2159 (string-append (assoc-ref inputs "java-commons-lang")
2160 "/share/java/commons-lang-"
2161 ,(package-version java-commons-lang) ".jar"))
2162 (("\\$\\{lib\\}/commons-io/commons-io.jar")
2163 (string-append (assoc-ref inputs "java-commons-io")
2164 "/share/java/commons-io-"
2165 ,(package-version java-commons-io)
2166 "-SNAPSHOT.jar"))
2167 ;; Remove dependency on svn
2168 (("<build-info.*") "")
2169 (("\\$\\{revision.number\\}")
2170 ,(number->string revision))
2171 (("\\$\\{version.number\\}") ,base-version))
2172 ;; Remove dependency on classycle
2173 (substitute* "../build_resources/ant/build-common.xml"
2174 (("<taskdef name=\"dependency-checker.*") "")
2175 (("classname=\"classycle.*") "")
2176 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
2177 #t))
2178 ;; A few tests fail because of the lack of a proper /etc/groups and
2179 ;; /etc/passwd file in the build container.
2180 (add-after 'unpack 'disable-broken-tests
2181 (lambda _
2182 (substitute* "sourceTest/java/ch/systemsx/cisd/base/AllTests.java"
2183 (("Unix.isOperational\\(\\)") "false"))
2184 #t))
2185 ;; These decorators are almost useless and pull in an unpackaged
2186 ;; dependency.
2187 (add-after 'unpack 'remove-useless-decorators
2188 (lambda _
2189 (substitute* "source/java/ch/systemsx/cisd/base/unix/Unix.java"
2190 (("@Private") "")
2191 (("import ch.rinn.restrictions.Private;") ""))
2192 (substitute* "sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java"
2193 (("@Friend.*") "")
2194 (("import ch.rinn.restrictions.Friend;") ""))
2195 #t))
2196 (add-before 'configure 'build-native-code
2197 (lambda* (#:key inputs #:allow-other-keys)
2198 (let ((jdk (assoc-ref inputs "jdk"))
2199 (dir ,(match (%current-system)
2200 ("i686-linux"
2201 "i386-Linux")
2202 ((or "armhf-linux" "aarch64-linux")
2203 "arm-Linux")
2204 ((or "x86_64-linux")
2205 "amd64-Linux")
2206 (_ "unknown-Linux"))))
2207 (with-directory-excursion "source/c"
2208 (invoke "gcc" "-shared" "-O3" "-fPIC" "unix.c"
2209 (string-append "-I" jdk "/include")
2210 (string-append "-I" jdk "/include/linux")
2211 "-o" "libunix.so")
2212 (invoke "gcc" "-shared" "-O3" "-fPIC"
2213 "-DMACHINE_BYTE_ORDER=1"
2214 "copyCommon.c"
2215 "copyByteChar.c"
2216 "copyByteDouble.c"
2217 "copyByteFloat.c"
2218 "copyByteInt.c"
2219 "copyByteLong.c"
2220 "copyByteShort.c"
2221 (string-append "-I" jdk "/include")
2222 (string-append "-I" jdk "/include/linux")
2223 "-o" "libnativedata.so"))
2224 (install-file "source/c/libunix.so"
2225 (string-append "libs/native/unix/" dir))
2226 (install-file "source/c/libnativedata.so"
2227 (string-append "libs/native/nativedata/" dir))
2228 #t)))
2229 ;; In the "check" phase we only build the test executable.
2230 (add-after 'check 'run-tests
2231 (lambda _
2232 (invoke "java" "-jar" "targets/dist/sis-base-test.jar")
2233 (delete-file "targets/dist/sis-base-test.jar")
2234 #t))
2235 (replace 'install (install-jars "targets/dist")))))
2236 (native-inputs
2237 `(("jdk" ,icedtea-8)
2238 ("java-commons-lang" ,java-commons-lang)
2239 ("java-commons-io" ,java-commons-io)
2240 ("java-testng" ,java-testng)
2241 ("build-resources"
2242 ,(origin
2243 (method svn-fetch)
2244 (uri (svn-reference
2245 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2246 "base/tags/release/"
2247 (version-major+minor base-version)
2248 ".x/" base-version
2249 "/build_resources/"))
2250 (revision revision)))
2251 (sha256
2252 (base32
2253 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
2254 (home-page "http://svnsis.ethz.ch")
2255 (synopsis "Utility classes for libraries from ETH Zurich")
2256 (description "This library supplies some utility classes needed for
2257libraries from the SIS division at ETH Zurich like jHDF5.")
2258 ;; The C sources are under a non-copyleft license, which looks like a
2259 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
2260 (license (list license:asl2.0
2261 (license:non-copyleft "file://source/c/COPYING"))))))
2262
04ddca26
RW
2263(define-public java-cisd-args4j
2264 (let ((revision 39162)
2265 (base-version "9.11.2"))
2266 (package
2267 (name "java-cisd-args4j")
2268 (version (string-append base-version "-" (number->string revision)))
2269 (source (origin
2270 (method svn-fetch)
2271 (uri (svn-reference
2272 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2273 "args4j/tags/release/"
2274 (version-major+minor base-version)
2275 ".x/" base-version "/args4j/"))
2276 (revision revision)))
2277 (file-name (string-append "java-cisd-args4j-" version "-checkout"))
2278 (sha256
2279 (base32
2280 "0hhqznjaivq7ips7mkwas78z42s6djsm20rrs7g1zd59rcsakxn2"))))
2281 (build-system ant-build-system)
2282 (arguments
2283 `(#:make-flags '("-file" "build/build.xml")
2284 #:tests? #f ; there are no tests
2285 ;; There are weird build failures with JDK8, such as: "The type
2286 ;; java.io.ObjectInputStream cannot be resolved. It is indirectly
2287 ;; referenced from required .class files"
2288 #:jdk ,icedtea-7
2289 #:modules ((guix build ant-build-system)
2290 (guix build utils)
2291 (guix build java-utils)
2292 (sxml simple)
2293 (sxml transform)
2294 (sxml xpath))
2295 #:phases
2296 (modify-phases %standard-phases
2297 (add-after 'unpack 'unpack-build-resources
2298 (lambda* (#:key inputs #:allow-other-keys)
2299 (mkdir-p "../build_resources")
2300 (invoke "tar" "xf" (assoc-ref inputs "build-resources")
2301 "-C" "../build_resources"
2302 "--strip-components=1")
2303 (mkdir-p "../build_resources/lib")
2304 #t))
2305 (add-after 'unpack-build-resources 'fix-dependencies
2306 (lambda* (#:key inputs #:allow-other-keys)
2307 ;; FIXME: There should be a more convenient abstraction for
2308 ;; editing XML files.
2309 (with-directory-excursion "../build_resources/ant/"
2310 (chmod "build-common.xml" #o664)
2311 (call-with-output-file "build-common.xml.new"
2312 (lambda (port)
2313 (sxml->xml
2314 (pre-post-order
2315 (with-input-from-file "build-common.xml"
2316 (lambda _ (xml->sxml #:trim-whitespace? #t)))
2317 `(;; Remove dependency on classycle and custom ant tasks
2318 (taskdef . ,(lambda (tag . kids)
2319 (let ((name ((sxpath '(name *text*)) kids)))
2320 (if (or (member "build-info" name)
2321 (member "dependency-checker" name)
2322 (member "build-java-subprojects" name)
2323 (member "project-classpath" name))
2324 '() ; skip
2325 `(,tag ,@kids)))))
2326 (typedef . ,(lambda (tag . kids)
2327 (let ((name ((sxpath '(name *text*)) kids)))
2328 (if (member "recursive-jar" name)
2329 '() ; skip
2330 `(,tag ,@kids)))))
2331 (build-java-subprojects . ,(lambda _ '()))
2332 ;; Ignore everything else
2333 (*default* . ,(lambda (tag . kids) `(,tag ,@kids)))
2334 (*text* . ,(lambda (_ txt) txt))))
2335 port)))
2336 (rename-file "build-common.xml.new" "build-common.xml"))
2337 (substitute* "build/build.xml"
2338 (("\\$\\{lib\\}/cisd-base/cisd-base.jar")
2339 (string-append (assoc-ref inputs "java-cisd-base")
2340 "/share/java/sis-base.jar"))
2341 ;; Remove dependency on svn
2342 (("<build-info.*") "")
2343 (("\\$\\{revision.number\\}")
2344 ,(number->string revision))
2345 (("\\$\\{version.number\\}") ,base-version)
2346 ;; Don't use custom ant tasks.
2347 (("recursive-jar") "jar")
2348 (("<project-classpath.*") ""))
2349 #t))
2350 (replace 'install (install-jars "targets/dist")))))
2351 (inputs
2352 `(("java-cisd-base" ,java-cisd-base)))
2353 (native-inputs
2354 `(("ecj" ,java-ecj-3.5)
2355 ("build-resources"
2356 ,(origin
2357 (method svn-fetch)
2358 (uri (svn-reference
2359 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2360 "args4j/tags/release/"
2361 (version-major+minor base-version)
2362 ".x/" base-version
2363 "/build_resources/"))
2364 (revision revision)))
2365 (sha256
2366 (base32
2367 "056cam4k8pll7ass31sy6gwn8g8719njc41yf4l02b0342nilkyf"))
2368 (modules '((guix build utils)))
2369 ;; Delete bundled pre-built jars.
2370 (snippet
2371 '(begin (delete-file-recursively "lib/") #t))))))
2372 (home-page "http://svnsis.ethz.ch")
2373 (synopsis "Command line parser library")
2374 (description "This package provides a parser for command line arguments.")
2375 (license license:asl2.0))))
2376
2f0d0418
RW
2377(define-public java-cisd-jhdf5
2378 (let ((revision 39162)
2379 (base-version "14.12.6"))
2380 (package
2381 (name "java-cisd-jhdf5")
2382 (version (string-append base-version "-" (number->string revision)))
2383 (source (origin
2384 (method svn-fetch)
2385 (uri (svn-reference
2386 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2387 "jhdf5/tags/release/"
2388 (version-major+minor base-version)
2389 ".x/" base-version "/jhdf5/"))
2390 (revision revision)))
2391 (file-name (string-append "java-cisd-jhdf5-" version "-checkout"))
2392 (sha256
2393 (base32
2394 "13i17s2hn0q9drdqvp8csy7770p3hdbh9rp30ihln2ldkfawdmz0"))
2395 (modules '((guix build utils)))
2396 (snippet
2397 '(begin
2398 ;; Delete included gradle jar
2399 (delete-file-recursively "gradle/wrapper")
2400 ;; Delete pre-built native libraries
2401 (delete-file-recursively "libs")
2402 #t))))
2403 (build-system ant-build-system)
2404 (arguments
2405 `(#:make-flags '("-file" "build/build.xml")
2406 #:build-target "jar-all"
2407 #:test-target "jar-test"
2408 #:jdk ,icedtea-8
2409 #:phases
2410 (modify-phases %standard-phases
2411 ;; Don't erase results from the build phase when building tests.
2412 (add-after 'unpack 'separate-test-target-from-clean
2413 (lambda _
2414 (substitute* "build/build.xml"
2415 (("\"jar-test\" depends=\"clean, ")
2416 "\"jar-test\" depends=\""))
2417 #t))
2418 (add-after 'unpack 'unpack-build-resources
2419 (lambda* (#:key inputs #:allow-other-keys)
2420 (copy-recursively (assoc-ref inputs "build-resources")
2421 "../build_resources")
2422 (delete-file-recursively "../build_resources/lib/")
2423 (mkdir-p "../build_resources/lib")
2424 ;; Remove dependency on classycle
2425 (substitute* "../build_resources/ant/build-common.xml"
2426 (("<taskdef name=\"dependency-checker.*") "")
2427 (("classname=\"classycle.*") "")
2428 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
2429 ;; Remove dependency on svn
2430 (substitute* "build/build.xml"
2431 (("<build-info.*") "")
2432 (("\\$\\{revision.number\\}")
2433 ,(number->string revision))
2434 (("\\$\\{version.number\\}") ,base-version))
2435 #t))
2436 (add-after 'unpack-build-resources 'fix-dependencies
2437 (lambda* (#:key inputs #:allow-other-keys)
2438 (substitute* "../build_resources/ant/build-common.xml"
2439 (("../libraries/testng/testng-jdk15.jar")
2440 (string-append (assoc-ref inputs "java-testng")
2441 "/share/java/java-testng.jar")))
2442 (substitute* "build/build.xml"
2443 (("\\$\\{lib\\}/sis-base/sis-base.jar")
2444 (string-append (assoc-ref inputs "java-cisd-base")
2445 "/share/java/sis-base.jar"))
2446 (("\\$\\{lib\\}/cisd-args4j/cisd-args4j.jar")
2447 (string-append (assoc-ref inputs "java-cisd-args4j")
2448 "/share/java/cisd-args4j.jar"))
2449 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
2450 (string-append (assoc-ref inputs "java-commons-lang")
2451 "/share/java/commons-lang-"
2452 ,(package-version java-commons-lang) ".jar"))
2453 (("\\$\\{lib\\}/commons-io/commons-io.jar")
2454 (string-append (assoc-ref inputs "java-commons-io")
2455 "/share/java/commons-io-"
2456 ,(package-version java-commons-io)
2457 "-SNAPSHOT.jar"))
2458 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
2459 (string-append (assoc-ref inputs "java-testng")
2460 "/share/java/java-testng.jar"))
2461 (("\\$\\{lib\\}/junit4/junit.jar")
2462 (string-append (assoc-ref inputs "java-junit")
2463 "/share/java/junit.jar"))
2464 (("\\$\\{lib\\}/jmock/hamcrest/hamcrest-core.jar")
2465 (string-append (assoc-ref inputs "java-hamcrest-core")
2466 "/share/java/hamcrest-core.jar")))
2467 ;; Remove dependency on ch.rinn.restrictions
2468 (with-directory-excursion "source/java/ch/systemsx/cisd/hdf5/"
2469 (substitute* '("BitSetConversionUtils.java"
2470 "HDF5Utils.java")
2471 (("import ch.rinn.restrictions.Private;") "")
2472 (("@Private") "")))
2473 (with-directory-excursion "sourceTest/java/ch/systemsx/cisd/hdf5/"
2474 (substitute* '("BitSetConversionTest.java"
2475 "h5ar/HDF5ArchiverTest.java")
2476 (("import ch.rinn.restrictions.Friend;") "")
2477 (("@Friend.*") ""))
2478 ;; Remove leftovers from removing @Friend
2479 (substitute* "h5ar/HDF5ArchiverTest.java"
2480 (("\\{ HDF5Archiver.class, IdCache.class, LinkRecord.class \\}\\)")
2481 "")))
2482 #t))
2483 (add-before 'configure 'build-native-library
2484 (lambda* (#:key inputs #:allow-other-keys)
2485 (let ((jdk (assoc-ref inputs "jdk"))
2486 (hdf5 (assoc-ref inputs "hdf5"))
2487 (dir ,(match (%current-system)
2488 ("i686-linux"
2489 "i386-Linux")
2490 ((or "armhf-linux" "aarch64-linux")
2491 "arm-Linux")
2492 ((or "x86_64-linux")
2493 "amd64-Linux")
2494 (_ "unknown-Linux"))))
2495 (with-directory-excursion "source/c"
2496 (apply invoke `("gcc" "-shared" "-O3"
2497 "-fPIC"
2498 "-Wl,--exclude-libs,ALL"
2499 ,@(find-files "jhdf5" "\\.c$")
2500 ,@(find-files "hdf-java" "\\.c$")
2501 ,(string-append "-I" hdf5 "/include")
2502 ,(string-append "-I" jdk "/include")
2503 ,(string-append "-I" jdk "/include/linux")
2504 ,(string-append hdf5 "/lib/libhdf5.a")
2505 "-o" "libjhdf5.so" "-lz")))
2506 (install-file "source/c/libjhdf5.so"
2507 (string-append "libs/native/jhdf5/" dir))
2508 #t)))
2509 ;; In the "check" phase we only build the test executable.
2510 (add-after 'check 'run-tests
2511 (lambda _
2512 (invoke "java" "-jar" "targets/dist/sis-jhdf5-test.jar")
2513 (delete-file "targets/dist/sis-jhdf5-test.jar")
2514 #t))
2515 (replace 'install
2516 (install-jars "targets/dist")))))
2517 (inputs
2518 `(("java-cisd-base" ,java-cisd-base)
2519 ("java-cisd-args4j" ,java-cisd-args4j)
2520 ("java-commons-lang" ,java-commons-lang)
2521 ("java-commons-io" ,java-commons-io)
2522 ("hdf5" ,hdf5)
2523 ("zlib" ,zlib)))
2524 (native-inputs
2525 `(("jdk" ,icedtea-8)
2526 ("java-testng" ,java-testng)
2527 ("java-junit" ,java-junit)
2528 ("java-jmock" ,java-jmock)
2529 ("java-hamcrest-core" ,java-hamcrest-core)
2530 ("build-resources"
2531 ,(origin
2532 (method svn-fetch)
2533 (uri (svn-reference
2534 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2535 "jhdf5/tags/release/"
2536 (version-major+minor base-version)
2537 ".x/" base-version
2538 "/build_resources/"))
2539 (revision revision)))
2540 (sha256
2541 (base32
2542 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
2543 (home-page "https://wiki-bsse.ethz.ch/display/JHDF5/")
2544 (synopsis "Java binding for HDF5")
2545 (description "JHDF5 is a high-level API in Java for reading and writing
2546HDF5 files, building on the libraries provided by the HDF Group.")
2547 ;; The C sources are under a non-copyleft license, which looks like a
2548 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
2549 (license (list license:asl2.0
2550 (license:non-copyleft "file://source/c/COPYING"))))))
2551
218d093b
RW
2552(define-public java-classpathx-servletapi
2553 (package
2554 (name "java-classpathx-servletapi")
ae307724 2555 (version "3.0.1")
218d093b
RW
2556 (source (origin
2557 (method url-fetch)
2558 (uri (string-append "mirror://gnu/classpathx/servletapi/"
2559 "servletapi-" version ".tar.gz"))
2560 (sha256
2561 (base32
ae307724 2562 "07d8h051siga2f33fra72hk12sbq1bxa4jifjg0qj0vfazjjff0x"))))
218d093b
RW
2563 (build-system ant-build-system)
2564 (arguments
2565 `(#:tests? #f ; there is no test target
2566 #:build-target "compile"
218d093b 2567 #:make-flags
ae307724 2568 (list "-Dbuild.compiler=javac1.8"
218d093b
RW
2569 (string-append "-Ddist=" (assoc-ref %outputs "out")))
2570 #:phases
2571 (modify-phases %standard-phases
2572 (replace 'install
2573 (lambda* (#:key make-flags #:allow-other-keys)
2574 (zero? (apply system* `("ant" "dist" ,@make-flags))))))))
2575 (home-page "https://www.gnu.org/software/classpathx/")
2576 (synopsis "Java servlet API implementation")
2577 (description "This is the GNU servlet API distribution, part of the
2578ClasspathX project. It provides implementations of version 3.0 of the servlet
2579API and version 2.1 of the Java ServerPages API.")
2580 (license license:gpl3+)))
2581
5490480c
RW
2582(define-public java-swt
2583 (package
2584 (name "java-swt")
8710d4dd 2585 (version "4.7.1a")
5490480c
RW
2586 (source
2587 ;; The types of many variables and procedures differ in the sources
2588 ;; dependent on whether the target architecture is a 32-bit system or a
2589 ;; 64-bit system. Instead of patching the sources on demand in a build
2590 ;; phase we download either the 32-bit archive (which mostly uses "int"
2591 ;; types) or the 64-bit archive (which mostly uses "long" types).
8710d4dd
RW
2592 (let ((hash32 "09q0cbh90d90q3a7dx9430kc4m6bijrkr4lajrmzzvi0jjdpq4v9")
2593 (hash64 "17k5hs75a87ssmc5xhwdfdm2gn4zba0r837l2455za01krnkaa2q")
5490480c
RW
2594 (file32 "x86")
2595 (file64 "x86_64"))
2596 (let-values (((hash file)
2597 (match (or (%current-target-system) (%current-system))
2598 ("x86_64-linux" (values hash64 file64))
2599 (_ (values hash32 file32)))))
2600 (origin
2601 (method url-fetch)
2602 (uri (string-append
8710d4dd
RW
2603 "http://download.eclipse.org/eclipse/downloads/drops4/"
2604 "R-" version "-201710090410/swt-" version
2605 "-gtk-linux-" file ".zip"))
5490480c
RW
2606 (sha256 (base32 hash))))))
2607 (build-system ant-build-system)
2608 (arguments
2609 `(#:jar-name "swt.jar"
8710d4dd 2610 #:jdk ,icedtea-8
5490480c
RW
2611 #:tests? #f ; no "check" target
2612 #:phases
2613 (modify-phases %standard-phases
2614 (replace 'unpack
2615 (lambda* (#:key source #:allow-other-keys)
2616 (and (mkdir "swt")
2617 (zero? (system* "unzip" source "-d" "swt"))
2618 (chdir "swt")
2619 (mkdir "src")
2620 (zero? (system* "unzip" "src.zip" "-d" "src")))))
2621 ;; The classpath contains invalid icecat jars. Since we don't need
2622 ;; anything other than the JDK on the classpath, we can simply unset
2623 ;; it.
2624 (add-after 'configure 'unset-classpath
2625 (lambda _ (unsetenv "CLASSPATH") #t))
2626 (add-before 'build 'build-native
2627 (lambda* (#:key inputs outputs #:allow-other-keys)
2628 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
2629 ;; Build shared libraries. Users of SWT have to set the system
2630 ;; property swt.library.path to the "lib" directory of this
2631 ;; package output.
2632 (mkdir-p lib)
2633 (setenv "OUTPUT_DIR" lib)
2634 (with-directory-excursion "src"
2635 (zero? (system* "bash" "build.sh"))))))
2636 (add-after 'install 'install-native
2637 (lambda* (#:key outputs #:allow-other-keys)
2638 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
2639 (for-each (lambda (file)
2640 (install-file file lib))
2641 (find-files "." "\\.so$"))
2642 #t))))))
2643 (inputs
8710d4dd 2644 `(("gtk" ,gtk+-2)
5490480c
RW
2645 ("libxtst" ,libxtst)
2646 ("libxt" ,libxt)
2647 ("mesa" ,mesa)
2648 ("glu" ,glu)))
2649 (native-inputs
2650 `(("pkg-config" ,pkg-config)
2651 ("unzip" ,unzip)))
2652 (home-page "https://www.eclipse.org/swt/")
2653 (synopsis "Widget toolkit for Java")
2654 (description
2655 "SWT is a widget toolkit for Java designed to provide efficient, portable
2656access to the user-interface facilities of the operating systems on which it
2657is implemented.")
2658 ;; SWT code is licensed under EPL1.0
2659 ;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
2660 ;; Cairo bindings contain code under MPL1.1
2661 ;; XULRunner 1.9 bindings contain code under MPL2.0
2662 (license (list
2663 license:epl1.0
2664 license:mpl1.1
2665 license:mpl2.0
2666 license:lgpl2.1+))))
2667
068e476f
RJ
2668(define-public java-xz
2669 (package
2670 (name "java-xz")
92966847 2671 (version "1.6")
068e476f
RJ
2672 (source (origin
2673 (method url-fetch)
2674 (uri (string-append "http://tukaani.org/xz/xz-java-" version ".zip"))
2675 (sha256
2676 (base32
92966847 2677 "1z3p1ri1gvl07inxn0agx44ck8n7wrzfmvkz8nbq3njn8r9wba8x"))))
068e476f
RJ
2678 (build-system ant-build-system)
2679 (arguments
2680 `(#:tests? #f ; There are no tests to run.
2681 #:jar-name ,(string-append "xz-" version ".jar")
2682 #:phases
2683 (modify-phases %standard-phases
2684 ;; The unpack phase enters the "maven" directory by accident.
2685 (add-after 'unpack 'chdir
2686 (lambda _ (chdir "..") #t)))))
2687 (native-inputs
2688 `(("unzip" ,unzip)))
d6ddc5ab 2689 (home-page "https://tukaani.org/xz/java.html")
068e476f
RJ
2690 (synopsis "Implementation of XZ data compression in pure Java")
2691 (description "This library aims to be a complete implementation of XZ data
2692compression in pure Java. Single-threaded streamed compression and
2693decompression and random access decompression have been fully implemented.")
2694 (license license:public-domain)))
04100c3b
RW
2695
2696;; java-hamcrest-core uses qdox version 1.12. We package this version instead
2697;; of the latest release.
2698(define-public java-qdox-1.12
2699 (package
2700 (name "java-qdox")
2701 (version "1.12.1")
2702 (source (origin
2703 (method url-fetch)
2704 (uri (string-append "http://central.maven.org/maven2/"
2705 "com/thoughtworks/qdox/qdox/" version
2706 "/qdox-" version "-sources.jar"))
2707 (sha256
2708 (base32
2709 "0hlfbqq2avf5s26wxkksqmkdyk6zp9ggqn37c468m96mjv0n9xfl"))))
2710 (build-system ant-build-system)
2711 (arguments
2712 `(;; Tests require junit
2713 #:tests? #f
2714 #:jar-name "qdox.jar"
2715 #:phases
2716 (modify-phases %standard-phases
2717 (replace 'unpack
2718 (lambda* (#:key source #:allow-other-keys)
2719 (mkdir "src")
2720 (with-directory-excursion "src"
2721 (zero? (system* "jar" "-xf" source)))))
2722 ;; At this point we don't have junit, so we must remove the API
2723 ;; tests.
2724 (add-after 'unpack 'delete-tests
2725 (lambda _
2726 (delete-file-recursively "src/com/thoughtworks/qdox/junit")
2727 #t)))))
2728 (home-page "http://qdox.codehaus.org/")
2729 (synopsis "Parse definitions from Java source files")
2730 (description
2731 "QDox is a high speed, small footprint parser for extracting
2732class/interface/method definitions from source files complete with JavaDoc
b13cf17f 2733@code{@@tags}. It is designed to be used by active code generators or
04100c3b
RW
2734documentation tools.")
2735 (license license:asl2.0)))
e7e28510
RW
2736
2737(define-public java-jarjar
2738 (package
2739 (name "java-jarjar")
2740 (version "1.4")
2741 (source (origin
2742 (method url-fetch)
2743 (uri (string-append
2744 "https://storage.googleapis.com/google-code-archive-downloads/v2/"
2745 "code.google.com/jarjar/jarjar-src-" version ".zip"))
2746 (sha256
2747 (base32
2748 "1v8irhni9cndcw1l1wxqgry013s2kpj0qqn57lj2ji28xjq8ndjl"))))
2749 (build-system ant-build-system)
2750 (arguments
2751 `(;; Tests require junit, which ultimately depends on this package.
2752 #:tests? #f
2753 #:build-target "jar"
2754 #:phases
2755 (modify-phases %standard-phases
2756 (replace 'install
2757 (lambda* (#:key outputs #:allow-other-keys)
2758 (let ((target (string-append (assoc-ref outputs "out")
2759 "/share/java")))
2760 (install-file (string-append "dist/jarjar-" ,version ".jar")
2761 target))
2762 #t)))))
2763 (native-inputs
2764 `(("unzip" ,unzip)))
2765 (home-page "https://code.google.com/archive/p/jarjar/")
2766 (synopsis "Repackage Java libraries")
2767 (description
2768 "Jar Jar Links is a utility that makes it easy to repackage Java
2769libraries and embed them into your own distribution. Jar Jar Links includes
2770an Ant task that extends the built-in @code{jar} task.")
2771 (license license:asl2.0)))
87c31a21
RW
2772
2773(define-public java-hamcrest-core
2774 (package
2775 (name "java-hamcrest-core")
2776 (version "1.3")
2777 (source (origin
2778 (method url-fetch)
00672896
HG
2779 (uri (string-append "https://github.com/hamcrest/JavaHamcrest/"
2780 "archive/hamcrest-java-" version ".tar.gz"))
87c31a21
RW
2781 (sha256
2782 (base32
00672896 2783 "11g0s105fmwzijbv08lx8jlb521yravjmxnpgdx08fvg1kjivhva"))
87c31a21
RW
2784 (modules '((guix build utils)))
2785 (snippet
2786 '(begin
00672896
HG
2787 ;; Delete bundled thirds-party jar archives.
2788 (delete-file-recursively "lib")
87c31a21
RW
2789 #t))))
2790 (build-system ant-build-system)
2791 (arguments
2792 `(#:tests? #f ; Tests require junit
a8d3cb62
RW
2793 #:modules ((guix build ant-build-system)
2794 (guix build utils)
2795 (srfi srfi-1))
87c31a21 2796 #:make-flags (list (string-append "-Dversion=" ,version))
fae0b4ca 2797 #:test-target "unit-test"
87c31a21
RW
2798 #:build-target "core"
2799 #:phases
2800 (modify-phases %standard-phases
2801 ;; Disable unit tests, because they require junit, which requires
2802 ;; hamcrest-core. We also give a fixed value to the "Built-Date"
2803 ;; attribute from the manifest for reproducibility.
2804 (add-before 'configure 'patch-build.xml
2805 (lambda _
2806 (substitute* "build.xml"
2807 (("unit-test, ") "")
2808 (("\\$\\{build.timestamp\\}") "guix"))
2809 #t))
2810 ;; Java's "getMethods()" returns methods in an unpredictable order.
2811 ;; To make the output of the generated code deterministic we must
2812 ;; sort the array of methods.
2813 (add-after 'unpack 'make-method-order-deterministic
2814 (lambda _
2815 (substitute* "hamcrest-generator/src/main/java/org/hamcrest/generator/ReflectiveFactoryReader.java"
2816 (("import java\\.util\\.Iterator;" line)
2817 (string-append line "\n"
2818 "import java.util.Arrays; import java.util.Comparator;"))
2819 (("allMethods = cls\\.getMethods\\(\\);" line)
2820 (string-append "_" line
2821 "
2822private Method[] getSortedMethods() {
2823 Arrays.sort(_allMethods, new Comparator<Method>() {
2824 @Override
2825 public int compare(Method a, Method b) {
2826 return a.toString().compareTo(b.toString());
2827 }
2828 });
2829 return _allMethods;
2830}
2831
2832private Method[] allMethods = getSortedMethods();")))))
2833 (add-before 'build 'do-not-use-bundled-qdox
2834 (lambda* (#:key inputs #:allow-other-keys)
2835 (substitute* "build.xml"
2836 (("lib/generator/qdox-1.12.jar")
2837 (string-append (assoc-ref inputs "java-qdox-1.12")
2838 "/share/java/qdox.jar")))
2839 #t))
fab959d3
HG
2840 ;; build.xml searches for .jar files in this directoy, which
2841 ;; we remove from the source archive.
2842 (add-before 'build 'create-dummy-directories
2843 (lambda _
2844 (mkdir-p "lib/integration")
2845 #t))
87c31a21
RW
2846 (replace 'install
2847 (lambda* (#:key outputs #:allow-other-keys)
a8d3cb62
RW
2848 (let* ((target (string-append (assoc-ref outputs "out")
2849 "/share/java/"))
2850 (version-suffix ,(string-append "-" version ".jar"))
2851 (install-without-version-suffix
2852 (lambda (jar)
2853 (copy-file jar
2854 (string-append target
2855 (basename jar version-suffix)
2856 ".jar")))))
2857 (mkdir-p target)
2858 (for-each
2859 install-without-version-suffix
2860 (find-files "build"
2861 (lambda (name _)
2862 (and (string-suffix? ".jar" name)
2863 (not (string-suffix? "-sources.jar" name)))))))
2864 #t)))))
87c31a21
RW
2865 (native-inputs
2866 `(("java-qdox-1.12" ,java-qdox-1.12)
2867 ("java-jarjar" ,java-jarjar)))
2868 (home-page "http://hamcrest.org/")
2869 (synopsis "Library of matchers for building test expressions")
2870 (description
2871 "This package provides a library of matcher objects (also known as
2872constraints or predicates) allowing @code{match} rules to be defined
2873declaratively, to be used in other frameworks. Typical scenarios include
2874testing frameworks, mocking libraries and UI validation rules.")
2875 (license license:bsd-2)))
d0184f44
RW
2876
2877(define-public java-junit
2878 (package
2879 (name "java-junit")
2880 (version "4.12")
2881 (source (origin
2882 (method url-fetch)
2883 (uri (string-append "https://github.com/junit-team/junit/"
2884 "archive/r" version ".tar.gz"))
2885 (file-name (string-append name "-" version ".tar.gz"))
2886 (sha256
2887 (base32
2888 "090dn5v1vs0b3acyaqc0gjf6p8lmd2h24wfzsbq7sly6b214anws"))
2889 (modules '((guix build utils)))
2890 (snippet
2891 '(begin
2892 ;; Delete bundled jar archives.
2893 (delete-file-recursively "lib")
2894 #t))))
2895 (build-system ant-build-system)
2896 (arguments
2897 `(#:tests? #f ; no tests
2898 #:jar-name "junit.jar"))
2899 (inputs
2900 `(("java-hamcrest-core" ,java-hamcrest-core)))
2901 (home-page "http://junit.org/")
2902 (synopsis "Test framework for Java")
2903 (description
2904 "JUnit is a simple framework to write repeatable tests for Java projects.
2905JUnit provides assertions for testing expected results, test fixtures for
2906sharing common test data, and test runners for running tests.")
2907 (license license:epl1.0)))
9fb20d01
RW
2908
2909(define-public java-plexus-utils
2910 (package
2911 (name "java-plexus-utils")
2912 (version "3.0.24")
2913 (source (origin
2914 (method url-fetch)
2915 (uri (string-append "https://github.com/codehaus-plexus/"
2916 "plexus-utils/archive/plexus-utils-"
2917 version ".tar.gz"))
2918 (sha256
2919 (base32
2920 "1mlwpc6fms24slygv5yvi6fi9hcha2fh0v73p5znpi78bg36i2js"))))
2921 (build-system ant-build-system)
2922 ;; FIXME: The default build.xml does not include a target to install
2923 ;; javadoc files.
2924 (arguments
2925 `(#:jar-name "plexus-utils.jar"
2926 #:source-dir "src/main"
2927 #:phases
2928 (modify-phases %standard-phases
2929 (add-after 'unpack 'fix-reference-to-/bin-and-/usr
2930 (lambda _
2931 (substitute* "src/main/java/org/codehaus/plexus/util/\
2932cli/shell/BourneShell.java"
2933 (("/bin/sh") (which "sh"))
2934 (("/usr/") (getcwd)))
2935 #t))
2936 (add-after 'unpack 'fix-or-disable-broken-tests
2937 (lambda _
2938 (with-directory-excursion "src/test/java/org/codehaus/plexus/util"
2939 (substitute* '("cli/CommandlineTest.java"
2940 "cli/shell/BourneShellTest.java")
2941 (("/bin/sh") (which "sh"))
2942 (("/bin/echo") (which "echo")))
2943
2944 ;; This test depends on MavenProjectStub, but we don't have
2945 ;; a package for Maven.
2946 (delete-file "introspection/ReflectionValueExtractorTest.java")
2947
2948 ;; FIXME: The command line tests fail, maybe because they use
2949 ;; absolute paths.
2950 (delete-file "cli/CommandlineTest.java"))
2951 #t)))))
2952 (native-inputs
2953 `(("java-junit" ,java-junit)))
2954 (home-page "http://codehaus-plexus.github.io/plexus-utils/")
2955 (synopsis "Common utilities for the Plexus framework")
2956 (description "This package provides various Java utility classes for the
2957Plexus framework to ease working with strings, files, command lines, XML and
2958more.")
2959 (license license:asl2.0)))
1e555562
HG
2960
2961(define-public java-plexus-interpolation
2962 (package
2963 (name "java-plexus-interpolation")
2964 (version "1.23")
2965 (source (origin
2966 (method url-fetch)
2967 (uri (string-append "https://github.com/codehaus-plexus/"
2968 "plexus-interpolation/archive/"
2969 "plexus-interpolation-" version ".tar.gz"))
2970 (sha256
2971 (base32
fd75eb6c 2972 "03377yzlx5q440m6sxxgv6a5qb8fl30zzcgxgc0hxk5qgl2z1jjn"))))
1e555562
HG
2973 (build-system ant-build-system)
2974 (arguments
2975 `(#:jar-name "plexus-interpolation.jar"
2976 #:source-dir "src/main"))
2977 (native-inputs
2978 `(("java-junit" ,java-junit)
2979 ("java-hamcrest-core" ,java-hamcrest-core)))
2980 (home-page "http://codehaus-plexus.github.io/plexus-interpolation/")
2981 (synopsis "Java components for interpolating ${} strings and the like")
2982 (description "Plexus interpolator is a modular, flexible interpolation
2983framework for the expression language style commonly seen in Maven, Plexus,
2984and other related projects.
2985
2986It has its foundation in the @code{org.codehaus.plexus.utils.interpolation}
2987package within @code{plexus-utils}, but has been separated in order to allow
2988these two libraries to vary independently of one another.")
2989 (license license:asl2.0)))
8f8ed9aa 2990
bb27eb0d
JL
2991(define-public java-plexus-classworlds
2992 (package
2993 (name "java-plexus-classworlds")
2994 (version "2.5.2")
2995 (source (origin
2996 (method url-fetch)
2997 (uri (string-append "https://github.com/codehaus-plexus/"
2998 "plexus-classworlds/archive/plexus-classworlds-"
2999 version ".tar.gz"))
3000 (sha256
3001 (base32
3002 "1qm4p0rl8d82lzhsiwnviw11jnq44s0gflg78zq152xyyr2xmh8g"))))
3003 (build-system ant-build-system)
3004 (arguments
3005 `(#:jar-name "plexus-classworlds.jar"
3006 #:source-dir "src/main"
3007 #:tests? #f));; FIXME: we need to generate some resources as in pom.xml
3008 (native-inputs
3009 `(("java-junit" ,java-junit)))
3010 (home-page "http://codehaus-plexus.github.io/plexus-classworlds/")
3011 (synopsis "Java class loader framework")
f4548394
TGR
3012 (description "Plexus classworlds replaces the native @code{ClassLoader}
3013mechanism of Java. It is especially useful for dynamic loading of application
bb27eb0d
JL
3014components.")
3015 (license license:asl2.0)))
3016
a7ad92ad 3017(define java-plexus-container-default-bootstrap
0726d4ea
JL
3018 (package
3019 (name "java-plexus-container-default-bootstrap")
3020 (version "1.7.1")
3021 (source (origin
3022 (method url-fetch)
3023 (uri (string-append "https://github.com/codehaus-plexus/plexus-containers"
3024 "/archive/plexus-containers-" version ".tar.gz"))
3025 (sha256
3026 (base32
3027 "0xw5g30qf4a83608rw9v2hv8pfsz7d69dkdhk6r0wia4q78hh1pc"))))
3028 (build-system ant-build-system)
3029 (arguments
3030 `(#:jar-name "container-default.jar"
3031 #:source-dir "plexus-container-default/src/main/java"
3032 #:test-dir "plexus-container-default/src/test"
3033 #:jdk ,icedtea-8
3034 #:tests? #f; requires plexus-archiver, which depends on this package
3035 #:phases
3036 (modify-phases %standard-phases
3037 (add-before 'build 'copy-resources
3038 (lambda _
3039 (copy-recursively
3040 "plexus-container-default/src/main/resources/"
3041 "build/classes")
3042 #t)))))
3043 (inputs
3044 `(("worldclass" ,java-plexus-classworlds)
3045 ("xbean" ,java-geronimo-xbean-reflect)
3046 ("utils" ,java-plexus-utils)
3047 ("junit" ,java-junit)
3048 ("guava" ,java-guava)))
3049 (home-page "https://github.com/codehaus-plexus/plexus-containers")
f4548394 3050 (synopsis "Inversion-of-control container")
0726d4ea 3051 (description "Plexus-default-container is Plexus' inversion-of-control
f4548394 3052(@dfn{IoC}) container. It is composed of its public API and its default
0726d4ea
JL
3053implementation.")
3054 (license license:asl2.0)))
3055
0858b9dc
JL
3056(define-public java-plexus-io
3057 (package
3058 (name "java-plexus-io")
3059 (version "3.0.0")
3060 (source (origin
3061 (method url-fetch)
3062 (uri (string-append "https://github.com/codehaus-plexus/plexus-io"
3063 "/archive/plexus-io-" version ".tar.gz"))
3064 (sha256
3065 (base32
3066 "0f2j41kihaymxkpbm55smpxjja235vad8cgz94frfy3ppcp021dw"))))
3067 (build-system ant-build-system)
3068 (arguments
3069 `(#:jar-name "plexus-io.jar"
3070 #:source-dir "src/main/java"
3071 #:test-dir "src/test"
3072 #:jdk ,icedtea-8
3073 #:phases
3074 (modify-phases %standard-phases
3075 (add-before 'build 'copy-resources
3076 (lambda _
3077 (mkdir-p "build/classes/META-INF/plexus")
3078 (copy-file "src/main/resources/META-INF/plexus/components.xml"
3079 "build/classes/META-INF/plexus/components.xml")
3080 #t)))))
3081 (inputs
3082 `(("utils" ,java-plexus-utils)
3083 ("commons-io" ,java-commons-io)
3084 ("java-jsr305" ,java-jsr305)))
3085 (native-inputs
3086 `(("junit" ,java-junit)
3087 ("hamcrest" ,java-hamcrest-core)
3088 ("guava" ,java-guava)
3089 ("classworlds" ,java-plexus-classworlds)
3090 ("xbean" ,java-geronimo-xbean-reflect)
3091 ("container-default" ,java-plexus-container-default-bootstrap)))
3092 (home-page "https://github.com/codehaus-plexus/plexus-io")
3093 (synopsis "I/O plexus components")
3094 (description "Plexus IO is a set of plexus components, which are designed
3095for use in I/O operations. This implementation using plexus components allows
3096reusing it in maven.")
3097 (license license:asl2.0)))
3098
b51df3ca
JL
3099(define-public java-plexus-archiver
3100 (package
3101 (name "java-plexus-archiver")
3102 (version "3.5")
3103 (source (origin
3104 (method url-fetch)
3105 (uri (string-append "https://github.com/codehaus-plexus/plexus-archiver"
3106 "/archive/plexus-archiver-" version ".tar.gz"))
3107 (sha256
3108 (base32
3109 "0iv1j7khra6icqh3jndng3iipfmkc7l5jq2y802cm8r575v75pyv"))))
3110 (build-system ant-build-system)
3111 (arguments
3112 `(#:jar-name "plexus-archiver.jar"
3113 #:source-dir "src/main/java"
3114 #:jdk ,icedtea-8
3115 #:test-dir "src/test"
3116 #:test-exclude (list "**/Abstract*.java" "**/Base*.java")
3117 #:phases
3118 (modify-phases %standard-phases
3119 (add-before 'check 'remove-failing
3120 (lambda _
3121 ;; Requires an older version of plexus container
3122 (delete-file
3123 "src/test/java/org/codehaus/plexus/archiver/DuplicateFilesTest.java")))
3124 (add-before 'build 'copy-resources
3125 (lambda _
3126 (mkdir-p "build/classes/META-INF/plexus")
3127 (copy-file "src/main/resources/META-INF/plexus/components.xml"
3128 "build/classes/META-INF/plexus/components.xml")
3129 #t)))))
3130 (inputs
3131 `(("utils" ,java-plexus-utils)
3132 ("commons-io" ,java-commons-io)
3133 ("snappy" ,java-iq80-snappy)
3134 ("io" ,java-plexus-io)
3135 ("compress" ,java-commons-compress)
3136 ("container-default" ,java-plexus-container-default-bootstrap)
3137 ("snappy" ,java-snappy)
3138 ("java-jsr305" ,java-jsr305)))
3139 (native-inputs
3140 `(("junit" ,java-junit)
3141 ("classworld" ,java-plexus-classworlds)
3142 ("xbean" ,java-geronimo-xbean-reflect)
3143 ("xz" ,java-tukaani-xz)
3144 ("guava" ,java-guava)))
3145 (home-page "https://github.com/codehaus-plexus/plexus-archiver")
3146 (synopsis "Archiver component of the Plexus project")
3147 (description "Plexus-archiver contains a component to deal with project
3148archives (jar).")
3149 (license license:asl2.0)))
3150
a0837294
JL
3151(define-public java-plexus-container-default
3152 (package
3153 (inherit java-plexus-container-default-bootstrap)
3154 (name "java-plexus-container-default")
3155 (arguments
3156 `(#:jar-name "container-default.jar"
3157 #:source-dir "plexus-container-default/src/main/java"
3158 #:test-dir "plexus-container-default/src/test"
3159 #:test-exclude (list ;"**/*Test.java"
3160 "**/Abstract*.java"
3161 ;; Requires plexus-hierarchy
3162 "**/PlexusHierarchyTest.java"
3163 ;; Failures
3164 "**/ComponentRealmCompositionTest.java"
3165 "**/PlexusContainerTest.java")
3166 #:jdk ,icedtea-8
3167 #:phases
3168 (modify-phases %standard-phases
3169 (add-before 'build 'copy-resources
3170 (lambda _
3171 (copy-recursively
3172 "plexus-container-default/src/main/resources/"
3173 "build/classes")
3174 #t))
3175 (add-before 'check 'fix-paths
3176 (lambda _
3177 (let ((dir "plexus-container-default/src/test/java/org/codehaus"))
3178 (substitute*
3179 (string-append
3180 dir "/plexus/component/composition/"
3181 "ComponentRealmCompositionTest.java")
3182 (("src/test") "plexus-container-default/src/test"))
3183 #t))))))
3184 (inputs
3185 `(("worldclass" ,java-plexus-classworlds)
3186 ("xbean" ,java-geronimo-xbean-reflect)
3187 ("utils" ,java-plexus-utils)
3188 ("junit" ,java-junit)
3189 ("guava" ,java-guava)))
3190 (native-inputs
3191 `(("archiver" ,java-plexus-archiver)
3192 ("hamcrest" ,java-hamcrest-core)))))
3193
3214afab
JL
3194(define-public java-plexus-component-annotations
3195 (package
3196 (inherit java-plexus-container-default)
3197 (name "java-plexus-component-annotations")
3198 (arguments
3199 `(#:jar-name "plexus-component-annotations.jar"
3200 #:source-dir "plexus-component-annotations/src/main/java"
3201 #:tests? #f)); no tests
3202 (inputs '())
3203 (native-inputs '())
3204 (synopsis "Plexus descriptors generator")
3205 (description "This package is a Maven plugin to generate Plexus descriptors
3206from source tags and class annotations.")))
3207
4f77ba17
JL
3208(define-public java-plexus-cipher
3209 (package
3210 (name "java-plexus-cipher")
3211 (version "1.7")
3212 (source (origin
3213 (method url-fetch)
3214 (uri (string-append "https://github.com/codehaus-plexus/plexus-cipher"
3215 "/archive/plexus-cipher-" version ".tar.gz"))
3216 (sha256
3217 (base32
3218 "1j3r8xzlxlk340snkjp6lk2ilkxlkn8qavsfiq01f43xmvv8ymk3"))))
3219 (build-system ant-build-system)
3220 (arguments
3221 `(#:jar-name "plexus-cipher.jar"
3222 #:source-dir "src/main/java"
3223 #:jdk ,icedtea-8
3224 #:tests? #f; FIXME: requires sisu-inject-bean
3225 #:phases
3226 (modify-phases %standard-phases
3227 (add-before 'build 'copy-resources
3228 (lambda _
3229 (copy-recursively "src/main/resources" "build/classes")
3230 (mkdir-p "build/classes/META-INF/sisu")
3231 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
3232 (lambda _
3233 (display "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
3234 #t)))))
3235 (inputs
3236 `(("java-cdi-api" ,java-cdi-api)
3237 ("java-javax-inject" ,java-javax-inject)))
3238 (home-page "https://github.com/sonatype/plexus-cipher")
3239 (synopsis "Encryption/decryption Component")
3240 (description "Plexus-cipher contains a component to deal with encryption
3241and decryption.")
3242 (license license:asl2.0)))
3243
239126d4
JL
3244(define-public java-plexus-compiler-api
3245 (package
3246 (name "java-plexus-compiler-api")
3247 (version "2.8.2")
3248 (source (origin
3249 (method url-fetch)
3250 (uri (string-append "https://github.com/codehaus-plexus/plexus-compiler"
3251 "/archive/plexus-compiler-" version ".tar.gz"))
3252 (sha256
3253 (base32
3254 "0g3x26pymcdnfnwv2a1i57pd5s26f5zqfi1rdy98z1bn01klx25k"))))
3255 (build-system ant-build-system)
3256 (arguments
3257 `(#:jar-name "plexus-compiler-api.jar"
3258 #:source-dir "plexus-compiler-api/src/main/java"
3259 #:jdk ,icedtea-8
3260 #:test-dir "plexus-compiler-api/src/test"))
3261 (inputs
3262 `(("java-plexus-container-default" ,java-plexus-container-default)
3263 ("java-plexus-util" ,java-plexus-utils)))
3264 (native-inputs
3265 `(("java-junit" ,java-junit)))
3266 (home-page "https://github.com/codehaus-plexus/plexus-compiler")
3267 (synopsis "Plexus Compilers component's API to manipulate compilers")
3268 (description "This package contains the API used by components to manipulate
3269compilers.")
3270 (license (list license:asl2.0
3271 license:expat))))
3272
f8a519fa
JL
3273(define-public java-plexus-compiler-javac
3274 (package
3275 (inherit java-plexus-compiler-api)
3276 (name "java-plexus-compiler-javac")
3277 (arguments
3278 `(#:jar-name "plexus-compiler-javac.jar"
3279 #:source-dir "plexus-compilers/plexus-compiler-javac/src/main/java"
3280 #:jdk ,icedtea-8
3281 #:tests? #f; depends on compiler-test -> maven-core -> ... -> this package.
3282 #:test-dir "plexus-compilers/plexus-compiler-javac/src/test"))
3283 (inputs
3284 `(("java-plexus-compiler-api" ,java-plexus-compiler-api)
3285 ("java-plexus-utils" ,java-plexus-utils)
3286 ("java-plexus-container-default" ,java-plexus-container-default)))
3287 (native-inputs
3288 `(("java-junit" ,java-junit)))
3289 (synopsis "Javac Compiler support for Plexus Compiler component")
3290 (description "This package contains the Javac Compiler support for Plexus
3291Compiler component.")))
3292
0aa85081
JL
3293(define-public java-plexus-sec-dispatcher
3294 (package
3295 (name "java-plexus-sec-dispatcher")
3296 (version "1.4") ;; Newest release listed at the Maven Central Repository.
3297 (source (origin
3298 ;; This project doesn't tag releases or publish tarballs, so we take
3299 ;; the "prepare release plexus-sec-dispatcher-1.4" git commit.
3300 (method url-fetch)
3301 (uri (string-append "https://github.com/sonatype/plexus-sec-dispatcher/"
3302 "archive/7db8f88048.tar.gz"))
3303 (sha256
3304 (base32
3305 "1smfrk4n7xbrsxpxcp2j4i0j8q86j73w0w6xg7qz83dp6dagdjgp"))
3306 (file-name (string-append name "-" version ".tar.gz"))))
3307 (arguments
3308 `(#:jar-name "plexus-sec-dispatcher.jar"
3309 #:source-dir "src/main/java"
3310 #:jdk ,icedtea-8
3311 #:phases
3312 (modify-phases %standard-phases
3313 (add-before 'build 'generate-models
3314 (lambda* (#:key inputs #:allow-other-keys)
3315 (define (modello-single-mode file version mode)
3316 (zero? (system* "java"
3317 "org.codehaus.modello.ModelloCli"
3318 file mode "src/main/java" version
3319 "false" "true")))
3320 (let ((file "src/main/mdo/settings-security.mdo"))
3321 (and
3322 (modello-single-mode file "1.0.0" "java")
3323 (modello-single-mode file "1.0.0" "xpp3-reader")
3324 (modello-single-mode file "1.0.0" "xpp3-writer")))))
3325 (add-before 'build 'generate-components.xml
3326 (lambda _
3327 (mkdir-p "build/classes/META-INF/plexus")
3328 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
3329 (lambda _
3330 (display
3331 "<component-set>\n
3332 <components>\n
3333 <component>\n
3334 <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role>\n
3335 <role-hint>default</role-hint>\n
3336 <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation>\n
3337 <description></description>\n
3338 <requirements>\n
3339 <requirement>\n
3340 <role>org.sonatype.plexus.components.cipher.PlexusCipher</role>\n
3341 <field-name>_cipher</field-name>\n
3342 </requirement>\n
3343 <requirement>\n
3344 <role>org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor</role>\n
3345 <field-name>_decryptors</field-name>\n
3346 </requirement>\n
3347 </requirements>\n
3348 <configuration>\n
3349 <_configuration-file>~/.settings-security.xml</_configuration-file>\n
3350 </configuration>\n
3351 </component>\n
3352 </components>\n
3353</component-set>\n")))))
3354 (add-before 'check 'fix-paths
3355 (lambda _
3356 (copy-recursively "src/test/resources" "target"))))))
3357 (inputs
3358 `(("java-plexus-cipher" ,java-plexus-cipher)))
3359 (native-inputs
3360 `(("java-modello-core" ,java-modello-core)
3361 ;; for modello:
3362 ("java-plexus-container-default" ,java-plexus-container-default)
3363 ("java-plexus-classworlds" ,java-plexus-classworlds)
3364 ("java-plexus-utils" ,java-plexus-utils)
3365 ("java-guava" ,java-guava)
3366 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
3367 ("java-sisu-build-api" ,java-sisu-build-api)
3368 ;; modello plugins:
3369 ("java-modellop-plugins-java" ,java-modello-plugins-java)
3370 ("java-modellop-plugins-xml" ,java-modello-plugins-xml)
3371 ("java-modellop-plugins-xpp3" ,java-modello-plugins-xpp3)
3372 ;; for tests
3373 ("java-junit" ,java-junit)))
3374 (build-system ant-build-system)
3375 (home-page "https://github.com/sonatype/plexus-sec-dispatcher")
3376 (synopsis "Plexus Security Dispatcher Component")
3377 (description "This package is the Plexus Security Dispatcher Component.
3378This component decrypts a string passed to it.")
3379 (license license:asl2.0)))
3380
8f524749
JL
3381(define-public java-sisu-build-api
3382 (package
3383 (name "java-sisu-build-api")
3384 (version "0.0.7")
3385 (source (origin
3386 (method url-fetch)
3387 (uri (string-append "https://github.com/sonatype/sisu-build-api/"
3388 "archive/plexus-build-api-" version ".tar.gz"))
3389 (sha256
3390 (base32
3391 "1c3rrpma3x634xp2rm2p5iskfhzdyc7qfbhjzr70agrl1jwghgy2"))))
3392 (build-system ant-build-system)
3393 (arguments
3394 `(#:jar-name "sisu-build-api.jar"
3395 #:source-dir "src/main/java"
3396 #:jdk ,icedtea-8
3397 #:tests? #f; FIXME: how to run the tests?
3398 #:phases
3399 (modify-phases %standard-phases
3400 (add-before 'build 'copy-resources
3401 (lambda _
3402 (copy-recursively "src/main/resources" "build/classes")
3403 (substitute* (find-files "build/classes")
3404 (("\\$\\{project.version\\}") ,version))
3405 #t))
3406 (add-before 'build 'generate-plexus-compontent
3407 (lambda _
3408 (mkdir-p "build/classes/META-INF/plexus")
3409 ;; This file is required for plexus to inject this package.
3410 ;; FIXME: how is it generated?
3411 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
3412 (lambda _
3413 (display
3414 "<component-set>\n
3415 <components>\n
3416 <component>\n
3417 <role>org.sonatype.plexus.build.incremental.BuildContext</role>\n
3418 <role-hint>default</role-hint>\n
3419 <implementation>org.sonatype.plexus.build.incremental.DefaultBuildContext</implementation>\n
3420 <description>Filesystem based non-incremental build context implementation\n
3421which behaves as if all files were just created.</description>\n
3422 </component>\n
3423 </components>\n
3424</component-set>\n")))
3425 #t)))))
3426 (inputs
3427 `(("java-plexus-utils" ,java-plexus-utils)
3428 ("java-plexus-container-default" ,java-plexus-container-default)))
3429 (home-page "https://github.com/sonatype/sisu-build-api/")
3430 (synopsis "Base build API for maven")
3431 (description "This package contains the base build API for maven and
3432a default implementation of it. This API is about scanning files in a
3433project and determining what files need to be rebuilt.")
3434 (license license:asl2.0)))
3435
b26c8b61
JL
3436(define-public java-modello-core
3437 (package
3438 (name "java-modello-core")
3439 (version "1.9.1")
3440 (source (origin
3441 (method url-fetch)
3442 (uri (string-append "https://github.com/codehaus-plexus/modello"
3443 "/archive/modello-" version ".tar.gz"))
3444 (sha256
3445 (base32
3446 "0l2pvns8pmlrmjm3iknp7gpg3654y1m8qhy55b19sdwdchdcyxfh"))))
3447 (build-system ant-build-system)
3448 (arguments
3449 `(#:jar-name "modello-core.jar"
3450 #:source-dir "modello-core/src/main/java"
3451 #:test-dir "modello-core/src/test"
3452 #:main-class "org.codehaus.modello.ModelloCli"
3453 #:jdk ,icedtea-8
3454 #:phases
3455 (modify-phases %standard-phases
3456 (add-before 'build 'copy-resources
3457 (lambda _
3458 (mkdir-p "build/classes/META-INF/plexus")
3459 (copy-file "modello-core/src/main/resources/META-INF/plexus/components.xml"
3460 "build/classes/META-INF/plexus/components.xml")
3461 #t))
3462 (add-before 'check 'fix-tests
3463 (lambda _
3464 (with-directory-excursion "modello-core/src/test/java/org/codehaus"
3465 (substitute* '("modello/core/DefaultModelloCoreTest.java"
3466 "modello/core/io/ModelReaderTest.java")
3467 (("src/test") "modello-core/src/test")))
3468 #t)))))
3469 (inputs
3470 `(("java-plexus-utils" ,java-plexus-utils)
3471 ("java-plexus-container-default" ,java-plexus-container-default)
3472 ("java-sisu-build-api" ,java-sisu-build-api)))
3473 (native-inputs
3474 `(("java-junit" ,java-junit)
3475 ("java-plexus-classworlds" ,java-plexus-classworlds)
3476 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
3477 ("java-guava" ,java-guava)))
3478 (home-page "http://codehaus-plexus.github.io/modello/")
3479 (synopsis "Framework for code generation from a simple model")
3480 (description "Modello is a framework for code generation from a simple model.
3481
3482Modello generates code from a simple model format: based on a plugin
3483architecture, various types of code and descriptors can be generated from the
3484single model, including Java POJOs, XML/JSON/YAML marshallers/unmarshallers,
3485XSD and documentation.")
3486 (license (list
3487 license:expat
3488 ;; Although this package uses only files licensed under expat,
3489 ;; other parts of the source are licensed under different
3490 ;; licenses. We include them to be inherited by other packages.
3491 license:asl2.0
3492 ;; Some files in modello-plugin-java are licensed under a
3493 ;; 5-clause BSD license.
3494 (license:non-copyleft
3495 (string-append "file:///modello-plugins/modello-plugin-java/"
3496 "src/main/java/org/codehaus/modello/plugin/"
3497 "java/javasource/JNaming.java"))))))
3498
fc620bef
JL
3499(define-public java-modello-plugins-java
3500 (package
3501 (inherit java-modello-core)
3502 (name "java-modello-plugins-java")
3503 (arguments
3504 `(#:jar-name "modello-plugins-java.jar"
3505 #:source-dir "modello-plugins/modello-plugin-java/src/main/java"
3506 #:test-dir "modello-plugins/modello-plugin-java/src/test"
3507 #:jdk ,icedtea-8
3508 #:tests? #f; requires maven-model, which depends on this package
3509 #:phases
3510 (modify-phases %standard-phases
3511 (add-before 'build 'copy-resources
3512 (lambda _
3513 (mkdir-p "build/classes")
3514 (copy-recursively "modello-plugins/modello-plugin-java/src/main/resources"
3515 "build/classes")
3516 #t)))))
3517 (inputs
3518 `(("java-modello-core" ,java-modello-core)
3519 ,@(package-inputs java-modello-core)))
3520 (synopsis "Modello Java Plugin")
3521 (description "Modello Java Plugin generates Java objects for the model.")))
3522
a0ce95ba
JL
3523(define-public java-modello-plugins-xml
3524 (package
3525 (inherit java-modello-core)
3526 (name "java-modello-plugins-xml")
3527 (arguments
3528 `(#:jar-name "modello-plugins-xml.jar"
3529 #:source-dir "modello-plugins/modello-plugin-xml/src/main/java"
3530 #:test-dir "modello-plugins/modello-plugin-xml/src/test"
3531 #:jdk ,icedtea-8
3532 #:phases
3533 (modify-phases %standard-phases
3534 (add-before 'build 'copy-resources
3535 (lambda _
3536 (mkdir-p "build/classes")
3537 (copy-recursively
3538 "modello-plugins/modello-plugin-xml/src/main/resources"
3539 "build/classes")
3540 #t))
3541 (add-before 'check 'fix-paths
3542 (lambda _
3543 (with-directory-excursion "modello-plugins/modello-plugin-xml/src/test"
3544 (substitute*
3545 "java/org/codehaus/modello/plugins/xml/XmlModelloPluginTest.java"
3546 (("src/test") "modello-plugins/modello-plugin-xml/src/test"))))))))
3547 (inputs
3548 `(("java-modello-core" ,java-modello-core)
3549 ("java-modello-plugins-java" ,java-modello-plugins-java)
3550 ,@(package-inputs java-modello-core)))
3551 (synopsis "Modello XML Plugin")
3552 (description "Modello XML Plugin contains shared code for every plugins
3553working on XML representation of the model.")))
3554
e4708560
JL
3555(define-public java-modello-test
3556 (package
3557 (inherit java-modello-core)
3558 (name "java-modello-test")
3559 (arguments
3560 `(#:jar-name "modello-test.jar"
3561 #:source-dir "modello-test/src/main/java"
3562 #:tests? #f; no tests
3563 #:jdk ,icedtea-8))
3564 (inputs
3565 `(("java-plexus-utils" ,java-plexus-utils)
3566 ("java-plexus-compiler-api" ,java-plexus-compiler-api)
3567 ("java-plexus-compiler-javac" ,java-plexus-compiler-javac)
3568 ("java-plexus-container-default" ,java-plexus-container-default)))
3569 (synopsis "Modello test package")
3570 (description "The modello test package contains the basis to create
3571Modello generator unit-tests, including sample models and xml files to test
3572every feature for every plugin.")))
3573
36607d3b
JL
3574(define-public java-modello-plugins-xpp3
3575 (package
3576 (inherit java-modello-core)
3577 (name "java-modello-plugins-xpp3")
3578 (arguments
3579 `(#:jar-name "modello-plugins-xpp3.jar"
3580 #:source-dir "modello-plugins/modello-plugin-xpp3/src/main/java"
3581 #:test-dir "modello-plugins/modello-plugin-xpp3/src/test"
3582 ;; One of the test dependencies is maven-model which depends on this package.
3583 #:tests? #f
3584 #:jdk ,icedtea-8
3585 #:phases
3586 (modify-phases %standard-phases
3587 (add-before 'build 'copy-resources
3588 (lambda _
3589 (mkdir-p "build/classes")
3590 (copy-recursively "modello-plugins/modello-plugin-xpp3/src/main/resources"
3591 "build/classes")
3592 #t)))))
3593 (inputs
3594 `(("java-modello-core" ,java-modello-core)
3595 ("java-modello-plugins-java" ,java-modello-plugins-java)
3596 ("java-modello-plugins-xml" ,java-modello-plugins-xml)
3597 ,@(package-inputs java-modello-core)))
3598 (native-inputs
3599 `(("java-xmlunit" ,java-xmlunit)
3600 ("java-modello-test" ,java-modello-test)
3601 ,@(package-native-inputs java-modello-core)))
3602 (synopsis "Modello XPP3 Plugin")
3603 (description "The modello XPP3 plugin generates XML readers and writers based
3604on the XPP3 API (XML Pull Parser).")))
3605
8f8ed9aa
RW
3606(define-public java-asm
3607 (package
3608 (name "java-asm")
d0e9ded7 3609 (version "6.0")
8f8ed9aa
RW
3610 (source (origin
3611 (method url-fetch)
3612 (uri (string-append "http://download.forge.ow2.org/asm/"
3613 "asm-" version ".tar.gz"))
3614 (sha256
3615 (base32
d0e9ded7 3616 "115l5pqblirdkmzi32dxx7gbcm4jy0s14y5wircr6h8jdr9aix00"))))
8f8ed9aa 3617 (build-system ant-build-system)
d0e9ded7
GB
3618 (propagated-inputs
3619 `(("java-aqute-bndlib" ,java-aqute-bndlib)))
8f8ed9aa
RW
3620 (arguments
3621 `(#:build-target "compile"
3622 ;; The tests require an old version of Janino, which no longer compiles
3623 ;; with the JDK7.
3624 #:tests? #f
d0e9ded7
GB
3625 #:make-flags
3626 (list
3627 ;; We don't need these extra ant tasks, but the build system asks us to
3628 ;; provide a path anyway.
3629 "-Dobjectweb.ant.tasks.path=dummy-path"
3630 ;; The java-aqute.bndlib JAR file will be put onto the classpath and
3631 ;; used during the build automatically by ant-build-system, but
3632 ;; java-asm's build.xml fails unless we provide something here.
3633 "-Dbiz.aQute.bnd.path=dummy-path")
8f8ed9aa
RW
3634 #:phases
3635 (modify-phases %standard-phases
3636 (add-before 'install 'build-jars
3637 (lambda* (#:key make-flags #:allow-other-keys)
3638 ;; We cannot use the "jar" target because it depends on a couple
3639 ;; of unpackaged, complicated tools.
3640 (mkdir "dist")
3641 (zero? (system* "jar"
3642 "-cf" (string-append "dist/asm-" ,version ".jar")
3643 "-C" "output/build/tmp" "."))))
3644 (replace 'install
3645 (install-jars "dist")))))
3646 (native-inputs
3647 `(("java-junit" ,java-junit)))
3648 (home-page "http://asm.ow2.org/")
3649 (synopsis "Very small and fast Java bytecode manipulation framework")
3650 (description "ASM is an all purpose Java bytecode manipulation and
3651analysis framework. It can be used to modify existing classes or dynamically
3652generate classes, directly in binary form. The provided common
3653transformations and analysis algorithms allow to easily assemble custom
3654complex transformations and code analysis tools.")
3655 (license license:bsd-3)))
607fe24a
RW
3656
3657(define-public java-cglib
3658 (package
3659 (name "java-cglib")
3660 (version "3.2.4")
3661 (source (origin
3662 (method url-fetch)
3663 (uri (string-append
3664 "https://github.com/cglib/cglib/archive/RELEASE_"
3665 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
3666 ".tar.gz"))
3667 (file-name (string-append "cglib-" version ".tar.gz"))
3668 (sha256
3669 (base32
3670 "162dvd4fln76ai8prfharf66pn6r56p3sxx683j5vdyccrd5hi1q"))))
3671 (build-system ant-build-system)
3672 (arguments
3673 `(;; FIXME: tests fail because junit runs
3674 ;; "net.sf.cglib.transform.AbstractTransformTest", which does not seem
3675 ;; to describe a test at all.
3676 #:tests? #f
3677 #:jar-name "cglib.jar"
3678 #:phases
3679 (modify-phases %standard-phases
3680 (add-after 'unpack 'chdir
3681 (lambda _ (chdir "cglib") #t)))))
3682 (inputs
3683 `(("java-asm" ,java-asm)
3684 ("java-junit" ,java-junit)))
3685 (home-page "https://github.com/cglib/cglib/")
3686 (synopsis "Java byte code generation library")
3687 (description "The byte code generation library CGLIB is a high level API
3688to generate and transform Java byte code.")
3689 (license license:asl2.0)))
33e34bfe
RW
3690
3691(define-public java-objenesis
3692 (package
3693 (name "java-objenesis")
3694 (version "2.5.1")
3695 (source (origin
3696 (method url-fetch)
3697 (uri (string-append "https://github.com/easymock/objenesis/"
3698 "archive/" version ".tar.gz"))
3699 (file-name (string-append "objenesis-" version ".tar.gz"))
3700 (sha256
3701 (base32
3702 "1va5qz1i2wawwavhnxfzxnfgrcaflz9p1pg03irrjh4nd3rz8wh6"))))
3703 (build-system ant-build-system)
3704 (arguments
3705 `(#:jar-name "objenesis.jar"
3706 #:source-dir "main/src/"
3707 #:test-dir "main/src/test/"))
3708 (native-inputs
3709 `(("java-junit" ,java-junit)
3710 ("java-hamcrest-core" ,java-hamcrest-core)))
3711 (home-page "http://objenesis.org/")
3712 (synopsis "Bypass the constructor when creating an object")
3713 (description "Objenesis is a small Java library that serves one purpose:
3714to instantiate a new object of a particular class. It is common to see
3715restrictions in libraries stating that classes must require a default
3716constructor. Objenesis aims to overcome these restrictions by bypassing the
3717constructor on object instantiation.")
3718 (license license:asl2.0)))
ae589876
RW
3719
3720(define-public java-easymock
3721 (package
3722 (name "java-easymock")
3723 (version "3.4")
3724 (source (origin
3725 (method url-fetch)
3726 (uri (string-append "https://github.com/easymock/easymock/"
3727 "archive/easymock-" version ".tar.gz"))
3728 (sha256
3729 (base32
3730 "1yzg0kv256ndr57gpav46cyv4a1ns5sj722l50zpxk3j6sk9hnmi"))))
3731 (build-system ant-build-system)
3732 (arguments
3733 `(#:jar-name "easymock.jar"
3734 #:source-dir "core/src/main"
3735 #:test-dir "core/src/test"
3736 #:phases
3737 (modify-phases %standard-phases
3738 ;; FIXME: Android support requires the following packages to be
3739 ;; available: com.google.dexmaker.stock.ProxyBuilder
3740 (add-after 'unpack 'delete-android-support
3741 (lambda _
3742 (with-directory-excursion "core/src/main/java/org/easymock/internal"
3743 (substitute* "MocksControl.java"
3744 (("AndroidSupport.isAndroid\\(\\)") "false")
3745 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
3746 (delete-file "AndroidClassProxyFactory.java"))
3747 #t))
3748 (add-after 'unpack 'delete-broken-tests
3749 (lambda _
3750 (with-directory-excursion "core/src/test/java/org/easymock"
3751 ;; This test depends on dexmaker.
3752 (delete-file "tests2/ClassExtensionHelperTest.java")
3753
3754 ;; This is not a test.
3755 (delete-file "tests/BaseEasyMockRunnerTest.java")
3756
3757 ;; This test should be executed with a different runner...
3758 (delete-file "tests2/EasyMockAnnotationsTest.java")
3759 ;; ...but deleting it means that we also have to delete these
3760 ;; dependent files.
3761 (delete-file "tests2/EasyMockRunnerTest.java")
3762 (delete-file "tests2/EasyMockRuleTest.java")
3763
3764 ;; This test fails because the file "easymock.properties" does
3765 ;; not exist.
3766 (delete-file "tests2/EasyMockPropertiesTest.java"))
3767 #t)))))
3768 (inputs
3769 `(("java-asm" ,java-asm)
3770 ("java-cglib" ,java-cglib)
3771 ("java-objenesis" ,java-objenesis)))
3772 (native-inputs
3773 `(("java-junit" ,java-junit)
3774 ("java-hamcrest-core" ,java-hamcrest-core)))
3775 (home-page "http://easymock.org")
3776 (synopsis "Java library providing mock objects for unit tests")
3777 (description "EasyMock is a Java library that provides an easy way to use
3778mock objects in unit testing.")
3779 (license license:asl2.0)))
7aa37023 3780
f12ad6c7
RW
3781(define-public java-jmock-1
3782 (package
3783 (name "java-jmock")
3784 (version "1.2.0")
3785 (source (origin
3786 (method url-fetch)
3787 (uri (string-append "https://github.com/jmock-developers/"
3788 "jmock-library/archive/" version ".tar.gz"))
3789 (file-name (string-append "jmock-" version ".tar.gz"))
3790 (sha256
3791 (base32
3792 "0xmrlhq0fszldkbv281k9463mv496143vvmqwpxp62yzjvdkx9w0"))))
3793 (build-system ant-build-system)
3794 (arguments
3795 `(#:build-target "jars"
3796 #:test-target "run.tests"
3797 #:phases
3798 (modify-phases %standard-phases
3799 (replace 'install (install-jars "build")))))
3800 (home-page "http://www.jmock.org")
3801 (synopsis "Mock object library for test-driven development")
3802 (description "JMock is a library that supports test-driven development of
3803Java code with mock objects. Mock objects help you design and test the
3804interactions between the objects in your programs.
3805
3806The jMock library
3807
3808@itemize
3809@item makes it quick and easy to define mock objects
3810@item lets you precisely specify the interactions between
3811 your objects, reducing the brittleness of your tests
3812@item plugs into your favourite test framework
3813@item is easy to extend.
3814@end itemize\n")
3815 (license license:bsd-3)))
3816
045124ae
JL
3817(define-public java-jmock
3818 (package
3819 (inherit java-jmock-1)
3820 (name "java-jmock")
3821 (version "2.8.2")
3822 (source (origin
3823 (method url-fetch)
3824 (uri (string-append "https://github.com/jmock-developers/"
3825 "jmock-library/archive/" version ".tar.gz"))
3826 (file-name (string-append name "-" version ".tar.gz"))
3827 (sha256
3828 (base32
3829 "18650a9g8xffcsdb6w91pbswa7f40fp2sh6s3nclkclz5dbzq8f0"))))
3830 (inputs
3831 `(("java-hamcrest-all" ,java-hamcrest-all)
3832 ("java-asm" ,java-asm)
3833 ("java-bsh" ,java-bsh)
3834 ("java-junit" ,java-junit)))
3835 (native-inputs
3836 `(("cglib" ,java-cglib)))
3837 (arguments
3838 `(#:jar-name "java-jmock.jar"
3839 #:source-dir "jmock/src/main/java"
3840 #:test-dir "jmock/src/test"))))
3841
25436c6d
JL
3842(define-public java-jmock-junit4
3843 (package
3844 (inherit java-jmock)
3845 (name "java-jmock-junit4")
3846 (arguments
3847 `(#:jar-name "java-jmock-junit4.jar"
3848 #:source-dir "jmock-junit4/src/main/java"
3849 #:test-dir "jmock-junit4/src/test"))
3850 (inputs
3851 `(("java-hamcrest-all" ,java-hamcrest-all)
3852 ("java-asm" ,java-asm)
3853 ("java-bsh" ,java-bsh)
3854 ("java-jmock" ,java-jmock)
3855 ("java-jumit" ,java-junit)))))
3856
e84b899d
JL
3857(define-public java-jmock-legacy
3858 (package
3859 (inherit java-jmock)
3860 (name "java-jmock-legacy")
3861 (arguments
3862 `(#:jar-name "java-jmock-legacy.jar"
3863 #:source-dir "jmock-legacy/src/main/java"
3864 #:test-dir "jmock-legacy/src/test"
3865 #:phases
3866 (modify-phases %standard-phases
3867 (add-before 'check 'copy-tests
3868 (lambda _
3869 ;; This file is a dependancy of some tests
3870 (let ((file "org/jmock/test/acceptance/PackageProtectedType.java"))
3871 (copy-file (string-append "jmock/src/test/java/" file)
3872 (string-append "jmock-legacy/src/test/java/" file))
3873 #t))))))
3874 (inputs
3875 `(("java-hamcrest-all" ,java-hamcrest-all)
3876 ("java-objenesis" ,java-objenesis)
3877 ("java-cglib" ,java-cglib)
3878 ("java-jmock" ,java-jmock)
3879 ("java-asm" ,java-asm)
3880 ("java-bsh" ,java-bsh)
3881 ("java-junit" ,java-junit)))
3882 (native-inputs
3883 `(("java-jmock-junit4" ,java-jmock-junit4)))))
3884
439c59da
RW
3885(define-public java-hamcrest-all
3886 (package (inherit java-hamcrest-core)
3887 (name "java-hamcrest-all")
3888 (arguments
bfc007e1
RW
3889 `(#:jdk ,icedtea-8
3890 ,@(substitute-keyword-arguments (package-arguments java-hamcrest-core)
3891 ((#:build-target _) "bigjar")
3892 ((#:phases phases)
3893 `(modify-phases ,phases
3894 ;; Some build targets override the classpath, so we need to patch
3895 ;; the build.xml to ensure that required dependencies are on the
3896 ;; classpath.
3897 (add-after 'unpack 'patch-classpath-for-integration
3898 (lambda* (#:key inputs #:allow-other-keys)
3899 (substitute* "build.xml"
3900 ((" build/hamcrest-library-\\$\\{version\\}.jar" line)
3901 (string-join
3902 (cons line
3903 (append
3904 (find-files (assoc-ref inputs "java-junit") "\\.jar$")
3905 (find-files (assoc-ref inputs "java-jmock") "\\.jar$")
3906 (find-files (assoc-ref inputs "java-easymock") "\\.jar$")))
3907 ";")))
3908 #t)))))))
439c59da
RW
3909 (inputs
3910 `(("java-junit" ,java-junit)
3911 ("java-jmock" ,java-jmock-1)
3912 ("java-easymock" ,java-easymock)
439c59da
RW
3913 ,@(package-inputs java-hamcrest-core)))))
3914
7aa37023
RW
3915(define-public java-jopt-simple
3916 (package
3917 (name "java-jopt-simple")
3918 (version "5.0.3")
3919 (source (origin
3920 (method url-fetch)
3921 (uri (string-append "http://repo1.maven.org/maven2/"
3922 "net/sf/jopt-simple/jopt-simple/"
3923 version "/jopt-simple-"
3924 version "-sources.jar"))
3925 (sha256
3926 (base32
3927 "1v8bzmwmw6qq20gm42xyay6vrd567dra4vqwhgjnqqjz1gs9f8qa"))))
3928 (build-system ant-build-system)
3929 (arguments
3930 `(#:tests? #f ; there are no tests
3931 #:jar-name "jopt-simple.jar"))
3932 (home-page "https://pholser.github.io/jopt-simple/")
3933 (synopsis "Java library for parsing command line options")
3934 (description "JOpt Simple is a Java library for parsing command line
3935options, such as those you might pass to an invocation of @code{javac}. In
3936the interest of striving for simplicity, as closely as possible JOpt Simple
3937attempts to honor the command line option syntaxes of POSIX @code{getopt} and
3938GNU @code{getopt_long}. It also aims to make option parser configuration and
3939retrieval of options and their arguments simple and expressive, without being
3940overly clever.")
3941 (license license:expat)))
840969e8
RW
3942
3943(define-public java-commons-math3
3944 (package
3945 (name "java-commons-math3")
3946 (version "3.6.1")
3947 (source (origin
3948 (method url-fetch)
3949 (uri (string-append "mirror://apache/commons/math/source/"
3950 "commons-math3-" version "-src.tar.gz"))
3951 (sha256
3952 (base32
3953 "19l6yp44qc5g7wg816nbn5z3zq3xxzwimvbm4a8pczgvpi4i85s6"))))
3954 (build-system ant-build-system)
3955 (arguments
3956 `(#:build-target "jar"
3957 #:test-target "test"
3958 #:make-flags
3959 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
3960 (junit (assoc-ref %build-inputs "java-junit")))
3961 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
3962 (string-append "-Dhamcrest.jar=" hamcrest
3963 "/share/java/hamcrest-core.jar")))
3964 #:phases
3965 (modify-phases %standard-phases
3966 ;; We want to build the jar in the build phase and run the tests
3967 ;; later in a separate phase.
3968 (add-after 'unpack 'untangle-targets
3969 (lambda _
3970 (substitute* "build.xml"
3971 (("name=\"jar\" depends=\"test\"")
3972 "name=\"jar\" depends=\"compile\""))
3973 #t))
3974 ;; There is no install target.
3975 (replace 'install
3976 (install-jars "target")))))
3977 (native-inputs
3978 `(("java-junit" ,java-junit)
3979 ("java-hamcrest-core" ,java-hamcrest-core)))
3980 (home-page "http://commons.apache.org/math/")
3981 (synopsis "Apache Commons mathematics library")
3982 (description "Commons Math is a library of lightweight, self-contained
3983mathematics and statistics components addressing the most common problems not
3984available in the Java programming language or Commons Lang.")
3985 (license license:asl2.0)))
62c9bfaa
RW
3986
3987(define-public java-jmh
3988 (package
3989 (name "java-jmh")
3990 (version "1.17.5")
3991 (source (origin
3992 (method hg-fetch)
3993 (uri (hg-reference
3994 (url "http://hg.openjdk.java.net/code-tools/jmh/")
3995 (changeset version)))
3996 (file-name (string-append name "-" version "-checkout"))
3997 (sha256
3998 (base32
3999 "1fxyxhg9famwcg1prc4cgwb5wzyxqavn3cjm5vz8605xz7x5k084"))))
4000 (build-system ant-build-system)
4001 (arguments
4002 `(#:jar-name "jmh-core.jar"
4003 #:source-dir "jmh-core/src/main"
4004 #:test-dir "jmh-core/src/test"
4005 #:phases
4006 (modify-phases %standard-phases
4007 ;; This seems to be a bug in the JDK. It may not be necessary in
4008 ;; future versions of the JDK.
4009 (add-after 'unpack 'fix-bug
4010 (lambda _
4011 (with-directory-excursion
4012 "jmh-core/src/main/java/org/openjdk/jmh/runner/options"
4013 (substitute* '("IntegerValueConverter.java"
4014 "ThreadsValueConverter.java")
4015 (("public Class<Integer> valueType")
4016 "public Class<? extends Integer> valueType")))
4017 #t)))))
4018 (inputs
4019 `(("java-jopt-simple" ,java-jopt-simple)
4020 ("java-commons-math3" ,java-commons-math3)))
4021 (native-inputs
4022 `(("java-junit" ,java-junit)
4023 ("java-hamcrest-core" ,java-hamcrest-core)))
4024 (home-page "http://openjdk.java.net/projects/code-tools/jmh/")
4025 (synopsis "Benchmark harness for the JVM")
4026 (description "JMH is a Java harness for building, running, and analysing
4027nano/micro/milli/macro benchmarks written in Java and other languages
f4548394 4028targeting the JVM.")
62c9bfaa
RW
4029 ;; GPLv2 only
4030 (license license:gpl2)))
56ebb4e9
RW
4031
4032(define-public java-commons-collections4
4033 (package
4034 (name "java-commons-collections4")
4035 (version "4.1")
4036 (source (origin
4037 (method url-fetch)
4038 (uri (string-append "mirror://apache/commons/collections/source/"
4039 "commons-collections4-" version "-src.tar.gz"))
4040 (sha256
4041 (base32
4042 "1krfhvggympq4avk7gh6qafzf6b9ip6r1m4lmacikyx04039m0wl"))))
4043 (build-system ant-build-system)
4044 (arguments
4045 `(#:test-target "test"
4046 #:make-flags
4047 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
4048 (junit (assoc-ref %build-inputs "java-junit"))
4049 (easymock (assoc-ref %build-inputs "java-easymock")))
4050 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
4051 (string-append "-Dhamcrest.jar=" hamcrest
4052 "/share/java/hamcrest-core.jar")
4053 (string-append "-Deasymock.jar=" easymock
4054 "/share/java/easymock.jar")))
4055 #:phases
4056 (modify-phases %standard-phases
4057 (replace 'install
4058 (install-jars "target")))))
4059 (native-inputs
4060 `(("java-junit" ,java-junit)
4061 ("java-hamcrest-core" ,java-hamcrest-core)
4062 ("java-easymock" ,java-easymock)))
4063 (home-page "http://commons.apache.org/collections/")
4064 (synopsis "Collections framework")
4065 (description "The Java Collections Framework is the recognised standard
4066for collection handling in Java. Commons-Collections seek to build upon the
4067JDK classes by providing new interfaces, implementations and utilities. There
4068are many features, including:
4069
4070@itemize
4071@item @code{Bag} interface for collections that have a number of copies of
4072 each object
4073@item @code{BidiMap} interface for maps that can be looked up from value to
4074 key as well and key to value
4075@item @code{MapIterator} interface to provide simple and quick iteration over
4076 maps
4077@item Transforming decorators that alter each object as it is added to the
4078 collection
4079@item Composite collections that make multiple collections look like one
4080@item Ordered maps and sets that retain the order elements are added in,
4081 including an LRU based map
4082@item Reference map that allows keys and/or values to be garbage collected
4083 under close control
4084@item Many comparator implementations
4085@item Many iterator implementations
4086@item Adapter classes from array and enumerations to collections
4087@item Utilities to test or create typical set-theory properties of collections
4088 such as union, intersection, and closure.
4089@end itemize\n")
4090 (license license:asl2.0)))
6af63e65 4091
229a9864
JL
4092(define-public java-commons-collections
4093 (package
4094 (inherit java-commons-collections4)
4095 (name "java-commons-collections")
4096 (version "3.2.2")
4097 (source (origin
4098 (method url-fetch)
4099 (uri (string-append "mirror://apache/commons/collections/source/"
4100 "commons-collections-" version "-src.tar.gz"))
4101 (sha256
4102 (base32
4103 "055r51a5lfc3z7rkxnxmnn1npvkvda7636hjpm4qk7cnfzz98387"))))
4104 (arguments
4105 (substitute-keyword-arguments (package-arguments java-commons-collections4)
4106 ((#:phases phases)
4107 `(modify-phases ,phases
4108 ;; The manifest is required by the build procedure
4109 (add-before 'build 'add-manifest
4110 (lambda _
4111 (mkdir-p "build/conf")
4112 (call-with-output-file "build/conf/MANIFEST.MF"
4113 (lambda (file)
4114 (format file "Manifest-Version: 1.0\n")))))
4115 (replace 'install
4116 (install-jars "build"))))))))
4117
5aa2f3f4
JL
4118(define java-commons-collections-test-classes
4119 (package
4120 (inherit java-commons-collections)
4121 (arguments
4122 `(#:jar-name "commons-collections-test-classes.jar"
4123 #:source-dir "src/test"
4124 #:tests? #f))
4125 (inputs
4126 `(("collection" ,java-commons-collections)))))
4127
4128(define-public java-commons-beanutils
4129 (package
4130 (name "java-commons-beanutils")
4131 (version "1.9.3")
4132 (source (origin
4133 (method url-fetch)
4134 (uri (string-append "mirror://apache/commons/beanutils/source/"
4135 "commons-beanutils-" version "-src.tar.gz"))
4136 (sha256
4137 (base32
4138 "03cs0bq3sl1sdc7py9g3qnf8n9h473nrkvd3d251kaqv6a2ab7qk"))))
4139 (build-system ant-build-system)
4140 (arguments
4141 `(#:test-target "test"
4142 #:tests? #f
4143 #:phases
4144 (modify-phases %standard-phases
4145 (replace 'install
4146 (lambda* (#:key outputs #:allow-other-keys)
4147 (rename-file (string-append "dist/commons-beanutils-" ,version
4148 "-SNAPSHOT.jar")
4149 "commons-beanutils.jar")
4150 (install-file "commons-beanutils.jar"
4151 (string-append (assoc-ref outputs "out") "/share/java/"))
4152 #t)))))
4153 (inputs
4154 `(("logging" ,java-commons-logging-minimal)
4155 ("collections" ,java-commons-collections)))
4156 (native-inputs
4157 `(("junit" ,java-junit)
4158 ("collections-test" ,java-commons-collections-test-classes)))
4159 (home-page "http://commons.apache.org/beanutils/")
4160 (synopsis "Dynamically set or get properties in Java")
4161 (description "BeanUtils provides a simplified interface to reflection and
4162introspection to set or get dynamically determined properties through their
4163setter and getter method.")
4164 (license license:asl2.0)))
4165
6af63e65
HG
4166(define-public java-commons-io
4167 (package
4168 (name "java-commons-io")
4169 (version "2.5")
4170 (source
4171 (origin
4172 (method url-fetch)
4173 (uri (string-append "mirror://apache/commons/io/source/"
4174 "commons-io-" version "-src.tar.gz"))
4175 (sha256
4176 (base32
4177 "0q5y41jrcjvx9hzs47x5kdhnasdy6rm4bzqd2jxl02w717m7a7v3"))))
4178 (build-system ant-build-system)
4179 (outputs '("out" "doc"))
4180 (arguments
4181 `(#:test-target "test"
4182 #:make-flags
4183 (list (string-append "-Djunit.jar="
4184 (assoc-ref %build-inputs "java-junit")
4185 "/share/java/junit.jar"))
4186 #:phases
4187 (modify-phases %standard-phases
4188 (add-after 'build 'build-javadoc ant-build-javadoc)
4189 (replace 'install (install-jars "target"))
4190 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
4191 (native-inputs
4192 `(("java-junit" ,java-junit)
4193 ("java-hamcrest-core" ,java-hamcrest-core)))
4194 (home-page "http://commons.apache.org/io/")
4195 (synopsis "Common useful IO related classes")
4196 (description "Commons-IO contains utility classes, stream implementations,
4197file filters and endian classes.")
4198 (license license:asl2.0)))
d631b5f3
HG
4199
4200(define-public java-commons-lang
4201 (package
4202 (name "java-commons-lang")
4203 (version "2.6")
4204 (source
4205 (origin
4206 (method url-fetch)
4207 (uri (string-append "mirror://apache/commons/lang/source/"
4208 "commons-lang-" version "-src.tar.gz"))
4209 (sha256
4210 (base32 "1mxwagqadzx1b2al7i0z1v0r235aj2njdyijf02szq0vhmqrfiq5"))))
4211 (build-system ant-build-system)
4212 (outputs '("out" "doc"))
4213 (arguments
4214 `(#:test-target "test"
e5a96113 4215 #:test-exclude (list "**/Abstract*.java" "**/Random*.java")
d631b5f3
HG
4216 #:phases
4217 (modify-phases %standard-phases
4218 (add-after 'build 'build-javadoc ant-build-javadoc)
4219 (add-before 'check 'disable-failing-test
4220 (lambda _
4221 ;; Disable a failing test
4222 (substitute* "src/test/java/org/apache/commons/lang/\
4223time/FastDateFormatTest.java"
4224 (("public void testFormat\\(\\)")
4225 "public void disabled_testFormat()"))
4226 #t))
4227 (replace 'install (install-jars "target"))
4228 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
4229 (native-inputs
4230 `(("java-junit" ,java-junit)))
4231 (home-page "http://commons.apache.org/lang/")
4232 (synopsis "Extension of the java.lang package")
4233 (description "The Commons Lang components contains a set of Java classes
4234that provide helper methods for standard Java classes, especially those found
4235in the @code{java.lang} package in the Sun JDK. The following classes are
4236included:
4237
4238@itemize
4239@item StringUtils - Helper for @code{java.lang.String}.
4240@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets
4241 of characters such as @code{[a-z]} and @code{[abcdez]}.
4242@item RandomStringUtils - Helper for creating randomised strings.
4243@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
4244@item NumberRange - A range of numbers with an upper and lower bound.
4245@item ObjectUtils - Helper for @code{java.lang.Object}.
4246@item SerializationUtils - Helper for serializing objects.
4247@item SystemUtils - Utility class defining the Java system properties.
4248@item NestedException package - A sub-package for the creation of nested
4249 exceptions.
4250@item Enum package - A sub-package for the creation of enumerated types.
4251@item Builder package - A sub-package for the creation of @code{equals},
4252 @code{hashCode}, @code{compareTo} and @code{toString} methods.
4253@end itemize\n")
4254 (license license:asl2.0)))
82e18864
HG
4255
4256(define-public java-commons-lang3
4257 (package
4258 (name "java-commons-lang3")
4259 (version "3.4")
4260 (source
4261 (origin
4262 (method url-fetch)
4263 (uri (string-append "mirror://apache/commons/lang/source/"
4264 "commons-lang3-" version "-src.tar.gz"))
4265 (sha256
4266 (base32 "0xpshb9spjhplq5a7mr0y1bgfw8190ik4xj8f569xidfcki1d6kg"))))
4267 (build-system ant-build-system)
4268 (outputs '("out" "doc"))
4269 (arguments
4270 `(#:test-target "test"
4271 #:make-flags
4272 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-all"))
4273 (junit (assoc-ref %build-inputs "java-junit"))
4274 (easymock (assoc-ref %build-inputs "java-easymock"))
4275 (io (assoc-ref %build-inputs "java-commons-io")))
4276 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
4277 (string-append "-Dhamcrest.jar=" hamcrest
4278 "/share/java/hamcrest-all.jar")
4279 (string-append "-Dcommons-io.jar=" io
4280 "/share/java/commons-io-"
4281 ,(package-version java-commons-io)
4282 "-SNAPSHOT.jar")
4283 (string-append "-Deasymock.jar=" easymock
4284 "/share/java/easymock.jar")))
4285 #:phases
4286 (modify-phases %standard-phases
4287 (add-after 'build 'build-javadoc ant-build-javadoc)
4288 (replace 'install (install-jars "target"))
4289 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
4290 (native-inputs
4291 `(("java-junit" ,java-junit)
4292 ("java-commons-io" ,java-commons-io)
4293 ("java-hamcrest-all" ,java-hamcrest-all)
4294 ("java-easymock" ,java-easymock)))
4295 (home-page "http://commons.apache.org/lang/")
4296 (synopsis "Extension of the java.lang package")
4297 (description "The Commons Lang components contains a set of Java classes
4298that provide helper methods for standard Java classes, especially those found
4299in the @code{java.lang} package. The following classes are included:
4300
4301@itemize
4302@item StringUtils - Helper for @code{java.lang.String}.
4303@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets of
4304 characters such as @code{[a-z]} and @code{[abcdez]}.
4305@item RandomStringUtils - Helper for creating randomised strings.
4306@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
4307@item NumberRange - A range of numbers with an upper and lower bound.
4308@item ObjectUtils - Helper for @code{java.lang.Object}.
4309@item SerializationUtils - Helper for serializing objects.
4310@item SystemUtils - Utility class defining the Java system properties.
4311@item NestedException package - A sub-package for the creation of nested
4312 exceptions.
4313@item Enum package - A sub-package for the creation of enumerated types.
4314@item Builder package - A sub-package for the creation of @code{equals},
4315 @code{hashCode}, @code{compareTo} and @code{toString} methods.
4316@end itemize\n")
4317 (license license:asl2.0)))
1c188f4e 4318
0d4a0d60
RW
4319(define-public java-jsr305
4320 (package
4321 (name "java-jsr305")
4322 (version "3.0.1")
4323 (source (origin
4324 (method url-fetch)
4325 (uri (string-append "https://repo1.maven.org/maven2/"
4326 "com/google/code/findbugs/"
4327 "jsr305/" version "/jsr305-"
4328 version "-sources.jar"))
4329 (sha256
4330 (base32
4331 "1rh6jin9v7jqpq3kf1swl868l8i94r636n03pzpsmgr8v0lh9j2n"))))
4332 (build-system ant-build-system)
4333 (arguments
4334 `(#:tests? #f ; no tests included
4335 #:jar-name "jsr305.jar"))
4336 (home-page "http://findbugs.sourceforge.net/")
4337 (synopsis "Annotations for the static analyzer called findbugs")
4338 (description "This package provides annotations for the findbugs package.
4339It provides packages in the @code{javax.annotations} namespace.")
4340 (license license:asl2.0)))
4341
4f3e47ea
RW
4342(define-public java-guava
4343 (package
4344 (name "java-guava")
4345 ;; This is the last release of Guava that can be built with Java 7.
4346 (version "20.0")
4347 (source (origin
4348 (method url-fetch)
4349 (uri (string-append "https://github.com/google/guava/"
4350 "releases/download/v" version
4351 "/guava-" version "-sources.jar"))
4352 (sha256
4353 (base32
4354 "1gawrs5gi6j5hcfxdgpnfli75vb9pfi4sn09pnc8xacr669yajwr"))))
4355 (build-system ant-build-system)
4356 (arguments
4357 `(#:tests? #f ; no tests included
4358 #:jar-name "guava.jar"
4359 #:phases
4360 (modify-phases %standard-phases
4361 (add-after 'unpack 'trim-sources
4362 (lambda _
4363 (with-directory-excursion "src/com/google/common"
4364 ;; Remove annotations to avoid extra dependencies:
4365 ;; * "j2objc" annotations are used when converting Java to
4366 ;; Objective C;
4367 ;; * "errorprone" annotations catch common Java mistakes at
4368 ;; compile time;
4369 ;; * "IgnoreJRERequirement" is used for Android.
4370 (substitute* (find-files "." "\\.java$")
4371 (("import com.google.j2objc.*") "")
4372 (("import com.google.errorprone.annotation.*") "")
4373 (("import org.codehaus.mojo.animal_sniffer.*") "")
4374 (("@CanIgnoreReturnValue") "")
4375 (("@LazyInit") "")
4376 (("@WeakOuter") "")
4377 (("@RetainedWith") "")
4378 (("@Weak") "")
4379 (("@ForOverride") "")
4380 (("@J2ObjCIncompatible") "")
4381 (("@IgnoreJRERequirement") "")))
4382 #t)))))
4383 (inputs
4384 `(("java-jsr305" ,java-jsr305)))
4385 (home-page "https://github.com/google/guava")
4386 (synopsis "Google core libraries for Java")
4387 (description "Guava is a set of core libraries that includes new
4388collection types (such as multimap and multiset), immutable collections, a
4389graph library, functional types, an in-memory cache, and APIs/utilities for
4390concurrency, I/O, hashing, primitives, reflection, string processing, and much
4391more!")
4392 (license license:asl2.0)))
4393
af8f8281
RW
4394;; The java-commons-logging package provides adapters to many different
4395;; logging frameworks. To avoid an excessive dependency graph we try to build
4396;; it with only a minimal set of adapters.
4397(define-public java-commons-logging-minimal
4398 (package
4399 (name "java-commons-logging-minimal")
4400 (version "1.2")
4401 (source (origin
4402 (method url-fetch)
4403 (uri (string-append "mirror://apache/commons/logging/source/"
4404 "commons-logging-" version "-src.tar.gz"))
4405 (sha256
4406 (base32
4407 "10bwcy5w8d7y39n0krlwhnp8ds3kj5zhmzj0zxnkw0qdlsjmsrj9"))))
4408 (build-system ant-build-system)
4409 (arguments
4410 `(#:tests? #f ; avoid dependency on logging frameworks
4411 #:jar-name "commons-logging-minimal.jar"
4412 #:phases
4413 (modify-phases %standard-phases
4414 (add-after 'unpack 'delete-adapters-and-tests
4415 (lambda _
4416 ;; Delete all adapters except for NoOpLog, SimpleLog, and
4417 ;; LogFactoryImpl. NoOpLog is required to build; LogFactoryImpl
4418 ;; is used by applications; SimpleLog is the only actually usable
4419 ;; implementation that does not depend on another logging
4420 ;; framework.
4421 (for-each
4422 (lambda (file)
4423 (delete-file (string-append
4424 "src/main/java/org/apache/commons/logging/impl/" file)))
4425 (list "Jdk13LumberjackLogger.java"
4426 "WeakHashtable.java"
4427 "Log4JLogger.java"
4428 "ServletContextCleaner.java"
4429 "Jdk14Logger.java"
4430 "AvalonLogger.java"
4431 "LogKitLogger.java"))
4432 (delete-file-recursively "src/test")
4433 #t)))))
4434 (home-page "http://commons.apache.org/logging/")
4435 (synopsis "Common API for logging implementations")
4436 (description "The Logging package is a thin bridge between different
4437logging implementations. A library that uses the commons-logging API can be
4438used with any logging implementation at runtime.")
4439 (license license:asl2.0)))
4440
90e65abe
RW
4441;; This is the last release of the 1.x series.
4442(define-public java-mockito-1
4443 (package
4444 (name "java-mockito")
4445 (version "1.10.19")
4446 (source (origin
4447 (method url-fetch)
4448 (uri (string-append "http://repo1.maven.org/maven2/"
4449 "org/mockito/mockito-core/" version
4450 "/mockito-core-" version "-sources.jar"))
4451 (sha256
4452 (base32
4453 "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc"))))
4454 (build-system ant-build-system)
4455 (arguments
4456 `(#:jar-name "mockito.jar"
4457 #:tests? #f ; no tests included
4458 ;; FIXME: patch-and-repack does not support jars, so we have to apply
4459 ;; patches in build phases.
4460 #:phases
4461 (modify-phases %standard-phases
4462 ;; Mockito was developed against a different version of hamcrest,
4463 ;; which does not require matcher implementations to provide an
4464 ;; implementation of the "describeMismatch" method. We add this
4465 ;; simple definition to pass the build with our version of hamcrest.
4466 (add-after 'unpack 'fix-hamcrest-build-error
4467 (lambda _
4468 (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java"
4469 (("public Matcher getActualMatcher\\(\\) .*" line)
4470 (string-append "
4471 public void describeMismatch(Object item, Description description) {
4472 actualMatcher.describeMismatch(item, description);
4473 }"
4474 line)))
4475 #t))
4476 ;; Mockito bundles cglib. We have a cglib package, so let's use
4477 ;; that instead.
4478 (add-after 'unpack 'use-system-libraries
4479 (lambda _
4480 (with-directory-excursion "src/org/mockito/internal/creation/cglib"
4481 (substitute* '("CGLIBHacker.java"
4482 "CglibMockMaker.java"
4483 "ClassImposterizer.java"
4484 "DelegatingMockitoMethodProxy.java"
4485 "MethodInterceptorFilter.java"
4486 "MockitoNamingPolicy.java"
4487 "SerializableMockitoMethodProxy.java"
4488 "SerializableNoOp.java")
4489 (("import org.mockito.cglib") "import net.sf.cglib")))
4490 #t)))))
4491 (inputs
4492 `(("java-junit" ,java-junit)
4493 ("java-objenesis" ,java-objenesis)
4494 ("java-cglib" ,java-cglib)
4495 ("java-hamcrest-core" ,java-hamcrest-core)))
4496 (home-page "http://mockito.org")
4497 (synopsis "Mockito is a mock library for Java")
4498 (description "Mockito is a mocking library for Java which lets you write
4499tests with a clean and simple API. It generates mocks using reflection, and
4500it records all mock invocations, including methods arguments.")
4501 (license license:asl2.0)))
4502
4f4d2e47
RW
4503(define-public java-httpcomponents-httpcore
4504 (package
4505 (name "java-httpcomponents-httpcore")
4506 (version "4.4.6")
4507 (source (origin
4508 (method url-fetch)
4509 (uri (string-append "mirror://apache//httpcomponents/httpcore/"
4510 "source/httpcomponents-core-"
4511 version "-src.tar.gz"))
4512 (sha256
4513 (base32
4514 "02bwcf38y4vgwq7kj2s6q7qrmma641r5lacivm16kgxvb2j6h1vy"))))
4515 (build-system ant-build-system)
4516 (arguments
4517 `(#:jar-name "httpcomponents-httpcore.jar"
4518 #:phases
4519 (modify-phases %standard-phases
4520 (add-after 'unpack 'chdir
4521 (lambda _ (chdir "httpcore") #t)))))
4522 (inputs
4523 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
4524 ("java-commons-lang3" ,java-commons-lang3)))
4525 (native-inputs
4526 `(("java-junit" ,java-junit)
4527 ("java-mockito" ,java-mockito-1)))
4528 (home-page "https://hc.apache.org/httpcomponents-core-4.4.x/index.html")
4529 (synopsis "Low level HTTP transport components")
4530 (description "HttpCore is a set of low level HTTP transport components
4531that can be used to build custom client and server side HTTP services with a
4532minimal footprint. HttpCore supports two I/O models: blocking I/O model based
4533on the classic Java I/O and non-blocking, event driven I/O model based on Java
4534NIO.
4535
4536This package provides the blocking I/O model library.")
4537 (license license:asl2.0)))
4538
3a068b43
RW
4539(define-public java-httpcomponents-httpcore-nio
4540 (package (inherit java-httpcomponents-httpcore)
4541 (name "java-httpcomponents-httpcore-nio")
4542 (arguments
4543 `(#:jar-name "httpcomponents-httpcore-nio.jar"
4544 #:phases
4545 (modify-phases %standard-phases
4546 (add-after 'unpack 'chdir
4547 (lambda _ (chdir "httpcore-nio") #t)))))
4548 (inputs
4549 `(("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
4550 ("java-hamcrest-core" ,java-hamcrest-core)
4551 ,@(package-inputs java-httpcomponents-httpcore)))
4552 (description "HttpCore is a set of low level HTTP transport components
4553that can be used to build custom client and server side HTTP services with a
4554minimal footprint. HttpCore supports two I/O models: blocking I/O model based
4555on the classic Java I/O and non-blocking, event driven I/O model based on Java
4556NIO.
4557
4558This package provides the non-blocking I/O model library based on Java
4559NIO.")))
4560
e1dd78f6
RW
4561(define-public java-httpcomponents-httpcore-ab
4562 (package (inherit java-httpcomponents-httpcore)
4563 (name "java-httpcomponents-httpcore-ab")
4564 (arguments
4565 `(#:jar-name "httpcomponents-httpcore-ab.jar"
4566 #:phases
4567 (modify-phases %standard-phases
4568 (add-after 'unpack 'chdir
4569 (lambda _ (chdir "httpcore-ab") #t)))))
4570 (inputs
4571 `(("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
4572 ("java-commons-cli" ,java-commons-cli)
4573 ("java-hamcrest-core" ,java-hamcrest-core)
4574 ,@(package-inputs java-httpcomponents-httpcore)))
4575 (synopsis "Apache HttpCore benchmarking tool")
4576 (description "This package provides the HttpCore benchmarking tool. It is
4577an Apache AB clone based on HttpCore.")))
4578
14a671d8
RW
4579(define-public java-httpcomponents-httpclient
4580 (package
4581 (name "java-httpcomponents-httpclient")
4582 (version "4.5.3")
4583 (source (origin
4584 (method url-fetch)
4585 (uri (string-append "mirror://apache/httpcomponents/httpclient/"
4586 "source/httpcomponents-client-"
4587 version "-src.tar.gz"))
4588 (sha256
4589 (base32
4590 "1428399s7qy3cim5wc6f3ks4gl9nf9vkjpfmnlap3jflif7g2pj1"))))
4591 (build-system ant-build-system)
4592 (arguments
4593 `(#:jar-name "httpcomponents-httpclient.jar"
4594 #:phases
4595 (modify-phases %standard-phases
4596 (add-after 'unpack 'chdir
4597 (lambda _ (chdir "httpclient") #t)))))
4598 (inputs
4599 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
4600 ("java-commons-codec" ,java-commons-codec)
4601 ("java-hamcrest-core" ,java-hamcrest-core)
4602 ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
4603 ("java-mockito" ,java-mockito-1)
4604 ("java-junit" ,java-junit)))
4605 (home-page "https://hc.apache.org/httpcomponents-client-ga/")
4606 (synopsis "HTTP client library for Java")
4607 (description "Although the @code{java.net} package provides basic
4608functionality for accessing resources via HTTP, it doesn't provide the full
4609flexibility or functionality needed by many applications. @code{HttpClient}
4610seeks to fill this void by providing an efficient, up-to-date, and
4611feature-rich package implementing the client side of the most recent HTTP
4612standards and recommendations.")
4613 (license license:asl2.0)))
4614
cbce5de2
RW
4615(define-public java-httpcomponents-httpmime
4616 (package (inherit java-httpcomponents-httpclient)
4617 (name "java-httpcomponents-httpmime")
4618 (arguments
4619 `(#:jar-name "httpcomponents-httpmime.jar"
4620 #:phases
4621 (modify-phases %standard-phases
4622 (add-after 'unpack 'chdir
4623 (lambda _ (chdir "httpmime") #t)))))
4624 (inputs
4625 `(("java-httpcomponents-httpclient" ,java-httpcomponents-httpclient)
4626 ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
4627 ("java-junit" ,java-junit)
4628 ("java-hamcrest-core" ,java-hamcrest-core)))))
4629
4b34c21f
RW
4630(define-public java-commons-net
4631 (package
4632 (name "java-commons-net")
4633 (version "3.6")
4634 (source (origin
4635 (method url-fetch)
4636 (uri (string-append "mirror://apache/commons/net/source/"
4637 "commons-net-" version "-src.tar.gz"))
4638 (sha256
4639 (base32
4640 "0n0cmnddk9qdqhjvka8pc6hd9mn2qi3166f1s6xk32h7rfy1adxr"))))
4641 (build-system ant-build-system)
4642 (arguments
4643 `(;; FIXME: MainTest.java tries to read "examples.properties" (which
4644 ;; should be "resources/examples/examples.properties"), but gets "null"
4645 ;; instead.
4646 #:tests? #f
4647 #:jar-name "commons-net.jar"))
4648 (native-inputs
4649 `(("java-junit" ,java-junit)
4650 ("java-hamcrest-core" ,java-hamcrest-core)))
4651 (home-page "http://commons.apache.org/net/")
4652 (synopsis "Client library for many basic Internet protocols")
4653 (description "The Apache Commons Net library implements the client side of
4654many basic Internet protocols. The purpose of the library is to provide
4655fundamental protocol access, not higher-level abstractions.")
4656 (license license:asl2.0)))
4657
808cb58f
RW
4658(define-public java-jsch
4659 (package
4660 (name "java-jsch")
4661 (version "0.1.54")
4662 (source (origin
4663 (method url-fetch)
4664 (uri (string-append "mirror://sourceforge/jsch/jsch/"
4665 version "/jsch-" version ".zip"))
4666 (sha256
4667 (base32
4668 "029rdddyq1mh3ghryh3ki99kba1xkf1d1swjv2vi6lk6zzjy2wdb"))))
4669 (build-system ant-build-system)
4670 (arguments
4671 `(#:build-target "dist"
4672 #:tests? #f ; no tests included
4673 #:phases
4674 (modify-phases %standard-phases
4675 (replace 'install (install-jars "dist")))))
4676 (native-inputs
4677 `(("unzip" ,unzip)))
4678 (home-page "http://www.jcraft.com/jsch/")
4679 (synopsis "Pure Java implementation of SSH2")
4680 (description "JSch is a pure Java implementation of SSH2. JSch allows you
4681to connect to an SSH server and use port forwarding, X11 forwarding, file
4682transfer, etc., and you can integrate its functionality into your own Java
4683programs.")
4684 (license license:bsd-3)))
4685
a6244698
RW
4686(define-public java-commons-compress
4687 (package
4688 (name "java-commons-compress")
4689 (version "1.13")
4690 (source (origin
4691 (method url-fetch)
4692 (uri (string-append "mirror://apache/commons/compress/source/"
4693 "commons-compress-" version "-src.tar.gz"))
4694 (sha256
4695 (base32
4696 "1vjqvavrn0babffn1kciz6v52ibwq2vwhzlb95hazis3lgllnxc8"))))
4697 (build-system ant-build-system)
4698 (arguments
4699 `(#:jar-name "commons-compress.jar"
4700 #:phases
4701 (modify-phases %standard-phases
4702 (add-after 'unpack 'delete-bad-tests
4703 (lambda _
4704 (with-directory-excursion "src/test/java/org/apache/commons/compress/"
4705 ;; FIXME: These tests really should not fail. Maybe they are
4706 ;; indicative of problems with our Java packaging work.
4707
4708 ;; This test fails with a null pointer exception.
4709 (delete-file "archivers/sevenz/SevenZOutputFileTest.java")
4710 ;; This test fails to open test resources.
4711 (delete-file "archivers/zip/ExplodeSupportTest.java")
4712
4713 ;; FIXME: This test adds a dependency on powermock, which is hard to
4714 ;; package at this point.
4715 ;; https://github.com/powermock/powermock
4716 (delete-file "archivers/sevenz/SevenZNativeHeapTest.java"))
4717 #t)))))
4718 (inputs
4719 `(("java-junit" ,java-junit)
4720 ("java-hamcrest-core" ,java-hamcrest-core)
4721 ("java-mockito" ,java-mockito-1)
4722 ("java-xz" ,java-xz)))
4723 (home-page "https://commons.apache.org/proper/commons-compress/")
4724 (synopsis "Java library for working with compressed files")
4725 (description "The Apache Commons Compress library defines an API for
4726working with compressed files such as ar, cpio, Unix dump, tar, zip, gzip, XZ,
4727Pack200, bzip2, 7z, arj, lzma, snappy, DEFLATE, lz4 and Z files.")
4728 (license license:asl2.0)))
4729
51263ff5
JL
4730(define-public java-commons-csv
4731 (package
4732 (name "java-commons-csv")
4733 (version "1.4")
4734 (source (origin
4735 (method url-fetch)
4736 (uri (string-append "mirror://apache/commons/csv/source/"
4737 "commons-csv-" version "-src.tar.gz"))
4738 (sha256
4739 (base32
4740 "1l89m0fm2s3xx3v3iynvangymfg2vlyngaj6fgsi457nmsw7m7ij"))))
4741 (build-system ant-build-system)
4742 (arguments
4743 `(#:jar-name "commons-csv.jar"
4744 #:source-dir "src/main/java"
4745 #:tests? #f)); FIXME: requires java-h2
4746 (inputs
4747 `(("java-hamcrest-core" ,java-hamcrest-core)
4748 ("java-commons-io" ,java-commons-io)
4749 ("java-commons-lang3" ,java-commons-lang3)
4750 ("junit" ,java-junit)))
4751 (home-page "https://commons.apache.org/proper/commons-csv/")
4752 (synopsis "Read and write CSV documents")
4753 (description "Commons CSV reads and writes files in variations of the Comma
4754Separated Value (CSV) format. The most common CSV formats are predefined in the
4755CSVFormat class:
4756
4757@itemize
4758@item Microsoft Excel
4759@item Informix UNLOAD
4760@item Informix UNLOAD CSV
4761@item MySQL
4762@item RFC 4180
4763@item TDF
4764@end itemize
4765
4766Custom formats can be created using a fluent style API.")
4767 (license license:asl2.0)))
4768
6ee6d0b5
RW
4769(define-public java-osgi-annotation
4770 (package
4771 (name "java-osgi-annotation")
4772 (version "6.0.0")
4773 (source (origin
4774 (method url-fetch)
4775 (uri (string-append "https://repo1.maven.org/maven2/"
4776 "org/osgi/org.osgi.annotation/" version "/"
4777 "org.osgi.annotation-" version "-sources.jar"))
4778 (sha256
4779 (base32
4780 "1q718mb7gqg726rh6pc2hcisn8v50nv35abbir0jypmffhiii85w"))))
4781 (build-system ant-build-system)
4782 (arguments
4783 `(#:tests? #f ; no tests
4784 #:jar-name "osgi-annotation.jar"))
c353d014 4785 (home-page "https://www.osgi.org")
6ee6d0b5
RW
4786 (synopsis "Annotation module of OSGi framework")
4787 (description
4788 "OSGi, for Open Services Gateway initiative framework, is a module system
4789and service platform for the Java programming language. This package contains
4790the OSGi annotation module, providing additional services to help dynamic
4791components.")
4792 (license license:asl2.0)))
4793
37e2e5d4
RW
4794(define-public java-osgi-core
4795 (package
4796 (name "java-osgi-core")
4797 (version "6.0.0")
4798 (source (origin
4799 (method url-fetch)
4800 (uri (string-append "https://repo1.maven.org/maven2/"
4801 "org/osgi/org.osgi.core/" version "/"
4802 "org.osgi.core-" version "-sources.jar"))
4803 (sha256
4804 (base32
4805 "19bpf5jx32jq9789gyhin35q5v7flmw0p9mk7wbgqpxqfmxyiabv"))))
4806 (build-system ant-build-system)
4807 (arguments
4808 `(#:tests? #f ; no tests
4809 #:jar-name "osgi-core.jar"))
4810 (inputs
4811 `(("java-osgi-annotation" ,java-osgi-annotation)))
c353d014 4812 (home-page "https://www.osgi.org")
37e2e5d4
RW
4813 (synopsis "Core module of OSGi framework")
4814 (description
4815 "OSGi, for Open Services Gateway initiative framework, is a module system
4816and service platform for the Java programming language. This package contains
4817the OSGi Core module.")
4818 (license license:asl2.0)))
4819
8af92c8f
RW
4820(define-public java-osgi-service-event
4821 (package
4822 (name "java-osgi-service-event")
4823 (version "1.3.1")
4824 (source (origin
4825 (method url-fetch)
4826 (uri (string-append "https://repo1.maven.org/maven2/"
4827 "org/osgi/org.osgi.service.event/"
4828 version "/org.osgi.service.event-"
4829 version "-sources.jar"))
4830 (sha256
4831 (base32
4832 "1nyhlgagwym75bycnjczwbnpymv2iw84zbhvvzk84g9q736i6qxm"))))
4833 (build-system ant-build-system)
4834 (arguments
4835 `(#:tests? #f ; no tests
4836 #:jar-name "osgi-service-event.jar"))
4837 (inputs
4838 `(("java-osgi-annotation" ,java-osgi-annotation)
4839 ("java-osgi-core" ,java-osgi-core)))
c353d014 4840 (home-page "https://www.osgi.org")
8af92c8f
RW
4841 (synopsis "OSGi service event module")
4842 (description
4843 "OSGi, for Open Services Gateway initiative framework, is a module system
4844and service platform for the Java programming language. This package contains
4845the OSGi @code{org.osgi.service.event} module.")
4846 (license license:asl2.0)))
4847
674e93a0
RW
4848(define-public java-eclipse-osgi
4849 (package
4850 (name "java-eclipse-osgi")
4851 (version "3.11.3")
4852 (source (origin
4853 (method url-fetch)
4854 (uri (string-append "https://repo1.maven.org/maven2/"
4855 "org/eclipse/platform/org.eclipse.osgi/"
4856 version "/org.eclipse.osgi-"
4857 version "-sources.jar"))
4858 (sha256
4859 (base32
4860 "00cqc6lb29n0zv68b4l842vzkwawvbr7gshfdygsk8sicvcq2c7b"))))
4861 (build-system ant-build-system)
4862 (arguments
4863 `(#:tests? #f ; no tests included
4864 #:jar-name "eclipse-equinox-osgi.jar"))
4865 (inputs
4866 `(("java-osgi-annotation" ,java-osgi-annotation)))
4867 (home-page "http://www.eclipse.org/equinox/")
4868 (synopsis "Eclipse Equinox OSGi framework")
4869 (description "This package provides an implementation of the OSGi Core
4870specification.")
4871 (license license:epl1.0)))
4872
81b55b1e
RW
4873(define-public java-eclipse-equinox-common
4874 (package
4875 (name "java-eclipse-equinox-common")
4876 (version "3.8.0")
4877 (source (origin
4878 (method url-fetch)
4879 (uri (string-append "https://repo1.maven.org/maven2/"
4880 "org/eclipse/platform/org.eclipse.equinox.common/"
4881 version "/org.eclipse.equinox.common-"
4882 version "-sources.jar"))
4883 (sha256
4884 (base32
4885 "12aazpkgw46r1qj0pr421jzwhbmsizd97r37krd7njnbrdgfzksc"))))
4886 (build-system ant-build-system)
4887 (arguments
4888 `(#:tests? #f ; no tests included
4889 #:jar-name "eclipse-equinox-common.jar"))
4890 (inputs
4891 `(("java-eclipse-osgi" ,java-eclipse-osgi)))
4892 (home-page "http://www.eclipse.org/equinox/")
4893 (synopsis "Common Eclipse runtime")
4894 (description "This package provides the common Eclipse runtime.")
4895 (license license:epl1.0)))
4896
90368ad9
RW
4897(define-public java-eclipse-core-jobs
4898 (package
4899 (name "java-eclipse-core-jobs")
4900 (version "3.8.0")
4901 (source (origin
4902 (method url-fetch)
4903 (uri (string-append "https://repo1.maven.org/maven2/"
4904 "org/eclipse/platform/org.eclipse.core.jobs/"
4905 version "/org.eclipse.core.jobs-"
4906 version "-sources.jar"))
4907 (sha256
4908 (base32
4909 "0395b8lh0km8vhzjnchvs1rii1qz48hyvb2wqfaq4yhklbwihq4b"))))
4910 (build-system ant-build-system)
4911 (arguments
4912 `(#:tests? #f ; no tests included
4913 #:jar-name "eclipse-core-jobs.jar"))
4914 (inputs
4915 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4916 ("java-eclipse-osgi" ,java-eclipse-osgi)))
4917 (home-page "http://www.eclipse.org/equinox/")
4918 (synopsis "Eclipse jobs mechanism")
4919 (description "This package provides the Eclipse jobs mechanism.")
4920 (license license:epl1.0)))
4921
fbaf09eb
RW
4922(define-public java-eclipse-equinox-registry
4923 (package
4924 (name "java-eclipse-equinox-registry")
4925 (version "3.6.100")
4926 (source (origin
4927 (method url-fetch)
4928 (uri (string-append "https://repo1.maven.org/maven2/"
4929 "org/eclipse/platform/org.eclipse.equinox.registry/"
4930 version "/org.eclipse.equinox.registry-"
4931 version "-sources.jar"))
4932 (sha256
4933 (base32
4934 "1i9sgymh2fy5vdgk5y7s3qvrlbgh4l93ddqi3v4zmca7hwrlhf9k"))))
4935 (build-system ant-build-system)
4936 (arguments
4937 `(#:tests? #f ; no tests included
4938 #:jar-name "eclipse-equinox-registry.jar"))
4939 (inputs
4940 `(("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
4941 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4942 ("java-eclipse-osgi" ,java-eclipse-osgi)))
4943 (home-page "http://www.eclipse.org/equinox/")
4944 (synopsis "Eclipse extension registry support")
4945 (description "This package provides support for the Eclipse extension
4946registry.")
4947 (license license:epl1.0)))
4948
65214c87
RW
4949(define-public java-eclipse-equinox-app
4950 (package
4951 (name "java-eclipse-equinox-app")
4952 (version "1.3.400")
4953 (source (origin
4954 (method url-fetch)
4955 (uri (string-append "https://repo1.maven.org/maven2/"
4956 "org/eclipse/platform/org.eclipse.equinox.app/"
4957 version "/org.eclipse.equinox.app-"
4958 version "-sources.jar"))
4959 (sha256
4960 (base32
4961 "0nhvbp93y203ar7y59gb0mz3w2d3jlqhr0c9hii9bcfpmr7imdab"))))
4962 (build-system ant-build-system)
4963 (arguments
4964 `(#:tests? #f ; no tests included
4965 #:jar-name "eclipse-equinox-app.jar"))
4966 (inputs
4967 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4968 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
4969 ("java-eclipse-osgi" ,java-eclipse-osgi)
4970 ("java-osgi-service-event" ,java-osgi-service-event)))
4971 (home-page "http://www.eclipse.org/equinox/")
4972 (synopsis "Equinox application container")
4973 (description "This package provides the Equinox application container for
4974Eclipse.")
4975 (license license:epl1.0)))
4976
3f970214
RW
4977(define-public java-eclipse-equinox-preferences
4978 (package
4979 (name "java-eclipse-equinox-preferences")
4980 (version "3.6.1")
4981 (source (origin
4982 (method url-fetch)
4983 (uri (string-append "https://repo1.maven.org/maven2/"
4984 "org/eclipse/platform/org.eclipse.equinox.preferences/"
4985 version "/org.eclipse.equinox.preferences-"
4986 version "-sources.jar"))
4987 (sha256
4988 (base32
4989 "0k7w6c141sqym4fy3af0qkwpy4pdh2vsjpjba6rp5fxyqa24v0a2"))))
4990 (build-system ant-build-system)
4991 (arguments
4992 `(#:tests? #f ; no tests included
4993 #:jar-name "eclipse-equinox-preferences.jar"))
4994 (inputs
4995 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4996 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
4997 ("java-eclipse-osgi" ,java-eclipse-osgi)))
4998 (home-page "http://www.eclipse.org/equinox/")
4999 (synopsis "Eclipse preferences mechanism")
5000 (description "This package provides the Eclipse preferences mechanism with
5001the module @code{org.eclipse.equinox.preferences}.")
5002 (license license:epl1.0)))
5003
4ad3d4f3
RW
5004(define-public java-eclipse-core-contenttype
5005 (package
5006 (name "java-eclipse-core-contenttype")
5007 (version "3.5.100")
5008 (source (origin
5009 (method url-fetch)
5010 (uri (string-append "https://repo1.maven.org/maven2/"
5011 "org/eclipse/platform/org.eclipse.core.contenttype/"
5012 version "/org.eclipse.core.contenttype-"
5013 version "-sources.jar"))
5014 (sha256
5015 (base32
5016 "1wcqcv7ijwv5rh748vz3x9pkmjl9w1r0k0026k56n8yjl4rrmspi"))))
5017 (build-system ant-build-system)
5018 (arguments
5019 `(#:tests? #f ; no tests included
5020 #:jar-name "eclipse-core-contenttype.jar"))
5021 (inputs
5022 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5023 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5024 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5025 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5026 (home-page "http://www.eclipse.org/")
5027 (synopsis "Eclipse content mechanism")
5028 (description "This package provides the Eclipse content mechanism in the
5029@code{org.eclipse.core.contenttype} module.")
5030 (license license:epl1.0)))
5031
6a7f7e49
RW
5032(define-public java-eclipse-core-runtime
5033 (package
5034 (name "java-eclipse-core-runtime")
5035 (version "3.12.0")
5036 (source (origin
5037 (method url-fetch)
5038 (uri (string-append "https://repo1.maven.org/maven2/"
5039 "org/eclipse/platform/org.eclipse.core.runtime/"
5040 version "/org.eclipse.core.runtime-"
5041 version "-sources.jar"))
5042 (sha256
5043 (base32
5044 "16mkf8jgj35pgzms7w1gyfq0gfm4ixw6c5xbbxzdj1la56c758ya"))))
5045 (build-system ant-build-system)
5046 (arguments
5047 `(#:tests? #f ; no tests included
5048 #:jar-name "eclipse-core-runtime.jar"))
5049 (inputs
5050 `(("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
5051 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
5052 ("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
5053 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5054 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5055 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5056 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5057 (home-page "https://www.eclipse.org/")
5058 (synopsis "Eclipse core runtime")
5059 (description "This package provides the Eclipse core runtime with the
5060module @code{org.eclipse.core.runtime}.")
5061 (license license:epl1.0)))
5062
b3806a15
RW
5063(define-public java-eclipse-core-filesystem
5064 (package
5065 (name "java-eclipse-core-filesystem")
5066 (version "1.6.1")
5067 (source (origin
5068 (method url-fetch)
5069 (uri (string-append "https://repo1.maven.org/maven2/"
5070 "org/eclipse/platform/org.eclipse.core.filesystem/"
5071 version "/org.eclipse.core.filesystem-"
5072 version "-sources.jar"))
5073 (sha256
5074 (base32
5075 "0km1bhwjim4rfy3pkvjhvy31kgsyf2ncx0mlkmbf5n6g57pphdyj"))))
5076 (build-system ant-build-system)
5077 (arguments
5078 `(#:tests? #f ; no tests included
5079 #:jar-name "eclipse-core-filesystem.jar"))
5080 (inputs
5081 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5082 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5083 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5084 (home-page "https://www.eclipse.org/")
5085 (synopsis "Eclipse core file system")
5086 (description "This package provides the Eclipse core file system with the
5087module @code{org.eclipse.core.filesystem}.")
5088 (license license:epl1.0)))
5089
e96060de
RW
5090(define-public java-eclipse-core-expressions
5091 (package
5092 (name "java-eclipse-core-expressions")
5093 (version "3.5.100")
5094 (source (origin
5095 (method url-fetch)
5096 (uri (string-append "https://repo1.maven.org/maven2/"
5097 "org/eclipse/platform/org.eclipse.core.expressions/"
5098 version "/org.eclipse.core.expressions-"
5099 version "-sources.jar"))
5100 (sha256
5101 (base32
5102 "18bw2l875gmygvpagpgk9l24qzbdjia4ag12nw6fi8v8yaq4987f"))))
5103 (build-system ant-build-system)
5104 (arguments
5105 `(#:tests? #f ; no tests included
5106 #:jar-name "eclipse-core-expressions.jar"))
5107 (inputs
5108 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5109 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5110 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5111 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5112 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5113 (home-page "https://www.eclipse.org/")
5114 (synopsis "Eclipse core expression language")
5115 (description "This package provides the Eclipse core expression language
5116with the @code{org.eclipse.core.expressions} module.")
5117 (license license:epl1.0)))
5118
e8d0f7c8
RW
5119(define-public java-eclipse-core-variables
5120 (package
5121 (name "java-eclipse-core-variables")
5122 (version "3.3.0")
5123 (source (origin
5124 (method url-fetch)
5125 (uri (string-append "https://repo1.maven.org/maven2/"
5126 "org/eclipse/platform/org.eclipse.core.variables/"
5127 version "/org.eclipse.core.variables-"
5128 version "-sources.jar"))
5129 (sha256
5130 (base32
5131 "12dirh03zi4n5x5cj07vzrhkmnqy6h9q10h9j605pagmpmifyxmy"))))
5132 (build-system ant-build-system)
5133 (arguments
5134 `(#:tests? #f ; no tests included
5135 #:jar-name "eclipse-core-variables.jar"))
5136 (inputs
5137 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5138 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5139 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5140 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5141 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5142 (home-page "https://www.eclipse.org/platform")
5143 (synopsis "Eclipse core variables")
5144 (description "This package provides the Eclipse core variables module
5145@code{org.eclipse.core.variables}.")
5146 (license license:epl1.0)))
5147
7c3d479e
RW
5148(define-public java-eclipse-ant-core
5149 (package
5150 (name "java-eclipse-ant-core")
5151 (version "3.4.100")
5152 (source (origin
5153 (method url-fetch)
5154 (uri (string-append "https://repo1.maven.org/maven2/"
5155 "org/eclipse/platform/org.eclipse.ant.core/"
5156 version "/org.eclipse.ant.core-"
5157 version "-sources.jar"))
5158 (sha256
5159 (base32
5160 "11g3if794qjlk98mz9zch22rr56sd7z63vn4i7k2icr8cq5bfqg7"))))
5161 (build-system ant-build-system)
5162 (arguments
5163 `(#:tests? #f ; no tests included
5164 #:jar-name "eclipse-ant-core.jar"))
5165 (inputs
5166 `(("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
5167 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5168 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5169 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5170 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
5171 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5172 ("java-eclipse-core-variables" ,java-eclipse-core-variables)
5173 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5174 (home-page "https://www.eclipse.org/platform")
5175 (synopsis "Ant build tool core libraries")
5176 (description "This package provides the ant build tool core libraries with
5177the module @code{org.eclipse.ant.core}.")
5178 (license license:epl1.0)))
5179
6636f638
RW
5180(define-public java-eclipse-core-resources
5181 (package
5182 (name "java-eclipse-core-resources")
5183 (version "3.11.1")
5184 (source (origin
5185 (method url-fetch)
5186 (uri (string-append "https://repo1.maven.org/maven2/"
5187 "org/eclipse/platform/org.eclipse.core.resources/"
5188 version "/org.eclipse.core.resources-"
5189 version "-sources.jar"))
5190 (sha256
5191 (base32
5192 "1hrfxrll6cpcagfksk2na1ypvkcnsp0fk6n3vcsrn97qayf9mx9l"))))
5193 (build-system ant-build-system)
5194 (arguments
5195 `(#:tests? #f ; no tests included
5196 #:jar-name "eclipse-core-resources.jar"))
5197 (inputs
5198 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5199 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5200 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5201 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
5202 ("java-eclipse-core-expressions" ,java-eclipse-core-expressions)
5203 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
5204 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
5205 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5206 ("java-eclipse-ant-core" ,java-eclipse-ant-core)
5207 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5208 (home-page "https://www.eclipse.org/")
5209 (synopsis "Eclipse core resource management")
5210 (description "This package provides the Eclipse core resource management
5211module @code{org.eclipse.core.resources}.")
5212 (license license:epl1.0)))
5213
afb5858d
RW
5214(define-public java-eclipse-compare-core
5215 (package
5216 (name "java-eclipse-compare-core")
5217 (version "3.6.0")
5218 (source (origin
5219 (method url-fetch)
5220 (uri (string-append "https://repo1.maven.org/maven2/"
5221 "org/eclipse/platform/org.eclipse.compare.core/"
5222 version "/org.eclipse.compare.core-"
5223 version "-sources.jar"))
5224 (sha256
5225 (base32
5226 "10g37r0pbiffyv2wk35c6g5lwzkdipkl0kkjp41v84dln46xm4dg"))))
5227 (build-system ant-build-system)
5228 (arguments
5229 `(#:tests? #f ; no tests included
5230 #:jar-name "eclipse-compare-core.jar"))
5231 (inputs
5232 `(("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5233 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5234 ("java-eclipse-osgi" ,java-eclipse-osgi)
5235 ("java-icu4j" ,java-icu4j)))
5236 (home-page "https://www.eclipse.org/")
5237 (synopsis "Eclipse core compare support")
5238 (description "This package provides the Eclipse core compare support
5239module @code{org.eclipse.compare.core}.")
5240 (license license:epl1.0)))
5241
1bb191fc
RW
5242(define-public java-eclipse-team-core
5243 (package
5244 (name "java-eclipse-team-core")
5245 (version "3.8.0")
5246 (source (origin
5247 (method url-fetch)
5248 (uri (string-append "https://repo1.maven.org/maven2/"
5249 "org/eclipse/platform/org.eclipse.team.core/"
5250 version "/org.eclipse.team.core-"
5251 version "-sources.jar"))
5252 (sha256
5253 (base32
5254 "02j2jzqgb26zx2d5ahxmvijw6j4r0la90zl5c3i65x6z19ciyam7"))))
5255 (build-system ant-build-system)
5256 (arguments
5257 `(#:tests? #f ; no tests included
5258 #:jar-name "eclipse-team-core.jar"))
5259 (inputs
5260 `(("java-eclipse-compare-core" ,java-eclipse-compare-core)
5261 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
5262 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
5263 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
5264 ("java-eclipse-core-resources" ,java-eclipse-core-resources)
5265 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5266 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5267 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5268 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5269 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5270 (home-page "https://www.eclipse.org/platform")
5271 (synopsis "Eclipse team support core")
5272 (description "This package provides the Eclipse team support core module
5273@code{org.eclipse.team.core}.")
5274 (license license:epl1.0)))
5275
31342529
RW
5276(define-public java-eclipse-core-commands
5277 (package
5278 (name "java-eclipse-core-commands")
5279 (version "3.8.1")
5280 (source (origin
5281 (method url-fetch)
5282 (uri (string-append "https://repo1.maven.org/maven2/"
5283 "org/eclipse/platform/org.eclipse.core.commands/"
5284 version "/org.eclipse.core.commands-"
5285 version "-sources.jar"))
5286 (sha256
5287 (base32
5288 "0yjn482qndcfrsq3jd6vnhcylp16420f5aqkrwr8spsprjigjcr9"))))
5289 (build-system ant-build-system)
5290 (arguments
5291 `(#:tests? #f ; no tests included
5292 #:jar-name "eclipse-core-commands.jar"))
5293 (inputs
5294 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)))
5295 (home-page "https://www.eclipse.org/platform")
5296 (synopsis "Eclipse core commands")
5297 (description "This package provides Eclipse core commands in the module
5298@code{org.eclipse.core.commands}.")
5299 (license license:epl1.0)))
5300
bf96acf7
RW
5301(define-public java-eclipse-text
5302 (package
5303 (name "java-eclipse-text")
5304 (version "3.6.0")
5305 (source (origin
5306 (method url-fetch)
5307 (uri (string-append "https://repo1.maven.org/maven2/"
5308 "org/eclipse/platform/org.eclipse.text/"
5309 version "/org.eclipse.text-"
5310 version "-sources.jar"))
5311 (sha256
5312 (base32
5313 "0scz70vzz5qs5caji9f5q01vkqnvip7dpri1q07l8wbbdcxn4cq1"))))
5314 (build-system ant-build-system)
5315 (arguments
5316 `(#:tests? #f ; no tests included
5317 #:jar-name "eclipse-text.jar"
5318 #:phases
5319 (modify-phases %standard-phases
5320 ;; When creating a new category we must make sure that the new list
5321 ;; matches List<Position>. By default it seems to be too generic
5322 ;; (ArrayList<Object>), so we specialize it to ArrayList<Position>.
5323 ;; Without this we get this error:
5324 ;;
5325 ;; [javac] .../src/org/eclipse/jface/text/AbstractDocument.java:376:
5326 ;; error: method put in interface Map<K,V> cannot be applied to given types;
5327 ;; [javac] fPositions.put(category, new ArrayList<>());
5328 ;; [javac] ^
5329 ;; [javac] required: String,List<Position>
5330 ;; [javac] found: String,ArrayList<Object>
5331 ;; [javac] reason: actual argument ArrayList<Object> cannot be converted
5332 ;; to List<Position> by method invocation conversion
5333 ;; [javac] where K,V are type-variables:
5334 ;; [javac] K extends Object declared in interface Map
5335 ;; [javac] V extends Object declared in interface Map
5336 ;;
5337 ;; I don't know if this is a good fix. I suspect it is not, but it
5338 ;; seems to work.
5339 (add-after 'unpack 'fix-compilation-error
5340 (lambda _
5341 (substitute* "src/org/eclipse/jface/text/AbstractDocument.java"
5342 (("Positions.put\\(category, new ArrayList<>\\(\\)\\);")
5343 "Positions.put(category, new ArrayList<Position>());"))
5344 #t)))))
5345 (inputs
5346 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5347 ("java-eclipse-core-commands" ,java-eclipse-core-commands)
5348 ("java-icu4j" ,java-icu4j)))
5349 (home-page "http://www.eclipse.org/platform")
5350 (synopsis "Eclipse text library")
5351 (description "Platform Text is part of the Platform UI project and
5352provides the basic building blocks for text and text editors within Eclipse
5353and contributes the Eclipse default text editor.")
5354 (license license:epl1.0)))
5355
c24d11b7
RW
5356(define-public java-eclipse-jdt-core
5357 (package
5358 (name "java-eclipse-jdt-core")
5359 (version "3.12.3")
5360 (source (origin
5361 (method url-fetch)
5362 (uri (string-append "https://repo1.maven.org/maven2/"
5363 "org/eclipse/jdt/org.eclipse.jdt.core/"
5364 version "/org.eclipse.jdt.core-"
5365 version "-sources.jar"))
5366 (sha256
5367 (base32
5368 "191xw4lc7mjjkprh4ji5vnpjvr5r4zvbpwkriy4bvsjqrz35vh1j"))))
5369 (build-system ant-build-system)
5370 (arguments
5371 `(#:tests? #f ; no tests included
5372 #:jar-name "eclipse-jdt-core.jar"))
5373 (inputs
5374 `(("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
5375 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
5376 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
5377 ("java-eclipse-core-resources" ,java-eclipse-core-resources)
5378 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5379 ("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
5380 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5381 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5382 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5383 ("java-eclipse-osgi" ,java-eclipse-osgi)
5384 ("java-eclipse-text" ,java-eclipse-text)))
5385 (home-page "https://www.eclipse.org/jdt")
5386 (synopsis "Java development tools core libraries")
5387 (description "This package provides the core libraries of the Eclipse Java
5388development tools.")
5389 (license license:epl1.0)))
5390
a5cdcf6c
RW
5391(define-public java-javax-mail
5392 (package
5393 (name "java-javax-mail")
5394 (version "1.5.6")
5395 (source (origin
5396 (method url-fetch)
5397 (uri (string-append "https://repo1.maven.org/maven2/"
5398 "com/sun/mail/javax.mail/"
5399 version "/javax.mail-"
5400 version "-sources.jar"))
5401 (sha256
5402 (base32
5403 "0sdlfgsc2b5s89xv1261y8i0jijcja019k2x1c8ngfn582w4jly9"))))
5404 (build-system ant-build-system)
5405 (arguments
5406 `(#:tests? #f ; no tests
5407 #:jar-name "javax-mail.jar"))
5408 (home-page "https://javamail.java.net")
5409 (synopsis "Reference implementation of the JavaMail API")
5410 (description
5411 "This package provides versions of the JavaMail API implementation, IMAP,
5412SMTP, and POP3 service providers, some examples, and documentation for the
5413JavaMail API.")
5414 ;; GPLv2 only with "classpath exception".
5415 (license license:gpl2)))
5416
0e660c4d
RW
5417(define-public java-log4j-api
5418 (package
5419 (name "java-log4j-api")
5420 (version "2.4.1")
5421 (source (origin
5422 (method url-fetch)
5423 (uri (string-append "mirror://apache/logging/log4j/" version
5424 "/apache-log4j-" version "-src.tar.gz"))
5425 (sha256
5426 (base32
5427 "0j5p9gik0jysh37nlrckqbky12isy95cpwg2gv5fas1rcdqbraxd"))))
5428 (build-system ant-build-system)
5429 (arguments
5430 `(#:tests? #f ; tests require unpackaged software
5431 #:jar-name "log4j-api.jar"
5432 #:make-flags
5433 (list (string-append "-Ddist.dir=" (assoc-ref %outputs "out")
5434 "/share/java"))
5435 #:phases
5436 (modify-phases %standard-phases
5437 (add-after 'unpack 'enter-dir
5438 (lambda _ (chdir "log4j-api") #t))
5439 ;; FIXME: The tests require additional software that has not been
5440 ;; packaged yet, such as
5441 ;; * org.apache.maven
5442 ;; * org.apache.felix
5443 (add-after 'enter-dir 'delete-tests
5444 (lambda _ (delete-file-recursively "src/test") #t)))))
5445 (inputs
5446 `(("java-osgi-core" ,java-osgi-core)
5447 ("java-hamcrest-core" ,java-hamcrest-core)
5448 ("java-junit" ,java-junit)))
5449 (home-page "http://logging.apache.org/log4j/2.x/")
5450 (synopsis "API module of the Log4j logging framework for Java")
5451 (description
5452 "This package provides the API module of the Log4j logging framework for
5453Java.")
5454 (license license:asl2.0)))
5455
dfef4231
JL
5456(define-public java-log4j-core
5457 (package
5458 (inherit java-log4j-api)
5459 (name "java-log4j-core")
5460 (inputs
5461 `(("java-osgi-core" ,java-osgi-core)
5462 ("java-hamcrest-core" ,java-hamcrest-core)
5463 ("java-log4j-api" ,java-log4j-api)
5464 ("java-mail" ,java-mail)
5465 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
5466 ("java-lmax-disruptor" ,java-lmax-disruptor)
5467 ("java-kafka" ,java-kafka-clients)
5468 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
5469 ("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
5470 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
5471 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
5472 ("java-fasterxml-jackson-dataformat-xml" ,java-fasterxml-jackson-dataformat-xml)
5473 ("java-fasterxml-jackson-dataformat-yaml" ,java-fasterxml-jackson-dataformat-yaml)
5474 ("java-commons-compress" ,java-commons-compress)
5475 ("java-commons-csv" ,java-commons-csv)
5476 ("java-jeromq" ,java-jeromq)
5477 ("java-junit" ,java-junit)))
5478 (native-inputs
5479 `(("hamcrest" ,java-hamcrest-all)
5480 ("java-commons-io" ,java-commons-io)
5481 ("java-commons-lang3" ,java-commons-lang3)
5482 ("slf4j" ,java-slf4j-api)))
5483 (arguments
5484 `(#:tests? #f ; tests require more dependencies
5485 #:test-dir "src/test"
5486 #:source-dir "src/main/java"
5487 #:jar-name "log4j-core.jar"
5488 #:jdk ,icedtea-8
5489 #:make-flags
5490 (list (string-append "-Ddist.dir=" (assoc-ref %outputs "out")
5491 "/share/java"))
5492 #:phases
5493 (modify-phases %standard-phases
5494 (add-after 'unpack 'enter-dir
5495 (lambda _ (chdir "log4j-core") #t)))))
5496 (synopsis "Core component of the Log4j framework")
5497 (description "This package provides the core component of the Log4j
5498logging framework for Java.")))
5499
2caf873e
JL
5500(define-public java-log4j-1.2-api
5501 (package
5502 (inherit java-log4j-api)
5503 (name "java-log4j-1.2-api")
5504 (arguments
5505 `(#:jar-name "java-log4j-1.2-api.jar"
5506 #:source-dir "log4j-1.2-api/src/main/java"
5507 #:jdk ,icedtea-8
5508 ;; Tests require maven-model (and other maven subprojects), which is a
5509 ;; cyclic dependency.
5510 #:tests? #f))
5511 (inputs
5512 `(("log4j-api" ,java-log4j-api)
5513 ("log4j-core" ,java-log4j-core)
5514 ("osgi-core" ,java-osgi-core)
5515 ("eclipse-osgi" ,java-eclipse-osgi)
5516 ("java-lmax-disruptor" ,java-lmax-disruptor)))))
5517
1c188f4e
HG
5518(define-public java-commons-cli
5519 (package
5520 (name "java-commons-cli")
5521 (version "1.3.1")
5522 (source (origin
5523 (method url-fetch)
5524 (uri (string-append "mirror://apache/commons/cli/source/"
5525 "commons-cli-" version "-src.tar.gz"))
5526 (sha256
5527 (base32
5528 "1fkjn552i12vp3xxk21ws4p70fi0lyjm004vzxsdaz7gdpgyxxyl"))))
5529 (build-system ant-build-system)
5530 ;; TODO: javadoc
5531 (arguments
5532 `(#:jar-name "commons-cli.jar"))
5533 (native-inputs
5534 `(("java-junit" ,java-junit)
5535 ("java-hamcrest-core" ,java-hamcrest-core)))
5536 (home-page "http://commons.apache.org/cli/")
5537 (synopsis "Command line arguments and options parsing library")
5538 (description "The Apache Commons CLI library provides an API for parsing
5539command line options passed to programs. It is also able to print help
5540messages detailing the options available for a command line tool.
5541
5542Commons CLI supports different types of options:
5543
5544@itemize
5545@item POSIX like options (ie. tar -zxvf foo.tar.gz)
5546@item GNU like long options (ie. du --human-readable --max-depth=1)
5547@item Java like properties (ie. java -Djava.awt.headless=true Foo)
5548@item Short options with value attached (ie. gcc -O2 foo.c)
5549@item long options with single hyphen (ie. ant -projecthelp)
5550@end itemize
5551
5552This is a part of the Apache Commons Project.")
5553 (license license:asl2.0)))
0a8519bc
HG
5554
5555(define-public java-commons-codec
5556 (package
5557 (name "java-commons-codec")
5558 (version "1.10")
5559 (source (origin
5560 (method url-fetch)
5561 (uri (string-append "mirror://apache/commons/codec/source/"
5562 "commons-codec-" version "-src.tar.gz"))
5563 (sha256
5564 (base32
5565 "1w9qg30y4s0x8gnmr2fgj4lyplfn788jqxbcz27lf5kbr6n8xr65"))))
5566 (build-system ant-build-system)
5567 (outputs '("out" "doc"))
5568 (arguments
5569 `(#:test-target "test"
5570 #:make-flags
5571 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
5572 (junit (assoc-ref %build-inputs "java-junit")))
5573 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
5574 (string-append "-Dhamcrest.jar=" hamcrest
5575 "/share/java/hamcrest-core.jar")
5576 ;; Do not append version to jar.
5577 "-Dfinal.name=commons-codec"))
5578 #:phases
5579 (modify-phases %standard-phases
5580 (add-after 'build 'build-javadoc ant-build-javadoc)
5581 (replace 'install (install-jars "dist"))
5582 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
5583 (native-inputs
5584 `(("java-junit" ,java-junit)
5585 ("java-hamcrest-core" ,java-hamcrest-core)))
5586 (home-page "http://commons.apache.org/codec/")
5587 (synopsis "Common encoders and decoders such as Base64, Hex, Phonetic and URLs")
5588 (description "The codec package contains simple encoder and decoders for
5589various formats such as Base64 and Hexadecimal. In addition to these widely
5590used encoders and decoders, the codec package also maintains a collection of
5591phonetic encoding utilities.
5592
5593This is a part of the Apache Commons Project.")
5594 (license license:asl2.0)))
7d91c1b9
HG
5595
5596(define-public java-commons-daemon
5597 (package
5598 (name "java-commons-daemon")
5599 (version "1.0.15")
5600 (source (origin
5601 (method url-fetch)
5602 (uri (string-append "mirror://apache/commons/daemon/source/"
5603 "commons-daemon-" version "-src.tar.gz"))
5604 (sha256
5605 (base32
5606 "0ci46kq8jpz084ccwq0mmkahcgsmh20ziclp2jf5i0djqv95gvhi"))))
5607 (build-system ant-build-system)
5608 (arguments
5609 `(#:test-target "test"
5610 #:phases
5611 (modify-phases %standard-phases
5612 (add-after 'build 'build-javadoc ant-build-javadoc)
5613 (replace 'install (install-jars "dist"))
5614 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
5615 (native-inputs
5616 `(("java-junit" ,java-junit)))
5617 (home-page "http://commons.apache.org/daemon/")
5618 (synopsis "Library to launch Java applications as daemons")
5619 (description "The Daemon package from Apache Commons can be used to
5620implement Java applications which can be launched as daemons. For example the
5621program will be notified about a shutdown so that it can perform cleanup tasks
5622before its process of execution is destroyed by the operation system.
5623
5624This package contains the Java library. You will also need the actual binary
5625for your architecture which is provided by the jsvc package.
5626
5627This is a part of the Apache Commons Project.")
5628 (license license:asl2.0)))
9f68e74a 5629
eb270ecf
RW
5630(define-public java-javaewah
5631 (package
5632 (name "java-javaewah")
5633 (version "1.1.6")
5634 (source (origin
5635 (method url-fetch)
5636 (uri (string-append "https://github.com/lemire/javaewah/"
5637 "archive/JavaEWAH-" version ".tar.gz"))
5638 (sha256
5639 (base32
5640 "1n7j1r1h24wlhwv9zdcj6yqjrhma2ixwyzm15l5vrv6yqjs6753b"))))
5641 (build-system ant-build-system)
5642 (arguments `(#:jar-name "javaewah.jar"))
5643 (inputs
5644 `(("java-junit" ,java-junit)
5645 ("java-hamcrest-core" ,java-hamcrest-core)))
5646 (home-page "https://github.com/lemire/javaewah")
5647 (synopsis "Compressed alternative to the Java @code{BitSet} class")
5648 (description "This is a word-aligned compressed variant of the Java
5649@code{Bitset} class. It provides both a 64-bit and a 32-bit RLE-like
5650compression scheme. It can be used to implement bitmap indexes.
5651
5652The goal of word-aligned compression is not to achieve the best compression,
5653but rather to improve query processing time. Hence, JavaEWAH tries to save CPU
5654cycles, maybe at the expense of storage. However, the EWAH scheme is always
5655more efficient storage-wise than an uncompressed bitmap (as implemented in the
5656@code{BitSet} class by Sun).")
5657 ;; GPL2.0 derivates are explicitly allowed.
5658 (license license:asl2.0)))
5659
f8e4d022
RW
5660(define-public java-slf4j-api
5661 (package
5662 (name "java-slf4j-api")
5663 (version "1.7.25")
5664 (source (origin
5665 (method url-fetch)
5666 (uri (string-append "https://www.slf4j.org/dist/slf4j-"
5667 version ".tar.gz"))
5668 (sha256
5669 (base32
5670 "13j51sgzmhhdrfa74gkal5zpip7r1440dh7zsi2c8bpb2zs1v8kb"))
5671 (modules '((guix build utils)))
5672 ;; Delete bundled jars.
5673 (snippet
5674 '(begin
5675 (for-each delete-file (find-files "." "\\.jar$"))
5676 #t))))
5677 (build-system ant-build-system)
5678 (arguments
dcf7a8a6 5679 `(#:jar-name "slf4j-api.jar"
f8e4d022 5680 #:source-dir "slf4j-api/src/main"
dcf7a8a6
JL
5681 #:test-dir "slf4j-api/src/test"
5682 #:phases
5683 (modify-phases %standard-phases
5684 (add-after 'build 'regenerate-jar
5685 (lambda _
5686 ;; pom.xml ignores these files in the jar creation process. If we don't,
5687 ;; we get the error "This code should have never made it into slf4j-api.jar"
5688 (delete-file-recursively "build/classes/org/slf4j/impl")
5689 (zero? (system* "jar" "-cf" "build/jar/slf4j-api.jar" "-C"
5690 "build/classes" "."))))
5691 (add-before 'check 'dont-test-abstract-classes
5692 (lambda _
5693 ;; abstract classes are not meant to be run with junit
5694 (substitute* "build.xml"
5695 (("<include name=\"\\*\\*/\\*Test.java\" />")
5696 (string-append "<include name=\"**/*Test.java\" />"
5697 "<exclude name=\"**/MultithreadedInitializationTest"
5698 ".java\" />"))))))))
f8e4d022
RW
5699 (inputs
5700 `(("java-junit" ,java-junit)
5701 ("java-hamcrest-core" ,java-hamcrest-core)))
5702 (home-page "https://www.slf4j.org/")
5703 (synopsis "Simple logging facade for Java")
5704 (description "The Simple Logging Facade for Java (SLF4J) serves as a
5705simple facade or abstraction for various logging
5706frameworks (e.g. @code{java.util.logging}, @code{logback}, @code{log4j})
5707allowing the end user to plug in the desired logging framework at deployment
5708time.")
5709 (license license:expat)))
5710
88f256a1
TD
5711(define-public java-slf4j-simple
5712 (package
5713 (name "java-slf4j-simple")
5714 (version "1.7.25")
5715 (source (package-source java-slf4j-api))
5716 (build-system ant-build-system)
5717 (arguments
5718 `(#:jar-name "slf4j-simple.jar"
5719 #:source-dir "slf4j-simple/src/main"
5720 #:test-dir "slf4j-simple/src/test"
5721 #:phases
5722 (modify-phases %standard-phases
5723 ;; The tests need some test classes from slf4j-api
5724 (add-before 'check 'build-slf4j-api-test-helpers
5725 (lambda _
5726 ;; Add current dir to CLASSPATH ...
5727 (setenv "CLASSPATH"
5728 (string-append (getcwd) ":" (getenv "CLASSPATH")))
5729 ;; ... and build test helper classes here:
5730 (zero?
5731 (apply system*
5732 `("javac" "-d" "."
5733 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))))))
5734 (inputs
5735 `(("java-junit" ,java-junit)
5736 ("java-hamcrest-core" ,java-hamcrest-core)
5737 ("java-slf4j-api" ,java-slf4j-api)))
5738 (home-page "https://www.slf4j.org/")
5739 (synopsis "Simple implementation of simple logging facade for Java")
5740 (description "SLF4J binding for the Simple implementation, which outputs
5741all events to System.err. Only messages of level INFO and higher are
5742printed.")
5743 (license license:expat)))
5744
9f68e74a
JL
5745(define-public antlr2
5746 (package
5747 (name "antlr2")
5748 (version "2.7.7")
5749 (source (origin
5750 (method url-fetch)
5751 (uri (string-append "http://www.antlr2.org/download/antlr-"
5752 version ".tar.gz"))
5753 (sha256
5754 (base32
5755 "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5"))
5756 (modules '((guix build utils)))
5757 (snippet
5758 '(begin
5759 (delete-file "antlr.jar")
5760 (substitute* "lib/cpp/antlr/CharScanner.hpp"
5761 (("#include <map>")
5762 (string-append
6d225e89
RW
5763 "#include <map>\n"
5764 "#define EOF (-1)\n"
5765 "#include <strings.h>")))
9f68e74a 5766 (substitute* "configure"
6d225e89
RW
5767 (("/bin/sh") "sh"))
5768 #t))))
9f68e74a
JL
5769 (build-system gnu-build-system)
5770 (arguments
6d225e89 5771 `(#:tests? #f ; no test target
3ad90395
RW
5772 #:imported-modules ((guix build ant-build-system)
5773 (guix build syscalls)
5774 ,@%gnu-build-system-modules)
5775 #:modules (((guix build ant-build-system) #:prefix ant:)
5776 (guix build gnu-build-system)
5777 (guix build utils))
9f68e74a
JL
5778 #:phases
5779 (modify-phases %standard-phases
5780 (add-after 'install 'strip-jar-timestamps
3ad90395 5781 (assoc-ref ant:%standard-phases 'strip-jar-timestamps))
9f68e74a
JL
5782 (add-after 'configure 'fix-bin-ls
5783 (lambda _
3ad90395
RW
5784 (substitute* (find-files "." "Makefile")
5785 (("/bin/ls") "ls"))
5786 #t)))))
9f68e74a
JL
5787 (native-inputs
5788 `(("which" ,which)
5789 ("zip" ,zip)
5790 ("java" ,icedtea "jdk")))
5791 (inputs
5792 `(("java" ,icedtea)))
5793 (home-page "http://www.antlr2.org")
5794 (synopsis "Framework for constructing recognizers, compilers, and translators")
5795 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
5796is a language tool that provides a framework for constructing recognizers,
5797compilers, and translators from grammatical descriptions containing Java, C#,
5798C++, or Python actions. ANTLR provides excellent support for tree construction,
5799tree walking, and translation.")
5800 (license license:public-domain)))
a0f15eff 5801
e44112e1 5802(define-public java-stringtemplate-3
a0f15eff 5803 (package
e44112e1 5804 (name "java-stringtemplate")
a0f15eff
JL
5805 (version "3.2.1")
5806 (source (origin
5807 (method url-fetch)
5808 (uri (string-append "https://github.com/antlr/website-st4/raw/"
5809 "gh-pages/download/stringtemplate-"
5810 version ".tar.gz"))
5811 (sha256
5812 (base32
5813 "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is"))))
5814 (build-system ant-build-system)
5815 (arguments
129d926d 5816 `(#:jar-name (string-append ,name "-" ,version ".jar")
2fcda6d2 5817 #:test-dir "test"
b101b4e8
RW
5818 #:modules ((guix build ant-build-system)
5819 (guix build utils)
5820 (srfi srfi-1))
a0f15eff
JL
5821 #:phases
5822 (modify-phases %standard-phases
2fcda6d2
RW
5823 (add-before 'check 'fix-tests
5824 (lambda _
5825 (substitute* "build.xml"
5826 (("\\$\\{test.home\\}/java")
5827 "${test.home}/org"))
5828 #t))
a0f15eff
JL
5829 (add-before 'build 'generate-grammar
5830 (lambda _
b101b4e8
RW
5831 (with-directory-excursion "src/org/antlr/stringtemplate/language/"
5832 (every (lambda (file)
5833 (format #t "~a\n" file)
5834 (zero? (system* "antlr" file)))
5835 '("template.g" "angle.bracket.template.g" "action.g"
5836 "eval.g" "group.g" "interface.g"))))))))
a0f15eff 5837 (native-inputs
2fcda6d2
RW
5838 `(("antlr" ,antlr2)
5839 ("java-junit" ,java-junit)))
a0f15eff
JL
5840 (home-page "http://www.stringtemplate.org")
5841 (synopsis "Template engine to generate formatted text output")
5842 (description "StringTemplate is a java template engine (with ports for C#,
5843Objective-C, JavaScript, Scala) for generating source code, web pages, emails,
5844or any other formatted text output. StringTemplate is particularly good at
5845code generators, multiple site skins, and internationalization / localization.
5846StringTemplate also powers ANTLR.")
5847 (license license:bsd-3)))
4ad8aed7
JL
5848
5849;; antlr3 is partially written using antlr3 grammar files. It also depends on
5850;; ST4 (stringtemplate4), which is also partially written using antlr3 grammar
5851;; files and uses antlr3 at runtime. The latest version requires a recent version
5852;; of antlr3 at runtime.
5853;; Fortunately, ST4 4.0.6 can be built with an older antlr3, and we use antlr3.3.
5854;; This version of ST4 is sufficient for the latest antlr3.
5855;; We use ST4 4.0.6 to build a boostrap antlr3 (latest version), and build
5856;; the latest ST4 with it. Then we build our final antlr3 that will be linked
5857;; against the latest ST4.
5858;; antlr3.3 still depends on antlr3 to generate some files, so we use an
5859;; even older version, antlr3.1, to generate them. Fortunately antlr3.1 uses
5860;; only grammar files with the antlr2 syntax.
5861;; So we build antlr3.1 -> antlr3.3 -> ST4.0.6 -> antlr3-bootstrap -> ST4 -> antlr3.
5862
64b7efc0 5863(define-public java-stringtemplate
407df789 5864 (package (inherit java-stringtemplate-3)
64b7efc0 5865 (name "java-stringtemplate")
4ad8aed7
JL
5866 (version "4.0.8")
5867 (source (origin
5868 (method url-fetch)
5869 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/"
5870 version ".tar.gz"))
5871 (file-name (string-append name "-" version ".tar.gz"))
5872 (sha256
5873 (base32
5874 "1pri8hqa95rfdkjy55icl5q1m09zwp5k67ib14abas39s4v3w087"))))
5875 (build-system ant-build-system)
5876 (arguments
6db77c7c
RW
5877 `(#:jar-name (string-append ,name "-" ,version ".jar")
5878 #:tests? #f ; FIXME: tests fail for unknown reasons
5879 #:test-dir "test"
f4aa4cfe
RW
5880 #:modules ((guix build ant-build-system)
5881 (guix build utils)
5882 (srfi srfi-1))
4ad8aed7
JL
5883 #:phases
5884 (modify-phases %standard-phases
6db77c7c
RW
5885 (add-before 'check 'fix-test-target
5886 (lambda _
5887 (substitute* "build.xml"
5888 (("\\$\\{test.home\\}/java") "${test.home}/")
5889 (("\\*Test.java") "Test*.java"))
5890 #t))
4ad8aed7 5891 (add-before 'build 'generate-grammar
f4aa4cfe
RW
5892 (lambda _
5893 (with-directory-excursion "src/org/stringtemplate/v4/compiler/"
5894 (every (lambda (file)
5895 (format #t "~a\n" file)
5896 (zero? (system* "antlr3" file)))
5897 '("STParser.g" "Group.g" "CodeGenerator.g"))))))))
4ad8aed7
JL
5898 (inputs
5899 `(("antlr3" ,antlr3-bootstrap)
5900 ("antlr2" ,antlr2)
6db77c7c
RW
5901 ("java-stringtemplate" ,java-stringtemplate-3)
5902 ("java-junit" ,java-junit)))))
4ad8aed7 5903
1345eeb0 5904(define java-stringtemplate-4.0.6
64b7efc0 5905 (package (inherit java-stringtemplate)
1345eeb0 5906 (name "java-stringtemplate")
4ad8aed7
JL
5907 (version "4.0.6")
5908 (source (origin
5909 (method url-fetch)
5910 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/ST-"
5911 version ".tar.gz"))
5912 (file-name (string-append name "-" version ".tar.gz"))
5913 (sha256
5914 (base32
5915 "0hjmh1ahdsh3w825i67mli9l4nncc4l6hdbf9ma91jvlj590sljp"))))
5916 (inputs
5917 `(("antlr3" ,antlr3-3.3)
5918 ("antlr2" ,antlr2)
e44112e1 5919 ("java-stringtemplate" ,java-stringtemplate-3)))))
4ad8aed7
JL
5920
5921(define-public antlr3
5922 (package
5923 (name "antlr3")
5924 (version "3.5.2")
5925 (source (origin
5926 (method url-fetch)
5927 (uri (string-append "https://github.com/antlr/antlr3/archive/"
5928 version ".tar.gz"))
5929 (file-name (string-append name "-" version ".tar.gz"))
5930 (sha256
5931 (base32
fd75eb6c 5932 "0218v683081lg54z9hvjxinhxd4dqp870jx6n39gslm0bkyi4vd6"))))
4ad8aed7
JL
5933 (build-system ant-build-system)
5934 (arguments
5935 `(#:jar-name (string-append ,name "-" ,version ".jar")
5936 #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3"
5937 #:tests? #f
5938 #:phases
5939 (modify-phases %standard-phases
5940 (add-after 'install 'bin-install
5941 (lambda* (#:key inputs outputs #:allow-other-keys)
5942 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
5943 (bin (string-append (assoc-ref outputs "out") "/bin")))
5944 (mkdir-p bin)
5945 (with-output-to-file (string-append bin "/antlr3")
5946 (lambda _
5947 (display
5948 (string-append "#!" (which "sh") "\n"
5949 "java -cp " jar "/" ,name "-" ,version ".jar:"
5950 (string-concatenate
5951 (find-files (assoc-ref inputs "stringtemplate")
5952 ".*\\.jar"))
5953 ":"
5954 (string-concatenate
5955 (find-files (assoc-ref inputs "stringtemplate4")
5956 ".*\\.jar"))
5957 ":"
5958 (string-concatenate
5959 (find-files (string-append
5960 (assoc-ref inputs "antlr")
5961 "/lib")
5962 ".*\\.jar"))
5963 " org.antlr.Tool $*"))))
5964 (chmod (string-append bin "/antlr3") #o755))))
5965 (add-before 'build 'generate-grammar
5966 (lambda _
5967 (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/")
5968 (for-each (lambda (file)
5969 (display file)
5970 (newline)
5971 (system* "antlr3" file))
5972 '("ANTLR.g" "ANTLRTreePrinter.g" "ActionAnalysis.g"
5973 "AssignTokenTypesWalker.g"
5974 "ActionTranslator.g" "TreeToNFAConverter.g"
5975 "ANTLRv3.g" "ANTLRv3Tree.g" "LeftRecursiveRuleWalker.g"
5976 "CodeGenTreeWalker.g" "DefineGrammarItemsWalker.g"))
5977 (substitute* "ANTLRParser.java"
5978 (("public Object getTree") "public GrammarAST getTree"))
5979 (substitute* "ANTLRv3Parser.java"
5980 (("public Object getTree") "public CommonTree getTree"))
5981 (chdir "../../../../../java")
5982 (system* "antlr" "-o" "org/antlr/tool"
5983 "org/antlr/tool/serialize.g")
5984 (substitute* "org/antlr/tool/LeftRecursiveRuleAnalyzer.java"
5985 (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*;
5986import org.antlr.grammar.v3.ANTLRTreePrinter;"))
5987 (substitute* "org/antlr/tool/ErrorManager.java"
5988 (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") ""))
5989 (chdir "../../../..")))
5990 (add-before 'build 'fix-build-xml
5991 (lambda _
5992 (substitute* "build.xml"
5993 (("<exec") "<copy todir=\"${classes.dir}\">
5994<fileset dir=\"tool/src/main/resources\">
5995<include name=\"**/*.stg\"/>
5996<include name=\"**/*.st\"/>
5997<include name=\"**/*.sti\"/>
5998<include name=\"**/STLexer.tokens\"/>
5999</fileset>
6000</copy><exec")))))))
6001 (native-inputs
6002 `(("antlr" ,antlr2)
6003 ("antlr3" ,antlr3-bootstrap)))
6004 (inputs
6005 `(("junit" ,java-junit)
e44112e1 6006 ("stringtemplate" ,java-stringtemplate-3)
64b7efc0 6007 ("stringtemplate4" ,java-stringtemplate)))
4ad8aed7 6008 (propagated-inputs
e44112e1 6009 `(("stringtemplate" ,java-stringtemplate-3)
4ad8aed7 6010 ("antlr" ,antlr2)
1345eeb0 6011 ("stringtemplate4" ,java-stringtemplate-4.0.6)))
4ad8aed7
JL
6012 (home-page "http://www.antlr3.org")
6013 (synopsis "Framework for constructing recognizers, compilers, and translators")
6014 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
6015is a language tool that provides a framework for constructing recognizers,
6016compilers, and translators from grammatical descriptions containing Java, C#,
6017C++, or Python actions. ANTLR provides excellent support for tree construction,
6018tree walking, and translation.")
6019 (license license:bsd-3)))
6020
6021(define antlr3-bootstrap
6022 (package
6023 (inherit antlr3)
6024 (name "antlr3-bootstrap")
6025 (native-inputs
6026 `(("antlr" ,antlr2)
6027 ("antlr3" ,antlr3-3.3)))
6028 (inputs
6029 `(("junit" ,java-junit)))))
6030
6031(define antlr3-3.3
6032 (package
6033 (inherit antlr3)
6034 (name "antlr3")
6035 (version "3.3")
6036 (source (origin
6037 (method url-fetch)
6038 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
6039 "gh-pages/download/antlr-"
6040 version ".tar.gz"))
6041 (sha256
6042 (base32
48c86220
GB
6043 "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m"))
6044 (patches
6045 (search-patches "antlr3-3_3-fix-java8-compilation.patch"))))
4ad8aed7
JL
6046 (arguments
6047 `(#:jar-name (string-append ,name "-" ,version ".jar")
a9540107
RW
6048 #:source-dir (string-join '("tool/src/main/java"
6049 "runtime/Java/src/main/java"
6050 "tool/src/main/antlr2"
6051 "tool/src/main/antlr3")
6052 ":")
6053 #:tests? #f ; FIXME: tests seem to require maven plugin
6054 #:modules ((guix build ant-build-system)
6055 (guix build utils)
6056 (srfi srfi-1))
4ad8aed7
JL
6057 #:phases
6058 (modify-phases %standard-phases
6059 (add-after 'install 'bin-install
6060 (lambda* (#:key inputs outputs #:allow-other-keys)
a9540107
RW
6061 (let* ((out (assoc-ref outputs "out"))
6062 (jar (string-append out "/share/java"))
6063 (bin (string-append out "/bin")))
4ad8aed7
JL
6064 (mkdir-p bin)
6065 (with-output-to-file (string-append bin "/antlr3")
6066 (lambda _
6067 (display
a9540107
RW
6068 (string-append
6069 "#!" (which "sh") "\n"
6070 "java -cp " jar "/antlr3-3.3.jar:"
6071 (string-join
6072 (append (find-files (assoc-ref inputs "java-stringtemplate")
6073 ".*\\.jar$")
6074 (find-files (string-append (assoc-ref inputs "antlr")
6075 "/lib")
6076 ".*\\.jar$"))
6077 ":")
6078 " org.antlr.Tool $*"))))
6079 (chmod (string-append bin "/antlr3") #o755)
6080 #t)))
4ad8aed7
JL
6081 (add-before 'build 'generate-grammar
6082 (lambda _
4ad8aed7
JL
6083 (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java"
6084 (("import org.antlr.grammar.v2.\\*;")
6085 "import org.antlr.grammar.v2.*;\n
6086import org.antlr.grammar.v2.TreeToNFAConverter;\n
6087import org.antlr.grammar.v2.DefineGrammarItemsWalker;\n
a9540107
RW
6088import org.antlr.grammar.v2.ANTLRTreePrinter;"))
6089 (and
6090 (with-directory-excursion "tool/src/main/antlr2/org/antlr/grammar/v2/"
6091 (every (lambda (file)
6092 (format #t "~a\n" file)
6093 (zero? (system* "antlr" file)))
6094 '("antlr.g" "antlr.print.g" "assign.types.g"
6095 "buildnfa.g" "codegen.g" "define.g")))
6096 (with-directory-excursion "tool/src/main/antlr3/org/antlr/grammar/v3/"
6097 (every (lambda (file)
6098 (format #t "~a\n" file)
6099 (zero? (system* "antlr3" file)))
6100 '("ActionAnalysis.g" "ActionTranslator.g" "ANTLRv3.g"
6101 "ANTLRv3Tree.g"))))))
4ad8aed7
JL
6102 (add-before 'build 'fix-build-xml
6103 (lambda _
6104 (substitute* "build.xml"
6105 (("<exec") "<copy todir=\"${classes.dir}\">
6106<fileset dir=\"tool/src/main/resources\">
6107<include name=\"**/*.stg\"/>
6108<include name=\"**/*.st\"/>
6109<include name=\"**/*.sti\"/>
6110<include name=\"**/STLexer.tokens\"/>
6111</fileset>
a9540107
RW
6112</copy><exec"))
6113 #t)))))
4ad8aed7
JL
6114 (native-inputs
6115 `(("antlr" ,antlr2)
6116 ("antlr3" ,antlr3-3.1)))
6117 (inputs
6118 `(("junit" ,java-junit)))
6119 (propagated-inputs
e44112e1 6120 `(("java-stringtemplate" ,java-stringtemplate-3)
4ad8aed7
JL
6121 ("antlr" ,antlr2)
6122 ("antlr3" ,antlr3-3.1)))))
6123
6124(define antlr3-3.1
6125 (package
6126 (inherit antlr3)
4ad8aed7
JL
6127 (version "3.1")
6128 (source (origin
6129 (method url-fetch)
6130 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
6131 "gh-pages/download/antlr-"
6132 version ".tar.gz"))
6133 (sha256
6134 (base32
4c763b4d
GB
6135 "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z"))
6136 (patches
6137 (search-patches "antlr3-3_1-fix-java8-compilation.patch"))))
4ad8aed7 6138 (arguments
ec32bc98 6139 `(#:jar-name (string-append "antlr3-" ,version ".jar")
4ad8aed7
JL
6140 #:source-dir "src:runtime/Java/src"
6141 #:tests? #f
6142 #:phases
6143 (modify-phases %standard-phases
6144 (add-after 'install 'bin-install
6145 (lambda* (#:key inputs outputs #:allow-other-keys)
6146 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
6147 (bin (string-append (assoc-ref outputs "out") "/bin")))
6148 (mkdir-p bin)
6149 (with-output-to-file (string-append bin "/antlr3")
6150 (lambda _
6151 (display
6152 (string-append "#!" (which "sh") "\n"
6153 "java -cp " jar "/antlr3-3.1-3.1.jar:"
6154 (string-concatenate
6155 (find-files (assoc-ref inputs "stringtemplate")
6156 ".*\\.jar"))
6157 ":"
6158 (string-concatenate
6159 (find-files (string-append
6160 (assoc-ref inputs "antlr")
6161 "/lib")
6162 ".*\\.jar"))
6163 " org.antlr.Tool $*"))))
6164 (chmod (string-append bin "/antlr3") #o755))))
6165 (add-before 'build 'generate-grammar
6166 (lambda _
6167 (let ((dir "src/org/antlr/tool/"))
6168 (for-each (lambda (file)
6169 (display file)
6170 (newline)
13f38d31 6171 (invoke "antlr" "-o" dir (string-append dir file)))
4ad8aed7
JL
6172 '("antlr.g" "antlr.print.g" "assign.types.g"
6173 "buildnfa.g" "define.g")))
6174 (format #t "codegen.g\n")
13f38d31
RW
6175 (invoke "antlr" "-o" "src/org/antlr/codegen"
6176 "src/org/antlr/codegen/codegen.g")
6177 #t))
4ad8aed7
JL
6178 (add-before 'build 'fix-build-xml
6179 (lambda _
6180 (substitute* "build.xml"
6181 (("<exec") "<copy todir=\"${classes.dir}\">
6182<fileset dir=\"src\">
6183<include name=\"**/*.stg\"/>
6184<include name=\"**/*.st\"/>
6185<include name=\"**/*.sti\"/>
6186<include name=\"**/STLexer.tokens\"/>
6187</fileset>
6188</copy><exec")))))))
6189 (native-inputs
6190 `(("antlr" ,antlr2)))
6191 (inputs
6192 `(("junit" ,java-junit)))
6193 (propagated-inputs
e44112e1 6194 `(("stringtemplate" ,java-stringtemplate-3)))))
d44bcd7a 6195
742242a5
GB
6196(define-public java-commons-cli-1.2
6197 ;; This is a bootstrap dependency for Maven2.
6198 (package
6199 (inherit java-commons-cli)
6200 (version "1.2")
6201 (source (origin
6202 (method url-fetch)
6203 (uri (string-append "mirror://apache/commons/cli/source/"
6204 "commons-cli-" version "-src.tar.gz"))
6205 (sha256
6206 (base32
6207 "0rvfgzgv2pc1m091dfj3ih9ddsjjppr1f1wf0qmc3bk6b1kwv2dm"))))
6208 (arguments
6209 `(#:jar-name "commons-cli.jar"
6210 #:phases
6211 (modify-phases %standard-phases
6212 (add-before 'check 'fix-build-xml
6213 (lambda* (#:key inputs #:allow-other-keys)
6214 (substitute* "build.xml"
6215 (("dir=\"\\$\\{test.home\\}/java\"")
6216 "dir=\"${test.home}\""))
6217 #t)))))
6218 (native-inputs
6219 `(("java-junit" ,java-junit)))))
30deadee
JL
6220
6221(define-public java-microemulator-cldc
6222 (package
6223 (name "java-microemulator-cldc")
6224 (version "2.0.4")
6225 (source (origin
6226 (method url-fetch)
6227 (uri (string-append "https://github.com/barteo/microemu/archive/"
6228 "microemulator_"
6229 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
6230 version)
6231 ".tar.gz"))
6232 (file-name (string-append name "-" version ".tar.gz"))
6233 (sha256
6234 (base32
6235 "1x1apmz38gkppxnwnygwmi12j54v4p258v8ddzn6dldkk7vak1ll"))))
6236 (build-system ant-build-system)
6237 (arguments
6238 `(#:jar-name "microemulator-cldc.jar"
6239 #:source-dir "microemu-cldc/src/main/java"
6240 #:tests? #f)); Requires even older software
6241 (home-page "https://github.com/barteo/microemu")
6242 (synopsis "J2ME CLDC emulator")
6243 (description "Microemulator is a Java 2 Micro Edition (J2ME) CLDC/MIDP
6244Emulator. It allows to demonstrate MIDlet based applications in web browser
6245applet and can be run as a standalone java application.")
6246 (license (list license:asl2.0
6247 ;; or altenatively:
6248 license:lgpl2.1+))))
8e2f3e5e
JL
6249
6250(define-public java-datanucleus-javax-persistence
6251 (package
6252 (name "java-datanucleus-javax-persistence")
6253 (version "2.2.0")
6254 (source (origin
6255 (method url-fetch)
6256 (uri (string-append "https://github.com/datanucleus/"
6257 "javax.persistence/archive/javax.persistence-"
6258 version "-release.tar.gz"))
6259 (sha256
6260 (base32
6261 "11jx0fjwgc2hhbqqgdd6m1pf2fplf9vslppygax0y1z5csnqjhpx"))))
6262 (build-system ant-build-system)
6263 (arguments
6264 `(#:jar-name "java-datanucleus-javax-persistence.jar"
6265 #:jdk ,icedtea-8
6266 #:source-dir "src/main/java"
6267 #:tests? #f)); no tests
6268 (home-page "https://github.com/datanucleus/javax.persistence")
6269 (synopsis "JPA API")
6270 (description "This package contains a clean definition of JPA API intended
6271for use with DataNucleus JPA since the JCP haven't provided an official JPA API
6272jar. See @url{http://java.net/projects/jpa-spec/downloads} for the specification
6273used to generate this API.")
6274 (license (list license:edl1.0 license:epl1.0))))
3240ddbf
JL
6275
6276(define-public java-osgi-cmpn
6277 (package
6278 (name "java-osgi-cmpn")
6279 (version "6.0.0")
6280 (source (origin
6281 (method url-fetch)
6282 (uri (string-append "http://central.maven.org/maven2/"
6283 "org/osgi/osgi.cmpn/" version "/osgi.cmpn-"
6284 version "-sources.jar"))
6285 (sha256
6286 (base32
6287 "1lmb6xyrmkqdhv1kayf0514rlwq6ypvs4m44ibrck3snp8241wys"))))
6288 (build-system ant-build-system)
6289 (arguments
6290 `(#:jar-name "osgi-cmpn.jar"
6291 #:tests? #f)); no tests
6292 (inputs
6293 `(("annotation" ,java-osgi-annotation)
6294 ("core" ,java-osgi-core)
6295 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
6296 ("microemulator" ,java-microemulator-cldc)
6297 ("servlet" ,java-classpathx-servletapi)))
c353d014 6298 (home-page "https://www.osgi.org")
3240ddbf
JL
6299 (synopsis "Compendium specification module of OSGi framework")
6300 (description
6301 "OSGi, for Open Services Gateway initiative framework, is a module system
6302and service platform for the Java programming language. This package contains
6303the compendium specification module, providing interfaces and classes for use
6304in compiling bundles.")
6305 (license license:asl2.0)))
747c7574
JL
6306
6307(define-public java-osgi-service-component-annotations
6308 (package
6309 (name "java-osgi-service-component-annotations")
6310 (version "1.3.0")
6311 (source (origin
6312 (method url-fetch)
6313 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6314 "org.osgi.service.component.annotations/"
6315 version "/org.osgi.service.component.annotations-"
6316 version "-sources.jar"))
6317 (sha256
6318 (base32
6319 "15rq9cmp4fpn74q44m4j35qsqmjf5lx3hcrk6pzvbhc08igic2f0"))))
6320 (build-system ant-build-system)
6321 (arguments
6322 `(#:jar-name "osgi-service-component-annotations.jar"
6323 #:tests? #f)); no tests
6324 (inputs
6325 `(("annotation" ,java-osgi-annotation)))
c353d014 6326 (home-page "https://www.osgi.org")
747c7574
JL
6327 (synopsis "Support annotations for osgi-service-component")
6328 (description
6329 "OSGi, for Open Services Gateway initiative framework, is a module system
6330and service platform for the Java programming language. This package contains
6331the support annotations for osgi-service-component.")
6332 (license license:asl2.0)))
999b5fb4
JL
6333
6334(define-public java-osgi-dto
6335 (package
6336 (name "java-osgi-dto")
6337 (version "1.0.0")
6338 (source (origin
6339 (method url-fetch)
6340 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6341 "org.osgi.dto/" version "/org.osgi.dto-"
6342 version "-sources.jar"))
6343 (sha256
6344 (base32
6345 "0f4bqjzadn0hwk6sd3h5gvbyfp3yci1s6r0v770cc15p0pg627yr"))))
6346 (build-system ant-build-system)
6347 (arguments
6348 `(#:jar-name "osgi-dto.jar"
6349 #:tests? #f)); no tests
6350 (inputs
6351 `(("annotation" ,java-osgi-annotation)))
c353d014 6352 (home-page "https://www.osgi.org")
999b5fb4
JL
6353 (synopsis "Data Transfer Objects")
6354 (description
6355 "OSGi, for Open Services Gateway initiative framework, is a module system
6356and service platform for the Java programming language. This package contains
6357the Data Transfer Objects. It is easily serializable having only public fields
6358of primitive types and their wrapper classes, Strings, and DTOs. List, Set,
6359Map and array aggregates may also be used. The aggregates must only hold
6360objects of the listed types or aggregates.")
6361 (license license:asl2.0)))
c304ce6a
JL
6362
6363(define-public java-osgi-resource
6364 (package
6365 (name "java-osgi-resource")
6366 (version "1.0.0")
6367 (source (origin
6368 (method url-fetch)
6369 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6370 "org.osgi.resource/"
6371 version "/org.osgi.resource-"
6372 version "-sources.jar"))
6373 (sha256
6374 (base32
6375 "0hi0fsc5v99q22bd7lrkvpz1y0ds4w9arjldpwsrcpqvz2js7q2d"))))
6376 (build-system ant-build-system)
6377 (arguments
6378 `(#:jar-name "osgi-resource.jar"
6379 #:tests? #f)); no tests
6380 (inputs
6381 `(("annotation" ,java-osgi-annotation)
6382 ("dto" ,java-osgi-dto)))
c353d014 6383 (home-page "https://www.osgi.org")
c304ce6a
JL
6384 (synopsis "OSGI Resource")
6385 (description
6386 "OSGi, for Open Services Gateway initiative framework, is a module system
6387and service platform for the Java programming language. This package contains
6388the definition of common types in osgi packages.")
6389 (license license:asl2.0)))
c2b14516
JL
6390
6391(define-public java-osgi-namespace-contract
6392 (package
6393 (name "java-osgi-namespace-contract")
6394 (version "1.0.0")
6395 (source (origin
6396 (method url-fetch)
6397 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6398 "org.osgi.namespace.contract/"
6399 version "/org.osgi.namespace.contract-"
6400 version "-sources.jar"))
6401 (sha256
6402 (base32
6403 "1iz4f2i0fvqrlq90ki9nfzcfpvy2av434ri25bglywqssx8mmp36"))))
6404 (build-system ant-build-system)
6405 (inputs
6406 `(("resource" ,java-osgi-resource)
6407 ("annotation" ,java-osgi-annotation)))
6408 (arguments
6409 `(#:jar-name "osgi-namespace-contract.jar"
6410 #:tests? #f)); no tests
c353d014 6411 (home-page "https://www.osgi.org")
c2b14516
JL
6412 (synopsis "Contract Capability and Requirement Namespace")
6413 (description
6414 "OSGi, for Open Services Gateway initiative framework, is a module system
6415and service platform for the Java programming language. This package contains
6416the names for the attributes and directives for a namespace with contracts.")
6417 (license license:asl2.0)))
f809c963
JL
6418
6419(define-public java-osgi-namespace-extender
6420 (package
6421 (name "java-osgi-namespace-extender")
6422 (version "1.0.1")
6423 (source (origin
6424 (method url-fetch)
6425 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6426 "org.osgi.namespace.extender/"
6427 version "/org.osgi.namespace.extender-"
6428 version "-sources.jar"))
6429 (sha256
6430 (base32
6431 "0jgqiak2i05qv6j3gd33xlaifzzc0ylxxk376v2x0apfg3vvixmz"))))
6432 (build-system ant-build-system)
6433 (inputs
6434 `(("resource" ,java-osgi-resource)
6435 ("annotation" ,java-osgi-annotation)))
6436 (arguments
6437 `(#:jar-name "osgi-namespace-extendent.jar"
6438 #:tests? #f)); no tests
c353d014 6439 (home-page "https://www.osgi.org")
f809c963
JL
6440 (synopsis "Extender Capability and Requirement Namespace")
6441 (description
6442 "OSGi, for Open Services Gateway initiative framework, is a module system
6443and service platform for the Java programming language. This package contains
b784962d
JL
6444the names for the attributes and directives for an extender namespace.")
6445 (license license:asl2.0)))
6446
6447(define-public java-osgi-namespace-service
6448 (package
6449 (name "java-osgi-namespace-service")
6450 (version "1.0.0")
6451 (source (origin
6452 (method url-fetch)
6453 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6454 "org.osgi.namespace.service/"
6455 version "/org.osgi.namespace.service-"
6456 version "-sources.jar"))
6457 (sha256
6458 (base32
6459 "0qmw8n2449nkmm56d1znz9zhazb6ya3vsimd5bf5jg23zzhgl8c8"))))
6460 (build-system ant-build-system)
6461 (inputs
6462 `(("resource" ,java-osgi-resource)
6463 ("annotation" ,java-osgi-annotation)))
6464 (arguments
6465 `(#:jar-name "osgi-namespace-service.jar"
6466 #:tests? #f)); no tests
c353d014 6467 (home-page "https://www.osgi.org")
b784962d
JL
6468 (synopsis "Service Capability and Requirement Namespace")
6469 (description
6470 "OSGi, for Open Services Gateway initiative framework, is a module system
6471and service platform for the Java programming language. This package contains
6472the names for the attributes and directives for a service namespace.")
f809c963 6473 (license license:asl2.0)))
0f0c5218
JL
6474
6475(define-public java-osgi-util-function
6476 (package
6477 (name "java-osgi-util-function")
6478 (version "1.0.0")
6479 (source (origin
6480 (method url-fetch)
6481 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6482 "org.osgi.util.function/"
6483 version "/org.osgi.util.function-"
6484 version "-sources.jar"))
6485 (sha256
6486 (base32
6487 "04l7j3hwmmj28w23m7paca0afzncs42j2mdr3liqq8kvp548sc6x"))))
6488 (build-system ant-build-system)
6489 (arguments
6490 `(#:jar-name "osgi-util-function.jar"
6491 #:tests? #f)); no tests
6492 (inputs
6493 `(("annotation" ,java-osgi-annotation)))
c353d014 6494 (home-page "https://www.osgi.org")
0f0c5218
JL
6495 (synopsis "OSGI Util Function")
6496 (description
6497 "OSGi, for Open Services Gateway initiative framework, is a module system
6498and service platform for the Java programming language. This package contains
6499an interface for a function that accepts a single argument and produces a result.")
6500 (license license:asl2.0)))
27103135
JL
6501
6502(define-public java-osgi-util-promise
6503 (package
6504 (name "java-osgi-util-promise")
6505 (version "1.0.0")
6506 (source (origin
6507 (method url-fetch)
6508 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6509 "org.osgi.util.promise/"
6510 version "/org.osgi.util.promise-"
6511 version "-sources.jar"))
6512 (sha256
6513 (base32
6514 "0y34dwiflg1c4ahvkswpf9z02xph2sr9fm04ia5493x3lshpw22c"))))
6515 (build-system ant-build-system)
6516 (arguments
6517 `(#:jar-name "osgi-util-promise.jar"
6518 #:tests? #f)); no tests
6519 (inputs
6520 `(("annotation" ,java-osgi-annotation)
6521 ("function" ,java-osgi-util-function)))
c353d014 6522 (home-page "https://www.osgi.org")
27103135
JL
6523 (synopsis "Promise of a value")
6524 (description
6525 "OSGi, for Open Services Gateway initiative framework, is a module system
6526and service platform for the Java programming language. This package contains
6527an interface and utilitary classes for promises. A Promise represents a future
6528value. It handles the interactions for asynchronous processing.")
6529 (license license:asl2.0)))
2b1fdb2b
JL
6530
6531(define-public java-osgi-service-metatype-annotations
6532 (package
6533 (name "java-osgi-service-metatype-annotations")
6534 (version "1.3.0")
6535 (source (origin
6536 (method url-fetch)
6537 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6538 "org.osgi.service.metatype.annotations/"
6539 version "/org.osgi.service.metatype.annotations-"
6540 version "-sources.jar"))
6541 (sha256
6542 (base32
6543 "12rwm3349wk80vm88rcdgs4435m4jxkpkj5mrx326skkz2c6hyw6"))))
6544 (build-system ant-build-system)
6545 (arguments
6546 `(#:jar-name "osgi-service-metatype-annotations.jar"
6547 #:tests? #f)); no tests
6548 (inputs
6549 `(("annotation" ,java-osgi-annotation)))
c353d014 6550 (home-page "https://www.osgi.org")
2b1fdb2b
JL
6551 (synopsis "Support annotations for metatype")
6552 (description
6553 "OSGi, for Open Services Gateway initiative framework, is a module system
6554and service platform for the Java programming language. This package contains
6555the support annotations for metatype.")
6556 (license license:asl2.0)))
a13acfbe
JL
6557
6558(define-public java-osgi-service-repository
6559 (package
6560 (name "java-osgi-service-repository")
6561 (version "1.1.0")
6562 (source (origin
6563 (method url-fetch)
6564 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6565 "org.osgi.service.repository/"
6566 version "/org.osgi.service.repository-"
6567 version "-sources.jar"))
6568 (sha256
6569 (base32
6570 "1k41mhg7b58pd8nsghr2qwcjrxdnf1p9spsw9v11k4257g6rl06n"))))
6571 (build-system ant-build-system)
6572 (arguments
6573 `(#:jar-name "osgi-service-repository.jar"
6574 #:tests? #f)); no tests
6575 (inputs
6576 `(("annotation" ,java-osgi-annotation)
6577 ("promise" ,java-osgi-util-promise)
6578 ("resource" ,java-osgi-resource)))
c353d014 6579 (home-page "https://www.osgi.org")
a13acfbe
JL
6580 (synopsis "OSGI service repository")
6581 (description
6582 "OSGi, for Open Services Gateway initiative framework, is a module system
6583and service platform for the Java programming language. This package contains
6584a repository service that contains resources.")
6585 (license license:asl2.0)))
dfd91541
JL
6586
6587(define-public java-osgi-framework
6588 (package
6589 (name "java-osgi-framework")
6590 (version "1.8.0")
6591 (source (origin
6592 (method url-fetch)
6593 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6594 "org.osgi.framework/" version "/org.osgi.framework-"
6595 version "-sources.jar"))
6596 (sha256
6597 (base32
6598 "1lwp2zfad3rybcc6q9bwz8xsgkc92ypzy5p6x54387f1qj65m73s"))))
6599 (build-system ant-build-system)
6600 (arguments
6601 `(#:jar-name "osgi-framework.jar"
6602 #:tests? #f)); no tests
6603 (inputs
6604 `(("annotation" ,java-osgi-annotation)
6605 ("resource" ,java-osgi-resource)
6606 ("dto" ,java-osgi-dto)))
c353d014 6607 (home-page "https://www.osgi.org")
dfd91541
JL
6608 (synopsis "OSGi framework")
6609 (description
6610 "OSGi, for Open Services Gateway initiative framework, is a module system
6611and service platform for the Java programming language.")
6612 (license license:asl2.0)))
98c9f16c
JL
6613
6614(define-public java-osgi-service-log
6615 (package
6616 (name "java-osgi-service-log")
6617 (version "1.3.0")
6618 (source (origin
6619 (method url-fetch)
6620 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6621 "org.osgi.service.log/"
6622 version "/org.osgi.service.log-"
6623 version "-sources.jar"))
6624 (sha256
6625 (base32
6626 "1029j30dzcwializzca0j3fkhwwz08kmmsha5agw1iccscimj6r0"))))
6627 (build-system ant-build-system)
6628 (arguments
6629 `(#:jar-name "osgi-service-log.jar"
6630 #:tests? #f)); no tests
6631 (inputs
6632 `(("java-osgi-framework" ,java-osgi-framework)))
c353d014 6633 (home-page "https://www.osgi.org")
98c9f16c
JL
6634 (synopsis "Provides methods for bundles to write messages to the log")
6635 (description
6636 "OSGi, for Open Services Gateway initiative framework, is a module system
6637and service platform for the Java programming language. This package contains
6638the log service.")
6639 (license license:asl2.0)))
dd76d44b
JL
6640
6641(define-public java-osgi-service-jdbc
6642 (package
6643 (name "java-osgi-service-jdbc")
6644 (version "1.0.0")
6645 (source (origin
6646 (method url-fetch)
6647 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6648 "org.osgi.service.jdbc/"
6649 version "/org.osgi.service.jdbc-"
6650 version "-sources.jar"))
6651 (sha256
6652 (base32
6653 "11iln5v7bk469cgb9ddkrz9sa95b3733gqgaqw9xf5g6wq652yjz"))))
6654 (build-system ant-build-system)
6655 (arguments
6656 `(#:jar-name "osgi-service-jdbc.jar"
6657 #:tests? #f)); no tests
c353d014 6658 (home-page "https://www.osgi.org")
dd76d44b
JL
6659 (synopsis "Factory for JDBC connection factories")
6660 (description
6661 "OSGi, for Open Services Gateway initiative framework, is a module system
6662and service platform for the Java programming language. This package contains
6663a factory for JDBC connection factories. There are 3 preferred connection
6664factories for getting JDBC connections:
6665
6666@itemize
6667@item @code{javax.sql.DataSource};
6668@item @code{javax.sql.ConnectionPoolDataSource};
6669@item @code{javax.sql.XADataSource}.
6670@end itemize")
6671 (license license:asl2.0)))
291d3f22
JL
6672
6673(define-public java-osgi-service-resolver
6674 (package
6675 (name "java-osgi-service-resolver")
6676 (version "1.0.1")
6677 (source (origin
6678 (method url-fetch)
6679 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6680 "org.osgi.service.resolver/"
6681 version "/org.osgi.service.resolver-"
6682 version "-sources.jar"))
6683 (sha256
6684 (base32
6685 "1dzqn1ryfi2rq4zwsgp44bmj2wlfydjg1qbxw2b0z4xdjjy55vxd"))))
6686 (build-system ant-build-system)
6687 (arguments
6688 `(#:jar-name "osgi-service-resolver.jar"
6689 #:tests? #f)); no tests
6690 (inputs
6691 `(("annotation" ,java-osgi-annotation)
6692 ("resource" ,java-osgi-resource)))
c353d014 6693 (home-page "https://www.osgi.org")
291d3f22
JL
6694 (synopsis "OSGI Resolver service")
6695 (description
6696 "OSGi, for Open Services Gateway initiative framework, is a module system
6697and service platform for the Java programming language. This package contains
6698a resolver service that resolves the specified resources in the context supplied
6699by the caller.")
6700 (license license:asl2.0)))
1884bb81
JL
6701
6702(define-public java-osgi-util-tracker
6703 (package
6704 (name "java-osgi-util-tracker")
6705 (version "1.5.1")
6706 (source (origin
6707 (method url-fetch)
6708 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6709 "org.osgi.util.tracker/"
6710 version "/org.osgi.util.tracker-"
6711 version "-sources.jar"))
6712 (sha256
6713 (base32
6714 "0c4fh9vxwzsx59r8dygda0gq2gx3z5vfhc3jsphlqwf5w0h403lz"))))
6715 (build-system ant-build-system)
6716 (arguments
6717 `(#:jar-name "osgi-util-tracker.jar"
6718 #:tests? #f)); no tests
6719 (inputs
6720 `(("framework" ,java-osgi-framework)
6721 ("annotation" ,java-osgi-annotation)))
c353d014 6722 (home-page "https://www.osgi.org")
1884bb81
JL
6723 (synopsis "Bundle tracking")
6724 (description
6725 "OSGi, for Open Services Gateway initiative framework, is a module system
6726and service platform for the Java programming language. This package contains
6727bundle tracking utility classes.")
6728 (license license:asl2.0)))
fb9c48b8
JL
6729
6730(define-public java-osgi-service-cm
6731 (package
6732 (name "java-osgi-service-cm")
6733 (version "1.5.0")
6734 (source (origin
6735 (method url-fetch)
6736 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6737 "org.osgi.service.cm/"
6738 version "/org.osgi.service.cm-"
6739 version "-sources.jar"))
6740 (sha256
6741 (base32
6742 "1z8kap48y3xi0ggj8v6czglfnpnd94mmismgi2wbqhj1nl5fzbp6"))))
6743 (build-system ant-build-system)
6744 (arguments
6745 `(#:jar-name "osgi-service-cm.jar"
6746 #:tests? #f)); no tests
6747 (inputs
6748 `(("framework" ,java-osgi-framework)
6749 ("annotation" ,java-osgi-annotation)))
c353d014 6750 (home-page "https://www.osgi.org")
fb9c48b8
JL
6751 (synopsis "OSGI Configuration Management")
6752 (description
6753 "OSGi, for Open Services Gateway initiative framework, is a module system
6754and service platform for the Java programming language. This package contains
6755utility classes for the configuration of services.")
6756 (license license:asl2.0)))
500aac75
JL
6757
6758(define-public java-osgi-service-packageadmin
6759 (package
6760 (name "java-osgi-service-packageadmin")
6761 (version "1.2.0")
6762 (source (origin
6763 (method url-fetch)
6764 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6765 "org.osgi.service.packageadmin/"
6766 version "/org.osgi.service.packageadmin-"
6767 version "-sources.jar"))
6768 (sha256
6769 (base32
6770 "041mpxzi7g36wmcily6y4ccn3jx15akpdy8gmhyb7m98x7qfvn52"))))
6771 (build-system ant-build-system)
6772 (arguments
6773 `(#:jar-name "osgi-service-packageadmin.jar"
6774 #:tests? #f)); no tests
6775 (inputs
6776 `(("framework" ,java-osgi-framework)))
c353d014 6777 (home-page "https://www.osgi.org")
500aac75
JL
6778 (synopsis "OSGI Package Administration")
6779 (description
6780 "OSGi, for Open Services Gateway initiative framework, is a module system
6781and service platform for the Java programming language. This package contains
6782the packageadmin service.")
6783 (license license:asl2.0)))
77a4f1ae
JL
6784
6785(define-public java-ops4j-base-lang
6786 (package
6787 (name "java-ops4j-base-lang")
6788 (version "1.5.0")
6789 (source (origin
6790 (method url-fetch)
6791 (uri (string-append "https://github.com/ops4j/org.ops4j.base/"
6792 "archive/base-" version ".tar.gz"))
6793 (sha256
6794 (base32
6795 "18hl3lpchgpv8yh5rlk39l2gif5dlfgb8gxjmncf39pr2dprkniw"))))
6796 (build-system ant-build-system)
6797 (arguments
6798 `(#:jar-name "java-ops4j-base-lang.jar"
6799 #:source-dir "ops4j-base-lang/src/main/java"
6800 #:tests? #f; no tests
6801 #:phases
6802 (modify-phases %standard-phases
6803 (add-before 'build 'add-test-file
6804 (lambda _
6805 ;; That file is required by a test in ops4j-pax-exam-core-spi
6806 (mkdir-p "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang")
6807 (with-output-to-file "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang/pom.properties"
6808 (lambda _
6809 (display
6810 (string-append
6811 "version=" ,version "\n"
6812 "groupId=org.ops4j.base"
6813 "artifactId=ops4j-base-lang\n")))))))))
6814 (home-page "https://ops4j1.jira.com/wiki/spaces/base/overview")
6815 (synopsis "Utility classes and extensions to be used in OPS4J projects")
6816 (description "OPS4J stands for Open Participation Software for Java. This
6817package contains utilities and extensions related to @code{java.lang}.")
6818 (license license:asl2.0)))
b2353495
JL
6819
6820(define-public java-ops4j-base-monitors
6821 (package
6822 (inherit java-ops4j-base-lang)
6823 (name "java-ops4j-base-monitors")
6824 (arguments
6825 `(#:jar-name "java-ops4j-base-monitors.jar"
6826 #:source-dir "ops4j-base-monitors/src/main/java"
6827 #:tests? #f)); no tests
6828 (inputs
6829 `(("lang" ,java-ops4j-base-lang)))
6830 (description "OPS4J stands for Open Participation Software for Java. This
6831package contains utilities and extensions related to monitoring.")))
322d349a
JL
6832
6833(define-public java-ops4j-base-io
6834 (package
6835 (inherit java-ops4j-base-lang)
6836 (name "java-ops4j-base-io")
6837 (arguments
6838 `(#:jar-name "java-ops4j-base-io.jar"
6839 #:source-dir "ops4j-base-io/src/main/java"
6840 #:test-dir "ops4j-base-io/src/test"
6841 #:test-exclude
6842 (list "**/ListerTest.java")))
6843 (inputs
6844 `(("lang" ,java-ops4j-base-monitors)
6845 ("lang" ,java-ops4j-base-lang)))
6846 (native-inputs
6847 `(("junit" ,java-junit)
6848 ("hamcrest" ,java-hamcrest-core)))
6849 (description "OPS4J stands for Open Participation Software for Java. This
6850package contains utilities and extensions related to handling streams and files.")))
559919c1
JL
6851
6852(define-public java-ops4j-base-util
6853 (package
6854 (inherit java-ops4j-base-lang)
6855 (name "java-ops4j-base-util")
6856 (arguments
6857 `(#:jar-name "java-ops4j-base-util.jar"
6858 #:source-dir "ops4j-base-util/src/main/java"
6859 #:test-dir "ops4j-base-util/src/test"))
6860 (inputs
6861 `(("lang" ,java-ops4j-base-lang)))
6862 (native-inputs
6863 `(("junit" ,java-junit)))
6864 (description "OPS4J stands for Open Participation Software for Java. This
6865package contains utilities and extensions related to environment, i18n and
6866mime types.")))
60dcec7a
JL
6867
6868(define-public java-ops4j-base-util-property
6869 (package
6870 (inherit java-ops4j-base-lang)
6871 (name "java-ops4j-base-util-property")
6872 (arguments
6873 `(#:jar-name "java-ops4j-base-util-property.jar"
6874 #:source-dir "ops4j-base-util-property/src/main/java"
6875 #:tests? #f)); no tests
6876 (inputs
6877 `(("lang" ,java-ops4j-base-lang)
6878 ("util" ,java-ops4j-base-util)))
6879 (description "OPS4J stands for Open Participation Software for Java. This
6880package contains utilities and extensions related to resolving properties from
6881different sources.")))
0edf8cf0
JL
6882
6883(define-public java-ops4j-base-store
6884 (package
6885 (inherit java-ops4j-base-lang)
6886 (name "java-ops4j-base-store")
6887 (arguments
6888 `(#:jar-name "java-ops4j-base-store.jar"
6889 #:source-dir "ops4j-base-store/src/main/java"
6890 #:tests? #f)); no tests
6891 (inputs
6892 `(("lang" ,java-ops4j-base-lang)
6893 ("slf4j" ,java-slf4j-api)
6894 ("io" ,java-ops4j-base-io)))
6895 (description "OPS4J stands for Open Participation Software for Java. This
6896package contains utilities for storing and retrieving data from an
6897@code{InputStream}.")))
214fcd8a
JL
6898
6899(define-public java-ops4j-base-spi
6900 (package
6901 (inherit java-ops4j-base-lang)
6902 (name "java-ops4j-base-spi")
6903 (arguments
6904 `(#:jar-name "java-ops4j-base-spi.jar"
6905 #:source-dir "ops4j-base-spi/src/main/java"
6906 #:test-dir "ops4j-base-spi/src/test"))
6907 (native-inputs
6908 `(("junit" ,java-junit)
6909 ("hamcrest" ,java-hamcrest-core)))
6910 (description "OPS4J stands for Open Participation Software for Java. This
6911package contains utilities for obtaining services via the Java SE 6
6912@code{ServiceLoader}.")))
e1edf42e
JL
6913
6914(define-public java-aqute-bnd-annotation
6915 (package
6916 (name "java-aqute-bnd-annotation")
6917 (version "3.4.0")
6918 (source (origin
6919 (method url-fetch)
6920 (uri (string-append "https://github.com/bndtools/bnd/archive/"
6921 version ".REL.tar.gz"))
6922 (file-name (string-append name "-" version ".tar.gz"))
6923 (sha256
6924 (base32
6925 "09vgb6axikbz66zi9falijbnzh1qnp9ysfns123dmzdb01cbza9q"))))
6926 (build-system ant-build-system)
6927 (arguments
6928 `(#:jar-name "java-aqute-bnd-annotation.jar"
6929 #:source-dir "biz.aQute.bnd.annotation/src"
6930 #:tests? #f)); empty test dir
6931 (home-page "http://bnd.bndtools.org/")
6932 (synopsis "Tools for OSGi")
6933 (description "Bnd is a swiss army knife for OSGi, it creates manifest
6934headers based on analyzing the class code, it verifies the project settings,
6935it manages project dependencies, gives diffs jars, and much more.")
6936 (license license:asl2.0)))
60ba2978
JL
6937
6938(define-public java-aqute-libg
6939 (package
6940 (inherit java-aqute-bnd-annotation)
6941 (name "java-aqute-libg")
6942 (arguments
6943 `(#:jar-name "java-aqute-libg.jar"
6944 #:source-dir "aQute.libg/src"
6945 #:tests? #f)); FIXME: tests are in "aQute.libg/test", not in a java directory
6946 (inputs
6947 `(("slf4j" ,java-slf4j-api)
6948 ("osgi-annot" ,java-osgi-annotation)
6949 ("java-osgi-cmpn" ,java-osgi-cmpn)
6950 ("osgi" ,java-osgi-core)))))
5f26a131
JL
6951
6952(define-public java-aqute-bndlib
6953 (package
6954 (inherit java-aqute-bnd-annotation)
6955 (name "java-aqute-bndlib")
6956 (arguments
6957 `(#:jar-name "java-bndlib.jar"
6958 #:source-dir "biz.aQute.bndlib/src"
6959 #:tests? #f)); no tests
6960 (inputs
6961 `(("slf4j" ,java-slf4j-api)
6962 ("osgi-annot" ,java-osgi-annotation)
6963 ("java-aqute-libg" ,java-aqute-libg)
6964 ("java-aqute-bnd-annotation" ,java-aqute-bnd-annotation)
6965 ("java-osgi-service-component-annotations" ,java-osgi-service-component-annotations)
6966 ("java-osgi-service-repository" ,java-osgi-service-repository)
6967 ("java-osgi-service-log" ,java-osgi-service-log)
6968 ("java-osgi-service-metatype-annotations" ,java-osgi-service-metatype-annotations)
6969 ("java-osgi-namespace-contract" ,java-osgi-namespace-contract)
6970 ("java-osgi-namespace-extender" ,java-osgi-namespace-extender)
6971 ("java-osgi-namespace-service" ,java-osgi-namespace-service)
6972 ("promise" ,java-osgi-util-promise)
6973 ("osgi" ,java-osgi-core)))))
25aef81d
JL
6974
6975(define-public java-ops4j-pax-tinybundles
6976 (package
6977 (name "java-ops4j-pax-tinybundles")
6978 (version "2.1.1")
6979 (source (origin
6980 (method url-fetch)
6981 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.tinybundles/"
6982 "archive/tinybundles-" version ".tar.gz"))
6983 (sha256
6984 (base32
6985 "0y0gq3pvv0iir2b885lmlwnvr724vv7vklzhhr4fs27d7mdkj871"))))
6986 (arguments
6987 `(#:jar-name "java-ops4j-pax-tinybundles.jar"
6988 #:source-dir "src/main/java"
6989 #:test-exclude
6990 ;; Abstract base classes for other tests
6991 (list "**/BndTest.java" "**/CoreTest.java")
6992 #:phases
6993 (modify-phases %standard-phases
6994 (add-before 'check 'fix-version
6995 (lambda _
6996 ;; This test has a reference to an old version of bndlib we are not
6997 ;; packaging. It uses the version referenced in pom.xml. We replace
6998 ;; it with our own version.
6999 (substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
0f277802
GB
7000 (("[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*")
7001 ,(package-version java-aqute-bndlib))))))))
25aef81d
JL
7002 (inputs
7003 `(("lang" ,java-ops4j-base-lang)
7004 ("io" ,java-ops4j-base-io)
7005 ("store" ,java-ops4j-base-store)
7006 ("slf4j" ,java-slf4j-api)
7007 ("libg" ,java-aqute-libg)
7008 ("bndlib" ,java-aqute-bndlib)))
7009 (native-inputs
7010 `(("junit" ,java-junit)
7011 ("hamcrest" ,java-hamcrest-core)
7012 ("log4j" ,java-log4j-api)
7013 ("bndannotation" ,java-aqute-bnd-annotation)
7014 ("framework" ,java-osgi-framework)))
7015 (build-system ant-build-system)
7016 (home-page "https://ops4j1.jira.com/wiki/spaces/ops4j/pages/12060312/Tinybundles")
7017 (synopsis "Java APIs to create OSGi related artifacts")
7018 (description "Tinybundles is all about creating OSGi related artifacts like
7019Bundles, Fragments and Deployment Packages with Java Api. It is very convinient
7020to create such artifacts on-the-fly inside Tests (like in Pax Exam). On the
7021other hand, this library can be a foundation of real end user tools that need
7022to create those artifacts.")
7023 (license license:asl2.0)))
e179add0
JL
7024
7025(define-public java-ops4j-pax-exam-core
7026 (package
7027 (name "java-ops4j-pax-exam-core")
7028 (version "4.11.0")
7029 (source (origin
7030 (method url-fetch)
7031 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.exam2/"
7032 "archive/exam-reactor-" version ".tar.gz"))
7033 (sha256
7034 (base32
7035 "08mzw8nkah3rj3vznlplnawspxhp61zgvb44ifqa1rni1cvbms2g"))))
7036 (arguments
7037 `(#:jar-name "java-ops4j-pax-exam-core.jar"
7038 #:source-dir "core/pax-exam/src/main/java"
7039 #:test-dir "core/pax-exam/src/test"))
7040 (inputs
7041 `(("slf4j" ,java-slf4j-api)
7042 ("lang" ,java-ops4j-base-lang)
7043 ("io" ,java-ops4j-base-io)
7044 ("util-property" ,java-ops4j-base-util-property)
7045 ("util-store" ,java-ops4j-base-store)
7046 ("java-osgi-core" ,java-osgi-core)))
7047 (native-inputs
7048 `(("junit" ,java-junit)
7049 ("hamcrest" ,java-hamcrest-core)))
7050 (build-system ant-build-system)
7051 (home-page "https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/overview")
7052 (synopsis "In-Container Testing for OSGi, Java EE and CDI")
7053 (description "Pax Exam creates OSGi bundles for testing purposes. It lets
7054the user take control of the OSGi framework, the test framework (e.g. JUnit) and
7055the system under test at the same time.")
7056 (license license:asl2.0)))
7a7c2b75
JL
7057
7058(define-public java-ops4j-pax-exam-core-spi
7059 (package
7060 (inherit java-ops4j-pax-exam-core)
7061 (name "java-ops4j-pax-exam-core-spi")
7062 (arguments
7063 `(#:jar-name "java-ops4j-pax-exam-spi.jar"
7064 #:source-dir "src/main/java"
7065 #:test-exclude
7066 (list
7067 ;; Abstract base class, not a test
7068 "**/BaseStagedReactorTest.java"
7069 ;; Depends on org.mortbay.jetty.testwars:test-war-dump
7070 "**/WarBuilderTest.java")
7071 #:phases
7072 (modify-phases %standard-phases
7073 (add-before 'configure 'chdir
7074 (lambda _
7075 ;; Tests assume we are in this directory
7076 (chdir "core/pax-exam-spi")))
7077 (add-before 'check 'fix-tests
7078 (lambda _
7079 ;; One test checks that this file is present.
7080 (mkdir-p "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi")
7081 (with-output-to-file
7082 "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi/pom.properties"
7083 (lambda _
7084 (display
7085 (string-append "artifactId = pax-exam-spi\n"
7086 "version = " ,(package-version java-ops4j-pax-exam-core-spi)))))
7087 ;; Maven puts compilation results in the target directory, while we
7088 ;; put them in the build directory.
7089 (substitute* '("src/test/java/org/ops4j/pax/exam/spi/war/WarBuilderTest.java"
7090 "src/test/java/org/ops4j/pax/exam/spi/war/WarTestProbeBuilderTest.java"
7091 "src/test/java/org/ops4j/pax/exam/spi/war/ZipBuilderTest.java")
7092 (("target") "build"))
7093 ;; One test is expected to fail, but it doesn't throw the expected exception
7094 (substitute* "src/test/java/org/ops4j/pax/exam/spi/reactors/BaseStagedReactorTest.java"
7095 (("AssertionError") "IllegalArgumentException")))))))
7096 (inputs
7097 `(("java-ops4j-pax-exam-core" ,java-ops4j-pax-exam-core)
7098 ("lang" ,java-ops4j-base-lang)
7099 ("monitors" ,java-ops4j-base-monitors)
7100 ("store" ,java-ops4j-base-store)
7101 ("io" ,java-ops4j-base-io)
7102 ("spi" ,java-ops4j-base-spi)
7103 ("osgi" ,java-osgi-core)
7104 ("slf4j" ,java-slf4j-api)
7105 ("tinybundles" ,java-ops4j-pax-tinybundles)))
7106 (native-inputs
7107 `(("mockito" ,java-mockito-1)
7108 ("junit" ,java-junit)
7109 ("hamcrest" ,java-hamcrest-core)
7110 ("cglib" ,java-cglib)
7111 ("objenesis" ,java-objenesis)
7112 ("asm" ,java-asm)))))
4496d77f
JL
7113
7114(define-public java-ops4j-pax-exam-core-junit
7115 (package
7116 (inherit java-ops4j-pax-exam-core)
7117 (name "java-ops4j-pax-exam-core-junit")
7118 (arguments
7119 `(#:jar-name "ops4j-pax-exam-core-junit.jar"
7120 #:source-dir "drivers/pax-exam-junit4/src/main/java"
7121 #:tests? #f)); no tests
7122 (inputs
7123 `(("junit" ,java-junit)
7124 ("slf4j" ,java-slf4j-api)
7125 ("core" ,java-ops4j-pax-exam-core)
7126 ("spi" ,java-ops4j-pax-exam-core-spi)))
7127 (native-inputs '())))
cb05f60d
JL
7128
7129(define-public java-fasterxml-jackson-annotations
7130 (package
7131 (name "java-fasterxml-jackson-annotations")
93dceea4 7132 (version "2.9.4")
cb05f60d
JL
7133 (source (origin
7134 (method url-fetch)
7135 (uri (string-append "https://github.com/FasterXML/"
7136 "jackson-annotations/archive/"
7137 "jackson-annotations-" version ".tar.gz"))
7138 (sha256
7139 (base32
93dceea4 7140 "0mr95xd0da6a4g95zvrl1ryk5n5zv2rc696w3xnsr5hxk2gicfc4"))))
cb05f60d
JL
7141 (build-system ant-build-system)
7142 (arguments
7143 `(#:jar-name "jackson-annotations.jar"
7144 #:source-dir "src/main/java"
7145 #:test-dir "src/test"))
7146 (native-inputs
7147 `(("junit" ,java-junit)))
7148 (home-page "https://github.com/FasterXML/jackson-annotations")
7149 (synopsis "General purpose annotations for the Jackson Data Processor")
7150 (description "This package contains general purpose annotations for the
7151Jackson Data Processor, used on value and handler types. The only annotations
7152not included are ones that require dependency to the Databind package.")
7153 (license license:asl2.0)))
0b5481df
JL
7154
7155(define-public java-fasterxml-jackson-core
7156 (package
7157 (name "java-fasterxml-jackson-core")
38a0fc38 7158 (version "2.9.4")
0b5481df
JL
7159 (source (origin
7160 (method url-fetch)
7161 (uri (string-append "https://github.com/FasterXML/"
7162 "jackson-core/archive/"
7163 "jackson-core-" version ".tar.gz"))
7164 (sha256
7165 (base32
38a0fc38 7166 "159hsnk17jr1gyzkf01cxvsn45srnk37g949r7364qlsr527gjgd"))))
0b5481df
JL
7167 (build-system ant-build-system)
7168 (arguments
7169 `(#:jar-name "jackson-core.jar"
7170 #:source-dir "src/main/java"
7171 #:test-dir "src/test"
7172 #:test-exclude
7173 (list
7174 ;; Expected failure. pom.xml excludes these
7175 "**/failing/**"
7176 ;; Base classes that have no constructor for junit
7177 "**/BaseTest.java"
7178 "**/ConcurrencyReadTest.java"
7179 "**/ManualCharAccessTest.java"
7180 "**/ManualCharAccessTest.java"
7181 "**/TrailingCommasTest.java"
7182 "**/AsyncMissingValuesInObjectTest.java"
7183 "**/AsyncMissingValuesInArrayTest.java")
7184 #:phases
7185 (modify-phases %standard-phases
7186 (add-before 'configure 'generate-PackageVersion.java
7187 (lambda _
7188 (let* ((out "src/main/java/com/fasterxml/jackson/core/json/PackageVersion.java")
7189 (in (string-append out ".in")))
7190 (copy-file in out)
7191 (substitute* out
7192 (("@package@") "com.fasterxml.jackson.core.json")
7193 (("@projectversion@") ,version)
7194 (("@projectgroupid@") "com.fasterxml.jackson.core")
7195 (("@projectartifactid@") "jackson-core")))))
7196 (add-before 'build 'copy-resources
7197 (lambda _
7198 (copy-recursively "src/main/resources"
7199 "build/classes")))
7200 (add-before 'check 'copy-test-resources
7201 (lambda _
7202 (copy-recursively "src/test/resources"
7203 "build/test-classes"))))))
7204 (native-inputs
7205 `(("junit" ,java-junit)
7206 ("hamcrest" ,java-hamcrest-core)))
7207 (home-page "https://github.com/FasterXML/jackson-core")
7208 (synopsis "")
7209 (description "")
7210 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
f234c7a0
JL
7211
7212(define-public java-fasterxml-jackson-databind
7213 (package
7214 (name "java-fasterxml-jackson-databind")
3c1edff5 7215 (version "2.9.4")
f234c7a0
JL
7216 (source (origin
7217 (method url-fetch)
7218 (uri (string-append "https://github.com/FasterXML/"
7219 "jackson-databind/archive/"
7220 "jackson-databind-" version ".tar.gz"))
7221 (sha256
7222 (base32
3c1edff5 7223 "1zd2cw4z6kdkbx8za96xh9pyicv2a2l7y0rkcx2fqd8hv6d47s08"))))
f234c7a0
JL
7224 (build-system ant-build-system)
7225 (arguments
7226 `(#:jar-name "jackson-databind.jar"
7227 #:source-dir "src/main/java"
7228 #:tests? #f; requires javax.measures for which I can't find a free implementation
7229 #:phases
7230 (modify-phases %standard-phases
7231 (add-before 'configure 'generate-PackageVersion.java
7232 (lambda _
7233 (let* ((out "src/main/java/com/fasterxml/jackson/databind/cfg/PackageVersion.java")
7234 (in (string-append out ".in")))
7235 (copy-file in out)
7236 (substitute* out
7237 (("@package@") "com.fasterxml.jackson.databind.cfg")
7238 (("@projectversion@") ,version)
7239 (("@projectgroupid@") "com.fasterxml.jackson.databind")
7240 (("@projectartifactid@") "jackson-databind")))))
7241 (add-before 'build 'copy-resources
7242 (lambda _
7243 (copy-recursively "src/main/resources" "build/classes"))))))
7244 (inputs
7245 `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
7246 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)))
7247 (home-page "https://github.com/FasterXML/jackson-databind")
7248 (synopsis "Data-binding functionality and tree-model for the Jackson Data Processor")
7249 (description "This package contains the general-purpose data-binding
7250functionality and tree-model for Jackson Data Processor. It builds on core
7251streaming parser/generator package, and uses Jackson Annotations for
7252configuration.")
7253 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
d57d8b89
JL
7254
7255(define-public java-fasterxml-jackson-modules-base-jaxb
7256 (package
7257 (name "java-fasterxml-jackson-modules-base-jaxb")
07207211 7258 (version "2.9.4")
d57d8b89
JL
7259 (source (origin
7260 (method url-fetch)
7261 (uri (string-append "https://github.com/FasterXML/"
7262 "jackson-modules-base/archive/"
7263 "jackson-modules-base-" version ".tar.gz"))
7264 (sha256
7265 (base32
07207211 7266 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
d57d8b89
JL
7267 (build-system ant-build-system)
7268 (arguments
7269 `(#:jar-name "jackson-modules-base-jaxb.jar"
7270 #:source-dir "jaxb/src/main/java"
7271 #:test-dir "jaxb/src/test"
7272 #:test-exclude
7273 ;; Base class for tests
7274 (list "**/BaseJaxbTest.java")
7275 #:phases
7276 (modify-phases %standard-phases
7277 (add-before 'configure 'generate-PackageVersion.java
7278 (lambda _
7279 (let* ((out (string-append "jaxb/src/main/java/com/fasterxml/"
7280 "jackson/module/jaxb/PackageVersion.java"))
7281 (in (string-append out ".in")))
7282 (copy-file in out)
7283 (substitute* out
7284 (("@package@") "com.fasterxml.jackson.module.jaxb")
7285 (("@projectversion@") ,version)
7286 (("@projectgroupid@") "com.fasterxml.jackson.module.jaxb")
7287 (("@projectartifactid@") "jackson-module-jaxb")))))
7288 (add-before 'build 'copy-resources
7289 (lambda _
7290 (copy-recursively "jaxb/src/main/resources" "build/classes"))))))
7291 (inputs
7292 `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
7293 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
7294 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)))
7295 (native-inputs
7296 `(("java-junit" ,java-junit)))
7297 (home-page "https://github.com/FasterXML/jackson-modules-base")
7298 (synopsis "Jaxb annotations jackson module")
7299 (description "This package is the jaxb annotations module for jackson.")
7300 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
0f296d37
JL
7301
7302(define-public java-snakeyaml
7303 (package
7304 (name "java-snakeyaml")
7305 (version "1.18")
7306 (source (origin
7307 (method url-fetch)
7308 (uri (string-append "https://bitbucket.org/asomov/snakeyaml/get/v"
7309 version ".tar.gz"))
7310 (sha256
7311 (base32
7312 "0rf5ha6w0waz50jz2479jsrbgmd0dnx0gs337m126j5z7zlmg7mg"))))
7313 (build-system ant-build-system)
7314 (arguments
7315 `(#:jar-name "java-snakeyaml.jar"
7316 #:source-dir "src/main/java"
7317 ;; Tests require velocity, a cyclic dependency, and
7318 ;; java-spring-framework-context which is not packaged.
7319 #:tests? #f))
7320 (home-page "https://bitbucket.org/asomov/snakeyaml")
7321 (synopsis "YAML processor")
7322 (description "SnakeYAML is a YAML processor for the Java Virtual Machine.")
7323 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
087c8fd2
JL
7324
7325(define-public java-fasterxml-jackson-dataformat-yaml
7326 (package
7327 (name "java-fasterxml-jackson-dataformat-yaml")
1f2be88f 7328 (version "2.9.4")
087c8fd2
JL
7329 (source (origin
7330 (method url-fetch)
7331 (uri (string-append "https://github.com/FasterXML/"
7332 "jackson-dataformats-text/archive/"
7333 "jackson-dataformats-text-" version ".tar.gz"))
7334 (sha256
7335 (base32
1f2be88f 7336 "1hikl06khaxbg439avf442qifcadap8w0lx13f0nnhp2vh3dkbz7"))))
087c8fd2
JL
7337 (build-system ant-build-system)
7338 (arguments
7339 `(#:jar-name "jackson-dataformat-yaml.jar"
7340 #:source-dir "yaml/src/main/java"
7341 #:test-dir "yaml/src/test"
7342 #:test-exclude (list "**/failing/**.java")
7343 #:phases
7344 (modify-phases %standard-phases
7345 (add-before 'configure 'generate-PackageVersion.java
7346 (lambda _
7347 (let* ((out "yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/PackageVersion.java")
7348 (in (string-append out ".in")))
7349 (copy-file in out)
7350 (substitute* out
7351 (("@package@") "com.fasterxml.jackson.dataformat.yaml")
7352 (("@projectversion@") ,version)
7353 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.yaml")
7354 (("@projectartifactid@") "jackson-dataformat-yaml"))))))))
7355 (inputs
7356 `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
7357 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
7358 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
7359 ("java-snakeyaml" ,java-snakeyaml)))
7360 (native-inputs
7361 `(("junit" ,java-junit)
7362 ("hamcrest" ,java-hamcrest-core)
7363 ("java-ops4j-pax-exam-core-spi" ,java-ops4j-pax-exam-core-spi)
7364 ("java-ops4j-pax-exam-core-junit" ,java-ops4j-pax-exam-core-junit)
7365 ("java-ops4j-pax-exam" ,java-ops4j-pax-exam-core)))
7366 (home-page "https://github.com/FasterXML/jackson-dataformats-text")
7367 (synopsis "Yaml backend for Jackson")
7368 (description "Dataformat backends are used to support format alternatives
7369to JSON, supported by default. This is done by sub-classing Jackson core
7370abstractions.")
7371 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
6fd07b98
JL
7372
7373(define-public java-stax2-api
7374 (package
7375 (name "java-stax2-api")
7376 (version "4.0.0")
7377 (source (origin
7378 (method url-fetch)
7379 (uri (string-append "https://github.com/FasterXML/stax2-api/archive/"
7380 "stax2-api-" version ".tar.gz"))
7381 (sha256
7382 (base32
7383 "1amc1si0l0hyyw2sawmnzy4hkna3z6fp195y4nm5m9wb9ld5awkq"))))
7384 (build-system ant-build-system)
7385 (arguments
7386 `(#:jar-name "java-stax2-api.jar"
7387 #:source-dir "src/main/java"
7388 #:tests? #f)); no tests
7389 (home-page "https://github.com/FasterXML/stax2-api")
7390 (synopsis "Stax2 API")
7391 (description "Stax2 API is an extension to basic Stax 1.0 API that adds
7392significant new functionalities, such as full-featured bi-direction validation
7393interface and high-performance Typed Access API.")
7394 (license license:bsd-2)))
40f193f3
JL
7395
7396(define-public java-woodstox-core
7397 (package
7398 (name "java-woodstox-core")
7399 (version "5.0.3")
7400 (source (origin
7401 (method url-fetch)
7402 (uri (string-append "https://github.com/FasterXML/woodstox/archive/"
7403 "woodstox-core-" version ".tar.gz"))
7404 (sha256
7405 (base32
7406 "1i7pdgb8jbw6gdy5kmm0l6rz109n2ns92pqalpyp24vb8vlvdfd4"))))
7407 (build-system ant-build-system)
7408 (arguments
7409 `(#:jar-name "woodstox.jar"
7410 #:test-exclude
7411 (list "**/Base*.java" "failing/**")
7412 #:phases
7413 (modify-phases %standard-phases
7414 (add-before 'build 'remove-msv-dep
7415 (lambda _
7416 ;; we don't need osgi, and it depends on msv
7417 (delete-file-recursively "src/main/java/com/ctc/wstx/osgi")
7418 ;; msv's latest release is from 2011 and we don't need it
7419 (delete-file-recursively "src/main/java/com/ctc/wstx/msv")
7420 (delete-file-recursively "src/test/java/wstxtest/osgi")
7421 (delete-file-recursively "src/test/java/wstxtest/msv")))
7422 (add-before 'build 'copy-resources
7423 (lambda _
7424 (copy-recursively "src/main/resources" "build/classes"))))))
7425 (inputs
7426 `(("stax2" ,java-stax2-api)))
7427 (native-inputs
7428 `(("junit" ,java-junit)))
7429 (home-page "https://github.com/FasterXML/woodstox")
7430 (synopsis "Stax XML API implementation")
7431 (description "Woodstox is a stax XML API implementation.")
7432 (license license:asl2.0)))
262a4d33
JL
7433
7434(define-public java-fasterxml-jackson-dataformat-xml
7435 (package
7436 (name "java-fasterxml-jackson-dataformat-xml")
f3bbe029 7437 (version "2.9.4")
262a4d33
JL
7438 (source (origin
7439 (method url-fetch)
7440 (uri (string-append "https://github.com/FasterXML/"
7441 "jackson-dataformat-xml/archive/"
7442 "jackson-dataformat-xml-" version ".tar.gz"))
7443 (sha256
7444 (base32
f3bbe029 7445 "111fkkl90w31jbf30kgj82qdcxlw4sxppki7i198liw0ck1jcavq"))))
262a4d33
JL
7446 (build-system ant-build-system)
7447 (arguments
7448 `(#:jar-name "jackson-dataformat-xml.jar"
7449 #:source-dir "src/main/java"
7450 #:test-exclude
7451 (list "**/failing/**")
7452 #:phases
7453 (modify-phases %standard-phases
7454 (add-before 'configure 'generate-PackageVersion.java
7455 (lambda _
7456 (let* ((out "src/main/java/com/fasterxml/jackson/dataformat/xml/PackageVersion.java")
7457 (in (string-append out ".in")))
7458 (copy-file in out)
7459 (newline)
7460 (substitute* out
7461 (("@package@") "com.fasterxml.jackson.dataformat.xml")
7462 (("@projectversion@") ,version)
7463 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.xml")
7464 (("@projectartifactid@") "jackson-dataformat-xml")))))
7465 (add-before 'build 'copy-resources
7466 (lambda _
7467 (copy-recursively "src/main/resources" "build/classes"))))))
7468 (inputs
7469 `(("jackson-annotations" ,java-fasterxml-jackson-annotations)
7470 ("jackson-core" ,java-fasterxml-jackson-core)
7471 ("jackson-modules-base-jaxb" ,java-fasterxml-jackson-modules-base-jaxb)
7472 ("jackson-databind" ,java-fasterxml-jackson-databind)
7473 ("stax2-api" ,java-stax2-api)
7474 ("woodstox" ,java-woodstox-core)))
7475 (native-inputs
7476 `(("junit" ,java-junit)
7477 ("hamcrest" ,java-hamcrest-core)))
7478 (home-page "https://github.com/FasterXML/jackson-dataformat-xml")
7479 (synopsis "Read and write XML")
7480 (description "This package contains Jackson extension component for reading
7481and writing XML encoded data.
7482
7483Further, the goal is to emulate how JAXB data-binding works with \"Code-first\"
7484approach (that is, no support is added for \"Schema-first\" approach). Support
7485for JAXB annotations is provided by JAXB annotation module; this module
7486provides low-level abstractions (@code{JsonParser}, @code{JsonGenerator},
7487@code{JsonFactory}) as well as small number of higher level overrides needed to
7488make data-binding work.")
7489 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
90a127c7
JL
7490
7491(define-public java-hdrhistogram
7492 (package
7493 (name "java-hdrhistogram")
7494 (version "2.1.9")
7495 (source (origin
7496 (method url-fetch)
7497 (uri (string-append "https://github.com/HdrHistogram/HdrHistogram/"
7498 "archive/HdrHistogram-" version ".tar.gz"))
7499 (sha256
7500 (base32
7501 "1sicbmc3sr42nw93qbkb26q9rn33ag33k6k77phjc3j5h5gjffqv"))))
7502 (build-system ant-build-system)
7503 (arguments
7504 `(#:jar-name "java-hdrhistogram.jar"
7505 #:source-dir "src/main/java"
7506 #:phases
7507 (modify-phases %standard-phases
7508 (add-before 'configure 'set-version
7509 (lambda _
7510 (let* ((version-java "src/main/java/org/HdrHistogram/Version.java")
7511 (template (string-append version-java ".template")))
7512 (copy-file template version-java)
7513 (substitute* version-java
7514 (("\\$VERSION\\$") ,version)
7515 (("\\$BUILD_TIME\\$") "0"))
7516 #t))))))
7517 (native-inputs
7518 `(("junit" ,java-junit)
7519 ("hamcrest" ,java-hamcrest-core)))
7520 (home-page "https://hdrhistogram.github.io/HdrHistogram")
7521 (synopsis "High dynamic range histogram")
7522 (description "Hdrhistogram allows to create histograms that support
7523recording and analyzing sampled data value counts across a configurable integer
7524value range with configurable value precision within the range. Value precision
7525is expressed as the number of significant digits in the value recording, and
7526provides control over value quantization behavior across the value range and
7527the subsequent value resolution at any given level.")
7528 (license license:public-domain)))
5d104a27 7529
c5ff11dc
RW
7530(define-public java-cofoja
7531 (package
7532 (name "java-cofoja")
7533 (version "1.3")
7534 (source (origin
7535 (method git-fetch)
7536 (uri (git-reference
7537 (url "https://github.com/nhatminhle/cofoja.git")
7538 (commit (string-append "v" version))))
7539 (file-name (string-append "java-cofoja-" version "-checkout"))
7540 (sha256
7541 (base32
7542 "0p7sz8y5xgpi5rx1qwn6587fkd52qr3ha3ybh14gqcyxhikl525w"))))
7543 (build-system ant-build-system)
7544 (arguments
7545 `(#:build-target "dist"
7546 #:test-target "test"
7547 #:jdk ,icedtea-8
7548 #:make-flags
7549 (list "-Ddist.dir=dist")
7550 #:modules ((guix build ant-build-system)
7551 (guix build java-utils)
7552 (guix build utils)
7553 (srfi srfi-1)
7554 (ice-9 match))
7555 #:phases
7556 (modify-phases %standard-phases
7557 ;; The bulid system ignores the class path the ant-build-system sets
7558 ;; up and instead expects to find all dependencies in the "lib"
7559 ;; directory.
7560 (add-after 'unpack 'create-libdir
7561 (lambda* (#:key inputs #:allow-other-keys)
7562 (mkdir-p "lib")
7563 (for-each
7564 (lambda (file)
7565 (let ((target (string-append "lib/" (basename file))))
7566 (unless (file-exists? target)
7567 (symlink file target))))
7568 (append-map (match-lambda
7569 ((label . dir)
7570 (find-files dir "\\.jar$")))
7571 inputs))
7572 #t))
7573 (replace 'install (install-jars "dist")))))
7574 (inputs
7575 `(("java-asm" ,java-asm)))
7576 (native-inputs
7577 `(("java-junit" ,java-junit)))
7578 (home-page "https://github.com/nhatminhle/cofoja")
7579 (synopsis "Contracts for Java")
7580 (description "Contracts for Java, or Cofoja for short, is a contract
7581programming framework and test tool for Java, which uses annotation processing
7582and bytecode instrumentation to provide run-time checking. (In particular,
7583this is not a static analysis tool.)")
7584 (license license:lgpl3+)))
7585
5d104a27
JL
7586(define-public java-aopalliance
7587 (package
7588 (name "java-aopalliance")
7589 (version "1.0")
7590 (source (origin
7591 (method git-fetch)
7592 ;; Note: this git repository is not official, but contains the
7593 ;; source code that is in the CVS repository. Downloading the
7594 ;; tarball from sourceforge is undeterministic, and the cvs download
7595 ;; fails.
7596 (uri (git-reference
7597 (url "https://github.com/hoverruan/aopalliance")
7598 (commit "0d7757ae204e5876f69431421fe9bc2a4f01e8a0")))
7599 (file-name (string-append name "-" version))
7600 (sha256
7601 (base32
7602 "0rsg2b0v3hxlq2yk1i3m2gw3xwq689j3cwx9wbxvqfpdcjbca0qr"))))
7603 (build-system ant-build-system)
7604 (arguments
7605 `(#:jar-name "java-aopalliance.jar"
7606 #:jdk ,icedtea-8
7607 #:tests? #f; no tests
7608 #:source-dir "aopalliance/src/main"))
7609 (home-page "http://aopalliance.sourceforge.net")
7610 (synopsis "Aspect-Oriented Programming")
7611 (description "The AOP Alliance project is a joint project between several
7612software engineering people who are interested in Aspect-Oriented Programming
7613(AOP) and Java.")
7614 (license license:public-domain)))
454536e0
JL
7615
7616(define-public java-javax-inject
7617 (package
7618 (name "java-javax-inject")
7619 (version "tck-1")
7620 (source (origin
7621 (method url-fetch)
7622 (uri (string-append "https://github.com/javax-inject/javax-inject/"
7623 "archive/javax.inject-" version ".tar.gz"))
7624 (sha256
7625 (base32
7626 "1ydrlvh2r7vr1g7lhjwy3w2dggpj9h6pix1lakkkgdywb365n6g0"))))
7627 (build-system ant-build-system)
7628 (arguments
7629 `(#:jar-name "java-javax-inject.jar"
7630 #:jdk ,icedtea-8
7631 #:tests? #f)); no tests
7632 (home-page "http://github.com/javax-inject/javax-inject")
7633 (synopsis "JSR-330: Dependency Injection for Java")
7634 (description "This package specifies a means for obtaining objects in such
7635a way as to maximize reusability, testability and maintainability compared to
7636traditional approaches such as constructors, factories, and service locators
7637(e.g., JNDI). This process, known as dependency injection, is beneficial to
7638most nontrivial applications.
7639
7640Many types depend on other types. For example, a @var{Stopwatch} might depend
7641on a @var{TimeSource}. The types on which a type depends are known as its
7642dependencies. The process of finding an instance of a dependency to use at run
7643time is known as resolving the dependency. If no such instance can be found,
7644the dependency is said to be unsatisfied, and the application is broken.")
7645 (license license:asl2.0)))
5766984b
JL
7646
7647(define-public java-guice
7648 (package
7649 (name "java-guice")
7650 (version "4.1")
7651 (source (origin
7652 (method url-fetch)
7653 (uri (string-append "https://github.com/google/guice/archive/"
7654 version ".tar.gz"))
7655 (file-name (string-append name "-" version ".tar.gz"))
7656 (sha256
7657 (base32
7658 "0dwmqjzlavb144ywqqglj3h68hqszkff8ai0a42hyb5il0qh4rbp"))))
7659 (build-system ant-build-system)
7660 (arguments
7661 `(#:jar-name "java-guice.jar"
7662 #:jdk ,icedtea-8
7663 #:tests? #f; FIXME: tests are not in a java sub directory
7664 #:source-dir "core/src"))
7665 (inputs
7666 `(("guava" ,java-guava)
7667 ("java-cglib" ,java-cglib)
7668 ("java-aopalliance" ,java-aopalliance)
7669 ("java-javax-inject" ,java-javax-inject)
7670 ("java-asm" ,java-asm)))
7671 (home-page "https://github.com/google/guice")
7672 (synopsis "Lightweight dependency injection framework")
7673 (description "Guice is a lightweight dependency injection framework fo
7674Java 6 and above.")
7675 (license license:asl2.0)))
ec4e8ad7
JL
7676
7677(define-public java-guice-servlet
7678 (package
7679 (inherit java-guice)
7680 (name "java-guice-servlet")
7681 (arguments
7682 `(#:jar-name "guice-servlet.jar"
7683 #:source-dir "extensions/servlet/src/"
7684 #:jdk ,icedtea-8
7685 #:tests? #f)); FIXME: not in a java subdir
7686 (inputs
7687 `(("guice" ,java-guice)
7688 ("servlet" ,java-tomcat)
7689 ,@(package-inputs java-guice)))))
b12fe1e5
JL
7690
7691(define-public java-assertj
7692 (package
7693 (name "java-assertj")
7694 (version "3.8.0")
7695 (source (origin
7696 (method url-fetch)
7697 (uri (string-append "https://github.com/joel-costigliola/"
7698 "assertj-core/archive/"
7699 "assertj-core-" version ".tar.gz"))
7700 (sha256
7701 (base32
7702 "1kf124fxskf548rklkg86294w2x6ajqrff94rrhyqns31danqkfz"))))
7703 (build-system ant-build-system)
7704 (arguments
7705 `(#:jar-name "java-assertj.jar"
7706 #:jdk ,icedtea-8
7707 #:source-dir "src/main/java"
7708 #:tests? #f)); depends on tng-junit which depends on assertj
7709 (inputs
7710 `(("cglib" ,java-cglib)
7711 ("junit" ,java-junit)
7712 ("hamcrest" ,java-hamcrest-core)))
7713 (native-inputs
7714 `(("mockito" ,java-mockito-1)))
7715 (home-page "https://joel-costigliola.github.io/assertj/index.html")
7716 (synopsis "Fluent assertions for java")
7717 (description "AssertJ core is a Java library that provides a fluent
7718interface for writing assertions. Its main goal is to improve test code
7719readability and make maintenance of tests easier.")
7720 (license license:asl2.0)))
6768e0a7
JL
7721
7722(define-public java-jboss-javassist
7723 (package
7724 (name "java-jboss-javassist")
7725 (version "3.21.0")
7726 (source (origin
7727 (method url-fetch)
7728 (uri (string-append "https://github.com/jboss-javassist/javassist/"
7729 "archive/rel_"
7730 (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
7731 "_ga.tar.gz"))
7732 (sha256
7733 (base32
7734 "10lpcr3sbf7y6fq6fc2h2ik7rqrivwcy4747bg0kxhwszil3cfmf"))))
7735 (build-system ant-build-system)
7736 (arguments
7737 `(#:jar-name "java-jboss-javassist.jar"
7738 #:jdk ,icedtea-8
7739 #:source-dir "src/main"
7740 #:tests? #f; FIXME: requires junit-awtui and junit-swingui from junit3
7741 #:phases
7742 (modify-phases %standard-phases
7743 (add-before 'configure 'remove-binary
7744 (lambda _
7745 (delete-file "javassist.jar")
7746 #t)))))
7747 (native-inputs
7748 `(("junit" ,java-junit)))
7749 (home-page "https://github.com/jboss-javassist/javassist")
7750 (synopsis "Java bytecode engineering toolkit")
7751 (description "Javassist (JAVA programming ASSISTant) makes Java bytecode
7752manipulation simple. It is a class library for editing bytecodes in Java; it
7753enables Java programs to define a new class at runtime and to modify a class
7754file when the JVM loads it.")
7755 (license (list license:gpl2 license:cddl1.0)))); either gpl2 only or cddl.
a6dd06d0
JL
7756
7757(define-public java-jcommander
7758 (package
7759 (name "java-jcommander")
7760 (version "1.71")
7761 (source (origin
7762 (method url-fetch)
7763 (uri (string-append "https://github.com/cbeust/jcommander/archive/"
7764 version ".tar.gz"))
7765 (file-name (string-append name "-" version ".tar.gz"))
7766 (sha256
7767 (base32
7768 "1f5k2ckay6qjc3d3w3d7bc0p3cx3c7n6p6zxvw1kibqdr0q98wlx"))))
7769 (build-system ant-build-system)
7770 (arguments
7771 `(#:jar-name "java-jcommander.jar"
7772 #:jdk ,icedtea-8
7773 #:tests? #f; requires testng which depends on jcommander
7774 #:source-dir "src/main/java"))
7775 (home-page "http://jcommander.org")
7776 (synopsis "Command line parameters parser")
7777 (description "JCommander is a very small Java framework that makes it
7778trivial to parse command line parameters. Parameters are declared with
7779annotations.")
7780 (license license:asl2.0)))
11bc385b
JL
7781
7782(define-public java-bsh
7783 (package
7784 (name "java-bsh")
7785 (version "2.0b6")
7786 (source (origin
7787 (method url-fetch)
7788 (uri (string-append "https://github.com/beanshell/beanshell/archive/"
7789 version ".tar.gz"))
7790 (file-name (string-append name "-" version ".tar.gz"))
7791 (sha256
7792 (base32
7793 "1bawkxk6jyc75hxvzkpz689h73cn3f222m0ar3nvb0dal2b85kfv"))))
7794 (build-system ant-build-system)
7795 (arguments
7796 `(#:build-target "jarall"
7797 #:test-target "junit-tests-all"
7798 #:phases
7799 (modify-phases %standard-phases
7800 (replace 'install
7801 (lambda* (#:key outputs #:allow-other-keys)
7802 (let ((share (string-append (assoc-ref outputs "out") "/share/java")))
7803 (mkdir-p share)
7804 (copy-file "dist/bsh-2.0b6.jar" (string-append share "/bsh-2.0b6.jar"))
7805 #t))))))
7806 (home-page "http://beanshell.org/")
7807 (synopsis "Lightweight Scripting for Java")
7808 (description "BeanShell is a small, free, embeddable Java source
7809interpreter with object scripting language features, written in Java.
7810BeanShell dynamically executes standard Java syntax and extends it with common
7811scripting conveniences such as loose types, commands, and method closures like
7812those in Perl and JavaScript.")
7813 (license license:asl2.0)))
7a343e97
JL
7814
7815(define-public java-fest-util
7816 (package
7817 (name "java-fest-util")
7818 (version "1.2.5")
7819 (source (origin
7820 (method url-fetch)
7821 (uri (string-append "https://github.com/alexruiz/fest-util/"
7822 "archive/fest-util-" version ".tar.gz"))
7823 (sha256
7824 (base32
7825 "05g6hljz5mdaakk8d7g32klbhz9bdwp3qlj6rdaggdidxs3x1sb8"))))
7826 (build-system ant-build-system)
7827 (arguments
7828 `(#:jar-name "java-fest-util.jar"
7829 #:source-dir "src/main/java"))
7830 (native-inputs
7831 `(("junit" ,java-junit)
7832 ("hamcrest" ,java-hamcrest-core)))
7833 (home-page "https://github.com/alexruiz/fest-util")
7834 (synopsis "FEST common utilities")
7835 (description "Common utilities used in all FEST module.")
7836 (license license:asl2.0)))
3c6c8358
JL
7837
7838(define-public java-fest-test
7839 (package
7840 (name "java-fest-test")
7841 (version "2.1.0")
7842 (source (origin
7843 (method url-fetch)
7844 (uri (string-append "https://github.com/alexruiz/fest-test/"
7845 "archive/fest-test-" version ".tar.gz"))
7846 (sha256
7847 (base32
7848 "1rxfbw6l9vc65iy1x3fb617qc6y4w2k430pgf1mfbxfdlxbm0f7g"))))
7849 (build-system ant-build-system)
7850 (arguments
7851 `(#:jar-name "java-fest-test.jar"
7852 #:source-dir "src/main/java"
7853 #:tests? #f)); no tests
7854 (inputs
7855 `(("junit" ,java-junit)))
7856 (home-page "https://github.com/alexruiz/fest-test")
7857 (synopsis "Common FEST testing infrastructure")
7858 (description "Fest-test contains the common FEST testing infrastructure.")
7859 (license license:asl2.0)))
ca98e448
JL
7860
7861(define-public java-fest-assert
7862 (package
7863 (name "java-fest-assert")
7864 (version "2.0M10")
7865 (source (origin
7866 (method url-fetch)
7867 (uri (string-append "https://github.com/alexruiz/fest-assert-2.x/"
7868 "archive/fest-assert-core-" version ".tar.gz"))
7869 (sha256
7870 (base32
7871 "1bi0iqavikzww6rxvz5jyg7y6bflv95s6ibryxx0xfcxrrw6i5lw"))))
7872 (build-system ant-build-system)
7873 (arguments
7874 `(#:jar-name "java-fest-assert.jar"
7875 #:source-dir "src/main/java"
7876 #:test-exclude
7877 (list
7878 "**/Abstract*.java"
7879 "**/*BaseTest.java"
7880 ;; Unable to set MockitoNamingPolicy on cglib generator which creates FastClasses
7881 "**/MessageFormatter_format_Test.java"
7882 "**/internal/*/*_assert*_Test.java")))
7883 (inputs
7884 `(("java-fest-util" ,java-fest-util)))
7885 (native-inputs
7886 `(("java-junit" ,java-junit)
7887 ("java-fest-test" ,java-fest-test)
7888 ("java-hamcrest-core" ,java-hamcrest-core)
7889 ("java-mockito" ,java-mockito-1)
7890 ("java-cglib" ,java-cglib)
7891 ("java-objenesis" ,java-objenesis)
7892 ("java-asm" ,java-asm)))
7893 (home-page "https://github.com/alexruiz/fest-assert-2.x")
7894 (synopsis "FEST fluent assertions")
7895 (description "FEST-Assert provides a fluent interface for assertions.")
7896 (license license:asl2.0)))
0442d897
JL
7897
7898(define-public java-testng
7899 (package
7900 (name "java-testng")
3422e10e 7901 (version "6.14.3")
0442d897 7902 (source (origin
36b39d16
RW
7903 (method git-fetch)
7904 (uri (git-reference
7905 (url "https://github.com/cbeust/testng.git")
7906 (commit version)))
7907 (file-name (string-append name "-" version "-checkout"))
0442d897
JL
7908 (sha256
7909 (base32
3422e10e 7910 "0y6vq30i5g276kw0v2bhbvci22ijg7ax49ap2611yqlhbs4d6dqv"))))
0442d897
JL
7911 (build-system ant-build-system)
7912 (arguments
7913 `(#:jdk ,icedtea-8; java.util.function
7914 #:jar-name "java-testng.jar"
7915 #:source-dir "src/main/java"
7916 #:phases
7917 (modify-phases %standard-phases
36b39d16
RW
7918 ;; FIXME: I don't know why these tests fail
7919 (add-after 'unpack 'delete-failing-tests
7920 (lambda _
7921 (substitute* "src/test/resources/testng.xml"
7922 (("<class name=\"test.configuration.github1625.TestRunnerIssue1625\"/>") "")
7923 (("<class name=\"test.serviceloader.ServiceLoaderTest\" />") ""))
7924 #t))
7925 ;; We don't have groovy
7926 (add-after 'unpack 'delete-groovy-tests
7927 (lambda _
7928 (delete-file-recursively "src/test/java/test/dependent/issue1648/")
7929 (substitute* "src/test/resources/testng.xml"
7930 (("<class name=\"test.dependent.issue1648.TestRunner\"/>") ""))
7931 #t))
0442d897
JL
7932 (add-before 'build 'copy-resources
7933 (lambda _
7934 (copy-recursively "src/main/resources" "build/classes")
7935 #t))
7936 (add-before 'check 'copy-test-resources
7937 (lambda _
7938 (copy-recursively "src/test/resources" "build/test-classes")
7939 #t))
7940 (replace 'check
7941 (lambda _
7942 (system* "ant" "compile-tests")
7943 ;; we don't have groovy
7944 (substitute* "src/test/resources/testng.xml"
7945 (("<class name=\"test.groovy.GroovyTest\" />") ""))
7946 (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH")
7947 ":build/classes"
7948 ":build/test-classes")
7949 "-Dtest.resources.dir=src/test/resources"
7950 "org.testng.TestNG" "src/test/resources/testng.xml")))))))
7951 (propagated-inputs
7952 `(("junit" ,java-junit)
7953 ("java-jsr305" ,java-jsr305)
7954 ("java-bsh" ,java-bsh)
7955 ("java-jcommander" ,java-jcommander)
7956 ("java-guice" ,java-guice)
7957 ("snakeyaml" ,java-snakeyaml)))
7958 (native-inputs
7959 `(("guava" ,java-guava)
7960 ("java-javax-inject" ,java-javax-inject)
7961 ("java-hamcrest" ,java-hamcrest-all)
7962 ("java-assertj" ,java-assertj)
36b39d16 7963 ("java-mockito" ,java-mockito-1)
0442d897
JL
7964 ("cglib" ,java-cglib)
7965 ("asm" ,java-asm)
7966 ("aopalliance" ,java-aopalliance)))
7967 (home-page "http://testng.org")
7968 (synopsis "Testing framework")
7969 (description "TestNG is a testing framework inspired from JUnit and NUnit
7970but introducing some new functionalities that make it more powerful and easier
7971to use.")
7972 (license license:asl2.0)))
1717a7de
JL
7973
7974(define-public java-jnacl
3e87923a
RW
7975 (let ((commit "094e819afdd63ea81a499b3bcb42a271006bebd9")
7976 (revision "2"))
7977 (package
7978 (name "java-jnacl")
7979 (version (string-append "0.1.0-" revision "." (string-take commit 7)))
7980 (source (origin
7981 (method git-fetch)
7982 (uri (git-reference
7983 (url "https://github.com/neilalexander/jnacl.git")
7984 (commit commit)))
7985 (sha256
7986 (base32
7987 "1d6g6xhn83byv5943n7935wwjsk0ibk0qdvqgr699qqgqqmwisbb"))))
7988 (build-system ant-build-system)
7989 (arguments
8c7d32e0 7990 `(#:jar-name "jnacl.jar"
3e87923a
RW
7991 #:source-dir "src/main/java"
7992 #:jdk ,icedtea-8
7993 #:phases
7994 (modify-phases %standard-phases
7995 (add-before 'build 'fix-tests
7996 (lambda _
7997 (substitute* '("src/test/java/com/neilalexander/jnacl/NaClTest.java"
7998 "src/test/java/com/neilalexander/jnacl/NaclSecretBoxTest.java")
7999 (("assertions.Assertions") "assertions.api.Assertions"))
8000 #t))
8001 (replace 'check
8002 (lambda _
8003 (invoke "ant" "compile-tests")
8004 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
8005 ":build/classes"
8006 ":build/test-classes")
8007 "org.testng.TestNG" "-testclass"
8008 "build/test-classes/com/neilalexander/jnacl/NaclSecretBoxTest.class")
8009 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
8010 ":build/classes"
8011 ":build/test-classes")
8012 "org.testng.TestNG" "-testclass"
8013 "build/test-classes/com/neilalexander/jnacl/NaClTest.class")
8014 #t)))))
8015 (native-inputs
8016 `(("java-testng" ,java-testng)
8017 ("java-fest-util" ,java-fest-util)
8018 ("java-fest-assert" ,java-fest-assert)))
8019 (home-page "https://github.com/neilalexander/jnacl")
8020 (synopsis "Java implementation of NaCl")
8021 (description "Pure Java implementation of the NaCl: Networking and
1717a7de 8022Cryptography library.")
3e87923a 8023 (license license:bsd-2))))
eaf3cb7a
JL
8024
8025(define-public java-mvel2
8026 (package
8027 (name "java-mvel2")
8028 (version "2.3.1")
8029 (source (origin
8030 (method url-fetch)
8031 (uri (string-append "https://github.com/mvel/mvel/archive/mvel2-"
8032 version ".Final.tar.gz"))
8033 (sha256
8034 (base32
8035 "01ph5s9gm16l2qz58lg21w6fna7xmmrj7f9bzqr1jim7h9557d3z"))))
8036 (build-system ant-build-system)
8037 (arguments
8038 `(#:jar-name "mvel2.jar"
8039 #:source-dir "src/main/java"
8040 #:test-exclude
8041 (list "**/Abstract*.java"
8042 ;; Base class with no tests
8043 "**/MVELThreadTest.java")
8044 #:phases
8045 (modify-phases %standard-phases
8046 (add-after 'install 'install-bin
8047 (lambda* (#:key outputs #:allow-other-keys)
8048 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
8049 (mkdir-p bin)
8050 (with-output-to-file (string-append bin "/mvel2")
8051 (lambda _
8052 (display
8053 (string-append
8054 "#!" (which "bash") "\n"
8055 "if [ \"$#\" -ne \"2\" ]; then\n"
8056 "echo 'Usage: mvel2 <script> <out.dir>'\n"
8057 "exit\n"
8058 "fi\n"
8059 "java -Dout.dir=$2 -cp " (getenv "CLASSPATH")
8060 ":" (assoc-ref outputs "out") "/share/java/mvel2.jar"
8061 " org.mvel2.sh.Main $1"))))
8062 (chmod (string-append bin "/mvel2") #o755))
8063 #t)))))
8064 (native-inputs
8065 `(("junit" ,java-junit)
8066 ("hamcrest" ,java-hamcrest-core)))
8067 (home-page "https://github.com/mvel/mvel")
8068 (synopsis "MVFLEX Expression Language")
8069 (description "MVEL has largely been inspired by Java syntax, but has some
8070fundamental differences aimed at making it more efficient as an expression
8071language, such as operators that directly support collection, array and string
8072matching, as well as regular expressions. MVEL is used to evaluate expressions
8073written using Java syntax.
8074
8075In addition to the expression language, MVEL serves as a templating language for
8076configuration and string construction.")
8077 (license license:asl2.0)))
d54d7d31 8078
9e325e8c
RW
8079(define-public java-commons-jexl-2
8080 (package
8081 (name "java-commons-jexl")
8082 (version "2.1.1")
8083 (source (origin
8084 (method url-fetch)
8085 (uri (string-append "mirror://apache/commons/jexl/source/"
8086 "commons-jexl-" version "-src.tar.gz"))
8087 (sha256
8088 (base32
8089 "1ai7632bwwaxglb0nbpblpr2jw5g20afrsaq372ipkphi3ncy1jz"))))
8090 (build-system ant-build-system)
8091 (arguments
8092 `(#:jar-name "commons-jexl-2.jar"
8093 #:jdk ,icedtea-8
8094 #:source-dir "src/main/java"
8095 #:phases
8096 (modify-phases %standard-phases
8097 (add-before 'check 'disable-broken-tests
8098 (lambda* (#:key inputs #:allow-other-keys)
8099 (with-directory-excursion "src/test/java/org/apache/commons/jexl2/"
8100 (substitute* "ArithmeticTest.java"
8101 (("asserter.assertExpression\\(\"3 / 0\"") "//")
8102 (("asserter.assertExpression\\(\"imanull") "//"))
8103 ;; This test fails with "ambiguous method invocation"
8104 (delete-file "CacheTest.java")
8105 ;; This test doesn't have access to the temp directory
8106 (substitute* "ClassCreatorTest.java"
8107 (("java.io.tmpdir") "user.dir"))
8108 ;; This test fails in trying to detect whether it can run.
8109 (substitute* "ClassCreator.java"
8110 (("boolean canRun =.*") "boolean canRun = false;\n"))
8111 ;; ...and these tests depend on it.
8112 (delete-file "scripting/JexlScriptEngineOptionalTest.java")
8113 (delete-file "scripting/JexlScriptEngineTest.java"))
8114 #t))
8115 (add-before 'build 'run-javacc
8116 (lambda _
8117 (with-directory-excursion "src/main/java/org/apache/commons/jexl2/parser/"
080d0b60
RW
8118 (invoke "java" "jjtree" "Parser.jjt")
8119 (invoke "java" "javacc" "Parser.jj"))
8120 #t)))))
9e325e8c
RW
8121 (inputs
8122 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)))
8123 (native-inputs
8124 `(("java-junit" ,java-junit)
8125 ("java-hamcrest-core" ,java-hamcrest-core)
8126 ("javacc" ,javacc-4)))
8127 (home-page "https://commons.apache.org/proper/commons-jexl/")
8128 (synopsis "Java Expression Language ")
8129 (description "JEXL is a library intended to facilitate the implementation
8130of dynamic and scripting features in applications and frameworks written in
8131Java. JEXL implements an Expression Language based on some extensions to the
8132JSTL Expression Language supporting most of the constructs seen in
8133shell-script or ECMAScript. Its goal is to expose scripting features usable
8134by technical operatives or consultants working with enterprise platforms.")
8135 (license license:asl2.0)))
8136
d54d7d31
JL
8137(define-public java-lz4
8138 (package
8139 (name "java-lz4")
8140 (version "1.4.0")
8141 (source (origin
8142 (method url-fetch)
8143 (uri (string-append "https://github.com/lz4/lz4-java/archive/"
8144 version ".tar.gz"))
8145 (file-name (string-append name "-" version ".tar.gz"))
8146 (sha256
8147 (base32
8148 "096dm57p2lzqk28n0j2p52x2j3cvnsd2dfqn43n7vbwrkjsy7y54"))))
8149 (build-system ant-build-system)
8150 (arguments
8151 `(#:jar-name "lz4.jar"
8152 #:jdk ,icedtea-8
8153 #:source-dir "src/java:src/java-unsafe"
8154 #:tests? #f; FIXME: requires more dependencies
8155 #:phases
8156 (modify-phases %standard-phases
8157 (add-before 'configure 'generate-source
8158 (lambda _
8159 (with-directory-excursion "src/build/source_templates"
1b6bc516
RW
8160 (invoke "mvel2" "../gen_sources.mvel" "../../java"))
8161 #t)))))
d54d7d31
JL
8162 (native-inputs
8163 `(("mvel" ,java-mvel2)))
8164 (home-page "https://jpountz.github.io/lz4-java")
8165 (synopsis "Compression algorithm")
8166 (description "LZ4 - Java is a Java port of the popular lz4 compression
8167algorithms and xxHash hashing algorithm.")
8168 (license license:asl2.0)))
62315865
JL
8169
8170(define-public java-bouncycastle-bcprov
8171 (package
8172 (name "java-bouncycastle-bcprov")
8173 (version "1.58")
8174 (source (origin
8175 (method url-fetch)
8176 (uri "https://bouncycastle.org/download/bcprov-jdk15on-158.tar.gz")
8177 (sha256
8178 (base32
8179 "1hgkg96llbvgs8i0krwz2n0j7wlg6jfnq8w8kg0cc899j0wfmf3n"))))
8180 (build-system ant-build-system)
8181 (arguments
8182 `(#:jar-name "bouncycastle-bcprov.jar"
8183 #:tests? #f; no tests
8184 #:source-dir "src"
8185 #:phases
8186 (modify-phases %standard-phases
8187 (add-before 'configure 'unzip-src
8188 (lambda _
8189 (mkdir-p "src")
8190 (with-directory-excursion "src"
9be4b9fa
RW
8191 (invoke "unzip" "../src.zip"))
8192 #t)))))
62315865
JL
8193 (native-inputs
8194 `(("unzip" ,unzip)
8195 ("junit" ,java-junit)))
8196 (home-page "https://www.bouncycastle.org")
8197 (synopsis "Cryptographic library")
8198 (description "Bouncy Castle Provider (bcprov) is a cryptographic library
8199for the Java programming language.")
8200 (license license:expat)))
31208367
JL
8201
8202(define-public java-bouncycastle-bcpkix
8203 (package
8204 (name "java-bouncycastle-bcpkix")
8205 (version "1.58")
8206 (source (origin
8207 (method url-fetch)
8208 (uri "https://bouncycastle.org/download/bcpkix-jdk15on-158.tar.gz")
8209 (sha256
8210 (base32
8211 "0is7qay02803s9f7lhnfcjlz61ni3hq5d7apg0iil7nbqkbfbcq2"))))
8212 (build-system ant-build-system)
8213 (arguments
8214 `(#:jar-name "bouncycastle-bcpkix.jar"
8215 #:tests? #f; no tests
8216 #:source-dir "src"
8217 #:phases
8218 (modify-phases %standard-phases
8219 (add-before 'configure 'unzip-src
8220 (lambda _
8221 (mkdir-p "src")
8222 (with-directory-excursion "src"
201084ac
RW
8223 (invoke "unzip" "../src.zip"))
8224 #t)))))
31208367
JL
8225 (native-inputs
8226 `(("unzip" ,unzip)
8227 ("junit" ,java-junit)))
8228 (inputs
8229 `(("bcprov" ,java-bouncycastle-bcprov)))
8230 (home-page "https://www.bouncycastle.org")
8231 (synopsis "Cryptographic library")
8232 (description "Bouncy Castle Java API for PKIX, CMS, EAC, TSP, PKCS, OCSP,
8233CMP, and CRMF.")
8234 (license license:expat)))
a53d9ac0
JL
8235
8236(define-public java-lmax-disruptor
8237 (package
8238 (name "java-lmax-disruptor")
8239 (version "3.3.7")
8240 (source (origin
8241 (method url-fetch)
8242 (uri (string-append "https://github.com/LMAX-Exchange/disruptor/"
8243 "archive/" version ".tar.gz"))
8244 (file-name (string-append name "-" version ".tar.gz"))
8245 (sha256
8246 (base32
8247 "17da2gwj5abnlsfgn2xqjk5lgzbg4vkb0hdv2dvc8r2fx4bi7w3g"))))
8248 (build-system ant-build-system)
8249 (arguments
8250 `(#:jar-name "java-lmax-disruptor.jar"
8251 #:jdk ,icedtea-8
8252 #:tests? #f)); tests hang
8253 (inputs
8254 `(("junit" ,java-junit)
8255 ("java-hdrhistogram" ,java-hdrhistogram)
8256 ("java-jmock" ,java-jmock)
8257 ("java-jmock-legacy" ,java-jmock-legacy)
8258 ("java-jmock-junit4" ,java-jmock-junit4)
8259 ("java-hamcrest-all" ,java-hamcrest-all)))
8260 (native-inputs
8261 `(("cglib" ,java-cglib)
8262 ("objenesis" ,java-objenesis)
8263 ("asm" ,java-asm)))
8264 (home-page "https://www.lmax.com/disruptor")
8265 (synopsis "High performance inter-thread communication")
8266 (description "LMAX Disruptor is a software pattern and software component
8267for high performance inter-thread communication that avoids the need for
8268message queues or resource locking.")
8269 (license license:asl2.0)))
5619556b 8270
5e3abfc8
RW
8271(define-public java-commons-bcel
8272 (package
8273 (name "java-commons-bcel")
8274 (version "6.1")
8275 (source (origin
8276 (method url-fetch)
8277 (uri (string-append "mirror://apache/commons/bcel/source/bcel-"
8278 version "-src.tar.gz"))
8279 (sha256
8280 (base32
8281 "0j3x1rxd673k07psclk8k13rqh0x0mf2yy5qiwkiw4z3afa568jy"))))
8282 (build-system ant-build-system)
8283 (arguments
8284 `(#:jar-name "bcel.jar"
8285 #:jdk ,icedtea-8
8286 #:source-dir "src/main/java"
8287 #:test-dir "src/test/java"
8288 ;; FIXME: Tests require the unpackaged jna.
8289 #:tests? #f))
8290 (home-page "https://commons.apache.org/proper/commons-bcel/")
8291 (synopsis "Byte code engineering library")
8292 (description "The Byte Code Engineering Library (Apache Commons BCEL) is
8293intended to give users a convenient way to analyze, create, and
8294manipulate (binary) Java class files. Classes are represented by objects
8295which contain all the symbolic information of the given class: methods, fields
8296and byte code instructions, in particular.
8297
8298Such objects can be read from an existing file, be transformed by a
8299program (e.g. a class loader at run-time) and written to a file again. An
8300even more interesting application is the creation of classes from scratch at
8301run-time. The @dfn{Byte Code Engineering Library} (BCEL) may be also useful
8302if you want to learn about the @dfn{Java Virtual Machine} (JVM) and the format
8303of Java @code{.class} files.")
8304 (license license:asl2.0)))
8305
5619556b
JL
8306(define-public java-xerial-core
8307 (package
8308 (name "java-xerial-core")
8309 (version "2.1")
8310 (source (origin
8311 (method url-fetch)
8312 (uri (string-append "https://github.com/xerial/xerial-java/archive/"
8313 version ".tar.gz"))
8314 (file-name (string-append name "-" version ".tar.gz"))
8315 (sha256
8316 (base32
8317 "0d3g863i41bgalpa4xr3vm1h140l091n8iwgq5qvby5yivns9y8d"))))
8318 (build-system ant-build-system)
8319 (arguments
8320 `(#:jar-name "xerial-core.jar"
8321 #:source-dir "xerial-core/src/main/java"
8322 #:test-dir "xerial-core/src/test"
8323 #:phases
8324 (modify-phases %standard-phases
8325 (add-before 'build 'copy-resources
8326 (lambda _
8327 (copy-recursively "xerial-core/src/main/resources"
8328 "build/classes")
8329 #t)))))
8330 (native-inputs
8331 `(("junit" ,java-junit)
8332 ("hamcrest" ,java-hamcrest-core)))
8333 (home-page "https://github.com/xerial/xerial-java")
f4548394 8334 (synopsis "Data management libraries for Java")
5619556b 8335 (description "Xerial is a set of data management libraries for the Java
f4548394 8336programming language. The ultimate goal of the Xerial project is to manage
5619556b
JL
8337everything as database, including class objects, text format data, data
8338streams, etc.")
8339 (license license:asl2.0)))
8d6a4815
JL
8340
8341(define-public java-powermock-reflect
8342 (package
8343 (name "java-powermock-reflect")
8344 (version "1.7.3")
8345 (source (origin
8346 (method url-fetch)
8347 (uri (string-append "https://github.com/powermock/powermock/"
8348 "archive/powermock-" version ".tar.gz"))
8349 (file-name (string-append name "-" version ".tar.gz"))
8350 (sha256
8351 (base32
8352 "0sbgi5vqq7k72wzcdjb20s370vyd4hsbnx71pzb8ishml3gy7fwy"))
8353 (patches
8354 (search-patches "java-powermock-fix-java-files.patch"))))
8355 (build-system ant-build-system)
8356 (arguments
8357 `(#:jar-name "java-powermock-reflect.jar"
8358 #:jdk ,icedtea-8
8359 #:source-dir "powermock-reflect/src/main/java"
8360 #:test-dir "powermock-reflect/src/test"))
8361 (inputs
8362 `(("java-objenesis" ,java-objenesis)))
8363 (native-inputs
8364 `(("junit" ,java-junit)
8365 ("cglib" ,java-cglib)
8366 ("asm" ,java-asm)
8367 ("hamcrest" ,java-hamcrest-core)
8368 ("assertj" ,java-assertj)))
8369 (home-page "https://github.com/powermock/powermock")
8370 (synopsis "Mock library extension framework")
8371 (description "PowerMock is a framework that extends other mock libraries
8372such as EasyMock with more powerful capabilities. PowerMock uses a custom
8373classloader and bytecode manipulation to enable mocking of static methods,
8374constructors, final classes and methods, private methods, removal of static
8375initializers and more. By using a custom classloader no changes need to be
8376done to the IDE or continuous integration servers which simplifies adoption.")
8377 (license license:asl2.0)))
d4a4d5da
JL
8378
8379(define-public java-powermock-core
8380 (package
8381 (inherit java-powermock-reflect)
8382 (name "java-powermock-core")
8383 (arguments
8384 `(#:jar-name "java-powermock-core.jar"
8385 #:source-dir "powermock-core/src/main/java"
8386 #:test-dir "powermock-core/src/test"
8387 #:tests? #f; requires powermock-api
59e0021c
JL
8388 #:jdk ,icedtea-8
8389 #:phases
8390 (modify-phases %standard-phases
8391 (add-before 'build 'copy-resources
8392 (lambda _
8393 (copy-recursively "powermock-core/src/main/resources"
8394 "build/classes"))))))
d4a4d5da
JL
8395 (inputs
8396 `(("reflect" ,java-powermock-reflect)
8397 ("javassist" ,java-jboss-javassist)))
8398 (native-inputs
8399 `(("junit" ,java-junit)
8400 ("assertj" ,java-assertj)
8401 ("mockito" ,java-mockito-1)))))
2d5d65d7
JL
8402
8403(define-public java-powermock-api-support
8404 (package
8405 (inherit java-powermock-reflect)
8406 (name "java-powermock-api-support")
8407 (build-system ant-build-system)
8408 (arguments
8409 `(#:jar-name "java-powermock-api-support.jar"
8410 #:jdk ,icedtea-8
8411 #:source-dir "powermock-api/powermock-api-support/src/main/java"
8412 #:tests? #f)); no tests
8413 (inputs
8414 `(("core" ,java-powermock-core)
8415 ("reflect" ,java-powermock-reflect)))))
6c21d46c
JL
8416
8417(define-public java-powermock-modules-junit4-common
8418 (package
8419 (inherit java-powermock-reflect)
8420 (name "java-powermock-modules-junit4-common")
8421 (build-system ant-build-system)
8422 (arguments
8423 `(#:jar-name "java-powermock-modules-junit4-common.jar"
8424 #:jdk ,icedtea-8
8425 #:source-dir "powermock-modules/powermock-module-junit4-common/src/main/java"
8426 #:test-dir "powermock-modules/powermock-module-junit4-common/src/test"))
8427 (inputs
8428 `(("core" ,java-powermock-core)
8429 ("easymock" ,java-easymock)
8430 ("reflect" ,java-powermock-reflect)
8431 ("hamcrest" ,java-hamcrest-core)
8432 ("cglib" ,java-cglib)))))
33db1681
JL
8433
8434(define-public java-powermock-modules-junit4
8435 (package
8436 (inherit java-powermock-reflect)
8437 (name "java-powermock-modules-junit4")
8438 (build-system ant-build-system)
8439 (arguments
8440 `(#:jar-name "java-powermock-modules-junit4.jar"
8441 #:jdk ,icedtea-8
8442 #:source-dir "powermock-modules/powermock-module-junit4/src/main/java"
1124683d
JL
8443 #:test-dir "powermock-modules/powermock-module-junit4/src/test"
8444 #:phases
8445 (modify-phases %standard-phases
8446 (add-before 'build 'fix-junit-detection
8447 (lambda _
8448 ;; Our junit version is 4.12-SNAPSHOT
8449 (substitute* (find-files "powermock-modules/powermock-module-junit4"
8450 "PowerMockJUnit4MethodValidator.java")
8451 (("4.12") "4.12-SNAPSHOT")))))))
33db1681
JL
8452 (inputs
8453 `(("core" ,java-powermock-core)
8454 ("reflect" ,java-powermock-reflect)
8455 ("common" ,java-powermock-modules-junit4-common)
8456 ("cglib" ,java-cglib)))
8457 (native-inputs
8458 `(("easymock" ,java-easymock)
8459 ("hamcrest" ,java-hamcrest-core)
8460 ("objenesis" ,java-objenesis)
8461 ("asm" ,java-asm)
8462 ("junit" ,java-junit)))))
4d508975
JL
8463
8464(define-public java-powermock-api-easymock
8465 (package
8466 (inherit java-powermock-reflect)
8467 (name "java-powermock-api-easymock")
8468 (build-system ant-build-system)
8469 (arguments
8470 `(#:jar-name "java-powermock-api-easymock.jar"
8471 #:jdk ,icedtea-8
8472 #:source-dir "powermock-api/powermock-api-easymock/src/main/java"
8473 #:tests? #f; no tests
8474 #:phases
8475 (modify-phases %standard-phases
8476 (add-before 'build 'fix-file
8477 (lambda _
8478 ;; FIXME: This looks wrong, but it fixes a build error.
8479 (with-directory-excursion "powermock-api/powermock-api-easymock"
8480 (substitute* "src/main/java/org/powermock/api/easymock/PowerMock.java"
8481 (("classLoader instanceof MockClassLoader") "false")
8482 (("\\(\\(MockClassLoader\\) classLoader\\).*;") ";")))
8483 #t)))))
8484 (inputs
8485 `(("core" ,java-powermock-core)
8486 ("easymock" ,java-easymock)
8487 ("reflect" ,java-powermock-reflect)
8488 ("support" ,java-powermock-api-support)
8489 ("cglib" ,java-cglib)))))
5fb3e822
JL
8490
8491(define-public java-jboss-jms-api-spec
8492 (package
8493 (name "java-jboss-jms-api-spec")
8494 (version "2.0")
8495 (source (origin
8496 (method url-fetch)
8497 (uri (string-append "https://github.com/jboss/jboss-jms-api_spec/"
8498 "archive/jboss-jms-api_" version
8499 "_spec-1.0.1.Final.tar.gz"))
8500 (sha256
8501 (base32
8502 "07bqblw9kq2i8q92bz70fvavq5xjfkaixl8xa0m0cypjgy82rb7m"))))
8503 (build-system ant-build-system)
8504 (arguments
8505 `(#:jar-name "java-jboss-jms-api_spec.jar"
8506 #:jdk ,icedtea-8
8507 #:source-dir "."
8508 #:tests? #f)); no tests
8509 (home-page "https://github.com/jboss/jboss-jms-api_spec")
8510 (synopsis "Java Message Service API specification")
8511 (description "Java Message Service (JMS) API is used to send messages
8512messages between two or more clients. It is a messaging standard that allows
8513application components to create, send, receive, and read messages.")
8514 ; either gpl2 only with GPL Classpath Exception, or cddl.
8515 (license (list license:gpl2 license:cddl1.0))))
3ff47c66
JL
8516
8517(define-public java-mail
8518 (package
8519 (name "java-mail")
8520 (version "1.6.0")
8521 (source (origin
8522 (method url-fetch)
8523 (uri (string-append "https://github.com/javaee/javamail/archive/"
8524 "JAVAMAIL-1_6_0.tar.gz"))
8525 (sha256
8526 (base32
8527 "1b4rg7fpj50ld90a71iz2m4gm3f5cnw18p3q3rbrrryjip46kx92"))))
8528 (build-system ant-build-system)
8529 (arguments
8530 `(#:jar-name "java-mail.jar"
8531 #:jdk ,icedtea-8
8532 #:source-dir "mail/src/main/java"
8533 #:test-dir "mail/src/test"
8534 #:test-exclude
8535 (list "**/CollectorFormatterTest.java"
8536 "**/CompactFormatterTest.java"
8537 "**/DurationFilterTest.java"
8538 "**/MailHandlerTest.java"
8539 "**/GetLocalAddressTest.java"
8540 ;; FIXME: both end with:
8541 ;; java.lang.ClassNotFoundException:
8542 ;; javax.mail.internet.MimeMultipartParseTest
8543 "**/MimeMultipartParseTest.java"
8544 "**/SearchTermSerializationTest.java")
8545 #:phases
8546 (modify-phases %standard-phases
8547 (add-before 'configure 'move-version.java
8548 (lambda _
8549 (copy-file "mail/src/main/resources/javax/mail/Version.java"
218d1dde
RW
8550 "mail/src/main/java/javax/mail/Version.java")
8551 #t))
3ff47c66
JL
8552 (add-before 'build 'copy-resources
8553 (lambda _
8554 (copy-recursively "mail/src/main/resources/META-INF"
8555 "build/classes/META-INF")
8556 #t)))))
8557 (native-inputs
8558 `(("junit" ,java-junit)
8559 ("hamcrest" ,java-hamcrest-core)))
8560 (home-page "https://javaee.github.io/javamail/")
8561 (synopsis "Mail-related functionnalities in Java")
8562 (description "The JavaMail API provides a platform-independent and
8563protocol-independent framework to build mail and messaging applications.")
8564 ;; General Public License Version 2 only ("GPL") or the Common Development
8565 ;; and Distribution License("CDDL")
8566 (license (list license:cddl1.1
8567 license:gpl2)))); with classpath exception
217b20e4
JL
8568
8569(define-public java-jeromq
8570 (package
8571 (name "java-jeromq")
4aa0a1df 8572 (version "0.4.3")
217b20e4 8573 (source (origin
4aa0a1df
RW
8574 (method git-fetch)
8575 (uri (git-reference
8576 (url "https://github.com/zeromq/jeromq.git")
8577 (commit (string-append "v" version))))
8578 (file-name (string-append name "-" version "-checkout"))
217b20e4
JL
8579 (sha256
8580 (base32
594bd3a0
GB
8581 "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj"))
8582 (patches (search-patches "java-jeromq-fix-tests.patch"))))
217b20e4
JL
8583 (build-system ant-build-system)
8584 (arguments
8585 `(#:jar-name "java-jeromq.jar"
8586 #:source-dir "src/main/java"
8587 #:jdk ,icedtea-8
8588 #:test-exclude
8589 (list
8590 "**/Abstract*.java"
8591 ;; Requires network
8592 "**/ZBeaconTest.java"
8593 ;; Failures
4aa0a1df 8594 "**/DealerSpecTest.java"
217b20e4 8595 "**/CustomDecoderTest.java"
594bd3a0
GB
8596 "**/CustomEncoderTest.java"
8597 "**/ConnectRidTest.java"
8598 "**/ReqSpecTest.java"
8599 "**/PushPullSpecTest.java"
8600 "**/PubSubHwmTest.java"
8601 "**/RouterSpecTest.java"
8602 "**/ProxyTest.java")))
217b20e4
JL
8603 (inputs
8604 `(("java-jnacl" ,java-jnacl)))
8605 (native-inputs
8606 `(("java-hamcrest-core" ,java-hamcrest-core)
8607 ("junit" ,java-junit)))
8608 (home-page "http://zeromq.org/bindings:java")
8609 (synopsis "Java binding for 0MQ")
8610 (description "Jeromq provides the java bindings for 0MQ.")
8611 (license license:mpl2.0)))
46c6905a
JL
8612
8613(define-public java-kafka-clients
8614 (package
8615 (name "java-kafka-clients")
8616 (version "1.0.0")
8617 (source (origin
8618 (method url-fetch)
8619 (uri (string-append "mirror://apache/kafka/" version "/kafka-"
8620 version "-src.tgz"))
8621 (sha256
8622 (base32
8623 "1yxmnsmliwm7671q5yy9bl4jdqyyn00n26cggz9brwczx80w1vfq"))))
8624 (build-system ant-build-system)
8625 (arguments
8626 `(#:jar-name "java-kafka-clients.jar"
8627 #:jdk ,icedtea-8
8628 #:source-dir "clients/src/main/java"
8629 #:test-dir "clients/src/test"
8630 #:test-exclude
8631 (list
8632 ;; This file does not contain a class
8633 "**/IntegrationTest.java"
8634 ;; Requires network
8635 "**/ClientUtilsTest.java"
8636 ;; End with errors that seem related to our powermock
8637 "**/KafkaProducerTest.java"
8638 "**/BufferPoolTest.java")))
8639 (inputs
8640 `(("java-slf4j-api" ,java-slf4j-api)
8641 ("java-lz4" ,java-lz4)))
8642 (native-inputs
8643 `(("junit" ,java-junit)
8644 ("hamcrest" ,java-hamcrest-all)
8645 ("objenesis" ,java-objenesis)
8646 ("asm" ,java-asm)
8647 ("cglib" ,java-cglib)
8648 ("javassist" ,java-jboss-javassist)
8649 ("snappy" ,java-snappy)
8650 ("easymock" ,java-easymock)
8651 ("powermock" ,java-powermock-core)
8652 ("powermock-easymock" ,java-powermock-api-easymock)
8653 ("powermock-junit4-common" ,java-powermock-modules-junit4-common)
8654 ("powermock-junit4" ,java-powermock-modules-junit4)
8655 ("powermock-support" ,java-powermock-api-support)
8656 ("bouncycastle" ,java-bouncycastle-bcprov)
8657 ("bouncycastle-bcpkix" ,java-bouncycastle-bcpkix)))
8658 (home-page "https://kafka.apache.org")
8659 (synopsis "Distributed streaming platform")
8660 (description "Kafka is a distributed streaming platform, which means:
8661@itemize
8662@item it can publish and subscribe to streams of records;
8663@item it can store streams of records in a fault-tolerant way;
8664@item it can process streams of records as they occur.
8665@end itemize")
8666 ;; Either cddl or gpl2 only.
8667 (license (list license:cddl1.1; actually cddl1.1
8668 license:gpl2)))); with classpath exception
0b54e190
JL
8669
8670(define-public java-jdom
8671 (package
8672 (name "java-jdom")
8673 (version "1.1.3")
8674 (source (origin
8675 (method url-fetch)
8676 (uri (string-append "http://jdom.org/dist/binary/archive/jdom-"
8677 version ".tar.gz"))
8678 (sha256
8679 (base32
8680 "07wdpm3jwwc9q38kmdw40fvbmv6jzjrkrf8m0zqs58f79a672wfl"))))
8681 (build-system ant-build-system)
8682 (arguments
8683 `(#:build-target "package"
8684 #:tests? #f; tests are run as part of the build process
8685 #:phases
8686 (modify-phases %standard-phases
8687 (replace 'install
8688 (install-jars "build")))))
8689 (home-page "http://jdom.org/")
8690 (synopsis "Access, manipulate, and output XML data")
8691 (description "Java-based solution for accessing, manipulating, and
8692outputting XML data from Java code.")
8693 (license license:bsd-4)))
78745d33
JL
8694
8695(define-public java-geronimo-xbean-reflect
8696 (package
8697 (name "java-geronimo-xbean-reflect")
8698 (version "4.5")
8699 (source (origin
8700 (method svn-fetch)
8701 (uri (svn-reference
8702 (url "https://svn.apache.org/repos/asf/geronimo/xbean/tags/xbean-4.5/")
8703 (revision 1807396)))
8704 (file-name (string-append name "-" version))
8705 (sha256
8706 (base32
8707 "18q3i6jgm6rkw8aysfgihgywrdc5nvijrwnslmi3ww497jvri6ja"))))
8708 (build-system ant-build-system)
8709 (arguments
8710 `(#:jar-name "geronimo-xbean-reflect.jar"
8711 #:source-dir "xbean-reflect/src/main/java"
8712 #:test-dir "xbean-reflect/src/test"
8713 #:jdk ,icedtea-8
8714 #:test-exclude
8715 (list "**/Abstract*.java" "**/AsmParameterNameLoaderTest.java"
8716 "**/ObjectRecipeTest.java" "**/ParameterNameLoaderTest.java"
8717 "**/RecipeHelperTest.java" "**/XbeanAsmParameterNameLoaderTest.java")
8718 #:phases
8719 (modify-phases %standard-phases
8720 (add-before 'build 'fix-source
8721 (lambda _
8722 (let ((dir "xbean-reflect/src/main/java/org/apache/xbean/recipe/"))
8723 ;; org.apache.xbean.asm6 is actually repackaged java-asm
8724 (substitute* (string-append dir "XbeanAsmParameterNameLoader.java")
8725 (("org.apache.xbean.asm5") "org.objectweb.asm"))
8726 #t))))))
8727 (inputs
8728 `(("asm" ,java-asm)
8729 ("log4j" ,java-log4j-api)
8730 ("log4j-1.2" ,java-log4j-1.2-api)
8731 ("log4j-core" ,java-log4j-core)
8732 ("logging" ,java-commons-logging-minimal)))
8733 (native-inputs
8734 `(("junit" ,java-junit)))
8735 (home-page "https://geronimo.apache.org/maven/xbean/3.6/xbean-reflect/")
8736 (synopsis "Dependency injection helper")
8737 (description "Xbean-reflect provides very flexible ways to create objects
8738and graphs of objects for dependency injection frameworks")
8739 (license license:asl2.0)))
09c44196 8740
3fda539b
JL
8741(define-public java-geronimo-xbean-bundleutils
8742 (package
8743 (inherit java-geronimo-xbean-reflect)
8744 (name "java-geronimo-xbean-bundleutils")
8745 (arguments
8746 `(#:jar-name "geronimo-xbean-bundleutils.jar"
8747 #:source-dir "xbean-bundleutils/src/main/java"
8748 #:test-dir "xbean-bundleutils/src/test"
8749 #:phases
8750 (modify-phases %standard-phases
8751 (add-before 'build 'fix-java
8752 (lambda _
8753 ;; We use a more recent version of osgi, so this file requires
8754 ;; more interface method implementations.
8755 (substitute* "xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java"
8756 (("import org.osgi.framework.ServiceRegistration;")
8757 "import org.osgi.framework.ServiceRegistration;
8758import org.osgi.framework.ServiceFactory;
8759import java.util.Collection;
8760import org.osgi.framework.ServiceObjects;")
8761 (("public Bundle getBundle\\(\\)")
8762 "@Override
8763public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
8764 throw new UnsupportedOperationException();
8765}
8766@Override
8767public <S> ServiceRegistration<S> registerService(Class<S> clazz,
8768 ServiceFactory<S> factory, Dictionary<String, ?> properties) {
8769 throw new UnsupportedOperationException();
8770}
8771public Bundle getBundle()"))
8772 #t)))))
8773 (inputs
8774 `(("java-slf4j" ,java-slf4j-api)
8775 ("java-asm" ,java-asm)
8776 ("java-osgi-framework" ,java-osgi-framework)
8777 ("java-eclipse-osgi" ,java-eclipse-osgi)
8778 ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)))))
0cb9ce32
JL
8779
8780(define-public java-geronimo-xbean-asm-util
8781 (package
8782 (inherit java-geronimo-xbean-reflect)
8783 (name "java-geronimo-xbean-asm-util")
8784 (arguments
8785 `(#:jar-name "geronimo-xbean-asm-util.jar"
8786 #:source-dir "xbean-asm-util/src/main/java"
8787 #:tests? #f)); no tests
8788 (inputs
8789 `(("java-asm" ,java-asm)))
8790 (native-inputs '())))
8d510f65
JL
8791
8792(define-public java-geronimo-xbean-finder
8793 (package
8794 (inherit java-geronimo-xbean-reflect)
8795 (name "java-geronimo-xbean-finder")
8796 (arguments
8797 `(#:jar-name "geronimo-xbean-finder.jar"
8798 #:source-dir "xbean-finder/src/main/java"
8799 #:test-dir "xbean-finder/src/test"))
8800 (inputs
8801 `(("java-slf4j-api" ,java-slf4j-api)
8802 ("java-asm" ,java-asm)
8803 ("java-geronimo-xbean-bundleutils" ,java-geronimo-xbean-bundleutils)
8804 ("java-geronimo-xbean-asm-util" ,java-geronimo-xbean-asm-util)
8805 ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)
8806 ("java-osgi-framework" ,java-osgi-framework)))
8807 (native-inputs
8808 `(("java-junit" ,java-junit)
8809 ("java-hamcrest-core" ,java-hamcrest-core)))))
3fda539b 8810
09c44196
JL
8811(define-public java-gson
8812 (package
8813 (name "java-gson")
8814 (version "2.8.2")
8815 (source (origin
8816 (method url-fetch)
8817 (uri (string-append "https://github.com/google/gson/archive/"
8818 "gson-parent-" version ".tar.gz"))
8819 (sha256
8820 (base32
8821 "1j4qnp7v046q0k48c4kyf69sxaasx2h949d3cqwsm3kzxms3x0f9"))))
8822 (build-system ant-build-system)
8823 (arguments
8824 `(#:jar-name "gson.jar"
8825 #:source-dir "gson/src/main/java"
8826 #:test-dir "gson/src/test"))
8827 (native-inputs
8828 `(("java-junit" ,java-junit)
8829 ("java-hamcrest-core" ,java-hamcrest-core)))
8830 (home-page "https://github.com/google/gson")
8831 (synopsis "Java serialization/deserialization library from/to JSON")
8832 (description "Gson is a Java library that can be used to convert Java
8833Objects into their JSON representation. It can also be used to convert a JSON
8834string to an equivalent Java object. Gson can work with arbitrary Java objects
8835including pre-existing objects that you do not have source-code of.")
8836 (license license:asl2.0)))
335aa20b
JL
8837
8838(define-public java-hawtjni
8839 (package
8840 (name "java-hawtjni")
8841 (version "1.15")
8842 (source (origin
8843 (method url-fetch)
8844 (uri (string-append "https://github.com/fusesource/hawtjni/archive/"
8845 "hawtjni-project-" version ".tar.gz"))
8846 (sha256
8847 (base32
8848 "1bqfd732rmh6svyx17fpw9175gc9gzkcbyps2yyrf50c3zzjas6g"))))
8849 (build-system ant-build-system)
8850 (arguments
8851 `(#:jar-name "hawtjni.jar"
8852 #:source-dir "hawtjni-generator/src/main/java:hawtjni-runtime/src/main/java"
8853 #:tests? #f; no tests
8854 #:phases
8855 (modify-phases %standard-phases
8856 (add-before 'build 'build-native
8857 (lambda* (#:key inputs #:allow-other-keys)
6338ea9a
RW
8858 (let ((include (string-append "-I" (assoc-ref inputs "jdk") "/include/linux")))
8859 (with-directory-excursion "hawtjni-generator/src/main/resources/"
8860 (invoke "gcc" "-c" "hawtjni.c" "-o" "hawtjni.o"
8861 "-fPIC" "-O2" include)
8862 (invoke "gcc" "-c" "hawtjni-callback.c" "-o" "hawtjni-callback.o"
8863 "-fPIC" "-O2" include)
8864 (invoke "gcc" "-o" "libhawtjni.so" "-shared"
8865 "hawtjni.o" "hawtjni-callback.o")))
8866 #t))
335aa20b
JL
8867 (add-after 'install 'install-native
8868 (lambda* (#:key outputs #:allow-other-keys)
8869 (let* ((out (assoc-ref outputs "out"))
8870 (lib (string-append out "/lib"))
8871 (inc (string-append out "/include")))
335aa20b 8872 (with-directory-excursion "hawtjni-generator/src/main/resources/"
6338ea9a
RW
8873 (install-file "libhawtjni.so" lib)
8874 (install-file "hawtjni.h" inc)))
335aa20b
JL
8875 #t)))))
8876 (inputs
8877 `(("java-commons-cli" ,java-commons-cli)
8878 ("java-asm" ,java-asm)
8879 ("java-geronimo-xbean-finder" ,java-geronimo-xbean-finder)))
8880 (home-page "https://fusesource.github.io/hawtjni/")
8881 (synopsis "JNI code generator")
8882 (description "HawtJNI is a code generator that produces the JNI code needed
8883to implement Java native methods. It is based on the jnigen code generator
8884that is part of the SWT Tools project.")
8885 (license license:asl2.0)))
d0c62afa
JL
8886
8887(define-public java-jansi-native
8888 (package
8889 (name "java-jansi-native")
8890 (version "1.7")
8891 (source (origin
8892 (method url-fetch)
8893 (uri (string-append "https://github.com/fusesource/jansi-native/"
8894 "archive/jansi-native-" version ".tar.gz"))
8895 (sha256
8896 (base32
8897 "0j2ydlgxbzbgshqkwghbxxxnbnx1mmjgd6k5fw6xfvxw1z956yqf"))))
8898 (build-system ant-build-system)
8899 (arguments
8900 `(#:jar-name "jansi-native.jar"
8901 #:source-dir "src/main/java"
8902 #:tests? #f; no tests
8903 #:phases
8904 (modify-phases %standard-phases
8905 (add-before 'build 'build-native
8906 (lambda* (#:key inputs #:allow-other-keys)
8907 ;; there are more required files for windows in windows/
8908 (with-directory-excursion "src/main/native-package/src"
8909 (substitute* "jansi_ttyname.c"
8910 (("#include \"jansi_.*") ""))
e85c1bf6
RW
8911 (invoke "gcc" "-c" "jansi_ttyname.c" "-o" "jansi_ttyname.o"
8912 (string-append "-I" (assoc-ref inputs "java-hawtjni")
8913 "/include")
8914 (string-append "-I" (assoc-ref inputs "jdk")
8915 "/include/linux")
8916 "-fPIC" "-O2")
8917 (invoke "gcc" "-o" "libjansi.so" "-shared" "jansi_ttyname.o")
8918 #t)))
d0c62afa
JL
8919 (add-before 'build 'install-native
8920 (lambda _
8921 (let ((dir (string-append "build/classes/META-INF/native/"
8922 ,(match (%current-system)
8923 ((or "i686-linux" "armhf-linux")
8924 "linux32")
8925 ((or "x86_64-linux" "aarch64-linux")
8926 "linux64")))))
8927 (install-file "src/main/native-package/src/libjansi.so" dir))
8928 #t))
8929 (add-after 'install 'install-native
8930 (lambda* (#:key outputs #:allow-other-keys)
d0c62afa
JL
8931 (install-file "src/main/native-package/src/jansi.h"
8932 (string-append (assoc-ref outputs "out") "/include"))
8933 #t)))))
8934 (inputs
8935 `(("java-hawtjni" ,java-hawtjni)))
8936 (home-page "https://fusesource.github.io/jansi/")
8937 (synopsis "Native library for jansi")
3d6925ef
RW
8938 (description "This package provides the native library for jansi, a small
8939Java library that allows you to use ANSI escape sequences to format your
8940console output.")
d0c62afa 8941 (license license:asl2.0)))
a87ea1ad
JL
8942
8943(define-public java-jansi
8944 (package
8945 (name "java-jansi")
8946 (version "1.16")
8947 (source (origin
8948 (method url-fetch)
8949 (uri (string-append "https://github.com/fusesource/jansi/archive/"
8950 "jansi-project-" version ".tar.gz"))
8951 (sha256
8952 (base32
8953 "11kh3144i3fzp21dpy8zg52mjmsr214k7km9p8ly0rqk2px0qq2z"))))
8954 (build-system ant-build-system)
8955 (arguments
8956 `(#:jar-name "jansi.jar"
8957 #:source-dir "jansi/src/main/java"
8958 #:test-dir "jansi/src/test"
8959 #:phases
8960 (modify-phases %standard-phases
8961 (add-after 'check 'clear-term
8962 (lambda _
8963 (zero? (system* "echo" "-e" "\\e[0m")))))))
8964 (inputs
8965 `(("java-jansi-native" ,java-jansi-native)))
8966 (native-inputs
8967 `(("java-junit" ,java-junit)
8968 ("java-hamcrest-core" ,java-hamcrest-core)))
8969 (home-page "https://fusesource.github.io/jansi/")
8970 (synopsis "Portable ANSI escape sequences")
8971 (description "Jansi is a Java library that allows you to use ANSI escape
8972sequences to format your console output which works on every platform.")
8973 (license license:asl2.0)))
cc061329
JL
8974
8975(define-public java-jboss-el-api-spec
8976 (package
8977 (name "java-jboss-el-api-spec")
8978 (version "3.0")
8979 (source (origin
8980 (method url-fetch)
8981 (uri (string-append "https://github.com/jboss/jboss-el-api_spec/"
8982 "archive/jboss-el-api_" version
8983 "_spec-1.0.7.Final.tar.gz"))
8984 (sha256
8985 (base32
8986 "1j45ljxalwlibxl7g7iv952sjxkw275m8vyxxij8l6wdd5pf0pdh"))))
8987 (build-system ant-build-system)
8988 (arguments
8989 `(#:jar-name "java-jboss-el-api_spec.jar"
8990 #:jdk ,icedtea-8))
8991 (inputs
8992 `(("java-junit" ,java-junit)))
8993 (home-page "https://github.com/jboss/jboss-el-api_spec")
8994 (synopsis "JSR-341 expression language 3.0 API")
8995 (description "This package contains an implementation of the JSR-341
8996specification for the expression language 3.0. It implements an expression
8997language inspired by ECMAScript and XPath. This language is used with
8998JavaServer Pages (JSP).")
8999 ;; Either GPL2 only or CDDL.
9000 (license (list license:gpl2 license:cddl1.1))))
cc03a786
JL
9001
9002(define-public java-jboss-interceptors-api-spec
9003 (package
9004 (name "java-jboss-interceptors-api-spec")
9005 (version "1.2")
9006 (source (origin
9007 (method url-fetch)
9008 (uri (string-append "https://github.com/jboss/jboss-interceptors-api_spec/"
9009 "archive/jboss-interceptors-api_" version
9010 "_spec-1.0.0.Final.tar.gz"))
9011 (sha256
9012 (base32
9013 "0wv8x0jp9a5qxlrgkhb5jdk2gr6vi87b4j4kjb8ryxiy9gn8g51z"))))
9014 (build-system ant-build-system)
9015 (arguments
9016 `(#:jar-name "java-jboss-interceptors-api_spec.jar"
9017 #:jdk ,icedtea-8
9018 #:source-dir "."
9019 #:tests? #f)); no tests
9020 (home-page "https://github.com/jboss/jboss-interceptors-api_spec")
9021 (synopsis "Interceptors 1.2 API classes from JSR 318")
9022 (description "Java-jboss-interceptors-api-spec implements the Interceptors
9023API. Interceptors are used to interpose on business method invocations and
9024specific events.")
9025 ;; Either GPL2 only or CDDL.
9026 (license (list license:gpl2 license:cddl1.1))))
a10a451c
JL
9027
9028(define-public java-cdi-api
9029 (package
9030 (name "java-cdi-api")
9031 (version "2.0")
9032 (source (origin
9033 (method url-fetch)
9034 (uri (string-append "https://github.com/cdi-spec/cdi/archive/"
9035 version ".tar.gz"))
9036 (file-name (string-append name "-" version ".tar.gz"))
9037 (sha256
9038 (base32
9039 "1iv8b8bp07c5kmqic14jsr868vycjv4qv02lf3pkgp9z21mnfg5y"))))
9040 (build-system ant-build-system)
9041 (arguments
9042 `(#:source-dir "api/src/main/java"
9043 #:jar-name "java-cdi-api.jar"
9044 #:test-dir "api/src/test"
9045 #:jdk ,icedtea-8
9046 #:tests? #f)); Tests fail because we don't have a CDI provider yet
9047 (inputs
9048 `(("java-javax-inject" ,java-javax-inject)
9049 ("java-jboss-el-api-spec" ,java-jboss-el-api-spec)
9050 ("java-jboss-interceptors-api-spec" ,java-jboss-interceptors-api-spec)))
9051 (native-inputs
9052 `(("java-testng" ,java-testng)
9053 ("java-hamcrest-core" ,java-hamcrest-core)))
9054 (home-page "http://cdi-spec.org/")
9055 (synopsis "Contexts and Dependency Injection APIs")
9056 (description "Java-cdi-api contains the required APIs for Contexts and
9057Dependency Injection (CDI).")
9058 (license license:asl2.0)))
d57fd728
JL
9059
9060(define-public java-joda-convert
9061 (package
9062 (name "java-joda-convert")
9063 (version "1.9.2")
9064 (source (origin
9065 (method url-fetch)
9066 (uri (string-append "https://github.com/JodaOrg/joda-convert/archive/v"
9067 version ".tar.gz"))
9068 (file-name (string-append name "-" version ".tar.gz"))
9069 (sha256
9070 (base32
9071 "0vp346xz7dh9br4q7xazhc7hvzf76a6hf95fki9bg67q5jr0kjh7"))))
9072 (build-system ant-build-system)
9073 (arguments
9074 `(#:jar-name (string-append ,name "-" ,version ".jar")
9075 #:source-dir "src/main/java"
9076 #:test-include (list "**/Test*.java")
9077 ;; Contains only interfaces and base classes (no test)
9078 #:test-exclude (list "**/test*/**.java")))
9079 (inputs
9080 `(("java-guava" ,java-guava)))
9081 (native-inputs
9082 `(("java-junit" ,java-junit)
9083 ("java-hamcrest-core" ,java-hamcrest-core)))
9084 (home-page "http://www.joda.org/joda-convert/")
9085 (synopsis "Conversion between Objects and Strings")
9086 (description "Joda-Convert provides a small set of classes to aid
9087conversion between Objects and Strings. It is not intended to tackle the
9088wider problem of Object to Object transformation.")
9089 (license license:asl2.0)))
0158ea8a
JL
9090
9091(define-public java-joda-time
9092 (package
9093 (name "java-joda-time")
9094 (version "2.9.9")
9095 (source (origin
9096 (method url-fetch)
9097 (uri (string-append "https://github.com/JodaOrg/joda-time/archive/v"
9098 version ".tar.gz"))
9099 (file-name (string-append name "-" version ".tar.gz"))
9100 (sha256
9101 (base32
9102 "1i9x91mi7yg2pasl0k3912f1pg46n37sps6rdb0v1gs8hj9ppwc1"))))
9103 (build-system ant-build-system)
9104 (arguments
9105 `(#:jar-name "java-joda-time.jar"
9106 #:source-dir "src/main/java"
9107 #:test-include (list "**/Test*.java")
9108 ;; There is no runnable test in these files
9109 #:test-exclude (list "**/Test*Chronology.java" "**/Test*Field.java")
9110 #:phases
9111 (modify-phases %standard-phases
9112 (add-after 'build 'build-resources
9113 (lambda _
9114 (mkdir-p "build/classes/org/joda/time/tz/data")
9115 (mkdir-p "build/classes/org/joda/time/format")
6d0368eb
JL
9116 ;; This will produce the following exception:
9117 ;; java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap"
9118 ;; which is normal, because it doesn't exist yet. It still generates
9119 ;; the same file as in the binary one can find on maven.
9120 (invoke "java" "-cp"
9121 (string-append "build/classes:" (getenv "CLASSPATH"))
9122 "org.joda.time.tz.ZoneInfoCompiler"
9123 "-src" "src/main/java/org/joda/time/tz/src"
9124 "-dst" "build/classes/org/joda/time/tz/data"
9125 "africa" "antarctica" "asia" "australasia"
9126 "europe" "northamerica" "southamerica"
9127 "pacificnew" "etcetera" "backward" "systemv")
0158ea8a
JL
9128 (for-each (lambda (f)
9129 (copy-file f (string-append
9130 "build/classes/org/joda/time/format/"
9131 (basename f))))
9132 (find-files "src/main/java/org/joda/time/format" ".*.properties"))
9133 #t))
9134 (add-before 'install 'regenerate-jar
9135 (lambda _
9136 ;; We need to regenerate the jar file to add generated data.
9137 (delete-file "build/jar/java-joda-time.jar")
6d0368eb 9138 (invoke "ant" "jar")))
0158ea8a
JL
9139 (add-before 'check 'copy-test-resources
9140 (lambda _
9141 (mkdir-p "build/test-classes/org/joda/time/tz/data")
9142 (copy-file "src/test/resources/tzdata/ZoneInfoMap"
9143 "build/test-classes/org/joda/time/tz/data/ZoneInfoMap")
9144 (copy-recursively "src/test/resources" "build/test-classes")
9145 #t)))))
9146 (inputs
9147 `(("java-joda-convert" ,java-joda-convert)))
9148 (native-inputs
9149 `(("java-junit" ,java-junit)
9150 ("java-hamcrest-core" ,java-hamcrest-core)
9151 ("tzdata" ,tzdata)))
9152 (home-page "http://www.joda.org/joda-time/")
9153 (synopsis "Replacement for the Java date and time classes")
9154 (description "Joda-Time is a replacement for the Java date and time
9155classes prior to Java SE 8.")
9156 (license license:asl2.0)))
6d0368eb
JL
9157
9158(define-public java-xerces
9159 (package
9160 (name "java-xerces")
9161 (version "2.11.0")
9162 (source
9163 (origin
9164 (method url-fetch)
9165 (uri (string-append "mirror://apache/xerces/j/source/"
9166 "Xerces-J-src." version ".tar.gz"))
9167 (sha256
9168 (base32 "1006igwy2lqrmjvdk64v8dg6qbk9c29pm8xxx7r87n0vnpvmx6pm"))
9169 (patches (search-patches
9170 "java-xerces-xjavac_taskdef.patch"
9171 "java-xerces-build_dont_unzip.patch"
9172 "java-xerces-bootclasspath.patch"))))
9173 (build-system ant-build-system)
9174 (arguments
9175 `(#:tests? #f;; Test files are not present
9176 #:test-target "test"
9177 #:jdk ,icedtea-8
9178 #:phases
9179 (modify-phases %standard-phases
9180 (add-after 'unpack 'create-build.properties
9181 (lambda* (#:key inputs #:allow-other-keys)
9182 (let ((jaxp (assoc-ref inputs "java-jaxp"))
9183 (resolver (assoc-ref inputs "java-apache-xml-commons-resolver")))
9184 (with-output-to-file "build.properties"
9185 (lambda _
9186 (format #t
9187 "jar.jaxp = ~a/share/java/jaxp.jar~@
9188 jar.apis-ext = ~a/share/java/jaxp.jar~@
9189 jar.resolver = ~a/share/java/xml-resolver.jar~%"
9190 jaxp jaxp resolver)))
9191 ;; Make xerces use our version of jaxp in tests
9192 (substitute* "build.xml"
9193 (("xml-apis.jar")
9194 (string-append jaxp "/share/java/jaxp.jar"))
9195 (("\\$\\{tools.dir\\}/\\$\\{jar.apis\\}")
9196 "${jar.apis}")))
9197 #t))
9198 (replace 'install (install-jars "build")))))
9199 (inputs
9200 `(("java-apache-xml-commons-resolver" ,java-apache-xml-commons-resolver)
9201 ("java-jaxp" ,java-jaxp)))
9202 (home-page "https://xerces.apache.org/xerces2-j/")
9203 (synopsis "Validating XML parser for Java with DOM level 3 support")
9204 (description "The Xerces2 Java parser is the reference implementation of
9205XNI, the Xerces Native Interface, and also a fully conforming XML Schema
9206processor.
9207
9208Xerces2-J supports the following standards and APIs:
9209
9210@itemize
9211@item eXtensible Markup Language (XML) 1.0 Second Edition Recommendation
9212@item Namespaces in XML Recommendation
9213@item Document Object Model (DOM) Level 2 Core, Events, and Traversal and
9214 Range Recommendations
9215@item Simple API for XML (SAX) 2.0.1 Core and Extension
9216@item Java APIs for XML Processing (JAXP) 1.2.01
9217@item XML Schema 1.0 Structures and Datatypes Recommendations
9218@item Experimental implementation of the Document Object Model (DOM) Level 3
9219 Core and Load/Save Working Drafts
9220@item Provides a partial implementation of the XML Inclusions (XInclude) W3C
9221 Candidate Recommendation
9222@end itemize
9223
9224Xerces is now able to parse documents written according to the XML 1.1
9225Candidate Recommendation, except that it does not yet provide an option to
9226enable normalization checking as described in section 2.13 of this
9227specification. It also handles namespaces according to the XML Namespaces 1.1
9228Candidate Recommendation, and will correctly serialize XML 1.1 documents if
9229the DOM level 3 load/save API's are in use.")
9230 (license license:asl2.0)))
e06bf428
JL
9231
9232(define-public java-jline
9233 (package
9234 (name "java-jline")
9235 (version "1.0")
9236 (source (origin
9237 (method url-fetch)
9238 (uri (string-append "https://github.com/jline/jline1/archive/jline-"
9239 version ".tar.gz"))
9240 (sha256
9241 (base32
9242 "0bi3p6vrh7a6v0fbpb6rx9plpmx5zk3lr352xzdbz2jcxg499wir"))))
9243 (build-system ant-build-system)
9244 (arguments
9245 `(#:jar-name "jline.jar"
9246 #:source-dir "src/main/java"
9247 #:test-dir "src/test"
9248 #:phases
9249 (modify-phases %standard-phases
9250 (add-before 'build 'copy-resources
9251 (lambda _
9252 (copy-recursively "src/main/resources" "build/classes")
9253 #t)))))
9254 (native-inputs
9255 `(("java-junit" ,java-junit)))
9256 (home-page "https://jline.github.io")
9257 (synopsis "Console input handling library")
9258 (description "JLine is a Java library for handling console input. It is
9259similar in functionality to BSD editline and GNU readline but with additional
9260features that bring it on par with the Z shell line editor.")
9261 (license license:bsd-3)))
7ac4f054
JL
9262
9263(define-public java-xmlunit
9264 (package
9265 (name "java-xmlunit")
9266 (version "2.5.1")
9267 (source (origin
9268 (method url-fetch)
9269 (uri (string-append "https://github.com/xmlunit/xmlunit/archive/v"
9270 version ".tar.gz"))
9271 (file-name (string-append name "-" version ".tar.gz"))
9272 (sha256
9273 (base32
9274 "035rivlnmwhfqj0fzviciv0bkh1h95ps1iwnh2kjcvdbk5nccm4z"))))
9275 (build-system ant-build-system)
9276 (arguments
9277 `(#:jar-name "java-xmlunit.jar"
9278 #:source-dir "xmlunit-core/src/main/java"
9279 #:test-dir "xmlunit-core/src/test"
9280 #:phases
9281 (modify-phases %standard-phases
9282 (add-before 'check 'copy-test-resources
9283 (lambda* (#:key inputs #:allow-other-keys)
9284 (copy-recursively (assoc-ref inputs "resources") "../test-resources")
9285 #t)))))
9286 (native-inputs
9287 `(("java-junit" ,java-junit)
9288 ("java-mockito-1" ,java-mockito-1)
9289 ("java-hamcrest-all" ,java-hamcrest-all)
9290 ("java-objenesis" ,java-objenesis)
9291 ("java-asm" ,java-asm)
9292 ("java-cglib" ,java-cglib)
9293 ("resources"
9294 ,(origin
9295 (method git-fetch)
9296 (uri (git-reference
9297 (url "https://github.com/xmlunit/test-resources.git")
9298 (commit "a590d2ae865c3e0455691d76ba8eefccc2215aec")))
9299 (file-name "java-xmlunit-test-resources")
9300 (sha256
9301 (base32
9302 "0r0glj37pg5l868yjz78gckr91cs8fysxxbp9p328dssssi91agr"))))))
9303 (home-page "http://www.xmlunit.org/")
9304 (synopsis "XML output testing")
9305 (description "XMLUnit provides you with the tools to verify the XML you
9306emit is the one you want to create. It provides helpers to validate against
9307an XML Schema, assert the values of XPath queries or compare XML documents
9308against expected outcomes.")
9309 (license license:asl2.0)))
73a1f10a
JL
9310
9311(define-public java-xmlunit-legacy
9312 (package
9313 (inherit java-xmlunit)
9314 (name "java-xmlunit-legacy")
9315 (arguments
9316 `(#:jar-name "java-xmlunit-legacy.jar"
9317 #:source-dir "xmlunit-legacy/src/main/java"
9318 #:test-dir "xmlunit-legacy/src/test"))
9319 (inputs
9320 `(("java-xmlunit" ,java-xmlunit)
9321 ("java-junit" ,java-junit)))
9322 (native-inputs
9323 `(("java-mockito-1" ,java-mockito-1)))))
93abc975
RW
9324
9325(define-public java-openchart2
9326 (package
9327 (name "java-openchart2")
9328 (version "1.4.3")
9329 (source (origin
9330 (method url-fetch)
9331 (uri (string-append "http://download.approximatrix.com/openchart2/"
9332 "openchart2-" version ".source.zip"))
9333 (sha256
9334 (base32
9335 "1xq96zm5r02n1blja0072jmmsifmxc40lbyfbnmcnr6mw42frh4g"))))
9336 (build-system ant-build-system)
9337 (arguments
9338 `(#:test-target "test"
9339 #:phases
9340 (modify-phases %standard-phases
9341 (add-after 'unpack 'fix-junit-errors
9342 (lambda _
9343 (with-directory-excursion "unittest/src/com/approximatrix/charting/"
9344 (substitute* '("coordsystem/ticklocator/NumericXTickLocatorTest.java"
9345 "coordsystem/ticklocator/NumericYTickLocatorTest.java"
9346 "coordsystem/ticklocator/ObjectXTickLocatorTest.java"
9347 "model/DefaultChartDataModelConstraintsTest.java"
9348 "model/MultiScatterDataModelConstraintsTest.java"
9349 "model/threedimensional/DotPlotDataModelConstraintsTest.java")
9350 (("(assertEquals[^;]+);" before _)
9351 (string-append (string-drop-right before 2) ", 1E-6);"))))
9352 #t))
9353 (replace 'install (install-jars ".")))))
9354 (native-inputs
9355 `(("unzip" ,unzip)
9356 ("java-junit" ,java-junit)
9357 ("java-hamcrest-core" ,java-hamcrest-core)))
9358 (home-page "http://approximatrix.com/products/openchart2/")
9359 (synopsis "Simple plotting for Java")
9360 (description "Openchart2 provides a simple, yet powerful, interface for
9361Java programmers to create two-dimensional charts and plots. The library
9362features an assortment of graph styles, including advanced scatter plots, bar
9363graphs, and pie charts.")
9364 (license license:lgpl2.1+)))