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