gnu: All snippets report errors using exceptions, else return #t.
[jackhill/guix/guix.git] / gnu / packages / java.scm
CommitLineData
0760e3a1 1;;; GNU Guix --- Functional package management for GNU
799c3c86 2;;; Copyright © 2015, 2016, 2017, 2018 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>
88f256a1 7;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
1d47ea86 8;;; Copyright © 2016, 2017, 2018 Alex Vong <alexvong1995@gmail.com>
f4548394 9;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
d0e9ded7
GB
10;;; Copyright © 2018 Gábor Boskovits <boskovits@gmail.com>
11;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
0760e3a1
RW
12;;;
13;;; This file is part of GNU Guix.
14;;;
15;;; GNU Guix is free software; you can redistribute it and/or modify it
16;;; under the terms of the GNU General Public License as published by
17;;; the Free Software Foundation; either version 3 of the License, or (at
18;;; your option) any later version.
19;;;
20;;; GNU Guix is distributed in the hope that it will be useful, but
21;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23;;; GNU General Public License for more details.
24;;;
25;;; You should have received a copy of the GNU General Public License
26;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28(define-module (gnu packages java)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
62c9bfaa 32 #:use-module (guix hg-download)
72885a4c 33 #:use-module (guix git-download)
78745d33 34 #:use-module (guix svn-download)
f6789047 35 #:use-module (guix utils)
068e476f 36 #:use-module (guix build-system ant)
0760e3a1 37 #:use-module (guix build-system gnu)
6a5829d9 38 #:use-module (guix build-system trivial)
0760e3a1
RW
39 #:use-module (gnu packages)
40 #:use-module (gnu packages attr)
41 #:use-module (gnu packages autotools)
42 #:use-module (gnu packages base)
43 #:use-module (gnu packages bash)
f21403e2 44 #:use-module (gnu packages certs)
0760e3a1
RW
45 #:use-module (gnu packages cpio)
46 #:use-module (gnu packages cups)
47 #:use-module (gnu packages compression)
48 #:use-module (gnu packages fontutils)
49 #:use-module (gnu packages gawk)
72885a4c 50 #:use-module (gnu packages gettext)
0760e3a1 51 #:use-module (gnu packages gcc)
8581c813 52 #:use-module (gnu packages gl)
0760e3a1
RW
53 #:use-module (gnu packages gnuzilla) ;nss
54 #:use-module (gnu packages ghostscript) ;lcms
55 #:use-module (gnu packages gnome)
56 #:use-module (gnu packages gtk)
6a5829d9 57 #:use-module (gnu packages guile)
afb5858d 58 #:use-module (gnu packages icu4c)
0760e3a1 59 #:use-module (gnu packages image)
c4fd86f9 60 #:use-module (gnu packages libffi)
0760e3a1 61 #:use-module (gnu packages linux) ;alsa
2f0d0418 62 #:use-module (gnu packages maths)
5766984b 63 #:use-module (gnu packages web)
0760e3a1 64 #:use-module (gnu packages wget)
0760e3a1
RW
65 #:use-module (gnu packages pkg-config)
66 #:use-module (gnu packages perl)
c4fd86f9 67 #:use-module (gnu packages popt)
89e34644 68 #:use-module (gnu packages kerberos)
0760e3a1
RW
69 #:use-module (gnu packages xml)
70 #:use-module (gnu packages xorg)
f6789047 71 #:use-module (gnu packages texinfo)
2d15f601
RW
72 #:use-module ((srfi srfi-1) #:select (fold alist-delete))
73 #:use-module (srfi srfi-11)
74 #:use-module (ice-9 match))
0760e3a1 75
e1ae3587
RW
76\f
77;;;
78;;; Java bootstrap toolchain.
79;;;
80
81;; The Java bootstrap begins with Jikes, a Java compiler written in C++. We
82;; use it to build the SableVM standard library and virtual machine, which are
83;; written in a simpler dialect of Java and C, respectively. This is
84;; sufficient to build an older version of Ant, which is needed to build an
85;; older version of ECJ, an incremental Java compiler, both of which are
86;; written in Java.
87;;
88;; ECJ is needed to build the latest release of GNU Classpath (0.99).
89;; Classpath (> 0.98) is a requirement for JamVM, a more modern implementation
90;; of the Java virtual machine.
91;;
92;; With JamVM we can build the latest development version of GNU Classpath,
93;; which has much more support for Java 1.6 than the latest release. Since
94;; the previous build of JamVM is limited by the use of GNU Classpath 0.99 we
95;; rebuild it with the latest development version of GNU Classpath.
96;;
97;; Finally, we use the bootstrap toolchain to build the OpenJDK with the
98;; Icedtea 1.x build framework. We then build the more recent JDKs Icedtea
99;; 2.x and Icedtea 3.x.
100
101(define jikes
102 (package
103 (name "jikes")
104 (version "1.22")
105 (source (origin
106 (method url-fetch)
107 (uri (string-append "mirror://sourceforge/jikes/Jikes/"
108 version "/jikes-" version ".tar.bz2"))
109 (sha256
110 (base32
111 "1qqldrp74pzpy5ly421srqn30qppmm9cvjiqdngk8hf47dv2rc0c"))))
112 (build-system gnu-build-system)
113 (home-page "http://jikes.sourceforge.net/")
114 (synopsis "Compiler for the Java language")
115 (description "Jikes is a compiler that translates Java source files as
116defined in The Java Language Specification into the bytecoded instruction set
117and binary format defined in The Java Virtual Machine Specification.")
118 (license license:ibmpl1.0)))
119
2551fee8
RW
120(define sablevm-classpath
121 (package
122 (name "sablevm-classpath")
123 (version "1.13")
124 (source (origin
125 (method url-fetch)
126 (uri (string-append "mirror://sourceforge/sablevm/sablevm/"
127 version "/sablevm-classpath-" version ".tar.gz"))
128 (sha256
129 (base32
130 "1qyhyfz8idghxdam16hdgpa24r2x4xbg9z8c8asa3chnd79h3zw2"))))
131 (build-system gnu-build-system)
132 (arguments
133 `(#:configure-flags
134 (list "--with-jikes"
135 "--disable-Werror"
136 "--disable-gmp"
137 "--disable-gtk-peer"
138 "--disable-plugin"
139 "--disable-dssi"
140 "--disable-alsa"
141 "--disable-gjdoc")))
142 (inputs
143 `(("gconf" ,gconf)
144 ("gtk+" ,gtk+-2)))
145 (native-inputs
146 `(("jikes" ,jikes)
147 ("fastjar" ,fastjar)
148 ("pkg-config" ,pkg-config)))
149 (home-page "http://sablevm.org/")
150 (synopsis "Java Virtual Machine")
151 (description "SableVM is a clean-room, highly portable and efficient Java
152virtual machine. Its goals are to be reasonably small, fast, and compliant
153with the various specifications (JVM specification, JNI, invocation interface,
154etc.). SableVM is no longer maintained.
155
156This package provides the classpath library.")
157 (license license:lgpl2.1+)))
57f6c50d
RW
158
159(define sablevm
160 (package
161 (name "sablevm")
162 (version "1.13")
163 (source (origin
164 (method url-fetch)
165 (uri (string-append "mirror://sourceforge/sablevm/sablevm/"
166 version "/sablevm-" version ".tar.gz"))
167 (sha256
168 (base32
169 "1jyg4bsym6igz94wps5443c7wiwlzinqzkchcw972nz4kf1cql6g"))))
170 (build-system gnu-build-system)
171 (arguments
c4fd86f9 172 `(#:configure-flags
799c3c86
RW
173 (list "--with-threading=switch" ; slower but prevents segfault
174 "--with-internal-libffi=no"
c4fd86f9
RW
175 "--with-internal-libpopt=no")
176 #:phases
57f6c50d 177 (modify-phases %standard-phases
ec7e9eea
RW
178 (add-after 'unpack 'remove-timestamp-for-reproducibility
179 (lambda _
180 (substitute* "src/sablevm/Makefile.in"
181 (("\\$\\(SVMCOMPILETIME\\)") "(unknown)"))
182 #t))
c4fd86f9
RW
183 (add-after 'unpack 'link-with-popt
184 (lambda _
185 (substitute* "src/sablevm/Makefile.in"
186 (("\\$\\(SVMADD\\)" match)
187 (string-append match " -lpopt")))
188 #t))
57f6c50d
RW
189 (add-after 'unpack 'patch-path-to-classpath
190 (lambda* (#:key inputs #:allow-other-keys)
191 (substitute* "Makefile.in"
192 (("@datadir@/sablevm-classpath")
193 (string-append (assoc-ref inputs "classpath")
194 "/share/sablevm-classpath")))
195 (substitute* "src/libsablevm/Makefile.in"
196 (("\\$\\(libdir\\)/sablevm-classpath")
197 (string-append (assoc-ref inputs "classpath")
198 "/lib/sablevm-classpath"))
199 (("\\$\\(datadir\\)/sablevm-classpath")
200 (string-append (assoc-ref inputs "classpath")
201 "/share/sablevm-classpath")))
202 #t)))))
203 (inputs
204 `(("classpath" ,sablevm-classpath)
205 ("jikes" ,jikes)
c4fd86f9
RW
206 ("zlib" ,zlib)
207 ("popt" ,popt)
208 ("libffi" ,libffi)))
57f6c50d
RW
209 (native-inputs
210 `(("libltdl" ,libltdl)))
211 (home-page "http://sablevm.org/")
212 (synopsis "Java Virtual Machine")
213 (description "SableVM is a clean-room, highly portable and efficient Java
214virtual machine. Its goals are to be reasonably small, fast, and compliant
215with the various specifications (JVM specification, JNI, invocation interface,
216etc.). SableVM is no longer maintained.
217
218This package provides the virtual machine.")
219 (license license:lgpl2.1+)))
2551fee8 220
5783bd77
RW
221(define ant-bootstrap
222 (package
223 (name "ant-bootstrap")
224 ;; The 1.10.x series requires Java 8. 1.9.0 and later use generics, which
225 ;; are not supported. The 1.8.x series is the last to use only features
226 ;; supported by Jikes, but it cannot seem to be built with sablevm.
227 (version "1.7.1")
228 (source (origin
229 (method url-fetch)
230 (uri (string-append "http://archive.apache.org/dist/"
231 "ant/source/apache-ant-"
232 version "-src.tar.bz2"))
233 (sha256
234 (base32
235 "19pvqvgkxgpgsqm4lvbki5sm0z84kxmykdqicvfad47gc1r9mi2d"))))
236 (build-system gnu-build-system)
237 (arguments
238 `(#:tests? #f ; no "check" target
239 #:phases
240 (modify-phases %standard-phases
241 (delete 'configure)
242 (replace 'build
243 (lambda* (#:key inputs #:allow-other-keys)
244 (setenv "JAVA_HOME"
245 (string-append (assoc-ref inputs "sablevm")
246 "/lib/sablevm"))
247 (setenv "JAVACMD"
248 (string-append (assoc-ref inputs "sablevm")
249 "/bin/java-sablevm"))
250 (setenv "JAVAC"
251 (string-append (assoc-ref inputs "sablevm")
252 "/bin/javac-sablevm"))
253
254 ;; Use jikes instead of javac for <javac ...> tags in build.xml
255 (setenv "ANT_OPTS" "-Dbuild.compiler=jikes")
256
257 ;; jikes produces lots of warnings, but they are not very
258 ;; interesting, so we silence them.
259 (setenv "$BOOTJAVAC_OPTS" "-nowarn")
260
261 ;; Disable tests because we are bootstrapping and thus don't have
262 ;; any of the dependencies required to build and run the tests.
263 (substitute* "build.xml"
264 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
265 (zero? (system* "bash" "bootstrap.sh"
266 (string-append "-Ddist.dir="
267 (assoc-ref %outputs "out"))))))
268 (delete 'install))))
269 (native-inputs
270 `(("jikes" ,jikes)
271 ("sablevm" ,sablevm)))
272 (home-page "http://ant.apache.org")
273 (synopsis "Build tool for Java")
274 (description
275 "Ant is a platform-independent build tool for Java. It is similar to
276make but is implemented using the Java language, requires the Java platform,
277and is best suited to building Java projects. Ant uses XML to describe the
278build process and its dependencies, whereas Make uses Makefile format.")
279 (license license:asl2.0)))
280
5461721f
RW
281;; Version 3.2.2 is the last version without a dependency on a full-fledged
282;; compiler for Java 1.5.
283(define ecj-bootstrap
284 (package
285 (name "ecj-bootstrap")
286 (version "3.2.2")
287 (source (origin
288 (method url-fetch)
289 (uri (string-append "http://archive.eclipse.org/eclipse/"
290 "downloads/drops/R-" version
291 "-200702121330/ecjsrc.zip"))
292 (sha256
293 (base32
294 "05hj82kxd23qaglsjkaqcj944riisjha7acf7h3ljhrjyljx8307"))))
295 ;; It would be so much easier if we could use the ant-build-system, but we
296 ;; cannot as we don't have ant at this point. We use ecj for
297 ;; bootstrapping the JDK.
298 (build-system gnu-build-system)
299 (arguments
300 `(#:modules ((guix build gnu-build-system)
301 (guix build utils)
302 (srfi srfi-1))
303 #:tests? #f ; there are no tests
304 #:phases
305 (modify-phases %standard-phases
306 (replace 'configure
307 (lambda* (#:key inputs #:allow-other-keys)
308 (setenv "CLASSPATH"
309 (string-join
310 (find-files (string-append (assoc-ref inputs "ant-bootstrap")
311 "/lib")
312 "\\.jar$")
313 ":"))
314 #t))
315 (replace 'build
316 (lambda* (#:key inputs #:allow-other-keys)
317 ;; The unpack phase enters the "org" directory by mistake.
318 (chdir "..")
319
320 ;; Create a simple manifest to make ecj executable.
321 (with-output-to-file "manifest"
322 (lambda _
323 (display "Manifest-Version: 1.0
324Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n")))
325
326 ;; Compile it all!
327 (and (zero? (apply system* "javac-sablevm"
328 (find-files "." "\\.java$")))
329 (zero? (system* "fastjar" "cvfm"
330 "ecj-bootstrap.jar" "manifest" ".")))))
331 (replace 'install
332 (lambda* (#:key outputs #:allow-other-keys)
333 (let ((share (string-append (assoc-ref outputs "out")
334 "/share/java/")))
335 (mkdir-p share)
336 (install-file "ecj-bootstrap.jar" share)
337 #t))))))
338 (native-inputs
339 `(("ant-bootstrap" ,ant-bootstrap)
340 ("unzip" ,unzip)
341 ("sablevm" ,sablevm)
342 ("fastjar" ,fastjar)))
343 (home-page "https://eclipse.org")
344 (synopsis "Eclipse Java development tools core batch compiler")
345 (description "This package provides the Eclipse Java core batch compiler
346for bootstrapping purposes. The @dfn{Eclipse compiler for Java} (ecj) is a
347requirement for all GNU Classpath releases after version 0.93.")
348 (license license:epl1.0)))
349
6a5829d9
RW
350(define ecj-javac-wrapper
351 (package (inherit ecj-bootstrap)
352 (name "ecj-javac-wrapper")
353 (source #f)
354 (build-system trivial-build-system)
355 (arguments
356 `(#:modules ((guix build utils))
357 #:builder
358 (let ((backend 'sablevm))
359 (use-modules (guix build utils))
360 (let* ((bin (string-append (assoc-ref %outputs "out") "/bin"))
361 (target (string-append bin "/javac"))
362 (guile (string-append (assoc-ref %build-inputs "guile")
363 "/bin/guile"))
364 (ecj (string-append (assoc-ref %build-inputs "ecj-bootstrap")
365 "/share/java/ecj-bootstrap.jar"))
366 (java (case backend
367 ((sablevm)
368 (string-append (assoc-ref %build-inputs "sablevm")
369 "/lib/sablevm/bin/java"))
370 ((jamvm)
371 (string-append (assoc-ref %build-inputs "jamvm")
372 "/bin/jamvm"))))
373 (bootcp (case backend
374 ((sablevm)
375 (let ((jvmlib (string-append
376 (assoc-ref %build-inputs "sablevm-classpath")
377 "/lib/sablevm")))
378 (string-append jvmlib "/jre/lib/rt.jar")))
379 ((jamvm)
380 (let ((jvmlib (string-append (assoc-ref %build-inputs "classpath")
381 "/share/classpath")))
382 (string-append jvmlib "/lib/glibj.zip:"
383 jvmlib "/lib/tools.zip"))))))
384 (mkdir-p bin)
385 (with-output-to-file target
386 (lambda _
387 (format #t "#!~a --no-auto-compile\n!#\n" guile)
388 (write
389 `(begin (use-modules (ice-9 match)
390 (ice-9 receive)
391 (ice-9 hash-table)
392 (srfi srfi-1)
393 (srfi srfi-26))
394 (define defaults
395 '(("-bootclasspath" ,bootcp)
396 ("-source" "1.5")
397 ("-target" "1.5")
398 ("-cp" ".")))
399 (define (main args)
400 (let ((classpath (getenv "CLASSPATH")))
401 (setenv "CLASSPATH"
402 (string-append ,ecj
403 (if classpath
404 (string-append ":" classpath)
405 ""))))
406 (receive (vm-args other-args)
407 ;; Separate VM arguments from arguments to ECJ.
408 (partition (cut string-prefix? "-J" <>)
409 (fold (lambda (default acc)
410 (if (member (first default) acc)
411 acc (append default acc)))
412 args defaults))
413 (apply system* ,java
414 (append
415 ;; Remove "-J" prefix
416 (map (cut string-drop <> 2) vm-args)
417 '("org.eclipse.jdt.internal.compiler.batch.Main")
418 (cons "-nowarn" other-args)))))
419 ;; Entry point
420 (let ((args (cdr (command-line))))
421 (if (null? args)
422 (format (current-error-port) "javac: no arguments given!\n")
423 (main args)))))))
424 (chmod target #o755)
425 #t))))
426 (native-inputs
427 `(("guile" ,guile-2.2)
428 ("ecj-bootstrap" ,ecj-bootstrap)
429 ("sablevm" ,sablevm)
430 ("sablevm-classpath" ,sablevm-classpath)))
431 (description "This package provides a wrapper around the @dfn{Eclipse
432compiler for Java} (ecj) with a command line interface that is compatible with
433the standard javac executable.")))
434
d3551e86
RW
435;; Note: All the tool wrappers (e.g. for javah, javac, etc) fail with
436;; java.lang.UnsupportedClassVersionError. They simply won't run on the old
437;; sablevm. We use Classpath 0.99 to build JamVM, on which the Classpath
438;; tools do run. Using these Classpath tools on JamVM we can then build the
439;; development version of GNU Classpath.
440(define classpath-on-sablevm
441 (package
442 (name "classpath")
443 (version "0.99")
444 (source (origin
445 (method url-fetch)
446 (uri (string-append "mirror://gnu/classpath/classpath-"
447 version ".tar.gz"))
448 (sha256
449 (base32
450 "1j7cby4k66f1nvckm48xcmh352b1d1b33qk7l6hi7dp9i9zjjagr"))))
451 (build-system gnu-build-system)
452 (arguments
453 `(#:configure-flags
454 (list (string-append "--with-ecj-jar="
455 (assoc-ref %build-inputs "ecj-bootstrap")
456 "/share/java/ecj-bootstrap.jar")
457 (string-append "JAVAC="
458 (assoc-ref %build-inputs "ecj-javac-wrapper")
459 "/bin/javac")
460 (string-append "JAVA="
461 (assoc-ref %build-inputs "sablevm")
462 "/bin/java-sablevm")
463 "GCJ_JAVAC_TRUE=no"
464 "ac_cv_prog_java_works=yes" ; trust me
465 "--disable-Werror"
466 "--disable-gmp"
467 "--disable-gtk-peer"
468 "--disable-gconf-peer"
469 "--disable-plugin"
470 "--disable-dssi"
471 "--disable-alsa"
472 "--disable-gjdoc")
473 #:phases
474 (modify-phases %standard-phases
475 (add-after 'install 'install-data
476 (lambda _ (zero? (system* "make" "install-data")))))))
477 (native-inputs
478 `(("ecj-bootstrap" ,ecj-bootstrap)
479 ("ecj-javac-wrapper" ,ecj-javac-wrapper)
480 ("fastjar" ,fastjar)
481 ("sablevm" ,sablevm)
482 ("sablevm-classpath" ,sablevm-classpath)
483 ("libltdl" ,libltdl)
484 ("pkg-config" ,pkg-config)))
485 (home-page "https://www.gnu.org/software/classpath/")
486 (synopsis "Essential libraries for Java")
487 (description "GNU Classpath is a project to create core class libraries
488for use with runtimes, compilers and tools for the Java programming
489language.")
490 ;; GPLv2 or later, with special linking exception.
491 (license license:gpl2+)))
5f4402c7
RW
492
493(define jamvm-bootstrap
494 (package
495 (name "jamvm")
496 (version "2.0.0")
497 (source (origin
498 (method url-fetch)
499 (uri (string-append "mirror://sourceforge/jamvm/jamvm/"
500 "JamVM%20" version "/jamvm-"
501 version ".tar.gz"))
502 (sha256
503 (base32
504 "1nl0zxz8y5x8gwsrm7n32bry4dx8x70p8z3s9jbdvs8avyb8whkn"))))
505 (build-system gnu-build-system)
506 (arguments
507 `(#:configure-flags
508 (list (string-append "--with-classpath-install-dir="
509 (assoc-ref %build-inputs "classpath")))))
510 (inputs
511 `(("classpath" ,classpath-on-sablevm)
512 ("ecj-javac-wrapper" ,ecj-javac-wrapper)
513 ("zlib" ,zlib)))
514 (home-page "http://jamvm.sourceforge.net/")
515 (synopsis "Small Java Virtual Machine")
516 (description "JamVM is a Java Virtual Machine conforming to the JVM
517specification edition 2 (blue book). It is extremely small. However, unlike
518other small VMs it supports the full spec, including object finalisation and
519JNI.")
520 (license license:gpl2+)))
d3551e86 521
04d7cae2
RW
522;; We need this because the tools provided by the latest release of GNU
523;; Classpath don't actually work with sablevm.
524(define classpath-jamvm-wrappers
525 (package (inherit classpath-on-sablevm)
526 (name "classpath-jamvm-wrappers")
527 (source #f)
528 (build-system trivial-build-system)
529 (arguments
530 `(#:modules ((guix build utils))
531 #:builder
532 (begin
533 (use-modules (guix build utils))
534 (let* ((bash (assoc-ref %build-inputs "bash"))
535 (jamvm (assoc-ref %build-inputs "jamvm"))
536 (classpath (assoc-ref %build-inputs "classpath"))
537 (bin (string-append (assoc-ref %outputs "out")
538 "/bin/")))
539 (mkdir-p bin)
540 (for-each (lambda (tool)
541 (with-output-to-file (string-append bin tool)
542 (lambda _
543 (format #t "#!~a/bin/sh
544~a/bin/jamvm -classpath ~a/share/classpath/tools.zip \
545gnu.classpath.tools.~a.~a $@"
546 bash jamvm classpath tool
547 (if (string=? "native2ascii" tool)
548 "Native2ASCII" "Main"))))
549 (chmod (string-append bin tool) #o755))
550 (list "javah"
551 "rmic"
552 "rmid"
553 "orbd"
554 "rmiregistry"
555 "native2ascii"))
556 #t))))
557 (native-inputs
558 `(("bash" ,bash)
559 ("jamvm" ,jamvm-bootstrap)
560 ("classpath" ,classpath-on-sablevm)))
561 (inputs '())
562 (synopsis "Executables from GNU Classpath")
563 (description "This package provides wrappers around the tools provided by
564the GNU Classpath library. They are executed by the JamVM virtual
565machine.")))
566
7292d694
RW
567(define ecj-javac-on-jamvm-wrapper
568 (package (inherit ecj-javac-wrapper)
569 (name "ecj-javac-on-jamvm-wrapper")
570 (arguments
571 `(#:modules ((guix build utils))
572 #:builder
573 ;; TODO: This builder is exactly the same as in ecj-javac-wrapper,
574 ;; except that the backend is 'jamvm here. Can we reuse the same
575 ;; builder somehow?
576 (let ((backend 'jamvm))
577 (use-modules (guix build utils))
578 (let* ((bin (string-append (assoc-ref %outputs "out") "/bin"))
579 (target (string-append bin "/javac"))
580 (guile (string-append (assoc-ref %build-inputs "guile")
581 "/bin/guile"))
582 (ecj (string-append (assoc-ref %build-inputs "ecj-bootstrap")
583 "/share/java/ecj-bootstrap.jar"))
584 (java (case backend
585 ((sablevm)
586 (string-append (assoc-ref %build-inputs "sablevm")
587 "/lib/sablevm/bin/java"))
588 ((jamvm)
589 (string-append (assoc-ref %build-inputs "jamvm")
590 "/bin/jamvm"))))
591 (bootcp (case backend
592 ((sablevm)
593 (let ((jvmlib (string-append
594 (assoc-ref %build-inputs "sablevm-classpath")
595 "/lib/sablevm")))
596 (string-append jvmlib "/jre/lib/rt.jar")))
597 ((jamvm)
598 (let ((jvmlib (string-append (assoc-ref %build-inputs "classpath")
599 "/share/classpath")))
600 (string-append jvmlib "/lib/glibj.zip:"
601 jvmlib "/lib/tools.zip"))))))
602 (mkdir-p bin)
603 (with-output-to-file target
604 (lambda _
605 (format #t "#!~a --no-auto-compile\n!#\n" guile)
606 (write
607 `(begin (use-modules (ice-9 match)
608 (ice-9 receive)
609 (ice-9 hash-table)
610 (srfi srfi-1)
611 (srfi srfi-26))
612 (define defaults
613 '(("-bootclasspath" ,bootcp)
614 ("-source" "1.5")
615 ("-target" "1.5")
616 ("-cp" ".")))
617 (define (main args)
618 (let ((classpath (getenv "CLASSPATH")))
619 (setenv "CLASSPATH"
620 (string-append ,ecj
621 (if classpath
622 (string-append ":" classpath)
623 ""))))
624 (receive (vm-args other-args)
625 ;; Separate VM arguments from arguments to ECJ.
626 (partition (cut string-prefix? "-J" <>)
627 (fold (lambda (default acc)
628 (if (member (first default) acc)
629 acc (append default acc)))
630 args defaults))
631 (apply system* ,java
632 (append
633 ;; Remove "-J" prefix
634 (map (cut string-drop <> 2) vm-args)
635 '("org.eclipse.jdt.internal.compiler.batch.Main")
636 (cons "-nowarn" other-args)))))
637 ;; Entry point
638 (let ((args (cdr (command-line))))
639 (if (null? args)
640 (format (current-error-port) "javac: no arguments given!\n")
641 (main args)))))))
642 (chmod target #o755)
643 #t))))
644 (native-inputs
645 `(("guile" ,guile-2.2)
646 ("ecj-bootstrap" ,ecj-bootstrap)
647 ("jamvm" ,jamvm-bootstrap)
648 ("classpath" ,classpath-on-sablevm)))
649 (description "This package provides a wrapper around the @dfn{Eclipse
650compiler for Java} (ecj) with a command line interface that is compatible with
651the standard javac executable. The tool runs on JamVM instead of SableVM.")))
652
72885a4c
RW
653;; The last release of GNU Classpath is 0.99 and it happened in 2012. Since
654;; then Classpath has gained much more support for Java 1.6.
655(define-public classpath-devel
656 (let ((commit "e7c13ee0cf2005206fbec0eca677f8cf66d5a103")
657 (revision "1"))
658 (package (inherit classpath-on-sablevm)
659 (version (string-append "0.99-" revision "." (string-take commit 9)))
660 (source (origin
661 (method git-fetch)
662 (uri (git-reference
5f13bf09 663 (url "https://git.savannah.gnu.org/git/classpath.git")
72885a4c 664 (commit commit)))
51988e3a 665 (file-name (string-append "classpath-" version "-checkout"))
72885a4c
RW
666 (sha256
667 (base32
668 "1v2rww76ww322mpg3s12a1kkc6gkp31bm9gcxs532h0wq285fiw4"))))
669 (arguments
93c103ab
RW
670 `(#:make-flags
671 ;; Ensure that the initial heap size is smaller than the maximum
672 ;; size. By default only Xmx is set, which can lead to invalid
673 ;; memory settings on some machines with a lot of memory.
674 '("JAVAC_MEM_OPT=-J-Xms512M -J-Xmx768M")
675 #:configure-flags
72885a4c
RW
676 (list (string-append "--with-ecj-jar="
677 (assoc-ref %build-inputs "ecj-bootstrap")
678 "/share/java/ecj-bootstrap.jar")
93c103ab 679 (string-append "--with-javac="
72885a4c
RW
680 (assoc-ref %build-inputs "ecj-javac-wrapper")
681 "/bin/javac")
682 (string-append "JAVA="
683 (assoc-ref %build-inputs "jamvm")
684 "/bin/jamvm")
685 "GCJ_JAVAC_TRUE=no"
686 "ac_cv_prog_java_works=yes" ; trust me
687 "--disable-Werror"
688 "--disable-gmp"
689 "--disable-gtk-peer"
690 "--disable-gconf-peer"
691 "--disable-plugin"
692 "--disable-dssi"
693 "--disable-alsa"
694 "--disable-gjdoc")
695 #:phases
696 (modify-phases %standard-phases
2a69f48e
RW
697 ;; XXX The bootstrap phase executes autogen.sh, which fails after
698 ;; complaining about the lack of gettext.
699 (replace 'bootstrap
700 (lambda _ (invoke "autoreconf" "-vif")))
72885a4c
RW
701 (add-after 'unpack 'remove-unsupported-annotations
702 (lambda _
703 (substitute* (find-files "java" "\\.java$")
704 (("@Override") ""))
705 #t))
706 (add-after 'install 'install-data
707 (lambda _ (zero? (system* "make" "install-data")))))))
708 (native-inputs
709 `(("autoconf" ,autoconf)
710 ("automake" ,automake)
711 ("libtool" ,libtool)
712 ("gettext" ,gettext-minimal)
713 ("texinfo" ,texinfo)
714 ("classpath-jamvm-wrappers" ,classpath-jamvm-wrappers) ; for javah
715 ("ecj-bootstrap" ,ecj-bootstrap)
716 ("ecj-javac-wrapper" ,ecj-javac-on-jamvm-wrapper)
717 ("fastjar" ,fastjar)
718 ("jamvm" ,jamvm-bootstrap)
719 ("libltdl" ,libltdl)
720 ("pkg-config" ,pkg-config))))))
721
8c6091e3
RW
722(define-public jamvm
723 (package (inherit jamvm-bootstrap)
724 (inputs
725 `(("classpath" ,classpath-devel)
726 ("ecj-javac-wrapper" ,ecj-javac-on-jamvm-wrapper)
727 ("zlib" ,zlib)))))
728
1bf56c72
RW
729(define ecj-javac-on-jamvm-wrapper-final
730 (package (inherit ecj-javac-on-jamvm-wrapper)
731 (native-inputs
732 `(("guile" ,guile-2.2)
733 ("ecj-bootstrap" ,ecj-bootstrap)
734 ("jamvm" ,jamvm)
735 ("classpath" ,classpath-devel)))))
736
98419316
RW
737;; The bootstrap JDK consisting of jamvm, classpath-devel,
738;; ecj-javac-on-jamvm-wrapper-final cannot build Icedtea 2.x directly, because
739;; it's written in Java 7. It can, however, build the unmaintained Icedtea
740;; 1.x, which uses Java 6 only.
741(define-public icedtea-6
742 (package
743 (name "icedtea")
744 (version "1.13.13")
745 (source (origin
746 (method url-fetch)
747 (uri (string-append
748 "http://icedtea.wildebeest.org/download/source/icedtea6-"
749 version ".tar.xz"))
750 (sha256
751 (base32
752 "0bg9sb4f7qbq77c0zf9m17p47ga0kf0r9622g9p12ysg26jd1ksg"))
753 (modules '((guix build utils)))
754 (snippet
6cbee49d
MW
755 '(begin
756 (substitute* "Makefile.in"
757 ;; do not leak information about the build host
758 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
759 "DISTRIBUTION_ID=\"\\\"guix\\\"\""))
760 #t))))
98419316
RW
761 (build-system gnu-build-system)
762 (outputs '("out" ; Java Runtime Environment
763 "jdk" ; Java Development Kit
764 "doc")) ; all documentation
765 (arguments
766 `(;; There are many failing tests and many are known to fail upstream.
767 #:tests? #f
768
769 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
770 ;; gremlin) doesn't support it yet, so skip this phase.
771 #:validate-runpath? #f
772
773 #:modules ((guix build utils)
774 (guix build gnu-build-system)
775 (srfi srfi-19))
776
777 #:configure-flags
778 `("--enable-bootstrap"
779 "--enable-nss"
780 "--without-rhino"
781 "--with-parallel-jobs"
782 "--disable-downloading"
783 "--disable-tests"
784 ,(string-append "--with-ecj="
785 (assoc-ref %build-inputs "ecj")
786 "/share/java/ecj-bootstrap.jar")
787 ,(string-append "--with-jar="
788 (assoc-ref %build-inputs "fastjar")
789 "/bin/fastjar")
790 ,(string-append "--with-jdk-home="
791 (assoc-ref %build-inputs "classpath"))
792 ,(string-append "--with-java="
793 (assoc-ref %build-inputs "jamvm")
794 "/bin/jamvm"))
795 #:phases
796 (modify-phases %standard-phases
797 (replace 'unpack
798 (lambda* (#:key source inputs #:allow-other-keys)
799 (and (zero? (system* "tar" "xvf" source))
800 (begin
801 (chdir (string-append "icedtea6-" ,version))
802 (mkdir "openjdk")
803 (copy-recursively (assoc-ref inputs "openjdk-src") "openjdk")
804 ;; The convenient OpenJDK source bundle is no longer
805 ;; available for download, so we have to take the sources
806 ;; from the Mercurial repositories and change the Makefile
807 ;; to avoid tests for the OpenJDK zip archive.
808 (with-directory-excursion "openjdk"
809 (for-each (lambda (part)
810 (mkdir part)
811 (copy-recursively
812 (assoc-ref inputs
813 (string-append part "-src"))
814 part))
815 '("jdk" "hotspot" "corba"
816 "langtools" "jaxp" "jaxws")))
817 (substitute* "Makefile.in"
818 (("echo \"ERROR: No up-to-date OpenJDK zip available\"; exit -1;")
819 "echo \"trust me\";")
820 ;; The contents of the bootstrap directory must be
821 ;; writeable but when copying from the store they are
822 ;; not.
823 (("mkdir -p lib/rt" line)
824 (string-append line "; chmod -R u+w $(BOOT_DIR)")))
825 (zero? (system* "chmod" "-R" "u+w" "openjdk"))
826 #t))))
827 (add-after 'unpack 'use-classpath
828 (lambda* (#:key inputs #:allow-other-keys)
829 (let ((jvmlib (assoc-ref inputs "classpath")))
830 ;; Classpath does not provide rt.jar.
831 (substitute* "Makefile.in"
832 (("\\$\\(SYSTEM_JDK_DIR\\)/jre/lib/rt.jar")
833 (string-append jvmlib "/share/classpath/glibj.zip")))
834 ;; Make sure we can find all classes.
835 (setenv "CLASSPATH"
836 (string-append jvmlib "/share/classpath/glibj.zip:"
837 jvmlib "/share/classpath/tools.zip"))
838 (setenv "JAVACFLAGS"
839 (string-append "-cp "
840 jvmlib "/share/classpath/glibj.zip:"
841 jvmlib "/share/classpath/tools.zip")))
842 #t))
843 (add-after 'unpack 'patch-patches
844 (lambda _
845 ;; shebang in patches so that they apply cleanly
846 (substitute* '("patches/jtreg-jrunscript.patch"
847 "patches/hotspot/hs23/drop_unlicensed_test.patch")
848 (("#!/bin/sh") (string-append "#!" (which "sh"))))
849 #t))
850 (add-after 'unpack 'patch-paths
851 (lambda* (#:key inputs #:allow-other-keys)
852 ;; buildtree.make generates shell scripts, so we need to replace
853 ;; the generated shebang
854 (substitute* '("openjdk/hotspot/make/linux/makefiles/buildtree.make")
855 (("/bin/sh") (which "bash")))
856
857 (let ((corebin (string-append
858 (assoc-ref inputs "coreutils") "/bin/"))
859 (binbin (string-append
860 (assoc-ref inputs "binutils") "/bin/"))
861 (grepbin (string-append
862 (assoc-ref inputs "grep") "/bin/")))
863 (substitute* '("openjdk/jdk/make/common/shared/Defs-linux.gmk"
864 "openjdk/corba/make/common/shared/Defs-linux.gmk")
865 (("UNIXCOMMAND_PATH = /bin/")
866 (string-append "UNIXCOMMAND_PATH = " corebin))
867 (("USRBIN_PATH = /usr/bin/")
868 (string-append "USRBIN_PATH = " corebin))
869 (("DEVTOOLS_PATH *= */usr/bin/")
870 (string-append "DEVTOOLS_PATH = " corebin))
871 (("COMPILER_PATH *= */usr/bin/")
872 (string-append "COMPILER_PATH = "
873 (assoc-ref inputs "gcc") "/bin/"))
874 (("DEF_OBJCOPY *=.*objcopy")
875 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
876
877 ;; fix path to alsa header
878 (substitute* "openjdk/jdk/make/common/shared/Sanity.gmk"
879 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
880 (string-append "ALSA_INCLUDE="
881 (assoc-ref inputs "alsa-lib")
882 "/include/alsa/version.h")))
883
884 ;; fix hard-coded utility paths
885 (substitute* '("openjdk/jdk/make/common/shared/Defs-utils.gmk"
886 "openjdk/corba/make/common/shared/Defs-utils.gmk")
887 (("ECHO *=.*echo")
888 (string-append "ECHO = " (which "echo")))
889 (("^GREP *=.*grep")
890 (string-append "GREP = " (which "grep")))
891 (("EGREP *=.*egrep")
892 (string-append "EGREP = " (which "egrep")))
893 (("CPIO *=.*cpio")
894 (string-append "CPIO = " (which "cpio")))
895 (("READELF *=.*readelf")
896 (string-append "READELF = " (which "readelf")))
897 (("^ *AR *=.*ar")
898 (string-append "AR = " (which "ar")))
899 (("^ *TAR *=.*tar")
900 (string-append "TAR = " (which "tar")))
901 (("AS *=.*as")
902 (string-append "AS = " (which "as")))
903 (("LD *=.*ld")
904 (string-append "LD = " (which "ld")))
905 (("STRIP *=.*strip")
906 (string-append "STRIP = " (which "strip")))
907 (("NM *=.*nm")
908 (string-append "NM = " (which "nm")))
909 (("^SH *=.*sh")
910 (string-append "SH = " (which "bash")))
911 (("^FIND *=.*find")
912 (string-append "FIND = " (which "find")))
913 (("LDD *=.*ldd")
914 (string-append "LDD = " (which "ldd")))
915 (("NAWK *=.*(n|g)awk")
916 (string-append "NAWK = " (which "gawk")))
917 (("XARGS *=.*xargs")
918 (string-append "XARGS = " (which "xargs")))
919 (("UNZIP *=.*unzip")
920 (string-append "UNZIP = " (which "unzip")))
921 (("ZIPEXE *=.*zip")
922 (string-append "ZIPEXE = " (which "zip")))
923 (("SED *=.*sed")
924 (string-append "SED = " (which "sed"))))
925
926 ;; Some of these timestamps cause problems as they are more than
927 ;; 10 years ago, failing the build process.
928 (substitute*
929 "openjdk/jdk/src/share/classes/java/util/CurrencyData.properties"
930 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
931 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
932 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
933 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY"))
934 #t)))
935 (add-before 'configure 'set-additional-paths
936 (lambda* (#:key inputs #:allow-other-keys)
937 (setenv "CPATH"
938 (string-append (assoc-ref inputs "libxrender")
939 "/include/X11/extensions" ":"
940 (assoc-ref inputs "libxtst")
941 "/include/X11/extensions" ":"
942 (assoc-ref inputs "libxinerama")
943 "/include/X11/extensions" ":"
944 (or (getenv "CPATH") "")))
945 (setenv "ALT_CUPS_HEADERS_PATH"
946 (string-append (assoc-ref inputs "cups")
947 "/include"))
948 (setenv "ALT_FREETYPE_HEADERS_PATH"
949 (string-append (assoc-ref inputs "freetype")
950 "/include"))
951 (setenv "ALT_FREETYPE_LIB_PATH"
952 (string-append (assoc-ref inputs "freetype")
953 "/lib"))
954 #t))
955 (replace 'install
956 (lambda* (#:key outputs #:allow-other-keys)
957 (let ((doc (string-append (assoc-ref outputs "doc")
958 "/share/doc/icedtea"))
959 (jre (assoc-ref outputs "out"))
960 (jdk (assoc-ref outputs "jdk")))
961 (copy-recursively "openjdk.build/docs" doc)
962 (copy-recursively "openjdk.build/j2re-image" jre)
963 (copy-recursively "openjdk.build/j2sdk-image" jdk))
964 #t)))))
965 (native-inputs
966 `(("ant" ,ant-bootstrap)
967 ("alsa-lib" ,alsa-lib)
968 ("attr" ,attr)
969 ("classpath" ,classpath-devel)
970 ("coreutils" ,coreutils)
971 ("cpio" ,cpio)
972 ("cups" ,cups)
973 ("ecj" ,ecj-bootstrap)
974 ("ecj-javac" ,ecj-javac-on-jamvm-wrapper-final)
975 ("fastjar" ,fastjar)
976 ("fontconfig" ,fontconfig)
977 ("freetype" ,freetype)
978 ("gtk" ,gtk+-2)
979 ("gawk" ,gawk)
980 ("giflib" ,giflib)
981 ("grep" ,grep)
982 ("jamvm" ,jamvm)
983 ("lcms" ,lcms)
984 ("libjpeg" ,libjpeg)
985 ("libpng" ,libpng)
986 ("libtool" ,libtool)
987 ("libx11" ,libx11)
988 ("libxcomposite" ,libxcomposite)
989 ("libxi" ,libxi)
990 ("libxinerama" ,libxinerama)
991 ("libxrender" ,libxrender)
992 ("libxslt" ,libxslt) ;for xsltproc
993 ("libxt" ,libxt)
994 ("libxtst" ,libxtst)
995 ("mit-krb5" ,mit-krb5)
996 ("nss" ,nss)
997 ("nss-certs" ,nss-certs)
998 ("perl" ,perl)
999 ("pkg-config" ,pkg-config)
1000 ("procps" ,procps) ;for "free", even though I'm not sure we should use it
1001 ("unzip" ,unzip)
1002 ("wget" ,wget)
1003 ("which" ,which)
1004 ("zip" ,zip)
1005 ("zlib" ,zlib)
1006 ("openjdk-src"
1007 ,(origin
1008 (method hg-fetch)
1009 (uri (hg-reference
1010 (url "http://hg.openjdk.java.net/jdk6/jdk6/")
1011 (changeset "jdk6-b41")))
1012 (sha256
1013 (base32
1014 "14q47yfg586fs64w30g8mk92m5dkxsvr36zzh0ra99xk5x0x96mv"))))
1015 ("jdk-src"
1016 ,(origin
1017 (method hg-fetch)
1018 (uri (hg-reference
1019 (url "http://hg.openjdk.java.net/jdk6/jdk6/jdk/")
1020 (changeset "jdk6-b41")))
1021 (sha256
1022 (base32
1023 "165824nhg1k1dx6zs9dny0j49rmk35jw5b13dmz8c77jfajml4v9"))))
1024 ("hotspot-src"
1025 ,(origin
1026 (method hg-fetch)
1027 (uri (hg-reference
1028 (url "http://hg.openjdk.java.net/jdk6/jdk6/hotspot/")
1029 (changeset "jdk6-b41")))
1030 (sha256
1031 (base32
1032 "07lc1z4k5dj9nrc1wvwmpvxr3xgxrdkdh53xb95skk5ij49yagfd"))))
1033 ("corba-src"
1034 ,(origin
1035 (method hg-fetch)
1036 (uri (hg-reference
1037 (url "http://hg.openjdk.java.net/jdk6/jdk6/corba/")
1038 (changeset "jdk6-b41")))
1039 (sha256
1040 (base32
1041 "1p9g1r9dnax2iwp7yb59qx7m4nmshqhwmrb2b8jj8zgbd9dl2i3q"))))
1042 ("langtools-src"
1043 ,(origin
1044 (method hg-fetch)
1045 (uri (hg-reference
1046 (url "http://hg.openjdk.java.net/jdk6/jdk6/langtools/")
1047 (changeset "jdk6-b41")))
1048 (sha256
1049 (base32
1050 "1x52wd67fynbbd9ild6fb4wvba3f5hhwk03qdjfazd0a1qr37z3d"))))
1051 ("jaxp-src"
1052 ,(origin
1053 (method hg-fetch)
1054 (uri (hg-reference
1055 (url "http://hg.openjdk.java.net/jdk6/jdk6/jaxp/")
1056 (changeset "jdk6-b41")))
1057 (sha256
1058 (base32
1059 "0shlqrvzpr4nrkmv215lbxnby63s3yvbdh1yxcayznsyqwa4nlxm"))))
1060 ("jaxws-src"
1061 ,(origin
1062 (method hg-fetch)
1063 (uri (hg-reference
1064 (url "http://hg.openjdk.java.net/jdk6/jdk6/jaxws/")
1065 (changeset "jdk6-b41")))
1066 (sha256
1067 (base32
1068 "0835lkw8vib1xhp8lxnybhlvzdh699hbi4mclxanydjk63zbpxk0"))))))
1069 (home-page "http://icedtea.classpath.org")
1070 (synopsis "Java development kit")
1071 (description
1072 "This package provides the OpenJDK built with the IcedTea build harness.
1073This version of the OpenJDK is no longer maintained and is only used for
1074bootstrapping purposes.")
1075 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
1076 ;; same license as both GNU Classpath and OpenJDK.
1077 (license license:gpl2+)))
1078
a243e12a 1079(define-public icedtea-7
6e7d8419 1080 (let* ((version "2.6.12")
f6789047
RW
1081 (drop (lambda (name hash)
1082 (origin
1083 (method url-fetch)
1084 (uri (string-append
d30ce4a7 1085 "http://icedtea.classpath.org/download/drops"
f6789047
RW
1086 "/icedtea7/" version "/" name ".tar.bz2"))
1087 (sha256 (base32 hash))))))
71053e14
RW
1088 (package
1089 (name "icedtea")
f6789047
RW
1090 (version version)
1091 (source (origin
1092 (method url-fetch)
1093 (uri (string-append
1094 "http://icedtea.wildebeest.org/download/source/icedtea-"
1095 version ".tar.xz"))
1096 (sha256
1097 (base32
6e7d8419 1098 "0s0zh0mj1sab99kb516lsgq3859vsc951phc565gwix4l5g9zppk"))
f6789047
RW
1099 (modules '((guix build utils)))
1100 (snippet
6cbee49d
MW
1101 '(begin
1102 (substitute* "Makefile.in"
1103 ;; do not leak information about the build host
1104 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
1105 "DISTRIBUTION_ID=\"\\\"guix\\\"\""))
1106 #t))))
71053e14
RW
1107 (build-system gnu-build-system)
1108 (outputs '("out" ; Java Runtime Environment
1109 "jdk" ; Java Development Kit
1110 "doc")) ; all documentation
f6789047
RW
1111 (arguments
1112 `(;; There are many test failures. Some are known to
1113 ;; fail upstream, others relate to not having an X
1114 ;; server running at test time, yet others are a
1115 ;; complete mystery to me.
1116
1117 ;; hotspot: passed: 241; failed: 45; error: 2
1118 ;; langtools: passed: 1,934; failed: 26
1119 ;; jdk: unknown
1120 #:tests? #f
71053e14
RW
1121
1122 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
1123 ;; gremlin) doesn't support it yet, so skip this phase.
1124 #:validate-runpath? #f
1125
f6789047
RW
1126 ;; Apparently, the C locale is needed for some of the tests.
1127 #:locale "C"
71053e14
RW
1128
1129 #:modules ((guix build utils)
1130 (guix build gnu-build-system)
1131 (ice-9 match)
1132 (ice-9 popen)
71053e14
RW
1133 (srfi srfi-19)
1134 (srfi srfi-26))
1135
1136 #:configure-flags
e2098e2d
RW
1137 ;; TODO: package pcsc and sctp, and add to inputs
1138 `("--disable-system-pcsc"
1139 "--disable-system-sctp"
1140 "--enable-bootstrap"
1141 "--enable-nss"
1142 "--without-rhino"
1143 "--disable-downloading"
1144 "--disable-tests" ;they are run in the check phase instead
1145 "--with-openjdk-src-dir=./openjdk.src"
1146 ,(string-append "--with-jdk-home="
1147 (assoc-ref %build-inputs "jdk")))
71053e14
RW
1148
1149 #:phases
1150 (modify-phases %standard-phases
1151 (replace 'unpack
1152 (lambda* (#:key source inputs #:allow-other-keys)
1153 (let ((target (string-append "icedtea-" ,version))
1154 (unpack (lambda* (name #:optional dir)
1155 (let ((dir (or dir
1156 (string-drop-right name 5))))
1157 (mkdir dir)
1158 (zero? (system* "tar" "xvf"
1159 (assoc-ref inputs name)
1160 "-C" dir
1161 "--strip-components=1"))))))
1162 (mkdir target)
1163 (and
1164 (zero? (system* "tar" "xvf" source
1165 "-C" target "--strip-components=1"))
1166 (chdir target)
1167 (unpack "openjdk-src" "openjdk.src")
1168 (with-directory-excursion "openjdk.src"
1169 (for-each unpack
1170 (filter (cut string-suffix? "-drop" <>)
1171 (map (match-lambda
1172 ((name . _) name))
1173 inputs))))
1174 #t))))
1175 (add-after 'unpack 'fix-x11-extension-include-path
1176 (lambda* (#:key inputs #:allow-other-keys)
1177 (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
1178 (((string-append "\\$\\(firstword \\$\\(wildcard "
1179 "\\$\\(OPENWIN_HOME\\)"
1180 "/include/X11/extensions\\).*$"))
1181 (string-append (assoc-ref inputs "libxrender")
1182 "/include/X11/extensions"
1183 " -I" (assoc-ref inputs "libxtst")
1184 "/include/X11/extensions"
1185 " -I" (assoc-ref inputs "libxinerama")
1186 "/include/X11/extensions"))
1187 (("\\$\\(wildcard /usr/include/X11/extensions\\)\\)") ""))
1188 #t))
1189 (add-after 'unpack 'patch-paths
1190 (lambda _
1191 ;; buildtree.make generates shell scripts, so we need to replace
1192 ;; the generated shebang
1193 (substitute* '("openjdk.src/hotspot/make/linux/makefiles/buildtree.make")
1194 (("/bin/sh") (which "bash")))
1195
1196 (let ((corebin (string-append
1197 (assoc-ref %build-inputs "coreutils") "/bin/"))
1198 (binbin (string-append
1199 (assoc-ref %build-inputs "binutils") "/bin/"))
1200 (grepbin (string-append
1201 (assoc-ref %build-inputs "grep") "/bin/")))
1202 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
1203 "openjdk.src/corba/make/common/shared/Defs-linux.gmk")
1204 (("UNIXCOMMAND_PATH = /bin/")
1205 (string-append "UNIXCOMMAND_PATH = " corebin))
1206 (("USRBIN_PATH = /usr/bin/")
1207 (string-append "USRBIN_PATH = " corebin))
1208 (("DEVTOOLS_PATH *= */usr/bin/")
1209 (string-append "DEVTOOLS_PATH = " corebin))
1210 (("COMPILER_PATH *= */usr/bin/")
1211 (string-append "COMPILER_PATH = "
1212 (assoc-ref %build-inputs "gcc") "/bin/"))
1213 (("DEF_OBJCOPY *=.*objcopy")
1214 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
1215
1216 ;; fix path to alsa header
1217 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
1218 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
1219 (string-append "ALSA_INCLUDE="
1220 (assoc-ref %build-inputs "alsa-lib")
1221 "/include/alsa/version.h")))
1222
1223 ;; fix hard-coded utility paths
1224 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-utils.gmk"
1225 "openjdk.src/corba/make/common/shared/Defs-utils.gmk")
1226 (("ECHO *=.*echo")
1227 (string-append "ECHO = " (which "echo")))
1228 (("^GREP *=.*grep")
1229 (string-append "GREP = " (which "grep")))
1230 (("EGREP *=.*egrep")
1231 (string-append "EGREP = " (which "egrep")))
1232 (("CPIO *=.*cpio")
1233 (string-append "CPIO = " (which "cpio")))
1234 (("READELF *=.*readelf")
1235 (string-append "READELF = " (which "readelf")))
1236 (("^ *AR *=.*ar")
1237 (string-append "AR = " (which "ar")))
1238 (("^ *TAR *=.*tar")
1239 (string-append "TAR = " (which "tar")))
1240 (("AS *=.*as")
1241 (string-append "AS = " (which "as")))
1242 (("LD *=.*ld")
1243 (string-append "LD = " (which "ld")))
1244 (("STRIP *=.*strip")
1245 (string-append "STRIP = " (which "strip")))
1246 (("NM *=.*nm")
1247 (string-append "NM = " (which "nm")))
1248 (("^SH *=.*sh")
1249 (string-append "SH = " (which "bash")))
1250 (("^FIND *=.*find")
1251 (string-append "FIND = " (which "find")))
1252 (("LDD *=.*ldd")
1253 (string-append "LDD = " (which "ldd")))
1254 (("NAWK *=.*(n|g)awk")
1255 (string-append "NAWK = " (which "gawk")))
1256 (("XARGS *=.*xargs")
1257 (string-append "XARGS = " (which "xargs")))
1258 (("UNZIP *=.*unzip")
1259 (string-append "UNZIP = " (which "unzip")))
1260 (("ZIPEXE *=.*zip")
1261 (string-append "ZIPEXE = " (which "zip")))
1262 (("SED *=.*sed")
1263 (string-append "SED = " (which "sed"))))
1264
1265 ;; Some of these timestamps cause problems as they are more than
1266 ;; 10 years ago, failing the build process.
1267 (substitute*
1268 "openjdk.src/jdk/src/share/classes/java/util/CurrencyData.properties"
1269 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
1270 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
1271 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
1272 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY")))
1273 #t))
1274 (add-before 'configure 'set-additional-paths
1275 (lambda* (#:key inputs #:allow-other-keys)
e2098e2d
RW
1276 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
1277 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
1278 (string-append "ALSA_INCLUDE="
1279 (assoc-ref inputs "alsa-lib")
1280 "/include/alsa/version.h")))
1281 (setenv "CC" "gcc")
1282 (setenv "CPATH"
1283 (string-append (assoc-ref inputs "libxcomposite")
1284 "/include/X11/extensions" ":"
1285 (assoc-ref inputs "libxrender")
1286 "/include/X11/extensions" ":"
1287 (assoc-ref inputs "libxtst")
1288 "/include/X11/extensions" ":"
1289 (assoc-ref inputs "libxinerama")
1290 "/include/X11/extensions" ":"
1291 (or (getenv "CPATH") "")))
1292 (setenv "ALT_OBJCOPY" (which "objcopy"))
1293 (setenv "ALT_CUPS_HEADERS_PATH"
1294 (string-append (assoc-ref inputs "cups")
1295 "/include"))
1296 (setenv "ALT_FREETYPE_HEADERS_PATH"
1297 (string-append (assoc-ref inputs "freetype")
1298 "/include"))
1299 (setenv "ALT_FREETYPE_LIB_PATH"
1300 (string-append (assoc-ref inputs "freetype")
1301 "/lib"))
71053e14
RW
1302 #t))
1303 (add-before 'check 'fix-test-framework
1304 (lambda _
1305 ;; Fix PATH in test environment
1306 (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
1307 (("PATH=/bin:/usr/bin")
1308 (string-append "PATH=" (getenv "PATH"))))
1309 (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
1310 (("/usr/bin/env") (which "env")))
1311 (substitute* "openjdk.src/hotspot/test/test_env.sh"
1312 (("/bin/rm") (which "rm"))
1313 (("/bin/cp") (which "cp"))
1314 (("/bin/mv") (which "mv")))
1315 #t))
1316 (add-before 'check 'fix-hotspot-tests
1317 (lambda _
1318 (with-directory-excursion "openjdk.src/hotspot/test/"
1319 (substitute* "jprt.config"
1320 (("PATH=\"\\$\\{path4sdk\\}\"")
1321 (string-append "PATH=" (getenv "PATH")))
1322 (("make=/usr/bin/make")
1323 (string-append "make=" (which "make"))))
1324 (substitute* '("runtime/6626217/Test6626217.sh"
1325 "runtime/7110720/Test7110720.sh")
1326 (("/bin/rm") (which "rm"))
1327 (("/bin/cp") (which "cp"))
1328 (("/bin/mv") (which "mv"))))
1329 #t))
1330 (add-before 'check 'fix-jdk-tests
1331 (lambda _
1332 (with-directory-excursion "openjdk.src/jdk/test/"
1333 (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
1334 (("/bin/pwd") (which "pwd")))
1335 (substitute* "com/sun/jdi/ShellScaffold.sh"
1336 (("/bin/kill") (which "kill")))
1337 (substitute* "start-Xvfb.sh"
1338 ;;(("/usr/bin/X11/Xvfb") (which "Xvfb"))
1339 (("/usr/bin/nohup") (which "nohup")))
1340 (substitute* "javax/security/auth/Subject/doAs/Test.sh"
1341 (("/bin/rm") (which "rm")))
1342 (substitute* "tools/launcher/MultipleJRE.sh"
1343 (("echo \"#!/bin/sh\"")
1344 (string-append "echo \"#!" (which "rm") "\""))
1345 (("/usr/bin/zip") (which "zip")))
1346 (substitute* "com/sun/jdi/OnThrowTest.java"
1347 (("#!/bin/sh") (string-append "#!" (which "sh"))))
1348 (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
1349 (("/usr/bin/uptime") (which "uptime")))
1350 (substitute* "java/lang/ProcessBuilder/Basic.java"
1351 (("/usr/bin/env") (which "env"))
1352 (("/bin/false") (which "false"))
1353 (("/bin/true") (which "true"))
1354 (("/bin/cp") (which "cp"))
1355 (("/bin/sh") (which "sh")))
1356 (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
1357 (("/bin/sh") (which "sh")))
1358 (substitute* "java/lang/ProcessBuilder/Zombies.java"
1359 (("/usr/bin/perl") (which "perl"))
1360 (("/bin/ps") (which "ps"))
1361 (("/bin/true") (which "true")))
1362 (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
1363 (("/usr/bin/tee") (which "tee")))
1364 (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
1365 (("/bin/true") (which "true")))
1366 (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
1367 (("/bin/cat") (which "cat")))
1368 (substitute* "java/lang/Runtime/exec/ExitValue.java"
1369 (("/bin/sh") (which "sh"))
1370 (("/bin/true") (which "true"))
1371 (("/bin/kill") (which "kill")))
1372 (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
1373 (("/usr/bin/echo") (which "echo")))
1374 (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
1375 (("/usr/bin/cat") (which "cat")))
1376 (substitute* "java/lang/Runtime/exec/SleepyCat.java"
1377 (("/bin/cat") (which "cat"))
1378 (("/bin/sleep") (which "sleep"))
1379 (("/bin/sh") (which "sh")))
1380 (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
1381 (("/bin/cat") (which "cat")))
1382 (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
1383 (("/bin/chmod") (which "chmod")))
1384 (substitute* "java/util/zip/ZipFile/Assortment.java"
1385 (("/bin/sh") (which "sh"))))
1386 #t))
1387 (replace 'check
1388 (lambda _
1389 ;; The "make check-*" targets always return zero, so we need to
1390 ;; check for errors in the associated log files to determine
1391 ;; whether any tests have failed.
1392 (use-modules (ice-9 rdelim))
1393 (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
1394 (checker (lambda (port)
1395 (let loop ()
1396 (let ((line (read-line port)))
1397 (cond
1398 ((eof-object? line) #t)
1399 ((regexp-exec error-pattern line) #f)
1400 (else (loop)))))))
1401 (run-test (lambda (test)
1402 (system* "make" test)
1403 (call-with-input-file
1404 (string-append "test/" test ".log")
1405 checker))))
1406 (or #t ; skip tests
1407 (and (run-test "check-hotspot")
1408 (run-test "check-langtools")
1409 (run-test "check-jdk"))))))
1410 (replace 'install
1411 (lambda* (#:key outputs #:allow-other-keys)
1412 (let ((doc (string-append (assoc-ref outputs "doc")
1413 "/share/doc/icedtea"))
1414 (jre (assoc-ref outputs "out"))
1415 (jdk (assoc-ref outputs "jdk")))
1416 (copy-recursively "openjdk.build/docs" doc)
1417 (copy-recursively "openjdk.build/j2re-image" jre)
1418 (copy-recursively "openjdk.build/j2sdk-image" jdk))
1419 #t))
491dc2fb
RJ
1420 ;; Some of the libraries in the lib/amd64 folder link to libjvm.so.
1421 ;; But that shared object is located in the server/ folder, so it
1422 ;; cannot be found. This phase creates a symbolic link in the
1423 ;; lib/amd64 folder so that the other libraries can find it.
1424 ;;
1425 ;; See:
1426 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1427 ;;
1428 ;; FIXME: Find the bug in the build system, so that this symlink is
1429 ;; not needed.
1430 (add-after 'install 'install-libjvm
1431 (lambda* (#:key inputs outputs #:allow-other-keys)
1432 (let* ((lib-path (string-append (assoc-ref outputs "out")
1433 "/lib/amd64")))
1434 (symlink (string-append lib-path "/server/libjvm.so")
1435 (string-append lib-path "/libjvm.so")))
1436 #t))
71053e14
RW
1437 ;; By default IcedTea only generates an empty keystore. In order to
1438 ;; be able to use certificates in Java programs we need to generate a
1439 ;; keystore from a set of certificates. For convenience we use the
1440 ;; certificates from the nss-certs package.
1441 (add-after 'install 'install-keystore
1442 (lambda* (#:key inputs outputs #:allow-other-keys)
1443 (let* ((keystore "cacerts")
1444 (certs-dir (string-append (assoc-ref inputs "nss-certs")
1445 "/etc/ssl/certs"))
1446 (keytool (string-append (assoc-ref outputs "jdk")
1447 "/bin/keytool")))
1448 (define (extract-cert file target)
1449 (call-with-input-file file
1450 (lambda (in)
1451 (call-with-output-file target
1452 (lambda (out)
1453 (let loop ((line (read-line in 'concat))
1454 (copying? #f))
1455 (cond
1456 ((eof-object? line) #t)
1457 ((string-prefix? "-----BEGIN" line)
1458 (display line out)
1459 (loop (read-line in 'concat) #t))
1460 ((string-prefix? "-----END" line)
1461 (display line out)
1462 #t)
1463 (else
1464 (when copying? (display line out))
1465 (loop (read-line in 'concat) copying?)))))))))
1466 (define (import-cert cert)
1467 (format #t "Importing certificate ~a\n" (basename cert))
1468 (let ((temp "tmpcert"))
1469 (extract-cert cert temp)
1470 (let ((port (open-pipe* OPEN_WRITE keytool
1471 "-import"
1472 "-alias" (basename cert)
1473 "-keystore" keystore
1474 "-storepass" "changeit"
1475 "-file" temp)))
1476 (display "yes\n" port)
1477 (when (not (zero? (status:exit-val (close-pipe port))))
1478 (format #t "failed to import ~a\n" cert)))
1479 (delete-file temp)))
1480
1481 ;; This is necessary because the certificate directory contains
1482 ;; files with non-ASCII characters in their names.
1483 (setlocale LC_ALL "en_US.utf8")
1484 (setenv "LC_ALL" "en_US.utf8")
1485
1486 (for-each import-cert (find-files certs-dir "\\.pem$"))
1487 (mkdir-p (string-append (assoc-ref outputs "out")
1488 "/lib/security"))
1489 (mkdir-p (string-append (assoc-ref outputs "jdk")
1490 "/jre/lib/security"))
1491
1492 ;; The cacerts files we are going to overwrite are chmod'ed as
1493 ;; read-only (444) in icedtea-8 (which derives from this
1494 ;; package). We have to change this so we can overwrite them.
1495 (chmod (string-append (assoc-ref outputs "out")
1496 "/lib/security/" keystore) #o644)
1497 (chmod (string-append (assoc-ref outputs "jdk")
1498 "/jre/lib/security/" keystore) #o644)
1499
1500 (install-file keystore
1501 (string-append (assoc-ref outputs "out")
1502 "/lib/security"))
1503 (install-file keystore
1504 (string-append (assoc-ref outputs "jdk")
1505 "/jre/lib/security"))
1506 #t))))))
f6789047 1507 (native-inputs
d9148890 1508 `(("openjdk-src"
f6789047 1509 ,(drop "openjdk"
6e7d8419 1510 "15qf3nfidgnigh2zny6djfp8bhfwjnwk9i06mxs2jbq6na953ql2"))
f6789047
RW
1511 ("corba-drop"
1512 ,(drop "corba"
6e7d8419 1513 "1phvn8fyl5mw2n2sn97f17nm442k75xsz2023bfw4h66ywzkqhqy"))
f6789047
RW
1514 ("jaxp-drop"
1515 ,(drop "jaxp"
6e7d8419 1516 "0j4ms6lmnfa2cwfh9yfqdfg1bnn3fc40ay4x6k8zqa8yvspik5w5"))
f6789047
RW
1517 ("jaxws-drop"
1518 ,(drop "jaxws"
6e7d8419 1519 "09sddj73k7n29s39hvdk14r130mvlknbxkpd2w58f34sq5sgpdrg"))
f6789047
RW
1520 ("jdk-drop"
1521 ,(drop "jdk"
6e7d8419 1522 "0q896zz8wyswmksy225q1k27nz3v3l27052dcvvpv20ryykz8yp7"))
f6789047
RW
1523 ("langtools-drop"
1524 ,(drop "langtools"
6e7d8419 1525 "0niicyfccim4a9is4akh87jd7wbl8jrazdaab957mcv9l1x3bnqc"))
f6789047
RW
1526 ("hotspot-drop"
1527 ,(drop "hotspot"
6e7d8419 1528 "1jw42qhbm3wfavk39304m53lmqipcllrvjqiab2f42mjs10i8gfx"))
e2098e2d 1529 ("ant" ,ant-bootstrap)
71053e14 1530 ("attr" ,attr)
71053e14
RW
1531 ("coreutils" ,coreutils)
1532 ("diffutils" ,diffutils) ;for tests
1533 ("gawk" ,gawk)
1534 ("grep" ,grep)
1535 ("libtool" ,libtool)
1536 ("pkg-config" ,pkg-config)
1537 ("wget" ,wget)
1538 ("which" ,which)
1539 ("cpio" ,cpio)
1540 ("zip" ,zip)
1541 ("unzip" ,unzip)
1542 ("fastjar" ,fastjar)
1543 ("libxslt" ,libxslt) ;for xsltproc
1544 ("nss-certs" ,nss-certs)
1545 ("perl" ,perl)
1546 ("procps" ,procps) ;for "free", even though I'm not sure we should use it
e2098e2d 1547 ("jdk" ,icedtea-6 "jdk")))
b711df02 1548 (inputs
71053e14
RW
1549 `(("alsa-lib" ,alsa-lib)
1550 ("cups" ,cups)
1551 ("libx11" ,libx11)
1552 ("libxcomposite" ,libxcomposite)
1553 ("libxt" ,libxt)
1554 ("libxtst" ,libxtst)
1555 ("libxi" ,libxi)
1556 ("libxinerama" ,libxinerama)
1557 ("libxrender" ,libxrender)
1558 ("libjpeg" ,libjpeg)
1559 ("libpng" ,libpng)
1560 ("mit-krb5" ,mit-krb5)
1561 ("nss" ,nss)
1562 ("giflib" ,giflib)
1563 ("fontconfig" ,fontconfig)
1564 ("freetype" ,freetype)
1565 ("lcms" ,lcms)
1566 ("zlib" ,zlib)
1567 ("gtk" ,gtk+-2)))
1568 (home-page "http://icedtea.classpath.org")
1569 (synopsis "Java development kit")
1570 (description
1571 "This package provides the Java development kit OpenJDK built with the
1572IcedTea build harness.")
1573 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
1574 ;; same license as both GNU Classpath and OpenJDK.
1575 (license license:gpl2+))))
d2540f80 1576
349a3147 1577(define-public icedtea-8
46dea124 1578 (let* ((version "3.6.0")
349a3147
RW
1579 (drop (lambda (name hash)
1580 (origin
1581 (method url-fetch)
1582 (uri (string-append
db531f73 1583 "http://icedtea.classpath.org/download/drops"
349a3147
RW
1584 "/icedtea8/" version "/" name ".tar.xz"))
1585 (sha256 (base32 hash))))))
1586 (package (inherit icedtea-7)
46dea124 1587 (version "3.6.0")
349a3147
RW
1588 (source (origin
1589 (method url-fetch)
1590 (uri (string-append
1591 "http://icedtea.wildebeest.org/download/source/icedtea-"
1592 version ".tar.xz"))
1593 (sha256
1594 (base32
46dea124 1595 "0zj192zrrxqh6j1ywc3399gk2ycay9w8pvzcvvr2kvdkb37ak86h"))
349a3147
RW
1596 (modules '((guix build utils)))
1597 (snippet
0c729ef4 1598 '(begin
f2785bd6
RW
1599 (substitute* '("configure"
1600 "acinclude.m4")
0c729ef4
RW
1601 ;; Do not embed build time
1602 (("(DIST_ID=\"Custom build).*$" _ prefix)
1603 (string-append prefix "\"\n"))
1604 ;; Do not leak information about the build host
1605 (("DIST_NAME=\"\\$build_os\"")
1606 "DIST_NAME=\"guix\""))
1607 #t))))
349a3147 1608 (arguments
f2785bd6
RW
1609 `(#:imported-modules
1610 ((guix build ant-build-system)
1611 (guix build syscalls)
1612 ,@%gnu-build-system-modules)
1613 ,@(substitute-keyword-arguments (package-arguments icedtea-7)
1614 ((#:modules modules)
1615 `((guix build utils)
1616 (guix build gnu-build-system)
1617 ((guix build ant-build-system) #:prefix ant:)
1618 (ice-9 match)
1619 (ice-9 popen)
1620 (srfi srfi-19)
1621 (srfi srfi-26)))
1622 ((#:configure-flags flags)
1623 `(let ((jdk (assoc-ref %build-inputs "jdk")))
1624 `( ;;"--disable-bootstrap"
1625 "--enable-bootstrap"
1626 "--enable-nss"
1627 "--disable-downloading"
1628 "--disable-system-pcsc"
1629 "--disable-system-sctp"
1630 "--disable-tests" ;they are run in the check phase instead
1631 "--with-openjdk-src-dir=./openjdk.src"
1632 ,(string-append "--with-jdk-home=" jdk))))
1633 ((#:phases phases)
1634 `(modify-phases ,phases
1635 (delete 'fix-x11-extension-include-path)
1636 (delete 'patch-paths)
1637 (delete 'set-additional-paths)
1638 (delete 'patch-patches)
1639 ;; Prevent the keytool from recording the current time when
1640 ;; adding certificates at build time.
1641 (add-after 'unpack 'patch-keystore
1642 (lambda _
1643 (substitute* "openjdk.src/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java"
1644 (("date = new Date\\(\\);")
1645 "\
1646date = (System.getenv(\"SOURCE_DATE_EPOCH\") != null) ?\
1647new Date(Long.parseLong(System.getenv(\"SOURCE_DATE_EPOCH\"))) :\
1648new Date();"))
1649 #t))
1650 (add-after 'unpack 'patch-jni-libs
1651 ;; Hardcode dynamically loaded libraries.
1652 (lambda _
1653 (let* ((library-path (search-path-as-string->list
1654 (getenv "LIBRARY_PATH")))
1655 (find-library (lambda (name)
1656 (search-path
1657 library-path
1658 (string-append "lib" name ".so")))))
1659 (for-each
1660 (lambda (file)
1661 (catch 'decoding-error
1662 (lambda ()
1663 (substitute* file
1664 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
1665 _ name version)
1666 (format #f "\"~a\"" (find-library name)))
1667 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
1668 (format #f "\"~a\"" (find-library name)))))
1669 (lambda _
1670 ;; Those are safe to skip.
1671 (format (current-error-port)
1672 "warning: failed to substitute: ~a~%"
1673 file))))
1674 (find-files "openjdk.src/jdk/src/solaris/native"
1675 "\\.c|\\.h"))
1676 #t)))
1677 (replace 'install
1678 (lambda* (#:key outputs #:allow-other-keys)
1679 (let ((doc (string-append (assoc-ref outputs "doc")
1680 "/share/doc/icedtea"))
1681 (jre (assoc-ref outputs "out"))
1682 (jdk (assoc-ref outputs "jdk")))
1683 (copy-recursively "openjdk.build/docs" doc)
1684 (copy-recursively "openjdk.build/images/j2re-image" jre)
1685 (copy-recursively "openjdk.build/images/j2sdk-image" jdk)
1686 ;; Install the nss.cfg file to JRE to enable SSL/TLS
1687 ;; support via NSS.
1688 (copy-file (string-append jdk "/jre/lib/security/nss.cfg")
1689 (string-append jre "/lib/security/nss.cfg"))
1690 #t)))
1691 (add-after 'install 'strip-jar-timestamps
1692 (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))))
349a3147
RW
1693 (native-inputs
1694 `(("jdk" ,icedtea-7 "jdk")
1695 ("openjdk-src"
1696 ,(drop "openjdk"
46dea124 1697 "0mqxh81kq05z4wydkik0yrr81ibf84xmwsdcw9n2gfrzs4f5jxnb"))
12eecbf0
LF
1698 ("aarch32-drop"
1699 ,(drop "aarch32"
46dea124 1700 "0b207g2n6kn510zf5vwh58bsxgqrmkvrna4p20r74v9cwcwx83n2"))
349a3147
RW
1701 ("corba-drop"
1702 ,(drop "corba"
46dea124 1703 "0qinc1q4w01nkr9klhfyd8caxvyrrfxjrz32nd7kgyja2bj8x7dd"))
349a3147
RW
1704 ("jaxp-drop"
1705 ,(drop "jaxp"
46dea124 1706 "07azrp3g86vk2laybmr5xfn0yrljkxs0rlm1q48385br225bgdxi"))
349a3147
RW
1707 ("jaxws-drop"
1708 ,(drop "jaxws"
46dea124 1709 "018fd2hq57zp3pq06wlxy5pabqcyk36xi8hk0d6xk3a90wsjvyik"))
349a3147
RW
1710 ("jdk-drop"
1711 ,(drop "jdk"
46dea124 1712 "0vs488kq5j2cc6kplc78jbhfxwq4fn06l34xrbq4d6y17777arg8"))
349a3147
RW
1713 ("langtools-drop"
1714 ,(drop "langtools"
46dea124 1715 "04f6d1wvck5jrpvrcw5gsbzxnihcry9zrf1v85czdm959q21zv9c"))
349a3147
RW
1716 ("hotspot-drop"
1717 ,(drop "hotspot"
46dea124 1718 "1mfgpzyr6zzy9klf8nn3z6d41fydb9ghpfpqzjq3cl95axfbdl1g"))
349a3147
RW
1719 ("nashorn-drop"
1720 ,(drop "nashorn"
46dea124 1721 "1a26cmzbs50gkh4rmmmxls7zljx62vfp1wq02gsfd5jqs4xvlibj"))
fd34d4f4
LF
1722 ("shenandoah-drop"
1723 ,(drop "shenandoah"
46dea124 1724 "11hmn9mwmvryfddcanzx3qffjm8bbiv18nwv3iy9cswrvxjy010f"))
349a3147 1725 ,@(fold alist-delete (package-native-inputs icedtea-7)
e2098e2d 1726 '("jdk" "openjdk-src" "corba-drop" "jaxp-drop" "jaxws-drop"
349a3147
RW
1727 "jdk-drop" "langtools-drop" "hotspot-drop")))))))
1728
a243e12a 1729(define-public icedtea icedtea-7)
068e476f 1730
5490480c 1731\f
8bbd0408
RW
1732(define-public ant/java8
1733 (package (inherit ant-bootstrap)
1734 (name "ant")
1735 (version "1.10.1")
1736 (source (origin
1737 (method url-fetch)
1738 (uri (string-append "mirror://apache/ant/source/apache-ant-"
1739 version "-src.tar.gz"))
1740 (sha256
1741 (base32
1742 "10p3dh77lkzzzcy32dk9azljixzadp46fggjfbvgkl8mmb8cxxv8"))
1743 (modules '((guix build utils)))
1744 (snippet
1745 '(begin
1746 (for-each delete-file
1747 (find-files "lib/optional" "\\.jar$"))
1748 #t))))
1749 (arguments
1750 (substitute-keyword-arguments (package-arguments ant-bootstrap)
1751 ((#:phases phases)
1752 `(modify-phases ,phases
1753 (add-after 'unpack 'remove-scripts
1754 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
1755 ;; wrappers.
1756 (lambda _
1757 (for-each delete-file
1758 (find-files "src/script"
1759 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))
1760 #t))
1761 (replace 'build
1762 (lambda* (#:key inputs outputs #:allow-other-keys)
1763 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
1764
1765 ;; Disable tests to avoid dependency on hamcrest-core, which needs
1766 ;; Ant to build. This is necessary in addition to disabling the
1767 ;; "check" phase, because the dependency on "test-jar" would always
1768 ;; result in the tests to be run.
1769 (substitute* "build.xml"
1770 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
1771 (zero? (system* "bash" "bootstrap.sh"
1772 (string-append "-Ddist.dir="
1773 (assoc-ref outputs "out"))))))))))
1774 (native-inputs
1775 `(("jdk" ,icedtea-8 "jdk")))))
1776
e441fc56
RW
1777;; The 1.9.x series is the last that can be built with GCJ. The 1.10.x series
1778;; requires Java 8.
1779(define-public ant
1780 (package (inherit ant/java8)
1781 (version "1.9.9")
1782 (source (origin
1783 (method url-fetch)
1784 (uri (string-append "mirror://apache/ant/source/apache-ant-"
1785 version "-src.tar.gz"))
1786 (sha256
1787 (base32
1788 "1k28mka0m3isy9yr8gz84kz1f3f879rwaxrd44vdn9xbfwvwk86n"))))
1789 (native-inputs
1790 `(("jdk" ,icedtea-7 "jdk")))))
1791
9ce7ac99
RW
1792(define-public ant-apache-bcel
1793 (package
1794 (inherit ant/java8)
1795 (name "ant-apache-bcel")
1796 (arguments
1797 (substitute-keyword-arguments (package-arguments ant/java8)
1798 ((#:phases phases)
1799 `(modify-phases ,phases
1800 (add-after 'unpack 'link-bcel
1801 (lambda* (#:key inputs #:allow-other-keys)
1802 (for-each (lambda (file)
1803 (symlink file
1804 (string-append "lib/optional/"
1805 (basename file))))
1806 (find-files (assoc-ref inputs "java-commons-bcel")
1807 "\\.jar$"))
1808 #t))
1809 (add-after 'build 'install
1810 (lambda* (#:key outputs #:allow-other-keys)
1811 (let* ((out (assoc-ref outputs "out"))
1812 (share (string-append out "/share/java"))
1813 (bin (string-append out "/bin"))
1814 (lib (string-append out "/lib")))
1815 (mkdir-p share)
1816 (install-file (string-append lib "/ant-apache-bcel.jar") share)
1817 (delete-file-recursively bin)
1818 (delete-file-recursively lib)
1819 #t)))))))
1820 (inputs
1821 `(("java-commons-bcel" ,java-commons-bcel)
1822 ,@(package-inputs ant/java8)))))
1823
fa6c4213
RW
1824(define-public ant-junit
1825 (package
1826 (inherit ant/java8)
1827 (name "ant-junit")
1828 (arguments
1829 (substitute-keyword-arguments (package-arguments ant/java8)
1830 ((#:phases phases)
1831 `(modify-phases ,phases
1832 (add-after 'unpack 'link-junit
1833 (lambda* (#:key inputs #:allow-other-keys)
1834 (for-each (lambda (file)
1835 (symlink file
1836 (string-append "lib/optional/"
1837 (basename file))))
1838 (find-files (assoc-ref inputs "java-junit")
1839 "\\.jar$"))
1840 #t))
1841 (add-after 'build 'install
1842 (lambda* (#:key outputs #:allow-other-keys)
1843 (let* ((out (assoc-ref outputs "out"))
1844 (share (string-append out "/share/java"))
1845 (bin (string-append out "/bin"))
1846 (lib (string-append out "/lib")))
1847 (mkdir-p share)
1848 (install-file (string-append lib "/ant-junit.jar") share)
1849 (delete-file-recursively bin)
1850 (delete-file-recursively lib)
1851 #t)))))))
1852 (inputs
1853 `(("java-junit" ,java-junit)
1854 ,@(package-inputs ant/java8)))))
1855
fc6e2727
RW
1856(define-public clojure
1857 (let* ((remove-archives '(begin
1858 (for-each delete-file
1859 (find-files "." ".*\\.(jar|zip)"))
1860 #t))
1861 (submodule (lambda (prefix version hash)
1862 (origin
1863 (method url-fetch)
1864 (uri (string-append "https://github.com/clojure/"
1865 prefix version ".tar.gz"))
1866 (sha256 (base32 hash))
1867 (modules '((guix build utils)))
1868 (snippet remove-archives)))))
1869 (package
1870 (name "clojure")
1d47ea86 1871 (version "1.9.0")
fc6e2727
RW
1872 (source
1873 (origin
1874 (method url-fetch)
1875 (uri
1d47ea86
AV
1876 (string-append "https://github.com/clojure/clojure/archive/clojure-"
1877 version ".tar.gz"))
fc6e2727 1878 (sha256
1d47ea86 1879 (base32 "0xjbzcw45z32vsn9pifp7ndysjzqswp5ig0jkjpivigh2ckkdzha"))
fc6e2727
RW
1880 (modules '((guix build utils)))
1881 (snippet remove-archives)))
1882 (build-system ant-build-system)
1883 (arguments
1884 `(#:modules ((guix build ant-build-system)
1885 (guix build utils)
1886 (ice-9 ftw)
1887 (ice-9 regex)
1888 (srfi srfi-1)
1889 (srfi srfi-26))
1890 #:test-target "test"
1891 #:phases
1892 (modify-phases %standard-phases
1893 (add-after 'unpack 'unpack-submodule-sources
1894 (lambda* (#:key inputs #:allow-other-keys)
1895 (for-each
1896 (lambda (name)
1897 (mkdir-p name)
1898 (with-directory-excursion name
1899 (or (zero? (system* "tar"
1900 ;; Use xz for repacked tarball.
1901 "--xz"
1902 "--extract"
1903 "--verbose"
1904 "--file" (assoc-ref inputs name)
1905 "--strip-components=1"))
1906 (error "failed to unpack tarball" name)))
1907 (copy-recursively (string-append name "/src/main/clojure/")
1908 "src/clj/"))
1d47ea86
AV
1909 '("core-specs-alpha-src"
1910 "data-generators-src"
1911 "spec-alpha-src"
fc6e2727
RW
1912 "test-check-src"
1913 "test-generative-src"
1d47ea86 1914 "tools-namespace-src"))
fc6e2727
RW
1915 #t))
1916 ;; The javadoc target is not built by default.
1917 (add-after 'build 'build-doc
1918 (lambda _
1919 (zero? (system* "ant" "javadoc"))))
1920 ;; Needed since no install target is provided.
1921 (replace 'install
1922 (lambda* (#:key outputs #:allow-other-keys)
1923 (let ((java-dir (string-append (assoc-ref outputs "out")
1924 "/share/java/")))
1925 ;; Install versioned to avoid collisions.
1926 (install-file (string-append "clojure-" ,version ".jar")
1927 java-dir)
1928 #t)))
1929 ;; Needed since no install-doc target is provided.
1930 (add-after 'install 'install-doc
1931 (lambda* (#:key outputs #:allow-other-keys)
1932 (let ((doc-dir (string-append (assoc-ref outputs "out")
1933 "/share/doc/clojure-"
1934 ,version "/")))
1935 (copy-recursively "doc/clojure" doc-dir)
1936 (copy-recursively "target/javadoc/"
1937 (string-append doc-dir "javadoc/"))
1938 (for-each (cut install-file <> doc-dir)
1939 (filter (cut string-match
1940 ".*\\.(html|markdown|md|txt)"
1941 <>)
1942 (scandir "./")))
1943 #t))))))
1944 ;; The native-inputs below are needed to run the tests.
1945 (native-inputs
1d47ea86
AV
1946 `(("core-specs-alpha-src"
1947 ,(submodule "core.specs.alpha/archive/core.specs.alpha-"
1948 "0.1.24"
1949 "0v2a0svf1ar2y42ajxwsjr7zmm5j7pp2zwrd2jh3k7xzd1p9x1fv"))
1950 ("data-generators-src"
fc6e2727
RW
1951 ,(submodule "data.generators/archive/data.generators-"
1952 "0.1.2"
1953 "0kki093jp4ckwxzfnw8ylflrfqs8b1i1wi9iapmwcsy328dmgzp1"))
1d47ea86
AV
1954 ("spec-alpha-src"
1955 ,(submodule "spec.alpha/archive/spec.alpha-"
1956 "0.1.143"
1957 "00alf0347licdn773w2jarpllyrbl52qz4d8mw61anjksacxylzz"))
fc6e2727
RW
1958 ("test-check-src"
1959 ,(submodule "test.check/archive/test.check-"
1960 "0.9.0"
1961 "0p0mnyhr442bzkz0s4k5ra3i6l5lc7kp6ajaqkkyh4c2k5yck1md"))
1962 ("test-generative-src"
1963 ,(submodule "test.generative/archive/test.generative-"
1964 "0.5.2"
1965 "1pjafy1i7yblc7ixmcpfq1lfbyf3jaljvkgrajn70sws9xs7a9f8"))
1966 ("tools-namespace-src"
1967 ,(submodule "tools.namespace/archive/tools.namespace-"
1968 "0.2.11"
1d47ea86 1969 "10baak8v0hnwz2hr33bavshm7y49mmn9zsyyms1dwjz45p5ymhy0"))))
fc6e2727
RW
1970 (home-page "https://clojure.org/")
1971 (synopsis "Lisp dialect running on the JVM")
1972 (description "Clojure is a dynamic, general-purpose programming language,
1973combining the approachability and interactive development of a scripting
1974language with an efficient and robust infrastructure for multithreaded
1975programming. Clojure is a compiled language, yet remains completely dynamic
1976– every feature supported by Clojure is supported at runtime. Clojure
1977provides easy access to the Java frameworks, with optional type hints and type
1978inference, to ensure that calls to Java can avoid reflection.
1979
1980Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy
1981and a powerful macro system. Clojure is predominantly a functional programming
1982language, and features a rich set of immutable, persistent data structures.
1983When mutable state is needed, Clojure offers a software transactional memory
1984system and reactive Agent system that ensure clean, correct, multithreaded
1985designs.")
1986 ;; Clojure is licensed under EPL1.0
1987 ;; ASM bytecode manipulation library is licensed under BSD-3
1988 ;; Guava Murmur3 hash implementation is licensed under APL2.0
1989 ;; src/clj/repl.clj is licensed under CPL1.0
1990 ;;
1991 ;; See readme.html or readme.txt for details.
1992 (license (list license:epl1.0
1993 license:bsd-3
1994 license:asl2.0
1995 license:cpl1.0)))))
1996
fc8d100b
RW
1997(define-public javacc
1998 (package
1999 (name "javacc")
2000 (version "7.0.3")
2001 (source (origin
2002 (method url-fetch)
2003 (uri (string-append "https://github.com/javacc/javacc/"
2004 "archive/" version ".tar.gz"))
2005 (file-name (string-append "javacc-" version ".tar.gz"))
2006 (sha256
2007 (base32
2008 "111xc9mnmc5a6qz6x3xbhqc07y1lg2b996ggzw0hrblg42zya9xf"))))
2009 (build-system ant-build-system)
2010 (arguments
2011 `(#:test-target "test"
2012 #:phases
2013 (modify-phases %standard-phases
2014 (add-after 'unpack 'delete-bundled-libs
2015 (lambda _
2016 (delete-file-recursively "lib") #t))
2017 (replace 'install (install-jars "target")))))
2018 (home-page "https://javacc.org/")
2019 (synopsis "Java parser generator")
2020 (description "Java Compiler Compiler (JavaCC) is the most popular parser
2021generator for use with Java applications. A parser generator is a tool that
2022reads a grammar specification and converts it to a Java program that can
2023recognize matches to the grammar. In addition to the parser generator itself,
2024JavaCC provides other standard capabilities related to parser generation such
2025as tree building (via a tool called JJTree included with JavaCC), actions,
2026debugging, etc.")
2027 (license license:bsd-3)))
2028
6688c41e
RW
2029(define-public javacc-4
2030 (package (inherit javacc)
2031 (version "4.1")
2032 (source (origin
2033 (method git-fetch)
2034 (uri (git-reference
2035 (url "https://github.com/javacc/javacc.git")
2036 (commit "release_41")))
2037 (file-name (string-append "javacc-" version "-checkout"))
2038 (sha256
2039 (base32
2040 "07ysav7j8r1c6h8qxrgqk6lwdp74ly0ad1935lragxml0qqc3ka0"))))
2041 ;; Tests fail with
2042 ;; /tmp/guix-build-javacc-4.1.drv-0/source/test/javacodeLA/build.xml:60:
2043 ;; JAVACODE failed
2044 (arguments
2045 `(#:tests? #f
2046 #:phases
2047 (modify-phases %standard-phases
2048 (add-after 'unpack 'delete-bundled-libs
2049 (lambda _
2050 (delete-file-recursively "lib") #t))
2051 (replace 'install (install-jars "bin/lib")))))))
2052
c1cb8576
RW
2053;; This is the last 3.x release of ECJ
2054(define-public java-ecj-3
2055 (package
2056 (name "java-ecj")
2057 (version "3.8.2")
2058 (source (origin
2059 (method url-fetch)
2060 (uri (string-append "http://archive.eclipse.org/eclipse/"
2061 "downloads/drops/R-" version
2062 "-201301310800/ecjsrc-" version ".jar"))
2063 (sha256
2064 (base32
2065 "01mdj14jw11g1jfnki4fi8229p0c6zzckd38zqy2w4m3cjcvsx04"))))
2066 (build-system ant-build-system)
2067 (arguments
2068 `(#:tests? #f ; none included
2069 #:jdk ,icedtea-7 ; doesn't build with JDK8+
2070 #:make-flags (list "-f" "src/build.xml")
2071 #:build-target "build"
2072 #:phases
2073 (modify-phases %standard-phases
2074 (add-after 'unpack 'fix-manifest
2075 (lambda _
2076 ;; Record the main class to make ecj executable.
2077 (with-atomic-file-replacement "src/META-INF/MANIFEST.MF"
2078 (lambda (in out)
2079 (display "Manifest-Version: 1.0
2080Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n"
2081 out)))))
2082 (replace 'install (install-jars ".")))))
2083 (home-page "https://eclipse.org")
2084 (synopsis "Eclipse Java development tools core batch compiler")
2085 (description "This package provides the Eclipse Java core batch compiler.")
2086 (license license:epl1.0)))
2087
f201b18e
RW
2088;; This is needed for java-cisd-args4j
2089(define-public java-ecj-3.5
2090 (package (inherit java-ecj-3)
2091 (version "3.5.1")
2092 (source (origin
2093 (method url-fetch/zipbomb)
2094 (uri (string-append "http://archive.eclipse.org/eclipse/"
2095 "downloads/drops/R-" version
2096 "-200909170800/ecjsrc-" version ".zip"))
2097 (sha256
2098 (base32
2099 "1vnl2mavisc567bip736xzsvvbjif5279wc4a7pbdik5wlir8qr7"))))
2100 (build-system ant-build-system)
2101 (arguments
2102 `(#:tests? #f ; none included
2103 #:jdk ,icedtea-7 ; doesn't build with JDK8+
2104 #:build-target "build"
2105 #:phases
2106 (modify-phases %standard-phases
2107 (add-after 'unpack 'fix-manifest
2108 (lambda _
2109 ;; Record the main class to make ecj executable.
2110 (with-atomic-file-replacement "META-INF/MANIFEST.MF"
2111 (lambda (in out)
2112 (dump-port in out)
2113 (display "Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n"
2114 out)))))
2115 (replace 'install (install-jars ".")))))
2116 (native-inputs
2117 `(("unzip" ,unzip)))))
2118
30d55473
RW
2119(define-public java-cisd-base
2120 (let ((revision 38938)
2121 (base-version "14.12.0"))
2122 (package
2123 (name "java-cisd-base")
2124 (version (string-append base-version "-" (number->string revision)))
2125 (source (origin
2126 (method svn-fetch)
2127 (uri (svn-reference
2128 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2129 "base/tags/release/"
2130 (version-major+minor base-version)
2131 ".x/" base-version "/base/"))
2132 (revision revision)))
2133 (file-name (string-append "java-cisd-base-" version "-checkout"))
2134 (sha256
2135 (base32
2136 "1i5adyf7nzclb0wydgwa1az04qliid8035vpahaandmkmigbnxiy"))
2137 (modules '((guix build utils)))
2138 (snippet
2139 '(begin
2140 ;; Delete included gradle jar
2141 (delete-file-recursively "gradle/wrapper")
2142 ;; Delete pre-built native libraries
2143 (delete-file-recursively "libs")
2144 #t))))
2145 (build-system ant-build-system)
2146 (arguments
2147 `(#:make-flags '("-file" "build/build.xml")
2148 #:test-target "jar-test"
2149 #:jdk ,icedtea-8
2150 #:phases
2151 (modify-phases %standard-phases
2152 (add-after 'unpack 'unpack-build-resources
2153 (lambda* (#:key inputs #:allow-other-keys)
2154 (copy-recursively (assoc-ref inputs "build-resources")
2155 "../build_resources")
2156 #t))
2157 (add-after 'unpack-build-resources 'fix-dependencies
2158 (lambda* (#:key inputs #:allow-other-keys)
2159 (substitute* "build/build.xml"
2160 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
2161 (string-append (assoc-ref inputs "java-testng")
2162 "/share/java/java-testng.jar"))
2163 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
2164 (string-append (assoc-ref inputs "java-commons-lang")
2165 "/share/java/commons-lang-"
2166 ,(package-version java-commons-lang) ".jar"))
2167 (("\\$\\{lib\\}/commons-io/commons-io.jar")
2168 (string-append (assoc-ref inputs "java-commons-io")
2169 "/share/java/commons-io-"
2170 ,(package-version java-commons-io)
2171 "-SNAPSHOT.jar"))
2172 ;; Remove dependency on svn
2173 (("<build-info.*") "")
2174 (("\\$\\{revision.number\\}")
2175 ,(number->string revision))
2176 (("\\$\\{version.number\\}") ,base-version))
2177 ;; Remove dependency on classycle
2178 (substitute* "../build_resources/ant/build-common.xml"
2179 (("<taskdef name=\"dependency-checker.*") "")
2180 (("classname=\"classycle.*") "")
2181 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
2182 #t))
2183 ;; A few tests fail because of the lack of a proper /etc/groups and
2184 ;; /etc/passwd file in the build container.
2185 (add-after 'unpack 'disable-broken-tests
2186 (lambda _
2187 (substitute* "sourceTest/java/ch/systemsx/cisd/base/AllTests.java"
2188 (("Unix.isOperational\\(\\)") "false"))
2189 #t))
2190 ;; These decorators are almost useless and pull in an unpackaged
2191 ;; dependency.
2192 (add-after 'unpack 'remove-useless-decorators
2193 (lambda _
2194 (substitute* "source/java/ch/systemsx/cisd/base/unix/Unix.java"
2195 (("@Private") "")
2196 (("import ch.rinn.restrictions.Private;") ""))
2197 (substitute* "sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java"
2198 (("@Friend.*") "")
2199 (("import ch.rinn.restrictions.Friend;") ""))
2200 #t))
2201 (add-before 'configure 'build-native-code
2202 (lambda* (#:key inputs #:allow-other-keys)
2203 (let ((jdk (assoc-ref inputs "jdk"))
2204 (dir ,(match (%current-system)
2205 ("i686-linux"
2206 "i386-Linux")
2207 ((or "armhf-linux" "aarch64-linux")
2208 "arm-Linux")
2209 ((or "x86_64-linux")
2210 "amd64-Linux")
2211 (_ "unknown-Linux"))))
2212 (with-directory-excursion "source/c"
2213 (invoke "gcc" "-shared" "-O3" "-fPIC" "unix.c"
2214 (string-append "-I" jdk "/include")
2215 (string-append "-I" jdk "/include/linux")
2216 "-o" "libunix.so")
2217 (invoke "gcc" "-shared" "-O3" "-fPIC"
2218 "-DMACHINE_BYTE_ORDER=1"
2219 "copyCommon.c"
2220 "copyByteChar.c"
2221 "copyByteDouble.c"
2222 "copyByteFloat.c"
2223 "copyByteInt.c"
2224 "copyByteLong.c"
2225 "copyByteShort.c"
2226 (string-append "-I" jdk "/include")
2227 (string-append "-I" jdk "/include/linux")
2228 "-o" "libnativedata.so"))
2229 (install-file "source/c/libunix.so"
2230 (string-append "libs/native/unix/" dir))
2231 (install-file "source/c/libnativedata.so"
2232 (string-append "libs/native/nativedata/" dir))
2233 #t)))
2234 ;; In the "check" phase we only build the test executable.
2235 (add-after 'check 'run-tests
2236 (lambda _
2237 (invoke "java" "-jar" "targets/dist/sis-base-test.jar")
2238 (delete-file "targets/dist/sis-base-test.jar")
2239 #t))
2240 (replace 'install (install-jars "targets/dist")))))
2241 (native-inputs
2242 `(("jdk" ,icedtea-8)
2243 ("java-commons-lang" ,java-commons-lang)
2244 ("java-commons-io" ,java-commons-io)
2245 ("java-testng" ,java-testng)
2246 ("build-resources"
2247 ,(origin
2248 (method svn-fetch)
2249 (uri (svn-reference
2250 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2251 "base/tags/release/"
2252 (version-major+minor base-version)
2253 ".x/" base-version
2254 "/build_resources/"))
2255 (revision revision)))
2256 (sha256
2257 (base32
2258 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
2259 (home-page "http://svnsis.ethz.ch")
2260 (synopsis "Utility classes for libraries from ETH Zurich")
2261 (description "This library supplies some utility classes needed for
2262libraries from the SIS division at ETH Zurich like jHDF5.")
2263 ;; The C sources are under a non-copyleft license, which looks like a
2264 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
2265 (license (list license:asl2.0
2266 (license:non-copyleft "file://source/c/COPYING"))))))
2267
04ddca26
RW
2268(define-public java-cisd-args4j
2269 (let ((revision 39162)
2270 (base-version "9.11.2"))
2271 (package
2272 (name "java-cisd-args4j")
2273 (version (string-append base-version "-" (number->string revision)))
2274 (source (origin
2275 (method svn-fetch)
2276 (uri (svn-reference
2277 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2278 "args4j/tags/release/"
2279 (version-major+minor base-version)
2280 ".x/" base-version "/args4j/"))
2281 (revision revision)))
2282 (file-name (string-append "java-cisd-args4j-" version "-checkout"))
2283 (sha256
2284 (base32
2285 "0hhqznjaivq7ips7mkwas78z42s6djsm20rrs7g1zd59rcsakxn2"))))
2286 (build-system ant-build-system)
2287 (arguments
2288 `(#:make-flags '("-file" "build/build.xml")
2289 #:tests? #f ; there are no tests
2290 ;; There are weird build failures with JDK8, such as: "The type
2291 ;; java.io.ObjectInputStream cannot be resolved. It is indirectly
2292 ;; referenced from required .class files"
2293 #:jdk ,icedtea-7
2294 #:modules ((guix build ant-build-system)
2295 (guix build utils)
2296 (guix build java-utils)
2297 (sxml simple)
2298 (sxml transform)
2299 (sxml xpath))
2300 #:phases
2301 (modify-phases %standard-phases
2302 (add-after 'unpack 'unpack-build-resources
2303 (lambda* (#:key inputs #:allow-other-keys)
2304 (mkdir-p "../build_resources")
2305 (invoke "tar" "xf" (assoc-ref inputs "build-resources")
2306 "-C" "../build_resources"
2307 "--strip-components=1")
2308 (mkdir-p "../build_resources/lib")
2309 #t))
2310 (add-after 'unpack-build-resources 'fix-dependencies
2311 (lambda* (#:key inputs #:allow-other-keys)
2312 ;; FIXME: There should be a more convenient abstraction for
2313 ;; editing XML files.
2314 (with-directory-excursion "../build_resources/ant/"
2315 (chmod "build-common.xml" #o664)
2316 (call-with-output-file "build-common.xml.new"
2317 (lambda (port)
2318 (sxml->xml
2319 (pre-post-order
2320 (with-input-from-file "build-common.xml"
2321 (lambda _ (xml->sxml #:trim-whitespace? #t)))
2322 `(;; Remove dependency on classycle and custom ant tasks
2323 (taskdef . ,(lambda (tag . kids)
2324 (let ((name ((sxpath '(name *text*)) kids)))
2325 (if (or (member "build-info" name)
2326 (member "dependency-checker" name)
2327 (member "build-java-subprojects" name)
2328 (member "project-classpath" name))
2329 '() ; skip
2330 `(,tag ,@kids)))))
2331 (typedef . ,(lambda (tag . kids)
2332 (let ((name ((sxpath '(name *text*)) kids)))
2333 (if (member "recursive-jar" name)
2334 '() ; skip
2335 `(,tag ,@kids)))))
2336 (build-java-subprojects . ,(lambda _ '()))
2337 ;; Ignore everything else
2338 (*default* . ,(lambda (tag . kids) `(,tag ,@kids)))
2339 (*text* . ,(lambda (_ txt) txt))))
2340 port)))
2341 (rename-file "build-common.xml.new" "build-common.xml"))
2342 (substitute* "build/build.xml"
2343 (("\\$\\{lib\\}/cisd-base/cisd-base.jar")
2344 (string-append (assoc-ref inputs "java-cisd-base")
2345 "/share/java/sis-base.jar"))
2346 ;; Remove dependency on svn
2347 (("<build-info.*") "")
2348 (("\\$\\{revision.number\\}")
2349 ,(number->string revision))
2350 (("\\$\\{version.number\\}") ,base-version)
2351 ;; Don't use custom ant tasks.
2352 (("recursive-jar") "jar")
2353 (("<project-classpath.*") ""))
2354 #t))
2355 (replace 'install (install-jars "targets/dist")))))
2356 (inputs
2357 `(("java-cisd-base" ,java-cisd-base)))
2358 (native-inputs
2359 `(("ecj" ,java-ecj-3.5)
2360 ("build-resources"
2361 ,(origin
2362 (method svn-fetch)
2363 (uri (svn-reference
2364 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2365 "args4j/tags/release/"
2366 (version-major+minor base-version)
2367 ".x/" base-version
2368 "/build_resources/"))
2369 (revision revision)))
2370 (sha256
2371 (base32
2372 "056cam4k8pll7ass31sy6gwn8g8719njc41yf4l02b0342nilkyf"))
2373 (modules '((guix build utils)))
2374 ;; Delete bundled pre-built jars.
2375 (snippet
2376 '(begin (delete-file-recursively "lib/") #t))))))
2377 (home-page "http://svnsis.ethz.ch")
2378 (synopsis "Command line parser library")
2379 (description "This package provides a parser for command line arguments.")
2380 (license license:asl2.0))))
2381
2f0d0418
RW
2382(define-public java-cisd-jhdf5
2383 (let ((revision 39162)
2384 (base-version "14.12.6"))
2385 (package
2386 (name "java-cisd-jhdf5")
2387 (version (string-append base-version "-" (number->string revision)))
2388 (source (origin
2389 (method svn-fetch)
2390 (uri (svn-reference
2391 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2392 "jhdf5/tags/release/"
2393 (version-major+minor base-version)
2394 ".x/" base-version "/jhdf5/"))
2395 (revision revision)))
2396 (file-name (string-append "java-cisd-jhdf5-" version "-checkout"))
2397 (sha256
2398 (base32
2399 "13i17s2hn0q9drdqvp8csy7770p3hdbh9rp30ihln2ldkfawdmz0"))
2400 (modules '((guix build utils)))
2401 (snippet
2402 '(begin
2403 ;; Delete included gradle jar
2404 (delete-file-recursively "gradle/wrapper")
2405 ;; Delete pre-built native libraries
2406 (delete-file-recursively "libs")
2407 #t))))
2408 (build-system ant-build-system)
2409 (arguments
2410 `(#:make-flags '("-file" "build/build.xml")
2411 #:build-target "jar-all"
2412 #:test-target "jar-test"
2413 #:jdk ,icedtea-8
2414 #:phases
2415 (modify-phases %standard-phases
2416 ;; Don't erase results from the build phase when building tests.
2417 (add-after 'unpack 'separate-test-target-from-clean
2418 (lambda _
2419 (substitute* "build/build.xml"
2420 (("\"jar-test\" depends=\"clean, ")
2421 "\"jar-test\" depends=\""))
2422 #t))
2423 (add-after 'unpack 'unpack-build-resources
2424 (lambda* (#:key inputs #:allow-other-keys)
2425 (copy-recursively (assoc-ref inputs "build-resources")
2426 "../build_resources")
2427 (delete-file-recursively "../build_resources/lib/")
2428 (mkdir-p "../build_resources/lib")
2429 ;; Remove dependency on classycle
2430 (substitute* "../build_resources/ant/build-common.xml"
2431 (("<taskdef name=\"dependency-checker.*") "")
2432 (("classname=\"classycle.*") "")
2433 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
2434 ;; Remove dependency on svn
2435 (substitute* "build/build.xml"
2436 (("<build-info.*") "")
2437 (("\\$\\{revision.number\\}")
2438 ,(number->string revision))
2439 (("\\$\\{version.number\\}") ,base-version))
2440 #t))
2441 (add-after 'unpack-build-resources 'fix-dependencies
2442 (lambda* (#:key inputs #:allow-other-keys)
2443 (substitute* "../build_resources/ant/build-common.xml"
2444 (("../libraries/testng/testng-jdk15.jar")
2445 (string-append (assoc-ref inputs "java-testng")
2446 "/share/java/java-testng.jar")))
2447 (substitute* "build/build.xml"
2448 (("\\$\\{lib\\}/sis-base/sis-base.jar")
2449 (string-append (assoc-ref inputs "java-cisd-base")
2450 "/share/java/sis-base.jar"))
2451 (("\\$\\{lib\\}/cisd-args4j/cisd-args4j.jar")
2452 (string-append (assoc-ref inputs "java-cisd-args4j")
2453 "/share/java/cisd-args4j.jar"))
2454 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
2455 (string-append (assoc-ref inputs "java-commons-lang")
2456 "/share/java/commons-lang-"
2457 ,(package-version java-commons-lang) ".jar"))
2458 (("\\$\\{lib\\}/commons-io/commons-io.jar")
2459 (string-append (assoc-ref inputs "java-commons-io")
2460 "/share/java/commons-io-"
2461 ,(package-version java-commons-io)
2462 "-SNAPSHOT.jar"))
2463 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
2464 (string-append (assoc-ref inputs "java-testng")
2465 "/share/java/java-testng.jar"))
2466 (("\\$\\{lib\\}/junit4/junit.jar")
2467 (string-append (assoc-ref inputs "java-junit")
2468 "/share/java/junit.jar"))
2469 (("\\$\\{lib\\}/jmock/hamcrest/hamcrest-core.jar")
2470 (string-append (assoc-ref inputs "java-hamcrest-core")
2471 "/share/java/hamcrest-core.jar")))
2472 ;; Remove dependency on ch.rinn.restrictions
2473 (with-directory-excursion "source/java/ch/systemsx/cisd/hdf5/"
2474 (substitute* '("BitSetConversionUtils.java"
2475 "HDF5Utils.java")
2476 (("import ch.rinn.restrictions.Private;") "")
2477 (("@Private") "")))
2478 (with-directory-excursion "sourceTest/java/ch/systemsx/cisd/hdf5/"
2479 (substitute* '("BitSetConversionTest.java"
2480 "h5ar/HDF5ArchiverTest.java")
2481 (("import ch.rinn.restrictions.Friend;") "")
2482 (("@Friend.*") ""))
2483 ;; Remove leftovers from removing @Friend
2484 (substitute* "h5ar/HDF5ArchiverTest.java"
2485 (("\\{ HDF5Archiver.class, IdCache.class, LinkRecord.class \\}\\)")
2486 "")))
2487 #t))
2488 (add-before 'configure 'build-native-library
2489 (lambda* (#:key inputs #:allow-other-keys)
2490 (let ((jdk (assoc-ref inputs "jdk"))
2491 (hdf5 (assoc-ref inputs "hdf5"))
2492 (dir ,(match (%current-system)
2493 ("i686-linux"
2494 "i386-Linux")
2495 ((or "armhf-linux" "aarch64-linux")
2496 "arm-Linux")
2497 ((or "x86_64-linux")
2498 "amd64-Linux")
2499 (_ "unknown-Linux"))))
2500 (with-directory-excursion "source/c"
2501 (apply invoke `("gcc" "-shared" "-O3"
2502 "-fPIC"
2503 "-Wl,--exclude-libs,ALL"
2504 ,@(find-files "jhdf5" "\\.c$")
2505 ,@(find-files "hdf-java" "\\.c$")
2506 ,(string-append "-I" hdf5 "/include")
2507 ,(string-append "-I" jdk "/include")
2508 ,(string-append "-I" jdk "/include/linux")
2509 ,(string-append hdf5 "/lib/libhdf5.a")
2510 "-o" "libjhdf5.so" "-lz")))
2511 (install-file "source/c/libjhdf5.so"
2512 (string-append "libs/native/jhdf5/" dir))
2513 #t)))
2514 ;; In the "check" phase we only build the test executable.
2515 (add-after 'check 'run-tests
2516 (lambda _
2517 (invoke "java" "-jar" "targets/dist/sis-jhdf5-test.jar")
2518 (delete-file "targets/dist/sis-jhdf5-test.jar")
2519 #t))
2520 (replace 'install
2521 (install-jars "targets/dist")))))
2522 (inputs
2523 `(("java-cisd-base" ,java-cisd-base)
2524 ("java-cisd-args4j" ,java-cisd-args4j)
2525 ("java-commons-lang" ,java-commons-lang)
2526 ("java-commons-io" ,java-commons-io)
2527 ("hdf5" ,hdf5)
2528 ("zlib" ,zlib)))
2529 (native-inputs
2530 `(("jdk" ,icedtea-8)
2531 ("java-testng" ,java-testng)
2532 ("java-junit" ,java-junit)
2533 ("java-jmock" ,java-jmock)
2534 ("java-hamcrest-core" ,java-hamcrest-core)
2535 ("build-resources"
2536 ,(origin
2537 (method svn-fetch)
2538 (uri (svn-reference
2539 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2540 "jhdf5/tags/release/"
2541 (version-major+minor base-version)
2542 ".x/" base-version
2543 "/build_resources/"))
2544 (revision revision)))
2545 (sha256
2546 (base32
2547 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
2548 (home-page "https://wiki-bsse.ethz.ch/display/JHDF5/")
2549 (synopsis "Java binding for HDF5")
2550 (description "JHDF5 is a high-level API in Java for reading and writing
2551HDF5 files, building on the libraries provided by the HDF Group.")
2552 ;; The C sources are under a non-copyleft license, which looks like a
2553 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
2554 (license (list license:asl2.0
2555 (license:non-copyleft "file://source/c/COPYING"))))))
2556
218d093b
RW
2557(define-public java-classpathx-servletapi
2558 (package
2559 (name "java-classpathx-servletapi")
ae307724 2560 (version "3.0.1")
218d093b
RW
2561 (source (origin
2562 (method url-fetch)
2563 (uri (string-append "mirror://gnu/classpathx/servletapi/"
2564 "servletapi-" version ".tar.gz"))
2565 (sha256
2566 (base32
ae307724 2567 "07d8h051siga2f33fra72hk12sbq1bxa4jifjg0qj0vfazjjff0x"))))
218d093b
RW
2568 (build-system ant-build-system)
2569 (arguments
2570 `(#:tests? #f ; there is no test target
2571 #:build-target "compile"
218d093b 2572 #:make-flags
ae307724 2573 (list "-Dbuild.compiler=javac1.8"
218d093b
RW
2574 (string-append "-Ddist=" (assoc-ref %outputs "out")))
2575 #:phases
2576 (modify-phases %standard-phases
2577 (replace 'install
2578 (lambda* (#:key make-flags #:allow-other-keys)
2579 (zero? (apply system* `("ant" "dist" ,@make-flags))))))))
2580 (home-page "https://www.gnu.org/software/classpathx/")
2581 (synopsis "Java servlet API implementation")
2582 (description "This is the GNU servlet API distribution, part of the
2583ClasspathX project. It provides implementations of version 3.0 of the servlet
2584API and version 2.1 of the Java ServerPages API.")
2585 (license license:gpl3+)))
2586
5490480c
RW
2587(define-public java-swt
2588 (package
2589 (name "java-swt")
8710d4dd 2590 (version "4.7.1a")
5490480c
RW
2591 (source
2592 ;; The types of many variables and procedures differ in the sources
2593 ;; dependent on whether the target architecture is a 32-bit system or a
2594 ;; 64-bit system. Instead of patching the sources on demand in a build
2595 ;; phase we download either the 32-bit archive (which mostly uses "int"
2596 ;; types) or the 64-bit archive (which mostly uses "long" types).
8710d4dd
RW
2597 (let ((hash32 "09q0cbh90d90q3a7dx9430kc4m6bijrkr4lajrmzzvi0jjdpq4v9")
2598 (hash64 "17k5hs75a87ssmc5xhwdfdm2gn4zba0r837l2455za01krnkaa2q")
5490480c
RW
2599 (file32 "x86")
2600 (file64 "x86_64"))
2601 (let-values (((hash file)
2602 (match (or (%current-target-system) (%current-system))
2603 ("x86_64-linux" (values hash64 file64))
2604 (_ (values hash32 file32)))))
2605 (origin
2606 (method url-fetch)
2607 (uri (string-append
8710d4dd
RW
2608 "http://download.eclipse.org/eclipse/downloads/drops4/"
2609 "R-" version "-201710090410/swt-" version
2610 "-gtk-linux-" file ".zip"))
5490480c
RW
2611 (sha256 (base32 hash))))))
2612 (build-system ant-build-system)
2613 (arguments
2614 `(#:jar-name "swt.jar"
8710d4dd 2615 #:jdk ,icedtea-8
5490480c
RW
2616 #:tests? #f ; no "check" target
2617 #:phases
2618 (modify-phases %standard-phases
2619 (replace 'unpack
2620 (lambda* (#:key source #:allow-other-keys)
2621 (and (mkdir "swt")
2622 (zero? (system* "unzip" source "-d" "swt"))
2623 (chdir "swt")
2624 (mkdir "src")
2625 (zero? (system* "unzip" "src.zip" "-d" "src")))))
2626 ;; The classpath contains invalid icecat jars. Since we don't need
2627 ;; anything other than the JDK on the classpath, we can simply unset
2628 ;; it.
2629 (add-after 'configure 'unset-classpath
2630 (lambda _ (unsetenv "CLASSPATH") #t))
2631 (add-before 'build 'build-native
2632 (lambda* (#:key inputs outputs #:allow-other-keys)
2633 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
2634 ;; Build shared libraries. Users of SWT have to set the system
2635 ;; property swt.library.path to the "lib" directory of this
2636 ;; package output.
2637 (mkdir-p lib)
2638 (setenv "OUTPUT_DIR" lib)
2639 (with-directory-excursion "src"
2640 (zero? (system* "bash" "build.sh"))))))
2641 (add-after 'install 'install-native
2642 (lambda* (#:key outputs #:allow-other-keys)
2643 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
2644 (for-each (lambda (file)
2645 (install-file file lib))
2646 (find-files "." "\\.so$"))
2647 #t))))))
2648 (inputs
8710d4dd 2649 `(("gtk" ,gtk+-2)
5490480c
RW
2650 ("libxtst" ,libxtst)
2651 ("libxt" ,libxt)
2652 ("mesa" ,mesa)
2653 ("glu" ,glu)))
2654 (native-inputs
2655 `(("pkg-config" ,pkg-config)
2656 ("unzip" ,unzip)))
2657 (home-page "https://www.eclipse.org/swt/")
2658 (synopsis "Widget toolkit for Java")
2659 (description
2660 "SWT is a widget toolkit for Java designed to provide efficient, portable
2661access to the user-interface facilities of the operating systems on which it
2662is implemented.")
2663 ;; SWT code is licensed under EPL1.0
2664 ;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
2665 ;; Cairo bindings contain code under MPL1.1
2666 ;; XULRunner 1.9 bindings contain code under MPL2.0
2667 (license (list
2668 license:epl1.0
2669 license:mpl1.1
2670 license:mpl2.0
2671 license:lgpl2.1+))))
2672
068e476f
RJ
2673(define-public java-xz
2674 (package
2675 (name "java-xz")
92966847 2676 (version "1.6")
068e476f
RJ
2677 (source (origin
2678 (method url-fetch)
2679 (uri (string-append "http://tukaani.org/xz/xz-java-" version ".zip"))
2680 (sha256
2681 (base32
92966847 2682 "1z3p1ri1gvl07inxn0agx44ck8n7wrzfmvkz8nbq3njn8r9wba8x"))))
068e476f
RJ
2683 (build-system ant-build-system)
2684 (arguments
2685 `(#:tests? #f ; There are no tests to run.
2686 #:jar-name ,(string-append "xz-" version ".jar")
2687 #:phases
2688 (modify-phases %standard-phases
2689 ;; The unpack phase enters the "maven" directory by accident.
2690 (add-after 'unpack 'chdir
2691 (lambda _ (chdir "..") #t)))))
2692 (native-inputs
2693 `(("unzip" ,unzip)))
d6ddc5ab 2694 (home-page "https://tukaani.org/xz/java.html")
068e476f
RJ
2695 (synopsis "Implementation of XZ data compression in pure Java")
2696 (description "This library aims to be a complete implementation of XZ data
2697compression in pure Java. Single-threaded streamed compression and
2698decompression and random access decompression have been fully implemented.")
2699 (license license:public-domain)))
04100c3b
RW
2700
2701;; java-hamcrest-core uses qdox version 1.12. We package this version instead
2702;; of the latest release.
2703(define-public java-qdox-1.12
2704 (package
2705 (name "java-qdox")
2706 (version "1.12.1")
2707 (source (origin
2708 (method url-fetch)
2709 (uri (string-append "http://central.maven.org/maven2/"
2710 "com/thoughtworks/qdox/qdox/" version
2711 "/qdox-" version "-sources.jar"))
2712 (sha256
2713 (base32
2714 "0hlfbqq2avf5s26wxkksqmkdyk6zp9ggqn37c468m96mjv0n9xfl"))))
2715 (build-system ant-build-system)
2716 (arguments
2717 `(;; Tests require junit
2718 #:tests? #f
2719 #:jar-name "qdox.jar"
2720 #:phases
2721 (modify-phases %standard-phases
2722 (replace 'unpack
2723 (lambda* (#:key source #:allow-other-keys)
2724 (mkdir "src")
2725 (with-directory-excursion "src"
2726 (zero? (system* "jar" "-xf" source)))))
2727 ;; At this point we don't have junit, so we must remove the API
2728 ;; tests.
2729 (add-after 'unpack 'delete-tests
2730 (lambda _
2731 (delete-file-recursively "src/com/thoughtworks/qdox/junit")
2732 #t)))))
2733 (home-page "http://qdox.codehaus.org/")
2734 (synopsis "Parse definitions from Java source files")
2735 (description
2736 "QDox is a high speed, small footprint parser for extracting
2737class/interface/method definitions from source files complete with JavaDoc
b13cf17f 2738@code{@@tags}. It is designed to be used by active code generators or
04100c3b
RW
2739documentation tools.")
2740 (license license:asl2.0)))
e7e28510
RW
2741
2742(define-public java-jarjar
2743 (package
2744 (name "java-jarjar")
2745 (version "1.4")
2746 (source (origin
2747 (method url-fetch)
2748 (uri (string-append
2749 "https://storage.googleapis.com/google-code-archive-downloads/v2/"
2750 "code.google.com/jarjar/jarjar-src-" version ".zip"))
2751 (sha256
2752 (base32
2753 "1v8irhni9cndcw1l1wxqgry013s2kpj0qqn57lj2ji28xjq8ndjl"))))
2754 (build-system ant-build-system)
2755 (arguments
2756 `(;; Tests require junit, which ultimately depends on this package.
2757 #:tests? #f
2758 #:build-target "jar"
2759 #:phases
2760 (modify-phases %standard-phases
2761 (replace 'install
2762 (lambda* (#:key outputs #:allow-other-keys)
2763 (let ((target (string-append (assoc-ref outputs "out")
2764 "/share/java")))
2765 (install-file (string-append "dist/jarjar-" ,version ".jar")
2766 target))
2767 #t)))))
2768 (native-inputs
2769 `(("unzip" ,unzip)))
2770 (home-page "https://code.google.com/archive/p/jarjar/")
2771 (synopsis "Repackage Java libraries")
2772 (description
2773 "Jar Jar Links is a utility that makes it easy to repackage Java
2774libraries and embed them into your own distribution. Jar Jar Links includes
2775an Ant task that extends the built-in @code{jar} task.")
2776 (license license:asl2.0)))
87c31a21
RW
2777
2778(define-public java-hamcrest-core
2779 (package
2780 (name "java-hamcrest-core")
2781 (version "1.3")
2782 (source (origin
2783 (method url-fetch)
00672896
HG
2784 (uri (string-append "https://github.com/hamcrest/JavaHamcrest/"
2785 "archive/hamcrest-java-" version ".tar.gz"))
87c31a21
RW
2786 (sha256
2787 (base32
00672896 2788 "11g0s105fmwzijbv08lx8jlb521yravjmxnpgdx08fvg1kjivhva"))
87c31a21
RW
2789 (modules '((guix build utils)))
2790 (snippet
2791 '(begin
00672896
HG
2792 ;; Delete bundled thirds-party jar archives.
2793 (delete-file-recursively "lib")
87c31a21
RW
2794 #t))))
2795 (build-system ant-build-system)
2796 (arguments
2797 `(#:tests? #f ; Tests require junit
a8d3cb62
RW
2798 #:modules ((guix build ant-build-system)
2799 (guix build utils)
2800 (srfi srfi-1))
87c31a21 2801 #:make-flags (list (string-append "-Dversion=" ,version))
fae0b4ca 2802 #:test-target "unit-test"
87c31a21
RW
2803 #:build-target "core"
2804 #:phases
2805 (modify-phases %standard-phases
2806 ;; Disable unit tests, because they require junit, which requires
2807 ;; hamcrest-core. We also give a fixed value to the "Built-Date"
2808 ;; attribute from the manifest for reproducibility.
2809 (add-before 'configure 'patch-build.xml
2810 (lambda _
2811 (substitute* "build.xml"
2812 (("unit-test, ") "")
2813 (("\\$\\{build.timestamp\\}") "guix"))
2814 #t))
2815 ;; Java's "getMethods()" returns methods in an unpredictable order.
2816 ;; To make the output of the generated code deterministic we must
2817 ;; sort the array of methods.
2818 (add-after 'unpack 'make-method-order-deterministic
2819 (lambda _
2820 (substitute* "hamcrest-generator/src/main/java/org/hamcrest/generator/ReflectiveFactoryReader.java"
2821 (("import java\\.util\\.Iterator;" line)
2822 (string-append line "\n"
2823 "import java.util.Arrays; import java.util.Comparator;"))
2824 (("allMethods = cls\\.getMethods\\(\\);" line)
2825 (string-append "_" line
2826 "
2827private Method[] getSortedMethods() {
2828 Arrays.sort(_allMethods, new Comparator<Method>() {
2829 @Override
2830 public int compare(Method a, Method b) {
2831 return a.toString().compareTo(b.toString());
2832 }
2833 });
2834 return _allMethods;
2835}
2836
2837private Method[] allMethods = getSortedMethods();")))))
2838 (add-before 'build 'do-not-use-bundled-qdox
2839 (lambda* (#:key inputs #:allow-other-keys)
2840 (substitute* "build.xml"
2841 (("lib/generator/qdox-1.12.jar")
2842 (string-append (assoc-ref inputs "java-qdox-1.12")
2843 "/share/java/qdox.jar")))
2844 #t))
fab959d3
HG
2845 ;; build.xml searches for .jar files in this directoy, which
2846 ;; we remove from the source archive.
2847 (add-before 'build 'create-dummy-directories
2848 (lambda _
2849 (mkdir-p "lib/integration")
2850 #t))
87c31a21
RW
2851 (replace 'install
2852 (lambda* (#:key outputs #:allow-other-keys)
a8d3cb62
RW
2853 (let* ((target (string-append (assoc-ref outputs "out")
2854 "/share/java/"))
2855 (version-suffix ,(string-append "-" version ".jar"))
2856 (install-without-version-suffix
2857 (lambda (jar)
2858 (copy-file jar
2859 (string-append target
2860 (basename jar version-suffix)
2861 ".jar")))))
2862 (mkdir-p target)
2863 (for-each
2864 install-without-version-suffix
2865 (find-files "build"
2866 (lambda (name _)
2867 (and (string-suffix? ".jar" name)
2868 (not (string-suffix? "-sources.jar" name)))))))
2869 #t)))))
87c31a21
RW
2870 (native-inputs
2871 `(("java-qdox-1.12" ,java-qdox-1.12)
2872 ("java-jarjar" ,java-jarjar)))
2873 (home-page "http://hamcrest.org/")
2874 (synopsis "Library of matchers for building test expressions")
2875 (description
2876 "This package provides a library of matcher objects (also known as
2877constraints or predicates) allowing @code{match} rules to be defined
2878declaratively, to be used in other frameworks. Typical scenarios include
2879testing frameworks, mocking libraries and UI validation rules.")
2880 (license license:bsd-2)))
d0184f44
RW
2881
2882(define-public java-junit
2883 (package
2884 (name "java-junit")
2885 (version "4.12")
2886 (source (origin
2887 (method url-fetch)
2888 (uri (string-append "https://github.com/junit-team/junit/"
2889 "archive/r" version ".tar.gz"))
2890 (file-name (string-append name "-" version ".tar.gz"))
2891 (sha256
2892 (base32
2893 "090dn5v1vs0b3acyaqc0gjf6p8lmd2h24wfzsbq7sly6b214anws"))
2894 (modules '((guix build utils)))
2895 (snippet
2896 '(begin
2897 ;; Delete bundled jar archives.
2898 (delete-file-recursively "lib")
2899 #t))))
2900 (build-system ant-build-system)
2901 (arguments
2902 `(#:tests? #f ; no tests
2903 #:jar-name "junit.jar"))
2904 (inputs
2905 `(("java-hamcrest-core" ,java-hamcrest-core)))
2906 (home-page "http://junit.org/")
2907 (synopsis "Test framework for Java")
2908 (description
2909 "JUnit is a simple framework to write repeatable tests for Java projects.
2910JUnit provides assertions for testing expected results, test fixtures for
2911sharing common test data, and test runners for running tests.")
2912 (license license:epl1.0)))
9fb20d01
RW
2913
2914(define-public java-plexus-utils
2915 (package
2916 (name "java-plexus-utils")
2917 (version "3.0.24")
2918 (source (origin
2919 (method url-fetch)
2920 (uri (string-append "https://github.com/codehaus-plexus/"
2921 "plexus-utils/archive/plexus-utils-"
2922 version ".tar.gz"))
2923 (sha256
2924 (base32
2925 "1mlwpc6fms24slygv5yvi6fi9hcha2fh0v73p5znpi78bg36i2js"))))
2926 (build-system ant-build-system)
2927 ;; FIXME: The default build.xml does not include a target to install
2928 ;; javadoc files.
2929 (arguments
2930 `(#:jar-name "plexus-utils.jar"
2931 #:source-dir "src/main"
2932 #:phases
2933 (modify-phases %standard-phases
2934 (add-after 'unpack 'fix-reference-to-/bin-and-/usr
2935 (lambda _
2936 (substitute* "src/main/java/org/codehaus/plexus/util/\
2937cli/shell/BourneShell.java"
2938 (("/bin/sh") (which "sh"))
2939 (("/usr/") (getcwd)))
2940 #t))
2941 (add-after 'unpack 'fix-or-disable-broken-tests
2942 (lambda _
2943 (with-directory-excursion "src/test/java/org/codehaus/plexus/util"
2944 (substitute* '("cli/CommandlineTest.java"
2945 "cli/shell/BourneShellTest.java")
2946 (("/bin/sh") (which "sh"))
2947 (("/bin/echo") (which "echo")))
2948
2949 ;; This test depends on MavenProjectStub, but we don't have
2950 ;; a package for Maven.
2951 (delete-file "introspection/ReflectionValueExtractorTest.java")
2952
2953 ;; FIXME: The command line tests fail, maybe because they use
2954 ;; absolute paths.
2955 (delete-file "cli/CommandlineTest.java"))
2956 #t)))))
2957 (native-inputs
2958 `(("java-junit" ,java-junit)))
2959 (home-page "http://codehaus-plexus.github.io/plexus-utils/")
2960 (synopsis "Common utilities for the Plexus framework")
2961 (description "This package provides various Java utility classes for the
2962Plexus framework to ease working with strings, files, command lines, XML and
2963more.")
2964 (license license:asl2.0)))
1e555562
HG
2965
2966(define-public java-plexus-interpolation
2967 (package
2968 (name "java-plexus-interpolation")
2969 (version "1.23")
2970 (source (origin
2971 (method url-fetch)
2972 (uri (string-append "https://github.com/codehaus-plexus/"
2973 "plexus-interpolation/archive/"
2974 "plexus-interpolation-" version ".tar.gz"))
2975 (sha256
2976 (base32
fd75eb6c 2977 "03377yzlx5q440m6sxxgv6a5qb8fl30zzcgxgc0hxk5qgl2z1jjn"))))
1e555562
HG
2978 (build-system ant-build-system)
2979 (arguments
2980 `(#:jar-name "plexus-interpolation.jar"
2981 #:source-dir "src/main"))
2982 (native-inputs
2983 `(("java-junit" ,java-junit)
2984 ("java-hamcrest-core" ,java-hamcrest-core)))
2985 (home-page "http://codehaus-plexus.github.io/plexus-interpolation/")
2986 (synopsis "Java components for interpolating ${} strings and the like")
2987 (description "Plexus interpolator is a modular, flexible interpolation
2988framework for the expression language style commonly seen in Maven, Plexus,
2989and other related projects.
2990
2991It has its foundation in the @code{org.codehaus.plexus.utils.interpolation}
2992package within @code{plexus-utils}, but has been separated in order to allow
2993these two libraries to vary independently of one another.")
2994 (license license:asl2.0)))
8f8ed9aa 2995
bb27eb0d
JL
2996(define-public java-plexus-classworlds
2997 (package
2998 (name "java-plexus-classworlds")
2999 (version "2.5.2")
3000 (source (origin
3001 (method url-fetch)
3002 (uri (string-append "https://github.com/codehaus-plexus/"
3003 "plexus-classworlds/archive/plexus-classworlds-"
3004 version ".tar.gz"))
3005 (sha256
3006 (base32
3007 "1qm4p0rl8d82lzhsiwnviw11jnq44s0gflg78zq152xyyr2xmh8g"))))
3008 (build-system ant-build-system)
3009 (arguments
3010 `(#:jar-name "plexus-classworlds.jar"
3011 #:source-dir "src/main"
3012 #:tests? #f));; FIXME: we need to generate some resources as in pom.xml
3013 (native-inputs
3014 `(("java-junit" ,java-junit)))
3015 (home-page "http://codehaus-plexus.github.io/plexus-classworlds/")
3016 (synopsis "Java class loader framework")
f4548394
TGR
3017 (description "Plexus classworlds replaces the native @code{ClassLoader}
3018mechanism of Java. It is especially useful for dynamic loading of application
bb27eb0d
JL
3019components.")
3020 (license license:asl2.0)))
3021
a7ad92ad 3022(define java-plexus-container-default-bootstrap
0726d4ea
JL
3023 (package
3024 (name "java-plexus-container-default-bootstrap")
3025 (version "1.7.1")
3026 (source (origin
3027 (method url-fetch)
3028 (uri (string-append "https://github.com/codehaus-plexus/plexus-containers"
3029 "/archive/plexus-containers-" version ".tar.gz"))
3030 (sha256
3031 (base32
3032 "0xw5g30qf4a83608rw9v2hv8pfsz7d69dkdhk6r0wia4q78hh1pc"))))
3033 (build-system ant-build-system)
3034 (arguments
3035 `(#:jar-name "container-default.jar"
3036 #:source-dir "plexus-container-default/src/main/java"
3037 #:test-dir "plexus-container-default/src/test"
3038 #:jdk ,icedtea-8
3039 #:tests? #f; requires plexus-archiver, which depends on this package
3040 #:phases
3041 (modify-phases %standard-phases
3042 (add-before 'build 'copy-resources
3043 (lambda _
3044 (copy-recursively
3045 "plexus-container-default/src/main/resources/"
3046 "build/classes")
3047 #t)))))
3048 (inputs
3049 `(("worldclass" ,java-plexus-classworlds)
3050 ("xbean" ,java-geronimo-xbean-reflect)
3051 ("utils" ,java-plexus-utils)
3052 ("junit" ,java-junit)
3053 ("guava" ,java-guava)))
3054 (home-page "https://github.com/codehaus-plexus/plexus-containers")
f4548394 3055 (synopsis "Inversion-of-control container")
0726d4ea 3056 (description "Plexus-default-container is Plexus' inversion-of-control
f4548394 3057(@dfn{IoC}) container. It is composed of its public API and its default
0726d4ea
JL
3058implementation.")
3059 (license license:asl2.0)))
3060
0858b9dc
JL
3061(define-public java-plexus-io
3062 (package
3063 (name "java-plexus-io")
3064 (version "3.0.0")
3065 (source (origin
3066 (method url-fetch)
3067 (uri (string-append "https://github.com/codehaus-plexus/plexus-io"
3068 "/archive/plexus-io-" version ".tar.gz"))
3069 (sha256
3070 (base32
3071 "0f2j41kihaymxkpbm55smpxjja235vad8cgz94frfy3ppcp021dw"))))
3072 (build-system ant-build-system)
3073 (arguments
3074 `(#:jar-name "plexus-io.jar"
3075 #:source-dir "src/main/java"
3076 #:test-dir "src/test"
3077 #:jdk ,icedtea-8
3078 #:phases
3079 (modify-phases %standard-phases
3080 (add-before 'build 'copy-resources
3081 (lambda _
3082 (mkdir-p "build/classes/META-INF/plexus")
3083 (copy-file "src/main/resources/META-INF/plexus/components.xml"
3084 "build/classes/META-INF/plexus/components.xml")
3085 #t)))))
3086 (inputs
3087 `(("utils" ,java-plexus-utils)
3088 ("commons-io" ,java-commons-io)
3089 ("java-jsr305" ,java-jsr305)))
3090 (native-inputs
3091 `(("junit" ,java-junit)
3092 ("hamcrest" ,java-hamcrest-core)
3093 ("guava" ,java-guava)
3094 ("classworlds" ,java-plexus-classworlds)
3095 ("xbean" ,java-geronimo-xbean-reflect)
3096 ("container-default" ,java-plexus-container-default-bootstrap)))
3097 (home-page "https://github.com/codehaus-plexus/plexus-io")
3098 (synopsis "I/O plexus components")
3099 (description "Plexus IO is a set of plexus components, which are designed
3100for use in I/O operations. This implementation using plexus components allows
3101reusing it in maven.")
3102 (license license:asl2.0)))
3103
b51df3ca
JL
3104(define-public java-plexus-archiver
3105 (package
3106 (name "java-plexus-archiver")
3107 (version "3.5")
3108 (source (origin
3109 (method url-fetch)
3110 (uri (string-append "https://github.com/codehaus-plexus/plexus-archiver"
3111 "/archive/plexus-archiver-" version ".tar.gz"))
3112 (sha256
3113 (base32
3114 "0iv1j7khra6icqh3jndng3iipfmkc7l5jq2y802cm8r575v75pyv"))))
3115 (build-system ant-build-system)
3116 (arguments
3117 `(#:jar-name "plexus-archiver.jar"
3118 #:source-dir "src/main/java"
3119 #:jdk ,icedtea-8
3120 #:test-dir "src/test"
3121 #:test-exclude (list "**/Abstract*.java" "**/Base*.java")
3122 #:phases
3123 (modify-phases %standard-phases
3124 (add-before 'check 'remove-failing
3125 (lambda _
3126 ;; Requires an older version of plexus container
3127 (delete-file
3128 "src/test/java/org/codehaus/plexus/archiver/DuplicateFilesTest.java")))
3129 (add-before 'build 'copy-resources
3130 (lambda _
3131 (mkdir-p "build/classes/META-INF/plexus")
3132 (copy-file "src/main/resources/META-INF/plexus/components.xml"
3133 "build/classes/META-INF/plexus/components.xml")
3134 #t)))))
3135 (inputs
3136 `(("utils" ,java-plexus-utils)
3137 ("commons-io" ,java-commons-io)
3138 ("snappy" ,java-iq80-snappy)
3139 ("io" ,java-plexus-io)
3140 ("compress" ,java-commons-compress)
3141 ("container-default" ,java-plexus-container-default-bootstrap)
3142 ("snappy" ,java-snappy)
3143 ("java-jsr305" ,java-jsr305)))
3144 (native-inputs
3145 `(("junit" ,java-junit)
3146 ("classworld" ,java-plexus-classworlds)
3147 ("xbean" ,java-geronimo-xbean-reflect)
3148 ("xz" ,java-tukaani-xz)
3149 ("guava" ,java-guava)))
3150 (home-page "https://github.com/codehaus-plexus/plexus-archiver")
3151 (synopsis "Archiver component of the Plexus project")
3152 (description "Plexus-archiver contains a component to deal with project
3153archives (jar).")
3154 (license license:asl2.0)))
3155
a0837294
JL
3156(define-public java-plexus-container-default
3157 (package
3158 (inherit java-plexus-container-default-bootstrap)
3159 (name "java-plexus-container-default")
3160 (arguments
3161 `(#:jar-name "container-default.jar"
3162 #:source-dir "plexus-container-default/src/main/java"
3163 #:test-dir "plexus-container-default/src/test"
3164 #:test-exclude (list ;"**/*Test.java"
3165 "**/Abstract*.java"
3166 ;; Requires plexus-hierarchy
3167 "**/PlexusHierarchyTest.java"
3168 ;; Failures
3169 "**/ComponentRealmCompositionTest.java"
3170 "**/PlexusContainerTest.java")
3171 #:jdk ,icedtea-8
3172 #:phases
3173 (modify-phases %standard-phases
3174 (add-before 'build 'copy-resources
3175 (lambda _
3176 (copy-recursively
3177 "plexus-container-default/src/main/resources/"
3178 "build/classes")
3179 #t))
3180 (add-before 'check 'fix-paths
3181 (lambda _
3182 (let ((dir "plexus-container-default/src/test/java/org/codehaus"))
3183 (substitute*
3184 (string-append
3185 dir "/plexus/component/composition/"
3186 "ComponentRealmCompositionTest.java")
3187 (("src/test") "plexus-container-default/src/test"))
3188 #t))))))
3189 (inputs
3190 `(("worldclass" ,java-plexus-classworlds)
3191 ("xbean" ,java-geronimo-xbean-reflect)
3192 ("utils" ,java-plexus-utils)
3193 ("junit" ,java-junit)
3194 ("guava" ,java-guava)))
3195 (native-inputs
3196 `(("archiver" ,java-plexus-archiver)
3197 ("hamcrest" ,java-hamcrest-core)))))
3198
3214afab
JL
3199(define-public java-plexus-component-annotations
3200 (package
3201 (inherit java-plexus-container-default)
3202 (name "java-plexus-component-annotations")
3203 (arguments
3204 `(#:jar-name "plexus-component-annotations.jar"
3205 #:source-dir "plexus-component-annotations/src/main/java"
3206 #:tests? #f)); no tests
3207 (inputs '())
3208 (native-inputs '())
3209 (synopsis "Plexus descriptors generator")
3210 (description "This package is a Maven plugin to generate Plexus descriptors
3211from source tags and class annotations.")))
3212
4f77ba17
JL
3213(define-public java-plexus-cipher
3214 (package
3215 (name "java-plexus-cipher")
3216 (version "1.7")
3217 (source (origin
3218 (method url-fetch)
3219 (uri (string-append "https://github.com/codehaus-plexus/plexus-cipher"
3220 "/archive/plexus-cipher-" version ".tar.gz"))
3221 (sha256
3222 (base32
3223 "1j3r8xzlxlk340snkjp6lk2ilkxlkn8qavsfiq01f43xmvv8ymk3"))))
3224 (build-system ant-build-system)
3225 (arguments
3226 `(#:jar-name "plexus-cipher.jar"
3227 #:source-dir "src/main/java"
3228 #:jdk ,icedtea-8
3229 #:tests? #f; FIXME: requires sisu-inject-bean
3230 #:phases
3231 (modify-phases %standard-phases
3232 (add-before 'build 'copy-resources
3233 (lambda _
3234 (copy-recursively "src/main/resources" "build/classes")
3235 (mkdir-p "build/classes/META-INF/sisu")
3236 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
3237 (lambda _
3238 (display "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
3239 #t)))))
3240 (inputs
3241 `(("java-cdi-api" ,java-cdi-api)
3242 ("java-javax-inject" ,java-javax-inject)))
3243 (home-page "https://github.com/sonatype/plexus-cipher")
3244 (synopsis "Encryption/decryption Component")
3245 (description "Plexus-cipher contains a component to deal with encryption
3246and decryption.")
3247 (license license:asl2.0)))
3248
239126d4
JL
3249(define-public java-plexus-compiler-api
3250 (package
3251 (name "java-plexus-compiler-api")
3252 (version "2.8.2")
3253 (source (origin
3254 (method url-fetch)
3255 (uri (string-append "https://github.com/codehaus-plexus/plexus-compiler"
3256 "/archive/plexus-compiler-" version ".tar.gz"))
3257 (sha256
3258 (base32
3259 "0g3x26pymcdnfnwv2a1i57pd5s26f5zqfi1rdy98z1bn01klx25k"))))
3260 (build-system ant-build-system)
3261 (arguments
3262 `(#:jar-name "plexus-compiler-api.jar"
3263 #:source-dir "plexus-compiler-api/src/main/java"
3264 #:jdk ,icedtea-8
3265 #:test-dir "plexus-compiler-api/src/test"))
3266 (inputs
3267 `(("java-plexus-container-default" ,java-plexus-container-default)
3268 ("java-plexus-util" ,java-plexus-utils)))
3269 (native-inputs
3270 `(("java-junit" ,java-junit)))
3271 (home-page "https://github.com/codehaus-plexus/plexus-compiler")
3272 (synopsis "Plexus Compilers component's API to manipulate compilers")
3273 (description "This package contains the API used by components to manipulate
3274compilers.")
3275 (license (list license:asl2.0
3276 license:expat))))
3277
f8a519fa
JL
3278(define-public java-plexus-compiler-javac
3279 (package
3280 (inherit java-plexus-compiler-api)
3281 (name "java-plexus-compiler-javac")
3282 (arguments
3283 `(#:jar-name "plexus-compiler-javac.jar"
3284 #:source-dir "plexus-compilers/plexus-compiler-javac/src/main/java"
3285 #:jdk ,icedtea-8
3286 #:tests? #f; depends on compiler-test -> maven-core -> ... -> this package.
3287 #:test-dir "plexus-compilers/plexus-compiler-javac/src/test"))
3288 (inputs
3289 `(("java-plexus-compiler-api" ,java-plexus-compiler-api)
3290 ("java-plexus-utils" ,java-plexus-utils)
3291 ("java-plexus-container-default" ,java-plexus-container-default)))
3292 (native-inputs
3293 `(("java-junit" ,java-junit)))
3294 (synopsis "Javac Compiler support for Plexus Compiler component")
3295 (description "This package contains the Javac Compiler support for Plexus
3296Compiler component.")))
3297
0aa85081
JL
3298(define-public java-plexus-sec-dispatcher
3299 (package
3300 (name "java-plexus-sec-dispatcher")
3301 (version "1.4") ;; Newest release listed at the Maven Central Repository.
3302 (source (origin
3303 ;; This project doesn't tag releases or publish tarballs, so we take
3304 ;; the "prepare release plexus-sec-dispatcher-1.4" git commit.
3305 (method url-fetch)
3306 (uri (string-append "https://github.com/sonatype/plexus-sec-dispatcher/"
3307 "archive/7db8f88048.tar.gz"))
3308 (sha256
3309 (base32
3310 "1smfrk4n7xbrsxpxcp2j4i0j8q86j73w0w6xg7qz83dp6dagdjgp"))
3311 (file-name (string-append name "-" version ".tar.gz"))))
3312 (arguments
3313 `(#:jar-name "plexus-sec-dispatcher.jar"
3314 #:source-dir "src/main/java"
3315 #:jdk ,icedtea-8
3316 #:phases
3317 (modify-phases %standard-phases
3318 (add-before 'build 'generate-models
3319 (lambda* (#:key inputs #:allow-other-keys)
3320 (define (modello-single-mode file version mode)
3321 (zero? (system* "java"
3322 "org.codehaus.modello.ModelloCli"
3323 file mode "src/main/java" version
3324 "false" "true")))
3325 (let ((file "src/main/mdo/settings-security.mdo"))
3326 (and
3327 (modello-single-mode file "1.0.0" "java")
3328 (modello-single-mode file "1.0.0" "xpp3-reader")
3329 (modello-single-mode file "1.0.0" "xpp3-writer")))))
3330 (add-before 'build 'generate-components.xml
3331 (lambda _
3332 (mkdir-p "build/classes/META-INF/plexus")
3333 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
3334 (lambda _
3335 (display
3336 "<component-set>\n
3337 <components>\n
3338 <component>\n
3339 <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role>\n
3340 <role-hint>default</role-hint>\n
3341 <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation>\n
3342 <description></description>\n
3343 <requirements>\n
3344 <requirement>\n
3345 <role>org.sonatype.plexus.components.cipher.PlexusCipher</role>\n
3346 <field-name>_cipher</field-name>\n
3347 </requirement>\n
3348 <requirement>\n
3349 <role>org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor</role>\n
3350 <field-name>_decryptors</field-name>\n
3351 </requirement>\n
3352 </requirements>\n
3353 <configuration>\n
3354 <_configuration-file>~/.settings-security.xml</_configuration-file>\n
3355 </configuration>\n
3356 </component>\n
3357 </components>\n
3358</component-set>\n")))))
3359 (add-before 'check 'fix-paths
3360 (lambda _
3361 (copy-recursively "src/test/resources" "target"))))))
3362 (inputs
3363 `(("java-plexus-cipher" ,java-plexus-cipher)))
3364 (native-inputs
3365 `(("java-modello-core" ,java-modello-core)
3366 ;; for modello:
3367 ("java-plexus-container-default" ,java-plexus-container-default)
3368 ("java-plexus-classworlds" ,java-plexus-classworlds)
3369 ("java-plexus-utils" ,java-plexus-utils)
3370 ("java-guava" ,java-guava)
3371 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
3372 ("java-sisu-build-api" ,java-sisu-build-api)
3373 ;; modello plugins:
3374 ("java-modellop-plugins-java" ,java-modello-plugins-java)
3375 ("java-modellop-plugins-xml" ,java-modello-plugins-xml)
3376 ("java-modellop-plugins-xpp3" ,java-modello-plugins-xpp3)
3377 ;; for tests
3378 ("java-junit" ,java-junit)))
3379 (build-system ant-build-system)
3380 (home-page "https://github.com/sonatype/plexus-sec-dispatcher")
3381 (synopsis "Plexus Security Dispatcher Component")
3382 (description "This package is the Plexus Security Dispatcher Component.
3383This component decrypts a string passed to it.")
3384 (license license:asl2.0)))
3385
8f524749
JL
3386(define-public java-sisu-build-api
3387 (package
3388 (name "java-sisu-build-api")
3389 (version "0.0.7")
3390 (source (origin
3391 (method url-fetch)
3392 (uri (string-append "https://github.com/sonatype/sisu-build-api/"
3393 "archive/plexus-build-api-" version ".tar.gz"))
3394 (sha256
3395 (base32
3396 "1c3rrpma3x634xp2rm2p5iskfhzdyc7qfbhjzr70agrl1jwghgy2"))))
3397 (build-system ant-build-system)
3398 (arguments
3399 `(#:jar-name "sisu-build-api.jar"
3400 #:source-dir "src/main/java"
3401 #:jdk ,icedtea-8
3402 #:tests? #f; FIXME: how to run the tests?
3403 #:phases
3404 (modify-phases %standard-phases
3405 (add-before 'build 'copy-resources
3406 (lambda _
3407 (copy-recursively "src/main/resources" "build/classes")
3408 (substitute* (find-files "build/classes")
3409 (("\\$\\{project.version\\}") ,version))
3410 #t))
3411 (add-before 'build 'generate-plexus-compontent
3412 (lambda _
3413 (mkdir-p "build/classes/META-INF/plexus")
3414 ;; This file is required for plexus to inject this package.
3415 ;; FIXME: how is it generated?
3416 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
3417 (lambda _
3418 (display
3419 "<component-set>\n
3420 <components>\n
3421 <component>\n
3422 <role>org.sonatype.plexus.build.incremental.BuildContext</role>\n
3423 <role-hint>default</role-hint>\n
3424 <implementation>org.sonatype.plexus.build.incremental.DefaultBuildContext</implementation>\n
3425 <description>Filesystem based non-incremental build context implementation\n
3426which behaves as if all files were just created.</description>\n
3427 </component>\n
3428 </components>\n
3429</component-set>\n")))
3430 #t)))))
3431 (inputs
3432 `(("java-plexus-utils" ,java-plexus-utils)
3433 ("java-plexus-container-default" ,java-plexus-container-default)))
3434 (home-page "https://github.com/sonatype/sisu-build-api/")
3435 (synopsis "Base build API for maven")
3436 (description "This package contains the base build API for maven and
3437a default implementation of it. This API is about scanning files in a
3438project and determining what files need to be rebuilt.")
3439 (license license:asl2.0)))
3440
b26c8b61
JL
3441(define-public java-modello-core
3442 (package
3443 (name "java-modello-core")
3444 (version "1.9.1")
3445 (source (origin
3446 (method url-fetch)
3447 (uri (string-append "https://github.com/codehaus-plexus/modello"
3448 "/archive/modello-" version ".tar.gz"))
3449 (sha256
3450 (base32
3451 "0l2pvns8pmlrmjm3iknp7gpg3654y1m8qhy55b19sdwdchdcyxfh"))))
3452 (build-system ant-build-system)
3453 (arguments
3454 `(#:jar-name "modello-core.jar"
3455 #:source-dir "modello-core/src/main/java"
3456 #:test-dir "modello-core/src/test"
3457 #:main-class "org.codehaus.modello.ModelloCli"
3458 #:jdk ,icedtea-8
3459 #:phases
3460 (modify-phases %standard-phases
3461 (add-before 'build 'copy-resources
3462 (lambda _
3463 (mkdir-p "build/classes/META-INF/plexus")
3464 (copy-file "modello-core/src/main/resources/META-INF/plexus/components.xml"
3465 "build/classes/META-INF/plexus/components.xml")
3466 #t))
3467 (add-before 'check 'fix-tests
3468 (lambda _
3469 (with-directory-excursion "modello-core/src/test/java/org/codehaus"
3470 (substitute* '("modello/core/DefaultModelloCoreTest.java"
3471 "modello/core/io/ModelReaderTest.java")
3472 (("src/test") "modello-core/src/test")))
3473 #t)))))
3474 (inputs
3475 `(("java-plexus-utils" ,java-plexus-utils)
3476 ("java-plexus-container-default" ,java-plexus-container-default)
3477 ("java-sisu-build-api" ,java-sisu-build-api)))
3478 (native-inputs
3479 `(("java-junit" ,java-junit)
3480 ("java-plexus-classworlds" ,java-plexus-classworlds)
3481 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
3482 ("java-guava" ,java-guava)))
3483 (home-page "http://codehaus-plexus.github.io/modello/")
3484 (synopsis "Framework for code generation from a simple model")
3485 (description "Modello is a framework for code generation from a simple model.
3486
3487Modello generates code from a simple model format: based on a plugin
3488architecture, various types of code and descriptors can be generated from the
3489single model, including Java POJOs, XML/JSON/YAML marshallers/unmarshallers,
3490XSD and documentation.")
3491 (license (list
3492 license:expat
3493 ;; Although this package uses only files licensed under expat,
3494 ;; other parts of the source are licensed under different
3495 ;; licenses. We include them to be inherited by other packages.
3496 license:asl2.0
3497 ;; Some files in modello-plugin-java are licensed under a
3498 ;; 5-clause BSD license.
3499 (license:non-copyleft
3500 (string-append "file:///modello-plugins/modello-plugin-java/"
3501 "src/main/java/org/codehaus/modello/plugin/"
3502 "java/javasource/JNaming.java"))))))
3503
fc620bef
JL
3504(define-public java-modello-plugins-java
3505 (package
3506 (inherit java-modello-core)
3507 (name "java-modello-plugins-java")
3508 (arguments
3509 `(#:jar-name "modello-plugins-java.jar"
3510 #:source-dir "modello-plugins/modello-plugin-java/src/main/java"
3511 #:test-dir "modello-plugins/modello-plugin-java/src/test"
3512 #:jdk ,icedtea-8
3513 #:tests? #f; requires maven-model, which depends on this package
3514 #:phases
3515 (modify-phases %standard-phases
3516 (add-before 'build 'copy-resources
3517 (lambda _
3518 (mkdir-p "build/classes")
3519 (copy-recursively "modello-plugins/modello-plugin-java/src/main/resources"
3520 "build/classes")
3521 #t)))))
3522 (inputs
3523 `(("java-modello-core" ,java-modello-core)
3524 ,@(package-inputs java-modello-core)))
3525 (synopsis "Modello Java Plugin")
3526 (description "Modello Java Plugin generates Java objects for the model.")))
3527
a0ce95ba
JL
3528(define-public java-modello-plugins-xml
3529 (package
3530 (inherit java-modello-core)
3531 (name "java-modello-plugins-xml")
3532 (arguments
3533 `(#:jar-name "modello-plugins-xml.jar"
3534 #:source-dir "modello-plugins/modello-plugin-xml/src/main/java"
3535 #:test-dir "modello-plugins/modello-plugin-xml/src/test"
3536 #:jdk ,icedtea-8
3537 #:phases
3538 (modify-phases %standard-phases
3539 (add-before 'build 'copy-resources
3540 (lambda _
3541 (mkdir-p "build/classes")
3542 (copy-recursively
3543 "modello-plugins/modello-plugin-xml/src/main/resources"
3544 "build/classes")
3545 #t))
3546 (add-before 'check 'fix-paths
3547 (lambda _
3548 (with-directory-excursion "modello-plugins/modello-plugin-xml/src/test"
3549 (substitute*
3550 "java/org/codehaus/modello/plugins/xml/XmlModelloPluginTest.java"
3551 (("src/test") "modello-plugins/modello-plugin-xml/src/test"))))))))
3552 (inputs
3553 `(("java-modello-core" ,java-modello-core)
3554 ("java-modello-plugins-java" ,java-modello-plugins-java)
3555 ,@(package-inputs java-modello-core)))
3556 (synopsis "Modello XML Plugin")
3557 (description "Modello XML Plugin contains shared code for every plugins
3558working on XML representation of the model.")))
3559
e4708560
JL
3560(define-public java-modello-test
3561 (package
3562 (inherit java-modello-core)
3563 (name "java-modello-test")
3564 (arguments
3565 `(#:jar-name "modello-test.jar"
3566 #:source-dir "modello-test/src/main/java"
3567 #:tests? #f; no tests
3568 #:jdk ,icedtea-8))
3569 (inputs
3570 `(("java-plexus-utils" ,java-plexus-utils)
3571 ("java-plexus-compiler-api" ,java-plexus-compiler-api)
3572 ("java-plexus-compiler-javac" ,java-plexus-compiler-javac)
3573 ("java-plexus-container-default" ,java-plexus-container-default)))
3574 (synopsis "Modello test package")
3575 (description "The modello test package contains the basis to create
3576Modello generator unit-tests, including sample models and xml files to test
3577every feature for every plugin.")))
3578
36607d3b
JL
3579(define-public java-modello-plugins-xpp3
3580 (package
3581 (inherit java-modello-core)
3582 (name "java-modello-plugins-xpp3")
3583 (arguments
3584 `(#:jar-name "modello-plugins-xpp3.jar"
3585 #:source-dir "modello-plugins/modello-plugin-xpp3/src/main/java"
3586 #:test-dir "modello-plugins/modello-plugin-xpp3/src/test"
3587 ;; One of the test dependencies is maven-model which depends on this package.
3588 #:tests? #f
3589 #:jdk ,icedtea-8
3590 #:phases
3591 (modify-phases %standard-phases
3592 (add-before 'build 'copy-resources
3593 (lambda _
3594 (mkdir-p "build/classes")
3595 (copy-recursively "modello-plugins/modello-plugin-xpp3/src/main/resources"
3596 "build/classes")
3597 #t)))))
3598 (inputs
3599 `(("java-modello-core" ,java-modello-core)
3600 ("java-modello-plugins-java" ,java-modello-plugins-java)
3601 ("java-modello-plugins-xml" ,java-modello-plugins-xml)
3602 ,@(package-inputs java-modello-core)))
3603 (native-inputs
3604 `(("java-xmlunit" ,java-xmlunit)
3605 ("java-modello-test" ,java-modello-test)
3606 ,@(package-native-inputs java-modello-core)))
3607 (synopsis "Modello XPP3 Plugin")
3608 (description "The modello XPP3 plugin generates XML readers and writers based
3609on the XPP3 API (XML Pull Parser).")))
3610
8f8ed9aa
RW
3611(define-public java-asm
3612 (package
3613 (name "java-asm")
d0e9ded7 3614 (version "6.0")
8f8ed9aa
RW
3615 (source (origin
3616 (method url-fetch)
3617 (uri (string-append "http://download.forge.ow2.org/asm/"
3618 "asm-" version ".tar.gz"))
3619 (sha256
3620 (base32
d0e9ded7 3621 "115l5pqblirdkmzi32dxx7gbcm4jy0s14y5wircr6h8jdr9aix00"))))
8f8ed9aa 3622 (build-system ant-build-system)
d0e9ded7
GB
3623 (propagated-inputs
3624 `(("java-aqute-bndlib" ,java-aqute-bndlib)))
8f8ed9aa
RW
3625 (arguments
3626 `(#:build-target "compile"
3627 ;; The tests require an old version of Janino, which no longer compiles
3628 ;; with the JDK7.
3629 #:tests? #f
d0e9ded7
GB
3630 #:make-flags
3631 (list
3632 ;; We don't need these extra ant tasks, but the build system asks us to
3633 ;; provide a path anyway.
3634 "-Dobjectweb.ant.tasks.path=dummy-path"
3635 ;; The java-aqute.bndlib JAR file will be put onto the classpath and
3636 ;; used during the build automatically by ant-build-system, but
3637 ;; java-asm's build.xml fails unless we provide something here.
3638 "-Dbiz.aQute.bnd.path=dummy-path")
8f8ed9aa
RW
3639 #:phases
3640 (modify-phases %standard-phases
3641 (add-before 'install 'build-jars
3642 (lambda* (#:key make-flags #:allow-other-keys)
3643 ;; We cannot use the "jar" target because it depends on a couple
3644 ;; of unpackaged, complicated tools.
3645 (mkdir "dist")
3646 (zero? (system* "jar"
3647 "-cf" (string-append "dist/asm-" ,version ".jar")
3648 "-C" "output/build/tmp" "."))))
3649 (replace 'install
3650 (install-jars "dist")))))
3651 (native-inputs
3652 `(("java-junit" ,java-junit)))
3653 (home-page "http://asm.ow2.org/")
3654 (synopsis "Very small and fast Java bytecode manipulation framework")
3655 (description "ASM is an all purpose Java bytecode manipulation and
3656analysis framework. It can be used to modify existing classes or dynamically
3657generate classes, directly in binary form. The provided common
3658transformations and analysis algorithms allow to easily assemble custom
3659complex transformations and code analysis tools.")
3660 (license license:bsd-3)))
607fe24a
RW
3661
3662(define-public java-cglib
3663 (package
3664 (name "java-cglib")
3665 (version "3.2.4")
3666 (source (origin
3667 (method url-fetch)
3668 (uri (string-append
3669 "https://github.com/cglib/cglib/archive/RELEASE_"
3670 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
3671 ".tar.gz"))
3672 (file-name (string-append "cglib-" version ".tar.gz"))
3673 (sha256
3674 (base32
3675 "162dvd4fln76ai8prfharf66pn6r56p3sxx683j5vdyccrd5hi1q"))))
3676 (build-system ant-build-system)
3677 (arguments
3678 `(;; FIXME: tests fail because junit runs
3679 ;; "net.sf.cglib.transform.AbstractTransformTest", which does not seem
3680 ;; to describe a test at all.
3681 #:tests? #f
3682 #:jar-name "cglib.jar"
3683 #:phases
3684 (modify-phases %standard-phases
3685 (add-after 'unpack 'chdir
3686 (lambda _ (chdir "cglib") #t)))))
3687 (inputs
3688 `(("java-asm" ,java-asm)
3689 ("java-junit" ,java-junit)))
3690 (home-page "https://github.com/cglib/cglib/")
3691 (synopsis "Java byte code generation library")
3692 (description "The byte code generation library CGLIB is a high level API
3693to generate and transform Java byte code.")
3694 (license license:asl2.0)))
33e34bfe
RW
3695
3696(define-public java-objenesis
3697 (package
3698 (name "java-objenesis")
3699 (version "2.5.1")
3700 (source (origin
3701 (method url-fetch)
3702 (uri (string-append "https://github.com/easymock/objenesis/"
3703 "archive/" version ".tar.gz"))
3704 (file-name (string-append "objenesis-" version ".tar.gz"))
3705 (sha256
3706 (base32
3707 "1va5qz1i2wawwavhnxfzxnfgrcaflz9p1pg03irrjh4nd3rz8wh6"))))
3708 (build-system ant-build-system)
3709 (arguments
3710 `(#:jar-name "objenesis.jar"
3711 #:source-dir "main/src/"
3712 #:test-dir "main/src/test/"))
3713 (native-inputs
3714 `(("java-junit" ,java-junit)
3715 ("java-hamcrest-core" ,java-hamcrest-core)))
3716 (home-page "http://objenesis.org/")
3717 (synopsis "Bypass the constructor when creating an object")
3718 (description "Objenesis is a small Java library that serves one purpose:
3719to instantiate a new object of a particular class. It is common to see
3720restrictions in libraries stating that classes must require a default
3721constructor. Objenesis aims to overcome these restrictions by bypassing the
3722constructor on object instantiation.")
3723 (license license:asl2.0)))
ae589876
RW
3724
3725(define-public java-easymock
3726 (package
3727 (name "java-easymock")
3728 (version "3.4")
3729 (source (origin
3730 (method url-fetch)
3731 (uri (string-append "https://github.com/easymock/easymock/"
3732 "archive/easymock-" version ".tar.gz"))
3733 (sha256
3734 (base32
3735 "1yzg0kv256ndr57gpav46cyv4a1ns5sj722l50zpxk3j6sk9hnmi"))))
3736 (build-system ant-build-system)
3737 (arguments
3738 `(#:jar-name "easymock.jar"
3739 #:source-dir "core/src/main"
3740 #:test-dir "core/src/test"
3741 #:phases
3742 (modify-phases %standard-phases
3743 ;; FIXME: Android support requires the following packages to be
3744 ;; available: com.google.dexmaker.stock.ProxyBuilder
3745 (add-after 'unpack 'delete-android-support
3746 (lambda _
3747 (with-directory-excursion "core/src/main/java/org/easymock/internal"
3748 (substitute* "MocksControl.java"
3749 (("AndroidSupport.isAndroid\\(\\)") "false")
3750 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
3751 (delete-file "AndroidClassProxyFactory.java"))
3752 #t))
3753 (add-after 'unpack 'delete-broken-tests
3754 (lambda _
3755 (with-directory-excursion "core/src/test/java/org/easymock"
3756 ;; This test depends on dexmaker.
3757 (delete-file "tests2/ClassExtensionHelperTest.java")
3758
3759 ;; This is not a test.
3760 (delete-file "tests/BaseEasyMockRunnerTest.java")
3761
3762 ;; This test should be executed with a different runner...
3763 (delete-file "tests2/EasyMockAnnotationsTest.java")
3764 ;; ...but deleting it means that we also have to delete these
3765 ;; dependent files.
3766 (delete-file "tests2/EasyMockRunnerTest.java")
3767 (delete-file "tests2/EasyMockRuleTest.java")
3768
3769 ;; This test fails because the file "easymock.properties" does
3770 ;; not exist.
3771 (delete-file "tests2/EasyMockPropertiesTest.java"))
3772 #t)))))
3773 (inputs
3774 `(("java-asm" ,java-asm)
3775 ("java-cglib" ,java-cglib)
3776 ("java-objenesis" ,java-objenesis)))
3777 (native-inputs
3778 `(("java-junit" ,java-junit)
3779 ("java-hamcrest-core" ,java-hamcrest-core)))
3780 (home-page "http://easymock.org")
3781 (synopsis "Java library providing mock objects for unit tests")
3782 (description "EasyMock is a Java library that provides an easy way to use
3783mock objects in unit testing.")
3784 (license license:asl2.0)))
7aa37023 3785
f12ad6c7
RW
3786(define-public java-jmock-1
3787 (package
3788 (name "java-jmock")
3789 (version "1.2.0")
3790 (source (origin
3791 (method url-fetch)
3792 (uri (string-append "https://github.com/jmock-developers/"
3793 "jmock-library/archive/" version ".tar.gz"))
3794 (file-name (string-append "jmock-" version ".tar.gz"))
3795 (sha256
3796 (base32
3797 "0xmrlhq0fszldkbv281k9463mv496143vvmqwpxp62yzjvdkx9w0"))))
3798 (build-system ant-build-system)
3799 (arguments
3800 `(#:build-target "jars"
3801 #:test-target "run.tests"
3802 #:phases
3803 (modify-phases %standard-phases
3804 (replace 'install (install-jars "build")))))
3805 (home-page "http://www.jmock.org")
3806 (synopsis "Mock object library for test-driven development")
3807 (description "JMock is a library that supports test-driven development of
3808Java code with mock objects. Mock objects help you design and test the
3809interactions between the objects in your programs.
3810
3811The jMock library
3812
3813@itemize
3814@item makes it quick and easy to define mock objects
3815@item lets you precisely specify the interactions between
3816 your objects, reducing the brittleness of your tests
3817@item plugs into your favourite test framework
3818@item is easy to extend.
3819@end itemize\n")
3820 (license license:bsd-3)))
3821
045124ae
JL
3822(define-public java-jmock
3823 (package
3824 (inherit java-jmock-1)
3825 (name "java-jmock")
3826 (version "2.8.2")
3827 (source (origin
3828 (method url-fetch)
3829 (uri (string-append "https://github.com/jmock-developers/"
3830 "jmock-library/archive/" version ".tar.gz"))
3831 (file-name (string-append name "-" version ".tar.gz"))
3832 (sha256
3833 (base32
3834 "18650a9g8xffcsdb6w91pbswa7f40fp2sh6s3nclkclz5dbzq8f0"))))
3835 (inputs
3836 `(("java-hamcrest-all" ,java-hamcrest-all)
3837 ("java-asm" ,java-asm)
3838 ("java-bsh" ,java-bsh)
3839 ("java-junit" ,java-junit)))
3840 (native-inputs
3841 `(("cglib" ,java-cglib)))
3842 (arguments
3843 `(#:jar-name "java-jmock.jar"
3844 #:source-dir "jmock/src/main/java"
3845 #:test-dir "jmock/src/test"))))
3846
25436c6d
JL
3847(define-public java-jmock-junit4
3848 (package
3849 (inherit java-jmock)
3850 (name "java-jmock-junit4")
3851 (arguments
3852 `(#:jar-name "java-jmock-junit4.jar"
3853 #:source-dir "jmock-junit4/src/main/java"
3854 #:test-dir "jmock-junit4/src/test"))
3855 (inputs
3856 `(("java-hamcrest-all" ,java-hamcrest-all)
3857 ("java-asm" ,java-asm)
3858 ("java-bsh" ,java-bsh)
3859 ("java-jmock" ,java-jmock)
3860 ("java-jumit" ,java-junit)))))
3861
e84b899d
JL
3862(define-public java-jmock-legacy
3863 (package
3864 (inherit java-jmock)
3865 (name "java-jmock-legacy")
3866 (arguments
3867 `(#:jar-name "java-jmock-legacy.jar"
3868 #:source-dir "jmock-legacy/src/main/java"
3869 #:test-dir "jmock-legacy/src/test"
3870 #:phases
3871 (modify-phases %standard-phases
3872 (add-before 'check 'copy-tests
3873 (lambda _
3874 ;; This file is a dependancy of some tests
3875 (let ((file "org/jmock/test/acceptance/PackageProtectedType.java"))
3876 (copy-file (string-append "jmock/src/test/java/" file)
3877 (string-append "jmock-legacy/src/test/java/" file))
3878 #t))))))
3879 (inputs
3880 `(("java-hamcrest-all" ,java-hamcrest-all)
3881 ("java-objenesis" ,java-objenesis)
3882 ("java-cglib" ,java-cglib)
3883 ("java-jmock" ,java-jmock)
3884 ("java-asm" ,java-asm)
3885 ("java-bsh" ,java-bsh)
3886 ("java-junit" ,java-junit)))
3887 (native-inputs
3888 `(("java-jmock-junit4" ,java-jmock-junit4)))))
3889
439c59da
RW
3890(define-public java-hamcrest-all
3891 (package (inherit java-hamcrest-core)
3892 (name "java-hamcrest-all")
3893 (arguments
bfc007e1
RW
3894 `(#:jdk ,icedtea-8
3895 ,@(substitute-keyword-arguments (package-arguments java-hamcrest-core)
3896 ((#:build-target _) "bigjar")
3897 ((#:phases phases)
3898 `(modify-phases ,phases
3899 ;; Some build targets override the classpath, so we need to patch
3900 ;; the build.xml to ensure that required dependencies are on the
3901 ;; classpath.
3902 (add-after 'unpack 'patch-classpath-for-integration
3903 (lambda* (#:key inputs #:allow-other-keys)
3904 (substitute* "build.xml"
3905 ((" build/hamcrest-library-\\$\\{version\\}.jar" line)
3906 (string-join
3907 (cons line
3908 (append
3909 (find-files (assoc-ref inputs "java-junit") "\\.jar$")
3910 (find-files (assoc-ref inputs "java-jmock") "\\.jar$")
3911 (find-files (assoc-ref inputs "java-easymock") "\\.jar$")))
3912 ";")))
3913 #t)))))))
439c59da
RW
3914 (inputs
3915 `(("java-junit" ,java-junit)
3916 ("java-jmock" ,java-jmock-1)
3917 ("java-easymock" ,java-easymock)
439c59da
RW
3918 ,@(package-inputs java-hamcrest-core)))))
3919
7aa37023
RW
3920(define-public java-jopt-simple
3921 (package
3922 (name "java-jopt-simple")
3923 (version "5.0.3")
3924 (source (origin
3925 (method url-fetch)
3926 (uri (string-append "http://repo1.maven.org/maven2/"
3927 "net/sf/jopt-simple/jopt-simple/"
3928 version "/jopt-simple-"
3929 version "-sources.jar"))
3930 (sha256
3931 (base32
3932 "1v8bzmwmw6qq20gm42xyay6vrd567dra4vqwhgjnqqjz1gs9f8qa"))))
3933 (build-system ant-build-system)
3934 (arguments
3935 `(#:tests? #f ; there are no tests
3936 #:jar-name "jopt-simple.jar"))
3937 (home-page "https://pholser.github.io/jopt-simple/")
3938 (synopsis "Java library for parsing command line options")
3939 (description "JOpt Simple is a Java library for parsing command line
3940options, such as those you might pass to an invocation of @code{javac}. In
3941the interest of striving for simplicity, as closely as possible JOpt Simple
3942attempts to honor the command line option syntaxes of POSIX @code{getopt} and
3943GNU @code{getopt_long}. It also aims to make option parser configuration and
3944retrieval of options and their arguments simple and expressive, without being
3945overly clever.")
3946 (license license:expat)))
840969e8
RW
3947
3948(define-public java-commons-math3
3949 (package
3950 (name "java-commons-math3")
3951 (version "3.6.1")
3952 (source (origin
3953 (method url-fetch)
3954 (uri (string-append "mirror://apache/commons/math/source/"
3955 "commons-math3-" version "-src.tar.gz"))
3956 (sha256
3957 (base32
3958 "19l6yp44qc5g7wg816nbn5z3zq3xxzwimvbm4a8pczgvpi4i85s6"))))
3959 (build-system ant-build-system)
3960 (arguments
3961 `(#:build-target "jar"
3962 #:test-target "test"
3963 #:make-flags
3964 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
3965 (junit (assoc-ref %build-inputs "java-junit")))
3966 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
3967 (string-append "-Dhamcrest.jar=" hamcrest
3968 "/share/java/hamcrest-core.jar")))
3969 #:phases
3970 (modify-phases %standard-phases
3971 ;; We want to build the jar in the build phase and run the tests
3972 ;; later in a separate phase.
3973 (add-after 'unpack 'untangle-targets
3974 (lambda _
3975 (substitute* "build.xml"
3976 (("name=\"jar\" depends=\"test\"")
3977 "name=\"jar\" depends=\"compile\""))
3978 #t))
3979 ;; There is no install target.
3980 (replace 'install
3981 (install-jars "target")))))
3982 (native-inputs
3983 `(("java-junit" ,java-junit)
3984 ("java-hamcrest-core" ,java-hamcrest-core)))
3985 (home-page "http://commons.apache.org/math/")
3986 (synopsis "Apache Commons mathematics library")
3987 (description "Commons Math is a library of lightweight, self-contained
3988mathematics and statistics components addressing the most common problems not
3989available in the Java programming language or Commons Lang.")
3990 (license license:asl2.0)))
62c9bfaa
RW
3991
3992(define-public java-jmh
3993 (package
3994 (name "java-jmh")
3995 (version "1.17.5")
3996 (source (origin
3997 (method hg-fetch)
3998 (uri (hg-reference
3999 (url "http://hg.openjdk.java.net/code-tools/jmh/")
4000 (changeset version)))
4001 (file-name (string-append name "-" version "-checkout"))
4002 (sha256
4003 (base32
4004 "1fxyxhg9famwcg1prc4cgwb5wzyxqavn3cjm5vz8605xz7x5k084"))))
4005 (build-system ant-build-system)
4006 (arguments
4007 `(#:jar-name "jmh-core.jar"
4008 #:source-dir "jmh-core/src/main"
4009 #:test-dir "jmh-core/src/test"
4010 #:phases
4011 (modify-phases %standard-phases
4012 ;; This seems to be a bug in the JDK. It may not be necessary in
4013 ;; future versions of the JDK.
4014 (add-after 'unpack 'fix-bug
4015 (lambda _
4016 (with-directory-excursion
4017 "jmh-core/src/main/java/org/openjdk/jmh/runner/options"
4018 (substitute* '("IntegerValueConverter.java"
4019 "ThreadsValueConverter.java")
4020 (("public Class<Integer> valueType")
4021 "public Class<? extends Integer> valueType")))
4022 #t)))))
4023 (inputs
4024 `(("java-jopt-simple" ,java-jopt-simple)
4025 ("java-commons-math3" ,java-commons-math3)))
4026 (native-inputs
4027 `(("java-junit" ,java-junit)
4028 ("java-hamcrest-core" ,java-hamcrest-core)))
4029 (home-page "http://openjdk.java.net/projects/code-tools/jmh/")
4030 (synopsis "Benchmark harness for the JVM")
4031 (description "JMH is a Java harness for building, running, and analysing
4032nano/micro/milli/macro benchmarks written in Java and other languages
f4548394 4033targeting the JVM.")
62c9bfaa
RW
4034 ;; GPLv2 only
4035 (license license:gpl2)))
56ebb4e9
RW
4036
4037(define-public java-commons-collections4
4038 (package
4039 (name "java-commons-collections4")
4040 (version "4.1")
4041 (source (origin
4042 (method url-fetch)
4043 (uri (string-append "mirror://apache/commons/collections/source/"
4044 "commons-collections4-" version "-src.tar.gz"))
4045 (sha256
4046 (base32
4047 "1krfhvggympq4avk7gh6qafzf6b9ip6r1m4lmacikyx04039m0wl"))))
4048 (build-system ant-build-system)
4049 (arguments
4050 `(#:test-target "test"
4051 #:make-flags
4052 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
4053 (junit (assoc-ref %build-inputs "java-junit"))
4054 (easymock (assoc-ref %build-inputs "java-easymock")))
4055 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
4056 (string-append "-Dhamcrest.jar=" hamcrest
4057 "/share/java/hamcrest-core.jar")
4058 (string-append "-Deasymock.jar=" easymock
4059 "/share/java/easymock.jar")))
4060 #:phases
4061 (modify-phases %standard-phases
4062 (replace 'install
4063 (install-jars "target")))))
4064 (native-inputs
4065 `(("java-junit" ,java-junit)
4066 ("java-hamcrest-core" ,java-hamcrest-core)
4067 ("java-easymock" ,java-easymock)))
4068 (home-page "http://commons.apache.org/collections/")
4069 (synopsis "Collections framework")
4070 (description "The Java Collections Framework is the recognised standard
4071for collection handling in Java. Commons-Collections seek to build upon the
4072JDK classes by providing new interfaces, implementations and utilities. There
4073are many features, including:
4074
4075@itemize
4076@item @code{Bag} interface for collections that have a number of copies of
4077 each object
4078@item @code{BidiMap} interface for maps that can be looked up from value to
4079 key as well and key to value
4080@item @code{MapIterator} interface to provide simple and quick iteration over
4081 maps
4082@item Transforming decorators that alter each object as it is added to the
4083 collection
4084@item Composite collections that make multiple collections look like one
4085@item Ordered maps and sets that retain the order elements are added in,
4086 including an LRU based map
4087@item Reference map that allows keys and/or values to be garbage collected
4088 under close control
4089@item Many comparator implementations
4090@item Many iterator implementations
4091@item Adapter classes from array and enumerations to collections
4092@item Utilities to test or create typical set-theory properties of collections
4093 such as union, intersection, and closure.
4094@end itemize\n")
4095 (license license:asl2.0)))
6af63e65 4096
229a9864
JL
4097(define-public java-commons-collections
4098 (package
4099 (inherit java-commons-collections4)
4100 (name "java-commons-collections")
4101 (version "3.2.2")
4102 (source (origin
4103 (method url-fetch)
4104 (uri (string-append "mirror://apache/commons/collections/source/"
4105 "commons-collections-" version "-src.tar.gz"))
4106 (sha256
4107 (base32
4108 "055r51a5lfc3z7rkxnxmnn1npvkvda7636hjpm4qk7cnfzz98387"))))
4109 (arguments
4110 (substitute-keyword-arguments (package-arguments java-commons-collections4)
4111 ((#:phases phases)
4112 `(modify-phases ,phases
4113 ;; The manifest is required by the build procedure
4114 (add-before 'build 'add-manifest
4115 (lambda _
4116 (mkdir-p "build/conf")
4117 (call-with-output-file "build/conf/MANIFEST.MF"
4118 (lambda (file)
4119 (format file "Manifest-Version: 1.0\n")))))
4120 (replace 'install
4121 (install-jars "build"))))))))
4122
5aa2f3f4
JL
4123(define java-commons-collections-test-classes
4124 (package
4125 (inherit java-commons-collections)
4126 (arguments
4127 `(#:jar-name "commons-collections-test-classes.jar"
4128 #:source-dir "src/test"
4129 #:tests? #f))
4130 (inputs
4131 `(("collection" ,java-commons-collections)))))
4132
4133(define-public java-commons-beanutils
4134 (package
4135 (name "java-commons-beanutils")
4136 (version "1.9.3")
4137 (source (origin
4138 (method url-fetch)
4139 (uri (string-append "mirror://apache/commons/beanutils/source/"
4140 "commons-beanutils-" version "-src.tar.gz"))
4141 (sha256
4142 (base32
4143 "03cs0bq3sl1sdc7py9g3qnf8n9h473nrkvd3d251kaqv6a2ab7qk"))))
4144 (build-system ant-build-system)
4145 (arguments
4146 `(#:test-target "test"
4147 #:tests? #f
4148 #:phases
4149 (modify-phases %standard-phases
4150 (replace 'install
4151 (lambda* (#:key outputs #:allow-other-keys)
4152 (rename-file (string-append "dist/commons-beanutils-" ,version
4153 "-SNAPSHOT.jar")
4154 "commons-beanutils.jar")
4155 (install-file "commons-beanutils.jar"
4156 (string-append (assoc-ref outputs "out") "/share/java/"))
4157 #t)))))
4158 (inputs
4159 `(("logging" ,java-commons-logging-minimal)
4160 ("collections" ,java-commons-collections)))
4161 (native-inputs
4162 `(("junit" ,java-junit)
4163 ("collections-test" ,java-commons-collections-test-classes)))
4164 (home-page "http://commons.apache.org/beanutils/")
4165 (synopsis "Dynamically set or get properties in Java")
4166 (description "BeanUtils provides a simplified interface to reflection and
4167introspection to set or get dynamically determined properties through their
4168setter and getter method.")
4169 (license license:asl2.0)))
4170
6af63e65
HG
4171(define-public java-commons-io
4172 (package
4173 (name "java-commons-io")
4174 (version "2.5")
4175 (source
4176 (origin
4177 (method url-fetch)
4178 (uri (string-append "mirror://apache/commons/io/source/"
4179 "commons-io-" version "-src.tar.gz"))
4180 (sha256
4181 (base32
4182 "0q5y41jrcjvx9hzs47x5kdhnasdy6rm4bzqd2jxl02w717m7a7v3"))))
4183 (build-system ant-build-system)
4184 (outputs '("out" "doc"))
4185 (arguments
4186 `(#:test-target "test"
4187 #:make-flags
4188 (list (string-append "-Djunit.jar="
4189 (assoc-ref %build-inputs "java-junit")
4190 "/share/java/junit.jar"))
4191 #:phases
4192 (modify-phases %standard-phases
4193 (add-after 'build 'build-javadoc ant-build-javadoc)
4194 (replace 'install (install-jars "target"))
4195 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
4196 (native-inputs
4197 `(("java-junit" ,java-junit)
4198 ("java-hamcrest-core" ,java-hamcrest-core)))
4199 (home-page "http://commons.apache.org/io/")
4200 (synopsis "Common useful IO related classes")
4201 (description "Commons-IO contains utility classes, stream implementations,
4202file filters and endian classes.")
4203 (license license:asl2.0)))
d631b5f3
HG
4204
4205(define-public java-commons-lang
4206 (package
4207 (name "java-commons-lang")
4208 (version "2.6")
4209 (source
4210 (origin
4211 (method url-fetch)
4212 (uri (string-append "mirror://apache/commons/lang/source/"
4213 "commons-lang-" version "-src.tar.gz"))
4214 (sha256
4215 (base32 "1mxwagqadzx1b2al7i0z1v0r235aj2njdyijf02szq0vhmqrfiq5"))))
4216 (build-system ant-build-system)
4217 (outputs '("out" "doc"))
4218 (arguments
4219 `(#:test-target "test"
e5a96113 4220 #:test-exclude (list "**/Abstract*.java" "**/Random*.java")
d631b5f3
HG
4221 #:phases
4222 (modify-phases %standard-phases
4223 (add-after 'build 'build-javadoc ant-build-javadoc)
4224 (add-before 'check 'disable-failing-test
4225 (lambda _
4226 ;; Disable a failing test
4227 (substitute* "src/test/java/org/apache/commons/lang/\
4228time/FastDateFormatTest.java"
4229 (("public void testFormat\\(\\)")
4230 "public void disabled_testFormat()"))
4231 #t))
4232 (replace 'install (install-jars "target"))
4233 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
4234 (native-inputs
4235 `(("java-junit" ,java-junit)))
4236 (home-page "http://commons.apache.org/lang/")
4237 (synopsis "Extension of the java.lang package")
4238 (description "The Commons Lang components contains a set of Java classes
4239that provide helper methods for standard Java classes, especially those found
4240in the @code{java.lang} package in the Sun JDK. The following classes are
4241included:
4242
4243@itemize
4244@item StringUtils - Helper for @code{java.lang.String}.
4245@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets
4246 of characters such as @code{[a-z]} and @code{[abcdez]}.
4247@item RandomStringUtils - Helper for creating randomised strings.
4248@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
4249@item NumberRange - A range of numbers with an upper and lower bound.
4250@item ObjectUtils - Helper for @code{java.lang.Object}.
4251@item SerializationUtils - Helper for serializing objects.
4252@item SystemUtils - Utility class defining the Java system properties.
4253@item NestedException package - A sub-package for the creation of nested
4254 exceptions.
4255@item Enum package - A sub-package for the creation of enumerated types.
4256@item Builder package - A sub-package for the creation of @code{equals},
4257 @code{hashCode}, @code{compareTo} and @code{toString} methods.
4258@end itemize\n")
4259 (license license:asl2.0)))
82e18864
HG
4260
4261(define-public java-commons-lang3
4262 (package
4263 (name "java-commons-lang3")
4264 (version "3.4")
4265 (source
4266 (origin
4267 (method url-fetch)
4268 (uri (string-append "mirror://apache/commons/lang/source/"
4269 "commons-lang3-" version "-src.tar.gz"))
4270 (sha256
4271 (base32 "0xpshb9spjhplq5a7mr0y1bgfw8190ik4xj8f569xidfcki1d6kg"))))
4272 (build-system ant-build-system)
4273 (outputs '("out" "doc"))
4274 (arguments
4275 `(#:test-target "test"
4276 #:make-flags
4277 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-all"))
4278 (junit (assoc-ref %build-inputs "java-junit"))
4279 (easymock (assoc-ref %build-inputs "java-easymock"))
4280 (io (assoc-ref %build-inputs "java-commons-io")))
4281 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
4282 (string-append "-Dhamcrest.jar=" hamcrest
4283 "/share/java/hamcrest-all.jar")
4284 (string-append "-Dcommons-io.jar=" io
4285 "/share/java/commons-io-"
4286 ,(package-version java-commons-io)
4287 "-SNAPSHOT.jar")
4288 (string-append "-Deasymock.jar=" easymock
4289 "/share/java/easymock.jar")))
4290 #:phases
4291 (modify-phases %standard-phases
4292 (add-after 'build 'build-javadoc ant-build-javadoc)
4293 (replace 'install (install-jars "target"))
4294 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
4295 (native-inputs
4296 `(("java-junit" ,java-junit)
4297 ("java-commons-io" ,java-commons-io)
4298 ("java-hamcrest-all" ,java-hamcrest-all)
4299 ("java-easymock" ,java-easymock)))
4300 (home-page "http://commons.apache.org/lang/")
4301 (synopsis "Extension of the java.lang package")
4302 (description "The Commons Lang components contains a set of Java classes
4303that provide helper methods for standard Java classes, especially those found
4304in the @code{java.lang} package. The following classes are included:
4305
4306@itemize
4307@item StringUtils - Helper for @code{java.lang.String}.
4308@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets of
4309 characters such as @code{[a-z]} and @code{[abcdez]}.
4310@item RandomStringUtils - Helper for creating randomised strings.
4311@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
4312@item NumberRange - A range of numbers with an upper and lower bound.
4313@item ObjectUtils - Helper for @code{java.lang.Object}.
4314@item SerializationUtils - Helper for serializing objects.
4315@item SystemUtils - Utility class defining the Java system properties.
4316@item NestedException package - A sub-package for the creation of nested
4317 exceptions.
4318@item Enum package - A sub-package for the creation of enumerated types.
4319@item Builder package - A sub-package for the creation of @code{equals},
4320 @code{hashCode}, @code{compareTo} and @code{toString} methods.
4321@end itemize\n")
4322 (license license:asl2.0)))
1c188f4e 4323
0d4a0d60
RW
4324(define-public java-jsr305
4325 (package
4326 (name "java-jsr305")
4327 (version "3.0.1")
4328 (source (origin
4329 (method url-fetch)
4330 (uri (string-append "https://repo1.maven.org/maven2/"
4331 "com/google/code/findbugs/"
4332 "jsr305/" version "/jsr305-"
4333 version "-sources.jar"))
4334 (sha256
4335 (base32
4336 "1rh6jin9v7jqpq3kf1swl868l8i94r636n03pzpsmgr8v0lh9j2n"))))
4337 (build-system ant-build-system)
4338 (arguments
4339 `(#:tests? #f ; no tests included
4340 #:jar-name "jsr305.jar"))
4341 (home-page "http://findbugs.sourceforge.net/")
4342 (synopsis "Annotations for the static analyzer called findbugs")
4343 (description "This package provides annotations for the findbugs package.
4344It provides packages in the @code{javax.annotations} namespace.")
4345 (license license:asl2.0)))
4346
4f3e47ea
RW
4347(define-public java-guava
4348 (package
4349 (name "java-guava")
4350 ;; This is the last release of Guava that can be built with Java 7.
4351 (version "20.0")
4352 (source (origin
4353 (method url-fetch)
4354 (uri (string-append "https://github.com/google/guava/"
4355 "releases/download/v" version
4356 "/guava-" version "-sources.jar"))
4357 (sha256
4358 (base32
4359 "1gawrs5gi6j5hcfxdgpnfli75vb9pfi4sn09pnc8xacr669yajwr"))))
4360 (build-system ant-build-system)
4361 (arguments
4362 `(#:tests? #f ; no tests included
4363 #:jar-name "guava.jar"
4364 #:phases
4365 (modify-phases %standard-phases
4366 (add-after 'unpack 'trim-sources
4367 (lambda _
4368 (with-directory-excursion "src/com/google/common"
4369 ;; Remove annotations to avoid extra dependencies:
4370 ;; * "j2objc" annotations are used when converting Java to
4371 ;; Objective C;
4372 ;; * "errorprone" annotations catch common Java mistakes at
4373 ;; compile time;
4374 ;; * "IgnoreJRERequirement" is used for Android.
4375 (substitute* (find-files "." "\\.java$")
4376 (("import com.google.j2objc.*") "")
4377 (("import com.google.errorprone.annotation.*") "")
4378 (("import org.codehaus.mojo.animal_sniffer.*") "")
4379 (("@CanIgnoreReturnValue") "")
4380 (("@LazyInit") "")
4381 (("@WeakOuter") "")
4382 (("@RetainedWith") "")
4383 (("@Weak") "")
4384 (("@ForOverride") "")
4385 (("@J2ObjCIncompatible") "")
4386 (("@IgnoreJRERequirement") "")))
4387 #t)))))
4388 (inputs
4389 `(("java-jsr305" ,java-jsr305)))
4390 (home-page "https://github.com/google/guava")
4391 (synopsis "Google core libraries for Java")
4392 (description "Guava is a set of core libraries that includes new
4393collection types (such as multimap and multiset), immutable collections, a
4394graph library, functional types, an in-memory cache, and APIs/utilities for
4395concurrency, I/O, hashing, primitives, reflection, string processing, and much
4396more!")
4397 (license license:asl2.0)))
4398
af8f8281
RW
4399;; The java-commons-logging package provides adapters to many different
4400;; logging frameworks. To avoid an excessive dependency graph we try to build
4401;; it with only a minimal set of adapters.
4402(define-public java-commons-logging-minimal
4403 (package
4404 (name "java-commons-logging-minimal")
4405 (version "1.2")
4406 (source (origin
4407 (method url-fetch)
4408 (uri (string-append "mirror://apache/commons/logging/source/"
4409 "commons-logging-" version "-src.tar.gz"))
4410 (sha256
4411 (base32
4412 "10bwcy5w8d7y39n0krlwhnp8ds3kj5zhmzj0zxnkw0qdlsjmsrj9"))))
4413 (build-system ant-build-system)
4414 (arguments
4415 `(#:tests? #f ; avoid dependency on logging frameworks
4416 #:jar-name "commons-logging-minimal.jar"
4417 #:phases
4418 (modify-phases %standard-phases
4419 (add-after 'unpack 'delete-adapters-and-tests
4420 (lambda _
4421 ;; Delete all adapters except for NoOpLog, SimpleLog, and
4422 ;; LogFactoryImpl. NoOpLog is required to build; LogFactoryImpl
4423 ;; is used by applications; SimpleLog is the only actually usable
4424 ;; implementation that does not depend on another logging
4425 ;; framework.
4426 (for-each
4427 (lambda (file)
4428 (delete-file (string-append
4429 "src/main/java/org/apache/commons/logging/impl/" file)))
4430 (list "Jdk13LumberjackLogger.java"
4431 "WeakHashtable.java"
4432 "Log4JLogger.java"
4433 "ServletContextCleaner.java"
4434 "Jdk14Logger.java"
4435 "AvalonLogger.java"
4436 "LogKitLogger.java"))
4437 (delete-file-recursively "src/test")
4438 #t)))))
4439 (home-page "http://commons.apache.org/logging/")
4440 (synopsis "Common API for logging implementations")
4441 (description "The Logging package is a thin bridge between different
4442logging implementations. A library that uses the commons-logging API can be
4443used with any logging implementation at runtime.")
4444 (license license:asl2.0)))
4445
90e65abe
RW
4446;; This is the last release of the 1.x series.
4447(define-public java-mockito-1
4448 (package
4449 (name "java-mockito")
4450 (version "1.10.19")
4451 (source (origin
4452 (method url-fetch)
4453 (uri (string-append "http://repo1.maven.org/maven2/"
4454 "org/mockito/mockito-core/" version
4455 "/mockito-core-" version "-sources.jar"))
4456 (sha256
4457 (base32
4458 "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc"))))
4459 (build-system ant-build-system)
4460 (arguments
4461 `(#:jar-name "mockito.jar"
4462 #:tests? #f ; no tests included
4463 ;; FIXME: patch-and-repack does not support jars, so we have to apply
4464 ;; patches in build phases.
4465 #:phases
4466 (modify-phases %standard-phases
4467 ;; Mockito was developed against a different version of hamcrest,
4468 ;; which does not require matcher implementations to provide an
4469 ;; implementation of the "describeMismatch" method. We add this
4470 ;; simple definition to pass the build with our version of hamcrest.
4471 (add-after 'unpack 'fix-hamcrest-build-error
4472 (lambda _
4473 (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java"
4474 (("public Matcher getActualMatcher\\(\\) .*" line)
4475 (string-append "
4476 public void describeMismatch(Object item, Description description) {
4477 actualMatcher.describeMismatch(item, description);
4478 }"
4479 line)))
4480 #t))
4481 ;; Mockito bundles cglib. We have a cglib package, so let's use
4482 ;; that instead.
4483 (add-after 'unpack 'use-system-libraries
4484 (lambda _
4485 (with-directory-excursion "src/org/mockito/internal/creation/cglib"
4486 (substitute* '("CGLIBHacker.java"
4487 "CglibMockMaker.java"
4488 "ClassImposterizer.java"
4489 "DelegatingMockitoMethodProxy.java"
4490 "MethodInterceptorFilter.java"
4491 "MockitoNamingPolicy.java"
4492 "SerializableMockitoMethodProxy.java"
4493 "SerializableNoOp.java")
4494 (("import org.mockito.cglib") "import net.sf.cglib")))
4495 #t)))))
4496 (inputs
4497 `(("java-junit" ,java-junit)
4498 ("java-objenesis" ,java-objenesis)
4499 ("java-cglib" ,java-cglib)
4500 ("java-hamcrest-core" ,java-hamcrest-core)))
4501 (home-page "http://mockito.org")
4502 (synopsis "Mockito is a mock library for Java")
4503 (description "Mockito is a mocking library for Java which lets you write
4504tests with a clean and simple API. It generates mocks using reflection, and
4505it records all mock invocations, including methods arguments.")
4506 (license license:asl2.0)))
4507
4f4d2e47
RW
4508(define-public java-httpcomponents-httpcore
4509 (package
4510 (name "java-httpcomponents-httpcore")
4511 (version "4.4.6")
4512 (source (origin
4513 (method url-fetch)
4514 (uri (string-append "mirror://apache//httpcomponents/httpcore/"
4515 "source/httpcomponents-core-"
4516 version "-src.tar.gz"))
4517 (sha256
4518 (base32
4519 "02bwcf38y4vgwq7kj2s6q7qrmma641r5lacivm16kgxvb2j6h1vy"))))
4520 (build-system ant-build-system)
4521 (arguments
4522 `(#:jar-name "httpcomponents-httpcore.jar"
4523 #:phases
4524 (modify-phases %standard-phases
4525 (add-after 'unpack 'chdir
4526 (lambda _ (chdir "httpcore") #t)))))
4527 (inputs
4528 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
4529 ("java-commons-lang3" ,java-commons-lang3)))
4530 (native-inputs
4531 `(("java-junit" ,java-junit)
4532 ("java-mockito" ,java-mockito-1)))
4533 (home-page "https://hc.apache.org/httpcomponents-core-4.4.x/index.html")
4534 (synopsis "Low level HTTP transport components")
4535 (description "HttpCore is a set of low level HTTP transport components
4536that can be used to build custom client and server side HTTP services with a
4537minimal footprint. HttpCore supports two I/O models: blocking I/O model based
4538on the classic Java I/O and non-blocking, event driven I/O model based on Java
4539NIO.
4540
4541This package provides the blocking I/O model library.")
4542 (license license:asl2.0)))
4543
3a068b43
RW
4544(define-public java-httpcomponents-httpcore-nio
4545 (package (inherit java-httpcomponents-httpcore)
4546 (name "java-httpcomponents-httpcore-nio")
4547 (arguments
4548 `(#:jar-name "httpcomponents-httpcore-nio.jar"
4549 #:phases
4550 (modify-phases %standard-phases
4551 (add-after 'unpack 'chdir
4552 (lambda _ (chdir "httpcore-nio") #t)))))
4553 (inputs
4554 `(("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
4555 ("java-hamcrest-core" ,java-hamcrest-core)
4556 ,@(package-inputs java-httpcomponents-httpcore)))
4557 (description "HttpCore is a set of low level HTTP transport components
4558that can be used to build custom client and server side HTTP services with a
4559minimal footprint. HttpCore supports two I/O models: blocking I/O model based
4560on the classic Java I/O and non-blocking, event driven I/O model based on Java
4561NIO.
4562
4563This package provides the non-blocking I/O model library based on Java
4564NIO.")))
4565
e1dd78f6
RW
4566(define-public java-httpcomponents-httpcore-ab
4567 (package (inherit java-httpcomponents-httpcore)
4568 (name "java-httpcomponents-httpcore-ab")
4569 (arguments
4570 `(#:jar-name "httpcomponents-httpcore-ab.jar"
4571 #:phases
4572 (modify-phases %standard-phases
4573 (add-after 'unpack 'chdir
4574 (lambda _ (chdir "httpcore-ab") #t)))))
4575 (inputs
4576 `(("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
4577 ("java-commons-cli" ,java-commons-cli)
4578 ("java-hamcrest-core" ,java-hamcrest-core)
4579 ,@(package-inputs java-httpcomponents-httpcore)))
4580 (synopsis "Apache HttpCore benchmarking tool")
4581 (description "This package provides the HttpCore benchmarking tool. It is
4582an Apache AB clone based on HttpCore.")))
4583
14a671d8
RW
4584(define-public java-httpcomponents-httpclient
4585 (package
4586 (name "java-httpcomponents-httpclient")
4587 (version "4.5.3")
4588 (source (origin
4589 (method url-fetch)
4590 (uri (string-append "mirror://apache/httpcomponents/httpclient/"
4591 "source/httpcomponents-client-"
4592 version "-src.tar.gz"))
4593 (sha256
4594 (base32
4595 "1428399s7qy3cim5wc6f3ks4gl9nf9vkjpfmnlap3jflif7g2pj1"))))
4596 (build-system ant-build-system)
4597 (arguments
4598 `(#:jar-name "httpcomponents-httpclient.jar"
4599 #:phases
4600 (modify-phases %standard-phases
4601 (add-after 'unpack 'chdir
4602 (lambda _ (chdir "httpclient") #t)))))
4603 (inputs
4604 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
4605 ("java-commons-codec" ,java-commons-codec)
4606 ("java-hamcrest-core" ,java-hamcrest-core)
4607 ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
4608 ("java-mockito" ,java-mockito-1)
4609 ("java-junit" ,java-junit)))
4610 (home-page "https://hc.apache.org/httpcomponents-client-ga/")
4611 (synopsis "HTTP client library for Java")
4612 (description "Although the @code{java.net} package provides basic
4613functionality for accessing resources via HTTP, it doesn't provide the full
4614flexibility or functionality needed by many applications. @code{HttpClient}
4615seeks to fill this void by providing an efficient, up-to-date, and
4616feature-rich package implementing the client side of the most recent HTTP
4617standards and recommendations.")
4618 (license license:asl2.0)))
4619
cbce5de2
RW
4620(define-public java-httpcomponents-httpmime
4621 (package (inherit java-httpcomponents-httpclient)
4622 (name "java-httpcomponents-httpmime")
4623 (arguments
4624 `(#:jar-name "httpcomponents-httpmime.jar"
4625 #:phases
4626 (modify-phases %standard-phases
4627 (add-after 'unpack 'chdir
4628 (lambda _ (chdir "httpmime") #t)))))
4629 (inputs
4630 `(("java-httpcomponents-httpclient" ,java-httpcomponents-httpclient)
4631 ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
4632 ("java-junit" ,java-junit)
4633 ("java-hamcrest-core" ,java-hamcrest-core)))))
4634
4b34c21f
RW
4635(define-public java-commons-net
4636 (package
4637 (name "java-commons-net")
4638 (version "3.6")
4639 (source (origin
4640 (method url-fetch)
4641 (uri (string-append "mirror://apache/commons/net/source/"
4642 "commons-net-" version "-src.tar.gz"))
4643 (sha256
4644 (base32
4645 "0n0cmnddk9qdqhjvka8pc6hd9mn2qi3166f1s6xk32h7rfy1adxr"))))
4646 (build-system ant-build-system)
4647 (arguments
4648 `(;; FIXME: MainTest.java tries to read "examples.properties" (which
4649 ;; should be "resources/examples/examples.properties"), but gets "null"
4650 ;; instead.
4651 #:tests? #f
4652 #:jar-name "commons-net.jar"))
4653 (native-inputs
4654 `(("java-junit" ,java-junit)
4655 ("java-hamcrest-core" ,java-hamcrest-core)))
4656 (home-page "http://commons.apache.org/net/")
4657 (synopsis "Client library for many basic Internet protocols")
4658 (description "The Apache Commons Net library implements the client side of
4659many basic Internet protocols. The purpose of the library is to provide
4660fundamental protocol access, not higher-level abstractions.")
4661 (license license:asl2.0)))
4662
808cb58f
RW
4663(define-public java-jsch
4664 (package
4665 (name "java-jsch")
4666 (version "0.1.54")
4667 (source (origin
4668 (method url-fetch)
4669 (uri (string-append "mirror://sourceforge/jsch/jsch/"
4670 version "/jsch-" version ".zip"))
4671 (sha256
4672 (base32
4673 "029rdddyq1mh3ghryh3ki99kba1xkf1d1swjv2vi6lk6zzjy2wdb"))))
4674 (build-system ant-build-system)
4675 (arguments
4676 `(#:build-target "dist"
4677 #:tests? #f ; no tests included
4678 #:phases
4679 (modify-phases %standard-phases
4680 (replace 'install (install-jars "dist")))))
4681 (native-inputs
4682 `(("unzip" ,unzip)))
4683 (home-page "http://www.jcraft.com/jsch/")
4684 (synopsis "Pure Java implementation of SSH2")
4685 (description "JSch is a pure Java implementation of SSH2. JSch allows you
4686to connect to an SSH server and use port forwarding, X11 forwarding, file
4687transfer, etc., and you can integrate its functionality into your own Java
4688programs.")
4689 (license license:bsd-3)))
4690
a6244698
RW
4691(define-public java-commons-compress
4692 (package
4693 (name "java-commons-compress")
4694 (version "1.13")
4695 (source (origin
4696 (method url-fetch)
4697 (uri (string-append "mirror://apache/commons/compress/source/"
4698 "commons-compress-" version "-src.tar.gz"))
4699 (sha256
4700 (base32
4701 "1vjqvavrn0babffn1kciz6v52ibwq2vwhzlb95hazis3lgllnxc8"))))
4702 (build-system ant-build-system)
4703 (arguments
4704 `(#:jar-name "commons-compress.jar"
4705 #:phases
4706 (modify-phases %standard-phases
4707 (add-after 'unpack 'delete-bad-tests
4708 (lambda _
4709 (with-directory-excursion "src/test/java/org/apache/commons/compress/"
4710 ;; FIXME: These tests really should not fail. Maybe they are
4711 ;; indicative of problems with our Java packaging work.
4712
4713 ;; This test fails with a null pointer exception.
4714 (delete-file "archivers/sevenz/SevenZOutputFileTest.java")
4715 ;; This test fails to open test resources.
4716 (delete-file "archivers/zip/ExplodeSupportTest.java")
4717
4718 ;; FIXME: This test adds a dependency on powermock, which is hard to
4719 ;; package at this point.
4720 ;; https://github.com/powermock/powermock
4721 (delete-file "archivers/sevenz/SevenZNativeHeapTest.java"))
4722 #t)))))
4723 (inputs
4724 `(("java-junit" ,java-junit)
4725 ("java-hamcrest-core" ,java-hamcrest-core)
4726 ("java-mockito" ,java-mockito-1)
4727 ("java-xz" ,java-xz)))
4728 (home-page "https://commons.apache.org/proper/commons-compress/")
4729 (synopsis "Java library for working with compressed files")
4730 (description "The Apache Commons Compress library defines an API for
4731working with compressed files such as ar, cpio, Unix dump, tar, zip, gzip, XZ,
4732Pack200, bzip2, 7z, arj, lzma, snappy, DEFLATE, lz4 and Z files.")
4733 (license license:asl2.0)))
4734
51263ff5
JL
4735(define-public java-commons-csv
4736 (package
4737 (name "java-commons-csv")
4738 (version "1.4")
4739 (source (origin
4740 (method url-fetch)
4741 (uri (string-append "mirror://apache/commons/csv/source/"
4742 "commons-csv-" version "-src.tar.gz"))
4743 (sha256
4744 (base32
4745 "1l89m0fm2s3xx3v3iynvangymfg2vlyngaj6fgsi457nmsw7m7ij"))))
4746 (build-system ant-build-system)
4747 (arguments
4748 `(#:jar-name "commons-csv.jar"
4749 #:source-dir "src/main/java"
4750 #:tests? #f)); FIXME: requires java-h2
4751 (inputs
4752 `(("java-hamcrest-core" ,java-hamcrest-core)
4753 ("java-commons-io" ,java-commons-io)
4754 ("java-commons-lang3" ,java-commons-lang3)
4755 ("junit" ,java-junit)))
4756 (home-page "https://commons.apache.org/proper/commons-csv/")
4757 (synopsis "Read and write CSV documents")
4758 (description "Commons CSV reads and writes files in variations of the Comma
4759Separated Value (CSV) format. The most common CSV formats are predefined in the
4760CSVFormat class:
4761
4762@itemize
4763@item Microsoft Excel
4764@item Informix UNLOAD
4765@item Informix UNLOAD CSV
4766@item MySQL
4767@item RFC 4180
4768@item TDF
4769@end itemize
4770
4771Custom formats can be created using a fluent style API.")
4772 (license license:asl2.0)))
4773
6ee6d0b5
RW
4774(define-public java-osgi-annotation
4775 (package
4776 (name "java-osgi-annotation")
4777 (version "6.0.0")
4778 (source (origin
4779 (method url-fetch)
4780 (uri (string-append "https://repo1.maven.org/maven2/"
4781 "org/osgi/org.osgi.annotation/" version "/"
4782 "org.osgi.annotation-" version "-sources.jar"))
4783 (sha256
4784 (base32
4785 "1q718mb7gqg726rh6pc2hcisn8v50nv35abbir0jypmffhiii85w"))))
4786 (build-system ant-build-system)
4787 (arguments
4788 `(#:tests? #f ; no tests
4789 #:jar-name "osgi-annotation.jar"))
c353d014 4790 (home-page "https://www.osgi.org")
6ee6d0b5
RW
4791 (synopsis "Annotation module of OSGi framework")
4792 (description
4793 "OSGi, for Open Services Gateway initiative framework, is a module system
4794and service platform for the Java programming language. This package contains
4795the OSGi annotation module, providing additional services to help dynamic
4796components.")
4797 (license license:asl2.0)))
4798
37e2e5d4
RW
4799(define-public java-osgi-core
4800 (package
4801 (name "java-osgi-core")
4802 (version "6.0.0")
4803 (source (origin
4804 (method url-fetch)
4805 (uri (string-append "https://repo1.maven.org/maven2/"
4806 "org/osgi/org.osgi.core/" version "/"
4807 "org.osgi.core-" version "-sources.jar"))
4808 (sha256
4809 (base32
4810 "19bpf5jx32jq9789gyhin35q5v7flmw0p9mk7wbgqpxqfmxyiabv"))))
4811 (build-system ant-build-system)
4812 (arguments
4813 `(#:tests? #f ; no tests
4814 #:jar-name "osgi-core.jar"))
4815 (inputs
4816 `(("java-osgi-annotation" ,java-osgi-annotation)))
c353d014 4817 (home-page "https://www.osgi.org")
37e2e5d4
RW
4818 (synopsis "Core module of OSGi framework")
4819 (description
4820 "OSGi, for Open Services Gateway initiative framework, is a module system
4821and service platform for the Java programming language. This package contains
4822the OSGi Core module.")
4823 (license license:asl2.0)))
4824
8af92c8f
RW
4825(define-public java-osgi-service-event
4826 (package
4827 (name "java-osgi-service-event")
4828 (version "1.3.1")
4829 (source (origin
4830 (method url-fetch)
4831 (uri (string-append "https://repo1.maven.org/maven2/"
4832 "org/osgi/org.osgi.service.event/"
4833 version "/org.osgi.service.event-"
4834 version "-sources.jar"))
4835 (sha256
4836 (base32
4837 "1nyhlgagwym75bycnjczwbnpymv2iw84zbhvvzk84g9q736i6qxm"))))
4838 (build-system ant-build-system)
4839 (arguments
4840 `(#:tests? #f ; no tests
4841 #:jar-name "osgi-service-event.jar"))
4842 (inputs
4843 `(("java-osgi-annotation" ,java-osgi-annotation)
4844 ("java-osgi-core" ,java-osgi-core)))
c353d014 4845 (home-page "https://www.osgi.org")
8af92c8f
RW
4846 (synopsis "OSGi service event module")
4847 (description
4848 "OSGi, for Open Services Gateway initiative framework, is a module system
4849and service platform for the Java programming language. This package contains
4850the OSGi @code{org.osgi.service.event} module.")
4851 (license license:asl2.0)))
4852
674e93a0
RW
4853(define-public java-eclipse-osgi
4854 (package
4855 (name "java-eclipse-osgi")
4856 (version "3.11.3")
4857 (source (origin
4858 (method url-fetch)
4859 (uri (string-append "https://repo1.maven.org/maven2/"
4860 "org/eclipse/platform/org.eclipse.osgi/"
4861 version "/org.eclipse.osgi-"
4862 version "-sources.jar"))
4863 (sha256
4864 (base32
4865 "00cqc6lb29n0zv68b4l842vzkwawvbr7gshfdygsk8sicvcq2c7b"))))
4866 (build-system ant-build-system)
4867 (arguments
4868 `(#:tests? #f ; no tests included
4869 #:jar-name "eclipse-equinox-osgi.jar"))
4870 (inputs
4871 `(("java-osgi-annotation" ,java-osgi-annotation)))
4872 (home-page "http://www.eclipse.org/equinox/")
4873 (synopsis "Eclipse Equinox OSGi framework")
4874 (description "This package provides an implementation of the OSGi Core
4875specification.")
4876 (license license:epl1.0)))
4877
81b55b1e
RW
4878(define-public java-eclipse-equinox-common
4879 (package
4880 (name "java-eclipse-equinox-common")
4881 (version "3.8.0")
4882 (source (origin
4883 (method url-fetch)
4884 (uri (string-append "https://repo1.maven.org/maven2/"
4885 "org/eclipse/platform/org.eclipse.equinox.common/"
4886 version "/org.eclipse.equinox.common-"
4887 version "-sources.jar"))
4888 (sha256
4889 (base32
4890 "12aazpkgw46r1qj0pr421jzwhbmsizd97r37krd7njnbrdgfzksc"))))
4891 (build-system ant-build-system)
4892 (arguments
4893 `(#:tests? #f ; no tests included
4894 #:jar-name "eclipse-equinox-common.jar"))
4895 (inputs
4896 `(("java-eclipse-osgi" ,java-eclipse-osgi)))
4897 (home-page "http://www.eclipse.org/equinox/")
4898 (synopsis "Common Eclipse runtime")
4899 (description "This package provides the common Eclipse runtime.")
4900 (license license:epl1.0)))
4901
90368ad9
RW
4902(define-public java-eclipse-core-jobs
4903 (package
4904 (name "java-eclipse-core-jobs")
4905 (version "3.8.0")
4906 (source (origin
4907 (method url-fetch)
4908 (uri (string-append "https://repo1.maven.org/maven2/"
4909 "org/eclipse/platform/org.eclipse.core.jobs/"
4910 version "/org.eclipse.core.jobs-"
4911 version "-sources.jar"))
4912 (sha256
4913 (base32
4914 "0395b8lh0km8vhzjnchvs1rii1qz48hyvb2wqfaq4yhklbwihq4b"))))
4915 (build-system ant-build-system)
4916 (arguments
4917 `(#:tests? #f ; no tests included
4918 #:jar-name "eclipse-core-jobs.jar"))
4919 (inputs
4920 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4921 ("java-eclipse-osgi" ,java-eclipse-osgi)))
4922 (home-page "http://www.eclipse.org/equinox/")
4923 (synopsis "Eclipse jobs mechanism")
4924 (description "This package provides the Eclipse jobs mechanism.")
4925 (license license:epl1.0)))
4926
fbaf09eb
RW
4927(define-public java-eclipse-equinox-registry
4928 (package
4929 (name "java-eclipse-equinox-registry")
4930 (version "3.6.100")
4931 (source (origin
4932 (method url-fetch)
4933 (uri (string-append "https://repo1.maven.org/maven2/"
4934 "org/eclipse/platform/org.eclipse.equinox.registry/"
4935 version "/org.eclipse.equinox.registry-"
4936 version "-sources.jar"))
4937 (sha256
4938 (base32
4939 "1i9sgymh2fy5vdgk5y7s3qvrlbgh4l93ddqi3v4zmca7hwrlhf9k"))))
4940 (build-system ant-build-system)
4941 (arguments
4942 `(#:tests? #f ; no tests included
4943 #:jar-name "eclipse-equinox-registry.jar"))
4944 (inputs
4945 `(("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
4946 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4947 ("java-eclipse-osgi" ,java-eclipse-osgi)))
4948 (home-page "http://www.eclipse.org/equinox/")
4949 (synopsis "Eclipse extension registry support")
4950 (description "This package provides support for the Eclipse extension
4951registry.")
4952 (license license:epl1.0)))
4953
65214c87
RW
4954(define-public java-eclipse-equinox-app
4955 (package
4956 (name "java-eclipse-equinox-app")
4957 (version "1.3.400")
4958 (source (origin
4959 (method url-fetch)
4960 (uri (string-append "https://repo1.maven.org/maven2/"
4961 "org/eclipse/platform/org.eclipse.equinox.app/"
4962 version "/org.eclipse.equinox.app-"
4963 version "-sources.jar"))
4964 (sha256
4965 (base32
4966 "0nhvbp93y203ar7y59gb0mz3w2d3jlqhr0c9hii9bcfpmr7imdab"))))
4967 (build-system ant-build-system)
4968 (arguments
4969 `(#:tests? #f ; no tests included
4970 #:jar-name "eclipse-equinox-app.jar"))
4971 (inputs
4972 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
4973 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
4974 ("java-eclipse-osgi" ,java-eclipse-osgi)
4975 ("java-osgi-service-event" ,java-osgi-service-event)))
4976 (home-page "http://www.eclipse.org/equinox/")
4977 (synopsis "Equinox application container")
4978 (description "This package provides the Equinox application container for
4979Eclipse.")
4980 (license license:epl1.0)))
4981
3f970214
RW
4982(define-public java-eclipse-equinox-preferences
4983 (package
4984 (name "java-eclipse-equinox-preferences")
4985 (version "3.6.1")
4986 (source (origin
4987 (method url-fetch)
4988 (uri (string-append "https://repo1.maven.org/maven2/"
4989 "org/eclipse/platform/org.eclipse.equinox.preferences/"
4990 version "/org.eclipse.equinox.preferences-"
4991 version "-sources.jar"))
4992 (sha256
4993 (base32
4994 "0k7w6c141sqym4fy3af0qkwpy4pdh2vsjpjba6rp5fxyqa24v0a2"))))
4995 (build-system ant-build-system)
4996 (arguments
4997 `(#:tests? #f ; no tests included
4998 #:jar-name "eclipse-equinox-preferences.jar"))
4999 (inputs
5000 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5001 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5002 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5003 (home-page "http://www.eclipse.org/equinox/")
5004 (synopsis "Eclipse preferences mechanism")
5005 (description "This package provides the Eclipse preferences mechanism with
5006the module @code{org.eclipse.equinox.preferences}.")
5007 (license license:epl1.0)))
5008
4ad3d4f3
RW
5009(define-public java-eclipse-core-contenttype
5010 (package
5011 (name "java-eclipse-core-contenttype")
5012 (version "3.5.100")
5013 (source (origin
5014 (method url-fetch)
5015 (uri (string-append "https://repo1.maven.org/maven2/"
5016 "org/eclipse/platform/org.eclipse.core.contenttype/"
5017 version "/org.eclipse.core.contenttype-"
5018 version "-sources.jar"))
5019 (sha256
5020 (base32
5021 "1wcqcv7ijwv5rh748vz3x9pkmjl9w1r0k0026k56n8yjl4rrmspi"))))
5022 (build-system ant-build-system)
5023 (arguments
5024 `(#:tests? #f ; no tests included
5025 #:jar-name "eclipse-core-contenttype.jar"))
5026 (inputs
5027 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5028 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5029 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5030 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5031 (home-page "http://www.eclipse.org/")
5032 (synopsis "Eclipse content mechanism")
5033 (description "This package provides the Eclipse content mechanism in the
5034@code{org.eclipse.core.contenttype} module.")
5035 (license license:epl1.0)))
5036
6a7f7e49
RW
5037(define-public java-eclipse-core-runtime
5038 (package
5039 (name "java-eclipse-core-runtime")
5040 (version "3.12.0")
5041 (source (origin
5042 (method url-fetch)
5043 (uri (string-append "https://repo1.maven.org/maven2/"
5044 "org/eclipse/platform/org.eclipse.core.runtime/"
5045 version "/org.eclipse.core.runtime-"
5046 version "-sources.jar"))
5047 (sha256
5048 (base32
5049 "16mkf8jgj35pgzms7w1gyfq0gfm4ixw6c5xbbxzdj1la56c758ya"))))
5050 (build-system ant-build-system)
5051 (arguments
5052 `(#:tests? #f ; no tests included
5053 #:jar-name "eclipse-core-runtime.jar"))
5054 (inputs
5055 `(("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
5056 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
5057 ("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
5058 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5059 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5060 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5061 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5062 (home-page "https://www.eclipse.org/")
5063 (synopsis "Eclipse core runtime")
5064 (description "This package provides the Eclipse core runtime with the
5065module @code{org.eclipse.core.runtime}.")
5066 (license license:epl1.0)))
5067
b3806a15
RW
5068(define-public java-eclipse-core-filesystem
5069 (package
5070 (name "java-eclipse-core-filesystem")
5071 (version "1.6.1")
5072 (source (origin
5073 (method url-fetch)
5074 (uri (string-append "https://repo1.maven.org/maven2/"
5075 "org/eclipse/platform/org.eclipse.core.filesystem/"
5076 version "/org.eclipse.core.filesystem-"
5077 version "-sources.jar"))
5078 (sha256
5079 (base32
5080 "0km1bhwjim4rfy3pkvjhvy31kgsyf2ncx0mlkmbf5n6g57pphdyj"))))
5081 (build-system ant-build-system)
5082 (arguments
5083 `(#:tests? #f ; no tests included
5084 #:jar-name "eclipse-core-filesystem.jar"))
5085 (inputs
5086 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5087 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5088 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5089 (home-page "https://www.eclipse.org/")
5090 (synopsis "Eclipse core file system")
5091 (description "This package provides the Eclipse core file system with the
5092module @code{org.eclipse.core.filesystem}.")
5093 (license license:epl1.0)))
5094
e96060de
RW
5095(define-public java-eclipse-core-expressions
5096 (package
5097 (name "java-eclipse-core-expressions")
5098 (version "3.5.100")
5099 (source (origin
5100 (method url-fetch)
5101 (uri (string-append "https://repo1.maven.org/maven2/"
5102 "org/eclipse/platform/org.eclipse.core.expressions/"
5103 version "/org.eclipse.core.expressions-"
5104 version "-sources.jar"))
5105 (sha256
5106 (base32
5107 "18bw2l875gmygvpagpgk9l24qzbdjia4ag12nw6fi8v8yaq4987f"))))
5108 (build-system ant-build-system)
5109 (arguments
5110 `(#:tests? #f ; no tests included
5111 #:jar-name "eclipse-core-expressions.jar"))
5112 (inputs
5113 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5114 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5115 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5116 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5117 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5118 (home-page "https://www.eclipse.org/")
5119 (synopsis "Eclipse core expression language")
5120 (description "This package provides the Eclipse core expression language
5121with the @code{org.eclipse.core.expressions} module.")
5122 (license license:epl1.0)))
5123
e8d0f7c8
RW
5124(define-public java-eclipse-core-variables
5125 (package
5126 (name "java-eclipse-core-variables")
5127 (version "3.3.0")
5128 (source (origin
5129 (method url-fetch)
5130 (uri (string-append "https://repo1.maven.org/maven2/"
5131 "org/eclipse/platform/org.eclipse.core.variables/"
5132 version "/org.eclipse.core.variables-"
5133 version "-sources.jar"))
5134 (sha256
5135 (base32
5136 "12dirh03zi4n5x5cj07vzrhkmnqy6h9q10h9j605pagmpmifyxmy"))))
5137 (build-system ant-build-system)
5138 (arguments
5139 `(#:tests? #f ; no tests included
5140 #:jar-name "eclipse-core-variables.jar"))
5141 (inputs
5142 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5143 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5144 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5145 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5146 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5147 (home-page "https://www.eclipse.org/platform")
5148 (synopsis "Eclipse core variables")
5149 (description "This package provides the Eclipse core variables module
5150@code{org.eclipse.core.variables}.")
5151 (license license:epl1.0)))
5152
7c3d479e
RW
5153(define-public java-eclipse-ant-core
5154 (package
5155 (name "java-eclipse-ant-core")
5156 (version "3.4.100")
5157 (source (origin
5158 (method url-fetch)
5159 (uri (string-append "https://repo1.maven.org/maven2/"
5160 "org/eclipse/platform/org.eclipse.ant.core/"
5161 version "/org.eclipse.ant.core-"
5162 version "-sources.jar"))
5163 (sha256
5164 (base32
5165 "11g3if794qjlk98mz9zch22rr56sd7z63vn4i7k2icr8cq5bfqg7"))))
5166 (build-system ant-build-system)
5167 (arguments
5168 `(#:tests? #f ; no tests included
5169 #:jar-name "eclipse-ant-core.jar"))
5170 (inputs
5171 `(("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
5172 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5173 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5174 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5175 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
5176 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5177 ("java-eclipse-core-variables" ,java-eclipse-core-variables)
5178 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5179 (home-page "https://www.eclipse.org/platform")
5180 (synopsis "Ant build tool core libraries")
5181 (description "This package provides the ant build tool core libraries with
5182the module @code{org.eclipse.ant.core}.")
5183 (license license:epl1.0)))
5184
6636f638
RW
5185(define-public java-eclipse-core-resources
5186 (package
5187 (name "java-eclipse-core-resources")
5188 (version "3.11.1")
5189 (source (origin
5190 (method url-fetch)
5191 (uri (string-append "https://repo1.maven.org/maven2/"
5192 "org/eclipse/platform/org.eclipse.core.resources/"
5193 version "/org.eclipse.core.resources-"
5194 version "-sources.jar"))
5195 (sha256
5196 (base32
5197 "1hrfxrll6cpcagfksk2na1ypvkcnsp0fk6n3vcsrn97qayf9mx9l"))))
5198 (build-system ant-build-system)
5199 (arguments
5200 `(#:tests? #f ; no tests included
5201 #:jar-name "eclipse-core-resources.jar"))
5202 (inputs
5203 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5204 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5205 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5206 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
5207 ("java-eclipse-core-expressions" ,java-eclipse-core-expressions)
5208 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
5209 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
5210 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5211 ("java-eclipse-ant-core" ,java-eclipse-ant-core)
5212 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5213 (home-page "https://www.eclipse.org/")
5214 (synopsis "Eclipse core resource management")
5215 (description "This package provides the Eclipse core resource management
5216module @code{org.eclipse.core.resources}.")
5217 (license license:epl1.0)))
5218
afb5858d
RW
5219(define-public java-eclipse-compare-core
5220 (package
5221 (name "java-eclipse-compare-core")
5222 (version "3.6.0")
5223 (source (origin
5224 (method url-fetch)
5225 (uri (string-append "https://repo1.maven.org/maven2/"
5226 "org/eclipse/platform/org.eclipse.compare.core/"
5227 version "/org.eclipse.compare.core-"
5228 version "-sources.jar"))
5229 (sha256
5230 (base32
5231 "10g37r0pbiffyv2wk35c6g5lwzkdipkl0kkjp41v84dln46xm4dg"))))
5232 (build-system ant-build-system)
5233 (arguments
5234 `(#:tests? #f ; no tests included
5235 #:jar-name "eclipse-compare-core.jar"))
5236 (inputs
5237 `(("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5238 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5239 ("java-eclipse-osgi" ,java-eclipse-osgi)
5240 ("java-icu4j" ,java-icu4j)))
5241 (home-page "https://www.eclipse.org/")
5242 (synopsis "Eclipse core compare support")
5243 (description "This package provides the Eclipse core compare support
5244module @code{org.eclipse.compare.core}.")
5245 (license license:epl1.0)))
5246
1bb191fc
RW
5247(define-public java-eclipse-team-core
5248 (package
5249 (name "java-eclipse-team-core")
5250 (version "3.8.0")
5251 (source (origin
5252 (method url-fetch)
5253 (uri (string-append "https://repo1.maven.org/maven2/"
5254 "org/eclipse/platform/org.eclipse.team.core/"
5255 version "/org.eclipse.team.core-"
5256 version "-sources.jar"))
5257 (sha256
5258 (base32
5259 "02j2jzqgb26zx2d5ahxmvijw6j4r0la90zl5c3i65x6z19ciyam7"))))
5260 (build-system ant-build-system)
5261 (arguments
5262 `(#:tests? #f ; no tests included
5263 #:jar-name "eclipse-team-core.jar"))
5264 (inputs
5265 `(("java-eclipse-compare-core" ,java-eclipse-compare-core)
5266 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
5267 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
5268 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
5269 ("java-eclipse-core-resources" ,java-eclipse-core-resources)
5270 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5271 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5272 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5273 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5274 ("java-eclipse-osgi" ,java-eclipse-osgi)))
5275 (home-page "https://www.eclipse.org/platform")
5276 (synopsis "Eclipse team support core")
5277 (description "This package provides the Eclipse team support core module
5278@code{org.eclipse.team.core}.")
5279 (license license:epl1.0)))
5280
31342529
RW
5281(define-public java-eclipse-core-commands
5282 (package
5283 (name "java-eclipse-core-commands")
5284 (version "3.8.1")
5285 (source (origin
5286 (method url-fetch)
5287 (uri (string-append "https://repo1.maven.org/maven2/"
5288 "org/eclipse/platform/org.eclipse.core.commands/"
5289 version "/org.eclipse.core.commands-"
5290 version "-sources.jar"))
5291 (sha256
5292 (base32
5293 "0yjn482qndcfrsq3jd6vnhcylp16420f5aqkrwr8spsprjigjcr9"))))
5294 (build-system ant-build-system)
5295 (arguments
5296 `(#:tests? #f ; no tests included
5297 #:jar-name "eclipse-core-commands.jar"))
5298 (inputs
5299 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)))
5300 (home-page "https://www.eclipse.org/platform")
5301 (synopsis "Eclipse core commands")
5302 (description "This package provides Eclipse core commands in the module
5303@code{org.eclipse.core.commands}.")
5304 (license license:epl1.0)))
5305
bf96acf7
RW
5306(define-public java-eclipse-text
5307 (package
5308 (name "java-eclipse-text")
5309 (version "3.6.0")
5310 (source (origin
5311 (method url-fetch)
5312 (uri (string-append "https://repo1.maven.org/maven2/"
5313 "org/eclipse/platform/org.eclipse.text/"
5314 version "/org.eclipse.text-"
5315 version "-sources.jar"))
5316 (sha256
5317 (base32
5318 "0scz70vzz5qs5caji9f5q01vkqnvip7dpri1q07l8wbbdcxn4cq1"))))
5319 (build-system ant-build-system)
5320 (arguments
5321 `(#:tests? #f ; no tests included
5322 #:jar-name "eclipse-text.jar"
5323 #:phases
5324 (modify-phases %standard-phases
5325 ;; When creating a new category we must make sure that the new list
5326 ;; matches List<Position>. By default it seems to be too generic
5327 ;; (ArrayList<Object>), so we specialize it to ArrayList<Position>.
5328 ;; Without this we get this error:
5329 ;;
5330 ;; [javac] .../src/org/eclipse/jface/text/AbstractDocument.java:376:
5331 ;; error: method put in interface Map<K,V> cannot be applied to given types;
5332 ;; [javac] fPositions.put(category, new ArrayList<>());
5333 ;; [javac] ^
5334 ;; [javac] required: String,List<Position>
5335 ;; [javac] found: String,ArrayList<Object>
5336 ;; [javac] reason: actual argument ArrayList<Object> cannot be converted
5337 ;; to List<Position> by method invocation conversion
5338 ;; [javac] where K,V are type-variables:
5339 ;; [javac] K extends Object declared in interface Map
5340 ;; [javac] V extends Object declared in interface Map
5341 ;;
5342 ;; I don't know if this is a good fix. I suspect it is not, but it
5343 ;; seems to work.
5344 (add-after 'unpack 'fix-compilation-error
5345 (lambda _
5346 (substitute* "src/org/eclipse/jface/text/AbstractDocument.java"
5347 (("Positions.put\\(category, new ArrayList<>\\(\\)\\);")
5348 "Positions.put(category, new ArrayList<Position>());"))
5349 #t)))))
5350 (inputs
5351 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5352 ("java-eclipse-core-commands" ,java-eclipse-core-commands)
5353 ("java-icu4j" ,java-icu4j)))
5354 (home-page "http://www.eclipse.org/platform")
5355 (synopsis "Eclipse text library")
5356 (description "Platform Text is part of the Platform UI project and
5357provides the basic building blocks for text and text editors within Eclipse
5358and contributes the Eclipse default text editor.")
5359 (license license:epl1.0)))
5360
c24d11b7
RW
5361(define-public java-eclipse-jdt-core
5362 (package
5363 (name "java-eclipse-jdt-core")
5364 (version "3.12.3")
5365 (source (origin
5366 (method url-fetch)
5367 (uri (string-append "https://repo1.maven.org/maven2/"
5368 "org/eclipse/jdt/org.eclipse.jdt.core/"
5369 version "/org.eclipse.jdt.core-"
5370 version "-sources.jar"))
5371 (sha256
5372 (base32
5373 "191xw4lc7mjjkprh4ji5vnpjvr5r4zvbpwkriy4bvsjqrz35vh1j"))))
5374 (build-system ant-build-system)
5375 (arguments
5376 `(#:tests? #f ; no tests included
5377 #:jar-name "eclipse-jdt-core.jar"))
5378 (inputs
5379 `(("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
5380 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
5381 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
5382 ("java-eclipse-core-resources" ,java-eclipse-core-resources)
5383 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5384 ("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
5385 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5386 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5387 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5388 ("java-eclipse-osgi" ,java-eclipse-osgi)
5389 ("java-eclipse-text" ,java-eclipse-text)))
5390 (home-page "https://www.eclipse.org/jdt")
5391 (synopsis "Java development tools core libraries")
5392 (description "This package provides the core libraries of the Eclipse Java
5393development tools.")
5394 (license license:epl1.0)))
5395
a5cdcf6c
RW
5396(define-public java-javax-mail
5397 (package
5398 (name "java-javax-mail")
5399 (version "1.5.6")
5400 (source (origin
5401 (method url-fetch)
5402 (uri (string-append "https://repo1.maven.org/maven2/"
5403 "com/sun/mail/javax.mail/"
5404 version "/javax.mail-"
5405 version "-sources.jar"))
5406 (sha256
5407 (base32
5408 "0sdlfgsc2b5s89xv1261y8i0jijcja019k2x1c8ngfn582w4jly9"))))
5409 (build-system ant-build-system)
5410 (arguments
5411 `(#:tests? #f ; no tests
5412 #:jar-name "javax-mail.jar"))
5413 (home-page "https://javamail.java.net")
5414 (synopsis "Reference implementation of the JavaMail API")
5415 (description
5416 "This package provides versions of the JavaMail API implementation, IMAP,
5417SMTP, and POP3 service providers, some examples, and documentation for the
5418JavaMail API.")
5419 ;; GPLv2 only with "classpath exception".
5420 (license license:gpl2)))
5421
0e660c4d
RW
5422(define-public java-log4j-api
5423 (package
5424 (name "java-log4j-api")
5425 (version "2.4.1")
5426 (source (origin
5427 (method url-fetch)
5428 (uri (string-append "mirror://apache/logging/log4j/" version
5429 "/apache-log4j-" version "-src.tar.gz"))
5430 (sha256
5431 (base32
5432 "0j5p9gik0jysh37nlrckqbky12isy95cpwg2gv5fas1rcdqbraxd"))))
5433 (build-system ant-build-system)
5434 (arguments
5435 `(#:tests? #f ; tests require unpackaged software
5436 #:jar-name "log4j-api.jar"
5437 #:make-flags
5438 (list (string-append "-Ddist.dir=" (assoc-ref %outputs "out")
5439 "/share/java"))
5440 #:phases
5441 (modify-phases %standard-phases
5442 (add-after 'unpack 'enter-dir
5443 (lambda _ (chdir "log4j-api") #t))
5444 ;; FIXME: The tests require additional software that has not been
5445 ;; packaged yet, such as
5446 ;; * org.apache.maven
5447 ;; * org.apache.felix
5448 (add-after 'enter-dir 'delete-tests
5449 (lambda _ (delete-file-recursively "src/test") #t)))))
5450 (inputs
5451 `(("java-osgi-core" ,java-osgi-core)
5452 ("java-hamcrest-core" ,java-hamcrest-core)
5453 ("java-junit" ,java-junit)))
5454 (home-page "http://logging.apache.org/log4j/2.x/")
5455 (synopsis "API module of the Log4j logging framework for Java")
5456 (description
5457 "This package provides the API module of the Log4j logging framework for
5458Java.")
5459 (license license:asl2.0)))
5460
dfef4231
JL
5461(define-public java-log4j-core
5462 (package
5463 (inherit java-log4j-api)
5464 (name "java-log4j-core")
5465 (inputs
5466 `(("java-osgi-core" ,java-osgi-core)
5467 ("java-hamcrest-core" ,java-hamcrest-core)
5468 ("java-log4j-api" ,java-log4j-api)
5469 ("java-mail" ,java-mail)
5470 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
5471 ("java-lmax-disruptor" ,java-lmax-disruptor)
5472 ("java-kafka" ,java-kafka-clients)
5473 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
5474 ("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
5475 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
5476 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
5477 ("java-fasterxml-jackson-dataformat-xml" ,java-fasterxml-jackson-dataformat-xml)
5478 ("java-fasterxml-jackson-dataformat-yaml" ,java-fasterxml-jackson-dataformat-yaml)
5479 ("java-commons-compress" ,java-commons-compress)
5480 ("java-commons-csv" ,java-commons-csv)
5481 ("java-jeromq" ,java-jeromq)
5482 ("java-junit" ,java-junit)))
5483 (native-inputs
5484 `(("hamcrest" ,java-hamcrest-all)
5485 ("java-commons-io" ,java-commons-io)
5486 ("java-commons-lang3" ,java-commons-lang3)
5487 ("slf4j" ,java-slf4j-api)))
5488 (arguments
5489 `(#:tests? #f ; tests require more dependencies
5490 #:test-dir "src/test"
5491 #:source-dir "src/main/java"
5492 #:jar-name "log4j-core.jar"
5493 #:jdk ,icedtea-8
5494 #:make-flags
5495 (list (string-append "-Ddist.dir=" (assoc-ref %outputs "out")
5496 "/share/java"))
5497 #:phases
5498 (modify-phases %standard-phases
5499 (add-after 'unpack 'enter-dir
5500 (lambda _ (chdir "log4j-core") #t)))))
5501 (synopsis "Core component of the Log4j framework")
5502 (description "This package provides the core component of the Log4j
5503logging framework for Java.")))
5504
2caf873e
JL
5505(define-public java-log4j-1.2-api
5506 (package
5507 (inherit java-log4j-api)
5508 (name "java-log4j-1.2-api")
5509 (arguments
5510 `(#:jar-name "java-log4j-1.2-api.jar"
5511 #:source-dir "log4j-1.2-api/src/main/java"
5512 #:jdk ,icedtea-8
5513 ;; Tests require maven-model (and other maven subprojects), which is a
5514 ;; cyclic dependency.
5515 #:tests? #f))
5516 (inputs
5517 `(("log4j-api" ,java-log4j-api)
5518 ("log4j-core" ,java-log4j-core)
5519 ("osgi-core" ,java-osgi-core)
5520 ("eclipse-osgi" ,java-eclipse-osgi)
5521 ("java-lmax-disruptor" ,java-lmax-disruptor)))))
5522
1c188f4e
HG
5523(define-public java-commons-cli
5524 (package
5525 (name "java-commons-cli")
5526 (version "1.3.1")
5527 (source (origin
5528 (method url-fetch)
5529 (uri (string-append "mirror://apache/commons/cli/source/"
5530 "commons-cli-" version "-src.tar.gz"))
5531 (sha256
5532 (base32
5533 "1fkjn552i12vp3xxk21ws4p70fi0lyjm004vzxsdaz7gdpgyxxyl"))))
5534 (build-system ant-build-system)
5535 ;; TODO: javadoc
5536 (arguments
5537 `(#:jar-name "commons-cli.jar"))
5538 (native-inputs
5539 `(("java-junit" ,java-junit)
5540 ("java-hamcrest-core" ,java-hamcrest-core)))
5541 (home-page "http://commons.apache.org/cli/")
5542 (synopsis "Command line arguments and options parsing library")
5543 (description "The Apache Commons CLI library provides an API for parsing
5544command line options passed to programs. It is also able to print help
5545messages detailing the options available for a command line tool.
5546
5547Commons CLI supports different types of options:
5548
5549@itemize
5550@item POSIX like options (ie. tar -zxvf foo.tar.gz)
5551@item GNU like long options (ie. du --human-readable --max-depth=1)
5552@item Java like properties (ie. java -Djava.awt.headless=true Foo)
5553@item Short options with value attached (ie. gcc -O2 foo.c)
5554@item long options with single hyphen (ie. ant -projecthelp)
5555@end itemize
5556
5557This is a part of the Apache Commons Project.")
5558 (license license:asl2.0)))
0a8519bc
HG
5559
5560(define-public java-commons-codec
5561 (package
5562 (name "java-commons-codec")
5563 (version "1.10")
5564 (source (origin
5565 (method url-fetch)
5566 (uri (string-append "mirror://apache/commons/codec/source/"
5567 "commons-codec-" version "-src.tar.gz"))
5568 (sha256
5569 (base32
5570 "1w9qg30y4s0x8gnmr2fgj4lyplfn788jqxbcz27lf5kbr6n8xr65"))))
5571 (build-system ant-build-system)
5572 (outputs '("out" "doc"))
5573 (arguments
5574 `(#:test-target "test"
5575 #:make-flags
5576 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
5577 (junit (assoc-ref %build-inputs "java-junit")))
5578 (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
5579 (string-append "-Dhamcrest.jar=" hamcrest
5580 "/share/java/hamcrest-core.jar")
5581 ;; Do not append version to jar.
5582 "-Dfinal.name=commons-codec"))
5583 #:phases
5584 (modify-phases %standard-phases
5585 (add-after 'build 'build-javadoc ant-build-javadoc)
5586 (replace 'install (install-jars "dist"))
5587 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
5588 (native-inputs
5589 `(("java-junit" ,java-junit)
5590 ("java-hamcrest-core" ,java-hamcrest-core)))
5591 (home-page "http://commons.apache.org/codec/")
5592 (synopsis "Common encoders and decoders such as Base64, Hex, Phonetic and URLs")
5593 (description "The codec package contains simple encoder and decoders for
5594various formats such as Base64 and Hexadecimal. In addition to these widely
5595used encoders and decoders, the codec package also maintains a collection of
5596phonetic encoding utilities.
5597
5598This is a part of the Apache Commons Project.")
5599 (license license:asl2.0)))
7d91c1b9
HG
5600
5601(define-public java-commons-daemon
5602 (package
5603 (name "java-commons-daemon")
5604 (version "1.0.15")
5605 (source (origin
5606 (method url-fetch)
5607 (uri (string-append "mirror://apache/commons/daemon/source/"
5608 "commons-daemon-" version "-src.tar.gz"))
5609 (sha256
5610 (base32
5611 "0ci46kq8jpz084ccwq0mmkahcgsmh20ziclp2jf5i0djqv95gvhi"))))
5612 (build-system ant-build-system)
5613 (arguments
5614 `(#:test-target "test"
5615 #:phases
5616 (modify-phases %standard-phases
5617 (add-after 'build 'build-javadoc ant-build-javadoc)
5618 (replace 'install (install-jars "dist"))
5619 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
5620 (native-inputs
5621 `(("java-junit" ,java-junit)))
5622 (home-page "http://commons.apache.org/daemon/")
5623 (synopsis "Library to launch Java applications as daemons")
5624 (description "The Daemon package from Apache Commons can be used to
5625implement Java applications which can be launched as daemons. For example the
5626program will be notified about a shutdown so that it can perform cleanup tasks
5627before its process of execution is destroyed by the operation system.
5628
5629This package contains the Java library. You will also need the actual binary
5630for your architecture which is provided by the jsvc package.
5631
5632This is a part of the Apache Commons Project.")
5633 (license license:asl2.0)))
9f68e74a 5634
eb270ecf
RW
5635(define-public java-javaewah
5636 (package
5637 (name "java-javaewah")
5638 (version "1.1.6")
5639 (source (origin
5640 (method url-fetch)
5641 (uri (string-append "https://github.com/lemire/javaewah/"
5642 "archive/JavaEWAH-" version ".tar.gz"))
5643 (sha256
5644 (base32
5645 "1n7j1r1h24wlhwv9zdcj6yqjrhma2ixwyzm15l5vrv6yqjs6753b"))))
5646 (build-system ant-build-system)
5647 (arguments `(#:jar-name "javaewah.jar"))
5648 (inputs
5649 `(("java-junit" ,java-junit)
5650 ("java-hamcrest-core" ,java-hamcrest-core)))
5651 (home-page "https://github.com/lemire/javaewah")
5652 (synopsis "Compressed alternative to the Java @code{BitSet} class")
5653 (description "This is a word-aligned compressed variant of the Java
5654@code{Bitset} class. It provides both a 64-bit and a 32-bit RLE-like
5655compression scheme. It can be used to implement bitmap indexes.
5656
5657The goal of word-aligned compression is not to achieve the best compression,
5658but rather to improve query processing time. Hence, JavaEWAH tries to save CPU
5659cycles, maybe at the expense of storage. However, the EWAH scheme is always
5660more efficient storage-wise than an uncompressed bitmap (as implemented in the
5661@code{BitSet} class by Sun).")
5662 ;; GPL2.0 derivates are explicitly allowed.
5663 (license license:asl2.0)))
5664
f8e4d022
RW
5665(define-public java-slf4j-api
5666 (package
5667 (name "java-slf4j-api")
5668 (version "1.7.25")
5669 (source (origin
5670 (method url-fetch)
5671 (uri (string-append "https://www.slf4j.org/dist/slf4j-"
5672 version ".tar.gz"))
5673 (sha256
5674 (base32
5675 "13j51sgzmhhdrfa74gkal5zpip7r1440dh7zsi2c8bpb2zs1v8kb"))
5676 (modules '((guix build utils)))
5677 ;; Delete bundled jars.
5678 (snippet
5679 '(begin
5680 (for-each delete-file (find-files "." "\\.jar$"))
5681 #t))))
5682 (build-system ant-build-system)
5683 (arguments
dcf7a8a6 5684 `(#:jar-name "slf4j-api.jar"
f8e4d022 5685 #:source-dir "slf4j-api/src/main"
dcf7a8a6
JL
5686 #:test-dir "slf4j-api/src/test"
5687 #:phases
5688 (modify-phases %standard-phases
5689 (add-after 'build 'regenerate-jar
5690 (lambda _
5691 ;; pom.xml ignores these files in the jar creation process. If we don't,
5692 ;; we get the error "This code should have never made it into slf4j-api.jar"
5693 (delete-file-recursively "build/classes/org/slf4j/impl")
5694 (zero? (system* "jar" "-cf" "build/jar/slf4j-api.jar" "-C"
5695 "build/classes" "."))))
5696 (add-before 'check 'dont-test-abstract-classes
5697 (lambda _
5698 ;; abstract classes are not meant to be run with junit
5699 (substitute* "build.xml"
5700 (("<include name=\"\\*\\*/\\*Test.java\" />")
5701 (string-append "<include name=\"**/*Test.java\" />"
5702 "<exclude name=\"**/MultithreadedInitializationTest"
5703 ".java\" />"))))))))
f8e4d022
RW
5704 (inputs
5705 `(("java-junit" ,java-junit)
5706 ("java-hamcrest-core" ,java-hamcrest-core)))
5707 (home-page "https://www.slf4j.org/")
5708 (synopsis "Simple logging facade for Java")
5709 (description "The Simple Logging Facade for Java (SLF4J) serves as a
5710simple facade or abstraction for various logging
5711frameworks (e.g. @code{java.util.logging}, @code{logback}, @code{log4j})
5712allowing the end user to plug in the desired logging framework at deployment
5713time.")
5714 (license license:expat)))
5715
88f256a1
TD
5716(define-public java-slf4j-simple
5717 (package
5718 (name "java-slf4j-simple")
5719 (version "1.7.25")
5720 (source (package-source java-slf4j-api))
5721 (build-system ant-build-system)
5722 (arguments
5723 `(#:jar-name "slf4j-simple.jar"
5724 #:source-dir "slf4j-simple/src/main"
5725 #:test-dir "slf4j-simple/src/test"
5726 #:phases
5727 (modify-phases %standard-phases
5728 ;; The tests need some test classes from slf4j-api
5729 (add-before 'check 'build-slf4j-api-test-helpers
5730 (lambda _
5731 ;; Add current dir to CLASSPATH ...
5732 (setenv "CLASSPATH"
5733 (string-append (getcwd) ":" (getenv "CLASSPATH")))
5734 ;; ... and build test helper classes here:
5735 (zero?
5736 (apply system*
5737 `("javac" "-d" "."
5738 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))))))
5739 (inputs
5740 `(("java-junit" ,java-junit)
5741 ("java-hamcrest-core" ,java-hamcrest-core)
5742 ("java-slf4j-api" ,java-slf4j-api)))
5743 (home-page "https://www.slf4j.org/")
5744 (synopsis "Simple implementation of simple logging facade for Java")
5745 (description "SLF4J binding for the Simple implementation, which outputs
5746all events to System.err. Only messages of level INFO and higher are
5747printed.")
5748 (license license:expat)))
5749
9f68e74a
JL
5750(define-public antlr2
5751 (package
5752 (name "antlr2")
5753 (version "2.7.7")
5754 (source (origin
5755 (method url-fetch)
5756 (uri (string-append "http://www.antlr2.org/download/antlr-"
5757 version ".tar.gz"))
5758 (sha256
5759 (base32
5760 "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5"))
5761 (modules '((guix build utils)))
5762 (snippet
5763 '(begin
5764 (delete-file "antlr.jar")
5765 (substitute* "lib/cpp/antlr/CharScanner.hpp"
5766 (("#include <map>")
5767 (string-append
6d225e89
RW
5768 "#include <map>\n"
5769 "#define EOF (-1)\n"
5770 "#include <strings.h>")))
9f68e74a 5771 (substitute* "configure"
6d225e89
RW
5772 (("/bin/sh") "sh"))
5773 #t))))
9f68e74a
JL
5774 (build-system gnu-build-system)
5775 (arguments
6d225e89 5776 `(#:tests? #f ; no test target
3ad90395
RW
5777 #:imported-modules ((guix build ant-build-system)
5778 (guix build syscalls)
5779 ,@%gnu-build-system-modules)
5780 #:modules (((guix build ant-build-system) #:prefix ant:)
5781 (guix build gnu-build-system)
5782 (guix build utils))
9f68e74a
JL
5783 #:phases
5784 (modify-phases %standard-phases
5785 (add-after 'install 'strip-jar-timestamps
3ad90395 5786 (assoc-ref ant:%standard-phases 'strip-jar-timestamps))
9f68e74a
JL
5787 (add-after 'configure 'fix-bin-ls
5788 (lambda _
3ad90395
RW
5789 (substitute* (find-files "." "Makefile")
5790 (("/bin/ls") "ls"))
5791 #t)))))
9f68e74a
JL
5792 (native-inputs
5793 `(("which" ,which)
5794 ("zip" ,zip)
5795 ("java" ,icedtea "jdk")))
5796 (inputs
5797 `(("java" ,icedtea)))
5798 (home-page "http://www.antlr2.org")
5799 (synopsis "Framework for constructing recognizers, compilers, and translators")
5800 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
5801is a language tool that provides a framework for constructing recognizers,
5802compilers, and translators from grammatical descriptions containing Java, C#,
5803C++, or Python actions. ANTLR provides excellent support for tree construction,
5804tree walking, and translation.")
5805 (license license:public-domain)))
a0f15eff 5806
e44112e1 5807(define-public java-stringtemplate-3
a0f15eff 5808 (package
e44112e1 5809 (name "java-stringtemplate")
a0f15eff
JL
5810 (version "3.2.1")
5811 (source (origin
5812 (method url-fetch)
5813 (uri (string-append "https://github.com/antlr/website-st4/raw/"
5814 "gh-pages/download/stringtemplate-"
5815 version ".tar.gz"))
5816 (sha256
5817 (base32
5818 "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is"))))
5819 (build-system ant-build-system)
5820 (arguments
129d926d 5821 `(#:jar-name (string-append ,name "-" ,version ".jar")
2fcda6d2 5822 #:test-dir "test"
b101b4e8
RW
5823 #:modules ((guix build ant-build-system)
5824 (guix build utils)
5825 (srfi srfi-1))
a0f15eff
JL
5826 #:phases
5827 (modify-phases %standard-phases
2fcda6d2
RW
5828 (add-before 'check 'fix-tests
5829 (lambda _
5830 (substitute* "build.xml"
5831 (("\\$\\{test.home\\}/java")
5832 "${test.home}/org"))
5833 #t))
a0f15eff
JL
5834 (add-before 'build 'generate-grammar
5835 (lambda _
b101b4e8
RW
5836 (with-directory-excursion "src/org/antlr/stringtemplate/language/"
5837 (every (lambda (file)
5838 (format #t "~a\n" file)
5839 (zero? (system* "antlr" file)))
5840 '("template.g" "angle.bracket.template.g" "action.g"
5841 "eval.g" "group.g" "interface.g"))))))))
a0f15eff 5842 (native-inputs
2fcda6d2
RW
5843 `(("antlr" ,antlr2)
5844 ("java-junit" ,java-junit)))
a0f15eff
JL
5845 (home-page "http://www.stringtemplate.org")
5846 (synopsis "Template engine to generate formatted text output")
5847 (description "StringTemplate is a java template engine (with ports for C#,
5848Objective-C, JavaScript, Scala) for generating source code, web pages, emails,
5849or any other formatted text output. StringTemplate is particularly good at
5850code generators, multiple site skins, and internationalization / localization.
5851StringTemplate also powers ANTLR.")
5852 (license license:bsd-3)))
4ad8aed7
JL
5853
5854;; antlr3 is partially written using antlr3 grammar files. It also depends on
5855;; ST4 (stringtemplate4), which is also partially written using antlr3 grammar
5856;; files and uses antlr3 at runtime. The latest version requires a recent version
5857;; of antlr3 at runtime.
5858;; Fortunately, ST4 4.0.6 can be built with an older antlr3, and we use antlr3.3.
5859;; This version of ST4 is sufficient for the latest antlr3.
5860;; We use ST4 4.0.6 to build a boostrap antlr3 (latest version), and build
5861;; the latest ST4 with it. Then we build our final antlr3 that will be linked
5862;; against the latest ST4.
5863;; antlr3.3 still depends on antlr3 to generate some files, so we use an
5864;; even older version, antlr3.1, to generate them. Fortunately antlr3.1 uses
5865;; only grammar files with the antlr2 syntax.
5866;; So we build antlr3.1 -> antlr3.3 -> ST4.0.6 -> antlr3-bootstrap -> ST4 -> antlr3.
5867
64b7efc0 5868(define-public java-stringtemplate
407df789 5869 (package (inherit java-stringtemplate-3)
64b7efc0 5870 (name "java-stringtemplate")
4ad8aed7
JL
5871 (version "4.0.8")
5872 (source (origin
5873 (method url-fetch)
5874 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/"
5875 version ".tar.gz"))
5876 (file-name (string-append name "-" version ".tar.gz"))
5877 (sha256
5878 (base32
5879 "1pri8hqa95rfdkjy55icl5q1m09zwp5k67ib14abas39s4v3w087"))))
5880 (build-system ant-build-system)
5881 (arguments
6db77c7c
RW
5882 `(#:jar-name (string-append ,name "-" ,version ".jar")
5883 #:tests? #f ; FIXME: tests fail for unknown reasons
5884 #:test-dir "test"
f4aa4cfe
RW
5885 #:modules ((guix build ant-build-system)
5886 (guix build utils)
5887 (srfi srfi-1))
4ad8aed7
JL
5888 #:phases
5889 (modify-phases %standard-phases
6db77c7c
RW
5890 (add-before 'check 'fix-test-target
5891 (lambda _
5892 (substitute* "build.xml"
5893 (("\\$\\{test.home\\}/java") "${test.home}/")
5894 (("\\*Test.java") "Test*.java"))
5895 #t))
4ad8aed7 5896 (add-before 'build 'generate-grammar
f4aa4cfe
RW
5897 (lambda _
5898 (with-directory-excursion "src/org/stringtemplate/v4/compiler/"
5899 (every (lambda (file)
5900 (format #t "~a\n" file)
5901 (zero? (system* "antlr3" file)))
5902 '("STParser.g" "Group.g" "CodeGenerator.g"))))))))
4ad8aed7
JL
5903 (inputs
5904 `(("antlr3" ,antlr3-bootstrap)
5905 ("antlr2" ,antlr2)
6db77c7c
RW
5906 ("java-stringtemplate" ,java-stringtemplate-3)
5907 ("java-junit" ,java-junit)))))
4ad8aed7 5908
1345eeb0 5909(define java-stringtemplate-4.0.6
64b7efc0 5910 (package (inherit java-stringtemplate)
1345eeb0 5911 (name "java-stringtemplate")
4ad8aed7
JL
5912 (version "4.0.6")
5913 (source (origin
5914 (method url-fetch)
5915 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/ST-"
5916 version ".tar.gz"))
5917 (file-name (string-append name "-" version ".tar.gz"))
5918 (sha256
5919 (base32
5920 "0hjmh1ahdsh3w825i67mli9l4nncc4l6hdbf9ma91jvlj590sljp"))))
5921 (inputs
5922 `(("antlr3" ,antlr3-3.3)
5923 ("antlr2" ,antlr2)
e44112e1 5924 ("java-stringtemplate" ,java-stringtemplate-3)))))
4ad8aed7
JL
5925
5926(define-public antlr3
5927 (package
5928 (name "antlr3")
5929 (version "3.5.2")
5930 (source (origin
5931 (method url-fetch)
5932 (uri (string-append "https://github.com/antlr/antlr3/archive/"
5933 version ".tar.gz"))
5934 (file-name (string-append name "-" version ".tar.gz"))
5935 (sha256
5936 (base32
fd75eb6c 5937 "0218v683081lg54z9hvjxinhxd4dqp870jx6n39gslm0bkyi4vd6"))))
4ad8aed7
JL
5938 (build-system ant-build-system)
5939 (arguments
5940 `(#:jar-name (string-append ,name "-" ,version ".jar")
5941 #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3"
5942 #:tests? #f
5943 #:phases
5944 (modify-phases %standard-phases
5945 (add-after 'install 'bin-install
5946 (lambda* (#:key inputs outputs #:allow-other-keys)
5947 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
5948 (bin (string-append (assoc-ref outputs "out") "/bin")))
5949 (mkdir-p bin)
5950 (with-output-to-file (string-append bin "/antlr3")
5951 (lambda _
5952 (display
5953 (string-append "#!" (which "sh") "\n"
5954 "java -cp " jar "/" ,name "-" ,version ".jar:"
5955 (string-concatenate
5956 (find-files (assoc-ref inputs "stringtemplate")
5957 ".*\\.jar"))
5958 ":"
5959 (string-concatenate
5960 (find-files (assoc-ref inputs "stringtemplate4")
5961 ".*\\.jar"))
5962 ":"
5963 (string-concatenate
5964 (find-files (string-append
5965 (assoc-ref inputs "antlr")
5966 "/lib")
5967 ".*\\.jar"))
5968 " org.antlr.Tool $*"))))
5969 (chmod (string-append bin "/antlr3") #o755))))
5970 (add-before 'build 'generate-grammar
5971 (lambda _
5972 (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/")
5973 (for-each (lambda (file)
5974 (display file)
5975 (newline)
5976 (system* "antlr3" file))
5977 '("ANTLR.g" "ANTLRTreePrinter.g" "ActionAnalysis.g"
5978 "AssignTokenTypesWalker.g"
5979 "ActionTranslator.g" "TreeToNFAConverter.g"
5980 "ANTLRv3.g" "ANTLRv3Tree.g" "LeftRecursiveRuleWalker.g"
5981 "CodeGenTreeWalker.g" "DefineGrammarItemsWalker.g"))
5982 (substitute* "ANTLRParser.java"
5983 (("public Object getTree") "public GrammarAST getTree"))
5984 (substitute* "ANTLRv3Parser.java"
5985 (("public Object getTree") "public CommonTree getTree"))
5986 (chdir "../../../../../java")
5987 (system* "antlr" "-o" "org/antlr/tool"
5988 "org/antlr/tool/serialize.g")
5989 (substitute* "org/antlr/tool/LeftRecursiveRuleAnalyzer.java"
5990 (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*;
5991import org.antlr.grammar.v3.ANTLRTreePrinter;"))
5992 (substitute* "org/antlr/tool/ErrorManager.java"
5993 (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") ""))
5994 (chdir "../../../..")))
5995 (add-before 'build 'fix-build-xml
5996 (lambda _
5997 (substitute* "build.xml"
5998 (("<exec") "<copy todir=\"${classes.dir}\">
5999<fileset dir=\"tool/src/main/resources\">
6000<include name=\"**/*.stg\"/>
6001<include name=\"**/*.st\"/>
6002<include name=\"**/*.sti\"/>
6003<include name=\"**/STLexer.tokens\"/>
6004</fileset>
6005</copy><exec")))))))
6006 (native-inputs
6007 `(("antlr" ,antlr2)
6008 ("antlr3" ,antlr3-bootstrap)))
6009 (inputs
6010 `(("junit" ,java-junit)
e44112e1 6011 ("stringtemplate" ,java-stringtemplate-3)
64b7efc0 6012 ("stringtemplate4" ,java-stringtemplate)))
4ad8aed7 6013 (propagated-inputs
e44112e1 6014 `(("stringtemplate" ,java-stringtemplate-3)
4ad8aed7 6015 ("antlr" ,antlr2)
1345eeb0 6016 ("stringtemplate4" ,java-stringtemplate-4.0.6)))
4ad8aed7
JL
6017 (home-page "http://www.antlr3.org")
6018 (synopsis "Framework for constructing recognizers, compilers, and translators")
6019 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
6020is a language tool that provides a framework for constructing recognizers,
6021compilers, and translators from grammatical descriptions containing Java, C#,
6022C++, or Python actions. ANTLR provides excellent support for tree construction,
6023tree walking, and translation.")
6024 (license license:bsd-3)))
6025
6026(define antlr3-bootstrap
6027 (package
6028 (inherit antlr3)
6029 (name "antlr3-bootstrap")
6030 (native-inputs
6031 `(("antlr" ,antlr2)
6032 ("antlr3" ,antlr3-3.3)))
6033 (inputs
6034 `(("junit" ,java-junit)))))
6035
6036(define antlr3-3.3
6037 (package
6038 (inherit antlr3)
6039 (name "antlr3")
6040 (version "3.3")
6041 (source (origin
6042 (method url-fetch)
6043 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
6044 "gh-pages/download/antlr-"
6045 version ".tar.gz"))
6046 (sha256
6047 (base32
48c86220
GB
6048 "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m"))
6049 (patches
6050 (search-patches "antlr3-3_3-fix-java8-compilation.patch"))))
4ad8aed7
JL
6051 (arguments
6052 `(#:jar-name (string-append ,name "-" ,version ".jar")
a9540107
RW
6053 #:source-dir (string-join '("tool/src/main/java"
6054 "runtime/Java/src/main/java"
6055 "tool/src/main/antlr2"
6056 "tool/src/main/antlr3")
6057 ":")
6058 #:tests? #f ; FIXME: tests seem to require maven plugin
6059 #:modules ((guix build ant-build-system)
6060 (guix build utils)
6061 (srfi srfi-1))
4ad8aed7
JL
6062 #:phases
6063 (modify-phases %standard-phases
6064 (add-after 'install 'bin-install
6065 (lambda* (#:key inputs outputs #:allow-other-keys)
a9540107
RW
6066 (let* ((out (assoc-ref outputs "out"))
6067 (jar (string-append out "/share/java"))
6068 (bin (string-append out "/bin")))
4ad8aed7
JL
6069 (mkdir-p bin)
6070 (with-output-to-file (string-append bin "/antlr3")
6071 (lambda _
6072 (display
a9540107
RW
6073 (string-append
6074 "#!" (which "sh") "\n"
6075 "java -cp " jar "/antlr3-3.3.jar:"
6076 (string-join
6077 (append (find-files (assoc-ref inputs "java-stringtemplate")
6078 ".*\\.jar$")
6079 (find-files (string-append (assoc-ref inputs "antlr")
6080 "/lib")
6081 ".*\\.jar$"))
6082 ":")
6083 " org.antlr.Tool $*"))))
6084 (chmod (string-append bin "/antlr3") #o755)
6085 #t)))
4ad8aed7
JL
6086 (add-before 'build 'generate-grammar
6087 (lambda _
4ad8aed7
JL
6088 (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java"
6089 (("import org.antlr.grammar.v2.\\*;")
6090 "import org.antlr.grammar.v2.*;\n
6091import org.antlr.grammar.v2.TreeToNFAConverter;\n
6092import org.antlr.grammar.v2.DefineGrammarItemsWalker;\n
a9540107
RW
6093import org.antlr.grammar.v2.ANTLRTreePrinter;"))
6094 (and
6095 (with-directory-excursion "tool/src/main/antlr2/org/antlr/grammar/v2/"
6096 (every (lambda (file)
6097 (format #t "~a\n" file)
6098 (zero? (system* "antlr" file)))
6099 '("antlr.g" "antlr.print.g" "assign.types.g"
6100 "buildnfa.g" "codegen.g" "define.g")))
6101 (with-directory-excursion "tool/src/main/antlr3/org/antlr/grammar/v3/"
6102 (every (lambda (file)
6103 (format #t "~a\n" file)
6104 (zero? (system* "antlr3" file)))
6105 '("ActionAnalysis.g" "ActionTranslator.g" "ANTLRv3.g"
6106 "ANTLRv3Tree.g"))))))
4ad8aed7
JL
6107 (add-before 'build 'fix-build-xml
6108 (lambda _
6109 (substitute* "build.xml"
6110 (("<exec") "<copy todir=\"${classes.dir}\">
6111<fileset dir=\"tool/src/main/resources\">
6112<include name=\"**/*.stg\"/>
6113<include name=\"**/*.st\"/>
6114<include name=\"**/*.sti\"/>
6115<include name=\"**/STLexer.tokens\"/>
6116</fileset>
a9540107
RW
6117</copy><exec"))
6118 #t)))))
4ad8aed7
JL
6119 (native-inputs
6120 `(("antlr" ,antlr2)
6121 ("antlr3" ,antlr3-3.1)))
6122 (inputs
6123 `(("junit" ,java-junit)))
6124 (propagated-inputs
e44112e1 6125 `(("java-stringtemplate" ,java-stringtemplate-3)
4ad8aed7
JL
6126 ("antlr" ,antlr2)
6127 ("antlr3" ,antlr3-3.1)))))
6128
6129(define antlr3-3.1
6130 (package
6131 (inherit antlr3)
4ad8aed7
JL
6132 (version "3.1")
6133 (source (origin
6134 (method url-fetch)
6135 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
6136 "gh-pages/download/antlr-"
6137 version ".tar.gz"))
6138 (sha256
6139 (base32
4c763b4d
GB
6140 "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z"))
6141 (patches
6142 (search-patches "antlr3-3_1-fix-java8-compilation.patch"))))
4ad8aed7 6143 (arguments
ec32bc98 6144 `(#:jar-name (string-append "antlr3-" ,version ".jar")
4ad8aed7
JL
6145 #:source-dir "src:runtime/Java/src"
6146 #:tests? #f
6147 #:phases
6148 (modify-phases %standard-phases
6149 (add-after 'install 'bin-install
6150 (lambda* (#:key inputs outputs #:allow-other-keys)
6151 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
6152 (bin (string-append (assoc-ref outputs "out") "/bin")))
6153 (mkdir-p bin)
6154 (with-output-to-file (string-append bin "/antlr3")
6155 (lambda _
6156 (display
6157 (string-append "#!" (which "sh") "\n"
6158 "java -cp " jar "/antlr3-3.1-3.1.jar:"
6159 (string-concatenate
6160 (find-files (assoc-ref inputs "stringtemplate")
6161 ".*\\.jar"))
6162 ":"
6163 (string-concatenate
6164 (find-files (string-append
6165 (assoc-ref inputs "antlr")
6166 "/lib")
6167 ".*\\.jar"))
6168 " org.antlr.Tool $*"))))
6169 (chmod (string-append bin "/antlr3") #o755))))
6170 (add-before 'build 'generate-grammar
6171 (lambda _
6172 (let ((dir "src/org/antlr/tool/"))
6173 (for-each (lambda (file)
6174 (display file)
6175 (newline)
13f38d31 6176 (invoke "antlr" "-o" dir (string-append dir file)))
4ad8aed7
JL
6177 '("antlr.g" "antlr.print.g" "assign.types.g"
6178 "buildnfa.g" "define.g")))
6179 (format #t "codegen.g\n")
13f38d31
RW
6180 (invoke "antlr" "-o" "src/org/antlr/codegen"
6181 "src/org/antlr/codegen/codegen.g")
6182 #t))
4ad8aed7
JL
6183 (add-before 'build 'fix-build-xml
6184 (lambda _
6185 (substitute* "build.xml"
6186 (("<exec") "<copy todir=\"${classes.dir}\">
6187<fileset dir=\"src\">
6188<include name=\"**/*.stg\"/>
6189<include name=\"**/*.st\"/>
6190<include name=\"**/*.sti\"/>
6191<include name=\"**/STLexer.tokens\"/>
6192</fileset>
6193</copy><exec")))))))
6194 (native-inputs
6195 `(("antlr" ,antlr2)))
6196 (inputs
6197 `(("junit" ,java-junit)))
6198 (propagated-inputs
e44112e1 6199 `(("stringtemplate" ,java-stringtemplate-3)))))
d44bcd7a 6200
742242a5
GB
6201(define-public java-commons-cli-1.2
6202 ;; This is a bootstrap dependency for Maven2.
6203 (package
6204 (inherit java-commons-cli)
6205 (version "1.2")
6206 (source (origin
6207 (method url-fetch)
6208 (uri (string-append "mirror://apache/commons/cli/source/"
6209 "commons-cli-" version "-src.tar.gz"))
6210 (sha256
6211 (base32
6212 "0rvfgzgv2pc1m091dfj3ih9ddsjjppr1f1wf0qmc3bk6b1kwv2dm"))))
6213 (arguments
6214 `(#:jar-name "commons-cli.jar"
6215 #:phases
6216 (modify-phases %standard-phases
6217 (add-before 'check 'fix-build-xml
6218 (lambda* (#:key inputs #:allow-other-keys)
6219 (substitute* "build.xml"
6220 (("dir=\"\\$\\{test.home\\}/java\"")
6221 "dir=\"${test.home}\""))
6222 #t)))))
6223 (native-inputs
6224 `(("java-junit" ,java-junit)))))
30deadee
JL
6225
6226(define-public java-microemulator-cldc
6227 (package
6228 (name "java-microemulator-cldc")
6229 (version "2.0.4")
6230 (source (origin
6231 (method url-fetch)
6232 (uri (string-append "https://github.com/barteo/microemu/archive/"
6233 "microemulator_"
6234 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
6235 version)
6236 ".tar.gz"))
6237 (file-name (string-append name "-" version ".tar.gz"))
6238 (sha256
6239 (base32
6240 "1x1apmz38gkppxnwnygwmi12j54v4p258v8ddzn6dldkk7vak1ll"))))
6241 (build-system ant-build-system)
6242 (arguments
6243 `(#:jar-name "microemulator-cldc.jar"
6244 #:source-dir "microemu-cldc/src/main/java"
6245 #:tests? #f)); Requires even older software
6246 (home-page "https://github.com/barteo/microemu")
6247 (synopsis "J2ME CLDC emulator")
6248 (description "Microemulator is a Java 2 Micro Edition (J2ME) CLDC/MIDP
6249Emulator. It allows to demonstrate MIDlet based applications in web browser
6250applet and can be run as a standalone java application.")
6251 (license (list license:asl2.0
6252 ;; or altenatively:
6253 license:lgpl2.1+))))
8e2f3e5e
JL
6254
6255(define-public java-datanucleus-javax-persistence
6256 (package
6257 (name "java-datanucleus-javax-persistence")
6258 (version "2.2.0")
6259 (source (origin
6260 (method url-fetch)
6261 (uri (string-append "https://github.com/datanucleus/"
6262 "javax.persistence/archive/javax.persistence-"
6263 version "-release.tar.gz"))
6264 (sha256
6265 (base32
6266 "11jx0fjwgc2hhbqqgdd6m1pf2fplf9vslppygax0y1z5csnqjhpx"))))
6267 (build-system ant-build-system)
6268 (arguments
6269 `(#:jar-name "java-datanucleus-javax-persistence.jar"
6270 #:jdk ,icedtea-8
6271 #:source-dir "src/main/java"
6272 #:tests? #f)); no tests
6273 (home-page "https://github.com/datanucleus/javax.persistence")
6274 (synopsis "JPA API")
6275 (description "This package contains a clean definition of JPA API intended
6276for use with DataNucleus JPA since the JCP haven't provided an official JPA API
6277jar. See @url{http://java.net/projects/jpa-spec/downloads} for the specification
6278used to generate this API.")
6279 (license (list license:edl1.0 license:epl1.0))))
3240ddbf
JL
6280
6281(define-public java-osgi-cmpn
6282 (package
6283 (name "java-osgi-cmpn")
6284 (version "6.0.0")
6285 (source (origin
6286 (method url-fetch)
6287 (uri (string-append "http://central.maven.org/maven2/"
6288 "org/osgi/osgi.cmpn/" version "/osgi.cmpn-"
6289 version "-sources.jar"))
6290 (sha256
6291 (base32
6292 "1lmb6xyrmkqdhv1kayf0514rlwq6ypvs4m44ibrck3snp8241wys"))))
6293 (build-system ant-build-system)
6294 (arguments
6295 `(#:jar-name "osgi-cmpn.jar"
6296 #:tests? #f)); no tests
6297 (inputs
6298 `(("annotation" ,java-osgi-annotation)
6299 ("core" ,java-osgi-core)
6300 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
6301 ("microemulator" ,java-microemulator-cldc)
6302 ("servlet" ,java-classpathx-servletapi)))
c353d014 6303 (home-page "https://www.osgi.org")
3240ddbf
JL
6304 (synopsis "Compendium specification module of OSGi framework")
6305 (description
6306 "OSGi, for Open Services Gateway initiative framework, is a module system
6307and service platform for the Java programming language. This package contains
6308the compendium specification module, providing interfaces and classes for use
6309in compiling bundles.")
6310 (license license:asl2.0)))
747c7574
JL
6311
6312(define-public java-osgi-service-component-annotations
6313 (package
6314 (name "java-osgi-service-component-annotations")
6315 (version "1.3.0")
6316 (source (origin
6317 (method url-fetch)
6318 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6319 "org.osgi.service.component.annotations/"
6320 version "/org.osgi.service.component.annotations-"
6321 version "-sources.jar"))
6322 (sha256
6323 (base32
6324 "15rq9cmp4fpn74q44m4j35qsqmjf5lx3hcrk6pzvbhc08igic2f0"))))
6325 (build-system ant-build-system)
6326 (arguments
6327 `(#:jar-name "osgi-service-component-annotations.jar"
6328 #:tests? #f)); no tests
6329 (inputs
6330 `(("annotation" ,java-osgi-annotation)))
c353d014 6331 (home-page "https://www.osgi.org")
747c7574
JL
6332 (synopsis "Support annotations for osgi-service-component")
6333 (description
6334 "OSGi, for Open Services Gateway initiative framework, is a module system
6335and service platform for the Java programming language. This package contains
6336the support annotations for osgi-service-component.")
6337 (license license:asl2.0)))
999b5fb4
JL
6338
6339(define-public java-osgi-dto
6340 (package
6341 (name "java-osgi-dto")
6342 (version "1.0.0")
6343 (source (origin
6344 (method url-fetch)
6345 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6346 "org.osgi.dto/" version "/org.osgi.dto-"
6347 version "-sources.jar"))
6348 (sha256
6349 (base32
6350 "0f4bqjzadn0hwk6sd3h5gvbyfp3yci1s6r0v770cc15p0pg627yr"))))
6351 (build-system ant-build-system)
6352 (arguments
6353 `(#:jar-name "osgi-dto.jar"
6354 #:tests? #f)); no tests
6355 (inputs
6356 `(("annotation" ,java-osgi-annotation)))
c353d014 6357 (home-page "https://www.osgi.org")
999b5fb4
JL
6358 (synopsis "Data Transfer Objects")
6359 (description
6360 "OSGi, for Open Services Gateway initiative framework, is a module system
6361and service platform for the Java programming language. This package contains
6362the Data Transfer Objects. It is easily serializable having only public fields
6363of primitive types and their wrapper classes, Strings, and DTOs. List, Set,
6364Map and array aggregates may also be used. The aggregates must only hold
6365objects of the listed types or aggregates.")
6366 (license license:asl2.0)))
c304ce6a
JL
6367
6368(define-public java-osgi-resource
6369 (package
6370 (name "java-osgi-resource")
6371 (version "1.0.0")
6372 (source (origin
6373 (method url-fetch)
6374 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6375 "org.osgi.resource/"
6376 version "/org.osgi.resource-"
6377 version "-sources.jar"))
6378 (sha256
6379 (base32
6380 "0hi0fsc5v99q22bd7lrkvpz1y0ds4w9arjldpwsrcpqvz2js7q2d"))))
6381 (build-system ant-build-system)
6382 (arguments
6383 `(#:jar-name "osgi-resource.jar"
6384 #:tests? #f)); no tests
6385 (inputs
6386 `(("annotation" ,java-osgi-annotation)
6387 ("dto" ,java-osgi-dto)))
c353d014 6388 (home-page "https://www.osgi.org")
c304ce6a
JL
6389 (synopsis "OSGI Resource")
6390 (description
6391 "OSGi, for Open Services Gateway initiative framework, is a module system
6392and service platform for the Java programming language. This package contains
6393the definition of common types in osgi packages.")
6394 (license license:asl2.0)))
c2b14516
JL
6395
6396(define-public java-osgi-namespace-contract
6397 (package
6398 (name "java-osgi-namespace-contract")
6399 (version "1.0.0")
6400 (source (origin
6401 (method url-fetch)
6402 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6403 "org.osgi.namespace.contract/"
6404 version "/org.osgi.namespace.contract-"
6405 version "-sources.jar"))
6406 (sha256
6407 (base32
6408 "1iz4f2i0fvqrlq90ki9nfzcfpvy2av434ri25bglywqssx8mmp36"))))
6409 (build-system ant-build-system)
6410 (inputs
6411 `(("resource" ,java-osgi-resource)
6412 ("annotation" ,java-osgi-annotation)))
6413 (arguments
6414 `(#:jar-name "osgi-namespace-contract.jar"
6415 #:tests? #f)); no tests
c353d014 6416 (home-page "https://www.osgi.org")
c2b14516
JL
6417 (synopsis "Contract Capability and Requirement Namespace")
6418 (description
6419 "OSGi, for Open Services Gateway initiative framework, is a module system
6420and service platform for the Java programming language. This package contains
6421the names for the attributes and directives for a namespace with contracts.")
6422 (license license:asl2.0)))
f809c963
JL
6423
6424(define-public java-osgi-namespace-extender
6425 (package
6426 (name "java-osgi-namespace-extender")
6427 (version "1.0.1")
6428 (source (origin
6429 (method url-fetch)
6430 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6431 "org.osgi.namespace.extender/"
6432 version "/org.osgi.namespace.extender-"
6433 version "-sources.jar"))
6434 (sha256
6435 (base32
6436 "0jgqiak2i05qv6j3gd33xlaifzzc0ylxxk376v2x0apfg3vvixmz"))))
6437 (build-system ant-build-system)
6438 (inputs
6439 `(("resource" ,java-osgi-resource)
6440 ("annotation" ,java-osgi-annotation)))
6441 (arguments
6442 `(#:jar-name "osgi-namespace-extendent.jar"
6443 #:tests? #f)); no tests
c353d014 6444 (home-page "https://www.osgi.org")
f809c963
JL
6445 (synopsis "Extender Capability and Requirement Namespace")
6446 (description
6447 "OSGi, for Open Services Gateway initiative framework, is a module system
6448and service platform for the Java programming language. This package contains
b784962d
JL
6449the names for the attributes and directives for an extender namespace.")
6450 (license license:asl2.0)))
6451
6452(define-public java-osgi-namespace-service
6453 (package
6454 (name "java-osgi-namespace-service")
6455 (version "1.0.0")
6456 (source (origin
6457 (method url-fetch)
6458 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6459 "org.osgi.namespace.service/"
6460 version "/org.osgi.namespace.service-"
6461 version "-sources.jar"))
6462 (sha256
6463 (base32
6464 "0qmw8n2449nkmm56d1znz9zhazb6ya3vsimd5bf5jg23zzhgl8c8"))))
6465 (build-system ant-build-system)
6466 (inputs
6467 `(("resource" ,java-osgi-resource)
6468 ("annotation" ,java-osgi-annotation)))
6469 (arguments
6470 `(#:jar-name "osgi-namespace-service.jar"
6471 #:tests? #f)); no tests
c353d014 6472 (home-page "https://www.osgi.org")
b784962d
JL
6473 (synopsis "Service Capability and Requirement Namespace")
6474 (description
6475 "OSGi, for Open Services Gateway initiative framework, is a module system
6476and service platform for the Java programming language. This package contains
6477the names for the attributes and directives for a service namespace.")
f809c963 6478 (license license:asl2.0)))
0f0c5218
JL
6479
6480(define-public java-osgi-util-function
6481 (package
6482 (name "java-osgi-util-function")
6483 (version "1.0.0")
6484 (source (origin
6485 (method url-fetch)
6486 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6487 "org.osgi.util.function/"
6488 version "/org.osgi.util.function-"
6489 version "-sources.jar"))
6490 (sha256
6491 (base32
6492 "04l7j3hwmmj28w23m7paca0afzncs42j2mdr3liqq8kvp548sc6x"))))
6493 (build-system ant-build-system)
6494 (arguments
6495 `(#:jar-name "osgi-util-function.jar"
6496 #:tests? #f)); no tests
6497 (inputs
6498 `(("annotation" ,java-osgi-annotation)))
c353d014 6499 (home-page "https://www.osgi.org")
0f0c5218
JL
6500 (synopsis "OSGI Util Function")
6501 (description
6502 "OSGi, for Open Services Gateway initiative framework, is a module system
6503and service platform for the Java programming language. This package contains
6504an interface for a function that accepts a single argument and produces a result.")
6505 (license license:asl2.0)))
27103135
JL
6506
6507(define-public java-osgi-util-promise
6508 (package
6509 (name "java-osgi-util-promise")
6510 (version "1.0.0")
6511 (source (origin
6512 (method url-fetch)
6513 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6514 "org.osgi.util.promise/"
6515 version "/org.osgi.util.promise-"
6516 version "-sources.jar"))
6517 (sha256
6518 (base32
6519 "0y34dwiflg1c4ahvkswpf9z02xph2sr9fm04ia5493x3lshpw22c"))))
6520 (build-system ant-build-system)
6521 (arguments
6522 `(#:jar-name "osgi-util-promise.jar"
6523 #:tests? #f)); no tests
6524 (inputs
6525 `(("annotation" ,java-osgi-annotation)
6526 ("function" ,java-osgi-util-function)))
c353d014 6527 (home-page "https://www.osgi.org")
27103135
JL
6528 (synopsis "Promise of a value")
6529 (description
6530 "OSGi, for Open Services Gateway initiative framework, is a module system
6531and service platform for the Java programming language. This package contains
6532an interface and utilitary classes for promises. A Promise represents a future
6533value. It handles the interactions for asynchronous processing.")
6534 (license license:asl2.0)))
2b1fdb2b
JL
6535
6536(define-public java-osgi-service-metatype-annotations
6537 (package
6538 (name "java-osgi-service-metatype-annotations")
6539 (version "1.3.0")
6540 (source (origin
6541 (method url-fetch)
6542 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6543 "org.osgi.service.metatype.annotations/"
6544 version "/org.osgi.service.metatype.annotations-"
6545 version "-sources.jar"))
6546 (sha256
6547 (base32
6548 "12rwm3349wk80vm88rcdgs4435m4jxkpkj5mrx326skkz2c6hyw6"))))
6549 (build-system ant-build-system)
6550 (arguments
6551 `(#:jar-name "osgi-service-metatype-annotations.jar"
6552 #:tests? #f)); no tests
6553 (inputs
6554 `(("annotation" ,java-osgi-annotation)))
c353d014 6555 (home-page "https://www.osgi.org")
2b1fdb2b
JL
6556 (synopsis "Support annotations for metatype")
6557 (description
6558 "OSGi, for Open Services Gateway initiative framework, is a module system
6559and service platform for the Java programming language. This package contains
6560the support annotations for metatype.")
6561 (license license:asl2.0)))
a13acfbe
JL
6562
6563(define-public java-osgi-service-repository
6564 (package
6565 (name "java-osgi-service-repository")
6566 (version "1.1.0")
6567 (source (origin
6568 (method url-fetch)
6569 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6570 "org.osgi.service.repository/"
6571 version "/org.osgi.service.repository-"
6572 version "-sources.jar"))
6573 (sha256
6574 (base32
6575 "1k41mhg7b58pd8nsghr2qwcjrxdnf1p9spsw9v11k4257g6rl06n"))))
6576 (build-system ant-build-system)
6577 (arguments
6578 `(#:jar-name "osgi-service-repository.jar"
6579 #:tests? #f)); no tests
6580 (inputs
6581 `(("annotation" ,java-osgi-annotation)
6582 ("promise" ,java-osgi-util-promise)
6583 ("resource" ,java-osgi-resource)))
c353d014 6584 (home-page "https://www.osgi.org")
a13acfbe
JL
6585 (synopsis "OSGI service repository")
6586 (description
6587 "OSGi, for Open Services Gateway initiative framework, is a module system
6588and service platform for the Java programming language. This package contains
6589a repository service that contains resources.")
6590 (license license:asl2.0)))
dfd91541
JL
6591
6592(define-public java-osgi-framework
6593 (package
6594 (name "java-osgi-framework")
6595 (version "1.8.0")
6596 (source (origin
6597 (method url-fetch)
6598 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6599 "org.osgi.framework/" version "/org.osgi.framework-"
6600 version "-sources.jar"))
6601 (sha256
6602 (base32
6603 "1lwp2zfad3rybcc6q9bwz8xsgkc92ypzy5p6x54387f1qj65m73s"))))
6604 (build-system ant-build-system)
6605 (arguments
6606 `(#:jar-name "osgi-framework.jar"
6607 #:tests? #f)); no tests
6608 (inputs
6609 `(("annotation" ,java-osgi-annotation)
6610 ("resource" ,java-osgi-resource)
6611 ("dto" ,java-osgi-dto)))
c353d014 6612 (home-page "https://www.osgi.org")
dfd91541
JL
6613 (synopsis "OSGi framework")
6614 (description
6615 "OSGi, for Open Services Gateway initiative framework, is a module system
6616and service platform for the Java programming language.")
6617 (license license:asl2.0)))
98c9f16c
JL
6618
6619(define-public java-osgi-service-log
6620 (package
6621 (name "java-osgi-service-log")
6622 (version "1.3.0")
6623 (source (origin
6624 (method url-fetch)
6625 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6626 "org.osgi.service.log/"
6627 version "/org.osgi.service.log-"
6628 version "-sources.jar"))
6629 (sha256
6630 (base32
6631 "1029j30dzcwializzca0j3fkhwwz08kmmsha5agw1iccscimj6r0"))))
6632 (build-system ant-build-system)
6633 (arguments
6634 `(#:jar-name "osgi-service-log.jar"
6635 #:tests? #f)); no tests
6636 (inputs
6637 `(("java-osgi-framework" ,java-osgi-framework)))
c353d014 6638 (home-page "https://www.osgi.org")
98c9f16c
JL
6639 (synopsis "Provides methods for bundles to write messages to the log")
6640 (description
6641 "OSGi, for Open Services Gateway initiative framework, is a module system
6642and service platform for the Java programming language. This package contains
6643the log service.")
6644 (license license:asl2.0)))
dd76d44b
JL
6645
6646(define-public java-osgi-service-jdbc
6647 (package
6648 (name "java-osgi-service-jdbc")
6649 (version "1.0.0")
6650 (source (origin
6651 (method url-fetch)
6652 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6653 "org.osgi.service.jdbc/"
6654 version "/org.osgi.service.jdbc-"
6655 version "-sources.jar"))
6656 (sha256
6657 (base32
6658 "11iln5v7bk469cgb9ddkrz9sa95b3733gqgaqw9xf5g6wq652yjz"))))
6659 (build-system ant-build-system)
6660 (arguments
6661 `(#:jar-name "osgi-service-jdbc.jar"
6662 #:tests? #f)); no tests
c353d014 6663 (home-page "https://www.osgi.org")
dd76d44b
JL
6664 (synopsis "Factory for JDBC connection factories")
6665 (description
6666 "OSGi, for Open Services Gateway initiative framework, is a module system
6667and service platform for the Java programming language. This package contains
6668a factory for JDBC connection factories. There are 3 preferred connection
6669factories for getting JDBC connections:
6670
6671@itemize
6672@item @code{javax.sql.DataSource};
6673@item @code{javax.sql.ConnectionPoolDataSource};
6674@item @code{javax.sql.XADataSource}.
6675@end itemize")
6676 (license license:asl2.0)))
291d3f22
JL
6677
6678(define-public java-osgi-service-resolver
6679 (package
6680 (name "java-osgi-service-resolver")
6681 (version "1.0.1")
6682 (source (origin
6683 (method url-fetch)
6684 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6685 "org.osgi.service.resolver/"
6686 version "/org.osgi.service.resolver-"
6687 version "-sources.jar"))
6688 (sha256
6689 (base32
6690 "1dzqn1ryfi2rq4zwsgp44bmj2wlfydjg1qbxw2b0z4xdjjy55vxd"))))
6691 (build-system ant-build-system)
6692 (arguments
6693 `(#:jar-name "osgi-service-resolver.jar"
6694 #:tests? #f)); no tests
6695 (inputs
6696 `(("annotation" ,java-osgi-annotation)
6697 ("resource" ,java-osgi-resource)))
c353d014 6698 (home-page "https://www.osgi.org")
291d3f22
JL
6699 (synopsis "OSGI Resolver service")
6700 (description
6701 "OSGi, for Open Services Gateway initiative framework, is a module system
6702and service platform for the Java programming language. This package contains
6703a resolver service that resolves the specified resources in the context supplied
6704by the caller.")
6705 (license license:asl2.0)))
1884bb81
JL
6706
6707(define-public java-osgi-util-tracker
6708 (package
6709 (name "java-osgi-util-tracker")
6710 (version "1.5.1")
6711 (source (origin
6712 (method url-fetch)
6713 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6714 "org.osgi.util.tracker/"
6715 version "/org.osgi.util.tracker-"
6716 version "-sources.jar"))
6717 (sha256
6718 (base32
6719 "0c4fh9vxwzsx59r8dygda0gq2gx3z5vfhc3jsphlqwf5w0h403lz"))))
6720 (build-system ant-build-system)
6721 (arguments
6722 `(#:jar-name "osgi-util-tracker.jar"
6723 #:tests? #f)); no tests
6724 (inputs
6725 `(("framework" ,java-osgi-framework)
6726 ("annotation" ,java-osgi-annotation)))
c353d014 6727 (home-page "https://www.osgi.org")
1884bb81
JL
6728 (synopsis "Bundle tracking")
6729 (description
6730 "OSGi, for Open Services Gateway initiative framework, is a module system
6731and service platform for the Java programming language. This package contains
6732bundle tracking utility classes.")
6733 (license license:asl2.0)))
fb9c48b8
JL
6734
6735(define-public java-osgi-service-cm
6736 (package
6737 (name "java-osgi-service-cm")
6738 (version "1.5.0")
6739 (source (origin
6740 (method url-fetch)
6741 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6742 "org.osgi.service.cm/"
6743 version "/org.osgi.service.cm-"
6744 version "-sources.jar"))
6745 (sha256
6746 (base32
6747 "1z8kap48y3xi0ggj8v6czglfnpnd94mmismgi2wbqhj1nl5fzbp6"))))
6748 (build-system ant-build-system)
6749 (arguments
6750 `(#:jar-name "osgi-service-cm.jar"
6751 #:tests? #f)); no tests
6752 (inputs
6753 `(("framework" ,java-osgi-framework)
6754 ("annotation" ,java-osgi-annotation)))
c353d014 6755 (home-page "https://www.osgi.org")
fb9c48b8
JL
6756 (synopsis "OSGI Configuration Management")
6757 (description
6758 "OSGi, for Open Services Gateway initiative framework, is a module system
6759and service platform for the Java programming language. This package contains
6760utility classes for the configuration of services.")
6761 (license license:asl2.0)))
500aac75
JL
6762
6763(define-public java-osgi-service-packageadmin
6764 (package
6765 (name "java-osgi-service-packageadmin")
6766 (version "1.2.0")
6767 (source (origin
6768 (method url-fetch)
6769 (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6770 "org.osgi.service.packageadmin/"
6771 version "/org.osgi.service.packageadmin-"
6772 version "-sources.jar"))
6773 (sha256
6774 (base32
6775 "041mpxzi7g36wmcily6y4ccn3jx15akpdy8gmhyb7m98x7qfvn52"))))
6776 (build-system ant-build-system)
6777 (arguments
6778 `(#:jar-name "osgi-service-packageadmin.jar"
6779 #:tests? #f)); no tests
6780 (inputs
6781 `(("framework" ,java-osgi-framework)))
c353d014 6782 (home-page "https://www.osgi.org")
500aac75
JL
6783 (synopsis "OSGI Package Administration")
6784 (description
6785 "OSGi, for Open Services Gateway initiative framework, is a module system
6786and service platform for the Java programming language. This package contains
6787the packageadmin service.")
6788 (license license:asl2.0)))
77a4f1ae
JL
6789
6790(define-public java-ops4j-base-lang
6791 (package
6792 (name "java-ops4j-base-lang")
6793 (version "1.5.0")
6794 (source (origin
6795 (method url-fetch)
6796 (uri (string-append "https://github.com/ops4j/org.ops4j.base/"
6797 "archive/base-" version ".tar.gz"))
6798 (sha256
6799 (base32
6800 "18hl3lpchgpv8yh5rlk39l2gif5dlfgb8gxjmncf39pr2dprkniw"))))
6801 (build-system ant-build-system)
6802 (arguments
6803 `(#:jar-name "java-ops4j-base-lang.jar"
6804 #:source-dir "ops4j-base-lang/src/main/java"
6805 #:tests? #f; no tests
6806 #:phases
6807 (modify-phases %standard-phases
6808 (add-before 'build 'add-test-file
6809 (lambda _
6810 ;; That file is required by a test in ops4j-pax-exam-core-spi
6811 (mkdir-p "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang")
6812 (with-output-to-file "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang/pom.properties"
6813 (lambda _
6814 (display
6815 (string-append
6816 "version=" ,version "\n"
6817 "groupId=org.ops4j.base"
6818 "artifactId=ops4j-base-lang\n")))))))))
6819 (home-page "https://ops4j1.jira.com/wiki/spaces/base/overview")
6820 (synopsis "Utility classes and extensions to be used in OPS4J projects")
6821 (description "OPS4J stands for Open Participation Software for Java. This
6822package contains utilities and extensions related to @code{java.lang}.")
6823 (license license:asl2.0)))
b2353495
JL
6824
6825(define-public java-ops4j-base-monitors
6826 (package
6827 (inherit java-ops4j-base-lang)
6828 (name "java-ops4j-base-monitors")
6829 (arguments
6830 `(#:jar-name "java-ops4j-base-monitors.jar"
6831 #:source-dir "ops4j-base-monitors/src/main/java"
6832 #:tests? #f)); no tests
6833 (inputs
6834 `(("lang" ,java-ops4j-base-lang)))
6835 (description "OPS4J stands for Open Participation Software for Java. This
6836package contains utilities and extensions related to monitoring.")))
322d349a
JL
6837
6838(define-public java-ops4j-base-io
6839 (package
6840 (inherit java-ops4j-base-lang)
6841 (name "java-ops4j-base-io")
6842 (arguments
6843 `(#:jar-name "java-ops4j-base-io.jar"
6844 #:source-dir "ops4j-base-io/src/main/java"
6845 #:test-dir "ops4j-base-io/src/test"
6846 #:test-exclude
6847 (list "**/ListerTest.java")))
6848 (inputs
6849 `(("lang" ,java-ops4j-base-monitors)
6850 ("lang" ,java-ops4j-base-lang)))
6851 (native-inputs
6852 `(("junit" ,java-junit)
6853 ("hamcrest" ,java-hamcrest-core)))
6854 (description "OPS4J stands for Open Participation Software for Java. This
6855package contains utilities and extensions related to handling streams and files.")))
559919c1
JL
6856
6857(define-public java-ops4j-base-util
6858 (package
6859 (inherit java-ops4j-base-lang)
6860 (name "java-ops4j-base-util")
6861 (arguments
6862 `(#:jar-name "java-ops4j-base-util.jar"
6863 #:source-dir "ops4j-base-util/src/main/java"
6864 #:test-dir "ops4j-base-util/src/test"))
6865 (inputs
6866 `(("lang" ,java-ops4j-base-lang)))
6867 (native-inputs
6868 `(("junit" ,java-junit)))
6869 (description "OPS4J stands for Open Participation Software for Java. This
6870package contains utilities and extensions related to environment, i18n and
6871mime types.")))
60dcec7a
JL
6872
6873(define-public java-ops4j-base-util-property
6874 (package
6875 (inherit java-ops4j-base-lang)
6876 (name "java-ops4j-base-util-property")
6877 (arguments
6878 `(#:jar-name "java-ops4j-base-util-property.jar"
6879 #:source-dir "ops4j-base-util-property/src/main/java"
6880 #:tests? #f)); no tests
6881 (inputs
6882 `(("lang" ,java-ops4j-base-lang)
6883 ("util" ,java-ops4j-base-util)))
6884 (description "OPS4J stands for Open Participation Software for Java. This
6885package contains utilities and extensions related to resolving properties from
6886different sources.")))
0edf8cf0
JL
6887
6888(define-public java-ops4j-base-store
6889 (package
6890 (inherit java-ops4j-base-lang)
6891 (name "java-ops4j-base-store")
6892 (arguments
6893 `(#:jar-name "java-ops4j-base-store.jar"
6894 #:source-dir "ops4j-base-store/src/main/java"
6895 #:tests? #f)); no tests
6896 (inputs
6897 `(("lang" ,java-ops4j-base-lang)
6898 ("slf4j" ,java-slf4j-api)
6899 ("io" ,java-ops4j-base-io)))
6900 (description "OPS4J stands for Open Participation Software for Java. This
6901package contains utilities for storing and retrieving data from an
6902@code{InputStream}.")))
214fcd8a
JL
6903
6904(define-public java-ops4j-base-spi
6905 (package
6906 (inherit java-ops4j-base-lang)
6907 (name "java-ops4j-base-spi")
6908 (arguments
6909 `(#:jar-name "java-ops4j-base-spi.jar"
6910 #:source-dir "ops4j-base-spi/src/main/java"
6911 #:test-dir "ops4j-base-spi/src/test"))
6912 (native-inputs
6913 `(("junit" ,java-junit)
6914 ("hamcrest" ,java-hamcrest-core)))
6915 (description "OPS4J stands for Open Participation Software for Java. This
6916package contains utilities for obtaining services via the Java SE 6
6917@code{ServiceLoader}.")))
e1edf42e
JL
6918
6919(define-public java-aqute-bnd-annotation
6920 (package
6921 (name "java-aqute-bnd-annotation")
6922 (version "3.4.0")
6923 (source (origin
6924 (method url-fetch)
6925 (uri (string-append "https://github.com/bndtools/bnd/archive/"
6926 version ".REL.tar.gz"))
6927 (file-name (string-append name "-" version ".tar.gz"))
6928 (sha256
6929 (base32
6930 "09vgb6axikbz66zi9falijbnzh1qnp9ysfns123dmzdb01cbza9q"))))
6931 (build-system ant-build-system)
6932 (arguments
6933 `(#:jar-name "java-aqute-bnd-annotation.jar"
6934 #:source-dir "biz.aQute.bnd.annotation/src"
6935 #:tests? #f)); empty test dir
6936 (home-page "http://bnd.bndtools.org/")
6937 (synopsis "Tools for OSGi")
6938 (description "Bnd is a swiss army knife for OSGi, it creates manifest
6939headers based on analyzing the class code, it verifies the project settings,
6940it manages project dependencies, gives diffs jars, and much more.")
6941 (license license:asl2.0)))
60ba2978
JL
6942
6943(define-public java-aqute-libg
6944 (package
6945 (inherit java-aqute-bnd-annotation)
6946 (name "java-aqute-libg")
6947 (arguments
6948 `(#:jar-name "java-aqute-libg.jar"
6949 #:source-dir "aQute.libg/src"
6950 #:tests? #f)); FIXME: tests are in "aQute.libg/test", not in a java directory
6951 (inputs
6952 `(("slf4j" ,java-slf4j-api)
6953 ("osgi-annot" ,java-osgi-annotation)
6954 ("java-osgi-cmpn" ,java-osgi-cmpn)
6955 ("osgi" ,java-osgi-core)))))
5f26a131
JL
6956
6957(define-public java-aqute-bndlib
6958 (package
6959 (inherit java-aqute-bnd-annotation)
6960 (name "java-aqute-bndlib")
6961 (arguments
6962 `(#:jar-name "java-bndlib.jar"
6963 #:source-dir "biz.aQute.bndlib/src"
6964 #:tests? #f)); no tests
6965 (inputs
6966 `(("slf4j" ,java-slf4j-api)
6967 ("osgi-annot" ,java-osgi-annotation)
6968 ("java-aqute-libg" ,java-aqute-libg)
6969 ("java-aqute-bnd-annotation" ,java-aqute-bnd-annotation)
6970 ("java-osgi-service-component-annotations" ,java-osgi-service-component-annotations)
6971 ("java-osgi-service-repository" ,java-osgi-service-repository)
6972 ("java-osgi-service-log" ,java-osgi-service-log)
6973 ("java-osgi-service-metatype-annotations" ,java-osgi-service-metatype-annotations)
6974 ("java-osgi-namespace-contract" ,java-osgi-namespace-contract)
6975 ("java-osgi-namespace-extender" ,java-osgi-namespace-extender)
6976 ("java-osgi-namespace-service" ,java-osgi-namespace-service)
6977 ("promise" ,java-osgi-util-promise)
6978 ("osgi" ,java-osgi-core)))))
25aef81d
JL
6979
6980(define-public java-ops4j-pax-tinybundles
6981 (package
6982 (name "java-ops4j-pax-tinybundles")
6983 (version "2.1.1")
6984 (source (origin
6985 (method url-fetch)
6986 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.tinybundles/"
6987 "archive/tinybundles-" version ".tar.gz"))
6988 (sha256
6989 (base32
6990 "0y0gq3pvv0iir2b885lmlwnvr724vv7vklzhhr4fs27d7mdkj871"))))
6991 (arguments
6992 `(#:jar-name "java-ops4j-pax-tinybundles.jar"
6993 #:source-dir "src/main/java"
6994 #:test-exclude
6995 ;; Abstract base classes for other tests
6996 (list "**/BndTest.java" "**/CoreTest.java")
6997 #:phases
6998 (modify-phases %standard-phases
6999 (add-before 'check 'fix-version
7000 (lambda _
7001 ;; This test has a reference to an old version of bndlib we are not
7002 ;; packaging. It uses the version referenced in pom.xml. We replace
7003 ;; it with our own version.
7004 (substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
0f277802
GB
7005 (("[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*")
7006 ,(package-version java-aqute-bndlib))))))))
25aef81d
JL
7007 (inputs
7008 `(("lang" ,java-ops4j-base-lang)
7009 ("io" ,java-ops4j-base-io)
7010 ("store" ,java-ops4j-base-store)
7011 ("slf4j" ,java-slf4j-api)
7012 ("libg" ,java-aqute-libg)
7013 ("bndlib" ,java-aqute-bndlib)))
7014 (native-inputs
7015 `(("junit" ,java-junit)
7016 ("hamcrest" ,java-hamcrest-core)
7017 ("log4j" ,java-log4j-api)
7018 ("bndannotation" ,java-aqute-bnd-annotation)
7019 ("framework" ,java-osgi-framework)))
7020 (build-system ant-build-system)
7021 (home-page "https://ops4j1.jira.com/wiki/spaces/ops4j/pages/12060312/Tinybundles")
7022 (synopsis "Java APIs to create OSGi related artifacts")
7023 (description "Tinybundles is all about creating OSGi related artifacts like
7024Bundles, Fragments and Deployment Packages with Java Api. It is very convinient
7025to create such artifacts on-the-fly inside Tests (like in Pax Exam). On the
7026other hand, this library can be a foundation of real end user tools that need
7027to create those artifacts.")
7028 (license license:asl2.0)))
e179add0
JL
7029
7030(define-public java-ops4j-pax-exam-core
7031 (package
7032 (name "java-ops4j-pax-exam-core")
7033 (version "4.11.0")
7034 (source (origin
7035 (method url-fetch)
7036 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.exam2/"
7037 "archive/exam-reactor-" version ".tar.gz"))
7038 (sha256
7039 (base32
7040 "08mzw8nkah3rj3vznlplnawspxhp61zgvb44ifqa1rni1cvbms2g"))))
7041 (arguments
7042 `(#:jar-name "java-ops4j-pax-exam-core.jar"
7043 #:source-dir "core/pax-exam/src/main/java"
7044 #:test-dir "core/pax-exam/src/test"))
7045 (inputs
7046 `(("slf4j" ,java-slf4j-api)
7047 ("lang" ,java-ops4j-base-lang)
7048 ("io" ,java-ops4j-base-io)
7049 ("util-property" ,java-ops4j-base-util-property)
7050 ("util-store" ,java-ops4j-base-store)
7051 ("java-osgi-core" ,java-osgi-core)))
7052 (native-inputs
7053 `(("junit" ,java-junit)
7054 ("hamcrest" ,java-hamcrest-core)))
7055 (build-system ant-build-system)
7056 (home-page "https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/overview")
7057 (synopsis "In-Container Testing for OSGi, Java EE and CDI")
7058 (description "Pax Exam creates OSGi bundles for testing purposes. It lets
7059the user take control of the OSGi framework, the test framework (e.g. JUnit) and
7060the system under test at the same time.")
7061 (license license:asl2.0)))
7a7c2b75
JL
7062
7063(define-public java-ops4j-pax-exam-core-spi
7064 (package
7065 (inherit java-ops4j-pax-exam-core)
7066 (name "java-ops4j-pax-exam-core-spi")
7067 (arguments
7068 `(#:jar-name "java-ops4j-pax-exam-spi.jar"
7069 #:source-dir "src/main/java"
7070 #:test-exclude
7071 (list
7072 ;; Abstract base class, not a test
7073 "**/BaseStagedReactorTest.java"
7074 ;; Depends on org.mortbay.jetty.testwars:test-war-dump
7075 "**/WarBuilderTest.java")
7076 #:phases
7077 (modify-phases %standard-phases
7078 (add-before 'configure 'chdir
7079 (lambda _
7080 ;; Tests assume we are in this directory
7081 (chdir "core/pax-exam-spi")))
7082 (add-before 'check 'fix-tests
7083 (lambda _
7084 ;; One test checks that this file is present.
7085 (mkdir-p "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi")
7086 (with-output-to-file
7087 "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi/pom.properties"
7088 (lambda _
7089 (display
7090 (string-append "artifactId = pax-exam-spi\n"
7091 "version = " ,(package-version java-ops4j-pax-exam-core-spi)))))
7092 ;; Maven puts compilation results in the target directory, while we
7093 ;; put them in the build directory.
7094 (substitute* '("src/test/java/org/ops4j/pax/exam/spi/war/WarBuilderTest.java"
7095 "src/test/java/org/ops4j/pax/exam/spi/war/WarTestProbeBuilderTest.java"
7096 "src/test/java/org/ops4j/pax/exam/spi/war/ZipBuilderTest.java")
7097 (("target") "build"))
7098 ;; One test is expected to fail, but it doesn't throw the expected exception
7099 (substitute* "src/test/java/org/ops4j/pax/exam/spi/reactors/BaseStagedReactorTest.java"
7100 (("AssertionError") "IllegalArgumentException")))))))
7101 (inputs
7102 `(("java-ops4j-pax-exam-core" ,java-ops4j-pax-exam-core)
7103 ("lang" ,java-ops4j-base-lang)
7104 ("monitors" ,java-ops4j-base-monitors)
7105 ("store" ,java-ops4j-base-store)
7106 ("io" ,java-ops4j-base-io)
7107 ("spi" ,java-ops4j-base-spi)
7108 ("osgi" ,java-osgi-core)
7109 ("slf4j" ,java-slf4j-api)
7110 ("tinybundles" ,java-ops4j-pax-tinybundles)))
7111 (native-inputs
7112 `(("mockito" ,java-mockito-1)
7113 ("junit" ,java-junit)
7114 ("hamcrest" ,java-hamcrest-core)
7115 ("cglib" ,java-cglib)
7116 ("objenesis" ,java-objenesis)
7117 ("asm" ,java-asm)))))
4496d77f
JL
7118
7119(define-public java-ops4j-pax-exam-core-junit
7120 (package
7121 (inherit java-ops4j-pax-exam-core)
7122 (name "java-ops4j-pax-exam-core-junit")
7123 (arguments
7124 `(#:jar-name "ops4j-pax-exam-core-junit.jar"
7125 #:source-dir "drivers/pax-exam-junit4/src/main/java"
7126 #:tests? #f)); no tests
7127 (inputs
7128 `(("junit" ,java-junit)
7129 ("slf4j" ,java-slf4j-api)
7130 ("core" ,java-ops4j-pax-exam-core)
7131 ("spi" ,java-ops4j-pax-exam-core-spi)))
7132 (native-inputs '())))
cb05f60d
JL
7133
7134(define-public java-fasterxml-jackson-annotations
7135 (package
7136 (name "java-fasterxml-jackson-annotations")
93dceea4 7137 (version "2.9.4")
cb05f60d
JL
7138 (source (origin
7139 (method url-fetch)
7140 (uri (string-append "https://github.com/FasterXML/"
7141 "jackson-annotations/archive/"
7142 "jackson-annotations-" version ".tar.gz"))
7143 (sha256
7144 (base32
93dceea4 7145 "0mr95xd0da6a4g95zvrl1ryk5n5zv2rc696w3xnsr5hxk2gicfc4"))))
cb05f60d
JL
7146 (build-system ant-build-system)
7147 (arguments
7148 `(#:jar-name "jackson-annotations.jar"
7149 #:source-dir "src/main/java"
7150 #:test-dir "src/test"))
7151 (native-inputs
7152 `(("junit" ,java-junit)))
7153 (home-page "https://github.com/FasterXML/jackson-annotations")
7154 (synopsis "General purpose annotations for the Jackson Data Processor")
7155 (description "This package contains general purpose annotations for the
7156Jackson Data Processor, used on value and handler types. The only annotations
7157not included are ones that require dependency to the Databind package.")
7158 (license license:asl2.0)))
0b5481df
JL
7159
7160(define-public java-fasterxml-jackson-core
7161 (package
7162 (name "java-fasterxml-jackson-core")
38a0fc38 7163 (version "2.9.4")
0b5481df
JL
7164 (source (origin
7165 (method url-fetch)
7166 (uri (string-append "https://github.com/FasterXML/"
7167 "jackson-core/archive/"
7168 "jackson-core-" version ".tar.gz"))
7169 (sha256
7170 (base32
38a0fc38 7171 "159hsnk17jr1gyzkf01cxvsn45srnk37g949r7364qlsr527gjgd"))))
0b5481df
JL
7172 (build-system ant-build-system)
7173 (arguments
7174 `(#:jar-name "jackson-core.jar"
7175 #:source-dir "src/main/java"
7176 #:test-dir "src/test"
7177 #:test-exclude
7178 (list
7179 ;; Expected failure. pom.xml excludes these
7180 "**/failing/**"
7181 ;; Base classes that have no constructor for junit
7182 "**/BaseTest.java"
7183 "**/ConcurrencyReadTest.java"
7184 "**/ManualCharAccessTest.java"
7185 "**/ManualCharAccessTest.java"
7186 "**/TrailingCommasTest.java"
7187 "**/AsyncMissingValuesInObjectTest.java"
7188 "**/AsyncMissingValuesInArrayTest.java")
7189 #:phases
7190 (modify-phases %standard-phases
7191 (add-before 'configure 'generate-PackageVersion.java
7192 (lambda _
7193 (let* ((out "src/main/java/com/fasterxml/jackson/core/json/PackageVersion.java")
7194 (in (string-append out ".in")))
7195 (copy-file in out)
7196 (substitute* out
7197 (("@package@") "com.fasterxml.jackson.core.json")
7198 (("@projectversion@") ,version)
7199 (("@projectgroupid@") "com.fasterxml.jackson.core")
7200 (("@projectartifactid@") "jackson-core")))))
7201 (add-before 'build 'copy-resources
7202 (lambda _
7203 (copy-recursively "src/main/resources"
7204 "build/classes")))
7205 (add-before 'check 'copy-test-resources
7206 (lambda _
7207 (copy-recursively "src/test/resources"
7208 "build/test-classes"))))))
7209 (native-inputs
7210 `(("junit" ,java-junit)
7211 ("hamcrest" ,java-hamcrest-core)))
7212 (home-page "https://github.com/FasterXML/jackson-core")
7213 (synopsis "")
7214 (description "")
7215 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
f234c7a0
JL
7216
7217(define-public java-fasterxml-jackson-databind
7218 (package
7219 (name "java-fasterxml-jackson-databind")
3c1edff5 7220 (version "2.9.4")
f234c7a0
JL
7221 (source (origin
7222 (method url-fetch)
7223 (uri (string-append "https://github.com/FasterXML/"
7224 "jackson-databind/archive/"
7225 "jackson-databind-" version ".tar.gz"))
7226 (sha256
7227 (base32
3c1edff5 7228 "1zd2cw4z6kdkbx8za96xh9pyicv2a2l7y0rkcx2fqd8hv6d47s08"))))
f234c7a0
JL
7229 (build-system ant-build-system)
7230 (arguments
7231 `(#:jar-name "jackson-databind.jar"
7232 #:source-dir "src/main/java"
7233 #:tests? #f; requires javax.measures for which I can't find a free implementation
7234 #:phases
7235 (modify-phases %standard-phases
7236 (add-before 'configure 'generate-PackageVersion.java
7237 (lambda _
7238 (let* ((out "src/main/java/com/fasterxml/jackson/databind/cfg/PackageVersion.java")
7239 (in (string-append out ".in")))
7240 (copy-file in out)
7241 (substitute* out
7242 (("@package@") "com.fasterxml.jackson.databind.cfg")
7243 (("@projectversion@") ,version)
7244 (("@projectgroupid@") "com.fasterxml.jackson.databind")
7245 (("@projectartifactid@") "jackson-databind")))))
7246 (add-before 'build 'copy-resources
7247 (lambda _
7248 (copy-recursively "src/main/resources" "build/classes"))))))
7249 (inputs
7250 `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
7251 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)))
7252 (home-page "https://github.com/FasterXML/jackson-databind")
7253 (synopsis "Data-binding functionality and tree-model for the Jackson Data Processor")
7254 (description "This package contains the general-purpose data-binding
7255functionality and tree-model for Jackson Data Processor. It builds on core
7256streaming parser/generator package, and uses Jackson Annotations for
7257configuration.")
7258 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
d57d8b89
JL
7259
7260(define-public java-fasterxml-jackson-modules-base-jaxb
7261 (package
7262 (name "java-fasterxml-jackson-modules-base-jaxb")
07207211 7263 (version "2.9.4")
d57d8b89
JL
7264 (source (origin
7265 (method url-fetch)
7266 (uri (string-append "https://github.com/FasterXML/"
7267 "jackson-modules-base/archive/"
7268 "jackson-modules-base-" version ".tar.gz"))
7269 (sha256
7270 (base32
07207211 7271 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
d57d8b89
JL
7272 (build-system ant-build-system)
7273 (arguments
7274 `(#:jar-name "jackson-modules-base-jaxb.jar"
7275 #:source-dir "jaxb/src/main/java"
7276 #:test-dir "jaxb/src/test"
7277 #:test-exclude
7278 ;; Base class for tests
7279 (list "**/BaseJaxbTest.java")
7280 #:phases
7281 (modify-phases %standard-phases
7282 (add-before 'configure 'generate-PackageVersion.java
7283 (lambda _
7284 (let* ((out (string-append "jaxb/src/main/java/com/fasterxml/"
7285 "jackson/module/jaxb/PackageVersion.java"))
7286 (in (string-append out ".in")))
7287 (copy-file in out)
7288 (substitute* out
7289 (("@package@") "com.fasterxml.jackson.module.jaxb")
7290 (("@projectversion@") ,version)
7291 (("@projectgroupid@") "com.fasterxml.jackson.module.jaxb")
7292 (("@projectartifactid@") "jackson-module-jaxb")))))
7293 (add-before 'build 'copy-resources
7294 (lambda _
7295 (copy-recursively "jaxb/src/main/resources" "build/classes"))))))
7296 (inputs
7297 `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
7298 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
7299 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)))
7300 (native-inputs
7301 `(("java-junit" ,java-junit)))
7302 (home-page "https://github.com/FasterXML/jackson-modules-base")
7303 (synopsis "Jaxb annotations jackson module")
7304 (description "This package is the jaxb annotations module for jackson.")
7305 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
0f296d37
JL
7306
7307(define-public java-snakeyaml
7308 (package
7309 (name "java-snakeyaml")
7310 (version "1.18")
7311 (source (origin
7312 (method url-fetch)
7313 (uri (string-append "https://bitbucket.org/asomov/snakeyaml/get/v"
7314 version ".tar.gz"))
307856cd 7315 (file-name (string-append name "-" version ".tar.gz"))
0f296d37
JL
7316 (sha256
7317 (base32
7318 "0rf5ha6w0waz50jz2479jsrbgmd0dnx0gs337m126j5z7zlmg7mg"))))
7319 (build-system ant-build-system)
7320 (arguments
7321 `(#:jar-name "java-snakeyaml.jar"
7322 #:source-dir "src/main/java"
7323 ;; Tests require velocity, a cyclic dependency, and
7324 ;; java-spring-framework-context which is not packaged.
7325 #:tests? #f))
7326 (home-page "https://bitbucket.org/asomov/snakeyaml")
7327 (synopsis "YAML processor")
7328 (description "SnakeYAML is a YAML processor for the Java Virtual Machine.")
7329 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
087c8fd2
JL
7330
7331(define-public java-fasterxml-jackson-dataformat-yaml
7332 (package
7333 (name "java-fasterxml-jackson-dataformat-yaml")
1f2be88f 7334 (version "2.9.4")
087c8fd2
JL
7335 (source (origin
7336 (method url-fetch)
7337 (uri (string-append "https://github.com/FasterXML/"
7338 "jackson-dataformats-text/archive/"
7339 "jackson-dataformats-text-" version ".tar.gz"))
7340 (sha256
7341 (base32
1f2be88f 7342 "1hikl06khaxbg439avf442qifcadap8w0lx13f0nnhp2vh3dkbz7"))))
087c8fd2
JL
7343 (build-system ant-build-system)
7344 (arguments
7345 `(#:jar-name "jackson-dataformat-yaml.jar"
7346 #:source-dir "yaml/src/main/java"
7347 #:test-dir "yaml/src/test"
7348 #:test-exclude (list "**/failing/**.java")
7349 #:phases
7350 (modify-phases %standard-phases
7351 (add-before 'configure 'generate-PackageVersion.java
7352 (lambda _
7353 (let* ((out "yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/PackageVersion.java")
7354 (in (string-append out ".in")))
7355 (copy-file in out)
7356 (substitute* out
7357 (("@package@") "com.fasterxml.jackson.dataformat.yaml")
7358 (("@projectversion@") ,version)
7359 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.yaml")
7360 (("@projectartifactid@") "jackson-dataformat-yaml"))))))))
7361 (inputs
7362 `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
7363 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
7364 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
7365 ("java-snakeyaml" ,java-snakeyaml)))
7366 (native-inputs
7367 `(("junit" ,java-junit)
7368 ("hamcrest" ,java-hamcrest-core)
7369 ("java-ops4j-pax-exam-core-spi" ,java-ops4j-pax-exam-core-spi)
7370 ("java-ops4j-pax-exam-core-junit" ,java-ops4j-pax-exam-core-junit)
7371 ("java-ops4j-pax-exam" ,java-ops4j-pax-exam-core)))
7372 (home-page "https://github.com/FasterXML/jackson-dataformats-text")
7373 (synopsis "Yaml backend for Jackson")
7374 (description "Dataformat backends are used to support format alternatives
7375to JSON, supported by default. This is done by sub-classing Jackson core
7376abstractions.")
7377 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
6fd07b98
JL
7378
7379(define-public java-stax2-api
7380 (package
7381 (name "java-stax2-api")
7382 (version "4.0.0")
7383 (source (origin
7384 (method url-fetch)
7385 (uri (string-append "https://github.com/FasterXML/stax2-api/archive/"
7386 "stax2-api-" version ".tar.gz"))
7387 (sha256
7388 (base32
7389 "1amc1si0l0hyyw2sawmnzy4hkna3z6fp195y4nm5m9wb9ld5awkq"))))
7390 (build-system ant-build-system)
7391 (arguments
7392 `(#:jar-name "java-stax2-api.jar"
7393 #:source-dir "src/main/java"
7394 #:tests? #f)); no tests
7395 (home-page "https://github.com/FasterXML/stax2-api")
7396 (synopsis "Stax2 API")
7397 (description "Stax2 API is an extension to basic Stax 1.0 API that adds
7398significant new functionalities, such as full-featured bi-direction validation
7399interface and high-performance Typed Access API.")
7400 (license license:bsd-2)))
40f193f3
JL
7401
7402(define-public java-woodstox-core
7403 (package
7404 (name "java-woodstox-core")
7405 (version "5.0.3")
7406 (source (origin
7407 (method url-fetch)
7408 (uri (string-append "https://github.com/FasterXML/woodstox/archive/"
7409 "woodstox-core-" version ".tar.gz"))
7410 (sha256
7411 (base32
7412 "1i7pdgb8jbw6gdy5kmm0l6rz109n2ns92pqalpyp24vb8vlvdfd4"))))
7413 (build-system ant-build-system)
7414 (arguments
7415 `(#:jar-name "woodstox.jar"
7416 #:test-exclude
7417 (list "**/Base*.java" "failing/**")
7418 #:phases
7419 (modify-phases %standard-phases
7420 (add-before 'build 'remove-msv-dep
7421 (lambda _
7422 ;; we don't need osgi, and it depends on msv
7423 (delete-file-recursively "src/main/java/com/ctc/wstx/osgi")
7424 ;; msv's latest release is from 2011 and we don't need it
7425 (delete-file-recursively "src/main/java/com/ctc/wstx/msv")
7426 (delete-file-recursively "src/test/java/wstxtest/osgi")
7427 (delete-file-recursively "src/test/java/wstxtest/msv")))
7428 (add-before 'build 'copy-resources
7429 (lambda _
7430 (copy-recursively "src/main/resources" "build/classes"))))))
7431 (inputs
7432 `(("stax2" ,java-stax2-api)))
7433 (native-inputs
7434 `(("junit" ,java-junit)))
7435 (home-page "https://github.com/FasterXML/woodstox")
7436 (synopsis "Stax XML API implementation")
7437 (description "Woodstox is a stax XML API implementation.")
7438 (license license:asl2.0)))
262a4d33
JL
7439
7440(define-public java-fasterxml-jackson-dataformat-xml
7441 (package
7442 (name "java-fasterxml-jackson-dataformat-xml")
f3bbe029 7443 (version "2.9.4")
262a4d33
JL
7444 (source (origin
7445 (method url-fetch)
7446 (uri (string-append "https://github.com/FasterXML/"
7447 "jackson-dataformat-xml/archive/"
7448 "jackson-dataformat-xml-" version ".tar.gz"))
7449 (sha256
7450 (base32
f3bbe029 7451 "111fkkl90w31jbf30kgj82qdcxlw4sxppki7i198liw0ck1jcavq"))))
262a4d33
JL
7452 (build-system ant-build-system)
7453 (arguments
7454 `(#:jar-name "jackson-dataformat-xml.jar"
7455 #:source-dir "src/main/java"
7456 #:test-exclude
7457 (list "**/failing/**")
7458 #:phases
7459 (modify-phases %standard-phases
7460 (add-before 'configure 'generate-PackageVersion.java
7461 (lambda _
7462 (let* ((out "src/main/java/com/fasterxml/jackson/dataformat/xml/PackageVersion.java")
7463 (in (string-append out ".in")))
7464 (copy-file in out)
7465 (newline)
7466 (substitute* out
7467 (("@package@") "com.fasterxml.jackson.dataformat.xml")
7468 (("@projectversion@") ,version)
7469 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.xml")
7470 (("@projectartifactid@") "jackson-dataformat-xml")))))
7471 (add-before 'build 'copy-resources
7472 (lambda _
7473 (copy-recursively "src/main/resources" "build/classes"))))))
7474 (inputs
7475 `(("jackson-annotations" ,java-fasterxml-jackson-annotations)
7476 ("jackson-core" ,java-fasterxml-jackson-core)
7477 ("jackson-modules-base-jaxb" ,java-fasterxml-jackson-modules-base-jaxb)
7478 ("jackson-databind" ,java-fasterxml-jackson-databind)
7479 ("stax2-api" ,java-stax2-api)
7480 ("woodstox" ,java-woodstox-core)))
7481 (native-inputs
7482 `(("junit" ,java-junit)
7483 ("hamcrest" ,java-hamcrest-core)))
7484 (home-page "https://github.com/FasterXML/jackson-dataformat-xml")
7485 (synopsis "Read and write XML")
7486 (description "This package contains Jackson extension component for reading
7487and writing XML encoded data.
7488
7489Further, the goal is to emulate how JAXB data-binding works with \"Code-first\"
7490approach (that is, no support is added for \"Schema-first\" approach). Support
7491for JAXB annotations is provided by JAXB annotation module; this module
7492provides low-level abstractions (@code{JsonParser}, @code{JsonGenerator},
7493@code{JsonFactory}) as well as small number of higher level overrides needed to
7494make data-binding work.")
7495 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
90a127c7
JL
7496
7497(define-public java-hdrhistogram
7498 (package
7499 (name "java-hdrhistogram")
7500 (version "2.1.9")
7501 (source (origin
7502 (method url-fetch)
7503 (uri (string-append "https://github.com/HdrHistogram/HdrHistogram/"
7504 "archive/HdrHistogram-" version ".tar.gz"))
7505 (sha256
7506 (base32
7507 "1sicbmc3sr42nw93qbkb26q9rn33ag33k6k77phjc3j5h5gjffqv"))))
7508 (build-system ant-build-system)
7509 (arguments
7510 `(#:jar-name "java-hdrhistogram.jar"
7511 #:source-dir "src/main/java"
7512 #:phases
7513 (modify-phases %standard-phases
7514 (add-before 'configure 'set-version
7515 (lambda _
7516 (let* ((version-java "src/main/java/org/HdrHistogram/Version.java")
7517 (template (string-append version-java ".template")))
7518 (copy-file template version-java)
7519 (substitute* version-java
7520 (("\\$VERSION\\$") ,version)
7521 (("\\$BUILD_TIME\\$") "0"))
7522 #t))))))
7523 (native-inputs
7524 `(("junit" ,java-junit)
7525 ("hamcrest" ,java-hamcrest-core)))
7526 (home-page "https://hdrhistogram.github.io/HdrHistogram")
7527 (synopsis "High dynamic range histogram")
7528 (description "Hdrhistogram allows to create histograms that support
7529recording and analyzing sampled data value counts across a configurable integer
7530value range with configurable value precision within the range. Value precision
7531is expressed as the number of significant digits in the value recording, and
7532provides control over value quantization behavior across the value range and
7533the subsequent value resolution at any given level.")
7534 (license license:public-domain)))
5d104a27 7535
c5ff11dc
RW
7536(define-public java-cofoja
7537 (package
7538 (name "java-cofoja")
7539 (version "1.3")
7540 (source (origin
7541 (method git-fetch)
7542 (uri (git-reference
7543 (url "https://github.com/nhatminhle/cofoja.git")
7544 (commit (string-append "v" version))))
7545 (file-name (string-append "java-cofoja-" version "-checkout"))
7546 (sha256
7547 (base32
7548 "0p7sz8y5xgpi5rx1qwn6587fkd52qr3ha3ybh14gqcyxhikl525w"))))
7549 (build-system ant-build-system)
7550 (arguments
7551 `(#:build-target "dist"
7552 #:test-target "test"
7553 #:jdk ,icedtea-8
7554 #:make-flags
7555 (list "-Ddist.dir=dist")
7556 #:modules ((guix build ant-build-system)
7557 (guix build java-utils)
7558 (guix build utils)
7559 (srfi srfi-1)
7560 (ice-9 match))
7561 #:phases
7562 (modify-phases %standard-phases
7563 ;; The bulid system ignores the class path the ant-build-system sets
7564 ;; up and instead expects to find all dependencies in the "lib"
7565 ;; directory.
7566 (add-after 'unpack 'create-libdir
7567 (lambda* (#:key inputs #:allow-other-keys)
7568 (mkdir-p "lib")
7569 (for-each
7570 (lambda (file)
7571 (let ((target (string-append "lib/" (basename file))))
7572 (unless (file-exists? target)
7573 (symlink file target))))
7574 (append-map (match-lambda
7575 ((label . dir)
7576 (find-files dir "\\.jar$")))
7577 inputs))
7578 #t))
7579 (replace 'install (install-jars "dist")))))
7580 (inputs
7581 `(("java-asm" ,java-asm)))
7582 (native-inputs
7583 `(("java-junit" ,java-junit)))
7584 (home-page "https://github.com/nhatminhle/cofoja")
7585 (synopsis "Contracts for Java")
7586 (description "Contracts for Java, or Cofoja for short, is a contract
7587programming framework and test tool for Java, which uses annotation processing
7588and bytecode instrumentation to provide run-time checking. (In particular,
7589this is not a static analysis tool.)")
7590 (license license:lgpl3+)))
7591
5d104a27
JL
7592(define-public java-aopalliance
7593 (package
7594 (name "java-aopalliance")
7595 (version "1.0")
7596 (source (origin
7597 (method git-fetch)
7598 ;; Note: this git repository is not official, but contains the
7599 ;; source code that is in the CVS repository. Downloading the
7600 ;; tarball from sourceforge is undeterministic, and the cvs download
7601 ;; fails.
7602 (uri (git-reference
7603 (url "https://github.com/hoverruan/aopalliance")
7604 (commit "0d7757ae204e5876f69431421fe9bc2a4f01e8a0")))
7605 (file-name (string-append name "-" version))
7606 (sha256
7607 (base32
7608 "0rsg2b0v3hxlq2yk1i3m2gw3xwq689j3cwx9wbxvqfpdcjbca0qr"))))
7609 (build-system ant-build-system)
7610 (arguments
7611 `(#:jar-name "java-aopalliance.jar"
7612 #:jdk ,icedtea-8
7613 #:tests? #f; no tests
7614 #:source-dir "aopalliance/src/main"))
7615 (home-page "http://aopalliance.sourceforge.net")
7616 (synopsis "Aspect-Oriented Programming")
7617 (description "The AOP Alliance project is a joint project between several
7618software engineering people who are interested in Aspect-Oriented Programming
7619(AOP) and Java.")
7620 (license license:public-domain)))
454536e0
JL
7621
7622(define-public java-javax-inject
7623 (package
7624 (name "java-javax-inject")
7625 (version "tck-1")
7626 (source (origin
7627 (method url-fetch)
7628 (uri (string-append "https://github.com/javax-inject/javax-inject/"
7629 "archive/javax.inject-" version ".tar.gz"))
7630 (sha256
7631 (base32
7632 "1ydrlvh2r7vr1g7lhjwy3w2dggpj9h6pix1lakkkgdywb365n6g0"))))
7633 (build-system ant-build-system)
7634 (arguments
7635 `(#:jar-name "java-javax-inject.jar"
7636 #:jdk ,icedtea-8
7637 #:tests? #f)); no tests
7638 (home-page "http://github.com/javax-inject/javax-inject")
7639 (synopsis "JSR-330: Dependency Injection for Java")
7640 (description "This package specifies a means for obtaining objects in such
7641a way as to maximize reusability, testability and maintainability compared to
7642traditional approaches such as constructors, factories, and service locators
7643(e.g., JNDI). This process, known as dependency injection, is beneficial to
7644most nontrivial applications.
7645
7646Many types depend on other types. For example, a @var{Stopwatch} might depend
7647on a @var{TimeSource}. The types on which a type depends are known as its
7648dependencies. The process of finding an instance of a dependency to use at run
7649time is known as resolving the dependency. If no such instance can be found,
7650the dependency is said to be unsatisfied, and the application is broken.")
7651 (license license:asl2.0)))
5766984b
JL
7652
7653(define-public java-guice
7654 (package
7655 (name "java-guice")
7656 (version "4.1")
7657 (source (origin
7658 (method url-fetch)
7659 (uri (string-append "https://github.com/google/guice/archive/"
7660 version ".tar.gz"))
7661 (file-name (string-append name "-" version ".tar.gz"))
7662 (sha256
7663 (base32
7664 "0dwmqjzlavb144ywqqglj3h68hqszkff8ai0a42hyb5il0qh4rbp"))))
7665 (build-system ant-build-system)
7666 (arguments
7667 `(#:jar-name "java-guice.jar"
7668 #:jdk ,icedtea-8
7669 #:tests? #f; FIXME: tests are not in a java sub directory
7670 #:source-dir "core/src"))
7671 (inputs
7672 `(("guava" ,java-guava)
7673 ("java-cglib" ,java-cglib)
7674 ("java-aopalliance" ,java-aopalliance)
7675 ("java-javax-inject" ,java-javax-inject)
7676 ("java-asm" ,java-asm)))
7677 (home-page "https://github.com/google/guice")
7678 (synopsis "Lightweight dependency injection framework")
7679 (description "Guice is a lightweight dependency injection framework fo
7680Java 6 and above.")
7681 (license license:asl2.0)))
ec4e8ad7
JL
7682
7683(define-public java-guice-servlet
7684 (package
7685 (inherit java-guice)
7686 (name "java-guice-servlet")
7687 (arguments
7688 `(#:jar-name "guice-servlet.jar"
7689 #:source-dir "extensions/servlet/src/"
7690 #:jdk ,icedtea-8
7691 #:tests? #f)); FIXME: not in a java subdir
7692 (inputs
7693 `(("guice" ,java-guice)
7694 ("servlet" ,java-tomcat)
7695 ,@(package-inputs java-guice)))))
b12fe1e5
JL
7696
7697(define-public java-assertj
7698 (package
7699 (name "java-assertj")
7700 (version "3.8.0")
7701 (source (origin
7702 (method url-fetch)
7703 (uri (string-append "https://github.com/joel-costigliola/"
7704 "assertj-core/archive/"
7705 "assertj-core-" version ".tar.gz"))
7706 (sha256
7707 (base32
7708 "1kf124fxskf548rklkg86294w2x6ajqrff94rrhyqns31danqkfz"))))
7709 (build-system ant-build-system)
7710 (arguments
7711 `(#:jar-name "java-assertj.jar"
7712 #:jdk ,icedtea-8
7713 #:source-dir "src/main/java"
7714 #:tests? #f)); depends on tng-junit which depends on assertj
7715 (inputs
7716 `(("cglib" ,java-cglib)
7717 ("junit" ,java-junit)
7718 ("hamcrest" ,java-hamcrest-core)))
7719 (native-inputs
7720 `(("mockito" ,java-mockito-1)))
7721 (home-page "https://joel-costigliola.github.io/assertj/index.html")
7722 (synopsis "Fluent assertions for java")
7723 (description "AssertJ core is a Java library that provides a fluent
7724interface for writing assertions. Its main goal is to improve test code
7725readability and make maintenance of tests easier.")
7726 (license license:asl2.0)))
6768e0a7
JL
7727
7728(define-public java-jboss-javassist
7729 (package
7730 (name "java-jboss-javassist")
7731 (version "3.21.0")
7732 (source (origin
7733 (method url-fetch)
7734 (uri (string-append "https://github.com/jboss-javassist/javassist/"
7735 "archive/rel_"
7736 (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
7737 "_ga.tar.gz"))
7738 (sha256
7739 (base32
7740 "10lpcr3sbf7y6fq6fc2h2ik7rqrivwcy4747bg0kxhwszil3cfmf"))))
7741 (build-system ant-build-system)
7742 (arguments
7743 `(#:jar-name "java-jboss-javassist.jar"
7744 #:jdk ,icedtea-8
7745 #:source-dir "src/main"
7746 #:tests? #f; FIXME: requires junit-awtui and junit-swingui from junit3
7747 #:phases
7748 (modify-phases %standard-phases
7749 (add-before 'configure 'remove-binary
7750 (lambda _
7751 (delete-file "javassist.jar")
7752 #t)))))
7753 (native-inputs
7754 `(("junit" ,java-junit)))
7755 (home-page "https://github.com/jboss-javassist/javassist")
7756 (synopsis "Java bytecode engineering toolkit")
7757 (description "Javassist (JAVA programming ASSISTant) makes Java bytecode
7758manipulation simple. It is a class library for editing bytecodes in Java; it
7759enables Java programs to define a new class at runtime and to modify a class
7760file when the JVM loads it.")
7761 (license (list license:gpl2 license:cddl1.0)))); either gpl2 only or cddl.
a6dd06d0
JL
7762
7763(define-public java-jcommander
7764 (package
7765 (name "java-jcommander")
7766 (version "1.71")
7767 (source (origin
7768 (method url-fetch)
7769 (uri (string-append "https://github.com/cbeust/jcommander/archive/"
7770 version ".tar.gz"))
7771 (file-name (string-append name "-" version ".tar.gz"))
7772 (sha256
7773 (base32
7774 "1f5k2ckay6qjc3d3w3d7bc0p3cx3c7n6p6zxvw1kibqdr0q98wlx"))))
7775 (build-system ant-build-system)
7776 (arguments
7777 `(#:jar-name "java-jcommander.jar"
7778 #:jdk ,icedtea-8
7779 #:tests? #f; requires testng which depends on jcommander
7780 #:source-dir "src/main/java"))
7781 (home-page "http://jcommander.org")
7782 (synopsis "Command line parameters parser")
7783 (description "JCommander is a very small Java framework that makes it
7784trivial to parse command line parameters. Parameters are declared with
7785annotations.")
7786 (license license:asl2.0)))
11bc385b
JL
7787
7788(define-public java-bsh
7789 (package
7790 (name "java-bsh")
7791 (version "2.0b6")
7792 (source (origin
7793 (method url-fetch)
7794 (uri (string-append "https://github.com/beanshell/beanshell/archive/"
7795 version ".tar.gz"))
7796 (file-name (string-append name "-" version ".tar.gz"))
7797 (sha256
7798 (base32
7799 "1bawkxk6jyc75hxvzkpz689h73cn3f222m0ar3nvb0dal2b85kfv"))))
7800 (build-system ant-build-system)
7801 (arguments
7802 `(#:build-target "jarall"
7803 #:test-target "junit-tests-all"
7804 #:phases
7805 (modify-phases %standard-phases
7806 (replace 'install
7807 (lambda* (#:key outputs #:allow-other-keys)
7808 (let ((share (string-append (assoc-ref outputs "out") "/share/java")))
7809 (mkdir-p share)
7810 (copy-file "dist/bsh-2.0b6.jar" (string-append share "/bsh-2.0b6.jar"))
7811 #t))))))
7812 (home-page "http://beanshell.org/")
7813 (synopsis "Lightweight Scripting for Java")
7814 (description "BeanShell is a small, free, embeddable Java source
7815interpreter with object scripting language features, written in Java.
7816BeanShell dynamically executes standard Java syntax and extends it with common
7817scripting conveniences such as loose types, commands, and method closures like
7818those in Perl and JavaScript.")
7819 (license license:asl2.0)))
7a343e97
JL
7820
7821(define-public java-fest-util
7822 (package
7823 (name "java-fest-util")
7824 (version "1.2.5")
7825 (source (origin
7826 (method url-fetch)
7827 (uri (string-append "https://github.com/alexruiz/fest-util/"
7828 "archive/fest-util-" version ".tar.gz"))
7829 (sha256
7830 (base32
7831 "05g6hljz5mdaakk8d7g32klbhz9bdwp3qlj6rdaggdidxs3x1sb8"))))
7832 (build-system ant-build-system)
7833 (arguments
7834 `(#:jar-name "java-fest-util.jar"
7835 #:source-dir "src/main/java"))
7836 (native-inputs
7837 `(("junit" ,java-junit)
7838 ("hamcrest" ,java-hamcrest-core)))
7839 (home-page "https://github.com/alexruiz/fest-util")
7840 (synopsis "FEST common utilities")
7841 (description "Common utilities used in all FEST module.")
7842 (license license:asl2.0)))
3c6c8358
JL
7843
7844(define-public java-fest-test
7845 (package
7846 (name "java-fest-test")
7847 (version "2.1.0")
7848 (source (origin
7849 (method url-fetch)
7850 (uri (string-append "https://github.com/alexruiz/fest-test/"
7851 "archive/fest-test-" version ".tar.gz"))
7852 (sha256
7853 (base32
7854 "1rxfbw6l9vc65iy1x3fb617qc6y4w2k430pgf1mfbxfdlxbm0f7g"))))
7855 (build-system ant-build-system)
7856 (arguments
7857 `(#:jar-name "java-fest-test.jar"
7858 #:source-dir "src/main/java"
7859 #:tests? #f)); no tests
7860 (inputs
7861 `(("junit" ,java-junit)))
7862 (home-page "https://github.com/alexruiz/fest-test")
7863 (synopsis "Common FEST testing infrastructure")
7864 (description "Fest-test contains the common FEST testing infrastructure.")
7865 (license license:asl2.0)))
ca98e448
JL
7866
7867(define-public java-fest-assert
7868 (package
7869 (name "java-fest-assert")
7870 (version "2.0M10")
7871 (source (origin
7872 (method url-fetch)
7873 (uri (string-append "https://github.com/alexruiz/fest-assert-2.x/"
7874 "archive/fest-assert-core-" version ".tar.gz"))
7875 (sha256
7876 (base32
7877 "1bi0iqavikzww6rxvz5jyg7y6bflv95s6ibryxx0xfcxrrw6i5lw"))))
7878 (build-system ant-build-system)
7879 (arguments
7880 `(#:jar-name "java-fest-assert.jar"
7881 #:source-dir "src/main/java"
7882 #:test-exclude
7883 (list
7884 "**/Abstract*.java"
7885 "**/*BaseTest.java"
7886 ;; Unable to set MockitoNamingPolicy on cglib generator which creates FastClasses
7887 "**/MessageFormatter_format_Test.java"
7888 "**/internal/*/*_assert*_Test.java")))
7889 (inputs
7890 `(("java-fest-util" ,java-fest-util)))
7891 (native-inputs
7892 `(("java-junit" ,java-junit)
7893 ("java-fest-test" ,java-fest-test)
7894 ("java-hamcrest-core" ,java-hamcrest-core)
7895 ("java-mockito" ,java-mockito-1)
7896 ("java-cglib" ,java-cglib)
7897 ("java-objenesis" ,java-objenesis)
7898 ("java-asm" ,java-asm)))
7899 (home-page "https://github.com/alexruiz/fest-assert-2.x")
7900 (synopsis "FEST fluent assertions")
7901 (description "FEST-Assert provides a fluent interface for assertions.")
7902 (license license:asl2.0)))
0442d897
JL
7903
7904(define-public java-testng
7905 (package
7906 (name "java-testng")
3422e10e 7907 (version "6.14.3")
0442d897 7908 (source (origin
36b39d16
RW
7909 (method git-fetch)
7910 (uri (git-reference
7911 (url "https://github.com/cbeust/testng.git")
7912 (commit version)))
7913 (file-name (string-append name "-" version "-checkout"))
0442d897
JL
7914 (sha256
7915 (base32
3422e10e 7916 "0y6vq30i5g276kw0v2bhbvci22ijg7ax49ap2611yqlhbs4d6dqv"))))
0442d897
JL
7917 (build-system ant-build-system)
7918 (arguments
7919 `(#:jdk ,icedtea-8; java.util.function
7920 #:jar-name "java-testng.jar"
7921 #:source-dir "src/main/java"
7922 #:phases
7923 (modify-phases %standard-phases
36b39d16
RW
7924 ;; FIXME: I don't know why these tests fail
7925 (add-after 'unpack 'delete-failing-tests
7926 (lambda _
7927 (substitute* "src/test/resources/testng.xml"
7928 (("<class name=\"test.configuration.github1625.TestRunnerIssue1625\"/>") "")
7929 (("<class name=\"test.serviceloader.ServiceLoaderTest\" />") ""))
7930 #t))
7931 ;; We don't have groovy
7932 (add-after 'unpack 'delete-groovy-tests
7933 (lambda _
7934 (delete-file-recursively "src/test/java/test/dependent/issue1648/")
7935 (substitute* "src/test/resources/testng.xml"
7936 (("<class name=\"test.dependent.issue1648.TestRunner\"/>") ""))
7937 #t))
0442d897
JL
7938 (add-before 'build 'copy-resources
7939 (lambda _
7940 (copy-recursively "src/main/resources" "build/classes")
7941 #t))
7942 (add-before 'check 'copy-test-resources
7943 (lambda _
7944 (copy-recursively "src/test/resources" "build/test-classes")
7945 #t))
7946 (replace 'check
7947 (lambda _
7948 (system* "ant" "compile-tests")
7949 ;; we don't have groovy
7950 (substitute* "src/test/resources/testng.xml"
7951 (("<class name=\"test.groovy.GroovyTest\" />") ""))
7952 (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH")
7953 ":build/classes"
7954 ":build/test-classes")
7955 "-Dtest.resources.dir=src/test/resources"
7956 "org.testng.TestNG" "src/test/resources/testng.xml")))))))
7957 (propagated-inputs
7958 `(("junit" ,java-junit)
7959 ("java-jsr305" ,java-jsr305)
7960 ("java-bsh" ,java-bsh)
7961 ("java-jcommander" ,java-jcommander)
7962 ("java-guice" ,java-guice)
7963 ("snakeyaml" ,java-snakeyaml)))
7964 (native-inputs
7965 `(("guava" ,java-guava)
7966 ("java-javax-inject" ,java-javax-inject)
7967 ("java-hamcrest" ,java-hamcrest-all)
7968 ("java-assertj" ,java-assertj)
36b39d16 7969 ("java-mockito" ,java-mockito-1)
0442d897
JL
7970 ("cglib" ,java-cglib)
7971 ("asm" ,java-asm)
7972 ("aopalliance" ,java-aopalliance)))
7973 (home-page "http://testng.org")
7974 (synopsis "Testing framework")
7975 (description "TestNG is a testing framework inspired from JUnit and NUnit
7976but introducing some new functionalities that make it more powerful and easier
7977to use.")
7978 (license license:asl2.0)))
1717a7de
JL
7979
7980(define-public java-jnacl
3e87923a
RW
7981 (let ((commit "094e819afdd63ea81a499b3bcb42a271006bebd9")
7982 (revision "2"))
7983 (package
7984 (name "java-jnacl")
7985 (version (string-append "0.1.0-" revision "." (string-take commit 7)))
7986 (source (origin
7987 (method git-fetch)
7988 (uri (git-reference
7989 (url "https://github.com/neilalexander/jnacl.git")
7990 (commit commit)))
6c34ad73 7991 (file-name (git-file-name name version))
3e87923a
RW
7992 (sha256
7993 (base32
7994 "1d6g6xhn83byv5943n7935wwjsk0ibk0qdvqgr699qqgqqmwisbb"))))
7995 (build-system ant-build-system)
7996 (arguments
8c7d32e0 7997 `(#:jar-name "jnacl.jar"
3e87923a
RW
7998 #:source-dir "src/main/java"
7999 #:jdk ,icedtea-8
8000 #:phases
8001 (modify-phases %standard-phases
8002 (add-before 'build 'fix-tests
8003 (lambda _
8004 (substitute* '("src/test/java/com/neilalexander/jnacl/NaClTest.java"
8005 "src/test/java/com/neilalexander/jnacl/NaclSecretBoxTest.java")
8006 (("assertions.Assertions") "assertions.api.Assertions"))
8007 #t))
8008 (replace 'check
8009 (lambda _
8010 (invoke "ant" "compile-tests")
8011 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
8012 ":build/classes"
8013 ":build/test-classes")
8014 "org.testng.TestNG" "-testclass"
8015 "build/test-classes/com/neilalexander/jnacl/NaclSecretBoxTest.class")
8016 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
8017 ":build/classes"
8018 ":build/test-classes")
8019 "org.testng.TestNG" "-testclass"
8020 "build/test-classes/com/neilalexander/jnacl/NaClTest.class")
8021 #t)))))
8022 (native-inputs
8023 `(("java-testng" ,java-testng)
8024 ("java-fest-util" ,java-fest-util)
8025 ("java-fest-assert" ,java-fest-assert)))
8026 (home-page "https://github.com/neilalexander/jnacl")
8027 (synopsis "Java implementation of NaCl")
8028 (description "Pure Java implementation of the NaCl: Networking and
1717a7de 8029Cryptography library.")
3e87923a 8030 (license license:bsd-2))))
eaf3cb7a
JL
8031
8032(define-public java-mvel2
8033 (package
8034 (name "java-mvel2")
8035 (version "2.3.1")
8036 (source (origin
8037 (method url-fetch)
8038 (uri (string-append "https://github.com/mvel/mvel/archive/mvel2-"
8039 version ".Final.tar.gz"))
8040 (sha256
8041 (base32
8042 "01ph5s9gm16l2qz58lg21w6fna7xmmrj7f9bzqr1jim7h9557d3z"))))
8043 (build-system ant-build-system)
8044 (arguments
8045 `(#:jar-name "mvel2.jar"
8046 #:source-dir "src/main/java"
8047 #:test-exclude
8048 (list "**/Abstract*.java"
8049 ;; Base class with no tests
8050 "**/MVELThreadTest.java")
8051 #:phases
8052 (modify-phases %standard-phases
8053 (add-after 'install 'install-bin
8054 (lambda* (#:key outputs #:allow-other-keys)
8055 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
8056 (mkdir-p bin)
8057 (with-output-to-file (string-append bin "/mvel2")
8058 (lambda _
8059 (display
8060 (string-append
8061 "#!" (which "bash") "\n"
8062 "if [ \"$#\" -ne \"2\" ]; then\n"
8063 "echo 'Usage: mvel2 <script> <out.dir>'\n"
8064 "exit\n"
8065 "fi\n"
8066 "java -Dout.dir=$2 -cp " (getenv "CLASSPATH")
8067 ":" (assoc-ref outputs "out") "/share/java/mvel2.jar"
8068 " org.mvel2.sh.Main $1"))))
8069 (chmod (string-append bin "/mvel2") #o755))
8070 #t)))))
8071 (native-inputs
8072 `(("junit" ,java-junit)
8073 ("hamcrest" ,java-hamcrest-core)))
8074 (home-page "https://github.com/mvel/mvel")
8075 (synopsis "MVFLEX Expression Language")
8076 (description "MVEL has largely been inspired by Java syntax, but has some
8077fundamental differences aimed at making it more efficient as an expression
8078language, such as operators that directly support collection, array and string
8079matching, as well as regular expressions. MVEL is used to evaluate expressions
8080written using Java syntax.
8081
8082In addition to the expression language, MVEL serves as a templating language for
8083configuration and string construction.")
8084 (license license:asl2.0)))
d54d7d31 8085
9e325e8c
RW
8086(define-public java-commons-jexl-2
8087 (package
8088 (name "java-commons-jexl")
8089 (version "2.1.1")
8090 (source (origin
8091 (method url-fetch)
8092 (uri (string-append "mirror://apache/commons/jexl/source/"
8093 "commons-jexl-" version "-src.tar.gz"))
8094 (sha256
8095 (base32
8096 "1ai7632bwwaxglb0nbpblpr2jw5g20afrsaq372ipkphi3ncy1jz"))))
8097 (build-system ant-build-system)
8098 (arguments
8099 `(#:jar-name "commons-jexl-2.jar"
8100 #:jdk ,icedtea-8
8101 #:source-dir "src/main/java"
8102 #:phases
8103 (modify-phases %standard-phases
8104 (add-before 'check 'disable-broken-tests
8105 (lambda* (#:key inputs #:allow-other-keys)
8106 (with-directory-excursion "src/test/java/org/apache/commons/jexl2/"
8107 (substitute* "ArithmeticTest.java"
8108 (("asserter.assertExpression\\(\"3 / 0\"") "//")
8109 (("asserter.assertExpression\\(\"imanull") "//"))
8110 ;; This test fails with "ambiguous method invocation"
8111 (delete-file "CacheTest.java")
8112 ;; This test doesn't have access to the temp directory
8113 (substitute* "ClassCreatorTest.java"
8114 (("java.io.tmpdir") "user.dir"))
8115 ;; This test fails in trying to detect whether it can run.
8116 (substitute* "ClassCreator.java"
8117 (("boolean canRun =.*") "boolean canRun = false;\n"))
8118 ;; ...and these tests depend on it.
8119 (delete-file "scripting/JexlScriptEngineOptionalTest.java")
8120 (delete-file "scripting/JexlScriptEngineTest.java"))
8121 #t))
8122 (add-before 'build 'run-javacc
8123 (lambda _
8124 (with-directory-excursion "src/main/java/org/apache/commons/jexl2/parser/"
080d0b60
RW
8125 (invoke "java" "jjtree" "Parser.jjt")
8126 (invoke "java" "javacc" "Parser.jj"))
8127 #t)))))
9e325e8c
RW
8128 (inputs
8129 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)))
8130 (native-inputs
8131 `(("java-junit" ,java-junit)
8132 ("java-hamcrest-core" ,java-hamcrest-core)
8133 ("javacc" ,javacc-4)))
8134 (home-page "https://commons.apache.org/proper/commons-jexl/")
8135 (synopsis "Java Expression Language ")
8136 (description "JEXL is a library intended to facilitate the implementation
8137of dynamic and scripting features in applications and frameworks written in
8138Java. JEXL implements an Expression Language based on some extensions to the
8139JSTL Expression Language supporting most of the constructs seen in
8140shell-script or ECMAScript. Its goal is to expose scripting features usable
8141by technical operatives or consultants working with enterprise platforms.")
8142 (license license:asl2.0)))
8143
d54d7d31
JL
8144(define-public java-lz4
8145 (package
8146 (name "java-lz4")
8147 (version "1.4.0")
8148 (source (origin
8149 (method url-fetch)
8150 (uri (string-append "https://github.com/lz4/lz4-java/archive/"
8151 version ".tar.gz"))
8152 (file-name (string-append name "-" version ".tar.gz"))
8153 (sha256
8154 (base32
8155 "096dm57p2lzqk28n0j2p52x2j3cvnsd2dfqn43n7vbwrkjsy7y54"))))
8156 (build-system ant-build-system)
8157 (arguments
8158 `(#:jar-name "lz4.jar"
8159 #:jdk ,icedtea-8
8160 #:source-dir "src/java:src/java-unsafe"
8161 #:tests? #f; FIXME: requires more dependencies
8162 #:phases
8163 (modify-phases %standard-phases
8164 (add-before 'configure 'generate-source
8165 (lambda _
8166 (with-directory-excursion "src/build/source_templates"
1b6bc516
RW
8167 (invoke "mvel2" "../gen_sources.mvel" "../../java"))
8168 #t)))))
d54d7d31
JL
8169 (native-inputs
8170 `(("mvel" ,java-mvel2)))
8171 (home-page "https://jpountz.github.io/lz4-java")
8172 (synopsis "Compression algorithm")
8173 (description "LZ4 - Java is a Java port of the popular lz4 compression
8174algorithms and xxHash hashing algorithm.")
8175 (license license:asl2.0)))
62315865
JL
8176
8177(define-public java-bouncycastle-bcprov
8178 (package
8179 (name "java-bouncycastle-bcprov")
8180 (version "1.58")
8181 (source (origin
8182 (method url-fetch)
8183 (uri "https://bouncycastle.org/download/bcprov-jdk15on-158.tar.gz")
8184 (sha256
8185 (base32
8186 "1hgkg96llbvgs8i0krwz2n0j7wlg6jfnq8w8kg0cc899j0wfmf3n"))))
8187 (build-system ant-build-system)
8188 (arguments
8189 `(#:jar-name "bouncycastle-bcprov.jar"
8190 #:tests? #f; no tests
8191 #:source-dir "src"
8192 #:phases
8193 (modify-phases %standard-phases
8194 (add-before 'configure 'unzip-src
8195 (lambda _
8196 (mkdir-p "src")
8197 (with-directory-excursion "src"
9be4b9fa
RW
8198 (invoke "unzip" "../src.zip"))
8199 #t)))))
62315865
JL
8200 (native-inputs
8201 `(("unzip" ,unzip)
8202 ("junit" ,java-junit)))
8203 (home-page "https://www.bouncycastle.org")
8204 (synopsis "Cryptographic library")
8205 (description "Bouncy Castle Provider (bcprov) is a cryptographic library
8206for the Java programming language.")
8207 (license license:expat)))
31208367
JL
8208
8209(define-public java-bouncycastle-bcpkix
8210 (package
8211 (name "java-bouncycastle-bcpkix")
8212 (version "1.58")
8213 (source (origin
8214 (method url-fetch)
8215 (uri "https://bouncycastle.org/download/bcpkix-jdk15on-158.tar.gz")
8216 (sha256
8217 (base32
8218 "0is7qay02803s9f7lhnfcjlz61ni3hq5d7apg0iil7nbqkbfbcq2"))))
8219 (build-system ant-build-system)
8220 (arguments
8221 `(#:jar-name "bouncycastle-bcpkix.jar"
8222 #:tests? #f; no tests
8223 #:source-dir "src"
8224 #:phases
8225 (modify-phases %standard-phases
8226 (add-before 'configure 'unzip-src
8227 (lambda _
8228 (mkdir-p "src")
8229 (with-directory-excursion "src"
201084ac
RW
8230 (invoke "unzip" "../src.zip"))
8231 #t)))))
31208367
JL
8232 (native-inputs
8233 `(("unzip" ,unzip)
8234 ("junit" ,java-junit)))
8235 (inputs
8236 `(("bcprov" ,java-bouncycastle-bcprov)))
8237 (home-page "https://www.bouncycastle.org")
8238 (synopsis "Cryptographic library")
8239 (description "Bouncy Castle Java API for PKIX, CMS, EAC, TSP, PKCS, OCSP,
8240CMP, and CRMF.")
8241 (license license:expat)))
a53d9ac0
JL
8242
8243(define-public java-lmax-disruptor
8244 (package
8245 (name "java-lmax-disruptor")
8246 (version "3.3.7")
8247 (source (origin
8248 (method url-fetch)
8249 (uri (string-append "https://github.com/LMAX-Exchange/disruptor/"
8250 "archive/" version ".tar.gz"))
8251 (file-name (string-append name "-" version ".tar.gz"))
8252 (sha256
8253 (base32
8254 "17da2gwj5abnlsfgn2xqjk5lgzbg4vkb0hdv2dvc8r2fx4bi7w3g"))))
8255 (build-system ant-build-system)
8256 (arguments
8257 `(#:jar-name "java-lmax-disruptor.jar"
8258 #:jdk ,icedtea-8
8259 #:tests? #f)); tests hang
8260 (inputs
8261 `(("junit" ,java-junit)
8262 ("java-hdrhistogram" ,java-hdrhistogram)
8263 ("java-jmock" ,java-jmock)
8264 ("java-jmock-legacy" ,java-jmock-legacy)
8265 ("java-jmock-junit4" ,java-jmock-junit4)
8266 ("java-hamcrest-all" ,java-hamcrest-all)))
8267 (native-inputs
8268 `(("cglib" ,java-cglib)
8269 ("objenesis" ,java-objenesis)
8270 ("asm" ,java-asm)))
8271 (home-page "https://www.lmax.com/disruptor")
8272 (synopsis "High performance inter-thread communication")
8273 (description "LMAX Disruptor is a software pattern and software component
8274for high performance inter-thread communication that avoids the need for
8275message queues or resource locking.")
8276 (license license:asl2.0)))
5619556b 8277
5e3abfc8
RW
8278(define-public java-commons-bcel
8279 (package
8280 (name "java-commons-bcel")
8281 (version "6.1")
8282 (source (origin
8283 (method url-fetch)
8284 (uri (string-append "mirror://apache/commons/bcel/source/bcel-"
8285 version "-src.tar.gz"))
8286 (sha256
8287 (base32
8288 "0j3x1rxd673k07psclk8k13rqh0x0mf2yy5qiwkiw4z3afa568jy"))))
8289 (build-system ant-build-system)
8290 (arguments
8291 `(#:jar-name "bcel.jar"
8292 #:jdk ,icedtea-8
8293 #:source-dir "src/main/java"
8294 #:test-dir "src/test/java"
8295 ;; FIXME: Tests require the unpackaged jna.
8296 #:tests? #f))
8297 (home-page "https://commons.apache.org/proper/commons-bcel/")
8298 (synopsis "Byte code engineering library")
8299 (description "The Byte Code Engineering Library (Apache Commons BCEL) is
8300intended to give users a convenient way to analyze, create, and
8301manipulate (binary) Java class files. Classes are represented by objects
8302which contain all the symbolic information of the given class: methods, fields
8303and byte code instructions, in particular.
8304
8305Such objects can be read from an existing file, be transformed by a
8306program (e.g. a class loader at run-time) and written to a file again. An
8307even more interesting application is the creation of classes from scratch at
8308run-time. The @dfn{Byte Code Engineering Library} (BCEL) may be also useful
8309if you want to learn about the @dfn{Java Virtual Machine} (JVM) and the format
8310of Java @code{.class} files.")
8311 (license license:asl2.0)))
8312
5619556b
JL
8313(define-public java-xerial-core
8314 (package
8315 (name "java-xerial-core")
8316 (version "2.1")
8317 (source (origin
8318 (method url-fetch)
8319 (uri (string-append "https://github.com/xerial/xerial-java/archive/"
8320 version ".tar.gz"))
8321 (file-name (string-append name "-" version ".tar.gz"))
8322 (sha256
8323 (base32
8324 "0d3g863i41bgalpa4xr3vm1h140l091n8iwgq5qvby5yivns9y8d"))))
8325 (build-system ant-build-system)
8326 (arguments
8327 `(#:jar-name "xerial-core.jar"
8328 #:source-dir "xerial-core/src/main/java"
8329 #:test-dir "xerial-core/src/test"
8330 #:phases
8331 (modify-phases %standard-phases
8332 (add-before 'build 'copy-resources
8333 (lambda _
8334 (copy-recursively "xerial-core/src/main/resources"
8335 "build/classes")
8336 #t)))))
8337 (native-inputs
8338 `(("junit" ,java-junit)
8339 ("hamcrest" ,java-hamcrest-core)))
8340 (home-page "https://github.com/xerial/xerial-java")
f4548394 8341 (synopsis "Data management libraries for Java")
5619556b 8342 (description "Xerial is a set of data management libraries for the Java
f4548394 8343programming language. The ultimate goal of the Xerial project is to manage
5619556b
JL
8344everything as database, including class objects, text format data, data
8345streams, etc.")
8346 (license license:asl2.0)))
8d6a4815
JL
8347
8348(define-public java-powermock-reflect
8349 (package
8350 (name "java-powermock-reflect")
8351 (version "1.7.3")
8352 (source (origin
8353 (method url-fetch)
8354 (uri (string-append "https://github.com/powermock/powermock/"
8355 "archive/powermock-" version ".tar.gz"))
8356 (file-name (string-append name "-" version ".tar.gz"))
8357 (sha256
8358 (base32
8359 "0sbgi5vqq7k72wzcdjb20s370vyd4hsbnx71pzb8ishml3gy7fwy"))
8360 (patches
8361 (search-patches "java-powermock-fix-java-files.patch"))))
8362 (build-system ant-build-system)
8363 (arguments
8364 `(#:jar-name "java-powermock-reflect.jar"
8365 #:jdk ,icedtea-8
8366 #:source-dir "powermock-reflect/src/main/java"
8367 #:test-dir "powermock-reflect/src/test"))
8368 (inputs
8369 `(("java-objenesis" ,java-objenesis)))
8370 (native-inputs
8371 `(("junit" ,java-junit)
8372 ("cglib" ,java-cglib)
8373 ("asm" ,java-asm)
8374 ("hamcrest" ,java-hamcrest-core)
8375 ("assertj" ,java-assertj)))
8376 (home-page "https://github.com/powermock/powermock")
8377 (synopsis "Mock library extension framework")
8378 (description "PowerMock is a framework that extends other mock libraries
8379such as EasyMock with more powerful capabilities. PowerMock uses a custom
8380classloader and bytecode manipulation to enable mocking of static methods,
8381constructors, final classes and methods, private methods, removal of static
8382initializers and more. By using a custom classloader no changes need to be
8383done to the IDE or continuous integration servers which simplifies adoption.")
8384 (license license:asl2.0)))
d4a4d5da
JL
8385
8386(define-public java-powermock-core
8387 (package
8388 (inherit java-powermock-reflect)
8389 (name "java-powermock-core")
8390 (arguments
8391 `(#:jar-name "java-powermock-core.jar"
8392 #:source-dir "powermock-core/src/main/java"
8393 #:test-dir "powermock-core/src/test"
8394 #:tests? #f; requires powermock-api
59e0021c
JL
8395 #:jdk ,icedtea-8
8396 #:phases
8397 (modify-phases %standard-phases
8398 (add-before 'build 'copy-resources
8399 (lambda _
8400 (copy-recursively "powermock-core/src/main/resources"
8401 "build/classes"))))))
d4a4d5da
JL
8402 (inputs
8403 `(("reflect" ,java-powermock-reflect)
8404 ("javassist" ,java-jboss-javassist)))
8405 (native-inputs
8406 `(("junit" ,java-junit)
8407 ("assertj" ,java-assertj)
8408 ("mockito" ,java-mockito-1)))))
2d5d65d7
JL
8409
8410(define-public java-powermock-api-support
8411 (package
8412 (inherit java-powermock-reflect)
8413 (name "java-powermock-api-support")
8414 (build-system ant-build-system)
8415 (arguments
8416 `(#:jar-name "java-powermock-api-support.jar"
8417 #:jdk ,icedtea-8
8418 #:source-dir "powermock-api/powermock-api-support/src/main/java"
8419 #:tests? #f)); no tests
8420 (inputs
8421 `(("core" ,java-powermock-core)
8422 ("reflect" ,java-powermock-reflect)))))
6c21d46c
JL
8423
8424(define-public java-powermock-modules-junit4-common
8425 (package
8426 (inherit java-powermock-reflect)
8427 (name "java-powermock-modules-junit4-common")
8428 (build-system ant-build-system)
8429 (arguments
8430 `(#:jar-name "java-powermock-modules-junit4-common.jar"
8431 #:jdk ,icedtea-8
8432 #:source-dir "powermock-modules/powermock-module-junit4-common/src/main/java"
8433 #:test-dir "powermock-modules/powermock-module-junit4-common/src/test"))
8434 (inputs
8435 `(("core" ,java-powermock-core)
8436 ("easymock" ,java-easymock)
8437 ("reflect" ,java-powermock-reflect)
8438 ("hamcrest" ,java-hamcrest-core)
8439 ("cglib" ,java-cglib)))))
33db1681
JL
8440
8441(define-public java-powermock-modules-junit4
8442 (package
8443 (inherit java-powermock-reflect)
8444 (name "java-powermock-modules-junit4")
8445 (build-system ant-build-system)
8446 (arguments
8447 `(#:jar-name "java-powermock-modules-junit4.jar"
8448 #:jdk ,icedtea-8
8449 #:source-dir "powermock-modules/powermock-module-junit4/src/main/java"
1124683d
JL
8450 #:test-dir "powermock-modules/powermock-module-junit4/src/test"
8451 #:phases
8452 (modify-phases %standard-phases
8453 (add-before 'build 'fix-junit-detection
8454 (lambda _
8455 ;; Our junit version is 4.12-SNAPSHOT
8456 (substitute* (find-files "powermock-modules/powermock-module-junit4"
8457 "PowerMockJUnit4MethodValidator.java")
8458 (("4.12") "4.12-SNAPSHOT")))))))
33db1681
JL
8459 (inputs
8460 `(("core" ,java-powermock-core)
8461 ("reflect" ,java-powermock-reflect)
8462 ("common" ,java-powermock-modules-junit4-common)
8463 ("cglib" ,java-cglib)))
8464 (native-inputs
8465 `(("easymock" ,java-easymock)
8466 ("hamcrest" ,java-hamcrest-core)
8467 ("objenesis" ,java-objenesis)
8468 ("asm" ,java-asm)
8469 ("junit" ,java-junit)))))
4d508975
JL
8470
8471(define-public java-powermock-api-easymock
8472 (package
8473 (inherit java-powermock-reflect)
8474 (name "java-powermock-api-easymock")
8475 (build-system ant-build-system)
8476 (arguments
8477 `(#:jar-name "java-powermock-api-easymock.jar"
8478 #:jdk ,icedtea-8
8479 #:source-dir "powermock-api/powermock-api-easymock/src/main/java"
8480 #:tests? #f; no tests
8481 #:phases
8482 (modify-phases %standard-phases
8483 (add-before 'build 'fix-file
8484 (lambda _
8485 ;; FIXME: This looks wrong, but it fixes a build error.
8486 (with-directory-excursion "powermock-api/powermock-api-easymock"
8487 (substitute* "src/main/java/org/powermock/api/easymock/PowerMock.java"
8488 (("classLoader instanceof MockClassLoader") "false")
8489 (("\\(\\(MockClassLoader\\) classLoader\\).*;") ";")))
8490 #t)))))
8491 (inputs
8492 `(("core" ,java-powermock-core)
8493 ("easymock" ,java-easymock)
8494 ("reflect" ,java-powermock-reflect)
8495 ("support" ,java-powermock-api-support)
8496 ("cglib" ,java-cglib)))))
5fb3e822
JL
8497
8498(define-public java-jboss-jms-api-spec
8499 (package
8500 (name "java-jboss-jms-api-spec")
8501 (version "2.0")
8502 (source (origin
8503 (method url-fetch)
8504 (uri (string-append "https://github.com/jboss/jboss-jms-api_spec/"
8505 "archive/jboss-jms-api_" version
8506 "_spec-1.0.1.Final.tar.gz"))
8507 (sha256
8508 (base32
8509 "07bqblw9kq2i8q92bz70fvavq5xjfkaixl8xa0m0cypjgy82rb7m"))))
8510 (build-system ant-build-system)
8511 (arguments
8512 `(#:jar-name "java-jboss-jms-api_spec.jar"
8513 #:jdk ,icedtea-8
8514 #:source-dir "."
8515 #:tests? #f)); no tests
8516 (home-page "https://github.com/jboss/jboss-jms-api_spec")
8517 (synopsis "Java Message Service API specification")
8518 (description "Java Message Service (JMS) API is used to send messages
8519messages between two or more clients. It is a messaging standard that allows
8520application components to create, send, receive, and read messages.")
8521 ; either gpl2 only with GPL Classpath Exception, or cddl.
8522 (license (list license:gpl2 license:cddl1.0))))
3ff47c66
JL
8523
8524(define-public java-mail
8525 (package
8526 (name "java-mail")
8527 (version "1.6.0")
8528 (source (origin
8529 (method url-fetch)
8530 (uri (string-append "https://github.com/javaee/javamail/archive/"
8531 "JAVAMAIL-1_6_0.tar.gz"))
8532 (sha256
8533 (base32
8534 "1b4rg7fpj50ld90a71iz2m4gm3f5cnw18p3q3rbrrryjip46kx92"))))
8535 (build-system ant-build-system)
8536 (arguments
8537 `(#:jar-name "java-mail.jar"
8538 #:jdk ,icedtea-8
8539 #:source-dir "mail/src/main/java"
8540 #:test-dir "mail/src/test"
8541 #:test-exclude
8542 (list "**/CollectorFormatterTest.java"
8543 "**/CompactFormatterTest.java"
8544 "**/DurationFilterTest.java"
8545 "**/MailHandlerTest.java"
8546 "**/GetLocalAddressTest.java"
8547 ;; FIXME: both end with:
8548 ;; java.lang.ClassNotFoundException:
8549 ;; javax.mail.internet.MimeMultipartParseTest
8550 "**/MimeMultipartParseTest.java"
8551 "**/SearchTermSerializationTest.java")
8552 #:phases
8553 (modify-phases %standard-phases
8554 (add-before 'configure 'move-version.java
8555 (lambda _
8556 (copy-file "mail/src/main/resources/javax/mail/Version.java"
218d1dde
RW
8557 "mail/src/main/java/javax/mail/Version.java")
8558 #t))
3ff47c66
JL
8559 (add-before 'build 'copy-resources
8560 (lambda _
8561 (copy-recursively "mail/src/main/resources/META-INF"
8562 "build/classes/META-INF")
8563 #t)))))
8564 (native-inputs
8565 `(("junit" ,java-junit)
8566 ("hamcrest" ,java-hamcrest-core)))
8567 (home-page "https://javaee.github.io/javamail/")
8568 (synopsis "Mail-related functionnalities in Java")
8569 (description "The JavaMail API provides a platform-independent and
8570protocol-independent framework to build mail and messaging applications.")
8571 ;; General Public License Version 2 only ("GPL") or the Common Development
8572 ;; and Distribution License("CDDL")
8573 (license (list license:cddl1.1
8574 license:gpl2)))); with classpath exception
217b20e4
JL
8575
8576(define-public java-jeromq
8577 (package
8578 (name "java-jeromq")
4aa0a1df 8579 (version "0.4.3")
217b20e4 8580 (source (origin
4aa0a1df
RW
8581 (method git-fetch)
8582 (uri (git-reference
8583 (url "https://github.com/zeromq/jeromq.git")
8584 (commit (string-append "v" version))))
8585 (file-name (string-append name "-" version "-checkout"))
217b20e4
JL
8586 (sha256
8587 (base32
594bd3a0
GB
8588 "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj"))
8589 (patches (search-patches "java-jeromq-fix-tests.patch"))))
217b20e4
JL
8590 (build-system ant-build-system)
8591 (arguments
8592 `(#:jar-name "java-jeromq.jar"
8593 #:source-dir "src/main/java"
8594 #:jdk ,icedtea-8
8595 #:test-exclude
8596 (list
8597 "**/Abstract*.java"
8598 ;; Requires network
8599 "**/ZBeaconTest.java"
8600 ;; Failures
4aa0a1df 8601 "**/DealerSpecTest.java"
217b20e4 8602 "**/CustomDecoderTest.java"
594bd3a0
GB
8603 "**/CustomEncoderTest.java"
8604 "**/ConnectRidTest.java"
8605 "**/ReqSpecTest.java"
8606 "**/PushPullSpecTest.java"
8607 "**/PubSubHwmTest.java"
8608 "**/RouterSpecTest.java"
8609 "**/ProxyTest.java")))
217b20e4
JL
8610 (inputs
8611 `(("java-jnacl" ,java-jnacl)))
8612 (native-inputs
8613 `(("java-hamcrest-core" ,java-hamcrest-core)
8614 ("junit" ,java-junit)))
8615 (home-page "http://zeromq.org/bindings:java")
8616 (synopsis "Java binding for 0MQ")
8617 (description "Jeromq provides the java bindings for 0MQ.")
8618 (license license:mpl2.0)))
46c6905a
JL
8619
8620(define-public java-kafka-clients
8621 (package
8622 (name "java-kafka-clients")
8623 (version "1.0.0")
8624 (source (origin
8625 (method url-fetch)
8626 (uri (string-append "mirror://apache/kafka/" version "/kafka-"
8627 version "-src.tgz"))
8628 (sha256
8629 (base32
8630 "1yxmnsmliwm7671q5yy9bl4jdqyyn00n26cggz9brwczx80w1vfq"))))
8631 (build-system ant-build-system)
8632 (arguments
8633 `(#:jar-name "java-kafka-clients.jar"
8634 #:jdk ,icedtea-8
8635 #:source-dir "clients/src/main/java"
8636 #:test-dir "clients/src/test"
8637 #:test-exclude
8638 (list
8639 ;; This file does not contain a class
8640 "**/IntegrationTest.java"
8641 ;; Requires network
8642 "**/ClientUtilsTest.java"
8643 ;; End with errors that seem related to our powermock
8644 "**/KafkaProducerTest.java"
8645 "**/BufferPoolTest.java")))
8646 (inputs
8647 `(("java-slf4j-api" ,java-slf4j-api)
8648 ("java-lz4" ,java-lz4)))
8649 (native-inputs
8650 `(("junit" ,java-junit)
8651 ("hamcrest" ,java-hamcrest-all)
8652 ("objenesis" ,java-objenesis)
8653 ("asm" ,java-asm)
8654 ("cglib" ,java-cglib)
8655 ("javassist" ,java-jboss-javassist)
8656 ("snappy" ,java-snappy)
8657 ("easymock" ,java-easymock)
8658 ("powermock" ,java-powermock-core)
8659 ("powermock-easymock" ,java-powermock-api-easymock)
8660 ("powermock-junit4-common" ,java-powermock-modules-junit4-common)
8661 ("powermock-junit4" ,java-powermock-modules-junit4)
8662 ("powermock-support" ,java-powermock-api-support)
8663 ("bouncycastle" ,java-bouncycastle-bcprov)
8664 ("bouncycastle-bcpkix" ,java-bouncycastle-bcpkix)))
8665 (home-page "https://kafka.apache.org")
8666 (synopsis "Distributed streaming platform")
8667 (description "Kafka is a distributed streaming platform, which means:
8668@itemize
8669@item it can publish and subscribe to streams of records;
8670@item it can store streams of records in a fault-tolerant way;
8671@item it can process streams of records as they occur.
8672@end itemize")
8673 ;; Either cddl or gpl2 only.
8674 (license (list license:cddl1.1; actually cddl1.1
8675 license:gpl2)))); with classpath exception
0b54e190
JL
8676
8677(define-public java-jdom
8678 (package
8679 (name "java-jdom")
8680 (version "1.1.3")
8681 (source (origin
8682 (method url-fetch)
8683 (uri (string-append "http://jdom.org/dist/binary/archive/jdom-"
8684 version ".tar.gz"))
8685 (sha256
8686 (base32
8687 "07wdpm3jwwc9q38kmdw40fvbmv6jzjrkrf8m0zqs58f79a672wfl"))))
8688 (build-system ant-build-system)
8689 (arguments
8690 `(#:build-target "package"
8691 #:tests? #f; tests are run as part of the build process
8692 #:phases
8693 (modify-phases %standard-phases
8694 (replace 'install
8695 (install-jars "build")))))
8696 (home-page "http://jdom.org/")
8697 (synopsis "Access, manipulate, and output XML data")
8698 (description "Java-based solution for accessing, manipulating, and
8699outputting XML data from Java code.")
8700 (license license:bsd-4)))
78745d33
JL
8701
8702(define-public java-geronimo-xbean-reflect
8703 (package
8704 (name "java-geronimo-xbean-reflect")
8705 (version "4.5")
8706 (source (origin
8707 (method svn-fetch)
8708 (uri (svn-reference
8709 (url "https://svn.apache.org/repos/asf/geronimo/xbean/tags/xbean-4.5/")
8710 (revision 1807396)))
8711 (file-name (string-append name "-" version))
8712 (sha256
8713 (base32
8714 "18q3i6jgm6rkw8aysfgihgywrdc5nvijrwnslmi3ww497jvri6ja"))))
8715 (build-system ant-build-system)
8716 (arguments
8717 `(#:jar-name "geronimo-xbean-reflect.jar"
8718 #:source-dir "xbean-reflect/src/main/java"
8719 #:test-dir "xbean-reflect/src/test"
8720 #:jdk ,icedtea-8
8721 #:test-exclude
8722 (list "**/Abstract*.java" "**/AsmParameterNameLoaderTest.java"
8723 "**/ObjectRecipeTest.java" "**/ParameterNameLoaderTest.java"
8724 "**/RecipeHelperTest.java" "**/XbeanAsmParameterNameLoaderTest.java")
8725 #:phases
8726 (modify-phases %standard-phases
8727 (add-before 'build 'fix-source
8728 (lambda _
8729 (let ((dir "xbean-reflect/src/main/java/org/apache/xbean/recipe/"))
8730 ;; org.apache.xbean.asm6 is actually repackaged java-asm
8731 (substitute* (string-append dir "XbeanAsmParameterNameLoader.java")
8732 (("org.apache.xbean.asm5") "org.objectweb.asm"))
8733 #t))))))
8734 (inputs
8735 `(("asm" ,java-asm)
8736 ("log4j" ,java-log4j-api)
8737 ("log4j-1.2" ,java-log4j-1.2-api)
8738 ("log4j-core" ,java-log4j-core)
8739 ("logging" ,java-commons-logging-minimal)))
8740 (native-inputs
8741 `(("junit" ,java-junit)))
8742 (home-page "https://geronimo.apache.org/maven/xbean/3.6/xbean-reflect/")
8743 (synopsis "Dependency injection helper")
8744 (description "Xbean-reflect provides very flexible ways to create objects
8745and graphs of objects for dependency injection frameworks")
8746 (license license:asl2.0)))
09c44196 8747
3fda539b
JL
8748(define-public java-geronimo-xbean-bundleutils
8749 (package
8750 (inherit java-geronimo-xbean-reflect)
8751 (name "java-geronimo-xbean-bundleutils")
8752 (arguments
8753 `(#:jar-name "geronimo-xbean-bundleutils.jar"
8754 #:source-dir "xbean-bundleutils/src/main/java"
8755 #:test-dir "xbean-bundleutils/src/test"
8756 #:phases
8757 (modify-phases %standard-phases
8758 (add-before 'build 'fix-java
8759 (lambda _
8760 ;; We use a more recent version of osgi, so this file requires
8761 ;; more interface method implementations.
8762 (substitute* "xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java"
8763 (("import org.osgi.framework.ServiceRegistration;")
8764 "import org.osgi.framework.ServiceRegistration;
8765import org.osgi.framework.ServiceFactory;
8766import java.util.Collection;
8767import org.osgi.framework.ServiceObjects;")
8768 (("public Bundle getBundle\\(\\)")
8769 "@Override
8770public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
8771 throw new UnsupportedOperationException();
8772}
8773@Override
8774public <S> ServiceRegistration<S> registerService(Class<S> clazz,
8775 ServiceFactory<S> factory, Dictionary<String, ?> properties) {
8776 throw new UnsupportedOperationException();
8777}
8778public Bundle getBundle()"))
8779 #t)))))
8780 (inputs
8781 `(("java-slf4j" ,java-slf4j-api)
8782 ("java-asm" ,java-asm)
8783 ("java-osgi-framework" ,java-osgi-framework)
8784 ("java-eclipse-osgi" ,java-eclipse-osgi)
8785 ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)))))
0cb9ce32
JL
8786
8787(define-public java-geronimo-xbean-asm-util
8788 (package
8789 (inherit java-geronimo-xbean-reflect)
8790 (name "java-geronimo-xbean-asm-util")
8791 (arguments
8792 `(#:jar-name "geronimo-xbean-asm-util.jar"
8793 #:source-dir "xbean-asm-util/src/main/java"
8794 #:tests? #f)); no tests
8795 (inputs
8796 `(("java-asm" ,java-asm)))
8797 (native-inputs '())))
8d510f65
JL
8798
8799(define-public java-geronimo-xbean-finder
8800 (package
8801 (inherit java-geronimo-xbean-reflect)
8802 (name "java-geronimo-xbean-finder")
8803 (arguments
8804 `(#:jar-name "geronimo-xbean-finder.jar"
8805 #:source-dir "xbean-finder/src/main/java"
8806 #:test-dir "xbean-finder/src/test"))
8807 (inputs
8808 `(("java-slf4j-api" ,java-slf4j-api)
8809 ("java-asm" ,java-asm)
8810 ("java-geronimo-xbean-bundleutils" ,java-geronimo-xbean-bundleutils)
8811 ("java-geronimo-xbean-asm-util" ,java-geronimo-xbean-asm-util)
8812 ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)
8813 ("java-osgi-framework" ,java-osgi-framework)))
8814 (native-inputs
8815 `(("java-junit" ,java-junit)
8816 ("java-hamcrest-core" ,java-hamcrest-core)))))
3fda539b 8817
09c44196
JL
8818(define-public java-gson
8819 (package
8820 (name "java-gson")
8821 (version "2.8.2")
8822 (source (origin
8823 (method url-fetch)
8824 (uri (string-append "https://github.com/google/gson/archive/"
8825 "gson-parent-" version ".tar.gz"))
8826 (sha256
8827 (base32
8828 "1j4qnp7v046q0k48c4kyf69sxaasx2h949d3cqwsm3kzxms3x0f9"))))
8829 (build-system ant-build-system)
8830 (arguments
8831 `(#:jar-name "gson.jar"
8832 #:source-dir "gson/src/main/java"
8833 #:test-dir "gson/src/test"))
8834 (native-inputs
8835 `(("java-junit" ,java-junit)
8836 ("java-hamcrest-core" ,java-hamcrest-core)))
8837 (home-page "https://github.com/google/gson")
8838 (synopsis "Java serialization/deserialization library from/to JSON")
8839 (description "Gson is a Java library that can be used to convert Java
8840Objects into their JSON representation. It can also be used to convert a JSON
8841string to an equivalent Java object. Gson can work with arbitrary Java objects
8842including pre-existing objects that you do not have source-code of.")
8843 (license license:asl2.0)))
335aa20b
JL
8844
8845(define-public java-hawtjni
8846 (package
8847 (name "java-hawtjni")
8848 (version "1.15")
8849 (source (origin
8850 (method url-fetch)
8851 (uri (string-append "https://github.com/fusesource/hawtjni/archive/"
8852 "hawtjni-project-" version ".tar.gz"))
8853 (sha256
8854 (base32
8855 "1bqfd732rmh6svyx17fpw9175gc9gzkcbyps2yyrf50c3zzjas6g"))))
8856 (build-system ant-build-system)
8857 (arguments
8858 `(#:jar-name "hawtjni.jar"
8859 #:source-dir "hawtjni-generator/src/main/java:hawtjni-runtime/src/main/java"
8860 #:tests? #f; no tests
8861 #:phases
8862 (modify-phases %standard-phases
8863 (add-before 'build 'build-native
8864 (lambda* (#:key inputs #:allow-other-keys)
6338ea9a
RW
8865 (let ((include (string-append "-I" (assoc-ref inputs "jdk") "/include/linux")))
8866 (with-directory-excursion "hawtjni-generator/src/main/resources/"
8867 (invoke "gcc" "-c" "hawtjni.c" "-o" "hawtjni.o"
8868 "-fPIC" "-O2" include)
8869 (invoke "gcc" "-c" "hawtjni-callback.c" "-o" "hawtjni-callback.o"
8870 "-fPIC" "-O2" include)
8871 (invoke "gcc" "-o" "libhawtjni.so" "-shared"
8872 "hawtjni.o" "hawtjni-callback.o")))
8873 #t))
335aa20b
JL
8874 (add-after 'install 'install-native
8875 (lambda* (#:key outputs #:allow-other-keys)
8876 (let* ((out (assoc-ref outputs "out"))
8877 (lib (string-append out "/lib"))
8878 (inc (string-append out "/include")))
335aa20b 8879 (with-directory-excursion "hawtjni-generator/src/main/resources/"
6338ea9a
RW
8880 (install-file "libhawtjni.so" lib)
8881 (install-file "hawtjni.h" inc)))
335aa20b
JL
8882 #t)))))
8883 (inputs
8884 `(("java-commons-cli" ,java-commons-cli)
8885 ("java-asm" ,java-asm)
8886 ("java-geronimo-xbean-finder" ,java-geronimo-xbean-finder)))
8887 (home-page "https://fusesource.github.io/hawtjni/")
8888 (synopsis "JNI code generator")
8889 (description "HawtJNI is a code generator that produces the JNI code needed
8890to implement Java native methods. It is based on the jnigen code generator
8891that is part of the SWT Tools project.")
8892 (license license:asl2.0)))
d0c62afa
JL
8893
8894(define-public java-jansi-native
8895 (package
8896 (name "java-jansi-native")
8897 (version "1.7")
8898 (source (origin
8899 (method url-fetch)
8900 (uri (string-append "https://github.com/fusesource/jansi-native/"
8901 "archive/jansi-native-" version ".tar.gz"))
8902 (sha256
8903 (base32
8904 "0j2ydlgxbzbgshqkwghbxxxnbnx1mmjgd6k5fw6xfvxw1z956yqf"))))
8905 (build-system ant-build-system)
8906 (arguments
8907 `(#:jar-name "jansi-native.jar"
8908 #:source-dir "src/main/java"
8909 #:tests? #f; no tests
8910 #:phases
8911 (modify-phases %standard-phases
8912 (add-before 'build 'build-native
8913 (lambda* (#:key inputs #:allow-other-keys)
8914 ;; there are more required files for windows in windows/
8915 (with-directory-excursion "src/main/native-package/src"
8916 (substitute* "jansi_ttyname.c"
8917 (("#include \"jansi_.*") ""))
e85c1bf6
RW
8918 (invoke "gcc" "-c" "jansi_ttyname.c" "-o" "jansi_ttyname.o"
8919 (string-append "-I" (assoc-ref inputs "java-hawtjni")
8920 "/include")
8921 (string-append "-I" (assoc-ref inputs "jdk")
8922 "/include/linux")
8923 "-fPIC" "-O2")
8924 (invoke "gcc" "-o" "libjansi.so" "-shared" "jansi_ttyname.o")
8925 #t)))
d0c62afa
JL
8926 (add-before 'build 'install-native
8927 (lambda _
8928 (let ((dir (string-append "build/classes/META-INF/native/"
8929 ,(match (%current-system)
8930 ((or "i686-linux" "armhf-linux")
8931 "linux32")
8932 ((or "x86_64-linux" "aarch64-linux")
8933 "linux64")))))
8934 (install-file "src/main/native-package/src/libjansi.so" dir))
8935 #t))
8936 (add-after 'install 'install-native
8937 (lambda* (#:key outputs #:allow-other-keys)
d0c62afa
JL
8938 (install-file "src/main/native-package/src/jansi.h"
8939 (string-append (assoc-ref outputs "out") "/include"))
8940 #t)))))
8941 (inputs
8942 `(("java-hawtjni" ,java-hawtjni)))
8943 (home-page "https://fusesource.github.io/jansi/")
8944 (synopsis "Native library for jansi")
3d6925ef
RW
8945 (description "This package provides the native library for jansi, a small
8946Java library that allows you to use ANSI escape sequences to format your
8947console output.")
d0c62afa 8948 (license license:asl2.0)))
a87ea1ad
JL
8949
8950(define-public java-jansi
8951 (package
8952 (name "java-jansi")
8953 (version "1.16")
8954 (source (origin
8955 (method url-fetch)
8956 (uri (string-append "https://github.com/fusesource/jansi/archive/"
8957 "jansi-project-" version ".tar.gz"))
8958 (sha256
8959 (base32
8960 "11kh3144i3fzp21dpy8zg52mjmsr214k7km9p8ly0rqk2px0qq2z"))))
8961 (build-system ant-build-system)
8962 (arguments
8963 `(#:jar-name "jansi.jar"
8964 #:source-dir "jansi/src/main/java"
8965 #:test-dir "jansi/src/test"
8966 #:phases
8967 (modify-phases %standard-phases
8968 (add-after 'check 'clear-term
8969 (lambda _
8970 (zero? (system* "echo" "-e" "\\e[0m")))))))
8971 (inputs
8972 `(("java-jansi-native" ,java-jansi-native)))
8973 (native-inputs
8974 `(("java-junit" ,java-junit)
8975 ("java-hamcrest-core" ,java-hamcrest-core)))
8976 (home-page "https://fusesource.github.io/jansi/")
8977 (synopsis "Portable ANSI escape sequences")
8978 (description "Jansi is a Java library that allows you to use ANSI escape
8979sequences to format your console output which works on every platform.")
8980 (license license:asl2.0)))
cc061329
JL
8981
8982(define-public java-jboss-el-api-spec
8983 (package
8984 (name "java-jboss-el-api-spec")
8985 (version "3.0")
8986 (source (origin
8987 (method url-fetch)
8988 (uri (string-append "https://github.com/jboss/jboss-el-api_spec/"
8989 "archive/jboss-el-api_" version
8990 "_spec-1.0.7.Final.tar.gz"))
8991 (sha256
8992 (base32
8993 "1j45ljxalwlibxl7g7iv952sjxkw275m8vyxxij8l6wdd5pf0pdh"))))
8994 (build-system ant-build-system)
8995 (arguments
8996 `(#:jar-name "java-jboss-el-api_spec.jar"
8997 #:jdk ,icedtea-8))
8998 (inputs
8999 `(("java-junit" ,java-junit)))
9000 (home-page "https://github.com/jboss/jboss-el-api_spec")
9001 (synopsis "JSR-341 expression language 3.0 API")
9002 (description "This package contains an implementation of the JSR-341
9003specification for the expression language 3.0. It implements an expression
9004language inspired by ECMAScript and XPath. This language is used with
9005JavaServer Pages (JSP).")
9006 ;; Either GPL2 only or CDDL.
9007 (license (list license:gpl2 license:cddl1.1))))
cc03a786
JL
9008
9009(define-public java-jboss-interceptors-api-spec
9010 (package
9011 (name "java-jboss-interceptors-api-spec")
9012 (version "1.2")
9013 (source (origin
9014 (method url-fetch)
9015 (uri (string-append "https://github.com/jboss/jboss-interceptors-api_spec/"
9016 "archive/jboss-interceptors-api_" version
9017 "_spec-1.0.0.Final.tar.gz"))
9018 (sha256
9019 (base32
9020 "0wv8x0jp9a5qxlrgkhb5jdk2gr6vi87b4j4kjb8ryxiy9gn8g51z"))))
9021 (build-system ant-build-system)
9022 (arguments
9023 `(#:jar-name "java-jboss-interceptors-api_spec.jar"
9024 #:jdk ,icedtea-8
9025 #:source-dir "."
9026 #:tests? #f)); no tests
9027 (home-page "https://github.com/jboss/jboss-interceptors-api_spec")
9028 (synopsis "Interceptors 1.2 API classes from JSR 318")
9029 (description "Java-jboss-interceptors-api-spec implements the Interceptors
9030API. Interceptors are used to interpose on business method invocations and
9031specific events.")
9032 ;; Either GPL2 only or CDDL.
9033 (license (list license:gpl2 license:cddl1.1))))
a10a451c
JL
9034
9035(define-public java-cdi-api
9036 (package
9037 (name "java-cdi-api")
9038 (version "2.0")
9039 (source (origin
9040 (method url-fetch)
9041 (uri (string-append "https://github.com/cdi-spec/cdi/archive/"
9042 version ".tar.gz"))
9043 (file-name (string-append name "-" version ".tar.gz"))
9044 (sha256
9045 (base32
9046 "1iv8b8bp07c5kmqic14jsr868vycjv4qv02lf3pkgp9z21mnfg5y"))))
9047 (build-system ant-build-system)
9048 (arguments
9049 `(#:source-dir "api/src/main/java"
9050 #:jar-name "java-cdi-api.jar"
9051 #:test-dir "api/src/test"
9052 #:jdk ,icedtea-8
9053 #:tests? #f)); Tests fail because we don't have a CDI provider yet
9054 (inputs
9055 `(("java-javax-inject" ,java-javax-inject)
9056 ("java-jboss-el-api-spec" ,java-jboss-el-api-spec)
9057 ("java-jboss-interceptors-api-spec" ,java-jboss-interceptors-api-spec)))
9058 (native-inputs
9059 `(("java-testng" ,java-testng)
9060 ("java-hamcrest-core" ,java-hamcrest-core)))
9061 (home-page "http://cdi-spec.org/")
9062 (synopsis "Contexts and Dependency Injection APIs")
9063 (description "Java-cdi-api contains the required APIs for Contexts and
9064Dependency Injection (CDI).")
9065 (license license:asl2.0)))
d57fd728
JL
9066
9067(define-public java-joda-convert
9068 (package
9069 (name "java-joda-convert")
9070 (version "1.9.2")
9071 (source (origin
9072 (method url-fetch)
9073 (uri (string-append "https://github.com/JodaOrg/joda-convert/archive/v"
9074 version ".tar.gz"))
9075 (file-name (string-append name "-" version ".tar.gz"))
9076 (sha256
9077 (base32
9078 "0vp346xz7dh9br4q7xazhc7hvzf76a6hf95fki9bg67q5jr0kjh7"))))
9079 (build-system ant-build-system)
9080 (arguments
9081 `(#:jar-name (string-append ,name "-" ,version ".jar")
9082 #:source-dir "src/main/java"
9083 #:test-include (list "**/Test*.java")
9084 ;; Contains only interfaces and base classes (no test)
9085 #:test-exclude (list "**/test*/**.java")))
9086 (inputs
9087 `(("java-guava" ,java-guava)))
9088 (native-inputs
9089 `(("java-junit" ,java-junit)
9090 ("java-hamcrest-core" ,java-hamcrest-core)))
9091 (home-page "http://www.joda.org/joda-convert/")
9092 (synopsis "Conversion between Objects and Strings")
9093 (description "Joda-Convert provides a small set of classes to aid
9094conversion between Objects and Strings. It is not intended to tackle the
9095wider problem of Object to Object transformation.")
9096 (license license:asl2.0)))
0158ea8a
JL
9097
9098(define-public java-joda-time
9099 (package
9100 (name "java-joda-time")
9101 (version "2.9.9")
9102 (source (origin
9103 (method url-fetch)
9104 (uri (string-append "https://github.com/JodaOrg/joda-time/archive/v"
9105 version ".tar.gz"))
9106 (file-name (string-append name "-" version ".tar.gz"))
9107 (sha256
9108 (base32
9109 "1i9x91mi7yg2pasl0k3912f1pg46n37sps6rdb0v1gs8hj9ppwc1"))))
9110 (build-system ant-build-system)
9111 (arguments
9112 `(#:jar-name "java-joda-time.jar"
9113 #:source-dir "src/main/java"
9114 #:test-include (list "**/Test*.java")
9115 ;; There is no runnable test in these files
9116 #:test-exclude (list "**/Test*Chronology.java" "**/Test*Field.java")
9117 #:phases
9118 (modify-phases %standard-phases
9119 (add-after 'build 'build-resources
9120 (lambda _
9121 (mkdir-p "build/classes/org/joda/time/tz/data")
9122 (mkdir-p "build/classes/org/joda/time/format")
6d0368eb
JL
9123 ;; This will produce the following exception:
9124 ;; java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap"
9125 ;; which is normal, because it doesn't exist yet. It still generates
9126 ;; the same file as in the binary one can find on maven.
9127 (invoke "java" "-cp"
9128 (string-append "build/classes:" (getenv "CLASSPATH"))
9129 "org.joda.time.tz.ZoneInfoCompiler"
9130 "-src" "src/main/java/org/joda/time/tz/src"
9131 "-dst" "build/classes/org/joda/time/tz/data"
9132 "africa" "antarctica" "asia" "australasia"
9133 "europe" "northamerica" "southamerica"
9134 "pacificnew" "etcetera" "backward" "systemv")
0158ea8a
JL
9135 (for-each (lambda (f)
9136 (copy-file f (string-append
9137 "build/classes/org/joda/time/format/"
9138 (basename f))))
9139 (find-files "src/main/java/org/joda/time/format" ".*.properties"))
9140 #t))
9141 (add-before 'install 'regenerate-jar
9142 (lambda _
9143 ;; We need to regenerate the jar file to add generated data.
9144 (delete-file "build/jar/java-joda-time.jar")
6d0368eb 9145 (invoke "ant" "jar")))
0158ea8a
JL
9146 (add-before 'check 'copy-test-resources
9147 (lambda _
9148 (mkdir-p "build/test-classes/org/joda/time/tz/data")
9149 (copy-file "src/test/resources/tzdata/ZoneInfoMap"
9150 "build/test-classes/org/joda/time/tz/data/ZoneInfoMap")
9151 (copy-recursively "src/test/resources" "build/test-classes")
9152 #t)))))
9153 (inputs
9154 `(("java-joda-convert" ,java-joda-convert)))
9155 (native-inputs
9156 `(("java-junit" ,java-junit)
9157 ("java-hamcrest-core" ,java-hamcrest-core)
9158 ("tzdata" ,tzdata)))
9159 (home-page "http://www.joda.org/joda-time/")
9160 (synopsis "Replacement for the Java date and time classes")
9161 (description "Joda-Time is a replacement for the Java date and time
9162classes prior to Java SE 8.")
9163 (license license:asl2.0)))
6d0368eb
JL
9164
9165(define-public java-xerces
9166 (package
9167 (name "java-xerces")
9168 (version "2.11.0")
9169 (source
9170 (origin
9171 (method url-fetch)
9172 (uri (string-append "mirror://apache/xerces/j/source/"
9173 "Xerces-J-src." version ".tar.gz"))
9174 (sha256
9175 (base32 "1006igwy2lqrmjvdk64v8dg6qbk9c29pm8xxx7r87n0vnpvmx6pm"))
9176 (patches (search-patches
9177 "java-xerces-xjavac_taskdef.patch"
9178 "java-xerces-build_dont_unzip.patch"
9179 "java-xerces-bootclasspath.patch"))))
9180 (build-system ant-build-system)
9181 (arguments
9182 `(#:tests? #f;; Test files are not present
9183 #:test-target "test"
9184 #:jdk ,icedtea-8
9185 #:phases
9186 (modify-phases %standard-phases
9187 (add-after 'unpack 'create-build.properties
9188 (lambda* (#:key inputs #:allow-other-keys)
9189 (let ((jaxp (assoc-ref inputs "java-jaxp"))
9190 (resolver (assoc-ref inputs "java-apache-xml-commons-resolver")))
9191 (with-output-to-file "build.properties"
9192 (lambda _
9193 (format #t
9194 "jar.jaxp = ~a/share/java/jaxp.jar~@
9195 jar.apis-ext = ~a/share/java/jaxp.jar~@
9196 jar.resolver = ~a/share/java/xml-resolver.jar~%"
9197 jaxp jaxp resolver)))
9198 ;; Make xerces use our version of jaxp in tests
9199 (substitute* "build.xml"
9200 (("xml-apis.jar")
9201 (string-append jaxp "/share/java/jaxp.jar"))
9202 (("\\$\\{tools.dir\\}/\\$\\{jar.apis\\}")
9203 "${jar.apis}")))
9204 #t))
9205 (replace 'install (install-jars "build")))))
9206 (inputs
9207 `(("java-apache-xml-commons-resolver" ,java-apache-xml-commons-resolver)
9208 ("java-jaxp" ,java-jaxp)))
9209 (home-page "https://xerces.apache.org/xerces2-j/")
9210 (synopsis "Validating XML parser for Java with DOM level 3 support")
9211 (description "The Xerces2 Java parser is the reference implementation of
9212XNI, the Xerces Native Interface, and also a fully conforming XML Schema
9213processor.
9214
9215Xerces2-J supports the following standards and APIs:
9216
9217@itemize
9218@item eXtensible Markup Language (XML) 1.0 Second Edition Recommendation
9219@item Namespaces in XML Recommendation
9220@item Document Object Model (DOM) Level 2 Core, Events, and Traversal and
9221 Range Recommendations
9222@item Simple API for XML (SAX) 2.0.1 Core and Extension
9223@item Java APIs for XML Processing (JAXP) 1.2.01
9224@item XML Schema 1.0 Structures and Datatypes Recommendations
9225@item Experimental implementation of the Document Object Model (DOM) Level 3
9226 Core and Load/Save Working Drafts
9227@item Provides a partial implementation of the XML Inclusions (XInclude) W3C
9228 Candidate Recommendation
9229@end itemize
9230
9231Xerces is now able to parse documents written according to the XML 1.1
9232Candidate Recommendation, except that it does not yet provide an option to
9233enable normalization checking as described in section 2.13 of this
9234specification. It also handles namespaces according to the XML Namespaces 1.1
9235Candidate Recommendation, and will correctly serialize XML 1.1 documents if
9236the DOM level 3 load/save API's are in use.")
9237 (license license:asl2.0)))
e06bf428
JL
9238
9239(define-public java-jline
9240 (package
9241 (name "java-jline")
9242 (version "1.0")
9243 (source (origin
9244 (method url-fetch)
9245 (uri (string-append "https://github.com/jline/jline1/archive/jline-"
9246 version ".tar.gz"))
9247 (sha256
9248 (base32
9249 "0bi3p6vrh7a6v0fbpb6rx9plpmx5zk3lr352xzdbz2jcxg499wir"))))
9250 (build-system ant-build-system)
9251 (arguments
9252 `(#:jar-name "jline.jar"
9253 #:source-dir "src/main/java"
9254 #:test-dir "src/test"
9255 #:phases
9256 (modify-phases %standard-phases
9257 (add-before 'build 'copy-resources
9258 (lambda _
9259 (copy-recursively "src/main/resources" "build/classes")
9260 #t)))))
9261 (native-inputs
9262 `(("java-junit" ,java-junit)))
9263 (home-page "https://jline.github.io")
9264 (synopsis "Console input handling library")
9265 (description "JLine is a Java library for handling console input. It is
9266similar in functionality to BSD editline and GNU readline but with additional
9267features that bring it on par with the Z shell line editor.")
9268 (license license:bsd-3)))
7ac4f054
JL
9269
9270(define-public java-xmlunit
9271 (package
9272 (name "java-xmlunit")
9273 (version "2.5.1")
9274 (source (origin
9275 (method url-fetch)
9276 (uri (string-append "https://github.com/xmlunit/xmlunit/archive/v"
9277 version ".tar.gz"))
9278 (file-name (string-append name "-" version ".tar.gz"))
9279 (sha256
9280 (base32
9281 "035rivlnmwhfqj0fzviciv0bkh1h95ps1iwnh2kjcvdbk5nccm4z"))))
9282 (build-system ant-build-system)
9283 (arguments
9284 `(#:jar-name "java-xmlunit.jar"
9285 #:source-dir "xmlunit-core/src/main/java"
9286 #:test-dir "xmlunit-core/src/test"
9287 #:phases
9288 (modify-phases %standard-phases
9289 (add-before 'check 'copy-test-resources
9290 (lambda* (#:key inputs #:allow-other-keys)
9291 (copy-recursively (assoc-ref inputs "resources") "../test-resources")
9292 #t)))))
9293 (native-inputs
9294 `(("java-junit" ,java-junit)
9295 ("java-mockito-1" ,java-mockito-1)
9296 ("java-hamcrest-all" ,java-hamcrest-all)
9297 ("java-objenesis" ,java-objenesis)
9298 ("java-asm" ,java-asm)
9299 ("java-cglib" ,java-cglib)
9300 ("resources"
9301 ,(origin
9302 (method git-fetch)
9303 (uri (git-reference
9304 (url "https://github.com/xmlunit/test-resources.git")
9305 (commit "a590d2ae865c3e0455691d76ba8eefccc2215aec")))
9306 (file-name "java-xmlunit-test-resources")
9307 (sha256
9308 (base32
9309 "0r0glj37pg5l868yjz78gckr91cs8fysxxbp9p328dssssi91agr"))))))
9310 (home-page "http://www.xmlunit.org/")
9311 (synopsis "XML output testing")
9312 (description "XMLUnit provides you with the tools to verify the XML you
9313emit is the one you want to create. It provides helpers to validate against
9314an XML Schema, assert the values of XPath queries or compare XML documents
9315against expected outcomes.")
9316 (license license:asl2.0)))
73a1f10a
JL
9317
9318(define-public java-xmlunit-legacy
9319 (package
9320 (inherit java-xmlunit)
9321 (name "java-xmlunit-legacy")
9322 (arguments
9323 `(#:jar-name "java-xmlunit-legacy.jar"
9324 #:source-dir "xmlunit-legacy/src/main/java"
9325 #:test-dir "xmlunit-legacy/src/test"))
9326 (inputs
9327 `(("java-xmlunit" ,java-xmlunit)
9328 ("java-junit" ,java-junit)))
9329 (native-inputs
9330 `(("java-mockito-1" ,java-mockito-1)))))
93abc975
RW
9331
9332(define-public java-openchart2
9333 (package
9334 (name "java-openchart2")
9335 (version "1.4.3")
9336 (source (origin
9337 (method url-fetch)
9338 (uri (string-append "http://download.approximatrix.com/openchart2/"
9339 "openchart2-" version ".source.zip"))
9340 (sha256
9341 (base32
9342 "1xq96zm5r02n1blja0072jmmsifmxc40lbyfbnmcnr6mw42frh4g"))))
9343 (build-system ant-build-system)
9344 (arguments
9345 `(#:test-target "test"
9346 #:phases
9347 (modify-phases %standard-phases
9348 (add-after 'unpack 'fix-junit-errors
9349 (lambda _
9350 (with-directory-excursion "unittest/src/com/approximatrix/charting/"
9351 (substitute* '("coordsystem/ticklocator/NumericXTickLocatorTest.java"
9352 "coordsystem/ticklocator/NumericYTickLocatorTest.java"
9353 "coordsystem/ticklocator/ObjectXTickLocatorTest.java"
9354 "model/DefaultChartDataModelConstraintsTest.java"
9355 "model/MultiScatterDataModelConstraintsTest.java"
9356 "model/threedimensional/DotPlotDataModelConstraintsTest.java")
9357 (("(assertEquals[^;]+);" before _)
9358 (string-append (string-drop-right before 2) ", 1E-6);"))))
9359 #t))
9360 (replace 'install (install-jars ".")))))
9361 (native-inputs
9362 `(("unzip" ,unzip)
9363 ("java-junit" ,java-junit)
9364 ("java-hamcrest-core" ,java-hamcrest-core)))
9365 (home-page "http://approximatrix.com/products/openchart2/")
9366 (synopsis "Simple plotting for Java")
9367 (description "Openchart2 provides a simple, yet powerful, interface for
9368Java programmers to create two-dimensional charts and plots. The library
9369features an assortment of graph styles, including advanced scatter plots, bar
9370graphs, and pie charts.")
9371 (license license:lgpl2.1+)))