gnu: ruby-listen: Update to 3.1.5.
[jackhill/guix/guix.git] / gnu / packages / java.scm
CommitLineData
0760e3a1 1;;; GNU Guix --- Functional package management for GNU
0c729ef4 2;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
559239af 3;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
ea9e58ef
CZ
4;;; Copyright © 2016, 2017 Roel Janssen <roel@gnu.org>
5;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
9f68e74a 6;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
0760e3a1
RW
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23(define-module (gnu packages java)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages)
26 #:use-module (guix download)
62c9bfaa 27 #:use-module (guix hg-download)
72885a4c 28 #:use-module (guix git-download)
f6789047 29 #:use-module (guix utils)
068e476f 30 #:use-module (guix build-system ant)
0760e3a1 31 #:use-module (guix build-system gnu)
6a5829d9 32 #:use-module (guix build-system trivial)
0760e3a1
RW
33 #:use-module (gnu packages)
34 #:use-module (gnu packages attr)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages bash)
f21403e2 38 #:use-module (gnu packages certs)
0760e3a1
RW
39 #:use-module (gnu packages cpio)
40 #:use-module (gnu packages cups)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages fontutils)
43 #:use-module (gnu packages gawk)
72885a4c 44 #:use-module (gnu packages gettext)
0760e3a1 45 #:use-module (gnu packages gcc)
8581c813 46 #:use-module (gnu packages gl)
0760e3a1
RW
47 #:use-module (gnu packages gnuzilla) ;nss
48 #:use-module (gnu packages ghostscript) ;lcms
49 #:use-module (gnu packages gnome)
50 #:use-module (gnu packages gtk)
6a5829d9 51 #:use-module (gnu packages guile)
afb5858d 52 #:use-module (gnu packages icu4c)
0760e3a1 53 #:use-module (gnu packages image)
c4fd86f9 54 #:use-module (gnu packages libffi)
0760e3a1
RW
55 #:use-module (gnu packages linux) ;alsa
56 #:use-module (gnu packages wget)
0760e3a1
RW
57 #:use-module (gnu packages pkg-config)
58 #:use-module (gnu packages perl)
c4fd86f9 59 #:use-module (gnu packages popt)
89e34644 60 #:use-module (gnu packages kerberos)
0760e3a1
RW
61 #:use-module (gnu packages xml)
62 #:use-module (gnu packages xorg)
f6789047 63 #:use-module (gnu packages texinfo)
2d15f601
RW
64 #:use-module ((srfi srfi-1) #:select (fold alist-delete))
65 #:use-module (srfi srfi-11)
66 #:use-module (ice-9 match))
0760e3a1 67
e1ae3587
RW
68\f
69;;;
70;;; Java bootstrap toolchain.
71;;;
72
73;; The Java bootstrap begins with Jikes, a Java compiler written in C++. We
74;; use it to build the SableVM standard library and virtual machine, which are
75;; written in a simpler dialect of Java and C, respectively. This is
76;; sufficient to build an older version of Ant, which is needed to build an
77;; older version of ECJ, an incremental Java compiler, both of which are
78;; written in Java.
79;;
80;; ECJ is needed to build the latest release of GNU Classpath (0.99).
81;; Classpath (> 0.98) is a requirement for JamVM, a more modern implementation
82;; of the Java virtual machine.
83;;
84;; With JamVM we can build the latest development version of GNU Classpath,
85;; which has much more support for Java 1.6 than the latest release. Since
86;; the previous build of JamVM is limited by the use of GNU Classpath 0.99 we
87;; rebuild it with the latest development version of GNU Classpath.
88;;
89;; Finally, we use the bootstrap toolchain to build the OpenJDK with the
90;; Icedtea 1.x build framework. We then build the more recent JDKs Icedtea
91;; 2.x and Icedtea 3.x.
92
93(define jikes
94 (package
95 (name "jikes")
96 (version "1.22")
97 (source (origin
98 (method url-fetch)
99 (uri (string-append "mirror://sourceforge/jikes/Jikes/"
100 version "/jikes-" version ".tar.bz2"))
101 (sha256
102 (base32
103 "1qqldrp74pzpy5ly421srqn30qppmm9cvjiqdngk8hf47dv2rc0c"))))
104 (build-system gnu-build-system)
105 (home-page "http://jikes.sourceforge.net/")
106 (synopsis "Compiler for the Java language")
107 (description "Jikes is a compiler that translates Java source files as
108defined in The Java Language Specification into the bytecoded instruction set
109and binary format defined in The Java Virtual Machine Specification.")
110 (license license:ibmpl1.0)))
111
2551fee8
RW
112(define sablevm-classpath
113 (package
114 (name "sablevm-classpath")
115 (version "1.13")
116 (source (origin
117 (method url-fetch)
118 (uri (string-append "mirror://sourceforge/sablevm/sablevm/"
119 version "/sablevm-classpath-" version ".tar.gz"))
120 (sha256
121 (base32
122 "1qyhyfz8idghxdam16hdgpa24r2x4xbg9z8c8asa3chnd79h3zw2"))))
123 (build-system gnu-build-system)
124 (arguments
125 `(#:configure-flags
126 (list "--with-jikes"
127 "--disable-Werror"
128 "--disable-gmp"
129 "--disable-gtk-peer"
130 "--disable-plugin"
131 "--disable-dssi"
132 "--disable-alsa"
133 "--disable-gjdoc")))
134 (inputs
135 `(("gconf" ,gconf)
136 ("gtk+" ,gtk+-2)))
137 (native-inputs
138 `(("jikes" ,jikes)
139 ("fastjar" ,fastjar)
140 ("pkg-config" ,pkg-config)))
141 (home-page "http://sablevm.org/")
142 (synopsis "Java Virtual Machine")
143 (description "SableVM is a clean-room, highly portable and efficient Java
144virtual machine. Its goals are to be reasonably small, fast, and compliant
145with the various specifications (JVM specification, JNI, invocation interface,
146etc.). SableVM is no longer maintained.
147
148This package provides the classpath library.")
149 (license license:lgpl2.1+)))
57f6c50d
RW
150
151(define sablevm
152 (package
153 (name "sablevm")
154 (version "1.13")
155 (source (origin
156 (method url-fetch)
157 (uri (string-append "mirror://sourceforge/sablevm/sablevm/"
158 version "/sablevm-" version ".tar.gz"))
159 (sha256
160 (base32
161 "1jyg4bsym6igz94wps5443c7wiwlzinqzkchcw972nz4kf1cql6g"))))
162 (build-system gnu-build-system)
163 (arguments
c4fd86f9
RW
164 `(#:configure-flags
165 (list "--with-internal-libffi=no"
166 "--with-internal-libpopt=no")
167 #:phases
57f6c50d 168 (modify-phases %standard-phases
ec7e9eea
RW
169 (add-after 'unpack 'remove-timestamp-for-reproducibility
170 (lambda _
171 (substitute* "src/sablevm/Makefile.in"
172 (("\\$\\(SVMCOMPILETIME\\)") "(unknown)"))
173 #t))
c4fd86f9
RW
174 (add-after 'unpack 'link-with-popt
175 (lambda _
176 (substitute* "src/sablevm/Makefile.in"
177 (("\\$\\(SVMADD\\)" match)
178 (string-append match " -lpopt")))
179 #t))
57f6c50d
RW
180 (add-after 'unpack 'patch-path-to-classpath
181 (lambda* (#:key inputs #:allow-other-keys)
182 (substitute* "Makefile.in"
183 (("@datadir@/sablevm-classpath")
184 (string-append (assoc-ref inputs "classpath")
185 "/share/sablevm-classpath")))
186 (substitute* "src/libsablevm/Makefile.in"
187 (("\\$\\(libdir\\)/sablevm-classpath")
188 (string-append (assoc-ref inputs "classpath")
189 "/lib/sablevm-classpath"))
190 (("\\$\\(datadir\\)/sablevm-classpath")
191 (string-append (assoc-ref inputs "classpath")
192 "/share/sablevm-classpath")))
193 #t)))))
194 (inputs
195 `(("classpath" ,sablevm-classpath)
196 ("jikes" ,jikes)
c4fd86f9
RW
197 ("zlib" ,zlib)
198 ("popt" ,popt)
199 ("libffi" ,libffi)))
57f6c50d
RW
200 (native-inputs
201 `(("libltdl" ,libltdl)))
202 (home-page "http://sablevm.org/")
203 (synopsis "Java Virtual Machine")
204 (description "SableVM is a clean-room, highly portable and efficient Java
205virtual machine. Its goals are to be reasonably small, fast, and compliant
206with the various specifications (JVM specification, JNI, invocation interface,
207etc.). SableVM is no longer maintained.
208
209This package provides the virtual machine.")
210 (license license:lgpl2.1+)))
2551fee8 211
5783bd77
RW
212(define ant-bootstrap
213 (package
214 (name "ant-bootstrap")
215 ;; The 1.10.x series requires Java 8. 1.9.0 and later use generics, which
216 ;; are not supported. The 1.8.x series is the last to use only features
217 ;; supported by Jikes, but it cannot seem to be built with sablevm.
218 (version "1.7.1")
219 (source (origin
220 (method url-fetch)
221 (uri (string-append "http://archive.apache.org/dist/"
222 "ant/source/apache-ant-"
223 version "-src.tar.bz2"))
224 (sha256
225 (base32
226 "19pvqvgkxgpgsqm4lvbki5sm0z84kxmykdqicvfad47gc1r9mi2d"))))
227 (build-system gnu-build-system)
228 (arguments
229 `(#:tests? #f ; no "check" target
230 #:phases
231 (modify-phases %standard-phases
232 (delete 'configure)
233 (replace 'build
234 (lambda* (#:key inputs #:allow-other-keys)
235 (setenv "JAVA_HOME"
236 (string-append (assoc-ref inputs "sablevm")
237 "/lib/sablevm"))
238 (setenv "JAVACMD"
239 (string-append (assoc-ref inputs "sablevm")
240 "/bin/java-sablevm"))
241 (setenv "JAVAC"
242 (string-append (assoc-ref inputs "sablevm")
243 "/bin/javac-sablevm"))
244
245 ;; Use jikes instead of javac for <javac ...> tags in build.xml
246 (setenv "ANT_OPTS" "-Dbuild.compiler=jikes")
247
248 ;; jikes produces lots of warnings, but they are not very
249 ;; interesting, so we silence them.
250 (setenv "$BOOTJAVAC_OPTS" "-nowarn")
251
252 ;; Disable tests because we are bootstrapping and thus don't have
253 ;; any of the dependencies required to build and run the tests.
254 (substitute* "build.xml"
255 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
256 (zero? (system* "bash" "bootstrap.sh"
257 (string-append "-Ddist.dir="
258 (assoc-ref %outputs "out"))))))
259 (delete 'install))))
260 (native-inputs
261 `(("jikes" ,jikes)
262 ("sablevm" ,sablevm)))
263 (home-page "http://ant.apache.org")
264 (synopsis "Build tool for Java")
265 (description
266 "Ant is a platform-independent build tool for Java. It is similar to
267make but is implemented using the Java language, requires the Java platform,
268and is best suited to building Java projects. Ant uses XML to describe the
269build process and its dependencies, whereas Make uses Makefile format.")
270 (license license:asl2.0)))
271
5461721f
RW
272;; Version 3.2.2 is the last version without a dependency on a full-fledged
273;; compiler for Java 1.5.
274(define ecj-bootstrap
275 (package
276 (name "ecj-bootstrap")
277 (version "3.2.2")
278 (source (origin
279 (method url-fetch)
280 (uri (string-append "http://archive.eclipse.org/eclipse/"
281 "downloads/drops/R-" version
282 "-200702121330/ecjsrc.zip"))
283 (sha256
284 (base32
285 "05hj82kxd23qaglsjkaqcj944riisjha7acf7h3ljhrjyljx8307"))))
286 ;; It would be so much easier if we could use the ant-build-system, but we
287 ;; cannot as we don't have ant at this point. We use ecj for
288 ;; bootstrapping the JDK.
289 (build-system gnu-build-system)
290 (arguments
291 `(#:modules ((guix build gnu-build-system)
292 (guix build utils)
293 (srfi srfi-1))
294 #:tests? #f ; there are no tests
295 #:phases
296 (modify-phases %standard-phases
297 (replace 'configure
298 (lambda* (#:key inputs #:allow-other-keys)
299 (setenv "CLASSPATH"
300 (string-join
301 (find-files (string-append (assoc-ref inputs "ant-bootstrap")
302 "/lib")
303 "\\.jar$")
304 ":"))
305 #t))
306 (replace 'build
307 (lambda* (#:key inputs #:allow-other-keys)
308 ;; The unpack phase enters the "org" directory by mistake.
309 (chdir "..")
310
311 ;; Create a simple manifest to make ecj executable.
312 (with-output-to-file "manifest"
313 (lambda _
314 (display "Manifest-Version: 1.0
315Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n")))
316
317 ;; Compile it all!
318 (and (zero? (apply system* "javac-sablevm"
319 (find-files "." "\\.java$")))
320 (zero? (system* "fastjar" "cvfm"
321 "ecj-bootstrap.jar" "manifest" ".")))))
322 (replace 'install
323 (lambda* (#:key outputs #:allow-other-keys)
324 (let ((share (string-append (assoc-ref outputs "out")
325 "/share/java/")))
326 (mkdir-p share)
327 (install-file "ecj-bootstrap.jar" share)
328 #t))))))
329 (native-inputs
330 `(("ant-bootstrap" ,ant-bootstrap)
331 ("unzip" ,unzip)
332 ("sablevm" ,sablevm)
333 ("fastjar" ,fastjar)))
334 (home-page "https://eclipse.org")
335 (synopsis "Eclipse Java development tools core batch compiler")
336 (description "This package provides the Eclipse Java core batch compiler
337for bootstrapping purposes. The @dfn{Eclipse compiler for Java} (ecj) is a
338requirement for all GNU Classpath releases after version 0.93.")
339 (license license:epl1.0)))
340
6a5829d9
RW
341(define ecj-javac-wrapper
342 (package (inherit ecj-bootstrap)
343 (name "ecj-javac-wrapper")
344 (source #f)
345 (build-system trivial-build-system)
346 (arguments
347 `(#:modules ((guix build utils))
348 #:builder
349 (let ((backend 'sablevm))
350 (use-modules (guix build utils))
351 (let* ((bin (string-append (assoc-ref %outputs "out") "/bin"))
352 (target (string-append bin "/javac"))
353 (guile (string-append (assoc-ref %build-inputs "guile")
354 "/bin/guile"))
355 (ecj (string-append (assoc-ref %build-inputs "ecj-bootstrap")
356 "/share/java/ecj-bootstrap.jar"))
357 (java (case backend
358 ((sablevm)
359 (string-append (assoc-ref %build-inputs "sablevm")
360 "/lib/sablevm/bin/java"))
361 ((jamvm)
362 (string-append (assoc-ref %build-inputs "jamvm")
363 "/bin/jamvm"))))
364 (bootcp (case backend
365 ((sablevm)
366 (let ((jvmlib (string-append
367 (assoc-ref %build-inputs "sablevm-classpath")
368 "/lib/sablevm")))
369 (string-append jvmlib "/jre/lib/rt.jar")))
370 ((jamvm)
371 (let ((jvmlib (string-append (assoc-ref %build-inputs "classpath")
372 "/share/classpath")))
373 (string-append jvmlib "/lib/glibj.zip:"
374 jvmlib "/lib/tools.zip"))))))
375 (mkdir-p bin)
376 (with-output-to-file target
377 (lambda _
378 (format #t "#!~a --no-auto-compile\n!#\n" guile)
379 (write
380 `(begin (use-modules (ice-9 match)
381 (ice-9 receive)
382 (ice-9 hash-table)
383 (srfi srfi-1)
384 (srfi srfi-26))
385 (define defaults
386 '(("-bootclasspath" ,bootcp)
387 ("-source" "1.5")
388 ("-target" "1.5")
389 ("-cp" ".")))
390 (define (main args)
391 (let ((classpath (getenv "CLASSPATH")))
392 (setenv "CLASSPATH"
393 (string-append ,ecj
394 (if classpath
395 (string-append ":" classpath)
396 ""))))
397 (receive (vm-args other-args)
398 ;; Separate VM arguments from arguments to ECJ.
399 (partition (cut string-prefix? "-J" <>)
400 (fold (lambda (default acc)
401 (if (member (first default) acc)
402 acc (append default acc)))
403 args defaults))
404 (apply system* ,java
405 (append
406 ;; Remove "-J" prefix
407 (map (cut string-drop <> 2) vm-args)
408 '("org.eclipse.jdt.internal.compiler.batch.Main")
409 (cons "-nowarn" other-args)))))
410 ;; Entry point
411 (let ((args (cdr (command-line))))
412 (if (null? args)
413 (format (current-error-port) "javac: no arguments given!\n")
414 (main args)))))))
415 (chmod target #o755)
416 #t))))
417 (native-inputs
418 `(("guile" ,guile-2.2)
419 ("ecj-bootstrap" ,ecj-bootstrap)
420 ("sablevm" ,sablevm)
421 ("sablevm-classpath" ,sablevm-classpath)))
422 (description "This package provides a wrapper around the @dfn{Eclipse
423compiler for Java} (ecj) with a command line interface that is compatible with
424the standard javac executable.")))
425
d3551e86
RW
426;; Note: All the tool wrappers (e.g. for javah, javac, etc) fail with
427;; java.lang.UnsupportedClassVersionError. They simply won't run on the old
428;; sablevm. We use Classpath 0.99 to build JamVM, on which the Classpath
429;; tools do run. Using these Classpath tools on JamVM we can then build the
430;; development version of GNU Classpath.
431(define classpath-on-sablevm
432 (package
433 (name "classpath")
434 (version "0.99")
435 (source (origin
436 (method url-fetch)
437 (uri (string-append "mirror://gnu/classpath/classpath-"
438 version ".tar.gz"))
439 (sha256
440 (base32
441 "1j7cby4k66f1nvckm48xcmh352b1d1b33qk7l6hi7dp9i9zjjagr"))))
442 (build-system gnu-build-system)
443 (arguments
444 `(#:configure-flags
445 (list (string-append "--with-ecj-jar="
446 (assoc-ref %build-inputs "ecj-bootstrap")
447 "/share/java/ecj-bootstrap.jar")
448 (string-append "JAVAC="
449 (assoc-ref %build-inputs "ecj-javac-wrapper")
450 "/bin/javac")
451 (string-append "JAVA="
452 (assoc-ref %build-inputs "sablevm")
453 "/bin/java-sablevm")
454 "GCJ_JAVAC_TRUE=no"
455 "ac_cv_prog_java_works=yes" ; trust me
456 "--disable-Werror"
457 "--disable-gmp"
458 "--disable-gtk-peer"
459 "--disable-gconf-peer"
460 "--disable-plugin"
461 "--disable-dssi"
462 "--disable-alsa"
463 "--disable-gjdoc")
464 #:phases
465 (modify-phases %standard-phases
466 (add-after 'install 'install-data
467 (lambda _ (zero? (system* "make" "install-data")))))))
468 (native-inputs
469 `(("ecj-bootstrap" ,ecj-bootstrap)
470 ("ecj-javac-wrapper" ,ecj-javac-wrapper)
471 ("fastjar" ,fastjar)
472 ("sablevm" ,sablevm)
473 ("sablevm-classpath" ,sablevm-classpath)
474 ("libltdl" ,libltdl)
475 ("pkg-config" ,pkg-config)))
476 (home-page "https://www.gnu.org/software/classpath/")
477 (synopsis "Essential libraries for Java")
478 (description "GNU Classpath is a project to create core class libraries
479for use with runtimes, compilers and tools for the Java programming
480language.")
481 ;; GPLv2 or later, with special linking exception.
482 (license license:gpl2+)))
5f4402c7
RW
483
484(define jamvm-bootstrap
485 (package
486 (name "jamvm")
487 (version "2.0.0")
488 (source (origin
489 (method url-fetch)
490 (uri (string-append "mirror://sourceforge/jamvm/jamvm/"
491 "JamVM%20" version "/jamvm-"
492 version ".tar.gz"))
493 (sha256
494 (base32
495 "1nl0zxz8y5x8gwsrm7n32bry4dx8x70p8z3s9jbdvs8avyb8whkn"))))
496 (build-system gnu-build-system)
497 (arguments
498 `(#:configure-flags
499 (list (string-append "--with-classpath-install-dir="
500 (assoc-ref %build-inputs "classpath")))))
501 (inputs
502 `(("classpath" ,classpath-on-sablevm)
503 ("ecj-javac-wrapper" ,ecj-javac-wrapper)
504 ("zlib" ,zlib)))
505 (home-page "http://jamvm.sourceforge.net/")
506 (synopsis "Small Java Virtual Machine")
507 (description "JamVM is a Java Virtual Machine conforming to the JVM
508specification edition 2 (blue book). It is extremely small. However, unlike
509other small VMs it supports the full spec, including object finalisation and
510JNI.")
511 (license license:gpl2+)))
d3551e86 512
04d7cae2
RW
513;; We need this because the tools provided by the latest release of GNU
514;; Classpath don't actually work with sablevm.
515(define classpath-jamvm-wrappers
516 (package (inherit classpath-on-sablevm)
517 (name "classpath-jamvm-wrappers")
518 (source #f)
519 (build-system trivial-build-system)
520 (arguments
521 `(#:modules ((guix build utils))
522 #:builder
523 (begin
524 (use-modules (guix build utils))
525 (let* ((bash (assoc-ref %build-inputs "bash"))
526 (jamvm (assoc-ref %build-inputs "jamvm"))
527 (classpath (assoc-ref %build-inputs "classpath"))
528 (bin (string-append (assoc-ref %outputs "out")
529 "/bin/")))
530 (mkdir-p bin)
531 (for-each (lambda (tool)
532 (with-output-to-file (string-append bin tool)
533 (lambda _
534 (format #t "#!~a/bin/sh
535~a/bin/jamvm -classpath ~a/share/classpath/tools.zip \
536gnu.classpath.tools.~a.~a $@"
537 bash jamvm classpath tool
538 (if (string=? "native2ascii" tool)
539 "Native2ASCII" "Main"))))
540 (chmod (string-append bin tool) #o755))
541 (list "javah"
542 "rmic"
543 "rmid"
544 "orbd"
545 "rmiregistry"
546 "native2ascii"))
547 #t))))
548 (native-inputs
549 `(("bash" ,bash)
550 ("jamvm" ,jamvm-bootstrap)
551 ("classpath" ,classpath-on-sablevm)))
552 (inputs '())
553 (synopsis "Executables from GNU Classpath")
554 (description "This package provides wrappers around the tools provided by
555the GNU Classpath library. They are executed by the JamVM virtual
556machine.")))
557
7292d694
RW
558(define ecj-javac-on-jamvm-wrapper
559 (package (inherit ecj-javac-wrapper)
560 (name "ecj-javac-on-jamvm-wrapper")
561 (arguments
562 `(#:modules ((guix build utils))
563 #:builder
564 ;; TODO: This builder is exactly the same as in ecj-javac-wrapper,
565 ;; except that the backend is 'jamvm here. Can we reuse the same
566 ;; builder somehow?
567 (let ((backend 'jamvm))
568 (use-modules (guix build utils))
569 (let* ((bin (string-append (assoc-ref %outputs "out") "/bin"))
570 (target (string-append bin "/javac"))
571 (guile (string-append (assoc-ref %build-inputs "guile")
572 "/bin/guile"))
573 (ecj (string-append (assoc-ref %build-inputs "ecj-bootstrap")
574 "/share/java/ecj-bootstrap.jar"))
575 (java (case backend
576 ((sablevm)
577 (string-append (assoc-ref %build-inputs "sablevm")
578 "/lib/sablevm/bin/java"))
579 ((jamvm)
580 (string-append (assoc-ref %build-inputs "jamvm")
581 "/bin/jamvm"))))
582 (bootcp (case backend
583 ((sablevm)
584 (let ((jvmlib (string-append
585 (assoc-ref %build-inputs "sablevm-classpath")
586 "/lib/sablevm")))
587 (string-append jvmlib "/jre/lib/rt.jar")))
588 ((jamvm)
589 (let ((jvmlib (string-append (assoc-ref %build-inputs "classpath")
590 "/share/classpath")))
591 (string-append jvmlib "/lib/glibj.zip:"
592 jvmlib "/lib/tools.zip"))))))
593 (mkdir-p bin)
594 (with-output-to-file target
595 (lambda _
596 (format #t "#!~a --no-auto-compile\n!#\n" guile)
597 (write
598 `(begin (use-modules (ice-9 match)
599 (ice-9 receive)
600 (ice-9 hash-table)
601 (srfi srfi-1)
602 (srfi srfi-26))
603 (define defaults
604 '(("-bootclasspath" ,bootcp)
605 ("-source" "1.5")
606 ("-target" "1.5")
607 ("-cp" ".")))
608 (define (main args)
609 (let ((classpath (getenv "CLASSPATH")))
610 (setenv "CLASSPATH"
611 (string-append ,ecj
612 (if classpath
613 (string-append ":" classpath)
614 ""))))
615 (receive (vm-args other-args)
616 ;; Separate VM arguments from arguments to ECJ.
617 (partition (cut string-prefix? "-J" <>)
618 (fold (lambda (default acc)
619 (if (member (first default) acc)
620 acc (append default acc)))
621 args defaults))
622 (apply system* ,java
623 (append
624 ;; Remove "-J" prefix
625 (map (cut string-drop <> 2) vm-args)
626 '("org.eclipse.jdt.internal.compiler.batch.Main")
627 (cons "-nowarn" other-args)))))
628 ;; Entry point
629 (let ((args (cdr (command-line))))
630 (if (null? args)
631 (format (current-error-port) "javac: no arguments given!\n")
632 (main args)))))))
633 (chmod target #o755)
634 #t))))
635 (native-inputs
636 `(("guile" ,guile-2.2)
637 ("ecj-bootstrap" ,ecj-bootstrap)
638 ("jamvm" ,jamvm-bootstrap)
639 ("classpath" ,classpath-on-sablevm)))
640 (description "This package provides a wrapper around the @dfn{Eclipse
641compiler for Java} (ecj) with a command line interface that is compatible with
642the standard javac executable. The tool runs on JamVM instead of SableVM.")))
643
72885a4c
RW
644;; The last release of GNU Classpath is 0.99 and it happened in 2012. Since
645;; then Classpath has gained much more support for Java 1.6.
646(define-public classpath-devel
647 (let ((commit "e7c13ee0cf2005206fbec0eca677f8cf66d5a103")
648 (revision "1"))
649 (package (inherit classpath-on-sablevm)
650 (version (string-append "0.99-" revision "." (string-take commit 9)))
651 (source (origin
652 (method git-fetch)
653 (uri (git-reference
654 (url "git://git.savannah.gnu.org/classpath.git")
655 (commit commit)))
656 (sha256
657 (base32
658 "1v2rww76ww322mpg3s12a1kkc6gkp31bm9gcxs532h0wq285fiw4"))))
659 (arguments
93c103ab
RW
660 `(#:make-flags
661 ;; Ensure that the initial heap size is smaller than the maximum
662 ;; size. By default only Xmx is set, which can lead to invalid
663 ;; memory settings on some machines with a lot of memory.
664 '("JAVAC_MEM_OPT=-J-Xms512M -J-Xmx768M")
665 #:configure-flags
72885a4c
RW
666 (list (string-append "--with-ecj-jar="
667 (assoc-ref %build-inputs "ecj-bootstrap")
668 "/share/java/ecj-bootstrap.jar")
93c103ab 669 (string-append "--with-javac="
72885a4c
RW
670 (assoc-ref %build-inputs "ecj-javac-wrapper")
671 "/bin/javac")
672 (string-append "JAVA="
673 (assoc-ref %build-inputs "jamvm")
674 "/bin/jamvm")
675 "GCJ_JAVAC_TRUE=no"
676 "ac_cv_prog_java_works=yes" ; trust me
677 "--disable-Werror"
678 "--disable-gmp"
679 "--disable-gtk-peer"
680 "--disable-gconf-peer"
681 "--disable-plugin"
682 "--disable-dssi"
683 "--disable-alsa"
684 "--disable-gjdoc")
685 #:phases
686 (modify-phases %standard-phases
687 (add-before 'configure 'bootstrap
688 (lambda _
689 (zero? (system* "autoreconf" "-vif"))))
690 (add-after 'unpack 'remove-unsupported-annotations
691 (lambda _
692 (substitute* (find-files "java" "\\.java$")
693 (("@Override") ""))
694 #t))
695 (add-after 'install 'install-data
696 (lambda _ (zero? (system* "make" "install-data")))))))
697 (native-inputs
698 `(("autoconf" ,autoconf)
699 ("automake" ,automake)
700 ("libtool" ,libtool)
701 ("gettext" ,gettext-minimal)
702 ("texinfo" ,texinfo)
703 ("classpath-jamvm-wrappers" ,classpath-jamvm-wrappers) ; for javah
704 ("ecj-bootstrap" ,ecj-bootstrap)
705 ("ecj-javac-wrapper" ,ecj-javac-on-jamvm-wrapper)
706 ("fastjar" ,fastjar)
707 ("jamvm" ,jamvm-bootstrap)
708 ("libltdl" ,libltdl)
709 ("pkg-config" ,pkg-config))))))
710
8c6091e3
RW
711(define-public jamvm
712 (package (inherit jamvm-bootstrap)
713 (inputs
714 `(("classpath" ,classpath-devel)
715 ("ecj-javac-wrapper" ,ecj-javac-on-jamvm-wrapper)
716 ("zlib" ,zlib)))))
717
1bf56c72
RW
718(define ecj-javac-on-jamvm-wrapper-final
719 (package (inherit ecj-javac-on-jamvm-wrapper)
720 (native-inputs
721 `(("guile" ,guile-2.2)
722 ("ecj-bootstrap" ,ecj-bootstrap)
723 ("jamvm" ,jamvm)
724 ("classpath" ,classpath-devel)))))
725
98419316
RW
726;; The bootstrap JDK consisting of jamvm, classpath-devel,
727;; ecj-javac-on-jamvm-wrapper-final cannot build Icedtea 2.x directly, because
728;; it's written in Java 7. It can, however, build the unmaintained Icedtea
729;; 1.x, which uses Java 6 only.
730(define-public icedtea-6
731 (package
732 (name "icedtea")
733 (version "1.13.13")
734 (source (origin
735 (method url-fetch)
736 (uri (string-append
737 "http://icedtea.wildebeest.org/download/source/icedtea6-"
738 version ".tar.xz"))
739 (sha256
740 (base32
741 "0bg9sb4f7qbq77c0zf9m17p47ga0kf0r9622g9p12ysg26jd1ksg"))
742 (modules '((guix build utils)))
743 (snippet
744 '(substitute* "Makefile.in"
745 ;; do not leak information about the build host
746 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
747 "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
748 (build-system gnu-build-system)
749 (outputs '("out" ; Java Runtime Environment
750 "jdk" ; Java Development Kit
751 "doc")) ; all documentation
752 (arguments
753 `(;; There are many failing tests and many are known to fail upstream.
754 #:tests? #f
755
756 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
757 ;; gremlin) doesn't support it yet, so skip this phase.
758 #:validate-runpath? #f
759
760 #:modules ((guix build utils)
761 (guix build gnu-build-system)
762 (srfi srfi-19))
763
764 #:configure-flags
765 `("--enable-bootstrap"
766 "--enable-nss"
767 "--without-rhino"
768 "--with-parallel-jobs"
769 "--disable-downloading"
770 "--disable-tests"
771 ,(string-append "--with-ecj="
772 (assoc-ref %build-inputs "ecj")
773 "/share/java/ecj-bootstrap.jar")
774 ,(string-append "--with-jar="
775 (assoc-ref %build-inputs "fastjar")
776 "/bin/fastjar")
777 ,(string-append "--with-jdk-home="
778 (assoc-ref %build-inputs "classpath"))
779 ,(string-append "--with-java="
780 (assoc-ref %build-inputs "jamvm")
781 "/bin/jamvm"))
782 #:phases
783 (modify-phases %standard-phases
784 (replace 'unpack
785 (lambda* (#:key source inputs #:allow-other-keys)
786 (and (zero? (system* "tar" "xvf" source))
787 (begin
788 (chdir (string-append "icedtea6-" ,version))
789 (mkdir "openjdk")
790 (copy-recursively (assoc-ref inputs "openjdk-src") "openjdk")
791 ;; The convenient OpenJDK source bundle is no longer
792 ;; available for download, so we have to take the sources
793 ;; from the Mercurial repositories and change the Makefile
794 ;; to avoid tests for the OpenJDK zip archive.
795 (with-directory-excursion "openjdk"
796 (for-each (lambda (part)
797 (mkdir part)
798 (copy-recursively
799 (assoc-ref inputs
800 (string-append part "-src"))
801 part))
802 '("jdk" "hotspot" "corba"
803 "langtools" "jaxp" "jaxws")))
804 (substitute* "Makefile.in"
805 (("echo \"ERROR: No up-to-date OpenJDK zip available\"; exit -1;")
806 "echo \"trust me\";")
807 ;; The contents of the bootstrap directory must be
808 ;; writeable but when copying from the store they are
809 ;; not.
810 (("mkdir -p lib/rt" line)
811 (string-append line "; chmod -R u+w $(BOOT_DIR)")))
812 (zero? (system* "chmod" "-R" "u+w" "openjdk"))
813 #t))))
814 (add-after 'unpack 'use-classpath
815 (lambda* (#:key inputs #:allow-other-keys)
816 (let ((jvmlib (assoc-ref inputs "classpath")))
817 ;; Classpath does not provide rt.jar.
818 (substitute* "Makefile.in"
819 (("\\$\\(SYSTEM_JDK_DIR\\)/jre/lib/rt.jar")
820 (string-append jvmlib "/share/classpath/glibj.zip")))
821 ;; Make sure we can find all classes.
822 (setenv "CLASSPATH"
823 (string-append jvmlib "/share/classpath/glibj.zip:"
824 jvmlib "/share/classpath/tools.zip"))
825 (setenv "JAVACFLAGS"
826 (string-append "-cp "
827 jvmlib "/share/classpath/glibj.zip:"
828 jvmlib "/share/classpath/tools.zip")))
829 #t))
830 (add-after 'unpack 'patch-patches
831 (lambda _
832 ;; shebang in patches so that they apply cleanly
833 (substitute* '("patches/jtreg-jrunscript.patch"
834 "patches/hotspot/hs23/drop_unlicensed_test.patch")
835 (("#!/bin/sh") (string-append "#!" (which "sh"))))
836 #t))
837 (add-after 'unpack 'patch-paths
838 (lambda* (#:key inputs #:allow-other-keys)
839 ;; buildtree.make generates shell scripts, so we need to replace
840 ;; the generated shebang
841 (substitute* '("openjdk/hotspot/make/linux/makefiles/buildtree.make")
842 (("/bin/sh") (which "bash")))
843
844 (let ((corebin (string-append
845 (assoc-ref inputs "coreutils") "/bin/"))
846 (binbin (string-append
847 (assoc-ref inputs "binutils") "/bin/"))
848 (grepbin (string-append
849 (assoc-ref inputs "grep") "/bin/")))
850 (substitute* '("openjdk/jdk/make/common/shared/Defs-linux.gmk"
851 "openjdk/corba/make/common/shared/Defs-linux.gmk")
852 (("UNIXCOMMAND_PATH = /bin/")
853 (string-append "UNIXCOMMAND_PATH = " corebin))
854 (("USRBIN_PATH = /usr/bin/")
855 (string-append "USRBIN_PATH = " corebin))
856 (("DEVTOOLS_PATH *= */usr/bin/")
857 (string-append "DEVTOOLS_PATH = " corebin))
858 (("COMPILER_PATH *= */usr/bin/")
859 (string-append "COMPILER_PATH = "
860 (assoc-ref inputs "gcc") "/bin/"))
861 (("DEF_OBJCOPY *=.*objcopy")
862 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
863
864 ;; fix path to alsa header
865 (substitute* "openjdk/jdk/make/common/shared/Sanity.gmk"
866 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
867 (string-append "ALSA_INCLUDE="
868 (assoc-ref inputs "alsa-lib")
869 "/include/alsa/version.h")))
870
871 ;; fix hard-coded utility paths
872 (substitute* '("openjdk/jdk/make/common/shared/Defs-utils.gmk"
873 "openjdk/corba/make/common/shared/Defs-utils.gmk")
874 (("ECHO *=.*echo")
875 (string-append "ECHO = " (which "echo")))
876 (("^GREP *=.*grep")
877 (string-append "GREP = " (which "grep")))
878 (("EGREP *=.*egrep")
879 (string-append "EGREP = " (which "egrep")))
880 (("CPIO *=.*cpio")
881 (string-append "CPIO = " (which "cpio")))
882 (("READELF *=.*readelf")
883 (string-append "READELF = " (which "readelf")))
884 (("^ *AR *=.*ar")
885 (string-append "AR = " (which "ar")))
886 (("^ *TAR *=.*tar")
887 (string-append "TAR = " (which "tar")))
888 (("AS *=.*as")
889 (string-append "AS = " (which "as")))
890 (("LD *=.*ld")
891 (string-append "LD = " (which "ld")))
892 (("STRIP *=.*strip")
893 (string-append "STRIP = " (which "strip")))
894 (("NM *=.*nm")
895 (string-append "NM = " (which "nm")))
896 (("^SH *=.*sh")
897 (string-append "SH = " (which "bash")))
898 (("^FIND *=.*find")
899 (string-append "FIND = " (which "find")))
900 (("LDD *=.*ldd")
901 (string-append "LDD = " (which "ldd")))
902 (("NAWK *=.*(n|g)awk")
903 (string-append "NAWK = " (which "gawk")))
904 (("XARGS *=.*xargs")
905 (string-append "XARGS = " (which "xargs")))
906 (("UNZIP *=.*unzip")
907 (string-append "UNZIP = " (which "unzip")))
908 (("ZIPEXE *=.*zip")
909 (string-append "ZIPEXE = " (which "zip")))
910 (("SED *=.*sed")
911 (string-append "SED = " (which "sed"))))
912
913 ;; Some of these timestamps cause problems as they are more than
914 ;; 10 years ago, failing the build process.
915 (substitute*
916 "openjdk/jdk/src/share/classes/java/util/CurrencyData.properties"
917 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
918 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
919 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
920 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY"))
921 #t)))
922 (add-before 'configure 'set-additional-paths
923 (lambda* (#:key inputs #:allow-other-keys)
924 (setenv "CPATH"
925 (string-append (assoc-ref inputs "libxrender")
926 "/include/X11/extensions" ":"
927 (assoc-ref inputs "libxtst")
928 "/include/X11/extensions" ":"
929 (assoc-ref inputs "libxinerama")
930 "/include/X11/extensions" ":"
931 (or (getenv "CPATH") "")))
932 (setenv "ALT_CUPS_HEADERS_PATH"
933 (string-append (assoc-ref inputs "cups")
934 "/include"))
935 (setenv "ALT_FREETYPE_HEADERS_PATH"
936 (string-append (assoc-ref inputs "freetype")
937 "/include"))
938 (setenv "ALT_FREETYPE_LIB_PATH"
939 (string-append (assoc-ref inputs "freetype")
940 "/lib"))
941 #t))
942 (replace 'install
943 (lambda* (#:key outputs #:allow-other-keys)
944 (let ((doc (string-append (assoc-ref outputs "doc")
945 "/share/doc/icedtea"))
946 (jre (assoc-ref outputs "out"))
947 (jdk (assoc-ref outputs "jdk")))
948 (copy-recursively "openjdk.build/docs" doc)
949 (copy-recursively "openjdk.build/j2re-image" jre)
950 (copy-recursively "openjdk.build/j2sdk-image" jdk))
951 #t)))))
952 (native-inputs
953 `(("ant" ,ant-bootstrap)
954 ("alsa-lib" ,alsa-lib)
955 ("attr" ,attr)
956 ("classpath" ,classpath-devel)
957 ("coreutils" ,coreutils)
958 ("cpio" ,cpio)
959 ("cups" ,cups)
960 ("ecj" ,ecj-bootstrap)
961 ("ecj-javac" ,ecj-javac-on-jamvm-wrapper-final)
962 ("fastjar" ,fastjar)
963 ("fontconfig" ,fontconfig)
964 ("freetype" ,freetype)
965 ("gtk" ,gtk+-2)
966 ("gawk" ,gawk)
967 ("giflib" ,giflib)
968 ("grep" ,grep)
969 ("jamvm" ,jamvm)
970 ("lcms" ,lcms)
971 ("libjpeg" ,libjpeg)
972 ("libpng" ,libpng)
973 ("libtool" ,libtool)
974 ("libx11" ,libx11)
975 ("libxcomposite" ,libxcomposite)
976 ("libxi" ,libxi)
977 ("libxinerama" ,libxinerama)
978 ("libxrender" ,libxrender)
979 ("libxslt" ,libxslt) ;for xsltproc
980 ("libxt" ,libxt)
981 ("libxtst" ,libxtst)
982 ("mit-krb5" ,mit-krb5)
983 ("nss" ,nss)
984 ("nss-certs" ,nss-certs)
985 ("perl" ,perl)
986 ("pkg-config" ,pkg-config)
987 ("procps" ,procps) ;for "free", even though I'm not sure we should use it
988 ("unzip" ,unzip)
989 ("wget" ,wget)
990 ("which" ,which)
991 ("zip" ,zip)
992 ("zlib" ,zlib)
993 ("openjdk-src"
994 ,(origin
995 (method hg-fetch)
996 (uri (hg-reference
997 (url "http://hg.openjdk.java.net/jdk6/jdk6/")
998 (changeset "jdk6-b41")))
999 (sha256
1000 (base32
1001 "14q47yfg586fs64w30g8mk92m5dkxsvr36zzh0ra99xk5x0x96mv"))))
1002 ("jdk-src"
1003 ,(origin
1004 (method hg-fetch)
1005 (uri (hg-reference
1006 (url "http://hg.openjdk.java.net/jdk6/jdk6/jdk/")
1007 (changeset "jdk6-b41")))
1008 (sha256
1009 (base32
1010 "165824nhg1k1dx6zs9dny0j49rmk35jw5b13dmz8c77jfajml4v9"))))
1011 ("hotspot-src"
1012 ,(origin
1013 (method hg-fetch)
1014 (uri (hg-reference
1015 (url "http://hg.openjdk.java.net/jdk6/jdk6/hotspot/")
1016 (changeset "jdk6-b41")))
1017 (sha256
1018 (base32
1019 "07lc1z4k5dj9nrc1wvwmpvxr3xgxrdkdh53xb95skk5ij49yagfd"))))
1020 ("corba-src"
1021 ,(origin
1022 (method hg-fetch)
1023 (uri (hg-reference
1024 (url "http://hg.openjdk.java.net/jdk6/jdk6/corba/")
1025 (changeset "jdk6-b41")))
1026 (sha256
1027 (base32
1028 "1p9g1r9dnax2iwp7yb59qx7m4nmshqhwmrb2b8jj8zgbd9dl2i3q"))))
1029 ("langtools-src"
1030 ,(origin
1031 (method hg-fetch)
1032 (uri (hg-reference
1033 (url "http://hg.openjdk.java.net/jdk6/jdk6/langtools/")
1034 (changeset "jdk6-b41")))
1035 (sha256
1036 (base32
1037 "1x52wd67fynbbd9ild6fb4wvba3f5hhwk03qdjfazd0a1qr37z3d"))))
1038 ("jaxp-src"
1039 ,(origin
1040 (method hg-fetch)
1041 (uri (hg-reference
1042 (url "http://hg.openjdk.java.net/jdk6/jdk6/jaxp/")
1043 (changeset "jdk6-b41")))
1044 (sha256
1045 (base32
1046 "0shlqrvzpr4nrkmv215lbxnby63s3yvbdh1yxcayznsyqwa4nlxm"))))
1047 ("jaxws-src"
1048 ,(origin
1049 (method hg-fetch)
1050 (uri (hg-reference
1051 (url "http://hg.openjdk.java.net/jdk6/jdk6/jaxws/")
1052 (changeset "jdk6-b41")))
1053 (sha256
1054 (base32
1055 "0835lkw8vib1xhp8lxnybhlvzdh699hbi4mclxanydjk63zbpxk0"))))))
1056 (home-page "http://icedtea.classpath.org")
1057 (synopsis "Java development kit")
1058 (description
1059 "This package provides the OpenJDK built with the IcedTea build harness.
1060This version of the OpenJDK is no longer maintained and is only used for
1061bootstrapping purposes.")
1062 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
1063 ;; same license as both GNU Classpath and OpenJDK.
1064 (license license:gpl2+)))
1065
a243e12a 1066(define-public icedtea-7
d30ce4a7 1067 (let* ((version "2.6.10")
f6789047
RW
1068 (drop (lambda (name hash)
1069 (origin
1070 (method url-fetch)
1071 (uri (string-append
d30ce4a7 1072 "http://icedtea.classpath.org/download/drops"
f6789047
RW
1073 "/icedtea7/" version "/" name ".tar.bz2"))
1074 (sha256 (base32 hash))))))
71053e14
RW
1075 (package
1076 (name "icedtea")
f6789047
RW
1077 (version version)
1078 (source (origin
1079 (method url-fetch)
1080 (uri (string-append
1081 "http://icedtea.wildebeest.org/download/source/icedtea-"
1082 version ".tar.xz"))
1083 (sha256
1084 (base32
d30ce4a7 1085 "0am945k2zqrka2xn7lb5grmkad4lwncnhnwk8iq6f269birzsj8w"))
f6789047
RW
1086 (modules '((guix build utils)))
1087 (snippet
1088 '(substitute* "Makefile.in"
1089 ;; do not leak information about the build host
1090 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
1091 "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
71053e14
RW
1092 (build-system gnu-build-system)
1093 (outputs '("out" ; Java Runtime Environment
1094 "jdk" ; Java Development Kit
1095 "doc")) ; all documentation
f6789047
RW
1096 (arguments
1097 `(;; There are many test failures. Some are known to
1098 ;; fail upstream, others relate to not having an X
1099 ;; server running at test time, yet others are a
1100 ;; complete mystery to me.
1101
1102 ;; hotspot: passed: 241; failed: 45; error: 2
1103 ;; langtools: passed: 1,934; failed: 26
1104 ;; jdk: unknown
1105 #:tests? #f
71053e14
RW
1106
1107 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
1108 ;; gremlin) doesn't support it yet, so skip this phase.
1109 #:validate-runpath? #f
1110
f6789047
RW
1111 ;; Apparently, the C locale is needed for some of the tests.
1112 #:locale "C"
71053e14
RW
1113
1114 #:modules ((guix build utils)
1115 (guix build gnu-build-system)
1116 (ice-9 match)
1117 (ice-9 popen)
71053e14
RW
1118 (srfi srfi-19)
1119 (srfi srfi-26))
1120
1121 #:configure-flags
e2098e2d
RW
1122 ;; TODO: package pcsc and sctp, and add to inputs
1123 `("--disable-system-pcsc"
1124 "--disable-system-sctp"
1125 "--enable-bootstrap"
1126 "--enable-nss"
1127 "--without-rhino"
1128 "--disable-downloading"
1129 "--disable-tests" ;they are run in the check phase instead
1130 "--with-openjdk-src-dir=./openjdk.src"
1131 ,(string-append "--with-jdk-home="
1132 (assoc-ref %build-inputs "jdk")))
71053e14
RW
1133
1134 #:phases
1135 (modify-phases %standard-phases
1136 (replace 'unpack
1137 (lambda* (#:key source inputs #:allow-other-keys)
1138 (let ((target (string-append "icedtea-" ,version))
1139 (unpack (lambda* (name #:optional dir)
1140 (let ((dir (or dir
1141 (string-drop-right name 5))))
1142 (mkdir dir)
1143 (zero? (system* "tar" "xvf"
1144 (assoc-ref inputs name)
1145 "-C" dir
1146 "--strip-components=1"))))))
1147 (mkdir target)
1148 (and
1149 (zero? (system* "tar" "xvf" source
1150 "-C" target "--strip-components=1"))
1151 (chdir target)
1152 (unpack "openjdk-src" "openjdk.src")
1153 (with-directory-excursion "openjdk.src"
1154 (for-each unpack
1155 (filter (cut string-suffix? "-drop" <>)
1156 (map (match-lambda
1157 ((name . _) name))
1158 inputs))))
1159 #t))))
1160 (add-after 'unpack 'fix-x11-extension-include-path
1161 (lambda* (#:key inputs #:allow-other-keys)
1162 (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
1163 (((string-append "\\$\\(firstword \\$\\(wildcard "
1164 "\\$\\(OPENWIN_HOME\\)"
1165 "/include/X11/extensions\\).*$"))
1166 (string-append (assoc-ref inputs "libxrender")
1167 "/include/X11/extensions"
1168 " -I" (assoc-ref inputs "libxtst")
1169 "/include/X11/extensions"
1170 " -I" (assoc-ref inputs "libxinerama")
1171 "/include/X11/extensions"))
1172 (("\\$\\(wildcard /usr/include/X11/extensions\\)\\)") ""))
1173 #t))
1174 (add-after 'unpack 'patch-paths
1175 (lambda _
1176 ;; buildtree.make generates shell scripts, so we need to replace
1177 ;; the generated shebang
1178 (substitute* '("openjdk.src/hotspot/make/linux/makefiles/buildtree.make")
1179 (("/bin/sh") (which "bash")))
1180
1181 (let ((corebin (string-append
1182 (assoc-ref %build-inputs "coreutils") "/bin/"))
1183 (binbin (string-append
1184 (assoc-ref %build-inputs "binutils") "/bin/"))
1185 (grepbin (string-append
1186 (assoc-ref %build-inputs "grep") "/bin/")))
1187 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
1188 "openjdk.src/corba/make/common/shared/Defs-linux.gmk")
1189 (("UNIXCOMMAND_PATH = /bin/")
1190 (string-append "UNIXCOMMAND_PATH = " corebin))
1191 (("USRBIN_PATH = /usr/bin/")
1192 (string-append "USRBIN_PATH = " corebin))
1193 (("DEVTOOLS_PATH *= */usr/bin/")
1194 (string-append "DEVTOOLS_PATH = " corebin))
1195 (("COMPILER_PATH *= */usr/bin/")
1196 (string-append "COMPILER_PATH = "
1197 (assoc-ref %build-inputs "gcc") "/bin/"))
1198 (("DEF_OBJCOPY *=.*objcopy")
1199 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
1200
1201 ;; fix path to alsa header
1202 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
1203 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
1204 (string-append "ALSA_INCLUDE="
1205 (assoc-ref %build-inputs "alsa-lib")
1206 "/include/alsa/version.h")))
1207
1208 ;; fix hard-coded utility paths
1209 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-utils.gmk"
1210 "openjdk.src/corba/make/common/shared/Defs-utils.gmk")
1211 (("ECHO *=.*echo")
1212 (string-append "ECHO = " (which "echo")))
1213 (("^GREP *=.*grep")
1214 (string-append "GREP = " (which "grep")))
1215 (("EGREP *=.*egrep")
1216 (string-append "EGREP = " (which "egrep")))
1217 (("CPIO *=.*cpio")
1218 (string-append "CPIO = " (which "cpio")))
1219 (("READELF *=.*readelf")
1220 (string-append "READELF = " (which "readelf")))
1221 (("^ *AR *=.*ar")
1222 (string-append "AR = " (which "ar")))
1223 (("^ *TAR *=.*tar")
1224 (string-append "TAR = " (which "tar")))
1225 (("AS *=.*as")
1226 (string-append "AS = " (which "as")))
1227 (("LD *=.*ld")
1228 (string-append "LD = " (which "ld")))
1229 (("STRIP *=.*strip")
1230 (string-append "STRIP = " (which "strip")))
1231 (("NM *=.*nm")
1232 (string-append "NM = " (which "nm")))
1233 (("^SH *=.*sh")
1234 (string-append "SH = " (which "bash")))
1235 (("^FIND *=.*find")
1236 (string-append "FIND = " (which "find")))
1237 (("LDD *=.*ldd")
1238 (string-append "LDD = " (which "ldd")))
1239 (("NAWK *=.*(n|g)awk")
1240 (string-append "NAWK = " (which "gawk")))
1241 (("XARGS *=.*xargs")
1242 (string-append "XARGS = " (which "xargs")))
1243 (("UNZIP *=.*unzip")
1244 (string-append "UNZIP = " (which "unzip")))
1245 (("ZIPEXE *=.*zip")
1246 (string-append "ZIPEXE = " (which "zip")))
1247 (("SED *=.*sed")
1248 (string-append "SED = " (which "sed"))))
1249
1250 ;; Some of these timestamps cause problems as they are more than
1251 ;; 10 years ago, failing the build process.
1252 (substitute*
1253 "openjdk.src/jdk/src/share/classes/java/util/CurrencyData.properties"
1254 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
1255 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
1256 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
1257 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY")))
1258 #t))
1259 (add-before 'configure 'set-additional-paths
1260 (lambda* (#:key inputs #:allow-other-keys)
e2098e2d
RW
1261 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
1262 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
1263 (string-append "ALSA_INCLUDE="
1264 (assoc-ref inputs "alsa-lib")
1265 "/include/alsa/version.h")))
1266 (setenv "CC" "gcc")
1267 (setenv "CPATH"
1268 (string-append (assoc-ref inputs "libxcomposite")
1269 "/include/X11/extensions" ":"
1270 (assoc-ref inputs "libxrender")
1271 "/include/X11/extensions" ":"
1272 (assoc-ref inputs "libxtst")
1273 "/include/X11/extensions" ":"
1274 (assoc-ref inputs "libxinerama")
1275 "/include/X11/extensions" ":"
1276 (or (getenv "CPATH") "")))
1277 (setenv "ALT_OBJCOPY" (which "objcopy"))
1278 (setenv "ALT_CUPS_HEADERS_PATH"
1279 (string-append (assoc-ref inputs "cups")
1280 "/include"))
1281 (setenv "ALT_FREETYPE_HEADERS_PATH"
1282 (string-append (assoc-ref inputs "freetype")
1283 "/include"))
1284 (setenv "ALT_FREETYPE_LIB_PATH"
1285 (string-append (assoc-ref inputs "freetype")
1286 "/lib"))
71053e14
RW
1287 #t))
1288 (add-before 'check 'fix-test-framework
1289 (lambda _
1290 ;; Fix PATH in test environment
1291 (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
1292 (("PATH=/bin:/usr/bin")
1293 (string-append "PATH=" (getenv "PATH"))))
1294 (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
1295 (("/usr/bin/env") (which "env")))
1296 (substitute* "openjdk.src/hotspot/test/test_env.sh"
1297 (("/bin/rm") (which "rm"))
1298 (("/bin/cp") (which "cp"))
1299 (("/bin/mv") (which "mv")))
1300 #t))
1301 (add-before 'check 'fix-hotspot-tests
1302 (lambda _
1303 (with-directory-excursion "openjdk.src/hotspot/test/"
1304 (substitute* "jprt.config"
1305 (("PATH=\"\\$\\{path4sdk\\}\"")
1306 (string-append "PATH=" (getenv "PATH")))
1307 (("make=/usr/bin/make")
1308 (string-append "make=" (which "make"))))
1309 (substitute* '("runtime/6626217/Test6626217.sh"
1310 "runtime/7110720/Test7110720.sh")
1311 (("/bin/rm") (which "rm"))
1312 (("/bin/cp") (which "cp"))
1313 (("/bin/mv") (which "mv"))))
1314 #t))
1315 (add-before 'check 'fix-jdk-tests
1316 (lambda _
1317 (with-directory-excursion "openjdk.src/jdk/test/"
1318 (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
1319 (("/bin/pwd") (which "pwd")))
1320 (substitute* "com/sun/jdi/ShellScaffold.sh"
1321 (("/bin/kill") (which "kill")))
1322 (substitute* "start-Xvfb.sh"
1323 ;;(("/usr/bin/X11/Xvfb") (which "Xvfb"))
1324 (("/usr/bin/nohup") (which "nohup")))
1325 (substitute* "javax/security/auth/Subject/doAs/Test.sh"
1326 (("/bin/rm") (which "rm")))
1327 (substitute* "tools/launcher/MultipleJRE.sh"
1328 (("echo \"#!/bin/sh\"")
1329 (string-append "echo \"#!" (which "rm") "\""))
1330 (("/usr/bin/zip") (which "zip")))
1331 (substitute* "com/sun/jdi/OnThrowTest.java"
1332 (("#!/bin/sh") (string-append "#!" (which "sh"))))
1333 (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
1334 (("/usr/bin/uptime") (which "uptime")))
1335 (substitute* "java/lang/ProcessBuilder/Basic.java"
1336 (("/usr/bin/env") (which "env"))
1337 (("/bin/false") (which "false"))
1338 (("/bin/true") (which "true"))
1339 (("/bin/cp") (which "cp"))
1340 (("/bin/sh") (which "sh")))
1341 (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
1342 (("/bin/sh") (which "sh")))
1343 (substitute* "java/lang/ProcessBuilder/Zombies.java"
1344 (("/usr/bin/perl") (which "perl"))
1345 (("/bin/ps") (which "ps"))
1346 (("/bin/true") (which "true")))
1347 (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
1348 (("/usr/bin/tee") (which "tee")))
1349 (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
1350 (("/bin/true") (which "true")))
1351 (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
1352 (("/bin/cat") (which "cat")))
1353 (substitute* "java/lang/Runtime/exec/ExitValue.java"
1354 (("/bin/sh") (which "sh"))
1355 (("/bin/true") (which "true"))
1356 (("/bin/kill") (which "kill")))
1357 (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
1358 (("/usr/bin/echo") (which "echo")))
1359 (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
1360 (("/usr/bin/cat") (which "cat")))
1361 (substitute* "java/lang/Runtime/exec/SleepyCat.java"
1362 (("/bin/cat") (which "cat"))
1363 (("/bin/sleep") (which "sleep"))
1364 (("/bin/sh") (which "sh")))
1365 (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
1366 (("/bin/cat") (which "cat")))
1367 (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
1368 (("/bin/chmod") (which "chmod")))
1369 (substitute* "java/util/zip/ZipFile/Assortment.java"
1370 (("/bin/sh") (which "sh"))))
1371 #t))
1372 (replace 'check
1373 (lambda _
1374 ;; The "make check-*" targets always return zero, so we need to
1375 ;; check for errors in the associated log files to determine
1376 ;; whether any tests have failed.
1377 (use-modules (ice-9 rdelim))
1378 (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
1379 (checker (lambda (port)
1380 (let loop ()
1381 (let ((line (read-line port)))
1382 (cond
1383 ((eof-object? line) #t)
1384 ((regexp-exec error-pattern line) #f)
1385 (else (loop)))))))
1386 (run-test (lambda (test)
1387 (system* "make" test)
1388 (call-with-input-file
1389 (string-append "test/" test ".log")
1390 checker))))
1391 (or #t ; skip tests
1392 (and (run-test "check-hotspot")
1393 (run-test "check-langtools")
1394 (run-test "check-jdk"))))))
1395 (replace 'install
1396 (lambda* (#:key outputs #:allow-other-keys)
1397 (let ((doc (string-append (assoc-ref outputs "doc")
1398 "/share/doc/icedtea"))
1399 (jre (assoc-ref outputs "out"))
1400 (jdk (assoc-ref outputs "jdk")))
1401 (copy-recursively "openjdk.build/docs" doc)
1402 (copy-recursively "openjdk.build/j2re-image" jre)
1403 (copy-recursively "openjdk.build/j2sdk-image" jdk))
1404 #t))
1405 ;; By default IcedTea only generates an empty keystore. In order to
1406 ;; be able to use certificates in Java programs we need to generate a
1407 ;; keystore from a set of certificates. For convenience we use the
1408 ;; certificates from the nss-certs package.
1409 (add-after 'install 'install-keystore
1410 (lambda* (#:key inputs outputs #:allow-other-keys)
1411 (let* ((keystore "cacerts")
1412 (certs-dir (string-append (assoc-ref inputs "nss-certs")
1413 "/etc/ssl/certs"))
1414 (keytool (string-append (assoc-ref outputs "jdk")
1415 "/bin/keytool")))
1416 (define (extract-cert file target)
1417 (call-with-input-file file
1418 (lambda (in)
1419 (call-with-output-file target
1420 (lambda (out)
1421 (let loop ((line (read-line in 'concat))
1422 (copying? #f))
1423 (cond
1424 ((eof-object? line) #t)
1425 ((string-prefix? "-----BEGIN" line)
1426 (display line out)
1427 (loop (read-line in 'concat) #t))
1428 ((string-prefix? "-----END" line)
1429 (display line out)
1430 #t)
1431 (else
1432 (when copying? (display line out))
1433 (loop (read-line in 'concat) copying?)))))))))
1434 (define (import-cert cert)
1435 (format #t "Importing certificate ~a\n" (basename cert))
1436 (let ((temp "tmpcert"))
1437 (extract-cert cert temp)
1438 (let ((port (open-pipe* OPEN_WRITE keytool
1439 "-import"
1440 "-alias" (basename cert)
1441 "-keystore" keystore
1442 "-storepass" "changeit"
1443 "-file" temp)))
1444 (display "yes\n" port)
1445 (when (not (zero? (status:exit-val (close-pipe port))))
1446 (format #t "failed to import ~a\n" cert)))
1447 (delete-file temp)))
1448
1449 ;; This is necessary because the certificate directory contains
1450 ;; files with non-ASCII characters in their names.
1451 (setlocale LC_ALL "en_US.utf8")
1452 (setenv "LC_ALL" "en_US.utf8")
1453
1454 (for-each import-cert (find-files certs-dir "\\.pem$"))
1455 (mkdir-p (string-append (assoc-ref outputs "out")
1456 "/lib/security"))
1457 (mkdir-p (string-append (assoc-ref outputs "jdk")
1458 "/jre/lib/security"))
1459
1460 ;; The cacerts files we are going to overwrite are chmod'ed as
1461 ;; read-only (444) in icedtea-8 (which derives from this
1462 ;; package). We have to change this so we can overwrite them.
1463 (chmod (string-append (assoc-ref outputs "out")
1464 "/lib/security/" keystore) #o644)
1465 (chmod (string-append (assoc-ref outputs "jdk")
1466 "/jre/lib/security/" keystore) #o644)
1467
1468 (install-file keystore
1469 (string-append (assoc-ref outputs "out")
1470 "/lib/security"))
1471 (install-file keystore
1472 (string-append (assoc-ref outputs "jdk")
1473 "/jre/lib/security"))
1474 #t))))))
f6789047 1475 (native-inputs
d9148890 1476 `(("openjdk-src"
f6789047 1477 ,(drop "openjdk"
d30ce4a7 1478 "02klsxp9hlf5sial6mxpiq53hmrhlrg6x774j7bjjfhb7hpdvadh"))
f6789047
RW
1479 ("corba-drop"
1480 ,(drop "corba"
d30ce4a7 1481 "1vbly6khri241xda05gnwkpf2fk41d96ls96ximi084mx0a3w5rd"))
f6789047
RW
1482 ("jaxp-drop"
1483 ,(drop "jaxp"
d30ce4a7 1484 "0s8zln64vdwdxwlw1vpfzm8xbpyhgsv3nqjmnv7y36qpsszg27a5"))
f6789047
RW
1485 ("jaxws-drop"
1486 ,(drop "jaxws"
d30ce4a7 1487 "0myd66bv8ib8krzgqv754bc564rd8xwpwabvf7my1apyb86vap3n"))
f6789047
RW
1488 ("jdk-drop"
1489 ,(drop "jdk"
d30ce4a7 1490 "10b4lfv10vba07zblw0wii7mhrfhf32pf7410x5nz2q0smgszl2h"))
f6789047
RW
1491 ("langtools-drop"
1492 ,(drop "langtools"
d30ce4a7 1493 "0lvncxb5qzrlqkflrnd0l8vwy155cwj1jb07rkq10z2vx0bq7lq2"))
f6789047
RW
1494 ("hotspot-drop"
1495 ,(drop "hotspot"
d30ce4a7 1496 "0q6mdgbbd3681y3n0z1v783irdjhhi73z6sn5csczpyhjm318axb"))
e2098e2d 1497 ("ant" ,ant-bootstrap)
71053e14 1498 ("attr" ,attr)
71053e14
RW
1499 ("coreutils" ,coreutils)
1500 ("diffutils" ,diffutils) ;for tests
1501 ("gawk" ,gawk)
1502 ("grep" ,grep)
1503 ("libtool" ,libtool)
1504 ("pkg-config" ,pkg-config)
1505 ("wget" ,wget)
1506 ("which" ,which)
1507 ("cpio" ,cpio)
1508 ("zip" ,zip)
1509 ("unzip" ,unzip)
1510 ("fastjar" ,fastjar)
1511 ("libxslt" ,libxslt) ;for xsltproc
1512 ("nss-certs" ,nss-certs)
1513 ("perl" ,perl)
1514 ("procps" ,procps) ;for "free", even though I'm not sure we should use it
e2098e2d 1515 ("jdk" ,icedtea-6 "jdk")))
b711df02 1516 (inputs
71053e14
RW
1517 `(("alsa-lib" ,alsa-lib)
1518 ("cups" ,cups)
1519 ("libx11" ,libx11)
1520 ("libxcomposite" ,libxcomposite)
1521 ("libxt" ,libxt)
1522 ("libxtst" ,libxtst)
1523 ("libxi" ,libxi)
1524 ("libxinerama" ,libxinerama)
1525 ("libxrender" ,libxrender)
1526 ("libjpeg" ,libjpeg)
1527 ("libpng" ,libpng)
1528 ("mit-krb5" ,mit-krb5)
1529 ("nss" ,nss)
1530 ("giflib" ,giflib)
1531 ("fontconfig" ,fontconfig)
1532 ("freetype" ,freetype)
1533 ("lcms" ,lcms)
1534 ("zlib" ,zlib)
1535 ("gtk" ,gtk+-2)))
1536 (home-page "http://icedtea.classpath.org")
1537 (synopsis "Java development kit")
1538 (description
1539 "This package provides the Java development kit OpenJDK built with the
1540IcedTea build harness.")
1541 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
1542 ;; same license as both GNU Classpath and OpenJDK.
1543 (license license:gpl2+))))
d2540f80 1544
349a3147 1545(define-public icedtea-8
e9185cba 1546 (let* ((version "3.5.0")
349a3147
RW
1547 (drop (lambda (name hash)
1548 (origin
1549 (method url-fetch)
1550 (uri (string-append
db531f73 1551 "http://icedtea.classpath.org/download/drops"
349a3147
RW
1552 "/icedtea8/" version "/" name ".tar.xz"))
1553 (sha256 (base32 hash))))))
1554 (package (inherit icedtea-7)
e9185cba 1555 (version "3.5.0")
349a3147
RW
1556 (source (origin
1557 (method url-fetch)
1558 (uri (string-append
1559 "http://icedtea.wildebeest.org/download/source/icedtea-"
1560 version ".tar.xz"))
1561 (sha256
1562 (base32
e9185cba 1563 "1dfa7ing61i73m6wfx2kx59q44npqdiy7cd66xmslyy0xh09xa4s"))
349a3147
RW
1564 (modules '((guix build utils)))
1565 (snippet
0c729ef4
RW
1566 '(begin
1567 (substitute* "acinclude.m4"
1568 ;; Do not embed build time
1569 (("(DIST_ID=\"Custom build).*$" _ prefix)
1570 (string-append prefix "\"\n"))
1571 ;; Do not leak information about the build host
1572 (("DIST_NAME=\"\\$build_os\"")
1573 "DIST_NAME=\"guix\""))
1574 #t))))
349a3147
RW
1575 (arguments
1576 (substitute-keyword-arguments (package-arguments icedtea-7)
1577 ((#:configure-flags flags)
1578 `(let ((jdk (assoc-ref %build-inputs "jdk")))
1579 `(;;"--disable-bootstrap"
1580 "--enable-bootstrap"
1581 "--enable-nss"
1582 "--disable-downloading"
5ac6b841
LF
1583 "--disable-system-pcsc"
1584 "--disable-system-sctp"
349a3147
RW
1585 "--disable-tests" ;they are run in the check phase instead
1586 "--with-openjdk-src-dir=./openjdk.src"
1587 ,(string-append "--with-jdk-home=" jdk))))
1588 ((#:phases phases)
1589 `(modify-phases ,phases
1590 (delete 'fix-x11-extension-include-path)
1591 (delete 'patch-paths)
1592 (delete 'set-additional-paths)
1593 (delete 'patch-patches)
cab1760d
SB
1594 (add-after 'unpack 'patch-jni-libs
1595 ;; Hardcode dynamically loaded libraries.
1596 (lambda _
1597 (let* ((library-path (search-path-as-string->list
1598 (getenv "LIBRARY_PATH")))
1599 (find-library (lambda (name)
1600 (search-path
1601 library-path
1602 (string-append "lib" name ".so")))))
1603 (for-each
1604 (lambda (file)
1605 (catch 'encoding-error
1606 (lambda ()
1607 (substitute* file
1608 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
1609 _ name version)
1610 (format #f "\"~a\"" (find-library name)))
1611 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
1612 (format #f "\"~a\"" (find-library name)))))
1613 (lambda _
1614 ;; Those are safe to skip.
1615 (format (current-error-port)
1616 "warning: failed to substitute: ~a~%"
1617 file))))
1618 (find-files "openjdk.src/jdk/src/solaris/native"
1619 "\\.c|\\.h"))
1620 #t)))
349a3147
RW
1621 (replace 'install
1622 (lambda* (#:key outputs #:allow-other-keys)
1623 (let ((doc (string-append (assoc-ref outputs "doc")
1624 "/share/doc/icedtea"))
1625 (jre (assoc-ref outputs "out"))
1626 (jdk (assoc-ref outputs "jdk")))
1627 (copy-recursively "openjdk.build/docs" doc)
1628 (copy-recursively "openjdk.build/images/j2re-image" jre)
1629 (copy-recursively "openjdk.build/images/j2sdk-image" jdk)
1630 #t)))))))
1631 (native-inputs
1632 `(("jdk" ,icedtea-7 "jdk")
1633 ("openjdk-src"
1634 ,(drop "openjdk"
e9185cba 1635 "0di7gmyis1p6rpksmff1q21ck85i51sqcl9awqyvg7xiwggq0wsm"))
12eecbf0
LF
1636 ("aarch32-drop"
1637 ,(drop "aarch32"
1638 "0cway5a5hcfyh4pzl9zz5xr7lil4gsliy6r5iqbaasd2d9alvqiq"))
349a3147
RW
1639 ("corba-drop"
1640 ,(drop "corba"
e9185cba 1641 "1xk64bsdxfc66g61d8k6xrhqj8rc56vzrlxx6s23gkr45604bl8x"))
349a3147
RW
1642 ("jaxp-drop"
1643 ,(drop "jaxp"
e9185cba 1644 "1iw9xa4s5kxijdqpf0ih4x6g0lw142yy11vrzfmz6n1y4b0ic7iw"))
349a3147
RW
1645 ("jaxws-drop"
1646 ,(drop "jaxws"
e9185cba 1647 "14p2l4j985wh5cdd4hfmm18gb5wmry73yiysdx9pg3aqpkw9qms7"))
349a3147
RW
1648 ("jdk-drop"
1649 ,(drop "jdk"
e9185cba 1650 "1qwmb80vicn7jd801f3j23lyil7327ks54d3s87czwv8h108m40r"))
349a3147
RW
1651 ("langtools-drop"
1652 ,(drop "langtools"
e9185cba 1653 "175pi2privhcvn9sbam5mhhgcvicfqbgldiw25fi5g80fqkkrza9"))
349a3147
RW
1654 ("hotspot-drop"
1655 ,(drop "hotspot"
e9185cba 1656 "1qdyn02p4ssl3p7z9aadhzl9qdam2q7pvwddz2jkyvajcrxb0mpi"))
349a3147
RW
1657 ("nashorn-drop"
1658 ,(drop "nashorn"
e9185cba 1659 "0kzmpf5b9kwhrvnwn7m20q3dzz8s82jjvbac84606x3ff97xk5gr"))
fd34d4f4
LF
1660 ("shenandoah-drop"
1661 ,(drop "shenandoah"
e9185cba 1662 "0kjc5m5jj2bzyy1vj1s59khv5xjfnkxy18z0g4bdb1kb3g21c5wi"))
349a3147 1663 ,@(fold alist-delete (package-native-inputs icedtea-7)
e2098e2d 1664 '("jdk" "openjdk-src" "corba-drop" "jaxp-drop" "jaxws-drop"
349a3147
RW
1665 "jdk-drop" "langtools-drop" "hotspot-drop")))))))
1666
a243e12a 1667(define-public icedtea icedtea-7)
068e476f 1668
5490480c 1669\f
8bbd0408
RW
1670(define-public ant/java8
1671 (package (inherit ant-bootstrap)
1672 (name "ant")
1673 (version "1.10.1")
1674 (source (origin
1675 (method url-fetch)
1676 (uri (string-append "mirror://apache/ant/source/apache-ant-"
1677 version "-src.tar.gz"))
1678 (sha256
1679 (base32
1680 "10p3dh77lkzzzcy32dk9azljixzadp46fggjfbvgkl8mmb8cxxv8"))
1681 (modules '((guix build utils)))
1682 (snippet
1683 '(begin
1684 (for-each delete-file
1685 (find-files "lib/optional" "\\.jar$"))
1686 #t))))
1687 (arguments
1688 (substitute-keyword-arguments (package-arguments ant-bootstrap)
1689 ((#:phases phases)
1690 `(modify-phases ,phases
1691 (add-after 'unpack 'remove-scripts
1692 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
1693 ;; wrappers.
1694 (lambda _
1695 (for-each delete-file
1696 (find-files "src/script"
1697 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))
1698 #t))
1699 (replace 'build
1700 (lambda* (#:key inputs outputs #:allow-other-keys)
1701 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
1702
1703 ;; Disable tests to avoid dependency on hamcrest-core, which needs
1704 ;; Ant to build. This is necessary in addition to disabling the
1705 ;; "check" phase, because the dependency on "test-jar" would always
1706 ;; result in the tests to be run.
1707 (substitute* "build.xml"
1708 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
1709 (zero? (system* "bash" "bootstrap.sh"
1710 (string-append "-Ddist.dir="
1711 (assoc-ref outputs "out"))))))))))
1712 (native-inputs
1713 `(("jdk" ,icedtea-8 "jdk")))))
1714
e441fc56
RW
1715;; The 1.9.x series is the last that can be built with GCJ. The 1.10.x series
1716;; requires Java 8.
1717(define-public ant
1718 (package (inherit ant/java8)
1719 (version "1.9.9")
1720 (source (origin
1721 (method url-fetch)
1722 (uri (string-append "mirror://apache/ant/source/apache-ant-"
1723 version "-src.tar.gz"))
1724 (sha256
1725 (base32
1726 "1k28mka0m3isy9yr8gz84kz1f3f879rwaxrd44vdn9xbfwvwk86n"))))
1727 (native-inputs
1728 `(("jdk" ,icedtea-7 "jdk")))))
1729
fc6e2727
RW
1730(define-public clojure
1731 (let* ((remove-archives '(begin
1732 (for-each delete-file
1733 (find-files "." ".*\\.(jar|zip)"))
1734 #t))
1735 (submodule (lambda (prefix version hash)
1736 (origin
1737 (method url-fetch)
1738 (uri (string-append "https://github.com/clojure/"
1739 prefix version ".tar.gz"))
1740 (sha256 (base32 hash))
1741 (modules '((guix build utils)))
1742 (snippet remove-archives)))))
1743 (package
1744 (name "clojure")
1745 (version "1.8.0")
1746 (source
1747 (origin
1748 (method url-fetch)
1749 (uri
1750 (string-append "http://repo1.maven.org/maven2/org/clojure/clojure/"
1751 version "/clojure-" version ".zip"))
1752 (sha256
1753 (base32 "1nip095fz5c492sw15skril60i1vd21ibg6szin4jcvyy3xr6cym"))
1754 (modules '((guix build utils)))
1755 (snippet remove-archives)))
1756 (build-system ant-build-system)
1757 (arguments
1758 `(#:modules ((guix build ant-build-system)
1759 (guix build utils)
1760 (ice-9 ftw)
1761 (ice-9 regex)
1762 (srfi srfi-1)
1763 (srfi srfi-26))
1764 #:test-target "test"
1765 #:phases
1766 (modify-phases %standard-phases
1767 (add-after 'unpack 'unpack-submodule-sources
1768 (lambda* (#:key inputs #:allow-other-keys)
1769 (for-each
1770 (lambda (name)
1771 (mkdir-p name)
1772 (with-directory-excursion name
1773 (or (zero? (system* "tar"
1774 ;; Use xz for repacked tarball.
1775 "--xz"
1776 "--extract"
1777 "--verbose"
1778 "--file" (assoc-ref inputs name)
1779 "--strip-components=1"))
1780 (error "failed to unpack tarball" name)))
1781 (copy-recursively (string-append name "/src/main/clojure/")
1782 "src/clj/"))
1783 '("data-generators-src"
1784 "java-classpath-src"
1785 "test-check-src"
1786 "test-generative-src"
1787 "tools-namespace-src"
1788 "tools-reader-src"))
1789 #t))
1790 ;; The javadoc target is not built by default.
1791 (add-after 'build 'build-doc
1792 (lambda _
1793 (zero? (system* "ant" "javadoc"))))
1794 ;; Needed since no install target is provided.
1795 (replace 'install
1796 (lambda* (#:key outputs #:allow-other-keys)
1797 (let ((java-dir (string-append (assoc-ref outputs "out")
1798 "/share/java/")))
1799 ;; Install versioned to avoid collisions.
1800 (install-file (string-append "clojure-" ,version ".jar")
1801 java-dir)
1802 #t)))
1803 ;; Needed since no install-doc target is provided.
1804 (add-after 'install 'install-doc
1805 (lambda* (#:key outputs #:allow-other-keys)
1806 (let ((doc-dir (string-append (assoc-ref outputs "out")
1807 "/share/doc/clojure-"
1808 ,version "/")))
1809 (copy-recursively "doc/clojure" doc-dir)
1810 (copy-recursively "target/javadoc/"
1811 (string-append doc-dir "javadoc/"))
1812 (for-each (cut install-file <> doc-dir)
1813 (filter (cut string-match
1814 ".*\\.(html|markdown|md|txt)"
1815 <>)
1816 (scandir "./")))
1817 #t))))))
1818 ;; The native-inputs below are needed to run the tests.
1819 (native-inputs
1820 `(("data-generators-src"
1821 ,(submodule "data.generators/archive/data.generators-"
1822 "0.1.2"
1823 "0kki093jp4ckwxzfnw8ylflrfqs8b1i1wi9iapmwcsy328dmgzp1"))
1824 ("java-classpath-src"
1825 ,(submodule "java.classpath/archive/java.classpath-"
1826 "0.2.3"
1827 "0sjymly9xh1lkvwn5ygygpsfwz4dabblnlq0c9bx76rkvq62fyng"))
1828 ("test-check-src"
1829 ,(submodule "test.check/archive/test.check-"
1830 "0.9.0"
1831 "0p0mnyhr442bzkz0s4k5ra3i6l5lc7kp6ajaqkkyh4c2k5yck1md"))
1832 ("test-generative-src"
1833 ,(submodule "test.generative/archive/test.generative-"
1834 "0.5.2"
1835 "1pjafy1i7yblc7ixmcpfq1lfbyf3jaljvkgrajn70sws9xs7a9f8"))
1836 ("tools-namespace-src"
1837 ,(submodule "tools.namespace/archive/tools.namespace-"
1838 "0.2.11"
1839 "10baak8v0hnwz2hr33bavshm7y49mmn9zsyyms1dwjz45p5ymhy0"))
1840 ("tools-reader-src"
1841 ,(submodule "tools.reader/archive/tools.reader-"
d34970ee
AV
1842 "1.0.0"
1843 "1lafblmmj4hkg0aqrf19qkdw9wdcsh3qxmn6cbkmnzbhffpyv2lv"))))
fc6e2727
RW
1844 (home-page "https://clojure.org/")
1845 (synopsis "Lisp dialect running on the JVM")
1846 (description "Clojure is a dynamic, general-purpose programming language,
1847combining the approachability and interactive development of a scripting
1848language with an efficient and robust infrastructure for multithreaded
1849programming. Clojure is a compiled language, yet remains completely dynamic
1850– every feature supported by Clojure is supported at runtime. Clojure
1851provides easy access to the Java frameworks, with optional type hints and type
1852inference, to ensure that calls to Java can avoid reflection.
1853
1854Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy
1855and a powerful macro system. Clojure is predominantly a functional programming
1856language, and features a rich set of immutable, persistent data structures.
1857When mutable state is needed, Clojure offers a software transactional memory
1858system and reactive Agent system that ensure clean, correct, multithreaded
1859designs.")
1860 ;; Clojure is licensed under EPL1.0
1861 ;; ASM bytecode manipulation library is licensed under BSD-3
1862 ;; Guava Murmur3 hash implementation is licensed under APL2.0
1863 ;; src/clj/repl.clj is licensed under CPL1.0
1864 ;;
1865 ;; See readme.html or readme.txt for details.
1866 (license (list license:epl1.0
1867 license:bsd-3
1868 license:asl2.0
1869 license:cpl1.0)))))
1870
218d093b
RW
1871(define-public java-classpathx-servletapi
1872 (package
1873 (name "java-classpathx-servletapi")
1874 (version "3.0")
1875 (source (origin
1876 (method url-fetch)
1877 (uri (string-append "mirror://gnu/classpathx/servletapi/"
1878 "servletapi-" version ".tar.gz"))
1879 (sha256
1880 (base32
1881 "0y9489pk4as9q6x300sk3ycc0psqfxcd4b0xvbmf3rhgli8q1kx3"))))
1882 (build-system ant-build-system)
1883 (arguments
1884 `(#:tests? #f ; there is no test target
1885 #:build-target "compile"
1886 ;; NOTE: This package does not build with Java 8 because of a type
1887 ;; mismatch in
1888 ;; "source/javax/servlet/jsp/el/ImplicitObjectELResolver.java". It
1889 ;; defines the return value of ScopeMap's "remove" method to be of type
1890 ;; "Object", whereas Map's "remove" method returns boolean.
1891 #:make-flags
1892 (list "-Dbuild.compiler=javac1.7"
1893 (string-append "-Ddist=" (assoc-ref %outputs "out")))
1894 #:phases
1895 (modify-phases %standard-phases
1896 (replace 'install
1897 (lambda* (#:key make-flags #:allow-other-keys)
1898 (zero? (apply system* `("ant" "dist" ,@make-flags))))))))
1899 (home-page "https://www.gnu.org/software/classpathx/")
1900 (synopsis "Java servlet API implementation")
1901 (description "This is the GNU servlet API distribution, part of the
1902ClasspathX project. It provides implementations of version 3.0 of the servlet
1903API and version 2.1 of the Java ServerPages API.")
1904 (license license:gpl3+)))
1905
5490480c
RW
1906(define-public java-swt
1907 (package
1908 (name "java-swt")
1909 (version "4.6")
1910 (source
1911 ;; The types of many variables and procedures differ in the sources
1912 ;; dependent on whether the target architecture is a 32-bit system or a
1913 ;; 64-bit system. Instead of patching the sources on demand in a build
1914 ;; phase we download either the 32-bit archive (which mostly uses "int"
1915 ;; types) or the 64-bit archive (which mostly uses "long" types).
1916 (let ((hash32 "0jmx1h65wqxsyjzs64i2z6ryiynllxzm13cq90fky2qrzagcw1ir")
1917 (hash64 "0wnd01xssdq9pgx5xqh5lfiy3dmk60dzzqdxzdzf883h13692lgy")
1918 (file32 "x86")
1919 (file64 "x86_64"))
1920 (let-values (((hash file)
1921 (match (or (%current-target-system) (%current-system))
1922 ("x86_64-linux" (values hash64 file64))
1923 (_ (values hash32 file32)))))
1924 (origin
1925 (method url-fetch)
1926 (uri (string-append
1927 "http://ftp-stud.fht-esslingen.de/pub/Mirrors/"
1928 "eclipse/eclipse/downloads/drops4/R-" version
1929 "-201606061100/swt-" version "-gtk-linux-" file ".zip"))
1930 (sha256 (base32 hash))))))
1931 (build-system ant-build-system)
1932 (arguments
1933 `(#:jar-name "swt.jar"
1934 #:tests? #f ; no "check" target
1935 #:phases
1936 (modify-phases %standard-phases
1937 (replace 'unpack
1938 (lambda* (#:key source #:allow-other-keys)
1939 (and (mkdir "swt")
1940 (zero? (system* "unzip" source "-d" "swt"))
1941 (chdir "swt")
1942 (mkdir "src")
1943 (zero? (system* "unzip" "src.zip" "-d" "src")))))
1944 ;; The classpath contains invalid icecat jars. Since we don't need
1945 ;; anything other than the JDK on the classpath, we can simply unset
1946 ;; it.
1947 (add-after 'configure 'unset-classpath
1948 (lambda _ (unsetenv "CLASSPATH") #t))
1949 (add-before 'build 'build-native
1950 (lambda* (#:key inputs outputs #:allow-other-keys)
1951 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
1952 ;; Build shared libraries. Users of SWT have to set the system
1953 ;; property swt.library.path to the "lib" directory of this
1954 ;; package output.
1955 (mkdir-p lib)
1956 (setenv "OUTPUT_DIR" lib)
1957 (with-directory-excursion "src"
1958 (zero? (system* "bash" "build.sh"))))))
1959 (add-after 'install 'install-native
1960 (lambda* (#:key outputs #:allow-other-keys)
1961 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
1962 (for-each (lambda (file)
1963 (install-file file lib))
1964 (find-files "." "\\.so$"))
1965 #t))))))
1966 (inputs
1967 `(("xulrunner" ,icecat)
1968 ("gtk" ,gtk+-2)
1969 ("libxtst" ,libxtst)
1970 ("libxt" ,libxt)
1971 ("mesa" ,mesa)
1972 ("glu" ,glu)))
1973 (native-inputs
1974 `(("pkg-config" ,pkg-config)
1975 ("unzip" ,unzip)))
1976 (home-page "https://www.eclipse.org/swt/")
1977 (synopsis "Widget toolkit for Java")
1978 (description
1979 "SWT is a widget toolkit for Java designed to provide efficient, portable
1980access to the user-interface facilities of the operating systems on which it
1981is implemented.")
1982 ;; SWT code is licensed under EPL1.0
1983 ;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
1984 ;; Cairo bindings contain code under MPL1.1
1985 ;; XULRunner 1.9 bindings contain code under MPL2.0
1986 (license (list
1987 license:epl1.0
1988 license:mpl1.1
1989 license:mpl2.0
1990 license:lgpl2.1+))))
1991
068e476f
RJ
1992(define-public java-xz
1993 (package
1994 (name "java-xz")
92966847 1995 (version "1.6")
068e476f
RJ
1996 (source (origin
1997 (method url-fetch)
1998 (uri (string-append "http://tukaani.org/xz/xz-java-" version ".zip"))
1999 (sha256
2000 (base32
92966847 2001 "1z3p1ri1gvl07inxn0agx44ck8n7wrzfmvkz8nbq3njn8r9wba8x"))))
068e476f
RJ
2002 (build-system ant-build-system)
2003 (arguments
2004 `(#:tests? #f ; There are no tests to run.
2005 #:jar-name ,(string-append "xz-" version ".jar")
2006 #:phases
2007 (modify-phases %standard-phases
2008 ;; The unpack phase enters the "maven" directory by accident.
2009 (add-after 'unpack 'chdir
2010 (lambda _ (chdir "..") #t)))))
2011 (native-inputs
2012 `(("unzip" ,unzip)))
2013 (home-page "http://tukaani.org/xz/java.html")
2014 (synopsis "Implementation of XZ data compression in pure Java")
2015 (description "This library aims to be a complete implementation of XZ data
2016compression in pure Java. Single-threaded streamed compression and
2017decompression and random access decompression have been fully implemented.")
2018 (license license:public-domain)))
04100c3b
RW
2019
2020;; java-hamcrest-core uses qdox version 1.12. We package this version instead
2021;; of the latest release.
2022(define-public java-qdox-1.12
2023 (package
2024 (name "java-qdox")
2025 (version "1.12.1")
2026 (source (origin
2027 (method url-fetch)
2028 (uri (string-append "http://central.maven.org/maven2/"
2029 "com/thoughtworks/qdox/qdox/" version
2030 "/qdox-" version "-sources.jar"))
2031 (sha256
2032 (base32
2033 "0hlfbqq2avf5s26wxkksqmkdyk6zp9ggqn37c468m96mjv0n9xfl"))))
2034 (build-system ant-build-system)
2035 (arguments
2036 `(;; Tests require junit
2037 #:tests? #f
2038 #:jar-name "qdox.jar"
2039 #:phases
2040 (modify-phases %standard-phases
2041 (replace 'unpack
2042 (lambda* (#:key source #:allow-other-keys)
2043 (mkdir "src")
2044 (with-directory-excursion "src"
2045 (zero? (system* "jar" "-xf" source)))))
2046 ;; At this point we don't have junit, so we must remove the API
2047 ;; tests.
2048 (add-after 'unpack 'delete-tests
2049 (lambda _
2050 (delete-file-recursively "src/com/thoughtworks/qdox/junit")
2051 #t)))))
2052 (home-page "http://qdox.codehaus.org/")
2053 (synopsis "Parse definitions from Java source files")
2054 (description
2055 "QDox is a high speed, small footprint parser for extracting
2056class/interface/method definitions from source files complete with JavaDoc
b13cf17f 2057@code{@@tags}. It is designed to be used by active code generators or
04100c3b
RW
2058documentation tools.")
2059 (license license:asl2.0)))
e7e28510
RW
2060
2061(define-public java-jarjar
2062 (package
2063 (name "java-jarjar")
2064 (version "1.4")
2065 (source (origin
2066 (method url-fetch)
2067 (uri (string-append
2068 "https://storage.googleapis.com/google-code-archive-downloads/v2/"
2069 "code.google.com/jarjar/jarjar-src-" version ".zip"))
2070 (sha256
2071 (base32
2072 "1v8irhni9cndcw1l1wxqgry013s2kpj0qqn57lj2ji28xjq8ndjl"))))
2073 (build-system ant-build-system)
2074 (arguments
2075 `(;; Tests require junit, which ultimately depends on this package.
2076 #:tests? #f
2077 #:build-target "jar"
2078 #:phases
2079 (modify-phases %standard-phases
2080 (replace 'install
2081 (lambda* (#:key outputs #:allow-other-keys)
2082 (let ((target (string-append (assoc-ref outputs "out")
2083 "/share/java")))
2084 (install-file (string-append "dist/jarjar-" ,version ".jar")
2085 target))
2086 #t)))))
2087 (native-inputs
2088 `(("unzip" ,unzip)))
2089 (home-page "https://code.google.com/archive/p/jarjar/")
2090 (synopsis "Repackage Java libraries")
2091 (description
2092 "Jar Jar Links is a utility that makes it easy to repackage Java
2093libraries and embed them into your own distribution. Jar Jar Links includes
2094an Ant task that extends the built-in @code{jar} task.")
2095 (license license:asl2.0)))
87c31a21
RW
2096
2097(define-public java-hamcrest-core
2098 (package
2099 (name "java-hamcrest-core")
2100 (version "1.3")
2101 (source (origin
2102 (method url-fetch)
00672896
HG
2103 (uri (string-append "https://github.com/hamcrest/JavaHamcrest/"
2104 "archive/hamcrest-java-" version ".tar.gz"))
87c31a21
RW
2105 (sha256
2106 (base32
00672896 2107 "11g0s105fmwzijbv08lx8jlb521yravjmxnpgdx08fvg1kjivhva"))
87c31a21
RW
2108 (modules '((guix build utils)))
2109 (snippet
2110 '(begin
00672896
HG
2111 ;; Delete bundled thirds-party jar archives.
2112 (delete-file-recursively "lib")
87c31a21
RW
2113 #t))))
2114 (build-system ant-build-system)
2115 (arguments
2116 `(#:tests? #f ; Tests require junit
a8d3cb62
RW
2117 #:modules ((guix build ant-build-system)
2118 (guix build utils)
2119 (srfi srfi-1))
87c31a21 2120 #:make-flags (list (string-append "-Dversion=" ,version))
fae0b4ca 2121 #:test-target "unit-test"
87c31a21
RW
2122 #:build-target "core"
2123 #:phases
2124 (modify-phases %standard-phases
2125 ;; Disable unit tests, because they require junit, which requires
2126 ;; hamcrest-core. We also give a fixed value to the "Built-Date"
2127 ;; attribute from the manifest for reproducibility.
2128 (add-before 'configure 'patch-build.xml
2129 (lambda _
2130 (substitute* "build.xml"
2131 (("unit-test, ") "")
2132 (("\\$\\{build.timestamp\\}") "guix"))
2133 #t))
2134 ;; Java's "getMethods()" returns methods in an unpredictable order.
2135 ;; To make the output of the generated code deterministic we must
2136 ;; sort the array of methods.
2137 (add-after 'unpack 'make-method-order-deterministic
2138 (lambda _
2139 (substitute* "hamcrest-generator/src/main/java/org/hamcrest/generator/ReflectiveFactoryReader.java"
2140 (("import java\\.util\\.Iterator;" line)
2141 (string-append line "\n"
2142 "import java.util.Arrays; import java.util.Comparator;"))
2143 (("allMethods = cls\\.getMethods\\(\\);" line)
2144 (string-append "_" line
2145 "
2146private Method[] getSortedMethods() {
2147 Arrays.sort(_allMethods, new Comparator<Method>() {
2148 @Override
2149 public int compare(Method a, Method b) {
2150 return a.toString().compareTo(b.toString());
2151 }
2152 });
2153 return _allMethods;
2154}
2155
2156private Method[] allMethods = getSortedMethods();")))))
2157 (add-before 'build 'do-not-use-bundled-qdox
2158 (lambda* (#:key inputs #:allow-other-keys)
2159 (substitute* "build.xml"
2160 (("lib/generator/qdox-1.12.jar")
2161 (string-append (assoc-ref inputs "java-qdox-1.12")
2162 "/share/java/qdox.jar")))
2163 #t))
fab959d3
HG
2164 ;; build.xml searches for .jar files in this directoy, which
2165 ;; we remove from the source archive.
2166 (add-before 'build 'create-dummy-directories
2167 (lambda _
2168 (mkdir-p "lib/integration")
2169 #t))
87c31a21
RW
2170 (replace 'install
2171 (lambda* (#:key outputs #:allow-other-keys)
a8d3cb62
RW
2172 (let* ((target (string-append (assoc-ref outputs "out")
2173 "/share/java/"))
2174 (version-suffix ,(string-append "-" version ".jar"))
2175 (install-without-version-suffix
2176 (lambda (jar)
2177 (copy-file jar
2178 (string-append target
2179 (basename jar version-suffix)
2180 ".jar")))))
2181 (mkdir-p target)
2182 (for-each
2183 install-without-version-suffix
2184 (find-files "build"
2185 (lambda (name _)
2186 (and (string-suffix? ".jar" name)
2187 (not (string-suffix? "-sources.jar" name)))))))
2188 #t)))))
87c31a21
RW
2189 (native-inputs
2190 `(("java-qdox-1.12" ,java-qdox-1.12)
2191 ("java-jarjar" ,java-jarjar)))
2192 (home-page "http://hamcrest.org/")
2193 (synopsis "Library of matchers for building test expressions")
2194 (description
2195 "This package provides a library of matcher objects (also known as
2196constraints or predicates) allowing @code{match} rules to be defined
2197declaratively, to be used in other frameworks. Typical scenarios include
2198testing frameworks, mocking libraries and UI validation rules.")
2199 (license license:bsd-2)))
d0184f44
RW
2200
2201(define-public java-junit
2202 (package
2203 (name "java-junit")
2204 (version "4.12")
2205 (source (origin
2206 (method url-fetch)
2207 (uri (string-append "https://github.com/junit-team/junit/"
2208 "archive/r" version ".tar.gz"))
2209 (file-name (string-append name "-" version ".tar.gz"))
2210 (sha256
2211 (base32
2212 "090dn5v1vs0b3acyaqc0gjf6p8lmd2h24wfzsbq7sly6b214anws"))
2213 (modules '((guix build utils)))
2214 (snippet
2215 '(begin
2216 ;; Delete bundled jar archives.
2217 (delete-file-recursively "lib")
2218 #t))))
2219 (build-system ant-build-system)
2220 (arguments
2221 `(#:tests? #f ; no tests
2222 #:jar-name "junit.jar"))
2223 (inputs
2224 `(("java-hamcrest-core" ,java-hamcrest-core)))
2225 (home-page "http://junit.org/")
2226 (synopsis "Test framework for Java")
2227 (description
2228 "JUnit is a simple framework to write repeatable tests for Java projects.
2229JUnit provides assertions for testing expected results, test fixtures for
2230sharing common test data, and test runners for running tests.")
2231 (license license:epl1.0)))
9fb20d01
RW
2232
2233(define-public java-plexus-utils
2234 (package
2235 (name "java-plexus-utils")
2236 (version "3.0.24")
2237 (source (origin
2238 (method url-fetch)
2239 (uri (string-append "https://github.com/codehaus-plexus/"
2240 "plexus-utils/archive/plexus-utils-"
2241 version ".tar.gz"))
2242 (sha256
2243 (base32
2244 "1mlwpc6fms24slygv5yvi6fi9hcha2fh0v73p5znpi78bg36i2js"))))
2245 (build-system ant-build-system)
2246 ;; FIXME: The default build.xml does not include a target to install
2247 ;; javadoc files.
2248 (arguments
2249 `(#:jar-name "plexus-utils.jar"
2250 #:source-dir "src/main"
2251 #:phases
2252 (modify-phases %standard-phases
2253 (add-after 'unpack 'fix-reference-to-/bin-and-/usr
2254 (lambda _
2255 (substitute* "src/main/java/org/codehaus/plexus/util/\
2256cli/shell/BourneShell.java"
2257 (("/bin/sh") (which "sh"))
2258 (("/usr/") (getcwd)))
2259 #t))
2260 (add-after 'unpack 'fix-or-disable-broken-tests
2261 (lambda _
2262 (with-directory-excursion "src/test/java/org/codehaus/plexus/util"
2263 (substitute* '("cli/CommandlineTest.java"
2264 "cli/shell/BourneShellTest.java")
2265 (("/bin/sh") (which "sh"))
2266 (("/bin/echo") (which "echo")))
2267
2268 ;; This test depends on MavenProjectStub, but we don't have
2269 ;; a package for Maven.
2270 (delete-file "introspection/ReflectionValueExtractorTest.java")
2271
2272 ;; FIXME: The command line tests fail, maybe because they use
2273 ;; absolute paths.
2274 (delete-file "cli/CommandlineTest.java"))
2275 #t)))))
2276 (native-inputs
2277 `(("java-junit" ,java-junit)))
2278 (home-page "http://codehaus-plexus.github.io/plexus-utils/")
2279 (synopsis "Common utilities for the Plexus framework")
2280 (description "This package provides various Java utility classes for the
2281Plexus framework to ease working with strings, files, command lines, XML and
2282more.")
2283 (license license:asl2.0)))
1e555562
HG
2284
2285(define-public java-plexus-interpolation
2286 (package
2287 (name "java-plexus-interpolation")
2288 (version "1.23")
2289 (source (origin
2290 (method url-fetch)
2291 (uri (string-append "https://github.com/codehaus-plexus/"
2292 "plexus-interpolation/archive/"
2293 "plexus-interpolation-" version ".tar.gz"))
2294 (sha256
2295 (base32
2296 "1w79ljwk42ymrgy8kqxq4l82pgdj6287gabpfnpkyzbrnclsnfrp"))))
2297 (build-system ant-build-system)
2298 (arguments
2299 `(#:jar-name "plexus-interpolation.jar"
2300 #:source-dir "src/main"))
2301 (native-inputs
2302 `(("java-junit" ,java-junit)
2303 ("java-hamcrest-core" ,java-hamcrest-core)))
2304 (home-page "http://codehaus-plexus.github.io/plexus-interpolation/")
2305 (synopsis "Java components for interpolating ${} strings and the like")
2306 (description "Plexus interpolator is a modular, flexible interpolation
2307framework for the expression language style commonly seen in Maven, Plexus,
2308and other related projects.
2309
2310It has its foundation in the @code{org.codehaus.plexus.utils.interpolation}
2311package within @code{plexus-utils}, but has been separated in order to allow
2312these two libraries to vary independently of one another.")
2313 (license license:asl2.0)))
8f8ed9aa
RW
2314
2315(define-public java-asm
2316 (package
2317 (name "java-asm")
2318 (version "5.2")
2319 (source (origin
2320 (method url-fetch)
2321 (uri (string-append "http://download.forge.ow2.org/asm/"
2322 "asm-" version ".tar.gz"))
2323 (sha256
2324 (base32
2325 "0kxvmv5275rnjl7jv0442k3wjnq03ngkb7sghs78avf45pzm4qgr"))))
2326 (build-system ant-build-system)
2327 (arguments
2328 `(#:build-target "compile"
2329 ;; The tests require an old version of Janino, which no longer compiles
2330 ;; with the JDK7.
2331 #:tests? #f
2332 ;; We don't need these extra ant tasks, but the build system asks us to
2333 ;; provide a path anyway.
2334 #:make-flags (list (string-append "-Dobjectweb.ant.tasks.path=foo"))
2335 #:phases
2336 (modify-phases %standard-phases
2337 (add-before 'install 'build-jars
2338 (lambda* (#:key make-flags #:allow-other-keys)
2339 ;; We cannot use the "jar" target because it depends on a couple
2340 ;; of unpackaged, complicated tools.
2341 (mkdir "dist")
2342 (zero? (system* "jar"
2343 "-cf" (string-append "dist/asm-" ,version ".jar")
2344 "-C" "output/build/tmp" "."))))
2345 (replace 'install
2346 (install-jars "dist")))))
2347 (native-inputs
2348 `(("java-junit" ,java-junit)))
2349 (home-page "http://asm.ow2.org/")
2350 (synopsis "Very small and fast Java bytecode manipulation framework")
2351 (description "ASM is an all purpose Java bytecode manipulation and
2352analysis framework. It can be used to modify existing classes or dynamically
2353generate classes, directly in binary form. The provided common
2354transformations and analysis algorithms allow to easily assemble custom
2355complex transformations and code analysis tools.")
2356 (license license:bsd-3)))
607fe24a
RW
2357
2358(define-public java-cglib
2359 (package
2360 (name "java-cglib")
2361 (version "3.2.4")
2362 (source (origin
2363 (method url-fetch)
2364 (uri (string-append
2365 "https://github.com/cglib/cglib/archive/RELEASE_"
2366 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
2367 ".tar.gz"))
2368 (file-name (string-append "cglib-" version ".tar.gz"))
2369 (sha256
2370 (base32
2371 "162dvd4fln76ai8prfharf66pn6r56p3sxx683j5vdyccrd5hi1q"))))
2372 (build-system ant-build-system)
2373 (arguments
2374 `(;; FIXME: tests fail because junit runs
2375 ;; "net.sf.cglib.transform.AbstractTransformTest", which does not seem
2376 ;; to describe a test at all.
2377 #:tests? #f
2378 #:jar-name "cglib.jar"
2379 #:phases
2380 (modify-phases %standard-phases
2381 (add-after 'unpack 'chdir
2382 (lambda _ (chdir "cglib") #t)))))
2383 (inputs
2384 `(("java-asm" ,java-asm)
2385 ("java-junit" ,java-junit)))
2386 (home-page "https://github.com/cglib/cglib/")
2387 (synopsis "Java byte code generation library")
2388 (description "The byte code generation library CGLIB is a high level API
2389to generate and transform Java byte code.")
2390 (license license:asl2.0)))
33e34bfe
RW
2391
2392(define-public java-objenesis
2393 (package
2394 (name "java-objenesis")
2395 (version "2.5.1")
2396 (source (origin
2397 (method url-fetch)
2398 (uri (string-append "https://github.com/easymock/objenesis/"
2399 "archive/" version ".tar.gz"))
2400 (file-name (string-append "objenesis-" version ".tar.gz"))
2401 (sha256
2402 (base32
2403 "1va5qz1i2wawwavhnxfzxnfgrcaflz9p1pg03irrjh4nd3rz8wh6"))))
2404 (build-system ant-build-system)
2405 (arguments
2406 `(#:jar-name "objenesis.jar"
2407 #:source-dir "main/src/"
2408 #:test-dir "main/src/test/"))
2409 (native-inputs
2410 `(("java-junit" ,java-junit)
2411 ("java-hamcrest-core" ,java-hamcrest-core)))
2412 (home-page "http://objenesis.org/")
2413 (synopsis "Bypass the constructor when creating an object")
2414 (description "Objenesis is a small Java library that serves one purpose:
2415to instantiate a new object of a particular class. It is common to see
2416restrictions in libraries stating that classes must require a default
2417constructor. Objenesis aims to overcome these restrictions by bypassing the
2418constructor on object instantiation.")
2419 (license license:asl2.0)))
ae589876
RW
2420
2421(define-public java-easymock
2422 (package
2423 (name "java-easymock")
2424 (version "3.4")
2425 (source (origin
2426 (method url-fetch)
2427 (uri (string-append "https://github.com/easymock/easymock/"
2428 "archive/easymock-" version ".tar.gz"))
2429 (sha256
2430 (base32
2431 "1yzg0kv256ndr57gpav46cyv4a1ns5sj722l50zpxk3j6sk9hnmi"))))
2432 (build-system ant-build-system)
2433 (arguments
2434 `(#:jar-name "easymock.jar"
2435 #:source-dir "core/src/main"
2436 #:test-dir "core/src/test"
2437 #:phases
2438 (modify-phases %standard-phases
2439 ;; FIXME: Android support requires the following packages to be
2440 ;; available: com.google.dexmaker.stock.ProxyBuilder
2441 (add-after 'unpack 'delete-android-support
2442 (lambda _
2443 (with-directory-excursion "core/src/main/java/org/easymock/internal"
2444 (substitute* "MocksControl.java"
2445 (("AndroidSupport.isAndroid\\(\\)") "false")
2446 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
2447 (delete-file "AndroidClassProxyFactory.java"))
2448 #t))
2449 (add-after 'unpack 'delete-broken-tests
2450 (lambda _
2451 (with-directory-excursion "core/src/test/java/org/easymock"
2452 ;; This test depends on dexmaker.
2453 (delete-file "tests2/ClassExtensionHelperTest.java")
2454
2455 ;; This is not a test.
2456 (delete-file "tests/BaseEasyMockRunnerTest.java")
2457
2458 ;; This test should be executed with a different runner...
2459 (delete-file "tests2/EasyMockAnnotationsTest.java")
2460 ;; ...but deleting it means that we also have to delete these
2461 ;; dependent files.
2462 (delete-file "tests2/EasyMockRunnerTest.java")
2463 (delete-file "tests2/EasyMockRuleTest.java")
2464
2465 ;; This test fails because the file "easymock.properties" does
2466 ;; not exist.
2467 (delete-file "tests2/EasyMockPropertiesTest.java"))
2468 #t)))))
2469 (inputs
2470 `(("java-asm" ,java-asm)
2471 ("java-cglib" ,java-cglib)
2472 ("java-objenesis" ,java-objenesis)))
2473 (native-inputs
2474 `(("java-junit" ,java-junit)
2475 ("java-hamcrest-core" ,java-hamcrest-core)))
2476 (home-page "http://easymock.org")
2477 (synopsis "Java library providing mock objects for unit tests")
2478 (description "EasyMock is a Java library that provides an easy way to use
2479mock objects in unit testing.")
2480 (license license:asl2.0)))
7aa37023 2481
f12ad6c7
RW
2482(define-public java-jmock-1
2483 (package
2484 (name "java-jmock")
2485 (version "1.2.0")
2486 (source (origin
2487 (method url-fetch)
2488 (uri (string-append "https://github.com/jmock-developers/"
2489 "jmock-library/archive/" version ".tar.gz"))
2490 (file-name (string-append "jmock-" version ".tar.gz"))
2491 (sha256
2492 (base32
2493 "0xmrlhq0fszldkbv281k9463mv496143vvmqwpxp62yzjvdkx9w0"))))
2494 (build-system ant-build-system)
2495 (arguments
2496 `(#:build-target "jars"
2497 #:test-target "run.tests"
2498 #:phases
2499 (modify-phases %standard-phases
2500 (replace 'install (install-jars "build")))))
2501 (home-page "http://www.jmock.org")
2502 (synopsis "Mock object library for test-driven development")
2503 (description "JMock is a library that supports test-driven development of
2504Java code with mock objects. Mock objects help you design and test the
2505interactions between the objects in your programs.
2506
2507The jMock library
2508
2509@itemize
2510@item makes it quick and easy to define mock objects
2511@item lets you precisely specify the interactions between
2512 your objects, reducing the brittleness of your tests
2513@item plugs into your favourite test framework
2514@item is easy to extend.
2515@end itemize\n")
2516 (license license:bsd-3)))
2517
439c59da
RW
2518(define-public java-hamcrest-all
2519 (package (inherit java-hamcrest-core)
2520 (name "java-hamcrest-all")
2521 (arguments
2522 (substitute-keyword-arguments (package-arguments java-hamcrest-core)
2523 ;; FIXME: a unit test fails because org.hamcrest.SelfDescribing is not
2524 ;; found, although it is part of the hamcrest-core library that has
2525 ;; just been built.
2526 ;;
2527 ;; Fixing this one test is insufficient, though, and upstream confirmed
2528 ;; that the latest hamcrest release fails its unit tests when built
2529 ;; with Java 7. See https://github.com/hamcrest/JavaHamcrest/issues/30
2530 ((#:tests? _) #f)
2531 ((#:build-target _) "bigjar")
2532 ((#:phases phases)
2533 `(modify-phases ,phases
2534 ;; Some build targets override the classpath, so we need to patch
2535 ;; the build.xml to ensure that required dependencies are on the
2536 ;; classpath.
2537 (add-after 'unpack 'patch-classpath-for-integration
2538 (lambda* (#:key inputs #:allow-other-keys)
2539 (substitute* "build.xml"
2540 ((" build/hamcrest-library-\\$\\{version\\}.jar" line)
2541 (string-join
2542 (cons line
2543 (append
2544 (find-files (assoc-ref inputs "java-hamcrest-core") "\\.jar$")
2545 (find-files (assoc-ref inputs "java-junit") "\\.jar$")
2546 (find-files (assoc-ref inputs "java-jmock") "\\.jar$")
2547 (find-files (assoc-ref inputs "java-easymock") "\\.jar$")))
2548 ";")))
2549 #t))))))
2550 (inputs
2551 `(("java-junit" ,java-junit)
2552 ("java-jmock" ,java-jmock-1)
2553 ("java-easymock" ,java-easymock)
2554 ("java-hamcrest-core" ,java-hamcrest-core)
2555 ,@(package-inputs java-hamcrest-core)))))
2556
7aa37023
RW
2557(define-public java-jopt-simple
2558 (package
2559 (name "java-jopt-simple")
2560 (version "5.0.3")
2561 (source (origin
2562 (method url-fetch)
2563 (uri (string-append "http://repo1.maven.org/maven2/"
2564 "net/sf/jopt-simple/jopt-simple/"
2565 version "/jopt-simple-"
2566 version "-sources.jar"))
2567 (sha256
2568 (base32
2569 "1v8bzmwmw6qq20gm42xyay6vrd567dra4vqwhgjnqqjz1gs9f8qa"))))
2570 (build-system ant-build-system)
2571 (arguments
2572 `(#:tests? #f ; there are no tests
2573 #:jar-name "jopt-simple.jar"))
2574 (home-page "https://pholser.github.io/jopt-simple/")
2575 (synopsis "Java library for parsing command line options")
2576 (description "JOpt Simple is a Java library for parsing command line
2577options, such as those you might pass to an invocation of @code{javac}. In
2578the interest of striving for simplicity, as closely as possible JOpt Simple
2579attempts to honor the command line option syntaxes of POSIX @code{getopt} and
2580GNU @code{getopt_long}. It also aims to make option parser configuration and
2581retrieval of options and their arguments simple and expressive, without being
2582overly clever.")
2583 (license license:expat)))
840969e8
RW
2584
2585(define-public java-commons-math3
2586 (package
2587 (name "java-commons-math3")
2588 (version "3.6.1")
2589 (source (origin
2590 (method url-fetch)
2591 (uri (string-append "mirror://apache/commons/math/source/"
2592 "commons-math3-" version "-src.tar.gz"))
2593 (sha256
2594 (base32
2595 "19l6yp44qc5g7wg816nbn5z3zq3xxzwimvbm4a8pczgvpi4i85s6"))))
2596 (build-system ant-build-system)
2597 (arguments
2598 `(#:build-target "jar"
2599 #:test-target "test"
2600 #:make-flags
2601 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
2602 (junit (assoc-ref %build-inputs "java-junit")))
2603 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
2604 (string-append "-Dhamcrest.jar=" hamcrest
2605 "/share/java/hamcrest-core.jar")))
2606 #:phases
2607 (modify-phases %standard-phases
2608 ;; We want to build the jar in the build phase and run the tests
2609 ;; later in a separate phase.
2610 (add-after 'unpack 'untangle-targets
2611 (lambda _
2612 (substitute* "build.xml"
2613 (("name=\"jar\" depends=\"test\"")
2614 "name=\"jar\" depends=\"compile\""))
2615 #t))
2616 ;; There is no install target.
2617 (replace 'install
2618 (install-jars "target")))))
2619 (native-inputs
2620 `(("java-junit" ,java-junit)
2621 ("java-hamcrest-core" ,java-hamcrest-core)))
2622 (home-page "http://commons.apache.org/math/")
2623 (synopsis "Apache Commons mathematics library")
2624 (description "Commons Math is a library of lightweight, self-contained
2625mathematics and statistics components addressing the most common problems not
2626available in the Java programming language or Commons Lang.")
2627 (license license:asl2.0)))
62c9bfaa
RW
2628
2629(define-public java-jmh
2630 (package
2631 (name "java-jmh")
2632 (version "1.17.5")
2633 (source (origin
2634 (method hg-fetch)
2635 (uri (hg-reference
2636 (url "http://hg.openjdk.java.net/code-tools/jmh/")
2637 (changeset version)))
2638 (file-name (string-append name "-" version "-checkout"))
2639 (sha256
2640 (base32
2641 "1fxyxhg9famwcg1prc4cgwb5wzyxqavn3cjm5vz8605xz7x5k084"))))
2642 (build-system ant-build-system)
2643 (arguments
2644 `(#:jar-name "jmh-core.jar"
2645 #:source-dir "jmh-core/src/main"
2646 #:test-dir "jmh-core/src/test"
2647 #:phases
2648 (modify-phases %standard-phases
2649 ;; This seems to be a bug in the JDK. It may not be necessary in
2650 ;; future versions of the JDK.
2651 (add-after 'unpack 'fix-bug
2652 (lambda _
2653 (with-directory-excursion
2654 "jmh-core/src/main/java/org/openjdk/jmh/runner/options"
2655 (substitute* '("IntegerValueConverter.java"
2656 "ThreadsValueConverter.java")
2657 (("public Class<Integer> valueType")
2658 "public Class<? extends Integer> valueType")))
2659 #t)))))
2660 (inputs
2661 `(("java-jopt-simple" ,java-jopt-simple)
2662 ("java-commons-math3" ,java-commons-math3)))
2663 (native-inputs
2664 `(("java-junit" ,java-junit)
2665 ("java-hamcrest-core" ,java-hamcrest-core)))
2666 (home-page "http://openjdk.java.net/projects/code-tools/jmh/")
2667 (synopsis "Benchmark harness for the JVM")
2668 (description "JMH is a Java harness for building, running, and analysing
2669nano/micro/milli/macro benchmarks written in Java and other languages
2670targetting the JVM.")
2671 ;; GPLv2 only
2672 (license license:gpl2)))
56ebb4e9
RW
2673
2674(define-public java-commons-collections4
2675 (package
2676 (name "java-commons-collections4")
2677 (version "4.1")
2678 (source (origin
2679 (method url-fetch)
2680 (uri (string-append "mirror://apache/commons/collections/source/"
2681 "commons-collections4-" version "-src.tar.gz"))
2682 (sha256
2683 (base32
2684 "1krfhvggympq4avk7gh6qafzf6b9ip6r1m4lmacikyx04039m0wl"))))
2685 (build-system ant-build-system)
2686 (arguments
2687 `(#:test-target "test"
2688 #:make-flags
2689 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
2690 (junit (assoc-ref %build-inputs "java-junit"))
2691 (easymock (assoc-ref %build-inputs "java-easymock")))
2692 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
2693 (string-append "-Dhamcrest.jar=" hamcrest
2694 "/share/java/hamcrest-core.jar")
2695 (string-append "-Deasymock.jar=" easymock
2696 "/share/java/easymock.jar")))
2697 #:phases
2698 (modify-phases %standard-phases
2699 (replace 'install
2700 (install-jars "target")))))
2701 (native-inputs
2702 `(("java-junit" ,java-junit)
2703 ("java-hamcrest-core" ,java-hamcrest-core)
2704 ("java-easymock" ,java-easymock)))
2705 (home-page "http://commons.apache.org/collections/")
2706 (synopsis "Collections framework")
2707 (description "The Java Collections Framework is the recognised standard
2708for collection handling in Java. Commons-Collections seek to build upon the
2709JDK classes by providing new interfaces, implementations and utilities. There
2710are many features, including:
2711
2712@itemize
2713@item @code{Bag} interface for collections that have a number of copies of
2714 each object
2715@item @code{BidiMap} interface for maps that can be looked up from value to
2716 key as well and key to value
2717@item @code{MapIterator} interface to provide simple and quick iteration over
2718 maps
2719@item Transforming decorators that alter each object as it is added to the
2720 collection
2721@item Composite collections that make multiple collections look like one
2722@item Ordered maps and sets that retain the order elements are added in,
2723 including an LRU based map
2724@item Reference map that allows keys and/or values to be garbage collected
2725 under close control
2726@item Many comparator implementations
2727@item Many iterator implementations
2728@item Adapter classes from array and enumerations to collections
2729@item Utilities to test or create typical set-theory properties of collections
2730 such as union, intersection, and closure.
2731@end itemize\n")
2732 (license license:asl2.0)))
6af63e65
HG
2733
2734(define-public java-commons-io
2735 (package
2736 (name "java-commons-io")
2737 (version "2.5")
2738 (source
2739 (origin
2740 (method url-fetch)
2741 (uri (string-append "mirror://apache/commons/io/source/"
2742 "commons-io-" version "-src.tar.gz"))
2743 (sha256
2744 (base32
2745 "0q5y41jrcjvx9hzs47x5kdhnasdy6rm4bzqd2jxl02w717m7a7v3"))))
2746 (build-system ant-build-system)
2747 (outputs '("out" "doc"))
2748 (arguments
2749 `(#:test-target "test"
2750 #:make-flags
2751 (list (string-append "-Djunit.jar="
2752 (assoc-ref %build-inputs "java-junit")
2753 "/share/java/junit.jar"))
2754 #:phases
2755 (modify-phases %standard-phases
2756 (add-after 'build 'build-javadoc ant-build-javadoc)
2757 (replace 'install (install-jars "target"))
2758 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
2759 (native-inputs
2760 `(("java-junit" ,java-junit)
2761 ("java-hamcrest-core" ,java-hamcrest-core)))
2762 (home-page "http://commons.apache.org/io/")
2763 (synopsis "Common useful IO related classes")
2764 (description "Commons-IO contains utility classes, stream implementations,
2765file filters and endian classes.")
2766 (license license:asl2.0)))
d631b5f3
HG
2767
2768(define-public java-commons-lang
2769 (package
2770 (name "java-commons-lang")
2771 (version "2.6")
2772 (source
2773 (origin
2774 (method url-fetch)
2775 (uri (string-append "mirror://apache/commons/lang/source/"
2776 "commons-lang-" version "-src.tar.gz"))
2777 (sha256
2778 (base32 "1mxwagqadzx1b2al7i0z1v0r235aj2njdyijf02szq0vhmqrfiq5"))))
2779 (build-system ant-build-system)
2780 (outputs '("out" "doc"))
2781 (arguments
2782 `(#:test-target "test"
2783 #:phases
2784 (modify-phases %standard-phases
2785 (add-after 'build 'build-javadoc ant-build-javadoc)
2786 (add-before 'check 'disable-failing-test
2787 (lambda _
2788 ;; Disable a failing test
2789 (substitute* "src/test/java/org/apache/commons/lang/\
2790time/FastDateFormatTest.java"
2791 (("public void testFormat\\(\\)")
2792 "public void disabled_testFormat()"))
2793 #t))
2794 (replace 'install (install-jars "target"))
2795 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
2796 (native-inputs
2797 `(("java-junit" ,java-junit)))
2798 (home-page "http://commons.apache.org/lang/")
2799 (synopsis "Extension of the java.lang package")
2800 (description "The Commons Lang components contains a set of Java classes
2801that provide helper methods for standard Java classes, especially those found
2802in the @code{java.lang} package in the Sun JDK. The following classes are
2803included:
2804
2805@itemize
2806@item StringUtils - Helper for @code{java.lang.String}.
2807@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets
2808 of characters such as @code{[a-z]} and @code{[abcdez]}.
2809@item RandomStringUtils - Helper for creating randomised strings.
2810@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
2811@item NumberRange - A range of numbers with an upper and lower bound.
2812@item ObjectUtils - Helper for @code{java.lang.Object}.
2813@item SerializationUtils - Helper for serializing objects.
2814@item SystemUtils - Utility class defining the Java system properties.
2815@item NestedException package - A sub-package for the creation of nested
2816 exceptions.
2817@item Enum package - A sub-package for the creation of enumerated types.
2818@item Builder package - A sub-package for the creation of @code{equals},
2819 @code{hashCode}, @code{compareTo} and @code{toString} methods.
2820@end itemize\n")
2821 (license license:asl2.0)))
82e18864
HG
2822
2823(define-public java-commons-lang3
2824 (package
2825 (name "java-commons-lang3")
2826 (version "3.4")
2827 (source
2828 (origin
2829 (method url-fetch)
2830 (uri (string-append "mirror://apache/commons/lang/source/"
2831 "commons-lang3-" version "-src.tar.gz"))
2832 (sha256
2833 (base32 "0xpshb9spjhplq5a7mr0y1bgfw8190ik4xj8f569xidfcki1d6kg"))))
2834 (build-system ant-build-system)
2835 (outputs '("out" "doc"))
2836 (arguments
2837 `(#:test-target "test"
2838 #:make-flags
2839 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-all"))
2840 (junit (assoc-ref %build-inputs "java-junit"))
2841 (easymock (assoc-ref %build-inputs "java-easymock"))
2842 (io (assoc-ref %build-inputs "java-commons-io")))
2843 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
2844 (string-append "-Dhamcrest.jar=" hamcrest
2845 "/share/java/hamcrest-all.jar")
2846 (string-append "-Dcommons-io.jar=" io
2847 "/share/java/commons-io-"
2848 ,(package-version java-commons-io)
2849 "-SNAPSHOT.jar")
2850 (string-append "-Deasymock.jar=" easymock
2851 "/share/java/easymock.jar")))
2852 #:phases
2853 (modify-phases %standard-phases
2854 (add-after 'build 'build-javadoc ant-build-javadoc)
2855 (replace 'install (install-jars "target"))
2856 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
2857 (native-inputs
2858 `(("java-junit" ,java-junit)
2859 ("java-commons-io" ,java-commons-io)
2860 ("java-hamcrest-all" ,java-hamcrest-all)
2861 ("java-easymock" ,java-easymock)))
2862 (home-page "http://commons.apache.org/lang/")
2863 (synopsis "Extension of the java.lang package")
2864 (description "The Commons Lang components contains a set of Java classes
2865that provide helper methods for standard Java classes, especially those found
2866in the @code{java.lang} package. The following classes are included:
2867
2868@itemize
2869@item StringUtils - Helper for @code{java.lang.String}.
2870@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets of
2871 characters such as @code{[a-z]} and @code{[abcdez]}.
2872@item RandomStringUtils - Helper for creating randomised strings.
2873@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
2874@item NumberRange - A range of numbers with an upper and lower bound.
2875@item ObjectUtils - Helper for @code{java.lang.Object}.
2876@item SerializationUtils - Helper for serializing objects.
2877@item SystemUtils - Utility class defining the Java system properties.
2878@item NestedException package - A sub-package for the creation of nested
2879 exceptions.
2880@item Enum package - A sub-package for the creation of enumerated types.
2881@item Builder package - A sub-package for the creation of @code{equals},
2882 @code{hashCode}, @code{compareTo} and @code{toString} methods.
2883@end itemize\n")
2884 (license license:asl2.0)))
1c188f4e 2885
0d4a0d60
RW
2886(define-public java-jsr305
2887 (package
2888 (name "java-jsr305")
2889 (version "3.0.1")
2890 (source (origin
2891 (method url-fetch)
2892 (uri (string-append "https://repo1.maven.org/maven2/"
2893 "com/google/code/findbugs/"
2894 "jsr305/" version "/jsr305-"
2895 version "-sources.jar"))
2896 (sha256
2897 (base32
2898 "1rh6jin9v7jqpq3kf1swl868l8i94r636n03pzpsmgr8v0lh9j2n"))))
2899 (build-system ant-build-system)
2900 (arguments
2901 `(#:tests? #f ; no tests included
2902 #:jar-name "jsr305.jar"))
2903 (home-page "http://findbugs.sourceforge.net/")
2904 (synopsis "Annotations for the static analyzer called findbugs")
2905 (description "This package provides annotations for the findbugs package.
2906It provides packages in the @code{javax.annotations} namespace.")
2907 (license license:asl2.0)))
2908
4f3e47ea
RW
2909(define-public java-guava
2910 (package
2911 (name "java-guava")
2912 ;; This is the last release of Guava that can be built with Java 7.
2913 (version "20.0")
2914 (source (origin
2915 (method url-fetch)
2916 (uri (string-append "https://github.com/google/guava/"
2917 "releases/download/v" version
2918 "/guava-" version "-sources.jar"))
2919 (sha256
2920 (base32
2921 "1gawrs5gi6j5hcfxdgpnfli75vb9pfi4sn09pnc8xacr669yajwr"))))
2922 (build-system ant-build-system)
2923 (arguments
2924 `(#:tests? #f ; no tests included
2925 #:jar-name "guava.jar"
2926 #:phases
2927 (modify-phases %standard-phases
2928 (add-after 'unpack 'trim-sources
2929 (lambda _
2930 (with-directory-excursion "src/com/google/common"
2931 ;; Remove annotations to avoid extra dependencies:
2932 ;; * "j2objc" annotations are used when converting Java to
2933 ;; Objective C;
2934 ;; * "errorprone" annotations catch common Java mistakes at
2935 ;; compile time;
2936 ;; * "IgnoreJRERequirement" is used for Android.
2937 (substitute* (find-files "." "\\.java$")
2938 (("import com.google.j2objc.*") "")
2939 (("import com.google.errorprone.annotation.*") "")
2940 (("import org.codehaus.mojo.animal_sniffer.*") "")
2941 (("@CanIgnoreReturnValue") "")
2942 (("@LazyInit") "")
2943 (("@WeakOuter") "")
2944 (("@RetainedWith") "")
2945 (("@Weak") "")
2946 (("@ForOverride") "")
2947 (("@J2ObjCIncompatible") "")
2948 (("@IgnoreJRERequirement") "")))
2949 #t)))))
2950 (inputs
2951 `(("java-jsr305" ,java-jsr305)))
2952 (home-page "https://github.com/google/guava")
2953 (synopsis "Google core libraries for Java")
2954 (description "Guava is a set of core libraries that includes new
2955collection types (such as multimap and multiset), immutable collections, a
2956graph library, functional types, an in-memory cache, and APIs/utilities for
2957concurrency, I/O, hashing, primitives, reflection, string processing, and much
2958more!")
2959 (license license:asl2.0)))
2960
af8f8281
RW
2961;; The java-commons-logging package provides adapters to many different
2962;; logging frameworks. To avoid an excessive dependency graph we try to build
2963;; it with only a minimal set of adapters.
2964(define-public java-commons-logging-minimal
2965 (package
2966 (name "java-commons-logging-minimal")
2967 (version "1.2")
2968 (source (origin
2969 (method url-fetch)
2970 (uri (string-append "mirror://apache/commons/logging/source/"
2971 "commons-logging-" version "-src.tar.gz"))
2972 (sha256
2973 (base32
2974 "10bwcy5w8d7y39n0krlwhnp8ds3kj5zhmzj0zxnkw0qdlsjmsrj9"))))
2975 (build-system ant-build-system)
2976 (arguments
2977 `(#:tests? #f ; avoid dependency on logging frameworks
2978 #:jar-name "commons-logging-minimal.jar"
2979 #:phases
2980 (modify-phases %standard-phases
2981 (add-after 'unpack 'delete-adapters-and-tests
2982 (lambda _
2983 ;; Delete all adapters except for NoOpLog, SimpleLog, and
2984 ;; LogFactoryImpl. NoOpLog is required to build; LogFactoryImpl
2985 ;; is used by applications; SimpleLog is the only actually usable
2986 ;; implementation that does not depend on another logging
2987 ;; framework.
2988 (for-each
2989 (lambda (file)
2990 (delete-file (string-append
2991 "src/main/java/org/apache/commons/logging/impl/" file)))
2992 (list "Jdk13LumberjackLogger.java"
2993 "WeakHashtable.java"
2994 "Log4JLogger.java"
2995 "ServletContextCleaner.java"
2996 "Jdk14Logger.java"
2997 "AvalonLogger.java"
2998 "LogKitLogger.java"))
2999 (delete-file-recursively "src/test")
3000 #t)))))
3001 (home-page "http://commons.apache.org/logging/")
3002 (synopsis "Common API for logging implementations")
3003 (description "The Logging package is a thin bridge between different
3004logging implementations. A library that uses the commons-logging API can be
3005used with any logging implementation at runtime.")
3006 (license license:asl2.0)))
3007
90e65abe
RW
3008;; This is the last release of the 1.x series.
3009(define-public java-mockito-1
3010 (package
3011 (name "java-mockito")
3012 (version "1.10.19")
3013 (source (origin
3014 (method url-fetch)
3015 (uri (string-append "http://repo1.maven.org/maven2/"
3016 "org/mockito/mockito-core/" version
3017 "/mockito-core-" version "-sources.jar"))
3018 (sha256
3019 (base32
3020 "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc"))))
3021 (build-system ant-build-system)
3022 (arguments
3023 `(#:jar-name "mockito.jar"
3024 #:tests? #f ; no tests included
3025 ;; FIXME: patch-and-repack does not support jars, so we have to apply
3026 ;; patches in build phases.
3027 #:phases
3028 (modify-phases %standard-phases
3029 ;; Mockito was developed against a different version of hamcrest,
3030 ;; which does not require matcher implementations to provide an
3031 ;; implementation of the "describeMismatch" method. We add this
3032 ;; simple definition to pass the build with our version of hamcrest.
3033 (add-after 'unpack 'fix-hamcrest-build-error
3034 (lambda _
3035 (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java"
3036 (("public Matcher getActualMatcher\\(\\) .*" line)
3037 (string-append "
3038 public void describeMismatch(Object item, Description description) {
3039 actualMatcher.describeMismatch(item, description);
3040 }"
3041 line)))
3042 #t))
3043 ;; Mockito bundles cglib. We have a cglib package, so let's use
3044 ;; that instead.
3045 (add-after 'unpack 'use-system-libraries
3046 (lambda _
3047 (with-directory-excursion "src/org/mockito/internal/creation/cglib"
3048 (substitute* '("CGLIBHacker.java"
3049 "CglibMockMaker.java"
3050 "ClassImposterizer.java"
3051 "DelegatingMockitoMethodProxy.java"
3052 "MethodInterceptorFilter.java"
3053 "MockitoNamingPolicy.java"
3054 "SerializableMockitoMethodProxy.java"
3055 "SerializableNoOp.java")
3056 (("import org.mockito.cglib") "import net.sf.cglib")))
3057 #t)))))
3058 (inputs
3059 `(("java-junit" ,java-junit)
3060 ("java-objenesis" ,java-objenesis)
3061 ("java-cglib" ,java-cglib)
3062 ("java-hamcrest-core" ,java-hamcrest-core)))
3063 (home-page "http://mockito.org")
3064 (synopsis "Mockito is a mock library for Java")
3065 (description "Mockito is a mocking library for Java which lets you write
3066tests with a clean and simple API. It generates mocks using reflection, and
3067it records all mock invocations, including methods arguments.")
3068 (license license:asl2.0)))
3069
4f4d2e47
RW
3070(define-public java-httpcomponents-httpcore
3071 (package
3072 (name "java-httpcomponents-httpcore")
3073 (version "4.4.6")
3074 (source (origin
3075 (method url-fetch)
3076 (uri (string-append "mirror://apache//httpcomponents/httpcore/"
3077 "source/httpcomponents-core-"
3078 version "-src.tar.gz"))
3079 (sha256
3080 (base32
3081 "02bwcf38y4vgwq7kj2s6q7qrmma641r5lacivm16kgxvb2j6h1vy"))))
3082 (build-system ant-build-system)
3083 (arguments
3084 `(#:jar-name "httpcomponents-httpcore.jar"
3085 #:phases
3086 (modify-phases %standard-phases
3087 (add-after 'unpack 'chdir
3088 (lambda _ (chdir "httpcore") #t)))))
3089 (inputs
3090 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
3091 ("java-commons-lang3" ,java-commons-lang3)))
3092 (native-inputs
3093 `(("java-junit" ,java-junit)
3094 ("java-mockito" ,java-mockito-1)))
3095 (home-page "https://hc.apache.org/httpcomponents-core-4.4.x/index.html")
3096 (synopsis "Low level HTTP transport components")
3097 (description "HttpCore is a set of low level HTTP transport components
3098that can be used to build custom client and server side HTTP services with a
3099minimal footprint. HttpCore supports two I/O models: blocking I/O model based
3100on the classic Java I/O and non-blocking, event driven I/O model based on Java
3101NIO.
3102
3103This package provides the blocking I/O model library.")
3104 (license license:asl2.0)))
3105
3a068b43
RW
3106(define-public java-httpcomponents-httpcore-nio
3107 (package (inherit java-httpcomponents-httpcore)
3108 (name "java-httpcomponents-httpcore-nio")
3109 (arguments
3110 `(#:jar-name "httpcomponents-httpcore-nio.jar"
3111 #:phases
3112 (modify-phases %standard-phases
3113 (add-after 'unpack 'chdir
3114 (lambda _ (chdir "httpcore-nio") #t)))))
3115 (inputs
3116 `(("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
3117 ("java-hamcrest-core" ,java-hamcrest-core)
3118 ,@(package-inputs java-httpcomponents-httpcore)))
3119 (description "HttpCore is a set of low level HTTP transport components
3120that can be used to build custom client and server side HTTP services with a
3121minimal footprint. HttpCore supports two I/O models: blocking I/O model based
3122on the classic Java I/O and non-blocking, event driven I/O model based on Java
3123NIO.
3124
3125This package provides the non-blocking I/O model library based on Java
3126NIO.")))
3127
e1dd78f6
RW
3128(define-public java-httpcomponents-httpcore-ab
3129 (package (inherit java-httpcomponents-httpcore)
3130 (name "java-httpcomponents-httpcore-ab")
3131 (arguments
3132 `(#:jar-name "httpcomponents-httpcore-ab.jar"
3133 #:phases
3134 (modify-phases %standard-phases
3135 (add-after 'unpack 'chdir
3136 (lambda _ (chdir "httpcore-ab") #t)))))
3137 (inputs
3138 `(("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
3139 ("java-commons-cli" ,java-commons-cli)
3140 ("java-hamcrest-core" ,java-hamcrest-core)
3141 ,@(package-inputs java-httpcomponents-httpcore)))
3142 (synopsis "Apache HttpCore benchmarking tool")
3143 (description "This package provides the HttpCore benchmarking tool. It is
3144an Apache AB clone based on HttpCore.")))
3145
14a671d8
RW
3146(define-public java-httpcomponents-httpclient
3147 (package
3148 (name "java-httpcomponents-httpclient")
3149 (version "4.5.3")
3150 (source (origin
3151 (method url-fetch)
3152 (uri (string-append "mirror://apache/httpcomponents/httpclient/"
3153 "source/httpcomponents-client-"
3154 version "-src.tar.gz"))
3155 (sha256
3156 (base32
3157 "1428399s7qy3cim5wc6f3ks4gl9nf9vkjpfmnlap3jflif7g2pj1"))))
3158 (build-system ant-build-system)
3159 (arguments
3160 `(#:jar-name "httpcomponents-httpclient.jar"
3161 #:phases
3162 (modify-phases %standard-phases
3163 (add-after 'unpack 'chdir
3164 (lambda _ (chdir "httpclient") #t)))))
3165 (inputs
3166 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
3167 ("java-commons-codec" ,java-commons-codec)
3168 ("java-hamcrest-core" ,java-hamcrest-core)
3169 ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
3170 ("java-mockito" ,java-mockito-1)
3171 ("java-junit" ,java-junit)))
3172 (home-page "https://hc.apache.org/httpcomponents-client-ga/")
3173 (synopsis "HTTP client library for Java")
3174 (description "Although the @code{java.net} package provides basic
3175functionality for accessing resources via HTTP, it doesn't provide the full
3176flexibility or functionality needed by many applications. @code{HttpClient}
3177seeks to fill this void by providing an efficient, up-to-date, and
3178feature-rich package implementing the client side of the most recent HTTP
3179standards and recommendations.")
3180 (license license:asl2.0)))
3181
cbce5de2
RW
3182(define-public java-httpcomponents-httpmime
3183 (package (inherit java-httpcomponents-httpclient)
3184 (name "java-httpcomponents-httpmime")
3185 (arguments
3186 `(#:jar-name "httpcomponents-httpmime.jar"
3187 #:phases
3188 (modify-phases %standard-phases
3189 (add-after 'unpack 'chdir
3190 (lambda _ (chdir "httpmime") #t)))))
3191 (inputs
3192 `(("java-httpcomponents-httpclient" ,java-httpcomponents-httpclient)
3193 ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
3194 ("java-junit" ,java-junit)
3195 ("java-hamcrest-core" ,java-hamcrest-core)))))
3196
4b34c21f
RW
3197(define-public java-commons-net
3198 (package
3199 (name "java-commons-net")
3200 (version "3.6")
3201 (source (origin
3202 (method url-fetch)
3203 (uri (string-append "mirror://apache/commons/net/source/"
3204 "commons-net-" version "-src.tar.gz"))
3205 (sha256
3206 (base32
3207 "0n0cmnddk9qdqhjvka8pc6hd9mn2qi3166f1s6xk32h7rfy1adxr"))))
3208 (build-system ant-build-system)
3209 (arguments
3210 `(;; FIXME: MainTest.java tries to read "examples.properties" (which
3211 ;; should be "resources/examples/examples.properties"), but gets "null"
3212 ;; instead.
3213 #:tests? #f
3214 #:jar-name "commons-net.jar"))
3215 (native-inputs
3216 `(("java-junit" ,java-junit)
3217 ("java-hamcrest-core" ,java-hamcrest-core)))
3218 (home-page "http://commons.apache.org/net/")
3219 (synopsis "Client library for many basic Internet protocols")
3220 (description "The Apache Commons Net library implements the client side of
3221many basic Internet protocols. The purpose of the library is to provide
3222fundamental protocol access, not higher-level abstractions.")
3223 (license license:asl2.0)))
3224
808cb58f
RW
3225(define-public java-jsch
3226 (package
3227 (name "java-jsch")
3228 (version "0.1.54")
3229 (source (origin
3230 (method url-fetch)
3231 (uri (string-append "mirror://sourceforge/jsch/jsch/"
3232 version "/jsch-" version ".zip"))
3233 (sha256
3234 (base32
3235 "029rdddyq1mh3ghryh3ki99kba1xkf1d1swjv2vi6lk6zzjy2wdb"))))
3236 (build-system ant-build-system)
3237 (arguments
3238 `(#:build-target "dist"
3239 #:tests? #f ; no tests included
3240 #:phases
3241 (modify-phases %standard-phases
3242 (replace 'install (install-jars "dist")))))
3243 (native-inputs
3244 `(("unzip" ,unzip)))
3245 (home-page "http://www.jcraft.com/jsch/")
3246 (synopsis "Pure Java implementation of SSH2")
3247 (description "JSch is a pure Java implementation of SSH2. JSch allows you
3248to connect to an SSH server and use port forwarding, X11 forwarding, file
3249transfer, etc., and you can integrate its functionality into your own Java
3250programs.")
3251 (license license:bsd-3)))
3252
a6244698
RW
3253(define-public java-commons-compress
3254 (package
3255 (name "java-commons-compress")
3256 (version "1.13")
3257 (source (origin
3258 (method url-fetch)
3259 (uri (string-append "mirror://apache/commons/compress/source/"
3260 "commons-compress-" version "-src.tar.gz"))
3261 (sha256
3262 (base32
3263 "1vjqvavrn0babffn1kciz6v52ibwq2vwhzlb95hazis3lgllnxc8"))))
3264 (build-system ant-build-system)
3265 (arguments
3266 `(#:jar-name "commons-compress.jar"
3267 #:phases
3268 (modify-phases %standard-phases
3269 (add-after 'unpack 'delete-bad-tests
3270 (lambda _
3271 (with-directory-excursion "src/test/java/org/apache/commons/compress/"
3272 ;; FIXME: These tests really should not fail. Maybe they are
3273 ;; indicative of problems with our Java packaging work.
3274
3275 ;; This test fails with a null pointer exception.
3276 (delete-file "archivers/sevenz/SevenZOutputFileTest.java")
3277 ;; This test fails to open test resources.
3278 (delete-file "archivers/zip/ExplodeSupportTest.java")
3279
3280 ;; FIXME: This test adds a dependency on powermock, which is hard to
3281 ;; package at this point.
3282 ;; https://github.com/powermock/powermock
3283 (delete-file "archivers/sevenz/SevenZNativeHeapTest.java"))
3284 #t)))))
3285 (inputs
3286 `(("java-junit" ,java-junit)
3287 ("java-hamcrest-core" ,java-hamcrest-core)
3288 ("java-mockito" ,java-mockito-1)
3289 ("java-xz" ,java-xz)))
3290 (home-page "https://commons.apache.org/proper/commons-compress/")
3291 (synopsis "Java library for working with compressed files")
3292 (description "The Apache Commons Compress library defines an API for
3293working with compressed files such as ar, cpio, Unix dump, tar, zip, gzip, XZ,
3294Pack200, bzip2, 7z, arj, lzma, snappy, DEFLATE, lz4 and Z files.")
3295 (license license:asl2.0)))
3296
b13a7cf8
RW
3297(define-public java-commons-net
3298 (package
3299 (name "java-commons-net")
3300 (version "3.6")
3301 (source (origin
3302 (method url-fetch)
3303 (uri (string-append "mirror://apache/commons/net/source/"
3304 "commons-net-" version "-src.tar.gz"))
3305 (sha256
3306 (base32
3307 "0n0cmnddk9qdqhjvka8pc6hd9mn2qi3166f1s6xk32h7rfy1adxr"))))
3308 (build-system ant-build-system)
3309 (arguments
3310 `(;; FIXME: MainTest.java tries to read "examples.properties" (which
3311 ;; should be "resources/examples/examples.properties"), but gets "null"
3312 ;; instead.
3313 #:tests? #f
3314 #:jar-name "commons-net.jar"))
3315 (native-inputs
3316 `(("java-junit" ,java-junit)
3317 ("java-hamcrest-core" ,java-hamcrest-core)))
3318 (home-page "http://commons.apache.org/net/")
3319 (synopsis "Client library for many basic Internet protocols")
3320 (description "The Apache Commons Net library implements the client side of
3321many basic Internet protocols. The purpose of the library is to provide
3322fundamental protocol access, not higher-level abstractions.")
3323 (license license:asl2.0)))
3324
6ee6d0b5
RW
3325(define-public java-osgi-annotation
3326 (package
3327 (name "java-osgi-annotation")
3328 (version "6.0.0")
3329 (source (origin
3330 (method url-fetch)
3331 (uri (string-append "https://repo1.maven.org/maven2/"
3332 "org/osgi/org.osgi.annotation/" version "/"
3333 "org.osgi.annotation-" version "-sources.jar"))
3334 (sha256
3335 (base32
3336 "1q718mb7gqg726rh6pc2hcisn8v50nv35abbir0jypmffhiii85w"))))
3337 (build-system ant-build-system)
3338 (arguments
3339 `(#:tests? #f ; no tests
3340 #:jar-name "osgi-annotation.jar"))
3341 (home-page "http://www.osgi.org")
3342 (synopsis "Annotation module of OSGi framework")
3343 (description
3344 "OSGi, for Open Services Gateway initiative framework, is a module system
3345and service platform for the Java programming language. This package contains
3346the OSGi annotation module, providing additional services to help dynamic
3347components.")
3348 (license license:asl2.0)))
3349
37e2e5d4
RW
3350(define-public java-osgi-core
3351 (package
3352 (name "java-osgi-core")
3353 (version "6.0.0")
3354 (source (origin
3355 (method url-fetch)
3356 (uri (string-append "https://repo1.maven.org/maven2/"
3357 "org/osgi/org.osgi.core/" version "/"
3358 "org.osgi.core-" version "-sources.jar"))
3359 (sha256
3360 (base32
3361 "19bpf5jx32jq9789gyhin35q5v7flmw0p9mk7wbgqpxqfmxyiabv"))))
3362 (build-system ant-build-system)
3363 (arguments
3364 `(#:tests? #f ; no tests
3365 #:jar-name "osgi-core.jar"))
3366 (inputs
3367 `(("java-osgi-annotation" ,java-osgi-annotation)))
3368 (home-page "http://www.osgi.org")
3369 (synopsis "Core module of OSGi framework")
3370 (description
3371 "OSGi, for Open Services Gateway initiative framework, is a module system
3372and service platform for the Java programming language. This package contains
3373the OSGi Core module.")
3374 (license license:asl2.0)))
3375
8af92c8f
RW
3376(define-public java-osgi-service-event
3377 (package
3378 (name "java-osgi-service-event")
3379 (version "1.3.1")
3380 (source (origin
3381 (method url-fetch)
3382 (uri (string-append "https://repo1.maven.org/maven2/"
3383 "org/osgi/org.osgi.service.event/"
3384 version "/org.osgi.service.event-"
3385 version "-sources.jar"))
3386 (sha256
3387 (base32
3388 "1nyhlgagwym75bycnjczwbnpymv2iw84zbhvvzk84g9q736i6qxm"))))
3389 (build-system ant-build-system)
3390 (arguments
3391 `(#:tests? #f ; no tests
3392 #:jar-name "osgi-service-event.jar"))
3393 (inputs
3394 `(("java-osgi-annotation" ,java-osgi-annotation)
3395 ("java-osgi-core" ,java-osgi-core)))
3396 (home-page "http://www.osgi.org")
3397 (synopsis "OSGi service event module")
3398 (description
3399 "OSGi, for Open Services Gateway initiative framework, is a module system
3400and service platform for the Java programming language. This package contains
3401the OSGi @code{org.osgi.service.event} module.")
3402 (license license:asl2.0)))
3403
674e93a0
RW
3404(define-public java-eclipse-osgi
3405 (package
3406 (name "java-eclipse-osgi")
3407 (version "3.11.3")
3408 (source (origin
3409 (method url-fetch)
3410 (uri (string-append "https://repo1.maven.org/maven2/"
3411 "org/eclipse/platform/org.eclipse.osgi/"
3412 version "/org.eclipse.osgi-"
3413 version "-sources.jar"))
3414 (sha256
3415 (base32
3416 "00cqc6lb29n0zv68b4l842vzkwawvbr7gshfdygsk8sicvcq2c7b"))))
3417 (build-system ant-build-system)
3418 (arguments
3419 `(#:tests? #f ; no tests included
3420 #:jar-name "eclipse-equinox-osgi.jar"))
3421 (inputs
3422 `(("java-osgi-annotation" ,java-osgi-annotation)))
3423 (home-page "http://www.eclipse.org/equinox/")
3424 (synopsis "Eclipse Equinox OSGi framework")
3425 (description "This package provides an implementation of the OSGi Core
3426specification.")
3427 (license license:epl1.0)))
3428
81b55b1e
RW
3429(define-public java-eclipse-equinox-common
3430 (package
3431 (name "java-eclipse-equinox-common")
3432 (version "3.8.0")
3433 (source (origin
3434 (method url-fetch)
3435 (uri (string-append "https://repo1.maven.org/maven2/"
3436 "org/eclipse/platform/org.eclipse.equinox.common/"
3437 version "/org.eclipse.equinox.common-"
3438 version "-sources.jar"))
3439 (sha256
3440 (base32
3441 "12aazpkgw46r1qj0pr421jzwhbmsizd97r37krd7njnbrdgfzksc"))))
3442 (build-system ant-build-system)
3443 (arguments
3444 `(#:tests? #f ; no tests included
3445 #:jar-name "eclipse-equinox-common.jar"))
3446 (inputs
3447 `(("java-eclipse-osgi" ,java-eclipse-osgi)))
3448 (home-page "http://www.eclipse.org/equinox/")
3449 (synopsis "Common Eclipse runtime")
3450 (description "This package provides the common Eclipse runtime.")
3451 (license license:epl1.0)))
3452
90368ad9
RW
3453(define-public java-eclipse-core-jobs
3454 (package
3455 (name "java-eclipse-core-jobs")
3456 (version "3.8.0")
3457 (source (origin
3458 (method url-fetch)
3459 (uri (string-append "https://repo1.maven.org/maven2/"
3460 "org/eclipse/platform/org.eclipse.core.jobs/"
3461 version "/org.eclipse.core.jobs-"
3462 version "-sources.jar"))
3463 (sha256
3464 (base32
3465 "0395b8lh0km8vhzjnchvs1rii1qz48hyvb2wqfaq4yhklbwihq4b"))))
3466 (build-system ant-build-system)
3467 (arguments
3468 `(#:tests? #f ; no tests included
3469 #:jar-name "eclipse-core-jobs.jar"))
3470 (inputs
3471 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3472 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3473 (home-page "http://www.eclipse.org/equinox/")
3474 (synopsis "Eclipse jobs mechanism")
3475 (description "This package provides the Eclipse jobs mechanism.")
3476 (license license:epl1.0)))
3477
fbaf09eb
RW
3478(define-public java-eclipse-equinox-registry
3479 (package
3480 (name "java-eclipse-equinox-registry")
3481 (version "3.6.100")
3482 (source (origin
3483 (method url-fetch)
3484 (uri (string-append "https://repo1.maven.org/maven2/"
3485 "org/eclipse/platform/org.eclipse.equinox.registry/"
3486 version "/org.eclipse.equinox.registry-"
3487 version "-sources.jar"))
3488 (sha256
3489 (base32
3490 "1i9sgymh2fy5vdgk5y7s3qvrlbgh4l93ddqi3v4zmca7hwrlhf9k"))))
3491 (build-system ant-build-system)
3492 (arguments
3493 `(#:tests? #f ; no tests included
3494 #:jar-name "eclipse-equinox-registry.jar"))
3495 (inputs
3496 `(("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
3497 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3498 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3499 (home-page "http://www.eclipse.org/equinox/")
3500 (synopsis "Eclipse extension registry support")
3501 (description "This package provides support for the Eclipse extension
3502registry.")
3503 (license license:epl1.0)))
3504
65214c87
RW
3505(define-public java-eclipse-equinox-app
3506 (package
3507 (name "java-eclipse-equinox-app")
3508 (version "1.3.400")
3509 (source (origin
3510 (method url-fetch)
3511 (uri (string-append "https://repo1.maven.org/maven2/"
3512 "org/eclipse/platform/org.eclipse.equinox.app/"
3513 version "/org.eclipse.equinox.app-"
3514 version "-sources.jar"))
3515 (sha256
3516 (base32
3517 "0nhvbp93y203ar7y59gb0mz3w2d3jlqhr0c9hii9bcfpmr7imdab"))))
3518 (build-system ant-build-system)
3519 (arguments
3520 `(#:tests? #f ; no tests included
3521 #:jar-name "eclipse-equinox-app.jar"))
3522 (inputs
3523 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3524 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3525 ("java-eclipse-osgi" ,java-eclipse-osgi)
3526 ("java-osgi-service-event" ,java-osgi-service-event)))
3527 (home-page "http://www.eclipse.org/equinox/")
3528 (synopsis "Equinox application container")
3529 (description "This package provides the Equinox application container for
3530Eclipse.")
3531 (license license:epl1.0)))
3532
3f970214
RW
3533(define-public java-eclipse-equinox-preferences
3534 (package
3535 (name "java-eclipse-equinox-preferences")
3536 (version "3.6.1")
3537 (source (origin
3538 (method url-fetch)
3539 (uri (string-append "https://repo1.maven.org/maven2/"
3540 "org/eclipse/platform/org.eclipse.equinox.preferences/"
3541 version "/org.eclipse.equinox.preferences-"
3542 version "-sources.jar"))
3543 (sha256
3544 (base32
3545 "0k7w6c141sqym4fy3af0qkwpy4pdh2vsjpjba6rp5fxyqa24v0a2"))))
3546 (build-system ant-build-system)
3547 (arguments
3548 `(#:tests? #f ; no tests included
3549 #:jar-name "eclipse-equinox-preferences.jar"))
3550 (inputs
3551 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3552 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3553 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3554 (home-page "http://www.eclipse.org/equinox/")
3555 (synopsis "Eclipse preferences mechanism")
3556 (description "This package provides the Eclipse preferences mechanism with
3557the module @code{org.eclipse.equinox.preferences}.")
3558 (license license:epl1.0)))
3559
4ad3d4f3
RW
3560(define-public java-eclipse-core-contenttype
3561 (package
3562 (name "java-eclipse-core-contenttype")
3563 (version "3.5.100")
3564 (source (origin
3565 (method url-fetch)
3566 (uri (string-append "https://repo1.maven.org/maven2/"
3567 "org/eclipse/platform/org.eclipse.core.contenttype/"
3568 version "/org.eclipse.core.contenttype-"
3569 version "-sources.jar"))
3570 (sha256
3571 (base32
3572 "1wcqcv7ijwv5rh748vz3x9pkmjl9w1r0k0026k56n8yjl4rrmspi"))))
3573 (build-system ant-build-system)
3574 (arguments
3575 `(#:tests? #f ; no tests included
3576 #:jar-name "eclipse-core-contenttype.jar"))
3577 (inputs
3578 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3579 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
3580 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3581 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3582 (home-page "http://www.eclipse.org/")
3583 (synopsis "Eclipse content mechanism")
3584 (description "This package provides the Eclipse content mechanism in the
3585@code{org.eclipse.core.contenttype} module.")
3586 (license license:epl1.0)))
3587
6a7f7e49
RW
3588(define-public java-eclipse-core-runtime
3589 (package
3590 (name "java-eclipse-core-runtime")
3591 (version "3.12.0")
3592 (source (origin
3593 (method url-fetch)
3594 (uri (string-append "https://repo1.maven.org/maven2/"
3595 "org/eclipse/platform/org.eclipse.core.runtime/"
3596 version "/org.eclipse.core.runtime-"
3597 version "-sources.jar"))
3598 (sha256
3599 (base32
3600 "16mkf8jgj35pgzms7w1gyfq0gfm4ixw6c5xbbxzdj1la56c758ya"))))
3601 (build-system ant-build-system)
3602 (arguments
3603 `(#:tests? #f ; no tests included
3604 #:jar-name "eclipse-core-runtime.jar"))
3605 (inputs
3606 `(("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
3607 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
3608 ("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
3609 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3610 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3611 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
3612 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3613 (home-page "https://www.eclipse.org/")
3614 (synopsis "Eclipse core runtime")
3615 (description "This package provides the Eclipse core runtime with the
3616module @code{org.eclipse.core.runtime}.")
3617 (license license:epl1.0)))
3618
b3806a15
RW
3619(define-public java-eclipse-core-filesystem
3620 (package
3621 (name "java-eclipse-core-filesystem")
3622 (version "1.6.1")
3623 (source (origin
3624 (method url-fetch)
3625 (uri (string-append "https://repo1.maven.org/maven2/"
3626 "org/eclipse/platform/org.eclipse.core.filesystem/"
3627 version "/org.eclipse.core.filesystem-"
3628 version "-sources.jar"))
3629 (sha256
3630 (base32
3631 "0km1bhwjim4rfy3pkvjhvy31kgsyf2ncx0mlkmbf5n6g57pphdyj"))))
3632 (build-system ant-build-system)
3633 (arguments
3634 `(#:tests? #f ; no tests included
3635 #:jar-name "eclipse-core-filesystem.jar"))
3636 (inputs
3637 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3638 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3639 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3640 (home-page "https://www.eclipse.org/")
3641 (synopsis "Eclipse core file system")
3642 (description "This package provides the Eclipse core file system with the
3643module @code{org.eclipse.core.filesystem}.")
3644 (license license:epl1.0)))
3645
e96060de
RW
3646(define-public java-eclipse-core-expressions
3647 (package
3648 (name "java-eclipse-core-expressions")
3649 (version "3.5.100")
3650 (source (origin
3651 (method url-fetch)
3652 (uri (string-append "https://repo1.maven.org/maven2/"
3653 "org/eclipse/platform/org.eclipse.core.expressions/"
3654 version "/org.eclipse.core.expressions-"
3655 version "-sources.jar"))
3656 (sha256
3657 (base32
3658 "18bw2l875gmygvpagpgk9l24qzbdjia4ag12nw6fi8v8yaq4987f"))))
3659 (build-system ant-build-system)
3660 (arguments
3661 `(#:tests? #f ; no tests included
3662 #:jar-name "eclipse-core-expressions.jar"))
3663 (inputs
3664 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3665 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3666 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
3667 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
3668 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3669 (home-page "https://www.eclipse.org/")
3670 (synopsis "Eclipse core expression language")
3671 (description "This package provides the Eclipse core expression language
3672with the @code{org.eclipse.core.expressions} module.")
3673 (license license:epl1.0)))
3674
e8d0f7c8
RW
3675(define-public java-eclipse-core-variables
3676 (package
3677 (name "java-eclipse-core-variables")
3678 (version "3.3.0")
3679 (source (origin
3680 (method url-fetch)
3681 (uri (string-append "https://repo1.maven.org/maven2/"
3682 "org/eclipse/platform/org.eclipse.core.variables/"
3683 version "/org.eclipse.core.variables-"
3684 version "-sources.jar"))
3685 (sha256
3686 (base32
3687 "12dirh03zi4n5x5cj07vzrhkmnqy6h9q10h9j605pagmpmifyxmy"))))
3688 (build-system ant-build-system)
3689 (arguments
3690 `(#:tests? #f ; no tests included
3691 #:jar-name "eclipse-core-variables.jar"))
3692 (inputs
3693 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3694 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3695 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
3696 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
3697 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3698 (home-page "https://www.eclipse.org/platform")
3699 (synopsis "Eclipse core variables")
3700 (description "This package provides the Eclipse core variables module
3701@code{org.eclipse.core.variables}.")
3702 (license license:epl1.0)))
3703
7c3d479e
RW
3704(define-public java-eclipse-ant-core
3705 (package
3706 (name "java-eclipse-ant-core")
3707 (version "3.4.100")
3708 (source (origin
3709 (method url-fetch)
3710 (uri (string-append "https://repo1.maven.org/maven2/"
3711 "org/eclipse/platform/org.eclipse.ant.core/"
3712 version "/org.eclipse.ant.core-"
3713 version "-sources.jar"))
3714 (sha256
3715 (base32
3716 "11g3if794qjlk98mz9zch22rr56sd7z63vn4i7k2icr8cq5bfqg7"))))
3717 (build-system ant-build-system)
3718 (arguments
3719 `(#:tests? #f ; no tests included
3720 #:jar-name "eclipse-ant-core.jar"))
3721 (inputs
3722 `(("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
3723 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3724 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3725 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
3726 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
3727 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
3728 ("java-eclipse-core-variables" ,java-eclipse-core-variables)
3729 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3730 (home-page "https://www.eclipse.org/platform")
3731 (synopsis "Ant build tool core libraries")
3732 (description "This package provides the ant build tool core libraries with
3733the module @code{org.eclipse.ant.core}.")
3734 (license license:epl1.0)))
3735
6636f638
RW
3736(define-public java-eclipse-core-resources
3737 (package
3738 (name "java-eclipse-core-resources")
3739 (version "3.11.1")
3740 (source (origin
3741 (method url-fetch)
3742 (uri (string-append "https://repo1.maven.org/maven2/"
3743 "org/eclipse/platform/org.eclipse.core.resources/"
3744 version "/org.eclipse.core.resources-"
3745 version "-sources.jar"))
3746 (sha256
3747 (base32
3748 "1hrfxrll6cpcagfksk2na1ypvkcnsp0fk6n3vcsrn97qayf9mx9l"))))
3749 (build-system ant-build-system)
3750 (arguments
3751 `(#:tests? #f ; no tests included
3752 #:jar-name "eclipse-core-resources.jar"))
3753 (inputs
3754 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3755 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
3756 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3757 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
3758 ("java-eclipse-core-expressions" ,java-eclipse-core-expressions)
3759 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
3760 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
3761 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
3762 ("java-eclipse-ant-core" ,java-eclipse-ant-core)
3763 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3764 (home-page "https://www.eclipse.org/")
3765 (synopsis "Eclipse core resource management")
3766 (description "This package provides the Eclipse core resource management
3767module @code{org.eclipse.core.resources}.")
3768 (license license:epl1.0)))
3769
afb5858d
RW
3770(define-public java-eclipse-compare-core
3771 (package
3772 (name "java-eclipse-compare-core")
3773 (version "3.6.0")
3774 (source (origin
3775 (method url-fetch)
3776 (uri (string-append "https://repo1.maven.org/maven2/"
3777 "org/eclipse/platform/org.eclipse.compare.core/"
3778 version "/org.eclipse.compare.core-"
3779 version "-sources.jar"))
3780 (sha256
3781 (base32
3782 "10g37r0pbiffyv2wk35c6g5lwzkdipkl0kkjp41v84dln46xm4dg"))))
3783 (build-system ant-build-system)
3784 (arguments
3785 `(#:tests? #f ; no tests included
3786 #:jar-name "eclipse-compare-core.jar"))
3787 (inputs
3788 `(("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
3789 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3790 ("java-eclipse-osgi" ,java-eclipse-osgi)
3791 ("java-icu4j" ,java-icu4j)))
3792 (home-page "https://www.eclipse.org/")
3793 (synopsis "Eclipse core compare support")
3794 (description "This package provides the Eclipse core compare support
3795module @code{org.eclipse.compare.core}.")
3796 (license license:epl1.0)))
3797
1bb191fc
RW
3798(define-public java-eclipse-team-core
3799 (package
3800 (name "java-eclipse-team-core")
3801 (version "3.8.0")
3802 (source (origin
3803 (method url-fetch)
3804 (uri (string-append "https://repo1.maven.org/maven2/"
3805 "org/eclipse/platform/org.eclipse.team.core/"
3806 version "/org.eclipse.team.core-"
3807 version "-sources.jar"))
3808 (sha256
3809 (base32
3810 "02j2jzqgb26zx2d5ahxmvijw6j4r0la90zl5c3i65x6z19ciyam7"))))
3811 (build-system ant-build-system)
3812 (arguments
3813 `(#:tests? #f ; no tests included
3814 #:jar-name "eclipse-team-core.jar"))
3815 (inputs
3816 `(("java-eclipse-compare-core" ,java-eclipse-compare-core)
3817 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
3818 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
3819 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
3820 ("java-eclipse-core-resources" ,java-eclipse-core-resources)
3821 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
3822 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3823 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3824 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
3825 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3826 (home-page "https://www.eclipse.org/platform")
3827 (synopsis "Eclipse team support core")
3828 (description "This package provides the Eclipse team support core module
3829@code{org.eclipse.team.core}.")
3830 (license license:epl1.0)))
3831
31342529
RW
3832(define-public java-eclipse-core-commands
3833 (package
3834 (name "java-eclipse-core-commands")
3835 (version "3.8.1")
3836 (source (origin
3837 (method url-fetch)
3838 (uri (string-append "https://repo1.maven.org/maven2/"
3839 "org/eclipse/platform/org.eclipse.core.commands/"
3840 version "/org.eclipse.core.commands-"
3841 version "-sources.jar"))
3842 (sha256
3843 (base32
3844 "0yjn482qndcfrsq3jd6vnhcylp16420f5aqkrwr8spsprjigjcr9"))))
3845 (build-system ant-build-system)
3846 (arguments
3847 `(#:tests? #f ; no tests included
3848 #:jar-name "eclipse-core-commands.jar"))
3849 (inputs
3850 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)))
3851 (home-page "https://www.eclipse.org/platform")
3852 (synopsis "Eclipse core commands")
3853 (description "This package provides Eclipse core commands in the module
3854@code{org.eclipse.core.commands}.")
3855 (license license:epl1.0)))
3856
bf96acf7
RW
3857(define-public java-eclipse-text
3858 (package
3859 (name "java-eclipse-text")
3860 (version "3.6.0")
3861 (source (origin
3862 (method url-fetch)
3863 (uri (string-append "https://repo1.maven.org/maven2/"
3864 "org/eclipse/platform/org.eclipse.text/"
3865 version "/org.eclipse.text-"
3866 version "-sources.jar"))
3867 (sha256
3868 (base32
3869 "0scz70vzz5qs5caji9f5q01vkqnvip7dpri1q07l8wbbdcxn4cq1"))))
3870 (build-system ant-build-system)
3871 (arguments
3872 `(#:tests? #f ; no tests included
3873 #:jar-name "eclipse-text.jar"
3874 #:phases
3875 (modify-phases %standard-phases
3876 ;; When creating a new category we must make sure that the new list
3877 ;; matches List<Position>. By default it seems to be too generic
3878 ;; (ArrayList<Object>), so we specialize it to ArrayList<Position>.
3879 ;; Without this we get this error:
3880 ;;
3881 ;; [javac] .../src/org/eclipse/jface/text/AbstractDocument.java:376:
3882 ;; error: method put in interface Map<K,V> cannot be applied to given types;
3883 ;; [javac] fPositions.put(category, new ArrayList<>());
3884 ;; [javac] ^
3885 ;; [javac] required: String,List<Position>
3886 ;; [javac] found: String,ArrayList<Object>
3887 ;; [javac] reason: actual argument ArrayList<Object> cannot be converted
3888 ;; to List<Position> by method invocation conversion
3889 ;; [javac] where K,V are type-variables:
3890 ;; [javac] K extends Object declared in interface Map
3891 ;; [javac] V extends Object declared in interface Map
3892 ;;
3893 ;; I don't know if this is a good fix. I suspect it is not, but it
3894 ;; seems to work.
3895 (add-after 'unpack 'fix-compilation-error
3896 (lambda _
3897 (substitute* "src/org/eclipse/jface/text/AbstractDocument.java"
3898 (("Positions.put\\(category, new ArrayList<>\\(\\)\\);")
3899 "Positions.put(category, new ArrayList<Position>());"))
3900 #t)))))
3901 (inputs
3902 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3903 ("java-eclipse-core-commands" ,java-eclipse-core-commands)
3904 ("java-icu4j" ,java-icu4j)))
3905 (home-page "http://www.eclipse.org/platform")
3906 (synopsis "Eclipse text library")
3907 (description "Platform Text is part of the Platform UI project and
3908provides the basic building blocks for text and text editors within Eclipse
3909and contributes the Eclipse default text editor.")
3910 (license license:epl1.0)))
3911
c24d11b7
RW
3912(define-public java-eclipse-jdt-core
3913 (package
3914 (name "java-eclipse-jdt-core")
3915 (version "3.12.3")
3916 (source (origin
3917 (method url-fetch)
3918 (uri (string-append "https://repo1.maven.org/maven2/"
3919 "org/eclipse/jdt/org.eclipse.jdt.core/"
3920 version "/org.eclipse.jdt.core-"
3921 version "-sources.jar"))
3922 (sha256
3923 (base32
3924 "191xw4lc7mjjkprh4ji5vnpjvr5r4zvbpwkriy4bvsjqrz35vh1j"))))
3925 (build-system ant-build-system)
3926 (arguments
3927 `(#:tests? #f ; no tests included
3928 #:jar-name "eclipse-jdt-core.jar"))
3929 (inputs
3930 `(("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
3931 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
3932 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
3933 ("java-eclipse-core-resources" ,java-eclipse-core-resources)
3934 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
3935 ("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
3936 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3937 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
3938 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3939 ("java-eclipse-osgi" ,java-eclipse-osgi)
3940 ("java-eclipse-text" ,java-eclipse-text)))
3941 (home-page "https://www.eclipse.org/jdt")
3942 (synopsis "Java development tools core libraries")
3943 (description "This package provides the core libraries of the Eclipse Java
3944development tools.")
3945 (license license:epl1.0)))
3946
a5cdcf6c
RW
3947(define-public java-javax-mail
3948 (package
3949 (name "java-javax-mail")
3950 (version "1.5.6")
3951 (source (origin
3952 (method url-fetch)
3953 (uri (string-append "https://repo1.maven.org/maven2/"
3954 "com/sun/mail/javax.mail/"
3955 version "/javax.mail-"
3956 version "-sources.jar"))
3957 (sha256
3958 (base32
3959 "0sdlfgsc2b5s89xv1261y8i0jijcja019k2x1c8ngfn582w4jly9"))))
3960 (build-system ant-build-system)
3961 (arguments
3962 `(#:tests? #f ; no tests
3963 #:jar-name "javax-mail.jar"))
3964 (home-page "https://javamail.java.net")
3965 (synopsis "Reference implementation of the JavaMail API")
3966 (description
3967 "This package provides versions of the JavaMail API implementation, IMAP,
3968SMTP, and POP3 service providers, some examples, and documentation for the
3969JavaMail API.")
3970 ;; GPLv2 only with "classpath exception".
3971 (license license:gpl2)))
3972
0e660c4d
RW
3973(define-public java-log4j-api
3974 (package
3975 (name "java-log4j-api")
3976 (version "2.4.1")
3977 (source (origin
3978 (method url-fetch)
3979 (uri (string-append "mirror://apache/logging/log4j/" version
3980 "/apache-log4j-" version "-src.tar.gz"))
3981 (sha256
3982 (base32
3983 "0j5p9gik0jysh37nlrckqbky12isy95cpwg2gv5fas1rcdqbraxd"))))
3984 (build-system ant-build-system)
3985 (arguments
3986 `(#:tests? #f ; tests require unpackaged software
3987 #:jar-name "log4j-api.jar"
3988 #:make-flags
3989 (list (string-append "-Ddist.dir=" (assoc-ref %outputs "out")
3990 "/share/java"))
3991 #:phases
3992 (modify-phases %standard-phases
3993 (add-after 'unpack 'enter-dir
3994 (lambda _ (chdir "log4j-api") #t))
3995 ;; FIXME: The tests require additional software that has not been
3996 ;; packaged yet, such as
3997 ;; * org.apache.maven
3998 ;; * org.apache.felix
3999 (add-after 'enter-dir 'delete-tests
4000 (lambda _ (delete-file-recursively "src/test") #t)))))
4001 (inputs
4002 `(("java-osgi-core" ,java-osgi-core)
4003 ("java-hamcrest-core" ,java-hamcrest-core)
4004 ("java-junit" ,java-junit)))
4005 (home-page "http://logging.apache.org/log4j/2.x/")
4006 (synopsis "API module of the Log4j logging framework for Java")
4007 (description
4008 "This package provides the API module of the Log4j logging framework for
4009Java.")
4010 (license license:asl2.0)))
4011
1c188f4e
HG
4012(define-public java-commons-cli
4013 (package
4014 (name "java-commons-cli")
4015 (version "1.3.1")
4016 (source (origin
4017 (method url-fetch)
4018 (uri (string-append "mirror://apache/commons/cli/source/"
4019 "commons-cli-" version "-src.tar.gz"))
4020 (sha256
4021 (base32
4022 "1fkjn552i12vp3xxk21ws4p70fi0lyjm004vzxsdaz7gdpgyxxyl"))))
4023 (build-system ant-build-system)
4024 ;; TODO: javadoc
4025 (arguments
4026 `(#:jar-name "commons-cli.jar"))
4027 (native-inputs
4028 `(("java-junit" ,java-junit)
4029 ("java-hamcrest-core" ,java-hamcrest-core)))
4030 (home-page "http://commons.apache.org/cli/")
4031 (synopsis "Command line arguments and options parsing library")
4032 (description "The Apache Commons CLI library provides an API for parsing
4033command line options passed to programs. It is also able to print help
4034messages detailing the options available for a command line tool.
4035
4036Commons CLI supports different types of options:
4037
4038@itemize
4039@item POSIX like options (ie. tar -zxvf foo.tar.gz)
4040@item GNU like long options (ie. du --human-readable --max-depth=1)
4041@item Java like properties (ie. java -Djava.awt.headless=true Foo)
4042@item Short options with value attached (ie. gcc -O2 foo.c)
4043@item long options with single hyphen (ie. ant -projecthelp)
4044@end itemize
4045
4046This is a part of the Apache Commons Project.")
4047 (license license:asl2.0)))
0a8519bc
HG
4048
4049(define-public java-commons-codec
4050 (package
4051 (name "java-commons-codec")
4052 (version "1.10")
4053 (source (origin
4054 (method url-fetch)
4055 (uri (string-append "mirror://apache/commons/codec/source/"
4056 "commons-codec-" version "-src.tar.gz"))
4057 (sha256
4058 (base32
4059 "1w9qg30y4s0x8gnmr2fgj4lyplfn788jqxbcz27lf5kbr6n8xr65"))))
4060 (build-system ant-build-system)
4061 (outputs '("out" "doc"))
4062 (arguments
4063 `(#:test-target "test"
4064 #:make-flags
4065 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
4066 (junit (assoc-ref %build-inputs "java-junit")))
4067 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
4068 (string-append "-Dhamcrest.jar=" hamcrest
4069 "/share/java/hamcrest-core.jar")
4070 ;; Do not append version to jar.
4071 "-Dfinal.name=commons-codec"))
4072 #:phases
4073 (modify-phases %standard-phases
4074 (add-after 'build 'build-javadoc ant-build-javadoc)
4075 (replace 'install (install-jars "dist"))
4076 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
4077 (native-inputs
4078 `(("java-junit" ,java-junit)
4079 ("java-hamcrest-core" ,java-hamcrest-core)))
4080 (home-page "http://commons.apache.org/codec/")
4081 (synopsis "Common encoders and decoders such as Base64, Hex, Phonetic and URLs")
4082 (description "The codec package contains simple encoder and decoders for
4083various formats such as Base64 and Hexadecimal. In addition to these widely
4084used encoders and decoders, the codec package also maintains a collection of
4085phonetic encoding utilities.
4086
4087This is a part of the Apache Commons Project.")
4088 (license license:asl2.0)))
7d91c1b9
HG
4089
4090(define-public java-commons-daemon
4091 (package
4092 (name "java-commons-daemon")
4093 (version "1.0.15")
4094 (source (origin
4095 (method url-fetch)
4096 (uri (string-append "mirror://apache/commons/daemon/source/"
4097 "commons-daemon-" version "-src.tar.gz"))
4098 (sha256
4099 (base32
4100 "0ci46kq8jpz084ccwq0mmkahcgsmh20ziclp2jf5i0djqv95gvhi"))))
4101 (build-system ant-build-system)
4102 (arguments
4103 `(#:test-target "test"
4104 #:phases
4105 (modify-phases %standard-phases
4106 (add-after 'build 'build-javadoc ant-build-javadoc)
4107 (replace 'install (install-jars "dist"))
4108 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
4109 (native-inputs
4110 `(("java-junit" ,java-junit)))
4111 (home-page "http://commons.apache.org/daemon/")
4112 (synopsis "Library to launch Java applications as daemons")
4113 (description "The Daemon package from Apache Commons can be used to
4114implement Java applications which can be launched as daemons. For example the
4115program will be notified about a shutdown so that it can perform cleanup tasks
4116before its process of execution is destroyed by the operation system.
4117
4118This package contains the Java library. You will also need the actual binary
4119for your architecture which is provided by the jsvc package.
4120
4121This is a part of the Apache Commons Project.")
4122 (license license:asl2.0)))
9f68e74a 4123
eb270ecf
RW
4124(define-public java-javaewah
4125 (package
4126 (name "java-javaewah")
4127 (version "1.1.6")
4128 (source (origin
4129 (method url-fetch)
4130 (uri (string-append "https://github.com/lemire/javaewah/"
4131 "archive/JavaEWAH-" version ".tar.gz"))
4132 (sha256
4133 (base32
4134 "1n7j1r1h24wlhwv9zdcj6yqjrhma2ixwyzm15l5vrv6yqjs6753b"))))
4135 (build-system ant-build-system)
4136 (arguments `(#:jar-name "javaewah.jar"))
4137 (inputs
4138 `(("java-junit" ,java-junit)
4139 ("java-hamcrest-core" ,java-hamcrest-core)))
4140 (home-page "https://github.com/lemire/javaewah")
4141 (synopsis "Compressed alternative to the Java @code{BitSet} class")
4142 (description "This is a word-aligned compressed variant of the Java
4143@code{Bitset} class. It provides both a 64-bit and a 32-bit RLE-like
4144compression scheme. It can be used to implement bitmap indexes.
4145
4146The goal of word-aligned compression is not to achieve the best compression,
4147but rather to improve query processing time. Hence, JavaEWAH tries to save CPU
4148cycles, maybe at the expense of storage. However, the EWAH scheme is always
4149more efficient storage-wise than an uncompressed bitmap (as implemented in the
4150@code{BitSet} class by Sun).")
4151 ;; GPL2.0 derivates are explicitly allowed.
4152 (license license:asl2.0)))
4153
f8e4d022
RW
4154(define-public java-slf4j-api
4155 (package
4156 (name "java-slf4j-api")
4157 (version "1.7.25")
4158 (source (origin
4159 (method url-fetch)
4160 (uri (string-append "https://www.slf4j.org/dist/slf4j-"
4161 version ".tar.gz"))
4162 (sha256
4163 (base32
4164 "13j51sgzmhhdrfa74gkal5zpip7r1440dh7zsi2c8bpb2zs1v8kb"))
4165 (modules '((guix build utils)))
4166 ;; Delete bundled jars.
4167 (snippet
4168 '(begin
4169 (for-each delete-file (find-files "." "\\.jar$"))
4170 #t))))
4171 (build-system ant-build-system)
4172 (arguments
4173 ;; FIXME: org.slf4j.NoBindingTest fails with the ominous "This code
4174 ;; should have never made it into slf4j-api.jar".
4175 `(#:tests? #f
4176 #:jar-name "slf4j-api.jar"
4177 #:source-dir "slf4j-api/src/main"
4178 #:test-dir "slf4j-api/src/test"))
4179 (inputs
4180 `(("java-junit" ,java-junit)
4181 ("java-hamcrest-core" ,java-hamcrest-core)))
4182 (home-page "https://www.slf4j.org/")
4183 (synopsis "Simple logging facade for Java")
4184 (description "The Simple Logging Facade for Java (SLF4J) serves as a
4185simple facade or abstraction for various logging
4186frameworks (e.g. @code{java.util.logging}, @code{logback}, @code{log4j})
4187allowing the end user to plug in the desired logging framework at deployment
4188time.")
4189 (license license:expat)))
4190
9f68e74a
JL
4191(define-public antlr2
4192 (package
4193 (name "antlr2")
4194 (version "2.7.7")
4195 (source (origin
4196 (method url-fetch)
4197 (uri (string-append "http://www.antlr2.org/download/antlr-"
4198 version ".tar.gz"))
4199 (sha256
4200 (base32
4201 "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5"))
4202 (modules '((guix build utils)))
4203 (snippet
4204 '(begin
4205 (delete-file "antlr.jar")
4206 (substitute* "lib/cpp/antlr/CharScanner.hpp"
4207 (("#include <map>")
4208 (string-append
6d225e89
RW
4209 "#include <map>\n"
4210 "#define EOF (-1)\n"
4211 "#include <strings.h>")))
9f68e74a 4212 (substitute* "configure"
6d225e89
RW
4213 (("/bin/sh") "sh"))
4214 #t))))
9f68e74a
JL
4215 (build-system gnu-build-system)
4216 (arguments
6d225e89 4217 `(#:tests? #f ; no test target
3ad90395
RW
4218 #:imported-modules ((guix build ant-build-system)
4219 (guix build syscalls)
4220 ,@%gnu-build-system-modules)
4221 #:modules (((guix build ant-build-system) #:prefix ant:)
4222 (guix build gnu-build-system)
4223 (guix build utils))
9f68e74a
JL
4224 #:phases
4225 (modify-phases %standard-phases
4226 (add-after 'install 'strip-jar-timestamps
3ad90395 4227 (assoc-ref ant:%standard-phases 'strip-jar-timestamps))
9f68e74a
JL
4228 (add-after 'configure 'fix-bin-ls
4229 (lambda _
3ad90395
RW
4230 (substitute* (find-files "." "Makefile")
4231 (("/bin/ls") "ls"))
4232 #t)))))
9f68e74a
JL
4233 (native-inputs
4234 `(("which" ,which)
4235 ("zip" ,zip)
4236 ("java" ,icedtea "jdk")))
4237 (inputs
4238 `(("java" ,icedtea)))
4239 (home-page "http://www.antlr2.org")
4240 (synopsis "Framework for constructing recognizers, compilers, and translators")
4241 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
4242is a language tool that provides a framework for constructing recognizers,
4243compilers, and translators from grammatical descriptions containing Java, C#,
4244C++, or Python actions. ANTLR provides excellent support for tree construction,
4245tree walking, and translation.")
4246 (license license:public-domain)))
a0f15eff 4247
e44112e1 4248(define-public java-stringtemplate-3
a0f15eff 4249 (package
e44112e1 4250 (name "java-stringtemplate")
a0f15eff
JL
4251 (version "3.2.1")
4252 (source (origin
4253 (method url-fetch)
4254 (uri (string-append "https://github.com/antlr/website-st4/raw/"
4255 "gh-pages/download/stringtemplate-"
4256 version ".tar.gz"))
4257 (sha256
4258 (base32
4259 "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is"))))
4260 (build-system ant-build-system)
4261 (arguments
129d926d 4262 `(#:jar-name (string-append ,name "-" ,version ".jar")
2fcda6d2 4263 #:test-dir "test"
b101b4e8
RW
4264 #:modules ((guix build ant-build-system)
4265 (guix build utils)
4266 (srfi srfi-1))
a0f15eff
JL
4267 #:phases
4268 (modify-phases %standard-phases
2fcda6d2
RW
4269 (add-before 'check 'fix-tests
4270 (lambda _
4271 (substitute* "build.xml"
4272 (("\\$\\{test.home\\}/java")
4273 "${test.home}/org"))
4274 #t))
a0f15eff
JL
4275 (add-before 'build 'generate-grammar
4276 (lambda _
b101b4e8
RW
4277 (with-directory-excursion "src/org/antlr/stringtemplate/language/"
4278 (every (lambda (file)
4279 (format #t "~a\n" file)
4280 (zero? (system* "antlr" file)))
4281 '("template.g" "angle.bracket.template.g" "action.g"
4282 "eval.g" "group.g" "interface.g"))))))))
a0f15eff 4283 (native-inputs
2fcda6d2
RW
4284 `(("antlr" ,antlr2)
4285 ("java-junit" ,java-junit)))
a0f15eff
JL
4286 (home-page "http://www.stringtemplate.org")
4287 (synopsis "Template engine to generate formatted text output")
4288 (description "StringTemplate is a java template engine (with ports for C#,
4289Objective-C, JavaScript, Scala) for generating source code, web pages, emails,
4290or any other formatted text output. StringTemplate is particularly good at
4291code generators, multiple site skins, and internationalization / localization.
4292StringTemplate also powers ANTLR.")
4293 (license license:bsd-3)))
4ad8aed7
JL
4294
4295;; antlr3 is partially written using antlr3 grammar files. It also depends on
4296;; ST4 (stringtemplate4), which is also partially written using antlr3 grammar
4297;; files and uses antlr3 at runtime. The latest version requires a recent version
4298;; of antlr3 at runtime.
4299;; Fortunately, ST4 4.0.6 can be built with an older antlr3, and we use antlr3.3.
4300;; This version of ST4 is sufficient for the latest antlr3.
4301;; We use ST4 4.0.6 to build a boostrap antlr3 (latest version), and build
4302;; the latest ST4 with it. Then we build our final antlr3 that will be linked
4303;; against the latest ST4.
4304;; antlr3.3 still depends on antlr3 to generate some files, so we use an
4305;; even older version, antlr3.1, to generate them. Fortunately antlr3.1 uses
4306;; only grammar files with the antlr2 syntax.
4307;; So we build antlr3.1 -> antlr3.3 -> ST4.0.6 -> antlr3-bootstrap -> ST4 -> antlr3.
4308
64b7efc0 4309(define-public java-stringtemplate
407df789 4310 (package (inherit java-stringtemplate-3)
64b7efc0 4311 (name "java-stringtemplate")
4ad8aed7
JL
4312 (version "4.0.8")
4313 (source (origin
4314 (method url-fetch)
4315 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/"
4316 version ".tar.gz"))
4317 (file-name (string-append name "-" version ".tar.gz"))
4318 (sha256
4319 (base32
4320 "1pri8hqa95rfdkjy55icl5q1m09zwp5k67ib14abas39s4v3w087"))))
4321 (build-system ant-build-system)
4322 (arguments
6db77c7c
RW
4323 `(#:jar-name (string-append ,name "-" ,version ".jar")
4324 #:tests? #f ; FIXME: tests fail for unknown reasons
4325 #:test-dir "test"
f4aa4cfe
RW
4326 #:modules ((guix build ant-build-system)
4327 (guix build utils)
4328 (srfi srfi-1))
4ad8aed7
JL
4329 #:phases
4330 (modify-phases %standard-phases
6db77c7c
RW
4331 (add-before 'check 'fix-test-target
4332 (lambda _
4333 (substitute* "build.xml"
4334 (("\\$\\{test.home\\}/java") "${test.home}/")
4335 (("\\*Test.java") "Test*.java"))
4336 #t))
4ad8aed7 4337 (add-before 'build 'generate-grammar
f4aa4cfe
RW
4338 (lambda _
4339 (with-directory-excursion "src/org/stringtemplate/v4/compiler/"
4340 (every (lambda (file)
4341 (format #t "~a\n" file)
4342 (zero? (system* "antlr3" file)))
4343 '("STParser.g" "Group.g" "CodeGenerator.g"))))))))
4ad8aed7
JL
4344 (inputs
4345 `(("antlr3" ,antlr3-bootstrap)
4346 ("antlr2" ,antlr2)
6db77c7c
RW
4347 ("java-stringtemplate" ,java-stringtemplate-3)
4348 ("java-junit" ,java-junit)))))
4ad8aed7 4349
1345eeb0 4350(define java-stringtemplate-4.0.6
64b7efc0 4351 (package (inherit java-stringtemplate)
1345eeb0 4352 (name "java-stringtemplate")
4ad8aed7
JL
4353 (version "4.0.6")
4354 (source (origin
4355 (method url-fetch)
4356 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/ST-"
4357 version ".tar.gz"))
4358 (file-name (string-append name "-" version ".tar.gz"))
4359 (sha256
4360 (base32
4361 "0hjmh1ahdsh3w825i67mli9l4nncc4l6hdbf9ma91jvlj590sljp"))))
4362 (inputs
4363 `(("antlr3" ,antlr3-3.3)
4364 ("antlr2" ,antlr2)
e44112e1 4365 ("java-stringtemplate" ,java-stringtemplate-3)))))
4ad8aed7
JL
4366
4367(define-public antlr3
4368 (package
4369 (name "antlr3")
4370 (version "3.5.2")
4371 (source (origin
4372 (method url-fetch)
4373 (uri (string-append "https://github.com/antlr/antlr3/archive/"
4374 version ".tar.gz"))
4375 (file-name (string-append name "-" version ".tar.gz"))
4376 (sha256
4377 (base32
4378 "07zff5frmjd53rnqdx31h0pmswz1lv0p2lp28cspfszh25ysz6sj"))))
4379 (build-system ant-build-system)
4380 (arguments
4381 `(#:jar-name (string-append ,name "-" ,version ".jar")
4382 #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3"
4383 #:tests? #f
4384 #:phases
4385 (modify-phases %standard-phases
4386 (add-after 'install 'bin-install
4387 (lambda* (#:key inputs outputs #:allow-other-keys)
4388 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
4389 (bin (string-append (assoc-ref outputs "out") "/bin")))
4390 (mkdir-p bin)
4391 (with-output-to-file (string-append bin "/antlr3")
4392 (lambda _
4393 (display
4394 (string-append "#!" (which "sh") "\n"
4395 "java -cp " jar "/" ,name "-" ,version ".jar:"
4396 (string-concatenate
4397 (find-files (assoc-ref inputs "stringtemplate")
4398 ".*\\.jar"))
4399 ":"
4400 (string-concatenate
4401 (find-files (assoc-ref inputs "stringtemplate4")
4402 ".*\\.jar"))
4403 ":"
4404 (string-concatenate
4405 (find-files (string-append
4406 (assoc-ref inputs "antlr")
4407 "/lib")
4408 ".*\\.jar"))
4409 " org.antlr.Tool $*"))))
4410 (chmod (string-append bin "/antlr3") #o755))))
4411 (add-before 'build 'generate-grammar
4412 (lambda _
4413 (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/")
4414 (for-each (lambda (file)
4415 (display file)
4416 (newline)
4417 (system* "antlr3" file))
4418 '("ANTLR.g" "ANTLRTreePrinter.g" "ActionAnalysis.g"
4419 "AssignTokenTypesWalker.g"
4420 "ActionTranslator.g" "TreeToNFAConverter.g"
4421 "ANTLRv3.g" "ANTLRv3Tree.g" "LeftRecursiveRuleWalker.g"
4422 "CodeGenTreeWalker.g" "DefineGrammarItemsWalker.g"))
4423 (substitute* "ANTLRParser.java"
4424 (("public Object getTree") "public GrammarAST getTree"))
4425 (substitute* "ANTLRv3Parser.java"
4426 (("public Object getTree") "public CommonTree getTree"))
4427 (chdir "../../../../../java")
4428 (system* "antlr" "-o" "org/antlr/tool"
4429 "org/antlr/tool/serialize.g")
4430 (substitute* "org/antlr/tool/LeftRecursiveRuleAnalyzer.java"
4431 (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*;
4432import org.antlr.grammar.v3.ANTLRTreePrinter;"))
4433 (substitute* "org/antlr/tool/ErrorManager.java"
4434 (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") ""))
4435 (chdir "../../../..")))
4436 (add-before 'build 'fix-build-xml
4437 (lambda _
4438 (substitute* "build.xml"
4439 (("<exec") "<copy todir=\"${classes.dir}\">
4440<fileset dir=\"tool/src/main/resources\">
4441<include name=\"**/*.stg\"/>
4442<include name=\"**/*.st\"/>
4443<include name=\"**/*.sti\"/>
4444<include name=\"**/STLexer.tokens\"/>
4445</fileset>
4446</copy><exec")))))))
4447 (native-inputs
4448 `(("antlr" ,antlr2)
4449 ("antlr3" ,antlr3-bootstrap)))
4450 (inputs
4451 `(("junit" ,java-junit)
e44112e1 4452 ("stringtemplate" ,java-stringtemplate-3)
64b7efc0 4453 ("stringtemplate4" ,java-stringtemplate)))
4ad8aed7 4454 (propagated-inputs
e44112e1 4455 `(("stringtemplate" ,java-stringtemplate-3)
4ad8aed7 4456 ("antlr" ,antlr2)
1345eeb0 4457 ("stringtemplate4" ,java-stringtemplate-4.0.6)))
4ad8aed7
JL
4458 (home-page "http://www.antlr3.org")
4459 (synopsis "Framework for constructing recognizers, compilers, and translators")
4460 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
4461is a language tool that provides a framework for constructing recognizers,
4462compilers, and translators from grammatical descriptions containing Java, C#,
4463C++, or Python actions. ANTLR provides excellent support for tree construction,
4464tree walking, and translation.")
4465 (license license:bsd-3)))
4466
4467(define antlr3-bootstrap
4468 (package
4469 (inherit antlr3)
4470 (name "antlr3-bootstrap")
4471 (native-inputs
4472 `(("antlr" ,antlr2)
4473 ("antlr3" ,antlr3-3.3)))
4474 (inputs
4475 `(("junit" ,java-junit)))))
4476
4477(define antlr3-3.3
4478 (package
4479 (inherit antlr3)
4480 (name "antlr3")
4481 (version "3.3")
4482 (source (origin
4483 (method url-fetch)
4484 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
4485 "gh-pages/download/antlr-"
4486 version ".tar.gz"))
4487 (sha256
4488 (base32
4489 "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m"))))
4490 (arguments
4491 `(#:jar-name (string-append ,name "-" ,version ".jar")
4492 #:source-dir (string-append "tool/src/main/java:runtime/Java/src/main/java:"
4493 "tool/src/main/antlr2:tool/src/main/antlr3")
4494 #:tests? #f
4495 #:phases
4496 (modify-phases %standard-phases
4497 (add-after 'install 'bin-install
4498 (lambda* (#:key inputs outputs #:allow-other-keys)
4499 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
4500 (bin (string-append (assoc-ref outputs "out") "/bin")))
4501 (mkdir-p bin)
4502 (with-output-to-file (string-append bin "/antlr3")
4503 (lambda _
4504 (display
4505 (string-append "#!" (which "sh") "\n"
4506 "java -cp " jar "/antlr3-3.3.jar:"
4507 (string-concatenate
e44112e1 4508 (find-files (assoc-ref inputs "java-stringtemplate")
4ad8aed7
JL
4509 ".*\\.jar"))
4510 ":"
4511 (string-concatenate
4512 (find-files (string-append
4513 (assoc-ref inputs "antlr")
4514 "/lib")
4515 ".*\\.jar"))
4516 " org.antlr.Tool $*"))))
4517 (chmod (string-append bin "/antlr3") #o755))))
4518 (add-before 'build 'generate-grammar
4519 (lambda _
4520 (let ((dir "tool/src/main/antlr2/org/antlr/grammar/v2/"))
4521 (for-each (lambda (file)
4522 (display file)
4523 (newline)
4524 (system* "antlr" "-o" dir (string-append dir file)))
4525 '("antlr.g" "antlr.print.g" "assign.types.g"
4526 "buildnfa.g" "codegen.g" "define.g")))
4527 (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/")
4528 (for-each (lambda (file)
4529 (display file)
4530 (newline)
4531 (system* "antlr3" file))
4532 '("ActionAnalysis.g" "ActionTranslator.g" "ANTLRv3.g"
4533 "ANTLRv3Tree.g"))
4534 (chdir "../../../../../../../..")
4535 (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java"
4536 (("import org.antlr.grammar.v2.\\*;")
4537 "import org.antlr.grammar.v2.*;\n
4538import org.antlr.grammar.v2.TreeToNFAConverter;\n
4539import org.antlr.grammar.v2.DefineGrammarItemsWalker;\n
4540import org.antlr.grammar.v2.ANTLRTreePrinter;"))))
4541 (add-before 'build 'fix-build-xml
4542 (lambda _
4543 (substitute* "build.xml"
4544 (("<exec") "<copy todir=\"${classes.dir}\">
4545<fileset dir=\"tool/src/main/resources\">
4546<include name=\"**/*.stg\"/>
4547<include name=\"**/*.st\"/>
4548<include name=\"**/*.sti\"/>
4549<include name=\"**/STLexer.tokens\"/>
4550</fileset>
4551</copy><exec")))))))
4552 (native-inputs
4553 `(("antlr" ,antlr2)
4554 ("antlr3" ,antlr3-3.1)))
4555 (inputs
4556 `(("junit" ,java-junit)))
4557 (propagated-inputs
e44112e1 4558 `(("java-stringtemplate" ,java-stringtemplate-3)
4ad8aed7
JL
4559 ("antlr" ,antlr2)
4560 ("antlr3" ,antlr3-3.1)))))
4561
4562(define antlr3-3.1
4563 (package
4564 (inherit antlr3)
4565 (name "antlr3-3.1")
4566 (version "3.1")
4567 (source (origin
4568 (method url-fetch)
4569 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
4570 "gh-pages/download/antlr-"
4571 version ".tar.gz"))
4572 (sha256
4573 (base32
4574 "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z"))))
4575 (arguments
4576 `(#:jar-name (string-append ,name "-" ,version ".jar")
4577 #:source-dir "src:runtime/Java/src"
4578 #:tests? #f
4579 #:phases
4580 (modify-phases %standard-phases
4581 (add-after 'install 'bin-install
4582 (lambda* (#:key inputs outputs #:allow-other-keys)
4583 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
4584 (bin (string-append (assoc-ref outputs "out") "/bin")))
4585 (mkdir-p bin)
4586 (with-output-to-file (string-append bin "/antlr3")
4587 (lambda _
4588 (display
4589 (string-append "#!" (which "sh") "\n"
4590 "java -cp " jar "/antlr3-3.1-3.1.jar:"
4591 (string-concatenate
4592 (find-files (assoc-ref inputs "stringtemplate")
4593 ".*\\.jar"))
4594 ":"
4595 (string-concatenate
4596 (find-files (string-append
4597 (assoc-ref inputs "antlr")
4598 "/lib")
4599 ".*\\.jar"))
4600 " org.antlr.Tool $*"))))
4601 (chmod (string-append bin "/antlr3") #o755))))
4602 (add-before 'build 'generate-grammar
4603 (lambda _
4604 (let ((dir "src/org/antlr/tool/"))
4605 (for-each (lambda (file)
4606 (display file)
4607 (newline)
4608 (system* "antlr" "-o" dir (string-append dir file)))
4609 '("antlr.g" "antlr.print.g" "assign.types.g"
4610 "buildnfa.g" "define.g")))
4611 (format #t "codegen.g\n")
4612 (system* "antlr" "-o" "src/org/antlr/codegen"
4613 "src/org/antlr/codegen/codegen.g")))
4614 (add-before 'build 'fix-build-xml
4615 (lambda _
4616 (substitute* "build.xml"
4617 (("<exec") "<copy todir=\"${classes.dir}\">
4618<fileset dir=\"src\">
4619<include name=\"**/*.stg\"/>
4620<include name=\"**/*.st\"/>
4621<include name=\"**/*.sti\"/>
4622<include name=\"**/STLexer.tokens\"/>
4623</fileset>
4624</copy><exec")))))))
4625 (native-inputs
4626 `(("antlr" ,antlr2)))
4627 (inputs
4628 `(("junit" ,java-junit)))
4629 (propagated-inputs
e44112e1 4630 `(("stringtemplate" ,java-stringtemplate-3)))))
d44bcd7a
RW
4631
4632(define-public java-asm
4633 (package
4634 (name "java-asm")
4635 (version "5.2")
4636 (source (origin
4637 (method url-fetch)
4638 (uri (string-append "http://download.forge.ow2.org/asm/"
4639 "asm-" version ".tar.gz"))
4640 (sha256
4641 (base32
4642 "0kxvmv5275rnjl7jv0442k3wjnq03ngkb7sghs78avf45pzm4qgr"))))
4643 (build-system ant-build-system)
4644 (arguments
4645 `(#:build-target "compile"
4646 #:test-target "test"
4647 ;; The tests require an old version of Janino, which no longer compiles
4648 ;; with the JDK7.
4649 #:tests? #f
4650 ;; We don't need these extra ant tasks, but the build system asks us to
4651 ;; provide a path anyway.
4652 #:make-flags (list (string-append "-Dobjectweb.ant.tasks.path=foo"))
4653 #:phases
4654 (modify-phases %standard-phases
4655 (add-before 'install 'build-jars
4656 (lambda* (#:key make-flags #:allow-other-keys)
4657 ;; We cannot use the "jar" target because it depends on a couple
4658 ;; of unpackaged, complicated tools.
4659 (mkdir "dist")
4660 (zero? (system* "jar"
4661 "-cf" (string-append "dist/asm-" ,version ".jar")
4662 "-C" "output/build/tmp" "."))))
4663 (replace 'install
4664 (install-jars "dist")))))
4665 (native-inputs
4666 `(("java-junit" ,java-junit)))
4667 (home-page "http://asm.ow2.org/")
4668 (synopsis "Very small and fast Java bytecode manipulation framework")
4669 (description "ASM is an all purpose Java bytecode manipulation and
4670analysis framework. It can be used to modify existing classes or dynamically
4671generate classes, directly in binary form. The provided common
4672transformations and analysis algorithms allow to easily assemble custom
4673complex transformations and code analysis tools.")
4674 (license license:bsd-3)))
742242a5
GB
4675
4676(define-public java-commons-cli-1.2
4677 ;; This is a bootstrap dependency for Maven2.
4678 (package
4679 (inherit java-commons-cli)
4680 (version "1.2")
4681 (source (origin
4682 (method url-fetch)
4683 (uri (string-append "mirror://apache/commons/cli/source/"
4684 "commons-cli-" version "-src.tar.gz"))
4685 (sha256
4686 (base32
4687 "0rvfgzgv2pc1m091dfj3ih9ddsjjppr1f1wf0qmc3bk6b1kwv2dm"))))
4688 (arguments
4689 `(#:jar-name "commons-cli.jar"
4690 #:phases
4691 (modify-phases %standard-phases
4692 (add-before 'check 'fix-build-xml
4693 (lambda* (#:key inputs #:allow-other-keys)
4694 (substitute* "build.xml"
4695 (("dir=\"\\$\\{test.home\\}/java\"")
4696 "dir=\"${test.home}\""))
4697 #t)))))
4698 (native-inputs
4699 `(("java-junit" ,java-junit)))))