1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
4 ;;; Copyright © 2016, 2017 Roel Janssen <roel@gnu.org>
5 ;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
6 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
8 ;;; This file is part of GNU Guix.
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.
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.
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/>.
23 (define-module (gnu packages java)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix hg-download)
28 #:use-module (guix git-download)
29 #:use-module (guix utils)
30 #:use-module (guix build-system ant)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix build-system trivial)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages attr)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages bash)
38 #:use-module (gnu packages certs)
39 #:use-module (gnu packages cpio)
40 #:use-module (gnu packages cups)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages fontutils)
43 #:use-module (gnu packages gawk)
44 #:use-module (gnu packages gettext)
45 #:use-module (gnu packages gcc)
46 #:use-module (gnu packages gl)
47 #:use-module (gnu packages gnuzilla) ;nss
48 #:use-module (gnu packages ghostscript) ;lcms
49 #:use-module (gnu packages gnome)
50 #:use-module (gnu packages gtk)
51 #:use-module (gnu packages guile)
52 #:use-module (gnu packages icu4c)
53 #:use-module (gnu packages image)
54 #:use-module (gnu packages linux) ;alsa
55 #:use-module (gnu packages wget)
56 #:use-module (gnu packages pkg-config)
57 #:use-module (gnu packages perl)
58 #:use-module (gnu packages kerberos)
59 #:use-module (gnu packages xml)
60 #:use-module (gnu packages xorg)
61 #:use-module (gnu packages zip)
62 #:use-module (gnu packages texinfo)
63 #:use-module ((srfi srfi-1) #:select (fold alist-delete))
64 #:use-module (srfi srfi-11)
65 #:use-module (ice-9 match))
69 ;;; Java bootstrap toolchain.
72 ;; The Java bootstrap begins with Jikes, a Java compiler written in C++. We
73 ;; use it to build the SableVM standard library and virtual machine, which are
74 ;; written in a simpler dialect of Java and C, respectively. This is
75 ;; sufficient to build an older version of Ant, which is needed to build an
76 ;; older version of ECJ, an incremental Java compiler, both of which are
79 ;; ECJ is needed to build the latest release of GNU Classpath (0.99).
80 ;; Classpath (> 0.98) is a requirement for JamVM, a more modern implementation
81 ;; of the Java virtual machine.
83 ;; With JamVM we can build the latest development version of GNU Classpath,
84 ;; which has much more support for Java 1.6 than the latest release. Since
85 ;; the previous build of JamVM is limited by the use of GNU Classpath 0.99 we
86 ;; rebuild it with the latest development version of GNU Classpath.
88 ;; Finally, we use the bootstrap toolchain to build the OpenJDK with the
89 ;; Icedtea 1.x build framework. We then build the more recent JDKs Icedtea
90 ;; 2.x and Icedtea 3.x.
98 (uri (string-append "mirror://sourceforge/jikes/Jikes/"
99 version "/jikes-" version ".tar.bz2"))
102 "1qqldrp74pzpy5ly421srqn30qppmm9cvjiqdngk8hf47dv2rc0c"))))
103 (build-system gnu-build-system)
104 (home-page "http://jikes.sourceforge.net/")
105 (synopsis "Compiler for the Java language")
106 (description "Jikes is a compiler that translates Java source files as
107 defined in The Java Language Specification into the bytecoded instruction set
108 and binary format defined in The Java Virtual Machine Specification.")
109 (license license:ibmpl1.0)))
111 (define sablevm-classpath
113 (name "sablevm-classpath")
117 (uri (string-append "mirror://sourceforge/sablevm/sablevm/"
118 version "/sablevm-classpath-" version ".tar.gz"))
121 "1qyhyfz8idghxdam16hdgpa24r2x4xbg9z8c8asa3chnd79h3zw2"))))
122 (build-system gnu-build-system)
139 ("pkg-config" ,pkg-config)))
140 (home-page "http://sablevm.org/")
141 (synopsis "Java Virtual Machine")
142 (description "SableVM is a clean-room, highly portable and efficient Java
143 virtual machine. Its goals are to be reasonably small, fast, and compliant
144 with the various specifications (JVM specification, JNI, invocation interface,
145 etc.). SableVM is no longer maintained.
147 This package provides the classpath library.")
148 (license license:lgpl2.1+)))
156 (uri (string-append "mirror://sourceforge/sablevm/sablevm/"
157 version "/sablevm-" version ".tar.gz"))
160 "1jyg4bsym6igz94wps5443c7wiwlzinqzkchcw972nz4kf1cql6g"))))
161 (build-system gnu-build-system)
164 (modify-phases %standard-phases
165 (add-after 'unpack 'patch-path-to-classpath
166 (lambda* (#:key inputs #:allow-other-keys)
167 (substitute* "Makefile.in"
168 (("@datadir@/sablevm-classpath")
169 (string-append (assoc-ref inputs "classpath")
170 "/share/sablevm-classpath")))
171 (substitute* "src/libsablevm/Makefile.in"
172 (("\\$\\(libdir\\)/sablevm-classpath")
173 (string-append (assoc-ref inputs "classpath")
174 "/lib/sablevm-classpath"))
175 (("\\$\\(datadir\\)/sablevm-classpath")
176 (string-append (assoc-ref inputs "classpath")
177 "/share/sablevm-classpath")))
180 `(("classpath" ,sablevm-classpath)
184 `(("libltdl" ,libltdl)))
185 (home-page "http://sablevm.org/")
186 (synopsis "Java Virtual Machine")
187 (description "SableVM is a clean-room, highly portable and efficient Java
188 virtual machine. Its goals are to be reasonably small, fast, and compliant
189 with the various specifications (JVM specification, JNI, invocation interface,
190 etc.). SableVM is no longer maintained.
192 This package provides the virtual machine.")
193 (license license:lgpl2.1+)))
195 (define ant-bootstrap
197 (name "ant-bootstrap")
198 ;; The 1.10.x series requires Java 8. 1.9.0 and later use generics, which
199 ;; are not supported. The 1.8.x series is the last to use only features
200 ;; supported by Jikes, but it cannot seem to be built with sablevm.
204 (uri (string-append "http://archive.apache.org/dist/"
205 "ant/source/apache-ant-"
206 version "-src.tar.bz2"))
209 "19pvqvgkxgpgsqm4lvbki5sm0z84kxmykdqicvfad47gc1r9mi2d"))))
210 (build-system gnu-build-system)
212 `(#:tests? #f ; no "check" target
214 (modify-phases %standard-phases
217 (lambda* (#:key inputs #:allow-other-keys)
219 (string-append (assoc-ref inputs "sablevm")
222 (string-append (assoc-ref inputs "sablevm")
223 "/bin/java-sablevm"))
225 (string-append (assoc-ref inputs "sablevm")
226 "/bin/javac-sablevm"))
228 ;; Use jikes instead of javac for <javac ...> tags in build.xml
229 (setenv "ANT_OPTS" "-Dbuild.compiler=jikes")
231 ;; jikes produces lots of warnings, but they are not very
232 ;; interesting, so we silence them.
233 (setenv "$BOOTJAVAC_OPTS" "-nowarn")
235 ;; Disable tests because we are bootstrapping and thus don't have
236 ;; any of the dependencies required to build and run the tests.
237 (substitute* "build.xml"
238 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
239 (zero? (system* "bash" "bootstrap.sh"
240 (string-append "-Ddist.dir="
241 (assoc-ref %outputs "out"))))))
245 ("sablevm" ,sablevm)))
246 (home-page "http://ant.apache.org")
247 (synopsis "Build tool for Java")
249 "Ant is a platform-independent build tool for Java. It is similar to
250 make but is implemented using the Java language, requires the Java platform,
251 and is best suited to building Java projects. Ant uses XML to describe the
252 build process and its dependencies, whereas Make uses Makefile format.")
253 (license license:asl2.0)))
255 ;; Version 3.2.2 is the last version without a dependency on a full-fledged
256 ;; compiler for Java 1.5.
257 (define ecj-bootstrap
259 (name "ecj-bootstrap")
263 (uri (string-append "http://archive.eclipse.org/eclipse/"
264 "downloads/drops/R-" version
265 "-200702121330/ecjsrc.zip"))
268 "05hj82kxd23qaglsjkaqcj944riisjha7acf7h3ljhrjyljx8307"))))
269 ;; It would be so much easier if we could use the ant-build-system, but we
270 ;; cannot as we don't have ant at this point. We use ecj for
271 ;; bootstrapping the JDK.
272 (build-system gnu-build-system)
274 `(#:modules ((guix build gnu-build-system)
277 #:tests? #f ; there are no tests
279 (modify-phases %standard-phases
281 (lambda* (#:key inputs #:allow-other-keys)
284 (find-files (string-append (assoc-ref inputs "ant-bootstrap")
290 (lambda* (#:key inputs #:allow-other-keys)
291 ;; The unpack phase enters the "org" directory by mistake.
294 ;; Create a simple manifest to make ecj executable.
295 (with-output-to-file "manifest"
297 (display "Manifest-Version: 1.0
298 Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n")))
301 (and (zero? (apply system* "javac-sablevm"
302 (find-files "." "\\.java$")))
303 (zero? (system* "fastjar" "cvfm"
304 "ecj-bootstrap.jar" "manifest" ".")))))
306 (lambda* (#:key outputs #:allow-other-keys)
307 (let ((share (string-append (assoc-ref outputs "out")
310 (install-file "ecj-bootstrap.jar" share)
313 `(("ant-bootstrap" ,ant-bootstrap)
316 ("fastjar" ,fastjar)))
317 (home-page "https://eclipse.org")
318 (synopsis "Eclipse Java development tools core batch compiler")
319 (description "This package provides the Eclipse Java core batch compiler
320 for bootstrapping purposes. The @dfn{Eclipse compiler for Java} (ecj) is a
321 requirement for all GNU Classpath releases after version 0.93.")
322 (license license:epl1.0)))
324 (define ecj-javac-wrapper
325 (package (inherit ecj-bootstrap)
326 (name "ecj-javac-wrapper")
328 (build-system trivial-build-system)
330 `(#:modules ((guix build utils))
332 (let ((backend 'sablevm))
333 (use-modules (guix build utils))
334 (let* ((bin (string-append (assoc-ref %outputs "out") "/bin"))
335 (target (string-append bin "/javac"))
336 (guile (string-append (assoc-ref %build-inputs "guile")
338 (ecj (string-append (assoc-ref %build-inputs "ecj-bootstrap")
339 "/share/java/ecj-bootstrap.jar"))
342 (string-append (assoc-ref %build-inputs "sablevm")
343 "/lib/sablevm/bin/java"))
345 (string-append (assoc-ref %build-inputs "jamvm")
347 (bootcp (case backend
349 (let ((jvmlib (string-append
350 (assoc-ref %build-inputs "sablevm-classpath")
352 (string-append jvmlib "/jre/lib/rt.jar")))
354 (let ((jvmlib (string-append (assoc-ref %build-inputs "classpath")
355 "/share/classpath")))
356 (string-append jvmlib "/lib/glibj.zip:"
357 jvmlib "/lib/tools.zip"))))))
359 (with-output-to-file target
361 (format #t "#!~a --no-auto-compile\n!#\n" guile)
363 `(begin (use-modules (ice-9 match)
369 '(("-bootclasspath" ,bootcp)
374 (let ((classpath (getenv "CLASSPATH")))
378 (string-append ":" classpath)
380 (receive (vm-args other-args)
381 ;; Separate VM arguments from arguments to ECJ.
382 (partition (cut string-prefix? "-J" <>)
383 (fold (lambda (default acc)
384 (if (member (first default) acc)
385 acc (append default acc)))
389 ;; Remove "-J" prefix
390 (map (cut string-drop <> 2) vm-args)
391 '("org.eclipse.jdt.internal.compiler.batch.Main")
392 (cons "-nowarn" other-args)))))
394 (let ((args (cdr (command-line))))
396 (format (current-error-port) "javac: no arguments given!\n")
401 `(("guile" ,guile-2.2)
402 ("ecj-bootstrap" ,ecj-bootstrap)
404 ("sablevm-classpath" ,sablevm-classpath)))
405 (description "This package provides a wrapper around the @dfn{Eclipse
406 compiler for Java} (ecj) with a command line interface that is compatible with
407 the standard javac executable.")))
409 ;; Note: All the tool wrappers (e.g. for javah, javac, etc) fail with
410 ;; java.lang.UnsupportedClassVersionError. They simply won't run on the old
411 ;; sablevm. We use Classpath 0.99 to build JamVM, on which the Classpath
412 ;; tools do run. Using these Classpath tools on JamVM we can then build the
413 ;; development version of GNU Classpath.
414 (define classpath-on-sablevm
420 (uri (string-append "mirror://gnu/classpath/classpath-"
424 "1j7cby4k66f1nvckm48xcmh352b1d1b33qk7l6hi7dp9i9zjjagr"))))
425 (build-system gnu-build-system)
428 (list (string-append "--with-ecj-jar="
429 (assoc-ref %build-inputs "ecj-bootstrap")
430 "/share/java/ecj-bootstrap.jar")
431 (string-append "JAVAC="
432 (assoc-ref %build-inputs "ecj-javac-wrapper")
434 (string-append "JAVA="
435 (assoc-ref %build-inputs "sablevm")
438 "ac_cv_prog_java_works=yes" ; trust me
442 "--disable-gconf-peer"
448 (modify-phases %standard-phases
449 (add-after 'install 'install-data
450 (lambda _ (zero? (system* "make" "install-data")))))))
452 `(("ecj-bootstrap" ,ecj-bootstrap)
453 ("ecj-javac-wrapper" ,ecj-javac-wrapper)
456 ("sablevm-classpath" ,sablevm-classpath)
458 ("pkg-config" ,pkg-config)))
459 (home-page "https://www.gnu.org/software/classpath/")
460 (synopsis "Essential libraries for Java")
461 (description "GNU Classpath is a project to create core class libraries
462 for use with runtimes, compilers and tools for the Java programming
464 ;; GPLv2 or later, with special linking exception.
465 (license license:gpl2+)))
467 (define jamvm-bootstrap
473 (uri (string-append "mirror://sourceforge/jamvm/jamvm/"
474 "JamVM%20" version "/jamvm-"
478 "1nl0zxz8y5x8gwsrm7n32bry4dx8x70p8z3s9jbdvs8avyb8whkn"))))
479 (build-system gnu-build-system)
482 (list (string-append "--with-classpath-install-dir="
483 (assoc-ref %build-inputs "classpath")))))
485 `(("classpath" ,classpath-on-sablevm)
486 ("ecj-javac-wrapper" ,ecj-javac-wrapper)
488 (home-page "http://jamvm.sourceforge.net/")
489 (synopsis "Small Java Virtual Machine")
490 (description "JamVM is a Java Virtual Machine conforming to the JVM
491 specification edition 2 (blue book). It is extremely small. However, unlike
492 other small VMs it supports the full spec, including object finalisation and
494 (license license:gpl2+)))
496 ;; We need this because the tools provided by the latest release of GNU
497 ;; Classpath don't actually work with sablevm.
498 (define classpath-jamvm-wrappers
499 (package (inherit classpath-on-sablevm)
500 (name "classpath-jamvm-wrappers")
502 (build-system trivial-build-system)
504 `(#:modules ((guix build utils))
507 (use-modules (guix build utils))
508 (let* ((bash (assoc-ref %build-inputs "bash"))
509 (jamvm (assoc-ref %build-inputs "jamvm"))
510 (classpath (assoc-ref %build-inputs "classpath"))
511 (bin (string-append (assoc-ref %outputs "out")
514 (for-each (lambda (tool)
515 (with-output-to-file (string-append bin tool)
517 (format #t "#!~a/bin/sh
518 ~a/bin/jamvm -classpath ~a/share/classpath/tools.zip \
519 gnu.classpath.tools.~a.~a $@"
520 bash jamvm classpath tool
521 (if (string=? "native2ascii" tool)
522 "Native2ASCII" "Main"))))
523 (chmod (string-append bin tool) #o755))
533 ("jamvm" ,jamvm-bootstrap)
534 ("classpath" ,classpath-on-sablevm)))
536 (synopsis "Executables from GNU Classpath")
537 (description "This package provides wrappers around the tools provided by
538 the GNU Classpath library. They are executed by the JamVM virtual
541 (define ecj-javac-on-jamvm-wrapper
542 (package (inherit ecj-javac-wrapper)
543 (name "ecj-javac-on-jamvm-wrapper")
545 `(#:modules ((guix build utils))
547 ;; TODO: This builder is exactly the same as in ecj-javac-wrapper,
548 ;; except that the backend is 'jamvm here. Can we reuse the same
550 (let ((backend 'jamvm))
551 (use-modules (guix build utils))
552 (let* ((bin (string-append (assoc-ref %outputs "out") "/bin"))
553 (target (string-append bin "/javac"))
554 (guile (string-append (assoc-ref %build-inputs "guile")
556 (ecj (string-append (assoc-ref %build-inputs "ecj-bootstrap")
557 "/share/java/ecj-bootstrap.jar"))
560 (string-append (assoc-ref %build-inputs "sablevm")
561 "/lib/sablevm/bin/java"))
563 (string-append (assoc-ref %build-inputs "jamvm")
565 (bootcp (case backend
567 (let ((jvmlib (string-append
568 (assoc-ref %build-inputs "sablevm-classpath")
570 (string-append jvmlib "/jre/lib/rt.jar")))
572 (let ((jvmlib (string-append (assoc-ref %build-inputs "classpath")
573 "/share/classpath")))
574 (string-append jvmlib "/lib/glibj.zip:"
575 jvmlib "/lib/tools.zip"))))))
577 (with-output-to-file target
579 (format #t "#!~a --no-auto-compile\n!#\n" guile)
581 `(begin (use-modules (ice-9 match)
587 '(("-bootclasspath" ,bootcp)
592 (let ((classpath (getenv "CLASSPATH")))
596 (string-append ":" classpath)
598 (receive (vm-args other-args)
599 ;; Separate VM arguments from arguments to ECJ.
600 (partition (cut string-prefix? "-J" <>)
601 (fold (lambda (default acc)
602 (if (member (first default) acc)
603 acc (append default acc)))
607 ;; Remove "-J" prefix
608 (map (cut string-drop <> 2) vm-args)
609 '("org.eclipse.jdt.internal.compiler.batch.Main")
610 (cons "-nowarn" other-args)))))
612 (let ((args (cdr (command-line))))
614 (format (current-error-port) "javac: no arguments given!\n")
619 `(("guile" ,guile-2.2)
620 ("ecj-bootstrap" ,ecj-bootstrap)
621 ("jamvm" ,jamvm-bootstrap)
622 ("classpath" ,classpath-on-sablevm)))
623 (description "This package provides a wrapper around the @dfn{Eclipse
624 compiler for Java} (ecj) with a command line interface that is compatible with
625 the standard javac executable. The tool runs on JamVM instead of SableVM.")))
627 ;; The last release of GNU Classpath is 0.99 and it happened in 2012. Since
628 ;; then Classpath has gained much more support for Java 1.6.
629 (define-public classpath-devel
630 (let ((commit "e7c13ee0cf2005206fbec0eca677f8cf66d5a103")
632 (package (inherit classpath-on-sablevm)
633 (version (string-append "0.99-" revision "." (string-take commit 9)))
637 (url "git://git.savannah.gnu.org/classpath.git")
641 "1v2rww76ww322mpg3s12a1kkc6gkp31bm9gcxs532h0wq285fiw4"))))
644 ;; Ensure that the initial heap size is smaller than the maximum
645 ;; size. By default only Xmx is set, which can lead to invalid
646 ;; memory settings on some machines with a lot of memory.
647 '("JAVAC_MEM_OPT=-J-Xms512M -J-Xmx768M")
649 (list (string-append "--with-ecj-jar="
650 (assoc-ref %build-inputs "ecj-bootstrap")
651 "/share/java/ecj-bootstrap.jar")
652 (string-append "--with-javac="
653 (assoc-ref %build-inputs "ecj-javac-wrapper")
655 (string-append "JAVA="
656 (assoc-ref %build-inputs "jamvm")
659 "ac_cv_prog_java_works=yes" ; trust me
663 "--disable-gconf-peer"
669 (modify-phases %standard-phases
670 (add-before 'configure 'bootstrap
672 (zero? (system* "autoreconf" "-vif"))))
673 (add-after 'unpack 'remove-unsupported-annotations
675 (substitute* (find-files "java" "\\.java$")
678 (add-after 'install 'install-data
679 (lambda _ (zero? (system* "make" "install-data")))))))
681 `(("autoconf" ,autoconf)
682 ("automake" ,automake)
684 ("gettext" ,gettext-minimal)
686 ("classpath-jamvm-wrappers" ,classpath-jamvm-wrappers) ; for javah
687 ("ecj-bootstrap" ,ecj-bootstrap)
688 ("ecj-javac-wrapper" ,ecj-javac-on-jamvm-wrapper)
690 ("jamvm" ,jamvm-bootstrap)
692 ("pkg-config" ,pkg-config))))))
695 (package (inherit jamvm-bootstrap)
697 `(("classpath" ,classpath-devel)
698 ("ecj-javac-wrapper" ,ecj-javac-on-jamvm-wrapper)
701 (define ecj-javac-on-jamvm-wrapper-final
702 (package (inherit ecj-javac-on-jamvm-wrapper)
704 `(("guile" ,guile-2.2)
705 ("ecj-bootstrap" ,ecj-bootstrap)
707 ("classpath" ,classpath-devel)))))
709 ;; The bootstrap JDK consisting of jamvm, classpath-devel,
710 ;; ecj-javac-on-jamvm-wrapper-final cannot build Icedtea 2.x directly, because
711 ;; it's written in Java 7. It can, however, build the unmaintained Icedtea
712 ;; 1.x, which uses Java 6 only.
713 (define-public icedtea-6
720 "http://icedtea.wildebeest.org/download/source/icedtea6-"
724 "0bg9sb4f7qbq77c0zf9m17p47ga0kf0r9622g9p12ysg26jd1ksg"))
725 (modules '((guix build utils)))
727 '(substitute* "Makefile.in"
728 ;; do not leak information about the build host
729 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
730 "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
731 (build-system gnu-build-system)
732 (outputs '("out" ; Java Runtime Environment
733 "jdk" ; Java Development Kit
734 "doc")) ; all documentation
736 `(;; There are many failing tests and many are known to fail upstream.
739 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
740 ;; gremlin) doesn't support it yet, so skip this phase.
741 #:validate-runpath? #f
743 #:modules ((guix build utils)
744 (guix build gnu-build-system)
748 `("--enable-bootstrap"
751 "--with-parallel-jobs"
752 "--disable-downloading"
754 ,(string-append "--with-ecj="
755 (assoc-ref %build-inputs "ecj")
756 "/share/java/ecj-bootstrap.jar")
757 ,(string-append "--with-jar="
758 (assoc-ref %build-inputs "fastjar")
760 ,(string-append "--with-jdk-home="
761 (assoc-ref %build-inputs "classpath"))
762 ,(string-append "--with-java="
763 (assoc-ref %build-inputs "jamvm")
766 (modify-phases %standard-phases
768 (lambda* (#:key source inputs #:allow-other-keys)
769 (and (zero? (system* "tar" "xvf" source))
771 (chdir (string-append "icedtea6-" ,version))
773 (copy-recursively (assoc-ref inputs "openjdk-src") "openjdk")
774 ;; The convenient OpenJDK source bundle is no longer
775 ;; available for download, so we have to take the sources
776 ;; from the Mercurial repositories and change the Makefile
777 ;; to avoid tests for the OpenJDK zip archive.
778 (with-directory-excursion "openjdk"
779 (for-each (lambda (part)
783 (string-append part "-src"))
785 '("jdk" "hotspot" "corba"
786 "langtools" "jaxp" "jaxws")))
787 (substitute* "Makefile.in"
788 (("echo \"ERROR: No up-to-date OpenJDK zip available\"; exit -1;")
789 "echo \"trust me\";")
790 ;; The contents of the bootstrap directory must be
791 ;; writeable but when copying from the store they are
793 (("mkdir -p lib/rt" line)
794 (string-append line "; chmod -R u+w $(BOOT_DIR)")))
795 (zero? (system* "chmod" "-R" "u+w" "openjdk"))
797 (add-after 'unpack 'use-classpath
798 (lambda* (#:key inputs #:allow-other-keys)
799 (let ((jvmlib (assoc-ref inputs "classpath")))
800 ;; Classpath does not provide rt.jar.
801 (substitute* "Makefile.in"
802 (("\\$\\(SYSTEM_JDK_DIR\\)/jre/lib/rt.jar")
803 (string-append jvmlib "/share/classpath/glibj.zip")))
804 ;; Make sure we can find all classes.
806 (string-append jvmlib "/share/classpath/glibj.zip:"
807 jvmlib "/share/classpath/tools.zip"))
809 (string-append "-cp "
810 jvmlib "/share/classpath/glibj.zip:"
811 jvmlib "/share/classpath/tools.zip")))
813 (add-after 'unpack 'patch-patches
815 ;; shebang in patches so that they apply cleanly
816 (substitute* '("patches/jtreg-jrunscript.patch"
817 "patches/hotspot/hs23/drop_unlicensed_test.patch")
818 (("#!/bin/sh") (string-append "#!" (which "sh"))))
820 (add-after 'unpack 'patch-paths
821 (lambda* (#:key inputs #:allow-other-keys)
822 ;; buildtree.make generates shell scripts, so we need to replace
823 ;; the generated shebang
824 (substitute* '("openjdk/hotspot/make/linux/makefiles/buildtree.make")
825 (("/bin/sh") (which "bash")))
827 (let ((corebin (string-append
828 (assoc-ref inputs "coreutils") "/bin/"))
829 (binbin (string-append
830 (assoc-ref inputs "binutils") "/bin/"))
831 (grepbin (string-append
832 (assoc-ref inputs "grep") "/bin/")))
833 (substitute* '("openjdk/jdk/make/common/shared/Defs-linux.gmk"
834 "openjdk/corba/make/common/shared/Defs-linux.gmk")
835 (("UNIXCOMMAND_PATH = /bin/")
836 (string-append "UNIXCOMMAND_PATH = " corebin))
837 (("USRBIN_PATH = /usr/bin/")
838 (string-append "USRBIN_PATH = " corebin))
839 (("DEVTOOLS_PATH *= */usr/bin/")
840 (string-append "DEVTOOLS_PATH = " corebin))
841 (("COMPILER_PATH *= */usr/bin/")
842 (string-append "COMPILER_PATH = "
843 (assoc-ref inputs "gcc") "/bin/"))
844 (("DEF_OBJCOPY *=.*objcopy")
845 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
847 ;; fix path to alsa header
848 (substitute* "openjdk/jdk/make/common/shared/Sanity.gmk"
849 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
850 (string-append "ALSA_INCLUDE="
851 (assoc-ref inputs "alsa-lib")
852 "/include/alsa/version.h")))
854 ;; fix hard-coded utility paths
855 (substitute* '("openjdk/jdk/make/common/shared/Defs-utils.gmk"
856 "openjdk/corba/make/common/shared/Defs-utils.gmk")
858 (string-append "ECHO = " (which "echo")))
860 (string-append "GREP = " (which "grep")))
862 (string-append "EGREP = " (which "egrep")))
864 (string-append "CPIO = " (which "cpio")))
865 (("READELF *=.*readelf")
866 (string-append "READELF = " (which "readelf")))
868 (string-append "AR = " (which "ar")))
870 (string-append "TAR = " (which "tar")))
872 (string-append "AS = " (which "as")))
874 (string-append "LD = " (which "ld")))
876 (string-append "STRIP = " (which "strip")))
878 (string-append "NM = " (which "nm")))
880 (string-append "SH = " (which "bash")))
882 (string-append "FIND = " (which "find")))
884 (string-append "LDD = " (which "ldd")))
885 (("NAWK *=.*(n|g)awk")
886 (string-append "NAWK = " (which "gawk")))
888 (string-append "XARGS = " (which "xargs")))
890 (string-append "UNZIP = " (which "unzip")))
892 (string-append "ZIPEXE = " (which "zip")))
894 (string-append "SED = " (which "sed"))))
896 ;; Some of these timestamps cause problems as they are more than
897 ;; 10 years ago, failing the build process.
899 "openjdk/jdk/src/share/classes/java/util/CurrencyData.properties"
900 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
901 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
902 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
903 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY"))
905 (add-before 'configure 'set-additional-paths
906 (lambda* (#:key inputs #:allow-other-keys)
908 (string-append (assoc-ref inputs "libxrender")
909 "/include/X11/extensions" ":"
910 (assoc-ref inputs "libxtst")
911 "/include/X11/extensions" ":"
912 (assoc-ref inputs "libxinerama")
913 "/include/X11/extensions" ":"
914 (or (getenv "CPATH") "")))
915 (setenv "ALT_CUPS_HEADERS_PATH"
916 (string-append (assoc-ref inputs "cups")
918 (setenv "ALT_FREETYPE_HEADERS_PATH"
919 (string-append (assoc-ref inputs "freetype")
921 (setenv "ALT_FREETYPE_LIB_PATH"
922 (string-append (assoc-ref inputs "freetype")
926 (lambda* (#:key outputs #:allow-other-keys)
927 (let ((doc (string-append (assoc-ref outputs "doc")
928 "/share/doc/icedtea"))
929 (jre (assoc-ref outputs "out"))
930 (jdk (assoc-ref outputs "jdk")))
931 (copy-recursively "openjdk.build/docs" doc)
932 (copy-recursively "openjdk.build/j2re-image" jre)
933 (copy-recursively "openjdk.build/j2sdk-image" jdk))
936 `(("ant" ,ant-bootstrap)
937 ("alsa-lib" ,alsa-lib)
939 ("classpath" ,classpath-devel)
940 ("coreutils" ,coreutils)
943 ("ecj" ,ecj-bootstrap)
944 ("ecj-javac" ,ecj-javac-on-jamvm-wrapper-final)
946 ("fontconfig" ,fontconfig)
947 ("freetype" ,freetype)
958 ("libxcomposite" ,libxcomposite)
960 ("libxinerama" ,libxinerama)
961 ("libxrender" ,libxrender)
962 ("libxslt" ,libxslt) ;for xsltproc
965 ("mit-krb5" ,mit-krb5)
967 ("nss-certs" ,nss-certs)
969 ("pkg-config" ,pkg-config)
970 ("procps" ,procps) ;for "free", even though I'm not sure we should use it
980 (url "http://hg.openjdk.java.net/jdk6/jdk6/")
981 (changeset "jdk6-b41")))
984 "14q47yfg586fs64w30g8mk92m5dkxsvr36zzh0ra99xk5x0x96mv"))))
989 (url "http://hg.openjdk.java.net/jdk6/jdk6/jdk/")
990 (changeset "jdk6-b41")))
993 "165824nhg1k1dx6zs9dny0j49rmk35jw5b13dmz8c77jfajml4v9"))))
998 (url "http://hg.openjdk.java.net/jdk6/jdk6/hotspot/")
999 (changeset "jdk6-b41")))
1002 "07lc1z4k5dj9nrc1wvwmpvxr3xgxrdkdh53xb95skk5ij49yagfd"))))
1007 (url "http://hg.openjdk.java.net/jdk6/jdk6/corba/")
1008 (changeset "jdk6-b41")))
1011 "1p9g1r9dnax2iwp7yb59qx7m4nmshqhwmrb2b8jj8zgbd9dl2i3q"))))
1016 (url "http://hg.openjdk.java.net/jdk6/jdk6/langtools/")
1017 (changeset "jdk6-b41")))
1020 "1x52wd67fynbbd9ild6fb4wvba3f5hhwk03qdjfazd0a1qr37z3d"))))
1025 (url "http://hg.openjdk.java.net/jdk6/jdk6/jaxp/")
1026 (changeset "jdk6-b41")))
1029 "0shlqrvzpr4nrkmv215lbxnby63s3yvbdh1yxcayznsyqwa4nlxm"))))
1034 (url "http://hg.openjdk.java.net/jdk6/jdk6/jaxws/")
1035 (changeset "jdk6-b41")))
1038 "0835lkw8vib1xhp8lxnybhlvzdh699hbi4mclxanydjk63zbpxk0"))))))
1039 (home-page "http://icedtea.classpath.org")
1040 (synopsis "Java development kit")
1042 "This package provides the OpenJDK built with the IcedTea build harness.
1043 This version of the OpenJDK is no longer maintained and is only used for
1044 bootstrapping purposes.")
1045 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
1046 ;; same license as both GNU Classpath and OpenJDK.
1047 (license license:gpl2+)))
1049 (define-public icedtea-7
1050 (let* ((version "2.6.10")
1051 (drop (lambda (name hash)
1055 "http://icedtea.classpath.org/download/drops"
1056 "/icedtea7/" version "/" name ".tar.bz2"))
1057 (sha256 (base32 hash))))))
1064 "http://icedtea.wildebeest.org/download/source/icedtea-"
1068 "0am945k2zqrka2xn7lb5grmkad4lwncnhnwk8iq6f269birzsj8w"))
1069 (modules '((guix build utils)))
1071 '(substitute* "Makefile.in"
1072 ;; do not leak information about the build host
1073 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
1074 "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
1075 (build-system gnu-build-system)
1076 (outputs '("out" ; Java Runtime Environment
1077 "jdk" ; Java Development Kit
1078 "doc")) ; all documentation
1080 `(;; There are many test failures. Some are known to
1081 ;; fail upstream, others relate to not having an X
1082 ;; server running at test time, yet others are a
1083 ;; complete mystery to me.
1085 ;; hotspot: passed: 241; failed: 45; error: 2
1086 ;; langtools: passed: 1,934; failed: 26
1090 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
1091 ;; gremlin) doesn't support it yet, so skip this phase.
1092 #:validate-runpath? #f
1094 ;; Apparently, the C locale is needed for some of the tests.
1097 #:modules ((guix build utils)
1098 (guix build gnu-build-system)
1105 ;; TODO: package pcsc and sctp, and add to inputs
1106 `("--disable-system-pcsc"
1107 "--disable-system-sctp"
1108 "--enable-bootstrap"
1111 "--disable-downloading"
1112 "--disable-tests" ;they are run in the check phase instead
1113 "--with-openjdk-src-dir=./openjdk.src"
1114 ,(string-append "--with-jdk-home="
1115 (assoc-ref %build-inputs "jdk")))
1118 (modify-phases %standard-phases
1120 (lambda* (#:key source inputs #:allow-other-keys)
1121 (let ((target (string-append "icedtea-" ,version))
1122 (unpack (lambda* (name #:optional dir)
1124 (string-drop-right name 5))))
1126 (zero? (system* "tar" "xvf"
1127 (assoc-ref inputs name)
1129 "--strip-components=1"))))))
1132 (zero? (system* "tar" "xvf" source
1133 "-C" target "--strip-components=1"))
1135 (unpack "openjdk-src" "openjdk.src")
1136 (with-directory-excursion "openjdk.src"
1138 (filter (cut string-suffix? "-drop" <>)
1143 (add-after 'unpack 'fix-x11-extension-include-path
1144 (lambda* (#:key inputs #:allow-other-keys)
1145 (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
1146 (((string-append "\\$\\(firstword \\$\\(wildcard "
1147 "\\$\\(OPENWIN_HOME\\)"
1148 "/include/X11/extensions\\).*$"))
1149 (string-append (assoc-ref inputs "libxrender")
1150 "/include/X11/extensions"
1151 " -I" (assoc-ref inputs "libxtst")
1152 "/include/X11/extensions"
1153 " -I" (assoc-ref inputs "libxinerama")
1154 "/include/X11/extensions"))
1155 (("\\$\\(wildcard /usr/include/X11/extensions\\)\\)") ""))
1157 (add-after 'unpack 'patch-paths
1159 ;; buildtree.make generates shell scripts, so we need to replace
1160 ;; the generated shebang
1161 (substitute* '("openjdk.src/hotspot/make/linux/makefiles/buildtree.make")
1162 (("/bin/sh") (which "bash")))
1164 (let ((corebin (string-append
1165 (assoc-ref %build-inputs "coreutils") "/bin/"))
1166 (binbin (string-append
1167 (assoc-ref %build-inputs "binutils") "/bin/"))
1168 (grepbin (string-append
1169 (assoc-ref %build-inputs "grep") "/bin/")))
1170 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
1171 "openjdk.src/corba/make/common/shared/Defs-linux.gmk")
1172 (("UNIXCOMMAND_PATH = /bin/")
1173 (string-append "UNIXCOMMAND_PATH = " corebin))
1174 (("USRBIN_PATH = /usr/bin/")
1175 (string-append "USRBIN_PATH = " corebin))
1176 (("DEVTOOLS_PATH *= */usr/bin/")
1177 (string-append "DEVTOOLS_PATH = " corebin))
1178 (("COMPILER_PATH *= */usr/bin/")
1179 (string-append "COMPILER_PATH = "
1180 (assoc-ref %build-inputs "gcc") "/bin/"))
1181 (("DEF_OBJCOPY *=.*objcopy")
1182 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
1184 ;; fix path to alsa header
1185 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
1186 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
1187 (string-append "ALSA_INCLUDE="
1188 (assoc-ref %build-inputs "alsa-lib")
1189 "/include/alsa/version.h")))
1191 ;; fix hard-coded utility paths
1192 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-utils.gmk"
1193 "openjdk.src/corba/make/common/shared/Defs-utils.gmk")
1195 (string-append "ECHO = " (which "echo")))
1197 (string-append "GREP = " (which "grep")))
1198 (("EGREP *=.*egrep")
1199 (string-append "EGREP = " (which "egrep")))
1201 (string-append "CPIO = " (which "cpio")))
1202 (("READELF *=.*readelf")
1203 (string-append "READELF = " (which "readelf")))
1205 (string-append "AR = " (which "ar")))
1207 (string-append "TAR = " (which "tar")))
1209 (string-append "AS = " (which "as")))
1211 (string-append "LD = " (which "ld")))
1212 (("STRIP *=.*strip")
1213 (string-append "STRIP = " (which "strip")))
1215 (string-append "NM = " (which "nm")))
1217 (string-append "SH = " (which "bash")))
1219 (string-append "FIND = " (which "find")))
1221 (string-append "LDD = " (which "ldd")))
1222 (("NAWK *=.*(n|g)awk")
1223 (string-append "NAWK = " (which "gawk")))
1224 (("XARGS *=.*xargs")
1225 (string-append "XARGS = " (which "xargs")))
1226 (("UNZIP *=.*unzip")
1227 (string-append "UNZIP = " (which "unzip")))
1229 (string-append "ZIPEXE = " (which "zip")))
1231 (string-append "SED = " (which "sed"))))
1233 ;; Some of these timestamps cause problems as they are more than
1234 ;; 10 years ago, failing the build process.
1236 "openjdk.src/jdk/src/share/classes/java/util/CurrencyData.properties"
1237 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
1238 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
1239 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
1240 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY")))
1242 (add-before 'configure 'set-additional-paths
1243 (lambda* (#:key inputs #:allow-other-keys)
1244 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
1245 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
1246 (string-append "ALSA_INCLUDE="
1247 (assoc-ref inputs "alsa-lib")
1248 "/include/alsa/version.h")))
1251 (string-append (assoc-ref inputs "libxcomposite")
1252 "/include/X11/extensions" ":"
1253 (assoc-ref inputs "libxrender")
1254 "/include/X11/extensions" ":"
1255 (assoc-ref inputs "libxtst")
1256 "/include/X11/extensions" ":"
1257 (assoc-ref inputs "libxinerama")
1258 "/include/X11/extensions" ":"
1259 (or (getenv "CPATH") "")))
1260 (setenv "ALT_OBJCOPY" (which "objcopy"))
1261 (setenv "ALT_CUPS_HEADERS_PATH"
1262 (string-append (assoc-ref inputs "cups")
1264 (setenv "ALT_FREETYPE_HEADERS_PATH"
1265 (string-append (assoc-ref inputs "freetype")
1267 (setenv "ALT_FREETYPE_LIB_PATH"
1268 (string-append (assoc-ref inputs "freetype")
1271 (add-before 'check 'fix-test-framework
1273 ;; Fix PATH in test environment
1274 (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
1275 (("PATH=/bin:/usr/bin")
1276 (string-append "PATH=" (getenv "PATH"))))
1277 (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
1278 (("/usr/bin/env") (which "env")))
1279 (substitute* "openjdk.src/hotspot/test/test_env.sh"
1280 (("/bin/rm") (which "rm"))
1281 (("/bin/cp") (which "cp"))
1282 (("/bin/mv") (which "mv")))
1284 (add-before 'check 'fix-hotspot-tests
1286 (with-directory-excursion "openjdk.src/hotspot/test/"
1287 (substitute* "jprt.config"
1288 (("PATH=\"\\$\\{path4sdk\\}\"")
1289 (string-append "PATH=" (getenv "PATH")))
1290 (("make=/usr/bin/make")
1291 (string-append "make=" (which "make"))))
1292 (substitute* '("runtime/6626217/Test6626217.sh"
1293 "runtime/7110720/Test7110720.sh")
1294 (("/bin/rm") (which "rm"))
1295 (("/bin/cp") (which "cp"))
1296 (("/bin/mv") (which "mv"))))
1298 (add-before 'check 'fix-jdk-tests
1300 (with-directory-excursion "openjdk.src/jdk/test/"
1301 (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
1302 (("/bin/pwd") (which "pwd")))
1303 (substitute* "com/sun/jdi/ShellScaffold.sh"
1304 (("/bin/kill") (which "kill")))
1305 (substitute* "start-Xvfb.sh"
1306 ;;(("/usr/bin/X11/Xvfb") (which "Xvfb"))
1307 (("/usr/bin/nohup") (which "nohup")))
1308 (substitute* "javax/security/auth/Subject/doAs/Test.sh"
1309 (("/bin/rm") (which "rm")))
1310 (substitute* "tools/launcher/MultipleJRE.sh"
1311 (("echo \"#!/bin/sh\"")
1312 (string-append "echo \"#!" (which "rm") "\""))
1313 (("/usr/bin/zip") (which "zip")))
1314 (substitute* "com/sun/jdi/OnThrowTest.java"
1315 (("#!/bin/sh") (string-append "#!" (which "sh"))))
1316 (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
1317 (("/usr/bin/uptime") (which "uptime")))
1318 (substitute* "java/lang/ProcessBuilder/Basic.java"
1319 (("/usr/bin/env") (which "env"))
1320 (("/bin/false") (which "false"))
1321 (("/bin/true") (which "true"))
1322 (("/bin/cp") (which "cp"))
1323 (("/bin/sh") (which "sh")))
1324 (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
1325 (("/bin/sh") (which "sh")))
1326 (substitute* "java/lang/ProcessBuilder/Zombies.java"
1327 (("/usr/bin/perl") (which "perl"))
1328 (("/bin/ps") (which "ps"))
1329 (("/bin/true") (which "true")))
1330 (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
1331 (("/usr/bin/tee") (which "tee")))
1332 (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
1333 (("/bin/true") (which "true")))
1334 (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
1335 (("/bin/cat") (which "cat")))
1336 (substitute* "java/lang/Runtime/exec/ExitValue.java"
1337 (("/bin/sh") (which "sh"))
1338 (("/bin/true") (which "true"))
1339 (("/bin/kill") (which "kill")))
1340 (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
1341 (("/usr/bin/echo") (which "echo")))
1342 (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
1343 (("/usr/bin/cat") (which "cat")))
1344 (substitute* "java/lang/Runtime/exec/SleepyCat.java"
1345 (("/bin/cat") (which "cat"))
1346 (("/bin/sleep") (which "sleep"))
1347 (("/bin/sh") (which "sh")))
1348 (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
1349 (("/bin/cat") (which "cat")))
1350 (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
1351 (("/bin/chmod") (which "chmod")))
1352 (substitute* "java/util/zip/ZipFile/Assortment.java"
1353 (("/bin/sh") (which "sh"))))
1357 ;; The "make check-*" targets always return zero, so we need to
1358 ;; check for errors in the associated log files to determine
1359 ;; whether any tests have failed.
1360 (use-modules (ice-9 rdelim))
1361 (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
1362 (checker (lambda (port)
1364 (let ((line (read-line port)))
1366 ((eof-object? line) #t)
1367 ((regexp-exec error-pattern line) #f)
1369 (run-test (lambda (test)
1370 (system* "make" test)
1371 (call-with-input-file
1372 (string-append "test/" test ".log")
1375 (and (run-test "check-hotspot")
1376 (run-test "check-langtools")
1377 (run-test "check-jdk"))))))
1379 (lambda* (#:key outputs #:allow-other-keys)
1380 (let ((doc (string-append (assoc-ref outputs "doc")
1381 "/share/doc/icedtea"))
1382 (jre (assoc-ref outputs "out"))
1383 (jdk (assoc-ref outputs "jdk")))
1384 (copy-recursively "openjdk.build/docs" doc)
1385 (copy-recursively "openjdk.build/j2re-image" jre)
1386 (copy-recursively "openjdk.build/j2sdk-image" jdk))
1388 ;; By default IcedTea only generates an empty keystore. In order to
1389 ;; be able to use certificates in Java programs we need to generate a
1390 ;; keystore from a set of certificates. For convenience we use the
1391 ;; certificates from the nss-certs package.
1392 (add-after 'install 'install-keystore
1393 (lambda* (#:key inputs outputs #:allow-other-keys)
1394 (let* ((keystore "cacerts")
1395 (certs-dir (string-append (assoc-ref inputs "nss-certs")
1397 (keytool (string-append (assoc-ref outputs "jdk")
1399 (define (extract-cert file target)
1400 (call-with-input-file file
1402 (call-with-output-file target
1404 (let loop ((line (read-line in 'concat))
1407 ((eof-object? line) #t)
1408 ((string-prefix? "-----BEGIN" line)
1410 (loop (read-line in 'concat) #t))
1411 ((string-prefix? "-----END" line)
1415 (when copying? (display line out))
1416 (loop (read-line in 'concat) copying?)))))))))
1417 (define (import-cert cert)
1418 (format #t "Importing certificate ~a\n" (basename cert))
1419 (let ((temp "tmpcert"))
1420 (extract-cert cert temp)
1421 (let ((port (open-pipe* OPEN_WRITE keytool
1423 "-alias" (basename cert)
1424 "-keystore" keystore
1425 "-storepass" "changeit"
1427 (display "yes\n" port)
1428 (when (not (zero? (status:exit-val (close-pipe port))))
1429 (format #t "failed to import ~a\n" cert)))
1430 (delete-file temp)))
1432 ;; This is necessary because the certificate directory contains
1433 ;; files with non-ASCII characters in their names.
1434 (setlocale LC_ALL "en_US.utf8")
1435 (setenv "LC_ALL" "en_US.utf8")
1437 (for-each import-cert (find-files certs-dir "\\.pem$"))
1438 (mkdir-p (string-append (assoc-ref outputs "out")
1440 (mkdir-p (string-append (assoc-ref outputs "jdk")
1441 "/jre/lib/security"))
1443 ;; The cacerts files we are going to overwrite are chmod'ed as
1444 ;; read-only (444) in icedtea-8 (which derives from this
1445 ;; package). We have to change this so we can overwrite them.
1446 (chmod (string-append (assoc-ref outputs "out")
1447 "/lib/security/" keystore) #o644)
1448 (chmod (string-append (assoc-ref outputs "jdk")
1449 "/jre/lib/security/" keystore) #o644)
1451 (install-file keystore
1452 (string-append (assoc-ref outputs "out")
1454 (install-file keystore
1455 (string-append (assoc-ref outputs "jdk")
1456 "/jre/lib/security"))
1461 "02klsxp9hlf5sial6mxpiq53hmrhlrg6x774j7bjjfhb7hpdvadh"))
1464 "1vbly6khri241xda05gnwkpf2fk41d96ls96ximi084mx0a3w5rd"))
1467 "0s8zln64vdwdxwlw1vpfzm8xbpyhgsv3nqjmnv7y36qpsszg27a5"))
1470 "0myd66bv8ib8krzgqv754bc564rd8xwpwabvf7my1apyb86vap3n"))
1473 "10b4lfv10vba07zblw0wii7mhrfhf32pf7410x5nz2q0smgszl2h"))
1476 "0lvncxb5qzrlqkflrnd0l8vwy155cwj1jb07rkq10z2vx0bq7lq2"))
1479 "0q6mdgbbd3681y3n0z1v783irdjhhi73z6sn5csczpyhjm318axb"))
1480 ("ant" ,ant-bootstrap)
1482 ("coreutils" ,coreutils)
1483 ("diffutils" ,diffutils) ;for tests
1486 ("libtool" ,libtool)
1487 ("pkg-config" ,pkg-config)
1493 ("fastjar" ,fastjar)
1494 ("libxslt" ,libxslt) ;for xsltproc
1495 ("nss-certs" ,nss-certs)
1497 ("procps" ,procps) ;for "free", even though I'm not sure we should use it
1498 ("jdk" ,icedtea-6 "jdk")))
1500 `(("alsa-lib" ,alsa-lib)
1503 ("libxcomposite" ,libxcomposite)
1505 ("libxtst" ,libxtst)
1507 ("libxinerama" ,libxinerama)
1508 ("libxrender" ,libxrender)
1509 ("libjpeg" ,libjpeg)
1511 ("mit-krb5" ,mit-krb5)
1514 ("fontconfig" ,fontconfig)
1515 ("freetype" ,freetype)
1519 (home-page "http://icedtea.classpath.org")
1520 (synopsis "Java development kit")
1522 "This package provides the Java development kit OpenJDK built with the
1523 IcedTea build harness.")
1524 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
1525 ;; same license as both GNU Classpath and OpenJDK.
1526 (license license:gpl2+))))
1528 (define-public icedtea-8
1529 (let* ((version "3.4.0")
1530 (drop (lambda (name hash)
1534 "http://icedtea.classpath.org/download/drops"
1535 "/icedtea8/" version "/" name ".tar.xz"))
1536 (sha256 (base32 hash))))))
1537 (package (inherit icedtea-7)
1542 "http://icedtea.wildebeest.org/download/source/icedtea-"
1546 "16if055973y6yw7n5gczp8iksvc31cy4p5by9lkbniadqj4z665m"))
1547 (modules '((guix build utils)))
1550 (substitute* "acinclude.m4"
1551 ;; Do not embed build time
1552 (("(DIST_ID=\"Custom build).*$" _ prefix)
1553 (string-append prefix "\"\n"))
1554 ;; Do not leak information about the build host
1555 (("DIST_NAME=\"\\$build_os\"")
1556 "DIST_NAME=\"guix\""))
1559 (substitute-keyword-arguments (package-arguments icedtea-7)
1560 ((#:configure-flags flags)
1561 `(let ((jdk (assoc-ref %build-inputs "jdk")))
1562 `(;;"--disable-bootstrap"
1563 "--enable-bootstrap"
1565 "--disable-downloading"
1566 "--disable-system-pcsc"
1567 "--disable-system-sctp"
1568 "--disable-tests" ;they are run in the check phase instead
1569 "--with-openjdk-src-dir=./openjdk.src"
1570 ,(string-append "--with-jdk-home=" jdk))))
1572 `(modify-phases ,phases
1573 (delete 'fix-x11-extension-include-path)
1574 (delete 'patch-paths)
1575 (delete 'set-additional-paths)
1576 (delete 'patch-patches)
1577 (add-after 'unpack 'patch-jni-libs
1578 ;; Hardcode dynamically loaded libraries.
1580 (let* ((library-path (search-path-as-string->list
1581 (getenv "LIBRARY_PATH")))
1582 (find-library (lambda (name)
1585 (string-append "lib" name ".so")))))
1588 (catch 'encoding-error
1591 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
1593 (format #f "\"~a\"" (find-library name)))
1594 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
1595 (format #f "\"~a\"" (find-library name)))))
1597 ;; Those are safe to skip.
1598 (format (current-error-port)
1599 "warning: failed to substitute: ~a~%"
1601 (find-files "openjdk.src/jdk/src/solaris/native"
1605 (lambda* (#:key outputs #:allow-other-keys)
1606 (let ((doc (string-append (assoc-ref outputs "doc")
1607 "/share/doc/icedtea"))
1608 (jre (assoc-ref outputs "out"))
1609 (jdk (assoc-ref outputs "jdk")))
1610 (copy-recursively "openjdk.build/docs" doc)
1611 (copy-recursively "openjdk.build/images/j2re-image" jre)
1612 (copy-recursively "openjdk.build/images/j2sdk-image" jdk)
1615 `(("jdk" ,icedtea-7 "jdk")
1618 "0va5i3zr8y8ncv914rz914jda9d88gq0viww3smdqnln8n78rszi"))
1621 "0cway5a5hcfyh4pzl9zz5xr7lil4gsliy6r5iqbaasd2d9alvqiq"))
1624 "1l9zr97a3kq00bj4i8wcdsjlz3xlfldxd8zhkcxikinwd5n0n8a7"))
1627 "0lqxrsr3xlpwm2na6f2rpl7znrz34dkb9dg3zjmympyjy4kqljn7"))
1630 "1b3chckk10dzrpa7cswmcf1jvryaiwkj8lihfqjr5j7l668jwr4h"))
1633 "15lq0k2jv2x26x6vqkbljdcxk35i3b60pcsw3j1sdfmlk1xy6wgc"))
1636 "17xkb8ahkg04ri0bp5wblcp1a2lp8j7c83ic5zdbggvgm339k5s8"))
1639 "0xpx8ykaq0ki6r0dl3dzca2xgp1p82z8mvsxcs2931ib667ncgcp"))
1642 "1bnn4731lhlvg8axy4mjxgvh646yl22hp52wipx8cfca4vkn2f1z"))
1645 "0fpxl8zlii1hpm777r875ys2cr5ih3gb6p1nm9jfa6krjrccrxv1"))
1646 ,@(fold alist-delete (package-native-inputs icedtea-7)
1647 '("jdk" "openjdk-src" "corba-drop" "jaxp-drop" "jaxws-drop"
1648 "jdk-drop" "langtools-drop" "hotspot-drop")))))))
1650 (define-public icedtea icedtea-7)
1653 (define-public ant/java8
1654 (package (inherit ant-bootstrap)
1659 (uri (string-append "mirror://apache/ant/source/apache-ant-"
1660 version "-src.tar.gz"))
1663 "10p3dh77lkzzzcy32dk9azljixzadp46fggjfbvgkl8mmb8cxxv8"))
1664 (modules '((guix build utils)))
1667 (for-each delete-file
1668 (find-files "lib/optional" "\\.jar$"))
1671 (substitute-keyword-arguments (package-arguments ant-bootstrap)
1673 `(modify-phases ,phases
1674 (add-after 'unpack 'remove-scripts
1675 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
1678 (for-each delete-file
1679 (find-files "src/script"
1680 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))
1683 (lambda* (#:key inputs outputs #:allow-other-keys)
1684 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
1686 ;; Disable tests to avoid dependency on hamcrest-core, which needs
1687 ;; Ant to build. This is necessary in addition to disabling the
1688 ;; "check" phase, because the dependency on "test-jar" would always
1689 ;; result in the tests to be run.
1690 (substitute* "build.xml"
1691 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
1692 (zero? (system* "bash" "bootstrap.sh"
1693 (string-append "-Ddist.dir="
1694 (assoc-ref outputs "out"))))))))))
1696 `(("jdk" ,icedtea-8 "jdk")))))
1698 ;; The 1.9.x series is the last that can be built with GCJ. The 1.10.x series
1701 (package (inherit ant/java8)
1705 (uri (string-append "mirror://apache/ant/source/apache-ant-"
1706 version "-src.tar.gz"))
1709 "1k28mka0m3isy9yr8gz84kz1f3f879rwaxrd44vdn9xbfwvwk86n"))))
1711 `(("jdk" ,icedtea-7 "jdk")))))
1713 (define-public clojure
1714 (let* ((remove-archives '(begin
1715 (for-each delete-file
1716 (find-files "." ".*\\.(jar|zip)"))
1718 (submodule (lambda (prefix version hash)
1721 (uri (string-append "https://github.com/clojure/"
1722 prefix version ".tar.gz"))
1723 (sha256 (base32 hash))
1724 (modules '((guix build utils)))
1725 (snippet remove-archives)))))
1733 (string-append "http://repo1.maven.org/maven2/org/clojure/clojure/"
1734 version "/clojure-" version ".zip"))
1736 (base32 "1nip095fz5c492sw15skril60i1vd21ibg6szin4jcvyy3xr6cym"))
1737 (modules '((guix build utils)))
1738 (snippet remove-archives)))
1739 (build-system ant-build-system)
1741 `(#:modules ((guix build ant-build-system)
1747 #:test-target "test"
1749 (modify-phases %standard-phases
1750 (add-after 'unpack 'unpack-submodule-sources
1751 (lambda* (#:key inputs #:allow-other-keys)
1755 (with-directory-excursion name
1756 (or (zero? (system* "tar"
1757 ;; Use xz for repacked tarball.
1761 "--file" (assoc-ref inputs name)
1762 "--strip-components=1"))
1763 (error "failed to unpack tarball" name)))
1764 (copy-recursively (string-append name "/src/main/clojure/")
1766 '("data-generators-src"
1767 "java-classpath-src"
1769 "test-generative-src"
1770 "tools-namespace-src"
1771 "tools-reader-src"))
1773 ;; The javadoc target is not built by default.
1774 (add-after 'build 'build-doc
1776 (zero? (system* "ant" "javadoc"))))
1777 ;; Needed since no install target is provided.
1779 (lambda* (#:key outputs #:allow-other-keys)
1780 (let ((java-dir (string-append (assoc-ref outputs "out")
1782 ;; Install versioned to avoid collisions.
1783 (install-file (string-append "clojure-" ,version ".jar")
1786 ;; Needed since no install-doc target is provided.
1787 (add-after 'install 'install-doc
1788 (lambda* (#:key outputs #:allow-other-keys)
1789 (let ((doc-dir (string-append (assoc-ref outputs "out")
1790 "/share/doc/clojure-"
1792 (copy-recursively "doc/clojure" doc-dir)
1793 (copy-recursively "target/javadoc/"
1794 (string-append doc-dir "javadoc/"))
1795 (for-each (cut install-file <> doc-dir)
1796 (filter (cut string-match
1797 ".*\\.(html|markdown|md|txt)"
1801 ;; The native-inputs below are needed to run the tests.
1803 `(("data-generators-src"
1804 ,(submodule "data.generators/archive/data.generators-"
1806 "0kki093jp4ckwxzfnw8ylflrfqs8b1i1wi9iapmwcsy328dmgzp1"))
1807 ("java-classpath-src"
1808 ,(submodule "java.classpath/archive/java.classpath-"
1810 "0sjymly9xh1lkvwn5ygygpsfwz4dabblnlq0c9bx76rkvq62fyng"))
1812 ,(submodule "test.check/archive/test.check-"
1814 "0p0mnyhr442bzkz0s4k5ra3i6l5lc7kp6ajaqkkyh4c2k5yck1md"))
1815 ("test-generative-src"
1816 ,(submodule "test.generative/archive/test.generative-"
1818 "1pjafy1i7yblc7ixmcpfq1lfbyf3jaljvkgrajn70sws9xs7a9f8"))
1819 ("tools-namespace-src"
1820 ,(submodule "tools.namespace/archive/tools.namespace-"
1822 "10baak8v0hnwz2hr33bavshm7y49mmn9zsyyms1dwjz45p5ymhy0"))
1824 ,(submodule "tools.reader/archive/tools.reader-"
1826 "09i3lzbhr608h76mhdjm3932gg9xi8sflscla3c5f0v1nkc28cnr"))))
1827 (home-page "https://clojure.org/")
1828 (synopsis "Lisp dialect running on the JVM")
1829 (description "Clojure is a dynamic, general-purpose programming language,
1830 combining the approachability and interactive development of a scripting
1831 language with an efficient and robust infrastructure for multithreaded
1832 programming. Clojure is a compiled language, yet remains completely dynamic
1833 – every feature supported by Clojure is supported at runtime. Clojure
1834 provides easy access to the Java frameworks, with optional type hints and type
1835 inference, to ensure that calls to Java can avoid reflection.
1837 Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy
1838 and a powerful macro system. Clojure is predominantly a functional programming
1839 language, and features a rich set of immutable, persistent data structures.
1840 When mutable state is needed, Clojure offers a software transactional memory
1841 system and reactive Agent system that ensure clean, correct, multithreaded
1843 ;; Clojure is licensed under EPL1.0
1844 ;; ASM bytecode manipulation library is licensed under BSD-3
1845 ;; Guava Murmur3 hash implementation is licensed under APL2.0
1846 ;; src/clj/repl.clj is licensed under CPL1.0
1848 ;; See readme.html or readme.txt for details.
1849 (license (list license:epl1.0
1854 (define-public java-swt
1859 ;; The types of many variables and procedures differ in the sources
1860 ;; dependent on whether the target architecture is a 32-bit system or a
1861 ;; 64-bit system. Instead of patching the sources on demand in a build
1862 ;; phase we download either the 32-bit archive (which mostly uses "int"
1863 ;; types) or the 64-bit archive (which mostly uses "long" types).
1864 (let ((hash32 "0jmx1h65wqxsyjzs64i2z6ryiynllxzm13cq90fky2qrzagcw1ir")
1865 (hash64 "0wnd01xssdq9pgx5xqh5lfiy3dmk60dzzqdxzdzf883h13692lgy")
1868 (let-values (((hash file)
1869 (match (or (%current-target-system) (%current-system))
1870 ("x86_64-linux" (values hash64 file64))
1871 (_ (values hash32 file32)))))
1875 "http://ftp-stud.fht-esslingen.de/pub/Mirrors/"
1876 "eclipse/eclipse/downloads/drops4/R-" version
1877 "-201606061100/swt-" version "-gtk-linux-" file ".zip"))
1878 (sha256 (base32 hash))))))
1879 (build-system ant-build-system)
1881 `(#:jar-name "swt.jar"
1882 #:tests? #f ; no "check" target
1884 (modify-phases %standard-phases
1886 (lambda* (#:key source #:allow-other-keys)
1888 (zero? (system* "unzip" source "-d" "swt"))
1891 (zero? (system* "unzip" "src.zip" "-d" "src")))))
1892 ;; The classpath contains invalid icecat jars. Since we don't need
1893 ;; anything other than the JDK on the classpath, we can simply unset
1895 (add-after 'configure 'unset-classpath
1896 (lambda _ (unsetenv "CLASSPATH") #t))
1897 (add-before 'build 'build-native
1898 (lambda* (#:key inputs outputs #:allow-other-keys)
1899 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
1900 ;; Build shared libraries. Users of SWT have to set the system
1901 ;; property swt.library.path to the "lib" directory of this
1904 (setenv "OUTPUT_DIR" lib)
1905 (with-directory-excursion "src"
1906 (zero? (system* "bash" "build.sh"))))))
1907 (add-after 'install 'install-native
1908 (lambda* (#:key outputs #:allow-other-keys)
1909 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
1910 (for-each (lambda (file)
1911 (install-file file lib))
1912 (find-files "." "\\.so$"))
1915 `(("xulrunner" ,icecat)
1917 ("libxtst" ,libxtst)
1922 `(("pkg-config" ,pkg-config)
1924 (home-page "https://www.eclipse.org/swt/")
1925 (synopsis "Widget toolkit for Java")
1927 "SWT is a widget toolkit for Java designed to provide efficient, portable
1928 access to the user-interface facilities of the operating systems on which it
1930 ;; SWT code is licensed under EPL1.0
1931 ;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
1932 ;; Cairo bindings contain code under MPL1.1
1933 ;; XULRunner 1.9 bindings contain code under MPL2.0
1938 license:lgpl2.1+))))
1940 (define-public java-xz
1946 (uri (string-append "http://tukaani.org/xz/xz-java-" version ".zip"))
1949 "1z3p1ri1gvl07inxn0agx44ck8n7wrzfmvkz8nbq3njn8r9wba8x"))))
1950 (build-system ant-build-system)
1952 `(#:tests? #f ; There are no tests to run.
1953 #:jar-name ,(string-append "xz-" version ".jar")
1955 (modify-phases %standard-phases
1956 ;; The unpack phase enters the "maven" directory by accident.
1957 (add-after 'unpack 'chdir
1958 (lambda _ (chdir "..") #t)))))
1960 `(("unzip" ,unzip)))
1961 (home-page "http://tukaani.org/xz/java.html")
1962 (synopsis "Implementation of XZ data compression in pure Java")
1963 (description "This library aims to be a complete implementation of XZ data
1964 compression in pure Java. Single-threaded streamed compression and
1965 decompression and random access decompression have been fully implemented.")
1966 (license license:public-domain)))
1968 ;; java-hamcrest-core uses qdox version 1.12. We package this version instead
1969 ;; of the latest release.
1970 (define-public java-qdox-1.12
1976 (uri (string-append "http://central.maven.org/maven2/"
1977 "com/thoughtworks/qdox/qdox/" version
1978 "/qdox-" version "-sources.jar"))
1981 "0hlfbqq2avf5s26wxkksqmkdyk6zp9ggqn37c468m96mjv0n9xfl"))))
1982 (build-system ant-build-system)
1984 `(;; Tests require junit
1986 #:jar-name "qdox.jar"
1988 (modify-phases %standard-phases
1990 (lambda* (#:key source #:allow-other-keys)
1992 (with-directory-excursion "src"
1993 (zero? (system* "jar" "-xf" source)))))
1994 ;; At this point we don't have junit, so we must remove the API
1996 (add-after 'unpack 'delete-tests
1998 (delete-file-recursively "src/com/thoughtworks/qdox/junit")
2000 (home-page "http://qdox.codehaus.org/")
2001 (synopsis "Parse definitions from Java source files")
2003 "QDox is a high speed, small footprint parser for extracting
2004 class/interface/method definitions from source files complete with JavaDoc
2005 @code{@@tags}. It is designed to be used by active code generators or
2006 documentation tools.")
2007 (license license:asl2.0)))
2009 (define-public java-jarjar
2011 (name "java-jarjar")
2016 "https://storage.googleapis.com/google-code-archive-downloads/v2/"
2017 "code.google.com/jarjar/jarjar-src-" version ".zip"))
2020 "1v8irhni9cndcw1l1wxqgry013s2kpj0qqn57lj2ji28xjq8ndjl"))))
2021 (build-system ant-build-system)
2023 `(;; Tests require junit, which ultimately depends on this package.
2025 #:build-target "jar"
2027 (modify-phases %standard-phases
2029 (lambda* (#:key outputs #:allow-other-keys)
2030 (let ((target (string-append (assoc-ref outputs "out")
2032 (install-file (string-append "dist/jarjar-" ,version ".jar")
2036 `(("unzip" ,unzip)))
2037 (home-page "https://code.google.com/archive/p/jarjar/")
2038 (synopsis "Repackage Java libraries")
2040 "Jar Jar Links is a utility that makes it easy to repackage Java
2041 libraries and embed them into your own distribution. Jar Jar Links includes
2042 an Ant task that extends the built-in @code{jar} task.")
2043 (license license:asl2.0)))
2045 (define-public java-hamcrest-core
2047 (name "java-hamcrest-core")
2051 (uri (string-append "https://github.com/hamcrest/JavaHamcrest/"
2052 "archive/hamcrest-java-" version ".tar.gz"))
2055 "11g0s105fmwzijbv08lx8jlb521yravjmxnpgdx08fvg1kjivhva"))
2056 (modules '((guix build utils)))
2059 ;; Delete bundled thirds-party jar archives.
2060 (delete-file-recursively "lib")
2062 (build-system ant-build-system)
2064 `(#:tests? #f ; Tests require junit
2065 #:modules ((guix build ant-build-system)
2068 #:make-flags (list (string-append "-Dversion=" ,version))
2069 #:test-target "unit-test"
2070 #:build-target "core"
2072 (modify-phases %standard-phases
2073 ;; Disable unit tests, because they require junit, which requires
2074 ;; hamcrest-core. We also give a fixed value to the "Built-Date"
2075 ;; attribute from the manifest for reproducibility.
2076 (add-before 'configure 'patch-build.xml
2078 (substitute* "build.xml"
2079 (("unit-test, ") "")
2080 (("\\$\\{build.timestamp\\}") "guix"))
2082 ;; Java's "getMethods()" returns methods in an unpredictable order.
2083 ;; To make the output of the generated code deterministic we must
2084 ;; sort the array of methods.
2085 (add-after 'unpack 'make-method-order-deterministic
2087 (substitute* "hamcrest-generator/src/main/java/org/hamcrest/generator/ReflectiveFactoryReader.java"
2088 (("import java\\.util\\.Iterator;" line)
2089 (string-append line "\n"
2090 "import java.util.Arrays; import java.util.Comparator;"))
2091 (("allMethods = cls\\.getMethods\\(\\);" line)
2092 (string-append "_" line
2094 private Method[] getSortedMethods() {
2095 Arrays.sort(_allMethods, new Comparator<Method>() {
2097 public int compare(Method a, Method b) {
2098 return a.toString().compareTo(b.toString());
2104 private Method[] allMethods = getSortedMethods();")))))
2105 (add-before 'build 'do-not-use-bundled-qdox
2106 (lambda* (#:key inputs #:allow-other-keys)
2107 (substitute* "build.xml"
2108 (("lib/generator/qdox-1.12.jar")
2109 (string-append (assoc-ref inputs "java-qdox-1.12")
2110 "/share/java/qdox.jar")))
2112 ;; build.xml searches for .jar files in this directoy, which
2113 ;; we remove from the source archive.
2114 (add-before 'build 'create-dummy-directories
2116 (mkdir-p "lib/integration")
2119 (lambda* (#:key outputs #:allow-other-keys)
2120 (let* ((target (string-append (assoc-ref outputs "out")
2122 (version-suffix ,(string-append "-" version ".jar"))
2123 (install-without-version-suffix
2126 (string-append target
2127 (basename jar version-suffix)
2131 install-without-version-suffix
2134 (and (string-suffix? ".jar" name)
2135 (not (string-suffix? "-sources.jar" name)))))))
2138 `(("java-qdox-1.12" ,java-qdox-1.12)
2139 ("java-jarjar" ,java-jarjar)))
2140 (home-page "http://hamcrest.org/")
2141 (synopsis "Library of matchers for building test expressions")
2143 "This package provides a library of matcher objects (also known as
2144 constraints or predicates) allowing @code{match} rules to be defined
2145 declaratively, to be used in other frameworks. Typical scenarios include
2146 testing frameworks, mocking libraries and UI validation rules.")
2147 (license license:bsd-2)))
2149 (define-public java-junit
2155 (uri (string-append "https://github.com/junit-team/junit/"
2156 "archive/r" version ".tar.gz"))
2157 (file-name (string-append name "-" version ".tar.gz"))
2160 "090dn5v1vs0b3acyaqc0gjf6p8lmd2h24wfzsbq7sly6b214anws"))
2161 (modules '((guix build utils)))
2164 ;; Delete bundled jar archives.
2165 (delete-file-recursively "lib")
2167 (build-system ant-build-system)
2169 `(#:tests? #f ; no tests
2170 #:jar-name "junit.jar"))
2172 `(("java-hamcrest-core" ,java-hamcrest-core)))
2173 (home-page "http://junit.org/")
2174 (synopsis "Test framework for Java")
2176 "JUnit is a simple framework to write repeatable tests for Java projects.
2177 JUnit provides assertions for testing expected results, test fixtures for
2178 sharing common test data, and test runners for running tests.")
2179 (license license:epl1.0)))
2181 (define-public java-plexus-utils
2183 (name "java-plexus-utils")
2187 (uri (string-append "https://github.com/codehaus-plexus/"
2188 "plexus-utils/archive/plexus-utils-"
2192 "1mlwpc6fms24slygv5yvi6fi9hcha2fh0v73p5znpi78bg36i2js"))))
2193 (build-system ant-build-system)
2194 ;; FIXME: The default build.xml does not include a target to install
2197 `(#:jar-name "plexus-utils.jar"
2198 #:source-dir "src/main"
2200 (modify-phases %standard-phases
2201 (add-after 'unpack 'fix-reference-to-/bin-and-/usr
2203 (substitute* "src/main/java/org/codehaus/plexus/util/\
2204 cli/shell/BourneShell.java"
2205 (("/bin/sh") (which "sh"))
2206 (("/usr/") (getcwd)))
2208 (add-after 'unpack 'fix-or-disable-broken-tests
2210 (with-directory-excursion "src/test/java/org/codehaus/plexus/util"
2211 (substitute* '("cli/CommandlineTest.java"
2212 "cli/shell/BourneShellTest.java")
2213 (("/bin/sh") (which "sh"))
2214 (("/bin/echo") (which "echo")))
2216 ;; This test depends on MavenProjectStub, but we don't have
2217 ;; a package for Maven.
2218 (delete-file "introspection/ReflectionValueExtractorTest.java")
2220 ;; FIXME: The command line tests fail, maybe because they use
2222 (delete-file "cli/CommandlineTest.java"))
2225 `(("java-junit" ,java-junit)))
2226 (home-page "http://codehaus-plexus.github.io/plexus-utils/")
2227 (synopsis "Common utilities for the Plexus framework")
2228 (description "This package provides various Java utility classes for the
2229 Plexus framework to ease working with strings, files, command lines, XML and
2231 (license license:asl2.0)))
2233 (define-public java-plexus-interpolation
2235 (name "java-plexus-interpolation")
2239 (uri (string-append "https://github.com/codehaus-plexus/"
2240 "plexus-interpolation/archive/"
2241 "plexus-interpolation-" version ".tar.gz"))
2244 "1w79ljwk42ymrgy8kqxq4l82pgdj6287gabpfnpkyzbrnclsnfrp"))))
2245 (build-system ant-build-system)
2247 `(#:jar-name "plexus-interpolation.jar"
2248 #:source-dir "src/main"))
2250 `(("java-junit" ,java-junit)
2251 ("java-hamcrest-core" ,java-hamcrest-core)))
2252 (home-page "http://codehaus-plexus.github.io/plexus-interpolation/")
2253 (synopsis "Java components for interpolating ${} strings and the like")
2254 (description "Plexus interpolator is a modular, flexible interpolation
2255 framework for the expression language style commonly seen in Maven, Plexus,
2256 and other related projects.
2258 It has its foundation in the @code{org.codehaus.plexus.utils.interpolation}
2259 package within @code{plexus-utils}, but has been separated in order to allow
2260 these two libraries to vary independently of one another.")
2261 (license license:asl2.0)))
2263 (define-public java-asm
2269 (uri (string-append "http://download.forge.ow2.org/asm/"
2270 "asm-" version ".tar.gz"))
2273 "0kxvmv5275rnjl7jv0442k3wjnq03ngkb7sghs78avf45pzm4qgr"))))
2274 (build-system ant-build-system)
2276 `(#:build-target "compile"
2277 ;; The tests require an old version of Janino, which no longer compiles
2280 ;; We don't need these extra ant tasks, but the build system asks us to
2281 ;; provide a path anyway.
2282 #:make-flags (list (string-append "-Dobjectweb.ant.tasks.path=foo"))
2284 (modify-phases %standard-phases
2285 (add-before 'install 'build-jars
2286 (lambda* (#:key make-flags #:allow-other-keys)
2287 ;; We cannot use the "jar" target because it depends on a couple
2288 ;; of unpackaged, complicated tools.
2290 (zero? (system* "jar"
2291 "-cf" (string-append "dist/asm-" ,version ".jar")
2292 "-C" "output/build/tmp" "."))))
2294 (install-jars "dist")))))
2296 `(("java-junit" ,java-junit)))
2297 (home-page "http://asm.ow2.org/")
2298 (synopsis "Very small and fast Java bytecode manipulation framework")
2299 (description "ASM is an all purpose Java bytecode manipulation and
2300 analysis framework. It can be used to modify existing classes or dynamically
2301 generate classes, directly in binary form. The provided common
2302 transformations and analysis algorithms allow to easily assemble custom
2303 complex transformations and code analysis tools.")
2304 (license license:bsd-3)))
2306 (define-public java-cglib
2313 "https://github.com/cglib/cglib/archive/RELEASE_"
2314 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
2316 (file-name (string-append "cglib-" version ".tar.gz"))
2319 "162dvd4fln76ai8prfharf66pn6r56p3sxx683j5vdyccrd5hi1q"))))
2320 (build-system ant-build-system)
2322 `(;; FIXME: tests fail because junit runs
2323 ;; "net.sf.cglib.transform.AbstractTransformTest", which does not seem
2324 ;; to describe a test at all.
2326 #:jar-name "cglib.jar"
2328 (modify-phases %standard-phases
2329 (add-after 'unpack 'chdir
2330 (lambda _ (chdir "cglib") #t)))))
2332 `(("java-asm" ,java-asm)
2333 ("java-junit" ,java-junit)))
2334 (home-page "https://github.com/cglib/cglib/")
2335 (synopsis "Java byte code generation library")
2336 (description "The byte code generation library CGLIB is a high level API
2337 to generate and transform Java byte code.")
2338 (license license:asl2.0)))
2340 (define-public java-objenesis
2342 (name "java-objenesis")
2346 (uri (string-append "https://github.com/easymock/objenesis/"
2347 "archive/" version ".tar.gz"))
2348 (file-name (string-append "objenesis-" version ".tar.gz"))
2351 "1va5qz1i2wawwavhnxfzxnfgrcaflz9p1pg03irrjh4nd3rz8wh6"))))
2352 (build-system ant-build-system)
2354 `(#:jar-name "objenesis.jar"
2355 #:source-dir "main/src/"
2356 #:test-dir "main/src/test/"))
2358 `(("java-junit" ,java-junit)
2359 ("java-hamcrest-core" ,java-hamcrest-core)))
2360 (home-page "http://objenesis.org/")
2361 (synopsis "Bypass the constructor when creating an object")
2362 (description "Objenesis is a small Java library that serves one purpose:
2363 to instantiate a new object of a particular class. It is common to see
2364 restrictions in libraries stating that classes must require a default
2365 constructor. Objenesis aims to overcome these restrictions by bypassing the
2366 constructor on object instantiation.")
2367 (license license:asl2.0)))
2369 (define-public java-easymock
2371 (name "java-easymock")
2375 (uri (string-append "https://github.com/easymock/easymock/"
2376 "archive/easymock-" version ".tar.gz"))
2379 "1yzg0kv256ndr57gpav46cyv4a1ns5sj722l50zpxk3j6sk9hnmi"))))
2380 (build-system ant-build-system)
2382 `(#:jar-name "easymock.jar"
2383 #:source-dir "core/src/main"
2384 #:test-dir "core/src/test"
2386 (modify-phases %standard-phases
2387 ;; FIXME: Android support requires the following packages to be
2388 ;; available: com.google.dexmaker.stock.ProxyBuilder
2389 (add-after 'unpack 'delete-android-support
2391 (with-directory-excursion "core/src/main/java/org/easymock/internal"
2392 (substitute* "MocksControl.java"
2393 (("AndroidSupport.isAndroid\\(\\)") "false")
2394 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
2395 (delete-file "AndroidClassProxyFactory.java"))
2397 (add-after 'unpack 'delete-broken-tests
2399 (with-directory-excursion "core/src/test/java/org/easymock"
2400 ;; This test depends on dexmaker.
2401 (delete-file "tests2/ClassExtensionHelperTest.java")
2403 ;; This is not a test.
2404 (delete-file "tests/BaseEasyMockRunnerTest.java")
2406 ;; This test should be executed with a different runner...
2407 (delete-file "tests2/EasyMockAnnotationsTest.java")
2408 ;; ...but deleting it means that we also have to delete these
2410 (delete-file "tests2/EasyMockRunnerTest.java")
2411 (delete-file "tests2/EasyMockRuleTest.java")
2413 ;; This test fails because the file "easymock.properties" does
2415 (delete-file "tests2/EasyMockPropertiesTest.java"))
2418 `(("java-asm" ,java-asm)
2419 ("java-cglib" ,java-cglib)
2420 ("java-objenesis" ,java-objenesis)))
2422 `(("java-junit" ,java-junit)
2423 ("java-hamcrest-core" ,java-hamcrest-core)))
2424 (home-page "http://easymock.org")
2425 (synopsis "Java library providing mock objects for unit tests")
2426 (description "EasyMock is a Java library that provides an easy way to use
2427 mock objects in unit testing.")
2428 (license license:asl2.0)))
2430 (define-public java-jmock-1
2436 (uri (string-append "https://github.com/jmock-developers/"
2437 "jmock-library/archive/" version ".tar.gz"))
2438 (file-name (string-append "jmock-" version ".tar.gz"))
2441 "0xmrlhq0fszldkbv281k9463mv496143vvmqwpxp62yzjvdkx9w0"))))
2442 (build-system ant-build-system)
2444 `(#:build-target "jars"
2445 #:test-target "run.tests"
2447 (modify-phases %standard-phases
2448 (replace 'install (install-jars "build")))))
2449 (home-page "http://www.jmock.org")
2450 (synopsis "Mock object library for test-driven development")
2451 (description "JMock is a library that supports test-driven development of
2452 Java code with mock objects. Mock objects help you design and test the
2453 interactions between the objects in your programs.
2458 @item makes it quick and easy to define mock objects
2459 @item lets you precisely specify the interactions between
2460 your objects, reducing the brittleness of your tests
2461 @item plugs into your favourite test framework
2462 @item is easy to extend.
2464 (license license:bsd-3)))
2466 (define-public java-hamcrest-all
2467 (package (inherit java-hamcrest-core)
2468 (name "java-hamcrest-all")
2470 (substitute-keyword-arguments (package-arguments java-hamcrest-core)
2471 ;; FIXME: a unit test fails because org.hamcrest.SelfDescribing is not
2472 ;; found, although it is part of the hamcrest-core library that has
2475 ;; Fixing this one test is insufficient, though, and upstream confirmed
2476 ;; that the latest hamcrest release fails its unit tests when built
2477 ;; with Java 7. See https://github.com/hamcrest/JavaHamcrest/issues/30
2479 ((#:build-target _) "bigjar")
2481 `(modify-phases ,phases
2482 ;; Some build targets override the classpath, so we need to patch
2483 ;; the build.xml to ensure that required dependencies are on the
2485 (add-after 'unpack 'patch-classpath-for-integration
2486 (lambda* (#:key inputs #:allow-other-keys)
2487 (substitute* "build.xml"
2488 ((" build/hamcrest-library-\\$\\{version\\}.jar" line)
2492 (find-files (assoc-ref inputs "java-hamcrest-core") "\\.jar$")
2493 (find-files (assoc-ref inputs "java-junit") "\\.jar$")
2494 (find-files (assoc-ref inputs "java-jmock") "\\.jar$")
2495 (find-files (assoc-ref inputs "java-easymock") "\\.jar$")))
2499 `(("java-junit" ,java-junit)
2500 ("java-jmock" ,java-jmock-1)
2501 ("java-easymock" ,java-easymock)
2502 ("java-hamcrest-core" ,java-hamcrest-core)
2503 ,@(package-inputs java-hamcrest-core)))))
2505 (define-public java-jopt-simple
2507 (name "java-jopt-simple")
2511 (uri (string-append "http://repo1.maven.org/maven2/"
2512 "net/sf/jopt-simple/jopt-simple/"
2513 version "/jopt-simple-"
2514 version "-sources.jar"))
2517 "1v8bzmwmw6qq20gm42xyay6vrd567dra4vqwhgjnqqjz1gs9f8qa"))))
2518 (build-system ant-build-system)
2520 `(#:tests? #f ; there are no tests
2521 #:jar-name "jopt-simple.jar"))
2522 (home-page "https://pholser.github.io/jopt-simple/")
2523 (synopsis "Java library for parsing command line options")
2524 (description "JOpt Simple is a Java library for parsing command line
2525 options, such as those you might pass to an invocation of @code{javac}. In
2526 the interest of striving for simplicity, as closely as possible JOpt Simple
2527 attempts to honor the command line option syntaxes of POSIX @code{getopt} and
2528 GNU @code{getopt_long}. It also aims to make option parser configuration and
2529 retrieval of options and their arguments simple and expressive, without being
2531 (license license:expat)))
2533 (define-public java-commons-math3
2535 (name "java-commons-math3")
2539 (uri (string-append "mirror://apache/commons/math/source/"
2540 "commons-math3-" version "-src.tar.gz"))
2543 "19l6yp44qc5g7wg816nbn5z3zq3xxzwimvbm4a8pczgvpi4i85s6"))))
2544 (build-system ant-build-system)
2546 `(#:build-target "jar"
2547 #:test-target "test"
2549 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
2550 (junit (assoc-ref %build-inputs "java-junit")))
2551 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
2552 (string-append "-Dhamcrest.jar=" hamcrest
2553 "/share/java/hamcrest-core.jar")))
2555 (modify-phases %standard-phases
2556 ;; We want to build the jar in the build phase and run the tests
2557 ;; later in a separate phase.
2558 (add-after 'unpack 'untangle-targets
2560 (substitute* "build.xml"
2561 (("name=\"jar\" depends=\"test\"")
2562 "name=\"jar\" depends=\"compile\""))
2564 ;; There is no install target.
2566 (install-jars "target")))))
2568 `(("java-junit" ,java-junit)
2569 ("java-hamcrest-core" ,java-hamcrest-core)))
2570 (home-page "http://commons.apache.org/math/")
2571 (synopsis "Apache Commons mathematics library")
2572 (description "Commons Math is a library of lightweight, self-contained
2573 mathematics and statistics components addressing the most common problems not
2574 available in the Java programming language or Commons Lang.")
2575 (license license:asl2.0)))
2577 (define-public java-jmh
2584 (url "http://hg.openjdk.java.net/code-tools/jmh/")
2585 (changeset version)))
2586 (file-name (string-append name "-" version "-checkout"))
2589 "1fxyxhg9famwcg1prc4cgwb5wzyxqavn3cjm5vz8605xz7x5k084"))))
2590 (build-system ant-build-system)
2592 `(#:jar-name "jmh-core.jar"
2593 #:source-dir "jmh-core/src/main"
2594 #:test-dir "jmh-core/src/test"
2596 (modify-phases %standard-phases
2597 ;; This seems to be a bug in the JDK. It may not be necessary in
2598 ;; future versions of the JDK.
2599 (add-after 'unpack 'fix-bug
2601 (with-directory-excursion
2602 "jmh-core/src/main/java/org/openjdk/jmh/runner/options"
2603 (substitute* '("IntegerValueConverter.java"
2604 "ThreadsValueConverter.java")
2605 (("public Class<Integer> valueType")
2606 "public Class<? extends Integer> valueType")))
2609 `(("java-jopt-simple" ,java-jopt-simple)
2610 ("java-commons-math3" ,java-commons-math3)))
2612 `(("java-junit" ,java-junit)
2613 ("java-hamcrest-core" ,java-hamcrest-core)))
2614 (home-page "http://openjdk.java.net/projects/code-tools/jmh/")
2615 (synopsis "Benchmark harness for the JVM")
2616 (description "JMH is a Java harness for building, running, and analysing
2617 nano/micro/milli/macro benchmarks written in Java and other languages
2618 targetting the JVM.")
2620 (license license:gpl2)))
2622 (define-public java-commons-collections4
2624 (name "java-commons-collections4")
2628 (uri (string-append "mirror://apache/commons/collections/source/"
2629 "commons-collections4-" version "-src.tar.gz"))
2632 "1krfhvggympq4avk7gh6qafzf6b9ip6r1m4lmacikyx04039m0wl"))))
2633 (build-system ant-build-system)
2635 `(#:test-target "test"
2637 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
2638 (junit (assoc-ref %build-inputs "java-junit"))
2639 (easymock (assoc-ref %build-inputs "java-easymock")))
2640 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
2641 (string-append "-Dhamcrest.jar=" hamcrest
2642 "/share/java/hamcrest-core.jar")
2643 (string-append "-Deasymock.jar=" easymock
2644 "/share/java/easymock.jar")))
2646 (modify-phases %standard-phases
2648 (install-jars "target")))))
2650 `(("java-junit" ,java-junit)
2651 ("java-hamcrest-core" ,java-hamcrest-core)
2652 ("java-easymock" ,java-easymock)))
2653 (home-page "http://commons.apache.org/collections/")
2654 (synopsis "Collections framework")
2655 (description "The Java Collections Framework is the recognised standard
2656 for collection handling in Java. Commons-Collections seek to build upon the
2657 JDK classes by providing new interfaces, implementations and utilities. There
2658 are many features, including:
2661 @item @code{Bag} interface for collections that have a number of copies of
2663 @item @code{BidiMap} interface for maps that can be looked up from value to
2664 key as well and key to value
2665 @item @code{MapIterator} interface to provide simple and quick iteration over
2667 @item Transforming decorators that alter each object as it is added to the
2669 @item Composite collections that make multiple collections look like one
2670 @item Ordered maps and sets that retain the order elements are added in,
2671 including an LRU based map
2672 @item Reference map that allows keys and/or values to be garbage collected
2674 @item Many comparator implementations
2675 @item Many iterator implementations
2676 @item Adapter classes from array and enumerations to collections
2677 @item Utilities to test or create typical set-theory properties of collections
2678 such as union, intersection, and closure.
2680 (license license:asl2.0)))
2682 (define-public java-commons-io
2684 (name "java-commons-io")
2689 (uri (string-append "mirror://apache/commons/io/source/"
2690 "commons-io-" version "-src.tar.gz"))
2693 "0q5y41jrcjvx9hzs47x5kdhnasdy6rm4bzqd2jxl02w717m7a7v3"))))
2694 (build-system ant-build-system)
2695 (outputs '("out" "doc"))
2697 `(#:test-target "test"
2699 (list (string-append "-Djunit.jar="
2700 (assoc-ref %build-inputs "java-junit")
2701 "/share/java/junit.jar"))
2703 (modify-phases %standard-phases
2704 (add-after 'build 'build-javadoc ant-build-javadoc)
2705 (replace 'install (install-jars "target"))
2706 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
2708 `(("java-junit" ,java-junit)
2709 ("java-hamcrest-core" ,java-hamcrest-core)))
2710 (home-page "http://commons.apache.org/io/")
2711 (synopsis "Common useful IO related classes")
2712 (description "Commons-IO contains utility classes, stream implementations,
2713 file filters and endian classes.")
2714 (license license:asl2.0)))
2716 (define-public java-commons-lang
2718 (name "java-commons-lang")
2723 (uri (string-append "mirror://apache/commons/lang/source/"
2724 "commons-lang-" version "-src.tar.gz"))
2726 (base32 "1mxwagqadzx1b2al7i0z1v0r235aj2njdyijf02szq0vhmqrfiq5"))))
2727 (build-system ant-build-system)
2728 (outputs '("out" "doc"))
2730 `(#:test-target "test"
2732 (modify-phases %standard-phases
2733 (add-after 'build 'build-javadoc ant-build-javadoc)
2734 (add-before 'check 'disable-failing-test
2736 ;; Disable a failing test
2737 (substitute* "src/test/java/org/apache/commons/lang/\
2738 time/FastDateFormatTest.java"
2739 (("public void testFormat\\(\\)")
2740 "public void disabled_testFormat()"))
2742 (replace 'install (install-jars "target"))
2743 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
2745 `(("java-junit" ,java-junit)))
2746 (home-page "http://commons.apache.org/lang/")
2747 (synopsis "Extension of the java.lang package")
2748 (description "The Commons Lang components contains a set of Java classes
2749 that provide helper methods for standard Java classes, especially those found
2750 in the @code{java.lang} package in the Sun JDK. The following classes are
2754 @item StringUtils - Helper for @code{java.lang.String}.
2755 @item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets
2756 of characters such as @code{[a-z]} and @code{[abcdez]}.
2757 @item RandomStringUtils - Helper for creating randomised strings.
2758 @item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
2759 @item NumberRange - A range of numbers with an upper and lower bound.
2760 @item ObjectUtils - Helper for @code{java.lang.Object}.
2761 @item SerializationUtils - Helper for serializing objects.
2762 @item SystemUtils - Utility class defining the Java system properties.
2763 @item NestedException package - A sub-package for the creation of nested
2765 @item Enum package - A sub-package for the creation of enumerated types.
2766 @item Builder package - A sub-package for the creation of @code{equals},
2767 @code{hashCode}, @code{compareTo} and @code{toString} methods.
2769 (license license:asl2.0)))
2771 (define-public java-commons-lang3
2773 (name "java-commons-lang3")
2778 (uri (string-append "mirror://apache/commons/lang/source/"
2779 "commons-lang3-" version "-src.tar.gz"))
2781 (base32 "0xpshb9spjhplq5a7mr0y1bgfw8190ik4xj8f569xidfcki1d6kg"))))
2782 (build-system ant-build-system)
2783 (outputs '("out" "doc"))
2785 `(#:test-target "test"
2787 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-all"))
2788 (junit (assoc-ref %build-inputs "java-junit"))
2789 (easymock (assoc-ref %build-inputs "java-easymock"))
2790 (io (assoc-ref %build-inputs "java-commons-io")))
2791 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
2792 (string-append "-Dhamcrest.jar=" hamcrest
2793 "/share/java/hamcrest-all.jar")
2794 (string-append "-Dcommons-io.jar=" io
2795 "/share/java/commons-io-"
2796 ,(package-version java-commons-io)
2798 (string-append "-Deasymock.jar=" easymock
2799 "/share/java/easymock.jar")))
2801 (modify-phases %standard-phases
2802 (add-after 'build 'build-javadoc ant-build-javadoc)
2803 (replace 'install (install-jars "target"))
2804 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
2806 `(("java-junit" ,java-junit)
2807 ("java-commons-io" ,java-commons-io)
2808 ("java-hamcrest-all" ,java-hamcrest-all)
2809 ("java-easymock" ,java-easymock)))
2810 (home-page "http://commons.apache.org/lang/")
2811 (synopsis "Extension of the java.lang package")
2812 (description "The Commons Lang components contains a set of Java classes
2813 that provide helper methods for standard Java classes, especially those found
2814 in the @code{java.lang} package. The following classes are included:
2817 @item StringUtils - Helper for @code{java.lang.String}.
2818 @item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets of
2819 characters such as @code{[a-z]} and @code{[abcdez]}.
2820 @item RandomStringUtils - Helper for creating randomised strings.
2821 @item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
2822 @item NumberRange - A range of numbers with an upper and lower bound.
2823 @item ObjectUtils - Helper for @code{java.lang.Object}.
2824 @item SerializationUtils - Helper for serializing objects.
2825 @item SystemUtils - Utility class defining the Java system properties.
2826 @item NestedException package - A sub-package for the creation of nested
2828 @item Enum package - A sub-package for the creation of enumerated types.
2829 @item Builder package - A sub-package for the creation of @code{equals},
2830 @code{hashCode}, @code{compareTo} and @code{toString} methods.
2832 (license license:asl2.0)))
2834 (define-public java-jsr305
2836 (name "java-jsr305")
2840 (uri (string-append "https://repo1.maven.org/maven2/"
2841 "com/google/code/findbugs/"
2842 "jsr305/" version "/jsr305-"
2843 version "-sources.jar"))
2846 "1rh6jin9v7jqpq3kf1swl868l8i94r636n03pzpsmgr8v0lh9j2n"))))
2847 (build-system ant-build-system)
2849 `(#:tests? #f ; no tests included
2850 #:jar-name "jsr305.jar"))
2851 (home-page "http://findbugs.sourceforge.net/")
2852 (synopsis "Annotations for the static analyzer called findbugs")
2853 (description "This package provides annotations for the findbugs package.
2854 It provides packages in the @code{javax.annotations} namespace.")
2855 (license license:asl2.0)))
2857 (define-public java-guava
2860 ;; This is the last release of Guava that can be built with Java 7.
2864 (uri (string-append "https://github.com/google/guava/"
2865 "releases/download/v" version
2866 "/guava-" version "-sources.jar"))
2869 "1gawrs5gi6j5hcfxdgpnfli75vb9pfi4sn09pnc8xacr669yajwr"))))
2870 (build-system ant-build-system)
2872 `(#:tests? #f ; no tests included
2873 #:jar-name "guava.jar"
2875 (modify-phases %standard-phases
2876 (add-after 'unpack 'trim-sources
2878 (with-directory-excursion "src/com/google/common"
2879 ;; Remove annotations to avoid extra dependencies:
2880 ;; * "j2objc" annotations are used when converting Java to
2882 ;; * "errorprone" annotations catch common Java mistakes at
2884 ;; * "IgnoreJRERequirement" is used for Android.
2885 (substitute* (find-files "." "\\.java$")
2886 (("import com.google.j2objc.*") "")
2887 (("import com.google.errorprone.annotation.*") "")
2888 (("import org.codehaus.mojo.animal_sniffer.*") "")
2889 (("@CanIgnoreReturnValue") "")
2892 (("@RetainedWith") "")
2894 (("@ForOverride") "")
2895 (("@J2ObjCIncompatible") "")
2896 (("@IgnoreJRERequirement") "")))
2899 `(("java-jsr305" ,java-jsr305)))
2900 (home-page "https://github.com/google/guava")
2901 (synopsis "Google core libraries for Java")
2902 (description "Guava is a set of core libraries that includes new
2903 collection types (such as multimap and multiset), immutable collections, a
2904 graph library, functional types, an in-memory cache, and APIs/utilities for
2905 concurrency, I/O, hashing, primitives, reflection, string processing, and much
2907 (license license:asl2.0)))
2909 ;; The java-commons-logging package provides adapters to many different
2910 ;; logging frameworks. To avoid an excessive dependency graph we try to build
2911 ;; it with only a minimal set of adapters.
2912 (define-public java-commons-logging-minimal
2914 (name "java-commons-logging-minimal")
2918 (uri (string-append "mirror://apache/commons/logging/source/"
2919 "commons-logging-" version "-src.tar.gz"))
2922 "10bwcy5w8d7y39n0krlwhnp8ds3kj5zhmzj0zxnkw0qdlsjmsrj9"))))
2923 (build-system ant-build-system)
2925 `(#:tests? #f ; avoid dependency on logging frameworks
2926 #:jar-name "commons-logging-minimal.jar"
2928 (modify-phases %standard-phases
2929 (add-after 'unpack 'delete-adapters-and-tests
2931 ;; Delete all adapters except for NoOpLog, SimpleLog, and
2932 ;; LogFactoryImpl. NoOpLog is required to build; LogFactoryImpl
2933 ;; is used by applications; SimpleLog is the only actually usable
2934 ;; implementation that does not depend on another logging
2938 (delete-file (string-append
2939 "src/main/java/org/apache/commons/logging/impl/" file)))
2940 (list "Jdk13LumberjackLogger.java"
2941 "WeakHashtable.java"
2943 "ServletContextCleaner.java"
2946 "LogKitLogger.java"))
2947 (delete-file-recursively "src/test")
2949 (home-page "http://commons.apache.org/logging/")
2950 (synopsis "Common API for logging implementations")
2951 (description "The Logging package is a thin bridge between different
2952 logging implementations. A library that uses the commons-logging API can be
2953 used with any logging implementation at runtime.")
2954 (license license:asl2.0)))
2956 ;; This is the last release of the 1.x series.
2957 (define-public java-mockito-1
2959 (name "java-mockito")
2963 (uri (string-append "http://repo1.maven.org/maven2/"
2964 "org/mockito/mockito-core/" version
2965 "/mockito-core-" version "-sources.jar"))
2968 "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc"))))
2969 (build-system ant-build-system)
2971 `(#:jar-name "mockito.jar"
2972 #:tests? #f ; no tests included
2973 ;; FIXME: patch-and-repack does not support jars, so we have to apply
2974 ;; patches in build phases.
2976 (modify-phases %standard-phases
2977 ;; Mockito was developed against a different version of hamcrest,
2978 ;; which does not require matcher implementations to provide an
2979 ;; implementation of the "describeMismatch" method. We add this
2980 ;; simple definition to pass the build with our version of hamcrest.
2981 (add-after 'unpack 'fix-hamcrest-build-error
2983 (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java"
2984 (("public Matcher getActualMatcher\\(\\) .*" line)
2986 public void describeMismatch(Object item, Description description) {
2987 actualMatcher.describeMismatch(item, description);
2991 ;; Mockito bundles cglib. We have a cglib package, so let's use
2993 (add-after 'unpack 'use-system-libraries
2995 (with-directory-excursion "src/org/mockito/internal/creation/cglib"
2996 (substitute* '("CGLIBHacker.java"
2997 "CglibMockMaker.java"
2998 "ClassImposterizer.java"
2999 "DelegatingMockitoMethodProxy.java"
3000 "MethodInterceptorFilter.java"
3001 "MockitoNamingPolicy.java"
3002 "SerializableMockitoMethodProxy.java"
3003 "SerializableNoOp.java")
3004 (("import org.mockito.cglib") "import net.sf.cglib")))
3007 `(("java-junit" ,java-junit)
3008 ("java-objenesis" ,java-objenesis)
3009 ("java-cglib" ,java-cglib)
3010 ("java-hamcrest-core" ,java-hamcrest-core)))
3011 (home-page "http://mockito.org")
3012 (synopsis "Mockito is a mock library for Java")
3013 (description "Mockito is a mocking library for Java which lets you write
3014 tests with a clean and simple API. It generates mocks using reflection, and
3015 it records all mock invocations, including methods arguments.")
3016 (license license:asl2.0)))
3018 (define-public java-httpcomponents-httpcore
3020 (name "java-httpcomponents-httpcore")
3024 (uri (string-append "mirror://apache//httpcomponents/httpcore/"
3025 "source/httpcomponents-core-"
3026 version "-src.tar.gz"))
3029 "02bwcf38y4vgwq7kj2s6q7qrmma641r5lacivm16kgxvb2j6h1vy"))))
3030 (build-system ant-build-system)
3032 `(#:jar-name "httpcomponents-httpcore.jar"
3034 (modify-phases %standard-phases
3035 (add-after 'unpack 'chdir
3036 (lambda _ (chdir "httpcore") #t)))))
3038 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
3039 ("java-commons-lang3" ,java-commons-lang3)))
3041 `(("java-junit" ,java-junit)
3042 ("java-mockito" ,java-mockito-1)))
3043 (home-page "https://hc.apache.org/httpcomponents-core-4.4.x/index.html")
3044 (synopsis "Low level HTTP transport components")
3045 (description "HttpCore is a set of low level HTTP transport components
3046 that can be used to build custom client and server side HTTP services with a
3047 minimal footprint. HttpCore supports two I/O models: blocking I/O model based
3048 on the classic Java I/O and non-blocking, event driven I/O model based on Java
3051 This package provides the blocking I/O model library.")
3052 (license license:asl2.0)))
3054 (define-public java-httpcomponents-httpcore-nio
3055 (package (inherit java-httpcomponents-httpcore)
3056 (name "java-httpcomponents-httpcore-nio")
3058 `(#:jar-name "httpcomponents-httpcore-nio.jar"
3060 (modify-phases %standard-phases
3061 (add-after 'unpack 'chdir
3062 (lambda _ (chdir "httpcore-nio") #t)))))
3064 `(("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
3065 ("java-hamcrest-core" ,java-hamcrest-core)
3066 ,@(package-inputs java-httpcomponents-httpcore)))
3067 (description "HttpCore is a set of low level HTTP transport components
3068 that can be used to build custom client and server side HTTP services with a
3069 minimal footprint. HttpCore supports two I/O models: blocking I/O model based
3070 on the classic Java I/O and non-blocking, event driven I/O model based on Java
3073 This package provides the non-blocking I/O model library based on Java
3076 (define-public java-httpcomponents-httpcore-ab
3077 (package (inherit java-httpcomponents-httpcore)
3078 (name "java-httpcomponents-httpcore-ab")
3080 `(#:jar-name "httpcomponents-httpcore-ab.jar"
3082 (modify-phases %standard-phases
3083 (add-after 'unpack 'chdir
3084 (lambda _ (chdir "httpcore-ab") #t)))))
3086 `(("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
3087 ("java-commons-cli" ,java-commons-cli)
3088 ("java-hamcrest-core" ,java-hamcrest-core)
3089 ,@(package-inputs java-httpcomponents-httpcore)))
3090 (synopsis "Apache HttpCore benchmarking tool")
3091 (description "This package provides the HttpCore benchmarking tool. It is
3092 an Apache AB clone based on HttpCore.")))
3094 (define-public java-httpcomponents-httpclient
3096 (name "java-httpcomponents-httpclient")
3100 (uri (string-append "mirror://apache/httpcomponents/httpclient/"
3101 "source/httpcomponents-client-"
3102 version "-src.tar.gz"))
3105 "1428399s7qy3cim5wc6f3ks4gl9nf9vkjpfmnlap3jflif7g2pj1"))))
3106 (build-system ant-build-system)
3108 `(#:jar-name "httpcomponents-httpclient.jar"
3110 (modify-phases %standard-phases
3111 (add-after 'unpack 'chdir
3112 (lambda _ (chdir "httpclient") #t)))))
3114 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
3115 ("java-commons-codec" ,java-commons-codec)
3116 ("java-hamcrest-core" ,java-hamcrest-core)
3117 ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
3118 ("java-mockito" ,java-mockito-1)
3119 ("java-junit" ,java-junit)))
3120 (home-page "https://hc.apache.org/httpcomponents-client-ga/")
3121 (synopsis "HTTP client library for Java")
3122 (description "Although the @code{java.net} package provides basic
3123 functionality for accessing resources via HTTP, it doesn't provide the full
3124 flexibility or functionality needed by many applications. @code{HttpClient}
3125 seeks to fill this void by providing an efficient, up-to-date, and
3126 feature-rich package implementing the client side of the most recent HTTP
3127 standards and recommendations.")
3128 (license license:asl2.0)))
3130 (define-public java-httpcomponents-httpmime
3131 (package (inherit java-httpcomponents-httpclient)
3132 (name "java-httpcomponents-httpmime")
3134 `(#:jar-name "httpcomponents-httpmime.jar"
3136 (modify-phases %standard-phases
3137 (add-after 'unpack 'chdir
3138 (lambda _ (chdir "httpmime") #t)))))
3140 `(("java-httpcomponents-httpclient" ,java-httpcomponents-httpclient)
3141 ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
3142 ("java-junit" ,java-junit)
3143 ("java-hamcrest-core" ,java-hamcrest-core)))))
3145 (define-public java-commons-net
3147 (name "java-commons-net")
3151 (uri (string-append "mirror://apache/commons/net/source/"
3152 "commons-net-" version "-src.tar.gz"))
3155 "0n0cmnddk9qdqhjvka8pc6hd9mn2qi3166f1s6xk32h7rfy1adxr"))))
3156 (build-system ant-build-system)
3158 `(;; FIXME: MainTest.java tries to read "examples.properties" (which
3159 ;; should be "resources/examples/examples.properties"), but gets "null"
3162 #:jar-name "commons-net.jar"))
3164 `(("java-junit" ,java-junit)
3165 ("java-hamcrest-core" ,java-hamcrest-core)))
3166 (home-page "http://commons.apache.org/net/")
3167 (synopsis "Client library for many basic Internet protocols")
3168 (description "The Apache Commons Net library implements the client side of
3169 many basic Internet protocols. The purpose of the library is to provide
3170 fundamental protocol access, not higher-level abstractions.")
3171 (license license:asl2.0)))
3173 (define-public java-jsch
3179 (uri (string-append "mirror://sourceforge/jsch/jsch/"
3180 version "/jsch-" version ".zip"))
3183 "029rdddyq1mh3ghryh3ki99kba1xkf1d1swjv2vi6lk6zzjy2wdb"))))
3184 (build-system ant-build-system)
3186 `(#:build-target "dist"
3187 #:tests? #f ; no tests included
3189 (modify-phases %standard-phases
3190 (replace 'install (install-jars "dist")))))
3192 `(("unzip" ,unzip)))
3193 (home-page "http://www.jcraft.com/jsch/")
3194 (synopsis "Pure Java implementation of SSH2")
3195 (description "JSch is a pure Java implementation of SSH2. JSch allows you
3196 to connect to an SSH server and use port forwarding, X11 forwarding, file
3197 transfer, etc., and you can integrate its functionality into your own Java
3199 (license license:bsd-3)))
3201 (define-public java-commons-compress
3203 (name "java-commons-compress")
3207 (uri (string-append "mirror://apache/commons/compress/source/"
3208 "commons-compress-" version "-src.tar.gz"))
3211 "1vjqvavrn0babffn1kciz6v52ibwq2vwhzlb95hazis3lgllnxc8"))))
3212 (build-system ant-build-system)
3214 `(#:jar-name "commons-compress.jar"
3216 (modify-phases %standard-phases
3217 (add-after 'unpack 'delete-bad-tests
3219 (with-directory-excursion "src/test/java/org/apache/commons/compress/"
3220 ;; FIXME: These tests really should not fail. Maybe they are
3221 ;; indicative of problems with our Java packaging work.
3223 ;; This test fails with a null pointer exception.
3224 (delete-file "archivers/sevenz/SevenZOutputFileTest.java")
3225 ;; This test fails to open test resources.
3226 (delete-file "archivers/zip/ExplodeSupportTest.java")
3228 ;; FIXME: This test adds a dependency on powermock, which is hard to
3229 ;; package at this point.
3230 ;; https://github.com/powermock/powermock
3231 (delete-file "archivers/sevenz/SevenZNativeHeapTest.java"))
3234 `(("java-junit" ,java-junit)
3235 ("java-hamcrest-core" ,java-hamcrest-core)
3236 ("java-mockito" ,java-mockito-1)
3237 ("java-xz" ,java-xz)))
3238 (home-page "https://commons.apache.org/proper/commons-compress/")
3239 (synopsis "Java library for working with compressed files")
3240 (description "The Apache Commons Compress library defines an API for
3241 working with compressed files such as ar, cpio, Unix dump, tar, zip, gzip, XZ,
3242 Pack200, bzip2, 7z, arj, lzma, snappy, DEFLATE, lz4 and Z files.")
3243 (license license:asl2.0)))
3245 (define-public java-commons-net
3247 (name "java-commons-net")
3251 (uri (string-append "mirror://apache/commons/net/source/"
3252 "commons-net-" version "-src.tar.gz"))
3255 "0n0cmnddk9qdqhjvka8pc6hd9mn2qi3166f1s6xk32h7rfy1adxr"))))
3256 (build-system ant-build-system)
3258 `(;; FIXME: MainTest.java tries to read "examples.properties" (which
3259 ;; should be "resources/examples/examples.properties"), but gets "null"
3262 #:jar-name "commons-net.jar"))
3264 `(("java-junit" ,java-junit)
3265 ("java-hamcrest-core" ,java-hamcrest-core)))
3266 (home-page "http://commons.apache.org/net/")
3267 (synopsis "Client library for many basic Internet protocols")
3268 (description "The Apache Commons Net library implements the client side of
3269 many basic Internet protocols. The purpose of the library is to provide
3270 fundamental protocol access, not higher-level abstractions.")
3271 (license license:asl2.0)))
3273 (define-public java-osgi-annotation
3275 (name "java-osgi-annotation")
3279 (uri (string-append "https://repo1.maven.org/maven2/"
3280 "org/osgi/org.osgi.annotation/" version "/"
3281 "org.osgi.annotation-" version "-sources.jar"))
3284 "1q718mb7gqg726rh6pc2hcisn8v50nv35abbir0jypmffhiii85w"))))
3285 (build-system ant-build-system)
3287 `(#:tests? #f ; no tests
3288 #:jar-name "osgi-annotation.jar"))
3289 (home-page "http://www.osgi.org")
3290 (synopsis "Annotation module of OSGi framework")
3292 "OSGi, for Open Services Gateway initiative framework, is a module system
3293 and service platform for the Java programming language. This package contains
3294 the OSGi annotation module, providing additional services to help dynamic
3296 (license license:asl2.0)))
3298 (define-public java-osgi-core
3300 (name "java-osgi-core")
3304 (uri (string-append "https://repo1.maven.org/maven2/"
3305 "org/osgi/org.osgi.core/" version "/"
3306 "org.osgi.core-" version "-sources.jar"))
3309 "19bpf5jx32jq9789gyhin35q5v7flmw0p9mk7wbgqpxqfmxyiabv"))))
3310 (build-system ant-build-system)
3312 `(#:tests? #f ; no tests
3313 #:jar-name "osgi-core.jar"))
3315 `(("java-osgi-annotation" ,java-osgi-annotation)))
3316 (home-page "http://www.osgi.org")
3317 (synopsis "Core module of OSGi framework")
3319 "OSGi, for Open Services Gateway initiative framework, is a module system
3320 and service platform for the Java programming language. This package contains
3321 the OSGi Core module.")
3322 (license license:asl2.0)))
3324 (define-public java-osgi-service-event
3326 (name "java-osgi-service-event")
3330 (uri (string-append "https://repo1.maven.org/maven2/"
3331 "org/osgi/org.osgi.service.event/"
3332 version "/org.osgi.service.event-"
3333 version "-sources.jar"))
3336 "1nyhlgagwym75bycnjczwbnpymv2iw84zbhvvzk84g9q736i6qxm"))))
3337 (build-system ant-build-system)
3339 `(#:tests? #f ; no tests
3340 #:jar-name "osgi-service-event.jar"))
3342 `(("java-osgi-annotation" ,java-osgi-annotation)
3343 ("java-osgi-core" ,java-osgi-core)))
3344 (home-page "http://www.osgi.org")
3345 (synopsis "OSGi service event module")
3347 "OSGi, for Open Services Gateway initiative framework, is a module system
3348 and service platform for the Java programming language. This package contains
3349 the OSGi @code{org.osgi.service.event} module.")
3350 (license license:asl2.0)))
3352 (define-public java-eclipse-osgi
3354 (name "java-eclipse-osgi")
3358 (uri (string-append "https://repo1.maven.org/maven2/"
3359 "org/eclipse/platform/org.eclipse.osgi/"
3360 version "/org.eclipse.osgi-"
3361 version "-sources.jar"))
3364 "00cqc6lb29n0zv68b4l842vzkwawvbr7gshfdygsk8sicvcq2c7b"))))
3365 (build-system ant-build-system)
3367 `(#:tests? #f ; no tests included
3368 #:jar-name "eclipse-equinox-osgi.jar"))
3370 `(("java-osgi-annotation" ,java-osgi-annotation)))
3371 (home-page "http://www.eclipse.org/equinox/")
3372 (synopsis "Eclipse Equinox OSGi framework")
3373 (description "This package provides an implementation of the OSGi Core
3375 (license license:epl1.0)))
3377 (define-public java-eclipse-equinox-common
3379 (name "java-eclipse-equinox-common")
3383 (uri (string-append "https://repo1.maven.org/maven2/"
3384 "org/eclipse/platform/org.eclipse.equinox.common/"
3385 version "/org.eclipse.equinox.common-"
3386 version "-sources.jar"))
3389 "12aazpkgw46r1qj0pr421jzwhbmsizd97r37krd7njnbrdgfzksc"))))
3390 (build-system ant-build-system)
3392 `(#:tests? #f ; no tests included
3393 #:jar-name "eclipse-equinox-common.jar"))
3395 `(("java-eclipse-osgi" ,java-eclipse-osgi)))
3396 (home-page "http://www.eclipse.org/equinox/")
3397 (synopsis "Common Eclipse runtime")
3398 (description "This package provides the common Eclipse runtime.")
3399 (license license:epl1.0)))
3401 (define-public java-eclipse-core-jobs
3403 (name "java-eclipse-core-jobs")
3407 (uri (string-append "https://repo1.maven.org/maven2/"
3408 "org/eclipse/platform/org.eclipse.core.jobs/"
3409 version "/org.eclipse.core.jobs-"
3410 version "-sources.jar"))
3413 "0395b8lh0km8vhzjnchvs1rii1qz48hyvb2wqfaq4yhklbwihq4b"))))
3414 (build-system ant-build-system)
3416 `(#:tests? #f ; no tests included
3417 #:jar-name "eclipse-core-jobs.jar"))
3419 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3420 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3421 (home-page "http://www.eclipse.org/equinox/")
3422 (synopsis "Eclipse jobs mechanism")
3423 (description "This package provides the Eclipse jobs mechanism.")
3424 (license license:epl1.0)))
3426 (define-public java-eclipse-equinox-registry
3428 (name "java-eclipse-equinox-registry")
3432 (uri (string-append "https://repo1.maven.org/maven2/"
3433 "org/eclipse/platform/org.eclipse.equinox.registry/"
3434 version "/org.eclipse.equinox.registry-"
3435 version "-sources.jar"))
3438 "1i9sgymh2fy5vdgk5y7s3qvrlbgh4l93ddqi3v4zmca7hwrlhf9k"))))
3439 (build-system ant-build-system)
3441 `(#:tests? #f ; no tests included
3442 #:jar-name "eclipse-equinox-registry.jar"))
3444 `(("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
3445 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3446 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3447 (home-page "http://www.eclipse.org/equinox/")
3448 (synopsis "Eclipse extension registry support")
3449 (description "This package provides support for the Eclipse extension
3451 (license license:epl1.0)))
3453 (define-public java-eclipse-equinox-app
3455 (name "java-eclipse-equinox-app")
3459 (uri (string-append "https://repo1.maven.org/maven2/"
3460 "org/eclipse/platform/org.eclipse.equinox.app/"
3461 version "/org.eclipse.equinox.app-"
3462 version "-sources.jar"))
3465 "0nhvbp93y203ar7y59gb0mz3w2d3jlqhr0c9hii9bcfpmr7imdab"))))
3466 (build-system ant-build-system)
3468 `(#:tests? #f ; no tests included
3469 #:jar-name "eclipse-equinox-app.jar"))
3471 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3472 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3473 ("java-eclipse-osgi" ,java-eclipse-osgi)
3474 ("java-osgi-service-event" ,java-osgi-service-event)))
3475 (home-page "http://www.eclipse.org/equinox/")
3476 (synopsis "Equinox application container")
3477 (description "This package provides the Equinox application container for
3479 (license license:epl1.0)))
3481 (define-public java-eclipse-equinox-preferences
3483 (name "java-eclipse-equinox-preferences")
3487 (uri (string-append "https://repo1.maven.org/maven2/"
3488 "org/eclipse/platform/org.eclipse.equinox.preferences/"
3489 version "/org.eclipse.equinox.preferences-"
3490 version "-sources.jar"))
3493 "0k7w6c141sqym4fy3af0qkwpy4pdh2vsjpjba6rp5fxyqa24v0a2"))))
3494 (build-system ant-build-system)
3496 `(#:tests? #f ; no tests included
3497 #:jar-name "eclipse-equinox-preferences.jar"))
3499 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3500 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3501 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3502 (home-page "http://www.eclipse.org/equinox/")
3503 (synopsis "Eclipse preferences mechanism")
3504 (description "This package provides the Eclipse preferences mechanism with
3505 the module @code{org.eclipse.equinox.preferences}.")
3506 (license license:epl1.0)))
3508 (define-public java-eclipse-core-contenttype
3510 (name "java-eclipse-core-contenttype")
3514 (uri (string-append "https://repo1.maven.org/maven2/"
3515 "org/eclipse/platform/org.eclipse.core.contenttype/"
3516 version "/org.eclipse.core.contenttype-"
3517 version "-sources.jar"))
3520 "1wcqcv7ijwv5rh748vz3x9pkmjl9w1r0k0026k56n8yjl4rrmspi"))))
3521 (build-system ant-build-system)
3523 `(#:tests? #f ; no tests included
3524 #:jar-name "eclipse-core-contenttype.jar"))
3526 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3527 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
3528 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3529 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3530 (home-page "http://www.eclipse.org/")
3531 (synopsis "Eclipse content mechanism")
3532 (description "This package provides the Eclipse content mechanism in the
3533 @code{org.eclipse.core.contenttype} module.")
3534 (license license:epl1.0)))
3536 (define-public java-eclipse-core-runtime
3538 (name "java-eclipse-core-runtime")
3542 (uri (string-append "https://repo1.maven.org/maven2/"
3543 "org/eclipse/platform/org.eclipse.core.runtime/"
3544 version "/org.eclipse.core.runtime-"
3545 version "-sources.jar"))
3548 "16mkf8jgj35pgzms7w1gyfq0gfm4ixw6c5xbbxzdj1la56c758ya"))))
3549 (build-system ant-build-system)
3551 `(#:tests? #f ; no tests included
3552 #:jar-name "eclipse-core-runtime.jar"))
3554 `(("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
3555 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
3556 ("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
3557 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3558 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3559 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
3560 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3561 (home-page "https://www.eclipse.org/")
3562 (synopsis "Eclipse core runtime")
3563 (description "This package provides the Eclipse core runtime with the
3564 module @code{org.eclipse.core.runtime}.")
3565 (license license:epl1.0)))
3567 (define-public java-eclipse-core-filesystem
3569 (name "java-eclipse-core-filesystem")
3573 (uri (string-append "https://repo1.maven.org/maven2/"
3574 "org/eclipse/platform/org.eclipse.core.filesystem/"
3575 version "/org.eclipse.core.filesystem-"
3576 version "-sources.jar"))
3579 "0km1bhwjim4rfy3pkvjhvy31kgsyf2ncx0mlkmbf5n6g57pphdyj"))))
3580 (build-system ant-build-system)
3582 `(#:tests? #f ; no tests included
3583 #:jar-name "eclipse-core-filesystem.jar"))
3585 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3586 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3587 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3588 (home-page "https://www.eclipse.org/")
3589 (synopsis "Eclipse core file system")
3590 (description "This package provides the Eclipse core file system with the
3591 module @code{org.eclipse.core.filesystem}.")
3592 (license license:epl1.0)))
3594 (define-public java-eclipse-core-expressions
3596 (name "java-eclipse-core-expressions")
3600 (uri (string-append "https://repo1.maven.org/maven2/"
3601 "org/eclipse/platform/org.eclipse.core.expressions/"
3602 version "/org.eclipse.core.expressions-"
3603 version "-sources.jar"))
3606 "18bw2l875gmygvpagpgk9l24qzbdjia4ag12nw6fi8v8yaq4987f"))))
3607 (build-system ant-build-system)
3609 `(#:tests? #f ; no tests included
3610 #:jar-name "eclipse-core-expressions.jar"))
3612 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3613 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3614 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
3615 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
3616 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3617 (home-page "https://www.eclipse.org/")
3618 (synopsis "Eclipse core expression language")
3619 (description "This package provides the Eclipse core expression language
3620 with the @code{org.eclipse.core.expressions} module.")
3621 (license license:epl1.0)))
3623 (define-public java-eclipse-core-variables
3625 (name "java-eclipse-core-variables")
3629 (uri (string-append "https://repo1.maven.org/maven2/"
3630 "org/eclipse/platform/org.eclipse.core.variables/"
3631 version "/org.eclipse.core.variables-"
3632 version "-sources.jar"))
3635 "12dirh03zi4n5x5cj07vzrhkmnqy6h9q10h9j605pagmpmifyxmy"))))
3636 (build-system ant-build-system)
3638 `(#:tests? #f ; no tests included
3639 #:jar-name "eclipse-core-variables.jar"))
3641 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3642 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3643 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
3644 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
3645 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3646 (home-page "https://www.eclipse.org/platform")
3647 (synopsis "Eclipse core variables")
3648 (description "This package provides the Eclipse core variables module
3649 @code{org.eclipse.core.variables}.")
3650 (license license:epl1.0)))
3652 (define-public java-eclipse-ant-core
3654 (name "java-eclipse-ant-core")
3658 (uri (string-append "https://repo1.maven.org/maven2/"
3659 "org/eclipse/platform/org.eclipse.ant.core/"
3660 version "/org.eclipse.ant.core-"
3661 version "-sources.jar"))
3664 "11g3if794qjlk98mz9zch22rr56sd7z63vn4i7k2icr8cq5bfqg7"))))
3665 (build-system ant-build-system)
3667 `(#:tests? #f ; no tests included
3668 #:jar-name "eclipse-ant-core.jar"))
3670 `(("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
3671 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3672 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3673 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
3674 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
3675 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
3676 ("java-eclipse-core-variables" ,java-eclipse-core-variables)
3677 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3678 (home-page "https://www.eclipse.org/platform")
3679 (synopsis "Ant build tool core libraries")
3680 (description "This package provides the ant build tool core libraries with
3681 the module @code{org.eclipse.ant.core}.")
3682 (license license:epl1.0)))
3684 (define-public java-eclipse-core-resources
3686 (name "java-eclipse-core-resources")
3690 (uri (string-append "https://repo1.maven.org/maven2/"
3691 "org/eclipse/platform/org.eclipse.core.resources/"
3692 version "/org.eclipse.core.resources-"
3693 version "-sources.jar"))
3696 "1hrfxrll6cpcagfksk2na1ypvkcnsp0fk6n3vcsrn97qayf9mx9l"))))
3697 (build-system ant-build-system)
3699 `(#:tests? #f ; no tests included
3700 #:jar-name "eclipse-core-resources.jar"))
3702 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3703 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
3704 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3705 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
3706 ("java-eclipse-core-expressions" ,java-eclipse-core-expressions)
3707 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
3708 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
3709 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
3710 ("java-eclipse-ant-core" ,java-eclipse-ant-core)
3711 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3712 (home-page "https://www.eclipse.org/")
3713 (synopsis "Eclipse core resource management")
3714 (description "This package provides the Eclipse core resource management
3715 module @code{org.eclipse.core.resources}.")
3716 (license license:epl1.0)))
3718 (define-public java-eclipse-compare-core
3720 (name "java-eclipse-compare-core")
3724 (uri (string-append "https://repo1.maven.org/maven2/"
3725 "org/eclipse/platform/org.eclipse.compare.core/"
3726 version "/org.eclipse.compare.core-"
3727 version "-sources.jar"))
3730 "10g37r0pbiffyv2wk35c6g5lwzkdipkl0kkjp41v84dln46xm4dg"))))
3731 (build-system ant-build-system)
3733 `(#:tests? #f ; no tests included
3734 #:jar-name "eclipse-compare-core.jar"))
3736 `(("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
3737 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3738 ("java-eclipse-osgi" ,java-eclipse-osgi)
3739 ("java-icu4j" ,java-icu4j)))
3740 (home-page "https://www.eclipse.org/")
3741 (synopsis "Eclipse core compare support")
3742 (description "This package provides the Eclipse core compare support
3743 module @code{org.eclipse.compare.core}.")
3744 (license license:epl1.0)))
3746 (define-public java-eclipse-team-core
3748 (name "java-eclipse-team-core")
3752 (uri (string-append "https://repo1.maven.org/maven2/"
3753 "org/eclipse/platform/org.eclipse.team.core/"
3754 version "/org.eclipse.team.core-"
3755 version "-sources.jar"))
3758 "02j2jzqgb26zx2d5ahxmvijw6j4r0la90zl5c3i65x6z19ciyam7"))))
3759 (build-system ant-build-system)
3761 `(#:tests? #f ; no tests included
3762 #:jar-name "eclipse-team-core.jar"))
3764 `(("java-eclipse-compare-core" ,java-eclipse-compare-core)
3765 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
3766 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
3767 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
3768 ("java-eclipse-core-resources" ,java-eclipse-core-resources)
3769 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
3770 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3771 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3772 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
3773 ("java-eclipse-osgi" ,java-eclipse-osgi)))
3774 (home-page "https://www.eclipse.org/platform")
3775 (synopsis "Eclipse team support core")
3776 (description "This package provides the Eclipse team support core module
3777 @code{org.eclipse.team.core}.")
3778 (license license:epl1.0)))
3780 (define-public java-eclipse-core-commands
3782 (name "java-eclipse-core-commands")
3786 (uri (string-append "https://repo1.maven.org/maven2/"
3787 "org/eclipse/platform/org.eclipse.core.commands/"
3788 version "/org.eclipse.core.commands-"
3789 version "-sources.jar"))
3792 "0yjn482qndcfrsq3jd6vnhcylp16420f5aqkrwr8spsprjigjcr9"))))
3793 (build-system ant-build-system)
3795 `(#:tests? #f ; no tests included
3796 #:jar-name "eclipse-core-commands.jar"))
3798 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)))
3799 (home-page "https://www.eclipse.org/platform")
3800 (synopsis "Eclipse core commands")
3801 (description "This package provides Eclipse core commands in the module
3802 @code{org.eclipse.core.commands}.")
3803 (license license:epl1.0)))
3805 (define-public java-eclipse-text
3807 (name "java-eclipse-text")
3811 (uri (string-append "https://repo1.maven.org/maven2/"
3812 "org/eclipse/platform/org.eclipse.text/"
3813 version "/org.eclipse.text-"
3814 version "-sources.jar"))
3817 "0scz70vzz5qs5caji9f5q01vkqnvip7dpri1q07l8wbbdcxn4cq1"))))
3818 (build-system ant-build-system)
3820 `(#:tests? #f ; no tests included
3821 #:jar-name "eclipse-text.jar"
3823 (modify-phases %standard-phases
3824 ;; When creating a new category we must make sure that the new list
3825 ;; matches List<Position>. By default it seems to be too generic
3826 ;; (ArrayList<Object>), so we specialize it to ArrayList<Position>.
3827 ;; Without this we get this error:
3829 ;; [javac] .../src/org/eclipse/jface/text/AbstractDocument.java:376:
3830 ;; error: method put in interface Map<K,V> cannot be applied to given types;
3831 ;; [javac] fPositions.put(category, new ArrayList<>());
3833 ;; [javac] required: String,List<Position>
3834 ;; [javac] found: String,ArrayList<Object>
3835 ;; [javac] reason: actual argument ArrayList<Object> cannot be converted
3836 ;; to List<Position> by method invocation conversion
3837 ;; [javac] where K,V are type-variables:
3838 ;; [javac] K extends Object declared in interface Map
3839 ;; [javac] V extends Object declared in interface Map
3841 ;; I don't know if this is a good fix. I suspect it is not, but it
3843 (add-after 'unpack 'fix-compilation-error
3845 (substitute* "src/org/eclipse/jface/text/AbstractDocument.java"
3846 (("Positions.put\\(category, new ArrayList<>\\(\\)\\);")
3847 "Positions.put(category, new ArrayList<Position>());"))
3850 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3851 ("java-eclipse-core-commands" ,java-eclipse-core-commands)
3852 ("java-icu4j" ,java-icu4j)))
3853 (home-page "http://www.eclipse.org/platform")
3854 (synopsis "Eclipse text library")
3855 (description "Platform Text is part of the Platform UI project and
3856 provides the basic building blocks for text and text editors within Eclipse
3857 and contributes the Eclipse default text editor.")
3858 (license license:epl1.0)))
3860 (define-public java-eclipse-jdt-core
3862 (name "java-eclipse-jdt-core")
3866 (uri (string-append "https://repo1.maven.org/maven2/"
3867 "org/eclipse/jdt/org.eclipse.jdt.core/"
3868 version "/org.eclipse.jdt.core-"
3869 version "-sources.jar"))
3872 "191xw4lc7mjjkprh4ji5vnpjvr5r4zvbpwkriy4bvsjqrz35vh1j"))))
3873 (build-system ant-build-system)
3875 `(#:tests? #f ; no tests included
3876 #:jar-name "eclipse-jdt-core.jar"))
3878 `(("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
3879 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
3880 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
3881 ("java-eclipse-core-resources" ,java-eclipse-core-resources)
3882 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
3883 ("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
3884 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
3885 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
3886 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
3887 ("java-eclipse-osgi" ,java-eclipse-osgi)
3888 ("java-eclipse-text" ,java-eclipse-text)))
3889 (home-page "https://www.eclipse.org/jdt")
3890 (synopsis "Java development tools core libraries")
3891 (description "This package provides the core libraries of the Eclipse Java
3892 development tools.")
3893 (license license:epl1.0)))
3895 (define-public java-javax-mail
3897 (name "java-javax-mail")
3901 (uri (string-append "https://repo1.maven.org/maven2/"
3902 "com/sun/mail/javax.mail/"
3903 version "/javax.mail-"
3904 version "-sources.jar"))
3907 "0sdlfgsc2b5s89xv1261y8i0jijcja019k2x1c8ngfn582w4jly9"))))
3908 (build-system ant-build-system)
3910 `(#:tests? #f ; no tests
3911 #:jar-name "javax-mail.jar"))
3912 (home-page "https://javamail.java.net")
3913 (synopsis "Reference implementation of the JavaMail API")
3915 "This package provides versions of the JavaMail API implementation, IMAP,
3916 SMTP, and POP3 service providers, some examples, and documentation for the
3918 ;; GPLv2 only with "classpath exception".
3919 (license license:gpl2)))
3921 (define-public java-log4j-api
3923 (name "java-log4j-api")
3927 (uri (string-append "mirror://apache/logging/log4j/" version
3928 "/apache-log4j-" version "-src.tar.gz"))
3931 "0j5p9gik0jysh37nlrckqbky12isy95cpwg2gv5fas1rcdqbraxd"))))
3932 (build-system ant-build-system)
3934 `(#:tests? #f ; tests require unpackaged software
3935 #:jar-name "log4j-api.jar"
3937 (list (string-append "-Ddist.dir=" (assoc-ref %outputs "out")
3940 (modify-phases %standard-phases
3941 (add-after 'unpack 'enter-dir
3942 (lambda _ (chdir "log4j-api") #t))
3943 ;; FIXME: The tests require additional software that has not been
3944 ;; packaged yet, such as
3945 ;; * org.apache.maven
3946 ;; * org.apache.felix
3947 (add-after 'enter-dir 'delete-tests
3948 (lambda _ (delete-file-recursively "src/test") #t)))))
3950 `(("java-osgi-core" ,java-osgi-core)
3951 ("java-hamcrest-core" ,java-hamcrest-core)
3952 ("java-junit" ,java-junit)))
3953 (home-page "http://logging.apache.org/log4j/2.x/")
3954 (synopsis "API module of the Log4j logging framework for Java")
3956 "This package provides the API module of the Log4j logging framework for
3958 (license license:asl2.0)))
3960 (define-public java-commons-cli
3962 (name "java-commons-cli")
3966 (uri (string-append "mirror://apache/commons/cli/source/"
3967 "commons-cli-" version "-src.tar.gz"))
3970 "1fkjn552i12vp3xxk21ws4p70fi0lyjm004vzxsdaz7gdpgyxxyl"))))
3971 (build-system ant-build-system)
3974 `(#:jar-name "commons-cli.jar"))
3976 `(("java-junit" ,java-junit)
3977 ("java-hamcrest-core" ,java-hamcrest-core)))
3978 (home-page "http://commons.apache.org/cli/")
3979 (synopsis "Command line arguments and options parsing library")
3980 (description "The Apache Commons CLI library provides an API for parsing
3981 command line options passed to programs. It is also able to print help
3982 messages detailing the options available for a command line tool.
3984 Commons CLI supports different types of options:
3987 @item POSIX like options (ie. tar -zxvf foo.tar.gz)
3988 @item GNU like long options (ie. du --human-readable --max-depth=1)
3989 @item Java like properties (ie. java -Djava.awt.headless=true Foo)
3990 @item Short options with value attached (ie. gcc -O2 foo.c)
3991 @item long options with single hyphen (ie. ant -projecthelp)
3994 This is a part of the Apache Commons Project.")
3995 (license license:asl2.0)))
3997 (define-public java-commons-codec
3999 (name "java-commons-codec")
4003 (uri (string-append "mirror://apache/commons/codec/source/"
4004 "commons-codec-" version "-src.tar.gz"))
4007 "1w9qg30y4s0x8gnmr2fgj4lyplfn788jqxbcz27lf5kbr6n8xr65"))))
4008 (build-system ant-build-system)
4009 (outputs '("out" "doc"))
4011 `(#:test-target "test"
4013 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
4014 (junit (assoc-ref %build-inputs "java-junit")))
4015 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
4016 (string-append "-Dhamcrest.jar=" hamcrest
4017 "/share/java/hamcrest-core.jar")
4018 ;; Do not append version to jar.
4019 "-Dfinal.name=commons-codec"))
4021 (modify-phases %standard-phases
4022 (add-after 'build 'build-javadoc ant-build-javadoc)
4023 (replace 'install (install-jars "dist"))
4024 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
4026 `(("java-junit" ,java-junit)
4027 ("java-hamcrest-core" ,java-hamcrest-core)))
4028 (home-page "http://commons.apache.org/codec/")
4029 (synopsis "Common encoders and decoders such as Base64, Hex, Phonetic and URLs")
4030 (description "The codec package contains simple encoder and decoders for
4031 various formats such as Base64 and Hexadecimal. In addition to these widely
4032 used encoders and decoders, the codec package also maintains a collection of
4033 phonetic encoding utilities.
4035 This is a part of the Apache Commons Project.")
4036 (license license:asl2.0)))
4038 (define-public java-commons-daemon
4040 (name "java-commons-daemon")
4044 (uri (string-append "mirror://apache/commons/daemon/source/"
4045 "commons-daemon-" version "-src.tar.gz"))
4048 "0ci46kq8jpz084ccwq0mmkahcgsmh20ziclp2jf5i0djqv95gvhi"))))
4049 (build-system ant-build-system)
4051 `(#:test-target "test"
4053 (modify-phases %standard-phases
4054 (add-after 'build 'build-javadoc ant-build-javadoc)
4055 (replace 'install (install-jars "dist"))
4056 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
4058 `(("java-junit" ,java-junit)))
4059 (home-page "http://commons.apache.org/daemon/")
4060 (synopsis "Library to launch Java applications as daemons")
4061 (description "The Daemon package from Apache Commons can be used to
4062 implement Java applications which can be launched as daemons. For example the
4063 program will be notified about a shutdown so that it can perform cleanup tasks
4064 before its process of execution is destroyed by the operation system.
4066 This package contains the Java library. You will also need the actual binary
4067 for your architecture which is provided by the jsvc package.
4069 This is a part of the Apache Commons Project.")
4070 (license license:asl2.0)))
4072 (define-public antlr2
4078 (uri (string-append "http://www.antlr2.org/download/antlr-"
4082 "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5"))
4083 (modules '((guix build utils)))
4086 (delete-file "antlr.jar")
4087 (substitute* "lib/cpp/antlr/CharScanner.hpp"
4091 "#define EOF (-1)\n"
4092 "#include <strings.h>")))
4093 (substitute* "configure"
4096 (build-system gnu-build-system)
4098 `(#:tests? #f ; no test target
4099 #:imported-modules ((guix build ant-build-system)
4100 (guix build syscalls)
4101 ,@%gnu-build-system-modules)
4102 #:modules (((guix build ant-build-system) #:prefix ant:)
4103 (guix build gnu-build-system)
4106 (modify-phases %standard-phases
4107 (add-after 'install 'strip-jar-timestamps
4108 (assoc-ref ant:%standard-phases 'strip-jar-timestamps))
4109 (add-after 'configure 'fix-bin-ls
4111 (substitute* (find-files "." "Makefile")
4117 ("java" ,icedtea "jdk")))
4119 `(("java" ,icedtea)))
4120 (home-page "http://www.antlr2.org")
4121 (synopsis "Framework for constructing recognizers, compilers, and translators")
4122 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
4123 is a language tool that provides a framework for constructing recognizers,
4124 compilers, and translators from grammatical descriptions containing Java, C#,
4125 C++, or Python actions. ANTLR provides excellent support for tree construction,
4126 tree walking, and translation.")
4127 (license license:public-domain)))
4129 (define-public java-stringtemplate-3
4131 (name "java-stringtemplate")
4135 (uri (string-append "https://github.com/antlr/website-st4/raw/"
4136 "gh-pages/download/stringtemplate-"
4140 "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is"))))
4141 (build-system ant-build-system)
4143 `(#:jar-name (string-append ,name "-" ,version ".jar")
4145 #:modules ((guix build ant-build-system)
4149 (modify-phases %standard-phases
4150 (add-before 'check 'fix-tests
4152 (substitute* "build.xml"
4153 (("\\$\\{test.home\\}/java")
4154 "${test.home}/org"))
4156 (add-before 'build 'generate-grammar
4158 (with-directory-excursion "src/org/antlr/stringtemplate/language/"
4159 (every (lambda (file)
4160 (format #t "~a\n" file)
4161 (zero? (system* "antlr" file)))
4162 '("template.g" "angle.bracket.template.g" "action.g"
4163 "eval.g" "group.g" "interface.g"))))))))
4166 ("java-junit" ,java-junit)))
4167 (home-page "http://www.stringtemplate.org")
4168 (synopsis "Template engine to generate formatted text output")
4169 (description "StringTemplate is a java template engine (with ports for C#,
4170 Objective-C, JavaScript, Scala) for generating source code, web pages, emails,
4171 or any other formatted text output. StringTemplate is particularly good at
4172 code generators, multiple site skins, and internationalization / localization.
4173 StringTemplate also powers ANTLR.")
4174 (license license:bsd-3)))
4176 ;; antlr3 is partially written using antlr3 grammar files. It also depends on
4177 ;; ST4 (stringtemplate4), which is also partially written using antlr3 grammar
4178 ;; files and uses antlr3 at runtime. The latest version requires a recent version
4179 ;; of antlr3 at runtime.
4180 ;; Fortunately, ST4 4.0.6 can be built with an older antlr3, and we use antlr3.3.
4181 ;; This version of ST4 is sufficient for the latest antlr3.
4182 ;; We use ST4 4.0.6 to build a boostrap antlr3 (latest version), and build
4183 ;; the latest ST4 with it. Then we build our final antlr3 that will be linked
4184 ;; against the latest ST4.
4185 ;; antlr3.3 still depends on antlr3 to generate some files, so we use an
4186 ;; even older version, antlr3.1, to generate them. Fortunately antlr3.1 uses
4187 ;; only grammar files with the antlr2 syntax.
4188 ;; So we build antlr3.1 -> antlr3.3 -> ST4.0.6 -> antlr3-bootstrap -> ST4 -> antlr3.
4190 (define-public java-stringtemplate
4191 (package (inherit java-stringtemplate-3)
4192 (name "java-stringtemplate")
4196 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/"
4198 (file-name (string-append name "-" version ".tar.gz"))
4201 "1pri8hqa95rfdkjy55icl5q1m09zwp5k67ib14abas39s4v3w087"))))
4202 (build-system ant-build-system)
4204 `(#:jar-name (string-append ,name "-" ,version ".jar")
4205 #:tests? #f ; FIXME: tests fail for unknown reasons
4207 #:modules ((guix build ant-build-system)
4211 (modify-phases %standard-phases
4212 (add-before 'check 'fix-test-target
4214 (substitute* "build.xml"
4215 (("\\$\\{test.home\\}/java") "${test.home}/")
4216 (("\\*Test.java") "Test*.java"))
4218 (add-before 'build 'generate-grammar
4220 (with-directory-excursion "src/org/stringtemplate/v4/compiler/"
4221 (every (lambda (file)
4222 (format #t "~a\n" file)
4223 (zero? (system* "antlr3" file)))
4224 '("STParser.g" "Group.g" "CodeGenerator.g"))))))))
4226 `(("antlr3" ,antlr3-bootstrap)
4228 ("java-stringtemplate" ,java-stringtemplate-3)
4229 ("java-junit" ,java-junit)))))
4231 (define java-stringtemplate-4.0.6
4232 (package (inherit java-stringtemplate)
4233 (name "java-stringtemplate")
4237 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/ST-"
4239 (file-name (string-append name "-" version ".tar.gz"))
4242 "0hjmh1ahdsh3w825i67mli9l4nncc4l6hdbf9ma91jvlj590sljp"))))
4244 `(("antlr3" ,antlr3-3.3)
4246 ("java-stringtemplate" ,java-stringtemplate-3)))))
4248 (define-public antlr3
4254 (uri (string-append "https://github.com/antlr/antlr3/archive/"
4256 (file-name (string-append name "-" version ".tar.gz"))
4259 "07zff5frmjd53rnqdx31h0pmswz1lv0p2lp28cspfszh25ysz6sj"))))
4260 (build-system ant-build-system)
4262 `(#:jar-name (string-append ,name "-" ,version ".jar")
4263 #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3"
4266 (modify-phases %standard-phases
4267 (add-after 'install 'bin-install
4268 (lambda* (#:key inputs outputs #:allow-other-keys)
4269 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
4270 (bin (string-append (assoc-ref outputs "out") "/bin")))
4272 (with-output-to-file (string-append bin "/antlr3")
4275 (string-append "#!" (which "sh") "\n"
4276 "java -cp " jar "/" ,name "-" ,version ".jar:"
4278 (find-files (assoc-ref inputs "stringtemplate")
4282 (find-files (assoc-ref inputs "stringtemplate4")
4286 (find-files (string-append
4287 (assoc-ref inputs "antlr")
4290 " org.antlr.Tool $*"))))
4291 (chmod (string-append bin "/antlr3") #o755))))
4292 (add-before 'build 'generate-grammar
4294 (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/")
4295 (for-each (lambda (file)
4298 (system* "antlr3" file))
4299 '("ANTLR.g" "ANTLRTreePrinter.g" "ActionAnalysis.g"
4300 "AssignTokenTypesWalker.g"
4301 "ActionTranslator.g" "TreeToNFAConverter.g"
4302 "ANTLRv3.g" "ANTLRv3Tree.g" "LeftRecursiveRuleWalker.g"
4303 "CodeGenTreeWalker.g" "DefineGrammarItemsWalker.g"))
4304 (substitute* "ANTLRParser.java"
4305 (("public Object getTree") "public GrammarAST getTree"))
4306 (substitute* "ANTLRv3Parser.java"
4307 (("public Object getTree") "public CommonTree getTree"))
4308 (chdir "../../../../../java")
4309 (system* "antlr" "-o" "org/antlr/tool"
4310 "org/antlr/tool/serialize.g")
4311 (substitute* "org/antlr/tool/LeftRecursiveRuleAnalyzer.java"
4312 (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*;
4313 import org.antlr.grammar.v3.ANTLRTreePrinter;"))
4314 (substitute* "org/antlr/tool/ErrorManager.java"
4315 (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") ""))
4316 (chdir "../../../..")))
4317 (add-before 'build 'fix-build-xml
4319 (substitute* "build.xml"
4320 (("<exec") "<copy todir=\"${classes.dir}\">
4321 <fileset dir=\"tool/src/main/resources\">
4322 <include name=\"**/*.stg\"/>
4323 <include name=\"**/*.st\"/>
4324 <include name=\"**/*.sti\"/>
4325 <include name=\"**/STLexer.tokens\"/>
4327 </copy><exec")))))))
4330 ("antlr3" ,antlr3-bootstrap)))
4332 `(("junit" ,java-junit)
4333 ("stringtemplate" ,java-stringtemplate-3)
4334 ("stringtemplate4" ,java-stringtemplate)))
4336 `(("stringtemplate" ,java-stringtemplate-3)
4338 ("stringtemplate4" ,java-stringtemplate-4.0.6)))
4339 (home-page "http://www.antlr3.org")
4340 (synopsis "Framework for constructing recognizers, compilers, and translators")
4341 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
4342 is a language tool that provides a framework for constructing recognizers,
4343 compilers, and translators from grammatical descriptions containing Java, C#,
4344 C++, or Python actions. ANTLR provides excellent support for tree construction,
4345 tree walking, and translation.")
4346 (license license:bsd-3)))
4348 (define antlr3-bootstrap
4351 (name "antlr3-bootstrap")
4354 ("antlr3" ,antlr3-3.3)))
4356 `(("junit" ,java-junit)))))
4365 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
4366 "gh-pages/download/antlr-"
4370 "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m"))))
4372 `(#:jar-name (string-append ,name "-" ,version ".jar")
4373 #:source-dir (string-append "tool/src/main/java:runtime/Java/src/main/java:"
4374 "tool/src/main/antlr2:tool/src/main/antlr3")
4377 (modify-phases %standard-phases
4378 (add-after 'install 'bin-install
4379 (lambda* (#:key inputs outputs #:allow-other-keys)
4380 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
4381 (bin (string-append (assoc-ref outputs "out") "/bin")))
4383 (with-output-to-file (string-append bin "/antlr3")
4386 (string-append "#!" (which "sh") "\n"
4387 "java -cp " jar "/antlr3-3.3.jar:"
4389 (find-files (assoc-ref inputs "java-stringtemplate")
4393 (find-files (string-append
4394 (assoc-ref inputs "antlr")
4397 " org.antlr.Tool $*"))))
4398 (chmod (string-append bin "/antlr3") #o755))))
4399 (add-before 'build 'generate-grammar
4401 (let ((dir "tool/src/main/antlr2/org/antlr/grammar/v2/"))
4402 (for-each (lambda (file)
4405 (system* "antlr" "-o" dir (string-append dir file)))
4406 '("antlr.g" "antlr.print.g" "assign.types.g"
4407 "buildnfa.g" "codegen.g" "define.g")))
4408 (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/")
4409 (for-each (lambda (file)
4412 (system* "antlr3" file))
4413 '("ActionAnalysis.g" "ActionTranslator.g" "ANTLRv3.g"
4415 (chdir "../../../../../../../..")
4416 (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java"
4417 (("import org.antlr.grammar.v2.\\*;")
4418 "import org.antlr.grammar.v2.*;\n
4419 import org.antlr.grammar.v2.TreeToNFAConverter;\n
4420 import org.antlr.grammar.v2.DefineGrammarItemsWalker;\n
4421 import org.antlr.grammar.v2.ANTLRTreePrinter;"))))
4422 (add-before 'build 'fix-build-xml
4424 (substitute* "build.xml"
4425 (("<exec") "<copy todir=\"${classes.dir}\">
4426 <fileset dir=\"tool/src/main/resources\">
4427 <include name=\"**/*.stg\"/>
4428 <include name=\"**/*.st\"/>
4429 <include name=\"**/*.sti\"/>
4430 <include name=\"**/STLexer.tokens\"/>
4432 </copy><exec")))))))
4435 ("antlr3" ,antlr3-3.1)))
4437 `(("junit" ,java-junit)))
4439 `(("java-stringtemplate" ,java-stringtemplate-3)
4441 ("antlr3" ,antlr3-3.1)))))
4450 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
4451 "gh-pages/download/antlr-"
4455 "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z"))))
4457 `(#:jar-name (string-append ,name "-" ,version ".jar")
4458 #:source-dir "src:runtime/Java/src"
4461 (modify-phases %standard-phases
4462 (add-after 'install 'bin-install
4463 (lambda* (#:key inputs outputs #:allow-other-keys)
4464 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
4465 (bin (string-append (assoc-ref outputs "out") "/bin")))
4467 (with-output-to-file (string-append bin "/antlr3")
4470 (string-append "#!" (which "sh") "\n"
4471 "java -cp " jar "/antlr3-3.1-3.1.jar:"
4473 (find-files (assoc-ref inputs "stringtemplate")
4477 (find-files (string-append
4478 (assoc-ref inputs "antlr")
4481 " org.antlr.Tool $*"))))
4482 (chmod (string-append bin "/antlr3") #o755))))
4483 (add-before 'build 'generate-grammar
4485 (let ((dir "src/org/antlr/tool/"))
4486 (for-each (lambda (file)
4489 (system* "antlr" "-o" dir (string-append dir file)))
4490 '("antlr.g" "antlr.print.g" "assign.types.g"
4491 "buildnfa.g" "define.g")))
4492 (format #t "codegen.g\n")
4493 (system* "antlr" "-o" "src/org/antlr/codegen"
4494 "src/org/antlr/codegen/codegen.g")))
4495 (add-before 'build 'fix-build-xml
4497 (substitute* "build.xml"
4498 (("<exec") "<copy todir=\"${classes.dir}\">
4499 <fileset dir=\"src\">
4500 <include name=\"**/*.stg\"/>
4501 <include name=\"**/*.st\"/>
4502 <include name=\"**/*.sti\"/>
4503 <include name=\"**/STLexer.tokens\"/>
4505 </copy><exec")))))))
4507 `(("antlr" ,antlr2)))
4509 `(("junit" ,java-junit)))
4511 `(("stringtemplate" ,java-stringtemplate-3)))))
4513 (define-public java-asm
4519 (uri (string-append "http://download.forge.ow2.org/asm/"
4520 "asm-" version ".tar.gz"))
4523 "0kxvmv5275rnjl7jv0442k3wjnq03ngkb7sghs78avf45pzm4qgr"))))
4524 (build-system ant-build-system)
4526 `(#:build-target "compile"
4527 #:test-target "test"
4528 ;; The tests require an old version of Janino, which no longer compiles
4531 ;; We don't need these extra ant tasks, but the build system asks us to
4532 ;; provide a path anyway.
4533 #:make-flags (list (string-append "-Dobjectweb.ant.tasks.path=foo"))
4535 (modify-phases %standard-phases
4536 (add-before 'install 'build-jars
4537 (lambda* (#:key make-flags #:allow-other-keys)
4538 ;; We cannot use the "jar" target because it depends on a couple
4539 ;; of unpackaged, complicated tools.
4541 (zero? (system* "jar"
4542 "-cf" (string-append "dist/asm-" ,version ".jar")
4543 "-C" "output/build/tmp" "."))))
4545 (install-jars "dist")))))
4547 `(("java-junit" ,java-junit)))
4548 (home-page "http://asm.ow2.org/")
4549 (synopsis "Very small and fast Java bytecode manipulation framework")
4550 (description "ASM is an all purpose Java bytecode manipulation and
4551 analysis framework. It can be used to modify existing classes or dynamically
4552 generate classes, directly in binary form. The provided common
4553 transformations and analysis algorithms allow to easily assemble custom
4554 complex transformations and code analysis tools.")
4555 (license license:bsd-3)))