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