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