gnu: Add ant-apache-bcel.
[jackhill/guix/guix.git] / gnu / packages / java.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
4 ;;; Copyright © 2016, 2017 Roel Janssen <roel@gnu.org>
5 ;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
6 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
7 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
8 ;;; Copyright © 2016, 2017 Alex Vong <alexvong1995@gmail.com>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages java)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix hg-download)
30 #:use-module (guix git-download)
31 #:use-module (guix svn-download)
32 #:use-module (guix utils)
33 #:use-module (guix build-system ant)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system trivial)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages attr)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages bash)
41 #:use-module (gnu packages certs)
42 #:use-module (gnu packages cpio)
43 #:use-module (gnu packages cups)
44 #:use-module (gnu packages compression)
45 #:use-module (gnu packages fontutils)
46 #:use-module (gnu packages gawk)
47 #:use-module (gnu packages gettext)
48 #:use-module (gnu packages gcc)
49 #:use-module (gnu packages gl)
50 #:use-module (gnu packages gnuzilla) ;nss
51 #:use-module (gnu packages ghostscript) ;lcms
52 #:use-module (gnu packages gnome)
53 #:use-module (gnu packages gtk)
54 #:use-module (gnu packages guile)
55 #:use-module (gnu packages icu4c)
56 #:use-module (gnu packages image)
57 #:use-module (gnu packages libffi)
58 #:use-module (gnu packages linux) ;alsa
59 #:use-module (gnu packages web)
60 #:use-module (gnu packages wget)
61 #:use-module (gnu packages pkg-config)
62 #:use-module (gnu packages perl)
63 #:use-module (gnu packages popt)
64 #:use-module (gnu packages kerberos)
65 #:use-module (gnu packages xml)
66 #:use-module (gnu packages xorg)
67 #:use-module (gnu packages texinfo)
68 #:use-module ((srfi srfi-1) #:select (fold alist-delete))
69 #:use-module (srfi srfi-11)
70 #:use-module (ice-9 match))
71
72 \f
73 ;;;
74 ;;; Java bootstrap toolchain.
75 ;;;
76
77 ;; The Java bootstrap begins with Jikes, a Java compiler written in C++. We
78 ;; use it to build the SableVM standard library and virtual machine, which are
79 ;; written in a simpler dialect of Java and C, respectively. This is
80 ;; sufficient to build an older version of Ant, which is needed to build an
81 ;; older version of ECJ, an incremental Java compiler, both of which are
82 ;; written in Java.
83 ;;
84 ;; ECJ is needed to build the latest release of GNU Classpath (0.99).
85 ;; Classpath (> 0.98) is a requirement for JamVM, a more modern implementation
86 ;; of the Java virtual machine.
87 ;;
88 ;; With JamVM we can build the latest development version of GNU Classpath,
89 ;; which has much more support for Java 1.6 than the latest release. Since
90 ;; the previous build of JamVM is limited by the use of GNU Classpath 0.99 we
91 ;; rebuild it with the latest development version of GNU Classpath.
92 ;;
93 ;; Finally, we use the bootstrap toolchain to build the OpenJDK with the
94 ;; Icedtea 1.x build framework. We then build the more recent JDKs Icedtea
95 ;; 2.x and Icedtea 3.x.
96
97 (define jikes
98 (package
99 (name "jikes")
100 (version "1.22")
101 (source (origin
102 (method url-fetch)
103 (uri (string-append "mirror://sourceforge/jikes/Jikes/"
104 version "/jikes-" version ".tar.bz2"))
105 (sha256
106 (base32
107 "1qqldrp74pzpy5ly421srqn30qppmm9cvjiqdngk8hf47dv2rc0c"))))
108 (build-system gnu-build-system)
109 (home-page "http://jikes.sourceforge.net/")
110 (synopsis "Compiler for the Java language")
111 (description "Jikes is a compiler that translates Java source files as
112 defined in The Java Language Specification into the bytecoded instruction set
113 and binary format defined in The Java Virtual Machine Specification.")
114 (license license:ibmpl1.0)))
115
116 (define sablevm-classpath
117 (package
118 (name "sablevm-classpath")
119 (version "1.13")
120 (source (origin
121 (method url-fetch)
122 (uri (string-append "mirror://sourceforge/sablevm/sablevm/"
123 version "/sablevm-classpath-" version ".tar.gz"))
124 (sha256
125 (base32
126 "1qyhyfz8idghxdam16hdgpa24r2x4xbg9z8c8asa3chnd79h3zw2"))))
127 (build-system gnu-build-system)
128 (arguments
129 `(#:configure-flags
130 (list "--with-jikes"
131 "--disable-Werror"
132 "--disable-gmp"
133 "--disable-gtk-peer"
134 "--disable-plugin"
135 "--disable-dssi"
136 "--disable-alsa"
137 "--disable-gjdoc")))
138 (inputs
139 `(("gconf" ,gconf)
140 ("gtk+" ,gtk+-2)))
141 (native-inputs
142 `(("jikes" ,jikes)
143 ("fastjar" ,fastjar)
144 ("pkg-config" ,pkg-config)))
145 (home-page "http://sablevm.org/")
146 (synopsis "Java Virtual Machine")
147 (description "SableVM is a clean-room, highly portable and efficient Java
148 virtual machine. Its goals are to be reasonably small, fast, and compliant
149 with the various specifications (JVM specification, JNI, invocation interface,
150 etc.). SableVM is no longer maintained.
151
152 This package provides the classpath library.")
153 (license license:lgpl2.1+)))
154
155 (define sablevm
156 (package
157 (name "sablevm")
158 (version "1.13")
159 (source (origin
160 (method url-fetch)
161 (uri (string-append "mirror://sourceforge/sablevm/sablevm/"
162 version "/sablevm-" version ".tar.gz"))
163 (sha256
164 (base32
165 "1jyg4bsym6igz94wps5443c7wiwlzinqzkchcw972nz4kf1cql6g"))))
166 (build-system gnu-build-system)
167 (arguments
168 `(#:configure-flags
169 (list "--with-internal-libffi=no"
170 "--with-internal-libpopt=no")
171 #:phases
172 (modify-phases %standard-phases
173 (add-after 'unpack 'remove-timestamp-for-reproducibility
174 (lambda _
175 (substitute* "src/sablevm/Makefile.in"
176 (("\\$\\(SVMCOMPILETIME\\)") "(unknown)"))
177 #t))
178 (add-after 'unpack 'link-with-popt
179 (lambda _
180 (substitute* "src/sablevm/Makefile.in"
181 (("\\$\\(SVMADD\\)" match)
182 (string-append match " -lpopt")))
183 #t))
184 (add-after 'unpack 'patch-path-to-classpath
185 (lambda* (#:key inputs #:allow-other-keys)
186 (substitute* "Makefile.in"
187 (("@datadir@/sablevm-classpath")
188 (string-append (assoc-ref inputs "classpath")
189 "/share/sablevm-classpath")))
190 (substitute* "src/libsablevm/Makefile.in"
191 (("\\$\\(libdir\\)/sablevm-classpath")
192 (string-append (assoc-ref inputs "classpath")
193 "/lib/sablevm-classpath"))
194 (("\\$\\(datadir\\)/sablevm-classpath")
195 (string-append (assoc-ref inputs "classpath")
196 "/share/sablevm-classpath")))
197 #t)))))
198 (inputs
199 `(("classpath" ,sablevm-classpath)
200 ("jikes" ,jikes)
201 ("zlib" ,zlib)
202 ("popt" ,popt)
203 ("libffi" ,libffi)))
204 (native-inputs
205 `(("libltdl" ,libltdl)))
206 (home-page "http://sablevm.org/")
207 (synopsis "Java Virtual Machine")
208 (description "SableVM is a clean-room, highly portable and efficient Java
209 virtual machine. Its goals are to be reasonably small, fast, and compliant
210 with the various specifications (JVM specification, JNI, invocation interface,
211 etc.). SableVM is no longer maintained.
212
213 This package provides the virtual machine.")
214 (license license:lgpl2.1+)))
215
216 (define ant-bootstrap
217 (package
218 (name "ant-bootstrap")
219 ;; The 1.10.x series requires Java 8. 1.9.0 and later use generics, which
220 ;; are not supported. The 1.8.x series is the last to use only features
221 ;; supported by Jikes, but it cannot seem to be built with sablevm.
222 (version "1.7.1")
223 (source (origin
224 (method url-fetch)
225 (uri (string-append "http://archive.apache.org/dist/"
226 "ant/source/apache-ant-"
227 version "-src.tar.bz2"))
228 (sha256
229 (base32
230 "19pvqvgkxgpgsqm4lvbki5sm0z84kxmykdqicvfad47gc1r9mi2d"))))
231 (build-system gnu-build-system)
232 (arguments
233 `(#:tests? #f ; no "check" target
234 #:phases
235 (modify-phases %standard-phases
236 (delete 'configure)
237 (replace 'build
238 (lambda* (#:key inputs #:allow-other-keys)
239 (setenv "JAVA_HOME"
240 (string-append (assoc-ref inputs "sablevm")
241 "/lib/sablevm"))
242 (setenv "JAVACMD"
243 (string-append (assoc-ref inputs "sablevm")
244 "/bin/java-sablevm"))
245 (setenv "JAVAC"
246 (string-append (assoc-ref inputs "sablevm")
247 "/bin/javac-sablevm"))
248
249 ;; Use jikes instead of javac for <javac ...> tags in build.xml
250 (setenv "ANT_OPTS" "-Dbuild.compiler=jikes")
251
252 ;; jikes produces lots of warnings, but they are not very
253 ;; interesting, so we silence them.
254 (setenv "$BOOTJAVAC_OPTS" "-nowarn")
255
256 ;; Disable tests because we are bootstrapping and thus don't have
257 ;; any of the dependencies required to build and run the tests.
258 (substitute* "build.xml"
259 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
260 (zero? (system* "bash" "bootstrap.sh"
261 (string-append "-Ddist.dir="
262 (assoc-ref %outputs "out"))))))
263 (delete 'install))))
264 (native-inputs
265 `(("jikes" ,jikes)
266 ("sablevm" ,sablevm)))
267 (home-page "http://ant.apache.org")
268 (synopsis "Build tool for Java")
269 (description
270 "Ant is a platform-independent build tool for Java. It is similar to
271 make but is implemented using the Java language, requires the Java platform,
272 and is best suited to building Java projects. Ant uses XML to describe the
273 build process and its dependencies, whereas Make uses Makefile format.")
274 (license license:asl2.0)))
275
276 ;; Version 3.2.2 is the last version without a dependency on a full-fledged
277 ;; compiler for Java 1.5.
278 (define ecj-bootstrap
279 (package
280 (name "ecj-bootstrap")
281 (version "3.2.2")
282 (source (origin
283 (method url-fetch)
284 (uri (string-append "http://archive.eclipse.org/eclipse/"
285 "downloads/drops/R-" version
286 "-200702121330/ecjsrc.zip"))
287 (sha256
288 (base32
289 "05hj82kxd23qaglsjkaqcj944riisjha7acf7h3ljhrjyljx8307"))))
290 ;; It would be so much easier if we could use the ant-build-system, but we
291 ;; cannot as we don't have ant at this point. We use ecj for
292 ;; bootstrapping the JDK.
293 (build-system gnu-build-system)
294 (arguments
295 `(#:modules ((guix build gnu-build-system)
296 (guix build utils)
297 (srfi srfi-1))
298 #:tests? #f ; there are no tests
299 #:phases
300 (modify-phases %standard-phases
301 (replace 'configure
302 (lambda* (#:key inputs #:allow-other-keys)
303 (setenv "CLASSPATH"
304 (string-join
305 (find-files (string-append (assoc-ref inputs "ant-bootstrap")
306 "/lib")
307 "\\.jar$")
308 ":"))
309 #t))
310 (replace 'build
311 (lambda* (#:key inputs #:allow-other-keys)
312 ;; The unpack phase enters the "org" directory by mistake.
313 (chdir "..")
314
315 ;; Create a simple manifest to make ecj executable.
316 (with-output-to-file "manifest"
317 (lambda _
318 (display "Manifest-Version: 1.0
319 Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n")))
320
321 ;; Compile it all!
322 (and (zero? (apply system* "javac-sablevm"
323 (find-files "." "\\.java$")))
324 (zero? (system* "fastjar" "cvfm"
325 "ecj-bootstrap.jar" "manifest" ".")))))
326 (replace 'install
327 (lambda* (#:key outputs #:allow-other-keys)
328 (let ((share (string-append (assoc-ref outputs "out")
329 "/share/java/")))
330 (mkdir-p share)
331 (install-file "ecj-bootstrap.jar" share)
332 #t))))))
333 (native-inputs
334 `(("ant-bootstrap" ,ant-bootstrap)
335 ("unzip" ,unzip)
336 ("sablevm" ,sablevm)
337 ("fastjar" ,fastjar)))
338 (home-page "https://eclipse.org")
339 (synopsis "Eclipse Java development tools core batch compiler")
340 (description "This package provides the Eclipse Java core batch compiler
341 for bootstrapping purposes. The @dfn{Eclipse compiler for Java} (ecj) is a
342 requirement for all GNU Classpath releases after version 0.93.")
343 (license license:epl1.0)))
344
345 (define ecj-javac-wrapper
346 (package (inherit ecj-bootstrap)
347 (name "ecj-javac-wrapper")
348 (source #f)
349 (build-system trivial-build-system)
350 (arguments
351 `(#:modules ((guix build utils))
352 #:builder
353 (let ((backend 'sablevm))
354 (use-modules (guix build utils))
355 (let* ((bin (string-append (assoc-ref %outputs "out") "/bin"))
356 (target (string-append bin "/javac"))
357 (guile (string-append (assoc-ref %build-inputs "guile")
358 "/bin/guile"))
359 (ecj (string-append (assoc-ref %build-inputs "ecj-bootstrap")
360 "/share/java/ecj-bootstrap.jar"))
361 (java (case backend
362 ((sablevm)
363 (string-append (assoc-ref %build-inputs "sablevm")
364 "/lib/sablevm/bin/java"))
365 ((jamvm)
366 (string-append (assoc-ref %build-inputs "jamvm")
367 "/bin/jamvm"))))
368 (bootcp (case backend
369 ((sablevm)
370 (let ((jvmlib (string-append
371 (assoc-ref %build-inputs "sablevm-classpath")
372 "/lib/sablevm")))
373 (string-append jvmlib "/jre/lib/rt.jar")))
374 ((jamvm)
375 (let ((jvmlib (string-append (assoc-ref %build-inputs "classpath")
376 "/share/classpath")))
377 (string-append jvmlib "/lib/glibj.zip:"
378 jvmlib "/lib/tools.zip"))))))
379 (mkdir-p bin)
380 (with-output-to-file target
381 (lambda _
382 (format #t "#!~a --no-auto-compile\n!#\n" guile)
383 (write
384 `(begin (use-modules (ice-9 match)
385 (ice-9 receive)
386 (ice-9 hash-table)
387 (srfi srfi-1)
388 (srfi srfi-26))
389 (define defaults
390 '(("-bootclasspath" ,bootcp)
391 ("-source" "1.5")
392 ("-target" "1.5")
393 ("-cp" ".")))
394 (define (main args)
395 (let ((classpath (getenv "CLASSPATH")))
396 (setenv "CLASSPATH"
397 (string-append ,ecj
398 (if classpath
399 (string-append ":" classpath)
400 ""))))
401 (receive (vm-args other-args)
402 ;; Separate VM arguments from arguments to ECJ.
403 (partition (cut string-prefix? "-J" <>)
404 (fold (lambda (default acc)
405 (if (member (first default) acc)
406 acc (append default acc)))
407 args defaults))
408 (apply system* ,java
409 (append
410 ;; Remove "-J" prefix
411 (map (cut string-drop <> 2) vm-args)
412 '("org.eclipse.jdt.internal.compiler.batch.Main")
413 (cons "-nowarn" other-args)))))
414 ;; Entry point
415 (let ((args (cdr (command-line))))
416 (if (null? args)
417 (format (current-error-port) "javac: no arguments given!\n")
418 (main args)))))))
419 (chmod target #o755)
420 #t))))
421 (native-inputs
422 `(("guile" ,guile-2.2)
423 ("ecj-bootstrap" ,ecj-bootstrap)
424 ("sablevm" ,sablevm)
425 ("sablevm-classpath" ,sablevm-classpath)))
426 (description "This package provides a wrapper around the @dfn{Eclipse
427 compiler for Java} (ecj) with a command line interface that is compatible with
428 the standard javac executable.")))
429
430 ;; Note: All the tool wrappers (e.g. for javah, javac, etc) fail with
431 ;; java.lang.UnsupportedClassVersionError. They simply won't run on the old
432 ;; sablevm. We use Classpath 0.99 to build JamVM, on which the Classpath
433 ;; tools do run. Using these Classpath tools on JamVM we can then build the
434 ;; development version of GNU Classpath.
435 (define classpath-on-sablevm
436 (package
437 (name "classpath")
438 (version "0.99")
439 (source (origin
440 (method url-fetch)
441 (uri (string-append "mirror://gnu/classpath/classpath-"
442 version ".tar.gz"))
443 (sha256
444 (base32
445 "1j7cby4k66f1nvckm48xcmh352b1d1b33qk7l6hi7dp9i9zjjagr"))))
446 (build-system gnu-build-system)
447 (arguments
448 `(#:configure-flags
449 (list (string-append "--with-ecj-jar="
450 (assoc-ref %build-inputs "ecj-bootstrap")
451 "/share/java/ecj-bootstrap.jar")
452 (string-append "JAVAC="
453 (assoc-ref %build-inputs "ecj-javac-wrapper")
454 "/bin/javac")
455 (string-append "JAVA="
456 (assoc-ref %build-inputs "sablevm")
457 "/bin/java-sablevm")
458 "GCJ_JAVAC_TRUE=no"
459 "ac_cv_prog_java_works=yes" ; trust me
460 "--disable-Werror"
461 "--disable-gmp"
462 "--disable-gtk-peer"
463 "--disable-gconf-peer"
464 "--disable-plugin"
465 "--disable-dssi"
466 "--disable-alsa"
467 "--disable-gjdoc")
468 #:phases
469 (modify-phases %standard-phases
470 (add-after 'install 'install-data
471 (lambda _ (zero? (system* "make" "install-data")))))))
472 (native-inputs
473 `(("ecj-bootstrap" ,ecj-bootstrap)
474 ("ecj-javac-wrapper" ,ecj-javac-wrapper)
475 ("fastjar" ,fastjar)
476 ("sablevm" ,sablevm)
477 ("sablevm-classpath" ,sablevm-classpath)
478 ("libltdl" ,libltdl)
479 ("pkg-config" ,pkg-config)))
480 (home-page "https://www.gnu.org/software/classpath/")
481 (synopsis "Essential libraries for Java")
482 (description "GNU Classpath is a project to create core class libraries
483 for use with runtimes, compilers and tools for the Java programming
484 language.")
485 ;; GPLv2 or later, with special linking exception.
486 (license license:gpl2+)))
487
488 (define jamvm-bootstrap
489 (package
490 (name "jamvm")
491 (version "2.0.0")
492 (source (origin
493 (method url-fetch)
494 (uri (string-append "mirror://sourceforge/jamvm/jamvm/"
495 "JamVM%20" version "/jamvm-"
496 version ".tar.gz"))
497 (sha256
498 (base32
499 "1nl0zxz8y5x8gwsrm7n32bry4dx8x70p8z3s9jbdvs8avyb8whkn"))))
500 (build-system gnu-build-system)
501 (arguments
502 `(#:configure-flags
503 (list (string-append "--with-classpath-install-dir="
504 (assoc-ref %build-inputs "classpath")))))
505 (inputs
506 `(("classpath" ,classpath-on-sablevm)
507 ("ecj-javac-wrapper" ,ecj-javac-wrapper)
508 ("zlib" ,zlib)))
509 (home-page "http://jamvm.sourceforge.net/")
510 (synopsis "Small Java Virtual Machine")
511 (description "JamVM is a Java Virtual Machine conforming to the JVM
512 specification edition 2 (blue book). It is extremely small. However, unlike
513 other small VMs it supports the full spec, including object finalisation and
514 JNI.")
515 (license license:gpl2+)))
516
517 ;; We need this because the tools provided by the latest release of GNU
518 ;; Classpath don't actually work with sablevm.
519 (define classpath-jamvm-wrappers
520 (package (inherit classpath-on-sablevm)
521 (name "classpath-jamvm-wrappers")
522 (source #f)
523 (build-system trivial-build-system)
524 (arguments
525 `(#:modules ((guix build utils))
526 #:builder
527 (begin
528 (use-modules (guix build utils))
529 (let* ((bash (assoc-ref %build-inputs "bash"))
530 (jamvm (assoc-ref %build-inputs "jamvm"))
531 (classpath (assoc-ref %build-inputs "classpath"))
532 (bin (string-append (assoc-ref %outputs "out")
533 "/bin/")))
534 (mkdir-p bin)
535 (for-each (lambda (tool)
536 (with-output-to-file (string-append bin tool)
537 (lambda _
538 (format #t "#!~a/bin/sh
539 ~a/bin/jamvm -classpath ~a/share/classpath/tools.zip \
540 gnu.classpath.tools.~a.~a $@"
541 bash jamvm classpath tool
542 (if (string=? "native2ascii" tool)
543 "Native2ASCII" "Main"))))
544 (chmod (string-append bin tool) #o755))
545 (list "javah"
546 "rmic"
547 "rmid"
548 "orbd"
549 "rmiregistry"
550 "native2ascii"))
551 #t))))
552 (native-inputs
553 `(("bash" ,bash)
554 ("jamvm" ,jamvm-bootstrap)
555 ("classpath" ,classpath-on-sablevm)))
556 (inputs '())
557 (synopsis "Executables from GNU Classpath")
558 (description "This package provides wrappers around the tools provided by
559 the GNU Classpath library. They are executed by the JamVM virtual
560 machine.")))
561
562 (define ecj-javac-on-jamvm-wrapper
563 (package (inherit ecj-javac-wrapper)
564 (name "ecj-javac-on-jamvm-wrapper")
565 (arguments
566 `(#:modules ((guix build utils))
567 #:builder
568 ;; TODO: This builder is exactly the same as in ecj-javac-wrapper,
569 ;; except that the backend is 'jamvm here. Can we reuse the same
570 ;; builder somehow?
571 (let ((backend 'jamvm))
572 (use-modules (guix build utils))
573 (let* ((bin (string-append (assoc-ref %outputs "out") "/bin"))
574 (target (string-append bin "/javac"))
575 (guile (string-append (assoc-ref %build-inputs "guile")
576 "/bin/guile"))
577 (ecj (string-append (assoc-ref %build-inputs "ecj-bootstrap")
578 "/share/java/ecj-bootstrap.jar"))
579 (java (case backend
580 ((sablevm)
581 (string-append (assoc-ref %build-inputs "sablevm")
582 "/lib/sablevm/bin/java"))
583 ((jamvm)
584 (string-append (assoc-ref %build-inputs "jamvm")
585 "/bin/jamvm"))))
586 (bootcp (case backend
587 ((sablevm)
588 (let ((jvmlib (string-append
589 (assoc-ref %build-inputs "sablevm-classpath")
590 "/lib/sablevm")))
591 (string-append jvmlib "/jre/lib/rt.jar")))
592 ((jamvm)
593 (let ((jvmlib (string-append (assoc-ref %build-inputs "classpath")
594 "/share/classpath")))
595 (string-append jvmlib "/lib/glibj.zip:"
596 jvmlib "/lib/tools.zip"))))))
597 (mkdir-p bin)
598 (with-output-to-file target
599 (lambda _
600 (format #t "#!~a --no-auto-compile\n!#\n" guile)
601 (write
602 `(begin (use-modules (ice-9 match)
603 (ice-9 receive)
604 (ice-9 hash-table)
605 (srfi srfi-1)
606 (srfi srfi-26))
607 (define defaults
608 '(("-bootclasspath" ,bootcp)
609 ("-source" "1.5")
610 ("-target" "1.5")
611 ("-cp" ".")))
612 (define (main args)
613 (let ((classpath (getenv "CLASSPATH")))
614 (setenv "CLASSPATH"
615 (string-append ,ecj
616 (if classpath
617 (string-append ":" classpath)
618 ""))))
619 (receive (vm-args other-args)
620 ;; Separate VM arguments from arguments to ECJ.
621 (partition (cut string-prefix? "-J" <>)
622 (fold (lambda (default acc)
623 (if (member (first default) acc)
624 acc (append default acc)))
625 args defaults))
626 (apply system* ,java
627 (append
628 ;; Remove "-J" prefix
629 (map (cut string-drop <> 2) vm-args)
630 '("org.eclipse.jdt.internal.compiler.batch.Main")
631 (cons "-nowarn" other-args)))))
632 ;; Entry point
633 (let ((args (cdr (command-line))))
634 (if (null? args)
635 (format (current-error-port) "javac: no arguments given!\n")
636 (main args)))))))
637 (chmod target #o755)
638 #t))))
639 (native-inputs
640 `(("guile" ,guile-2.2)
641 ("ecj-bootstrap" ,ecj-bootstrap)
642 ("jamvm" ,jamvm-bootstrap)
643 ("classpath" ,classpath-on-sablevm)))
644 (description "This package provides a wrapper around the @dfn{Eclipse
645 compiler for Java} (ecj) with a command line interface that is compatible with
646 the standard javac executable. The tool runs on JamVM instead of SableVM.")))
647
648 ;; The last release of GNU Classpath is 0.99 and it happened in 2012. Since
649 ;; then Classpath has gained much more support for Java 1.6.
650 (define-public classpath-devel
651 (let ((commit "e7c13ee0cf2005206fbec0eca677f8cf66d5a103")
652 (revision "1"))
653 (package (inherit classpath-on-sablevm)
654 (version (string-append "0.99-" revision "." (string-take commit 9)))
655 (source (origin
656 (method git-fetch)
657 (uri (git-reference
658 (url "https://git.savannah.gnu.org/git/classpath.git")
659 (commit commit)))
660 (file-name (string-append "classpath-" version "-checkout"))
661 (sha256
662 (base32
663 "1v2rww76ww322mpg3s12a1kkc6gkp31bm9gcxs532h0wq285fiw4"))))
664 (arguments
665 `(#:make-flags
666 ;; Ensure that the initial heap size is smaller than the maximum
667 ;; size. By default only Xmx is set, which can lead to invalid
668 ;; memory settings on some machines with a lot of memory.
669 '("JAVAC_MEM_OPT=-J-Xms512M -J-Xmx768M")
670 #:configure-flags
671 (list (string-append "--with-ecj-jar="
672 (assoc-ref %build-inputs "ecj-bootstrap")
673 "/share/java/ecj-bootstrap.jar")
674 (string-append "--with-javac="
675 (assoc-ref %build-inputs "ecj-javac-wrapper")
676 "/bin/javac")
677 (string-append "JAVA="
678 (assoc-ref %build-inputs "jamvm")
679 "/bin/jamvm")
680 "GCJ_JAVAC_TRUE=no"
681 "ac_cv_prog_java_works=yes" ; trust me
682 "--disable-Werror"
683 "--disable-gmp"
684 "--disable-gtk-peer"
685 "--disable-gconf-peer"
686 "--disable-plugin"
687 "--disable-dssi"
688 "--disable-alsa"
689 "--disable-gjdoc")
690 #:phases
691 (modify-phases %standard-phases
692 (add-after 'unpack 'bootstrap
693 (lambda _
694 (zero? (system* "autoreconf" "-vif"))))
695 (add-after 'unpack 'remove-unsupported-annotations
696 (lambda _
697 (substitute* (find-files "java" "\\.java$")
698 (("@Override") ""))
699 #t))
700 (add-after 'install 'install-data
701 (lambda _ (zero? (system* "make" "install-data")))))))
702 (native-inputs
703 `(("autoconf" ,autoconf)
704 ("automake" ,automake)
705 ("libtool" ,libtool)
706 ("gettext" ,gettext-minimal)
707 ("texinfo" ,texinfo)
708 ("classpath-jamvm-wrappers" ,classpath-jamvm-wrappers) ; for javah
709 ("ecj-bootstrap" ,ecj-bootstrap)
710 ("ecj-javac-wrapper" ,ecj-javac-on-jamvm-wrapper)
711 ("fastjar" ,fastjar)
712 ("jamvm" ,jamvm-bootstrap)
713 ("libltdl" ,libltdl)
714 ("pkg-config" ,pkg-config))))))
715
716 (define-public jamvm
717 (package (inherit jamvm-bootstrap)
718 (inputs
719 `(("classpath" ,classpath-devel)
720 ("ecj-javac-wrapper" ,ecj-javac-on-jamvm-wrapper)
721 ("zlib" ,zlib)))))
722
723 (define ecj-javac-on-jamvm-wrapper-final
724 (package (inherit ecj-javac-on-jamvm-wrapper)
725 (native-inputs
726 `(("guile" ,guile-2.2)
727 ("ecj-bootstrap" ,ecj-bootstrap)
728 ("jamvm" ,jamvm)
729 ("classpath" ,classpath-devel)))))
730
731 ;; The bootstrap JDK consisting of jamvm, classpath-devel,
732 ;; ecj-javac-on-jamvm-wrapper-final cannot build Icedtea 2.x directly, because
733 ;; it's written in Java 7. It can, however, build the unmaintained Icedtea
734 ;; 1.x, which uses Java 6 only.
735 (define-public icedtea-6
736 (package
737 (name "icedtea")
738 (version "1.13.13")
739 (source (origin
740 (method url-fetch)
741 (uri (string-append
742 "http://icedtea.wildebeest.org/download/source/icedtea6-"
743 version ".tar.xz"))
744 (sha256
745 (base32
746 "0bg9sb4f7qbq77c0zf9m17p47ga0kf0r9622g9p12ysg26jd1ksg"))
747 (modules '((guix build utils)))
748 (snippet
749 '(substitute* "Makefile.in"
750 ;; do not leak information about the build host
751 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
752 "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
753 (build-system gnu-build-system)
754 (outputs '("out" ; Java Runtime Environment
755 "jdk" ; Java Development Kit
756 "doc")) ; all documentation
757 (arguments
758 `(;; There are many failing tests and many are known to fail upstream.
759 #:tests? #f
760
761 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
762 ;; gremlin) doesn't support it yet, so skip this phase.
763 #:validate-runpath? #f
764
765 #:modules ((guix build utils)
766 (guix build gnu-build-system)
767 (srfi srfi-19))
768
769 #:configure-flags
770 `("--enable-bootstrap"
771 "--enable-nss"
772 "--without-rhino"
773 "--with-parallel-jobs"
774 "--disable-downloading"
775 "--disable-tests"
776 ,(string-append "--with-ecj="
777 (assoc-ref %build-inputs "ecj")
778 "/share/java/ecj-bootstrap.jar")
779 ,(string-append "--with-jar="
780 (assoc-ref %build-inputs "fastjar")
781 "/bin/fastjar")
782 ,(string-append "--with-jdk-home="
783 (assoc-ref %build-inputs "classpath"))
784 ,(string-append "--with-java="
785 (assoc-ref %build-inputs "jamvm")
786 "/bin/jamvm"))
787 #:phases
788 (modify-phases %standard-phases
789 (replace 'unpack
790 (lambda* (#:key source inputs #:allow-other-keys)
791 (and (zero? (system* "tar" "xvf" source))
792 (begin
793 (chdir (string-append "icedtea6-" ,version))
794 (mkdir "openjdk")
795 (copy-recursively (assoc-ref inputs "openjdk-src") "openjdk")
796 ;; The convenient OpenJDK source bundle is no longer
797 ;; available for download, so we have to take the sources
798 ;; from the Mercurial repositories and change the Makefile
799 ;; to avoid tests for the OpenJDK zip archive.
800 (with-directory-excursion "openjdk"
801 (for-each (lambda (part)
802 (mkdir part)
803 (copy-recursively
804 (assoc-ref inputs
805 (string-append part "-src"))
806 part))
807 '("jdk" "hotspot" "corba"
808 "langtools" "jaxp" "jaxws")))
809 (substitute* "Makefile.in"
810 (("echo \"ERROR: No up-to-date OpenJDK zip available\"; exit -1;")
811 "echo \"trust me\";")
812 ;; The contents of the bootstrap directory must be
813 ;; writeable but when copying from the store they are
814 ;; not.
815 (("mkdir -p lib/rt" line)
816 (string-append line "; chmod -R u+w $(BOOT_DIR)")))
817 (zero? (system* "chmod" "-R" "u+w" "openjdk"))
818 #t))))
819 (add-after 'unpack 'use-classpath
820 (lambda* (#:key inputs #:allow-other-keys)
821 (let ((jvmlib (assoc-ref inputs "classpath")))
822 ;; Classpath does not provide rt.jar.
823 (substitute* "Makefile.in"
824 (("\\$\\(SYSTEM_JDK_DIR\\)/jre/lib/rt.jar")
825 (string-append jvmlib "/share/classpath/glibj.zip")))
826 ;; Make sure we can find all classes.
827 (setenv "CLASSPATH"
828 (string-append jvmlib "/share/classpath/glibj.zip:"
829 jvmlib "/share/classpath/tools.zip"))
830 (setenv "JAVACFLAGS"
831 (string-append "-cp "
832 jvmlib "/share/classpath/glibj.zip:"
833 jvmlib "/share/classpath/tools.zip")))
834 #t))
835 (add-after 'unpack 'patch-patches
836 (lambda _
837 ;; shebang in patches so that they apply cleanly
838 (substitute* '("patches/jtreg-jrunscript.patch"
839 "patches/hotspot/hs23/drop_unlicensed_test.patch")
840 (("#!/bin/sh") (string-append "#!" (which "sh"))))
841 #t))
842 (add-after 'unpack 'patch-paths
843 (lambda* (#:key inputs #:allow-other-keys)
844 ;; buildtree.make generates shell scripts, so we need to replace
845 ;; the generated shebang
846 (substitute* '("openjdk/hotspot/make/linux/makefiles/buildtree.make")
847 (("/bin/sh") (which "bash")))
848
849 (let ((corebin (string-append
850 (assoc-ref inputs "coreutils") "/bin/"))
851 (binbin (string-append
852 (assoc-ref inputs "binutils") "/bin/"))
853 (grepbin (string-append
854 (assoc-ref inputs "grep") "/bin/")))
855 (substitute* '("openjdk/jdk/make/common/shared/Defs-linux.gmk"
856 "openjdk/corba/make/common/shared/Defs-linux.gmk")
857 (("UNIXCOMMAND_PATH = /bin/")
858 (string-append "UNIXCOMMAND_PATH = " corebin))
859 (("USRBIN_PATH = /usr/bin/")
860 (string-append "USRBIN_PATH = " corebin))
861 (("DEVTOOLS_PATH *= */usr/bin/")
862 (string-append "DEVTOOLS_PATH = " corebin))
863 (("COMPILER_PATH *= */usr/bin/")
864 (string-append "COMPILER_PATH = "
865 (assoc-ref inputs "gcc") "/bin/"))
866 (("DEF_OBJCOPY *=.*objcopy")
867 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
868
869 ;; fix path to alsa header
870 (substitute* "openjdk/jdk/make/common/shared/Sanity.gmk"
871 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
872 (string-append "ALSA_INCLUDE="
873 (assoc-ref inputs "alsa-lib")
874 "/include/alsa/version.h")))
875
876 ;; fix hard-coded utility paths
877 (substitute* '("openjdk/jdk/make/common/shared/Defs-utils.gmk"
878 "openjdk/corba/make/common/shared/Defs-utils.gmk")
879 (("ECHO *=.*echo")
880 (string-append "ECHO = " (which "echo")))
881 (("^GREP *=.*grep")
882 (string-append "GREP = " (which "grep")))
883 (("EGREP *=.*egrep")
884 (string-append "EGREP = " (which "egrep")))
885 (("CPIO *=.*cpio")
886 (string-append "CPIO = " (which "cpio")))
887 (("READELF *=.*readelf")
888 (string-append "READELF = " (which "readelf")))
889 (("^ *AR *=.*ar")
890 (string-append "AR = " (which "ar")))
891 (("^ *TAR *=.*tar")
892 (string-append "TAR = " (which "tar")))
893 (("AS *=.*as")
894 (string-append "AS = " (which "as")))
895 (("LD *=.*ld")
896 (string-append "LD = " (which "ld")))
897 (("STRIP *=.*strip")
898 (string-append "STRIP = " (which "strip")))
899 (("NM *=.*nm")
900 (string-append "NM = " (which "nm")))
901 (("^SH *=.*sh")
902 (string-append "SH = " (which "bash")))
903 (("^FIND *=.*find")
904 (string-append "FIND = " (which "find")))
905 (("LDD *=.*ldd")
906 (string-append "LDD = " (which "ldd")))
907 (("NAWK *=.*(n|g)awk")
908 (string-append "NAWK = " (which "gawk")))
909 (("XARGS *=.*xargs")
910 (string-append "XARGS = " (which "xargs")))
911 (("UNZIP *=.*unzip")
912 (string-append "UNZIP = " (which "unzip")))
913 (("ZIPEXE *=.*zip")
914 (string-append "ZIPEXE = " (which "zip")))
915 (("SED *=.*sed")
916 (string-append "SED = " (which "sed"))))
917
918 ;; Some of these timestamps cause problems as they are more than
919 ;; 10 years ago, failing the build process.
920 (substitute*
921 "openjdk/jdk/src/share/classes/java/util/CurrencyData.properties"
922 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
923 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
924 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
925 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY"))
926 #t)))
927 (add-before 'configure 'set-additional-paths
928 (lambda* (#:key inputs #:allow-other-keys)
929 (setenv "CPATH"
930 (string-append (assoc-ref inputs "libxrender")
931 "/include/X11/extensions" ":"
932 (assoc-ref inputs "libxtst")
933 "/include/X11/extensions" ":"
934 (assoc-ref inputs "libxinerama")
935 "/include/X11/extensions" ":"
936 (or (getenv "CPATH") "")))
937 (setenv "ALT_CUPS_HEADERS_PATH"
938 (string-append (assoc-ref inputs "cups")
939 "/include"))
940 (setenv "ALT_FREETYPE_HEADERS_PATH"
941 (string-append (assoc-ref inputs "freetype")
942 "/include"))
943 (setenv "ALT_FREETYPE_LIB_PATH"
944 (string-append (assoc-ref inputs "freetype")
945 "/lib"))
946 #t))
947 (replace 'install
948 (lambda* (#:key outputs #:allow-other-keys)
949 (let ((doc (string-append (assoc-ref outputs "doc")
950 "/share/doc/icedtea"))
951 (jre (assoc-ref outputs "out"))
952 (jdk (assoc-ref outputs "jdk")))
953 (copy-recursively "openjdk.build/docs" doc)
954 (copy-recursively "openjdk.build/j2re-image" jre)
955 (copy-recursively "openjdk.build/j2sdk-image" jdk))
956 #t)))))
957 (native-inputs
958 `(("ant" ,ant-bootstrap)
959 ("alsa-lib" ,alsa-lib)
960 ("attr" ,attr)
961 ("classpath" ,classpath-devel)
962 ("coreutils" ,coreutils)
963 ("cpio" ,cpio)
964 ("cups" ,cups)
965 ("ecj" ,ecj-bootstrap)
966 ("ecj-javac" ,ecj-javac-on-jamvm-wrapper-final)
967 ("fastjar" ,fastjar)
968 ("fontconfig" ,fontconfig)
969 ("freetype" ,freetype)
970 ("gtk" ,gtk+-2)
971 ("gawk" ,gawk)
972 ("giflib" ,giflib)
973 ("grep" ,grep)
974 ("jamvm" ,jamvm)
975 ("lcms" ,lcms)
976 ("libjpeg" ,libjpeg)
977 ("libpng" ,libpng)
978 ("libtool" ,libtool)
979 ("libx11" ,libx11)
980 ("libxcomposite" ,libxcomposite)
981 ("libxi" ,libxi)
982 ("libxinerama" ,libxinerama)
983 ("libxrender" ,libxrender)
984 ("libxslt" ,libxslt) ;for xsltproc
985 ("libxt" ,libxt)
986 ("libxtst" ,libxtst)
987 ("mit-krb5" ,mit-krb5)
988 ("nss" ,nss)
989 ("nss-certs" ,nss-certs)
990 ("perl" ,perl)
991 ("pkg-config" ,pkg-config)
992 ("procps" ,procps) ;for "free", even though I'm not sure we should use it
993 ("unzip" ,unzip)
994 ("wget" ,wget)
995 ("which" ,which)
996 ("zip" ,zip)
997 ("zlib" ,zlib)
998 ("openjdk-src"
999 ,(origin
1000 (method hg-fetch)
1001 (uri (hg-reference
1002 (url "http://hg.openjdk.java.net/jdk6/jdk6/")
1003 (changeset "jdk6-b41")))
1004 (sha256
1005 (base32
1006 "14q47yfg586fs64w30g8mk92m5dkxsvr36zzh0ra99xk5x0x96mv"))))
1007 ("jdk-src"
1008 ,(origin
1009 (method hg-fetch)
1010 (uri (hg-reference
1011 (url "http://hg.openjdk.java.net/jdk6/jdk6/jdk/")
1012 (changeset "jdk6-b41")))
1013 (sha256
1014 (base32
1015 "165824nhg1k1dx6zs9dny0j49rmk35jw5b13dmz8c77jfajml4v9"))))
1016 ("hotspot-src"
1017 ,(origin
1018 (method hg-fetch)
1019 (uri (hg-reference
1020 (url "http://hg.openjdk.java.net/jdk6/jdk6/hotspot/")
1021 (changeset "jdk6-b41")))
1022 (sha256
1023 (base32
1024 "07lc1z4k5dj9nrc1wvwmpvxr3xgxrdkdh53xb95skk5ij49yagfd"))))
1025 ("corba-src"
1026 ,(origin
1027 (method hg-fetch)
1028 (uri (hg-reference
1029 (url "http://hg.openjdk.java.net/jdk6/jdk6/corba/")
1030 (changeset "jdk6-b41")))
1031 (sha256
1032 (base32
1033 "1p9g1r9dnax2iwp7yb59qx7m4nmshqhwmrb2b8jj8zgbd9dl2i3q"))))
1034 ("langtools-src"
1035 ,(origin
1036 (method hg-fetch)
1037 (uri (hg-reference
1038 (url "http://hg.openjdk.java.net/jdk6/jdk6/langtools/")
1039 (changeset "jdk6-b41")))
1040 (sha256
1041 (base32
1042 "1x52wd67fynbbd9ild6fb4wvba3f5hhwk03qdjfazd0a1qr37z3d"))))
1043 ("jaxp-src"
1044 ,(origin
1045 (method hg-fetch)
1046 (uri (hg-reference
1047 (url "http://hg.openjdk.java.net/jdk6/jdk6/jaxp/")
1048 (changeset "jdk6-b41")))
1049 (sha256
1050 (base32
1051 "0shlqrvzpr4nrkmv215lbxnby63s3yvbdh1yxcayznsyqwa4nlxm"))))
1052 ("jaxws-src"
1053 ,(origin
1054 (method hg-fetch)
1055 (uri (hg-reference
1056 (url "http://hg.openjdk.java.net/jdk6/jdk6/jaxws/")
1057 (changeset "jdk6-b41")))
1058 (sha256
1059 (base32
1060 "0835lkw8vib1xhp8lxnybhlvzdh699hbi4mclxanydjk63zbpxk0"))))))
1061 (home-page "http://icedtea.classpath.org")
1062 (synopsis "Java development kit")
1063 (description
1064 "This package provides the OpenJDK built with the IcedTea build harness.
1065 This version of the OpenJDK is no longer maintained and is only used for
1066 bootstrapping purposes.")
1067 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
1068 ;; same license as both GNU Classpath and OpenJDK.
1069 (license license:gpl2+)))
1070
1071 (define-public icedtea-7
1072 (let* ((version "2.6.11")
1073 (drop (lambda (name hash)
1074 (origin
1075 (method url-fetch)
1076 (uri (string-append
1077 "http://icedtea.classpath.org/download/drops"
1078 "/icedtea7/" version "/" name ".tar.bz2"))
1079 (sha256 (base32 hash))))))
1080 (package
1081 (name "icedtea")
1082 (version version)
1083 (source (origin
1084 (method url-fetch)
1085 (uri (string-append
1086 "http://icedtea.wildebeest.org/download/source/icedtea-"
1087 version ".tar.xz"))
1088 (sha256
1089 (base32
1090 "1ibp6ybqnf8g7mbs45bkbv44dwz4h2w9gr4rh15yvr1m8lqkq1i0"))
1091 (modules '((guix build utils)))
1092 (snippet
1093 '(substitute* "Makefile.in"
1094 ;; do not leak information about the build host
1095 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
1096 "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
1097 (build-system gnu-build-system)
1098 (outputs '("out" ; Java Runtime Environment
1099 "jdk" ; Java Development Kit
1100 "doc")) ; all documentation
1101 (arguments
1102 `(;; There are many test failures. Some are known to
1103 ;; fail upstream, others relate to not having an X
1104 ;; server running at test time, yet others are a
1105 ;; complete mystery to me.
1106
1107 ;; hotspot: passed: 241; failed: 45; error: 2
1108 ;; langtools: passed: 1,934; failed: 26
1109 ;; jdk: unknown
1110 #:tests? #f
1111
1112 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
1113 ;; gremlin) doesn't support it yet, so skip this phase.
1114 #:validate-runpath? #f
1115
1116 ;; Apparently, the C locale is needed for some of the tests.
1117 #:locale "C"
1118
1119 #:modules ((guix build utils)
1120 (guix build gnu-build-system)
1121 (ice-9 match)
1122 (ice-9 popen)
1123 (srfi srfi-19)
1124 (srfi srfi-26))
1125
1126 #:configure-flags
1127 ;; TODO: package pcsc and sctp, and add to inputs
1128 `("--disable-system-pcsc"
1129 "--disable-system-sctp"
1130 "--enable-bootstrap"
1131 "--enable-nss"
1132 "--without-rhino"
1133 "--disable-downloading"
1134 "--disable-tests" ;they are run in the check phase instead
1135 "--with-openjdk-src-dir=./openjdk.src"
1136 ,(string-append "--with-jdk-home="
1137 (assoc-ref %build-inputs "jdk")))
1138
1139 #:phases
1140 (modify-phases %standard-phases
1141 (replace 'unpack
1142 (lambda* (#:key source inputs #:allow-other-keys)
1143 (let ((target (string-append "icedtea-" ,version))
1144 (unpack (lambda* (name #:optional dir)
1145 (let ((dir (or dir
1146 (string-drop-right name 5))))
1147 (mkdir dir)
1148 (zero? (system* "tar" "xvf"
1149 (assoc-ref inputs name)
1150 "-C" dir
1151 "--strip-components=1"))))))
1152 (mkdir target)
1153 (and
1154 (zero? (system* "tar" "xvf" source
1155 "-C" target "--strip-components=1"))
1156 (chdir target)
1157 (unpack "openjdk-src" "openjdk.src")
1158 (with-directory-excursion "openjdk.src"
1159 (for-each unpack
1160 (filter (cut string-suffix? "-drop" <>)
1161 (map (match-lambda
1162 ((name . _) name))
1163 inputs))))
1164 #t))))
1165 (add-after 'unpack 'fix-x11-extension-include-path
1166 (lambda* (#:key inputs #:allow-other-keys)
1167 (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
1168 (((string-append "\\$\\(firstword \\$\\(wildcard "
1169 "\\$\\(OPENWIN_HOME\\)"
1170 "/include/X11/extensions\\).*$"))
1171 (string-append (assoc-ref inputs "libxrender")
1172 "/include/X11/extensions"
1173 " -I" (assoc-ref inputs "libxtst")
1174 "/include/X11/extensions"
1175 " -I" (assoc-ref inputs "libxinerama")
1176 "/include/X11/extensions"))
1177 (("\\$\\(wildcard /usr/include/X11/extensions\\)\\)") ""))
1178 #t))
1179 (add-after 'unpack 'patch-paths
1180 (lambda _
1181 ;; buildtree.make generates shell scripts, so we need to replace
1182 ;; the generated shebang
1183 (substitute* '("openjdk.src/hotspot/make/linux/makefiles/buildtree.make")
1184 (("/bin/sh") (which "bash")))
1185
1186 (let ((corebin (string-append
1187 (assoc-ref %build-inputs "coreutils") "/bin/"))
1188 (binbin (string-append
1189 (assoc-ref %build-inputs "binutils") "/bin/"))
1190 (grepbin (string-append
1191 (assoc-ref %build-inputs "grep") "/bin/")))
1192 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
1193 "openjdk.src/corba/make/common/shared/Defs-linux.gmk")
1194 (("UNIXCOMMAND_PATH = /bin/")
1195 (string-append "UNIXCOMMAND_PATH = " corebin))
1196 (("USRBIN_PATH = /usr/bin/")
1197 (string-append "USRBIN_PATH = " corebin))
1198 (("DEVTOOLS_PATH *= */usr/bin/")
1199 (string-append "DEVTOOLS_PATH = " corebin))
1200 (("COMPILER_PATH *= */usr/bin/")
1201 (string-append "COMPILER_PATH = "
1202 (assoc-ref %build-inputs "gcc") "/bin/"))
1203 (("DEF_OBJCOPY *=.*objcopy")
1204 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
1205
1206 ;; fix path to alsa header
1207 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
1208 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
1209 (string-append "ALSA_INCLUDE="
1210 (assoc-ref %build-inputs "alsa-lib")
1211 "/include/alsa/version.h")))
1212
1213 ;; fix hard-coded utility paths
1214 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-utils.gmk"
1215 "openjdk.src/corba/make/common/shared/Defs-utils.gmk")
1216 (("ECHO *=.*echo")
1217 (string-append "ECHO = " (which "echo")))
1218 (("^GREP *=.*grep")
1219 (string-append "GREP = " (which "grep")))
1220 (("EGREP *=.*egrep")
1221 (string-append "EGREP = " (which "egrep")))
1222 (("CPIO *=.*cpio")
1223 (string-append "CPIO = " (which "cpio")))
1224 (("READELF *=.*readelf")
1225 (string-append "READELF = " (which "readelf")))
1226 (("^ *AR *=.*ar")
1227 (string-append "AR = " (which "ar")))
1228 (("^ *TAR *=.*tar")
1229 (string-append "TAR = " (which "tar")))
1230 (("AS *=.*as")
1231 (string-append "AS = " (which "as")))
1232 (("LD *=.*ld")
1233 (string-append "LD = " (which "ld")))
1234 (("STRIP *=.*strip")
1235 (string-append "STRIP = " (which "strip")))
1236 (("NM *=.*nm")
1237 (string-append "NM = " (which "nm")))
1238 (("^SH *=.*sh")
1239 (string-append "SH = " (which "bash")))
1240 (("^FIND *=.*find")
1241 (string-append "FIND = " (which "find")))
1242 (("LDD *=.*ldd")
1243 (string-append "LDD = " (which "ldd")))
1244 (("NAWK *=.*(n|g)awk")
1245 (string-append "NAWK = " (which "gawk")))
1246 (("XARGS *=.*xargs")
1247 (string-append "XARGS = " (which "xargs")))
1248 (("UNZIP *=.*unzip")
1249 (string-append "UNZIP = " (which "unzip")))
1250 (("ZIPEXE *=.*zip")
1251 (string-append "ZIPEXE = " (which "zip")))
1252 (("SED *=.*sed")
1253 (string-append "SED = " (which "sed"))))
1254
1255 ;; Some of these timestamps cause problems as they are more than
1256 ;; 10 years ago, failing the build process.
1257 (substitute*
1258 "openjdk.src/jdk/src/share/classes/java/util/CurrencyData.properties"
1259 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
1260 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
1261 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
1262 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY")))
1263 #t))
1264 (add-before 'configure 'set-additional-paths
1265 (lambda* (#:key inputs #:allow-other-keys)
1266 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
1267 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
1268 (string-append "ALSA_INCLUDE="
1269 (assoc-ref inputs "alsa-lib")
1270 "/include/alsa/version.h")))
1271 (setenv "CC" "gcc")
1272 (setenv "CPATH"
1273 (string-append (assoc-ref inputs "libxcomposite")
1274 "/include/X11/extensions" ":"
1275 (assoc-ref inputs "libxrender")
1276 "/include/X11/extensions" ":"
1277 (assoc-ref inputs "libxtst")
1278 "/include/X11/extensions" ":"
1279 (assoc-ref inputs "libxinerama")
1280 "/include/X11/extensions" ":"
1281 (or (getenv "CPATH") "")))
1282 (setenv "ALT_OBJCOPY" (which "objcopy"))
1283 (setenv "ALT_CUPS_HEADERS_PATH"
1284 (string-append (assoc-ref inputs "cups")
1285 "/include"))
1286 (setenv "ALT_FREETYPE_HEADERS_PATH"
1287 (string-append (assoc-ref inputs "freetype")
1288 "/include"))
1289 (setenv "ALT_FREETYPE_LIB_PATH"
1290 (string-append (assoc-ref inputs "freetype")
1291 "/lib"))
1292 #t))
1293 (add-before 'check 'fix-test-framework
1294 (lambda _
1295 ;; Fix PATH in test environment
1296 (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
1297 (("PATH=/bin:/usr/bin")
1298 (string-append "PATH=" (getenv "PATH"))))
1299 (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
1300 (("/usr/bin/env") (which "env")))
1301 (substitute* "openjdk.src/hotspot/test/test_env.sh"
1302 (("/bin/rm") (which "rm"))
1303 (("/bin/cp") (which "cp"))
1304 (("/bin/mv") (which "mv")))
1305 #t))
1306 (add-before 'check 'fix-hotspot-tests
1307 (lambda _
1308 (with-directory-excursion "openjdk.src/hotspot/test/"
1309 (substitute* "jprt.config"
1310 (("PATH=\"\\$\\{path4sdk\\}\"")
1311 (string-append "PATH=" (getenv "PATH")))
1312 (("make=/usr/bin/make")
1313 (string-append "make=" (which "make"))))
1314 (substitute* '("runtime/6626217/Test6626217.sh"
1315 "runtime/7110720/Test7110720.sh")
1316 (("/bin/rm") (which "rm"))
1317 (("/bin/cp") (which "cp"))
1318 (("/bin/mv") (which "mv"))))
1319 #t))
1320 (add-before 'check 'fix-jdk-tests
1321 (lambda _
1322 (with-directory-excursion "openjdk.src/jdk/test/"
1323 (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
1324 (("/bin/pwd") (which "pwd")))
1325 (substitute* "com/sun/jdi/ShellScaffold.sh"
1326 (("/bin/kill") (which "kill")))
1327 (substitute* "start-Xvfb.sh"
1328 ;;(("/usr/bin/X11/Xvfb") (which "Xvfb"))
1329 (("/usr/bin/nohup") (which "nohup")))
1330 (substitute* "javax/security/auth/Subject/doAs/Test.sh"
1331 (("/bin/rm") (which "rm")))
1332 (substitute* "tools/launcher/MultipleJRE.sh"
1333 (("echo \"#!/bin/sh\"")
1334 (string-append "echo \"#!" (which "rm") "\""))
1335 (("/usr/bin/zip") (which "zip")))
1336 (substitute* "com/sun/jdi/OnThrowTest.java"
1337 (("#!/bin/sh") (string-append "#!" (which "sh"))))
1338 (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
1339 (("/usr/bin/uptime") (which "uptime")))
1340 (substitute* "java/lang/ProcessBuilder/Basic.java"
1341 (("/usr/bin/env") (which "env"))
1342 (("/bin/false") (which "false"))
1343 (("/bin/true") (which "true"))
1344 (("/bin/cp") (which "cp"))
1345 (("/bin/sh") (which "sh")))
1346 (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
1347 (("/bin/sh") (which "sh")))
1348 (substitute* "java/lang/ProcessBuilder/Zombies.java"
1349 (("/usr/bin/perl") (which "perl"))
1350 (("/bin/ps") (which "ps"))
1351 (("/bin/true") (which "true")))
1352 (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
1353 (("/usr/bin/tee") (which "tee")))
1354 (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
1355 (("/bin/true") (which "true")))
1356 (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
1357 (("/bin/cat") (which "cat")))
1358 (substitute* "java/lang/Runtime/exec/ExitValue.java"
1359 (("/bin/sh") (which "sh"))
1360 (("/bin/true") (which "true"))
1361 (("/bin/kill") (which "kill")))
1362 (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
1363 (("/usr/bin/echo") (which "echo")))
1364 (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
1365 (("/usr/bin/cat") (which "cat")))
1366 (substitute* "java/lang/Runtime/exec/SleepyCat.java"
1367 (("/bin/cat") (which "cat"))
1368 (("/bin/sleep") (which "sleep"))
1369 (("/bin/sh") (which "sh")))
1370 (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
1371 (("/bin/cat") (which "cat")))
1372 (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
1373 (("/bin/chmod") (which "chmod")))
1374 (substitute* "java/util/zip/ZipFile/Assortment.java"
1375 (("/bin/sh") (which "sh"))))
1376 #t))
1377 (replace 'check
1378 (lambda _
1379 ;; The "make check-*" targets always return zero, so we need to
1380 ;; check for errors in the associated log files to determine
1381 ;; whether any tests have failed.
1382 (use-modules (ice-9 rdelim))
1383 (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
1384 (checker (lambda (port)
1385 (let loop ()
1386 (let ((line (read-line port)))
1387 (cond
1388 ((eof-object? line) #t)
1389 ((regexp-exec error-pattern line) #f)
1390 (else (loop)))))))
1391 (run-test (lambda (test)
1392 (system* "make" test)
1393 (call-with-input-file
1394 (string-append "test/" test ".log")
1395 checker))))
1396 (or #t ; skip tests
1397 (and (run-test "check-hotspot")
1398 (run-test "check-langtools")
1399 (run-test "check-jdk"))))))
1400 (replace 'install
1401 (lambda* (#:key outputs #:allow-other-keys)
1402 (let ((doc (string-append (assoc-ref outputs "doc")
1403 "/share/doc/icedtea"))
1404 (jre (assoc-ref outputs "out"))
1405 (jdk (assoc-ref outputs "jdk")))
1406 (copy-recursively "openjdk.build/docs" doc)
1407 (copy-recursively "openjdk.build/j2re-image" jre)
1408 (copy-recursively "openjdk.build/j2sdk-image" jdk))
1409 #t))
1410 ;; Some of the libraries in the lib/amd64 folder link to libjvm.so.
1411 ;; But that shared object is located in the server/ folder, so it
1412 ;; cannot be found. This phase creates a symbolic link in the
1413 ;; lib/amd64 folder so that the other libraries can find it.
1414 ;;
1415 ;; See:
1416 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1417 ;;
1418 ;; FIXME: Find the bug in the build system, so that this symlink is
1419 ;; not needed.
1420 (add-after 'install 'install-libjvm
1421 (lambda* (#:key inputs outputs #:allow-other-keys)
1422 (let* ((lib-path (string-append (assoc-ref outputs "out")
1423 "/lib/amd64")))
1424 (symlink (string-append lib-path "/server/libjvm.so")
1425 (string-append lib-path "/libjvm.so")))
1426 #t))
1427 ;; By default IcedTea only generates an empty keystore. In order to
1428 ;; be able to use certificates in Java programs we need to generate a
1429 ;; keystore from a set of certificates. For convenience we use the
1430 ;; certificates from the nss-certs package.
1431 (add-after 'install 'install-keystore
1432 (lambda* (#:key inputs outputs #:allow-other-keys)
1433 (let* ((keystore "cacerts")
1434 (certs-dir (string-append (assoc-ref inputs "nss-certs")
1435 "/etc/ssl/certs"))
1436 (keytool (string-append (assoc-ref outputs "jdk")
1437 "/bin/keytool")))
1438 (define (extract-cert file target)
1439 (call-with-input-file file
1440 (lambda (in)
1441 (call-with-output-file target
1442 (lambda (out)
1443 (let loop ((line (read-line in 'concat))
1444 (copying? #f))
1445 (cond
1446 ((eof-object? line) #t)
1447 ((string-prefix? "-----BEGIN" line)
1448 (display line out)
1449 (loop (read-line in 'concat) #t))
1450 ((string-prefix? "-----END" line)
1451 (display line out)
1452 #t)
1453 (else
1454 (when copying? (display line out))
1455 (loop (read-line in 'concat) copying?)))))))))
1456 (define (import-cert cert)
1457 (format #t "Importing certificate ~a\n" (basename cert))
1458 (let ((temp "tmpcert"))
1459 (extract-cert cert temp)
1460 (let ((port (open-pipe* OPEN_WRITE keytool
1461 "-import"
1462 "-alias" (basename cert)
1463 "-keystore" keystore
1464 "-storepass" "changeit"
1465 "-file" temp)))
1466 (display "yes\n" port)
1467 (when (not (zero? (status:exit-val (close-pipe port))))
1468 (format #t "failed to import ~a\n" cert)))
1469 (delete-file temp)))
1470
1471 ;; This is necessary because the certificate directory contains
1472 ;; files with non-ASCII characters in their names.
1473 (setlocale LC_ALL "en_US.utf8")
1474 (setenv "LC_ALL" "en_US.utf8")
1475
1476 (for-each import-cert (find-files certs-dir "\\.pem$"))
1477 (mkdir-p (string-append (assoc-ref outputs "out")
1478 "/lib/security"))
1479 (mkdir-p (string-append (assoc-ref outputs "jdk")
1480 "/jre/lib/security"))
1481
1482 ;; The cacerts files we are going to overwrite are chmod'ed as
1483 ;; read-only (444) in icedtea-8 (which derives from this
1484 ;; package). We have to change this so we can overwrite them.
1485 (chmod (string-append (assoc-ref outputs "out")
1486 "/lib/security/" keystore) #o644)
1487 (chmod (string-append (assoc-ref outputs "jdk")
1488 "/jre/lib/security/" keystore) #o644)
1489
1490 (install-file keystore
1491 (string-append (assoc-ref outputs "out")
1492 "/lib/security"))
1493 (install-file keystore
1494 (string-append (assoc-ref outputs "jdk")
1495 "/jre/lib/security"))
1496 #t))))))
1497 (native-inputs
1498 `(("openjdk-src"
1499 ,(drop "openjdk"
1500 "1zhr4l9kxnbzghcsgjk3vmih9qpg1wrr9qry7fx04l97svp1ylhd"))
1501 ("corba-drop"
1502 ,(drop "corba"
1503 "108v15ncb2rnsyzgzncjlm1f57d1sv60zd9qbpas8kqmvpp8r0gz"))
1504 ("jaxp-drop"
1505 ,(drop "jaxp"
1506 "0zcpcmm3g1s7m31glrbw3ys7azi97ixcvbyxd40y9xzdja3jyr52"))
1507 ("jaxws-drop"
1508 ,(drop "jaxws"
1509 "1gkqm0p3sr8d0xpki3fhf7cvmgqxx8ambgl5f3jx2plfnhsg96d2"))
1510 ("jdk-drop"
1511 ,(drop "jdk"
1512 "1d9fjnzdx4m6gwkvmj2n097ag0mvkhm3lldaxjki8x8c6a5clknf"))
1513 ("langtools-drop"
1514 ,(drop "langtools"
1515 "0zscdp9arcq7gr8j7jq4m75gq0w1i3ryxpdnrc8fl0msh4w2s2k5"))
1516 ("hotspot-drop"
1517 ,(drop "hotspot"
1518 "1y6vnssn5y50x27g4ypdb5wwpmi7zf7jdi8gqbymkwf6n8p5y1d6"))
1519 ("ant" ,ant-bootstrap)
1520 ("attr" ,attr)
1521 ("coreutils" ,coreutils)
1522 ("diffutils" ,diffutils) ;for tests
1523 ("gawk" ,gawk)
1524 ("grep" ,grep)
1525 ("libtool" ,libtool)
1526 ("pkg-config" ,pkg-config)
1527 ("wget" ,wget)
1528 ("which" ,which)
1529 ("cpio" ,cpio)
1530 ("zip" ,zip)
1531 ("unzip" ,unzip)
1532 ("fastjar" ,fastjar)
1533 ("libxslt" ,libxslt) ;for xsltproc
1534 ("nss-certs" ,nss-certs)
1535 ("perl" ,perl)
1536 ("procps" ,procps) ;for "free", even though I'm not sure we should use it
1537 ("jdk" ,icedtea-6 "jdk")))
1538 (inputs
1539 `(("alsa-lib" ,alsa-lib)
1540 ("cups" ,cups)
1541 ("libx11" ,libx11)
1542 ("libxcomposite" ,libxcomposite)
1543 ("libxt" ,libxt)
1544 ("libxtst" ,libxtst)
1545 ("libxi" ,libxi)
1546 ("libxinerama" ,libxinerama)
1547 ("libxrender" ,libxrender)
1548 ("libjpeg" ,libjpeg)
1549 ("libpng" ,libpng)
1550 ("mit-krb5" ,mit-krb5)
1551 ("nss" ,nss)
1552 ("giflib" ,giflib)
1553 ("fontconfig" ,fontconfig)
1554 ("freetype" ,freetype)
1555 ("lcms" ,lcms)
1556 ("zlib" ,zlib)
1557 ("gtk" ,gtk+-2)))
1558 (home-page "http://icedtea.classpath.org")
1559 (synopsis "Java development kit")
1560 (description
1561 "This package provides the Java development kit OpenJDK built with the
1562 IcedTea build harness.")
1563 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
1564 ;; same license as both GNU Classpath and OpenJDK.
1565 (license license:gpl2+))))
1566
1567 (define-public icedtea-8
1568 (let* ((version "3.6.0")
1569 (drop (lambda (name hash)
1570 (origin
1571 (method url-fetch)
1572 (uri (string-append
1573 "http://icedtea.classpath.org/download/drops"
1574 "/icedtea8/" version "/" name ".tar.xz"))
1575 (sha256 (base32 hash))))))
1576 (package (inherit icedtea-7)
1577 (version "3.6.0")
1578 (source (origin
1579 (method url-fetch)
1580 (uri (string-append
1581 "http://icedtea.wildebeest.org/download/source/icedtea-"
1582 version ".tar.xz"))
1583 (sha256
1584 (base32
1585 "0zj192zrrxqh6j1ywc3399gk2ycay9w8pvzcvvr2kvdkb37ak86h"))
1586 (modules '((guix build utils)))
1587 (snippet
1588 '(begin
1589 (substitute* "acinclude.m4"
1590 ;; Do not embed build time
1591 (("(DIST_ID=\"Custom build).*$" _ prefix)
1592 (string-append prefix "\"\n"))
1593 ;; Do not leak information about the build host
1594 (("DIST_NAME=\"\\$build_os\"")
1595 "DIST_NAME=\"guix\""))
1596 #t))))
1597 (arguments
1598 (substitute-keyword-arguments (package-arguments icedtea-7)
1599 ((#:configure-flags flags)
1600 `(let ((jdk (assoc-ref %build-inputs "jdk")))
1601 `(;;"--disable-bootstrap"
1602 "--enable-bootstrap"
1603 "--enable-nss"
1604 "--disable-downloading"
1605 "--disable-system-pcsc"
1606 "--disable-system-sctp"
1607 "--disable-tests" ;they are run in the check phase instead
1608 "--with-openjdk-src-dir=./openjdk.src"
1609 ,(string-append "--with-jdk-home=" jdk))))
1610 ((#:phases phases)
1611 `(modify-phases ,phases
1612 (delete 'fix-x11-extension-include-path)
1613 (delete 'patch-paths)
1614 (delete 'set-additional-paths)
1615 (delete 'patch-patches)
1616 (add-after 'unpack 'patch-jni-libs
1617 ;; Hardcode dynamically loaded libraries.
1618 (lambda _
1619 (let* ((library-path (search-path-as-string->list
1620 (getenv "LIBRARY_PATH")))
1621 (find-library (lambda (name)
1622 (search-path
1623 library-path
1624 (string-append "lib" name ".so")))))
1625 (for-each
1626 (lambda (file)
1627 (catch 'decoding-error
1628 (lambda ()
1629 (substitute* file
1630 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
1631 _ name version)
1632 (format #f "\"~a\"" (find-library name)))
1633 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
1634 (format #f "\"~a\"" (find-library name)))))
1635 (lambda _
1636 ;; Those are safe to skip.
1637 (format (current-error-port)
1638 "warning: failed to substitute: ~a~%"
1639 file))))
1640 (find-files "openjdk.src/jdk/src/solaris/native"
1641 "\\.c|\\.h"))
1642 #t)))
1643 (replace 'install
1644 (lambda* (#:key outputs #:allow-other-keys)
1645 (let ((doc (string-append (assoc-ref outputs "doc")
1646 "/share/doc/icedtea"))
1647 (jre (assoc-ref outputs "out"))
1648 (jdk (assoc-ref outputs "jdk")))
1649 (copy-recursively "openjdk.build/docs" doc)
1650 (copy-recursively "openjdk.build/images/j2re-image" jre)
1651 (copy-recursively "openjdk.build/images/j2sdk-image" jdk)
1652 ;; Install the nss.cfg file to JRE to enable SSL/TLS
1653 ;; support via NSS.
1654 (copy-file (string-append jdk "/jre/lib/security/nss.cfg")
1655 (string-append jre "/lib/security/nss.cfg"))
1656 #t)))))))
1657 (native-inputs
1658 `(("jdk" ,icedtea-7 "jdk")
1659 ("openjdk-src"
1660 ,(drop "openjdk"
1661 "0mqxh81kq05z4wydkik0yrr81ibf84xmwsdcw9n2gfrzs4f5jxnb"))
1662 ("aarch32-drop"
1663 ,(drop "aarch32"
1664 "0b207g2n6kn510zf5vwh58bsxgqrmkvrna4p20r74v9cwcwx83n2"))
1665 ("corba-drop"
1666 ,(drop "corba"
1667 "0qinc1q4w01nkr9klhfyd8caxvyrrfxjrz32nd7kgyja2bj8x7dd"))
1668 ("jaxp-drop"
1669 ,(drop "jaxp"
1670 "07azrp3g86vk2laybmr5xfn0yrljkxs0rlm1q48385br225bgdxi"))
1671 ("jaxws-drop"
1672 ,(drop "jaxws"
1673 "018fd2hq57zp3pq06wlxy5pabqcyk36xi8hk0d6xk3a90wsjvyik"))
1674 ("jdk-drop"
1675 ,(drop "jdk"
1676 "0vs488kq5j2cc6kplc78jbhfxwq4fn06l34xrbq4d6y17777arg8"))
1677 ("langtools-drop"
1678 ,(drop "langtools"
1679 "04f6d1wvck5jrpvrcw5gsbzxnihcry9zrf1v85czdm959q21zv9c"))
1680 ("hotspot-drop"
1681 ,(drop "hotspot"
1682 "1mfgpzyr6zzy9klf8nn3z6d41fydb9ghpfpqzjq3cl95axfbdl1g"))
1683 ("nashorn-drop"
1684 ,(drop "nashorn"
1685 "1a26cmzbs50gkh4rmmmxls7zljx62vfp1wq02gsfd5jqs4xvlibj"))
1686 ("shenandoah-drop"
1687 ,(drop "shenandoah"
1688 "11hmn9mwmvryfddcanzx3qffjm8bbiv18nwv3iy9cswrvxjy010f"))
1689 ,@(fold alist-delete (package-native-inputs icedtea-7)
1690 '("jdk" "openjdk-src" "corba-drop" "jaxp-drop" "jaxws-drop"
1691 "jdk-drop" "langtools-drop" "hotspot-drop")))))))
1692
1693 (define-public icedtea icedtea-7)
1694
1695 \f
1696 (define-public ant/java8
1697 (package (inherit ant-bootstrap)
1698 (name "ant")
1699 (version "1.10.1")
1700 (source (origin
1701 (method url-fetch)
1702 (uri (string-append "mirror://apache/ant/source/apache-ant-"
1703 version "-src.tar.gz"))
1704 (sha256
1705 (base32
1706 "10p3dh77lkzzzcy32dk9azljixzadp46fggjfbvgkl8mmb8cxxv8"))
1707 (modules '((guix build utils)))
1708 (snippet
1709 '(begin
1710 (for-each delete-file
1711 (find-files "lib/optional" "\\.jar$"))
1712 #t))))
1713 (arguments
1714 (substitute-keyword-arguments (package-arguments ant-bootstrap)
1715 ((#:phases phases)
1716 `(modify-phases ,phases
1717 (add-after 'unpack 'remove-scripts
1718 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
1719 ;; wrappers.
1720 (lambda _
1721 (for-each delete-file
1722 (find-files "src/script"
1723 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))
1724 #t))
1725 (replace 'build
1726 (lambda* (#:key inputs outputs #:allow-other-keys)
1727 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
1728
1729 ;; Disable tests to avoid dependency on hamcrest-core, which needs
1730 ;; Ant to build. This is necessary in addition to disabling the
1731 ;; "check" phase, because the dependency on "test-jar" would always
1732 ;; result in the tests to be run.
1733 (substitute* "build.xml"
1734 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
1735 (zero? (system* "bash" "bootstrap.sh"
1736 (string-append "-Ddist.dir="
1737 (assoc-ref outputs "out"))))))))))
1738 (native-inputs
1739 `(("jdk" ,icedtea-8 "jdk")))))
1740
1741 ;; The 1.9.x series is the last that can be built with GCJ. The 1.10.x series
1742 ;; requires Java 8.
1743 (define-public ant
1744 (package (inherit ant/java8)
1745 (version "1.9.9")
1746 (source (origin
1747 (method url-fetch)
1748 (uri (string-append "mirror://apache/ant/source/apache-ant-"
1749 version "-src.tar.gz"))
1750 (sha256
1751 (base32
1752 "1k28mka0m3isy9yr8gz84kz1f3f879rwaxrd44vdn9xbfwvwk86n"))))
1753 (native-inputs
1754 `(("jdk" ,icedtea-7 "jdk")))))
1755
1756 (define-public ant-apache-bcel
1757 (package
1758 (inherit ant/java8)
1759 (name "ant-apache-bcel")
1760 (arguments
1761 (substitute-keyword-arguments (package-arguments ant/java8)
1762 ((#:phases phases)
1763 `(modify-phases ,phases
1764 (add-after 'unpack 'link-bcel
1765 (lambda* (#:key inputs #:allow-other-keys)
1766 (for-each (lambda (file)
1767 (symlink file
1768 (string-append "lib/optional/"
1769 (basename file))))
1770 (find-files (assoc-ref inputs "java-commons-bcel")
1771 "\\.jar$"))
1772 #t))
1773 (add-after 'build 'install
1774 (lambda* (#:key outputs #:allow-other-keys)
1775 (let* ((out (assoc-ref outputs "out"))
1776 (share (string-append out "/share/java"))
1777 (bin (string-append out "/bin"))
1778 (lib (string-append out "/lib")))
1779 (mkdir-p share)
1780 (install-file (string-append lib "/ant-apache-bcel.jar") share)
1781 (delete-file-recursively bin)
1782 (delete-file-recursively lib)
1783 #t)))))))
1784 (inputs
1785 `(("java-commons-bcel" ,java-commons-bcel)
1786 ,@(package-inputs ant/java8)))))
1787
1788 (define-public clojure
1789 (let* ((remove-archives '(begin
1790 (for-each delete-file
1791 (find-files "." ".*\\.(jar|zip)"))
1792 #t))
1793 (submodule (lambda (prefix version hash)
1794 (origin
1795 (method url-fetch)
1796 (uri (string-append "https://github.com/clojure/"
1797 prefix version ".tar.gz"))
1798 (sha256 (base32 hash))
1799 (modules '((guix build utils)))
1800 (snippet remove-archives)))))
1801 (package
1802 (name "clojure")
1803 (version "1.8.0")
1804 (source
1805 (origin
1806 (method url-fetch)
1807 (uri
1808 (string-append "http://repo1.maven.org/maven2/org/clojure/clojure/"
1809 version "/clojure-" version ".zip"))
1810 (sha256
1811 (base32 "1nip095fz5c492sw15skril60i1vd21ibg6szin4jcvyy3xr6cym"))
1812 (modules '((guix build utils)))
1813 (snippet remove-archives)))
1814 (build-system ant-build-system)
1815 (arguments
1816 `(#:modules ((guix build ant-build-system)
1817 (guix build utils)
1818 (ice-9 ftw)
1819 (ice-9 regex)
1820 (srfi srfi-1)
1821 (srfi srfi-26))
1822 #:test-target "test"
1823 #:phases
1824 (modify-phases %standard-phases
1825 (add-after 'unpack 'unpack-submodule-sources
1826 (lambda* (#:key inputs #:allow-other-keys)
1827 (for-each
1828 (lambda (name)
1829 (mkdir-p name)
1830 (with-directory-excursion name
1831 (or (zero? (system* "tar"
1832 ;; Use xz for repacked tarball.
1833 "--xz"
1834 "--extract"
1835 "--verbose"
1836 "--file" (assoc-ref inputs name)
1837 "--strip-components=1"))
1838 (error "failed to unpack tarball" name)))
1839 (copy-recursively (string-append name "/src/main/clojure/")
1840 "src/clj/"))
1841 '("data-generators-src"
1842 "java-classpath-src"
1843 "test-check-src"
1844 "test-generative-src"
1845 "tools-namespace-src"
1846 "tools-reader-src"))
1847 #t))
1848 ;; The javadoc target is not built by default.
1849 (add-after 'build 'build-doc
1850 (lambda _
1851 (zero? (system* "ant" "javadoc"))))
1852 ;; Needed since no install target is provided.
1853 (replace 'install
1854 (lambda* (#:key outputs #:allow-other-keys)
1855 (let ((java-dir (string-append (assoc-ref outputs "out")
1856 "/share/java/")))
1857 ;; Install versioned to avoid collisions.
1858 (install-file (string-append "clojure-" ,version ".jar")
1859 java-dir)
1860 #t)))
1861 ;; Needed since no install-doc target is provided.
1862 (add-after 'install 'install-doc
1863 (lambda* (#:key outputs #:allow-other-keys)
1864 (let ((doc-dir (string-append (assoc-ref outputs "out")
1865 "/share/doc/clojure-"
1866 ,version "/")))
1867 (copy-recursively "doc/clojure" doc-dir)
1868 (copy-recursively "target/javadoc/"
1869 (string-append doc-dir "javadoc/"))
1870 (for-each (cut install-file <> doc-dir)
1871 (filter (cut string-match
1872 ".*\\.(html|markdown|md|txt)"
1873 <>)
1874 (scandir "./")))
1875 #t))))))
1876 ;; The native-inputs below are needed to run the tests.
1877 (native-inputs
1878 `(("data-generators-src"
1879 ,(submodule "data.generators/archive/data.generators-"
1880 "0.1.2"
1881 "0kki093jp4ckwxzfnw8ylflrfqs8b1i1wi9iapmwcsy328dmgzp1"))
1882 ("java-classpath-src"
1883 ,(submodule "java.classpath/archive/java.classpath-"
1884 "0.2.3"
1885 "0sjymly9xh1lkvwn5ygygpsfwz4dabblnlq0c9bx76rkvq62fyng"))
1886 ("test-check-src"
1887 ,(submodule "test.check/archive/test.check-"
1888 "0.9.0"
1889 "0p0mnyhr442bzkz0s4k5ra3i6l5lc7kp6ajaqkkyh4c2k5yck1md"))
1890 ("test-generative-src"
1891 ,(submodule "test.generative/archive/test.generative-"
1892 "0.5.2"
1893 "1pjafy1i7yblc7ixmcpfq1lfbyf3jaljvkgrajn70sws9xs7a9f8"))
1894 ("tools-namespace-src"
1895 ,(submodule "tools.namespace/archive/tools.namespace-"
1896 "0.2.11"
1897 "10baak8v0hnwz2hr33bavshm7y49mmn9zsyyms1dwjz45p5ymhy0"))
1898 ("tools-reader-src"
1899 ,(submodule "tools.reader/archive/tools.reader-"
1900 "1.0.0"
1901 "1lafblmmj4hkg0aqrf19qkdw9wdcsh3qxmn6cbkmnzbhffpyv2lv"))))
1902 (home-page "https://clojure.org/")
1903 (synopsis "Lisp dialect running on the JVM")
1904 (description "Clojure is a dynamic, general-purpose programming language,
1905 combining the approachability and interactive development of a scripting
1906 language with an efficient and robust infrastructure for multithreaded
1907 programming. Clojure is a compiled language, yet remains completely dynamic
1908 – every feature supported by Clojure is supported at runtime. Clojure
1909 provides easy access to the Java frameworks, with optional type hints and type
1910 inference, to ensure that calls to Java can avoid reflection.
1911
1912 Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy
1913 and a powerful macro system. Clojure is predominantly a functional programming
1914 language, and features a rich set of immutable, persistent data structures.
1915 When mutable state is needed, Clojure offers a software transactional memory
1916 system and reactive Agent system that ensure clean, correct, multithreaded
1917 designs.")
1918 ;; Clojure is licensed under EPL1.0
1919 ;; ASM bytecode manipulation library is licensed under BSD-3
1920 ;; Guava Murmur3 hash implementation is licensed under APL2.0
1921 ;; src/clj/repl.clj is licensed under CPL1.0
1922 ;;
1923 ;; See readme.html or readme.txt for details.
1924 (license (list license:epl1.0
1925 license:bsd-3
1926 license:asl2.0
1927 license:cpl1.0)))))
1928
1929 (define-public javacc
1930 (package
1931 (name "javacc")
1932 (version "7.0.3")
1933 (source (origin
1934 (method url-fetch)
1935 (uri (string-append "https://github.com/javacc/javacc/"
1936 "archive/" version ".tar.gz"))
1937 (file-name (string-append "javacc-" version ".tar.gz"))
1938 (sha256
1939 (base32
1940 "111xc9mnmc5a6qz6x3xbhqc07y1lg2b996ggzw0hrblg42zya9xf"))))
1941 (build-system ant-build-system)
1942 (arguments
1943 `(#:test-target "test"
1944 #:phases
1945 (modify-phases %standard-phases
1946 (add-after 'unpack 'delete-bundled-libs
1947 (lambda _
1948 (delete-file-recursively "lib") #t))
1949 (replace 'install (install-jars "target")))))
1950 (home-page "https://javacc.org/")
1951 (synopsis "Java parser generator")
1952 (description "Java Compiler Compiler (JavaCC) is the most popular parser
1953 generator for use with Java applications. A parser generator is a tool that
1954 reads a grammar specification and converts it to a Java program that can
1955 recognize matches to the grammar. In addition to the parser generator itself,
1956 JavaCC provides other standard capabilities related to parser generation such
1957 as tree building (via a tool called JJTree included with JavaCC), actions,
1958 debugging, etc.")
1959 (license license:bsd-3)))
1960
1961 (define-public javacc-4
1962 (package (inherit javacc)
1963 (version "4.1")
1964 (source (origin
1965 (method git-fetch)
1966 (uri (git-reference
1967 (url "https://github.com/javacc/javacc.git")
1968 (commit "release_41")))
1969 (file-name (string-append "javacc-" version "-checkout"))
1970 (sha256
1971 (base32
1972 "07ysav7j8r1c6h8qxrgqk6lwdp74ly0ad1935lragxml0qqc3ka0"))))
1973 ;; Tests fail with
1974 ;; /tmp/guix-build-javacc-4.1.drv-0/source/test/javacodeLA/build.xml:60:
1975 ;; JAVACODE failed
1976 (arguments
1977 `(#:tests? #f
1978 #:phases
1979 (modify-phases %standard-phases
1980 (add-after 'unpack 'delete-bundled-libs
1981 (lambda _
1982 (delete-file-recursively "lib") #t))
1983 (replace 'install (install-jars "bin/lib")))))))
1984
1985 (define-public java-classpathx-servletapi
1986 (package
1987 (name "java-classpathx-servletapi")
1988 (version "3.0")
1989 (source (origin
1990 (method url-fetch)
1991 (uri (string-append "mirror://gnu/classpathx/servletapi/"
1992 "servletapi-" version ".tar.gz"))
1993 (sha256
1994 (base32
1995 "0y9489pk4as9q6x300sk3ycc0psqfxcd4b0xvbmf3rhgli8q1kx3"))))
1996 (build-system ant-build-system)
1997 (arguments
1998 `(#:tests? #f ; there is no test target
1999 #:build-target "compile"
2000 ;; NOTE: This package does not build with Java 8 because of a type
2001 ;; mismatch in
2002 ;; "source/javax/servlet/jsp/el/ImplicitObjectELResolver.java". It
2003 ;; defines the return value of ScopeMap's "remove" method to be of type
2004 ;; "Object", whereas Map's "remove" method returns boolean.
2005 #:make-flags
2006 (list "-Dbuild.compiler=javac1.7"
2007 (string-append "-Ddist=" (assoc-ref %outputs "out")))
2008 #:phases
2009 (modify-phases %standard-phases
2010 (replace 'install
2011 (lambda* (#:key make-flags #:allow-other-keys)
2012 (zero? (apply system* `("ant" "dist" ,@make-flags))))))))
2013 (home-page "https://www.gnu.org/software/classpathx/")
2014 (synopsis "Java servlet API implementation")
2015 (description "This is the GNU servlet API distribution, part of the
2016 ClasspathX project. It provides implementations of version 3.0 of the servlet
2017 API and version 2.1 of the Java ServerPages API.")
2018 (license license:gpl3+)))
2019
2020 (define-public java-swt
2021 (package
2022 (name "java-swt")
2023 (version "4.7.1a")
2024 (source
2025 ;; The types of many variables and procedures differ in the sources
2026 ;; dependent on whether the target architecture is a 32-bit system or a
2027 ;; 64-bit system. Instead of patching the sources on demand in a build
2028 ;; phase we download either the 32-bit archive (which mostly uses "int"
2029 ;; types) or the 64-bit archive (which mostly uses "long" types).
2030 (let ((hash32 "09q0cbh90d90q3a7dx9430kc4m6bijrkr4lajrmzzvi0jjdpq4v9")
2031 (hash64 "17k5hs75a87ssmc5xhwdfdm2gn4zba0r837l2455za01krnkaa2q")
2032 (file32 "x86")
2033 (file64 "x86_64"))
2034 (let-values (((hash file)
2035 (match (or (%current-target-system) (%current-system))
2036 ("x86_64-linux" (values hash64 file64))
2037 (_ (values hash32 file32)))))
2038 (origin
2039 (method url-fetch)
2040 (uri (string-append
2041 "http://download.eclipse.org/eclipse/downloads/drops4/"
2042 "R-" version "-201710090410/swt-" version
2043 "-gtk-linux-" file ".zip"))
2044 (sha256 (base32 hash))))))
2045 (build-system ant-build-system)
2046 (arguments
2047 `(#:jar-name "swt.jar"
2048 #:jdk ,icedtea-8
2049 #:tests? #f ; no "check" target
2050 #:phases
2051 (modify-phases %standard-phases
2052 (replace 'unpack
2053 (lambda* (#:key source #:allow-other-keys)
2054 (and (mkdir "swt")
2055 (zero? (system* "unzip" source "-d" "swt"))
2056 (chdir "swt")
2057 (mkdir "src")
2058 (zero? (system* "unzip" "src.zip" "-d" "src")))))
2059 ;; The classpath contains invalid icecat jars. Since we don't need
2060 ;; anything other than the JDK on the classpath, we can simply unset
2061 ;; it.
2062 (add-after 'configure 'unset-classpath
2063 (lambda _ (unsetenv "CLASSPATH") #t))
2064 (add-before 'build 'build-native
2065 (lambda* (#:key inputs outputs #:allow-other-keys)
2066 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
2067 ;; Build shared libraries. Users of SWT have to set the system
2068 ;; property swt.library.path to the "lib" directory of this
2069 ;; package output.
2070 (mkdir-p lib)
2071 (setenv "OUTPUT_DIR" lib)
2072 (with-directory-excursion "src"
2073 (zero? (system* "bash" "build.sh"))))))
2074 (add-after 'install 'install-native
2075 (lambda* (#:key outputs #:allow-other-keys)
2076 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
2077 (for-each (lambda (file)
2078 (install-file file lib))
2079 (find-files "." "\\.so$"))
2080 #t))))))
2081 (inputs
2082 `(("gtk" ,gtk+-2)
2083 ("libxtst" ,libxtst)
2084 ("libxt" ,libxt)
2085 ("mesa" ,mesa)
2086 ("glu" ,glu)))
2087 (native-inputs
2088 `(("pkg-config" ,pkg-config)
2089 ("unzip" ,unzip)))
2090 (home-page "https://www.eclipse.org/swt/")
2091 (synopsis "Widget toolkit for Java")
2092 (description
2093 "SWT is a widget toolkit for Java designed to provide efficient, portable
2094 access to the user-interface facilities of the operating systems on which it
2095 is implemented.")
2096 ;; SWT code is licensed under EPL1.0
2097 ;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
2098 ;; Cairo bindings contain code under MPL1.1
2099 ;; XULRunner 1.9 bindings contain code under MPL2.0
2100 (license (list
2101 license:epl1.0
2102 license:mpl1.1
2103 license:mpl2.0
2104 license:lgpl2.1+))))
2105
2106 (define-public java-xz
2107 (package
2108 (name "java-xz")
2109 (version "1.6")
2110 (source (origin
2111 (method url-fetch)
2112 (uri (string-append "http://tukaani.org/xz/xz-java-" version ".zip"))
2113 (sha256
2114 (base32
2115 "1z3p1ri1gvl07inxn0agx44ck8n7wrzfmvkz8nbq3njn8r9wba8x"))))
2116 (build-system ant-build-system)
2117 (arguments
2118 `(#:tests? #f ; There are no tests to run.
2119 #:jar-name ,(string-append "xz-" version ".jar")
2120 #:phases
2121 (modify-phases %standard-phases
2122 ;; The unpack phase enters the "maven" directory by accident.
2123 (add-after 'unpack 'chdir
2124 (lambda _ (chdir "..") #t)))))
2125 (native-inputs
2126 `(("unzip" ,unzip)))
2127 (home-page "http://tukaani.org/xz/java.html")
2128 (synopsis "Implementation of XZ data compression in pure Java")
2129 (description "This library aims to be a complete implementation of XZ data
2130 compression in pure Java. Single-threaded streamed compression and
2131 decompression and random access decompression have been fully implemented.")
2132 (license license:public-domain)))
2133
2134 ;; java-hamcrest-core uses qdox version 1.12. We package this version instead
2135 ;; of the latest release.
2136 (define-public java-qdox-1.12
2137 (package
2138 (name "java-qdox")
2139 (version "1.12.1")
2140 (source (origin
2141 (method url-fetch)
2142 (uri (string-append "http://central.maven.org/maven2/"
2143 "com/thoughtworks/qdox/qdox/" version
2144 "/qdox-" version "-sources.jar"))
2145 (sha256
2146 (base32
2147 "0hlfbqq2avf5s26wxkksqmkdyk6zp9ggqn37c468m96mjv0n9xfl"))))
2148 (build-system ant-build-system)
2149 (arguments
2150 `(;; Tests require junit
2151 #:tests? #f
2152 #:jar-name "qdox.jar"
2153 #:phases
2154 (modify-phases %standard-phases
2155 (replace 'unpack
2156 (lambda* (#:key source #:allow-other-keys)
2157 (mkdir "src")
2158 (with-directory-excursion "src"
2159 (zero? (system* "jar" "-xf" source)))))
2160 ;; At this point we don't have junit, so we must remove the API
2161 ;; tests.
2162 (add-after 'unpack 'delete-tests
2163 (lambda _
2164 (delete-file-recursively "src/com/thoughtworks/qdox/junit")
2165 #t)))))
2166 (home-page "http://qdox.codehaus.org/")
2167 (synopsis "Parse definitions from Java source files")
2168 (description
2169 "QDox is a high speed, small footprint parser for extracting
2170 class/interface/method definitions from source files complete with JavaDoc
2171 @code{@@tags}. It is designed to be used by active code generators or
2172 documentation tools.")
2173 (license license:asl2.0)))
2174
2175 (define-public java-jarjar
2176 (package
2177 (name "java-jarjar")
2178 (version "1.4")
2179 (source (origin
2180 (method url-fetch)
2181 (uri (string-append
2182 "https://storage.googleapis.com/google-code-archive-downloads/v2/"
2183 "code.google.com/jarjar/jarjar-src-" version ".zip"))
2184 (sha256
2185 (base32
2186 "1v8irhni9cndcw1l1wxqgry013s2kpj0qqn57lj2ji28xjq8ndjl"))))
2187 (build-system ant-build-system)
2188 (arguments
2189 `(;; Tests require junit, which ultimately depends on this package.
2190 #:tests? #f
2191 #:build-target "jar"
2192 #:phases
2193 (modify-phases %standard-phases
2194 (replace 'install
2195 (lambda* (#:key outputs #:allow-other-keys)
2196 (let ((target (string-append (assoc-ref outputs "out")
2197 "/share/java")))
2198 (install-file (string-append "dist/jarjar-" ,version ".jar")
2199 target))
2200 #t)))))
2201 (native-inputs
2202 `(("unzip" ,unzip)))
2203 (home-page "https://code.google.com/archive/p/jarjar/")
2204 (synopsis "Repackage Java libraries")
2205 (description
2206 "Jar Jar Links is a utility that makes it easy to repackage Java
2207 libraries and embed them into your own distribution. Jar Jar Links includes
2208 an Ant task that extends the built-in @code{jar} task.")
2209 (license license:asl2.0)))
2210
2211 (define-public java-hamcrest-core
2212 (package
2213 (name "java-hamcrest-core")
2214 (version "1.3")
2215 (source (origin
2216 (method url-fetch)
2217 (uri (string-append "https://github.com/hamcrest/JavaHamcrest/"
2218 "archive/hamcrest-java-" version ".tar.gz"))
2219 (sha256
2220 (base32
2221 "11g0s105fmwzijbv08lx8jlb521yravjmxnpgdx08fvg1kjivhva"))
2222 (modules '((guix build utils)))
2223 (snippet
2224 '(begin
2225 ;; Delete bundled thirds-party jar archives.
2226 (delete-file-recursively "lib")
2227 #t))))
2228 (build-system ant-build-system)
2229 (arguments
2230 `(#:tests? #f ; Tests require junit
2231 #:modules ((guix build ant-build-system)
2232 (guix build utils)
2233 (srfi srfi-1))
2234 #:make-flags (list (string-append "-Dversion=" ,version))
2235 #:test-target "unit-test"
2236 #:build-target "core"
2237 #:phases
2238 (modify-phases %standard-phases
2239 ;; Disable unit tests, because they require junit, which requires
2240 ;; hamcrest-core. We also give a fixed value to the "Built-Date"
2241 ;; attribute from the manifest for reproducibility.
2242 (add-before 'configure 'patch-build.xml
2243 (lambda _
2244 (substitute* "build.xml"
2245 (("unit-test, ") "")
2246 (("\\$\\{build.timestamp\\}") "guix"))
2247 #t))
2248 ;; Java's "getMethods()" returns methods in an unpredictable order.
2249 ;; To make the output of the generated code deterministic we must
2250 ;; sort the array of methods.
2251 (add-after 'unpack 'make-method-order-deterministic
2252 (lambda _
2253 (substitute* "hamcrest-generator/src/main/java/org/hamcrest/generator/ReflectiveFactoryReader.java"
2254 (("import java\\.util\\.Iterator;" line)
2255 (string-append line "\n"
2256 "import java.util.Arrays; import java.util.Comparator;"))
2257 (("allMethods = cls\\.getMethods\\(\\);" line)
2258 (string-append "_" line
2259 "
2260 private Method[] getSortedMethods() {
2261 Arrays.sort(_allMethods, new Comparator<Method>() {
2262 @Override
2263 public int compare(Method a, Method b) {
2264 return a.toString().compareTo(b.toString());
2265 }
2266 });
2267 return _allMethods;
2268 }
2269
2270 private Method[] allMethods = getSortedMethods();")))))
2271 (add-before 'build 'do-not-use-bundled-qdox
2272 (lambda* (#:key inputs #:allow-other-keys)
2273 (substitute* "build.xml"
2274 (("lib/generator/qdox-1.12.jar")
2275 (string-append (assoc-ref inputs "java-qdox-1.12")
2276 "/share/java/qdox.jar")))
2277 #t))
2278 ;; build.xml searches for .jar files in this directoy, which
2279 ;; we remove from the source archive.
2280 (add-before 'build 'create-dummy-directories
2281 (lambda _
2282 (mkdir-p "lib/integration")
2283 #t))
2284 (replace 'install
2285 (lambda* (#:key outputs #:allow-other-keys)
2286 (let* ((target (string-append (assoc-ref outputs "out")
2287 "/share/java/"))
2288 (version-suffix ,(string-append "-" version ".jar"))
2289 (install-without-version-suffix
2290 (lambda (jar)
2291 (copy-file jar
2292 (string-append target
2293 (basename jar version-suffix)
2294 ".jar")))))
2295 (mkdir-p target)
2296 (for-each
2297 install-without-version-suffix
2298 (find-files "build"
2299 (lambda (name _)
2300 (and (string-suffix? ".jar" name)
2301 (not (string-suffix? "-sources.jar" name)))))))
2302 #t)))))
2303 (native-inputs
2304 `(("java-qdox-1.12" ,java-qdox-1.12)
2305 ("java-jarjar" ,java-jarjar)))
2306 (home-page "http://hamcrest.org/")
2307 (synopsis "Library of matchers for building test expressions")
2308 (description
2309 "This package provides a library of matcher objects (also known as
2310 constraints or predicates) allowing @code{match} rules to be defined
2311 declaratively, to be used in other frameworks. Typical scenarios include
2312 testing frameworks, mocking libraries and UI validation rules.")
2313 (license license:bsd-2)))
2314
2315 (define-public java-junit
2316 (package
2317 (name "java-junit")
2318 (version "4.12")
2319 (source (origin
2320 (method url-fetch)
2321 (uri (string-append "https://github.com/junit-team/junit/"
2322 "archive/r" version ".tar.gz"))
2323 (file-name (string-append name "-" version ".tar.gz"))
2324 (sha256
2325 (base32
2326 "090dn5v1vs0b3acyaqc0gjf6p8lmd2h24wfzsbq7sly6b214anws"))
2327 (modules '((guix build utils)))
2328 (snippet
2329 '(begin
2330 ;; Delete bundled jar archives.
2331 (delete-file-recursively "lib")
2332 #t))))
2333 (build-system ant-build-system)
2334 (arguments
2335 `(#:tests? #f ; no tests
2336 #:jar-name "junit.jar"))
2337 (inputs
2338 `(("java-hamcrest-core" ,java-hamcrest-core)))
2339 (home-page "http://junit.org/")
2340 (synopsis "Test framework for Java")
2341 (description
2342 "JUnit is a simple framework to write repeatable tests for Java projects.
2343 JUnit provides assertions for testing expected results, test fixtures for
2344 sharing common test data, and test runners for running tests.")
2345 (license license:epl1.0)))
2346
2347 (define-public java-plexus-utils
2348 (package
2349 (name "java-plexus-utils")
2350 (version "3.0.24")
2351 (source (origin
2352 (method url-fetch)
2353 (uri (string-append "https://github.com/codehaus-plexus/"
2354 "plexus-utils/archive/plexus-utils-"
2355 version ".tar.gz"))
2356 (sha256
2357 (base32
2358 "1mlwpc6fms24slygv5yvi6fi9hcha2fh0v73p5znpi78bg36i2js"))))
2359 (build-system ant-build-system)
2360 ;; FIXME: The default build.xml does not include a target to install
2361 ;; javadoc files.
2362 (arguments
2363 `(#:jar-name "plexus-utils.jar"
2364 #:source-dir "src/main"
2365 #:phases
2366 (modify-phases %standard-phases
2367 (add-after 'unpack 'fix-reference-to-/bin-and-/usr
2368 (lambda _
2369 (substitute* "src/main/java/org/codehaus/plexus/util/\
2370 cli/shell/BourneShell.java"
2371 (("/bin/sh") (which "sh"))
2372 (("/usr/") (getcwd)))
2373 #t))
2374 (add-after 'unpack 'fix-or-disable-broken-tests
2375 (lambda _
2376 (with-directory-excursion "src/test/java/org/codehaus/plexus/util"
2377 (substitute* '("cli/CommandlineTest.java"
2378 "cli/shell/BourneShellTest.java")
2379 (("/bin/sh") (which "sh"))
2380 (("/bin/echo") (which "echo")))
2381
2382 ;; This test depends on MavenProjectStub, but we don't have
2383 ;; a package for Maven.
2384 (delete-file "introspection/ReflectionValueExtractorTest.java")
2385
2386 ;; FIXME: The command line tests fail, maybe because they use
2387 ;; absolute paths.
2388 (delete-file "cli/CommandlineTest.java"))
2389 #t)))))
2390 (native-inputs
2391 `(("java-junit" ,java-junit)))
2392 (home-page "http://codehaus-plexus.github.io/plexus-utils/")
2393 (synopsis "Common utilities for the Plexus framework")
2394 (description "This package provides various Java utility classes for the
2395 Plexus framework to ease working with strings, files, command lines, XML and
2396 more.")
2397 (license license:asl2.0)))
2398
2399 (define-public java-plexus-interpolation
2400 (package
2401 (name "java-plexus-interpolation")
2402 (version "1.23")
2403 (source (origin
2404 (method url-fetch)
2405 (uri (string-append "https://github.com/codehaus-plexus/"
2406 "plexus-interpolation/archive/"
2407 "plexus-interpolation-" version ".tar.gz"))
2408 (sha256
2409 (base32
2410 "03377yzlx5q440m6sxxgv6a5qb8fl30zzcgxgc0hxk5qgl2z1jjn"))))
2411 (build-system ant-build-system)
2412 (arguments
2413 `(#:jar-name "plexus-interpolation.jar"
2414 #:source-dir "src/main"))
2415 (native-inputs
2416 `(("java-junit" ,java-junit)
2417 ("java-hamcrest-core" ,java-hamcrest-core)))
2418 (home-page "http://codehaus-plexus.github.io/plexus-interpolation/")
2419 (synopsis "Java components for interpolating ${} strings and the like")
2420 (description "Plexus interpolator is a modular, flexible interpolation
2421 framework for the expression language style commonly seen in Maven, Plexus,
2422 and other related projects.
2423
2424 It has its foundation in the @code{org.codehaus.plexus.utils.interpolation}
2425 package within @code{plexus-utils}, but has been separated in order to allow
2426 these two libraries to vary independently of one another.")
2427 (license license:asl2.0)))
2428
2429 (define-public java-plexus-classworlds
2430 (package
2431 (name "java-plexus-classworlds")
2432 (version "2.5.2")
2433 (source (origin
2434 (method url-fetch)
2435 (uri (string-append "https://github.com/codehaus-plexus/"
2436 "plexus-classworlds/archive/plexus-classworlds-"
2437 version ".tar.gz"))
2438 (sha256
2439 (base32
2440 "1qm4p0rl8d82lzhsiwnviw11jnq44s0gflg78zq152xyyr2xmh8g"))))
2441 (build-system ant-build-system)
2442 (arguments
2443 `(#:jar-name "plexus-classworlds.jar"
2444 #:source-dir "src/main"
2445 #:tests? #f));; FIXME: we need to generate some resources as in pom.xml
2446 (native-inputs
2447 `(("java-junit" ,java-junit)))
2448 (home-page "http://codehaus-plexus.github.io/plexus-classworlds/")
2449 (synopsis "Java class loader framework")
2450 (description "Plexus classworlds replaces the native ClassLoader mechanism
2451 of Java. It is especially usefull for dynamic loading of application
2452 components.")
2453 (license license:asl2.0)))
2454
2455 (define-public java-plexus-container-default-bootstrap
2456 (package
2457 (name "java-plexus-container-default-bootstrap")
2458 (version "1.7.1")
2459 (source (origin
2460 (method url-fetch)
2461 (uri (string-append "https://github.com/codehaus-plexus/plexus-containers"
2462 "/archive/plexus-containers-" version ".tar.gz"))
2463 (sha256
2464 (base32
2465 "0xw5g30qf4a83608rw9v2hv8pfsz7d69dkdhk6r0wia4q78hh1pc"))))
2466 (build-system ant-build-system)
2467 (arguments
2468 `(#:jar-name "container-default.jar"
2469 #:source-dir "plexus-container-default/src/main/java"
2470 #:test-dir "plexus-container-default/src/test"
2471 #:jdk ,icedtea-8
2472 #:tests? #f; requires plexus-archiver, which depends on this package
2473 #:phases
2474 (modify-phases %standard-phases
2475 (add-before 'build 'copy-resources
2476 (lambda _
2477 (copy-recursively
2478 "plexus-container-default/src/main/resources/"
2479 "build/classes")
2480 #t)))))
2481 (inputs
2482 `(("worldclass" ,java-plexus-classworlds)
2483 ("xbean" ,java-geronimo-xbean-reflect)
2484 ("utils" ,java-plexus-utils)
2485 ("junit" ,java-junit)
2486 ("guava" ,java-guava)))
2487 (home-page "https://github.com/codehaus-plexus/plexus-containers")
2488 (synopsis "Inversion of controll container")
2489 (description "Plexus-default-container is Plexus' inversion-of-control
2490 (IoC) container. It is composed of its public API and its default
2491 implementation.")
2492 (license license:asl2.0)))
2493
2494 (define-public java-plexus-io
2495 (package
2496 (name "java-plexus-io")
2497 (version "3.0.0")
2498 (source (origin
2499 (method url-fetch)
2500 (uri (string-append "https://github.com/codehaus-plexus/plexus-io"
2501 "/archive/plexus-io-" version ".tar.gz"))
2502 (sha256
2503 (base32
2504 "0f2j41kihaymxkpbm55smpxjja235vad8cgz94frfy3ppcp021dw"))))
2505 (build-system ant-build-system)
2506 (arguments
2507 `(#:jar-name "plexus-io.jar"
2508 #:source-dir "src/main/java"
2509 #:test-dir "src/test"
2510 #:jdk ,icedtea-8
2511 #:phases
2512 (modify-phases %standard-phases
2513 (add-before 'build 'copy-resources
2514 (lambda _
2515 (mkdir-p "build/classes/META-INF/plexus")
2516 (copy-file "src/main/resources/META-INF/plexus/components.xml"
2517 "build/classes/META-INF/plexus/components.xml")
2518 #t)))))
2519 (inputs
2520 `(("utils" ,java-plexus-utils)
2521 ("commons-io" ,java-commons-io)
2522 ("java-jsr305" ,java-jsr305)))
2523 (native-inputs
2524 `(("junit" ,java-junit)
2525 ("hamcrest" ,java-hamcrest-core)
2526 ("guava" ,java-guava)
2527 ("classworlds" ,java-plexus-classworlds)
2528 ("xbean" ,java-geronimo-xbean-reflect)
2529 ("container-default" ,java-plexus-container-default-bootstrap)))
2530 (home-page "https://github.com/codehaus-plexus/plexus-io")
2531 (synopsis "I/O plexus components")
2532 (description "Plexus IO is a set of plexus components, which are designed
2533 for use in I/O operations. This implementation using plexus components allows
2534 reusing it in maven.")
2535 (license license:asl2.0)))
2536
2537 (define-public java-plexus-archiver
2538 (package
2539 (name "java-plexus-archiver")
2540 (version "3.5")
2541 (source (origin
2542 (method url-fetch)
2543 (uri (string-append "https://github.com/codehaus-plexus/plexus-archiver"
2544 "/archive/plexus-archiver-" version ".tar.gz"))
2545 (sha256
2546 (base32
2547 "0iv1j7khra6icqh3jndng3iipfmkc7l5jq2y802cm8r575v75pyv"))))
2548 (build-system ant-build-system)
2549 (arguments
2550 `(#:jar-name "plexus-archiver.jar"
2551 #:source-dir "src/main/java"
2552 #:jdk ,icedtea-8
2553 #:test-dir "src/test"
2554 #:test-exclude (list "**/Abstract*.java" "**/Base*.java")
2555 #:phases
2556 (modify-phases %standard-phases
2557 (add-before 'check 'remove-failing
2558 (lambda _
2559 ;; Requires an older version of plexus container
2560 (delete-file
2561 "src/test/java/org/codehaus/plexus/archiver/DuplicateFilesTest.java")))
2562 (add-before 'build 'copy-resources
2563 (lambda _
2564 (mkdir-p "build/classes/META-INF/plexus")
2565 (copy-file "src/main/resources/META-INF/plexus/components.xml"
2566 "build/classes/META-INF/plexus/components.xml")
2567 #t)))))
2568 (inputs
2569 `(("utils" ,java-plexus-utils)
2570 ("commons-io" ,java-commons-io)
2571 ("snappy" ,java-iq80-snappy)
2572 ("io" ,java-plexus-io)
2573 ("compress" ,java-commons-compress)
2574 ("container-default" ,java-plexus-container-default-bootstrap)
2575 ("snappy" ,java-snappy)
2576 ("java-jsr305" ,java-jsr305)))
2577 (native-inputs
2578 `(("junit" ,java-junit)
2579 ("classworld" ,java-plexus-classworlds)
2580 ("xbean" ,java-geronimo-xbean-reflect)
2581 ("xz" ,java-tukaani-xz)
2582 ("guava" ,java-guava)))
2583 (home-page "https://github.com/codehaus-plexus/plexus-archiver")
2584 (synopsis "Archiver component of the Plexus project")
2585 (description "Plexus-archiver contains a component to deal with project
2586 archives (jar).")
2587 (license license:asl2.0)))
2588
2589 (define-public java-plexus-container-default
2590 (package
2591 (inherit java-plexus-container-default-bootstrap)
2592 (name "java-plexus-container-default")
2593 (arguments
2594 `(#:jar-name "container-default.jar"
2595 #:source-dir "plexus-container-default/src/main/java"
2596 #:test-dir "plexus-container-default/src/test"
2597 #:test-exclude (list ;"**/*Test.java"
2598 "**/Abstract*.java"
2599 ;; Requires plexus-hierarchy
2600 "**/PlexusHierarchyTest.java"
2601 ;; Failures
2602 "**/ComponentRealmCompositionTest.java"
2603 "**/PlexusContainerTest.java")
2604 #:jdk ,icedtea-8
2605 #:phases
2606 (modify-phases %standard-phases
2607 (add-before 'build 'copy-resources
2608 (lambda _
2609 (copy-recursively
2610 "plexus-container-default/src/main/resources/"
2611 "build/classes")
2612 #t))
2613 (add-before 'check 'fix-paths
2614 (lambda _
2615 (let ((dir "plexus-container-default/src/test/java/org/codehaus"))
2616 (substitute*
2617 (string-append
2618 dir "/plexus/component/composition/"
2619 "ComponentRealmCompositionTest.java")
2620 (("src/test") "plexus-container-default/src/test"))
2621 #t))))))
2622 (inputs
2623 `(("worldclass" ,java-plexus-classworlds)
2624 ("xbean" ,java-geronimo-xbean-reflect)
2625 ("utils" ,java-plexus-utils)
2626 ("junit" ,java-junit)
2627 ("guava" ,java-guava)))
2628 (native-inputs
2629 `(("archiver" ,java-plexus-archiver)
2630 ("hamcrest" ,java-hamcrest-core)))))
2631
2632 (define-public java-asm
2633 (package
2634 (name "java-asm")
2635 (version "5.2")
2636 (source (origin
2637 (method url-fetch)
2638 (uri (string-append "http://download.forge.ow2.org/asm/"
2639 "asm-" version ".tar.gz"))
2640 (sha256
2641 (base32
2642 "0kxvmv5275rnjl7jv0442k3wjnq03ngkb7sghs78avf45pzm4qgr"))))
2643 (build-system ant-build-system)
2644 (arguments
2645 `(#:build-target "compile"
2646 ;; The tests require an old version of Janino, which no longer compiles
2647 ;; with the JDK7.
2648 #:tests? #f
2649 ;; We don't need these extra ant tasks, but the build system asks us to
2650 ;; provide a path anyway.
2651 #:make-flags (list (string-append "-Dobjectweb.ant.tasks.path=foo"))
2652 #:phases
2653 (modify-phases %standard-phases
2654 (add-before 'install 'build-jars
2655 (lambda* (#:key make-flags #:allow-other-keys)
2656 ;; We cannot use the "jar" target because it depends on a couple
2657 ;; of unpackaged, complicated tools.
2658 (mkdir "dist")
2659 (zero? (system* "jar"
2660 "-cf" (string-append "dist/asm-" ,version ".jar")
2661 "-C" "output/build/tmp" "."))))
2662 (replace 'install
2663 (install-jars "dist")))))
2664 (native-inputs
2665 `(("java-junit" ,java-junit)))
2666 (home-page "http://asm.ow2.org/")
2667 (synopsis "Very small and fast Java bytecode manipulation framework")
2668 (description "ASM is an all purpose Java bytecode manipulation and
2669 analysis framework. It can be used to modify existing classes or dynamically
2670 generate classes, directly in binary form. The provided common
2671 transformations and analysis algorithms allow to easily assemble custom
2672 complex transformations and code analysis tools.")
2673 (license license:bsd-3)))
2674
2675 (define-public java-cglib
2676 (package
2677 (name "java-cglib")
2678 (version "3.2.4")
2679 (source (origin
2680 (method url-fetch)
2681 (uri (string-append
2682 "https://github.com/cglib/cglib/archive/RELEASE_"
2683 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
2684 ".tar.gz"))
2685 (file-name (string-append "cglib-" version ".tar.gz"))
2686 (sha256
2687 (base32
2688 "162dvd4fln76ai8prfharf66pn6r56p3sxx683j5vdyccrd5hi1q"))))
2689 (build-system ant-build-system)
2690 (arguments
2691 `(;; FIXME: tests fail because junit runs
2692 ;; "net.sf.cglib.transform.AbstractTransformTest", which does not seem
2693 ;; to describe a test at all.
2694 #:tests? #f
2695 #:jar-name "cglib.jar"
2696 #:phases
2697 (modify-phases %standard-phases
2698 (add-after 'unpack 'chdir
2699 (lambda _ (chdir "cglib") #t)))))
2700 (inputs
2701 `(("java-asm" ,java-asm)
2702 ("java-junit" ,java-junit)))
2703 (home-page "https://github.com/cglib/cglib/")
2704 (synopsis "Java byte code generation library")
2705 (description "The byte code generation library CGLIB is a high level API
2706 to generate and transform Java byte code.")
2707 (license license:asl2.0)))
2708
2709 (define-public java-objenesis
2710 (package
2711 (name "java-objenesis")
2712 (version "2.5.1")
2713 (source (origin
2714 (method url-fetch)
2715 (uri (string-append "https://github.com/easymock/objenesis/"
2716 "archive/" version ".tar.gz"))
2717 (file-name (string-append "objenesis-" version ".tar.gz"))
2718 (sha256
2719 (base32
2720 "1va5qz1i2wawwavhnxfzxnfgrcaflz9p1pg03irrjh4nd3rz8wh6"))))
2721 (build-system ant-build-system)
2722 (arguments
2723 `(#:jar-name "objenesis.jar"
2724 #:source-dir "main/src/"
2725 #:test-dir "main/src/test/"))
2726 (native-inputs
2727 `(("java-junit" ,java-junit)
2728 ("java-hamcrest-core" ,java-hamcrest-core)))
2729 (home-page "http://objenesis.org/")
2730 (synopsis "Bypass the constructor when creating an object")
2731 (description "Objenesis is a small Java library that serves one purpose:
2732 to instantiate a new object of a particular class. It is common to see
2733 restrictions in libraries stating that classes must require a default
2734 constructor. Objenesis aims to overcome these restrictions by bypassing the
2735 constructor on object instantiation.")
2736 (license license:asl2.0)))
2737
2738 (define-public java-easymock
2739 (package
2740 (name "java-easymock")
2741 (version "3.4")
2742 (source (origin
2743 (method url-fetch)
2744 (uri (string-append "https://github.com/easymock/easymock/"
2745 "archive/easymock-" version ".tar.gz"))
2746 (sha256
2747 (base32
2748 "1yzg0kv256ndr57gpav46cyv4a1ns5sj722l50zpxk3j6sk9hnmi"))))
2749 (build-system ant-build-system)
2750 (arguments
2751 `(#:jar-name "easymock.jar"
2752 #:source-dir "core/src/main"
2753 #:test-dir "core/src/test"
2754 #:phases
2755 (modify-phases %standard-phases
2756 ;; FIXME: Android support requires the following packages to be
2757 ;; available: com.google.dexmaker.stock.ProxyBuilder
2758 (add-after 'unpack 'delete-android-support
2759 (lambda _
2760 (with-directory-excursion "core/src/main/java/org/easymock/internal"
2761 (substitute* "MocksControl.java"
2762 (("AndroidSupport.isAndroid\\(\\)") "false")
2763 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
2764 (delete-file "AndroidClassProxyFactory.java"))
2765 #t))
2766 (add-after 'unpack 'delete-broken-tests
2767 (lambda _
2768 (with-directory-excursion "core/src/test/java/org/easymock"
2769 ;; This test depends on dexmaker.
2770 (delete-file "tests2/ClassExtensionHelperTest.java")
2771
2772 ;; This is not a test.
2773 (delete-file "tests/BaseEasyMockRunnerTest.java")
2774
2775 ;; This test should be executed with a different runner...
2776 (delete-file "tests2/EasyMockAnnotationsTest.java")
2777 ;; ...but deleting it means that we also have to delete these
2778 ;; dependent files.
2779 (delete-file "tests2/EasyMockRunnerTest.java")
2780 (delete-file "tests2/EasyMockRuleTest.java")
2781
2782 ;; This test fails because the file "easymock.properties" does
2783 ;; not exist.
2784 (delete-file "tests2/EasyMockPropertiesTest.java"))
2785 #t)))))
2786 (inputs
2787 `(("java-asm" ,java-asm)
2788 ("java-cglib" ,java-cglib)
2789 ("java-objenesis" ,java-objenesis)))
2790 (native-inputs
2791 `(("java-junit" ,java-junit)
2792 ("java-hamcrest-core" ,java-hamcrest-core)))
2793 (home-page "http://easymock.org")
2794 (synopsis "Java library providing mock objects for unit tests")
2795 (description "EasyMock is a Java library that provides an easy way to use
2796 mock objects in unit testing.")
2797 (license license:asl2.0)))
2798
2799 (define-public java-jmock-1
2800 (package
2801 (name "java-jmock")
2802 (version "1.2.0")
2803 (source (origin
2804 (method url-fetch)
2805 (uri (string-append "https://github.com/jmock-developers/"
2806 "jmock-library/archive/" version ".tar.gz"))
2807 (file-name (string-append "jmock-" version ".tar.gz"))
2808 (sha256
2809 (base32
2810 "0xmrlhq0fszldkbv281k9463mv496143vvmqwpxp62yzjvdkx9w0"))))
2811 (build-system ant-build-system)
2812 (arguments
2813 `(#:build-target "jars"
2814 #:test-target "run.tests"
2815 #:phases
2816 (modify-phases %standard-phases
2817 (replace 'install (install-jars "build")))))
2818 (home-page "http://www.jmock.org")
2819 (synopsis "Mock object library for test-driven development")
2820 (description "JMock is a library that supports test-driven development of
2821 Java code with mock objects. Mock objects help you design and test the
2822 interactions between the objects in your programs.
2823
2824 The jMock library
2825
2826 @itemize
2827 @item makes it quick and easy to define mock objects
2828 @item lets you precisely specify the interactions between
2829 your objects, reducing the brittleness of your tests
2830 @item plugs into your favourite test framework
2831 @item is easy to extend.
2832 @end itemize\n")
2833 (license license:bsd-3)))
2834
2835 (define-public java-jmock
2836 (package
2837 (inherit java-jmock-1)
2838 (name "java-jmock")
2839 (version "2.8.2")
2840 (source (origin
2841 (method url-fetch)
2842 (uri (string-append "https://github.com/jmock-developers/"
2843 "jmock-library/archive/" version ".tar.gz"))
2844 (file-name (string-append name "-" version ".tar.gz"))
2845 (sha256
2846 (base32
2847 "18650a9g8xffcsdb6w91pbswa7f40fp2sh6s3nclkclz5dbzq8f0"))))
2848 (inputs
2849 `(("java-hamcrest-all" ,java-hamcrest-all)
2850 ("java-asm" ,java-asm)
2851 ("java-bsh" ,java-bsh)
2852 ("java-junit" ,java-junit)))
2853 (native-inputs
2854 `(("cglib" ,java-cglib)))
2855 (arguments
2856 `(#:jar-name "java-jmock.jar"
2857 #:source-dir "jmock/src/main/java"
2858 #:test-dir "jmock/src/test"))))
2859
2860 (define-public java-jmock-junit4
2861 (package
2862 (inherit java-jmock)
2863 (name "java-jmock-junit4")
2864 (arguments
2865 `(#:jar-name "java-jmock-junit4.jar"
2866 #:source-dir "jmock-junit4/src/main/java"
2867 #:test-dir "jmock-junit4/src/test"))
2868 (inputs
2869 `(("java-hamcrest-all" ,java-hamcrest-all)
2870 ("java-asm" ,java-asm)
2871 ("java-bsh" ,java-bsh)
2872 ("java-jmock" ,java-jmock)
2873 ("java-jumit" ,java-junit)))))
2874
2875 (define-public java-jmock-legacy
2876 (package
2877 (inherit java-jmock)
2878 (name "java-jmock-legacy")
2879 (arguments
2880 `(#:jar-name "java-jmock-legacy.jar"
2881 #:source-dir "jmock-legacy/src/main/java"
2882 #:test-dir "jmock-legacy/src/test"
2883 #:phases
2884 (modify-phases %standard-phases
2885 (add-before 'check 'copy-tests
2886 (lambda _
2887 ;; This file is a dependancy of some tests
2888 (let ((file "org/jmock/test/acceptance/PackageProtectedType.java"))
2889 (copy-file (string-append "jmock/src/test/java/" file)
2890 (string-append "jmock-legacy/src/test/java/" file))
2891 #t))))))
2892 (inputs
2893 `(("java-hamcrest-all" ,java-hamcrest-all)
2894 ("java-objenesis" ,java-objenesis)
2895 ("java-cglib" ,java-cglib)
2896 ("java-jmock" ,java-jmock)
2897 ("java-asm" ,java-asm)
2898 ("java-bsh" ,java-bsh)
2899 ("java-junit" ,java-junit)))
2900 (native-inputs
2901 `(("java-jmock-junit4" ,java-jmock-junit4)))))
2902
2903 (define-public java-hamcrest-all
2904 (package (inherit java-hamcrest-core)
2905 (name "java-hamcrest-all")
2906 (arguments
2907 (substitute-keyword-arguments (package-arguments java-hamcrest-core)
2908 ;; FIXME: a unit test fails because org.hamcrest.SelfDescribing is not
2909 ;; found, although it is part of the hamcrest-core library that has
2910 ;; just been built.
2911 ;;
2912 ;; Fixing this one test is insufficient, though, and upstream confirmed
2913 ;; that the latest hamcrest release fails its unit tests when built
2914 ;; with Java 7. See https://github.com/hamcrest/JavaHamcrest/issues/30
2915 ((#:tests? _) #f)
2916 ((#:build-target _) "bigjar")
2917 ((#:phases phases)
2918 `(modify-phases ,phases
2919 ;; Some build targets override the classpath, so we need to patch
2920 ;; the build.xml to ensure that required dependencies are on the
2921 ;; classpath.
2922 (add-after 'unpack 'patch-classpath-for-integration
2923 (lambda* (#:key inputs #:allow-other-keys)
2924 (substitute* "build.xml"
2925 ((" build/hamcrest-library-\\$\\{version\\}.jar" line)
2926 (string-join
2927 (cons line
2928 (append
2929 (find-files (assoc-ref inputs "java-hamcrest-core") "\\.jar$")
2930 (find-files (assoc-ref inputs "java-junit") "\\.jar$")
2931 (find-files (assoc-ref inputs "java-jmock") "\\.jar$")
2932 (find-files (assoc-ref inputs "java-easymock") "\\.jar$")))
2933 ";")))
2934 #t))))))
2935 (inputs
2936 `(("java-junit" ,java-junit)
2937 ("java-jmock" ,java-jmock-1)
2938 ("java-easymock" ,java-easymock)
2939 ("java-hamcrest-core" ,java-hamcrest-core)
2940 ,@(package-inputs java-hamcrest-core)))))
2941
2942 (define-public java-jopt-simple
2943 (package
2944 (name "java-jopt-simple")
2945 (version "5.0.3")
2946 (source (origin
2947 (method url-fetch)
2948 (uri (string-append "http://repo1.maven.org/maven2/"
2949 "net/sf/jopt-simple/jopt-simple/"
2950 version "/jopt-simple-"
2951 version "-sources.jar"))
2952 (sha256
2953 (base32
2954 "1v8bzmwmw6qq20gm42xyay6vrd567dra4vqwhgjnqqjz1gs9f8qa"))))
2955 (build-system ant-build-system)
2956 (arguments
2957 `(#:tests? #f ; there are no tests
2958 #:jar-name "jopt-simple.jar"))
2959 (home-page "https://pholser.github.io/jopt-simple/")
2960 (synopsis "Java library for parsing command line options")
2961 (description "JOpt Simple is a Java library for parsing command line
2962 options, such as those you might pass to an invocation of @code{javac}. In
2963 the interest of striving for simplicity, as closely as possible JOpt Simple
2964 attempts to honor the command line option syntaxes of POSIX @code{getopt} and
2965 GNU @code{getopt_long}. It also aims to make option parser configuration and
2966 retrieval of options and their arguments simple and expressive, without being
2967 overly clever.")
2968 (license license:expat)))
2969
2970 (define-public java-commons-math3
2971 (package
2972 (name "java-commons-math3")
2973 (version "3.6.1")
2974 (source (origin
2975 (method url-fetch)
2976 (uri (string-append "mirror://apache/commons/math/source/"
2977 "commons-math3-" version "-src.tar.gz"))
2978 (sha256
2979 (base32
2980 "19l6yp44qc5g7wg816nbn5z3zq3xxzwimvbm4a8pczgvpi4i85s6"))))
2981 (build-system ant-build-system)
2982 (arguments
2983 `(#:build-target "jar"
2984 #:test-target "test"
2985 #:make-flags
2986 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
2987 (junit (assoc-ref %build-inputs "java-junit")))
2988 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
2989 (string-append "-Dhamcrest.jar=" hamcrest
2990 "/share/java/hamcrest-core.jar")))
2991 #:phases
2992 (modify-phases %standard-phases
2993 ;; We want to build the jar in the build phase and run the tests
2994 ;; later in a separate phase.
2995 (add-after 'unpack 'untangle-targets
2996 (lambda _
2997 (substitute* "build.xml"
2998 (("name=\"jar\" depends=\"test\"")
2999 "name=\"jar\" depends=\"compile\""))
3000 #t))
3001 ;; There is no install target.
3002 (replace 'install
3003 (install-jars "target")))))
3004 (native-inputs
3005 `(("java-junit" ,java-junit)
3006 ("java-hamcrest-core" ,java-hamcrest-core)))
3007 (home-page "http://commons.apache.org/math/")
3008 (synopsis "Apache Commons mathematics library")
3009 (description "Commons Math is a library of lightweight, self-contained
3010 mathematics and statistics components addressing the most common problems not
3011 available in the Java programming language or Commons Lang.")
3012 (license license:asl2.0)))
3013
3014 (define-public java-jmh
3015 (package
3016 (name "java-jmh")
3017 (version "1.17.5")
3018 (source (origin
3019 (method hg-fetch)
3020 (uri (hg-reference
3021 (url "http://hg.openjdk.java.net/code-tools/jmh/")
3022 (changeset version)))
3023 (file-name (string-append name "-" version "-checkout"))
3024 (sha256
3025 (base32
3026 "1fxyxhg9famwcg1prc4cgwb5wzyxqavn3cjm5vz8605xz7x5k084"))))
3027 (build-system ant-build-system)
3028 (arguments
3029 `(#:jar-name "jmh-core.jar"
3030 #:source-dir "jmh-core/src/main"
3031 #:test-dir "jmh-core/src/test"
3032 #:phases
3033 (modify-phases %standard-phases
3034 ;; This seems to be a bug in the JDK. It may not be necessary in
3035 ;; future versions of the JDK.
3036 (add-after 'unpack 'fix-bug
3037 (lambda _
3038 (with-directory-excursion
3039 "jmh-core/src/main/java/org/openjdk/jmh/runner/options"
3040 (substitute* '("IntegerValueConverter.java"
3041 "ThreadsValueConverter.java")
3042 (("public Class<Integer> valueType")
3043 "public Class<? extends Integer> valueType")))
3044 #t)))))
3045 (inputs
3046 `(("java-jopt-simple" ,java-jopt-simple)
3047 ("java-commons-math3" ,java-commons-math3)))
3048 (native-inputs
3049 `(("java-junit" ,java-junit)
3050 ("java-hamcrest-core" ,java-hamcrest-core)))
3051 (home-page "http://openjdk.java.net/projects/code-tools/jmh/")
3052 (synopsis "Benchmark harness for the JVM")
3053 (description "JMH is a Java harness for building, running, and analysing
3054 nano/micro/milli/macro benchmarks written in Java and other languages
3055 targetting the JVM.")
3056 ;; GPLv2 only
3057 (license license:gpl2)))
3058
3059 (define-public java-commons-collections4
3060 (package
3061 (name "java-commons-collections4")
3062 (version "4.1")
3063 (source (origin
3064 (method url-fetch)
3065 (uri (string-append "mirror://apache/commons/collections/source/"
3066 "commons-collections4-" version "-src.tar.gz"))
3067 (sha256
3068 (base32
3069 "1krfhvggympq4avk7gh6qafzf6b9ip6r1m4lmacikyx04039m0wl"))))
3070 (build-system ant-build-system)
3071 (arguments
3072 `(#:test-target "test"
3073 #:make-flags
3074 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
3075 (junit (assoc-ref %build-inputs "java-junit"))
3076 (easymock (assoc-ref %build-inputs "java-easymock")))
3077 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
3078 (string-append "-Dhamcrest.jar=" hamcrest
3079 "/share/java/hamcrest-core.jar")
3080 (string-append "-Deasymock.jar=" easymock
3081 "/share/java/easymock.jar")))
3082 #:phases
3083 (modify-phases %standard-phases
3084 (replace 'install
3085 (install-jars "target")))))
3086 (native-inputs
3087 `(("java-junit" ,java-junit)
3088 ("java-hamcrest-core" ,java-hamcrest-core)
3089 ("java-easymock" ,java-easymock)))
3090 (home-page "http://commons.apache.org/collections/")
3091 (synopsis "Collections framework")
3092 (description "The Java Collections Framework is the recognised standard
3093 for collection handling in Java. Commons-Collections seek to build upon the
3094 JDK classes by providing new interfaces, implementations and utilities. There
3095 are many features, including:
3096
3097 @itemize
3098 @item @code{Bag} interface for collections that have a number of copies of
3099 each object
3100 @item @code{BidiMap} interface for maps that can be looked up from value to
3101 key as well and key to value
3102 @item @code{MapIterator} interface to provide simple and quick iteration over
3103 maps
3104 @item Transforming decorators that alter each object as it is added to the
3105 collection
3106 @item Composite collections that make multiple collections look like one
3107 @item Ordered maps and sets that retain the order elements are added in,
3108 including an LRU based map
3109 @item Reference map that allows keys and/or values to be garbage collected
3110 under close control
3111 @item Many comparator implementations
3112 @item Many iterator implementations
3113 @item Adapter classes from array and enumerations to collections
3114 @item Utilities to test or create typical set-theory properties of collections
3115 such as union, intersection, and closure.
3116 @end itemize\n")
3117 (license license:asl2.0)))
3118
3119 (define-public java-commons-collections
3120 (package
3121 (inherit java-commons-collections4)
3122 (name "java-commons-collections")
3123 (version "3.2.2")
3124 (source (origin
3125 (method url-fetch)
3126 (uri (string-append "mirror://apache/commons/collections/source/"
3127 "commons-collections-" version "-src.tar.gz"))
3128 (sha256
3129 (base32
3130 "055r51a5lfc3z7rkxnxmnn1npvkvda7636hjpm4qk7cnfzz98387"))))
3131 (arguments
3132 (substitute-keyword-arguments (package-arguments java-commons-collections4)
3133 ((#:phases phases)
3134 `(modify-phases ,phases
3135 ;; The manifest is required by the build procedure
3136 (add-before 'build 'add-manifest
3137 (lambda _
3138 (mkdir-p "build/conf")
3139 (call-with-output-file "build/conf/MANIFEST.MF"
3140 (lambda (file)
3141 (format file "Manifest-Version: 1.0\n")))))
3142 (replace 'install
3143 (install-jars "build"))))))))
3144
3145 (define java-commons-collections-test-classes
3146 (package
3147 (inherit java-commons-collections)
3148 (arguments
3149 `(#:jar-name "commons-collections-test-classes.jar"
3150 #:source-dir "src/test"
3151 #:tests? #f))
3152 (inputs
3153 `(("collection" ,java-commons-collections)))))
3154
3155 (define-public java-commons-beanutils
3156 (package
3157 (name "java-commons-beanutils")
3158 (version "1.9.3")
3159 (source (origin
3160 (method url-fetch)
3161 (uri (string-append "mirror://apache/commons/beanutils/source/"
3162 "commons-beanutils-" version "-src.tar.gz"))
3163 (sha256
3164 (base32
3165 "03cs0bq3sl1sdc7py9g3qnf8n9h473nrkvd3d251kaqv6a2ab7qk"))))
3166 (build-system ant-build-system)
3167 (arguments
3168 `(#:test-target "test"
3169 #:tests? #f
3170 #:phases
3171 (modify-phases %standard-phases
3172 (replace 'install
3173 (lambda* (#:key outputs #:allow-other-keys)
3174 (rename-file (string-append "dist/commons-beanutils-" ,version
3175 "-SNAPSHOT.jar")
3176 "commons-beanutils.jar")
3177 (install-file "commons-beanutils.jar"
3178 (string-append (assoc-ref outputs "out") "/share/java/"))
3179 #t)))))
3180 (inputs
3181 `(("logging" ,java-commons-logging-minimal)
3182 ("collections" ,java-commons-collections)))
3183 (native-inputs
3184 `(("junit" ,java-junit)
3185 ("collections-test" ,java-commons-collections-test-classes)))
3186 (home-page "http://commons.apache.org/beanutils/")
3187 (synopsis "Dynamically set or get properties in Java")
3188 (description "BeanUtils provides a simplified interface to reflection and
3189 introspection to set or get dynamically determined properties through their
3190 setter and getter method.")
3191 (license license:asl2.0)))
3192
3193 (define-public java-commons-io
3194 (package
3195 (name "java-commons-io")
3196 (version "2.5")
3197 (source
3198 (origin
3199 (method url-fetch)
3200 (uri (string-append "mirror://apache/commons/io/source/"
3201 "commons-io-" version "-src.tar.gz"))
3202 (sha256
3203 (base32
3204 "0q5y41jrcjvx9hzs47x5kdhnasdy6rm4bzqd2jxl02w717m7a7v3"))))
3205 (build-system ant-build-system)
3206 (outputs '("out" "doc"))
3207 (arguments
3208 `(#:test-target "test"
3209 #:make-flags
3210 (list (string-append "-Djunit.jar="
3211 (assoc-ref %build-inputs "java-junit")
3212 "/share/java/junit.jar"))
3213 #:phases
3214 (modify-phases %standard-phases
3215 (add-after 'build 'build-javadoc ant-build-javadoc)
3216 (replace 'install (install-jars "target"))
3217 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
3218 (native-inputs
3219 `(("java-junit" ,java-junit)
3220 ("java-hamcrest-core" ,java-hamcrest-core)))
3221 (home-page "http://commons.apache.org/io/")
3222 (synopsis "Common useful IO related classes")
3223 (description "Commons-IO contains utility classes, stream implementations,
3224 file filters and endian classes.")
3225 (license license:asl2.0)))
3226
3227 (define-public java-commons-lang
3228 (package
3229 (name "java-commons-lang")
3230 (version "2.6")
3231 (source
3232 (origin
3233 (method url-fetch)
3234 (uri (string-append "mirror://apache/commons/lang/source/"
3235 "commons-lang-" version "-src.tar.gz"))
3236 (sha256
3237 (base32 "1mxwagqadzx1b2al7i0z1v0r235aj2njdyijf02szq0vhmqrfiq5"))))
3238 (build-system ant-build-system)
3239 (outputs '("out" "doc"))
3240 (arguments
3241 `(#:test-target "test"
3242 #:phases
3243 (modify-phases %standard-phases
3244 (add-after 'build 'build-javadoc ant-build-javadoc)
3245 (add-before 'check 'disable-failing-test
3246 (lambda _
3247 ;; Disable a failing test
3248 (substitute* "src/test/java/org/apache/commons/lang/\
3249 time/FastDateFormatTest.java"
3250 (("public void testFormat\\(\\)")
3251 "public void disabled_testFormat()"))
3252 #t))
3253 (replace 'install (install-jars "target"))
3254 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
3255 (native-inputs
3256 `(("java-junit" ,java-junit)))
3257 (home-page "http://commons.apache.org/lang/")
3258 (synopsis "Extension of the java.lang package")
3259 (description "The Commons Lang components contains a set of Java classes
3260 that provide helper methods for standard Java classes, especially those found
3261 in the @code{java.lang} package in the Sun JDK. The following classes are
3262 included:
3263
3264 @itemize
3265 @item StringUtils - Helper for @code{java.lang.String}.
3266 @item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets
3267 of characters such as @code{[a-z]} and @code{[abcdez]}.
3268 @item RandomStringUtils - Helper for creating randomised strings.
3269 @item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
3270 @item NumberRange - A range of numbers with an upper and lower bound.
3271 @item ObjectUtils - Helper for @code{java.lang.Object}.
3272 @item SerializationUtils - Helper for serializing objects.
3273 @item SystemUtils - Utility class defining the Java system properties.
3274 @item NestedException package - A sub-package for the creation of nested
3275 exceptions.
3276 @item Enum package - A sub-package for the creation of enumerated types.
3277 @item Builder package - A sub-package for the creation of @code{equals},
3278 @code{hashCode}, @code{compareTo} and @code{toString} methods.
3279 @end itemize\n")
3280 (license license:asl2.0)))
3281
3282 (define-public java-commons-lang3
3283 (package
3284 (name "java-commons-lang3")
3285 (version "3.4")
3286 (source
3287 (origin
3288 (method url-fetch)
3289 (uri (string-append "mirror://apache/commons/lang/source/"
3290 "commons-lang3-" version "-src.tar.gz"))
3291 (sha256
3292 (base32 "0xpshb9spjhplq5a7mr0y1bgfw8190ik4xj8f569xidfcki1d6kg"))))
3293 (build-system ant-build-system)
3294 (outputs '("out" "doc"))
3295 (arguments
3296 `(#:test-target "test"
3297 #:make-flags
3298 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-all"))
3299 (junit (assoc-ref %build-inputs "java-junit"))
3300 (easymock (assoc-ref %build-inputs "java-easymock"))
3301 (io (assoc-ref %build-inputs "java-commons-io")))
3302 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
3303 (string-append "-Dhamcrest.jar=" hamcrest
3304 "/share/java/hamcrest-all.jar")
3305 (string-append "-Dcommons-io.jar=" io
3306 "/share/java/commons-io-"
3307 ,(package-version java-commons-io)
3308 "-SNAPSHOT.jar")
3309 (string-append "-Deasymock.jar=" easymock
3310 "/share/java/easymock.jar")))
3311 #:phases
3312 (modify-phases %standard-phases
3313 (add-after 'build 'build-javadoc ant-build-javadoc)
3314 (replace 'install (install-jars "target"))
3315 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
3316 (native-inputs
3317 `(("java-junit" ,java-junit)
3318 ("java-commons-io" ,java-commons-io)
3319 ("java-hamcrest-all" ,java-hamcrest-all)
3320 ("java-easymock" ,java-easymock)))
3321 (home-page "http://commons.apache.org/lang/")
3322 (synopsis "Extension of the java.lang package")
3323 (description "The Commons Lang components contains a set of Java classes
3324 that provide helper methods for standard Java classes, especially those found
3325 in the @code{java.lang} package. The following classes are included:
3326
3327 @itemize
3328 @item StringUtils - Helper for @code{java.lang.String}.
3329 @item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets of
3330 characters such as @code{[a-z]} and @code{[abcdez]}.
3331 @item RandomStringUtils - Helper for creating randomised strings.
3332 @item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
3333 @item NumberRange - A range of numbers with an upper and lower bound.
3334 @item ObjectUtils - Helper for @code{java.lang.Object}.
3335 @item SerializationUtils - Helper for serializing objects.
3336 @item SystemUtils - Utility class defining the Java system properties.
3337 @item NestedException package - A sub-package for the creation of nested
3338 exceptions.
3339 @item Enum package - A sub-package for the creation of enumerated types.
3340 @item Builder package - A sub-package for the creation of @code{equals},
3341 @code{hashCode}, @code{compareTo} and @code{toString} methods.
3342 @end itemize\n")
3343 (license license:asl2.0)))
3344
3345 (define-public java-jsr305
3346 (package
3347 (name "java-jsr305")
3348 (version "3.0.1")
3349 (source (origin
3350 (method url-fetch)
3351 (uri (string-append "https://repo1.maven.org/maven2/"
3352 "com/google/code/findbugs/"
3353 "jsr305/" version "/jsr305-"
3354 version "-sources.jar"))
3355 (sha256
3356 (base32
3357 "1rh6jin9v7jqpq3kf1swl868l8i94r636n03pzpsmgr8v0lh9j2n"))))
3358 (build-system ant-build-system)
3359 (arguments
3360 `(#:tests? #f ; no tests included
3361 #:jar-name "jsr305.jar"))
3362 (home-page "http://findbugs.sourceforge.net/")
3363 (synopsis "Annotations for the static analyzer called findbugs")
3364 (description "This package provides annotations for the findbugs package.
3365 It provides packages in the @code{javax.annotations} namespace.")
3366 (license license:asl2.0)))
3367
3368 (define-public java-guava
3369 (package
3370 (name "java-guava")
3371 ;; This is the last release of Guava that can be built with Java 7.
3372 (version "20.0")
3373 (source (origin
3374 (method url-fetch)
3375 (uri (string-append "https://github.com/google/guava/"
3376 "releases/download/v" version
3377 "/guava-" version "-sources.jar"))
3378 (sha256
3379 (base32
3380 "1gawrs5gi6j5hcfxdgpnfli75vb9pfi4sn09pnc8xacr669yajwr"))))
3381 (build-system ant-build-system)
3382 (arguments
3383 `(#:tests? #f ; no tests included
3384 #:jar-name "guava.jar"
3385 #:phases
3386 (modify-phases %standard-phases
3387 (add-after 'unpack 'trim-sources
3388 (lambda _
3389 (with-directory-excursion "src/com/google/common"
3390 ;; Remove annotations to avoid extra dependencies:
3391 ;; * "j2objc" annotations are used when converting Java to
3392 ;; Objective C;
3393 ;; * "errorprone" annotations catch common Java mistakes at
3394 ;; compile time;
3395 ;; * "IgnoreJRERequirement" is used for Android.
3396 (substitute* (find-files "." "\\.java$")
3397 (("import com.google.j2objc.*") "")
3398 (("import com.google.errorprone.annotation.*") "")
3399 (("import org.codehaus.mojo.animal_sniffer.*") "")
3400 (("@CanIgnoreReturnValue") "")
3401 (("@LazyInit") "")
3402 (("@WeakOuter") "")
3403 (("@RetainedWith") "")
3404 (("@Weak") "")
3405 (("@ForOverride") "")
3406 (("@J2ObjCIncompatible") "")
3407 (("@IgnoreJRERequirement") "")))
3408 #t)))))
3409 (inputs
3410 `(("java-jsr305" ,java-jsr305)))
3411 (home-page "https://github.com/google/guava")
3412 (synopsis "Google core libraries for Java")
3413 (description "Guava is a set of core libraries that includes new
3414 collection types (such as multimap and multiset), immutable collections, a
3415 graph library, functional types, an in-memory cache, and APIs/utilities for
3416 concurrency, I/O, hashing, primitives, reflection, string processing, and much
3417 more!")
3418 (license license:asl2.0)))
3419
3420 ;; The java-commons-logging package provides adapters to many different
3421 ;; logging frameworks. To avoid an excessive dependency graph we try to build
3422 ;; it with only a minimal set of adapters.
3423 (define-public java-commons-logging-minimal
3424 (package
3425 (name "java-commons-logging-minimal")
3426 (version "1.2")
3427 (source (origin
3428 (method url-fetch)
3429 (uri (string-append "mirror://apache/commons/logging/source/"
3430 "commons-logging-" version "-src.tar.gz"))
3431 (sha256
3432 (base32
3433 "10bwcy5w8d7y39n0krlwhnp8ds3kj5zhmzj0zxnkw0qdlsjmsrj9"))))
3434 (build-system ant-build-system)
3435 (arguments
3436 `(#:tests? #f ; avoid dependency on logging frameworks
3437 #:jar-name "commons-logging-minimal.jar"
3438 #:phases
3439 (modify-phases %standard-phases
3440 (add-after 'unpack 'delete-adapters-and-tests
3441 (lambda _
3442 ;; Delete all adapters except for NoOpLog, SimpleLog, and
3443 ;; LogFactoryImpl. NoOpLog is required to build; LogFactoryImpl
3444 ;; is used by applications; SimpleLog is the only actually usable
3445 ;; implementation that does not depend on another logging
3446 ;; framework.
3447 (for-each
3448 (lambda (file)
3449 (delete-file (string-append
3450 "src/main/java/org/apache/commons/logging/impl/" file)))
3451 (list "Jdk13LumberjackLogger.java"
3452 "WeakHashtable.java"
3453 "Log4JLogger.java"
3454 "ServletContextCleaner.java"
3455 "Jdk14Logger.java"
3456 "AvalonLogger.java"
3457 "LogKitLogger.java"))
3458 (delete-file-recursively "src/test")
3459 #t)))))
3460 (home-page "http://commons.apache.org/logging/")
3461 (synopsis "Common API for logging implementations")
3462 (description "The Logging package is a thin bridge between different
3463 logging implementations. A library that uses the commons-logging API can be
3464 used with any logging implementation at runtime.")
3465 (license license:asl2.0)))
3466
3467 ;; This is the last release of the 1.x series.
3468 (define-public java-mockito-1
3469 (package
3470 (name "java-mockito")
3471 (version "1.10.19")
3472 (source (origin
3473 (method url-fetch)
3474 (uri (string-append "http://repo1.maven.org/maven2/"
3475 "org/mockito/mockito-core/" version
3476 "/mockito-core-" version "-sources.jar"))
3477 (sha256
3478 (base32
3479 "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc"))))
3480 (build-system ant-build-system)
3481 (arguments
3482 `(#:jar-name "mockito.jar"
3483 #:tests? #f ; no tests included
3484 ;; FIXME: patch-and-repack does not support jars, so we have to apply
3485 ;; patches in build phases.
3486 #:phases
3487 (modify-phases %standard-phases
3488 ;; Mockito was developed against a different version of hamcrest,
3489 ;; which does not require matcher implementations to provide an
3490 ;; implementation of the "describeMismatch" method. We add this
3491 ;; simple definition to pass the build with our version of hamcrest.
3492 (add-after 'unpack 'fix-hamcrest-build-error
3493 (lambda _
3494 (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java"
3495 (("public Matcher getActualMatcher\\(\\) .*" line)
3496 (string-append "
3497 public void describeMismatch(Object item, Description description) {
3498 actualMatcher.describeMismatch(item, description);
3499 }"
3500 line)))
3501 #t))
3502 ;; Mockito bundles cglib. We have a cglib package, so let's use
3503 ;; that instead.
3504 (add-after 'unpack 'use-system-libraries
3505 (lambda _
3506 (with-directory-excursion "src/org/mockito/internal/creation/cglib"
3507 (substitute* '("CGLIBHacker.java"
3508 "CglibMockMaker.java"
3509 "ClassImposterizer.java"
3510 "DelegatingMockitoMethodProxy.java"
3511 "MethodInterceptorFilter.java"
3512 "MockitoNamingPolicy.java"
3513 "SerializableMockitoMethodProxy.java"
3514 "SerializableNoOp.java")
3515 (("import org.mockito.cglib") "import net.sf.cglib")))
3516 #t)))))
3517 (inputs
3518 `(("java-junit" ,java-junit)
3519 ("java-objenesis" ,java-objenesis)
3520 ("java-cglib" ,java-cglib)
3521 ("java-hamcrest-core" ,java-hamcrest-core)))
3522 (home-page "http://mockito.org")
3523 (synopsis "Mockito is a mock library for Java")
3524 (description "Mockito is a mocking library for Java which lets you write
3525 tests with a clean and simple API. It generates mocks using reflection, and
3526 it records all mock invocations, including methods arguments.")
3527 (license license:asl2.0)))
3528
3529 (define-public java-httpcomponents-httpcore
3530 (package
3531 (name "java-httpcomponents-httpcore")
3532 (version "4.4.6")
3533 (source (origin
3534 (method url-fetch)
3535 (uri (string-append "mirror://apache//httpcomponents/httpcore/"
3536 "source/httpcomponents-core-"
3537 version "-src.tar.gz"))
3538 (sha256
3539 (base32
3540 "02bwcf38y4vgwq7kj2s6q7qrmma641r5lacivm16kgxvb2j6h1vy"))))
3541 (build-system ant-build-system)
3542 (arguments
3543 `(#:jar-name "httpcomponents-httpcore.jar"
3544 #:phases
3545 (modify-phases %standard-phases
3546 (add-after 'unpack 'chdir
3547 (lambda _ (chdir "httpcore") #t)))))
3548 (inputs
3549 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
3550 ("java-commons-lang3" ,java-commons-lang3)))
3551 (native-inputs
3552 `(("java-junit" ,java-junit)
3553 ("java-mockito" ,java-mockito-1)))
3554 (home-page "https://hc.apache.org/httpcomponents-core-4.4.x/index.html")
3555 (synopsis "Low level HTTP transport components")
3556 (description "HttpCore is a set of low level HTTP transport components
3557 that can be used to build custom client and server side HTTP services with a
3558 minimal footprint. HttpCore supports two I/O models: blocking I/O model based
3559 on the classic Java I/O and non-blocking, event driven I/O model based on Java
3560 NIO.
3561
3562 This package provides the blocking I/O model library.")
3563 (license license:asl2.0)))
3564
3565 (define-public java-httpcomponents-httpcore-nio
3566 (package (inherit java-httpcomponents-httpcore)
3567 (name "java-httpcomponents-httpcore-nio")
3568 (arguments
3569 `(#:jar-name "httpcomponents-httpcore-nio.jar"
3570 #:phases
3571 (modify-phases %standard-phases
3572 (add-after 'unpack 'chdir
3573 (lambda _ (chdir "httpcore-nio") #t)))))
3574 (inputs
3575 `(("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
3576 ("java-hamcrest-core" ,java-hamcrest-core)
3577 ,@(package-inputs java-httpcomponents-httpcore)))
3578 (description "HttpCore is a set of low level HTTP transport components
3579 that can be used to build custom client and server side HTTP services with a
3580 minimal footprint. HttpCore supports two I/O models: blocking I/O model based
3581 on the classic Java I/O and non-blocking, event driven I/O model based on Java
3582 NIO.
3583
3584 This package provides the non-blocking I/O model library based on Java
3585 NIO.")))
3586
3587 (define-public java-httpcomponents-httpcore-ab
3588 (package (inherit java-httpcomponents-httpcore)
3589 (name "java-httpcomponents-httpcore-ab")
3590 (arguments
3591 `(#:jar-name "httpcomponents-httpcore-ab.jar"
3592 #:phases
3593 (modify-phases %standard-phases
3594 (add-after 'unpack 'chdir
3595 (lambda _ (chdir "httpcore-ab") #t)))))
3596 (inputs
3597 `(("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
3598 ("java-commons-cli" ,java-commons-cli)
3599 ("java-hamcrest-core" ,java-hamcrest-core)
3600 ,@(package-inputs java-httpcomponents-httpcore)))
3601 (synopsis "Apache HttpCore benchmarking tool")
3602 (description "This package provides the HttpCore benchmarking tool. It is
3603 an Apache AB clone based on HttpCore.")))
3604
3605 (define-public java-httpcomponents-httpclient
3606 (package
3607 (name "java-httpcomponents-httpclient")
3608 (version "4.5.3")
3609 (source (origin
3610 (method url-fetch)
3611 (uri (string-append "mirror://apache/httpcomponents/httpclient/"
3612 "source/httpcomponents-client-"
3613 version "-src.tar.gz"))
3614 (sha256
3615 (base32
3616 "1428399s7qy3cim5wc6f3ks4gl9nf9vkjpfmnlap3jflif7g2pj1"))))
3617 (build-system ant-build-system)
3618 (arguments
3619 `(#:jar-name "httpcomponents-httpclient.jar"
3620 #:phases
3621 (modify-phases %standard-phases
3622 (add-after 'unpack 'chdir
3623 (lambda _ (chdir "httpclient") #t)))))
3624 (inputs
3625 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
3626 ("java-commons-codec" ,java-commons-codec)
3627 ("java-hamcrest-core" ,java-hamcrest-core)
3628 ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
3629 ("java-mockito" ,java-mockito-1)
3630 ("java-junit" ,java-junit)))
3631 (home-page "https://hc.apache.org/httpcomponents-client-ga/")
3632 (synopsis "HTTP client library for Java")
3633 (description "Although the @code{java.net} package provides basic
3634 functionality for accessing resources via HTTP, it doesn't provide the full
3635 flexibility or functionality needed by many applications. @code{HttpClient}
3636 seeks to fill this void by providing an efficient, up-to-date, and
3637 feature-rich package implementing the client side of the most recent HTTP
3638 standards and recommendations.")
3639 (license license:asl2.0)))
3640
3641 (define-public java-httpcomponents-httpmime
3642 (package (inherit java-httpcomponents-httpclient)
3643 (name "java-httpcomponents-httpmime")
3644 (arguments
3645 `(#:jar-name "httpcomponents-httpmime.jar"
3646 #:phases
3647 (modify-phases %standard-phases
3648 (add-after 'unpack 'chdir
3649 (lambda _ (chdir "httpmime") #t)))))
3650 (inputs
3651 `(("java-httpcomponents-httpclient" ,java-httpcomponents-httpclient)
3652 ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
3653 ("java-junit" ,java-junit)
3654 ("java-hamcrest-core" ,java-hamcrest-core)))))
3655
3656 (define-public java-commons-net
3657 (package
3658 (name "java-commons-net")
3659 (version "3.6")
3660 (source (origin
3661 (method url-fetch)
3662 (uri (string-append "mirror://apache/commons/net/source/"
3663 "commons-net-" version "-src.tar.gz"))
3664 (sha256
3665 (base32
3666 "0n0cmnddk9qdqhjvka8pc6hd9mn2qi3166f1s6xk32h7rfy1adxr"))))
3667 (build-system ant-build-system)
3668 (arguments
3669 `(;; FIXME: MainTest.java tries to read "examples.properties" (which
3670 ;; should be "resources/examples/examples.properties"), but gets "null"
3671 ;; instead.
3672 #:tests? #f
3673 #:jar-name "commons-net.jar"))
3674 (native-inputs
3675 `(("java-junit" ,java-junit)
3676 ("java-hamcrest-core" ,java-hamcrest-core)))
3677 (home-page "http://commons.apache.org/net/")
3678 (synopsis "Client library for many basic Internet protocols")
3679 (description "The Apache Commons Net library implements the client side of
3680 many basic Internet protocols. The purpose of the library is to provide
3681 fundamental protocol access, not higher-level abstractions.")
3682 (license license:asl2.0)))
3683
3684 (define-public java-jsch
3685 (package
3686 (name "java-jsch")
3687 (version "0.1.54")
3688 (source (origin
3689 (method url-fetch)
3690 (uri (string-append "mirror://sourceforge/jsch/jsch/"
3691 version "/jsch-" version ".zip"))
3692 (sha256
3693 (base32
3694 "029rdddyq1mh3ghryh3ki99kba1xkf1d1swjv2vi6lk6zzjy2wdb"))))
3695 (build-system ant-build-system)
3696 (arguments
3697 `(#:build-target "dist"
3698 #:tests? #f ; no tests included
3699 #:phases
3700 (modify-phases %standard-phases
3701 (replace 'install (install-jars "dist")))))
3702 (native-inputs
3703 `(("unzip" ,unzip)))
3704 (home-page "http://www.jcraft.com/jsch/")
3705 (synopsis "Pure Java implementation of SSH2")
3706 (description "JSch is a pure Java implementation of SSH2. JSch allows you
3707 to connect to an SSH server and use port forwarding, X11 forwarding, file
3708 transfer, etc., and you can integrate its functionality into your own Java
3709 programs.")
3710 (license license:bsd-3)))
3711
3712 (define-public java-commons-compress
3713 (package
3714 (name "java-commons-compress")
3715 (version "1.13")
3716 (source (origin
3717 (method url-fetch)
3718 (uri (string-append "mirror://apache/commons/compress/source/"
3719 "commons-compress-" version "-src.tar.gz"))
3720 (sha256
3721 (base32
3722 "1vjqvavrn0babffn1kciz6v52ibwq2vwhzlb95hazis3lgllnxc8"))))
3723 (build-system ant-build-system)
3724 (arguments
3725 `(#:jar-name "commons-compress.jar"
3726 #:phases
3727 (modify-phases %standard-phases
3728 (add-after 'unpack 'delete-bad-tests
3729 (lambda _
3730 (with-directory-excursion "src/test/java/org/apache/commons/compress/"
3731 ;; FIXME: These tests really should not fail. Maybe they are
3732 ;; indicative of problems with our Java packaging work.
3733
3734 ;; This test fails with a null pointer exception.
3735 (delete-file "archivers/sevenz/SevenZOutputFileTest.java")
3736 ;; This test fails to open test resources.
3737 (delete-file "archivers/zip/ExplodeSupportTest.java")
3738
3739 ;; FIXME: This test adds a dependency on powermock, which is hard to
3740 ;; package at this point.
3741 ;; https://github.com/powermock/powermock
3742 (delete-file "archivers/sevenz/SevenZNativeHeapTest.java"))
3743 #t)))))
3744 (inputs
3745 `(("java-junit" ,java-junit)
3746 ("java-hamcrest-core" ,java-hamcrest-core)
3747 ("java-mockito" ,java-mockito-1)
3748 ("java-xz" ,java-xz)))
3749 (home-page "https://commons.apache.org/proper/commons-compress/")
3750 (synopsis "Java library for working with compressed files")
3751 (description "The Apache Commons Compress library defines an API for
3752 working with compressed files such as ar, cpio, Unix dump, tar, zip, gzip, XZ,
3753 Pack200, bzip2, 7z, arj, lzma, snappy, DEFLATE, lz4 and Z files.")
3754 (license license:asl2.0)))
3755
3756 (define-public java-commons-csv
3757 (package
3758 (name "java-commons-csv")
3759 (version "1.4")
3760 (source (origin
3761 (method url-fetch)
3762 (uri (string-append "mirror://apache/commons/csv/source/"
3763 "commons-csv-" version "-src.tar.gz"))
3764 (sha256
3765 (base32
3766 "1l89m0fm2s3xx3v3iynvangymfg2vlyngaj6fgsi457nmsw7m7ij"))))
3767 (build-system ant-build-system)
3768 (arguments
3769 `(#:jar-name "commons-csv.jar"
3770 #:source-dir "src/main/java"
3771 #:tests? #f)); FIXME: requires java-h2
3772 (inputs
3773 `(("java-hamcrest-core" ,java-hamcrest-core)
3774 ("java-commons-io" ,java-commons-io)
3775 ("java-commons-lang3" ,java-commons-lang3)
3776 ("junit" ,java-junit)))
3777 (home-page "https://commons.apache.org/proper/commons-csv/")
3778 (synopsis "Read and write CSV documents")
3779 (description "Commons CSV reads and writes files in variations of the Comma
3780 Separated Value (CSV) format. The most common CSV formats are predefined in the
3781 CSVFormat class:
3782
3783 @itemize
3784 @item Microsoft Excel
3785 @item Informix UNLOAD
3786 @item Informix UNLOAD CSV
3787 @item MySQL
3788 @item RFC 4180
3789 @item TDF
3790 @end itemize
3791
3792 Custom formats can be created using a fluent style API.")
3793 (license license:asl2.0)))
3794
3795 (define-public java-osgi-annotation
3796 (package
3797 (name "java-osgi-annotation")
3798 (version "6.0.0")
3799 (source (origin
3800 (method url-fetch)
3801 (uri (string-append "https://repo1.maven.org/maven2/"
3802 "org/osgi/org.osgi.annotation/" version "/"
3803 "org.osgi.annotation-" version "-sources.jar"))
3804 (sha256
3805 (base32
3806 "1q718mb7gqg726rh6pc2hcisn8v50nv35abbir0jypmffhiii85w"))))
3807 (build-system ant-build-system)
3808 (arguments
3809 `(#:tests? #f ; no tests
3810 #:jar-name "osgi-annotation.jar"))
3811 (home-page "http://www.osgi.org")
3812 (synopsis "Annotation module of OSGi framework")
3813 (description
3814 "OSGi, for Open Services Gateway initiative framework, is a module system
3815 and service platform for the Java programming language. This package contains
3816 the OSGi annotation module, providing additional services to help dynamic
3817 components.")
3818 (license license:asl2.0)))
3819
3820 (define-public java-osgi-core
3821 (package
3822 (name "java-osgi-core")
3823 (version "6.0.0")
3824 (source (origin
3825 (method url-fetch)
3826 (uri (string-append "https://repo1.maven.org/maven2/"
3827 "org/osgi/org.osgi.core/" version "/"
3828 "org.osgi.core-" version "-sources.jar"))
3829 (sha256
3830 (base32
3831 "19bpf5jx32jq9789gyhin35q5v7flmw0p9mk7wbgqpxqfmxyiabv"))))
3832 (build-system ant-build-system)
3833 (arguments
3834 `(#:tests? #f ; no tests
3835 #:jar-name "osgi-core.jar"))
3836 (inputs
3837 `(("java-osgi-annotation" ,java-osgi-annotation)))
3838 (home-page "http://www.osgi.org")
3839 (synopsis "Core module of OSGi framework")
3840 (description
3841 "OSGi, for Open Services Gateway initiative framework, is a module system
3842 and service platform for the Java programming language. This package contains
3843 the OSGi Core module.")
3844 (license license:asl2.0)))
3845
3846 (define-public java-osgi-service-event
3847 (package
3848 (name "java-osgi-service-event")
3849 (version "1.3.1")
3850 (source (origin
3851 (method url-fetch)
3852 (uri (string-append "https://repo1.maven.org/maven2/"
3853 "org/osgi/org.osgi.service.event/"
3854 version "/org.osgi.service.event-"
3855 version "-sources.jar"))
3856 (sha256
3857 (base32
3858 "1nyhlgagwym75bycnjczwbnpymv2iw84zbhvvzk84g9q736i6qxm"))))
3859 (build-system ant-build-system)
3860 (arguments
3861 `(#:tests? #f ; no tests
3862 #:jar-name "osgi-service-event.jar"))
3863 (inputs
3864 `(("java-osgi-annotation" ,java-osgi-annotation)
3865 ("java-osgi-core" ,java-osgi-core)))
3866 (home-page "http://www.osgi.org")
3867 (synopsis "OSGi service event module")
3868 (description
3869 "OSGi, for Open Services Gateway initiative framework, is a module system
3870 and service platform for the Java programming language. This package contains
3871 the OSGi @code{org.osgi.service.event} module.")
3872 (license license:asl2.0)))
3873
3874 (define-public java-eclipse-osgi
3875 (package
3876 (name "java-eclipse-osgi")
3877 (version "3.11.3")
3878 (source (origin
3879 (method url-fetch)
3880 (uri (string-append "https://repo1.maven.org/maven2/"
3881 "org/eclipse/platform/org.eclipse.osgi/"
3882 version "/org.eclipse.osgi-"
3883 version "-sources.jar"))
3884 (sha256
3885 (base32
3886 "00cqc6lb29n0zv68b4l842vzkwawvbr7gshfdygsk8sicvcq2c7b"))))
3887 (build-system ant-build-system)
3888 (arguments
3889 `(#:tests? #f ; no tests included
3890 #:jar-name "eclipse-equinox-osgi.jar"))
3891 (inputs
3892 `(("java-osgi-annotation" ,java-osgi-annotation)))
3893 (home-page "http://www.eclipse.org/equinox/")
3894 (synopsis "Eclipse Equinox OSGi framework")
3895 (description "This package provides an implementation of the OSGi Core
3896 specification.")
3897 (license license:epl1.0)))
3898
3899 (define-public java-eclipse-equinox-common
3900 (package
3901 (name "java-eclipse-equinox-common")
3902 (version "3.8.0")
3903 (source (origin
3904 (method url-fetch)
3905 (uri (string-append "https://repo1.maven.org/maven2/"
3906 "org/eclipse/platform/org.eclipse.equinox.common/"
3907 version "/org.eclipse.equinox.common-"
3908 version "-sources.jar"))
3909 (sha256
3910 (base32
3911 "12aazpkgw46r1qj0pr421jzwhbmsizd97r37krd7njnbrdgfzksc"))))
3912 (build-system ant-build-system)
3913 (arguments
3914 `(#:tests? #f ; no tests included
3915 #:jar-name "eclipse-equinox-common.jar"))
3916 (inputs
3917 `(("java-eclipse-osgi" ,java-eclipse-osgi)))
3918 (home-page "http://www.eclipse.org/equinox/")
3919 (synopsis "Common Eclipse runtime")
3920 (description "This package provides the common Eclipse runtime.")
3921 (license license:epl1.0)))
3922
3923 (define-public java-eclipse-core-jobs
3924 (package
3925 (name "java-eclipse-core-jobs")
3926 (version "3.8.0")
3927 (source (origin
3928 (method url-fetch)
3929 (uri (string-append "https://repo1.maven.org/maven2/"
3930 "org/eclipse/platform/org.eclipse.core.jobs/"
3931 version "/org.eclipse.core.jobs-"
3932 version "-sources.jar"))
3933 (sha256
3934 (base32
3935 "0395b8lh0km8vhzjnchvs1rii1qz48hyvb2wqfaq4yhklbwihq4b"))))
3936 (build-system ant-build-system)
3937 (arguments
3938 `(#:tests? #f ; no tests included
3939 #:jar-name "eclipse-core-jobs.jar"))
3940 (inputs
3941 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3942 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3943 (home-page "http://www.eclipse.org/equinox/")
3944 (synopsis "Eclipse jobs mechanism")
3945 (description "This package provides the Eclipse jobs mechanism.")
3946 (license license:epl1.0)))
3947
3948 (define-public java-eclipse-equinox-registry
3949 (package
3950 (name "java-eclipse-equinox-registry")
3951 (version "3.6.100")
3952 (source (origin
3953 (method url-fetch)
3954 (uri (string-append "https://repo1.maven.org/maven2/"
3955 "org/eclipse/platform/org.eclipse.equinox.registry/"
3956 version "/org.eclipse.equinox.registry-"
3957 version "-sources.jar"))
3958 (sha256
3959 (base32
3960 "1i9sgymh2fy5vdgk5y7s3qvrlbgh4l93ddqi3v4zmca7hwrlhf9k"))))
3961 (build-system ant-build-system)
3962 (arguments
3963 `(#:tests? #f ; no tests included
3964 #:jar-name "eclipse-equinox-registry.jar"))
3965 (inputs
3966 `(("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
3967 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3968 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3969 (home-page "http://www.eclipse.org/equinox/")
3970 (synopsis "Eclipse extension registry support")
3971 (description "This package provides support for the Eclipse extension
3972 registry.")
3973 (license license:epl1.0)))
3974
3975 (define-public java-eclipse-equinox-app
3976 (package
3977 (name "java-eclipse-equinox-app")
3978 (version "1.3.400")
3979 (source (origin
3980 (method url-fetch)
3981 (uri (string-append "https://repo1.maven.org/maven2/"
3982 "org/eclipse/platform/org.eclipse.equinox.app/"
3983 version "/org.eclipse.equinox.app-"
3984 version "-sources.jar"))
3985 (sha256
3986 (base32
3987 "0nhvbp93y203ar7y59gb0mz3w2d3jlqhr0c9hii9bcfpmr7imdab"))))
3988 (build-system ant-build-system)
3989 (arguments
3990 `(#:tests? #f ; no tests included
3991 #:jar-name "eclipse-equinox-app.jar"))
3992 (inputs
3993 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3994 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3995 ("java-eclipse-osgi" ,java-eclipse-osgi)
3996 ("java-osgi-service-event" ,java-osgi-service-event)))
3997 (home-page "http://www.eclipse.org/equinox/")
3998 (synopsis "Equinox application container")
3999 (description "This package provides the Equinox application container for
4000 Eclipse.")
4001 (license license:epl1.0)))
4002
4003 (define-public java-eclipse-equinox-preferences
4004 (package
4005 (name "java-eclipse-equinox-preferences")
4006 (version "3.6.1")
4007 (source (origin
4008 (method url-fetch)
4009 (uri (string-append "https://repo1.maven.org/maven2/"
4010 "org/eclipse/platform/org.eclipse.equinox.preferences/"
4011 version "/org.eclipse.equinox.preferences-"
4012 version "-sources.jar"))
4013 (sha256
4014 (base32
4015 "0k7w6c141sqym4fy3af0qkwpy4pdh2vsjpjba6rp5fxyqa24v0a2"))))
4016 (build-system ant-build-system)
4017 (arguments
4018 `(#:tests? #f ; no tests included
4019 #:jar-name "eclipse-equinox-preferences.jar"))
4020 (inputs
4021 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4022 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
4023 ("java-eclipse-osgi" ,java-eclipse-osgi)))
4024 (home-page "http://www.eclipse.org/equinox/")
4025 (synopsis "Eclipse preferences mechanism")
4026 (description "This package provides the Eclipse preferences mechanism with
4027 the module @code{org.eclipse.equinox.preferences}.")
4028 (license license:epl1.0)))
4029
4030 (define-public java-eclipse-core-contenttype
4031 (package
4032 (name "java-eclipse-core-contenttype")
4033 (version "3.5.100")
4034 (source (origin
4035 (method url-fetch)
4036 (uri (string-append "https://repo1.maven.org/maven2/"
4037 "org/eclipse/platform/org.eclipse.core.contenttype/"
4038 version "/org.eclipse.core.contenttype-"
4039 version "-sources.jar"))
4040 (sha256
4041 (base32
4042 "1wcqcv7ijwv5rh748vz3x9pkmjl9w1r0k0026k56n8yjl4rrmspi"))))
4043 (build-system ant-build-system)
4044 (arguments
4045 `(#:tests? #f ; no tests included
4046 #:jar-name "eclipse-core-contenttype.jar"))
4047 (inputs
4048 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4049 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
4050 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
4051 ("java-eclipse-osgi" ,java-eclipse-osgi)))
4052 (home-page "http://www.eclipse.org/")
4053 (synopsis "Eclipse content mechanism")
4054 (description "This package provides the Eclipse content mechanism in the
4055 @code{org.eclipse.core.contenttype} module.")
4056 (license license:epl1.0)))
4057
4058 (define-public java-eclipse-core-runtime
4059 (package
4060 (name "java-eclipse-core-runtime")
4061 (version "3.12.0")
4062 (source (origin
4063 (method url-fetch)
4064 (uri (string-append "https://repo1.maven.org/maven2/"
4065 "org/eclipse/platform/org.eclipse.core.runtime/"
4066 version "/org.eclipse.core.runtime-"
4067 version "-sources.jar"))
4068 (sha256
4069 (base32
4070 "16mkf8jgj35pgzms7w1gyfq0gfm4ixw6c5xbbxzdj1la56c758ya"))))
4071 (build-system ant-build-system)
4072 (arguments
4073 `(#:tests? #f ; no tests included
4074 #:jar-name "eclipse-core-runtime.jar"))
4075 (inputs
4076 `(("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
4077 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
4078 ("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
4079 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4080 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
4081 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
4082 ("java-eclipse-osgi" ,java-eclipse-osgi)))
4083 (home-page "https://www.eclipse.org/")
4084 (synopsis "Eclipse core runtime")
4085 (description "This package provides the Eclipse core runtime with the
4086 module @code{org.eclipse.core.runtime}.")
4087 (license license:epl1.0)))
4088
4089 (define-public java-eclipse-core-filesystem
4090 (package
4091 (name "java-eclipse-core-filesystem")
4092 (version "1.6.1")
4093 (source (origin
4094 (method url-fetch)
4095 (uri (string-append "https://repo1.maven.org/maven2/"
4096 "org/eclipse/platform/org.eclipse.core.filesystem/"
4097 version "/org.eclipse.core.filesystem-"
4098 version "-sources.jar"))
4099 (sha256
4100 (base32
4101 "0km1bhwjim4rfy3pkvjhvy31kgsyf2ncx0mlkmbf5n6g57pphdyj"))))
4102 (build-system ant-build-system)
4103 (arguments
4104 `(#:tests? #f ; no tests included
4105 #:jar-name "eclipse-core-filesystem.jar"))
4106 (inputs
4107 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4108 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
4109 ("java-eclipse-osgi" ,java-eclipse-osgi)))
4110 (home-page "https://www.eclipse.org/")
4111 (synopsis "Eclipse core file system")
4112 (description "This package provides the Eclipse core file system with the
4113 module @code{org.eclipse.core.filesystem}.")
4114 (license license:epl1.0)))
4115
4116 (define-public java-eclipse-core-expressions
4117 (package
4118 (name "java-eclipse-core-expressions")
4119 (version "3.5.100")
4120 (source (origin
4121 (method url-fetch)
4122 (uri (string-append "https://repo1.maven.org/maven2/"
4123 "org/eclipse/platform/org.eclipse.core.expressions/"
4124 version "/org.eclipse.core.expressions-"
4125 version "-sources.jar"))
4126 (sha256
4127 (base32
4128 "18bw2l875gmygvpagpgk9l24qzbdjia4ag12nw6fi8v8yaq4987f"))))
4129 (build-system ant-build-system)
4130 (arguments
4131 `(#:tests? #f ; no tests included
4132 #:jar-name "eclipse-core-expressions.jar"))
4133 (inputs
4134 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4135 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
4136 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
4137 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
4138 ("java-eclipse-osgi" ,java-eclipse-osgi)))
4139 (home-page "https://www.eclipse.org/")
4140 (synopsis "Eclipse core expression language")
4141 (description "This package provides the Eclipse core expression language
4142 with the @code{org.eclipse.core.expressions} module.")
4143 (license license:epl1.0)))
4144
4145 (define-public java-eclipse-core-variables
4146 (package
4147 (name "java-eclipse-core-variables")
4148 (version "3.3.0")
4149 (source (origin
4150 (method url-fetch)
4151 (uri (string-append "https://repo1.maven.org/maven2/"
4152 "org/eclipse/platform/org.eclipse.core.variables/"
4153 version "/org.eclipse.core.variables-"
4154 version "-sources.jar"))
4155 (sha256
4156 (base32
4157 "12dirh03zi4n5x5cj07vzrhkmnqy6h9q10h9j605pagmpmifyxmy"))))
4158 (build-system ant-build-system)
4159 (arguments
4160 `(#:tests? #f ; no tests included
4161 #:jar-name "eclipse-core-variables.jar"))
4162 (inputs
4163 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4164 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
4165 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
4166 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
4167 ("java-eclipse-osgi" ,java-eclipse-osgi)))
4168 (home-page "https://www.eclipse.org/platform")
4169 (synopsis "Eclipse core variables")
4170 (description "This package provides the Eclipse core variables module
4171 @code{org.eclipse.core.variables}.")
4172 (license license:epl1.0)))
4173
4174 (define-public java-eclipse-ant-core
4175 (package
4176 (name "java-eclipse-ant-core")
4177 (version "3.4.100")
4178 (source (origin
4179 (method url-fetch)
4180 (uri (string-append "https://repo1.maven.org/maven2/"
4181 "org/eclipse/platform/org.eclipse.ant.core/"
4182 version "/org.eclipse.ant.core-"
4183 version "-sources.jar"))
4184 (sha256
4185 (base32
4186 "11g3if794qjlk98mz9zch22rr56sd7z63vn4i7k2icr8cq5bfqg7"))))
4187 (build-system ant-build-system)
4188 (arguments
4189 `(#:tests? #f ; no tests included
4190 #:jar-name "eclipse-ant-core.jar"))
4191 (inputs
4192 `(("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
4193 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4194 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
4195 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
4196 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
4197 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
4198 ("java-eclipse-core-variables" ,java-eclipse-core-variables)
4199 ("java-eclipse-osgi" ,java-eclipse-osgi)))
4200 (home-page "https://www.eclipse.org/platform")
4201 (synopsis "Ant build tool core libraries")
4202 (description "This package provides the ant build tool core libraries with
4203 the module @code{org.eclipse.ant.core}.")
4204 (license license:epl1.0)))
4205
4206 (define-public java-eclipse-core-resources
4207 (package
4208 (name "java-eclipse-core-resources")
4209 (version "3.11.1")
4210 (source (origin
4211 (method url-fetch)
4212 (uri (string-append "https://repo1.maven.org/maven2/"
4213 "org/eclipse/platform/org.eclipse.core.resources/"
4214 version "/org.eclipse.core.resources-"
4215 version "-sources.jar"))
4216 (sha256
4217 (base32
4218 "1hrfxrll6cpcagfksk2na1ypvkcnsp0fk6n3vcsrn97qayf9mx9l"))))
4219 (build-system ant-build-system)
4220 (arguments
4221 `(#:tests? #f ; no tests included
4222 #:jar-name "eclipse-core-resources.jar"))
4223 (inputs
4224 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4225 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
4226 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
4227 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
4228 ("java-eclipse-core-expressions" ,java-eclipse-core-expressions)
4229 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
4230 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
4231 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
4232 ("java-eclipse-ant-core" ,java-eclipse-ant-core)
4233 ("java-eclipse-osgi" ,java-eclipse-osgi)))
4234 (home-page "https://www.eclipse.org/")
4235 (synopsis "Eclipse core resource management")
4236 (description "This package provides the Eclipse core resource management
4237 module @code{org.eclipse.core.resources}.")
4238 (license license:epl1.0)))
4239
4240 (define-public java-eclipse-compare-core
4241 (package
4242 (name "java-eclipse-compare-core")
4243 (version "3.6.0")
4244 (source (origin
4245 (method url-fetch)
4246 (uri (string-append "https://repo1.maven.org/maven2/"
4247 "org/eclipse/platform/org.eclipse.compare.core/"
4248 version "/org.eclipse.compare.core-"
4249 version "-sources.jar"))
4250 (sha256
4251 (base32
4252 "10g37r0pbiffyv2wk35c6g5lwzkdipkl0kkjp41v84dln46xm4dg"))))
4253 (build-system ant-build-system)
4254 (arguments
4255 `(#:tests? #f ; no tests included
4256 #:jar-name "eclipse-compare-core.jar"))
4257 (inputs
4258 `(("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
4259 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4260 ("java-eclipse-osgi" ,java-eclipse-osgi)
4261 ("java-icu4j" ,java-icu4j)))
4262 (home-page "https://www.eclipse.org/")
4263 (synopsis "Eclipse core compare support")
4264 (description "This package provides the Eclipse core compare support
4265 module @code{org.eclipse.compare.core}.")
4266 (license license:epl1.0)))
4267
4268 (define-public java-eclipse-team-core
4269 (package
4270 (name "java-eclipse-team-core")
4271 (version "3.8.0")
4272 (source (origin
4273 (method url-fetch)
4274 (uri (string-append "https://repo1.maven.org/maven2/"
4275 "org/eclipse/platform/org.eclipse.team.core/"
4276 version "/org.eclipse.team.core-"
4277 version "-sources.jar"))
4278 (sha256
4279 (base32
4280 "02j2jzqgb26zx2d5ahxmvijw6j4r0la90zl5c3i65x6z19ciyam7"))))
4281 (build-system ant-build-system)
4282 (arguments
4283 `(#:tests? #f ; no tests included
4284 #:jar-name "eclipse-team-core.jar"))
4285 (inputs
4286 `(("java-eclipse-compare-core" ,java-eclipse-compare-core)
4287 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
4288 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
4289 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
4290 ("java-eclipse-core-resources" ,java-eclipse-core-resources)
4291 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
4292 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4293 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
4294 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
4295 ("java-eclipse-osgi" ,java-eclipse-osgi)))
4296 (home-page "https://www.eclipse.org/platform")
4297 (synopsis "Eclipse team support core")
4298 (description "This package provides the Eclipse team support core module
4299 @code{org.eclipse.team.core}.")
4300 (license license:epl1.0)))
4301
4302 (define-public java-eclipse-core-commands
4303 (package
4304 (name "java-eclipse-core-commands")
4305 (version "3.8.1")
4306 (source (origin
4307 (method url-fetch)
4308 (uri (string-append "https://repo1.maven.org/maven2/"
4309 "org/eclipse/platform/org.eclipse.core.commands/"
4310 version "/org.eclipse.core.commands-"
4311 version "-sources.jar"))
4312 (sha256
4313 (base32
4314 "0yjn482qndcfrsq3jd6vnhcylp16420f5aqkrwr8spsprjigjcr9"))))
4315 (build-system ant-build-system)
4316 (arguments
4317 `(#:tests? #f ; no tests included
4318 #:jar-name "eclipse-core-commands.jar"))
4319 (inputs
4320 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)))
4321 (home-page "https://www.eclipse.org/platform")
4322 (synopsis "Eclipse core commands")
4323 (description "This package provides Eclipse core commands in the module
4324 @code{org.eclipse.core.commands}.")
4325 (license license:epl1.0)))
4326
4327 (define-public java-eclipse-text
4328 (package
4329 (name "java-eclipse-text")
4330 (version "3.6.0")
4331 (source (origin
4332 (method url-fetch)
4333 (uri (string-append "https://repo1.maven.org/maven2/"
4334 "org/eclipse/platform/org.eclipse.text/"
4335 version "/org.eclipse.text-"
4336 version "-sources.jar"))
4337 (sha256
4338 (base32
4339 "0scz70vzz5qs5caji9f5q01vkqnvip7dpri1q07l8wbbdcxn4cq1"))))
4340 (build-system ant-build-system)
4341 (arguments
4342 `(#:tests? #f ; no tests included
4343 #:jar-name "eclipse-text.jar"
4344 #:phases
4345 (modify-phases %standard-phases
4346 ;; When creating a new category we must make sure that the new list
4347 ;; matches List<Position>. By default it seems to be too generic
4348 ;; (ArrayList<Object>), so we specialize it to ArrayList<Position>.
4349 ;; Without this we get this error:
4350 ;;
4351 ;; [javac] .../src/org/eclipse/jface/text/AbstractDocument.java:376:
4352 ;; error: method put in interface Map<K,V> cannot be applied to given types;
4353 ;; [javac] fPositions.put(category, new ArrayList<>());
4354 ;; [javac] ^
4355 ;; [javac] required: String,List<Position>
4356 ;; [javac] found: String,ArrayList<Object>
4357 ;; [javac] reason: actual argument ArrayList<Object> cannot be converted
4358 ;; to List<Position> by method invocation conversion
4359 ;; [javac] where K,V are type-variables:
4360 ;; [javac] K extends Object declared in interface Map
4361 ;; [javac] V extends Object declared in interface Map
4362 ;;
4363 ;; I don't know if this is a good fix. I suspect it is not, but it
4364 ;; seems to work.
4365 (add-after 'unpack 'fix-compilation-error
4366 (lambda _
4367 (substitute* "src/org/eclipse/jface/text/AbstractDocument.java"
4368 (("Positions.put\\(category, new ArrayList<>\\(\\)\\);")
4369 "Positions.put(category, new ArrayList<Position>());"))
4370 #t)))))
4371 (inputs
4372 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4373 ("java-eclipse-core-commands" ,java-eclipse-core-commands)
4374 ("java-icu4j" ,java-icu4j)))
4375 (home-page "http://www.eclipse.org/platform")
4376 (synopsis "Eclipse text library")
4377 (description "Platform Text is part of the Platform UI project and
4378 provides the basic building blocks for text and text editors within Eclipse
4379 and contributes the Eclipse default text editor.")
4380 (license license:epl1.0)))
4381
4382 (define-public java-eclipse-jdt-core
4383 (package
4384 (name "java-eclipse-jdt-core")
4385 (version "3.12.3")
4386 (source (origin
4387 (method url-fetch)
4388 (uri (string-append "https://repo1.maven.org/maven2/"
4389 "org/eclipse/jdt/org.eclipse.jdt.core/"
4390 version "/org.eclipse.jdt.core-"
4391 version "-sources.jar"))
4392 (sha256
4393 (base32
4394 "191xw4lc7mjjkprh4ji5vnpjvr5r4zvbpwkriy4bvsjqrz35vh1j"))))
4395 (build-system ant-build-system)
4396 (arguments
4397 `(#:tests? #f ; no tests included
4398 #:jar-name "eclipse-jdt-core.jar"))
4399 (inputs
4400 `(("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
4401 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
4402 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
4403 ("java-eclipse-core-resources" ,java-eclipse-core-resources)
4404 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
4405 ("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
4406 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4407 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
4408 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
4409 ("java-eclipse-osgi" ,java-eclipse-osgi)
4410 ("java-eclipse-text" ,java-eclipse-text)))
4411 (home-page "https://www.eclipse.org/jdt")
4412 (synopsis "Java development tools core libraries")
4413 (description "This package provides the core libraries of the Eclipse Java
4414 development tools.")
4415 (license license:epl1.0)))
4416
4417 (define-public java-javax-mail
4418 (package
4419 (name "java-javax-mail")
4420 (version "1.5.6")
4421 (source (origin
4422 (method url-fetch)
4423 (uri (string-append "https://repo1.maven.org/maven2/"
4424 "com/sun/mail/javax.mail/"
4425 version "/javax.mail-"
4426 version "-sources.jar"))
4427 (sha256
4428 (base32
4429 "0sdlfgsc2b5s89xv1261y8i0jijcja019k2x1c8ngfn582w4jly9"))))
4430 (build-system ant-build-system)
4431 (arguments
4432 `(#:tests? #f ; no tests
4433 #:jar-name "javax-mail.jar"))
4434 (home-page "https://javamail.java.net")
4435 (synopsis "Reference implementation of the JavaMail API")
4436 (description
4437 "This package provides versions of the JavaMail API implementation, IMAP,
4438 SMTP, and POP3 service providers, some examples, and documentation for the
4439 JavaMail API.")
4440 ;; GPLv2 only with "classpath exception".
4441 (license license:gpl2)))
4442
4443 (define-public java-log4j-api
4444 (package
4445 (name "java-log4j-api")
4446 (version "2.4.1")
4447 (source (origin
4448 (method url-fetch)
4449 (uri (string-append "mirror://apache/logging/log4j/" version
4450 "/apache-log4j-" version "-src.tar.gz"))
4451 (sha256
4452 (base32
4453 "0j5p9gik0jysh37nlrckqbky12isy95cpwg2gv5fas1rcdqbraxd"))))
4454 (build-system ant-build-system)
4455 (arguments
4456 `(#:tests? #f ; tests require unpackaged software
4457 #:jar-name "log4j-api.jar"
4458 #:make-flags
4459 (list (string-append "-Ddist.dir=" (assoc-ref %outputs "out")
4460 "/share/java"))
4461 #:phases
4462 (modify-phases %standard-phases
4463 (add-after 'unpack 'enter-dir
4464 (lambda _ (chdir "log4j-api") #t))
4465 ;; FIXME: The tests require additional software that has not been
4466 ;; packaged yet, such as
4467 ;; * org.apache.maven
4468 ;; * org.apache.felix
4469 (add-after 'enter-dir 'delete-tests
4470 (lambda _ (delete-file-recursively "src/test") #t)))))
4471 (inputs
4472 `(("java-osgi-core" ,java-osgi-core)
4473 ("java-hamcrest-core" ,java-hamcrest-core)
4474 ("java-junit" ,java-junit)))
4475 (home-page "http://logging.apache.org/log4j/2.x/")
4476 (synopsis "API module of the Log4j logging framework for Java")
4477 (description
4478 "This package provides the API module of the Log4j logging framework for
4479 Java.")
4480 (license license:asl2.0)))
4481
4482 (define-public java-log4j-core
4483 (package
4484 (inherit java-log4j-api)
4485 (name "java-log4j-core")
4486 (inputs
4487 `(("java-osgi-core" ,java-osgi-core)
4488 ("java-hamcrest-core" ,java-hamcrest-core)
4489 ("java-log4j-api" ,java-log4j-api)
4490 ("java-mail" ,java-mail)
4491 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
4492 ("java-lmax-disruptor" ,java-lmax-disruptor)
4493 ("java-kafka" ,java-kafka-clients)
4494 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
4495 ("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
4496 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
4497 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
4498 ("java-fasterxml-jackson-dataformat-xml" ,java-fasterxml-jackson-dataformat-xml)
4499 ("java-fasterxml-jackson-dataformat-yaml" ,java-fasterxml-jackson-dataformat-yaml)
4500 ("java-commons-compress" ,java-commons-compress)
4501 ("java-commons-csv" ,java-commons-csv)
4502 ("java-jeromq" ,java-jeromq)
4503 ("java-junit" ,java-junit)))
4504 (native-inputs
4505 `(("hamcrest" ,java-hamcrest-all)
4506 ("java-commons-io" ,java-commons-io)
4507 ("java-commons-lang3" ,java-commons-lang3)
4508 ("slf4j" ,java-slf4j-api)))
4509 (arguments
4510 `(#:tests? #f ; tests require more dependencies
4511 #:test-dir "src/test"
4512 #:source-dir "src/main/java"
4513 #:jar-name "log4j-core.jar"
4514 #:jdk ,icedtea-8
4515 #:make-flags
4516 (list (string-append "-Ddist.dir=" (assoc-ref %outputs "out")
4517 "/share/java"))
4518 #:phases
4519 (modify-phases %standard-phases
4520 (add-after 'unpack 'enter-dir
4521 (lambda _ (chdir "log4j-core") #t)))))
4522 (synopsis "Core component of the Log4j framework")
4523 (description "This package provides the core component of the Log4j
4524 logging framework for Java.")))
4525
4526 (define-public java-log4j-1.2-api
4527 (package
4528 (inherit java-log4j-api)
4529 (name "java-log4j-1.2-api")
4530 (arguments
4531 `(#:jar-name "java-log4j-1.2-api.jar"
4532 #:source-dir "log4j-1.2-api/src/main/java"
4533 #:jdk ,icedtea-8
4534 ;; Tests require maven-model (and other maven subprojects), which is a
4535 ;; cyclic dependency.
4536 #:tests? #f))
4537 (inputs
4538 `(("log4j-api" ,java-log4j-api)
4539 ("log4j-core" ,java-log4j-core)
4540 ("osgi-core" ,java-osgi-core)
4541 ("eclipse-osgi" ,java-eclipse-osgi)
4542 ("java-lmax-disruptor" ,java-lmax-disruptor)))))
4543
4544 (define-public java-commons-cli
4545 (package
4546 (name "java-commons-cli")
4547 (version "1.3.1")
4548 (source (origin
4549 (method url-fetch)
4550 (uri (string-append "mirror://apache/commons/cli/source/"
4551 "commons-cli-" version "-src.tar.gz"))
4552 (sha256
4553 (base32
4554 "1fkjn552i12vp3xxk21ws4p70fi0lyjm004vzxsdaz7gdpgyxxyl"))))
4555 (build-system ant-build-system)
4556 ;; TODO: javadoc
4557 (arguments
4558 `(#:jar-name "commons-cli.jar"))
4559 (native-inputs
4560 `(("java-junit" ,java-junit)
4561 ("java-hamcrest-core" ,java-hamcrest-core)))
4562 (home-page "http://commons.apache.org/cli/")
4563 (synopsis "Command line arguments and options parsing library")
4564 (description "The Apache Commons CLI library provides an API for parsing
4565 command line options passed to programs. It is also able to print help
4566 messages detailing the options available for a command line tool.
4567
4568 Commons CLI supports different types of options:
4569
4570 @itemize
4571 @item POSIX like options (ie. tar -zxvf foo.tar.gz)
4572 @item GNU like long options (ie. du --human-readable --max-depth=1)
4573 @item Java like properties (ie. java -Djava.awt.headless=true Foo)
4574 @item Short options with value attached (ie. gcc -O2 foo.c)
4575 @item long options with single hyphen (ie. ant -projecthelp)
4576 @end itemize
4577
4578 This is a part of the Apache Commons Project.")
4579 (license license:asl2.0)))
4580
4581 (define-public java-commons-codec
4582 (package
4583 (name "java-commons-codec")
4584 (version "1.10")
4585 (source (origin
4586 (method url-fetch)
4587 (uri (string-append "mirror://apache/commons/codec/source/"
4588 "commons-codec-" version "-src.tar.gz"))
4589 (sha256
4590 (base32
4591 "1w9qg30y4s0x8gnmr2fgj4lyplfn788jqxbcz27lf5kbr6n8xr65"))))
4592 (build-system ant-build-system)
4593 (outputs '("out" "doc"))
4594 (arguments
4595 `(#:test-target "test"
4596 #:make-flags
4597 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
4598 (junit (assoc-ref %build-inputs "java-junit")))
4599 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
4600 (string-append "-Dhamcrest.jar=" hamcrest
4601 "/share/java/hamcrest-core.jar")
4602 ;; Do not append version to jar.
4603 "-Dfinal.name=commons-codec"))
4604 #:phases
4605 (modify-phases %standard-phases
4606 (add-after 'build 'build-javadoc ant-build-javadoc)
4607 (replace 'install (install-jars "dist"))
4608 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
4609 (native-inputs
4610 `(("java-junit" ,java-junit)
4611 ("java-hamcrest-core" ,java-hamcrest-core)))
4612 (home-page "http://commons.apache.org/codec/")
4613 (synopsis "Common encoders and decoders such as Base64, Hex, Phonetic and URLs")
4614 (description "The codec package contains simple encoder and decoders for
4615 various formats such as Base64 and Hexadecimal. In addition to these widely
4616 used encoders and decoders, the codec package also maintains a collection of
4617 phonetic encoding utilities.
4618
4619 This is a part of the Apache Commons Project.")
4620 (license license:asl2.0)))
4621
4622 (define-public java-commons-daemon
4623 (package
4624 (name "java-commons-daemon")
4625 (version "1.0.15")
4626 (source (origin
4627 (method url-fetch)
4628 (uri (string-append "mirror://apache/commons/daemon/source/"
4629 "commons-daemon-" version "-src.tar.gz"))
4630 (sha256
4631 (base32
4632 "0ci46kq8jpz084ccwq0mmkahcgsmh20ziclp2jf5i0djqv95gvhi"))))
4633 (build-system ant-build-system)
4634 (arguments
4635 `(#:test-target "test"
4636 #:phases
4637 (modify-phases %standard-phases
4638 (add-after 'build 'build-javadoc ant-build-javadoc)
4639 (replace 'install (install-jars "dist"))
4640 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
4641 (native-inputs
4642 `(("java-junit" ,java-junit)))
4643 (home-page "http://commons.apache.org/daemon/")
4644 (synopsis "Library to launch Java applications as daemons")
4645 (description "The Daemon package from Apache Commons can be used to
4646 implement Java applications which can be launched as daemons. For example the
4647 program will be notified about a shutdown so that it can perform cleanup tasks
4648 before its process of execution is destroyed by the operation system.
4649
4650 This package contains the Java library. You will also need the actual binary
4651 for your architecture which is provided by the jsvc package.
4652
4653 This is a part of the Apache Commons Project.")
4654 (license license:asl2.0)))
4655
4656 (define-public java-javaewah
4657 (package
4658 (name "java-javaewah")
4659 (version "1.1.6")
4660 (source (origin
4661 (method url-fetch)
4662 (uri (string-append "https://github.com/lemire/javaewah/"
4663 "archive/JavaEWAH-" version ".tar.gz"))
4664 (sha256
4665 (base32
4666 "1n7j1r1h24wlhwv9zdcj6yqjrhma2ixwyzm15l5vrv6yqjs6753b"))))
4667 (build-system ant-build-system)
4668 (arguments `(#:jar-name "javaewah.jar"))
4669 (inputs
4670 `(("java-junit" ,java-junit)
4671 ("java-hamcrest-core" ,java-hamcrest-core)))
4672 (home-page "https://github.com/lemire/javaewah")
4673 (synopsis "Compressed alternative to the Java @code{BitSet} class")
4674 (description "This is a word-aligned compressed variant of the Java
4675 @code{Bitset} class. It provides both a 64-bit and a 32-bit RLE-like
4676 compression scheme. It can be used to implement bitmap indexes.
4677
4678 The goal of word-aligned compression is not to achieve the best compression,
4679 but rather to improve query processing time. Hence, JavaEWAH tries to save CPU
4680 cycles, maybe at the expense of storage. However, the EWAH scheme is always
4681 more efficient storage-wise than an uncompressed bitmap (as implemented in the
4682 @code{BitSet} class by Sun).")
4683 ;; GPL2.0 derivates are explicitly allowed.
4684 (license license:asl2.0)))
4685
4686 (define-public java-slf4j-api
4687 (package
4688 (name "java-slf4j-api")
4689 (version "1.7.25")
4690 (source (origin
4691 (method url-fetch)
4692 (uri (string-append "https://www.slf4j.org/dist/slf4j-"
4693 version ".tar.gz"))
4694 (sha256
4695 (base32
4696 "13j51sgzmhhdrfa74gkal5zpip7r1440dh7zsi2c8bpb2zs1v8kb"))
4697 (modules '((guix build utils)))
4698 ;; Delete bundled jars.
4699 (snippet
4700 '(begin
4701 (for-each delete-file (find-files "." "\\.jar$"))
4702 #t))))
4703 (build-system ant-build-system)
4704 (arguments
4705 `(#:jar-name "slf4j-api.jar"
4706 #:source-dir "slf4j-api/src/main"
4707 #:test-dir "slf4j-api/src/test"
4708 #:phases
4709 (modify-phases %standard-phases
4710 (add-after 'build 'regenerate-jar
4711 (lambda _
4712 ;; pom.xml ignores these files in the jar creation process. If we don't,
4713 ;; we get the error "This code should have never made it into slf4j-api.jar"
4714 (delete-file-recursively "build/classes/org/slf4j/impl")
4715 (zero? (system* "jar" "-cf" "build/jar/slf4j-api.jar" "-C"
4716 "build/classes" "."))))
4717 (add-before 'check 'dont-test-abstract-classes
4718 (lambda _
4719 ;; abstract classes are not meant to be run with junit
4720 (substitute* "build.xml"
4721 (("<include name=\"\\*\\*/\\*Test.java\" />")
4722 (string-append "<include name=\"**/*Test.java\" />"
4723 "<exclude name=\"**/MultithreadedInitializationTest"
4724 ".java\" />"))))))))
4725 (inputs
4726 `(("java-junit" ,java-junit)
4727 ("java-hamcrest-core" ,java-hamcrest-core)))
4728 (home-page "https://www.slf4j.org/")
4729 (synopsis "Simple logging facade for Java")
4730 (description "The Simple Logging Facade for Java (SLF4J) serves as a
4731 simple facade or abstraction for various logging
4732 frameworks (e.g. @code{java.util.logging}, @code{logback}, @code{log4j})
4733 allowing the end user to plug in the desired logging framework at deployment
4734 time.")
4735 (license license:expat)))
4736
4737 (define-public java-slf4j-simple
4738 (package
4739 (name "java-slf4j-simple")
4740 (version "1.7.25")
4741 (source (package-source java-slf4j-api))
4742 (build-system ant-build-system)
4743 (arguments
4744 `(#:jar-name "slf4j-simple.jar"
4745 #:source-dir "slf4j-simple/src/main"
4746 #:test-dir "slf4j-simple/src/test"
4747 #:phases
4748 (modify-phases %standard-phases
4749 ;; The tests need some test classes from slf4j-api
4750 (add-before 'check 'build-slf4j-api-test-helpers
4751 (lambda _
4752 ;; Add current dir to CLASSPATH ...
4753 (setenv "CLASSPATH"
4754 (string-append (getcwd) ":" (getenv "CLASSPATH")))
4755 ;; ... and build test helper classes here:
4756 (zero?
4757 (apply system*
4758 `("javac" "-d" "."
4759 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))))))
4760 (inputs
4761 `(("java-junit" ,java-junit)
4762 ("java-hamcrest-core" ,java-hamcrest-core)
4763 ("java-slf4j-api" ,java-slf4j-api)))
4764 (home-page "https://www.slf4j.org/")
4765 (synopsis "Simple implementation of simple logging facade for Java")
4766 (description "SLF4J binding for the Simple implementation, which outputs
4767 all events to System.err. Only messages of level INFO and higher are
4768 printed.")
4769 (license license:expat)))
4770
4771 (define-public antlr2
4772 (package
4773 (name "antlr2")
4774 (version "2.7.7")
4775 (source (origin
4776 (method url-fetch)
4777 (uri (string-append "http://www.antlr2.org/download/antlr-"
4778 version ".tar.gz"))
4779 (sha256
4780 (base32
4781 "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5"))
4782 (modules '((guix build utils)))
4783 (snippet
4784 '(begin
4785 (delete-file "antlr.jar")
4786 (substitute* "lib/cpp/antlr/CharScanner.hpp"
4787 (("#include <map>")
4788 (string-append
4789 "#include <map>\n"
4790 "#define EOF (-1)\n"
4791 "#include <strings.h>")))
4792 (substitute* "configure"
4793 (("/bin/sh") "sh"))
4794 #t))))
4795 (build-system gnu-build-system)
4796 (arguments
4797 `(#:tests? #f ; no test target
4798 #:imported-modules ((guix build ant-build-system)
4799 (guix build syscalls)
4800 ,@%gnu-build-system-modules)
4801 #:modules (((guix build ant-build-system) #:prefix ant:)
4802 (guix build gnu-build-system)
4803 (guix build utils))
4804 #:phases
4805 (modify-phases %standard-phases
4806 (add-after 'install 'strip-jar-timestamps
4807 (assoc-ref ant:%standard-phases 'strip-jar-timestamps))
4808 (add-after 'configure 'fix-bin-ls
4809 (lambda _
4810 (substitute* (find-files "." "Makefile")
4811 (("/bin/ls") "ls"))
4812 #t)))))
4813 (native-inputs
4814 `(("which" ,which)
4815 ("zip" ,zip)
4816 ("java" ,icedtea "jdk")))
4817 (inputs
4818 `(("java" ,icedtea)))
4819 (home-page "http://www.antlr2.org")
4820 (synopsis "Framework for constructing recognizers, compilers, and translators")
4821 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
4822 is a language tool that provides a framework for constructing recognizers,
4823 compilers, and translators from grammatical descriptions containing Java, C#,
4824 C++, or Python actions. ANTLR provides excellent support for tree construction,
4825 tree walking, and translation.")
4826 (license license:public-domain)))
4827
4828 (define-public java-stringtemplate-3
4829 (package
4830 (name "java-stringtemplate")
4831 (version "3.2.1")
4832 (source (origin
4833 (method url-fetch)
4834 (uri (string-append "https://github.com/antlr/website-st4/raw/"
4835 "gh-pages/download/stringtemplate-"
4836 version ".tar.gz"))
4837 (sha256
4838 (base32
4839 "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is"))))
4840 (build-system ant-build-system)
4841 (arguments
4842 `(#:jar-name (string-append ,name "-" ,version ".jar")
4843 #:test-dir "test"
4844 #:modules ((guix build ant-build-system)
4845 (guix build utils)
4846 (srfi srfi-1))
4847 #:phases
4848 (modify-phases %standard-phases
4849 (add-before 'check 'fix-tests
4850 (lambda _
4851 (substitute* "build.xml"
4852 (("\\$\\{test.home\\}/java")
4853 "${test.home}/org"))
4854 #t))
4855 (add-before 'build 'generate-grammar
4856 (lambda _
4857 (with-directory-excursion "src/org/antlr/stringtemplate/language/"
4858 (every (lambda (file)
4859 (format #t "~a\n" file)
4860 (zero? (system* "antlr" file)))
4861 '("template.g" "angle.bracket.template.g" "action.g"
4862 "eval.g" "group.g" "interface.g"))))))))
4863 (native-inputs
4864 `(("antlr" ,antlr2)
4865 ("java-junit" ,java-junit)))
4866 (home-page "http://www.stringtemplate.org")
4867 (synopsis "Template engine to generate formatted text output")
4868 (description "StringTemplate is a java template engine (with ports for C#,
4869 Objective-C, JavaScript, Scala) for generating source code, web pages, emails,
4870 or any other formatted text output. StringTemplate is particularly good at
4871 code generators, multiple site skins, and internationalization / localization.
4872 StringTemplate also powers ANTLR.")
4873 (license license:bsd-3)))
4874
4875 ;; antlr3 is partially written using antlr3 grammar files. It also depends on
4876 ;; ST4 (stringtemplate4), which is also partially written using antlr3 grammar
4877 ;; files and uses antlr3 at runtime. The latest version requires a recent version
4878 ;; of antlr3 at runtime.
4879 ;; Fortunately, ST4 4.0.6 can be built with an older antlr3, and we use antlr3.3.
4880 ;; This version of ST4 is sufficient for the latest antlr3.
4881 ;; We use ST4 4.0.6 to build a boostrap antlr3 (latest version), and build
4882 ;; the latest ST4 with it. Then we build our final antlr3 that will be linked
4883 ;; against the latest ST4.
4884 ;; antlr3.3 still depends on antlr3 to generate some files, so we use an
4885 ;; even older version, antlr3.1, to generate them. Fortunately antlr3.1 uses
4886 ;; only grammar files with the antlr2 syntax.
4887 ;; So we build antlr3.1 -> antlr3.3 -> ST4.0.6 -> antlr3-bootstrap -> ST4 -> antlr3.
4888
4889 (define-public java-stringtemplate
4890 (package (inherit java-stringtemplate-3)
4891 (name "java-stringtemplate")
4892 (version "4.0.8")
4893 (source (origin
4894 (method url-fetch)
4895 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/"
4896 version ".tar.gz"))
4897 (file-name (string-append name "-" version ".tar.gz"))
4898 (sha256
4899 (base32
4900 "1pri8hqa95rfdkjy55icl5q1m09zwp5k67ib14abas39s4v3w087"))))
4901 (build-system ant-build-system)
4902 (arguments
4903 `(#:jar-name (string-append ,name "-" ,version ".jar")
4904 #:tests? #f ; FIXME: tests fail for unknown reasons
4905 #:test-dir "test"
4906 #:modules ((guix build ant-build-system)
4907 (guix build utils)
4908 (srfi srfi-1))
4909 #:phases
4910 (modify-phases %standard-phases
4911 (add-before 'check 'fix-test-target
4912 (lambda _
4913 (substitute* "build.xml"
4914 (("\\$\\{test.home\\}/java") "${test.home}/")
4915 (("\\*Test.java") "Test*.java"))
4916 #t))
4917 (add-before 'build 'generate-grammar
4918 (lambda _
4919 (with-directory-excursion "src/org/stringtemplate/v4/compiler/"
4920 (every (lambda (file)
4921 (format #t "~a\n" file)
4922 (zero? (system* "antlr3" file)))
4923 '("STParser.g" "Group.g" "CodeGenerator.g"))))))))
4924 (inputs
4925 `(("antlr3" ,antlr3-bootstrap)
4926 ("antlr2" ,antlr2)
4927 ("java-stringtemplate" ,java-stringtemplate-3)
4928 ("java-junit" ,java-junit)))))
4929
4930 (define java-stringtemplate-4.0.6
4931 (package (inherit java-stringtemplate)
4932 (name "java-stringtemplate")
4933 (version "4.0.6")
4934 (source (origin
4935 (method url-fetch)
4936 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/ST-"
4937 version ".tar.gz"))
4938 (file-name (string-append name "-" version ".tar.gz"))
4939 (sha256
4940 (base32
4941 "0hjmh1ahdsh3w825i67mli9l4nncc4l6hdbf9ma91jvlj590sljp"))))
4942 (inputs
4943 `(("antlr3" ,antlr3-3.3)
4944 ("antlr2" ,antlr2)
4945 ("java-stringtemplate" ,java-stringtemplate-3)))))
4946
4947 (define-public antlr3
4948 (package
4949 (name "antlr3")
4950 (version "3.5.2")
4951 (source (origin
4952 (method url-fetch)
4953 (uri (string-append "https://github.com/antlr/antlr3/archive/"
4954 version ".tar.gz"))
4955 (file-name (string-append name "-" version ".tar.gz"))
4956 (sha256
4957 (base32
4958 "0218v683081lg54z9hvjxinhxd4dqp870jx6n39gslm0bkyi4vd6"))))
4959 (build-system ant-build-system)
4960 (arguments
4961 `(#:jar-name (string-append ,name "-" ,version ".jar")
4962 #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3"
4963 #:tests? #f
4964 #:phases
4965 (modify-phases %standard-phases
4966 (add-after 'install 'bin-install
4967 (lambda* (#:key inputs outputs #:allow-other-keys)
4968 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
4969 (bin (string-append (assoc-ref outputs "out") "/bin")))
4970 (mkdir-p bin)
4971 (with-output-to-file (string-append bin "/antlr3")
4972 (lambda _
4973 (display
4974 (string-append "#!" (which "sh") "\n"
4975 "java -cp " jar "/" ,name "-" ,version ".jar:"
4976 (string-concatenate
4977 (find-files (assoc-ref inputs "stringtemplate")
4978 ".*\\.jar"))
4979 ":"
4980 (string-concatenate
4981 (find-files (assoc-ref inputs "stringtemplate4")
4982 ".*\\.jar"))
4983 ":"
4984 (string-concatenate
4985 (find-files (string-append
4986 (assoc-ref inputs "antlr")
4987 "/lib")
4988 ".*\\.jar"))
4989 " org.antlr.Tool $*"))))
4990 (chmod (string-append bin "/antlr3") #o755))))
4991 (add-before 'build 'generate-grammar
4992 (lambda _
4993 (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/")
4994 (for-each (lambda (file)
4995 (display file)
4996 (newline)
4997 (system* "antlr3" file))
4998 '("ANTLR.g" "ANTLRTreePrinter.g" "ActionAnalysis.g"
4999 "AssignTokenTypesWalker.g"
5000 "ActionTranslator.g" "TreeToNFAConverter.g"
5001 "ANTLRv3.g" "ANTLRv3Tree.g" "LeftRecursiveRuleWalker.g"
5002 "CodeGenTreeWalker.g" "DefineGrammarItemsWalker.g"))
5003 (substitute* "ANTLRParser.java"
5004 (("public Object getTree") "public GrammarAST getTree"))
5005 (substitute* "ANTLRv3Parser.java"
5006 (("public Object getTree") "public CommonTree getTree"))
5007 (chdir "../../../../../java")
5008 (system* "antlr" "-o" "org/antlr/tool"
5009 "org/antlr/tool/serialize.g")
5010 (substitute* "org/antlr/tool/LeftRecursiveRuleAnalyzer.java"
5011 (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*;
5012 import org.antlr.grammar.v3.ANTLRTreePrinter;"))
5013 (substitute* "org/antlr/tool/ErrorManager.java"
5014 (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") ""))
5015 (chdir "../../../..")))
5016 (add-before 'build 'fix-build-xml
5017 (lambda _
5018 (substitute* "build.xml"
5019 (("<exec") "<copy todir=\"${classes.dir}\">
5020 <fileset dir=\"tool/src/main/resources\">
5021 <include name=\"**/*.stg\"/>
5022 <include name=\"**/*.st\"/>
5023 <include name=\"**/*.sti\"/>
5024 <include name=\"**/STLexer.tokens\"/>
5025 </fileset>
5026 </copy><exec")))))))
5027 (native-inputs
5028 `(("antlr" ,antlr2)
5029 ("antlr3" ,antlr3-bootstrap)))
5030 (inputs
5031 `(("junit" ,java-junit)
5032 ("stringtemplate" ,java-stringtemplate-3)
5033 ("stringtemplate4" ,java-stringtemplate)))
5034 (propagated-inputs
5035 `(("stringtemplate" ,java-stringtemplate-3)
5036 ("antlr" ,antlr2)
5037 ("stringtemplate4" ,java-stringtemplate-4.0.6)))
5038 (home-page "http://www.antlr3.org")
5039 (synopsis "Framework for constructing recognizers, compilers, and translators")
5040 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
5041 is a language tool that provides a framework for constructing recognizers,
5042 compilers, and translators from grammatical descriptions containing Java, C#,
5043 C++, or Python actions. ANTLR provides excellent support for tree construction,
5044 tree walking, and translation.")
5045 (license license:bsd-3)))
5046
5047 (define antlr3-bootstrap
5048 (package
5049 (inherit antlr3)
5050 (name "antlr3-bootstrap")
5051 (native-inputs
5052 `(("antlr" ,antlr2)
5053 ("antlr3" ,antlr3-3.3)))
5054 (inputs
5055 `(("junit" ,java-junit)))))
5056
5057 (define antlr3-3.3
5058 (package
5059 (inherit antlr3)
5060 (name "antlr3")
5061 (version "3.3")
5062 (source (origin
5063 (method url-fetch)
5064 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
5065 "gh-pages/download/antlr-"
5066 version ".tar.gz"))
5067 (sha256
5068 (base32
5069 "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m"))))
5070 (arguments
5071 `(#:jar-name (string-append ,name "-" ,version ".jar")
5072 #:source-dir (string-join '("tool/src/main/java"
5073 "runtime/Java/src/main/java"
5074 "tool/src/main/antlr2"
5075 "tool/src/main/antlr3")
5076 ":")
5077 #:tests? #f ; FIXME: tests seem to require maven plugin
5078 #:modules ((guix build ant-build-system)
5079 (guix build utils)
5080 (srfi srfi-1))
5081 #:phases
5082 (modify-phases %standard-phases
5083 (add-after 'install 'bin-install
5084 (lambda* (#:key inputs outputs #:allow-other-keys)
5085 (let* ((out (assoc-ref outputs "out"))
5086 (jar (string-append out "/share/java"))
5087 (bin (string-append out "/bin")))
5088 (mkdir-p bin)
5089 (with-output-to-file (string-append bin "/antlr3")
5090 (lambda _
5091 (display
5092 (string-append
5093 "#!" (which "sh") "\n"
5094 "java -cp " jar "/antlr3-3.3.jar:"
5095 (string-join
5096 (append (find-files (assoc-ref inputs "java-stringtemplate")
5097 ".*\\.jar$")
5098 (find-files (string-append (assoc-ref inputs "antlr")
5099 "/lib")
5100 ".*\\.jar$"))
5101 ":")
5102 " org.antlr.Tool $*"))))
5103 (chmod (string-append bin "/antlr3") #o755)
5104 #t)))
5105 (add-before 'build 'generate-grammar
5106 (lambda _
5107 (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java"
5108 (("import org.antlr.grammar.v2.\\*;")
5109 "import org.antlr.grammar.v2.*;\n
5110 import org.antlr.grammar.v2.TreeToNFAConverter;\n
5111 import org.antlr.grammar.v2.DefineGrammarItemsWalker;\n
5112 import org.antlr.grammar.v2.ANTLRTreePrinter;"))
5113 (and
5114 (with-directory-excursion "tool/src/main/antlr2/org/antlr/grammar/v2/"
5115 (every (lambda (file)
5116 (format #t "~a\n" file)
5117 (zero? (system* "antlr" file)))
5118 '("antlr.g" "antlr.print.g" "assign.types.g"
5119 "buildnfa.g" "codegen.g" "define.g")))
5120 (with-directory-excursion "tool/src/main/antlr3/org/antlr/grammar/v3/"
5121 (every (lambda (file)
5122 (format #t "~a\n" file)
5123 (zero? (system* "antlr3" file)))
5124 '("ActionAnalysis.g" "ActionTranslator.g" "ANTLRv3.g"
5125 "ANTLRv3Tree.g"))))))
5126 (add-before 'build 'fix-build-xml
5127 (lambda _
5128 (substitute* "build.xml"
5129 (("<exec") "<copy todir=\"${classes.dir}\">
5130 <fileset dir=\"tool/src/main/resources\">
5131 <include name=\"**/*.stg\"/>
5132 <include name=\"**/*.st\"/>
5133 <include name=\"**/*.sti\"/>
5134 <include name=\"**/STLexer.tokens\"/>
5135 </fileset>
5136 </copy><exec"))
5137 #t)))))
5138 (native-inputs
5139 `(("antlr" ,antlr2)
5140 ("antlr3" ,antlr3-3.1)))
5141 (inputs
5142 `(("junit" ,java-junit)))
5143 (propagated-inputs
5144 `(("java-stringtemplate" ,java-stringtemplate-3)
5145 ("antlr" ,antlr2)
5146 ("antlr3" ,antlr3-3.1)))))
5147
5148 (define antlr3-3.1
5149 (package
5150 (inherit antlr3)
5151 (name "antlr3-3.1")
5152 (version "3.1")
5153 (source (origin
5154 (method url-fetch)
5155 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
5156 "gh-pages/download/antlr-"
5157 version ".tar.gz"))
5158 (sha256
5159 (base32
5160 "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z"))))
5161 (arguments
5162 `(#:jar-name (string-append ,name "-" ,version ".jar")
5163 #:source-dir "src:runtime/Java/src"
5164 #:tests? #f
5165 #:phases
5166 (modify-phases %standard-phases
5167 (add-after 'install 'bin-install
5168 (lambda* (#:key inputs outputs #:allow-other-keys)
5169 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
5170 (bin (string-append (assoc-ref outputs "out") "/bin")))
5171 (mkdir-p bin)
5172 (with-output-to-file (string-append bin "/antlr3")
5173 (lambda _
5174 (display
5175 (string-append "#!" (which "sh") "\n"
5176 "java -cp " jar "/antlr3-3.1-3.1.jar:"
5177 (string-concatenate
5178 (find-files (assoc-ref inputs "stringtemplate")
5179 ".*\\.jar"))
5180 ":"
5181 (string-concatenate
5182 (find-files (string-append
5183 (assoc-ref inputs "antlr")
5184 "/lib")
5185 ".*\\.jar"))
5186 " org.antlr.Tool $*"))))
5187 (chmod (string-append bin "/antlr3") #o755))))
5188 (add-before 'build 'generate-grammar
5189 (lambda _
5190 (let ((dir "src/org/antlr/tool/"))
5191 (for-each (lambda (file)
5192 (display file)
5193 (newline)
5194 (system* "antlr" "-o" dir (string-append dir file)))
5195 '("antlr.g" "antlr.print.g" "assign.types.g"
5196 "buildnfa.g" "define.g")))
5197 (format #t "codegen.g\n")
5198 (system* "antlr" "-o" "src/org/antlr/codegen"
5199 "src/org/antlr/codegen/codegen.g")))
5200 (add-before 'build 'fix-build-xml
5201 (lambda _
5202 (substitute* "build.xml"
5203 (("<exec") "<copy todir=\"${classes.dir}\">
5204 <fileset dir=\"src\">
5205 <include name=\"**/*.stg\"/>
5206 <include name=\"**/*.st\"/>
5207 <include name=\"**/*.sti\"/>
5208 <include name=\"**/STLexer.tokens\"/>
5209 </fileset>
5210 </copy><exec")))))))
5211 (native-inputs
5212 `(("antlr" ,antlr2)))
5213 (inputs
5214 `(("junit" ,java-junit)))
5215 (propagated-inputs
5216 `(("stringtemplate" ,java-stringtemplate-3)))))
5217
5218 (define-public java-commons-cli-1.2
5219 ;; This is a bootstrap dependency for Maven2.
5220 (package
5221 (inherit java-commons-cli)
5222 (version "1.2")
5223 (source (origin
5224 (method url-fetch)
5225 (uri (string-append "mirror://apache/commons/cli/source/"
5226 "commons-cli-" version "-src.tar.gz"))
5227 (sha256
5228 (base32
5229 "0rvfgzgv2pc1m091dfj3ih9ddsjjppr1f1wf0qmc3bk6b1kwv2dm"))))
5230 (arguments
5231 `(#:jar-name "commons-cli.jar"
5232 #:phases
5233 (modify-phases %standard-phases
5234 (add-before 'check 'fix-build-xml
5235 (lambda* (#:key inputs #:allow-other-keys)
5236 (substitute* "build.xml"
5237 (("dir=\"\\$\\{test.home\\}/java\"")
5238 "dir=\"${test.home}\""))
5239 #t)))))
5240 (native-inputs
5241 `(("java-junit" ,java-junit)))))
5242
5243 (define-public java-microemulator-cldc
5244 (package
5245 (name "java-microemulator-cldc")
5246 (version "2.0.4")
5247 (source (origin
5248 (method url-fetch)
5249 (uri (string-append "https://github.com/barteo/microemu/archive/"
5250 "microemulator_"
5251 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
5252 version)
5253 ".tar.gz"))
5254 (file-name (string-append name "-" version ".tar.gz"))
5255 (sha256
5256 (base32
5257 "1x1apmz38gkppxnwnygwmi12j54v4p258v8ddzn6dldkk7vak1ll"))))
5258 (build-system ant-build-system)
5259 (arguments
5260 `(#:jar-name "microemulator-cldc.jar"
5261 #:source-dir "microemu-cldc/src/main/java"
5262 #:tests? #f)); Requires even older software
5263 (home-page "https://github.com/barteo/microemu")
5264 (synopsis "J2ME CLDC emulator")
5265 (description "Microemulator is a Java 2 Micro Edition (J2ME) CLDC/MIDP
5266 Emulator. It allows to demonstrate MIDlet based applications in web browser
5267 applet and can be run as a standalone java application.")
5268 (license (list license:asl2.0
5269 ;; or altenatively:
5270 license:lgpl2.1+))))
5271
5272 (define-public java-datanucleus-javax-persistence
5273 (package
5274 (name "java-datanucleus-javax-persistence")
5275 (version "2.2.0")
5276 (source (origin
5277 (method url-fetch)
5278 (uri (string-append "https://github.com/datanucleus/"
5279 "javax.persistence/archive/javax.persistence-"
5280 version "-release.tar.gz"))
5281 (sha256
5282 (base32
5283 "11jx0fjwgc2hhbqqgdd6m1pf2fplf9vslppygax0y1z5csnqjhpx"))))
5284 (build-system ant-build-system)
5285 (arguments
5286 `(#:jar-name "java-datanucleus-javax-persistence.jar"
5287 #:jdk ,icedtea-8
5288 #:source-dir "src/main/java"
5289 #:tests? #f)); no tests
5290 (home-page "https://github.com/datanucleus/javax.persistence")
5291 (synopsis "JPA API")
5292 (description "This package contains a clean definition of JPA API intended
5293 for use with DataNucleus JPA since the JCP haven't provided an official JPA API
5294 jar. See @url{http://java.net/projects/jpa-spec/downloads} for the specification
5295 used to generate this API.")
5296 (license (list license:edl1.0 license:epl1.0))))
5297
5298 (define-public java-osgi-cmpn
5299 (package
5300 (name "java-osgi-cmpn")
5301 (version "6.0.0")
5302 (source (origin
5303 (method url-fetch)
5304 (uri (string-append "http://central.maven.org/maven2/"
5305 "org/osgi/osgi.cmpn/" version "/osgi.cmpn-"
5306 version "-sources.jar"))
5307 (sha256
5308 (base32
5309 "1lmb6xyrmkqdhv1kayf0514rlwq6ypvs4m44ibrck3snp8241wys"))))
5310 (build-system ant-build-system)
5311 (arguments
5312 `(#:jar-name "osgi-cmpn.jar"
5313 #:tests? #f)); no tests
5314 (inputs
5315 `(("annotation" ,java-osgi-annotation)
5316 ("core" ,java-osgi-core)
5317 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
5318 ("microemulator" ,java-microemulator-cldc)
5319 ("servlet" ,java-classpathx-servletapi)))
5320 (home-page "http://www.osgi.org")
5321 (synopsis "Compendium specification module of OSGi framework")
5322 (description
5323 "OSGi, for Open Services Gateway initiative framework, is a module system
5324 and service platform for the Java programming language. This package contains
5325 the compendium specification module, providing interfaces and classes for use
5326 in compiling bundles.")
5327 (license license:asl2.0)))
5328
5329 (define-public java-osgi-service-component-annotations
5330 (package
5331 (name "java-osgi-service-component-annotations")
5332 (version "1.3.0")
5333 (source (origin
5334 (method url-fetch)
5335 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5336 "org.osgi.service.component.annotations/"
5337 version "/org.osgi.service.component.annotations-"
5338 version "-sources.jar"))
5339 (sha256
5340 (base32
5341 "15rq9cmp4fpn74q44m4j35qsqmjf5lx3hcrk6pzvbhc08igic2f0"))))
5342 (build-system ant-build-system)
5343 (arguments
5344 `(#:jar-name "osgi-service-component-annotations.jar"
5345 #:tests? #f)); no tests
5346 (inputs
5347 `(("annotation" ,java-osgi-annotation)))
5348 (home-page "http://www.osgi.org")
5349 (synopsis "Support annotations for osgi-service-component")
5350 (description
5351 "OSGi, for Open Services Gateway initiative framework, is a module system
5352 and service platform for the Java programming language. This package contains
5353 the support annotations for osgi-service-component.")
5354 (license license:asl2.0)))
5355
5356 (define-public java-osgi-dto
5357 (package
5358 (name "java-osgi-dto")
5359 (version "1.0.0")
5360 (source (origin
5361 (method url-fetch)
5362 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5363 "org.osgi.dto/" version "/org.osgi.dto-"
5364 version "-sources.jar"))
5365 (sha256
5366 (base32
5367 "0f4bqjzadn0hwk6sd3h5gvbyfp3yci1s6r0v770cc15p0pg627yr"))))
5368 (build-system ant-build-system)
5369 (arguments
5370 `(#:jar-name "osgi-dto.jar"
5371 #:tests? #f)); no tests
5372 (inputs
5373 `(("annotation" ,java-osgi-annotation)))
5374 (home-page "http://www.osgi.org")
5375 (synopsis "Data Transfer Objects")
5376 (description
5377 "OSGi, for Open Services Gateway initiative framework, is a module system
5378 and service platform for the Java programming language. This package contains
5379 the Data Transfer Objects. It is easily serializable having only public fields
5380 of primitive types and their wrapper classes, Strings, and DTOs. List, Set,
5381 Map and array aggregates may also be used. The aggregates must only hold
5382 objects of the listed types or aggregates.")
5383 (license license:asl2.0)))
5384
5385 (define-public java-osgi-resource
5386 (package
5387 (name "java-osgi-resource")
5388 (version "1.0.0")
5389 (source (origin
5390 (method url-fetch)
5391 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5392 "org.osgi.resource/"
5393 version "/org.osgi.resource-"
5394 version "-sources.jar"))
5395 (sha256
5396 (base32
5397 "0hi0fsc5v99q22bd7lrkvpz1y0ds4w9arjldpwsrcpqvz2js7q2d"))))
5398 (build-system ant-build-system)
5399 (arguments
5400 `(#:jar-name "osgi-resource.jar"
5401 #:tests? #f)); no tests
5402 (inputs
5403 `(("annotation" ,java-osgi-annotation)
5404 ("dto" ,java-osgi-dto)))
5405 (home-page "http://www.osgi.org")
5406 (synopsis "OSGI Resource")
5407 (description
5408 "OSGi, for Open Services Gateway initiative framework, is a module system
5409 and service platform for the Java programming language. This package contains
5410 the definition of common types in osgi packages.")
5411 (license license:asl2.0)))
5412
5413 (define-public java-osgi-namespace-contract
5414 (package
5415 (name "java-osgi-namespace-contract")
5416 (version "1.0.0")
5417 (source (origin
5418 (method url-fetch)
5419 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5420 "org.osgi.namespace.contract/"
5421 version "/org.osgi.namespace.contract-"
5422 version "-sources.jar"))
5423 (sha256
5424 (base32
5425 "1iz4f2i0fvqrlq90ki9nfzcfpvy2av434ri25bglywqssx8mmp36"))))
5426 (build-system ant-build-system)
5427 (inputs
5428 `(("resource" ,java-osgi-resource)
5429 ("annotation" ,java-osgi-annotation)))
5430 (arguments
5431 `(#:jar-name "osgi-namespace-contract.jar"
5432 #:tests? #f)); no tests
5433 (home-page "http://www.osgi.org")
5434 (synopsis "Contract Capability and Requirement Namespace")
5435 (description
5436 "OSGi, for Open Services Gateway initiative framework, is a module system
5437 and service platform for the Java programming language. This package contains
5438 the names for the attributes and directives for a namespace with contracts.")
5439 (license license:asl2.0)))
5440
5441 (define-public java-osgi-namespace-extender
5442 (package
5443 (name "java-osgi-namespace-extender")
5444 (version "1.0.1")
5445 (source (origin
5446 (method url-fetch)
5447 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5448 "org.osgi.namespace.extender/"
5449 version "/org.osgi.namespace.extender-"
5450 version "-sources.jar"))
5451 (sha256
5452 (base32
5453 "0jgqiak2i05qv6j3gd33xlaifzzc0ylxxk376v2x0apfg3vvixmz"))))
5454 (build-system ant-build-system)
5455 (inputs
5456 `(("resource" ,java-osgi-resource)
5457 ("annotation" ,java-osgi-annotation)))
5458 (arguments
5459 `(#:jar-name "osgi-namespace-extendent.jar"
5460 #:tests? #f)); no tests
5461 (home-page "http://www.osgi.org")
5462 (synopsis "Extender Capability and Requirement Namespace")
5463 (description
5464 "OSGi, for Open Services Gateway initiative framework, is a module system
5465 and service platform for the Java programming language. This package contains
5466 the names for the attributes and directives for an extender namespace.")
5467 (license license:asl2.0)))
5468
5469 (define-public java-osgi-namespace-service
5470 (package
5471 (name "java-osgi-namespace-service")
5472 (version "1.0.0")
5473 (source (origin
5474 (method url-fetch)
5475 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5476 "org.osgi.namespace.service/"
5477 version "/org.osgi.namespace.service-"
5478 version "-sources.jar"))
5479 (sha256
5480 (base32
5481 "0qmw8n2449nkmm56d1znz9zhazb6ya3vsimd5bf5jg23zzhgl8c8"))))
5482 (build-system ant-build-system)
5483 (inputs
5484 `(("resource" ,java-osgi-resource)
5485 ("annotation" ,java-osgi-annotation)))
5486 (arguments
5487 `(#:jar-name "osgi-namespace-service.jar"
5488 #:tests? #f)); no tests
5489 (home-page "http://www.osgi.org")
5490 (synopsis "Service Capability and Requirement Namespace")
5491 (description
5492 "OSGi, for Open Services Gateway initiative framework, is a module system
5493 and service platform for the Java programming language. This package contains
5494 the names for the attributes and directives for a service namespace.")
5495 (license license:asl2.0)))
5496
5497 (define-public java-osgi-util-function
5498 (package
5499 (name "java-osgi-util-function")
5500 (version "1.0.0")
5501 (source (origin
5502 (method url-fetch)
5503 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5504 "org.osgi.util.function/"
5505 version "/org.osgi.util.function-"
5506 version "-sources.jar"))
5507 (sha256
5508 (base32
5509 "04l7j3hwmmj28w23m7paca0afzncs42j2mdr3liqq8kvp548sc6x"))))
5510 (build-system ant-build-system)
5511 (arguments
5512 `(#:jar-name "osgi-util-function.jar"
5513 #:tests? #f)); no tests
5514 (inputs
5515 `(("annotation" ,java-osgi-annotation)))
5516 (home-page "http://www.osgi.org")
5517 (synopsis "OSGI Util Function")
5518 (description
5519 "OSGi, for Open Services Gateway initiative framework, is a module system
5520 and service platform for the Java programming language. This package contains
5521 an interface for a function that accepts a single argument and produces a result.")
5522 (license license:asl2.0)))
5523
5524 (define-public java-osgi-util-promise
5525 (package
5526 (name "java-osgi-util-promise")
5527 (version "1.0.0")
5528 (source (origin
5529 (method url-fetch)
5530 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5531 "org.osgi.util.promise/"
5532 version "/org.osgi.util.promise-"
5533 version "-sources.jar"))
5534 (sha256
5535 (base32
5536 "0y34dwiflg1c4ahvkswpf9z02xph2sr9fm04ia5493x3lshpw22c"))))
5537 (build-system ant-build-system)
5538 (arguments
5539 `(#:jar-name "osgi-util-promise.jar"
5540 #:tests? #f)); no tests
5541 (inputs
5542 `(("annotation" ,java-osgi-annotation)
5543 ("function" ,java-osgi-util-function)))
5544 (home-page "http://www.osgi.org")
5545 (synopsis "Promise of a value")
5546 (description
5547 "OSGi, for Open Services Gateway initiative framework, is a module system
5548 and service platform for the Java programming language. This package contains
5549 an interface and utilitary classes for promises. A Promise represents a future
5550 value. It handles the interactions for asynchronous processing.")
5551 (license license:asl2.0)))
5552
5553 (define-public java-osgi-service-metatype-annotations
5554 (package
5555 (name "java-osgi-service-metatype-annotations")
5556 (version "1.3.0")
5557 (source (origin
5558 (method url-fetch)
5559 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5560 "org.osgi.service.metatype.annotations/"
5561 version "/org.osgi.service.metatype.annotations-"
5562 version "-sources.jar"))
5563 (sha256
5564 (base32
5565 "12rwm3349wk80vm88rcdgs4435m4jxkpkj5mrx326skkz2c6hyw6"))))
5566 (build-system ant-build-system)
5567 (arguments
5568 `(#:jar-name "osgi-service-metatype-annotations.jar"
5569 #:tests? #f)); no tests
5570 (inputs
5571 `(("annotation" ,java-osgi-annotation)))
5572 (home-page "http://www.osgi.org")
5573 (synopsis "Support annotations for metatype")
5574 (description
5575 "OSGi, for Open Services Gateway initiative framework, is a module system
5576 and service platform for the Java programming language. This package contains
5577 the support annotations for metatype.")
5578 (license license:asl2.0)))
5579
5580 (define-public java-osgi-service-repository
5581 (package
5582 (name "java-osgi-service-repository")
5583 (version "1.1.0")
5584 (source (origin
5585 (method url-fetch)
5586 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5587 "org.osgi.service.repository/"
5588 version "/org.osgi.service.repository-"
5589 version "-sources.jar"))
5590 (sha256
5591 (base32
5592 "1k41mhg7b58pd8nsghr2qwcjrxdnf1p9spsw9v11k4257g6rl06n"))))
5593 (build-system ant-build-system)
5594 (arguments
5595 `(#:jar-name "osgi-service-repository.jar"
5596 #:tests? #f)); no tests
5597 (inputs
5598 `(("annotation" ,java-osgi-annotation)
5599 ("promise" ,java-osgi-util-promise)
5600 ("resource" ,java-osgi-resource)))
5601 (home-page "http://www.osgi.org")
5602 (synopsis "OSGI service repository")
5603 (description
5604 "OSGi, for Open Services Gateway initiative framework, is a module system
5605 and service platform for the Java programming language. This package contains
5606 a repository service that contains resources.")
5607 (license license:asl2.0)))
5608
5609 (define-public java-osgi-framework
5610 (package
5611 (name "java-osgi-framework")
5612 (version "1.8.0")
5613 (source (origin
5614 (method url-fetch)
5615 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5616 "org.osgi.framework/" version "/org.osgi.framework-"
5617 version "-sources.jar"))
5618 (sha256
5619 (base32
5620 "1lwp2zfad3rybcc6q9bwz8xsgkc92ypzy5p6x54387f1qj65m73s"))))
5621 (build-system ant-build-system)
5622 (arguments
5623 `(#:jar-name "osgi-framework.jar"
5624 #:tests? #f)); no tests
5625 (inputs
5626 `(("annotation" ,java-osgi-annotation)
5627 ("resource" ,java-osgi-resource)
5628 ("dto" ,java-osgi-dto)))
5629 (home-page "http://www.osgi.org")
5630 (synopsis "OSGi framework")
5631 (description
5632 "OSGi, for Open Services Gateway initiative framework, is a module system
5633 and service platform for the Java programming language.")
5634 (license license:asl2.0)))
5635
5636 (define-public java-osgi-service-log
5637 (package
5638 (name "java-osgi-service-log")
5639 (version "1.3.0")
5640 (source (origin
5641 (method url-fetch)
5642 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5643 "org.osgi.service.log/"
5644 version "/org.osgi.service.log-"
5645 version "-sources.jar"))
5646 (sha256
5647 (base32
5648 "1029j30dzcwializzca0j3fkhwwz08kmmsha5agw1iccscimj6r0"))))
5649 (build-system ant-build-system)
5650 (arguments
5651 `(#:jar-name "osgi-service-log.jar"
5652 #:tests? #f)); no tests
5653 (inputs
5654 `(("java-osgi-framework" ,java-osgi-framework)))
5655 (home-page "http://www.osgi.org")
5656 (synopsis "Provides methods for bundles to write messages to the log")
5657 (description
5658 "OSGi, for Open Services Gateway initiative framework, is a module system
5659 and service platform for the Java programming language. This package contains
5660 the log service.")
5661 (license license:asl2.0)))
5662
5663 (define-public java-osgi-service-jdbc
5664 (package
5665 (name "java-osgi-service-jdbc")
5666 (version "1.0.0")
5667 (source (origin
5668 (method url-fetch)
5669 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5670 "org.osgi.service.jdbc/"
5671 version "/org.osgi.service.jdbc-"
5672 version "-sources.jar"))
5673 (sha256
5674 (base32
5675 "11iln5v7bk469cgb9ddkrz9sa95b3733gqgaqw9xf5g6wq652yjz"))))
5676 (build-system ant-build-system)
5677 (arguments
5678 `(#:jar-name "osgi-service-jdbc.jar"
5679 #:tests? #f)); no tests
5680 (home-page "http://www.osgi.org")
5681 (synopsis "Factory for JDBC connection factories")
5682 (description
5683 "OSGi, for Open Services Gateway initiative framework, is a module system
5684 and service platform for the Java programming language. This package contains
5685 a factory for JDBC connection factories. There are 3 preferred connection
5686 factories for getting JDBC connections:
5687
5688 @itemize
5689 @item @code{javax.sql.DataSource};
5690 @item @code{javax.sql.ConnectionPoolDataSource};
5691 @item @code{javax.sql.XADataSource}.
5692 @end itemize")
5693 (license license:asl2.0)))
5694
5695 (define-public java-osgi-service-resolver
5696 (package
5697 (name "java-osgi-service-resolver")
5698 (version "1.0.1")
5699 (source (origin
5700 (method url-fetch)
5701 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5702 "org.osgi.service.resolver/"
5703 version "/org.osgi.service.resolver-"
5704 version "-sources.jar"))
5705 (sha256
5706 (base32
5707 "1dzqn1ryfi2rq4zwsgp44bmj2wlfydjg1qbxw2b0z4xdjjy55vxd"))))
5708 (build-system ant-build-system)
5709 (arguments
5710 `(#:jar-name "osgi-service-resolver.jar"
5711 #:tests? #f)); no tests
5712 (inputs
5713 `(("annotation" ,java-osgi-annotation)
5714 ("resource" ,java-osgi-resource)))
5715 (home-page "http://www.osgi.org")
5716 (synopsis "OSGI Resolver service")
5717 (description
5718 "OSGi, for Open Services Gateway initiative framework, is a module system
5719 and service platform for the Java programming language. This package contains
5720 a resolver service that resolves the specified resources in the context supplied
5721 by the caller.")
5722 (license license:asl2.0)))
5723
5724 (define-public java-osgi-util-tracker
5725 (package
5726 (name "java-osgi-util-tracker")
5727 (version "1.5.1")
5728 (source (origin
5729 (method url-fetch)
5730 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5731 "org.osgi.util.tracker/"
5732 version "/org.osgi.util.tracker-"
5733 version "-sources.jar"))
5734 (sha256
5735 (base32
5736 "0c4fh9vxwzsx59r8dygda0gq2gx3z5vfhc3jsphlqwf5w0h403lz"))))
5737 (build-system ant-build-system)
5738 (arguments
5739 `(#:jar-name "osgi-util-tracker.jar"
5740 #:tests? #f)); no tests
5741 (inputs
5742 `(("framework" ,java-osgi-framework)
5743 ("annotation" ,java-osgi-annotation)))
5744 (home-page "http://www.osgi.org")
5745 (synopsis "Bundle tracking")
5746 (description
5747 "OSGi, for Open Services Gateway initiative framework, is a module system
5748 and service platform for the Java programming language. This package contains
5749 bundle tracking utility classes.")
5750 (license license:asl2.0)))
5751
5752 (define-public java-osgi-service-cm
5753 (package
5754 (name "java-osgi-service-cm")
5755 (version "1.5.0")
5756 (source (origin
5757 (method url-fetch)
5758 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5759 "org.osgi.service.cm/"
5760 version "/org.osgi.service.cm-"
5761 version "-sources.jar"))
5762 (sha256
5763 (base32
5764 "1z8kap48y3xi0ggj8v6czglfnpnd94mmismgi2wbqhj1nl5fzbp6"))))
5765 (build-system ant-build-system)
5766 (arguments
5767 `(#:jar-name "osgi-service-cm.jar"
5768 #:tests? #f)); no tests
5769 (inputs
5770 `(("framework" ,java-osgi-framework)
5771 ("annotation" ,java-osgi-annotation)))
5772 (home-page "http://www.osgi.org")
5773 (synopsis "OSGI Configuration Management")
5774 (description
5775 "OSGi, for Open Services Gateway initiative framework, is a module system
5776 and service platform for the Java programming language. This package contains
5777 utility classes for the configuration of services.")
5778 (license license:asl2.0)))
5779
5780 (define-public java-osgi-service-packageadmin
5781 (package
5782 (name "java-osgi-service-packageadmin")
5783 (version "1.2.0")
5784 (source (origin
5785 (method url-fetch)
5786 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
5787 "org.osgi.service.packageadmin/"
5788 version "/org.osgi.service.packageadmin-"
5789 version "-sources.jar"))
5790 (sha256
5791 (base32
5792 "041mpxzi7g36wmcily6y4ccn3jx15akpdy8gmhyb7m98x7qfvn52"))))
5793 (build-system ant-build-system)
5794 (arguments
5795 `(#:jar-name "osgi-service-packageadmin.jar"
5796 #:tests? #f)); no tests
5797 (inputs
5798 `(("framework" ,java-osgi-framework)))
5799 (home-page "http://www.osgi.org")
5800 (synopsis "OSGI Package Administration")
5801 (description
5802 "OSGi, for Open Services Gateway initiative framework, is a module system
5803 and service platform for the Java programming language. This package contains
5804 the packageadmin service.")
5805 (license license:asl2.0)))
5806
5807 (define-public java-ops4j-base-lang
5808 (package
5809 (name "java-ops4j-base-lang")
5810 (version "1.5.0")
5811 (source (origin
5812 (method url-fetch)
5813 (uri (string-append "https://github.com/ops4j/org.ops4j.base/"
5814 "archive/base-" version ".tar.gz"))
5815 (sha256
5816 (base32
5817 "18hl3lpchgpv8yh5rlk39l2gif5dlfgb8gxjmncf39pr2dprkniw"))))
5818 (build-system ant-build-system)
5819 (arguments
5820 `(#:jar-name "java-ops4j-base-lang.jar"
5821 #:source-dir "ops4j-base-lang/src/main/java"
5822 #:tests? #f; no tests
5823 #:phases
5824 (modify-phases %standard-phases
5825 (add-before 'build 'add-test-file
5826 (lambda _
5827 ;; That file is required by a test in ops4j-pax-exam-core-spi
5828 (mkdir-p "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang")
5829 (with-output-to-file "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang/pom.properties"
5830 (lambda _
5831 (display
5832 (string-append
5833 "version=" ,version "\n"
5834 "groupId=org.ops4j.base"
5835 "artifactId=ops4j-base-lang\n")))))))))
5836 (home-page "https://ops4j1.jira.com/wiki/spaces/base/overview")
5837 (synopsis "Utility classes and extensions to be used in OPS4J projects")
5838 (description "OPS4J stands for Open Participation Software for Java. This
5839 package contains utilities and extensions related to @code{java.lang}.")
5840 (license license:asl2.0)))
5841
5842 (define-public java-ops4j-base-monitors
5843 (package
5844 (inherit java-ops4j-base-lang)
5845 (name "java-ops4j-base-monitors")
5846 (arguments
5847 `(#:jar-name "java-ops4j-base-monitors.jar"
5848 #:source-dir "ops4j-base-monitors/src/main/java"
5849 #:tests? #f)); no tests
5850 (inputs
5851 `(("lang" ,java-ops4j-base-lang)))
5852 (description "OPS4J stands for Open Participation Software for Java. This
5853 package contains utilities and extensions related to monitoring.")))
5854
5855 (define-public java-ops4j-base-io
5856 (package
5857 (inherit java-ops4j-base-lang)
5858 (name "java-ops4j-base-io")
5859 (arguments
5860 `(#:jar-name "java-ops4j-base-io.jar"
5861 #:source-dir "ops4j-base-io/src/main/java"
5862 #:test-dir "ops4j-base-io/src/test"
5863 #:test-exclude
5864 (list "**/ListerTest.java")))
5865 (inputs
5866 `(("lang" ,java-ops4j-base-monitors)
5867 ("lang" ,java-ops4j-base-lang)))
5868 (native-inputs
5869 `(("junit" ,java-junit)
5870 ("hamcrest" ,java-hamcrest-core)))
5871 (description "OPS4J stands for Open Participation Software for Java. This
5872 package contains utilities and extensions related to handling streams and files.")))
5873
5874 (define-public java-ops4j-base-util
5875 (package
5876 (inherit java-ops4j-base-lang)
5877 (name "java-ops4j-base-util")
5878 (arguments
5879 `(#:jar-name "java-ops4j-base-util.jar"
5880 #:source-dir "ops4j-base-util/src/main/java"
5881 #:test-dir "ops4j-base-util/src/test"))
5882 (inputs
5883 `(("lang" ,java-ops4j-base-lang)))
5884 (native-inputs
5885 `(("junit" ,java-junit)))
5886 (description "OPS4J stands for Open Participation Software for Java. This
5887 package contains utilities and extensions related to environment, i18n and
5888 mime types.")))
5889
5890 (define-public java-ops4j-base-util-property
5891 (package
5892 (inherit java-ops4j-base-lang)
5893 (name "java-ops4j-base-util-property")
5894 (arguments
5895 `(#:jar-name "java-ops4j-base-util-property.jar"
5896 #:source-dir "ops4j-base-util-property/src/main/java"
5897 #:tests? #f)); no tests
5898 (inputs
5899 `(("lang" ,java-ops4j-base-lang)
5900 ("util" ,java-ops4j-base-util)))
5901 (description "OPS4J stands for Open Participation Software for Java. This
5902 package contains utilities and extensions related to resolving properties from
5903 different sources.")))
5904
5905 (define-public java-ops4j-base-store
5906 (package
5907 (inherit java-ops4j-base-lang)
5908 (name "java-ops4j-base-store")
5909 (arguments
5910 `(#:jar-name "java-ops4j-base-store.jar"
5911 #:source-dir "ops4j-base-store/src/main/java"
5912 #:tests? #f)); no tests
5913 (inputs
5914 `(("lang" ,java-ops4j-base-lang)
5915 ("slf4j" ,java-slf4j-api)
5916 ("io" ,java-ops4j-base-io)))
5917 (description "OPS4J stands for Open Participation Software for Java. This
5918 package contains utilities for storing and retrieving data from an
5919 @code{InputStream}.")))
5920
5921 (define-public java-ops4j-base-spi
5922 (package
5923 (inherit java-ops4j-base-lang)
5924 (name "java-ops4j-base-spi")
5925 (arguments
5926 `(#:jar-name "java-ops4j-base-spi.jar"
5927 #:source-dir "ops4j-base-spi/src/main/java"
5928 #:test-dir "ops4j-base-spi/src/test"))
5929 (native-inputs
5930 `(("junit" ,java-junit)
5931 ("hamcrest" ,java-hamcrest-core)))
5932 (description "OPS4J stands for Open Participation Software for Java. This
5933 package contains utilities for obtaining services via the Java SE 6
5934 @code{ServiceLoader}.")))
5935
5936 (define-public java-aqute-bnd-annotation
5937 (package
5938 (name "java-aqute-bnd-annotation")
5939 (version "3.4.0")
5940 (source (origin
5941 (method url-fetch)
5942 (uri (string-append "https://github.com/bndtools/bnd/archive/"
5943 version ".REL.tar.gz"))
5944 (file-name (string-append name "-" version ".tar.gz"))
5945 (sha256
5946 (base32
5947 "09vgb6axikbz66zi9falijbnzh1qnp9ysfns123dmzdb01cbza9q"))))
5948 (build-system ant-build-system)
5949 (arguments
5950 `(#:jar-name "java-aqute-bnd-annotation.jar"
5951 #:source-dir "biz.aQute.bnd.annotation/src"
5952 #:tests? #f)); empty test dir
5953 (home-page "http://bnd.bndtools.org/")
5954 (synopsis "Tools for OSGi")
5955 (description "Bnd is a swiss army knife for OSGi, it creates manifest
5956 headers based on analyzing the class code, it verifies the project settings,
5957 it manages project dependencies, gives diffs jars, and much more.")
5958 (license license:asl2.0)))
5959
5960 (define-public java-aqute-libg
5961 (package
5962 (inherit java-aqute-bnd-annotation)
5963 (name "java-aqute-libg")
5964 (arguments
5965 `(#:jar-name "java-aqute-libg.jar"
5966 #:source-dir "aQute.libg/src"
5967 #:tests? #f)); FIXME: tests are in "aQute.libg/test", not in a java directory
5968 (inputs
5969 `(("slf4j" ,java-slf4j-api)
5970 ("osgi-annot" ,java-osgi-annotation)
5971 ("java-osgi-cmpn" ,java-osgi-cmpn)
5972 ("osgi" ,java-osgi-core)))))
5973
5974 (define-public java-aqute-bndlib
5975 (package
5976 (inherit java-aqute-bnd-annotation)
5977 (name "java-aqute-bndlib")
5978 (arguments
5979 `(#:jar-name "java-bndlib.jar"
5980 #:source-dir "biz.aQute.bndlib/src"
5981 #:tests? #f)); no tests
5982 (inputs
5983 `(("slf4j" ,java-slf4j-api)
5984 ("osgi-annot" ,java-osgi-annotation)
5985 ("java-aqute-libg" ,java-aqute-libg)
5986 ("java-aqute-bnd-annotation" ,java-aqute-bnd-annotation)
5987 ("java-osgi-service-component-annotations" ,java-osgi-service-component-annotations)
5988 ("java-osgi-service-repository" ,java-osgi-service-repository)
5989 ("java-osgi-service-log" ,java-osgi-service-log)
5990 ("java-osgi-service-metatype-annotations" ,java-osgi-service-metatype-annotations)
5991 ("java-osgi-namespace-contract" ,java-osgi-namespace-contract)
5992 ("java-osgi-namespace-extender" ,java-osgi-namespace-extender)
5993 ("java-osgi-namespace-service" ,java-osgi-namespace-service)
5994 ("promise" ,java-osgi-util-promise)
5995 ("osgi" ,java-osgi-core)))))
5996
5997 (define-public java-ops4j-pax-tinybundles
5998 (package
5999 (name "java-ops4j-pax-tinybundles")
6000 (version "2.1.1")
6001 (source (origin
6002 (method url-fetch)
6003 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.tinybundles/"
6004 "archive/tinybundles-" version ".tar.gz"))
6005 (sha256
6006 (base32
6007 "0y0gq3pvv0iir2b885lmlwnvr724vv7vklzhhr4fs27d7mdkj871"))))
6008 (arguments
6009 `(#:jar-name "java-ops4j-pax-tinybundles.jar"
6010 #:source-dir "src/main/java"
6011 #:test-exclude
6012 ;; Abstract base classes for other tests
6013 (list "**/BndTest.java" "**/CoreTest.java")
6014 #:phases
6015 (modify-phases %standard-phases
6016 (add-before 'check 'fix-version
6017 (lambda _
6018 ;; This test has a reference to an old version of bndlib we are not
6019 ;; packaging. It uses the version referenced in pom.xml. We replace
6020 ;; it with our own version.
6021 (substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
6022 (("2.4.0.201411031534") "3.4.0")))))))
6023 (inputs
6024 `(("lang" ,java-ops4j-base-lang)
6025 ("io" ,java-ops4j-base-io)
6026 ("store" ,java-ops4j-base-store)
6027 ("slf4j" ,java-slf4j-api)
6028 ("libg" ,java-aqute-libg)
6029 ("bndlib" ,java-aqute-bndlib)))
6030 (native-inputs
6031 `(("junit" ,java-junit)
6032 ("hamcrest" ,java-hamcrest-core)
6033 ("log4j" ,java-log4j-api)
6034 ("bndannotation" ,java-aqute-bnd-annotation)
6035 ("framework" ,java-osgi-framework)))
6036 (build-system ant-build-system)
6037 (home-page "https://ops4j1.jira.com/wiki/spaces/ops4j/pages/12060312/Tinybundles")
6038 (synopsis "Java APIs to create OSGi related artifacts")
6039 (description "Tinybundles is all about creating OSGi related artifacts like
6040 Bundles, Fragments and Deployment Packages with Java Api. It is very convinient
6041 to create such artifacts on-the-fly inside Tests (like in Pax Exam). On the
6042 other hand, this library can be a foundation of real end user tools that need
6043 to create those artifacts.")
6044 (license license:asl2.0)))
6045
6046 (define-public java-ops4j-pax-exam-core
6047 (package
6048 (name "java-ops4j-pax-exam-core")
6049 (version "4.11.0")
6050 (source (origin
6051 (method url-fetch)
6052 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.exam2/"
6053 "archive/exam-reactor-" version ".tar.gz"))
6054 (sha256
6055 (base32
6056 "08mzw8nkah3rj3vznlplnawspxhp61zgvb44ifqa1rni1cvbms2g"))))
6057 (arguments
6058 `(#:jar-name "java-ops4j-pax-exam-core.jar"
6059 #:source-dir "core/pax-exam/src/main/java"
6060 #:test-dir "core/pax-exam/src/test"))
6061 (inputs
6062 `(("slf4j" ,java-slf4j-api)
6063 ("lang" ,java-ops4j-base-lang)
6064 ("io" ,java-ops4j-base-io)
6065 ("util-property" ,java-ops4j-base-util-property)
6066 ("util-store" ,java-ops4j-base-store)
6067 ("java-osgi-core" ,java-osgi-core)))
6068 (native-inputs
6069 `(("junit" ,java-junit)
6070 ("hamcrest" ,java-hamcrest-core)))
6071 (build-system ant-build-system)
6072 (home-page "https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/overview")
6073 (synopsis "In-Container Testing for OSGi, Java EE and CDI")
6074 (description "Pax Exam creates OSGi bundles for testing purposes. It lets
6075 the user take control of the OSGi framework, the test framework (e.g. JUnit) and
6076 the system under test at the same time.")
6077 (license license:asl2.0)))
6078
6079 (define-public java-ops4j-pax-exam-core-spi
6080 (package
6081 (inherit java-ops4j-pax-exam-core)
6082 (name "java-ops4j-pax-exam-core-spi")
6083 (arguments
6084 `(#:jar-name "java-ops4j-pax-exam-spi.jar"
6085 #:source-dir "src/main/java"
6086 #:test-exclude
6087 (list
6088 ;; Abstract base class, not a test
6089 "**/BaseStagedReactorTest.java"
6090 ;; Depends on org.mortbay.jetty.testwars:test-war-dump
6091 "**/WarBuilderTest.java")
6092 #:phases
6093 (modify-phases %standard-phases
6094 (add-before 'configure 'chdir
6095 (lambda _
6096 ;; Tests assume we are in this directory
6097 (chdir "core/pax-exam-spi")))
6098 (add-before 'check 'fix-tests
6099 (lambda _
6100 ;; One test checks that this file is present.
6101 (mkdir-p "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi")
6102 (with-output-to-file
6103 "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi/pom.properties"
6104 (lambda _
6105 (display
6106 (string-append "artifactId = pax-exam-spi\n"
6107 "version = " ,(package-version java-ops4j-pax-exam-core-spi)))))
6108 ;; Maven puts compilation results in the target directory, while we
6109 ;; put them in the build directory.
6110 (substitute* '("src/test/java/org/ops4j/pax/exam/spi/war/WarBuilderTest.java"
6111 "src/test/java/org/ops4j/pax/exam/spi/war/WarTestProbeBuilderTest.java"
6112 "src/test/java/org/ops4j/pax/exam/spi/war/ZipBuilderTest.java")
6113 (("target") "build"))
6114 ;; One test is expected to fail, but it doesn't throw the expected exception
6115 (substitute* "src/test/java/org/ops4j/pax/exam/spi/reactors/BaseStagedReactorTest.java"
6116 (("AssertionError") "IllegalArgumentException")))))))
6117 (inputs
6118 `(("java-ops4j-pax-exam-core" ,java-ops4j-pax-exam-core)
6119 ("lang" ,java-ops4j-base-lang)
6120 ("monitors" ,java-ops4j-base-monitors)
6121 ("store" ,java-ops4j-base-store)
6122 ("io" ,java-ops4j-base-io)
6123 ("spi" ,java-ops4j-base-spi)
6124 ("osgi" ,java-osgi-core)
6125 ("slf4j" ,java-slf4j-api)
6126 ("tinybundles" ,java-ops4j-pax-tinybundles)))
6127 (native-inputs
6128 `(("mockito" ,java-mockito-1)
6129 ("junit" ,java-junit)
6130 ("hamcrest" ,java-hamcrest-core)
6131 ("cglib" ,java-cglib)
6132 ("objenesis" ,java-objenesis)
6133 ("asm" ,java-asm)))))
6134
6135 (define-public java-ops4j-pax-exam-core-junit
6136 (package
6137 (inherit java-ops4j-pax-exam-core)
6138 (name "java-ops4j-pax-exam-core-junit")
6139 (arguments
6140 `(#:jar-name "ops4j-pax-exam-core-junit.jar"
6141 #:source-dir "drivers/pax-exam-junit4/src/main/java"
6142 #:tests? #f)); no tests
6143 (inputs
6144 `(("junit" ,java-junit)
6145 ("slf4j" ,java-slf4j-api)
6146 ("core" ,java-ops4j-pax-exam-core)
6147 ("spi" ,java-ops4j-pax-exam-core-spi)))
6148 (native-inputs '())))
6149
6150 (define-public java-fasterxml-jackson-annotations
6151 (package
6152 (name "java-fasterxml-jackson-annotations")
6153 (version "2.9.2")
6154 (source (origin
6155 (method url-fetch)
6156 (uri (string-append "https://github.com/FasterXML/"
6157 "jackson-annotations/archive/"
6158 "jackson-annotations-" version ".tar.gz"))
6159 (sha256
6160 (base32
6161 "0b4wdxjxfbl3gkilylfdbl7fzimfpyih676jiwdf19i4056j8lqw"))))
6162 (build-system ant-build-system)
6163 (arguments
6164 `(#:jar-name "jackson-annotations.jar"
6165 #:source-dir "src/main/java"
6166 #:test-dir "src/test"))
6167 (native-inputs
6168 `(("junit" ,java-junit)))
6169 (home-page "https://github.com/FasterXML/jackson-annotations")
6170 (synopsis "General purpose annotations for the Jackson Data Processor")
6171 (description "This package contains general purpose annotations for the
6172 Jackson Data Processor, used on value and handler types. The only annotations
6173 not included are ones that require dependency to the Databind package.")
6174 (license license:asl2.0)))
6175
6176 (define-public java-fasterxml-jackson-core
6177 (package
6178 (name "java-fasterxml-jackson-core")
6179 (version "2.9.2")
6180 (source (origin
6181 (method url-fetch)
6182 (uri (string-append "https://github.com/FasterXML/"
6183 "jackson-core/archive/"
6184 "jackson-core-" version ".tar.gz"))
6185 (sha256
6186 (base32
6187 "0q2d6qnylyxj5jh0sam1b095b5486f7ipzhxgwcgbm254ls7fqc1"))))
6188 (build-system ant-build-system)
6189 (arguments
6190 `(#:jar-name "jackson-core.jar"
6191 #:source-dir "src/main/java"
6192 #:test-dir "src/test"
6193 #:test-exclude
6194 (list
6195 ;; Expected failure. pom.xml excludes these
6196 "**/failing/**"
6197 ;; Base classes that have no constructor for junit
6198 "**/BaseTest.java"
6199 "**/ConcurrencyReadTest.java"
6200 "**/ManualCharAccessTest.java"
6201 "**/ManualCharAccessTest.java"
6202 "**/TrailingCommasTest.java"
6203 "**/AsyncMissingValuesInObjectTest.java"
6204 "**/AsyncMissingValuesInArrayTest.java")
6205 #:phases
6206 (modify-phases %standard-phases
6207 (add-before 'configure 'generate-PackageVersion.java
6208 (lambda _
6209 (let* ((out "src/main/java/com/fasterxml/jackson/core/json/PackageVersion.java")
6210 (in (string-append out ".in")))
6211 (copy-file in out)
6212 (substitute* out
6213 (("@package@") "com.fasterxml.jackson.core.json")
6214 (("@projectversion@") ,version)
6215 (("@projectgroupid@") "com.fasterxml.jackson.core")
6216 (("@projectartifactid@") "jackson-core")))))
6217 (add-before 'build 'copy-resources
6218 (lambda _
6219 (copy-recursively "src/main/resources"
6220 "build/classes")))
6221 (add-before 'check 'copy-test-resources
6222 (lambda _
6223 (copy-recursively "src/test/resources"
6224 "build/test-classes"))))))
6225 (native-inputs
6226 `(("junit" ,java-junit)
6227 ("hamcrest" ,java-hamcrest-core)))
6228 (home-page "https://github.com/FasterXML/jackson-core")
6229 (synopsis "")
6230 (description "")
6231 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
6232
6233 (define-public java-fasterxml-jackson-databind
6234 (package
6235 (name "java-fasterxml-jackson-databind")
6236 (version "2.9.2")
6237 (source (origin
6238 (method url-fetch)
6239 (uri (string-append "https://github.com/FasterXML/"
6240 "jackson-databind/archive/"
6241 "jackson-databind-" version ".tar.gz"))
6242 (sha256
6243 (base32
6244 "1d5ns8ypqhdy8d94i8q560ip9kka6q8lhnk6q7nfh2g9mr22cc4w"))))
6245 (build-system ant-build-system)
6246 (arguments
6247 `(#:jar-name "jackson-databind.jar"
6248 #:source-dir "src/main/java"
6249 #:tests? #f; requires javax.measures for which I can't find a free implementation
6250 #:phases
6251 (modify-phases %standard-phases
6252 (add-before 'configure 'generate-PackageVersion.java
6253 (lambda _
6254 (let* ((out "src/main/java/com/fasterxml/jackson/databind/cfg/PackageVersion.java")
6255 (in (string-append out ".in")))
6256 (copy-file in out)
6257 (substitute* out
6258 (("@package@") "com.fasterxml.jackson.databind.cfg")
6259 (("@projectversion@") ,version)
6260 (("@projectgroupid@") "com.fasterxml.jackson.databind")
6261 (("@projectartifactid@") "jackson-databind")))))
6262 (add-before 'build 'copy-resources
6263 (lambda _
6264 (copy-recursively "src/main/resources" "build/classes"))))))
6265 (inputs
6266 `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
6267 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)))
6268 (home-page "https://github.com/FasterXML/jackson-databind")
6269 (synopsis "Data-binding functionality and tree-model for the Jackson Data Processor")
6270 (description "This package contains the general-purpose data-binding
6271 functionality and tree-model for Jackson Data Processor. It builds on core
6272 streaming parser/generator package, and uses Jackson Annotations for
6273 configuration.")
6274 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
6275
6276 (define-public java-fasterxml-jackson-modules-base-jaxb
6277 (package
6278 (name "java-fasterxml-jackson-modules-base-jaxb")
6279 (version "2.9.2")
6280 (source (origin
6281 (method url-fetch)
6282 (uri (string-append "https://github.com/FasterXML/"
6283 "jackson-modules-base/archive/"
6284 "jackson-modules-base-" version ".tar.gz"))
6285 (sha256
6286 (base32
6287 "0kc19n5a188g4vpyay44xfb7qcabcbfnwzhx1g84lg0sac8lf0ng"))))
6288 (build-system ant-build-system)
6289 (arguments
6290 `(#:jar-name "jackson-modules-base-jaxb.jar"
6291 #:source-dir "jaxb/src/main/java"
6292 #:test-dir "jaxb/src/test"
6293 #:test-exclude
6294 ;; Base class for tests
6295 (list "**/BaseJaxbTest.java")
6296 #:phases
6297 (modify-phases %standard-phases
6298 (add-before 'configure 'generate-PackageVersion.java
6299 (lambda _
6300 (let* ((out (string-append "jaxb/src/main/java/com/fasterxml/"
6301 "jackson/module/jaxb/PackageVersion.java"))
6302 (in (string-append out ".in")))
6303 (copy-file in out)
6304 (substitute* out
6305 (("@package@") "com.fasterxml.jackson.module.jaxb")
6306 (("@projectversion@") ,version)
6307 (("@projectgroupid@") "com.fasterxml.jackson.module.jaxb")
6308 (("@projectartifactid@") "jackson-module-jaxb")))))
6309 (add-before 'build 'copy-resources
6310 (lambda _
6311 (copy-recursively "jaxb/src/main/resources" "build/classes"))))))
6312 (inputs
6313 `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
6314 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
6315 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)))
6316 (native-inputs
6317 `(("java-junit" ,java-junit)))
6318 (home-page "https://github.com/FasterXML/jackson-modules-base")
6319 (synopsis "Jaxb annotations jackson module")
6320 (description "This package is the jaxb annotations module for jackson.")
6321 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
6322
6323 (define-public java-snakeyaml
6324 (package
6325 (name "java-snakeyaml")
6326 (version "1.18")
6327 (source (origin
6328 (method url-fetch)
6329 (uri (string-append "https://bitbucket.org/asomov/snakeyaml/get/v"
6330 version ".tar.gz"))
6331 (sha256
6332 (base32
6333 "0rf5ha6w0waz50jz2479jsrbgmd0dnx0gs337m126j5z7zlmg7mg"))))
6334 (build-system ant-build-system)
6335 (arguments
6336 `(#:jar-name "java-snakeyaml.jar"
6337 #:source-dir "src/main/java"
6338 ;; Tests require velocity, a cyclic dependency, and
6339 ;; java-spring-framework-context which is not packaged.
6340 #:tests? #f))
6341 (home-page "https://bitbucket.org/asomov/snakeyaml")
6342 (synopsis "YAML processor")
6343 (description "SnakeYAML is a YAML processor for the Java Virtual Machine.")
6344 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
6345
6346 (define-public java-fasterxml-jackson-dataformat-yaml
6347 (package
6348 (name "java-fasterxml-jackson-dataformat-yaml")
6349 (version "2.9.2")
6350 (source (origin
6351 (method url-fetch)
6352 (uri (string-append "https://github.com/FasterXML/"
6353 "jackson-dataformats-text/archive/"
6354 "jackson-dataformats-text-" version ".tar.gz"))
6355 (sha256
6356 (base32
6357 "1x7c7v201jpb8ynjsmmq7jj7hyqzzp39jvpr053ggdndm022yzc7"))))
6358 (build-system ant-build-system)
6359 (arguments
6360 `(#:jar-name "jackson-dataformat-yaml.jar"
6361 #:source-dir "yaml/src/main/java"
6362 #:test-dir "yaml/src/test"
6363 #:test-exclude (list "**/failing/**.java")
6364 #:phases
6365 (modify-phases %standard-phases
6366 (add-before 'configure 'generate-PackageVersion.java
6367 (lambda _
6368 (let* ((out "yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/PackageVersion.java")
6369 (in (string-append out ".in")))
6370 (copy-file in out)
6371 (substitute* out
6372 (("@package@") "com.fasterxml.jackson.dataformat.yaml")
6373 (("@projectversion@") ,version)
6374 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.yaml")
6375 (("@projectartifactid@") "jackson-dataformat-yaml"))))))))
6376 (inputs
6377 `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
6378 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
6379 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
6380 ("java-snakeyaml" ,java-snakeyaml)))
6381 (native-inputs
6382 `(("junit" ,java-junit)
6383 ("hamcrest" ,java-hamcrest-core)
6384 ("java-ops4j-pax-exam-core-spi" ,java-ops4j-pax-exam-core-spi)
6385 ("java-ops4j-pax-exam-core-junit" ,java-ops4j-pax-exam-core-junit)
6386 ("java-ops4j-pax-exam" ,java-ops4j-pax-exam-core)))
6387 (home-page "https://github.com/FasterXML/jackson-dataformats-text")
6388 (synopsis "Yaml backend for Jackson")
6389 (description "Dataformat backends are used to support format alternatives
6390 to JSON, supported by default. This is done by sub-classing Jackson core
6391 abstractions.")
6392 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
6393
6394 (define-public java-stax2-api
6395 (package
6396 (name "java-stax2-api")
6397 (version "4.0.0")
6398 (source (origin
6399 (method url-fetch)
6400 (uri (string-append "https://github.com/FasterXML/stax2-api/archive/"
6401 "stax2-api-" version ".tar.gz"))
6402 (sha256
6403 (base32
6404 "1amc1si0l0hyyw2sawmnzy4hkna3z6fp195y4nm5m9wb9ld5awkq"))))
6405 (build-system ant-build-system)
6406 (arguments
6407 `(#:jar-name "java-stax2-api.jar"
6408 #:source-dir "src/main/java"
6409 #:tests? #f)); no tests
6410 (home-page "https://github.com/FasterXML/stax2-api")
6411 (synopsis "Stax2 API")
6412 (description "Stax2 API is an extension to basic Stax 1.0 API that adds
6413 significant new functionalities, such as full-featured bi-direction validation
6414 interface and high-performance Typed Access API.")
6415 (license license:bsd-2)))
6416
6417 (define-public java-woodstox-core
6418 (package
6419 (name "java-woodstox-core")
6420 (version "5.0.3")
6421 (source (origin
6422 (method url-fetch)
6423 (uri (string-append "https://github.com/FasterXML/woodstox/archive/"
6424 "woodstox-core-" version ".tar.gz"))
6425 (sha256
6426 (base32
6427 "1i7pdgb8jbw6gdy5kmm0l6rz109n2ns92pqalpyp24vb8vlvdfd4"))))
6428 (build-system ant-build-system)
6429 (arguments
6430 `(#:jar-name "woodstox.jar"
6431 #:test-exclude
6432 (list "**/Base*.java" "failing/**")
6433 #:phases
6434 (modify-phases %standard-phases
6435 (add-before 'build 'remove-msv-dep
6436 (lambda _
6437 ;; we don't need osgi, and it depends on msv
6438 (delete-file-recursively "src/main/java/com/ctc/wstx/osgi")
6439 ;; msv's latest release is from 2011 and we don't need it
6440 (delete-file-recursively "src/main/java/com/ctc/wstx/msv")
6441 (delete-file-recursively "src/test/java/wstxtest/osgi")
6442 (delete-file-recursively "src/test/java/wstxtest/msv")))
6443 (add-before 'build 'copy-resources
6444 (lambda _
6445 (copy-recursively "src/main/resources" "build/classes"))))))
6446 (inputs
6447 `(("stax2" ,java-stax2-api)))
6448 (native-inputs
6449 `(("junit" ,java-junit)))
6450 (home-page "https://github.com/FasterXML/woodstox")
6451 (synopsis "Stax XML API implementation")
6452 (description "Woodstox is a stax XML API implementation.")
6453 (license license:asl2.0)))
6454
6455 (define-public java-fasterxml-jackson-dataformat-xml
6456 (package
6457 (name "java-fasterxml-jackson-dataformat-xml")
6458 (version "2.9.2")
6459 (source (origin
6460 (method url-fetch)
6461 (uri (string-append "https://github.com/FasterXML/"
6462 "jackson-dataformat-xml/archive/"
6463 "jackson-dataformat-xml-" version ".tar.gz"))
6464 (sha256
6465 (base32
6466 "1j1qanvcdh6afagr67zqrlypjkf0n6wr1qzpbvkw79lii72j6pbr"))))
6467 (build-system ant-build-system)
6468 (arguments
6469 `(#:jar-name "jackson-dataformat-xml.jar"
6470 #:source-dir "src/main/java"
6471 #:test-exclude
6472 (list "**/failing/**")
6473 #:phases
6474 (modify-phases %standard-phases
6475 (add-before 'configure 'generate-PackageVersion.java
6476 (lambda _
6477 (let* ((out "src/main/java/com/fasterxml/jackson/dataformat/xml/PackageVersion.java")
6478 (in (string-append out ".in")))
6479 (copy-file in out)
6480 (newline)
6481 (substitute* out
6482 (("@package@") "com.fasterxml.jackson.dataformat.xml")
6483 (("@projectversion@") ,version)
6484 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.xml")
6485 (("@projectartifactid@") "jackson-dataformat-xml")))))
6486 (add-before 'build 'copy-resources
6487 (lambda _
6488 (copy-recursively "src/main/resources" "build/classes"))))))
6489 (inputs
6490 `(("jackson-annotations" ,java-fasterxml-jackson-annotations)
6491 ("jackson-core" ,java-fasterxml-jackson-core)
6492 ("jackson-modules-base-jaxb" ,java-fasterxml-jackson-modules-base-jaxb)
6493 ("jackson-databind" ,java-fasterxml-jackson-databind)
6494 ("stax2-api" ,java-stax2-api)
6495 ("woodstox" ,java-woodstox-core)))
6496 (native-inputs
6497 `(("junit" ,java-junit)
6498 ("hamcrest" ,java-hamcrest-core)))
6499 (home-page "https://github.com/FasterXML/jackson-dataformat-xml")
6500 (synopsis "Read and write XML")
6501 (description "This package contains Jackson extension component for reading
6502 and writing XML encoded data.
6503
6504 Further, the goal is to emulate how JAXB data-binding works with \"Code-first\"
6505 approach (that is, no support is added for \"Schema-first\" approach). Support
6506 for JAXB annotations is provided by JAXB annotation module; this module
6507 provides low-level abstractions (@code{JsonParser}, @code{JsonGenerator},
6508 @code{JsonFactory}) as well as small number of higher level overrides needed to
6509 make data-binding work.")
6510 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
6511
6512 (define-public java-hdrhistogram
6513 (package
6514 (name "java-hdrhistogram")
6515 (version "2.1.9")
6516 (source (origin
6517 (method url-fetch)
6518 (uri (string-append "https://github.com/HdrHistogram/HdrHistogram/"
6519 "archive/HdrHistogram-" version ".tar.gz"))
6520 (sha256
6521 (base32
6522 "1sicbmc3sr42nw93qbkb26q9rn33ag33k6k77phjc3j5h5gjffqv"))))
6523 (build-system ant-build-system)
6524 (arguments
6525 `(#:jar-name "java-hdrhistogram.jar"
6526 #:source-dir "src/main/java"
6527 #:phases
6528 (modify-phases %standard-phases
6529 (add-before 'configure 'set-version
6530 (lambda _
6531 (let* ((version-java "src/main/java/org/HdrHistogram/Version.java")
6532 (template (string-append version-java ".template")))
6533 (copy-file template version-java)
6534 (substitute* version-java
6535 (("\\$VERSION\\$") ,version)
6536 (("\\$BUILD_TIME\\$") "0"))
6537 #t))))))
6538 (native-inputs
6539 `(("junit" ,java-junit)
6540 ("hamcrest" ,java-hamcrest-core)))
6541 (home-page "https://hdrhistogram.github.io/HdrHistogram")
6542 (synopsis "High dynamic range histogram")
6543 (description "Hdrhistogram allows to create histograms that support
6544 recording and analyzing sampled data value counts across a configurable integer
6545 value range with configurable value precision within the range. Value precision
6546 is expressed as the number of significant digits in the value recording, and
6547 provides control over value quantization behavior across the value range and
6548 the subsequent value resolution at any given level.")
6549 (license license:public-domain)))
6550
6551 (define-public java-cofoja
6552 (package
6553 (name "java-cofoja")
6554 (version "1.3")
6555 (source (origin
6556 (method git-fetch)
6557 (uri (git-reference
6558 (url "https://github.com/nhatminhle/cofoja.git")
6559 (commit (string-append "v" version))))
6560 (file-name (string-append "java-cofoja-" version "-checkout"))
6561 (sha256
6562 (base32
6563 "0p7sz8y5xgpi5rx1qwn6587fkd52qr3ha3ybh14gqcyxhikl525w"))))
6564 (build-system ant-build-system)
6565 (arguments
6566 `(#:build-target "dist"
6567 #:test-target "test"
6568 #:jdk ,icedtea-8
6569 #:make-flags
6570 (list "-Ddist.dir=dist")
6571 #:modules ((guix build ant-build-system)
6572 (guix build java-utils)
6573 (guix build utils)
6574 (srfi srfi-1)
6575 (ice-9 match))
6576 #:phases
6577 (modify-phases %standard-phases
6578 ;; The bulid system ignores the class path the ant-build-system sets
6579 ;; up and instead expects to find all dependencies in the "lib"
6580 ;; directory.
6581 (add-after 'unpack 'create-libdir
6582 (lambda* (#:key inputs #:allow-other-keys)
6583 (mkdir-p "lib")
6584 (for-each
6585 (lambda (file)
6586 (let ((target (string-append "lib/" (basename file))))
6587 (unless (file-exists? target)
6588 (symlink file target))))
6589 (append-map (match-lambda
6590 ((label . dir)
6591 (find-files dir "\\.jar$")))
6592 inputs))
6593 #t))
6594 (replace 'install (install-jars "dist")))))
6595 (inputs
6596 `(("java-asm" ,java-asm)))
6597 (native-inputs
6598 `(("java-junit" ,java-junit)))
6599 (home-page "https://github.com/nhatminhle/cofoja")
6600 (synopsis "Contracts for Java")
6601 (description "Contracts for Java, or Cofoja for short, is a contract
6602 programming framework and test tool for Java, which uses annotation processing
6603 and bytecode instrumentation to provide run-time checking. (In particular,
6604 this is not a static analysis tool.)")
6605 (license license:lgpl3+)))
6606
6607 (define-public java-aopalliance
6608 (package
6609 (name "java-aopalliance")
6610 (version "1.0")
6611 (source (origin
6612 (method git-fetch)
6613 ;; Note: this git repository is not official, but contains the
6614 ;; source code that is in the CVS repository. Downloading the
6615 ;; tarball from sourceforge is undeterministic, and the cvs download
6616 ;; fails.
6617 (uri (git-reference
6618 (url "https://github.com/hoverruan/aopalliance")
6619 (commit "0d7757ae204e5876f69431421fe9bc2a4f01e8a0")))
6620 (file-name (string-append name "-" version))
6621 (sha256
6622 (base32
6623 "0rsg2b0v3hxlq2yk1i3m2gw3xwq689j3cwx9wbxvqfpdcjbca0qr"))))
6624 (build-system ant-build-system)
6625 (arguments
6626 `(#:jar-name "java-aopalliance.jar"
6627 #:jdk ,icedtea-8
6628 #:tests? #f; no tests
6629 #:source-dir "aopalliance/src/main"))
6630 (home-page "http://aopalliance.sourceforge.net")
6631 (synopsis "Aspect-Oriented Programming")
6632 (description "The AOP Alliance project is a joint project between several
6633 software engineering people who are interested in Aspect-Oriented Programming
6634 (AOP) and Java.")
6635 (license license:public-domain)))
6636
6637 (define-public java-javax-inject
6638 (package
6639 (name "java-javax-inject")
6640 (version "tck-1")
6641 (source (origin
6642 (method url-fetch)
6643 (uri (string-append "https://github.com/javax-inject/javax-inject/"
6644 "archive/javax.inject-" version ".tar.gz"))
6645 (sha256
6646 (base32
6647 "1ydrlvh2r7vr1g7lhjwy3w2dggpj9h6pix1lakkkgdywb365n6g0"))))
6648 (build-system ant-build-system)
6649 (arguments
6650 `(#:jar-name "java-javax-inject.jar"
6651 #:jdk ,icedtea-8
6652 #:tests? #f)); no tests
6653 (home-page "http://github.com/javax-inject/javax-inject")
6654 (synopsis "JSR-330: Dependency Injection for Java")
6655 (description "This package specifies a means for obtaining objects in such
6656 a way as to maximize reusability, testability and maintainability compared to
6657 traditional approaches such as constructors, factories, and service locators
6658 (e.g., JNDI). This process, known as dependency injection, is beneficial to
6659 most nontrivial applications.
6660
6661 Many types depend on other types. For example, a @var{Stopwatch} might depend
6662 on a @var{TimeSource}. The types on which a type depends are known as its
6663 dependencies. The process of finding an instance of a dependency to use at run
6664 time is known as resolving the dependency. If no such instance can be found,
6665 the dependency is said to be unsatisfied, and the application is broken.")
6666 (license license:asl2.0)))
6667
6668 (define-public java-guice
6669 (package
6670 (name "java-guice")
6671 (version "4.1")
6672 (source (origin
6673 (method url-fetch)
6674 (uri (string-append "https://github.com/google/guice/archive/"
6675 version ".tar.gz"))
6676 (file-name (string-append name "-" version ".tar.gz"))
6677 (sha256
6678 (base32
6679 "0dwmqjzlavb144ywqqglj3h68hqszkff8ai0a42hyb5il0qh4rbp"))))
6680 (build-system ant-build-system)
6681 (arguments
6682 `(#:jar-name "java-guice.jar"
6683 #:jdk ,icedtea-8
6684 #:tests? #f; FIXME: tests are not in a java sub directory
6685 #:source-dir "core/src"))
6686 (inputs
6687 `(("guava" ,java-guava)
6688 ("java-cglib" ,java-cglib)
6689 ("java-aopalliance" ,java-aopalliance)
6690 ("java-javax-inject" ,java-javax-inject)
6691 ("java-asm" ,java-asm)))
6692 (home-page "https://github.com/google/guice")
6693 (synopsis "Lightweight dependency injection framework")
6694 (description "Guice is a lightweight dependency injection framework fo
6695 Java 6 and above.")
6696 (license license:asl2.0)))
6697
6698 (define-public java-guice-servlet
6699 (package
6700 (inherit java-guice)
6701 (name "java-guice-servlet")
6702 (arguments
6703 `(#:jar-name "guice-servlet.jar"
6704 #:source-dir "extensions/servlet/src/"
6705 #:jdk ,icedtea-8
6706 #:tests? #f)); FIXME: not in a java subdir
6707 (inputs
6708 `(("guice" ,java-guice)
6709 ("servlet" ,java-tomcat)
6710 ,@(package-inputs java-guice)))))
6711
6712 (define-public java-assertj
6713 (package
6714 (name "java-assertj")
6715 (version "3.8.0")
6716 (source (origin
6717 (method url-fetch)
6718 (uri (string-append "https://github.com/joel-costigliola/"
6719 "assertj-core/archive/"
6720 "assertj-core-" version ".tar.gz"))
6721 (sha256
6722 (base32
6723 "1kf124fxskf548rklkg86294w2x6ajqrff94rrhyqns31danqkfz"))))
6724 (build-system ant-build-system)
6725 (arguments
6726 `(#:jar-name "java-assertj.jar"
6727 #:jdk ,icedtea-8
6728 #:source-dir "src/main/java"
6729 #:tests? #f)); depends on tng-junit which depends on assertj
6730 (inputs
6731 `(("cglib" ,java-cglib)
6732 ("junit" ,java-junit)
6733 ("hamcrest" ,java-hamcrest-core)))
6734 (native-inputs
6735 `(("mockito" ,java-mockito-1)))
6736 (home-page "https://joel-costigliola.github.io/assertj/index.html")
6737 (synopsis "Fluent assertions for java")
6738 (description "AssertJ core is a Java library that provides a fluent
6739 interface for writing assertions. Its main goal is to improve test code
6740 readability and make maintenance of tests easier.")
6741 (license license:asl2.0)))
6742
6743 (define-public java-jboss-javassist
6744 (package
6745 (name "java-jboss-javassist")
6746 (version "3.21.0")
6747 (source (origin
6748 (method url-fetch)
6749 (uri (string-append "https://github.com/jboss-javassist/javassist/"
6750 "archive/rel_"
6751 (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
6752 "_ga.tar.gz"))
6753 (sha256
6754 (base32
6755 "10lpcr3sbf7y6fq6fc2h2ik7rqrivwcy4747bg0kxhwszil3cfmf"))))
6756 (build-system ant-build-system)
6757 (arguments
6758 `(#:jar-name "java-jboss-javassist.jar"
6759 #:jdk ,icedtea-8
6760 #:source-dir "src/main"
6761 #:tests? #f; FIXME: requires junit-awtui and junit-swingui from junit3
6762 #:phases
6763 (modify-phases %standard-phases
6764 (add-before 'configure 'remove-binary
6765 (lambda _
6766 (delete-file "javassist.jar")
6767 #t)))))
6768 (native-inputs
6769 `(("junit" ,java-junit)))
6770 (home-page "https://github.com/jboss-javassist/javassist")
6771 (synopsis "Java bytecode engineering toolkit")
6772 (description "Javassist (JAVA programming ASSISTant) makes Java bytecode
6773 manipulation simple. It is a class library for editing bytecodes in Java; it
6774 enables Java programs to define a new class at runtime and to modify a class
6775 file when the JVM loads it.")
6776 (license (list license:gpl2 license:cddl1.0)))); either gpl2 only or cddl.
6777
6778 (define-public java-jcommander
6779 (package
6780 (name "java-jcommander")
6781 (version "1.71")
6782 (source (origin
6783 (method url-fetch)
6784 (uri (string-append "https://github.com/cbeust/jcommander/archive/"
6785 version ".tar.gz"))
6786 (file-name (string-append name "-" version ".tar.gz"))
6787 (sha256
6788 (base32
6789 "1f5k2ckay6qjc3d3w3d7bc0p3cx3c7n6p6zxvw1kibqdr0q98wlx"))))
6790 (build-system ant-build-system)
6791 (arguments
6792 `(#:jar-name "java-jcommander.jar"
6793 #:jdk ,icedtea-8
6794 #:tests? #f; requires testng which depends on jcommander
6795 #:source-dir "src/main/java"))
6796 (home-page "http://jcommander.org")
6797 (synopsis "Command line parameters parser")
6798 (description "JCommander is a very small Java framework that makes it
6799 trivial to parse command line parameters. Parameters are declared with
6800 annotations.")
6801 (license license:asl2.0)))
6802
6803 (define-public java-bsh
6804 (package
6805 (name "java-bsh")
6806 (version "2.0b6")
6807 (source (origin
6808 (method url-fetch)
6809 (uri (string-append "https://github.com/beanshell/beanshell/archive/"
6810 version ".tar.gz"))
6811 (file-name (string-append name "-" version ".tar.gz"))
6812 (sha256
6813 (base32
6814 "1bawkxk6jyc75hxvzkpz689h73cn3f222m0ar3nvb0dal2b85kfv"))))
6815 (build-system ant-build-system)
6816 (arguments
6817 `(#:build-target "jarall"
6818 #:test-target "junit-tests-all"
6819 #:phases
6820 (modify-phases %standard-phases
6821 (replace 'install
6822 (lambda* (#:key outputs #:allow-other-keys)
6823 (let ((share (string-append (assoc-ref outputs "out") "/share/java")))
6824 (mkdir-p share)
6825 (copy-file "dist/bsh-2.0b6.jar" (string-append share "/bsh-2.0b6.jar"))
6826 #t))))))
6827 (home-page "http://beanshell.org/")
6828 (synopsis "Lightweight Scripting for Java")
6829 (description "BeanShell is a small, free, embeddable Java source
6830 interpreter with object scripting language features, written in Java.
6831 BeanShell dynamically executes standard Java syntax and extends it with common
6832 scripting conveniences such as loose types, commands, and method closures like
6833 those in Perl and JavaScript.")
6834 (license license:asl2.0)))
6835
6836 (define-public java-fest-util
6837 (package
6838 (name "java-fest-util")
6839 (version "1.2.5")
6840 (source (origin
6841 (method url-fetch)
6842 (uri (string-append "https://github.com/alexruiz/fest-util/"
6843 "archive/fest-util-" version ".tar.gz"))
6844 (sha256
6845 (base32
6846 "05g6hljz5mdaakk8d7g32klbhz9bdwp3qlj6rdaggdidxs3x1sb8"))))
6847 (build-system ant-build-system)
6848 (arguments
6849 `(#:jar-name "java-fest-util.jar"
6850 #:source-dir "src/main/java"))
6851 (native-inputs
6852 `(("junit" ,java-junit)
6853 ("hamcrest" ,java-hamcrest-core)))
6854 (home-page "https://github.com/alexruiz/fest-util")
6855 (synopsis "FEST common utilities")
6856 (description "Common utilities used in all FEST module.")
6857 (license license:asl2.0)))
6858
6859 (define-public java-fest-test
6860 (package
6861 (name "java-fest-test")
6862 (version "2.1.0")
6863 (source (origin
6864 (method url-fetch)
6865 (uri (string-append "https://github.com/alexruiz/fest-test/"
6866 "archive/fest-test-" version ".tar.gz"))
6867 (sha256
6868 (base32
6869 "1rxfbw6l9vc65iy1x3fb617qc6y4w2k430pgf1mfbxfdlxbm0f7g"))))
6870 (build-system ant-build-system)
6871 (arguments
6872 `(#:jar-name "java-fest-test.jar"
6873 #:source-dir "src/main/java"
6874 #:tests? #f)); no tests
6875 (inputs
6876 `(("junit" ,java-junit)))
6877 (home-page "https://github.com/alexruiz/fest-test")
6878 (synopsis "Common FEST testing infrastructure")
6879 (description "Fest-test contains the common FEST testing infrastructure.")
6880 (license license:asl2.0)))
6881
6882 (define-public java-fest-assert
6883 (package
6884 (name "java-fest-assert")
6885 (version "2.0M10")
6886 (source (origin
6887 (method url-fetch)
6888 (uri (string-append "https://github.com/alexruiz/fest-assert-2.x/"
6889 "archive/fest-assert-core-" version ".tar.gz"))
6890 (sha256
6891 (base32
6892 "1bi0iqavikzww6rxvz5jyg7y6bflv95s6ibryxx0xfcxrrw6i5lw"))))
6893 (build-system ant-build-system)
6894 (arguments
6895 `(#:jar-name "java-fest-assert.jar"
6896 #:source-dir "src/main/java"
6897 #:test-exclude
6898 (list
6899 "**/Abstract*.java"
6900 "**/*BaseTest.java"
6901 ;; Unable to set MockitoNamingPolicy on cglib generator which creates FastClasses
6902 "**/MessageFormatter_format_Test.java"
6903 "**/internal/*/*_assert*_Test.java")))
6904 (inputs
6905 `(("java-fest-util" ,java-fest-util)))
6906 (native-inputs
6907 `(("java-junit" ,java-junit)
6908 ("java-fest-test" ,java-fest-test)
6909 ("java-hamcrest-core" ,java-hamcrest-core)
6910 ("java-mockito" ,java-mockito-1)
6911 ("java-cglib" ,java-cglib)
6912 ("java-objenesis" ,java-objenesis)
6913 ("java-asm" ,java-asm)))
6914 (home-page "https://github.com/alexruiz/fest-assert-2.x")
6915 (synopsis "FEST fluent assertions")
6916 (description "FEST-Assert provides a fluent interface for assertions.")
6917 (license license:asl2.0)))
6918
6919 (define-public java-testng
6920 (package
6921 (name "java-testng")
6922 (version "6.12")
6923 (source (origin
6924 (method url-fetch)
6925 (uri (string-append "https://github.com/cbeust/testng/archive/"
6926 version ".tar.gz"))
6927 (file-name (string-append name "-" version ".tar.gz"))
6928 (sha256
6929 (base32
6930 "01j2x47wkj7n5w6gpcjfbwgc88ai5654b23lb87w7nsrj63m3by6"))))
6931 (build-system ant-build-system)
6932 (arguments
6933 `(#:jdk ,icedtea-8; java.util.function
6934 #:jar-name "java-testng.jar"
6935 #:source-dir "src/main/java"
6936 #:phases
6937 (modify-phases %standard-phases
6938 (add-before 'build 'copy-resources
6939 (lambda _
6940 (copy-recursively "src/main/resources" "build/classes")
6941 #t))
6942 (add-before 'check 'copy-test-resources
6943 (lambda _
6944 (copy-recursively "src/test/resources" "build/test-classes")
6945 #t))
6946 (replace 'check
6947 (lambda _
6948 (system* "ant" "compile-tests")
6949 ;; we don't have groovy
6950 (substitute* "src/test/resources/testng.xml"
6951 (("<class name=\"test.groovy.GroovyTest\" />") ""))
6952 (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH")
6953 ":build/classes"
6954 ":build/test-classes")
6955 "-Dtest.resources.dir=src/test/resources"
6956 "org.testng.TestNG" "src/test/resources/testng.xml")))))))
6957 (propagated-inputs
6958 `(("junit" ,java-junit)
6959 ("java-jsr305" ,java-jsr305)
6960 ("java-bsh" ,java-bsh)
6961 ("java-jcommander" ,java-jcommander)
6962 ("java-guice" ,java-guice)
6963 ("snakeyaml" ,java-snakeyaml)))
6964 (native-inputs
6965 `(("guava" ,java-guava)
6966 ("java-javax-inject" ,java-javax-inject)
6967 ("java-hamcrest" ,java-hamcrest-all)
6968 ("java-assertj" ,java-assertj)
6969 ("cglib" ,java-cglib)
6970 ("asm" ,java-asm)
6971 ("aopalliance" ,java-aopalliance)))
6972 (home-page "http://testng.org")
6973 (synopsis "Testing framework")
6974 (description "TestNG is a testing framework inspired from JUnit and NUnit
6975 but introducing some new functionalities that make it more powerful and easier
6976 to use.")
6977 (license license:asl2.0)))
6978
6979 (define-public java-jnacl
6980 (package
6981 (name "java-jnacl")
6982 (version "0.1.0")
6983 (source (origin
6984 (method git-fetch)
6985 (uri (git-reference
6986 (url "https://github.com/neilalexander/jnacl")
6987 (commit "40c322e0a42637ab17cdf941138eeaf2494055f8")))
6988 (sha256
6989 (base32
6990 "1pspnmp44q61a2q4bpslpxw86rfn8s5l0xgvyrikqgdvg7ypx597"))))
6991 (build-system ant-build-system)
6992 (arguments
6993 `(#:jar-name "java-jnacl.jar"
6994 #:source-dir "src/main/java"
6995 #:jdk ,icedtea-8
6996 #:phases
6997 (modify-phases %standard-phases
6998 (add-before 'build 'fix-tests
6999 (lambda _
7000 (substitute* "src/test/java/com/neilalexander/jnacl/NaClTest.java"
7001 (("assertions.Assertions") "assertions.api.Assertions"))
7002 (substitute* "src/test/java/com/neilalexander/jnacl/NaclSecretBoxTest.java"
7003 (("assertions.Assertions") "assertions.api.Assertions"))
7004 #t))
7005 (replace 'check
7006 (lambda _
7007 (system* "ant" "compile-tests")
7008 (and
7009 (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH")
7010 ":build/classes"
7011 ":build/test-classes")
7012 "org.testng.TestNG" "-testclass"
7013 "build/test-classes/com/neilalexander/jnacl/NaclSecretBoxTest.class"))
7014 (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH")
7015 ":build/classes"
7016 ":build/test-classes")
7017 "org.testng.TestNG" "-testclass"
7018 "build/test-classes/com/neilalexander/jnacl/NaClTest.class"))))))))
7019 (native-inputs
7020 `(("java-testng" ,java-testng)
7021 ("java-fest-util" ,java-fest-util)
7022 ("java-fest-assert" ,java-fest-assert)))
7023 (home-page "https://github.com/neilalexander/jnacl")
7024 (synopsis "Java implementation of NaCl")
7025 (description "Pure Java implementation of the NaCl: Networking and
7026 Cryptography library.")
7027 (license license:mpl2.0)))
7028
7029 (define-public java-mvel2
7030 (package
7031 (name "java-mvel2")
7032 (version "2.3.1")
7033 (source (origin
7034 (method url-fetch)
7035 (uri (string-append "https://github.com/mvel/mvel/archive/mvel2-"
7036 version ".Final.tar.gz"))
7037 (sha256
7038 (base32
7039 "01ph5s9gm16l2qz58lg21w6fna7xmmrj7f9bzqr1jim7h9557d3z"))))
7040 (build-system ant-build-system)
7041 (arguments
7042 `(#:jar-name "mvel2.jar"
7043 #:source-dir "src/main/java"
7044 #:test-exclude
7045 (list "**/Abstract*.java"
7046 ;; Base class with no tests
7047 "**/MVELThreadTest.java")
7048 #:phases
7049 (modify-phases %standard-phases
7050 (add-after 'install 'install-bin
7051 (lambda* (#:key outputs #:allow-other-keys)
7052 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
7053 (mkdir-p bin)
7054 (with-output-to-file (string-append bin "/mvel2")
7055 (lambda _
7056 (display
7057 (string-append
7058 "#!" (which "bash") "\n"
7059 "if [ \"$#\" -ne \"2\" ]; then\n"
7060 "echo 'Usage: mvel2 <script> <out.dir>'\n"
7061 "exit\n"
7062 "fi\n"
7063 "java -Dout.dir=$2 -cp " (getenv "CLASSPATH")
7064 ":" (assoc-ref outputs "out") "/share/java/mvel2.jar"
7065 " org.mvel2.sh.Main $1"))))
7066 (chmod (string-append bin "/mvel2") #o755))
7067 #t)))))
7068 (native-inputs
7069 `(("junit" ,java-junit)
7070 ("hamcrest" ,java-hamcrest-core)))
7071 (home-page "https://github.com/mvel/mvel")
7072 (synopsis "MVFLEX Expression Language")
7073 (description "MVEL has largely been inspired by Java syntax, but has some
7074 fundamental differences aimed at making it more efficient as an expression
7075 language, such as operators that directly support collection, array and string
7076 matching, as well as regular expressions. MVEL is used to evaluate expressions
7077 written using Java syntax.
7078
7079 In addition to the expression language, MVEL serves as a templating language for
7080 configuration and string construction.")
7081 (license license:asl2.0)))
7082
7083 (define-public java-commons-jexl-2
7084 (package
7085 (name "java-commons-jexl")
7086 (version "2.1.1")
7087 (source (origin
7088 (method url-fetch)
7089 (uri (string-append "mirror://apache/commons/jexl/source/"
7090 "commons-jexl-" version "-src.tar.gz"))
7091 (sha256
7092 (base32
7093 "1ai7632bwwaxglb0nbpblpr2jw5g20afrsaq372ipkphi3ncy1jz"))))
7094 (build-system ant-build-system)
7095 (arguments
7096 `(#:jar-name "commons-jexl-2.jar"
7097 #:jdk ,icedtea-8
7098 #:source-dir "src/main/java"
7099 #:phases
7100 (modify-phases %standard-phases
7101 (add-before 'check 'disable-broken-tests
7102 (lambda* (#:key inputs #:allow-other-keys)
7103 (with-directory-excursion "src/test/java/org/apache/commons/jexl2/"
7104 (substitute* "ArithmeticTest.java"
7105 (("asserter.assertExpression\\(\"3 / 0\"") "//")
7106 (("asserter.assertExpression\\(\"imanull") "//"))
7107 ;; This test fails with "ambiguous method invocation"
7108 (delete-file "CacheTest.java")
7109 ;; This test doesn't have access to the temp directory
7110 (substitute* "ClassCreatorTest.java"
7111 (("java.io.tmpdir") "user.dir"))
7112 ;; This test fails in trying to detect whether it can run.
7113 (substitute* "ClassCreator.java"
7114 (("boolean canRun =.*") "boolean canRun = false;\n"))
7115 ;; ...and these tests depend on it.
7116 (delete-file "scripting/JexlScriptEngineOptionalTest.java")
7117 (delete-file "scripting/JexlScriptEngineTest.java"))
7118 #t))
7119 (add-before 'build 'run-javacc
7120 (lambda _
7121 (with-directory-excursion "src/main/java/org/apache/commons/jexl2/parser/"
7122 (and (zero? (system* "java" "jjtree" "Parser.jjt"))
7123 (zero? (system* "java" "javacc" "Parser.jj")))))))))
7124 (inputs
7125 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)))
7126 (native-inputs
7127 `(("java-junit" ,java-junit)
7128 ("java-hamcrest-core" ,java-hamcrest-core)
7129 ("javacc" ,javacc-4)))
7130 (home-page "https://commons.apache.org/proper/commons-jexl/")
7131 (synopsis "Java Expression Language ")
7132 (description "JEXL is a library intended to facilitate the implementation
7133 of dynamic and scripting features in applications and frameworks written in
7134 Java. JEXL implements an Expression Language based on some extensions to the
7135 JSTL Expression Language supporting most of the constructs seen in
7136 shell-script or ECMAScript. Its goal is to expose scripting features usable
7137 by technical operatives or consultants working with enterprise platforms.")
7138 (license license:asl2.0)))
7139
7140 (define-public java-lz4
7141 (package
7142 (name "java-lz4")
7143 (version "1.4.0")
7144 (source (origin
7145 (method url-fetch)
7146 (uri (string-append "https://github.com/lz4/lz4-java/archive/"
7147 version ".tar.gz"))
7148 (file-name (string-append name "-" version ".tar.gz"))
7149 (sha256
7150 (base32
7151 "096dm57p2lzqk28n0j2p52x2j3cvnsd2dfqn43n7vbwrkjsy7y54"))))
7152 (build-system ant-build-system)
7153 (arguments
7154 `(#:jar-name "lz4.jar"
7155 #:jdk ,icedtea-8
7156 #:source-dir "src/java:src/java-unsafe"
7157 #:tests? #f; FIXME: requires more dependencies
7158 #:phases
7159 (modify-phases %standard-phases
7160 (add-before 'configure 'generate-source
7161 (lambda _
7162 (with-directory-excursion "src/build/source_templates"
7163 (zero? (system* "mvel2" "../gen_sources.mvel" "../../java"))))))))
7164 (native-inputs
7165 `(("mvel" ,java-mvel2)))
7166 (home-page "https://jpountz.github.io/lz4-java")
7167 (synopsis "Compression algorithm")
7168 (description "LZ4 - Java is a Java port of the popular lz4 compression
7169 algorithms and xxHash hashing algorithm.")
7170 (license license:asl2.0)))
7171
7172 (define-public java-bouncycastle-bcprov
7173 (package
7174 (name "java-bouncycastle-bcprov")
7175 (version "1.58")
7176 (source (origin
7177 (method url-fetch)
7178 (uri "https://bouncycastle.org/download/bcprov-jdk15on-158.tar.gz")
7179 (sha256
7180 (base32
7181 "1hgkg96llbvgs8i0krwz2n0j7wlg6jfnq8w8kg0cc899j0wfmf3n"))))
7182 (build-system ant-build-system)
7183 (arguments
7184 `(#:jar-name "bouncycastle-bcprov.jar"
7185 #:tests? #f; no tests
7186 #:source-dir "src"
7187 #:phases
7188 (modify-phases %standard-phases
7189 (add-before 'configure 'unzip-src
7190 (lambda _
7191 (mkdir-p "src")
7192 (with-directory-excursion "src"
7193 (zero? (system* "unzip" "../src.zip"))))))))
7194 (native-inputs
7195 `(("unzip" ,unzip)
7196 ("junit" ,java-junit)))
7197 (home-page "https://www.bouncycastle.org")
7198 (synopsis "Cryptographic library")
7199 (description "Bouncy Castle Provider (bcprov) is a cryptographic library
7200 for the Java programming language.")
7201 (license license:expat)))
7202
7203 (define-public java-bouncycastle-bcpkix
7204 (package
7205 (name "java-bouncycastle-bcpkix")
7206 (version "1.58")
7207 (source (origin
7208 (method url-fetch)
7209 (uri "https://bouncycastle.org/download/bcpkix-jdk15on-158.tar.gz")
7210 (sha256
7211 (base32
7212 "0is7qay02803s9f7lhnfcjlz61ni3hq5d7apg0iil7nbqkbfbcq2"))))
7213 (build-system ant-build-system)
7214 (arguments
7215 `(#:jar-name "bouncycastle-bcpkix.jar"
7216 #:tests? #f; no tests
7217 #:source-dir "src"
7218 #:phases
7219 (modify-phases %standard-phases
7220 (add-before 'configure 'unzip-src
7221 (lambda _
7222 (mkdir-p "src")
7223 (with-directory-excursion "src"
7224 (zero? (system* "unzip" "../src.zip"))))))))
7225 (native-inputs
7226 `(("unzip" ,unzip)
7227 ("junit" ,java-junit)))
7228 (inputs
7229 `(("bcprov" ,java-bouncycastle-bcprov)))
7230 (home-page "https://www.bouncycastle.org")
7231 (synopsis "Cryptographic library")
7232 (description "Bouncy Castle Java API for PKIX, CMS, EAC, TSP, PKCS, OCSP,
7233 CMP, and CRMF.")
7234 (license license:expat)))
7235
7236 (define-public java-lmax-disruptor
7237 (package
7238 (name "java-lmax-disruptor")
7239 (version "3.3.7")
7240 (source (origin
7241 (method url-fetch)
7242 (uri (string-append "https://github.com/LMAX-Exchange/disruptor/"
7243 "archive/" version ".tar.gz"))
7244 (file-name (string-append name "-" version ".tar.gz"))
7245 (sha256
7246 (base32
7247 "17da2gwj5abnlsfgn2xqjk5lgzbg4vkb0hdv2dvc8r2fx4bi7w3g"))))
7248 (build-system ant-build-system)
7249 (arguments
7250 `(#:jar-name "java-lmax-disruptor.jar"
7251 #:jdk ,icedtea-8
7252 #:tests? #f)); tests hang
7253 (inputs
7254 `(("junit" ,java-junit)
7255 ("java-hdrhistogram" ,java-hdrhistogram)
7256 ("java-jmock" ,java-jmock)
7257 ("java-jmock-legacy" ,java-jmock-legacy)
7258 ("java-jmock-junit4" ,java-jmock-junit4)
7259 ("java-hamcrest-all" ,java-hamcrest-all)))
7260 (native-inputs
7261 `(("cglib" ,java-cglib)
7262 ("objenesis" ,java-objenesis)
7263 ("asm" ,java-asm)))
7264 (home-page "https://www.lmax.com/disruptor")
7265 (synopsis "High performance inter-thread communication")
7266 (description "LMAX Disruptor is a software pattern and software component
7267 for high performance inter-thread communication that avoids the need for
7268 message queues or resource locking.")
7269 (license license:asl2.0)))
7270
7271 (define-public java-commons-bcel
7272 (package
7273 (name "java-commons-bcel")
7274 (version "6.1")
7275 (source (origin
7276 (method url-fetch)
7277 (uri (string-append "mirror://apache/commons/bcel/source/bcel-"
7278 version "-src.tar.gz"))
7279 (sha256
7280 (base32
7281 "0j3x1rxd673k07psclk8k13rqh0x0mf2yy5qiwkiw4z3afa568jy"))))
7282 (build-system ant-build-system)
7283 (arguments
7284 `(#:jar-name "bcel.jar"
7285 #:jdk ,icedtea-8
7286 #:source-dir "src/main/java"
7287 #:test-dir "src/test/java"
7288 ;; FIXME: Tests require the unpackaged jna.
7289 #:tests? #f))
7290 (home-page "https://commons.apache.org/proper/commons-bcel/")
7291 (synopsis "Byte code engineering library")
7292 (description "The Byte Code Engineering Library (Apache Commons BCEL) is
7293 intended to give users a convenient way to analyze, create, and
7294 manipulate (binary) Java class files. Classes are represented by objects
7295 which contain all the symbolic information of the given class: methods, fields
7296 and byte code instructions, in particular.
7297
7298 Such objects can be read from an existing file, be transformed by a
7299 program (e.g. a class loader at run-time) and written to a file again. An
7300 even more interesting application is the creation of classes from scratch at
7301 run-time. The @dfn{Byte Code Engineering Library} (BCEL) may be also useful
7302 if you want to learn about the @dfn{Java Virtual Machine} (JVM) and the format
7303 of Java @code{.class} files.")
7304 (license license:asl2.0)))
7305
7306 (define-public java-xerial-core
7307 (package
7308 (name "java-xerial-core")
7309 (version "2.1")
7310 (source (origin
7311 (method url-fetch)
7312 (uri (string-append "https://github.com/xerial/xerial-java/archive/"
7313 version ".tar.gz"))
7314 (file-name (string-append name "-" version ".tar.gz"))
7315 (sha256
7316 (base32
7317 "0d3g863i41bgalpa4xr3vm1h140l091n8iwgq5qvby5yivns9y8d"))))
7318 (build-system ant-build-system)
7319 (arguments
7320 `(#:jar-name "xerial-core.jar"
7321 #:source-dir "xerial-core/src/main/java"
7322 #:test-dir "xerial-core/src/test"
7323 #:phases
7324 (modify-phases %standard-phases
7325 (add-before 'build 'copy-resources
7326 (lambda _
7327 (copy-recursively "xerial-core/src/main/resources"
7328 "build/classes")
7329 #t)))))
7330 (native-inputs
7331 `(("junit" ,java-junit)
7332 ("hamcrest" ,java-hamcrest-core)))
7333 (home-page "https://github.com/xerial/xerial-java")
7334 (synopsis "Data managment libraries for Java")
7335 (description "Xerial is a set of data management libraries for the Java
7336 programming language. The ulitimate goal of the Xerial project is to manage
7337 everything as database, including class objects, text format data, data
7338 streams, etc.")
7339 (license license:asl2.0)))
7340
7341 (define-public java-powermock-reflect
7342 (package
7343 (name "java-powermock-reflect")
7344 (version "1.7.3")
7345 (source (origin
7346 (method url-fetch)
7347 (uri (string-append "https://github.com/powermock/powermock/"
7348 "archive/powermock-" version ".tar.gz"))
7349 (file-name (string-append name "-" version ".tar.gz"))
7350 (sha256
7351 (base32
7352 "0sbgi5vqq7k72wzcdjb20s370vyd4hsbnx71pzb8ishml3gy7fwy"))
7353 (patches
7354 (search-patches "java-powermock-fix-java-files.patch"))))
7355 (build-system ant-build-system)
7356 (arguments
7357 `(#:jar-name "java-powermock-reflect.jar"
7358 #:jdk ,icedtea-8
7359 #:source-dir "powermock-reflect/src/main/java"
7360 #:test-dir "powermock-reflect/src/test"))
7361 (inputs
7362 `(("java-objenesis" ,java-objenesis)))
7363 (native-inputs
7364 `(("junit" ,java-junit)
7365 ("cglib" ,java-cglib)
7366 ("asm" ,java-asm)
7367 ("hamcrest" ,java-hamcrest-core)
7368 ("assertj" ,java-assertj)))
7369 (home-page "https://github.com/powermock/powermock")
7370 (synopsis "Mock library extension framework")
7371 (description "PowerMock is a framework that extends other mock libraries
7372 such as EasyMock with more powerful capabilities. PowerMock uses a custom
7373 classloader and bytecode manipulation to enable mocking of static methods,
7374 constructors, final classes and methods, private methods, removal of static
7375 initializers and more. By using a custom classloader no changes need to be
7376 done to the IDE or continuous integration servers which simplifies adoption.")
7377 (license license:asl2.0)))
7378
7379 (define-public java-powermock-core
7380 (package
7381 (inherit java-powermock-reflect)
7382 (name "java-powermock-core")
7383 (arguments
7384 `(#:jar-name "java-powermock-core.jar"
7385 #:source-dir "powermock-core/src/main/java"
7386 #:test-dir "powermock-core/src/test"
7387 #:tests? #f; requires powermock-api
7388 #:jdk ,icedtea-8))
7389 (inputs
7390 `(("reflect" ,java-powermock-reflect)
7391 ("javassist" ,java-jboss-javassist)))
7392 (native-inputs
7393 `(("junit" ,java-junit)
7394 ("assertj" ,java-assertj)
7395 ("mockito" ,java-mockito-1)))))
7396
7397 (define-public java-powermock-api-support
7398 (package
7399 (inherit java-powermock-reflect)
7400 (name "java-powermock-api-support")
7401 (build-system ant-build-system)
7402 (arguments
7403 `(#:jar-name "java-powermock-api-support.jar"
7404 #:jdk ,icedtea-8
7405 #:source-dir "powermock-api/powermock-api-support/src/main/java"
7406 #:tests? #f)); no tests
7407 (inputs
7408 `(("core" ,java-powermock-core)
7409 ("reflect" ,java-powermock-reflect)))))
7410
7411 (define-public java-powermock-modules-junit4-common
7412 (package
7413 (inherit java-powermock-reflect)
7414 (name "java-powermock-modules-junit4-common")
7415 (build-system ant-build-system)
7416 (arguments
7417 `(#:jar-name "java-powermock-modules-junit4-common.jar"
7418 #:jdk ,icedtea-8
7419 #:source-dir "powermock-modules/powermock-module-junit4-common/src/main/java"
7420 #:test-dir "powermock-modules/powermock-module-junit4-common/src/test"))
7421 (inputs
7422 `(("core" ,java-powermock-core)
7423 ("easymock" ,java-easymock)
7424 ("reflect" ,java-powermock-reflect)
7425 ("hamcrest" ,java-hamcrest-core)
7426 ("cglib" ,java-cglib)))))
7427
7428 (define-public java-powermock-modules-junit4
7429 (package
7430 (inherit java-powermock-reflect)
7431 (name "java-powermock-modules-junit4")
7432 (build-system ant-build-system)
7433 (arguments
7434 `(#:jar-name "java-powermock-modules-junit4.jar"
7435 #:jdk ,icedtea-8
7436 #:source-dir "powermock-modules/powermock-module-junit4/src/main/java"
7437 #:test-dir "powermock-modules/powermock-module-junit4/src/test"))
7438 (inputs
7439 `(("core" ,java-powermock-core)
7440 ("reflect" ,java-powermock-reflect)
7441 ("common" ,java-powermock-modules-junit4-common)
7442 ("cglib" ,java-cglib)))
7443 (native-inputs
7444 `(("easymock" ,java-easymock)
7445 ("hamcrest" ,java-hamcrest-core)
7446 ("objenesis" ,java-objenesis)
7447 ("asm" ,java-asm)
7448 ("junit" ,java-junit)))))
7449
7450 (define-public java-powermock-api-easymock
7451 (package
7452 (inherit java-powermock-reflect)
7453 (name "java-powermock-api-easymock")
7454 (build-system ant-build-system)
7455 (arguments
7456 `(#:jar-name "java-powermock-api-easymock.jar"
7457 #:jdk ,icedtea-8
7458 #:source-dir "powermock-api/powermock-api-easymock/src/main/java"
7459 #:tests? #f; no tests
7460 #:phases
7461 (modify-phases %standard-phases
7462 (add-before 'build 'fix-file
7463 (lambda _
7464 ;; FIXME: This looks wrong, but it fixes a build error.
7465 (with-directory-excursion "powermock-api/powermock-api-easymock"
7466 (substitute* "src/main/java/org/powermock/api/easymock/PowerMock.java"
7467 (("classLoader instanceof MockClassLoader") "false")
7468 (("\\(\\(MockClassLoader\\) classLoader\\).*;") ";")))
7469 #t)))))
7470 (inputs
7471 `(("core" ,java-powermock-core)
7472 ("easymock" ,java-easymock)
7473 ("reflect" ,java-powermock-reflect)
7474 ("support" ,java-powermock-api-support)
7475 ("cglib" ,java-cglib)))))
7476
7477 (define-public java-jboss-jms-api-spec
7478 (package
7479 (name "java-jboss-jms-api-spec")
7480 (version "2.0")
7481 (source (origin
7482 (method url-fetch)
7483 (uri (string-append "https://github.com/jboss/jboss-jms-api_spec/"
7484 "archive/jboss-jms-api_" version
7485 "_spec-1.0.1.Final.tar.gz"))
7486 (sha256
7487 (base32
7488 "07bqblw9kq2i8q92bz70fvavq5xjfkaixl8xa0m0cypjgy82rb7m"))))
7489 (build-system ant-build-system)
7490 (arguments
7491 `(#:jar-name "java-jboss-jms-api_spec.jar"
7492 #:jdk ,icedtea-8
7493 #:source-dir "."
7494 #:tests? #f)); no tests
7495 (home-page "https://github.com/jboss/jboss-jms-api_spec")
7496 (synopsis "Java Message Service API specification")
7497 (description "Java Message Service (JMS) API is used to send messages
7498 messages between two or more clients. It is a messaging standard that allows
7499 application components to create, send, receive, and read messages.")
7500 ; either gpl2 only with GPL Classpath Exception, or cddl.
7501 (license (list license:gpl2 license:cddl1.0))))
7502
7503 (define-public java-mail
7504 (package
7505 (name "java-mail")
7506 (version "1.6.0")
7507 (source (origin
7508 (method url-fetch)
7509 (uri (string-append "https://github.com/javaee/javamail/archive/"
7510 "JAVAMAIL-1_6_0.tar.gz"))
7511 (sha256
7512 (base32
7513 "1b4rg7fpj50ld90a71iz2m4gm3f5cnw18p3q3rbrrryjip46kx92"))))
7514 (build-system ant-build-system)
7515 (arguments
7516 `(#:jar-name "java-mail.jar"
7517 #:jdk ,icedtea-8
7518 #:source-dir "mail/src/main/java"
7519 #:test-dir "mail/src/test"
7520 #:test-exclude
7521 (list "**/CollectorFormatterTest.java"
7522 "**/CompactFormatterTest.java"
7523 "**/DurationFilterTest.java"
7524 "**/MailHandlerTest.java"
7525 "**/GetLocalAddressTest.java"
7526 ;; FIXME: both end with:
7527 ;; java.lang.ClassNotFoundException:
7528 ;; javax.mail.internet.MimeMultipartParseTest
7529 "**/MimeMultipartParseTest.java"
7530 "**/SearchTermSerializationTest.java")
7531 #:phases
7532 (modify-phases %standard-phases
7533 (add-before 'configure 'move-version.java
7534 (lambda _
7535 (copy-file "mail/src/main/resources/javax/mail/Version.java"
7536 "mail/src/main/java/javax/mail/Version.java")
7537 #t))
7538 (add-before 'build 'copy-resources
7539 (lambda _
7540 (copy-recursively "mail/src/main/resources/META-INF"
7541 "build/classes/META-INF")
7542 #t)))))
7543 (native-inputs
7544 `(("junit" ,java-junit)
7545 ("hamcrest" ,java-hamcrest-core)))
7546 (home-page "https://javaee.github.io/javamail/")
7547 (synopsis "Mail-related functionnalities in Java")
7548 (description "The JavaMail API provides a platform-independent and
7549 protocol-independent framework to build mail and messaging applications.")
7550 ;; General Public License Version 2 only ("GPL") or the Common Development
7551 ;; and Distribution License("CDDL")
7552 (license (list license:cddl1.1
7553 license:gpl2)))); with classpath exception
7554
7555 (define-public java-jeromq
7556 (package
7557 (name "java-jeromq")
7558 (version "0.4.2")
7559 (source (origin
7560 (method url-fetch)
7561 (uri (string-append "https://github.com/zeromq/jeromq/archive/v"
7562 version ".tar.gz"))
7563 (file-name (string-append name "-" version ".tar.gz"))
7564 (sha256
7565 (base32
7566 "17wx8dlyqmbw77xf6d6wxnhiyky6181zpf1a48jqzz9hidz0j841"))))
7567 (build-system ant-build-system)
7568 (arguments
7569 `(#:jar-name "java-jeromq.jar"
7570 #:source-dir "src/main/java"
7571 #:jdk ,icedtea-8
7572 #:test-exclude
7573 (list
7574 "**/Abstract*.java"
7575 ;; Requires network
7576 "**/ZBeaconTest.java"
7577 ;; Failures
7578 "**/CustomDecoderTest.java"
7579 "**/CustomEncoderTest.java")))
7580 (inputs
7581 `(("java-jnacl" ,java-jnacl)))
7582 (native-inputs
7583 `(("java-hamcrest-core" ,java-hamcrest-core)
7584 ("junit" ,java-junit)))
7585 (home-page "http://zeromq.org/bindings:java")
7586 (synopsis "Java binding for 0MQ")
7587 (description "Jeromq provides the java bindings for 0MQ.")
7588 (license license:mpl2.0)))
7589
7590 (define-public java-kafka-clients
7591 (package
7592 (name "java-kafka-clients")
7593 (version "1.0.0")
7594 (source (origin
7595 (method url-fetch)
7596 (uri (string-append "mirror://apache/kafka/" version "/kafka-"
7597 version "-src.tgz"))
7598 (sha256
7599 (base32
7600 "1yxmnsmliwm7671q5yy9bl4jdqyyn00n26cggz9brwczx80w1vfq"))))
7601 (build-system ant-build-system)
7602 (arguments
7603 `(#:jar-name "java-kafka-clients.jar"
7604 #:jdk ,icedtea-8
7605 #:source-dir "clients/src/main/java"
7606 #:test-dir "clients/src/test"
7607 #:test-exclude
7608 (list
7609 ;; This file does not contain a class
7610 "**/IntegrationTest.java"
7611 ;; Requires network
7612 "**/ClientUtilsTest.java"
7613 ;; End with errors that seem related to our powermock
7614 "**/KafkaProducerTest.java"
7615 "**/BufferPoolTest.java")))
7616 (inputs
7617 `(("java-slf4j-api" ,java-slf4j-api)
7618 ("java-lz4" ,java-lz4)))
7619 (native-inputs
7620 `(("junit" ,java-junit)
7621 ("hamcrest" ,java-hamcrest-all)
7622 ("objenesis" ,java-objenesis)
7623 ("asm" ,java-asm)
7624 ("cglib" ,java-cglib)
7625 ("javassist" ,java-jboss-javassist)
7626 ("snappy" ,java-snappy)
7627 ("easymock" ,java-easymock)
7628 ("powermock" ,java-powermock-core)
7629 ("powermock-easymock" ,java-powermock-api-easymock)
7630 ("powermock-junit4-common" ,java-powermock-modules-junit4-common)
7631 ("powermock-junit4" ,java-powermock-modules-junit4)
7632 ("powermock-support" ,java-powermock-api-support)
7633 ("bouncycastle" ,java-bouncycastle-bcprov)
7634 ("bouncycastle-bcpkix" ,java-bouncycastle-bcpkix)))
7635 (home-page "https://kafka.apache.org")
7636 (synopsis "Distributed streaming platform")
7637 (description "Kafka is a distributed streaming platform, which means:
7638 @itemize
7639 @item it can publish and subscribe to streams of records;
7640 @item it can store streams of records in a fault-tolerant way;
7641 @item it can process streams of records as they occur.
7642 @end itemize")
7643 ;; Either cddl or gpl2 only.
7644 (license (list license:cddl1.1; actually cddl1.1
7645 license:gpl2)))); with classpath exception
7646
7647 (define-public java-jdom
7648 (package
7649 (name "java-jdom")
7650 (version "1.1.3")
7651 (source (origin
7652 (method url-fetch)
7653 (uri (string-append "http://jdom.org/dist/binary/archive/jdom-"
7654 version ".tar.gz"))
7655 (sha256
7656 (base32
7657 "07wdpm3jwwc9q38kmdw40fvbmv6jzjrkrf8m0zqs58f79a672wfl"))))
7658 (build-system ant-build-system)
7659 (arguments
7660 `(#:build-target "package"
7661 #:tests? #f; tests are run as part of the build process
7662 #:phases
7663 (modify-phases %standard-phases
7664 (replace 'install
7665 (install-jars "build")))))
7666 (home-page "http://jdom.org/")
7667 (synopsis "Access, manipulate, and output XML data")
7668 (description "Java-based solution for accessing, manipulating, and
7669 outputting XML data from Java code.")
7670 (license license:bsd-4)))
7671
7672 (define-public java-geronimo-xbean-reflect
7673 (package
7674 (name "java-geronimo-xbean-reflect")
7675 (version "4.5")
7676 (source (origin
7677 (method svn-fetch)
7678 (uri (svn-reference
7679 (url "https://svn.apache.org/repos/asf/geronimo/xbean/tags/xbean-4.5/")
7680 (revision 1807396)))
7681 (file-name (string-append name "-" version))
7682 (sha256
7683 (base32
7684 "18q3i6jgm6rkw8aysfgihgywrdc5nvijrwnslmi3ww497jvri6ja"))))
7685 (build-system ant-build-system)
7686 (arguments
7687 `(#:jar-name "geronimo-xbean-reflect.jar"
7688 #:source-dir "xbean-reflect/src/main/java"
7689 #:test-dir "xbean-reflect/src/test"
7690 #:jdk ,icedtea-8
7691 #:test-exclude
7692 (list "**/Abstract*.java" "**/AsmParameterNameLoaderTest.java"
7693 "**/ObjectRecipeTest.java" "**/ParameterNameLoaderTest.java"
7694 "**/RecipeHelperTest.java" "**/XbeanAsmParameterNameLoaderTest.java")
7695 #:phases
7696 (modify-phases %standard-phases
7697 (add-before 'build 'fix-source
7698 (lambda _
7699 (let ((dir "xbean-reflect/src/main/java/org/apache/xbean/recipe/"))
7700 ;; org.apache.xbean.asm6 is actually repackaged java-asm
7701 (substitute* (string-append dir "XbeanAsmParameterNameLoader.java")
7702 (("org.apache.xbean.asm5") "org.objectweb.asm"))
7703 #t))))))
7704 (inputs
7705 `(("asm" ,java-asm)
7706 ("log4j" ,java-log4j-api)
7707 ("log4j-1.2" ,java-log4j-1.2-api)
7708 ("log4j-core" ,java-log4j-core)
7709 ("logging" ,java-commons-logging-minimal)))
7710 (native-inputs
7711 `(("junit" ,java-junit)))
7712 (home-page "https://geronimo.apache.org/maven/xbean/3.6/xbean-reflect/")
7713 (synopsis "Dependency injection helper")
7714 (description "Xbean-reflect provides very flexible ways to create objects
7715 and graphs of objects for dependency injection frameworks")
7716 (license license:asl2.0)))