gnu: Add java-openjfx-controls.
[jackhill/guix/guix.git] / gnu / packages / java.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
4 ;;; Copyright © 2016, 2017 Roel Janssen <roel@gnu.org>
5 ;;; Copyright © 2017, 2019 Carlo Zancanaro <carlo@zancanaro.id.au>
6 ;;; Copyright © 2017-2020 Julien Lepiller <julien@lepiller.eu>
7 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
8 ;;; Copyright © 2016, 2017, 2018 Alex Vong <alexvong1995@gmail.com>
9 ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2018, 2019 Gábor Boskovits <boskovits@gmail.com>
11 ;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
12 ;;; Copyright © 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
13 ;;; Copyright © 2019, 2020, 2021 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
14 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
15 ;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
16 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
17 ;;; Copyright © 2021 Vincent Legoll <vincent.legoll@gmail.com>
18 ;;;
19 ;;; This file is part of GNU Guix.
20 ;;;
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
25 ;;;
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
30 ;;;
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33
34 (define-module (gnu packages java)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (guix packages)
37 #:use-module (guix download)
38 #:use-module (guix hg-download)
39 #:use-module (guix git-download)
40 #:use-module (guix svn-download)
41 #:use-module ((guix build utils) #:select (alist-replace))
42 #:use-module (guix utils)
43 #:use-module (guix build-system ant)
44 #:use-module (guix build-system gnu)
45 #:use-module (guix build-system trivial)
46 #:use-module (gnu packages)
47 #:use-module (gnu packages attr)
48 #:use-module (gnu packages autotools)
49 #:use-module (gnu packages base)
50 #:use-module (gnu packages bash)
51 #:use-module (gnu packages certs)
52 #:use-module (gnu packages cpio)
53 #:use-module (gnu packages cups)
54 #:use-module (gnu packages compression)
55 #:use-module (gnu packages elf)
56 #:use-module (gnu packages fontutils)
57 #:use-module (gnu packages gawk)
58 #:use-module (gnu packages gettext)
59 #:use-module (gnu packages gl)
60 #:use-module (gnu packages ghostscript) ;lcms
61 #:use-module (gnu packages gnome)
62 #:use-module (gnu packages groovy)
63 #:use-module (gnu packages gtk)
64 #:use-module (gnu packages guile)
65 #:use-module (gnu packages icu4c)
66 #:use-module (gnu packages image)
67 #:use-module (gnu packages java-compression)
68 #:use-module (gnu packages libffi)
69 #:use-module (gnu packages linux) ;alsa
70 #:use-module (gnu packages maths)
71 #:use-module (gnu packages maven)
72 #:use-module (gnu packages maven-parent-pom)
73 #:use-module (gnu packages nss)
74 #:use-module (gnu packages onc-rpc)
75 #:use-module (gnu packages web)
76 #:use-module (gnu packages wget)
77 #:use-module (gnu packages pkg-config)
78 #:use-module (gnu packages perl)
79 #:use-module (gnu packages popt)
80 #:use-module (gnu packages kerberos)
81 #:use-module (gnu packages xml)
82 #:use-module (gnu packages xorg)
83 #:use-module (gnu packages texinfo)
84 #:use-module ((srfi srfi-1) #:select (fold alist-delete))
85 #:use-module (srfi srfi-11)
86 #:use-module (ice-9 match))
87
88 \f
89 ;;;
90 ;;; Java bootstrap toolchain.
91 ;;;
92
93 ;; The Java bootstrap begins with Jikes, a Java compiler written in C++. We
94 ;; use it to build a simple version of GNU Classpath, the Java standard
95 ;; library. We chose version 0.93 because it is the last version that can be
96 ;; built with Jikes. With Jikes and this version of GNU Classpath we can
97 ;; build JamVM, a Java Virtual Machine. We build version 1.5.1 because it is
98 ;; the last version of JamVM that works with a version of GNU classpath that
99 ;; does not require ECJ. These three packages make up the bootstrap JDK.
100
101 ;; This is sufficient to build an older version of Ant, which is needed to
102 ;; build an older version of ECJ, an incremental Java compiler, both of which
103 ;; are written in Java.
104 ;;
105 ;; ECJ is needed to build the latest release (0.99) and the development
106 ;; version of GNU Classpath. The development version of GNU Classpath has
107 ;; much more support for Java 1.6 than the latest release, but we need to
108 ;; build 0.99 first to get a working version of javah. ECJ, the development
109 ;; version of GNU Classpath, and the latest version of JamVM make up the
110 ;; second stage JDK with which we can build the OpenJDK with the Icedtea 1.x
111 ;; build framework. We then build the more recent JDKs Icedtea 2.x and
112 ;; Icedtea 3.x.
113
114 (define-public libantlr3c
115 (package
116 (name "libantlr3c")
117 (version "3.4")
118 (source
119 (origin
120 (method url-fetch)
121 (uri
122 (string-append "https://www.antlr3.org/download/C/"
123 name "-" version ".tar.gz"))
124 (sha256
125 (base32 "0lpbnb4dq4azmsvlhp6khq1gy42kyqyjv8gww74g5lm2y6blm4fa"))))
126 (build-system gnu-build-system)
127 (arguments
128 `(#:configure-flags (list "--enable-debuginfo" "--disable-static")
129 #:phases (modify-phases %standard-phases
130 (replace 'configure
131 (lambda* (#:key build target native-inputs inputs outputs
132 (configure-flags '()) out-of-source? system
133 #:allow-other-keys)
134 (let ((configure (assoc-ref %standard-phases 'configure))
135 (enable-64bit? (member system '("aarch64-linux"
136 "x86_64-linux"
137 "mips64el-linux"))))
138 (configure #:build build #:target target
139 #:native-inputs native-inputs
140 #:inputs inputs #:outputs outputs
141 #:configure-flags `(,(if enable-64bit?
142 "--enable-64bit"
143 '())
144 ,@configure-flags)
145 #:out-of-source? out-of-source?)))))))
146 (synopsis "ANTLR C Library")
147 (description "LIBANTLR3C provides run-time C libraries for ANTLR3 (ANother
148 Tool for Language Recognition v3).")
149 (home-page "https://www.antlr3.org/")
150 (license license:bsd-3)))
151
152 (define jikes
153 (package
154 (name "jikes")
155 (version "1.22")
156 (source (origin
157 (method url-fetch)
158 (uri (string-append "mirror://sourceforge/jikes/Jikes/"
159 version "/jikes-" version ".tar.bz2"))
160 (sha256
161 (base32
162 "1qqldrp74pzpy5ly421srqn30qppmm9cvjiqdngk8hf47dv2rc0c"))))
163 (build-system gnu-build-system)
164 (home-page "http://jikes.sourceforge.net/")
165 (synopsis "Compiler for the Java language")
166 (description "Jikes is a compiler that translates Java source files as
167 defined in The Java Language Specification into the bytecoded instruction set
168 and binary format defined in The Java Virtual Machine Specification.")
169 (license license:ibmpl1.0)))
170
171 (define-public drip
172 ;; Last release is from 2014, with a few important commits afterwards.
173 (let ((commit "a4bd00df0199e78243847f06cc04ecaea31f8f08"))
174 (package
175 (name "drip")
176 (version (git-version "0.2.4" "1" commit))
177 (source (origin
178 (method git-fetch)
179 (uri (git-reference
180 (url "https://github.com/ninjudd/drip")
181 (commit commit)))
182 (file-name (git-file-name name version))
183 (sha256
184 (base32
185 "0wzmjwfyldr3jn49517xd8yn7dgdk8h88qkga3kjyg1zc375ylg2"))))
186 (build-system gnu-build-system)
187 (native-inputs
188 `(("jdk" ,icedtea "jdk")))
189 (arguments
190 `(#:tests? #f ; No tests.
191 #:phases
192 (modify-phases %standard-phases
193 (delete 'configure)
194 (add-before 'install 'fix-wrapper
195 (lambda* (#:key inputs #:allow-other-keys)
196 (let ((jps (string-append (assoc-ref inputs "jdk") "/bin/jps")))
197 (substitute* "bin/drip"
198 (("jps") jps)
199 (("brew update && brew upgrade drip") "guix pull && guix install drip")
200 ;; No need to make:
201 (("\\(cd -- \"\\$drip_dir\" && make -s\\) \\|\\| exit 1") "")
202 ;; No need to include source:
203 (("\\[\\[ -r \\$drip_dir/src/org/flatland/drip/Main\\.java \\]\\]")
204 "true"))
205 #t)))
206 (replace 'install
207 (lambda* (#:key outputs #:allow-other-keys)
208 (let* ((out (assoc-ref outputs "out"))
209 (bin (string-append out "/bin"))
210 (share (string-append out "/share/drip")))
211 (mkdir-p bin)
212 (for-each
213 (lambda (file)
214 (install-file (string-append "bin/" file) bin))
215 '("drip" "drip_daemon" "drip_proxy"))
216 (install-file "drip.jar" share)
217 (substitute* (string-append bin "/drip")
218 (("drip_dir=\\$bin_dir/..")
219 (string-append "drip_dir=" share)))
220 #t))))))
221 (home-page "https://github.com/ninjudd/drip")
222 (synopsis "Faster Java Virtual Machine launching")
223 (description "Drip is a launcher for the Java Virtual Machine that
224 provides much faster startup times than the @command{java} command. The @command{drip}
225 script is intended to be a drop-in replacement for the @command{java} command,
226 only faster.")
227 (license license:epl1.0))))
228
229 ;; This is the last version of GNU Classpath that can be built without ECJ.
230 (define classpath-bootstrap
231 (package
232 (name "classpath")
233 (version "0.93")
234 (source (origin
235 (method url-fetch)
236 (uri (string-append "mirror://gnu/classpath/classpath-"
237 version ".tar.gz"))
238 (sha256
239 (base32
240 "0i99wf9xd3hw1sj2sazychb9prx8nadxh2clgvk3zlmb28v0jbfz"))
241 (patches (search-patches "classpath-aarch64-support.patch"))))
242 (build-system gnu-build-system)
243 (arguments
244 `(#:configure-flags
245 (list (string-append "JAVAC="
246 (assoc-ref %build-inputs "jikes")
247 "/bin/jikes")
248 "--disable-Werror"
249 "--disable-gmp"
250 "--disable-gtk-peer"
251 "--disable-gconf-peer"
252 "--disable-plugin"
253 "--disable-dssi"
254 "--disable-alsa"
255 "--disable-gjdoc")
256 #:phases
257 (modify-phases %standard-phases
258 ;; XXX: This introduces a memory leak as we remove a call to free up
259 ;; memory for the file name string. This was necessary because of a
260 ;; runtime error that would have prevented us from building
261 ;; ant-bootstrap later. See https://issues.guix.gnu.org/issue/36685
262 ;; for the gnarly details.
263 (add-after 'unpack 'remove-call-to-free
264 (lambda _
265 (substitute* "native/jni/java-io/java_io_VMFile.c"
266 (("result = cpio_isFileExists.*" m)
267 (string-append m "\n//")))
268 #t))
269 (add-after 'install 'install-data
270 (lambda _ (invoke "make" "install-data"))))))
271 (native-inputs
272 `(("jikes" ,jikes)
273 ("fastjar" ,fastjar)
274 ("libltdl" ,libltdl)
275 ("pkg-config" ,pkg-config)))
276 (home-page "https://www.gnu.org/software/classpath/")
277 (synopsis "Essential libraries for Java")
278 (description "GNU Classpath is a project to create core class libraries
279 for use with runtimes, compilers and tools for the Java programming
280 language.")
281 ;; GPLv2 or later, with special linking exception.
282 (license license:gpl2+)))
283
284 ;; This is the last version of JamVM that works with a version of GNU
285 ;; classpath that does not require ECJ.
286 (define jamvm-1-bootstrap
287 (package
288 (name "jamvm")
289 (version "1.5.1")
290 (source (origin
291 (method url-fetch)
292 (uri (string-append "mirror://sourceforge/jamvm/jamvm/"
293 "JamVM%20" version "/jamvm-"
294 version ".tar.gz"))
295 (patches (search-patches "jamvm-1.5.1-aarch64-support.patch"
296 "jamvm-1.5.1-armv7-support.patch"))
297 (sha256
298 (base32
299 "06lhi03l3b0h48pc7x58bk9my2nrcf1flpmglvys3wyad6yraf36"))
300 (snippet
301 '(begin
302 ;; Remove precompiled software.
303 (delete-file "lib/classes.zip")
304 #t))))
305 (build-system gnu-build-system)
306 (arguments
307 `(#:configure-flags
308 (list (string-append "--with-classpath-install-dir="
309 (assoc-ref %build-inputs "classpath"))
310 "--disable-int-caching"
311 "--enable-runtime-reloc-checks"
312 "--enable-ffi")
313 #:phases
314 ,(if (string-prefix? "aarch64" (or (%current-system)
315 (%current-target-system)))
316 ;; Makefiles and the configure script need to be regenerated to
317 ;; incorporate support for AArch64.
318 '(modify-phases %standard-phases
319 (replace 'bootstrap
320 (lambda _ (invoke "autoreconf" "-vif"))))
321 '%standard-phases)))
322 (inputs
323 `(("classpath" ,classpath-bootstrap)
324 ("jikes" ,jikes)
325 ("libffi" ,libffi)
326 ("zip" ,zip)
327 ("zlib" ,zlib)))
328 (native-inputs
329 (if (string-prefix? "aarch64" (or (%current-system)
330 (%current-target-system)))
331 ;; Additional packages needed for autoreconf.
332 `(("autoconf" ,autoconf)
333 ("automake" ,automake)
334 ("libtool" ,libtool))
335 '()))
336 (home-page "http://jamvm.sourceforge.net/")
337 (synopsis "Small Java Virtual Machine")
338 (description "JamVM is a Java Virtual Machine conforming to the JVM
339 specification edition 2 (blue book). It is extremely small. However, unlike
340 other small VMs it supports the full spec, including object finalisation and
341 JNI.")
342 (license license:gpl2+)))
343
344 (define ant-bootstrap
345 (package
346 (name "ant-bootstrap")
347 ;; The 1.10.x series requires Java 8. 1.9.0 and later use generics, which
348 ;; are not supported. The 1.8.x series is the last to use only features
349 ;; supported by Jikes.
350 (version "1.8.4")
351 (source (origin
352 (method url-fetch)
353 (uri (string-append "mirror://apache/"
354 "ant/source/apache-ant-"
355 version "-src.tar.bz2"))
356 (sha256
357 (base32
358 "1cg0lga887qz5iizh6mlkxp01lciymrhmp7wzxpl6zpnldxmzrjx"))))
359 (build-system gnu-build-system)
360 (arguments
361 `(#:imported-modules ((guix build syscalls)
362 ,@%gnu-build-system-modules)
363 #:modules ((srfi srfi-1)
364 (guix build gnu-build-system)
365 (guix build utils)
366 (guix build syscalls))
367 #:tests? #f ; no "check" target
368 #:phases
369 (modify-phases %standard-phases
370 (delete 'bootstrap)
371 (delete 'configure)
372 (replace 'build
373 (lambda* (#:key inputs #:allow-other-keys)
374 (setenv "JAVA_HOME" (assoc-ref inputs "jamvm"))
375 (setenv "JAVACMD"
376 (string-append (assoc-ref inputs "jamvm")
377 "/bin/jamvm"))
378 (setenv "JAVAC"
379 (string-append (assoc-ref inputs "jikes")
380 "/bin/jikes"))
381 (setenv "CLASSPATH"
382 (string-append (assoc-ref inputs "jamvm")
383 "/lib/rt.jar"))
384
385 ;; Ant complains if this file doesn't exist.
386 (setenv "HOME" "/tmp")
387 (with-output-to-file "/tmp/.ant.properties"
388 (lambda _ (display "")))
389
390 ;; Use jikes instead of javac for <javac ...> tags in build.xml
391 (setenv "ANT_OPTS" "-Dbuild.compiler=jikes")
392
393 ;; jikes produces lots of warnings, but they are not very
394 ;; interesting, so we silence them.
395 (setenv "$BOOTJAVAC_OPTS" "-nowarn")
396
397 ;; Without these JamVM options the build may freeze.
398 (substitute* "bootstrap.sh"
399 (("^\"\\$\\{JAVACMD\\}\" " m)
400 ,@(if (string-prefix? "armhf" (or (%current-system)
401 (%current-target-system)))
402 `((string-append m "-Xnocompact "))
403 `((string-append m "-Xnocompact -Xnoinlining ")))))
404
405 ;; Disable tests because we are bootstrapping and thus don't have
406 ;; any of the dependencies required to build and run the tests.
407 (substitute* "build.xml"
408 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
409 (invoke "bash" "bootstrap.sh"
410 (string-append "-Ddist.dir="
411 (assoc-ref %outputs "out")))))
412 (add-after 'build 'strip-jar-timestamps ;based on ant-build-system
413 (lambda* (#:key outputs #:allow-other-keys)
414 (define (repack-archive jar)
415 (let* ((dir (mkdtemp! "jar-contents.XXXXXX"))
416 (manifest (string-append dir "/META-INF/MANIFESTS.MF")))
417 (with-directory-excursion dir
418 (invoke "unzip" jar))
419 (delete-file jar)
420 ;; XXX: copied from (gnu build install)
421 (for-each (lambda (file)
422 (let ((s (lstat file)))
423 (unless (eq? (stat:type s) 'symlink)
424 (utime file 0 0 0 0))))
425 (find-files dir #:directories? #t))
426 ;; It is important that the manifest appears first.
427 (with-directory-excursion dir
428 (let* ((files (find-files "." ".*" #:directories? #t))
429 ;; To ensure that the reference scanner can
430 ;; detect all store references in the jars
431 ;; we disable compression with the "-0" option.
432 (command (if (file-exists? manifest)
433 `("zip" "-0" "-X" ,jar ,manifest
434 ,@files)
435 `("zip" "-0" "-X" ,jar ,@files))))
436 (apply invoke command)))))
437 (for-each repack-archive
438 (find-files
439 (string-append (assoc-ref %outputs "out") "/lib")
440 "\\.jar$"))
441 #t))
442 (delete 'install))))
443 (native-inputs
444 `(("jikes" ,jikes)
445 ("jamvm" ,jamvm-1-bootstrap)
446 ("unzip" ,unzip)
447 ("zip" ,zip)))
448 (home-page "https://ant.apache.org")
449 (synopsis "Build tool for Java")
450 (description
451 "Ant is a platform-independent build tool for Java. It is similar to
452 make but is implemented using the Java language, requires the Java platform,
453 and is best suited to building Java projects. Ant uses XML to describe the
454 build process and its dependencies, whereas Make uses Makefile format.")
455 (license license:asl2.0)))
456
457 ;; Version 3.2.2 is the last version without a dependency on a full-fledged
458 ;; compiler for Java 1.5.
459 (define ecj-bootstrap
460 (package
461 (name "ecj-bootstrap")
462 (version "3.2.2")
463 (source (origin
464 (method url-fetch)
465 (uri (string-append "http://archive.eclipse.org/eclipse/"
466 "downloads/drops/R-" version
467 "-200702121330/ecjsrc.zip"))
468 (sha256
469 (base32
470 "05hj82kxd23qaglsjkaqcj944riisjha7acf7h3ljhrjyljx8307"))))
471 ;; It would be so much easier if we could use the ant-build-system, but we
472 ;; cannot as we don't have ant at this point. We use ecj for
473 ;; bootstrapping the JDK.
474 (build-system gnu-build-system)
475 (arguments
476 `(#:modules ((guix build gnu-build-system)
477 (guix build utils)
478 (srfi srfi-1))
479 #:tests? #f ; there are no tests
480 #:phases
481 (modify-phases %standard-phases
482 (replace 'configure
483 (lambda* (#:key inputs #:allow-other-keys)
484 (setenv "CLASSPATH"
485 (string-join
486 (cons (string-append (assoc-ref inputs "jamvm")
487 "/lib/rt.jar")
488 (find-files (string-append
489 (assoc-ref inputs "ant-bootstrap")
490 "/lib")
491 "\\.jar$"))
492 ":"))
493 #t))
494 (replace 'build
495 (lambda* (#:key inputs #:allow-other-keys)
496 ;; The unpack phase enters the "org" directory by mistake.
497 (chdir "..")
498
499 ;; Create a simple manifest to make ecj executable.
500 (with-output-to-file "manifest"
501 (lambda _
502 (display "Manifest-Version: 1.0
503 Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n")))
504
505 ;; Compile it all!
506 (and (apply invoke "jikes"
507 (find-files "." "\\.java$"))
508 (invoke "fastjar" "cvfm"
509 "ecj-bootstrap.jar" "manifest" "."))))
510 (replace 'install
511 (lambda* (#:key outputs #:allow-other-keys)
512 (let ((share (string-append (assoc-ref outputs "out")
513 "/share/java/")))
514 (mkdir-p share)
515 (install-file "ecj-bootstrap.jar" share)
516 #t))))))
517 (native-inputs
518 `(("ant-bootstrap" ,ant-bootstrap)
519 ("unzip" ,unzip)
520 ("jikes" ,jikes)
521 ("jamvm" ,jamvm-1-bootstrap)
522 ("fastjar" ,fastjar)))
523 (home-page "https://eclipse.org")
524 (synopsis "Eclipse Java development tools core batch compiler")
525 (description "This package provides the Eclipse Java core batch compiler
526 for bootstrapping purposes. The @dfn{Eclipse compiler for Java} (ecj) is a
527 requirement for all GNU Classpath releases after version 0.93.")
528 (license license:epl1.0)))
529
530 (define ecj-javac-wrapper
531 (package (inherit ecj-bootstrap)
532 (name "ecj-javac-wrapper")
533 (source #f)
534 (build-system trivial-build-system)
535 (arguments
536 `(#:modules ((guix build utils))
537 #:builder
538 (begin
539 (use-modules (guix build utils))
540 (let* ((bin (string-append (assoc-ref %outputs "out") "/bin"))
541 (target (string-append bin "/javac"))
542 (guile (string-append (assoc-ref %build-inputs "guile")
543 "/bin/guile"))
544 (ecj (string-append (assoc-ref %build-inputs "ecj-bootstrap")
545 "/share/java/ecj-bootstrap.jar"))
546 (java (string-append (assoc-ref %build-inputs "jamvm")
547 "/bin/jamvm"))
548 (bootcp (let ((jvmlib (string-append (assoc-ref %build-inputs "classpath")
549 "/share/classpath")))
550 (string-append jvmlib "/glibj.zip:"
551 jvmlib "/tools.zip"))))
552 (mkdir-p bin)
553 (with-output-to-file target
554 (lambda _
555 (format #t "#!~a --no-auto-compile\n!#\n" guile)
556 (write
557 `(begin (use-modules (ice-9 match)
558 (ice-9 receive)
559 (ice-9 hash-table)
560 (srfi srfi-1)
561 (srfi srfi-26))
562 (define defaults
563 '(("-bootclasspath" ,bootcp)
564 ("-source" "1.5")
565 ("-target" "1.5")
566 ("-cp" ".")))
567 (define (main args)
568 (let ((classpath (getenv "CLASSPATH")))
569 (setenv "CLASSPATH"
570 (string-join (list ,ecj
571 ,(string-append (assoc-ref %build-inputs "jamvm")
572 "/lib/rt.jar")
573 (or classpath ""))
574 ":")))
575 (receive (vm-args other-args)
576 ;; Separate VM arguments from arguments to ECJ.
577 (partition (cut string-prefix? "-J" <>)
578 (fold (lambda (default acc)
579 (if (member (first default) acc)
580 acc (append default acc)))
581 args defaults))
582 (apply system* ,java
583 (append
584 ;; Remove "-J" prefix
585 (map (cut string-drop <> 2) vm-args)
586 '("org.eclipse.jdt.internal.compiler.batch.Main")
587 (cons "-nowarn" other-args)))))
588 ;; Entry point
589 (let ((args (cdr (command-line))))
590 (if (null? args)
591 (format (current-error-port) "javac: no arguments given!\n")
592 (main args)))))))
593 (chmod target #o755)
594 #t))))
595 (native-inputs
596 `(("guile" ,guile-2.2)
597 ("ecj-bootstrap" ,ecj-bootstrap)
598 ("jamvm" ,jamvm-1-bootstrap)
599 ("classpath" ,classpath-bootstrap)))
600 (description "This package provides a wrapper around the @dfn{Eclipse
601 compiler for Java} (ecj) with a command line interface that is compatible with
602 the standard javac executable.")))
603
604 ;; The classpath-bootstrap was built without a virtual machine, so it does not
605 ;; provide a wrapper for javah. We cannot build the development version of
606 ;; Classpath without javah.
607 (define classpath-0.99
608 (package (inherit classpath-bootstrap)
609 (version "0.99")
610 (source (origin
611 (method url-fetch)
612 (uri (string-append "mirror://gnu/classpath/classpath-"
613 version ".tar.gz"))
614 (sha256
615 (base32
616 "1j7cby4k66f1nvckm48xcmh352b1d1b33qk7l6hi7dp9i9zjjagr"))
617 (patches (search-patches "classpath-aarch64-support.patch"))))
618 (arguments
619 `(#:configure-flags
620 (list (string-append "--with-ecj-jar="
621 (assoc-ref %build-inputs "ecj-bootstrap")
622 "/share/java/ecj-bootstrap.jar")
623 (string-append "JAVAC="
624 (assoc-ref %build-inputs "ecj-javac-wrapper")
625 "/bin/javac")
626 (string-append "JAVA="
627 (assoc-ref %build-inputs "jamvm")
628 "/bin/jamvm")
629 "GCJ_JAVAC_TRUE=no"
630 "ac_cv_prog_java_works=yes" ; trust me
631 "--disable-Werror"
632 "--disable-gmp"
633 "--disable-gtk-peer"
634 "--disable-gconf-peer"
635 "--disable-plugin"
636 "--disable-dssi"
637 "--disable-alsa"
638 "--disable-gjdoc")
639 #:phases
640 (modify-phases %standard-phases
641 (add-after 'install 'install-data
642 (lambda _ (invoke "make" "install-data"))))))
643 (native-inputs
644 `(("ecj-bootstrap" ,ecj-bootstrap)
645 ("ecj-javac-wrapper" ,ecj-javac-wrapper)
646 ("fastjar" ,fastjar)
647 ("jamvm" ,jamvm-1-bootstrap)
648 ("classpath" ,classpath-bootstrap)
649 ("libltdl" ,libltdl)
650 ("pkg-config" ,pkg-config)))))
651
652 ;; We need this because classpath-bootstrap does not provide all of the tools
653 ;; we need to build classpath-devel.
654 (define classpath-jamvm-wrappers
655 (package (inherit classpath-0.99)
656 (name "classpath-jamvm-wrappers")
657 (source #f)
658 (build-system trivial-build-system)
659 (arguments
660 `(#:modules ((guix build utils))
661 #:builder
662 (begin
663 (use-modules (guix build utils))
664 (let* ((bash (assoc-ref %build-inputs "bash"))
665 (jamvm (assoc-ref %build-inputs "jamvm"))
666 (classpath (assoc-ref %build-inputs "classpath"))
667 (bin (string-append (assoc-ref %outputs "out")
668 "/bin/")))
669 (mkdir-p bin)
670 (for-each (lambda (tool)
671 (with-output-to-file (string-append bin tool)
672 (lambda _
673 ,@(if (string-prefix? "armhf" (or (%current-system)
674 (%current-target-system)))
675 `((format #t "#!~a/bin/sh
676 ~a/bin/jamvm -Xnocompact -classpath ~a/share/classpath/tools.zip \
677 gnu.classpath.tools.~a.~a $@"
678 bash jamvm classpath tool
679 (if (string=? "native2ascii" tool)
680 "Native2ASCII" "Main")))
681 `((format #t "#!~a/bin/sh
682 ~a/bin/jamvm -Xnocompact -Xnoinlining -classpath ~a/share/classpath/tools.zip \
683 gnu.classpath.tools.~a.~a $@"
684 bash jamvm classpath tool
685 (if (string=? "native2ascii" tool)
686 "Native2ASCII" "Main"))))))
687 (chmod (string-append bin tool) #o755))
688 (list "javah"
689 "rmic"
690 "rmid"
691 "orbd"
692 "rmiregistry"
693 "native2ascii"))
694 #t))))
695 (native-inputs
696 `(("bash" ,bash)
697 ("jamvm" ,jamvm-1-bootstrap)
698 ("classpath" ,classpath-0.99)))
699 (inputs '())
700 (synopsis "Executables from GNU Classpath")
701 (description "This package provides wrappers around the tools provided by
702 the GNU Classpath library. They are executed by the JamVM virtual
703 machine.")))
704
705 ;; The last release of GNU Classpath is 0.99 and it happened in 2012. Since
706 ;; then Classpath has gained much more support for Java 1.6.
707 (define-public classpath-devel
708 (let ((commit "e7c13ee0cf2005206fbec0eca677f8cf66d5a103")
709 (revision "1"))
710 (package (inherit classpath-bootstrap)
711 (version (string-append "0.99-" revision "." (string-take commit 9)))
712 (source (origin
713 (method git-fetch)
714 (uri (git-reference
715 (url "https://git.savannah.gnu.org/git/classpath.git")
716 (commit commit)))
717 (file-name (string-append "classpath-" version "-checkout"))
718 (sha256
719 (base32
720 "1v2rww76ww322mpg3s12a1kkc6gkp31bm9gcxs532h0wq285fiw4"))
721 (patches (search-patches "classpath-aarch64-support.patch"))))
722 (arguments
723 `(#:make-flags
724 ;; Ensure that the initial heap size is smaller than the maximum
725 ;; size. By default only Xmx is set, which can lead to invalid
726 ;; memory settings on some machines with a lot of memory.
727 '("JAVAC_MEM_OPT=-J-Xms512M -J-Xmx768M")
728 #:configure-flags
729 (list (string-append "--with-ecj-jar="
730 (assoc-ref %build-inputs "ecj-bootstrap")
731 "/share/java/ecj-bootstrap.jar")
732 (string-append "--with-javac="
733 (assoc-ref %build-inputs "ecj-javac-wrapper")
734 "/bin/javac")
735 (string-append "JAVA="
736 (assoc-ref %build-inputs "jamvm")
737 "/bin/jamvm")
738 "GCJ_JAVAC_TRUE=no"
739 "ac_cv_prog_java_works=yes" ; trust me
740 "--disable-Werror"
741 "--disable-gmp"
742 "--disable-gtk-peer"
743 "--disable-gconf-peer"
744 "--disable-plugin"
745 "--disable-dssi"
746 "--disable-alsa"
747 "--disable-gjdoc")
748 #:phases
749 (modify-phases %standard-phases
750 ;; XXX The bootstrap phase executes autogen.sh, which fails after
751 ;; complaining about the lack of gettext.
752 (replace 'bootstrap
753 (lambda _ (invoke "autoreconf" "-vif")))
754 (add-after 'unpack 'remove-unsupported-annotations
755 (lambda _
756 (substitute* (find-files "java" "\\.java$")
757 (("@Override") ""))
758 #t))
759 (add-after 'install 'install-data
760 (lambda _ (invoke "make" "install-data"))))))
761 (native-inputs
762 `(("autoconf" ,autoconf)
763 ("automake" ,automake)
764 ("libtool" ,libtool)
765 ("gettext" ,gettext-minimal)
766 ("texinfo" ,texinfo)
767 ("classpath-jamvm-wrappers" ,classpath-jamvm-wrappers) ; for javah
768 ("ecj-bootstrap" ,ecj-bootstrap)
769 ("ecj-javac-wrapper" ,ecj-javac-wrapper)
770 ("fastjar" ,fastjar)
771 ("jamvm" ,jamvm-1-bootstrap)
772 ("libltdl" ,libltdl)
773 ("pkg-config" ,pkg-config))))))
774
775 (define jamvm
776 (package (inherit jamvm-1-bootstrap)
777 (version "2.0.0")
778 (source (origin
779 (method url-fetch)
780 (uri (string-append "mirror://sourceforge/jamvm/jamvm/"
781 "JamVM%20" version "/jamvm-"
782 version ".tar.gz"))
783 (sha256
784 (base32
785 "1nl0zxz8y5x8gwsrm7n32bry4dx8x70p8z3s9jbdvs8avyb8whkn"))
786 (patches
787 (search-patches "jamvm-2.0.0-disable-branch-patching.patch"
788 "jamvm-2.0.0-opcode-guard.patch"
789 "jamvm-2.0.0-aarch64-support.patch"))
790 (snippet
791 '(begin
792 ;; Remove precompiled software.
793 (delete-file "src/classlib/gnuclasspath/lib/classes.zip")
794 #t))))
795 (build-system gnu-build-system)
796 (arguments
797 (substitute-keyword-arguments (package-arguments jamvm-1-bootstrap)
798 ((#:configure-flags _)
799 '(list (string-append "--with-classpath-install-dir="
800 (assoc-ref %build-inputs "classpath"))))))
801 (inputs
802 `(("classpath" ,classpath-devel)
803 ("ecj-javac-wrapper" ,ecj-javac-wrapper)
804 ("zip" ,zip)
805 ("zlib" ,zlib)))))
806
807 (define ecj-javac-wrapper-final
808 (package (inherit ecj-javac-wrapper)
809 (native-inputs
810 `(("guile" ,guile-2.2)
811 ("ecj-bootstrap" ,ecj-bootstrap)
812 ("jamvm" ,jamvm)
813 ("classpath" ,classpath-devel)))))
814
815 ;; The bootstrap JDK consisting of jamvm, classpath-devel,
816 ;; ecj-javac-wrapper-final cannot build Icedtea 2.x directly, because it's
817 ;; written in Java 7. It can, however, build the unmaintained Icedtea 1.x,
818 ;; which uses Java 6 only.
819 (define-public icedtea-6
820 (package
821 (name "icedtea")
822 (version "1.13.13")
823 (source (origin
824 (method url-fetch)
825 (uri (string-append
826 "http://icedtea.wildebeest.org/download/source/icedtea6-"
827 version ".tar.xz"))
828 (sha256
829 (base32
830 "0bg9sb4f7qbq77c0zf9m17p47ga0kf0r9622g9p12ysg26jd1ksg"))
831 (patches (search-patches
832 "icedtea-6-extend-hotspot-aarch64-support.patch"))
833 (modules '((guix build utils)))
834 (snippet
835 '(begin
836 (substitute* "Makefile.in"
837 ;; do not leak information about the build host
838 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
839 "DISTRIBUTION_ID=\"\\\"guix\\\"\""))
840 #t))))
841 (build-system gnu-build-system)
842 (outputs '("out" ; Java Runtime Environment
843 "jdk" ; Java Development Kit
844 "doc")) ; all documentation
845 (arguments
846 `(;; There are many failing tests and many are known to fail upstream.
847 #:tests? #f
848
849 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
850 ;; gremlin) doesn't support it yet, so skip this phase.
851 #:validate-runpath? #f
852
853 #:modules ((guix build utils)
854 (guix build gnu-build-system)
855 (srfi srfi-19))
856
857 #:configure-flags
858 `("--enable-bootstrap"
859 "--enable-nss"
860 "--without-rhino"
861 ,(string-append "--with-parallel-jobs="
862 (number->string (parallel-job-count)))
863 "--disable-downloading"
864 "--disable-tests"
865 ,(string-append "--with-ecj="
866 (assoc-ref %build-inputs "ecj")
867 "/share/java/ecj-bootstrap.jar")
868 ,(string-append "--with-jar="
869 (assoc-ref %build-inputs "fastjar")
870 "/bin/fastjar")
871 ,(string-append "--with-jdk-home="
872 (assoc-ref %build-inputs "classpath"))
873 ,(string-append "--with-java="
874 (assoc-ref %build-inputs "jamvm")
875 "/bin/jamvm"))
876 #:phases
877 (modify-phases %standard-phases
878 (replace 'unpack
879 (lambda* (#:key source inputs #:allow-other-keys)
880 (invoke "tar" "xvf" source)
881 (chdir (string-append "icedtea6-" ,version))
882 (mkdir "openjdk")
883 (copy-recursively (assoc-ref inputs "openjdk-src") "openjdk")
884 ;; The convenient OpenJDK source bundle is no longer
885 ;; available for download, so we have to take the sources
886 ;; from the Mercurial repositories and change the Makefile
887 ;; to avoid tests for the OpenJDK zip archive.
888 (with-directory-excursion "openjdk"
889 (for-each (lambda (part)
890 (mkdir part)
891 (copy-recursively
892 (assoc-ref inputs
893 (string-append part "-src"))
894 part))
895 '("jdk" "hotspot" "corba"
896 "langtools" "jaxp" "jaxws")))
897 (substitute* "patches/freetypeversion.patch"
898 (("REQUIRED_FREETYPE_VERSION = 2.2.1")
899 "REQUIRED_FREETYPE_VERSION = 2.10.1"))
900 (substitute* "Makefile.in"
901 (("echo \"ERROR: No up-to-date OpenJDK zip available\"; exit -1;")
902 "echo \"trust me\";")
903 ;; The contents of the bootstrap directory must be
904 ;; writeable but when copying from the store they are
905 ;; not.
906 (("mkdir -p lib/rt" line)
907 (string-append line "; chmod -R u+w $(BOOT_DIR)")))
908 (invoke "chmod" "-R" "u+w" "openjdk")))
909 (add-after 'unpack 'use-classpath
910 (lambda* (#:key inputs #:allow-other-keys)
911 (let ((jvmlib (assoc-ref inputs "classpath"))
912 (jamvm (assoc-ref inputs "jamvm")))
913 ;; Classpath does not provide rt.jar.
914 (substitute* "Makefile.in"
915 (("\\$\\(SYSTEM_JDK_DIR\\)/jre/lib/rt.jar")
916 (string-append jvmlib "/share/classpath/glibj.zip")))
917 ;; Make sure we can find all classes.
918 (setenv "CLASSPATH"
919 (string-append jvmlib "/share/classpath/glibj.zip:"
920 jvmlib "/share/classpath/tools.zip:"
921 jamvm "/lib/rt.jar"))
922 (setenv "JAVACFLAGS"
923 (string-append "-cp "
924 jvmlib "/share/classpath/glibj.zip:"
925 jvmlib "/share/classpath/tools.zip")))
926 #t))
927 (add-after 'unpack 'patch-patches
928 (lambda _
929 ;; shebang in patches so that they apply cleanly
930 (substitute* '("patches/jtreg-jrunscript.patch"
931 "patches/hotspot/hs23/drop_unlicensed_test.patch")
932 (("#!/bin/sh") (string-append "#!" (which "sh"))))
933 #t))
934 (add-after 'unpack 'patch-paths
935 (lambda* (#:key inputs #:allow-other-keys)
936 ;; buildtree.make generates shell scripts, so we need to replace
937 ;; the generated shebang
938 (substitute* '("openjdk/hotspot/make/linux/makefiles/buildtree.make")
939 (("/bin/sh") (which "bash")))
940
941 (let ((corebin (string-append
942 (assoc-ref inputs "coreutils") "/bin/"))
943 (binbin (string-append
944 (assoc-ref inputs "binutils") "/bin/"))
945 (grepbin (string-append
946 (assoc-ref inputs "grep") "/bin/")))
947 (substitute* '("openjdk/jdk/make/common/shared/Defs-linux.gmk"
948 "openjdk/corba/make/common/shared/Defs-linux.gmk")
949 (("UNIXCOMMAND_PATH = /bin/")
950 (string-append "UNIXCOMMAND_PATH = " corebin))
951 (("USRBIN_PATH = /usr/bin/")
952 (string-append "USRBIN_PATH = " corebin))
953 (("DEVTOOLS_PATH *= */usr/bin/")
954 (string-append "DEVTOOLS_PATH = " corebin))
955 (("COMPILER_PATH *= */usr/bin/")
956 (string-append "COMPILER_PATH = "
957 (assoc-ref inputs "gcc") "/bin/"))
958 (("DEF_OBJCOPY *=.*objcopy")
959 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
960
961 ;; fix path to alsa header
962 (substitute* "openjdk/jdk/make/common/shared/Sanity.gmk"
963 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
964 (string-append "ALSA_INCLUDE="
965 (assoc-ref inputs "alsa-lib")
966 "/include/alsa/version.h")))
967
968 ;; fix hard-coded utility paths
969 (substitute* '("openjdk/jdk/make/common/shared/Defs-utils.gmk"
970 "openjdk/corba/make/common/shared/Defs-utils.gmk")
971 (("ECHO *=.*echo")
972 (string-append "ECHO = " (which "echo")))
973 (("^GREP *=.*grep")
974 (string-append "GREP = " (which "grep")))
975 (("EGREP *=.*egrep")
976 (string-append "EGREP = " (which "egrep")))
977 (("CPIO *=.*cpio")
978 (string-append "CPIO = " (which "cpio")))
979 (("READELF *=.*readelf")
980 (string-append "READELF = " (which "readelf")))
981 (("^ *AR *=.*ar")
982 (string-append "AR = " (which "ar")))
983 (("^ *TAR *=.*tar")
984 (string-append "TAR = " (which "tar")))
985 (("AS *=.*as")
986 (string-append "AS = " (which "as")))
987 (("LD *=.*ld")
988 (string-append "LD = " (which "ld")))
989 (("STRIP *=.*strip")
990 (string-append "STRIP = " (which "strip")))
991 (("NM *=.*nm")
992 (string-append "NM = " (which "nm")))
993 (("^SH *=.*sh")
994 (string-append "SH = " (which "bash")))
995 (("^FIND *=.*find")
996 (string-append "FIND = " (which "find")))
997 (("LDD *=.*ldd")
998 (string-append "LDD = " (which "ldd")))
999 (("NAWK *=.*(n|g)awk")
1000 (string-append "NAWK = " (which "gawk")))
1001 (("XARGS *=.*xargs")
1002 (string-append "XARGS = " (which "xargs")))
1003 (("UNZIP *=.*unzip")
1004 (string-append "UNZIP = " (which "unzip")))
1005 (("ZIPEXE *=.*zip")
1006 (string-append "ZIPEXE = " (which "zip")))
1007 (("SED *=.*sed")
1008 (string-append "SED = " (which "sed"))))
1009
1010 ;; Some of these timestamps cause problems as they are more than
1011 ;; 10 years ago, failing the build process.
1012 (substitute*
1013 "openjdk/jdk/src/share/classes/java/util/CurrencyData.properties"
1014 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
1015 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
1016 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
1017 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY"))
1018 #t)))
1019 (add-before 'configure 'set-additional-paths
1020 (lambda* (#:key inputs #:allow-other-keys)
1021 (setenv "CPATH"
1022 (string-append (assoc-ref inputs "libxrender")
1023 "/include/X11/extensions" ":"
1024 (assoc-ref inputs "libxtst")
1025 "/include/X11/extensions" ":"
1026 (assoc-ref inputs "libxinerama")
1027 "/include/X11/extensions" ":"
1028 (or (getenv "CPATH") "")))
1029 (setenv "ALT_CUPS_HEADERS_PATH"
1030 (string-append (assoc-ref inputs "cups")
1031 "/include"))
1032 (setenv "ALT_FREETYPE_HEADERS_PATH"
1033 (string-append (assoc-ref inputs "freetype")
1034 "/include"))
1035 (setenv "ALT_FREETYPE_LIB_PATH"
1036 (string-append (assoc-ref inputs "freetype")
1037 "/lib"))
1038 #t))
1039 (add-before 'build 'disable-os-version-check
1040 ;; allow build on linux major version change
1041 (lambda _
1042 (setenv "DISABLE_HOTSPOT_OS_VERSION_CHECK" "ok")
1043 #t))
1044 (replace 'install
1045 (lambda* (#:key outputs #:allow-other-keys)
1046 (let ((doc (string-append (assoc-ref outputs "doc")
1047 "/share/doc/icedtea"))
1048 (jre (assoc-ref outputs "out"))
1049 (jdk (assoc-ref outputs "jdk")))
1050 (copy-recursively "openjdk.build/docs" doc)
1051 (copy-recursively "openjdk.build/j2re-image" jre)
1052 (copy-recursively "openjdk.build/j2sdk-image" jdk))
1053 #t)))))
1054 (native-inputs
1055 `(("ant" ,ant-bootstrap)
1056 ("alsa-lib" ,alsa-lib)
1057 ("attr" ,attr)
1058 ("classpath" ,classpath-devel)
1059 ("coreutils" ,coreutils)
1060 ("cpio" ,cpio)
1061 ("cups" ,cups)
1062 ("ecj" ,ecj-bootstrap)
1063 ("ecj-javac" ,ecj-javac-wrapper-final)
1064 ("fastjar" ,fastjar)
1065 ("fontconfig" ,fontconfig)
1066 ("freetype" ,freetype)
1067 ("gtk" ,gtk+-2)
1068 ("gawk" ,gawk)
1069 ("giflib" ,giflib)
1070 ("grep" ,grep)
1071 ("jamvm" ,jamvm)
1072 ("lcms" ,lcms)
1073 ("libjpeg" ,libjpeg-turbo)
1074 ("libnsl" ,libnsl)
1075 ("libpng" ,libpng)
1076 ("libtool" ,libtool)
1077 ("libx11" ,libx11)
1078 ("libxcomposite" ,libxcomposite)
1079 ("libxi" ,libxi)
1080 ("libxinerama" ,libxinerama)
1081 ("libxrender" ,libxrender)
1082 ("libxslt" ,libxslt) ;for xsltproc
1083 ("libxt" ,libxt)
1084 ("libxtst" ,libxtst)
1085 ("mit-krb5" ,mit-krb5)
1086 ("nss" ,nss)
1087 ("nss-certs" ,nss-certs)
1088 ("perl" ,perl)
1089 ("pkg-config" ,pkg-config)
1090 ("procps" ,procps) ;for "free", even though I'm not sure we should use it
1091 ("unzip" ,unzip)
1092 ("wget" ,wget)
1093 ("which" ,which)
1094 ("zip" ,zip)
1095 ("zlib" ,zlib)
1096 ("openjdk-src"
1097 ,(origin
1098 (method hg-fetch)
1099 (uri (hg-reference
1100 (url "http://hg.openjdk.java.net/jdk6/jdk6/")
1101 (changeset "jdk6-b41")))
1102 (sha256
1103 (base32
1104 "14q47yfg586fs64w30g8mk92m5dkxsvr36zzh0ra99xk5x0x96mv"))))
1105 ("jdk-src"
1106 ,(origin
1107 (method hg-fetch)
1108 (uri (hg-reference
1109 (url "http://hg.openjdk.java.net/jdk6/jdk6/jdk/")
1110 (changeset "jdk6-b41")))
1111 (sha256
1112 (base32
1113 "165824nhg1k1dx6zs9dny0j49rmk35jw5b13dmz8c77jfajml4v9"))))
1114 ("hotspot-src"
1115 ,(origin
1116 (method hg-fetch)
1117 (uri (hg-reference
1118 (url "http://hg.openjdk.java.net/jdk6/jdk6/hotspot/")
1119 (changeset "jdk6-b41")))
1120 (sha256
1121 (base32
1122 "07lc1z4k5dj9nrc1wvwmpvxr3xgxrdkdh53xb95skk5ij49yagfd"))))
1123 ("corba-src"
1124 ,(origin
1125 (method hg-fetch)
1126 (uri (hg-reference
1127 (url "http://hg.openjdk.java.net/jdk6/jdk6/corba/")
1128 (changeset "jdk6-b41")))
1129 (sha256
1130 (base32
1131 "1p9g1r9dnax2iwp7yb59qx7m4nmshqhwmrb2b8jj8zgbd9dl2i3q"))))
1132 ("langtools-src"
1133 ,(origin
1134 (method hg-fetch)
1135 (uri (hg-reference
1136 (url "http://hg.openjdk.java.net/jdk6/jdk6/langtools/")
1137 (changeset "jdk6-b41")))
1138 (sha256
1139 (base32
1140 "1x52wd67fynbbd9ild6fb4wvba3f5hhwk03qdjfazd0a1qr37z3d"))))
1141 ("jaxp-src"
1142 ,(origin
1143 (method hg-fetch)
1144 (uri (hg-reference
1145 (url "http://hg.openjdk.java.net/jdk6/jdk6/jaxp/")
1146 (changeset "jdk6-b41")))
1147 (sha256
1148 (base32
1149 "0shlqrvzpr4nrkmv215lbxnby63s3yvbdh1yxcayznsyqwa4nlxm"))))
1150 ("jaxws-src"
1151 ,(origin
1152 (method hg-fetch)
1153 (uri (hg-reference
1154 (url "http://hg.openjdk.java.net/jdk6/jdk6/jaxws/")
1155 (changeset "jdk6-b41")))
1156 (sha256
1157 (base32
1158 "0835lkw8vib1xhp8lxnybhlvzdh699hbi4mclxanydjk63zbpxk0"))))))
1159 (home-page "http://icedtea.classpath.org")
1160 (synopsis "Java development kit")
1161 (description
1162 "This package provides the OpenJDK built with the IcedTea build harness.
1163 This version of the OpenJDK is no longer maintained and is only used for
1164 bootstrapping purposes.")
1165 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
1166 ;; same license as both GNU Classpath and OpenJDK.
1167 (license license:gpl2+)))
1168
1169 (define-public icedtea-7
1170 (let* ((version "2.6.13")
1171 (drop (lambda (name hash)
1172 (origin
1173 (method url-fetch)
1174 (uri (string-append
1175 "http://icedtea.classpath.org/download/drops"
1176 "/icedtea7/" version "/" name ".tar.bz2"))
1177 (sha256 (base32 hash))))))
1178 (package
1179 (name "icedtea")
1180 (version version)
1181 (source (origin
1182 (method url-fetch)
1183 (uri (string-append
1184 "http://icedtea.wildebeest.org/download/source/icedtea-"
1185 version ".tar.xz"))
1186 (sha256
1187 (base32
1188 "1w331rdqx1dcx2xb0fmjmrkdc71xqn20fxsgw8by4xhiblh88khh"))
1189 (modules '((guix build utils)))
1190 (snippet
1191 '(begin
1192 (substitute* "Makefile.in"
1193 ;; do not leak information about the build host
1194 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
1195 "DISTRIBUTION_ID=\"\\\"guix\\\"\""))
1196 #t))))
1197 (build-system gnu-build-system)
1198 (outputs '("out" ; Java Runtime Environment
1199 "jdk" ; Java Development Kit
1200 "doc")) ; all documentation
1201 (arguments
1202 `(;; There are many test failures. Some are known to
1203 ;; fail upstream, others relate to not having an X
1204 ;; server running at test time, yet others are a
1205 ;; complete mystery to me.
1206
1207 ;; hotspot: passed: 241; failed: 45; error: 2
1208 ;; langtools: passed: 1,934; failed: 26
1209 ;; jdk: unknown
1210 #:tests? #f
1211
1212 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
1213 ;; gremlin) doesn't support it yet, so skip this phase.
1214 #:validate-runpath? #f
1215
1216 ;; Apparently, the C locale is needed for some of the tests.
1217 #:locale "C"
1218
1219 #:modules ((guix build utils)
1220 (guix build gnu-build-system)
1221 (ice-9 match)
1222 (ice-9 popen)
1223 (srfi srfi-19)
1224 (srfi srfi-26))
1225
1226 #:configure-flags
1227 ;; TODO: package pcsc and sctp, and add to inputs
1228 `("--disable-system-pcsc"
1229 "--disable-system-sctp"
1230 "--enable-bootstrap"
1231 "--enable-nss"
1232 "--without-rhino"
1233 ,(string-append "--with-parallel-jobs="
1234 (number->string (parallel-job-count)))
1235 "--disable-downloading"
1236 "--disable-tests" ;they are run in the check phase instead
1237 "--with-openjdk-src-dir=./openjdk.src"
1238 ,(string-append "--with-jdk-home="
1239 (assoc-ref %build-inputs "jdk")))
1240
1241 #:phases
1242 (modify-phases %standard-phases
1243 (replace 'unpack
1244 (lambda* (#:key source inputs #:allow-other-keys)
1245 (let ((target (string-append "icedtea-" ,version))
1246 (unpack (lambda* (name #:optional dir)
1247 (let ((dir (or dir
1248 (string-drop-right name 5))))
1249 (mkdir dir)
1250 (invoke "tar" "xvf"
1251 (assoc-ref inputs name)
1252 "-C" dir
1253 "--strip-components=1")))))
1254 (mkdir target)
1255 (invoke "tar" "xvf" source
1256 "-C" target "--strip-components=1")
1257 (chdir target)
1258 (unpack "openjdk-src" "openjdk.src")
1259 (with-directory-excursion "openjdk.src"
1260 (for-each unpack
1261 (filter (cut string-suffix? "-drop" <>)
1262 (map (match-lambda
1263 ((name . _) name))
1264 inputs))))
1265 #t)))
1266 (add-after 'unpack 'patch-bitrot
1267 (lambda _
1268 (substitute* '("patches/boot/revert-6973616.patch"
1269 "openjdk.src/jdk/make/common/shared/Defs-versions.gmk")
1270 (("REQUIRED_FREETYPE_VERSION = 2.2.1")
1271 "REQUIRED_FREETYPE_VERSION = 2.10.1"))
1272 ;; As of attr 2.4.48 this header is no longer
1273 ;; included. It is provided by the libc instead.
1274 (substitute* '("configure"
1275 "openjdk.src/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c")
1276 (("attr/xattr.h") "sys/xattr.h"))
1277 #t))
1278 (add-after 'unpack 'fix-x11-extension-include-path
1279 (lambda* (#:key inputs #:allow-other-keys)
1280 (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
1281 (((string-append "\\$\\(firstword \\$\\(wildcard "
1282 "\\$\\(OPENWIN_HOME\\)"
1283 "/include/X11/extensions\\).*$"))
1284 (string-append (assoc-ref inputs "libxrender")
1285 "/include/X11/extensions"
1286 " -I" (assoc-ref inputs "libxtst")
1287 "/include/X11/extensions"
1288 " -I" (assoc-ref inputs "libxinerama")
1289 "/include/X11/extensions"))
1290 (("\\$\\(wildcard /usr/include/X11/extensions\\)\\)") ""))
1291 #t))
1292 (add-after 'unpack 'patch-paths
1293 (lambda _
1294 ;; buildtree.make generates shell scripts, so we need to replace
1295 ;; the generated shebang
1296 (substitute* '("openjdk.src/hotspot/make/linux/makefiles/buildtree.make")
1297 (("/bin/sh") (which "bash")))
1298
1299 (let ((corebin (string-append
1300 (assoc-ref %build-inputs "coreutils") "/bin/"))
1301 (binbin (string-append
1302 (assoc-ref %build-inputs "binutils") "/bin/"))
1303 (grepbin (string-append
1304 (assoc-ref %build-inputs "grep") "/bin/")))
1305 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
1306 "openjdk.src/corba/make/common/shared/Defs-linux.gmk")
1307 (("UNIXCOMMAND_PATH = /bin/")
1308 (string-append "UNIXCOMMAND_PATH = " corebin))
1309 (("USRBIN_PATH = /usr/bin/")
1310 (string-append "USRBIN_PATH = " corebin))
1311 (("DEVTOOLS_PATH *= */usr/bin/")
1312 (string-append "DEVTOOLS_PATH = " corebin))
1313 (("COMPILER_PATH *= */usr/bin/")
1314 (string-append "COMPILER_PATH = "
1315 (assoc-ref %build-inputs "gcc") "/bin/"))
1316 (("DEF_OBJCOPY *=.*objcopy")
1317 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
1318
1319 ;; fix path to alsa header
1320 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
1321 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
1322 (string-append "ALSA_INCLUDE="
1323 (assoc-ref %build-inputs "alsa-lib")
1324 "/include/alsa/version.h")))
1325
1326 ;; fix hard-coded utility paths
1327 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-utils.gmk"
1328 "openjdk.src/corba/make/common/shared/Defs-utils.gmk")
1329 (("ECHO *=.*echo")
1330 (string-append "ECHO = " (which "echo")))
1331 (("^GREP *=.*grep")
1332 (string-append "GREP = " (which "grep")))
1333 (("EGREP *=.*egrep")
1334 (string-append "EGREP = " (which "egrep")))
1335 (("CPIO *=.*cpio")
1336 (string-append "CPIO = " (which "cpio")))
1337 (("READELF *=.*readelf")
1338 (string-append "READELF = " (which "readelf")))
1339 (("^ *AR *=.*ar")
1340 (string-append "AR = " (which "ar")))
1341 (("^ *TAR *=.*tar")
1342 (string-append "TAR = " (which "tar")))
1343 (("AS *=.*as")
1344 (string-append "AS = " (which "as")))
1345 (("LD *=.*ld")
1346 (string-append "LD = " (which "ld")))
1347 (("STRIP *=.*strip")
1348 (string-append "STRIP = " (which "strip")))
1349 (("NM *=.*nm")
1350 (string-append "NM = " (which "nm")))
1351 (("^SH *=.*sh")
1352 (string-append "SH = " (which "bash")))
1353 (("^FIND *=.*find")
1354 (string-append "FIND = " (which "find")))
1355 (("LDD *=.*ldd")
1356 (string-append "LDD = " (which "ldd")))
1357 (("NAWK *=.*(n|g)awk")
1358 (string-append "NAWK = " (which "gawk")))
1359 (("XARGS *=.*xargs")
1360 (string-append "XARGS = " (which "xargs")))
1361 (("UNZIP *=.*unzip")
1362 (string-append "UNZIP = " (which "unzip")))
1363 (("ZIPEXE *=.*zip")
1364 (string-append "ZIPEXE = " (which "zip")))
1365 (("SED *=.*sed")
1366 (string-append "SED = " (which "sed"))))
1367
1368 ;; Some of these timestamps cause problems as they are more than
1369 ;; 10 years ago, failing the build process.
1370 (substitute*
1371 "openjdk.src/jdk/src/share/classes/java/util/CurrencyData.properties"
1372 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
1373 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
1374 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
1375 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY")))
1376 #t))
1377 (add-before 'configure 'set-additional-paths
1378 (lambda* (#:key inputs #:allow-other-keys)
1379 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
1380 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
1381 (string-append "ALSA_INCLUDE="
1382 (assoc-ref inputs "alsa-lib")
1383 "/include/alsa/version.h")))
1384 (setenv "CC" "gcc")
1385 (setenv "CPATH"
1386 (string-append (assoc-ref inputs "libxcomposite")
1387 "/include/X11/extensions" ":"
1388 (assoc-ref inputs "libxrender")
1389 "/include/X11/extensions" ":"
1390 (assoc-ref inputs "libxtst")
1391 "/include/X11/extensions" ":"
1392 (assoc-ref inputs "libxinerama")
1393 "/include/X11/extensions" ":"
1394 (or (getenv "CPATH") "")))
1395 (setenv "ALT_OBJCOPY" (which "objcopy"))
1396 (setenv "ALT_CUPS_HEADERS_PATH"
1397 (string-append (assoc-ref inputs "cups")
1398 "/include"))
1399 (setenv "ALT_FREETYPE_HEADERS_PATH"
1400 (string-append (assoc-ref inputs "freetype")
1401 "/include"))
1402 (setenv "ALT_FREETYPE_LIB_PATH"
1403 (string-append (assoc-ref inputs "freetype")
1404 "/lib"))
1405 #t))
1406 (add-before 'build 'disable-os-version-check
1407 ;; allow build on linux major version change
1408 (lambda _
1409 (setenv "DISABLE_HOTSPOT_OS_VERSION_CHECK" "ok")
1410 #t))
1411 (add-before 'check 'fix-test-framework
1412 (lambda _
1413 ;; Fix PATH in test environment
1414 (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
1415 (("PATH=/bin:/usr/bin")
1416 (string-append "PATH=" (getenv "PATH"))))
1417 (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
1418 (("/usr/bin/env") (which "env")))
1419 (substitute* "openjdk.src/hotspot/test/test_env.sh"
1420 (("/bin/rm") (which "rm"))
1421 (("/bin/cp") (which "cp"))
1422 (("/bin/mv") (which "mv")))
1423 #t))
1424 (add-before 'check 'fix-hotspot-tests
1425 (lambda _
1426 (with-directory-excursion "openjdk.src/hotspot/test/"
1427 (substitute* "jprt.config"
1428 (("PATH=\"\\$\\{path4sdk\\}\"")
1429 (string-append "PATH=" (getenv "PATH")))
1430 (("make=/usr/bin/make")
1431 (string-append "make=" (which "make"))))
1432 (substitute* '("runtime/6626217/Test6626217.sh"
1433 "runtime/7110720/Test7110720.sh")
1434 (("/bin/rm") (which "rm"))
1435 (("/bin/cp") (which "cp"))
1436 (("/bin/mv") (which "mv"))))
1437 #t))
1438 (add-before 'check 'fix-jdk-tests
1439 (lambda _
1440 (with-directory-excursion "openjdk.src/jdk/test/"
1441 (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
1442 (("/bin/pwd") (which "pwd")))
1443 (substitute* "com/sun/jdi/ShellScaffold.sh"
1444 (("/bin/kill") (which "kill")))
1445 (substitute* "start-Xvfb.sh"
1446 ;;(("/usr/bin/X11/Xvfb") (which "Xvfb"))
1447 (("/usr/bin/nohup") (which "nohup")))
1448 (substitute* "javax/security/auth/Subject/doAs/Test.sh"
1449 (("/bin/rm") (which "rm")))
1450 (substitute* "tools/launcher/MultipleJRE.sh"
1451 (("echo \"#!/bin/sh\"")
1452 (string-append "echo \"#!" (which "rm") "\""))
1453 (("/usr/bin/zip") (which "zip")))
1454 (substitute* "com/sun/jdi/OnThrowTest.java"
1455 (("#!/bin/sh") (string-append "#!" (which "sh"))))
1456 (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
1457 (("/usr/bin/uptime") (which "uptime")))
1458 (substitute* "java/lang/ProcessBuilder/Basic.java"
1459 (("/usr/bin/env") (which "env"))
1460 (("/bin/false") (which "false"))
1461 (("/bin/true") (which "true"))
1462 (("/bin/cp") (which "cp"))
1463 (("/bin/sh") (which "sh")))
1464 (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
1465 (("/bin/sh") (which "sh")))
1466 (substitute* "java/lang/ProcessBuilder/Zombies.java"
1467 (("/usr/bin/perl") (which "perl"))
1468 (("/bin/ps") (which "ps"))
1469 (("/bin/true") (which "true")))
1470 (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
1471 (("/usr/bin/tee") (which "tee")))
1472 (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
1473 (("/bin/true") (which "true")))
1474 (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
1475 (("/bin/cat") (which "cat")))
1476 (substitute* "java/lang/Runtime/exec/ExitValue.java"
1477 (("/bin/sh") (which "sh"))
1478 (("/bin/true") (which "true"))
1479 (("/bin/kill") (which "kill")))
1480 (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
1481 (("/usr/bin/echo") (which "echo")))
1482 (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
1483 (("/usr/bin/cat") (which "cat")))
1484 (substitute* "java/lang/Runtime/exec/SleepyCat.java"
1485 (("/bin/cat") (which "cat"))
1486 (("/bin/sleep") (which "sleep"))
1487 (("/bin/sh") (which "sh")))
1488 (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
1489 (("/bin/cat") (which "cat")))
1490 (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
1491 (("/bin/chmod") (which "chmod")))
1492 (substitute* "java/util/zip/ZipFile/Assortment.java"
1493 (("/bin/sh") (which "sh"))))
1494 #t))
1495 (replace 'check
1496 (lambda _
1497 ;; The "make check-*" targets always return zero, so we need to
1498 ;; check for errors in the associated log files to determine
1499 ;; whether any tests have failed.
1500 (use-modules (ice-9 rdelim))
1501 (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
1502 (checker (lambda (port)
1503 (let loop ()
1504 (let ((line (read-line port)))
1505 (cond
1506 ((eof-object? line) #t)
1507 ((regexp-exec error-pattern line)
1508 (error "test failed"))
1509 (else (loop)))))))
1510 (run-test (lambda (test)
1511 (invoke "make" test)
1512 (call-with-input-file
1513 (string-append "test/" test ".log")
1514 checker))))
1515 (when #f ; skip tests
1516 (run-test "check-hotspot")
1517 (run-test "check-langtools")
1518 (run-test "check-jdk"))
1519 #t)))
1520 (replace 'install
1521 (lambda* (#:key outputs #:allow-other-keys)
1522 (let ((doc (string-append (assoc-ref outputs "doc")
1523 "/share/doc/icedtea"))
1524 (jre (assoc-ref outputs "out"))
1525 (jdk (assoc-ref outputs "jdk")))
1526 (copy-recursively "openjdk.build/docs" doc)
1527 (copy-recursively "openjdk.build/j2re-image" jre)
1528 (copy-recursively "openjdk.build/j2sdk-image" jdk))
1529 #t))
1530 ;; Some of the libraries in the lib/amd64 folder link to libjvm.so.
1531 ;; But that shared object is located in the server/ folder, so it
1532 ;; cannot be found. This phase creates a symbolic link in the
1533 ;; lib/amd64 folder so that the other libraries can find it.
1534 ;;
1535 ;; See:
1536 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1537 ;;
1538 ;; FIXME: Find the bug in the build system, so that this symlink is
1539 ;; not needed.
1540 (add-after 'install 'install-libjvm
1541 (lambda* (#:key inputs outputs #:allow-other-keys)
1542 (let* ((lib-path (string-append (assoc-ref outputs "out")
1543 ;; See 'INSTALL_ARCH_DIR' in
1544 ;; 'configure'.
1545 ,(match (%current-system)
1546 ("i686-linux"
1547 "/lib/i386")
1548 ("x86_64-linux"
1549 "/lib/amd64")
1550 ("armhf-linux"
1551 "/lib/arm")
1552 ("aarch64-linux"
1553 "/lib/aarch64")
1554 ;; We need a catch-all, dropping
1555 ;; '-linux' works in most cases.
1556 (_
1557 (string-append
1558 "/lib/"
1559 (string-drop-right
1560 (%current-system) 6)))))))
1561 (symlink (string-append lib-path "/server/libjvm.so")
1562 (string-append lib-path "/libjvm.so")))
1563 #t))
1564 ;; By default IcedTea only generates an empty keystore. In order to
1565 ;; be able to use certificates in Java programs we need to generate a
1566 ;; keystore from a set of certificates. For convenience we use the
1567 ;; certificates from the nss-certs package.
1568 (add-after 'install 'install-keystore
1569 (lambda* (#:key inputs outputs #:allow-other-keys)
1570 (let* ((keystore "cacerts")
1571 (certs-dir (string-append (assoc-ref inputs "nss-certs")
1572 "/etc/ssl/certs"))
1573 (keytool (string-append (assoc-ref outputs "jdk")
1574 "/bin/keytool")))
1575 (define (extract-cert file target)
1576 (call-with-input-file file
1577 (lambda (in)
1578 (call-with-output-file target
1579 (lambda (out)
1580 (let loop ((line (read-line in 'concat))
1581 (copying? #f))
1582 (cond
1583 ((eof-object? line) #t)
1584 ((string-prefix? "-----BEGIN" line)
1585 (display line out)
1586 (loop (read-line in 'concat) #t))
1587 ((string-prefix? "-----END" line)
1588 (display line out)
1589 #t)
1590 (else
1591 (when copying? (display line out))
1592 (loop (read-line in 'concat) copying?)))))))))
1593 (define (import-cert cert)
1594 (format #t "Importing certificate ~a\n" (basename cert))
1595 (let ((temp "tmpcert"))
1596 (extract-cert cert temp)
1597 (let ((port (open-pipe* OPEN_WRITE keytool
1598 "-import"
1599 "-alias" (basename cert)
1600 "-keystore" keystore
1601 "-storepass" "changeit"
1602 "-file" temp)))
1603 (display "yes\n" port)
1604 (when (not (zero? (status:exit-val (close-pipe port))))
1605 (format #t "failed to import ~a\n" cert)))
1606 (delete-file temp)))
1607
1608 ;; This is necessary because the certificate directory contains
1609 ;; files with non-ASCII characters in their names.
1610 (setlocale LC_ALL "en_US.utf8")
1611 (setenv "LC_ALL" "en_US.utf8")
1612
1613 (for-each import-cert (find-files certs-dir "\\.pem$"))
1614 (mkdir-p (string-append (assoc-ref outputs "out")
1615 "/lib/security"))
1616 (mkdir-p (string-append (assoc-ref outputs "jdk")
1617 "/jre/lib/security"))
1618
1619 ;; The cacerts files we are going to overwrite are chmod'ed as
1620 ;; read-only (444) in icedtea-8 (which derives from this
1621 ;; package). We have to change this so we can overwrite them.
1622 (chmod (string-append (assoc-ref outputs "out")
1623 "/lib/security/" keystore) #o644)
1624 (chmod (string-append (assoc-ref outputs "jdk")
1625 "/jre/lib/security/" keystore) #o644)
1626
1627 (install-file keystore
1628 (string-append (assoc-ref outputs "out")
1629 "/lib/security"))
1630 (install-file keystore
1631 (string-append (assoc-ref outputs "jdk")
1632 "/jre/lib/security"))
1633 #t))))))
1634 (native-inputs
1635 `(("openjdk-src"
1636 ,(drop "openjdk"
1637 "0l34ikyf62hbzlf9032alzkkqvf7bpmckz4gvirvph755w7gka8l"))
1638 ("corba-drop"
1639 ,(drop "corba"
1640 "050gv2jbg1pi6qkn8w18bwpbklfa5b0kymjvan9pncddbj8m84fz"))
1641 ("jaxp-drop"
1642 ,(drop "jaxp"
1643 "1k6yldwnxfzdg5926r1nlfv8d1r1j7rlp2nkz6gqh05vgyamnfhl"))
1644 ("jaxws-drop"
1645 ,(drop "jaxws"
1646 "110j7jlz47x2gg6f7653x12mssan5kvj9l9h1m1c8c92drfxbqyk"))
1647 ("jdk-drop"
1648 ,(drop "jdk"
1649 "0d1mca38ksxvdskp9im3pp7fdijhj1n3lwq9w13r9s4v3qyskgdd"))
1650 ("langtools-drop"
1651 ,(drop "langtools"
1652 "0nq5236fzxn3p6x8cgncl56mzcmsj07q9gymysnws4c8byc6n0qj"))
1653 ("hotspot-drop"
1654 ,(origin
1655 (method url-fetch)
1656 (uri (string-append
1657 "http://icedtea.classpath.org/downloads/drops"
1658 "/icedtea7/" version "/hotspot.tar.bz2"))
1659 (sha256
1660 (base32
1661 "17bdv39n4lh8l5737c96f3xgamx4y305m067p01cywgp7zaddqws"))
1662 (patches (search-patches
1663 "icedtea-7-hotspot-aarch64-use-c++98.patch"))))
1664 ("ant" ,ant-bootstrap)
1665 ("attr" ,attr)
1666 ("coreutils" ,coreutils)
1667 ("diffutils" ,diffutils) ;for tests
1668 ("gawk" ,gawk)
1669 ("grep" ,grep)
1670 ("libtool" ,libtool)
1671 ("pkg-config" ,pkg-config)
1672 ("wget" ,wget)
1673 ("which" ,which)
1674 ("cpio" ,cpio)
1675 ("zip" ,zip)
1676 ("unzip" ,unzip)
1677 ("fastjar" ,fastjar)
1678 ("libxslt" ,libxslt) ;for xsltproc
1679 ("nss-certs" ,nss-certs)
1680 ("perl" ,perl)
1681 ("procps" ,procps) ;for "free", even though I'm not sure we should use it
1682 ("jdk" ,icedtea-6 "jdk")))
1683 (inputs
1684 `(("alsa-lib" ,alsa-lib)
1685 ("cups" ,cups)
1686 ("libx11" ,libx11)
1687 ("libxcomposite" ,libxcomposite)
1688 ("libxt" ,libxt)
1689 ("libxtst" ,libxtst)
1690 ("libxi" ,libxi)
1691 ("libxinerama" ,libxinerama)
1692 ("libxrender" ,libxrender)
1693 ("libjpeg" ,libjpeg-turbo)
1694 ("libpng" ,libpng)
1695 ("mit-krb5" ,mit-krb5)
1696 ("nss" ,nss)
1697 ("giflib" ,giflib)
1698 ("fontconfig" ,fontconfig)
1699 ("freetype" ,freetype)
1700 ("lcms" ,lcms)
1701 ("zlib" ,zlib)
1702 ("gtk" ,gtk+-2)))
1703 (home-page "http://icedtea.classpath.org")
1704 (synopsis "Java development kit")
1705 (description
1706 "This package provides the Java development kit OpenJDK built with the
1707 IcedTea build harness.")
1708
1709 ;; 'configure' lists "mips" and "mipsel", but not "mips64el'.
1710 (supported-systems (delete "mips64el-linux" %supported-systems))
1711
1712 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
1713 ;; same license as both GNU Classpath and OpenJDK.
1714 (license license:gpl2+))))
1715
1716 (define-public icedtea-8
1717 (let* ((version "3.7.0")
1718 (drop (lambda (name hash)
1719 (origin
1720 (method url-fetch)
1721 (uri (string-append
1722 "http://icedtea.classpath.org/download/drops"
1723 "/icedtea8/" version "/" name ".tar.xz"))
1724 (sha256 (base32 hash))))))
1725 (package (inherit icedtea-7)
1726 (version "3.7.0")
1727 (source (origin
1728 (method url-fetch)
1729 (uri (string-append
1730 "http://icedtea.wildebeest.org/download/source/icedtea-"
1731 version ".tar.xz"))
1732 (sha256
1733 (base32
1734 "09yqzn8rpccs7cyv89hhy5zlznpgqw5x3jz0w1ccp0cz1vgs8l5w"))
1735 (modules '((guix build utils)))
1736 (snippet
1737 '(begin
1738 (substitute* '("configure"
1739 "acinclude.m4")
1740 ;; Do not embed build time
1741 (("(DIST_ID=\"Custom build).*$" _ prefix)
1742 (string-append prefix "\"\n"))
1743 ;; Do not leak information about the build host
1744 (("DIST_NAME=\"\\$build_os\"")
1745 "DIST_NAME=\"guix\""))
1746 #t))))
1747 (arguments
1748 `(#:imported-modules
1749 ((guix build ant-build-system)
1750 (guix build syscalls)
1751 ,@%gnu-build-system-modules)
1752 ,@(substitute-keyword-arguments (package-arguments icedtea-7)
1753 ((#:modules modules)
1754 `((guix build utils)
1755 (guix build gnu-build-system)
1756 ((guix build ant-build-system) #:prefix ant:)
1757 (ice-9 match)
1758 (ice-9 popen)
1759 (srfi srfi-19)
1760 (srfi srfi-26)))
1761 ((#:configure-flags flags)
1762 `(let ((jdk (assoc-ref %build-inputs "jdk")))
1763 `( ;;"--disable-bootstrap"
1764 "--enable-bootstrap"
1765 "--enable-nss"
1766 ,(string-append "--with-parallel-jobs="
1767 (number->string (parallel-job-count)))
1768 "--disable-downloading"
1769 "--disable-system-pcsc"
1770 "--disable-system-sctp"
1771 "--disable-tests" ;they are run in the check phase instead
1772 "--with-openjdk-src-dir=./openjdk.src"
1773 ,(string-append "--with-jdk-home=" jdk))))
1774 ((#:phases phases)
1775 `(modify-phases ,phases
1776 (delete 'fix-x11-extension-include-path)
1777 (delete 'patch-paths)
1778 (delete 'set-additional-paths)
1779 (delete 'patch-patches)
1780 (delete 'patch-bitrot)
1781 ;; Prevent the keytool from recording the current time when
1782 ;; adding certificates at build time.
1783 (add-after 'unpack 'patch-keystore
1784 (lambda _
1785 (substitute* "openjdk.src/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java"
1786 (("date = new Date\\(\\);")
1787 "\
1788 date = (System.getenv(\"SOURCE_DATE_EPOCH\") != null) ?\
1789 new Date(Long.parseLong(System.getenv(\"SOURCE_DATE_EPOCH\"))) :\
1790 new Date();"))
1791 #t))
1792 (add-after 'unpack 'patch-jni-libs
1793 ;; Hardcode dynamically loaded libraries.
1794 (lambda _
1795 (let* ((library-path (search-path-as-string->list
1796 (getenv "LIBRARY_PATH")))
1797 (find-library (lambda (name)
1798 (search-path
1799 library-path
1800 (string-append "lib" name ".so")))))
1801 (for-each
1802 (lambda (file)
1803 (catch 'decoding-error
1804 (lambda ()
1805 (substitute* file
1806 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
1807 _ name version)
1808 (format #f "\"~a\"" (find-library name)))
1809 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
1810 (format #f "\"~a\"" (find-library name)))))
1811 (lambda _
1812 ;; Those are safe to skip.
1813 (format (current-error-port)
1814 "warning: failed to substitute: ~a~%"
1815 file))))
1816 (find-files "openjdk.src/jdk/src/solaris/native"
1817 "\\.c|\\.h"))
1818 #t)))
1819 (replace 'install
1820 (lambda* (#:key outputs #:allow-other-keys)
1821 (let ((doc (string-append (assoc-ref outputs "doc")
1822 "/share/doc/icedtea"))
1823 (jre (assoc-ref outputs "out"))
1824 (jdk (assoc-ref outputs "jdk")))
1825 (copy-recursively "openjdk.build/docs" doc)
1826 (copy-recursively "openjdk.build/images/j2re-image" jre)
1827 (copy-recursively "openjdk.build/images/j2sdk-image" jdk)
1828 ;; Install the nss.cfg file to JRE to enable SSL/TLS
1829 ;; support via NSS.
1830 (copy-file (string-append jdk "/jre/lib/security/nss.cfg")
1831 (string-append jre "/lib/security/nss.cfg"))
1832 #t)))
1833 (add-after 'install 'strip-jar-timestamps
1834 (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))))
1835 (native-inputs
1836 `(("jdk" ,icedtea-7 "jdk")
1837 ("openjdk-src"
1838 ,(drop "openjdk"
1839 "1mj6xgmw31i6qd30qi9dmv7160fbcfq5ikz1jwjihdg2793il19p"))
1840 ("aarch32-drop"
1841 ,(drop "aarch32"
1842 "1wb8k5zm40zld0986dvmlh5xh3gyixbg9h26sl662zy92amhmyyg"))
1843 ("corba-drop"
1844 ,(drop "corba"
1845 "11ma4zz0599cy70xd219v7a8vin7p96xrhhz3wsaw6cjhkzpagah"))
1846 ("jaxp-drop"
1847 ,(drop "jaxp"
1848 "14m1y0z0fbm5z5zjw3vnq85py8dma84bi3f9cw8rhdyc6skk8q4i"))
1849 ("jaxws-drop"
1850 ,(drop "jaxws"
1851 "09andnm6xaasnp963hgx42yiflifiljp9z7z85jrfyc5z8a5whmf"))
1852 ("jdk-drop"
1853 ,(drop "jdk"
1854 "0s6lcpc0zckz2fnq98aqf28nz9y3wbi41a3kyaqqa2abwbkm1zwl"))
1855 ("langtools-drop"
1856 ,(drop "langtools"
1857 "15wizy123vhk40chl1b4p552jf2pw2hdww0myf11qab425axz4nw"))
1858 ("hotspot-drop"
1859 ,(drop "hotspot"
1860 "1ciz1w9j0kz7s1dxdhyqq71nla9icyz6qvn0b9z2zgkklqa98qmm"))
1861 ("nashorn-drop"
1862 ,(drop "nashorn"
1863 "19pzl3ppaw8j6r5cnyp8qiw3hxijh3hdc46l39g5yfhdl4pr4hpa"))
1864 ("shenandoah-drop"
1865 ,(drop "shenandoah"
1866 "0k33anxdzw1icn072wynfmmdjhsv50hay0j1sfkfxny12rb3vgdy"))
1867 ,@(fold alist-delete (package-native-inputs icedtea-7)
1868 '("jdk" "openjdk-src" "corba-drop" "jaxp-drop" "jaxws-drop"
1869 "jdk-drop" "langtools-drop" "hotspot-drop")))))))
1870
1871 (define-public openjdk9
1872 (package
1873 (name "openjdk")
1874 (version "9.181")
1875 (source (origin
1876 (method url-fetch)
1877 (uri "https://hg.openjdk.java.net/jdk/jdk/archive/3cc80be736f2.tar.bz2")
1878 (file-name (string-append name "-" version ".tar.bz2"))
1879 (sha256
1880 (base32
1881 "01ihmyf7k5z17wbr7xig7y40l9f01d5zjgkcmawn1102hw5kchpq"))
1882 (modules '((guix build utils)))
1883 (snippet
1884 `(begin
1885 (for-each delete-file
1886 (find-files "." ".*.(bin|exe|jar)$"))
1887 #t))))
1888 (build-system gnu-build-system)
1889 (outputs '("out" "jdk" "doc"))
1890 (arguments
1891 `(#:tests? #f; require jtreg
1892 #:make-flags '("all")
1893 #:imported-modules
1894 ((guix build syscalls)
1895 ,@%gnu-build-system-modules)
1896 #:phases
1897 (modify-phases %standard-phases
1898 (add-after 'patch-source-shebangs 'fix-java-shebangs
1899 (lambda _
1900 ;; This file was "fixed" by patch-source-shebangs, but it requires
1901 ;; this exact first line.
1902 (substitute* "jdk/make/data/blacklistedcertsconverter/blacklisted.certs.pem"
1903 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))
1904 #t))
1905 (replace 'configure
1906 (lambda* (#:key inputs outputs #:allow-other-keys)
1907 ;; TODO: unbundle libpng and lcms
1908 (invoke "bash" "./configure"
1909 (string-append "--with-freetype=" (assoc-ref inputs "freetype"))
1910 "--disable-freetype-bundling"
1911 "--disable-warnings-as-errors"
1912 "--disable-hotspot-gtest"
1913 "--with-giflib=system"
1914 "--with-libjpeg=system"
1915 (string-append "--prefix=" (assoc-ref outputs "out")))
1916 #t))
1917 (add-before 'build 'write-source-revision-file
1918 (lambda _
1919 (with-output-to-file ".src-rev"
1920 (lambda _
1921 (display ,version)))
1922 #t))
1923 (replace 'build
1924 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
1925 (apply invoke "make"
1926 `(,@(if parallel-build?
1927 (list (string-append "JOBS="
1928 (number->string (parallel-job-count))))
1929 '())
1930 ,@make-flags))))
1931 (add-after 'unpack 'patch-jni-libs
1932 ;; Hardcode dynamically loaded libraries.
1933 (lambda _
1934 (let* ((library-path (search-path-as-string->list
1935 (getenv "LIBRARY_PATH")))
1936 (find-library (lambda (name)
1937 (search-path
1938 library-path
1939 (string-append "lib" name ".so")))))
1940 (for-each
1941 (lambda (file)
1942 (catch 'decoding-error
1943 (lambda ()
1944 (substitute* file
1945 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
1946 _ name version)
1947 (format #f "\"~a\"" (find-library name)))
1948 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
1949 (format #f "\"~a\"" (find-library name)))))
1950 (lambda _
1951 ;; Those are safe to skip.
1952 (format (current-error-port)
1953 "warning: failed to substitute: ~a~%"
1954 file))))
1955 (find-files "."
1956 "\\.c$|\\.h$"))
1957 #t)))
1958 ;; Some of the libraries in the lib/ folder link to libjvm.so.
1959 ;; But that shared object is located in the server/ folder, so it
1960 ;; cannot be found. This phase creates a symbolic link in the
1961 ;; lib/ folder so that the other libraries can find it.
1962 ;;
1963 ;; See:
1964 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1965 ;;
1966 ;; FIXME: Find the bug in the build system, so that this symlink is
1967 ;; not needed.
1968 (add-after 'install 'install-libjvm
1969 (lambda* (#:key inputs outputs #:allow-other-keys)
1970 (let* ((lib-out (string-append (assoc-ref outputs "out")
1971 "/lib"))
1972 (lib-jdk (string-append (assoc-ref outputs "jdk")
1973 "/lib")))
1974 (symlink (string-append lib-jdk "/server/libjvm.so")
1975 (string-append lib-jdk "/libjvm.so"))
1976 (symlink (string-append lib-out "/server/libjvm.so")
1977 (string-append lib-out "/libjvm.so")))
1978 #t))
1979 (replace 'install
1980 (lambda* (#:key outputs #:allow-other-keys)
1981 (let ((out (assoc-ref outputs "out"))
1982 (jdk (assoc-ref outputs "jdk"))
1983 (doc (assoc-ref outputs "doc"))
1984 (images (car (find-files "build" ".*-server-release"
1985 #:directories? #t))))
1986 (copy-recursively (string-append images "/images/jdk") jdk)
1987 (copy-recursively (string-append images "/images/jre") out)
1988 (copy-recursively (string-append images "/images/docs") doc))
1989 #t))
1990 (add-after 'install 'strip-zip-timestamps
1991 (lambda* (#:key outputs #:allow-other-keys)
1992 (use-modules (guix build syscalls))
1993 (for-each (lambda (zip)
1994 (let ((dir (mkdtemp! "zip-contents.XXXXXX")))
1995 (with-directory-excursion dir
1996 (invoke "unzip" zip))
1997 (delete-file zip)
1998 (for-each (lambda (file)
1999 (let ((s (lstat file)))
2000 (unless (eq? (stat:type s) 'symlink)
2001 (format #t "reset ~a~%" file)
2002 (utime file 0 0 0 0))))
2003 (find-files dir #:directories? #t))
2004 (with-directory-excursion dir
2005 (let ((files (find-files "." ".*" #:directories? #t)))
2006 (apply invoke "zip" "-0" "-X" zip files)))))
2007 (find-files (assoc-ref outputs "doc") ".*.zip$"))
2008 #t)))))
2009 (inputs
2010 `(("alsa-lib" ,alsa-lib)
2011 ("cups" ,cups)
2012 ("fontconfig" ,fontconfig)
2013 ("freetype" ,freetype)
2014 ("giflib" ,giflib)
2015 ("lcms" ,lcms)
2016 ("libelf" ,libelf)
2017 ("libjpeg" ,libjpeg-turbo)
2018 ("libice" ,libice)
2019 ("libpng" ,libpng)
2020 ("libx11" ,libx11)
2021 ("libxcomposite" ,libxcomposite)
2022 ("libxi" ,libxi)
2023 ("libxinerama" ,libxinerama)
2024 ("libxrender" ,libxrender)
2025 ("libxt" ,libxt)
2026 ("libxtst" ,libxtst)))
2027 (native-inputs
2028 `(("icedtea-8" ,icedtea-8)
2029 ("icedtea-8:jdk" ,icedtea-8 "jdk")
2030 ;; XXX: The build system fails with newer versions of GNU Make.
2031 ("make@4.2" ,gnu-make-4.2)
2032 ("unzip" ,unzip)
2033 ("which" ,which)
2034 ("zip" ,zip)))
2035 (home-page "https://openjdk.java.net/projects/jdk9/")
2036 (synopsis "Java development kit")
2037 (description
2038 "This package provides the Java development kit OpenJDK.")
2039 (license license:gpl2+)))
2040
2041 (define-public openjdk10
2042 (package
2043 (inherit openjdk9)
2044 (name "openjdk")
2045 (version "10.46")
2046 (source (origin
2047 (method url-fetch)
2048 (uri "http://hg.openjdk.java.net/jdk/jdk/archive/6fa770f9f8ab.tar.bz2")
2049 (file-name (string-append name "-" version ".tar.bz2"))
2050 (sha256
2051 (base32
2052 "0zywq2203b4hx4jms9vbwvjcj1d3k2v3qpx4s33729fkpmid97r4"))
2053 (patches (search-patches
2054 "openjdk-10-idlj-reproducibility.patch"))
2055 (modules '((guix build utils)))
2056 (snippet
2057 `(begin
2058 (for-each delete-file (find-files "." ".*.(bin|exe|jar)$"))
2059 #t))))
2060 (arguments
2061 (substitute-keyword-arguments (package-arguments openjdk9)
2062 ((#:phases phases)
2063 `(modify-phases ,phases
2064 (replace 'fix-java-shebangs
2065 (lambda _
2066 ;; This file was "fixed" by patch-source-shebangs, but it requires
2067 ;; this exact first line.
2068 (substitute* "make/data/blacklistedcertsconverter/blacklisted.certs.pem"
2069 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))
2070 #t))
2071 (replace 'configure
2072 (lambda* (#:key inputs outputs #:allow-other-keys)
2073 (invoke "bash" "./configure"
2074 (string-append "--with-freetype=" (assoc-ref inputs "freetype"))
2075 "--disable-freetype-bundling"
2076 "--disable-warnings-as-errors"
2077 "--disable-hotspot-gtest"
2078 "--with-giflib=system"
2079 "--with-libjpeg=system"
2080 "--with-native-debug-symbols=zipped"
2081 (string-append "--prefix=" (assoc-ref outputs "out")))
2082 #t))))))
2083 (native-inputs
2084 `(("openjdk9" ,openjdk9)
2085 ("openjdk9:jdk" ,openjdk9 "jdk")
2086 ("make@4.2" ,gnu-make-4.2)
2087 ("unzip" ,unzip)
2088 ("which" ,which)
2089 ("zip" ,zip)))))
2090
2091 (define-public openjdk11
2092 (package
2093 (name "openjdk")
2094 (version "11.28")
2095 (source (origin
2096 (method url-fetch)
2097 (uri "http://hg.openjdk.java.net/jdk/jdk/archive/76072a077ee1.tar.bz2")
2098 (file-name (string-append name "-" version ".tar.bz2"))
2099 (sha256
2100 (base32
2101 "0v705w1s9lrqalzahir78pk397rkk9gfvzq821yv8h3xha0bqi6w"))
2102 (modules '((guix build utils)))
2103 (snippet
2104 `(begin
2105 (for-each delete-file (find-files "." ".*.(bin|exe|jar)$"))
2106 #t))))
2107 (build-system gnu-build-system)
2108 (outputs '("out" "jdk" "doc"))
2109 (arguments
2110 `(#:imported-modules
2111 ((guix build syscalls)
2112 (ice-9 binary-ports)
2113 (rnrs bytevectors)
2114 ,@%gnu-build-system-modules)
2115 #:tests? #f; requires jtreg
2116 ;; TODO package jtreg
2117 #:configure-flags
2118 `("--disable-option-checking" ; --enable-fast-install default flag errors otherwise
2119 "--disable-warnings-as-errors"
2120 ;; make validate-runpath pass, see: http://issues.guix.info/issue/32894
2121 "--with-native-debug-symbols=zipped"
2122 ;; do not use the bundled libraries
2123 "--with-giflib=system"
2124 "--with-lcms=system"
2125 "--with-libjpeg=system"
2126 "--with-libpng=system"
2127 "--with-version-pre="
2128 ;; allow the build system to locate the system freetype
2129 ,(string-append "--with-freetype-include="
2130 (assoc-ref %build-inputs "freetype") "/include")
2131 ,(string-append "--with-freetype-lib="
2132 (assoc-ref %build-inputs "freetype") "/lib"))
2133 #:phases
2134 (modify-phases %standard-phases
2135 (add-after 'patch-source-shebangs 'fix-java-shebangs
2136 (lambda _
2137 ;; This file was "fixed" by patch-source-shebangs, but it requires
2138 ;; this exact first line.
2139 (substitute* "make/data/blacklistedcertsconverter/blacklisted.certs.pem"
2140 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))
2141 #t))
2142 (add-after 'unpack 'patch-jni-libs
2143 ;; Hardcode dynamically loaded libraries.
2144 (lambda _
2145 (let* ((library-path (search-path-as-string->list
2146 (getenv "LIBRARY_PATH")))
2147 (find-library (lambda (name)
2148 (search-path
2149 library-path
2150 (string-append "lib" name ".so")))))
2151 (for-each
2152 (lambda (file)
2153 (catch 'decoding-error
2154 (lambda ()
2155 (substitute* file
2156 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
2157 _ name version)
2158 (format #f "\"~a\"" (find-library name)))
2159 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
2160 (format #f "\"~a\"" (find-library name)))))
2161 (lambda _
2162 ;; Those are safe to skip.
2163 (format (current-error-port)
2164 "warning: failed to substitute: ~a~%"
2165 file))))
2166 (find-files "."
2167 "\\.c$|\\.h$"))
2168 #t)))
2169 (add-before 'build 'write-source-revision-file
2170 (lambda _
2171 (with-output-to-file ".src-rev"
2172 (lambda _
2173 (display ,version)))
2174 #t))
2175 (replace 'build
2176 (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
2177 (apply invoke "make" "all"
2178 `(,@(if parallel-build?
2179 (list (string-append "JOBS="
2180 (number->string (parallel-job-count))))
2181 '())
2182 ,@make-flags))))
2183 ;; jdk 11 does not build jre by default any more
2184 ;; building it anyways
2185 ;; for further information see:
2186 ;; https://github.com/AdoptOpenJDK/openjdk-build/issues/356
2187 (add-after 'build 'build-jre
2188 (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
2189 (apply invoke "make" "legacy-jre-image"
2190 `(,@(if parallel-build?
2191 (list (string-append "JOBS="
2192 (number->string (parallel-job-count))))
2193 '())
2194 ,@make-flags))))
2195 (replace 'install
2196 (lambda* (#:key outputs #:allow-other-keys)
2197 (let ((out (assoc-ref outputs "out"))
2198 (jdk (assoc-ref outputs "jdk"))
2199 (doc (assoc-ref outputs "doc"))
2200 (images (car (find-files "build" ".*-server-release"
2201 #:directories? #t))))
2202 (copy-recursively (string-append images "/images/jdk") jdk)
2203 (copy-recursively (string-append images "/images/jre") out)
2204 (copy-recursively (string-append images "/images/docs") doc))
2205 #t))
2206 ;; Some of the libraries in the lib/ folder link to libjvm.so.
2207 ;; But that shared object is located in the server/ folder, so it
2208 ;; cannot be found. This phase creates a symbolic link in the
2209 ;; lib/ folder so that the other libraries can find it.
2210 ;;
2211 ;; See:
2212 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
2213 ;;
2214 ;; FIXME: Find the bug in the build system, so that this symlink is
2215 ;; not needed.
2216 (add-after 'install 'install-libjvm
2217 (lambda* (#:key inputs outputs #:allow-other-keys)
2218 (let* ((lib-out (string-append (assoc-ref outputs "out")
2219 "/lib"))
2220 (lib-jdk (string-append (assoc-ref outputs "jdk")
2221 "/lib")))
2222 (symlink (string-append lib-jdk "/server/libjvm.so")
2223 (string-append lib-jdk "/libjvm.so"))
2224 (symlink (string-append lib-out "/server/libjvm.so")
2225 (string-append lib-out "/libjvm.so")))
2226 #t))
2227 (add-after 'install 'strip-character-data-timestamps
2228 (lambda* (#:key outputs #:allow-other-keys)
2229 (use-modules (guix build syscalls))
2230 (let ((archive (string-append
2231 (assoc-ref outputs "jdk") "/lib/src.zip"))
2232 (dir (mkdtemp! "zip-contents.XXXXXX")))
2233 (with-directory-excursion dir
2234 (invoke "unzip" archive))
2235 (delete-file archive)
2236 (with-directory-excursion dir
2237 (let ((char-data-files (find-files "." "CharacterData.*")))
2238 (for-each (lambda (file)
2239 (substitute* file
2240 (((string-append "This file was generated "
2241 "AUTOMATICALLY from a template "
2242 "file.*"))
2243 (string-append "This file was generated "
2244 "AUTOMATICALLY from a template "
2245 "file"))))
2246 char-data-files)))
2247 (with-directory-excursion dir
2248 (let ((files (find-files "." ".*" #:directories? #t)))
2249 (apply invoke "zip" "-0" "-X" archive files))))))
2250 (add-after 'strip-character-data-timestamps 'strip-archive-timestamps
2251 (lambda* (#:key outputs #:allow-other-keys)
2252 (use-modules (guix build syscalls)
2253 (ice-9 binary-ports)
2254 (rnrs bytevectors))
2255 (letrec ((repack-archive
2256 (lambda (archive)
2257 (let ((dir (mkdtemp! "zip-contents.XXXXXX")))
2258 (with-directory-excursion dir
2259 (invoke "unzip" archive))
2260 (delete-file archive)
2261 (for-each (compose repack-archive canonicalize-path)
2262 (find-files dir "(ct.sym|.*.jar)$"))
2263 (let ((reset-file-timestamp
2264 (lambda (file)
2265 (let ((s (lstat file)))
2266 (unless (eq? (stat:type s) 'symlink)
2267 (format #t "reset ~a~%" file)
2268 (utime file 0 0 0 0))))))
2269 (for-each reset-file-timestamp
2270 (find-files dir #:directories? #t)))
2271 (with-directory-excursion dir
2272 (let ((files (find-files "." ".*" #:directories? #t)))
2273 (apply invoke "zip" "-0" "-X" archive files)))))))
2274 (for-each repack-archive
2275 (find-files (assoc-ref outputs "doc") ".*.zip$"))
2276 (for-each repack-archive
2277 (find-files (assoc-ref outputs "jdk")
2278 ".*.(zip|jar|diz)$"))
2279 (repack-archive (string-append (assoc-ref outputs "jdk") "/lib/ct.sym"))
2280 (let ((repack-jmod
2281 (lambda (file-name)
2282 (call-with-input-file file-name
2283 (lambda (file)
2284 (let ((header #vu8(#x4a #x4d #x01 #x00)))
2285 (if (equal? (get-bytevector-n
2286 file (bytevector-length header))
2287 header)
2288 (let* ((header-length (bytevector-length header))
2289 (temp-file (mkstemp!
2290 (string-copy
2291 "temp-file.XXXXXX")))
2292 (temp-filename (port-filename temp-file))
2293 (content-length
2294 (- (stat:size (stat file))
2295 header-length)))
2296 (sendfile temp-file file content-length header-length)
2297 (delete-file file-name)
2298 (close-port temp-file)
2299 (repack-archive (canonicalize-path temp-filename))
2300 (call-with-output-file file-name
2301 (lambda (file)
2302 (put-bytevector file header)
2303 (call-with-input-file temp-filename
2304 (lambda (temp-file)
2305 (sendfile
2306 file temp-file
2307 (stat:size (stat temp-file)) 0)))))))))))))
2308 (for-each repack-jmod
2309 (find-files (assoc-ref outputs "jdk") ".*.jmod$")))
2310 #t)))
2311 (add-after 'install 'remove-timestamp-from-api-summary
2312 (lambda* (#:key outputs #:allow-other-keys)
2313 (substitute* (string-append (assoc-ref outputs "doc")
2314 "/api/overview-summary.html")
2315 (("Generated by javadoc \\(11-internal\\).*$")
2316 "Generated by javadoc (11-internal) -->\n"))
2317 #t)))))
2318 (inputs
2319 `(("alsa-lib" ,alsa-lib)
2320 ("cups" ,cups)
2321 ("fontconfig" ,fontconfig)
2322 ("freetype" ,freetype)
2323 ("giflib" ,giflib)
2324 ("lcms" ,lcms)
2325 ("libjpeg" ,libjpeg-turbo)
2326 ("libpng" ,libpng)
2327 ("libx11" ,libx11)
2328 ("libxext" ,libxext)
2329 ("libxrender" ,libxrender)
2330 ("libxt" ,libxt)
2331 ("libxtst" ,libxtst)))
2332 (native-inputs
2333 `(("autoconf" ,autoconf)
2334 ("openjdk10" ,openjdk10)
2335 ("openjdk10:jdk" ,openjdk10 "jdk")
2336 ("make" ,gnu-make-4.2)
2337 ("pkg-config" ,pkg-config)
2338 ("unzip" ,unzip)
2339 ("which" ,which)
2340 ("zip" ,zip)))
2341 (home-page "https://openjdk.java.net/projects/jdk/11/")
2342 (synopsis "Java development kit")
2343 (description
2344 "This package provides the Java development kit OpenJDK.")
2345 (license license:gpl2+)))
2346
2347 (define-public openjdk12
2348 (package
2349 (inherit openjdk11)
2350 (name "openjdk")
2351 (version "12.33")
2352 (source (origin
2353 (method url-fetch)
2354 (uri "http://hg.openjdk.java.net/jdk/jdk/archive/0276cba45aac.tar.bz2")
2355 (file-name (string-append name "-" version ".tar.bz2"))
2356 (sha256
2357 (base32
2358 "0mbhdrk12b6878kby0flnbak7444dlpm0ihlmf92vk59y1c02bc2"))
2359 (modules '((guix build utils)))
2360 (snippet
2361 `(begin
2362 (for-each delete-file (find-files "." ".*.(bin|exe|jar)$"))
2363 #t))))
2364 (inputs
2365 `(("alsa-lib" ,alsa-lib)
2366 ("cups" ,cups)
2367 ("fontconfig" ,fontconfig)
2368 ("freetype" ,freetype)
2369 ("giflib" ,giflib)
2370 ("lcms" ,lcms)
2371 ("libjpeg" ,libjpeg-turbo)
2372 ("libpng" ,libpng)
2373 ("libx11" ,libx11)
2374 ("libxext" ,libxext)
2375 ("libxrandr" ,libxrandr)
2376 ("libxrender" ,libxrender)
2377 ("libxt" ,libxt)
2378 ("libxtst" ,libxtst)))
2379 (native-inputs
2380 `(("autoconf" ,autoconf)
2381 ("openjdk11" ,openjdk11)
2382 ("openjdk11:jdk" ,openjdk11 "jdk")
2383 ("make@4.2" ,gnu-make-4.2)
2384 ("pkg-config" ,pkg-config)
2385 ("unzip" ,unzip)
2386 ("which" ,which)
2387 ("zip" ,zip)))
2388 (home-page "https://openjdk.java.net/projects/jdk/12")))
2389
2390 (define-public openjdk13
2391 (package
2392 (inherit openjdk12)
2393 (name "openjdk")
2394 (version "13.0")
2395 (source (origin
2396 (method url-fetch)
2397 (uri "http://hg.openjdk.java.net/jdk/jdk13/archive/9c250a7600e1.tar.bz2")
2398 (file-name (string-append name "-" version ".tar.bz2"))
2399 (sha256
2400 (base32
2401 "0v0ljvx5dyzp96dw4z4ksw3pvasil7783mgnmd1wk9gads5ab8iq"))
2402 (modules '((guix build utils)))
2403 (snippet
2404 `(begin
2405 (for-each delete-file (find-files "." ".*.(bin|exe|jar)$"))
2406 #t))))
2407 (inputs
2408 `(("alsa-lib" ,alsa-lib)
2409 ("cups" ,cups)
2410 ("fontconfig" ,fontconfig)
2411 ("freetype" ,freetype)
2412 ("giflib" ,giflib)
2413 ("lcms" ,lcms)
2414 ("libjpeg" ,libjpeg-turbo)
2415 ("libpng" ,libpng)
2416 ("libx11" ,libx11)
2417 ("libxext" ,libxext)
2418 ("libxrandr" ,libxrandr)
2419 ("libxrender" ,libxrender)
2420 ("libxt" ,libxt)
2421 ("libxtst" ,libxtst)))
2422 (native-inputs
2423 `(("autoconf" ,autoconf)
2424 ("openjdk12:jdk" ,openjdk12 "jdk")
2425 ("make@4.2" ,gnu-make-4.2)
2426 ("pkg-config" ,pkg-config)
2427 ("unzip" ,unzip)
2428 ("which" ,which)
2429 ("zip" ,zip)))
2430 (home-page "https://openjdk.java.net/projects/jdk/13")))
2431
2432 (define-public openjdk14
2433 (package
2434 (inherit openjdk13)
2435 (name "openjdk")
2436 (version "14.0")
2437 (source (origin
2438 (method url-fetch)
2439 (uri "http://hg.openjdk.java.net/jdk/jdk14/archive/bc54620a3848.tar.bz2")
2440 (file-name (string-append name "-" version ".tar.bz2"))
2441 (sha256
2442 (base32
2443 "0z485pk7r1xpw8004g4nrwrzj17sabgx8yfdbxwfvzkjp8qyajch"))
2444 (modules '((guix build utils)))
2445 (snippet
2446 `(begin
2447 ;; The m4 macro uses 'help' to search for builtins, which is
2448 ;; not available in bash-minimal
2449 (substitute* "make/autoconf/basics.m4"
2450 (("if help") "if command -v"))
2451 (for-each delete-file (find-files "." ".*.(bin|exe|jar)$"))
2452 #t))))
2453 (inputs
2454 `(("alsa-lib" ,alsa-lib)
2455 ("cups" ,cups)
2456 ("fontconfig" ,fontconfig)
2457 ("freetype" ,freetype)
2458 ("giflib" ,giflib)
2459 ("lcms" ,lcms)
2460 ("libjpeg" ,libjpeg-turbo)
2461 ("libpng" ,libpng)
2462 ("libx11" ,libx11)
2463 ("libxext" ,libxext)
2464 ("libxrandr" ,libxrandr)
2465 ("libxrender" ,libxrender)
2466 ("libxt" ,libxt)
2467 ("libxtst" ,libxtst)))
2468 (native-inputs
2469 `(("autoconf" ,autoconf)
2470 ("make@4.2" ,gnu-make-4.2)
2471 ("openjdk13:jdk" ,openjdk13 "jdk")
2472 ("pkg-config" ,pkg-config)
2473 ("unzip" ,unzip)
2474 ("which" ,which)
2475 ("zip" ,zip)))
2476 (home-page "https://openjdk.java.net/projects/jdk/14")))
2477
2478 (define-public icedtea icedtea-8)
2479
2480 \f
2481 (define-public ant/java8
2482 (package (inherit ant-bootstrap)
2483 (name "ant")
2484 (version "1.10.9")
2485 (source (origin
2486 (method url-fetch)
2487 (uri (string-append "mirror://apache/ant/source/apache-ant-"
2488 version "-src.tar.gz"))
2489 (sha256
2490 (base32
2491 "0x78434q5ab193ma7ys27m9kwpdgrfzqj00hrf1szwcgk0lzw01z"))
2492 (modules '((guix build utils)))
2493 (snippet
2494 '(begin
2495 (for-each delete-file
2496 (find-files "lib/optional" "\\.jar$"))
2497 #t))))
2498 (arguments
2499 (substitute-keyword-arguments (package-arguments ant-bootstrap)
2500 ((#:phases phases)
2501 `(modify-phases ,phases
2502 (add-after 'unpack 'remove-scripts
2503 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
2504 ;; wrappers.
2505 (lambda _
2506 (for-each delete-file
2507 (find-files "src/script"
2508 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))
2509 #t))
2510 (replace 'build
2511 (lambda* (#:key inputs outputs #:allow-other-keys)
2512 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
2513
2514 ;; Disable tests to avoid dependency on hamcrest-core, which needs
2515 ;; Ant to build. This is necessary in addition to disabling the
2516 ;; "check" phase, because the dependency on "test-jar" would always
2517 ;; result in the tests to be run.
2518 (substitute* "build.xml"
2519 (("depends=\"jars,test-jar") "depends=\"jars"))
2520 (invoke "bash" "bootstrap.sh"
2521 (string-append "-Ddist.dir="
2522 (assoc-ref outputs "out")))))))))
2523 (native-inputs
2524 `(("jdk" ,icedtea-8 "jdk")
2525 ("zip" ,zip)
2526 ("unzip" ,unzip)))))
2527
2528 ;; The 1.9.x series is the last that can be built with GCJ. The 1.10.x series
2529 ;; requires Java 8.
2530 (define-public ant
2531 (package (inherit ant/java8)
2532 (version "1.9.15")
2533 (source (origin
2534 (method url-fetch)
2535 (uri (string-append "mirror://apache/ant/source/apache-ant-"
2536 version "-src.tar.gz"))
2537 (sha256
2538 (base32
2539 "1xy30f1w5gaqk6g3f0vw7ygix4rb6032qkcw42y4z8wd9jihgygd"))))
2540 (native-inputs
2541 `(("jdk" ,icedtea-7 "jdk")
2542 ("zip" ,zip)
2543 ("unzip" ,unzip)))))
2544
2545 (define-public ant-apache-bcel
2546 (package
2547 (inherit ant/java8)
2548 (name "ant-apache-bcel")
2549 (arguments
2550 (substitute-keyword-arguments (package-arguments ant/java8)
2551 ((#:phases phases)
2552 `(modify-phases ,phases
2553 (add-after 'unpack 'link-bcel
2554 (lambda* (#:key inputs #:allow-other-keys)
2555 (for-each (lambda (file)
2556 (symlink file
2557 (string-append "lib/optional/"
2558 (basename file))))
2559 (find-files (assoc-ref inputs "java-commons-bcel")
2560 "\\.jar$"))
2561 #t))
2562 (add-after 'build 'install
2563 (lambda* (#:key outputs #:allow-other-keys)
2564 (let* ((out (assoc-ref outputs "out"))
2565 (share (string-append out "/share/java"))
2566 (bin (string-append out "/bin"))
2567 (lib (string-append out "/lib")))
2568 (mkdir-p share)
2569 (install-file (string-append lib "/ant-apache-bcel.jar") share)
2570 (delete-file-recursively bin)
2571 (delete-file-recursively lib)
2572 #t)))))))
2573 (inputs
2574 `(("java-commons-bcel" ,java-commons-bcel)
2575 ,@(package-inputs ant/java8)))))
2576
2577 (define-public ant-junit
2578 (package
2579 (inherit ant/java8)
2580 (name "ant-junit")
2581 (arguments
2582 (substitute-keyword-arguments (package-arguments ant/java8)
2583 ((#:phases phases)
2584 `(modify-phases ,phases
2585 (add-after 'unpack 'link-junit
2586 (lambda* (#:key inputs #:allow-other-keys)
2587 (for-each (lambda (file)
2588 (symlink file
2589 (string-append "lib/optional/"
2590 (basename file))))
2591 (find-files (assoc-ref inputs "java-junit")
2592 "\\.jar$"))
2593 #t))
2594 (add-after 'build 'install
2595 (lambda* (#:key outputs #:allow-other-keys)
2596 (let* ((out (assoc-ref outputs "out"))
2597 (share (string-append out "/share/java"))
2598 (bin (string-append out "/bin"))
2599 (lib (string-append out "/lib")))
2600 (mkdir-p share)
2601 (install-file (string-append lib "/ant-junit.jar") share)
2602 (delete-file-recursively bin)
2603 (delete-file-recursively lib)
2604 #t)))))))
2605 (inputs
2606 `(("java-junit" ,java-junit)
2607 ,@(package-inputs ant/java8)))))
2608
2609 (define-public java-openjfx-build
2610 (package
2611 (name "java-openjfx-build")
2612 ;; This is a java-8 version
2613 (version "8.202")
2614 (source (origin
2615 (method hg-fetch)
2616 (uri (hg-reference
2617 (url "http://hg.openjdk.java.net/openjfx/8u-dev/rt")
2618 (changeset (string-append
2619 (string-join (string-split version #\.) "u")
2620 "-ga"))))
2621 (file-name (string-append name "-" version "-checkout"))
2622 (modules '((guix build utils)))
2623 (snippet
2624 '(begin
2625 ;; Delete included gradle jar
2626 (delete-file-recursively "gradle/wrapper")
2627 #t))
2628 (sha256
2629 (base32
2630 "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))
2631 (patches (search-patches "java-openjfx-build-jdk_version.patch"))))
2632 (build-system ant-build-system)
2633 (arguments
2634 `(#:jar-name "java-openjfx.jar"
2635 #:source-dir "buildSrc/src/main/java"
2636 #:test-dir "buildSrc/src/test"
2637 #:phases
2638 (modify-phases %standard-phases
2639 (add-before 'configure 'generate-jsl-parser
2640 (lambda _
2641 (invoke "antlr3" "-o"
2642 "buildSrc/src/main/java/com/sun/scenario/effect/compiler"
2643 "buildSrc/src/main/antlr/JSL.g"))))))
2644 (inputs
2645 `(("antlr3" ,antlr3)
2646 ("java-stringtemplate" ,java-stringtemplate)))
2647 (native-inputs
2648 `(("java-junit" ,java-junit)
2649 ("java-hamcrest-core" ,java-hamcrest-core)))
2650 (home-page "https://openjfx.io")
2651 (synopsis "Graphical application toolkit in Java")
2652 (description "OpenJFX is a client application platform for desktop,
2653 mobile and embedded systems built on Java. Its goal is to produce a
2654 modern, efficient, and fully featured toolkit for developing rich client
2655 applications. This package contains base classes for the OpenJFX
2656 distribution and helper classes for building other parts of the
2657 distribution.")
2658 (license license:gpl2))) ;gpl2 only, with classpath exception
2659
2660 (define-public java-openjfx-base
2661 (package (inherit java-openjfx-build)
2662 (name "java-openjfx-base")
2663 (arguments
2664 `(#:jar-name "java-openjfx-base.jar"
2665 #:source-dir "modules/base/src/main/java:modules/base/src/main/java8:modules/base/src/main/version-info"
2666 #:test-dir "modules/base/src/test"
2667 #:phases
2668 (modify-phases %standard-phases
2669 (add-before 'check 'remove-empty-file
2670 (lambda _
2671 (with-directory-excursion "modules/base/src/test/java"
2672 ;; These files are completely commented, but junit expects them to
2673 ;; contain a class, so tests fail.
2674 (delete-file
2675 "com/sun/javafx/property/adapter/PropertyDescriptorTest.java")
2676 (delete-file
2677 "com/sun/javafx/property/adapter/ReadOnlyPropertyDescriptorTest.java")
2678 (delete-file "javafx/beans/property/PropertiesTest.java")
2679 (delete-file
2680 "javafx/beans/property/adapter/ReadOnlyJavaBeanPropertyBuilder_General_Test.java")
2681 ;; This one fails
2682 (delete-file "com/sun/javafx/runtime/VersionInfoTest.java"))
2683 #t)))))
2684 (propagated-inputs
2685 `(("java-openjfx-build" ,java-openjfx-build)))
2686 (description "OpenJFX is a client application platform for desktop,
2687 mobile and embedded systems built on Java. Its goal is to produce a
2688 modern, efficient, and fully featured toolkit for developing rich client
2689 applications. This package contains base classes for the OpenJFX
2690 distribution.")))
2691
2692 (define-public java-openjfx-graphics
2693 (package (inherit java-openjfx-build)
2694 (name "java-openjfx-graphics")
2695 (arguments
2696 `(#:jar-name "java-openjfx-graphics.jar"
2697 #:source-dir "modules/graphics/src/main/java"
2698 #:tests? #f; require X
2699 #:test-dir "modules/graphics/src/test"))
2700 (propagated-inputs
2701 `(("java-openjfx-base" ,java-openjfx-base)
2702 ("java-swt" ,java-swt)))
2703 (description "OpenJFX is a client application platform for desktop,
2704 mobile and embedded systems built on Java. Its goal is to produce a
2705 modern, efficient, and fully featured toolkit for developing rich client
2706 applications. This package contains graphics-related classes for the
2707 OpenJFX distribution.")))
2708
2709 (define-public java-openjfx-media
2710 (package (inherit java-openjfx-build)
2711 (name "java-openjfx-media")
2712 (propagated-inputs
2713 `(("java-openjxf-graphics" ,java-openjfx-graphics)))
2714 (arguments
2715 `(#:jar-name "java-openjfx-media.jar"
2716 #:source-dir "modules/media/src/main/java"
2717 #:tests? #f)); no tests
2718 (description "OpenJFX is a client application platform for desktop,
2719 mobile and embedded systems built on Java. Its goal is to produce a
2720 modern, efficient, and fully featured toolkit for developing rich client
2721 applications. This package contains media-related classes for the
2722 OpenJFX distribution.")))
2723
2724 (define-public java-openjfx-controls
2725 (package (inherit java-openjfx-build)
2726 (name "java-openjfx-controls")
2727 (propagated-inputs
2728 `(("java-openjxf-graphics" ,java-openjfx-graphics)))
2729 (arguments
2730 `(#:jar-name "java-openjfx-controls.jar"
2731 #:source-dir "modules/controls/src/main/java"
2732 #:test-dir "modules/controls/src/test"
2733 ;; TODO: tests require com.sun.javafx.pgstub,
2734 ;; javafx.collections.MockSetObserver, and
2735 ;; com.sun.javafx.binding.ExpressionHelperUtility
2736 #:tests? #false
2737 #:phases
2738 (modify-phases %standard-phases
2739 (add-after 'unpack 'copy-resources
2740 (lambda _
2741 (copy-recursively "modules/controls/src/test/resources"
2742 "build/test-classes")
2743 (copy-recursively "modules/controls/src/main/resources"
2744 "build/classes"))))))
2745 (description "OpenJFX is a client application platform for desktop,
2746 mobile and embedded systems built on Java. Its goal is to produce a
2747 modern, efficient, and fully featured toolkit for developing rich client
2748 applications. This package contains UI control classes for the
2749 OpenJFX distribution.")))
2750
2751 (define-public javacc-4
2752 (package
2753 (name "javacc")
2754 (version "4.1")
2755 (source (origin
2756 (method git-fetch)
2757 (uri (git-reference
2758 (url "https://github.com/javacc/javacc")
2759 (commit "release_41")))
2760 (file-name (string-append "javacc-" version "-checkout"))
2761 (sha256
2762 (base32
2763 "07ysav7j8r1c6h8qxrgqk6lwdp74ly0ad1935lragxml0qqc3ka0"))
2764 (modules '((guix build utils)))
2765 ;; delete bundled jars
2766 (snippet '(begin (delete-file-recursively "lib") #t))))
2767 (build-system ant-build-system)
2768 ;; Tests fail with
2769 ;; /tmp/guix-build-javacc-4.1.drv-0/source/test/javacodeLA/build.xml:60:
2770 ;; JAVACODE failed
2771 (arguments
2772 `(#:tests? #f
2773 #:phases
2774 (modify-phases %standard-phases
2775 ;; Delete tests to avoid build failure (we don't run them anyway).
2776 (add-after 'unpack 'delete-tests
2777 (lambda _
2778 (for-each delete-file
2779 '("src/org/javacc/JavaCCTestCase.java"
2780 "src/org/javacc/parser/ExpansionTest.java"
2781 "src/org/javacc/parser/OptionsTest.java"
2782 "src/org/javacc/jjtree/JJTreeOptionsTest.java"))
2783 (for-each delete-file-recursively
2784 '("src/org/javacc/parser/test"
2785 "src/org/javacc/jjdoc/test"))
2786 #t))
2787 (replace 'install (install-jars "bin/lib")))))
2788 (home-page "https://javacc.org/")
2789 (synopsis "Java parser generator")
2790 (description "Java Compiler Compiler (JavaCC) is the most popular parser
2791 generator for use with Java applications. A parser generator is a tool that
2792 reads a grammar specification and converts it to a Java program that can
2793 recognize matches to the grammar. In addition to the parser generator itself,
2794 JavaCC provides other standard capabilities related to parser generation such
2795 as tree building (via a tool called JJTree included with JavaCC), actions,
2796 debugging, etc.")
2797 (license license:bsd-3)))
2798
2799 ;; javacc-3, as javacc-4 is not properly bootstrapped: is contains a javacc.jar
2800 ;; in the bootstrap/ directory.
2801 (define-public javacc-3
2802 (package
2803 (inherit javacc-4)
2804 (version "3.2")
2805 (source (origin
2806 (method git-fetch)
2807 (uri (git-reference
2808 (url "https://github.com/javacc/javacc")
2809 (commit "release_32")))
2810 (file-name (string-append "javacc-" version "-checkout"))
2811 (sha256
2812 (base32
2813 "1pyf1xyh8gk83nxqn2v2mdws32l68ydznha41cxa4l2kkbq1v1g3"))))
2814 (arguments
2815 `(#:tests? #f
2816 #:phases
2817 (modify-phases %standard-phases
2818 (add-before 'build 'set-java-version
2819 (lambda _
2820 (for-each
2821 (lambda (file)
2822 (substitute* file
2823 (("debug=") "source=\"1.4\" debug=")))
2824 (find-files "." "build.xml"))
2825 #t))
2826 (replace 'install (install-jars "bin/lib")))))))
2827
2828 (define-public javacc
2829 (package
2830 (inherit javacc-4)
2831 (version "7.0.4")
2832 (source
2833 (origin
2834 (method git-fetch)
2835 (uri (git-reference
2836 (url "https://github.com/javacc/javacc")
2837 (commit version)))
2838 (file-name (git-file-name "javacc" version))
2839 (sha256
2840 (base32 "18kkak3gda93gr25jrgy6q00g0jr8i24ri2wk4kybz1v234fxx9i"))
2841 (modules '((guix build utils)))
2842 ;; Delete bundled jars.
2843 (snippet '(begin (for-each delete-file-recursively
2844 '("bootstrap" "lib"))
2845 #t))))
2846 (arguments
2847 `(#:make-flags ; bootstrap from javacc-4
2848 (list (string-append "-Dbootstrap-jar="
2849 (assoc-ref %build-inputs "javacc")
2850 "/share/java/javacc.jar"))
2851 #:test-target "test"
2852 #:phases
2853 (modify-phases %standard-phases
2854 (replace 'install (install-jars "target"))
2855 (add-after 'install 'install-bin
2856 (lambda* (#:key outputs inputs #:allow-other-keys)
2857 (let* ((out (assoc-ref outputs "out"))
2858 (dir (string-append out "/share/java"))
2859 (bin (string-append out "/bin"))
2860 (javacc (string-append bin "/javacc")))
2861 (mkdir-p bin)
2862 (with-output-to-file javacc
2863 (lambda _
2864 (display
2865 (string-append "#!/bin/sh\n"
2866 (assoc-ref inputs "jdk") "/bin/java"
2867 " -cp " dir "/javacc.jar" " `basename $0`" " $*"))))
2868 (chmod javacc #o755)
2869 ;; symlink to different names to affect the first argument and
2870 ;; change the behavior of the jar file.
2871 (symlink javacc (string-append bin "/jjdoc"))
2872 (symlink javacc (string-append bin "/jjtree"))
2873 #t))))))
2874
2875 (native-inputs
2876 `(("javacc" ,javacc-4)))))
2877
2878 ;; This is the last 3.x release of ECJ
2879 (define-public java-ecj-3
2880 (package
2881 (name "java-ecj")
2882 (version "3.8.2")
2883 (source (origin
2884 (method url-fetch)
2885 (uri (string-append "http://archive.eclipse.org/eclipse/"
2886 "downloads/drops/R-" version
2887 "-201301310800/ecjsrc-" version ".jar"))
2888 (sha256
2889 (base32
2890 "01mdj14jw11g1jfnki4fi8229p0c6zzckd38zqy2w4m3cjcvsx04"))))
2891 (build-system ant-build-system)
2892 (arguments
2893 `(#:tests? #f ; none included
2894 #:jdk ,icedtea-7 ; doesn't build with JDK8+
2895 #:make-flags (list "-f" "src/build.xml")
2896 #:build-target "build"
2897 #:phases
2898 (modify-phases %standard-phases
2899 (add-after 'unpack 'fix-manifest
2900 (lambda _
2901 ;; Record the main class to make ecj executable.
2902 (with-atomic-file-replacement "src/META-INF/MANIFEST.MF"
2903 (lambda (in out)
2904 (display "Manifest-Version: 1.0
2905 Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n"
2906 out)))
2907 #t))
2908 (replace 'install (install-jars ".")))))
2909 (home-page "https://eclipse.org")
2910 (synopsis "Eclipse Java development tools core batch compiler")
2911 (description "This package provides the Eclipse Java core batch compiler.")
2912 (license license:epl1.0)))
2913
2914 ;; This is needed for java-cisd-args4j
2915 (define-public java-ecj-3.5
2916 (package (inherit java-ecj-3)
2917 (version "3.5.1")
2918 (source (origin
2919 (method url-fetch/zipbomb)
2920 (uri (string-append "http://archive.eclipse.org/eclipse/"
2921 "downloads/drops/R-" version
2922 "-200909170800/ecjsrc-" version ".zip"))
2923 (sha256
2924 (base32
2925 "1vnl2mavisc567bip736xzsvvbjif5279wc4a7pbdik5wlir8qr7"))))
2926 (build-system ant-build-system)
2927 (arguments
2928 `(#:tests? #f ; none included
2929 #:jdk ,icedtea-7 ; doesn't build with JDK8+
2930 #:build-target "build"
2931 #:phases
2932 (modify-phases %standard-phases
2933 (add-after 'unpack 'fix-manifest
2934 (lambda _
2935 ;; Record the main class to make ecj executable.
2936 (with-atomic-file-replacement "META-INF/MANIFEST.MF"
2937 (lambda (in out)
2938 (dump-port in out)
2939 (display "Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n"
2940 out)))
2941 #t))
2942 (replace 'install (install-jars ".")))))
2943 (native-inputs
2944 `(("unzip" ,unzip)))))
2945
2946 (define-public java-ecj
2947 (package (inherit java-ecj-3)
2948 (version "4.6.3")
2949 (source
2950 (origin
2951 (method url-fetch)
2952 (uri (string-append
2953 "http://archive.eclipse.org/eclipse/downloads/drops4/R-"
2954 version
2955 "-201703010400/ecjsrc-"
2956 version
2957 ".jar"))
2958 (sha256
2959 (base32
2960 "11cfgsdgznja1pvlxkjbqykxd7pcd5655vkm7s44xmahmap15gpl"))))
2961 (arguments
2962 `(#:tests? #f ; none included
2963 #:build-target "build"
2964 #:phases
2965 (modify-phases %standard-phases
2966 (add-after 'unpack 'fix-build.xml
2967 (lambda _
2968 (substitute* "src/build.xml"
2969 (("^.*MANIFEST.*$")
2970 ""))
2971 #t))
2972 (add-after 'unpack 'fix-prop
2973 (lambda _
2974 (substitute* "src/build.xml"
2975 (("^.*properties.*$")
2976 "<include name=\"**/*.properties\"/>
2977 <include name=\"**/*.props\"/>"))
2978 #t))
2979 (add-before 'build 'chdir
2980 (lambda _
2981 (chdir "src")
2982 #t))
2983 (replace 'install (install-jars ".")))))))
2984
2985 (define-public java-cisd-base
2986 (let ((revision 38938)
2987 (base-version "14.12.0"))
2988 (package
2989 (name "java-cisd-base")
2990 (version (string-append base-version "-" (number->string revision)))
2991 (source (origin
2992 (method svn-fetch)
2993 (uri (svn-reference
2994 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2995 "base/tags/release/"
2996 (version-major+minor base-version)
2997 ".x/" base-version "/base/"))
2998 (revision revision)))
2999 (file-name (string-append "java-cisd-base-" version "-checkout"))
3000 (sha256
3001 (base32
3002 "1i5adyf7nzclb0wydgwa1az04qliid8035vpahaandmkmigbnxiy"))
3003 (modules '((guix build utils)))
3004 (snippet
3005 '(begin
3006 ;; Delete included gradle jar
3007 (delete-file-recursively "gradle/wrapper")
3008 ;; Delete pre-built native libraries
3009 (delete-file-recursively "libs")
3010 #t))))
3011 (build-system ant-build-system)
3012 (arguments
3013 `(#:make-flags '("-file" "build/build.xml")
3014 #:test-target "jar-test"
3015 #:jdk ,icedtea-8
3016 #:phases
3017 (modify-phases %standard-phases
3018 (add-after 'unpack 'unpack-build-resources
3019 (lambda* (#:key inputs #:allow-other-keys)
3020 (copy-recursively (assoc-ref inputs "build-resources")
3021 "../build_resources")
3022 #t))
3023 (add-after 'unpack-build-resources 'fix-dependencies
3024 (lambda* (#:key inputs #:allow-other-keys)
3025 (substitute* "build/build.xml"
3026 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
3027 (string-append (assoc-ref inputs "java-testng")
3028 "/share/java/java-testng.jar"))
3029 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
3030 (string-append (assoc-ref inputs "java-commons-lang")
3031 "/share/java/commons-lang-"
3032 ,(package-version java-commons-lang) ".jar"))
3033 (("\\$\\{lib\\}/commons-io/commons-io.jar")
3034 (string-append (assoc-ref inputs "java-commons-io")
3035 "/lib/m2/commons-io/commons-io/"
3036 ,(package-version java-commons-io)
3037 "/commons-io-"
3038 ,(package-version java-commons-io)
3039 ".jar"))
3040 ;; Remove dependency on svn
3041 (("<build-info.*") "")
3042 (("\\$\\{revision.number\\}")
3043 ,(number->string revision))
3044 (("\\$\\{version.number\\}") ,base-version))
3045 ;; Remove dependency on classycle
3046 (substitute* "../build_resources/ant/build-common.xml"
3047 (("<taskdef name=\"dependency-checker.*") "")
3048 (("classname=\"classycle.*") "")
3049 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
3050 #t))
3051 ;; A few tests fail because of the lack of a proper /etc/groups and
3052 ;; /etc/passwd file in the build container.
3053 (add-after 'unpack 'disable-broken-tests
3054 (lambda _
3055 (substitute* "sourceTest/java/ch/systemsx/cisd/base/AllTests.java"
3056 (("Unix.isOperational\\(\\)") "false"))
3057 #t))
3058 ;; These decorators are almost useless and pull in an unpackaged
3059 ;; dependency.
3060 (add-after 'unpack 'remove-useless-decorators
3061 (lambda _
3062 (substitute* "source/java/ch/systemsx/cisd/base/unix/Unix.java"
3063 (("@Private") "")
3064 (("import ch.rinn.restrictions.Private;") ""))
3065 (substitute* "sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java"
3066 (("@Friend.*") "")
3067 (("import ch.rinn.restrictions.Friend;") ""))
3068 #t))
3069 (add-before 'configure 'build-native-code
3070 (lambda* (#:key inputs #:allow-other-keys)
3071 (let ((jdk (assoc-ref inputs "jdk"))
3072 (dir ,(match (%current-system)
3073 ("i686-linux"
3074 "i386-Linux")
3075 ((or "armhf-linux" "aarch64-linux")
3076 "arm-Linux")
3077 ((or "x86_64-linux")
3078 "amd64-Linux")
3079 (_ "unknown-Linux"))))
3080 (with-directory-excursion "source/c"
3081 (invoke "gcc" "-shared" "-O3" "-fPIC" "unix.c"
3082 (string-append "-I" jdk "/include")
3083 (string-append "-I" jdk "/include/linux")
3084 "-o" "libunix.so")
3085 (invoke "gcc" "-shared" "-O3" "-fPIC"
3086 "-DMACHINE_BYTE_ORDER=1"
3087 "copyCommon.c"
3088 "copyByteChar.c"
3089 "copyByteDouble.c"
3090 "copyByteFloat.c"
3091 "copyByteInt.c"
3092 "copyByteLong.c"
3093 "copyByteShort.c"
3094 (string-append "-I" jdk "/include")
3095 (string-append "-I" jdk "/include/linux")
3096 "-o" "libnativedata.so"))
3097 (install-file "source/c/libunix.so"
3098 (string-append "libs/native/unix/" dir))
3099 (install-file "source/c/libnativedata.so"
3100 (string-append "libs/native/nativedata/" dir))
3101 #t)))
3102 ;; In the "check" phase we only build the test executable.
3103 (add-after 'check 'run-tests
3104 (lambda _
3105 (invoke "java" "-jar" "targets/dist/sis-base-test.jar")
3106 (delete-file "targets/dist/sis-base-test.jar")
3107 #t))
3108 (replace 'install (install-jars "targets/dist")))))
3109 (native-inputs
3110 `(("jdk" ,icedtea-8)
3111 ("java-commons-lang" ,java-commons-lang)
3112 ("java-commons-io" ,java-commons-io)
3113 ("java-testng" ,java-testng)
3114 ("build-resources"
3115 ,(origin
3116 (method svn-fetch)
3117 (uri (svn-reference
3118 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3119 "base/tags/release/"
3120 (version-major+minor base-version)
3121 ".x/" base-version
3122 "/build_resources/"))
3123 (revision revision)))
3124 (sha256
3125 (base32
3126 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
3127 (home-page "http://svnsis.ethz.ch")
3128 (synopsis "Utility classes for libraries from ETH Zurich")
3129 (description "This library supplies some utility classes needed for
3130 libraries from the SIS division at ETH Zurich like jHDF5.")
3131 ;; The C sources are under a non-copyleft license, which looks like a
3132 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
3133 (license (list license:asl2.0
3134 (license:non-copyleft "file://source/c/COPYING"))))))
3135
3136 (define-public java-cisd-args4j
3137 (let ((revision 39162)
3138 (base-version "9.11.2"))
3139 (package
3140 (name "java-cisd-args4j")
3141 (version (string-append base-version "-" (number->string revision)))
3142 (source (origin
3143 (method svn-fetch)
3144 (uri (svn-reference
3145 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3146 "args4j/tags/release/"
3147 (version-major+minor base-version)
3148 ".x/" base-version "/args4j/"))
3149 (revision revision)))
3150 (file-name (string-append "java-cisd-args4j-" version "-checkout"))
3151 (sha256
3152 (base32
3153 "0hhqznjaivq7ips7mkwas78z42s6djsm20rrs7g1zd59rcsakxn2"))))
3154 (build-system ant-build-system)
3155 (arguments
3156 `(#:make-flags '("-file" "build/build.xml")
3157 #:tests? #f ; there are no tests
3158 ;; There are weird build failures with JDK8, such as: "The type
3159 ;; java.io.ObjectInputStream cannot be resolved. It is indirectly
3160 ;; referenced from required .class files"
3161 #:jdk ,icedtea-7
3162 #:modules ((guix build ant-build-system)
3163 (guix build utils)
3164 (guix build java-utils)
3165 (sxml simple)
3166 (sxml transform)
3167 (sxml xpath))
3168 #:phases
3169 (modify-phases %standard-phases
3170 (add-after 'unpack 'unpack-build-resources
3171 (lambda* (#:key inputs #:allow-other-keys)
3172 (mkdir-p "../build_resources")
3173 (invoke "tar" "xf" (assoc-ref inputs "build-resources")
3174 "-C" "../build_resources"
3175 "--strip-components=1")
3176 (mkdir-p "../build_resources/lib")
3177 #t))
3178 (add-after 'unpack-build-resources 'fix-dependencies
3179 (lambda* (#:key inputs #:allow-other-keys)
3180 ;; FIXME: There should be a more convenient abstraction for
3181 ;; editing XML files.
3182 (with-directory-excursion "../build_resources/ant/"
3183 (chmod "build-common.xml" #o664)
3184 (call-with-output-file "build-common.xml.new"
3185 (lambda (port)
3186 (sxml->xml
3187 (pre-post-order
3188 (with-input-from-file "build-common.xml"
3189 (lambda _ (xml->sxml #:trim-whitespace? #t)))
3190 `(;; Remove dependency on classycle and custom ant tasks
3191 (taskdef . ,(lambda (tag . kids)
3192 (let ((name ((sxpath '(name *text*)) kids)))
3193 (if (or (member "build-info" name)
3194 (member "dependency-checker" name)
3195 (member "build-java-subprojects" name)
3196 (member "project-classpath" name))
3197 '() ; skip
3198 `(,tag ,@kids)))))
3199 (typedef . ,(lambda (tag . kids)
3200 (let ((name ((sxpath '(name *text*)) kids)))
3201 (if (member "recursive-jar" name)
3202 '() ; skip
3203 `(,tag ,@kids)))))
3204 (build-java-subprojects . ,(lambda _ '()))
3205 ;; Ignore everything else
3206 (*default* . ,(lambda (tag . kids) `(,tag ,@kids)))
3207 (*text* . ,(lambda (_ txt) txt))))
3208 port)))
3209 (rename-file "build-common.xml.new" "build-common.xml"))
3210 (substitute* "build/build.xml"
3211 (("\\$\\{lib\\}/cisd-base/cisd-base.jar")
3212 (string-append (assoc-ref inputs "java-cisd-base")
3213 "/share/java/sis-base.jar"))
3214 ;; Remove dependency on svn
3215 (("<build-info.*") "")
3216 (("\\$\\{revision.number\\}")
3217 ,(number->string revision))
3218 (("\\$\\{version.number\\}") ,base-version)
3219 ;; Don't use custom ant tasks.
3220 (("recursive-jar") "jar")
3221 (("<project-classpath.*") ""))
3222 #t))
3223 (replace 'install (install-jars "targets/dist")))))
3224 (inputs
3225 `(("java-cisd-base" ,java-cisd-base)))
3226 (native-inputs
3227 `(("ecj" ,java-ecj-3.5)
3228 ("build-resources"
3229 ,(origin
3230 (method svn-fetch)
3231 (uri (svn-reference
3232 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3233 "args4j/tags/release/"
3234 (version-major+minor base-version)
3235 ".x/" base-version
3236 "/build_resources/"))
3237 (revision revision)))
3238 (sha256
3239 (base32
3240 "056cam4k8pll7ass31sy6gwn8g8719njc41yf4l02b0342nilkyf"))
3241 (modules '((guix build utils)))
3242 ;; Delete bundled pre-built jars.
3243 (snippet
3244 '(begin (delete-file-recursively "lib/") #t))))))
3245 (home-page "http://svnsis.ethz.ch")
3246 (synopsis "Command line parser library")
3247 (description "This package provides a parser for command line arguments.")
3248 (license license:asl2.0))))
3249
3250 (define-public java-cisd-jhdf5
3251 (let ((revision 39162)
3252 (base-version "14.12.6"))
3253 (package
3254 (name "java-cisd-jhdf5")
3255 (version (string-append base-version "-" (number->string revision)))
3256 (source (origin
3257 (method svn-fetch)
3258 (uri (svn-reference
3259 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3260 "jhdf5/tags/release/"
3261 (version-major+minor base-version)
3262 ".x/" base-version "/jhdf5/"))
3263 (revision revision)))
3264 (file-name (string-append "java-cisd-jhdf5-" version "-checkout"))
3265 (sha256
3266 (base32
3267 "13i17s2hn0q9drdqvp8csy7770p3hdbh9rp30ihln2ldkfawdmz0"))
3268 (modules '((guix build utils)))
3269 (snippet
3270 '(begin
3271 ;; Delete included gradle jar
3272 (delete-file-recursively "gradle/wrapper")
3273 ;; Delete pre-built native libraries
3274 (delete-file-recursively "libs")
3275 #t))))
3276 (build-system ant-build-system)
3277 (arguments
3278 `(#:make-flags '("-file" "build/build.xml")
3279 #:build-target "jar-all"
3280 #:test-target "jar-test"
3281 #:jdk ,icedtea-8
3282 #:phases
3283 (modify-phases %standard-phases
3284 ;; FIXME: this build phase fails.
3285 (delete 'generate-jar-indices)
3286 ;; Don't erase results from the build phase when building tests.
3287 (add-after 'unpack 'separate-test-target-from-clean
3288 (lambda _
3289 (substitute* "build/build.xml"
3290 (("\"jar-test\" depends=\"clean, ")
3291 "\"jar-test\" depends=\""))
3292 #t))
3293 (add-after 'unpack 'unpack-build-resources
3294 (lambda* (#:key inputs #:allow-other-keys)
3295 (copy-recursively (assoc-ref inputs "build-resources")
3296 "../build_resources")
3297 (delete-file-recursively "../build_resources/lib/")
3298 (mkdir-p "../build_resources/lib")
3299 ;; Remove dependency on classycle
3300 (substitute* "../build_resources/ant/build-common.xml"
3301 (("<taskdef name=\"dependency-checker.*") "")
3302 (("classname=\"classycle.*") "")
3303 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
3304 ;; Remove dependency on svn
3305 (substitute* "build/build.xml"
3306 (("<build-info.*") "")
3307 (("\\$\\{revision.number\\}")
3308 ,(number->string revision))
3309 (("\\$\\{version.number\\}") ,base-version))
3310 #t))
3311 (add-after 'unpack-build-resources 'fix-dependencies
3312 (lambda* (#:key inputs #:allow-other-keys)
3313 (substitute* "../build_resources/ant/build-common.xml"
3314 (("../libraries/testng/testng-jdk15.jar")
3315 (string-append (assoc-ref inputs "java-testng")
3316 "/share/java/java-testng.jar")))
3317 (substitute* "build/build.xml"
3318 (("\\$\\{lib\\}/sis-base/sis-base.jar")
3319 (string-append (assoc-ref inputs "java-cisd-base")
3320 "/share/java/sis-base.jar"))
3321 (("\\$\\{lib\\}/cisd-args4j/cisd-args4j.jar")
3322 (string-append (assoc-ref inputs "java-cisd-args4j")
3323 "/share/java/cisd-args4j.jar"))
3324 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
3325 (string-append (assoc-ref inputs "java-commons-lang")
3326 "/share/java/commons-lang-"
3327 ,(package-version java-commons-lang) ".jar"))
3328 (("\\$\\{lib\\}/commons-io/commons-io.jar")
3329 (string-append (assoc-ref inputs "java-commons-io")
3330 "/lib/m2/commons-io/commons-io/"
3331 ,(package-version java-commons-io)
3332 "/commons-io-"
3333 ,(package-version java-commons-io)
3334 ".jar"))
3335 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
3336 (string-append (assoc-ref inputs "java-testng")
3337 "/share/java/java-testng.jar"))
3338 (("\\$\\{lib\\}/junit4/junit.jar")
3339 (car (find-files (assoc-ref inputs "java-junit") "jar$")))
3340 (("\\$\\{lib\\}/jmock/hamcrest/hamcrest-core.jar")
3341 (car (find-files (assoc-ref inputs "java-hamcrest-core")
3342 "jar$"))))
3343 ;; Remove dependency on ch.rinn.restrictions
3344 (with-directory-excursion "source/java/ch/systemsx/cisd/hdf5/"
3345 (substitute* '("BitSetConversionUtils.java"
3346 "HDF5Utils.java")
3347 (("import ch.rinn.restrictions.Private;") "")
3348 (("@Private") "")))
3349 (with-directory-excursion "sourceTest/java/ch/systemsx/cisd/hdf5/"
3350 (substitute* '("BitSetConversionTest.java"
3351 "h5ar/HDF5ArchiverTest.java")
3352 (("import ch.rinn.restrictions.Friend;") "")
3353 (("@Friend.*") ""))
3354 ;; Remove leftovers from removing @Friend
3355 (substitute* "h5ar/HDF5ArchiverTest.java"
3356 (("\\{ HDF5Archiver.class, IdCache.class, LinkRecord.class \\}\\)")
3357 "")))
3358 #t))
3359 (add-before 'configure 'build-native-library
3360 (lambda* (#:key inputs #:allow-other-keys)
3361 (let ((jdk (assoc-ref inputs "jdk"))
3362 (hdf5 (assoc-ref inputs "hdf5"))
3363 (dir ,(match (%current-system)
3364 ("i686-linux"
3365 "i386-Linux")
3366 ((or "armhf-linux" "aarch64-linux")
3367 "arm-Linux")
3368 ((or "x86_64-linux")
3369 "amd64-Linux")
3370 (_ "unknown-Linux"))))
3371 (with-directory-excursion "source/c"
3372 (apply invoke `("gcc" "-shared" "-O3"
3373 "-fPIC"
3374 "-Wl,--exclude-libs,ALL"
3375 ,@(find-files "jhdf5" "\\.c$")
3376 ,@(find-files "hdf-java" "\\.c$")
3377 ,(string-append "-I" hdf5 "/include")
3378 ,(string-append "-I" jdk "/include")
3379 ,(string-append "-I" jdk "/include/linux")
3380 ,(string-append hdf5 "/lib/libhdf5.a")
3381 "-o" "libjhdf5.so" "-lz")))
3382 (install-file "source/c/libjhdf5.so"
3383 (string-append "libs/native/jhdf5/" dir))
3384 #t)))
3385 ;; In the "check" phase we only build the test executable.
3386 (add-after 'check 'run-tests
3387 (lambda _
3388 (invoke "java" "-jar" "targets/dist/sis-jhdf5-test.jar")
3389 (delete-file "targets/dist/sis-jhdf5-test.jar")
3390 #t))
3391 (replace 'install
3392 (install-jars "targets/dist")))))
3393 (inputs
3394 `(("java-cisd-base" ,java-cisd-base)
3395 ("java-cisd-args4j" ,java-cisd-args4j)
3396 ("java-commons-lang" ,java-commons-lang)
3397 ("java-commons-io" ,java-commons-io)
3398 ("hdf5" ,hdf5-1.8)
3399 ("zlib" ,zlib)))
3400 (native-inputs
3401 `(("jdk" ,icedtea-8)
3402 ("java-testng" ,java-testng)
3403 ("java-junit" ,java-junit)
3404 ("java-jmock" ,java-jmock)
3405 ("java-hamcrest-core" ,java-hamcrest-core)
3406 ("build-resources"
3407 ,(origin
3408 (method svn-fetch)
3409 (uri (svn-reference
3410 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3411 "jhdf5/tags/release/"
3412 (version-major+minor base-version)
3413 ".x/" base-version
3414 "/build_resources/"))
3415 (revision revision)))
3416 (sha256
3417 (base32
3418 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
3419 (home-page "https://wiki-bsse.ethz.ch/display/JHDF5/")
3420 (synopsis "Java binding for HDF5")
3421 (description "JHDF5 is a high-level API in Java for reading and writing
3422 HDF5 files, building on the libraries provided by the HDF Group.")
3423 ;; The C sources are under a non-copyleft license, which looks like a
3424 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
3425 (license (list license:asl2.0
3426 (license:non-copyleft "file://source/c/COPYING"))))))
3427
3428 (define-public java-classpathx-servletapi
3429 (package
3430 (name "java-classpathx-servletapi")
3431 (version "3.0.1")
3432 (source (origin
3433 (method url-fetch)
3434 (uri (string-append "mirror://gnu/classpathx/servletapi/"
3435 "servletapi-" version ".tar.gz"))
3436 (sha256
3437 (base32
3438 "07d8h051siga2f33fra72hk12sbq1bxa4jifjg0qj0vfazjjff0x"))))
3439 (build-system ant-build-system)
3440 (arguments
3441 `(#:tests? #f ; there is no test target
3442 #:build-target "compile"
3443 #:make-flags
3444 (list "-Dbuild.compiler=javac1.8"
3445 (string-append "-Ddist=" (assoc-ref %outputs "out")))
3446 #:phases
3447 (modify-phases %standard-phases
3448 (replace 'install
3449 (lambda* (#:key make-flags #:allow-other-keys)
3450 (apply invoke `("ant" "dist" ,@make-flags)))))))
3451 (home-page "https://www.gnu.org/software/classpathx/")
3452 (synopsis "Java servlet API implementation")
3453 (description "This is the GNU servlet API distribution, part of the
3454 ClasspathX project. It provides implementations of version 3.0 of the servlet
3455 API and version 2.1 of the Java ServerPages API.")
3456 (license license:gpl3+)))
3457
3458 (define-public java-javaee-servletapi
3459 (package
3460 (name "java-javaee-servletapi")
3461 (version "3.1.0")
3462 (source (origin
3463 (method git-fetch)
3464 (uri (git-reference
3465 (url "https://github.com/javaee/servlet-spec")
3466 (commit version)))
3467 (file-name (git-file-name name version))
3468 (sha256
3469 (base32
3470 "0s03lj8w5an70lkqbjycgfrfk0kc07vbfav91jzk87gh3awf9ksl"))))
3471 (build-system ant-build-system)
3472 (arguments
3473 `(#:jar-name "javax-servletapi.jar"
3474 ;; no tests
3475 #:tests? #f
3476 #:source-dir "src/main/java"
3477 #:phases
3478 (modify-phases %standard-phases
3479 (add-before 'build 'copy-resources
3480 (lambda _
3481 (mkdir-p "build/classes/javax/servlet/http")
3482 (let ((from-prefix "src/main/java/javax/servlet/")
3483 (to-prefix "build/classes/javax/servlet/"))
3484 (for-each (lambda (f)
3485 (copy-file (string-append from-prefix f)
3486 (string-append to-prefix f)))
3487 (list "LocalStrings_ja.properties"
3488 "LocalStrings.properties"
3489 "LocalStrings_fr.properties"
3490 "http/LocalStrings_es.properties"
3491 "http/LocalStrings_ja.properties"
3492 "http/LocalStrings.properties"
3493 "http/LocalStrings_fr.properties")))
3494 #t)))))
3495 (native-inputs
3496 `(("unzip" ,unzip)))
3497 (home-page "https://javaee.github.io/servlet-spec/")
3498 (synopsis "Java servlet API")
3499 (description "Java Servlet is the foundation web specification in the
3500 Java Enterprise Platform. Developers can build web applications using the
3501 Servlet API to interact with the request/response workflow. This project
3502 provides information on the continued development of the Java Servlet
3503 specification.")
3504 ;; Main code is dual-licensed by Oracle under either GLP2 or CDDL 1.1.
3505 ;; Some files are licensed under ASL 2.0.
3506 (license (list license:asl2.0 license:gpl2 license:cddl1.1))))
3507
3508 (define-public java-swt
3509 (package
3510 (name "java-swt")
3511 (version "4.7.1a")
3512 (source
3513 ;; The types of many variables and procedures differ in the sources
3514 ;; dependent on whether the target architecture is a 32-bit system or a
3515 ;; 64-bit system. Instead of patching the sources on demand in a build
3516 ;; phase we download either the 32-bit archive (which mostly uses "int"
3517 ;; types) or the 64-bit archive (which mostly uses "long" types).
3518 (let ((hash32 "09q0cbh90d90q3a7dx9430kc4m6bijrkr4lajrmzzvi0jjdpq4v9")
3519 (hash64 "17k5hs75a87ssmc5xhwdfdm2gn4zba0r837l2455za01krnkaa2q")
3520 (file32 "x86")
3521 (file64 "x86_64"))
3522 (let-values (((hash file)
3523 (match (or (%current-target-system) (%current-system))
3524 ("x86_64-linux" (values hash64 file64))
3525 (_ (values hash32 file32)))))
3526 (origin
3527 (method url-fetch)
3528 (uri (string-append
3529 "http://download.eclipse.org/eclipse/downloads/drops4/"
3530 "R-" version "-201710090410/swt-" version
3531 "-gtk-linux-" file ".zip"))
3532 (sha256 (base32 hash))))))
3533 (build-system ant-build-system)
3534 (arguments
3535 `(#:jar-name "swt.jar"
3536 #:jdk ,icedtea-8
3537 #:tests? #f ; no "check" target
3538 #:phases
3539 (modify-phases %standard-phases
3540 (replace 'unpack
3541 (lambda* (#:key source #:allow-other-keys)
3542 (mkdir "swt")
3543 (invoke "unzip" source "-d" "swt")
3544 (chdir "swt")
3545 (mkdir "src")
3546 (invoke "unzip" "src.zip" "-d" "src")))
3547 ;; The classpath contains invalid icecat jars. Since we don't need
3548 ;; anything other than the JDK on the classpath, we can simply unset
3549 ;; it.
3550 (add-after 'configure 'unset-classpath
3551 (lambda _ (unsetenv "CLASSPATH") #t))
3552 (add-before 'build 'build-native
3553 (lambda* (#:key inputs outputs #:allow-other-keys)
3554 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3555 ;; Build shared libraries. Users of SWT have to set the system
3556 ;; property swt.library.path to the "lib" directory of this
3557 ;; package output.
3558 (mkdir-p lib)
3559 (setenv "OUTPUT_DIR" lib)
3560 (with-directory-excursion "src"
3561 (invoke "bash" "build.sh")))))
3562 (add-after 'install 'install-native
3563 (lambda* (#:key outputs #:allow-other-keys)
3564 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3565 (for-each (lambda (file)
3566 (install-file file lib))
3567 (find-files "." "\\.so$"))
3568 #t))))))
3569 (inputs
3570 `(("gtk" ,gtk+-2)
3571 ("libxtst" ,libxtst)
3572 ("libxt" ,libxt)
3573 ("mesa" ,mesa)
3574 ("glu" ,glu)))
3575 (native-inputs
3576 `(("pkg-config" ,pkg-config)
3577 ("unzip" ,unzip)))
3578 (home-page "https://www.eclipse.org/swt/")
3579 (synopsis "Widget toolkit for Java")
3580 (description
3581 "SWT is a widget toolkit for Java designed to provide efficient, portable
3582 access to the user-interface facilities of the operating systems on which it
3583 is implemented.")
3584 ;; SWT code is licensed under EPL1.0
3585 ;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
3586 ;; Cairo bindings contain code under MPL1.1
3587 ;; XULRunner 1.9 bindings contain code under MPL2.0
3588 (license (list
3589 license:epl1.0
3590 license:mpl1.1
3591 license:mpl2.0
3592 license:lgpl2.1+))))
3593
3594 ;; java-hamcrest-core uses qdox version 1.12. We package this version instead
3595 ;; of the latest release.
3596 (define-public java-qdox-1.12
3597 (package
3598 (name "java-qdox")
3599 (version "1.12.1")
3600 (source (origin
3601 (method url-fetch)
3602 (uri (string-append "https://repo1.maven.org/maven2/"
3603 "com/thoughtworks/qdox/qdox/" version
3604 "/qdox-" version "-sources.jar"))
3605 (sha256
3606 (base32
3607 "0hlfbqq2avf5s26wxkksqmkdyk6zp9ggqn37c468m96mjv0n9xfl"))))
3608 (build-system ant-build-system)
3609 (arguments
3610 `(;; Tests require junit
3611 #:tests? #f
3612 #:jar-name "qdox.jar"
3613 #:phases
3614 (modify-phases %standard-phases
3615 (replace 'unpack
3616 (lambda* (#:key source #:allow-other-keys)
3617 (mkdir "src")
3618 (with-directory-excursion "src"
3619 (invoke "jar" "-xf" source))))
3620 ;; At this point we don't have junit, so we must remove the API
3621 ;; tests.
3622 (add-after 'unpack 'delete-tests
3623 (lambda _
3624 (delete-file-recursively "src/com/thoughtworks/qdox/junit")
3625 #t)))))
3626 (home-page "https://github.com/codehaus/qdox")
3627 (synopsis "Parse definitions from Java source files")
3628 (description
3629 "QDox is a high speed, small footprint parser for extracting
3630 class/interface/method definitions from source files complete with JavaDoc
3631 @code{@@tags}. It is designed to be used by active code generators or
3632 documentation tools.")
3633 (license license:asl2.0)))
3634
3635 (define-public java-qdox
3636 (package
3637 (name "java-qdox")
3638 ; Newer version exists, but this version is required by java-plexus-component-metadata
3639 (version "2.0-M2")
3640 (source (origin
3641 (method url-fetch)
3642 ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
3643 ;; Older releases at https://github.com/codehaus/qdox/
3644 ;; Note: The release at maven is pre-generated. The release at
3645 ;; github requires jflex.
3646 (uri (string-append "https://repo1.maven.org/maven2/"
3647 "com/thoughtworks/qdox/qdox/" version
3648 "/qdox-" version "-sources.jar"))
3649 (sha256
3650 (base32
3651 "10xxrcaicq6axszcr2jpygisa4ch4sinyx5q7kqqxv4lknrmxp5x"))))
3652 (build-system ant-build-system)
3653 (arguments
3654 `(#:jar-name "qdox.jar"
3655 #:tests? #f; no tests
3656 #:modules
3657 ((guix build ant-build-system)
3658 (guix build java-utils)
3659 (guix build utils)
3660 (sxml simple))
3661 #:phases
3662 (modify-phases %standard-phases
3663 (add-before 'install 'create-pom
3664 (lambda _
3665 (with-output-to-file "pom.xml"
3666 (lambda _
3667 (sxml->xml
3668 `((project
3669 (modelVersion "4.0.0")
3670 (name "QDox")
3671 (groupId "com.thoughtworks.qdox")
3672 (artifactId "qdox")
3673 (version ,,version))))))
3674 #t))
3675 (replace 'install
3676 (install-from-pom "pom.xml")))))
3677 (home-page "https://github.com/codehaus/qdox")
3678 (synopsis "Parse definitions from Java source files")
3679 (description "QDox is a high speed, small footprint parser for extracting
3680 class/interface/method definitions from source files complete with JavaDoc
3681 @code{@@tags}. It is designed to be used by active code generators or
3682 documentation tools.")
3683 (license license:asl2.0)))
3684
3685 (define-public java-qdox-2-M9
3686 (package
3687 (inherit java-qdox)
3688 (version "2.0-M9"); required by plexus-java
3689 (source (origin
3690 (method url-fetch)
3691 ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
3692 ;; Older releases at https://github.com/codehaus/qdox/
3693 ;; Note: The release at maven is pre-generated. The release at
3694 ;; github requires jflex.
3695 (uri (string-append "https://repo1.maven.org/maven2/"
3696 "com/thoughtworks/qdox/qdox/" version
3697 "/qdox-" version "-sources.jar"))
3698 (sha256
3699 (base32
3700 "1s2jnmx2dkwnaha12lcj26aynywgwa8sslc47z82wx8xai13y4fg"))))))
3701
3702 (define-public java-jarjar
3703 (package
3704 (name "java-jarjar")
3705 (version "1.4")
3706 (source (origin
3707 (method url-fetch)
3708 (uri (string-append
3709 "https://storage.googleapis.com/google-code-archive-downloads/v2/"
3710 "code.google.com/jarjar/jarjar-src-" version ".zip"))
3711 (sha256
3712 (base32
3713 "1v8irhni9cndcw1l1wxqgry013s2kpj0qqn57lj2ji28xjq8ndjl"))
3714 (modules '((guix build utils)))
3715 (snippet
3716 '(begin
3717 ;; Delete bundled thirds-party jar archives.
3718 (delete-file-recursively "lib")
3719 (delete-file "src/test/enumtest.jar")
3720 ;; the CLASSPATH needs this directory, create an empty one
3721 (mkdir-p "lib")
3722 #t))))
3723 (build-system ant-build-system)
3724 (arguments
3725 `(;; Tests require junit, which ultimately depends on this package.
3726 #:tests? #f
3727 #:build-target "jar"
3728 #:phases
3729 (modify-phases %standard-phases
3730 (add-before 'build 'do-not-use-bundled-asm
3731 (lambda* (#:key inputs #:allow-other-keys)
3732 (substitute* "build.xml"
3733 (("<path id=\"path.build\">")
3734 (string-append "<path id=\"path.build\"><fileset dir=\""
3735 (assoc-ref inputs "java-asm-bootstrap")
3736 "/lib/m2\" includes=\"**/*.jar\"/>"))
3737 (("<zipfileset src=\"lib/asm-4.0.jar\"/>") "")
3738 (("lib/asm-commons-4.0.jar")
3739 (car (find-files (assoc-ref inputs "java-asm-bootstrap")
3740 "asm-6.0.jar")))
3741 (("<include name=\"org/objectweb/asm/commons/Remap\\*\\.class\"/>")
3742 (string-append "<include name=\"org/objectweb/asm/"
3743 "commons/Remap*.class\"/>"
3744 "<include name=\"org/objectweb/asm/*.class\"/>"
3745 "<include name=\"org/objectweb/asm/"
3746 "signature/*.class\"/>"
3747 "<include name=\"org/objectweb/asm/"
3748 "commons/SignatureRemapper.class\"/>")))
3749 #t))
3750 (add-before 'build 'remove-maven-dependency
3751 (lambda _
3752 ;; We do not need to build jarjar as a maven plugin just yet, so
3753 ;; remove this file. Maven requires jarjar (but not that plugin),
3754 ;; so removing it improves the bootstrap.
3755 (delete-file "src/main/com/tonicsystems/jarjar/JarJarMojo.java")
3756 #t))
3757 (replace 'install
3758 (lambda* (#:key outputs #:allow-other-keys)
3759 (let ((target (string-append (assoc-ref outputs "out")
3760 "/share/java")))
3761 (install-file (string-append "dist/jarjar-" ,version ".jar")
3762 target))
3763 #t)))))
3764 (inputs
3765 `(("java-asm-bootstrap" ,java-asm-bootstrap)))
3766 (native-inputs
3767 `(("unzip" ,unzip)))
3768 (home-page "https://code.google.com/archive/p/jarjar/")
3769 (synopsis "Repackage Java libraries")
3770 (description
3771 "Jar Jar Links is a utility that makes it easy to repackage Java
3772 libraries and embed them into your own distribution. Jar Jar Links includes
3773 an Ant task that extends the built-in @code{jar} task.")
3774 (license license:asl2.0)))
3775
3776 (define-public java-hamcrest-core
3777 (package
3778 (name "java-hamcrest-core")
3779 (version "1.3")
3780 (source (origin
3781 (method git-fetch)
3782 (uri (git-reference
3783 (url "https://github.com/hamcrest/JavaHamcrest/")
3784 (commit (string-append "hamcrest-java-" version))))
3785 (file-name (git-file-name name version))
3786 (sha256
3787 (base32
3788 "16fxxkrd31ahqvcaby30jgh3z1i0zxh51m24hxgz0z2agxj6bc63"))
3789 (modules '((guix build utils)))
3790 (snippet
3791 '(begin
3792 ;; Delete bundled thirds-party jar archives.
3793 (delete-file-recursively "lib")
3794 #t))))
3795 (build-system ant-build-system)
3796 (arguments
3797 `(#:tests? #f ; Tests require junit
3798 #:modules ((guix build ant-build-system)
3799 (guix build java-utils)
3800 (guix build utils)
3801 (srfi srfi-1))
3802 #:make-flags (list (string-append "-Dversion=" ,version))
3803 #:test-target "unit-test"
3804 #:build-target "core"
3805 #:phases
3806 (modify-phases %standard-phases
3807 ;; Disable unit tests, because they require junit, which requires
3808 ;; hamcrest-core. We also give a fixed value to the "Built-Date"
3809 ;; attribute from the manifest for reproducibility.
3810 (add-before 'configure 'patch-build.xml
3811 (lambda _
3812 (substitute* "build.xml"
3813 (("unit-test, ") "")
3814 (("\\$\\{build.timestamp\\}") "guix"))
3815 #t))
3816 ;; Java's "getMethods()" returns methods in an unpredictable order.
3817 ;; To make the output of the generated code deterministic we must
3818 ;; sort the array of methods.
3819 (add-after 'unpack 'make-method-order-deterministic
3820 (lambda _
3821 (substitute* "hamcrest-generator/src/main/java/org/hamcrest/generator/ReflectiveFactoryReader.java"
3822 (("import java\\.util\\.Iterator;" line)
3823 (string-append line "\n"
3824 "import java.util.Arrays; import java.util.Comparator;"))
3825 (("allMethods = cls\\.getMethods\\(\\);" line)
3826 (string-append "_" line
3827 "
3828 private Method[] getSortedMethods() {
3829 Arrays.sort(_allMethods, new Comparator<Method>() {
3830 @Override
3831 public int compare(Method a, Method b) {
3832 return a.toString().compareTo(b.toString());
3833 }
3834 });
3835 return _allMethods;
3836 }
3837
3838 private Method[] allMethods = getSortedMethods();")))
3839 #t))
3840 (add-before 'build 'do-not-use-bundled-qdox
3841 (lambda* (#:key inputs #:allow-other-keys)
3842 (substitute* "build.xml"
3843 (("lib/generator/qdox-1.12.jar")
3844 (string-append (assoc-ref inputs "java-qdox-1.12")
3845 "/share/java/qdox.jar")))
3846 #t))
3847 ;; build.xml searches for .jar files in this directoy, which
3848 ;; we remove from the source archive.
3849 (add-before 'build 'create-dummy-directories
3850 (lambda _
3851 (mkdir-p "lib/integration")
3852 #t))
3853 (add-before 'build 'create-pom
3854 (lambda _
3855 (substitute* "pom/hamcrest-core.pom"
3856 (("@VERSION@") ,version))
3857 #t))
3858 (replace 'install
3859 (install-from-pom "pom/hamcrest-core.pom")))))
3860 (native-inputs
3861 `(("java-qdox-1.12" ,java-qdox-1.12)
3862 ("java-jarjar" ,java-jarjar)))
3863 (propagated-inputs
3864 `(("java-hamcrest-parent-pom" ,java-hamcrest-parent-pom)))
3865 (home-page "http://hamcrest.org/")
3866 (synopsis "Library of matchers for building test expressions")
3867 (description
3868 "This package provides a library of matcher objects (also known as
3869 constraints or predicates) allowing @code{match} rules to be defined
3870 declaratively, to be used in other frameworks. Typical scenarios include
3871 testing frameworks, mocking libraries and UI validation rules.")
3872 (license license:bsd-2)))
3873
3874 (define java-hamcrest-parent-pom
3875 (package
3876 (inherit java-hamcrest-core)
3877 (name "java-hamcrest-parent-pom")
3878 (propagated-inputs '())
3879 (native-inputs '())
3880 (arguments
3881 `(#:tests? #f
3882 #:phases
3883 (modify-phases %standard-phases
3884 (delete 'configure)
3885 (replace 'build
3886 (lambda _
3887 (substitute* "pom/hamcrest-parent.pom"
3888 (("@VERSION@") ,(package-version java-hamcrest-core)))
3889 #t))
3890 (replace 'install
3891 (install-pom-file "pom/hamcrest-parent.pom")))))))
3892
3893 (define-public java-hamcrest-library
3894 (package
3895 (inherit java-hamcrest-core)
3896 (name "java-hamcrest-library")
3897 (arguments
3898 (substitute-keyword-arguments (package-arguments java-hamcrest-core)
3899 ((#:build-target _) "library")
3900 ((#:phases phases)
3901 `(modify-phases ,phases
3902 (add-after 'unpack 'patch-classpath-for-integration
3903 (lambda* (#:key inputs #:allow-other-keys)
3904 (substitute* "build.xml"
3905 (("build/hamcrest-core-\\$\\{version\\}\\.jar")
3906 (car (find-files (assoc-ref inputs "java-hamcrest-core")
3907 "jar$"))))
3908 #t))
3909 (replace 'create-pom
3910 (lambda _
3911 (substitute* "pom/hamcrest-library.pom"
3912 (("@VERSION@") ,(package-version java-hamcrest-core)))
3913 #t))
3914 (replace 'install
3915 (install-from-pom "pom/hamcrest-library.pom"))))))
3916 (propagated-inputs
3917 `(("java-hamcrest-core" ,java-hamcrest-core)
3918 ("java-hamcrest-parent-pom" ,java-hamcrest-parent-pom)))))
3919
3920 (define-public java-junit
3921 (package
3922 (name "java-junit")
3923 (version "4.12")
3924 (source (origin
3925 (method git-fetch)
3926 (uri (git-reference
3927 (url "https://github.com/junit-team/junit/")
3928 (commit (string-append "r" version))))
3929 (file-name (git-file-name name version))
3930 (sha256
3931 (base32
3932 "1j8avi91px1z8rjc89cfikwrvfifdmmsarwiyrcnr59ynvpz0v8h"))
3933 (modules '((guix build utils)))
3934 (snippet
3935 '(begin
3936 ;; Delete bundled jar archives.
3937 (delete-file-recursively "lib")
3938 #t))))
3939 (build-system ant-build-system)
3940 (arguments
3941 `(#:jar-name "junit.jar"
3942 #:source-dir "src/main/java"
3943 #:test-dir "src/test"
3944 #:test-exclude (list "**/SimpleTest.java" "**/StackTracesTest.java"
3945 "**/RuleChainTest.java" "**/TestWatchmanTest.java")
3946 #:phases
3947 (modify-phases %standard-phases
3948 (add-before 'check 'copy-test-resources
3949 (lambda _
3950 (copy-recursively "src/test/resources" "build/test-classes")
3951 #t))
3952 (replace 'install
3953 (install-from-pom "pom.xml")))))
3954 (propagated-inputs
3955 `(("java-hamcrest-core" ,java-hamcrest-core)))
3956 (native-inputs
3957 `(("java-hamcrest-library" ,java-hamcrest-library)))
3958 (home-page "https://junit.org/junit4/")
3959 (synopsis "Test framework for Java")
3960 (description
3961 "JUnit is a simple framework to write repeatable tests for Java projects.
3962 JUnit provides assertions for testing expected results, test fixtures for
3963 sharing common test data, and test runners for running tests.")
3964 (license license:epl1.0)))
3965
3966 (define-public java-junitparams
3967 (package
3968 (name "java-junitparams")
3969 (version "1.1.1")
3970 (source (origin
3971 (method git-fetch)
3972 (uri (git-reference
3973 (url "https://github.com/Pragmatists/JUnitParams")
3974 (commit (string-append "JUnitParams-" version))))
3975 (file-name (git-file-name name version))
3976 (sha256
3977 (base32
3978 "0rb52xdfp99invyjrras3w0bf0a81cz30yd47rkkiyqcqj0y1q9b"))))
3979 (build-system ant-build-system)
3980 (arguments
3981 `(#:jar-name "junitparams.jar"
3982 #:source-dir "src/main/java"
3983 #:test-dir "src/test"
3984 #:test-exclude (list "**/SuperclassTest.java")))
3985 (inputs
3986 `(("java-junit" ,java-junit)))
3987 (native-inputs
3988 `(("java-junit" ,java-junit)
3989 ("java-hamcrest-core" ,java-hamcrest-core)
3990 ("java-assertj" ,java-assertj)))
3991 (home-page "https://github.com/Pragmatists/JUnitParams")
3992 (synopsis "Parameterised test support for JUnit")
3993 (description "The JUnitParams project adds a new runner to JUnit and
3994 provides much easier and readable parametrised tests for JUnit.")
3995 (license license:asl2.0)))
3996
3997 (define-public java-plexus-utils
3998 (package
3999 (name "java-plexus-utils")
4000 ;; sisu-build-api needs this version, later versions don't work
4001 (version "3.2.1")
4002 (source (origin
4003 (method git-fetch)
4004 (uri (git-reference
4005 (url "https://github.com/codehaus-plexus/plexus-utils")
4006 (commit (string-append "plexus-utils-" version))))
4007 (file-name (git-file-name name version))
4008 (sha256
4009 (base32
4010 "1w169glixyk94jbczj8jzg897lsab46jihiaa3dhw0p06g35va8b"))))
4011 (build-system ant-build-system)
4012 ;; FIXME: The default build.xml does not include a target to install
4013 ;; javadoc files.
4014 (arguments
4015 `(#:jar-name "plexus-utils.jar"
4016 #:source-dir "src/main"
4017 #:phases
4018 (modify-phases %standard-phases
4019 (add-after 'unpack 'fix-reference-to-/bin-and-/usr
4020 (lambda _
4021 (substitute* "src/main/java/org/codehaus/plexus/util/\
4022 cli/shell/BourneShell.java"
4023 (("/bin/sh") (which "sh"))
4024 (("/usr/") (getcwd)))
4025 #t))
4026 (add-after 'unpack 'fix-or-disable-broken-tests
4027 (lambda _
4028 (with-directory-excursion "src/test/java/org/codehaus/plexus/util"
4029 (substitute* '("cli/CommandlineTest.java"
4030 "cli/shell/BourneShellTest.java")
4031 (("/bin/sh") (which "sh"))
4032 (("/bin/echo") (which "echo")))
4033
4034 ;; This test depends on MavenProjectStub, but we don't have
4035 ;; a package for Maven.
4036 (delete-file "introspection/ReflectionValueExtractorTest.java")
4037
4038 ;; FIXME: The command line tests fail, maybe because they use
4039 ;; absolute paths.
4040 (delete-file "cli/CommandlineTest.java")
4041
4042 ;; These tests require openjdk jmh, which is not packaged yet
4043 (for-each delete-file (find-files "." "PerfTest.java$")))
4044 #t))
4045 (add-before 'build 'copy-resources
4046 (lambda _
4047 (copy-recursively "src/main/resources" "build/classes")
4048 #t))
4049 (replace 'install (install-from-pom "pom.xml")))))
4050 (native-inputs
4051 `(("java-hamcrest-core" ,java-hamcrest-core)
4052 ("java-junit" ,java-junit)))
4053 (propagated-inputs
4054 `(("plexus-parent-pom" ,plexus-parent-pom-5.1)))
4055 (home-page "https://codehaus-plexus.github.io/plexus-utils/")
4056 (synopsis "Common utilities for the Plexus framework")
4057 (description "This package provides various Java utility classes for the
4058 Plexus framework to ease working with strings, files, command lines, XML and
4059 more.")
4060 (license license:asl2.0)))
4061
4062 (define-public java-plexus-utils-3.3.0
4063 (package
4064 (inherit java-plexus-utils)
4065 (version "3.3.0")
4066 (source (origin
4067 (method git-fetch)
4068 (uri (git-reference
4069 (url "https://github.com/codehaus-plexus/plexus-utils")
4070 (commit (string-append "plexus-utils-" version))))
4071 (file-name (git-file-name "java-plexus-utils" version))
4072 (sha256
4073 (base32
4074 "0d0fq21rzjy0j55kcp8w9k1rbq9rwr0r7cc8239p9jbz54vihp0g"))))))
4075
4076 (define-public java-plexus-interpolation
4077 (package
4078 (name "java-plexus-interpolation")
4079 (version "1.26")
4080 (source (origin
4081 (method git-fetch)
4082 (uri (git-reference
4083 (url "https://github.com/codehaus-plexus/plexus-interpolation")
4084 (commit (string-append "plexus-interpolation-" version))))
4085 (file-name (git-file-name name version))
4086 (sha256
4087 (base32
4088 "1rahjmhywf6d5m32qzlc9izawyvcd71abfm9k03f13rs2xmfxzlh"))))
4089 (build-system ant-build-system)
4090 (arguments
4091 `(#:jar-name "plexus-interpolation.jar"
4092 #:source-dir "src/main"
4093 #:phases
4094 (modify-phases %standard-phases
4095 (replace 'install (install-from-pom "pom.xml")))))
4096 (propagated-inputs
4097 `(("plexus-parent-pom-5.1" ,plexus-parent-pom-5.1)))
4098 (native-inputs
4099 `(("java-junit" ,java-junit)
4100 ("java-hamcrest-core" ,java-hamcrest-core)))
4101 (home-page "https://codehaus-plexus.github.io/plexus-interpolation/")
4102 (synopsis "Java components for interpolating ${} strings and the like")
4103 (description "Plexus interpolator is a modular, flexible interpolation
4104 framework for the expression language style commonly seen in Maven, Plexus,
4105 and other related projects.
4106
4107 It has its foundation in the @code{org.codehaus.plexus.utils.interpolation}
4108 package within @code{plexus-utils}, but has been separated in order to allow
4109 these two libraries to vary independently of one another.")
4110 (license license:asl2.0)))
4111
4112 (define-public java-plexus-classworlds
4113 (package
4114 (name "java-plexus-classworlds")
4115 (version "2.6.0")
4116 (source (origin
4117 (method git-fetch)
4118 (uri (git-reference
4119 (url "https://github.com/codehaus-plexus/plexus-classworlds")
4120 (commit (string-append "plexus-classworlds-" version))))
4121 (file-name (git-file-name name version))
4122 (sha256
4123 (base32
4124 "034k2hgvj1saalwbnzrbg4n0zgzwcpz1lhlb8q4kgglsp9pmm03s"))))
4125 (build-system ant-build-system)
4126 (arguments
4127 `(#:jar-name "plexus-classworlds.jar"
4128 #:source-dir "src/main"
4129 #:tests? #f;; FIXME: we need to generate some resources as in pom.xml
4130 #:phases
4131 (modify-phases %standard-phases
4132 (replace 'install (install-from-pom "pom.xml")))))
4133 (propagated-inputs
4134 `(("plexus-parent-pom-5.1" ,plexus-parent-pom-5.1)))
4135 (native-inputs
4136 `(("java-junit" ,java-junit)))
4137 (home-page "https://codehaus-plexus.github.io/plexus-classworlds/")
4138 (synopsis "Java class loader framework")
4139 (description "Plexus classworlds replaces the native @code{ClassLoader}
4140 mechanism of Java. It is especially useful for dynamic loading of application
4141 components.")
4142 (license license:asl2.0)))
4143
4144 (define java-plexus-container-default-bootstrap
4145 (package
4146 (name "java-plexus-container-default-bootstrap")
4147 (version "1.7.1")
4148 (source (origin
4149 (method git-fetch)
4150 (uri (git-reference
4151 (url "https://github.com/codehaus-plexus/plexus-containers")
4152 (commit (string-append "plexus-containers-" version))))
4153 (file-name (git-file-name name version))
4154 (sha256
4155 (base32
4156 "1316hrp5vqfv0aw7miq2fp0wwy833h66h502h29vnh5sxj27x228"))))
4157 (build-system ant-build-system)
4158 (arguments
4159 `(#:jar-name "container-default.jar"
4160 #:source-dir "plexus-container-default/src/main/java"
4161 #:test-dir "plexus-container-default/src/test"
4162 #:tests? #f; requires plexus-archiver, which depends on this package
4163 #:phases
4164 (modify-phases %standard-phases
4165 (add-before 'build 'fix-google-collections
4166 (lambda _
4167 ;; Google collections are now replaced with guava
4168 (substitute* "plexus-container-default/pom.xml"
4169 (("google-collections") "guava")
4170 (("com.google.collections") "com.google.guava"))
4171 #t))
4172 (add-before 'build 'copy-resources
4173 (lambda _
4174 (copy-recursively
4175 "plexus-container-default/src/main/resources/"
4176 "build/classes")
4177 #t))
4178 (replace 'install
4179 (install-from-pom "plexus-container-default/pom.xml")))))
4180 (propagated-inputs
4181 `(("java-plexus-worldclass" ,java-plexus-classworlds)
4182 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
4183 ("java-plexus-utils" ,java-plexus-utils)
4184 ("java-junit" ,java-junit)
4185 ("java-guava" ,java-guava)
4186 ("java-plexus-containers-parent-pom" ,java-plexus-containers-parent-pom)))
4187 (home-page "https://github.com/codehaus-plexus/plexus-containers")
4188 (synopsis "Inversion-of-control container")
4189 (description "Plexus-default-container is Plexus' inversion-of-control
4190 (@dfn{IoC}) container. It is composed of its public API and its default
4191 implementation.")
4192 (license license:asl2.0)))
4193
4194 (define java-plexus-containers-parent-pom
4195 (package
4196 (inherit java-plexus-container-default-bootstrap)
4197 (name "java-plexus-containers-parent-pom")
4198 (arguments
4199 `(#:tests? #f
4200 #:phases
4201 (modify-phases %standard-phases
4202 (delete 'configure)
4203 (delete 'build)
4204 (replace 'install
4205 (install-pom-file "pom.xml")))))
4206 (propagated-inputs
4207 `(("plexus-parent-pom" ,plexus-parent-pom-4.0)))))
4208
4209 (define-public java-plexus-io
4210 (package
4211 (name "java-plexus-io")
4212 (version "3.2.0")
4213 (source (origin
4214 (method git-fetch)
4215 (uri (git-reference
4216 (url "https://github.com/codehaus-plexus/plexus-io")
4217 (commit (string-append "plexus-io-" version))))
4218 (file-name (git-file-name name version))
4219 (sha256
4220 (base32
4221 "1r3wqfpbxq8vp4p914i8p88r0994rmcjw02hz14n11cfb6gsyvlr"))))
4222 (build-system ant-build-system)
4223 (arguments
4224 `(#:jar-name "plexus-io.jar"
4225 #:source-dir "src/main/java"
4226 #:test-dir "src/test"
4227 #:phases
4228 (modify-phases %standard-phases
4229 (add-before 'build 'copy-resources
4230 (lambda _
4231 (mkdir-p "build/classes")
4232 (copy-recursively "src/main/resources" "build/classes")
4233 (mkdir-p "build/test-classes")
4234 (copy-recursively "src/test/resources" "build/test-classes")
4235 #t))
4236 (replace 'install (install-from-pom "pom.xml")))))
4237 (propagated-inputs
4238 `(("java-plexus-utils" ,java-plexus-utils-3.3.0)
4239 ("java-commons-io" ,java-commons-io)
4240 ("plexus-parent-pom" ,plexus-parent-pom-5.1)))
4241 (inputs
4242 `(("java-jsr305" ,java-jsr305)))
4243 (native-inputs
4244 `(("junit" ,java-junit)
4245 ("hamcrest" ,java-hamcrest-core)
4246 ("guava" ,java-guava)
4247 ("classworlds" ,java-plexus-classworlds)
4248 ("xbean" ,java-geronimo-xbean-reflect)
4249 ("container-default" ,java-plexus-container-default-bootstrap)))
4250 (home-page "https://github.com/codehaus-plexus/plexus-io")
4251 (synopsis "I/O plexus components")
4252 (description "Plexus IO is a set of plexus components, which are designed
4253 for use in I/O operations. This implementation using plexus components allows
4254 reusing it in maven.")
4255 (license license:asl2.0)))
4256
4257 (define-public java-plexus-archiver
4258 (package
4259 (name "java-plexus-archiver")
4260 (version "4.2.2")
4261 (source (origin
4262 (method url-fetch)
4263 (uri (string-append "https://github.com/codehaus-plexus/plexus-archiver"
4264 "/archive/plexus-archiver-" version ".tar.gz"))
4265 (sha256
4266 (base32
4267 "144n971r3lfrx3l12nf2scm80x4xdvgbkk4bjpa4vcvvdrll6qys"))))
4268 (build-system ant-build-system)
4269 (arguments
4270 `(#:jar-name "plexus-archiver.jar"
4271 #:source-dir "src/main/java"
4272 #:test-dir "src/test"
4273 #:test-exclude (list "**/Abstract*.java" "**/Base*.java")
4274 #:phases
4275 (modify-phases %standard-phases
4276 (add-before 'check 'remove-failing
4277 (lambda _
4278 ;; Requires an older version of plexus container
4279 (delete-file
4280 "src/test/java/org/codehaus/plexus/archiver/DuplicateFilesTest.java")
4281 #t))
4282 (add-before 'check 'fix-test-building
4283 (lambda _
4284 (substitute* "build.xml"
4285 (("srcdir=\"src/test\"") "srcdir=\"src/test/java\""))
4286 #t))
4287 (add-before 'build 'copy-resources
4288 (lambda _
4289 (mkdir-p "build/classes")
4290 (copy-recursively "src/main/resources" "build/classes")
4291 (mkdir-p "build/test-classes")
4292 (copy-recursively "src/test/resources" "build/test-classes")
4293 #t))
4294 (replace 'install (install-from-pom "pom.xml")))))
4295 (propagated-inputs
4296 `(("java-plexus-utils" ,java-plexus-utils-3.3.0)
4297 ("java-plexus-io" ,java-plexus-io)
4298 ("java-iq80-snappy" ,java-iq80-snappy)
4299 ("java-commons-compress" ,java-commons-compress)
4300 ("plexus-parent-pom" ,plexus-parent-pom-6.1)))
4301 (inputs
4302 `(("java-jsr305" ,java-jsr305)
4303 ("java-plexus-container-default"
4304 ,java-plexus-container-default-bootstrap)))
4305 (native-inputs
4306 `(("java-hamcrest-core" ,java-hamcrest-core)
4307 ("junit" ,java-junit)
4308 ("classworld" ,java-plexus-classworlds)
4309 ("xbean" ,java-geronimo-xbean-reflect)
4310 ("xz" ,java-xz)
4311 ("guava" ,java-guava)))
4312 (home-page "https://github.com/codehaus-plexus/plexus-archiver")
4313 (synopsis "Archiver component of the Plexus project")
4314 (description "Plexus-archiver contains a component to deal with project
4315 archives (jar).")
4316 (license license:asl2.0)))
4317
4318 (define-public java-plexus-container-default
4319 (package
4320 (inherit java-plexus-container-default-bootstrap)
4321 (name "java-plexus-container-default")
4322 (arguments
4323 `(#:jar-name "container-default.jar"
4324 #:source-dir "plexus-container-default/src/main/java"
4325 #:test-dir "plexus-container-default/src/test"
4326 #:test-exclude (list ;"**/*Test.java"
4327 "**/Abstract*.java"
4328 ;; Requires plexus-hierarchy
4329 "**/PlexusHierarchyTest.java"
4330 ;; Failures
4331 "**/ComponentRealmCompositionTest.java"
4332 "**/PlexusContainerTest.java")
4333 #:phases
4334 (modify-phases %standard-phases
4335 (add-before 'build 'fix-google-collections
4336 (lambda _
4337 ;; Google collections are now replaced with guava
4338 (substitute* "plexus-container-default/pom.xml"
4339 (("google-collections") "guava")
4340 (("com.google.collections") "com.google.guava"))
4341 #t))
4342 (add-before 'build 'copy-resources
4343 (lambda _
4344 (copy-recursively
4345 "plexus-container-default/src/main/resources/"
4346 "build/classes")
4347 #t))
4348 (add-before 'check 'fix-paths
4349 (lambda _
4350 (let ((dir "plexus-container-default/src/test/java/org/codehaus"))
4351 (substitute*
4352 (string-append
4353 dir "/plexus/component/composition/"
4354 "ComponentRealmCompositionTest.java")
4355 (("src/test") "plexus-container-default/src/test"))
4356 #t)))
4357 (replace 'install
4358 (install-from-pom "plexus-container-default/pom.xml")))))
4359 (inputs
4360 `(("worldclass" ,java-plexus-classworlds)
4361 ("xbean" ,java-geronimo-xbean-reflect)
4362 ("utils" ,java-plexus-utils)
4363 ("junit" ,java-junit)
4364 ("guava" ,java-guava)))
4365 (native-inputs
4366 `(("archiver" ,java-plexus-archiver)
4367 ("hamcrest" ,java-hamcrest-core)))))
4368
4369 (define-public java-plexus-component-annotations
4370 (package
4371 (inherit java-plexus-container-default)
4372 (name "java-plexus-component-annotations")
4373 (arguments
4374 `(#:jar-name "plexus-component-annotations.jar"
4375 #:source-dir "plexus-component-annotations/src/main/java"
4376 #:tests? #f; no tests
4377 #:phases
4378 (modify-phases %standard-phases
4379 (replace 'install
4380 (install-from-pom "plexus-component-annotations/pom.xml")))))
4381 (propagated-inputs
4382 `(("java-plexus-containers-parent-pom" ,java-plexus-containers-parent-pom)))
4383 (inputs '())
4384 (native-inputs '())
4385 (synopsis "Plexus descriptors generator")
4386 (description "This package is a Maven plugin to generate Plexus descriptors
4387 from source tags and class annotations.")))
4388
4389 (define-public java-plexus-component-metadata
4390 (package
4391 (inherit java-plexus-container-default)
4392 (name "java-plexus-component-metadata")
4393 (arguments
4394 `(#:jar-name "plexus-component-metadata.jar"
4395 #:source-dir "src/main/java"
4396 #:test-dir "src/test"
4397 #:jdk ,icedtea-8
4398 #:phases
4399 (modify-phases %standard-phases
4400 (add-before 'configure 'chdir
4401 (lambda _
4402 (chdir "plexus-component-metadata")
4403 #t))
4404 (add-before 'build 'copy-resources
4405 (lambda _
4406 (copy-recursively "src/main/resources"
4407 "build/classes/")
4408 #t)))))
4409 (propagated-inputs
4410 `(("java-plexus-container-default" ,java-plexus-container-default)
4411 ("java-plexu-component-annotations" ,java-plexus-component-annotations)
4412 ("java-plexus-utils" ,java-plexus-utils)
4413 ("java-plexus-cli" ,java-plexus-cli)
4414 ("java-plexus-classworlds" ,java-plexus-classworlds)
4415 ("maven-plugin-api" ,maven-plugin-api)
4416 ("maven-plugin-annotations" ,maven-plugin-annotations)
4417 ("maven-core-bootstrap" ,maven-core-bootstrap)
4418 ("maven-model" ,maven-model)
4419 ("java-commons-cli" ,java-commons-cli)
4420 ("java-qdox" ,java-qdox)
4421 ("java-jdom2" ,java-jdom2)
4422 ("java-asm" ,java-asm)))
4423 (native-inputs
4424 `(("java-junit" ,java-junit)
4425 ("java-guava" ,java-guava)
4426 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)))
4427 (synopsis "Inversion-of-control container for Maven")
4428 (description "The Plexus project provides a full software stack for creating
4429 and executing software projects. Based on the Plexus container, the
4430 applications can utilise component-oriented programming to build modular,
4431 reusable components that can easily be assembled and reused. This package
4432 provides the Maven plugin generating the component metadata.")))
4433
4434 (define-public java-plexus-cipher
4435 (package
4436 (name "java-plexus-cipher")
4437 (version "1.7")
4438 (source (origin
4439 (method git-fetch)
4440 (uri (git-reference
4441 (url "https://github.com/codehaus-plexus/plexus-cipher")
4442 (commit (string-append "plexus-cipher-" version))))
4443 (file-name (git-file-name name version))
4444 (sha256
4445 (base32
4446 "0m638nzlxbmnbcj5cwdpgs326ab584yv0k803zlx37r6iqwvf6b0"))))
4447 (build-system ant-build-system)
4448 (arguments
4449 `(#:jar-name "plexus-cipher.jar"
4450 #:source-dir "src/main/java"
4451 #:tests? #f; FIXME: requires sisu-inject-bean
4452 #:phases
4453 (modify-phases %standard-phases
4454 (add-before 'build 'copy-resources
4455 (lambda _
4456 (copy-recursively "src/main/resources" "build/classes")
4457 (mkdir-p "build/classes/META-INF/sisu")
4458 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4459 (lambda _
4460 (display "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
4461 #t))
4462 (add-before 'install 'fix-test-dependency
4463 (lambda _
4464 ;; sisu-inject-bean is only used for tests, but its scope is "provided".
4465 (substitute* "pom.xml"
4466 (("provided") "test"))
4467 #t))
4468 (replace 'install (install-from-pom "pom.xml")))))
4469 (inputs
4470 `(("java-cdi-api" ,java-cdi-api)
4471 ("java-javax-inject" ,java-javax-inject)))
4472 (propagated-inputs
4473 `(("java-sonatype-spice-parent-pom" ,java-sonatype-spice-parent-pom-15)))
4474 (native-inputs
4475 `(("java-junit" ,java-junit)))
4476 (home-page "https://github.com/sonatype/plexus-cipher")
4477 (synopsis "Encryption/decryption Component")
4478 (description "Plexus-cipher contains a component to deal with encryption
4479 and decryption.")
4480 (license license:asl2.0)))
4481
4482 (define-public java-plexus-java
4483 (package
4484 (name "java-plexus-java")
4485 (version "0.9.10")
4486 (source (origin
4487 (method git-fetch)
4488 (uri (git-reference
4489 (url "https://github.com/codehaus-plexus/plexus-languages")
4490 (commit (string-append "plexus-languages-" version))))
4491 (file-name (git-file-name name version))
4492 (sha256
4493 (base32
4494 "0vmvgq5hfxs90yyxgssfpwq78l7vwx1ljwpkk594mrdr8sm668b5"))
4495 (modules '((guix build utils)))
4496 (snippet
4497 `(begin
4498 (for-each delete-file (find-files "." ".*.jar$"))
4499 #t))))
4500 (build-system ant-build-system)
4501 (arguments
4502 `(#:jar-name "plexus-java.java"
4503 #:source-dir "plexus-java/src/main/java"
4504 #:test-dir "plexus-java/src/test"
4505 #:tests? #f; require mockito 2
4506 #:phases
4507 (modify-phases %standard-phases
4508 (add-after 'build 'generate-metadata
4509 (lambda _
4510 (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
4511 "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
4512 "--source" "plexus-java/src/main/java"
4513 "--output" "build/classes/META-INF/plexus/components.xml"
4514 "--classes" "build/classes"
4515 "--descriptors" "build/classes/META-INF")
4516 (invoke "ant" "jar")
4517 #t))
4518 (add-before 'install 'install-parent
4519 (install-pom-file "pom.xml"))
4520 (replace 'install
4521 (install-from-pom "plexus-java/pom.xml")))))
4522 (propagated-inputs
4523 `(("java-asm" ,java-asm)
4524 ("java-qdox" ,java-qdox-2-M9)
4525 ("java-javax-inject" ,java-javax-inject)
4526 ("plexus-parent-pom" ,plexus-parent-pom-4.0)))
4527 (inputs
4528 `(("java-plexus-component-annotations" ,java-plexus-component-annotations)))
4529 (native-inputs
4530 `(("java-plexus-component-metadata" ,java-plexus-component-metadata)
4531 ("java-junit" ,java-junit)))
4532 (home-page "https://codehaus-plexus.github.io/plexus-languages/plexus-java")
4533 (synopsis "Shared language features for Java")
4534 (description "This package contains shared language features of the Java
4535 language, for the plexus project.")
4536 (license license:asl2.0)))
4537
4538 (define-public java-plexus-compiler-api
4539 (package
4540 (name "java-plexus-compiler-api")
4541 (version "2.8.4")
4542 (source (origin
4543 (method git-fetch)
4544 (uri (git-reference
4545 (url "https://github.com/codehaus-plexus/plexus-compiler")
4546 (commit (string-append "plexus-compiler-" version))))
4547 (file-name (git-file-name name version))
4548 (sha256
4549 (base32
4550 "1nq1gnn3s6z1j29gmi1hqbklsmm8b1lmnafb0191914f95mn18gk"))))
4551 (build-system ant-build-system)
4552 (arguments
4553 `(#:jar-name "plexus-compiler-api.jar"
4554 #:source-dir "plexus-compiler-api/src/main/java"
4555 #:test-dir "plexus-compiler-api/src/test"
4556 #:phases
4557 (modify-phases %standard-phases
4558 (replace 'install
4559 (install-from-pom "plexus-compiler-api/pom.xml")))))
4560 (propagated-inputs
4561 `(("java-plexus-container-default" ,java-plexus-container-default)
4562 ("java-plexus-compiler-pom" ,java-plexus-compiler-pom)
4563 ("java-plexus-util" ,java-plexus-utils)))
4564 (native-inputs
4565 `(("java-junit" ,java-junit)))
4566 (home-page "https://github.com/codehaus-plexus/plexus-compiler")
4567 (synopsis "Plexus Compilers component's API to manipulate compilers")
4568 (description "This package contains the API used by components to manipulate
4569 compilers.")
4570 (license (list license:asl2.0
4571 license:expat))))
4572
4573 (define java-plexus-compiler-pom
4574 (package
4575 (inherit java-plexus-compiler-api)
4576 (name "java-plexus-compiler-pom")
4577 (arguments
4578 `(#:tests? #f
4579 #:phases
4580 (modify-phases %standard-phases
4581 (delete 'configure)
4582 (delete 'build)
4583 (replace 'install
4584 (install-pom-file "pom.xml"))
4585 (add-after 'install 'install-compilers
4586 (install-pom-file "plexus-compilers/pom.xml")))))
4587 (propagated-inputs
4588 `(("plexus-components-parent-pom-4.0" ,plexus-components-parent-pom-4.0)))))
4589
4590 (define plexus-components-parent-pom-4.0
4591 (package
4592 (name "plexus-components-parent-pom")
4593 (version "4.0")
4594 (source (origin
4595 (method git-fetch)
4596 (uri (git-reference
4597 (url "https://github.com/codehaus-plexus/plexus-components")
4598 (commit (string-append "plexus-components-" version))))
4599 (file-name (git-file-name name version))
4600 (sha256
4601 (base32
4602 "041bm8yv0m2i17mqg8zljib4ykpha7ijls2qfdwvkma4d39lhysi"))))
4603 (build-system ant-build-system)
4604 (arguments
4605 `(#:tests? #f
4606 #:phases
4607 (modify-phases %standard-phases
4608 (delete 'configure)
4609 (delete 'build)
4610 (replace 'install
4611 (install-pom-file "pom.xml")))))
4612 (propagated-inputs
4613 `(("plexus-parent-pom-4.0" ,plexus-parent-pom-4.0)))
4614 (home-page "https://codehaus-plexus.github.io/plexus-components")
4615 (synopsis "Plexus parent pom")
4616 (description "This package contains the Plexus components parent POM.")
4617 (license license:asl2.0)))
4618
4619 (define-public java-plexus-compiler-manager
4620 (package
4621 (inherit java-plexus-compiler-api)
4622 (name "java-plexus-compiler-manager")
4623 (arguments
4624 `(#:jar-name "compiler-compiler-manager.java"
4625 #:source-dir "plexus-compiler-manager/src/main/java"
4626 #:test-dir "plexus-compiler-manager/src/test"
4627 #:tests? #f
4628 #:phases
4629 (modify-phases %standard-phases
4630 (add-after 'build 'generate-metadata
4631 (lambda _
4632 (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
4633 "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
4634 "--source" "plexus-compiler-manager/src/main/java"
4635 "--output" "build/classes/META-INF/plexus/components.xml"
4636 "--classes" "build/classes"
4637 "--descriptors" "build/classes/META-INF")
4638 (invoke "ant" "jar")
4639 #t))
4640 (add-after 'generate-metadata 'rebuild
4641 (lambda _
4642 (invoke "ant" "jar")
4643 #t))
4644 (replace 'install
4645 (install-from-pom "plexus-compiler-manager/pom.xml")))))
4646 (propagated-inputs
4647 `(("java-plexus-compiler-api" ,java-plexus-compiler-api)
4648 ("java-plexus-compiler-pom" ,java-plexus-compiler-pom)
4649 ("java-plexus-container-default" ,java-plexus-container-default)))
4650 (native-inputs
4651 `(("unzip" ,unzip)
4652 ("java-plexus-component-metadata" ,java-plexus-component-metadata)))
4653 (synopsis "Compiler management for Plexus Compiler component")
4654 (description "Plexus Compiler is a Plexus component to use different
4655 compilers through a uniform API. This component chooses the compiler
4656 implementation to use in a project.")))
4657
4658 (define-public java-plexus-compiler-javac
4659 (package
4660 (inherit java-plexus-compiler-api)
4661 (name "java-plexus-compiler-javac")
4662 (arguments
4663 `(#:jar-name "plexus-compiler-javac.jar"
4664 #:source-dir "plexus-compilers/plexus-compiler-javac/src/main/java"
4665 #:jdk ,icedtea-8
4666 #:tests? #f; depends on compiler-test -> maven-core -> ... -> this package.
4667 #:test-dir "plexus-compilers/plexus-compiler-javac/src/test"
4668 #:modules ((guix build ant-build-system)
4669 (guix build utils)
4670 (guix build java-utils)
4671 (sxml simple))
4672 #:phases
4673 (modify-phases %standard-phases
4674 ;; We cannot use java-plexus-component-metadata to generate the metadata
4675 ;; because it ultimately depends on this package.
4676 ;; Create it manually instead
4677 (add-before 'build 'create-metadata
4678 (lambda _
4679 (let* ((dir "build/classes/META-INF/plexus")
4680 (file (string-append dir "/components.xml")))
4681 (mkdir-p dir)
4682 (with-output-to-file file
4683 (lambda _
4684 (sxml->xml
4685 `(component-set
4686 (components
4687 (component
4688 (role "org.codehaus.plexus.compiler.Compiler")
4689 (role-hint "javac")
4690 (implementation "org.codehaus.plexus.compiler.javac.JavacCompiler")
4691 (isolated-realm "false"))))))))
4692 #t))
4693 (replace 'install
4694 (install-from-pom "plexus-compilers/plexus-compiler-javac/pom.xml")))))
4695 (propagated-inputs
4696 `(("java-plexus-compiler-api" ,java-plexus-compiler-api)
4697 ("java-plexus-utils" ,java-plexus-utils)
4698 ("java-plexus-container-default" ,java-plexus-container-default)))
4699 (synopsis "Javac Compiler support for Plexus Compiler component")
4700 (description "This package contains the Javac Compiler support for Plexus
4701 Compiler component.")))
4702
4703 (define plexus-components-pom-1.1.20
4704 (package
4705 (name "plexus-components-pom-1.1.20")
4706 (version "1.1.20")
4707 (source (origin
4708 (method git-fetch)
4709 (uri (git-reference
4710 (url "https://github.com/codehaus-plexus/plexus-components")
4711 (commit (string-append "plexus-components-" version))))
4712 (file-name (git-file-name name version))
4713 (sha256
4714 (base32
4715 "1q254k95m9icyfsvaw8c226midg8v6v436wvivhv7im825mnp5yb"))))
4716 (build-system ant-build-system)
4717 (arguments
4718 `(#:tests? #f
4719 #:phases
4720 (modify-phases %standard-phases
4721 (delete 'configure)
4722 (delete 'build)
4723 (replace 'install
4724 (install-pom-file "pom.xml")))))
4725 (propagated-inputs
4726 `(("plexus-parent-pom" ,plexus-parent-pom-3.1)))
4727 (home-page "https://github.com/codehaus-plexus/plexus-components")
4728 (synopsis "Maven parent pom for plexus packages")
4729 (description "This package contains the parent pom for plexus component
4730 packages.")
4731 (license license:asl2.0)))
4732
4733 (define-public java-plexus-digest
4734 (package
4735 (name "java-plexus-digest")
4736 (version "1.2")
4737 (source (origin
4738 (method git-fetch)
4739 (uri (git-reference
4740 (url "https://github.com/codehaus-plexus/plexus-digest")
4741 (commit "2a52ad1bda8297fa0e287163d2fa37245ec6a430")))
4742 (file-name (git-file-name name version))
4743 (sha256
4744 (base32
4745 "19w5wxsliz8r42niry68qa665kvjsb8081dazg9vgd3pca72w07x"))))
4746 (build-system ant-build-system)
4747 (arguments
4748 `(#:jar-name "plexus-digest.jar"
4749 #:source-dir "src/main/java"
4750 #:tests? #f
4751 #:phases
4752 (modify-phases %standard-phases
4753 (replace 'install
4754 (install-from-pom "pom.xml")))))
4755 (propagated-inputs
4756 `(("java-plexus-utils" ,java-plexus-utils)
4757 ("plexus-components-pom-1.1.20" ,plexus-components-pom-1.1.20)))
4758 (native-inputs
4759 `(("java-junit" ,java-junit)))
4760 (home-page "https://github.com/codehaus-plexus/plexus-digest")
4761 (synopsis "Hash function utilities for Java")
4762 (description "This package is a plexus component that contains hash
4763 function utilities.")
4764 (license license:asl2.0)))
4765
4766 (define-public java-plexus-sec-dispatcher
4767 (package
4768 (name "java-plexus-sec-dispatcher")
4769 (version "1.4") ;; Newest release listed at the Maven Central Repository.
4770 (source (origin
4771 ;; This project doesn't tag releases or publish tarballs, so we take
4772 ;; the "prepare release plexus-sec-dispatcher-1.4" git commit.
4773 (method git-fetch)
4774 (uri (git-reference
4775 (url "https://github.com/sonatype/plexus-sec-dispatcher/")
4776 (commit "7db8f880486e192a1c5ea9544e01e756c3d49d0f")))
4777 (sha256
4778 (base32
4779 "1ng4yliy4cqpjr4fxxjbpwyk1wkch5f8vblm1kvwf328s4gibszs"))
4780 (file-name (git-file-name name version))))
4781 (arguments
4782 `(#:jar-name "plexus-sec-dispatcher.jar"
4783 #:source-dir "src/main/java"
4784 #:phases
4785 (modify-phases %standard-phases
4786 (add-before 'build 'generate-models
4787 (lambda* (#:key inputs #:allow-other-keys)
4788 (define (modello-single-mode file version mode)
4789 (invoke "java"
4790 "org.codehaus.modello.ModelloCli"
4791 file mode "src/main/java" version
4792 "false" "true"))
4793 (let ((file "src/main/mdo/settings-security.mdo"))
4794 (modello-single-mode file "1.0.0" "java")
4795 (modello-single-mode file "1.0.0" "xpp3-reader")
4796 (modello-single-mode file "1.0.0" "xpp3-writer"))
4797 #t))
4798 (add-before 'build 'generate-components.xml
4799 (lambda _
4800 (mkdir-p "build/classes/META-INF/plexus")
4801 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
4802 (lambda _
4803 (display
4804 "<component-set>\n
4805 <components>\n
4806 <component>\n
4807 <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role>\n
4808 <role-hint>default</role-hint>\n
4809 <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation>\n
4810 <description></description>\n
4811 <requirements>\n
4812 <requirement>\n
4813 <role>org.sonatype.plexus.components.cipher.PlexusCipher</role>\n
4814 <field-name>_cipher</field-name>\n
4815 </requirement>\n
4816 <requirement>\n
4817 <role>org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor</role>\n
4818 <field-name>_decryptors</field-name>\n
4819 </requirement>\n
4820 </requirements>\n
4821 <configuration>\n
4822 <_configuration-file>~/.settings-security.xml</_configuration-file>\n
4823 </configuration>\n
4824 </component>\n
4825 </components>\n
4826 </component-set>\n")))
4827 #t))
4828 (add-before 'check 'fix-paths
4829 (lambda _
4830 (copy-recursively "src/test/resources" "target")
4831 #t))
4832 (replace 'install (install-from-pom "pom.xml")))))
4833 (propagated-inputs
4834 `(("java-plexus-utils" ,java-plexus-utils)
4835 ("java-plexus-cipher" ,java-plexus-cipher)
4836 ("java-sonatype-spice-parent-pom" ,java-sonatype-spice-parent-pom-12)))
4837 (native-inputs
4838 `(("java-modello-core" ,java-modello-core)
4839 ;; for modello:
4840 ("java-plexus-container-default" ,java-plexus-container-default)
4841 ("java-plexus-classworlds" ,java-plexus-classworlds)
4842 ("java-plexus-utils" ,java-plexus-utils)
4843 ("java-guava" ,java-guava)
4844 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
4845 ("java-sisu-build-api" ,java-sisu-build-api)
4846 ;; modello plugins:
4847 ("java-modellop-plugins-java" ,java-modello-plugins-java)
4848 ("java-modellop-plugins-xml" ,java-modello-plugins-xml)
4849 ("java-modellop-plugins-xpp3" ,java-modello-plugins-xpp3)
4850 ;; for tests
4851 ("java-junit" ,java-junit)))
4852 (build-system ant-build-system)
4853 (home-page "https://github.com/sonatype/plexus-sec-dispatcher")
4854 (synopsis "Plexus Security Dispatcher Component")
4855 (description "This package is the Plexus Security Dispatcher Component.
4856 This component decrypts a string passed to it.")
4857 (license license:asl2.0)))
4858
4859 (define-public java-plexus-cli
4860 (package
4861 (name "java-plexus-cli")
4862 (version "1.7")
4863 (source (origin
4864 (method git-fetch)
4865 (uri (git-reference
4866 (url "https://github.com/sonatype/plexus-cli")
4867 (commit "a776afa6bca84e5107bedb69440329cdb24ed645")))
4868 (file-name (string-append name "-" version))
4869 (sha256
4870 (base32
4871 "0xjrlay605rypv3zd7y24vlwf0039bil3n2cqw54r1ddpysq46vx"))))
4872 (build-system ant-build-system)
4873 (arguments
4874 `(#:jar-name "plexus-cli.jar"
4875 #:source-dir "src/main/java"
4876 #:jdk ,icedtea-8
4877 #:test-dir "src/test"))
4878 (inputs
4879 `(("java-commons-cli" ,java-commons-cli)
4880 ("java-plexus-container-default" ,java-plexus-container-default)
4881 ("java-plexus-classworlds" ,java-plexus-classworlds)))
4882 (native-inputs
4883 `(("java-plexus-utils" ,java-plexus-utils)
4884 ("java-junit" ,java-junit)
4885 ("java-guava" ,java-guava)))
4886 (home-page "https://codehaus-plexus.github.io/plexus-cli")
4887 (synopsis "CLI building library for plexus")
4888 (description "This package is a library to help creating CLI around
4889 Plexus components.")
4890 (license license:asl2.0)))
4891
4892 (define-public java-sisu-build-api
4893 (package
4894 (name "java-sisu-build-api")
4895 (version "0.0.7")
4896 (source (origin
4897 (method git-fetch)
4898 (uri (git-reference
4899 (url "https://github.com/sonatype/sisu-build-api")
4900 (commit (string-append "plexus-build-api-" version))))
4901 (file-name (git-file-name name version))
4902 (sha256
4903 (base32
4904 "1d5w6c58gkx30d51v7qwv1xrhc0ly76848gihmgshj19yf6yhca0"))))
4905 (build-system ant-build-system)
4906 (arguments
4907 `(#:jar-name "sisu-build-api.jar"
4908 #:source-dir "src/main/java"
4909 #:jdk ,icedtea-8
4910 #:tests? #f; FIXME: how to run the tests?
4911 #:phases
4912 (modify-phases %standard-phases
4913 (add-before 'build 'copy-resources
4914 (lambda _
4915 (copy-recursively "src/main/resources" "build/classes")
4916 (substitute* (find-files "build/classes")
4917 (("\\$\\{project.version\\}") ,version))
4918 #t))
4919 (add-before 'build 'generate-plexus-compontent
4920 (lambda _
4921 (mkdir-p "build/classes/META-INF/plexus")
4922 ;; This file is required for plexus to inject this package.
4923 ;; FIXME: how is it generated?
4924 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
4925 (lambda _
4926 (display
4927 "<component-set>\n
4928 <components>\n
4929 <component>\n
4930 <role>org.sonatype.plexus.build.incremental.BuildContext</role>\n
4931 <role-hint>default</role-hint>\n
4932 <implementation>org.sonatype.plexus.build.incremental.DefaultBuildContext</implementation>\n
4933 <description>Filesystem based non-incremental build context implementation\n
4934 which behaves as if all files were just created.</description>\n
4935 </component>\n
4936 </components>\n
4937 </component-set>\n")))
4938 #t))
4939 (replace 'install
4940 (install-from-pom "pom.xml")))))
4941 (inputs
4942 `(("java-plexus-utils" ,java-plexus-utils)
4943 ("java-plexus-container-default" ,java-plexus-container-default)))
4944 (home-page "https://github.com/sonatype/sisu-build-api/")
4945 (synopsis "Base build API for maven")
4946 (description "This package contains the base build API for maven and
4947 a default implementation of it. This API is about scanning files in a
4948 project and determining what files need to be rebuilt.")
4949 (license license:asl2.0)))
4950
4951 (define-public java-modello-core
4952 (package
4953 (name "java-modello-core")
4954 (version "1.9.1")
4955 (source (origin
4956 (method git-fetch)
4957 (uri (git-reference
4958 (url "https://github.com/codehaus-plexus/modello")
4959 (commit (string-append "modello-" version))))
4960 (file-name (git-file-name name version))
4961 (sha256
4962 (base32
4963 "1di6ni42aqllpdvkpyfcw70352vr2i8wf6hd5nhd9kmqjb5dj5j4"))))
4964 (build-system ant-build-system)
4965 (arguments
4966 `(#:jar-name "modello-core.jar"
4967 #:source-dir "modello-core/src/main/java"
4968 #:test-dir "modello-core/src/test"
4969 #:main-class "org.codehaus.modello.ModelloCli"
4970 #:jdk ,icedtea-8
4971 #:phases
4972 (modify-phases %standard-phases
4973 (add-before 'build 'copy-resources
4974 (lambda _
4975 (mkdir-p "build/classes/META-INF/plexus")
4976 (copy-file "modello-core/src/main/resources/META-INF/plexus/components.xml"
4977 "build/classes/META-INF/plexus/components.xml")
4978 #t))
4979 (add-before 'check 'fix-tests
4980 (lambda _
4981 (with-directory-excursion "modello-core/src/test/java/org/codehaus"
4982 (substitute* '("modello/core/DefaultModelloCoreTest.java"
4983 "modello/core/io/ModelReaderTest.java")
4984 (("src/test") "modello-core/src/test")))
4985 #t)))))
4986 (propagated-inputs
4987 `(("java-plexus-utils" ,java-plexus-utils)
4988 ("java-plexus-container-default" ,java-plexus-container-default)
4989 ("java-sisu-build-api" ,java-sisu-build-api)))
4990 (native-inputs
4991 `(("java-junit" ,java-junit)
4992 ("java-plexus-classworlds" ,java-plexus-classworlds)
4993 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
4994 ("java-guava" ,java-guava)))
4995 (home-page "https://codehaus-plexus.github.io/modello/")
4996 (synopsis "Framework for code generation from a simple model")
4997 (description "Modello is a framework for code generation from a simple model.
4998
4999 Modello generates code from a simple model format: based on a plugin
5000 architecture, various types of code and descriptors can be generated from the
5001 single model, including Java POJOs, XML/JSON/YAML marshallers/unmarshallers,
5002 XSD and documentation.")
5003 (license (list
5004 license:expat
5005 ;; Although this package uses only files licensed under expat,
5006 ;; other parts of the source are licensed under different
5007 ;; licenses. We include them to be inherited by other packages.
5008 license:asl2.0
5009 ;; Some files in modello-plugin-java are licensed under a
5010 ;; 5-clause BSD license.
5011 (license:non-copyleft
5012 (string-append "file:///modello-plugins/modello-plugin-java/"
5013 "src/main/java/org/codehaus/modello/plugin/"
5014 "java/javasource/JNaming.java"))))))
5015
5016 (define-public java-modello-plugins-java
5017 (package
5018 (inherit java-modello-core)
5019 (name "java-modello-plugins-java")
5020 (arguments
5021 `(#:jar-name "modello-plugins-java.jar"
5022 #:source-dir "modello-plugins/modello-plugin-java/src/main/java"
5023 #:test-dir "modello-plugins/modello-plugin-java/src/test"
5024 #:jdk ,icedtea-8
5025 #:tests? #f; requires maven-model, which depends on this package
5026 #:phases
5027 (modify-phases %standard-phases
5028 (add-before 'build 'copy-resources
5029 (lambda _
5030 (mkdir-p "build/classes")
5031 (copy-recursively "modello-plugins/modello-plugin-java/src/main/resources"
5032 "build/classes")
5033 #t)))))
5034 (inputs
5035 `(("java-modello-core" ,java-modello-core)))
5036 (synopsis "Modello Java Plugin")
5037 (description "Modello Java Plugin generates Java objects for the model.")))
5038
5039 (define-public java-modello-plugins-xml
5040 (package
5041 (inherit java-modello-core)
5042 (name "java-modello-plugins-xml")
5043 (arguments
5044 `(#:jar-name "modello-plugins-xml.jar"
5045 #:source-dir "modello-plugins/modello-plugin-xml/src/main/java"
5046 #:test-dir "modello-plugins/modello-plugin-xml/src/test"
5047 #:jdk ,icedtea-8
5048 #:phases
5049 (modify-phases %standard-phases
5050 (add-before 'build 'copy-resources
5051 (lambda _
5052 (mkdir-p "build/classes")
5053 (copy-recursively
5054 "modello-plugins/modello-plugin-xml/src/main/resources"
5055 "build/classes")
5056 #t))
5057 (add-before 'check 'fix-paths
5058 (lambda _
5059 (with-directory-excursion "modello-plugins/modello-plugin-xml/src/test"
5060 (substitute*
5061 "java/org/codehaus/modello/plugins/xml/XmlModelloPluginTest.java"
5062 (("src/test") "modello-plugins/modello-plugin-xml/src/test")))
5063 #t)))))
5064 (propagated-inputs
5065 `(("java-modello-core" ,java-modello-core)
5066 ("java-modello-plugins-java" ,java-modello-plugins-java)))
5067 (synopsis "Modello XML Plugin")
5068 (description "Modello XML Plugin contains shared code for every plugins
5069 working on XML representation of the model.")))
5070
5071 (define-public java-modello-test
5072 (package
5073 (inherit java-modello-core)
5074 (name "java-modello-test")
5075 (arguments
5076 `(#:jar-name "modello-test.jar"
5077 #:source-dir "modello-test/src/main/java"
5078 #:tests? #f; no tests
5079 #:jdk ,icedtea-8))
5080 (inputs
5081 `(("java-plexus-utils" ,java-plexus-utils)
5082 ("java-plexus-compiler-api" ,java-plexus-compiler-api)
5083 ("java-plexus-compiler-javac" ,java-plexus-compiler-javac)
5084 ("java-plexus-container-default" ,java-plexus-container-default)))
5085 (synopsis "Modello test package")
5086 (description "The modello test package contains the basis to create
5087 Modello generator unit-tests, including sample models and xml files to test
5088 every feature for every plugin.")))
5089
5090 (define-public java-modello-plugins-xpp3
5091 (package
5092 (inherit java-modello-core)
5093 (name "java-modello-plugins-xpp3")
5094 (arguments
5095 `(#:jar-name "modello-plugins-xpp3.jar"
5096 #:source-dir "modello-plugins/modello-plugin-xpp3/src/main/java"
5097 #:test-dir "modello-plugins/modello-plugin-xpp3/src/test"
5098 ;; One of the test dependencies is maven-model which depends on this package.
5099 #:tests? #f
5100 #:jdk ,icedtea-8
5101 #:phases
5102 (modify-phases %standard-phases
5103 (add-before 'build 'copy-resources
5104 (lambda _
5105 (mkdir-p "build/classes")
5106 (copy-recursively "modello-plugins/modello-plugin-xpp3/src/main/resources"
5107 "build/classes")
5108 #t)))))
5109 (propagated-inputs
5110 `(("java-modello-core" ,java-modello-core)
5111 ("java-modello-plugins-java" ,java-modello-plugins-java)
5112 ("java-modello-plugins-xml" ,java-modello-plugins-xml)))
5113 (native-inputs
5114 `(("java-xmlunit" ,java-xmlunit)
5115 ("java-modello-test" ,java-modello-test)
5116 ,@(package-native-inputs java-modello-core)))
5117 (synopsis "Modello XPP3 Plugin")
5118 (description "The modello XPP3 plugin generates XML readers and writers based
5119 on the XPP3 API (XML Pull Parser).")))
5120
5121 (define-public java-asm
5122 (package
5123 (name "java-asm")
5124 (version "6.0")
5125 (source (origin
5126 (method url-fetch)
5127 (uri (string-append "https://download.forge.ow2.org/asm/"
5128 "asm-" version ".tar.gz"))
5129 (sha256
5130 (base32
5131 "115l5pqblirdkmzi32dxx7gbcm4jy0s14y5wircr6h8jdr9aix00"))))
5132 (build-system ant-build-system)
5133 (arguments
5134 `(#:build-target "compile"
5135 ;; The tests require an old version of Janino, which no longer compiles
5136 ;; with the JDK7.
5137 #:tests? #f
5138 #:make-flags
5139 (list
5140 ;; We don't need these extra ant tasks, but the build system asks us to
5141 ;; provide a path anyway.
5142 "-Dobjectweb.ant.tasks.path=dummy-path"
5143 ;; The java-aqute.bndlib JAR file will be put onto the classpath and
5144 ;; used during the build automatically by ant-build-system, but
5145 ;; java-asm's build.xml fails unless we provide something here.
5146 "-Dbiz.aQute.bnd.path=dummy-path")
5147 #:phases
5148 (modify-phases %standard-phases
5149 (add-before 'build 'remove-bnd-dependency
5150 (lambda _
5151 ;; This file is the only one to require bnd, and is not needed
5152 ;; because we don't build a bundle.
5153 (delete-file "src/org/objectweb/asm/tools/ModuleInfoBndPlugin.java")
5154 #t))
5155 (add-before 'install 'build-jars
5156 (lambda* (#:key make-flags #:allow-other-keys)
5157 ;; We cannot use the "jar" target because it depends on a couple
5158 ;; of unpackaged, complicated tools.
5159 (mkdir "dist")
5160 (invoke "jar"
5161 "-cf" (string-append "dist/asm-" ,version ".jar")
5162 "-C" "output/build/tmp" ".")))
5163 (add-before 'install 'fix-pom
5164 (lambda _
5165 (substitute* (find-files "archive" "\\.pom$")
5166 (("@product.artifact@") ,version))
5167 #t))
5168 (add-before 'install 'install-parent
5169 (install-pom-file "archive/asm-parent.pom"))
5170 (replace 'install
5171 (install-from-pom "archive/asm.pom")))))
5172 (native-inputs
5173 `(("java-junit" ,java-junit)))
5174 (propagated-inputs
5175 `(("java-org-ow2-parent-pom" ,java-org-ow2-parent-pom-1.3)))
5176 (home-page "https://asm.ow2.io/")
5177 (synopsis "Very small and fast Java bytecode manipulation framework")
5178 (description "ASM is an all purpose Java bytecode manipulation and
5179 analysis framework. It can be used to modify existing classes or dynamically
5180 generate classes, directly in binary form. The provided common
5181 transformations and analysis algorithms allow easily assembling custom
5182 complex transformations and code analysis tools.")
5183 (license license:bsd-3)))
5184
5185 (define java-org-ow2-parent-pom-1.3
5186 (package
5187 (name "java-org-ow2-parent-pom")
5188 (version "1.3")
5189 (source (origin
5190 (method url-fetch)
5191 (uri "https://repo1.maven.org/maven2/org/ow2/ow2/1.3/ow2-1.3.pom")
5192 (sha256
5193 (base32
5194 "1yr8hfx8gffpppa4ii6cvrsq029a6x8hzy7nsavxhs60s9kmq8ai"))))
5195 (build-system ant-build-system)
5196 (arguments
5197 `(#:tests? #f
5198 #:phases
5199 (modify-phases %standard-phases
5200 (delete 'unpack)
5201 (delete 'build)
5202 (delete 'configure)
5203 (replace 'install
5204 (install-pom-file (assoc-ref %build-inputs "source"))))))
5205 (home-page "https://ow2.org")
5206 (synopsis "Ow2.org parent pom")
5207 (description "This package contains the parent pom for projects from ow2.org,
5208 including java-asm.")
5209 (license license:lgpl2.1+)))
5210
5211 (define java-asm-bootstrap
5212 (package
5213 (inherit java-asm)
5214 (name "java-asm-bootstrap")
5215 (arguments
5216 (substitute-keyword-arguments (package-arguments java-asm)
5217 ((#:tests? _) #f)))
5218 (native-inputs `())))
5219
5220 (define-public java-asm-8
5221 (package
5222 (inherit java-asm)
5223 (version "8.0.1")
5224 (source (origin
5225 (method git-fetch)
5226 (uri (git-reference
5227 (url "https://gitlab.ow2.org/asm/asm")
5228 (commit (string-append
5229 "ASM_" (string-join (string-split version #\.)
5230 "_")))))
5231 (file-name (git-file-name "java-asm" version))
5232 (sha256
5233 (base32
5234 "1s6j27zc1i76gh891w2g48b1c3abp9w8zp5j54yb1vm5h8djkd69"))))
5235 (arguments
5236 `(#:jar-name "asm8.jar"
5237 #:source-dir "asm/src/main/java"
5238 #:test-dir "asm/src/test"
5239 ;; tests depend on junit5
5240 #:tests? #f))
5241 (propagated-inputs '())
5242 (native-inputs '())))
5243
5244 (define-public java-asm-tree-8
5245 (package
5246 (inherit java-asm-8)
5247 (name "java-asm-tree")
5248 (arguments
5249 `(#:jar-name "asm-tree.jar"
5250 #:source-dir "asm-tree/src/main/java"
5251 #:test-dir "asm-tree/src/test"
5252 ;; tests depend on junit5
5253 #:tests? #f))
5254 (inputs
5255 `(("java-asm" ,java-asm-8)))))
5256
5257 (define-public java-asm-analysis-8
5258 (package
5259 (inherit java-asm-8)
5260 (name "java-asm-analysis")
5261 (arguments
5262 `(#:jar-name "asm-analysis.jar"
5263 #:source-dir "asm-analysis/src/main/java"
5264 #:test-dir "asm-analysis/src/test"
5265 ;; tests depend on junit5
5266 #:tests? #f))
5267 (inputs
5268 `(("java-asm" ,java-asm-8)
5269 ("java-asm-tree" ,java-asm-tree-8)))))
5270
5271 (define-public java-asm-util-8
5272 (package
5273 (inherit java-asm-8)
5274 (name "java-asm-util")
5275 (arguments
5276 `(#:jar-name "asm-util8.jar"
5277 #:source-dir "asm-util/src/main/java"
5278 #:test-dir "asm-util/src/test"
5279 ;; tests depend on junit5
5280 #:tests? #f))
5281 (inputs
5282 `(("java-asm" ,java-asm-8)
5283 ("java-asm-analysis" ,java-asm-analysis-8)
5284 ("java-asm-tree" ,java-asm-tree-8)))))
5285
5286 (define-public java-cglib
5287 (package
5288 (name "java-cglib")
5289 (version "3.2.4")
5290 (source
5291 (origin
5292 (method git-fetch)
5293 (uri (git-reference
5294 (url "https://github.com/cglib/cglib")
5295 (commit (string-append
5296 "RELEASE_"
5297 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
5298 version)))))
5299 (file-name (git-file-name name version))
5300 (sha256
5301 (base32 "186451jms2zfp47yd8kxd77az2cqal1my2br7klgyp8fpl4qfg8v"))))
5302 (build-system ant-build-system)
5303 (arguments
5304 `(;; FIXME: tests fail because junit runs
5305 ;; "net.sf.cglib.transform.AbstractTransformTest", which does not seem
5306 ;; to describe a test at all.
5307 #:tests? #f
5308 #:jar-name "cglib.jar"
5309 #:phases
5310 (modify-phases %standard-phases
5311 (add-after 'unpack 'chdir
5312 (lambda _ (chdir "cglib") #t)))))
5313 (inputs
5314 `(("java-asm" ,java-asm)
5315 ("java-junit" ,java-junit)))
5316 (home-page "https://github.com/cglib/cglib/")
5317 (synopsis "Java byte code generation library")
5318 (description "The byte code generation library CGLIB is a high level API
5319 to generate and transform Java byte code.")
5320 (license license:asl2.0)))
5321
5322 (define-public java-objenesis
5323 (package
5324 (name "java-objenesis")
5325 (version "2.5.1")
5326 (source (origin
5327 (method git-fetch)
5328 (uri (git-reference
5329 (url "https://github.com/easymock/objenesis")
5330 (commit version)))
5331 (file-name (git-file-name name version))
5332 (sha256
5333 (base32
5334 "054yi200wj00x6dp1sxfrwgndwywadsbn8d8ij1j0v45j9g2vdya"))))
5335 (build-system ant-build-system)
5336 (arguments
5337 `(#:jar-name "objenesis.jar"
5338 #:source-dir "main/src/"
5339 #:test-dir "main/src/test/"))
5340 (native-inputs
5341 `(("java-junit" ,java-junit)
5342 ("java-hamcrest-core" ,java-hamcrest-core)))
5343 (home-page "http://objenesis.org/")
5344 (synopsis "Bypass the constructor when creating an object")
5345 (description "Objenesis is a small Java library that serves one purpose:
5346 to instantiate a new object of a particular class. It is common to see
5347 restrictions in libraries stating that classes must require a default
5348 constructor. Objenesis aims to overcome these restrictions by bypassing the
5349 constructor on object instantiation.")
5350 (license license:asl2.0)))
5351
5352 (define-public java-easymock
5353 (package
5354 (name "java-easymock")
5355 (version "3.4")
5356 (source (origin
5357 (method git-fetch)
5358 (uri (git-reference
5359 (url "https://github.com/easymock/easymock/")
5360 (commit (string-append "easymock-" version))))
5361 (file-name (git-file-name name version))
5362 (sha256
5363 (base32
5364 "02vybm8hc0i0n9sp2f2iiqn54zwqhq835f76wc6b2m7819z5a8dq"))))
5365 (build-system ant-build-system)
5366 (arguments
5367 `(#:jar-name "easymock.jar"
5368 #:source-dir "core/src/main"
5369 #:test-dir "core/src/test"
5370 #:phases
5371 (modify-phases %standard-phases
5372 ;; FIXME: Android support requires the following packages to be
5373 ;; available: com.google.dexmaker.stock.ProxyBuilder
5374 (add-after 'unpack 'delete-android-support
5375 (lambda _
5376 (with-directory-excursion "core/src/main/java/org/easymock/internal"
5377 (substitute* "MocksControl.java"
5378 (("AndroidSupport.isAndroid\\(\\)") "false")
5379 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
5380 (delete-file "AndroidClassProxyFactory.java"))
5381 #t))
5382 (add-after 'unpack 'delete-broken-tests
5383 (lambda _
5384 (with-directory-excursion "core/src/test/java/org/easymock"
5385 ;; This test depends on dexmaker.
5386 (delete-file "tests2/ClassExtensionHelperTest.java")
5387
5388 ;; This is not a test.
5389 (delete-file "tests/BaseEasyMockRunnerTest.java")
5390
5391 ;; This test should be executed with a different runner...
5392 (delete-file "tests2/EasyMockAnnotationsTest.java")
5393 ;; ...but deleting it means that we also have to delete these
5394 ;; dependent files.
5395 (delete-file "tests2/EasyMockRunnerTest.java")
5396 (delete-file "tests2/EasyMockRuleTest.java")
5397
5398 ;; This test fails because the file "easymock.properties" does
5399 ;; not exist.
5400 (delete-file "tests2/EasyMockPropertiesTest.java"))
5401 #t)))))
5402 (inputs
5403 `(("java-asm" ,java-asm)
5404 ("java-cglib" ,java-cglib)
5405 ("java-objenesis" ,java-objenesis)))
5406 (native-inputs
5407 `(("java-junit" ,java-junit)
5408 ("java-hamcrest-core" ,java-hamcrest-core)))
5409 (home-page "https://easymock.org/")
5410 (synopsis "Java library providing mock objects for unit tests")
5411 (description "EasyMock is a Java library that provides an easy way to use
5412 mock objects in unit testing.")
5413 (license license:asl2.0)))
5414
5415 (define-public java-jmock-1
5416 (package
5417 (name "java-jmock")
5418 (version "1.2.0")
5419 (source (origin
5420 (method git-fetch)
5421 (uri (git-reference
5422 (url "https://github.com/jmock-developers/jmock-library")
5423 (commit version)))
5424 (file-name (git-file-name name version))
5425 (sha256
5426 (base32
5427 "0lkga995xd9b9mmzxmcd301hlw83p1h78nibh7djlx7wydscr85z"))))
5428 (build-system ant-build-system)
5429 (arguments
5430 `(#:build-target "jars"
5431 #:test-target "run.tests"
5432 #:phases
5433 (modify-phases %standard-phases
5434 (replace 'install (install-jars "build")))))
5435 (home-page "http://jmock.org/")
5436 (synopsis "Mock object library for test-driven development")
5437 (description "JMock is a library that supports test-driven development of
5438 Java code with mock objects. Mock objects help you design and test the
5439 interactions between the objects in your programs.
5440
5441 The jMock library
5442
5443 @itemize
5444 @item makes it quick and easy to define mock objects
5445 @item lets you precisely specify the interactions between
5446 your objects, reducing the brittleness of your tests
5447 @item plugs into your favourite test framework
5448 @item is easy to extend.
5449 @end itemize\n")
5450 (license license:bsd-3)))
5451
5452 (define-public java-jmock
5453 (package
5454 (inherit java-jmock-1)
5455 (name "java-jmock")
5456 (version "2.8.2")
5457 (source (origin
5458 (method git-fetch)
5459 (uri (git-reference
5460 (url "https://github.com/jmock-developers/jmock-library")
5461 (commit version)))
5462 (file-name (git-file-name name version))
5463 (sha256
5464 (base32
5465 "12b7l22g3nrjvf2dzcw3z03fpd2chrgp0d8xkvn8w55rwb57pax6"))))
5466 (inputs
5467 `(("java-hamcrest-all" ,java-hamcrest-all)
5468 ("java-asm" ,java-asm)
5469 ("java-bsh" ,java-bsh)
5470 ("java-junit" ,java-junit)))
5471 (native-inputs
5472 `(("cglib" ,java-cglib)))
5473 (arguments
5474 `(#:jar-name "java-jmock.jar"
5475 #:source-dir "jmock/src/main/java"
5476 #:test-dir "jmock/src/test"))))
5477
5478 (define-public java-jmock-junit4
5479 (package
5480 (inherit java-jmock)
5481 (name "java-jmock-junit4")
5482 (arguments
5483 `(#:jar-name "java-jmock-junit4.jar"
5484 #:source-dir "jmock-junit4/src/main/java"
5485 #:test-dir "jmock-junit4/src/test"))
5486 (inputs
5487 `(("java-hamcrest-all" ,java-hamcrest-all)
5488 ("java-asm" ,java-asm)
5489 ("java-bsh" ,java-bsh)
5490 ("java-jmock" ,java-jmock)
5491 ("java-jumit" ,java-junit)))))
5492
5493 (define-public java-jmock-legacy
5494 (package
5495 (inherit java-jmock)
5496 (name "java-jmock-legacy")
5497 (arguments
5498 `(#:jar-name "java-jmock-legacy.jar"
5499 #:source-dir "jmock-legacy/src/main/java"
5500 #:test-dir "jmock-legacy/src/test"
5501 #:phases
5502 (modify-phases %standard-phases
5503 (add-before 'check 'copy-tests
5504 (lambda _
5505 ;; This file is a dependancy of some tests
5506 (let ((file "org/jmock/test/acceptance/PackageProtectedType.java"))
5507 (copy-file (string-append "jmock/src/test/java/" file)
5508 (string-append "jmock-legacy/src/test/java/" file))
5509 #t))))))
5510 (inputs
5511 `(("java-hamcrest-all" ,java-hamcrest-all)
5512 ("java-objenesis" ,java-objenesis)
5513 ("java-cglib" ,java-cglib)
5514 ("java-jmock" ,java-jmock)
5515 ("java-asm" ,java-asm)
5516 ("java-bsh" ,java-bsh)
5517 ("java-junit" ,java-junit)))
5518 (native-inputs
5519 `(("java-jmock-junit4" ,java-jmock-junit4)))))
5520
5521 (define-public java-hamcrest-all
5522 (package (inherit java-hamcrest-core)
5523 (name "java-hamcrest-all")
5524 (arguments
5525 `(#:jdk ,icedtea-8
5526 ,@(substitute-keyword-arguments (package-arguments java-hamcrest-core)
5527 ((#:build-target _) "bigjar")
5528 ((#:phases phases)
5529 `(modify-phases ,phases
5530 ;; Some build targets override the classpath, so we need to patch
5531 ;; the build.xml to ensure that required dependencies are on the
5532 ;; classpath.
5533 (add-after 'unpack 'patch-classpath-for-integration
5534 (lambda* (#:key inputs #:allow-other-keys)
5535 (substitute* "build.xml"
5536 ((" build/hamcrest-library-\\$\\{version\\}.jar" line)
5537 (string-join
5538 (cons line
5539 (append
5540 (find-files (assoc-ref inputs "java-junit") "\\.jar$")
5541 (find-files (assoc-ref inputs "java-jmock") "\\.jar$")
5542 (find-files (assoc-ref inputs "java-easymock") "\\.jar$")))
5543 ";"))
5544 (("build/hamcrest-core-\\$\\{version\\}\\.jar")
5545 (car (find-files (assoc-ref inputs "java-hamcrest-core")
5546 "jar$"))))
5547 #t))
5548 (replace 'install
5549 (lambda* (#:key outputs #:allow-other-keys)
5550 (let* ((target (string-append (assoc-ref outputs "out")
5551 "/share/java/"))
5552 (version-suffix
5553 ,(string-append
5554 "-" (package-version java-hamcrest-core) ".jar"))
5555 (install-without-version-suffix
5556 (lambda (jar)
5557 (copy-file jar
5558 (string-append target
5559 (basename jar version-suffix)
5560 ".jar")))))
5561 (mkdir-p target)
5562 (for-each
5563 install-without-version-suffix
5564 (find-files "build"
5565 (lambda (name _)
5566 (and (string-suffix? ".jar" name)
5567 (not (string-suffix? "-sources.jar" name)))))))
5568 #t)))))))
5569 (inputs
5570 `(("java-junit" ,java-junit)
5571 ("java-jmock" ,java-jmock-1)
5572 ;; This is necessary because of what seems to be a race condition.
5573 ;; This package would sometimes fail to build because hamcrest-core.jar
5574 ;; could not be found, even though it is built as part of this package.
5575 ;; Adding java-hamcrest-core appears to fix this problem. See
5576 ;; https://debbugs.gnu.org/31390 for more information.
5577 ("java-hamcrest-core" ,java-hamcrest-core)
5578 ("java-easymock" ,java-easymock)
5579 ,@(package-inputs java-hamcrest-core)))))
5580
5581 (define-public java-jopt-simple
5582 (package
5583 (name "java-jopt-simple")
5584 (version "5.0.3")
5585 (source (origin
5586 (method url-fetch)
5587 (uri (string-append "http://repo1.maven.org/maven2/"
5588 "net/sf/jopt-simple/jopt-simple/"
5589 version "/jopt-simple-"
5590 version "-sources.jar"))
5591 (sha256
5592 (base32
5593 "1v8bzmwmw6qq20gm42xyay6vrd567dra4vqwhgjnqqjz1gs9f8qa"))))
5594 (build-system ant-build-system)
5595 (arguments
5596 `(#:tests? #f ; there are no tests
5597 #:jar-name "jopt-simple.jar"))
5598 (home-page "https://pholser.github.io/jopt-simple/")
5599 (synopsis "Java library for parsing command line options")
5600 (description "JOpt Simple is a Java library for parsing command line
5601 options, such as those you might pass to an invocation of @code{javac}. In
5602 the interest of striving for simplicity, as closely as possible JOpt Simple
5603 attempts to honor the command line option syntaxes of POSIX @code{getopt} and
5604 GNU @code{getopt_long}. It also aims to make option parser configuration and
5605 retrieval of options and their arguments simple and expressive, without being
5606 overly clever.")
5607 (license license:expat)))
5608
5609 (define-public java-commons-math3
5610 (package
5611 (name "java-commons-math3")
5612 (version "3.6.1")
5613 (source (origin
5614 (method url-fetch)
5615 (uri (string-append "mirror://apache/commons/math/source/"
5616 "commons-math3-" version "-src.tar.gz"))
5617 (sha256
5618 (base32
5619 "19l6yp44qc5g7wg816nbn5z3zq3xxzwimvbm4a8pczgvpi4i85s6"))))
5620 (build-system ant-build-system)
5621 (arguments
5622 `(#:build-target "jar"
5623 #:test-target "test"
5624 #:make-flags
5625 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
5626 (junit (assoc-ref %build-inputs "java-junit")))
5627 (list (string-append "-Djunit.jar="
5628 (car (find-files junit "jar$")))
5629 (string-append "-Dhamcrest.jar="
5630 (car (find-files hamcrest ".*.jar$")))))
5631 #:phases
5632 (modify-phases %standard-phases
5633 ;; We want to build the jar in the build phase and run the tests
5634 ;; later in a separate phase.
5635 (add-after 'unpack 'untangle-targets
5636 (lambda _
5637 (substitute* "build.xml"
5638 (("name=\"jar\" depends=\"test\"")
5639 "name=\"jar\" depends=\"compile\""))
5640 #t))
5641 ;; There is no install target.
5642 (replace 'install
5643 (install-jars "target")))))
5644 (native-inputs
5645 `(("java-junit" ,java-junit)
5646 ("java-hamcrest-core" ,java-hamcrest-core)))
5647 (home-page "https://commons.apache.org/math/")
5648 (synopsis "Apache Commons mathematics library")
5649 (description "Commons Math is a library of lightweight, self-contained
5650 mathematics and statistics components addressing the most common problems not
5651 available in the Java programming language or Commons Lang.")
5652 (license license:asl2.0)))
5653
5654 (define-public java-jmh
5655 (package
5656 (name "java-jmh")
5657 (version "1.17.5")
5658 (source (origin
5659 (method hg-fetch)
5660 (uri (hg-reference
5661 (url "http://hg.openjdk.java.net/code-tools/jmh/")
5662 (changeset version)))
5663 (file-name (string-append name "-" version "-checkout"))
5664 (sha256
5665 (base32
5666 "1fxyxhg9famwcg1prc4cgwb5wzyxqavn3cjm5vz8605xz7x5k084"))))
5667 (build-system ant-build-system)
5668 (arguments
5669 `(#:jar-name "jmh-core.jar"
5670 #:source-dir "jmh-core/src/main"
5671 #:test-dir "jmh-core/src/test"
5672 #:phases
5673 (modify-phases %standard-phases
5674 ;; This seems to be a bug in the JDK. It may not be necessary in
5675 ;; future versions of the JDK.
5676 (add-after 'unpack 'fix-bug
5677 (lambda _
5678 (with-directory-excursion
5679 "jmh-core/src/main/java/org/openjdk/jmh/runner/options"
5680 (substitute* '("IntegerValueConverter.java"
5681 "ThreadsValueConverter.java")
5682 (("public Class<Integer> valueType")
5683 "public Class<? extends Integer> valueType")))
5684 #t)))))
5685 (inputs
5686 `(("java-jopt-simple" ,java-jopt-simple)
5687 ("java-commons-math3" ,java-commons-math3)))
5688 (native-inputs
5689 `(("java-junit" ,java-junit)
5690 ("java-hamcrest-core" ,java-hamcrest-core)))
5691 (home-page "https://openjdk.java.net/projects/code-tools/jmh/")
5692 (synopsis "Benchmark harness for the JVM")
5693 (description "JMH is a Java harness for building, running, and analysing
5694 nano/micro/milli/macro benchmarks written in Java and other languages
5695 targeting the JVM.")
5696 ;; GPLv2 only
5697 (license license:gpl2)))
5698
5699 (define-public java-commons-collections4
5700 (package
5701 (name "java-commons-collections4")
5702 (version "4.1")
5703 (source (origin
5704 (method url-fetch)
5705 (uri (string-append "mirror://apache/commons/collections/source/"
5706 "commons-collections4-" version "-src.tar.gz"))
5707 (sha256
5708 (base32
5709 "1krfhvggympq4avk7gh6qafzf6b9ip6r1m4lmacikyx04039m0wl"))))
5710 (build-system ant-build-system)
5711 (arguments
5712 `(#:test-target "test"
5713 #:make-flags
5714 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
5715 (junit (assoc-ref %build-inputs "java-junit"))
5716 (easymock (assoc-ref %build-inputs "java-easymock")))
5717 (list (string-append "-Djunit.jar="
5718 (car (find-files junit "jar$")))
5719 (string-append "-Dhamcrest.jar="
5720 (car (find-files hamcrest "jar$")))
5721 (string-append "-Deasymock.jar=" easymock
5722 "/share/java/easymock.jar")))
5723 #:phases
5724 (modify-phases %standard-phases
5725 (replace 'install
5726 (install-jars "target")))))
5727 (native-inputs
5728 `(("java-junit" ,java-junit)
5729 ("java-hamcrest-core" ,java-hamcrest-core)
5730 ("java-easymock" ,java-easymock)))
5731 (home-page "https://commons.apache.org/collections/")
5732 (synopsis "Collections framework")
5733 (description "The Java Collections Framework is the recognised standard
5734 for collection handling in Java. Commons-Collections seek to build upon the
5735 JDK classes by providing new interfaces, implementations and utilities. There
5736 are many features, including:
5737
5738 @itemize
5739 @item @code{Bag} interface for collections that have a number of copies of
5740 each object
5741 @item @code{BidiMap} interface for maps that can be looked up from value to
5742 key as well and key to value
5743 @item @code{MapIterator} interface to provide simple and quick iteration over
5744 maps
5745 @item Transforming decorators that alter each object as it is added to the
5746 collection
5747 @item Composite collections that make multiple collections look like one
5748 @item Ordered maps and sets that retain the order elements are added in,
5749 including an LRU based map
5750 @item Reference map that allows keys and/or values to be garbage collected
5751 under close control
5752 @item Many comparator implementations
5753 @item Many iterator implementations
5754 @item Adapter classes from array and enumerations to collections
5755 @item Utilities to test or create typical set-theory properties of collections
5756 such as union, intersection, and closure.
5757 @end itemize\n")
5758 (license license:asl2.0)))
5759
5760 (define-public java-commons-collections
5761 (package
5762 (inherit java-commons-collections4)
5763 (name "java-commons-collections")
5764 (version "3.2.2")
5765 (source (origin
5766 (method url-fetch)
5767 (uri (string-append "mirror://apache/commons/collections/source/"
5768 "commons-collections-" version "-src.tar.gz"))
5769 (sha256
5770 (base32
5771 "055r51a5lfc3z7rkxnxmnn1npvkvda7636hjpm4qk7cnfzz98387"))
5772 (patches
5773 (search-patches "java-commons-collections-fix-java8.patch"))))
5774 (arguments
5775 (substitute-keyword-arguments (package-arguments java-commons-collections4)
5776 ((#:phases phases)
5777 `(modify-phases ,phases
5778 ;; The manifest is required by the build procedure
5779 (add-before 'build 'add-manifest
5780 (lambda _
5781 (mkdir-p "build/conf")
5782 (call-with-output-file "build/conf/MANIFEST.MF"
5783 (lambda (file)
5784 (format file "Manifest-Version: 1.0\n")))
5785 #t))
5786 (replace 'install
5787 (install-jars "build"))))))))
5788
5789 (define java-commons-collections-test-classes
5790 (package
5791 (inherit java-commons-collections)
5792 (arguments
5793 `(#:jar-name "commons-collections-test-classes.jar"
5794 #:source-dir "src/test"
5795 #:tests? #f))
5796 (inputs
5797 `(("collection" ,java-commons-collections)))))
5798
5799 (define-public java-commons-beanutils
5800 (package
5801 (name "java-commons-beanutils")
5802 (version "1.9.3")
5803 (source (origin
5804 (method url-fetch)
5805 (uri (string-append "mirror://apache/commons/beanutils/source/"
5806 "commons-beanutils-" version "-src.tar.gz"))
5807 (sha256
5808 (base32
5809 "03cs0bq3sl1sdc7py9g3qnf8n9h473nrkvd3d251kaqv6a2ab7qk"))))
5810 (build-system ant-build-system)
5811 (arguments
5812 `(#:test-target "test"
5813 #:tests? #f
5814 #:phases
5815 (modify-phases %standard-phases
5816 (replace 'install
5817 (lambda* (#:key outputs #:allow-other-keys)
5818 (rename-file (string-append "dist/commons-beanutils-" ,version
5819 "-SNAPSHOT.jar")
5820 "commons-beanutils.jar")
5821 (install-file "commons-beanutils.jar"
5822 (string-append (assoc-ref outputs "out") "/share/java/"))
5823 #t)))))
5824 (inputs
5825 `(("logging" ,java-commons-logging-minimal)
5826 ("collections" ,java-commons-collections)))
5827 (native-inputs
5828 `(("junit" ,java-junit)
5829 ("collections-test" ,java-commons-collections-test-classes)))
5830 (home-page "https://commons.apache.org/beanutils/")
5831 (synopsis "Dynamically set or get properties in Java")
5832 (description "BeanUtils provides a simplified interface to reflection and
5833 introspection to set or get dynamically determined properties through their
5834 setter and getter method.")
5835 (license license:asl2.0)))
5836
5837 (define-public java-commons-io
5838 (package
5839 (name "java-commons-io")
5840 (version "2.5")
5841 (source
5842 (origin
5843 (method url-fetch)
5844 (uri (string-append "mirror://apache/commons/io/source/"
5845 "commons-io-" version "-src.tar.gz"))
5846 (sha256
5847 (base32
5848 "0q5y41jrcjvx9hzs47x5kdhnasdy6rm4bzqd2jxl02w717m7a7v3"))))
5849 (build-system ant-build-system)
5850 (outputs '("out" "doc"))
5851 (arguments
5852 `(#:test-target "test"
5853 #:make-flags
5854 (list (string-append "-Djunit.jar="
5855 (car (find-files (assoc-ref %build-inputs "java-junit")
5856 "jar$"))))
5857 #:phases
5858 (modify-phases %standard-phases
5859 (add-after 'build 'build-javadoc ant-build-javadoc)
5860 (replace 'install (install-from-pom "pom.xml"))
5861 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
5862 (native-inputs
5863 `(("java-junit" ,java-junit)
5864 ("java-hamcrest-core" ,java-hamcrest-core)))
5865 (propagated-inputs
5866 `(("apache-commons-parent-pom" ,apache-commons-parent-pom-39)))
5867 (home-page "https://commons.apache.org/io/")
5868 (synopsis "Common useful IO related classes")
5869 (description "Commons-IO contains utility classes, stream implementations,
5870 file filters and endian classes.")
5871 (license license:asl2.0)))
5872
5873 (define-public java-commons-exec-1.1
5874 (package
5875 (name "java-commons-exec")
5876 (version "1.1")
5877 (source
5878 (origin
5879 (method url-fetch)
5880 (uri (string-append "mirror://apache/commons/exec/source/"
5881 "commons-exec-" version "-src.tar.gz"))
5882 (sha256
5883 (base32
5884 "025dk8xgj10lxwwwqp0hng2rn7fr4vcirxzydqzx9k4dim667alk"))))
5885 (build-system ant-build-system)
5886 (arguments
5887 `(#:test-target "test"
5888 #:make-flags
5889 (list (string-append "-Dmaven.junit.jar="
5890 (car (find-files (assoc-ref %build-inputs "java-junit")
5891 "jar$"))))
5892 #:phases
5893 (modify-phases %standard-phases
5894 (add-before 'build 'delete-network-tests
5895 (lambda _
5896 (delete-file "src/test/java/org/apache/commons/exec/DefaultExecutorTest.java")
5897 (substitute* "src/test/java/org/apache/commons/exec/TestRunner.java"
5898 (("suite\\.addTestSuite\\(DefaultExecutorTest\\.class\\);") ""))
5899 #t))
5900 ;; The "build" phase automatically tests.
5901 (delete 'check)
5902 (replace 'install (install-jars "target")))))
5903 (native-inputs
5904 `(("java-junit" ,java-junit)))
5905 (home-page "https://commons.apache.org/proper/commons-exec/")
5906 (synopsis "Common program execution related classes")
5907 (description "Commons-Exec simplifies executing external processes.")
5908 (license license:asl2.0)))
5909
5910 (define-public java-commons-exec
5911 (package
5912 (inherit java-commons-exec-1.1)
5913 (version "1.3")
5914 (source
5915 (origin
5916 (method url-fetch)
5917 (uri (string-append "mirror://apache/commons/exec/source/"
5918 "commons-exec-" version "-src.tar.gz"))
5919 (sha256
5920 (base32
5921 "17yb4h6f8l49c5iyyvda4z2nmw0bxrx857nrwmsr7mmpb7x441yv"))))
5922 (arguments
5923 `(#:test-target "test"
5924 #:make-flags
5925 (list (string-append "-Dmaven.junit.jar="
5926 (car (find-files (assoc-ref %build-inputs "java-junit")
5927 "jar$")))
5928 "-Dmaven.compiler.source=1.7"
5929 "-Dmaven.compiler.target=1.7")
5930 #:phases
5931 (modify-phases %standard-phases
5932 (add-before 'build 'delete-network-tests
5933 (lambda* (#:key inputs #:allow-other-keys)
5934 ;; This test hangs indefinitely.
5935 (delete-file "src/test/java/org/apache/commons/exec/issues/Exec60Test.java")
5936 (substitute* "src/test/java/org/apache/commons/exec/issues/Exec41Test.java"
5937 (("ping -c 10 127.0.0.1") "sleep 10"))
5938 (substitute* "src/test/java/org/apache/commons/exec/issues/Exec49Test.java"
5939 (("/bin/ls") "ls"))
5940 (call-with-output-file "src/test/scripts/ping.sh"
5941 (lambda (port)
5942 (format port "#!~a/bin/sh\nsleep $1\n"
5943 (assoc-ref inputs "bash"))))
5944 #t))
5945 ;; The "build" phase automatically tests.
5946 (delete 'check)
5947 (replace 'install (install-jars "target")))))
5948 (native-inputs
5949 `(("java-junit" ,java-junit)
5950 ("java-hamcrest-core" ,java-hamcrest-core)))))
5951
5952 (define-public java-commons-lang
5953 (package
5954 (name "java-commons-lang")
5955 (version "2.6")
5956 (source
5957 (origin
5958 (method url-fetch)
5959 (uri (string-append "mirror://apache/commons/lang/source/"
5960 "commons-lang-" version "-src.tar.gz"))
5961 (sha256
5962 (base32 "1mxwagqadzx1b2al7i0z1v0r235aj2njdyijf02szq0vhmqrfiq5"))))
5963 (build-system ant-build-system)
5964 (outputs '("out" "doc"))
5965 (arguments
5966 `(#:test-target "test"
5967 #:test-exclude (list "**/Abstract*.java" "**/Random*.java")
5968 #:phases
5969 (modify-phases %standard-phases
5970 (add-after 'build 'build-javadoc ant-build-javadoc)
5971 (add-before 'check 'disable-failing-test
5972 (lambda _
5973 ;; Disable a failing test
5974 (substitute* "src/test/java/org/apache/commons/lang/\
5975 time/FastDateFormatTest.java"
5976 (("public void testFormat\\(\\)")
5977 "public void disabled_testFormat()"))
5978 #t))
5979 (replace 'install (install-jars "target"))
5980 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
5981 (native-inputs
5982 `(("java-junit" ,java-junit)))
5983 (home-page "https://commons.apache.org/lang/")
5984 (synopsis "Extension of the java.lang package")
5985 (description "The Commons Lang components contains a set of Java classes
5986 that provide helper methods for standard Java classes, especially those found
5987 in the @code{java.lang} package in the Sun JDK. The following classes are
5988 included:
5989
5990 @itemize
5991 @item StringUtils - Helper for @code{java.lang.String}.
5992 @item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets
5993 of characters such as @code{[a-z]} and @code{[abcdez]}.
5994 @item RandomStringUtils - Helper for creating randomised strings.
5995 @item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
5996 @item NumberRange - A range of numbers with an upper and lower bound.
5997 @item ObjectUtils - Helper for @code{java.lang.Object}.
5998 @item SerializationUtils - Helper for serializing objects.
5999 @item SystemUtils - Utility class defining the Java system properties.
6000 @item NestedException package - A sub-package for the creation of nested
6001 exceptions.
6002 @item Enum package - A sub-package for the creation of enumerated types.
6003 @item Builder package - A sub-package for the creation of @code{equals},
6004 @code{hashCode}, @code{compareTo} and @code{toString} methods.
6005 @end itemize\n")
6006 (license license:asl2.0)))
6007
6008 (define-public java-commons-lang3
6009 (package
6010 (name "java-commons-lang3")
6011 (version "3.9")
6012 (source
6013 (origin
6014 (method url-fetch)
6015 (uri (string-append "mirror://apache/commons/lang/source/"
6016 "commons-lang3-" version "-src.tar.gz"))
6017 (sha256
6018 (base32 "0s4ffbvsyl16c90l45ximsg4dwd8hmz7wsza3p308fw43h6mwhb6"))))
6019 (build-system ant-build-system)
6020 (arguments
6021 `(#:jar-name "commons-lang3.jar"
6022 #:source-dir "src/main/java"
6023 #:tests? #f; require junit5
6024 #:phases
6025 (modify-phases %standard-phases
6026 (replace 'install (install-from-pom "pom.xml")))))
6027 (propagated-inputs
6028 `(("apache-commons-parent-pom" ,apache-commons-parent-pom-48)))
6029 (home-page "https://commons.apache.org/lang/")
6030 (synopsis "Extension of the java.lang package")
6031 (description "The Commons Lang components contains a set of Java classes
6032 that provide helper methods for standard Java classes, especially those found
6033 in the @code{java.lang} package. The following classes are included:
6034
6035 @itemize
6036 @item StringUtils - Helper for @code{java.lang.String}.
6037 @item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets of
6038 characters such as @code{[a-z]} and @code{[abcdez]}.
6039 @item RandomStringUtils - Helper for creating randomised strings.
6040 @item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
6041 @item NumberRange - A range of numbers with an upper and lower bound.
6042 @item ObjectUtils - Helper for @code{java.lang.Object}.
6043 @item SerializationUtils - Helper for serializing objects.
6044 @item SystemUtils - Utility class defining the Java system properties.
6045 @item NestedException package - A sub-package for the creation of nested
6046 exceptions.
6047 @item Enum package - A sub-package for the creation of enumerated types.
6048 @item Builder package - A sub-package for the creation of @code{equals},
6049 @code{hashCode}, @code{compareTo} and @code{toString} methods.
6050 @end itemize\n")
6051 (license license:asl2.0)))
6052
6053 (define-public java-commons-bsf
6054 (package
6055 (name "java-commons-bsf")
6056 (version "2.4.0")
6057 (source (origin
6058 (method url-fetch)
6059 (uri (string-append "mirror://apache/commons/bsf/source/bsf-src-"
6060 version ".tar.gz"))
6061 (sha256
6062 (base32
6063 "1sbamr8jl32p1jgf59nw0b2w9qivyg145954hm6ly54cfgsqrdas"))
6064 (modules '((guix build utils)))
6065 (snippet
6066 '(begin
6067 (for-each delete-file
6068 (find-files "." "\\.jar$"))
6069 #t))))
6070 (build-system ant-build-system)
6071 (arguments
6072 `(#:build-target "jar"
6073 #:tests? #f; No test file
6074 #:modules ((guix build ant-build-system)
6075 (guix build utils)
6076 (guix build java-utils)
6077 (sxml simple))
6078 #:phases
6079 (modify-phases %standard-phases
6080 (add-before 'build 'create-properties
6081 (lambda _
6082 ;; This file is missing from the distribution
6083 (call-with-output-file "build-properties.xml"
6084 (lambda (port)
6085 (sxml->xml
6086 `(project (@ (basedir ".") (name "build-properties") (default ""))
6087 (property (@ (name "project.name") (value "bsf")))
6088 (property (@ (name "source.level") (value "1.5")))
6089 (property (@ (name "build.lib") (value "build/jar")))
6090 (property (@ (name "src.dir") (value "src")))
6091 (property (@ (name "tests.dir") (value "src/org/apache/bsf/test")))
6092 (property (@ (name "build.tests") (value "build/test-classes")))
6093 (property (@ (name "build.dest") (value "build/classes"))))
6094 port)))
6095 #t))
6096 (replace 'install (install-jars "build")))))
6097 (native-inputs
6098 `(("java-junit" ,java-junit)))
6099 (inputs
6100 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)))
6101 (home-page "https://commons.apache.org/proper/commons-bsf")
6102 (synopsis "Bean Scripting Framework")
6103 (description "The Bean Scripting Framework (BSF) is a set of Java classes
6104 which provides scripting language support within Java applications, and access
6105 to Java objects and methods from scripting languages. BSF allows one to write
6106 JSPs in languages other than Java while providing access to the Java class
6107 library. In addition, BSF permits any Java application to be implemented in
6108 part (or dynamically extended) by a language that is embedded within it. This
6109 is achieved by providing an API that permits calling scripting language engines
6110 from within Java, as well as an object registry that exposes Java objects to
6111 these scripting language engines.")
6112 (license license:asl2.0)))
6113
6114 (define-public java-commons-jxpath
6115 (package
6116 (name "java-commons-jxpath")
6117 (version "1.3")
6118 (source (origin
6119 (method url-fetch)
6120 (uri (string-append "mirror://apache/commons/jxpath/source/"
6121 "commons-jxpath-" version "-src.tar.gz"))
6122 (sha256
6123 (base32
6124 "1rpgg31ayn9fwr4bfi2i1ij0npcg79ad2fv0w9hacvawsyc42cfs"))))
6125 (build-system ant-build-system)
6126 (arguments
6127 `(#:jar-name "commons-jxpath.jar"
6128 ;; tests require more dependencies, including mockrunner which depends on old software
6129 #:tests? #f
6130 #:source-dir "src/java"))
6131 (inputs
6132 `(("servlet" ,java-classpathx-servletapi)
6133 ("java-jdom" ,java-jdom)
6134 ("java-commons-beanutils" ,java-commons-beanutils)))
6135 (native-inputs
6136 `(("java-junit" ,java-junit)))
6137 (home-page "https://commons.apache.org/jxpath/")
6138 (synopsis "Simple interpreter of an expression language called XPath.")
6139 (description "The org.apache.commons.jxpath package defines a simple
6140 interpreter of an expression language called XPath. JXPath applies XPath
6141 expressions to graphs of objects of all kinds: JavaBeans, Maps, Servlet
6142 contexts, DOM etc, including mixtures thereof.")
6143 (license license:asl2.0)))
6144
6145 (define-public java-commons-pool
6146 (package
6147 (name "java-commons-pool")
6148 (version "2.6.2")
6149 (source (origin
6150 (method url-fetch)
6151 (uri (string-append "mirror://apache/commons/pool/source/"
6152 "commons-pool2-" version "-src.tar.gz"))
6153 (sha256
6154 (base32
6155 "1fi1hgqmq01bs6azbj3sfswxzadp2r8sjjfiq6ryilz1m50kvrv6"))))
6156 (arguments
6157 `(#:jar-name "common-pool.jar"
6158 #:source-dir "src/main/java"
6159 #:test-exclude
6160 (list "**/PerformanceTest.java")))
6161 (build-system ant-build-system)
6162 (inputs
6163 `(("java-cglib" ,java-cglib)))
6164 (native-inputs
6165 `(("java-junit" ,java-junit)
6166 ("java-hamcrest-core" ,java-hamcrest-core)
6167 ("java-asm" ,java-asm)
6168 ("java-objenesis" ,java-objenesis)))
6169 (home-page "https://commons.apache.org/proper/commons-pool/")
6170 (synopsis "Object-pooling API in Java")
6171 (description "The commons-pool package provides an object-pooling API
6172 and a number of object pool implementations. This package defines a
6173 handful of pooling interfaces and some base classes that may be useful when
6174 creating new pool implementations.")
6175 (license license:asl2.0)))
6176
6177 (define-public java-commons-dbcp
6178 (package
6179 (name "java-commons-dbcp")
6180 (version "2.6.0")
6181 (source (origin
6182 (method url-fetch)
6183 (uri (string-append "mirror://apache/commons/dbcp/source/"
6184 "commons-dbcp2-" version "-src.tar.gz"))
6185 (sha256
6186 (base32
6187 "0axbvcbnf2l70fc3ybrlp3siw2w4ka9mia2pnx4py8gz54cpw3rc"))))
6188 (arguments
6189 `(#:source-dir "src/main/java"
6190 #:jar-name "java-commons-dbcp.jar"
6191 #:tests? #f)); requires apache-geronimo
6192 (inputs
6193 `(("java-commons-pool" ,java-commons-pool)
6194 ("java-commons-logging" ,java-commons-logging-minimal)
6195 ("java-jboss-transaction-api-spec" ,java-jboss-transaction-api-spec)))
6196 (native-inputs
6197 `(("java-junit" ,java-junit)))
6198 (build-system ant-build-system)
6199 (home-page "https://commons.apache.org/proper/commons-dbcp/")
6200 (synopsis "Database Connection Pool for Java")
6201 (description "Commons-dbcp allows you to share a pool of database
6202 connections between users. Creating a new connection for each user can be
6203 time consuming and even unfeasible when the number of simultaneous users is
6204 very large. This package provides a way to share a poole of connections to
6205 reduce that load.")
6206 (license license:asl2.0)))
6207
6208 (define-public java-commons-jcs
6209 (package
6210 (name "java-commons-jcs")
6211 (version "2.2.1")
6212 (source (origin
6213 (method url-fetch)
6214 (uri (string-append "mirror://apache/commons/jcs/source/"
6215 "commons-jcs-dist-" version "-src.tar.gz"))
6216 (sha256
6217 (base32
6218 "0syhq2npjbrl0azqfjm0gvash1qd5qjy4qmysxcrqjsk0nf9fa1q"))))
6219 (build-system ant-build-system)
6220 (arguments
6221 `(#:jar-name "commons-jcs.jar"
6222 #:source-dir "commons-jcs-core/src/main/java"
6223 #:test-dir "commons-jcs-core/src/test"
6224 #:tests? #f; requires hsqldb
6225 #:phases
6226 (modify-phases %standard-phases
6227 (add-before 'build 'prepare
6228 (lambda _
6229 (with-directory-excursion
6230 "commons-jcs-core/src/main/java/org/apache/commons/jcs"
6231 (substitute*
6232 "auxiliary/disk/jdbc/dsfactory/SharedPoolDataSourceFactory.java"
6233 (("commons.dbcp") "commons.dbcp2")
6234 ((".*\\.setMaxActive.*") ""))
6235 ;;; Remove dependency on velocity-tools
6236 (delete-file "admin/servlet/JCSAdminServlet.java"))
6237 #t)))))
6238 (propagated-inputs
6239 `(("java-classpathx-servletapi" ,java-classpathx-servletapi)
6240 ("java-commons-logging-minimal" ,java-commons-logging-minimal)
6241 ("java-commons-httpclient" ,java-commons-httpclient)
6242 ("java-commons-dbcp" ,java-commons-dbcp)))
6243 (native-inputs
6244 `(("java-junit" ,java-junit)))
6245 (home-page "https://commons.apache.org/proper/commons-jcs/")
6246 (synopsis "Distributed caching system in Java")
6247 (description "JCS is a distributed caching system written in Java. It
6248 is intended to speed up applications by providing a means to manage cached
6249 data of various dynamic natures. Like any caching system, JCS is most useful
6250 for high read, low put applications. Latency times drop sharply and
6251 bottlenecks move away from the database in an effectively cached system.")
6252 (license license:asl2.0)))
6253
6254 (define-public java-jsr250
6255 (package
6256 (name "java-jsr250")
6257 (version "1.3")
6258 (source (origin
6259 (method url-fetch)
6260 (uri (string-append "https://repo1.maven.org/maven2/"
6261 "javax/annotation/javax.annotation-api/"
6262 version "/javax.annotation-api-"
6263 version "-sources.jar"))
6264 (sha256
6265 (base32
6266 "08clh8n4n9wfglf75qsqfjs6yf79f7x6hqx38cn856pksszv50kz"))))
6267 (build-system ant-build-system)
6268 (arguments
6269 `(#:tests? #f ; no tests included
6270 #:jdk ,icedtea-8
6271 #:jar-name "jsr250.jar"
6272 #:modules ((guix build ant-build-system)
6273 (guix build utils)
6274 (guix build maven pom)
6275 (guix build java-utils)
6276 (sxml simple))
6277 #:phases
6278 (modify-phases %standard-phases
6279 (add-before 'install 'create-pom
6280 (lambda _
6281 (with-output-to-file "pom.xml"
6282 (lambda _
6283 (sxml->xml
6284 `((project
6285 (modelVersion "4.0.0")
6286 (name "jsr250")
6287 (groupId "javax.annotation")
6288 (artifactId "jsr250-api")
6289 (version ,,version))))))
6290 #t))
6291 (replace 'install
6292 (install-from-pom "pom.xml")))))
6293 (home-page "https://jcp.org/en/jsr/detail?id=250")
6294 (synopsis "Security-related annotations")
6295 (description "This package provides annotations for security. It provides
6296 packages in the @code{javax.annotation} and @code{javax.annotation.security}
6297 namespaces.")
6298 ;; either cddl or gpl2 only, with classpath exception
6299 (license (list license:cddl1.0
6300 license:gpl2))))
6301
6302 (define-public java-jsr305
6303 (package
6304 (name "java-jsr305")
6305 (version "3.0.1")
6306 (source (origin
6307 (method url-fetch)
6308 (uri (string-append "https://repo1.maven.org/maven2/"
6309 "com/google/code/findbugs/"
6310 "jsr305/" version "/jsr305-"
6311 version "-sources.jar"))
6312 (sha256
6313 (base32
6314 "1rh6jin9v7jqpq3kf1swl868l8i94r636n03pzpsmgr8v0lh9j2n"))))
6315 (build-system ant-build-system)
6316 (arguments
6317 `(#:tests? #f ; no tests included
6318 #:jar-name "jsr305.jar"
6319 #:modules ((guix build ant-build-system)
6320 (guix build java-utils)
6321 (guix build maven pom)
6322 (guix build utils)
6323 (sxml simple))
6324 #:phases
6325 (modify-phases %standard-phases
6326 (add-before 'install 'create-pom
6327 (lambda _
6328 (with-output-to-file "pom.xml"
6329 (lambda _
6330 (sxml->xml
6331 `((project
6332 (modelVersion "4.0.0")
6333 (name "jsr305")
6334 (groupId "com.google.code.findbugs")
6335 (artifactId "jsr305")
6336 (version ,,version))))))
6337 #t))
6338 (replace 'install
6339 (install-from-pom "pom.xml")))))
6340 (home-page "http://findbugs.sourceforge.net/")
6341 (synopsis "Annotations for the static analyzer called findbugs")
6342 (description "This package provides annotations for the findbugs package.
6343 It provides packages in the @code{javax.annotations} namespace.")
6344 (license license:asl2.0)))
6345
6346 (define-public java-guava
6347 (package
6348 (name "java-guava")
6349 ;; This is the last release of Guava that can be built with Java 7.
6350 (version "20.0")
6351 (source (origin
6352 (method git-fetch)
6353 (uri (git-reference
6354 (url "https://github.com/google/guava/")
6355 (commit (string-append "v" version))))
6356 (file-name (git-file-name name version))
6357 (sha256
6358 (base32
6359 "00h5cawdjic1vind3yivzh1f58flvm1yfmhsyqwyvmbvj1vakysp"))))
6360 (build-system ant-build-system)
6361 (arguments
6362 `(#:tests? #f ; no tests included
6363 #:jar-name "guava.jar"
6364 #:source-dir "guava/src"
6365 #:phases
6366 (modify-phases %standard-phases
6367 (add-after 'unpack 'trim-sources
6368 (lambda _
6369 (with-directory-excursion "guava/src/com/google/common"
6370 ;; Remove annotations to avoid extra dependencies:
6371 ;; * "j2objc" annotations are used when converting Java to
6372 ;; Objective C;
6373 ;; * "errorprone" annotations catch common Java mistakes at
6374 ;; compile time;
6375 ;; * "IgnoreJRERequirement" is used for Android.
6376 (substitute* (find-files "." "\\.java$")
6377 (("import com.google.j2objc.*") "")
6378 (("import com.google.errorprone.annotation.*") "")
6379 (("import org.codehaus.mojo.animal_sniffer.*") "")
6380 (("@CanIgnoreReturnValue") "")
6381 (("@LazyInit") "")
6382 (("@WeakOuter") "")
6383 (("@RetainedWith") "")
6384 (("@Weak") "")
6385 (("@ForOverride") "")
6386 (("@J2ObjCIncompatible") "")
6387 (("@IgnoreJRERequirement") "")))
6388 #t))
6389 (replace 'install (install-from-pom "guava/pom.xml")))))
6390 (inputs
6391 `(("java-jsr305" ,java-jsr305)))
6392 (propagated-inputs
6393 `(("java-guava-parent-pom" ,java-guava-parent-pom)))
6394 (home-page "https://github.com/google/guava")
6395 (synopsis "Google core libraries for Java")
6396 (description "Guava is a set of core libraries that includes new
6397 collection types (such as multimap and multiset), immutable collections, a
6398 graph library, functional types, an in-memory cache, and APIs/utilities for
6399 concurrency, I/O, hashing, primitives, reflection, string processing, and much
6400 more!")
6401 (license license:asl2.0)))
6402
6403 (define java-guava-parent-pom
6404 (package
6405 (inherit java-guava)
6406 (name "java-guava-parent-pom")
6407 (arguments
6408 `(#:tests? #f
6409 #:phases
6410 (modify-phases %standard-phases
6411 (delete 'configure)
6412 (delete 'build)
6413 (replace 'install
6414 (install-pom-file "pom.xml")))))
6415 (propagated-inputs
6416 `(("java-sonatype-oss-parent-pom" ,java-sonatype-oss-parent-pom-7)))))
6417
6418 ;; The java-commons-logging package provides adapters to many different
6419 ;; logging frameworks. To avoid an excessive dependency graph we try to build
6420 ;; it with only a minimal set of adapters.
6421 (define-public java-commons-logging-minimal
6422 (package
6423 (name "java-commons-logging-minimal")
6424 (version "1.2")
6425 (source (origin
6426 (method url-fetch)
6427 (uri (string-append "mirror://apache/commons/logging/source/"
6428 "commons-logging-" version "-src.tar.gz"))
6429 (sha256
6430 (base32
6431 "10bwcy5w8d7y39n0krlwhnp8ds3kj5zhmzj0zxnkw0qdlsjmsrj9"))))
6432 (build-system ant-build-system)
6433 (arguments
6434 `(#:tests? #f ; avoid dependency on logging frameworks
6435 #:jar-name "commons-logging-minimal.jar"
6436 #:phases
6437 (modify-phases %standard-phases
6438 (add-after 'unpack 'delete-adapters-and-tests
6439 (lambda _
6440 ;; Delete all adapters except for NoOpLog, SimpleLog, and
6441 ;; LogFactoryImpl. NoOpLog is required to build; LogFactoryImpl
6442 ;; is used by applications; SimpleLog is the only actually usable
6443 ;; implementation that does not depend on another logging
6444 ;; framework.
6445 (for-each
6446 (lambda (file)
6447 (delete-file (string-append
6448 "src/main/java/org/apache/commons/logging/impl/" file)))
6449 (list "Jdk13LumberjackLogger.java"
6450 "WeakHashtable.java"
6451 "Log4JLogger.java"
6452 "ServletContextCleaner.java"
6453 "Jdk14Logger.java"
6454 "AvalonLogger.java"
6455 "LogKitLogger.java"))
6456 (delete-file-recursively "src/test")
6457 #t)))))
6458 (home-page "https://commons.apache.org/logging/")
6459 (synopsis "Common API for logging implementations")
6460 (description "The Logging package is a thin bridge between different
6461 logging implementations. A library that uses the commons-logging API can be
6462 used with any logging implementation at runtime.")
6463 (license license:asl2.0)))
6464
6465 ;; This is the last release of the 1.x series.
6466 (define-public java-mockito-1
6467 (package
6468 (name "java-mockito")
6469 (version "1.10.19")
6470 (source (origin
6471 (method url-fetch)
6472 (uri (string-append "http://repo1.maven.org/maven2/"
6473 "org/mockito/mockito-core/" version
6474 "/mockito-core-" version "-sources.jar"))
6475 (sha256
6476 (base32
6477 "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc"))))
6478 (build-system ant-build-system)
6479 (arguments
6480 `(#:jar-name "mockito.jar"
6481 #:tests? #f ; no tests included
6482 ;; FIXME: patch-and-repack does not support jars, so we have to apply
6483 ;; patches in build phases.
6484 #:phases
6485 (modify-phases %standard-phases
6486 ;; Mockito was developed against a different version of hamcrest,
6487 ;; which does not require matcher implementations to provide an
6488 ;; implementation of the "describeMismatch" method. We add this
6489 ;; simple definition to pass the build with our version of hamcrest.
6490 (add-after 'unpack 'fix-hamcrest-build-error
6491 (lambda _
6492 (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java"
6493 (("public Matcher getActualMatcher\\(\\) .*" line)
6494 (string-append "
6495 public void describeMismatch(Object item, Description description) {
6496 actualMatcher.describeMismatch(item, description);
6497 }"
6498 line)))
6499 #t))
6500 ;; Mockito bundles cglib. We have a cglib package, so let's use
6501 ;; that instead.
6502 (add-after 'unpack 'use-system-libraries
6503 (lambda _
6504 (with-directory-excursion "src/org/mockito/internal/creation/cglib"
6505 (substitute* '("CGLIBHacker.java"
6506 "CglibMockMaker.java"
6507 "ClassImposterizer.java"
6508 "DelegatingMockitoMethodProxy.java"
6509 "MethodInterceptorFilter.java"
6510 "MockitoNamingPolicy.java"
6511 "SerializableMockitoMethodProxy.java"
6512 "SerializableNoOp.java")
6513 (("import org.mockito.cglib") "import net.sf.cglib")))
6514 #t)))))
6515 (inputs
6516 `(("java-junit" ,java-junit)
6517 ("java-objenesis" ,java-objenesis)
6518 ("java-cglib" ,java-cglib)
6519 ("java-hamcrest-core" ,java-hamcrest-core)))
6520 (home-page "http://mockito.org")
6521 (synopsis "Mockito is a mock library for Java")
6522 (description "Mockito is a mocking library for Java which lets you write
6523 tests with a clean and simple API. It generates mocks using reflection, and
6524 it records all mock invocations, including methods arguments.")
6525 (license license:asl2.0)))
6526
6527 (define-public java-httpcomponents-httpcore
6528 (package
6529 (name "java-httpcomponents-httpcore")
6530 (version "4.4.6")
6531 (source (origin
6532 (method url-fetch)
6533 (uri (string-append "mirror://apache//httpcomponents/httpcore/"
6534 "source/httpcomponents-core-"
6535 version "-src.tar.gz"))
6536 (sha256
6537 (base32
6538 "02bwcf38y4vgwq7kj2s6q7qrmma641r5lacivm16kgxvb2j6h1vy"))))
6539 (build-system ant-build-system)
6540 (arguments
6541 `(#:jar-name "httpcomponents-httpcore.jar"
6542 #:phases
6543 (modify-phases %standard-phases
6544 (add-after 'unpack 'chdir
6545 (lambda _ (chdir "httpcore") #t)))))
6546 (inputs
6547 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
6548 ("java-commons-lang3" ,java-commons-lang3)))
6549 (native-inputs
6550 `(("java-junit" ,java-junit)
6551 ("java-mockito" ,java-mockito-1)))
6552 (home-page "https://hc.apache.org/httpcomponents-core-4.4.x/index.html")
6553 (synopsis "Low level HTTP transport components")
6554 (description "HttpCore is a set of low level HTTP transport components
6555 that can be used to build custom client and server side HTTP services with a
6556 minimal footprint. HttpCore supports two I/O models: blocking I/O model based
6557 on the classic Java I/O and non-blocking, event driven I/O model based on Java
6558 NIO.
6559
6560 This package provides the blocking I/O model library.")
6561 (license license:asl2.0)))
6562
6563 (define-public java-httpcomponents-httpcore-nio
6564 (package (inherit java-httpcomponents-httpcore)
6565 (name "java-httpcomponents-httpcore-nio")
6566 (arguments
6567 `(#:jar-name "httpcomponents-httpcore-nio.jar"
6568 #:phases
6569 (modify-phases %standard-phases
6570 (add-after 'unpack 'chdir
6571 (lambda _ (chdir "httpcore-nio") #t)))))
6572 (inputs
6573 `(("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
6574 ("java-hamcrest-core" ,java-hamcrest-core)
6575 ,@(package-inputs java-httpcomponents-httpcore)))
6576 (description "HttpCore is a set of low level HTTP transport components
6577 that can be used to build custom client and server side HTTP services with a
6578 minimal footprint. HttpCore supports two I/O models: blocking I/O model based
6579 on the classic Java I/O and non-blocking, event driven I/O model based on Java
6580 NIO.
6581
6582 This package provides the non-blocking I/O model library based on Java
6583 NIO.")))
6584
6585 (define-public java-httpcomponents-httpcore-ab
6586 (package (inherit java-httpcomponents-httpcore)
6587 (name "java-httpcomponents-httpcore-ab")
6588 (arguments
6589 `(#:jar-name "httpcomponents-httpcore-ab.jar"
6590 #:phases
6591 (modify-phases %standard-phases
6592 (add-after 'unpack 'chdir
6593 (lambda _ (chdir "httpcore-ab") #t)))))
6594 (inputs
6595 `(("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
6596 ("java-commons-cli" ,java-commons-cli)
6597 ("java-hamcrest-core" ,java-hamcrest-core)
6598 ,@(package-inputs java-httpcomponents-httpcore)))
6599 (synopsis "Apache HttpCore benchmarking tool")
6600 (description "This package provides the HttpCore benchmarking tool. It is
6601 an Apache AB clone based on HttpCore.")))
6602
6603 (define-public java-httpcomponents-httpclient
6604 (package
6605 (name "java-httpcomponents-httpclient")
6606 (version "4.5.12")
6607 (source (origin
6608 (method url-fetch)
6609 (uri (string-append "mirror://apache/httpcomponents/httpclient/"
6610 "source/httpcomponents-client-"
6611 version "-src.tar.gz"))
6612 (sha256
6613 (base32
6614 "1va99m2zc2liv0v9vn72p5ja8yz4s5wq7zpahaai5nr966kvxzkb"))))
6615 (build-system ant-build-system)
6616 (arguments
6617 `(#:jar-name "httpcomponents-httpclient.jar"
6618 #:phases
6619 (modify-phases %standard-phases
6620 (add-after 'unpack 'chdir
6621 (lambda _ (chdir "httpclient") #t)))))
6622 (inputs
6623 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
6624 ("java-commons-codec" ,java-commons-codec)
6625 ("java-hamcrest-core" ,java-hamcrest-core)
6626 ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
6627 ("java-mockito" ,java-mockito-1)
6628 ("java-junit" ,java-junit)))
6629 (home-page "https://hc.apache.org/httpcomponents-client-ga/")
6630 (synopsis "HTTP client library for Java")
6631 (description "Although the @code{java.net} package provides basic
6632 functionality for accessing resources via HTTP, it doesn't provide the full
6633 flexibility or functionality needed by many applications. @code{HttpClient}
6634 seeks to fill this void by providing an efficient, up-to-date, and
6635 feature-rich package implementing the client side of the most recent HTTP
6636 standards and recommendations.")
6637 (license license:asl2.0)))
6638
6639 (define-public java-httpcomponents-httpmime
6640 (package (inherit java-httpcomponents-httpclient)
6641 (name "java-httpcomponents-httpmime")
6642 (arguments
6643 `(#:jar-name "httpcomponents-httpmime.jar"
6644 #:phases
6645 (modify-phases %standard-phases
6646 (add-after 'unpack 'chdir
6647 (lambda _ (chdir "httpmime") #t)))))
6648 (inputs
6649 `(("java-httpcomponents-httpclient" ,java-httpcomponents-httpclient)
6650 ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
6651 ("java-junit" ,java-junit)
6652 ("java-hamcrest-core" ,java-hamcrest-core)))))
6653
6654 (define-public java-commons-net
6655 (package
6656 (name "java-commons-net")
6657 (version "3.6")
6658 (source (origin
6659 (method url-fetch)
6660 (uri (string-append "mirror://apache/commons/net/source/"
6661 "commons-net-" version "-src.tar.gz"))
6662 (sha256
6663 (base32
6664 "0n0cmnddk9qdqhjvka8pc6hd9mn2qi3166f1s6xk32h7rfy1adxr"))))
6665 (build-system ant-build-system)
6666 (arguments
6667 `(;; FIXME: MainTest.java tries to read "examples.properties" (which
6668 ;; should be "resources/examples/examples.properties"), but gets "null"
6669 ;; instead.
6670 #:tests? #f
6671 #:jar-name "commons-net.jar"))
6672 (native-inputs
6673 `(("java-junit" ,java-junit)
6674 ("java-hamcrest-core" ,java-hamcrest-core)))
6675 (home-page "https://commons.apache.org/net/")
6676 (synopsis "Client library for many basic Internet protocols")
6677 (description "The Apache Commons Net library implements the client side of
6678 many basic Internet protocols. The purpose of the library is to provide
6679 fundamental protocol access, not higher-level abstractions.")
6680 (license license:asl2.0)))
6681
6682 (define-public java-jsch
6683 (package
6684 (name "java-jsch")
6685 (version "0.1.55")
6686 (source (origin
6687 (method url-fetch)
6688 (uri (string-append "mirror://sourceforge/jsch/jsch/"
6689 version "/jsch-" version ".zip"))
6690 (sha256
6691 (base32
6692 "1lxyjwvmwa723wcf3bqn816hkvc03vz4xhbsi7bvfhrz2rpgcfq6"))))
6693 (build-system ant-build-system)
6694 (arguments
6695 `(#:build-target "dist"
6696 #:tests? #f ; no tests included
6697 #:phases
6698 (modify-phases %standard-phases
6699 (replace 'install (install-jars "dist")))))
6700 (native-inputs
6701 `(("unzip" ,unzip)))
6702 (home-page "http://www.jcraft.com/jsch/")
6703 (synopsis "Pure Java implementation of SSH2")
6704 (description "JSch is a pure Java implementation of SSH2. JSch allows you
6705 to connect to an SSH server and use port forwarding, X11 forwarding, file
6706 transfer, etc., and you can integrate its functionality into your own Java
6707 programs.")
6708 (license license:bsd-3)))
6709
6710 (define-public java-commons-compress
6711 (package
6712 (name "java-commons-compress")
6713 (version "1.13")
6714 (source (origin
6715 (method url-fetch)
6716 (uri (string-append "mirror://apache/commons/compress/source/"
6717 "commons-compress-" version "-src.tar.gz"))
6718 (sha256
6719 (base32
6720 "1vjqvavrn0babffn1kciz6v52ibwq2vwhzlb95hazis3lgllnxc8"))))
6721 (build-system ant-build-system)
6722 (arguments
6723 `(#:jar-name "commons-compress.jar"
6724 #:phases
6725 (modify-phases %standard-phases
6726 (add-after 'unpack 'delete-bad-tests
6727 (lambda _
6728 (with-directory-excursion "src/test/java/org/apache/commons/compress/"
6729 ;; FIXME: These tests really should not fail. Maybe they are
6730 ;; indicative of problems with our Java packaging work.
6731
6732 ;; This test fails with a null pointer exception.
6733 (delete-file "archivers/sevenz/SevenZOutputFileTest.java")
6734 ;; This test fails to open test resources.
6735 (delete-file "archivers/zip/ExplodeSupportTest.java")
6736
6737 ;; FIXME: This test adds a dependency on powermock, which is hard to
6738 ;; package at this point.
6739 ;; https://github.com/powermock/powermock
6740 (delete-file "archivers/sevenz/SevenZNativeHeapTest.java"))
6741 #t))
6742 (replace 'install (install-from-pom "pom.xml")))))
6743 (propagated-inputs
6744 `(("java-xz" ,java-xz)
6745 ("apache-commons-parent-pom" ,apache-commons-parent-pom-41)))
6746 (native-inputs
6747 `(("java-junit" ,java-junit)
6748 ("java-mockito" ,java-mockito-1)))
6749 (home-page "https://commons.apache.org/proper/commons-compress/")
6750 (synopsis "Java library for working with compressed files")
6751 (description "The Apache Commons Compress library defines an API for
6752 working with compressed files such as ar, cpio, Unix dump, tar, zip, gzip, XZ,
6753 Pack200, bzip2, 7z, arj, lzma, snappy, DEFLATE, lz4 and Z files.")
6754 (license license:asl2.0)))
6755
6756 (define-public java-commons-csv
6757 (package
6758 (name "java-commons-csv")
6759 (version "1.4")
6760 (source (origin
6761 (method url-fetch)
6762 (uri (string-append "mirror://apache/commons/csv/source/"
6763 "commons-csv-" version "-src.tar.gz"))
6764 (sha256
6765 (base32
6766 "1l89m0fm2s3xx3v3iynvangymfg2vlyngaj6fgsi457nmsw7m7ij"))))
6767 (build-system ant-build-system)
6768 (arguments
6769 `(#:jar-name "commons-csv.jar"
6770 #:source-dir "src/main/java"
6771 #:tests? #f)); FIXME: requires java-h2
6772 (inputs
6773 `(("java-hamcrest-core" ,java-hamcrest-core)
6774 ("java-commons-io" ,java-commons-io)
6775 ("java-commons-lang3" ,java-commons-lang3)
6776 ("junit" ,java-junit)))
6777 (home-page "https://commons.apache.org/proper/commons-csv/")
6778 (synopsis "Read and write CSV documents")
6779 (description "Commons CSV reads and writes files in variations of the Comma
6780 Separated Value (CSV) format. The most common CSV formats are predefined in the
6781 CSVFormat class:
6782
6783 @itemize
6784 @item Microsoft Excel
6785 @item Informix UNLOAD
6786 @item Informix UNLOAD CSV
6787 @item MySQL
6788 @item RFC 4180
6789 @item TDF
6790 @end itemize
6791
6792 Custom formats can be created using a fluent style API.")
6793 (license license:asl2.0)))
6794
6795 (define-public java-osgi-annotation
6796 (package
6797 (name "java-osgi-annotation")
6798 (version "6.0.0")
6799 (source (origin
6800 (method url-fetch)
6801 (uri (string-append "https://repo1.maven.org/maven2/"
6802 "org/osgi/org.osgi.annotation/" version "/"
6803 "org.osgi.annotation-" version "-sources.jar"))
6804 (sha256
6805 (base32
6806 "1q718mb7gqg726rh6pc2hcisn8v50nv35abbir0jypmffhiii85w"))))
6807 (build-system ant-build-system)
6808 (arguments
6809 `(#:tests? #f ; no tests
6810 #:jar-name "osgi-annotation.jar"))
6811 (home-page "https://www.osgi.org")
6812 (synopsis "Annotation module of OSGi framework")
6813 (description
6814 "OSGi, for Open Services Gateway initiative framework, is a module system
6815 and service platform for the Java programming language. This package contains
6816 the OSGi annotation module, providing additional services to help dynamic
6817 components.")
6818 (license license:asl2.0)))
6819
6820 (define-public java-osgi-core
6821 (package
6822 (name "java-osgi-core")
6823 (version "6.0.0")
6824 (source (origin
6825 (method url-fetch)
6826 (uri (string-append "https://repo1.maven.org/maven2/"
6827 "org/osgi/org.osgi.core/" version "/"
6828 "org.osgi.core-" version "-sources.jar"))
6829 (sha256
6830 (base32
6831 "19bpf5jx32jq9789gyhin35q5v7flmw0p9mk7wbgqpxqfmxyiabv"))))
6832 (build-system ant-build-system)
6833 (arguments
6834 `(#:tests? #f ; no tests
6835 #:jar-name "osgi-core.jar"))
6836 (inputs
6837 `(("java-osgi-annotation" ,java-osgi-annotation)))
6838 (home-page "https://www.osgi.org")
6839 (synopsis "Core module of OSGi framework")
6840 (description
6841 "OSGi, for Open Services Gateway initiative framework, is a module system
6842 and service platform for the Java programming language. This package contains
6843 the OSGi Core module.")
6844 (license license:asl2.0)))
6845
6846 (define-public java-osgi-service-event
6847 (package
6848 (name "java-osgi-service-event")
6849 (version "1.3.1")
6850 (source (origin
6851 (method url-fetch)
6852 (uri (string-append "https://repo1.maven.org/maven2/"
6853 "org/osgi/org.osgi.service.event/"
6854 version "/org.osgi.service.event-"
6855 version "-sources.jar"))
6856 (sha256
6857 (base32
6858 "1nyhlgagwym75bycnjczwbnpymv2iw84zbhvvzk84g9q736i6qxm"))))
6859 (build-system ant-build-system)
6860 (arguments
6861 `(#:tests? #f ; no tests
6862 #:jar-name "osgi-service-event.jar"))
6863 (inputs
6864 `(("java-osgi-annotation" ,java-osgi-annotation)
6865 ("java-osgi-core" ,java-osgi-core)))
6866 (home-page "https://www.osgi.org")
6867 (synopsis "OSGi service event module")
6868 (description
6869 "OSGi, for Open Services Gateway initiative framework, is a module system
6870 and service platform for the Java programming language. This package contains
6871 the OSGi @code{org.osgi.service.event} module.")
6872 (license license:asl2.0)))
6873
6874 (define-public java-eclipse-osgi
6875 (package
6876 (name "java-eclipse-osgi")
6877 (version "3.11.3")
6878 (source (origin
6879 (method url-fetch)
6880 (uri (string-append "https://repo1.maven.org/maven2/"
6881 "org/eclipse/platform/org.eclipse.osgi/"
6882 version "/org.eclipse.osgi-"
6883 version "-sources.jar"))
6884 (sha256
6885 (base32
6886 "00cqc6lb29n0zv68b4l842vzkwawvbr7gshfdygsk8sicvcq2c7b"))))
6887 (build-system ant-build-system)
6888 (arguments
6889 `(#:tests? #f ; no tests included
6890 #:jar-name "eclipse-equinox-osgi.jar"))
6891 (inputs
6892 `(("java-osgi-annotation" ,java-osgi-annotation)))
6893 (home-page "http://www.eclipse.org/equinox/")
6894 (synopsis "Eclipse Equinox OSGi framework")
6895 (description "This package provides an implementation of the OSGi Core
6896 specification.")
6897 (license license:epl1.0)))
6898
6899 (define-public java-eclipse-equinox-common
6900 (package
6901 (name "java-eclipse-equinox-common")
6902 (version "3.10.200")
6903 (source (origin
6904 (method url-fetch)
6905 (uri (string-append "https://repo1.maven.org/maven2/"
6906 "org/eclipse/platform/org.eclipse.equinox.common/"
6907 version "/org.eclipse.equinox.common-"
6908 version "-sources.jar"))
6909 (sha256
6910 (base32
6911 "1yn8ij6xsljlf35sr2l7wvyvc0ss4n1rv0ry5zkgb49dj4hyrqrj"))))
6912 (build-system ant-build-system)
6913 (arguments
6914 `(#:tests? #f ; no tests included
6915 #:jar-name "eclipse-equinox-common.jar"))
6916 (inputs
6917 `(("java-eclipse-osgi" ,java-eclipse-osgi)))
6918 (home-page "http://www.eclipse.org/equinox/")
6919 (synopsis "Common Eclipse runtime")
6920 (description "This package provides the common Eclipse runtime.")
6921 (license license:epl1.0)))
6922
6923 (define-public java-eclipse-core-jobs
6924 (package
6925 (name "java-eclipse-core-jobs")
6926 (version "3.8.0")
6927 (source (origin
6928 (method url-fetch)
6929 (uri (string-append "https://repo1.maven.org/maven2/"
6930 "org/eclipse/platform/org.eclipse.core.jobs/"
6931 version "/org.eclipse.core.jobs-"
6932 version "-sources.jar"))
6933 (sha256
6934 (base32
6935 "0395b8lh0km8vhzjnchvs1rii1qz48hyvb2wqfaq4yhklbwihq4b"))))
6936 (build-system ant-build-system)
6937 (arguments
6938 `(#:tests? #f ; no tests included
6939 #:jar-name "eclipse-core-jobs.jar"))
6940 (inputs
6941 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
6942 ("java-eclipse-osgi" ,java-eclipse-osgi)))
6943 (home-page "http://www.eclipse.org/equinox/")
6944 (synopsis "Eclipse jobs mechanism")
6945 (description "This package provides the Eclipse jobs mechanism.")
6946 (license license:epl1.0)))
6947
6948 (define-public java-eclipse-equinox-registry
6949 (package
6950 (name "java-eclipse-equinox-registry")
6951 (version "3.6.100")
6952 (source (origin
6953 (method url-fetch)
6954 (uri (string-append "https://repo1.maven.org/maven2/"
6955 "org/eclipse/platform/org.eclipse.equinox.registry/"
6956 version "/org.eclipse.equinox.registry-"
6957 version "-sources.jar"))
6958 (sha256
6959 (base32
6960 "1i9sgymh2fy5vdgk5y7s3qvrlbgh4l93ddqi3v4zmca7hwrlhf9k"))))
6961 (build-system ant-build-system)
6962 (arguments
6963 `(#:tests? #f ; no tests included
6964 #:jar-name "eclipse-equinox-registry.jar"))
6965 (inputs
6966 `(("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
6967 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
6968 ("java-eclipse-osgi" ,java-eclipse-osgi)))
6969 (home-page "http://www.eclipse.org/equinox/")
6970 (synopsis "Eclipse extension registry support")
6971 (description "This package provides support for the Eclipse extension
6972 registry.")
6973 (license license:epl1.0)))
6974
6975 (define-public java-eclipse-equinox-app
6976 (package
6977 (name "java-eclipse-equinox-app")
6978 (version "1.3.400")
6979 (source (origin
6980 (method url-fetch)
6981 (uri (string-append "https://repo1.maven.org/maven2/"
6982 "org/eclipse/platform/org.eclipse.equinox.app/"
6983 version "/org.eclipse.equinox.app-"
6984 version "-sources.jar"))
6985 (sha256
6986 (base32
6987 "0nhvbp93y203ar7y59gb0mz3w2d3jlqhr0c9hii9bcfpmr7imdab"))))
6988 (build-system ant-build-system)
6989 (arguments
6990 `(#:tests? #f ; no tests included
6991 #:jar-name "eclipse-equinox-app.jar"))
6992 (inputs
6993 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
6994 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
6995 ("java-eclipse-osgi" ,java-eclipse-osgi)
6996 ("java-osgi-service-event" ,java-osgi-service-event)))
6997 (home-page "http://www.eclipse.org/equinox/")
6998 (synopsis "Equinox application container")
6999 (description "This package provides the Equinox application container for
7000 Eclipse.")
7001 (license license:epl1.0)))
7002
7003 (define-public java-eclipse-equinox-preferences
7004 (package
7005 (name "java-eclipse-equinox-preferences")
7006 (version "3.6.1")
7007 (source (origin
7008 (method url-fetch)
7009 (uri (string-append "https://repo1.maven.org/maven2/"
7010 "org/eclipse/platform/org.eclipse.equinox.preferences/"
7011 version "/org.eclipse.equinox.preferences-"
7012 version "-sources.jar"))
7013 (sha256
7014 (base32
7015 "0k7w6c141sqym4fy3af0qkwpy4pdh2vsjpjba6rp5fxyqa24v0a2"))))
7016 (build-system ant-build-system)
7017 (arguments
7018 `(#:tests? #f ; no tests included
7019 #:jar-name "eclipse-equinox-preferences.jar"))
7020 (inputs
7021 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7022 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7023 ("java-eclipse-osgi" ,java-eclipse-osgi)))
7024 (home-page "http://www.eclipse.org/equinox/")
7025 (synopsis "Eclipse preferences mechanism")
7026 (description "This package provides the Eclipse preferences mechanism with
7027 the module @code{org.eclipse.equinox.preferences}.")
7028 (license license:epl1.0)))
7029
7030 (define-public java-eclipse-core-contenttype
7031 (package
7032 (name "java-eclipse-core-contenttype")
7033 (version "3.5.100")
7034 (source (origin
7035 (method url-fetch)
7036 (uri (string-append "https://repo1.maven.org/maven2/"
7037 "org/eclipse/platform/org.eclipse.core.contenttype/"
7038 version "/org.eclipse.core.contenttype-"
7039 version "-sources.jar"))
7040 (sha256
7041 (base32
7042 "1wcqcv7ijwv5rh748vz3x9pkmjl9w1r0k0026k56n8yjl4rrmspi"))))
7043 (build-system ant-build-system)
7044 (arguments
7045 `(#:tests? #f ; no tests included
7046 #:jar-name "eclipse-core-contenttype.jar"))
7047 (inputs
7048 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7049 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
7050 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7051 ("java-eclipse-osgi" ,java-eclipse-osgi)))
7052 (home-page "http://www.eclipse.org/")
7053 (synopsis "Eclipse content mechanism")
7054 (description "This package provides the Eclipse content mechanism in the
7055 @code{org.eclipse.core.contenttype} module.")
7056 (license license:epl1.0)))
7057
7058 (define-public java-eclipse-core-runtime
7059 (package
7060 (name "java-eclipse-core-runtime")
7061 (version "3.15.100")
7062 (source (origin
7063 (method url-fetch)
7064 (uri (string-append "https://repo1.maven.org/maven2/"
7065 "org/eclipse/platform/org.eclipse.core.runtime/"
7066 version "/org.eclipse.core.runtime-"
7067 version "-sources.jar"))
7068 (sha256
7069 (base32
7070 "0l8xayacsbjvz5hypx2fv47vpw2n4dspamcfb3hx30x9hj8vmg7r"))))
7071 (build-system ant-build-system)
7072 (arguments
7073 `(#:tests? #f ; no tests included
7074 #:jar-name "eclipse-core-runtime.jar"))
7075 (inputs
7076 `(("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
7077 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
7078 ("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
7079 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7080 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7081 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
7082 ("java-eclipse-osgi" ,java-eclipse-osgi)))
7083 (home-page "https://www.eclipse.org/")
7084 (synopsis "Eclipse core runtime")
7085 (description "This package provides the Eclipse core runtime with the
7086 module @code{org.eclipse.core.runtime}.")
7087 (license license:epl1.0)))
7088
7089 (define-public java-eclipse-core-filesystem
7090 (package
7091 (name "java-eclipse-core-filesystem")
7092 (version "1.6.1")
7093 (source (origin
7094 (method url-fetch)
7095 (uri (string-append "https://repo1.maven.org/maven2/"
7096 "org/eclipse/platform/org.eclipse.core.filesystem/"
7097 version "/org.eclipse.core.filesystem-"
7098 version "-sources.jar"))
7099 (sha256
7100 (base32
7101 "0km1bhwjim4rfy3pkvjhvy31kgsyf2ncx0mlkmbf5n6g57pphdyj"))))
7102 (build-system ant-build-system)
7103 (arguments
7104 `(#:tests? #f ; no tests included
7105 #:jar-name "eclipse-core-filesystem.jar"))
7106 (inputs
7107 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7108 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7109 ("java-eclipse-osgi" ,java-eclipse-osgi)))
7110 (home-page "https://www.eclipse.org/")
7111 (synopsis "Eclipse core file system")
7112 (description "This package provides the Eclipse core file system with the
7113 module @code{org.eclipse.core.filesystem}.")
7114 (license license:epl1.0)))
7115
7116 (define-public java-eclipse-core-expressions
7117 (package
7118 (name "java-eclipse-core-expressions")
7119 (version "3.5.100")
7120 (source (origin
7121 (method url-fetch)
7122 (uri (string-append "https://repo1.maven.org/maven2/"
7123 "org/eclipse/platform/org.eclipse.core.expressions/"
7124 version "/org.eclipse.core.expressions-"
7125 version "-sources.jar"))
7126 (sha256
7127 (base32
7128 "18bw2l875gmygvpagpgk9l24qzbdjia4ag12nw6fi8v8yaq4987f"))))
7129 (build-system ant-build-system)
7130 (arguments
7131 `(#:tests? #f ; no tests included
7132 #:jar-name "eclipse-core-expressions.jar"))
7133 (inputs
7134 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7135 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7136 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
7137 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
7138 ("java-eclipse-osgi" ,java-eclipse-osgi)))
7139 (home-page "https://www.eclipse.org/")
7140 (synopsis "Eclipse core expression language")
7141 (description "This package provides the Eclipse core expression language
7142 with the @code{org.eclipse.core.expressions} module.")
7143 (license license:epl1.0)))
7144
7145 (define-public java-eclipse-core-variables
7146 (package
7147 (name "java-eclipse-core-variables")
7148 (version "3.3.0")
7149 (source (origin
7150 (method url-fetch)
7151 (uri (string-append "https://repo1.maven.org/maven2/"
7152 "org/eclipse/platform/org.eclipse.core.variables/"
7153 version "/org.eclipse.core.variables-"
7154 version "-sources.jar"))
7155 (sha256
7156 (base32
7157 "12dirh03zi4n5x5cj07vzrhkmnqy6h9q10h9j605pagmpmifyxmy"))))
7158 (build-system ant-build-system)
7159 (arguments
7160 `(#:tests? #f ; no tests included
7161 #:jar-name "eclipse-core-variables.jar"))
7162 (inputs
7163 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7164 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7165 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
7166 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
7167 ("java-eclipse-osgi" ,java-eclipse-osgi)))
7168 (home-page "https://www.eclipse.org/platform")
7169 (synopsis "Eclipse core variables")
7170 (description "This package provides the Eclipse core variables module
7171 @code{org.eclipse.core.variables}.")
7172 (license license:epl1.0)))
7173
7174 (define-public java-eclipse-ant-core
7175 (package
7176 (name "java-eclipse-ant-core")
7177 (version "3.4.100")
7178 (source (origin
7179 (method url-fetch)
7180 (uri (string-append "https://repo1.maven.org/maven2/"
7181 "org/eclipse/platform/org.eclipse.ant.core/"
7182 version "/org.eclipse.ant.core-"
7183 version "-sources.jar"))
7184 (sha256
7185 (base32
7186 "11g3if794qjlk98mz9zch22rr56sd7z63vn4i7k2icr8cq5bfqg7"))))
7187 (build-system ant-build-system)
7188 (arguments
7189 `(#:tests? #f ; no tests included
7190 #:jar-name "eclipse-ant-core.jar"))
7191 (inputs
7192 `(("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
7193 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7194 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7195 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
7196 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
7197 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
7198 ("java-eclipse-core-variables" ,java-eclipse-core-variables)
7199 ("java-eclipse-osgi" ,java-eclipse-osgi)))
7200 (home-page "https://www.eclipse.org/platform")
7201 (synopsis "Ant build tool core libraries")
7202 (description "This package provides the ant build tool core libraries with
7203 the module @code{org.eclipse.ant.core}.")
7204 (license license:epl1.0)))
7205
7206 (define-public java-eclipse-core-resources
7207 (package
7208 (name "java-eclipse-core-resources")
7209 (version "3.13.200")
7210 (source (origin
7211 (method url-fetch)
7212 (uri (string-append "https://repo1.maven.org/maven2/"
7213 "org/eclipse/platform/org.eclipse.core.resources/"
7214 version "/org.eclipse.core.resources-"
7215 version "-sources.jar"))
7216 (sha256
7217 (base32
7218 "1sn3b6ky72hkvxcgf9b2jkpbdh3y8lbhi9xxwv1dsiddpkkq91hs"))))
7219 (build-system ant-build-system)
7220 (arguments
7221 `(#:tests? #f ; no tests included
7222 #:jar-name "eclipse-core-resources.jar"))
7223 (inputs
7224 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7225 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
7226 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7227 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
7228 ("java-eclipse-core-expressions" ,java-eclipse-core-expressions)
7229 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
7230 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
7231 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
7232 ("java-eclipse-ant-core" ,java-eclipse-ant-core)
7233 ("java-eclipse-osgi" ,java-eclipse-osgi)))
7234 (home-page "https://www.eclipse.org/")
7235 (synopsis "Eclipse core resource management")
7236 (description "This package provides the Eclipse core resource management
7237 module @code{org.eclipse.core.resources}.")
7238 (license license:epl1.0)))
7239
7240 (define-public java-eclipse-compare-core
7241 (package
7242 (name "java-eclipse-compare-core")
7243 (version "3.6.0")
7244 (source (origin
7245 (method url-fetch)
7246 (uri (string-append "https://repo1.maven.org/maven2/"
7247 "org/eclipse/platform/org.eclipse.compare.core/"
7248 version "/org.eclipse.compare.core-"
7249 version "-sources.jar"))
7250 (sha256
7251 (base32
7252 "10g37r0pbiffyv2wk35c6g5lwzkdipkl0kkjp41v84dln46xm4dg"))))
7253 (build-system ant-build-system)
7254 (arguments
7255 `(#:tests? #f ; no tests included
7256 #:jar-name "eclipse-compare-core.jar"))
7257 (inputs
7258 `(("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
7259 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7260 ("java-eclipse-osgi" ,java-eclipse-osgi)
7261 ("java-icu4j" ,java-icu4j)))
7262 (home-page "https://www.eclipse.org/")
7263 (synopsis "Eclipse core compare support")
7264 (description "This package provides the Eclipse core compare support
7265 module @code{org.eclipse.compare.core}.")
7266 (license license:epl1.0)))
7267
7268 (define-public java-eclipse-team-core
7269 (package
7270 (name "java-eclipse-team-core")
7271 (version "3.8.0")
7272 (source (origin
7273 (method url-fetch)
7274 (uri (string-append "https://repo1.maven.org/maven2/"
7275 "org/eclipse/platform/org.eclipse.team.core/"
7276 version "/org.eclipse.team.core-"
7277 version "-sources.jar"))
7278 (sha256
7279 (base32
7280 "02j2jzqgb26zx2d5ahxmvijw6j4r0la90zl5c3i65x6z19ciyam7"))))
7281 (build-system ant-build-system)
7282 (arguments
7283 `(#:tests? #f ; no tests included
7284 #:jar-name "eclipse-team-core.jar"))
7285 (inputs
7286 `(("java-eclipse-compare-core" ,java-eclipse-compare-core)
7287 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
7288 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
7289 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
7290 ("java-eclipse-core-resources" ,java-eclipse-core-resources)
7291 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
7292 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7293 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7294 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
7295 ("java-eclipse-osgi" ,java-eclipse-osgi)))
7296 (home-page "https://www.eclipse.org/platform")
7297 (synopsis "Eclipse team support core")
7298 (description "This package provides the Eclipse team support core module
7299 @code{org.eclipse.team.core}.")
7300 (license license:epl1.0)))
7301
7302 (define-public java-eclipse-core-commands
7303 (package
7304 (name "java-eclipse-core-commands")
7305 (version "3.8.1")
7306 (source (origin
7307 (method url-fetch)
7308 (uri (string-append "https://repo1.maven.org/maven2/"
7309 "org/eclipse/platform/org.eclipse.core.commands/"
7310 version "/org.eclipse.core.commands-"
7311 version "-sources.jar"))
7312 (sha256
7313 (base32
7314 "0yjn482qndcfrsq3jd6vnhcylp16420f5aqkrwr8spsprjigjcr9"))))
7315 (build-system ant-build-system)
7316 (arguments
7317 `(#:tests? #f ; no tests included
7318 #:jar-name "eclipse-core-commands.jar"))
7319 (inputs
7320 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)))
7321 (home-page "https://www.eclipse.org/platform")
7322 (synopsis "Eclipse core commands")
7323 (description "This package provides Eclipse core commands in the module
7324 @code{org.eclipse.core.commands}.")
7325 (license license:epl1.0)))
7326
7327 (define-public java-eclipse-text
7328 (package
7329 (name "java-eclipse-text")
7330 (version "3.6.0")
7331 (source (origin
7332 (method url-fetch)
7333 (uri (string-append "https://repo1.maven.org/maven2/"
7334 "org/eclipse/platform/org.eclipse.text/"
7335 version "/org.eclipse.text-"
7336 version "-sources.jar"))
7337 (sha256
7338 (base32
7339 "0scz70vzz5qs5caji9f5q01vkqnvip7dpri1q07l8wbbdcxn4cq1"))))
7340 (build-system ant-build-system)
7341 (arguments
7342 `(#:tests? #f ; no tests included
7343 #:jar-name "eclipse-text.jar"
7344 #:phases
7345 (modify-phases %standard-phases
7346 ;; When creating a new category we must make sure that the new list
7347 ;; matches List<Position>. By default it seems to be too generic
7348 ;; (ArrayList<Object>), so we specialize it to ArrayList<Position>.
7349 ;; Without this we get this error:
7350 ;;
7351 ;; [javac] .../src/org/eclipse/jface/text/AbstractDocument.java:376:
7352 ;; error: method put in interface Map<K,V> cannot be applied to given types;
7353 ;; [javac] fPositions.put(category, new ArrayList<>());
7354 ;; [javac] ^
7355 ;; [javac] required: String,List<Position>
7356 ;; [javac] found: String,ArrayList<Object>
7357 ;; [javac] reason: actual argument ArrayList<Object> cannot be converted
7358 ;; to List<Position> by method invocation conversion
7359 ;; [javac] where K,V are type-variables:
7360 ;; [javac] K extends Object declared in interface Map
7361 ;; [javac] V extends Object declared in interface Map
7362 ;;
7363 ;; I don't know if this is a good fix. I suspect it is not, but it
7364 ;; seems to work.
7365 (add-after 'unpack 'fix-compilation-error
7366 (lambda _
7367 (substitute* "src/org/eclipse/jface/text/AbstractDocument.java"
7368 (("Positions.put\\(category, new ArrayList<>\\(\\)\\);")
7369 "Positions.put(category, new ArrayList<Position>());"))
7370 #t)))))
7371 (inputs
7372 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7373 ("java-eclipse-core-commands" ,java-eclipse-core-commands)
7374 ("java-icu4j" ,java-icu4j)))
7375 (home-page "http://www.eclipse.org/platform")
7376 (synopsis "Eclipse text library")
7377 (description "Platform Text is part of the Platform UI project and
7378 provides the basic building blocks for text and text editors within Eclipse
7379 and contributes the Eclipse default text editor.")
7380 (license license:epl1.0)))
7381
7382 (define-public java-eclipse-jdt-core
7383 (package
7384 (name "java-eclipse-jdt-core")
7385 (version "3.16.0")
7386 (source (origin
7387 (method url-fetch)
7388 (uri (string-append "https://repo1.maven.org/maven2/"
7389 "org/eclipse/jdt/org.eclipse.jdt.core/"
7390 version "/org.eclipse.jdt.core-"
7391 version "-sources.jar"))
7392 (sha256
7393 (base32
7394 "1g560yr9v2kzv34gc2m3ifpgnj7krcdd6h4gd4z83pwqacwkfz0k"))))
7395 (build-system ant-build-system)
7396 (arguments
7397 `(#:tests? #f ; no tests included
7398 #:jar-name "eclipse-jdt-core.jar"
7399 #:phases
7400 (modify-phases %standard-phases
7401 (add-after 'unpack 'move-sources
7402 (lambda _
7403 (with-directory-excursion "src/jdtCompilerAdaptersrc/"
7404 (for-each (lambda (file)
7405 (install-file file (string-append "../" (dirname file))))
7406 (find-files "." ".*")))
7407 (delete-file-recursively "src/jdtCompilerAdaptersrc/")
7408 #t))
7409 (add-before 'build 'copy-resources
7410 (lambda _
7411 (with-directory-excursion "src"
7412 (for-each (lambda (file)
7413 (install-file file (string-append "../build/classes/" (dirname file))))
7414 (find-files "." ".*.(props|properties|rsc)")))
7415 #t)))))
7416 (inputs
7417 `(("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
7418 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
7419 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
7420 ("java-eclipse-core-resources" ,java-eclipse-core-resources)
7421 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
7422 ("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
7423 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7424 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
7425 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7426 ("java-eclipse-osgi" ,java-eclipse-osgi)
7427 ("java-eclipse-text" ,java-eclipse-text)))
7428 (home-page "https://www.eclipse.org/jdt")
7429 (synopsis "Java development tools core libraries")
7430 (description "This package provides the core libraries of the Eclipse Java
7431 development tools.")
7432 (license license:epl1.0)))
7433
7434 (define-public java-eclipse-jdt-compiler-apt
7435 (package
7436 (name "java-eclipse-jdt-compiler-apt")
7437 (version "1.3.400")
7438 (source (origin
7439 (method url-fetch)
7440 (uri (string-append "https://repo1.maven.org/maven2/"
7441 "org/eclipse/jdt/org.eclipse.jdt.compiler.apt/"
7442 version "/org.eclipse.jdt.compiler.apt-"
7443 version "-sources.jar"))
7444 (sha256
7445 (base32
7446 "1s285k9p2ixdqrknb40jbbvw682n9a7l5lqpn583a8pvlzg2l6r8"))))
7447 (build-system ant-build-system)
7448 (arguments
7449 `(#:tests? #f ; no tests included
7450 #:jar-name "eclipse-jdt-compiler-apt.jar"
7451 #:jdk ,openjdk11))
7452 (inputs
7453 `(("java-eclipse-jdt-core" ,java-eclipse-jdt-core)))
7454 (home-page "https://www.eclipse.org/jdt/apt/")
7455 (synopsis "Annotation processing tool")
7456 (description "APT stands for Annotation Processing Tool. APT provides a
7457 means for generating files and compiling new Java classes based on annotations
7458 found in your source code.")
7459 (license license:epl2.0)))
7460
7461 (define-public java-javax-mail
7462 (package
7463 (name "java-javax-mail")
7464 (version "1.5.6")
7465 (source (origin
7466 (method url-fetch)
7467 (uri (string-append "https://repo1.maven.org/maven2/"
7468 "com/sun/mail/javax.mail/"
7469 version "/javax.mail-"
7470 version "-sources.jar"))
7471 (sha256
7472 (base32
7473 "0sdlfgsc2b5s89xv1261y8i0jijcja019k2x1c8ngfn582w4jly9"))))
7474 (build-system ant-build-system)
7475 (arguments
7476 `(#:tests? #f ; no tests
7477 #:jar-name "javax-mail.jar"))
7478 (home-page "https://javamail.java.net")
7479 (synopsis "Reference implementation of the JavaMail API")
7480 (description
7481 "This package provides versions of the JavaMail API implementation, IMAP,
7482 SMTP, and POP3 service providers, some examples, and documentation for the
7483 JavaMail API.")
7484 ;; GPLv2 only with "classpath exception".
7485 (license license:gpl2)))
7486
7487 (define-public java-log4j-api
7488 (package
7489 (name "java-log4j-api")
7490 (version "2.4.1")
7491 (source (origin
7492 (method url-fetch)
7493 (uri (string-append "mirror://apache/logging/log4j/" version
7494 "/apache-log4j-" version "-src.tar.gz"))
7495 (sha256
7496 (base32
7497 "0j5p9gik0jysh37nlrckqbky12isy95cpwg2gv5fas1rcdqbraxd"))))
7498 (build-system ant-build-system)
7499 (arguments
7500 `(#:tests? #f ; tests require unpackaged software
7501 #:jar-name "log4j-api.jar"
7502 #:make-flags
7503 (list (string-append "-Ddist.dir=" (assoc-ref %outputs "out")
7504 "/share/java"))
7505 #:phases
7506 (modify-phases %standard-phases
7507 (add-after 'unpack 'enter-dir
7508 (lambda _ (chdir "log4j-api") #t))
7509 ;; FIXME: The tests require additional software that has not been
7510 ;; packaged yet, such as
7511 ;; * org.apache.maven
7512 ;; * org.apache.felix
7513 (add-after 'enter-dir 'delete-tests
7514 (lambda _ (delete-file-recursively "src/test") #t)))))
7515 (inputs
7516 `(("java-osgi-core" ,java-osgi-core)
7517 ("java-hamcrest-core" ,java-hamcrest-core)
7518 ("java-junit" ,java-junit)))
7519 (home-page "https://logging.apache.org/log4j/2.x/")
7520 (synopsis "API module of the Log4j logging framework for Java")
7521 (description
7522 "This package provides the API module of the Log4j logging framework for
7523 Java.")
7524 (license license:asl2.0)))
7525
7526 (define-public java-log4j-core
7527 (package
7528 (inherit java-log4j-api)
7529 (name "java-log4j-core")
7530 (inputs
7531 `(("java-osgi-core" ,java-osgi-core)
7532 ("java-hamcrest-core" ,java-hamcrest-core)
7533 ("java-log4j-api" ,java-log4j-api)
7534 ("java-mail" ,java-mail)
7535 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
7536 ("java-lmax-disruptor" ,java-lmax-disruptor)
7537 ("java-kafka" ,java-kafka-clients)
7538 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
7539 ("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
7540 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
7541 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
7542 ("java-fasterxml-jackson-dataformat-xml" ,java-fasterxml-jackson-dataformat-xml)
7543 ("java-fasterxml-jackson-dataformat-yaml" ,java-fasterxml-jackson-dataformat-yaml)
7544 ("java-commons-compress" ,java-commons-compress)
7545 ("java-commons-csv" ,java-commons-csv)
7546 ("java-jeromq" ,java-jeromq)
7547 ("java-junit" ,java-junit)))
7548 (native-inputs
7549 `(("hamcrest" ,java-hamcrest-all)
7550 ("java-commons-io" ,java-commons-io)
7551 ("java-commons-lang3" ,java-commons-lang3)
7552 ("slf4j" ,java-slf4j-api)))
7553 (arguments
7554 `(#:tests? #f ; tests require more dependencies
7555 #:test-dir "src/test"
7556 #:source-dir "src/main/java"
7557 #:jar-name "log4j-core.jar"
7558 #:jdk ,icedtea-8
7559 #:make-flags
7560 (list (string-append "-Ddist.dir=" (assoc-ref %outputs "out")
7561 "/share/java"))
7562 #:phases
7563 (modify-phases %standard-phases
7564 (add-after 'unpack 'enter-dir
7565 (lambda _ (chdir "log4j-core") #t)))))
7566 (synopsis "Core component of the Log4j framework")
7567 (description "This package provides the core component of the Log4j
7568 logging framework for Java.")))
7569
7570 (define-public java-log4j-1.2-api
7571 (package
7572 (inherit java-log4j-api)
7573 (name "java-log4j-1.2-api")
7574 (arguments
7575 `(#:jar-name "java-log4j-1.2-api.jar"
7576 #:source-dir "log4j-1.2-api/src/main/java"
7577 #:jdk ,icedtea-8
7578 ;; Tests require maven-model (and other maven subprojects), which is a
7579 ;; cyclic dependency.
7580 #:tests? #f))
7581 (inputs
7582 `(("log4j-api" ,java-log4j-api)
7583 ("log4j-core" ,java-log4j-core)
7584 ("osgi-core" ,java-osgi-core)
7585 ("eclipse-osgi" ,java-eclipse-osgi)
7586 ("java-lmax-disruptor" ,java-lmax-disruptor)))))
7587
7588 (define-public java-commons-cli
7589 (package
7590 (name "java-commons-cli")
7591 (version "1.4")
7592 (source (origin
7593 (method url-fetch)
7594 (uri (string-append "mirror://apache/commons/cli/source/"
7595 "commons-cli-" version "-src.tar.gz"))
7596 (sha256
7597 (base32
7598 "05hgi2z01fqz374y719gl1dxzqvzci5af071zm7vxrjg9vczipm1"))))
7599 (build-system ant-build-system)
7600 ;; TODO: javadoc
7601 (arguments
7602 `(#:jar-name "commons-cli.jar"
7603 #:phases
7604 (modify-phases %standard-phases
7605 (replace 'install
7606 (install-from-pom "pom.xml")))))
7607 (native-inputs
7608 `(("java-junit" ,java-junit)
7609 ("java-hamcrest-core" ,java-hamcrest-core)))
7610 (home-page "https://commons.apache.org/cli/")
7611 (synopsis "Command line arguments and options parsing library")
7612 (description "The Apache Commons CLI library provides an API for parsing
7613 command line options passed to programs. It is also able to print help
7614 messages detailing the options available for a command line tool.
7615
7616 Commons CLI supports different types of options:
7617
7618 @itemize
7619 @item POSIX like options (ie. tar -zxvf foo.tar.gz)
7620 @item GNU like long options (ie. du --human-readable --max-depth=1)
7621 @item Java like properties (ie. java -Djava.awt.headless=true Foo)
7622 @item Short options with value attached (ie. gcc -O2 foo.c)
7623 @item long options with single hyphen (ie. ant -projecthelp)
7624 @end itemize
7625
7626 This is a part of the Apache Commons Project.")
7627 (license license:asl2.0)))
7628
7629 (define-public java-commons-codec
7630 (package
7631 (name "java-commons-codec")
7632 (version "1.14")
7633 (source (origin
7634 (method url-fetch)
7635 (uri (string-append "mirror://apache/commons/codec/source/"
7636 "commons-codec-" version "-src.tar.gz"))
7637 (sha256
7638 (base32
7639 "11xr0agckkhm91pb5akf2mbk84yd54gyr178wj57gsm97fi7nkh9"))))
7640 (build-system ant-build-system)
7641 (arguments
7642 `(#:jar-name "java-commons-codec.jar"
7643 #:source-dir "src/main/java"
7644 #:test-dir "src/test"
7645 #:test-exclude (list "**/*AbstractTest.java")
7646 #:phases
7647 (modify-phases %standard-phases
7648 (add-before 'build 'copy-resources
7649 (lambda _
7650 (copy-recursively "src/main/resources"
7651 "build/classes")
7652 #t))
7653 (add-before 'check 'copy-test-resources
7654 (lambda _
7655 (copy-recursively "src/test/resources"
7656 "build/test-classes")
7657 #t))
7658 (replace 'install (install-from-pom "pom.xml")))))
7659 (native-inputs
7660 `(("java-commons-lang3" ,java-commons-lang3)
7661 ("java-junit" ,java-junit)))
7662 (propagated-inputs
7663 `(("apache-commons-parent-pom" ,apache-commons-parent-pom-50)))
7664 (home-page "https://commons.apache.org/codec/")
7665 (synopsis "Common encoders and decoders such as Base64, Hex, Phonetic and URLs")
7666 (description "The codec package contains simple encoder and decoders for
7667 various formats such as Base64 and Hexadecimal. In addition to these widely
7668 used encoders and decoders, the codec package also maintains a collection of
7669 phonetic encoding utilities.
7670
7671 This is a part of the Apache Commons Project.")
7672 (license license:asl2.0)))
7673
7674 (define-public java-commons-daemon
7675 (package
7676 (name "java-commons-daemon")
7677 (version "1.1.0")
7678 (source (origin
7679 (method url-fetch)
7680 (uri (string-append "mirror://apache/commons/daemon/source/"
7681 "commons-daemon-" version "-src.tar.gz"))
7682 (sha256
7683 (base32
7684 "141gkhfzv5v3pdhic6y4ardq2dhsa3v36j8wmmhy6f8mac48fp7n"))))
7685 (build-system ant-build-system)
7686 (arguments
7687 `(#:test-target "test"
7688 #:phases
7689 (modify-phases %standard-phases
7690 (add-after 'build 'build-javadoc ant-build-javadoc)
7691 (replace 'install (install-jars "dist"))
7692 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
7693 (native-inputs
7694 `(("java-junit" ,java-junit)))
7695 (home-page "https://commons.apache.org/daemon/")
7696 (synopsis "Library to launch Java applications as daemons")
7697 (description "The Daemon package from Apache Commons can be used to
7698 implement Java applications which can be launched as daemons. For example the
7699 program will be notified about a shutdown so that it can perform cleanup tasks
7700 before its process of execution is destroyed by the operation system.
7701
7702 This package contains the Java library. You will also need the actual binary
7703 for your architecture which is provided by the jsvc package.
7704
7705 This is a part of the Apache Commons Project.")
7706 (license license:asl2.0)))
7707
7708 (define-public java-javaewah
7709 (package
7710 (name "java-javaewah")
7711 (version "1.1.6")
7712 (source (origin
7713 (method git-fetch)
7714 (uri (git-reference
7715 (url "https://github.com/lemire/javaewah/")
7716 (commit (string-append "JavaEWAH-" version))))
7717 (file-name (git-file-name name version))
7718 (sha256
7719 (base32
7720 "1m8qcb1py76v7avbjjrkvyy6fhr5dk2ywy73gbsxqry04gkm2nhw"))))
7721 (build-system ant-build-system)
7722 (arguments `(#:jar-name "javaewah.jar"))
7723 (inputs
7724 `(("java-junit" ,java-junit)
7725 ("java-hamcrest-core" ,java-hamcrest-core)))
7726 (home-page "https://github.com/lemire/javaewah")
7727 (synopsis "Compressed alternative to the Java @code{BitSet} class")
7728 (description "This is a word-aligned compressed variant of the Java
7729 @code{Bitset} class. It provides both a 64-bit and a 32-bit RLE-like
7730 compression scheme. It can be used to implement bitmap indexes.
7731
7732 The goal of word-aligned compression is not to achieve the best compression,
7733 but rather to improve query processing time. Hence, JavaEWAH tries to save CPU
7734 cycles, maybe at the expense of storage. However, the EWAH scheme is always
7735 more efficient storage-wise than an uncompressed bitmap (as implemented in the
7736 @code{BitSet} class by Sun).")
7737 ;; GPL2.0 derivates are explicitly allowed.
7738 (license license:asl2.0)))
7739
7740 (define-public java-slf4j-api
7741 (package
7742 (name "java-slf4j-api")
7743 (version "1.7.25")
7744 (source (origin
7745 (method url-fetch)
7746 (uri (string-append "https://www.slf4j.org/dist/slf4j-"
7747 version ".tar.gz"))
7748 (sha256
7749 (base32
7750 "13j51sgzmhhdrfa74gkal5zpip7r1440dh7zsi2c8bpb2zs1v8kb"))
7751 (modules '((guix build utils)))
7752 ;; Delete bundled jars.
7753 (snippet
7754 '(begin
7755 (for-each delete-file (find-files "." "\\.jar$"))
7756 #t))))
7757 (build-system ant-build-system)
7758 (arguments
7759 `(#:jar-name "slf4j-api.jar"
7760 #:source-dir "slf4j-api/src/main"
7761 #:test-dir "slf4j-api/src/test"
7762 #:phases
7763 (modify-phases %standard-phases
7764 (add-after 'build 'regenerate-jar
7765 (lambda _
7766 ;; pom.xml ignores these files in the jar creation process. If we don't,
7767 ;; we get the error "This code should have never made it into slf4j-api.jar"
7768 (delete-file-recursively "build/classes/org/slf4j/impl")
7769 (invoke "jar" "-cf" "build/jar/slf4j-api.jar" "-C"
7770 "build/classes" ".")))
7771 (add-before 'check 'dont-test-abstract-classes
7772 (lambda _
7773 ;; abstract classes are not meant to be run with junit
7774 (substitute* "build.xml"
7775 (("<include name=\"\\*\\*/\\*Test.java\" />")
7776 (string-append "<include name=\"**/*Test.java\" />"
7777 "<exclude name=\"**/MultithreadedInitializationTest"
7778 ".java\" />")))
7779 #t))
7780 (replace 'install
7781 (install-from-pom "slf4j-api/pom.xml")))))
7782 (propagated-inputs
7783 `(("java-slf4j-parent" ,java-slf4j-parent)))
7784 (native-inputs
7785 `(("java-junit" ,java-junit)
7786 ("java-hamcrest-core" ,java-hamcrest-core)))
7787 (home-page "https://www.slf4j.org/")
7788 (synopsis "Simple logging facade for Java")
7789 (description "The Simple Logging Facade for Java (SLF4J) serves as a
7790 simple facade or abstraction for various logging
7791 frameworks (e.g. @code{java.util.logging}, @code{logback}, @code{log4j})
7792 allowing the end user to plug in the desired logging framework at deployment
7793 time.")
7794 (license license:expat)))
7795
7796 (define java-slf4j-parent
7797 (package
7798 (inherit java-slf4j-api)
7799 (name "java-slf4j-parent")
7800 (native-inputs `())
7801 (propagated-inputs '())
7802 (arguments
7803 `(#:tests? #f
7804 #:phases
7805 (modify-phases %standard-phases
7806 (delete 'build)
7807 (delete 'configure)
7808 (replace 'install
7809 (install-pom-file "pom.xml")))))))
7810
7811 (define-public java-slf4j-simple
7812 (package
7813 (name "java-slf4j-simple")
7814 (version "1.7.25")
7815 (source (package-source java-slf4j-api))
7816 (build-system ant-build-system)
7817 (arguments
7818 `(#:jar-name "slf4j-simple.jar"
7819 #:source-dir "slf4j-simple/src/main"
7820 #:test-dir "slf4j-simple/src/test"
7821 #:phases
7822 (modify-phases %standard-phases
7823 ;; The tests need some test classes from slf4j-api
7824 (add-before 'check 'build-slf4j-api-test-helpers
7825 (lambda _
7826 ;; Add current dir to CLASSPATH ...
7827 (setenv "CLASSPATH"
7828 (string-append (getcwd) ":" (getenv "CLASSPATH")))
7829 ;; ... and build test helper classes here:
7830 (apply invoke
7831 `("javac" "-d" "."
7832 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
7833 (replace 'install
7834 (install-from-pom "slf4j-simple/pom.xml")))))
7835 (propagated-inputs
7836 `(("java-slf4j-api" ,java-slf4j-api)))
7837 (native-inputs
7838 `(("java-junit" ,java-junit)
7839 ("java-hamcrest-core" ,java-hamcrest-core)))
7840 (home-page "https://www.slf4j.org/")
7841 (synopsis "Simple implementation of simple logging facade for Java")
7842 (description "SLF4J binding for the Simple implementation, which outputs
7843 all events to System.err. Only messages of level INFO and higher are
7844 printed.")
7845 (license license:expat)))
7846
7847 (define-public antlr2
7848 (package
7849 (name "antlr2")
7850 (version "2.7.7")
7851 (source (origin
7852 (method url-fetch)
7853 (uri (string-append "https://www.antlr2.org/download/antlr-"
7854 version ".tar.gz"))
7855 (sha256
7856 (base32
7857 "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5"))
7858 (modules '((guix build utils)))
7859 (snippet
7860 '(begin
7861 (delete-file "antlr.jar")
7862 (substitute* "lib/cpp/antlr/CharScanner.hpp"
7863 (("#include <map>")
7864 (string-append
7865 "#include <map>\n"
7866 "#define EOF (-1)\n"
7867 "#include <strings.h>")))
7868 (substitute* "configure"
7869 (("/bin/sh") "sh"))
7870 #t))))
7871 (build-system gnu-build-system)
7872 (arguments
7873 `(#:tests? #f ; no test target
7874 #:imported-modules ((guix build ant-build-system)
7875 (guix build syscalls)
7876 ,@%gnu-build-system-modules)
7877 #:modules (((guix build ant-build-system) #:prefix ant:)
7878 (guix build gnu-build-system)
7879 (guix build utils))
7880 #:phases
7881 (modify-phases %standard-phases
7882 (add-after 'install 'strip-jar-timestamps
7883 (assoc-ref ant:%standard-phases 'strip-jar-timestamps))
7884 (add-before 'configure 'fix-timestamp
7885 (lambda _
7886 (substitute* "configure"
7887 (("^TIMESTAMP.*") "TIMESTAMP=19700101\n"))
7888 #t))
7889 (add-after 'configure 'fix-bin-ls
7890 (lambda _
7891 (substitute* (find-files "." "Makefile")
7892 (("/bin/ls") "ls"))
7893 #t)))))
7894 (native-inputs
7895 `(("which" ,which)
7896 ("zip" ,zip)
7897 ("java" ,icedtea "jdk")))
7898 (inputs
7899 `(("java" ,icedtea)))
7900 (home-page "https://www.antlr2.org")
7901 (synopsis "Framework for constructing recognizers, compilers, and translators")
7902 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
7903 is a language tool that provides a framework for constructing recognizers,
7904 compilers, and translators from grammatical descriptions containing Java, C#,
7905 C++, or Python actions. ANTLR provides excellent support for tree construction,
7906 tree walking, and translation.")
7907 (license license:public-domain)))
7908
7909 (define-public java-stringtemplate-3
7910 (package
7911 (name "java-stringtemplate")
7912 (version "3.2.1")
7913 (source (origin
7914 (method url-fetch)
7915 (uri (string-append "https://github.com/antlr/website-st4/raw/"
7916 "gh-pages/download/stringtemplate-"
7917 version ".tar.gz"))
7918 (sha256
7919 (base32
7920 "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is"))))
7921 (build-system ant-build-system)
7922 (arguments
7923 `(#:jar-name (string-append ,name "-" ,version ".jar")
7924 #:test-dir "test"
7925 #:modules ((guix build ant-build-system)
7926 (guix build utils)
7927 (srfi srfi-1))
7928 #:phases
7929 (modify-phases %standard-phases
7930 (add-before 'check 'fix-tests
7931 (lambda _
7932 (substitute* "build.xml"
7933 (("\\$\\{test.home\\}/java")
7934 "${test.home}/org"))
7935 #t))
7936 (add-before 'build 'generate-grammar
7937 (lambda _
7938 (with-directory-excursion "src/org/antlr/stringtemplate/language/"
7939 (for-each (lambda (file)
7940 (format #t "~a\n" file)
7941 (invoke "antlr" file))
7942 '("template.g" "angle.bracket.template.g" "action.g"
7943 "eval.g" "group.g" "interface.g")))
7944 #t)))))
7945 (native-inputs
7946 `(("antlr" ,antlr2)
7947 ("java-junit" ,java-junit)))
7948 (home-page "https://www.stringtemplate.org")
7949 (synopsis "Template engine to generate formatted text output")
7950 (description "StringTemplate is a java template engine (with ports for C#,
7951 Objective-C, JavaScript, Scala) for generating source code, web pages, emails,
7952 or any other formatted text output. StringTemplate is particularly good at
7953 code generators, multiple site skins, and internationalization / localization.
7954 StringTemplate also powers ANTLR.")
7955 (license license:bsd-3)))
7956
7957 ;; antlr3 is partially written using antlr3 grammar files. It also depends on
7958 ;; ST4 (stringtemplate4), which is also partially written using antlr3 grammar
7959 ;; files and uses antlr3 at runtime. The latest version requires a recent version
7960 ;; of antlr3 at runtime.
7961 ;; Fortunately, ST4 4.0.6 can be built with an older antlr3, and we use antlr3.3.
7962 ;; This version of ST4 is sufficient for the latest antlr3.
7963 ;; We use ST4 4.0.6 to build a boostrap antlr3 (latest version), and build
7964 ;; the latest ST4 with it. Then we build our final antlr3 that will be linked
7965 ;; against the latest ST4.
7966 ;; antlr3.3 still depends on antlr3 to generate some files, so we use an
7967 ;; even older version, antlr3.1, to generate them. Fortunately antlr3.1 uses
7968 ;; only grammar files with the antlr2 syntax.
7969 ;; So we build antlr3.1 -> antlr3.3 -> ST4.0.6 -> antlr3-bootstrap -> ST4 -> antlr3.
7970
7971 (define-public java-stringtemplate
7972 (package (inherit java-stringtemplate-3)
7973 (name "java-stringtemplate")
7974 (version "4.0.8")
7975 (source (origin
7976 (method url-fetch)
7977 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/"
7978 version ".tar.gz"))
7979 (file-name (string-append name "-" version ".tar.gz"))
7980 (sha256
7981 (base32
7982 "1pri8hqa95rfdkjy55icl5q1m09zwp5k67ib14abas39s4v3w087"))))
7983 (build-system ant-build-system)
7984 (arguments
7985 `(#:jar-name (string-append ,name "-" ,version ".jar")
7986 #:tests? #f ; FIXME: tests fail for unknown reasons
7987 #:test-dir "test"
7988 #:modules ((guix build ant-build-system)
7989 (guix build utils)
7990 (srfi srfi-1))
7991 #:phases
7992 (modify-phases %standard-phases
7993 (add-before 'check 'fix-test-target
7994 (lambda _
7995 (substitute* "build.xml"
7996 (("\\$\\{test.home\\}/java") "${test.home}/")
7997 (("\\*Test.java") "Test*.java"))
7998 #t))
7999 (add-before 'build 'generate-grammar
8000 (lambda _
8001 (with-directory-excursion "src/org/stringtemplate/v4/compiler/"
8002 (for-each (lambda (file)
8003 (format #t "~a\n" file)
8004 (invoke "antlr3" file))
8005 '("STParser.g" "Group.g" "CodeGenerator.g")))
8006 #t)))))
8007 (inputs
8008 `(("antlr3" ,antlr3-bootstrap)
8009 ("antlr2" ,antlr2)
8010 ("java-stringtemplate" ,java-stringtemplate-3)
8011 ("java-junit" ,java-junit)))))
8012
8013 (define java-stringtemplate-4.0.6
8014 (package (inherit java-stringtemplate)
8015 (name "java-stringtemplate")
8016 (version "4.0.6")
8017 (source (origin
8018 (method url-fetch)
8019 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/ST-"
8020 version ".tar.gz"))
8021 (file-name (string-append name "-" version ".tar.gz"))
8022 (sha256
8023 (base32
8024 "0hjmh1ahdsh3w825i67mli9l4nncc4l6hdbf9ma91jvlj590sljp"))))
8025 (inputs
8026 `(("antlr3" ,antlr3-3.3)
8027 ("antlr2" ,antlr2)
8028 ("java-stringtemplate" ,java-stringtemplate-3)))))
8029
8030 (define-public antlr3
8031 (package
8032 (name "antlr3")
8033 (version "3.5.2")
8034 (source (origin
8035 (method git-fetch)
8036 (uri (git-reference
8037 (url "https://github.com/antlr/antlr3")
8038 (commit version)))
8039 (file-name (git-file-name name version))
8040 (sha256
8041 (base32
8042 "0cafavrjmzqhklghrk8c2jqxkdwxgzskm20pbrfd3r41cn00dpnf"))))
8043 (build-system ant-build-system)
8044 (arguments
8045 `(#:jar-name (string-append ,name "-" ,version ".jar")
8046 #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3"
8047 #:tests? #f
8048 #:phases
8049 (modify-phases %standard-phases
8050 (add-after 'install 'bin-install
8051 (lambda* (#:key inputs outputs #:allow-other-keys)
8052 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
8053 (bin (string-append (assoc-ref outputs "out") "/bin")))
8054 (mkdir-p bin)
8055 (with-output-to-file (string-append bin "/antlr3")
8056 (lambda _
8057 (display
8058 (string-append "#!" (which "sh") "\n"
8059 "java -cp " jar "/" ,name "-" ,version ".jar:"
8060 (string-concatenate
8061 (find-files (assoc-ref inputs "stringtemplate")
8062 ".*\\.jar"))
8063 ":"
8064 (string-concatenate
8065 (find-files (assoc-ref inputs "stringtemplate4")
8066 ".*\\.jar"))
8067 ":"
8068 (string-concatenate
8069 (find-files (string-append
8070 (assoc-ref inputs "antlr")
8071 "/lib")
8072 ".*\\.jar"))
8073 " org.antlr.Tool $*"))))
8074 (chmod (string-append bin "/antlr3") #o755))
8075 #t))
8076 (add-before 'build 'generate-grammar
8077 (lambda _
8078 (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/")
8079 (for-each (lambda (file)
8080 (display file)
8081 (newline)
8082 (invoke "antlr3" file))
8083 '("ANTLR.g" "ANTLRTreePrinter.g" "ActionAnalysis.g"
8084 "AssignTokenTypesWalker.g"
8085 "ActionTranslator.g" "TreeToNFAConverter.g"
8086 "ANTLRv3.g" "ANTLRv3Tree.g" "LeftRecursiveRuleWalker.g"
8087 "CodeGenTreeWalker.g" "DefineGrammarItemsWalker.g"))
8088 (substitute* "ANTLRParser.java"
8089 (("public Object getTree") "public GrammarAST getTree"))
8090 (substitute* "ANTLRv3Parser.java"
8091 (("public Object getTree") "public CommonTree getTree"))
8092 (chdir "../../../../../java")
8093 (substitute* "org/antlr/tool/LeftRecursiveRuleAnalyzer.java"
8094 (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*;
8095 import org.antlr.grammar.v3.ANTLRTreePrinter;"))
8096 (substitute* "org/antlr/tool/ErrorManager.java"
8097 (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") ""))
8098 (chdir "../../../..")
8099 #t))
8100 (add-before 'build 'fix-build-xml
8101 (lambda _
8102 (substitute* "build.xml"
8103 (("target name=\"compile\">")
8104 "target name=\"compile\">
8105 <copy todir=\"${classes.dir}\">
8106 <fileset dir=\"tool/src/main/resources\">
8107 <include name=\"**/*.stg\"/>
8108 <include name=\"**/*.st\"/>
8109 <include name=\"**/*.sti\"/>
8110 <include name=\"**/STLexer.tokens\"/>
8111 </fileset>
8112 </copy>"))
8113 #t)))))
8114 (native-inputs
8115 `(("antlr" ,antlr2)
8116 ("antlr3" ,antlr3-bootstrap)))
8117 (inputs
8118 `(("junit" ,java-junit)
8119 ("stringtemplate" ,java-stringtemplate-3)
8120 ("stringtemplate4" ,java-stringtemplate)))
8121 (propagated-inputs
8122 `(("stringtemplate" ,java-stringtemplate-3)
8123 ("antlr" ,antlr2)
8124 ("stringtemplate4" ,java-stringtemplate-4.0.6)))
8125 (home-page "https://www.antlr3.org")
8126 (synopsis "Framework for constructing recognizers, compilers, and translators")
8127 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
8128 is a language tool that provides a framework for constructing recognizers,
8129 compilers, and translators from grammatical descriptions containing Java, C#,
8130 C++, or Python actions. ANTLR provides excellent support for tree construction,
8131 tree walking, and translation.")
8132 (license license:bsd-3)))
8133
8134 (define antlr3-bootstrap
8135 (package
8136 (inherit antlr3)
8137 (name "antlr3-bootstrap")
8138 (native-inputs
8139 `(("antlr" ,antlr2)
8140 ("antlr3" ,antlr3-3.3)))
8141 (inputs
8142 `(("junit" ,java-junit)))))
8143
8144 (define-public antlr3-3.3
8145 (package
8146 (inherit antlr3)
8147 (name "antlr3")
8148 (version "3.3")
8149 (source (origin
8150 (method url-fetch)
8151 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
8152 "gh-pages/download/antlr-"
8153 version ".tar.gz"))
8154 (sha256
8155 (base32
8156 "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m"))
8157 (patches
8158 (search-patches "antlr3-3_3-fix-java8-compilation.patch"))))
8159 (arguments
8160 `(#:jar-name (string-append ,name "-" ,version ".jar")
8161 #:source-dir (string-join '("tool/src/main/java"
8162 "runtime/Java/src/main/java"
8163 "tool/src/main/antlr2"
8164 "tool/src/main/antlr3")
8165 ":")
8166 #:tests? #f ; FIXME: tests seem to require maven plugin
8167 #:modules ((guix build ant-build-system)
8168 (guix build utils)
8169 (srfi srfi-1))
8170 #:phases
8171 (modify-phases %standard-phases
8172 (add-after 'install 'bin-install
8173 (lambda* (#:key inputs outputs #:allow-other-keys)
8174 (let* ((out (assoc-ref outputs "out"))
8175 (jar (string-append out "/share/java"))
8176 (bin (string-append out "/bin")))
8177 (mkdir-p bin)
8178 (with-output-to-file (string-append bin "/antlr3")
8179 (lambda _
8180 (display
8181 (string-append
8182 "#!" (which "sh") "\n"
8183 "java -cp " jar "/antlr3-3.3.jar:"
8184 (string-join
8185 (append (find-files (assoc-ref inputs "java-stringtemplate")
8186 ".*\\.jar$")
8187 (find-files (string-append (assoc-ref inputs "antlr")
8188 "/lib")
8189 ".*\\.jar$"))
8190 ":")
8191 " org.antlr.Tool $*"))))
8192 (chmod (string-append bin "/antlr3") #o755)
8193 #t)))
8194 (add-before 'build 'generate-grammar
8195 (lambda _
8196 (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java"
8197 (("import org.antlr.grammar.v2.\\*;")
8198 "import org.antlr.grammar.v2.*;\n
8199 import org.antlr.grammar.v2.TreeToNFAConverter;\n
8200 import org.antlr.grammar.v2.DefineGrammarItemsWalker;\n
8201 import org.antlr.grammar.v2.ANTLRTreePrinter;"))
8202 (with-directory-excursion "tool/src/main/antlr2/org/antlr/grammar/v2/"
8203 (for-each (lambda (file)
8204 (format #t "~a\n" file)
8205 (invoke "antlr" file))
8206 '("antlr.g" "antlr.print.g" "assign.types.g"
8207 "buildnfa.g" "codegen.g" "define.g")))
8208 (with-directory-excursion "tool/src/main/antlr3/org/antlr/grammar/v3/"
8209 (for-each (lambda (file)
8210 (format #t "~a\n" file)
8211 (invoke "antlr3" file))
8212 '("ActionAnalysis.g" "ActionTranslator.g" "ANTLRv3.g"
8213 "ANTLRv3Tree.g")))
8214 #t))
8215 (add-before 'build 'fix-build-xml
8216 (lambda _
8217 (substitute* "build.xml"
8218 (("target name=\"compile\">")
8219 "target name=\"compile\">
8220 <copy todir=\"${classes.dir}\">
8221 <fileset dir=\"tool/src/main/resources\">
8222 <include name=\"**/*.stg\"/>
8223 <include name=\"**/*.st\"/>
8224 <include name=\"**/*.sti\"/>
8225 <include name=\"**/STLexer.tokens\"/>
8226 </fileset>
8227 </copy>"))
8228 #t)))))
8229 (native-inputs
8230 `(("antlr" ,antlr2)
8231 ("antlr3" ,antlr3-3.1)))
8232 (inputs
8233 `(("junit" ,java-junit)))
8234 (propagated-inputs
8235 `(("java-stringtemplate" ,java-stringtemplate-3)
8236 ("antlr" ,antlr2)))))
8237
8238 (define-public antlr3-3.1
8239 (package
8240 (inherit antlr3)
8241 (version "3.1")
8242 (source (origin
8243 (method url-fetch)
8244 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
8245 "gh-pages/download/antlr-"
8246 version ".tar.gz"))
8247 (sha256
8248 (base32
8249 "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z"))
8250 (patches
8251 (search-patches "antlr3-3_1-fix-java8-compilation.patch"))))
8252 (arguments
8253 `(#:jar-name (string-append "antlr3-" ,version ".jar")
8254 #:source-dir "src:runtime/Java/src"
8255 #:tests? #f
8256 #:phases
8257 (modify-phases %standard-phases
8258 (add-after 'install 'bin-install
8259 (lambda* (#:key inputs outputs #:allow-other-keys)
8260 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
8261 (bin (string-append (assoc-ref outputs "out") "/bin")))
8262 (mkdir-p bin)
8263 (with-output-to-file (string-append bin "/antlr3")
8264 (lambda _
8265 (display
8266 (string-append "#!" (which "sh") "\n"
8267 "java -cp " jar "/antlr3-3.1.jar:"
8268 (string-concatenate
8269 (find-files (assoc-ref inputs "stringtemplate")
8270 ".*\\.jar"))
8271 ":"
8272 (string-concatenate
8273 (find-files (string-append
8274 (assoc-ref inputs "antlr")
8275 "/lib")
8276 ".*\\.jar"))
8277 " org.antlr.Tool $*"))))
8278 (chmod (string-append bin "/antlr3") #o755))
8279 #t))
8280 (add-before 'build 'generate-grammar
8281 (lambda _
8282 (let ((dir "src/org/antlr/tool/"))
8283 (for-each (lambda (file)
8284 (display file)
8285 (newline)
8286 (invoke "antlr" "-o" dir (string-append dir file)))
8287 '("antlr.g" "antlr.print.g" "assign.types.g"
8288 "buildnfa.g" "define.g")))
8289 (format #t "codegen.g\n")
8290 (invoke "antlr" "-o" "src/org/antlr/codegen"
8291 "src/org/antlr/codegen/codegen.g")
8292 #t))
8293 (add-before 'build 'fix-build-xml
8294 (lambda _
8295 (substitute* "build.xml"
8296 (("target name=\"compile\">")
8297 "target name=\"compile\">
8298 <copy todir=\"${classes.dir}\">
8299 <fileset dir=\"src\">
8300 <include name=\"**/*.stg\"/>
8301 <include name=\"**/*.st\"/>
8302 <include name=\"**/*.sti\"/>
8303 <include name=\"**/STLexer.tokens\"/>
8304 </fileset>
8305 </copy>"))
8306 #t)))))
8307 (native-inputs
8308 `(("antlr" ,antlr2)))
8309 (inputs
8310 `(("junit" ,java-junit)))
8311 (propagated-inputs
8312 `(("stringtemplate" ,java-stringtemplate-3)))))
8313
8314 (define-public java-treelayout
8315 (package
8316 (name "java-treelayout")
8317 (version "1.0.3")
8318 (source (origin
8319 (method git-fetch)
8320 (uri (git-reference
8321 (url "https://github.com/abego/treelayout")
8322 (commit (string-append "v" version))))
8323 (file-name (git-file-name name version))
8324 (sha256
8325 (base32
8326 "18my8ql9b1y0n0zrvkih7xfhf3dpgfhyfifvkcfhmwcvw3divxak"))))
8327 (build-system ant-build-system)
8328 (arguments
8329 `(#:jar-name (string-append ,name "-" ,version ".jar")
8330 #:source-dir "org.abego.treelayout/src/main/java"
8331 #:test-dir "org.abego.treelayout/src/test"))
8332 (inputs
8333 `(("java-junit" ,java-junit)))
8334 (native-inputs
8335 `(("java-hamcrest-core" ,java-hamcrest-core)))
8336 (home-page "http://treelayout.sourceforge.net")
8337 (synopsis "Tree Layout Algorithm in Java")
8338 (description "TreeLayout creates tree layouts for arbitrary trees. It is
8339 not restricted to a specific output or format, but can be used for any kind of
8340 two dimensional diagram. Examples are Swing based components, SVG files, etc.
8341 This is possible because TreeLayout separates the layout of a tree from the
8342 actual rendering.")
8343 (license license:bsd-3)))
8344
8345 (define-public java-antlr4-runtime
8346 (package
8347 (name "java-antlr4-runtime")
8348 (version "4.8")
8349 (source (origin
8350 (method git-fetch)
8351 (uri (git-reference
8352 (url "https://github.com/antlr/antlr4")
8353 (commit version)))
8354 (file-name (git-file-name name version))
8355 (sha256
8356 (base32
8357 "1qal3add26qxskm85nk7r758arladn5rcyjinmhlhznmpbbv9j8m"))
8358 (patches
8359 (search-patches "java-antlr4-Add-standalone-generator.patch"
8360 "java-antlr4-fix-code-too-large.java"))))
8361 (build-system ant-build-system)
8362 (arguments
8363 `(#:jar-name "java-antlr4-runtime.jar"
8364 #:source-dir "runtime/Java/src/org"
8365 #:tests? #f; tests depend on java-antlr4 itself
8366 #:phases
8367 (modify-phases %standard-phases
8368 (add-before 'build 'copy-resources
8369 (lambda _
8370 (copy-recursively "runtime/Java/src/main/dot"
8371 "build/classes")
8372 #t)))))
8373 (home-page "https://www.antlr.org")
8374 (synopsis "ANTLR runtime library")
8375 (description "This package contains the runtime library used with generated
8376 sources by ANTLR.")
8377 (license license:bsd-3)))
8378
8379 (define-public antlr4
8380 (package
8381 (inherit java-antlr4-runtime)
8382 (name "antlr4")
8383 (arguments
8384 `(#:jar-name "antlr4.jar"
8385 #:source-dir "tool/src"
8386 #:test-dir "tool-testsuite/test:runtime-testsuite/test:runtime-testsuite/annotations/src"
8387 #:test-include (list "**/Test*.java")
8388 #:test-exclude (list
8389 ;; no runnable method
8390 "**/TestOutputReading.java"
8391 ;; no @Test methods
8392 "**/TestParserErrors.java"
8393 "**/TestSemPredEvalParser.java"
8394 "**/TestSets.java"
8395 "**/TestListeners.java"
8396 "**/TestParseTrees.java"
8397 "**/TestParserExec.java"
8398 "**/TestLexerErrors.java"
8399 "**/TestPerformance.java"
8400 "**/TestCompositeParsers.java"
8401 "**/TestLexerExec.java"
8402 "**/TestSemPredEvalLexer.java"
8403 "**/TestLeftRecursion.java"
8404 "**/TestFullContextParsing.java"
8405 "**/TestCompositeLexers.java"
8406 ;; Null pointer exception
8407 "**/TestCompositeGrammars.java"
8408 ;; Wrong assumption on emoji
8409 "**/TestUnicodeData.java")
8410 #:phases
8411 (modify-phases %standard-phases
8412 (add-before 'build 'fix-build.xml
8413 (lambda _
8414 ;; tests are not in a java subdirectory
8415 (substitute* "build.xml"
8416 (("\\$\\{test.home\\}/java") "${test.home}"))
8417 #t))
8418 ;; tests require to have a working antlr4 binary
8419 (delete 'check)
8420 (add-after 'bin-install 'check
8421 (lambda _
8422 (invoke "ant" "compile-tests")
8423 (invoke "ant" "check" "-Dtest.home=runtime-testsuite/annotations/src")
8424 (invoke "ant" "check" "-Dtest.home=runtime-testsuite/test")
8425 (invoke "ant" "check" "-Dtest.home=tool-testsuite/test")
8426 #t))
8427 (add-before 'check 'remove-unrelated-languages
8428 (lambda _
8429 ;; There are tests for other languages that ANTLR can generate, but
8430 ;; we don't have the infrastructure for that yet. Let's test Java
8431 ;; generation only.
8432 (for-each
8433 (lambda (language)
8434 (delete-file-recursively
8435 (string-append "runtime-testsuite/test/org/antlr/v4/test/runtime/"
8436 language)))
8437 '("cpp" "csharp" "go" "javascript" "php" "python" "python2"
8438 "python3" "swift"))
8439 #t))
8440 (add-before 'check 'generate-test-parsers
8441 (lambda* (#:key outputs #:allow-other-keys)
8442 (define (run-antlr dir filename package)
8443 (invoke "antlr4" "-lib" dir "-visitor" "-no-listener"
8444 "-package" package (string-append dir "/" filename)
8445 "-Xlog"))
8446 (setenv "PATH" (string-append (getenv "PATH") ":"
8447 (assoc-ref outputs "out") "/bin"))
8448 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
8449 "Java.g4" "org.antlr.v4.test.runtime.java.api")
8450 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
8451 "VisitorBasic.g4" "org.antlr.v4.test.runtime.java.api")
8452 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
8453 "VisitorCalc.g4" "org.antlr.v4.test.runtime.java.api")
8454 #t))
8455 (add-before 'check 'remove-graphemes
8456 (lambda _
8457 ;; When running antlr on grahemes.g4, we get a runtime exception:
8458 ;; set is empty. So delete the file that depends on it.
8459 (delete-file
8460 "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/perf/TimeLexerSpeed.java")
8461 #t))
8462 (add-after 'install 'bin-install
8463 (lambda* (#:key inputs outputs #:allow-other-keys)
8464 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
8465 (bin (string-append (assoc-ref outputs "out") "/bin")))
8466 (mkdir-p bin)
8467 (with-output-to-file (string-append bin "/antlr4")
8468 (lambda _
8469 (display
8470 (string-append "#!" (which "sh") "\n"
8471 "java -cp " jar "/antlr4.jar:"
8472 (string-join
8473 (apply
8474 append
8475 (map
8476 (lambda (input)
8477 (find-files (assoc-ref inputs input)
8478 ".*\\.jar"))
8479 '("antlr3" "java-stringtemplate"
8480 "java-antlr4-runtime" "java-treelayout"
8481 "java-jsonp-api" "java-icu4j")))
8482 ":")
8483 " org.antlr.v4.Tool $*"))))
8484 (chmod (string-append bin "/antlr4") #o755)
8485 #t)))
8486 (add-before 'build 'copy-resources
8487 (lambda _
8488 (copy-recursively "tool/resources/" "build/classes")
8489 #t))
8490 (add-before 'build 'generate-unicode
8491 (lambda _
8492 ;; First: build the generator
8493 (invoke "javac" "-cp" (getenv "CLASSPATH")
8494 "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java"
8495 "tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java")
8496 ;; Then use it
8497 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
8498 ":tool/src:runtime/Java")
8499 "org.antlr.v4.unicode.UnicodeRenderer"
8500 "tool/resources/org/antlr/v4/tool/templates"
8501 "unicodedata"
8502 "tool/src/org/antlr/v4/unicode/UnicodeData.java")
8503 ;; It seems there is a bug with our ST4
8504 (substitute* "tool/src/org/antlr/v4/unicode/UnicodeData.java"
8505 (("\\\\>") ">"))
8506 ;; Remove the additional file
8507 (delete-file "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java")
8508 #t))
8509 (add-before 'build 'generate-grammar
8510 (lambda* (#:key inputs #:allow-other-keys)
8511 (with-directory-excursion "tool/src/org/antlr/v4/parse"
8512 (for-each (lambda (file)
8513 (display file)
8514 (newline)
8515 (invoke "antlr3" file))
8516 '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g"
8517 "GrammarTreeVisitor.g" "ATNBuilder.g"
8518 "ActionSplitter.g" "LeftRecursiveRuleWalker.g")))
8519 (with-directory-excursion "tool/src/org/antlr/v4/codegen"
8520 (install-file "../parse/ANTLRParser.tokens" ".")
8521 (display "SourceGenTriggers.g\n")
8522 (invoke "antlr3" "SourceGenTriggers.g"))
8523 #t)))))
8524 (inputs
8525 `(("antlr3" ,antlr3)
8526 ("java-antlr4-runtime" ,java-antlr4-runtime)
8527 ("java-icu4j" ,java-icu4j)
8528 ("java-jsonp-api" ,java-jsonp-api)
8529 ("java-stringtemplate" ,java-stringtemplate)
8530 ("java-treelayout" ,java-treelayout)))
8531 (native-inputs
8532 `(("java-junit" ,java-junit)))
8533 (synopsis "Parser and lexer generator in Java")
8534 (description "ANTLR (ANother Tool for Language Recognition) is a powerful
8535 parser generator for reading, processing, executing, or translating structured
8536 text or binary files. It's widely used to build languages, tools, and
8537 frameworks. From a grammar, ANTLR generates a parser that can build and walk
8538 parse trees.")))
8539
8540 (define-public java-antlr4-runtime-4.1
8541 (package
8542 (inherit java-antlr4-runtime)
8543 (version "4.1")
8544 (source (origin
8545 (method git-fetch)
8546 (uri (git-reference
8547 (url "https://github.com/antlr/antlr4")
8548 (commit version)))
8549 (file-name (git-file-name "antlr4" version))
8550 (sha256
8551 (base32
8552 "1i8hmx5an58cjyvhji0xgpvd6lq00z1k1mjys025q2wqc25wv4c1"))))
8553 (arguments
8554 (substitute-keyword-arguments (package-arguments java-antlr4-runtime)
8555 ((#:phases phases)
8556 `(modify-phases ,phases
8557 (add-before 'configure 'chmod
8558 (lambda _
8559 (chmod "build.xml" #o644)
8560 #t))))))
8561 (inputs
8562 `(("java-treelayout" ,java-treelayout)))))
8563
8564 (define-public antlr4-4.1
8565 (package
8566 (inherit antlr4)
8567 (version (package-version java-antlr4-runtime-4.1))
8568 (source (package-source java-antlr4-runtime-4.1))
8569 (arguments
8570 (substitute-keyword-arguments (package-arguments antlr4)
8571 ((#:test-dir _)
8572 "tool/test")
8573 ((#:test-exclude excludes)
8574 `(list "**/TestParseErrors.java"
8575 "**/TestTopologicalSort.java"
8576 ,@excludes))
8577 ((#:phases phases)
8578 `(modify-phases ,phases
8579 (delete 'generate-unicode)
8580 (replace 'check
8581 (lambda _
8582 (invoke "ant" "check")
8583 #t))
8584 (add-before 'configure 'chmod
8585 (lambda _
8586 (chmod "build.xml" #o644)
8587 #t))
8588 (delete 'remove-graphemes)
8589 (delete 'remove-unrelated-languages)
8590 (delete 'generate-test-parsers)))))
8591 (inputs
8592 (alist-replace
8593 "java-antlr4-runtime" (list java-antlr4-runtime-4.1)
8594 (package-inputs antlr4)))))
8595
8596 (define-public java-tunnelvisionlabs-antlr4-runtime-annotations
8597 (package
8598 (inherit java-antlr4-runtime)
8599 (name "java-tunnelvisionlabs-antlr4-runtime-annotations")
8600 (version "4.7.4")
8601 (source (origin
8602 (method git-fetch)
8603 (uri (git-reference
8604 (url "https://github.com/tunnelvisionlabs/antlr4")
8605 (commit (string-append version "-opt"))))
8606 (file-name (git-file-name "java-tunnelvisionlabs-antlr4" version))
8607 (sha256
8608 (base32
8609 "1mf2lvvsszpialsk23ma83pwp50nd32lrbjpa847zlm5gmranbr8"))
8610 (patches
8611 (search-patches "java-antlr4-Add-standalone-generator.patch"
8612 "java-tunnelvisionlabs-antlr-code-too-large.patch"))))
8613 (arguments
8614 `(#:jar-name "java-antlr4-runtime-annotations.jar"
8615 #:source-dir "runtime/JavaAnnotations/src"
8616 #:tests? #f; no tests
8617 #:phases
8618 (modify-phases %standard-phases
8619 (add-after 'build 'copy-resources
8620 (lambda _
8621 (copy-recursively "runtime/JavaAnnotations/resources"
8622 "build/classes")
8623 #t))
8624 (add-after 'copy-resources 'rebuild-jar
8625 (lambda _
8626 (invoke "ant" "jar")
8627 #t)))))
8628 (inputs '())
8629 (native-inputs '())
8630 (synopsis "Annotations for ANTLR's runtime library")
8631 (description "This package contains annotations used during the build of
8632 the runtime library of ANTLR.")))
8633
8634 ;; the runtime of this library requires a lexer that is generated by antlr4.
8635 ;; However, antlr4 itself requires this library at build and run-time. We
8636 ;; use antlr4@4.1, the closest version of antlr that doesn't need this
8637 ;; bootstrap process, to generate the lexer. The generated lexer is built
8638 ;; for the 4.1 runtime, which is slightly different from this runtime.
8639 ;; So, we build the runtime with antlr 4.1, with a broken xml lexer, that we
8640 ;; use to build antlr4. We then re-use this antlr4 to build the runtime, and
8641 ;; the proper, working, runtime to build antlr4 again.
8642 (define java-tunnelvisionlabs-antlr4-runtime-bootstrap
8643 (package
8644 (inherit java-antlr4-runtime)
8645 (name "java-tunnelvisionlabs-antlr4-runtime")
8646 (version (package-version java-tunnelvisionlabs-antlr4-runtime-annotations))
8647 (source (package-source java-tunnelvisionlabs-antlr4-runtime-annotations))
8648 (arguments
8649 `(#:jar-name "java-antlr4-runtime.jar"
8650 #:source-dir "runtime/Java/src"
8651 #:tests? #f; tests require antlr4, but antlr4 depends on this package
8652 #:phases
8653 (modify-phases %standard-phases
8654 (add-before 'build 'generate-xpath-lexer
8655 (lambda _
8656 (invoke "antlr4" "-lib" "runtime/Java/src/org/antlr/v4/runtime/tree/xpath"
8657 "-visitor" "-no-listener"
8658 "-package" "org.antlr.v4.runtime.tree.xpath"
8659 "runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.g4")
8660 ;; Generated code is for an incompatible version of the runtime
8661 (substitute* "runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.java"
8662 (("LexerATNSimulator\\(this,_ATN,_decisionToDFA,_sharedContextCache\\)")
8663 "LexerATNSimulator(this,_ATN)"))
8664 #t))
8665 (add-before 'build 'copy-resources
8666 (lambda _
8667 (copy-recursively "runtime/Java/src/main/dot"
8668 "build/classes")
8669 #t)))))
8670 (native-inputs
8671 `(("antlr4" ,antlr4-4.1)
8672 ("java-tunnelvisionlabs-antlr4-runtime-annotations"
8673 ,java-tunnelvisionlabs-antlr4-runtime-annotations)))))
8674
8675 (define java-tunnelvisionlabs-antlr4-bootstrap
8676 (package
8677 (inherit antlr4)
8678 (name "java-tunnelvisionlabs-antlr4")
8679 (version (package-version java-tunnelvisionlabs-antlr4-runtime-annotations))
8680 (source (package-source java-tunnelvisionlabs-antlr4-runtime-annotations))
8681 (arguments
8682 (substitute-keyword-arguments (package-arguments antlr4)
8683 ((#:test-dir _)
8684 "tool/test:runtime-testsuite/src")
8685 ((#:phases phases)
8686 `(modify-phases ,phases
8687 (delete 'remove-unrelated-languages)
8688 (delete 'remove-graphemes)
8689 (delete 'generate-test-parsers)
8690 (delete 'check)))))
8691 (native-inputs '())
8692 (inputs
8693 `(("antlr3" ,antlr3)
8694 ("java-antlr4-runtime" ,java-tunnelvisionlabs-antlr4-runtime-bootstrap)
8695 ("java-tunnelvisionlabs-antlr4-runtime-annotations"
8696 ,java-tunnelvisionlabs-antlr4-runtime-annotations)
8697 ("java-icu4j" ,java-icu4j)
8698 ("java-jsonp-api" ,java-jsonp-api)
8699 ("java-stringtemplate" ,java-stringtemplate)
8700 ("java-treelayout" ,java-treelayout)))))
8701
8702 (define-public java-tunnelvisionlabs-antlr4-runtime
8703 (package
8704 (inherit java-tunnelvisionlabs-antlr4-runtime-bootstrap)
8705 (native-inputs
8706 (alist-replace
8707 "antlr4" (list java-tunnelvisionlabs-antlr4-bootstrap)
8708 (package-native-inputs java-tunnelvisionlabs-antlr4-runtime-bootstrap)))))
8709
8710 (define-public java-tunnelvisionlabs-antlr4
8711 (package
8712 (inherit java-tunnelvisionlabs-antlr4-bootstrap)
8713 (inputs
8714 (alist-replace
8715 "java-antlr4-runtime" (list java-tunnelvisionlabs-antlr4-runtime)
8716 (package-inputs java-tunnelvisionlabs-antlr4-bootstrap)))))
8717
8718 (define-public java-commons-cli-1.2
8719 ;; This is a bootstrap dependency for Maven2.
8720 (package
8721 (inherit java-commons-cli)
8722 (version "1.2")
8723 (source (origin
8724 (method url-fetch)
8725 (uri (string-append "mirror://apache/commons/cli/source/"
8726 "commons-cli-" version "-src.tar.gz"))
8727 (sha256
8728 (base32
8729 "0rvfgzgv2pc1m091dfj3ih9ddsjjppr1f1wf0qmc3bk6b1kwv2dm"))))
8730 (arguments
8731 `(#:jar-name "commons-cli.jar"
8732 #:phases
8733 (modify-phases %standard-phases
8734 (add-before 'check 'fix-build-xml
8735 (lambda* (#:key inputs #:allow-other-keys)
8736 (substitute* "build.xml"
8737 (("dir=\"\\$\\{test.home\\}/java\"")
8738 "dir=\"${test.home}\""))
8739 #t)))))
8740 (native-inputs
8741 `(("java-junit" ,java-junit)))))
8742
8743 (define-public java-microemulator-cldc
8744 (package
8745 (name "java-microemulator-cldc")
8746 (version "2.0.4")
8747 (source (origin
8748 (method url-fetch)
8749 (uri (string-append "https://github.com/barteo/microemu/archive/"
8750 "microemulator_"
8751 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
8752 version)
8753 ".tar.gz"))
8754 (file-name (string-append name "-" version ".tar.gz"))
8755 (sha256
8756 (base32
8757 "1x1apmz38gkppxnwnygwmi12j54v4p258v8ddzn6dldkk7vak1ll"))))
8758 (build-system ant-build-system)
8759 (arguments
8760 `(#:jar-name "microemulator-cldc.jar"
8761 #:source-dir "microemu-cldc/src/main/java"
8762 #:tests? #f)); Requires even older software
8763 (home-page "https://github.com/barteo/microemu")
8764 (synopsis "J2ME CLDC emulator")
8765 (description "Microemulator is a Java 2 Micro Edition (J2ME) CLDC/MIDP
8766 Emulator. It demonstrates MIDlet based applications in web browser
8767 applet and can be run as a standalone java application.")
8768 (license (list license:asl2.0
8769 ;; or altenatively:
8770 license:lgpl2.1+))))
8771
8772 (define-public java-datanucleus-javax-persistence
8773 (package
8774 (name "java-datanucleus-javax-persistence")
8775 (version "2.2.0")
8776 (source (origin
8777 (method url-fetch)
8778 (uri (string-append "https://github.com/datanucleus/"
8779 "javax.persistence/archive/javax.persistence-"
8780 version "-release.tar.gz"))
8781 (sha256
8782 (base32
8783 "11jx0fjwgc2hhbqqgdd6m1pf2fplf9vslppygax0y1z5csnqjhpx"))))
8784 (build-system ant-build-system)
8785 (arguments
8786 `(#:jar-name "java-datanucleus-javax-persistence.jar"
8787 #:jdk ,icedtea-8
8788 #:source-dir "src/main/java"
8789 #:tests? #f)); no tests
8790 (home-page "https://github.com/datanucleus/javax.persistence")
8791 (synopsis "JPA API")
8792 (description "This package contains a clean definition of JPA API intended
8793 for use with DataNucleus JPA since the JCP haven't provided an official JPA API
8794 jar. See @url{http://java.net/projects/jpa-spec/downloads} for the specification
8795 used to generate this API.")
8796 (license (list license:edl1.0 license:epl1.0))))
8797
8798 (define-public java-osgi-cmpn
8799 (package
8800 (name "java-osgi-cmpn")
8801 (version "6.0.0")
8802 (source (origin
8803 (method url-fetch)
8804 (uri (string-append "https://repo1.maven.org/maven2/"
8805 "org/osgi/osgi.cmpn/" version "/osgi.cmpn-"
8806 version "-sources.jar"))
8807 (sha256
8808 (base32
8809 "1lmb6xyrmkqdhv1kayf0514rlwq6ypvs4m44ibrck3snp8241wys"))))
8810 (build-system ant-build-system)
8811 (arguments
8812 `(#:jar-name "osgi-cmpn.jar"
8813 #:tests? #f)); no tests
8814 (inputs
8815 `(("annotation" ,java-osgi-annotation)
8816 ("core" ,java-osgi-core)
8817 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
8818 ("microemulator" ,java-microemulator-cldc)
8819 ("servlet" ,java-classpathx-servletapi)))
8820 (home-page "https://www.osgi.org")
8821 (synopsis "Compendium specification module of OSGi framework")
8822 (description
8823 "OSGi, for Open Services Gateway initiative framework, is a module system
8824 and service platform for the Java programming language. This package contains
8825 the compendium specification module, providing interfaces and classes for use
8826 in compiling bundles.")
8827 (license license:asl2.0)))
8828
8829 (define-public java-osgi-service-component-annotations
8830 (package
8831 (name "java-osgi-service-component-annotations")
8832 (version "1.3.0")
8833 (source (origin
8834 (method url-fetch)
8835 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
8836 "org.osgi.service.component.annotations/"
8837 version "/org.osgi.service.component.annotations-"
8838 version "-sources.jar"))
8839 (sha256
8840 (base32
8841 "15rq9cmp4fpn74q44m4j35qsqmjf5lx3hcrk6pzvbhc08igic2f0"))))
8842 (build-system ant-build-system)
8843 (arguments
8844 `(#:jar-name "osgi-service-component-annotations.jar"
8845 #:tests? #f)); no tests
8846 (inputs
8847 `(("annotation" ,java-osgi-annotation)))
8848 (home-page "https://www.osgi.org")
8849 (synopsis "Support annotations for osgi-service-component")
8850 (description
8851 "OSGi, for Open Services Gateway initiative framework, is a module system
8852 and service platform for the Java programming language. This package contains
8853 the support annotations for osgi-service-component.")
8854 (license license:asl2.0)))
8855
8856 (define-public java-osgi-dto
8857 (package
8858 (name "java-osgi-dto")
8859 (version "1.0.0")
8860 (source (origin
8861 (method url-fetch)
8862 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
8863 "org.osgi.dto/" version "/org.osgi.dto-"
8864 version "-sources.jar"))
8865 (sha256
8866 (base32
8867 "0f4bqjzadn0hwk6sd3h5gvbyfp3yci1s6r0v770cc15p0pg627yr"))))
8868 (build-system ant-build-system)
8869 (arguments
8870 `(#:jar-name "osgi-dto.jar"
8871 #:tests? #f)); no tests
8872 (inputs
8873 `(("annotation" ,java-osgi-annotation)))
8874 (home-page "https://www.osgi.org")
8875 (synopsis "Data Transfer Objects")
8876 (description
8877 "OSGi, for Open Services Gateway initiative framework, is a module system
8878 and service platform for the Java programming language. This package contains
8879 the Data Transfer Objects. It is easily serializable having only public fields
8880 of primitive types and their wrapper classes, Strings, and DTOs. List, Set,
8881 Map and array aggregates may also be used. The aggregates must only hold
8882 objects of the listed types or aggregates.")
8883 (license license:asl2.0)))
8884
8885 (define-public java-osgi-resource
8886 (package
8887 (name "java-osgi-resource")
8888 (version "1.0.0")
8889 (source (origin
8890 (method url-fetch)
8891 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
8892 "org.osgi.resource/"
8893 version "/org.osgi.resource-"
8894 version "-sources.jar"))
8895 (sha256
8896 (base32
8897 "0hi0fsc5v99q22bd7lrkvpz1y0ds4w9arjldpwsrcpqvz2js7q2d"))))
8898 (build-system ant-build-system)
8899 (arguments
8900 `(#:jar-name "osgi-resource.jar"
8901 #:tests? #f)); no tests
8902 (inputs
8903 `(("annotation" ,java-osgi-annotation)
8904 ("dto" ,java-osgi-dto)))
8905 (home-page "https://www.osgi.org")
8906 (synopsis "OSGI Resource")
8907 (description
8908 "OSGi, for Open Services Gateway initiative framework, is a module system
8909 and service platform for the Java programming language. This package contains
8910 the definition of common types in osgi packages.")
8911 (license license:asl2.0)))
8912
8913 (define-public java-osgi-namespace-contract
8914 (package
8915 (name "java-osgi-namespace-contract")
8916 (version "1.0.0")
8917 (source (origin
8918 (method url-fetch)
8919 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
8920 "org.osgi.namespace.contract/"
8921 version "/org.osgi.namespace.contract-"
8922 version "-sources.jar"))
8923 (sha256
8924 (base32
8925 "1iz4f2i0fvqrlq90ki9nfzcfpvy2av434ri25bglywqssx8mmp36"))))
8926 (build-system ant-build-system)
8927 (inputs
8928 `(("resource" ,java-osgi-resource)
8929 ("annotation" ,java-osgi-annotation)))
8930 (arguments
8931 `(#:jar-name "osgi-namespace-contract.jar"
8932 #:tests? #f)); no tests
8933 (home-page "https://www.osgi.org")
8934 (synopsis "Contract Capability and Requirement Namespace")
8935 (description
8936 "OSGi, for Open Services Gateway initiative framework, is a module system
8937 and service platform for the Java programming language. This package contains
8938 the names for the attributes and directives for a namespace with contracts.")
8939 (license license:asl2.0)))
8940
8941 (define-public java-osgi-namespace-extender
8942 (package
8943 (name "java-osgi-namespace-extender")
8944 (version "1.0.1")
8945 (source (origin
8946 (method url-fetch)
8947 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
8948 "org.osgi.namespace.extender/"
8949 version "/org.osgi.namespace.extender-"
8950 version "-sources.jar"))
8951 (sha256
8952 (base32
8953 "0jgqiak2i05qv6j3gd33xlaifzzc0ylxxk376v2x0apfg3vvixmz"))))
8954 (build-system ant-build-system)
8955 (inputs
8956 `(("resource" ,java-osgi-resource)
8957 ("annotation" ,java-osgi-annotation)))
8958 (arguments
8959 `(#:jar-name "osgi-namespace-extendent.jar"
8960 #:tests? #f)); no tests
8961 (home-page "https://www.osgi.org")
8962 (synopsis "Extender Capability and Requirement Namespace")
8963 (description
8964 "OSGi, for Open Services Gateway initiative framework, is a module system
8965 and service platform for the Java programming language. This package contains
8966 the names for the attributes and directives for an extender namespace.")
8967 (license license:asl2.0)))
8968
8969 (define-public java-osgi-namespace-service
8970 (package
8971 (name "java-osgi-namespace-service")
8972 (version "1.0.0")
8973 (source (origin
8974 (method url-fetch)
8975 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
8976 "org.osgi.namespace.service/"
8977 version "/org.osgi.namespace.service-"
8978 version "-sources.jar"))
8979 (sha256
8980 (base32
8981 "0qmw8n2449nkmm56d1znz9zhazb6ya3vsimd5bf5jg23zzhgl8c8"))))
8982 (build-system ant-build-system)
8983 (inputs
8984 `(("resource" ,java-osgi-resource)
8985 ("annotation" ,java-osgi-annotation)))
8986 (arguments
8987 `(#:jar-name "osgi-namespace-service.jar"
8988 #:tests? #f)); no tests
8989 (home-page "https://www.osgi.org")
8990 (synopsis "Service Capability and Requirement Namespace")
8991 (description
8992 "OSGi, for Open Services Gateway initiative framework, is a module system
8993 and service platform for the Java programming language. This package contains
8994 the names for the attributes and directives for a service namespace.")
8995 (license license:asl2.0)))
8996
8997 (define-public java-osgi-util-function
8998 (package
8999 (name "java-osgi-util-function")
9000 (version "1.0.0")
9001 (source (origin
9002 (method url-fetch)
9003 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9004 "org.osgi.util.function/"
9005 version "/org.osgi.util.function-"
9006 version "-sources.jar"))
9007 (sha256
9008 (base32
9009 "04l7j3hwmmj28w23m7paca0afzncs42j2mdr3liqq8kvp548sc6x"))))
9010 (build-system ant-build-system)
9011 (arguments
9012 `(#:jar-name "osgi-util-function.jar"
9013 #:tests? #f)); no tests
9014 (inputs
9015 `(("annotation" ,java-osgi-annotation)))
9016 (home-page "https://www.osgi.org")
9017 (synopsis "OSGI Util Function")
9018 (description
9019 "OSGi, for Open Services Gateway initiative framework, is a module system
9020 and service platform for the Java programming language. This package contains
9021 an interface for a function that accepts a single argument and produces a result.")
9022 (license license:asl2.0)))
9023
9024 (define-public java-osgi-util-promise
9025 (package
9026 (name "java-osgi-util-promise")
9027 (version "1.0.0")
9028 (source (origin
9029 (method url-fetch)
9030 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9031 "org.osgi.util.promise/"
9032 version "/org.osgi.util.promise-"
9033 version "-sources.jar"))
9034 (sha256
9035 (base32
9036 "0y34dwiflg1c4ahvkswpf9z02xph2sr9fm04ia5493x3lshpw22c"))))
9037 (build-system ant-build-system)
9038 (arguments
9039 `(#:jar-name "osgi-util-promise.jar"
9040 #:tests? #f)); no tests
9041 (inputs
9042 `(("annotation" ,java-osgi-annotation)
9043 ("function" ,java-osgi-util-function)))
9044 (home-page "https://www.osgi.org")
9045 (synopsis "Promise of a value")
9046 (description
9047 "OSGi, for Open Services Gateway initiative framework, is a module system
9048 and service platform for the Java programming language. This package contains
9049 an interface and utilitary classes for promises. A Promise represents a future
9050 value. It handles the interactions for asynchronous processing.")
9051 (license license:asl2.0)))
9052
9053 (define-public java-osgi-service-metatype-annotations
9054 (package
9055 (name "java-osgi-service-metatype-annotations")
9056 (version "1.3.0")
9057 (source (origin
9058 (method url-fetch)
9059 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9060 "org.osgi.service.metatype.annotations/"
9061 version "/org.osgi.service.metatype.annotations-"
9062 version "-sources.jar"))
9063 (sha256
9064 (base32
9065 "12rwm3349wk80vm88rcdgs4435m4jxkpkj5mrx326skkz2c6hyw6"))))
9066 (build-system ant-build-system)
9067 (arguments
9068 `(#:jar-name "osgi-service-metatype-annotations.jar"
9069 #:tests? #f)); no tests
9070 (inputs
9071 `(("annotation" ,java-osgi-annotation)))
9072 (home-page "https://www.osgi.org")
9073 (synopsis "Support annotations for metatype")
9074 (description
9075 "OSGi, for Open Services Gateway initiative framework, is a module system
9076 and service platform for the Java programming language. This package contains
9077 the support annotations for metatype.")
9078 (license license:asl2.0)))
9079
9080 (define-public java-osgi-service-repository
9081 (package
9082 (name "java-osgi-service-repository")
9083 (version "1.1.0")
9084 (source (origin
9085 (method url-fetch)
9086 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9087 "org.osgi.service.repository/"
9088 version "/org.osgi.service.repository-"
9089 version "-sources.jar"))
9090 (sha256
9091 (base32
9092 "1k41mhg7b58pd8nsghr2qwcjrxdnf1p9spsw9v11k4257g6rl06n"))))
9093 (build-system ant-build-system)
9094 (arguments
9095 `(#:jar-name "osgi-service-repository.jar"
9096 #:tests? #f)); no tests
9097 (inputs
9098 `(("annotation" ,java-osgi-annotation)
9099 ("promise" ,java-osgi-util-promise)
9100 ("resource" ,java-osgi-resource)))
9101 (home-page "https://www.osgi.org")
9102 (synopsis "OSGI service repository")
9103 (description
9104 "OSGi, for Open Services Gateway initiative framework, is a module system
9105 and service platform for the Java programming language. This package contains
9106 a repository service that contains resources.")
9107 (license license:asl2.0)))
9108
9109 (define-public java-osgi-framework
9110 (package
9111 (name "java-osgi-framework")
9112 (version "1.8.0")
9113 (source (origin
9114 (method url-fetch)
9115 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9116 "org.osgi.framework/" version "/org.osgi.framework-"
9117 version "-sources.jar"))
9118 (sha256
9119 (base32
9120 "1lwp2zfad3rybcc6q9bwz8xsgkc92ypzy5p6x54387f1qj65m73s"))))
9121 (build-system ant-build-system)
9122 (arguments
9123 `(#:jar-name "osgi-framework.jar"
9124 #:tests? #f)); no tests
9125 (inputs
9126 `(("annotation" ,java-osgi-annotation)
9127 ("resource" ,java-osgi-resource)
9128 ("dto" ,java-osgi-dto)))
9129 (home-page "https://www.osgi.org")
9130 (synopsis "OSGi framework")
9131 (description
9132 "OSGi, for Open Services Gateway initiative framework, is a module system
9133 and service platform for the Java programming language.")
9134 (license license:asl2.0)))
9135
9136 (define-public java-osgi-service-log
9137 (package
9138 (name "java-osgi-service-log")
9139 (version "1.3.0")
9140 (source (origin
9141 (method url-fetch)
9142 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9143 "org.osgi.service.log/"
9144 version "/org.osgi.service.log-"
9145 version "-sources.jar"))
9146 (sha256
9147 (base32
9148 "1029j30dzcwializzca0j3fkhwwz08kmmsha5agw1iccscimj6r0"))))
9149 (build-system ant-build-system)
9150 (arguments
9151 `(#:jar-name "osgi-service-log.jar"
9152 #:tests? #f)); no tests
9153 (inputs
9154 `(("java-osgi-framework" ,java-osgi-framework)))
9155 (home-page "https://www.osgi.org")
9156 (synopsis "Provides methods for bundles to write messages to the log")
9157 (description
9158 "OSGi, for Open Services Gateway initiative framework, is a module system
9159 and service platform for the Java programming language. This package contains
9160 the log service.")
9161 (license license:asl2.0)))
9162
9163 (define-public java-osgi-service-jdbc
9164 (package
9165 (name "java-osgi-service-jdbc")
9166 (version "1.0.0")
9167 (source (origin
9168 (method url-fetch)
9169 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9170 "org.osgi.service.jdbc/"
9171 version "/org.osgi.service.jdbc-"
9172 version "-sources.jar"))
9173 (sha256
9174 (base32
9175 "11iln5v7bk469cgb9ddkrz9sa95b3733gqgaqw9xf5g6wq652yjz"))))
9176 (build-system ant-build-system)
9177 (arguments
9178 `(#:jar-name "osgi-service-jdbc.jar"
9179 #:tests? #f)); no tests
9180 (home-page "https://www.osgi.org")
9181 (synopsis "Factory for JDBC connection factories")
9182 (description
9183 "OSGi, for Open Services Gateway initiative framework, is a module system
9184 and service platform for the Java programming language. This package contains
9185 a factory for JDBC connection factories. There are 3 preferred connection
9186 factories for getting JDBC connections:
9187
9188 @itemize
9189 @item @code{javax.sql.DataSource};
9190 @item @code{javax.sql.ConnectionPoolDataSource};
9191 @item @code{javax.sql.XADataSource}.
9192 @end itemize")
9193 (license license:asl2.0)))
9194
9195 (define-public java-osgi-service-resolver
9196 (package
9197 (name "java-osgi-service-resolver")
9198 (version "1.0.1")
9199 (source (origin
9200 (method url-fetch)
9201 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9202 "org.osgi.service.resolver/"
9203 version "/org.osgi.service.resolver-"
9204 version "-sources.jar"))
9205 (sha256
9206 (base32
9207 "1dzqn1ryfi2rq4zwsgp44bmj2wlfydjg1qbxw2b0z4xdjjy55vxd"))))
9208 (build-system ant-build-system)
9209 (arguments
9210 `(#:jar-name "osgi-service-resolver.jar"
9211 #:tests? #f)); no tests
9212 (inputs
9213 `(("annotation" ,java-osgi-annotation)
9214 ("resource" ,java-osgi-resource)))
9215 (home-page "https://www.osgi.org")
9216 (synopsis "OSGI Resolver service")
9217 (description
9218 "OSGi, for Open Services Gateway initiative framework, is a module system
9219 and service platform for the Java programming language. This package contains
9220 a resolver service that resolves the specified resources in the context supplied
9221 by the caller.")
9222 (license license:asl2.0)))
9223
9224 (define-public java-osgi-util-tracker
9225 (package
9226 (name "java-osgi-util-tracker")
9227 (version "1.5.1")
9228 (source (origin
9229 (method url-fetch)
9230 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9231 "org.osgi.util.tracker/"
9232 version "/org.osgi.util.tracker-"
9233 version "-sources.jar"))
9234 (sha256
9235 (base32
9236 "0c4fh9vxwzsx59r8dygda0gq2gx3z5vfhc3jsphlqwf5w0h403lz"))))
9237 (build-system ant-build-system)
9238 (arguments
9239 `(#:jar-name "osgi-util-tracker.jar"
9240 #:tests? #f)); no tests
9241 (inputs
9242 `(("framework" ,java-osgi-framework)
9243 ("annotation" ,java-osgi-annotation)))
9244 (home-page "https://www.osgi.org")
9245 (synopsis "Bundle tracking")
9246 (description
9247 "OSGi, for Open Services Gateway initiative framework, is a module system
9248 and service platform for the Java programming language. This package contains
9249 bundle tracking utility classes.")
9250 (license license:asl2.0)))
9251
9252 (define-public java-osgi-service-cm
9253 (package
9254 (name "java-osgi-service-cm")
9255 (version "1.5.0")
9256 (source (origin
9257 (method url-fetch)
9258 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9259 "org.osgi.service.cm/"
9260 version "/org.osgi.service.cm-"
9261 version "-sources.jar"))
9262 (sha256
9263 (base32
9264 "1z8kap48y3xi0ggj8v6czglfnpnd94mmismgi2wbqhj1nl5fzbp6"))))
9265 (build-system ant-build-system)
9266 (arguments
9267 `(#:jar-name "osgi-service-cm.jar"
9268 #:tests? #f)); no tests
9269 (inputs
9270 `(("framework" ,java-osgi-framework)
9271 ("annotation" ,java-osgi-annotation)))
9272 (home-page "https://www.osgi.org")
9273 (synopsis "OSGI Configuration Management")
9274 (description
9275 "OSGi, for Open Services Gateway initiative framework, is a module system
9276 and service platform for the Java programming language. This package contains
9277 utility classes for the configuration of services.")
9278 (license license:asl2.0)))
9279
9280 (define-public java-osgi-service-packageadmin
9281 (package
9282 (name "java-osgi-service-packageadmin")
9283 (version "1.2.0")
9284 (source (origin
9285 (method url-fetch)
9286 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9287 "org.osgi.service.packageadmin/"
9288 version "/org.osgi.service.packageadmin-"
9289 version "-sources.jar"))
9290 (sha256
9291 (base32
9292 "041mpxzi7g36wmcily6y4ccn3jx15akpdy8gmhyb7m98x7qfvn52"))))
9293 (build-system ant-build-system)
9294 (arguments
9295 `(#:jar-name "osgi-service-packageadmin.jar"
9296 #:tests? #f)); no tests
9297 (inputs
9298 `(("framework" ,java-osgi-framework)))
9299 (home-page "https://www.osgi.org")
9300 (synopsis "OSGI Package Administration")
9301 (description
9302 "OSGi, for Open Services Gateway initiative framework, is a module system
9303 and service platform for the Java programming language. This package contains
9304 the packageadmin service.")
9305 (license license:asl2.0)))
9306
9307 (define-public java-ops4j-base-lang
9308 (package
9309 (name "java-ops4j-base-lang")
9310 (version "1.5.0")
9311 (source (origin
9312 (method url-fetch)
9313 (uri (string-append "https://github.com/ops4j/org.ops4j.base/"
9314 "archive/base-" version ".tar.gz"))
9315 (sha256
9316 (base32
9317 "18hl3lpchgpv8yh5rlk39l2gif5dlfgb8gxjmncf39pr2dprkniw"))))
9318 (build-system ant-build-system)
9319 (arguments
9320 `(#:jar-name "java-ops4j-base-lang.jar"
9321 #:source-dir "ops4j-base-lang/src/main/java"
9322 #:tests? #f; no tests
9323 #:phases
9324 (modify-phases %standard-phases
9325 (add-before 'build 'add-test-file
9326 (lambda _
9327 ;; That file is required by a test in ops4j-pax-exam-core-spi
9328 (mkdir-p "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang")
9329 (with-output-to-file "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang/pom.properties"
9330 (lambda _
9331 (display
9332 (string-append
9333 "version=" ,version "\n"
9334 "groupId=org.ops4j.base"
9335 "artifactId=ops4j-base-lang\n"))))
9336 #t)))))
9337 (home-page "https://ops4j1.jira.com/wiki/spaces/base/overview")
9338 (synopsis "Utility classes and extensions to be used in OPS4J projects")
9339 (description "OPS4J stands for Open Participation Software for Java. This
9340 package contains utilities and extensions related to @code{java.lang}.")
9341 (license license:asl2.0)))
9342
9343 (define-public java-ops4j-base-monitors
9344 (package
9345 (inherit java-ops4j-base-lang)
9346 (name "java-ops4j-base-monitors")
9347 (arguments
9348 `(#:jar-name "java-ops4j-base-monitors.jar"
9349 #:source-dir "ops4j-base-monitors/src/main/java"
9350 #:tests? #f)); no tests
9351 (inputs
9352 `(("lang" ,java-ops4j-base-lang)))
9353 (description "OPS4J stands for Open Participation Software for Java. This
9354 package contains utilities and extensions related to monitoring.")))
9355
9356 (define-public java-ops4j-base-io
9357 (package
9358 (inherit java-ops4j-base-lang)
9359 (name "java-ops4j-base-io")
9360 (arguments
9361 `(#:jar-name "java-ops4j-base-io.jar"
9362 #:source-dir "ops4j-base-io/src/main/java"
9363 #:test-dir "ops4j-base-io/src/test"
9364 #:test-exclude
9365 (list "**/ListerTest.java")))
9366 (inputs
9367 `(("lang" ,java-ops4j-base-monitors)
9368 ("lang" ,java-ops4j-base-lang)))
9369 (native-inputs
9370 `(("junit" ,java-junit)
9371 ("hamcrest" ,java-hamcrest-core)))
9372 (description "OPS4J stands for Open Participation Software for Java. This
9373 package contains utilities and extensions related to handling streams and files.")))
9374
9375 (define-public java-ops4j-base-util
9376 (package
9377 (inherit java-ops4j-base-lang)
9378 (name "java-ops4j-base-util")
9379 (arguments
9380 `(#:jar-name "java-ops4j-base-util.jar"
9381 #:source-dir "ops4j-base-util/src/main/java"
9382 #:test-dir "ops4j-base-util/src/test"))
9383 (inputs
9384 `(("lang" ,java-ops4j-base-lang)))
9385 (native-inputs
9386 `(("junit" ,java-junit)))
9387 (description "OPS4J stands for Open Participation Software for Java. This
9388 package contains utilities and extensions related to environment, i18n and
9389 mime types.")))
9390
9391 (define-public java-ops4j-base-util-property
9392 (package
9393 (inherit java-ops4j-base-lang)
9394 (name "java-ops4j-base-util-property")
9395 (arguments
9396 `(#:jar-name "java-ops4j-base-util-property.jar"
9397 #:source-dir "ops4j-base-util-property/src/main/java"
9398 #:tests? #f)); no tests
9399 (inputs
9400 `(("lang" ,java-ops4j-base-lang)
9401 ("util" ,java-ops4j-base-util)))
9402 (description "OPS4J stands for Open Participation Software for Java. This
9403 package contains utilities and extensions related to resolving properties from
9404 different sources.")))
9405
9406 (define-public java-ops4j-base-store
9407 (package
9408 (inherit java-ops4j-base-lang)
9409 (name "java-ops4j-base-store")
9410 (arguments
9411 `(#:jar-name "java-ops4j-base-store.jar"
9412 #:source-dir "ops4j-base-store/src/main/java"
9413 #:tests? #f)); no tests
9414 (inputs
9415 `(("lang" ,java-ops4j-base-lang)
9416 ("slf4j" ,java-slf4j-api)
9417 ("io" ,java-ops4j-base-io)))
9418 (description "OPS4J stands for Open Participation Software for Java. This
9419 package contains utilities for storing and retrieving data from an
9420 @code{InputStream}.")))
9421
9422 (define-public java-ops4j-base-spi
9423 (package
9424 (inherit java-ops4j-base-lang)
9425 (name "java-ops4j-base-spi")
9426 (arguments
9427 `(#:jar-name "java-ops4j-base-spi.jar"
9428 #:source-dir "ops4j-base-spi/src/main/java"
9429 #:test-dir "ops4j-base-spi/src/test"))
9430 (native-inputs
9431 `(("junit" ,java-junit)
9432 ("hamcrest" ,java-hamcrest-core)))
9433 (description "OPS4J stands for Open Participation Software for Java. This
9434 package contains utilities for obtaining services via the Java SE 6
9435 @code{ServiceLoader}.")))
9436
9437 (define-public java-aqute-bnd-annotation
9438 (package
9439 (name "java-aqute-bnd-annotation")
9440 (version "3.5.0")
9441 (source (origin
9442 (method url-fetch)
9443 (uri (string-append "https://github.com/bndtools/bnd/archive/"
9444 version ".REL.tar.gz"))
9445 (file-name (string-append name "-" version ".tar.gz"))
9446 (sha256
9447 (base32
9448 "1ggyiq0as0f6cz333a0dh98j72kmvv5pf2s47v9554yh905lfqdl"))))
9449 (build-system ant-build-system)
9450 (arguments
9451 `(#:jar-name "java-aqute-bnd-annotation.jar"
9452 #:source-dir "biz.aQute.bnd.annotation/src"
9453 #:tests? #f)); empty test dir
9454 (home-page "https://bnd.bndtools.org/")
9455 (synopsis "Tools for OSGi")
9456 (description "Bnd is a swiss army knife for OSGi, it creates manifest
9457 headers based on analyzing the class code, it verifies the project settings,
9458 it manages project dependencies, gives diffs jars, and much more.")
9459 (license license:asl2.0)))
9460
9461 (define-public java-aqute-libg
9462 (package
9463 (inherit java-aqute-bnd-annotation)
9464 (name "java-aqute-libg")
9465 (arguments
9466 `(#:jar-name "java-aqute-libg.jar"
9467 ;; The build fails when source/target more recent than 1.7. This
9468 ;; is a known issue. See: https://github.com/bndtools/bnd/issues/1327
9469 ;;
9470 ;; It is closed as won't fix. There is no way to change the source
9471 ;; so that it works on 1.8, and still works on 1.6, the upstream
9472 ;; target. It work fine on 1.7, so we use 1.7.
9473 #:make-flags (list "-Dant.build.javac.source=1.7"
9474 "-Dant.build.javac.target=1.7")
9475 #:phases
9476 (modify-phases %standard-phases
9477 (add-before 'configure 'chdir
9478 ;; Change to aQute.libg directory, so that the relative
9479 ;; paths in the tests aren't broken.
9480 (lambda _
9481 (chdir "aQute.libg")
9482 #t))
9483 (add-before 'check 'create-test-directory
9484 ;; Copy the test directory to test/java, since that's where
9485 ;; ant-build-system's default project in build.xml expects to find
9486 ;; the test classes. Leave a copy in the original place to not
9487 ;; break paths in tests.
9488 (lambda _
9489 (mkdir "src/test")
9490 (copy-recursively "test" "src/test/java")
9491 #t)))))
9492 (inputs
9493 `(("slf4j" ,java-slf4j-api)
9494 ("osgi-annot" ,java-osgi-annotation)
9495 ("java-osgi-cmpn" ,java-osgi-cmpn)
9496 ("osgi" ,java-osgi-core)))
9497 (native-inputs
9498 `(("hamcrest" ,java-hamcrest-core)
9499 ("java-junit" ,java-junit)))))
9500
9501 (define-public java-aqute-bndlib
9502 (package
9503 (inherit java-aqute-bnd-annotation)
9504 (name "java-aqute-bndlib")
9505 (arguments
9506 `(#:jar-name "java-bndlib.jar"
9507 #:source-dir "biz.aQute.bndlib/src"
9508 #:tests? #f)); no tests
9509 (inputs
9510 `(("slf4j" ,java-slf4j-api)
9511 ("osgi-annot" ,java-osgi-annotation)
9512 ("java-aqute-libg" ,java-aqute-libg)
9513 ("java-aqute-bnd-annotation" ,java-aqute-bnd-annotation)
9514 ("java-osgi-service-component-annotations" ,java-osgi-service-component-annotations)
9515 ("java-osgi-service-repository" ,java-osgi-service-repository)
9516 ("java-osgi-service-log" ,java-osgi-service-log)
9517 ("java-osgi-service-metatype-annotations" ,java-osgi-service-metatype-annotations)
9518 ("java-osgi-namespace-contract" ,java-osgi-namespace-contract)
9519 ("java-osgi-namespace-extender" ,java-osgi-namespace-extender)
9520 ("java-osgi-namespace-service" ,java-osgi-namespace-service)
9521 ("promise" ,java-osgi-util-promise)
9522 ("osgi" ,java-osgi-core)))))
9523
9524 (define-public java-ops4j-pax-tinybundles
9525 (package
9526 (name "java-ops4j-pax-tinybundles")
9527 (version "2.1.1")
9528 (source (origin
9529 (method url-fetch)
9530 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.tinybundles/"
9531 "archive/tinybundles-" version ".tar.gz"))
9532 (sha256
9533 (base32
9534 "0y0gq3pvv0iir2b885lmlwnvr724vv7vklzhhr4fs27d7mdkj871"))))
9535 (arguments
9536 `(#:jar-name "java-ops4j-pax-tinybundles.jar"
9537 #:source-dir "src/main/java"
9538 #:test-exclude
9539 ;; Abstract base classes for other tests
9540 (list "**/BndTest.java" "**/CoreTest.java")
9541 #:phases
9542 (modify-phases %standard-phases
9543 (add-before 'check 'fix-version
9544 (lambda _
9545 ;; This test has a reference to an old version of bndlib we are not
9546 ;; packaging. It uses the version referenced in pom.xml. We replace
9547 ;; it with our own version.
9548 (substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
9549 (("[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*")
9550 ,(package-version java-aqute-bndlib)))
9551 #t)))))
9552 (inputs
9553 `(("lang" ,java-ops4j-base-lang)
9554 ("io" ,java-ops4j-base-io)
9555 ("store" ,java-ops4j-base-store)
9556 ("slf4j" ,java-slf4j-api)
9557 ("libg" ,java-aqute-libg)
9558 ("bndlib" ,java-aqute-bndlib)))
9559 (native-inputs
9560 `(("junit" ,java-junit)
9561 ("hamcrest" ,java-hamcrest-core)
9562 ("log4j" ,java-log4j-api)
9563 ("bndannotation" ,java-aqute-bnd-annotation)
9564 ("framework" ,java-osgi-framework)))
9565 (build-system ant-build-system)
9566 (home-page "https://ops4j1.jira.com/wiki/spaces/ops4j/pages/12060312/Tinybundles")
9567 (synopsis "Java APIs to create OSGi related artifacts")
9568 (description "Tinybundles is all about creating OSGi related artifacts like
9569 Bundles, Fragments and Deployment Packages with Java Api. It is very convenient
9570 to create such artifacts on-the-fly inside Tests (like in Pax Exam). On the
9571 other hand, this library can be a foundation of real end user tools that need
9572 to create those artifacts.")
9573 (license license:asl2.0)))
9574
9575 (define-public java-ops4j-pax-exam-core
9576 (package
9577 (name "java-ops4j-pax-exam-core")
9578 (version "4.11.0")
9579 (source (origin
9580 (method url-fetch)
9581 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.exam2/"
9582 "archive/exam-reactor-" version ".tar.gz"))
9583 (sha256
9584 (base32
9585 "08mzw8nkah3rj3vznlplnawspxhp61zgvb44ifqa1rni1cvbms2g"))))
9586 (arguments
9587 `(#:jar-name "java-ops4j-pax-exam-core.jar"
9588 #:source-dir "core/pax-exam/src/main/java"
9589 #:test-dir "core/pax-exam/src/test"))
9590 (inputs
9591 `(("slf4j" ,java-slf4j-api)
9592 ("lang" ,java-ops4j-base-lang)
9593 ("io" ,java-ops4j-base-io)
9594 ("util-property" ,java-ops4j-base-util-property)
9595 ("util-store" ,java-ops4j-base-store)
9596 ("java-osgi-core" ,java-osgi-core)))
9597 (native-inputs
9598 `(("junit" ,java-junit)
9599 ("hamcrest" ,java-hamcrest-core)))
9600 (build-system ant-build-system)
9601 (home-page "https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/overview")
9602 (synopsis "In-Container Testing for OSGi, Java EE and CDI")
9603 (description "Pax Exam creates OSGi bundles for testing purposes. It lets
9604 the user take control of the OSGi framework, the test framework (e.g. JUnit) and
9605 the system under test at the same time.")
9606 (license license:asl2.0)))
9607
9608 (define-public java-ops4j-pax-exam-core-spi
9609 (package
9610 (inherit java-ops4j-pax-exam-core)
9611 (name "java-ops4j-pax-exam-core-spi")
9612 (arguments
9613 `(#:jar-name "java-ops4j-pax-exam-spi.jar"
9614 #:source-dir "src/main/java"
9615 #:test-exclude
9616 (list
9617 ;; Abstract base class, not a test
9618 "**/BaseStagedReactorTest.java"
9619 ;; Depends on org.mortbay.jetty.testwars:test-war-dump
9620 "**/WarBuilderTest.java")
9621 #:phases
9622 (modify-phases %standard-phases
9623 (add-before 'configure 'chdir
9624 (lambda _
9625 ;; Tests assume we are in this directory
9626 (chdir "core/pax-exam-spi")
9627 #t))
9628 (add-before 'check 'fix-tests
9629 (lambda _
9630 ;; One test checks that this file is present.
9631 (mkdir-p "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi")
9632 (with-output-to-file
9633 "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi/pom.properties"
9634 (lambda _
9635 (display
9636 (string-append "artifactId = pax-exam-spi\n"
9637 "version = " ,(package-version java-ops4j-pax-exam-core-spi)))))
9638 ;; Maven puts compilation results in the target directory, while we
9639 ;; put them in the build directory.
9640 (substitute* '("src/test/java/org/ops4j/pax/exam/spi/war/WarBuilderTest.java"
9641 "src/test/java/org/ops4j/pax/exam/spi/war/WarTestProbeBuilderTest.java"
9642 "src/test/java/org/ops4j/pax/exam/spi/war/ZipBuilderTest.java")
9643 (("target") "build"))
9644 ;; One test is expected to fail, but it doesn't throw the expected exception
9645 (substitute* "src/test/java/org/ops4j/pax/exam/spi/reactors/BaseStagedReactorTest.java"
9646 (("AssertionError") "IllegalArgumentException"))
9647 #t)))))
9648 (inputs
9649 `(("java-ops4j-pax-exam-core" ,java-ops4j-pax-exam-core)
9650 ("lang" ,java-ops4j-base-lang)
9651 ("monitors" ,java-ops4j-base-monitors)
9652 ("store" ,java-ops4j-base-store)
9653 ("io" ,java-ops4j-base-io)
9654 ("spi" ,java-ops4j-base-spi)
9655 ("osgi" ,java-osgi-core)
9656 ("slf4j" ,java-slf4j-api)
9657 ("tinybundles" ,java-ops4j-pax-tinybundles)))
9658 (native-inputs
9659 `(("mockito" ,java-mockito-1)
9660 ("junit" ,java-junit)
9661 ("hamcrest" ,java-hamcrest-core)
9662 ("cglib" ,java-cglib)
9663 ("objenesis" ,java-objenesis)
9664 ("asm" ,java-asm)))))
9665
9666 (define-public java-ops4j-pax-exam-core-junit
9667 (package
9668 (inherit java-ops4j-pax-exam-core)
9669 (name "java-ops4j-pax-exam-core-junit")
9670 (arguments
9671 `(#:jar-name "ops4j-pax-exam-core-junit.jar"
9672 #:source-dir "drivers/pax-exam-junit4/src/main/java"
9673 #:tests? #f)); no tests
9674 (inputs
9675 `(("junit" ,java-junit)
9676 ("slf4j" ,java-slf4j-api)
9677 ("core" ,java-ops4j-pax-exam-core)
9678 ("spi" ,java-ops4j-pax-exam-core-spi)))
9679 (native-inputs '())))
9680
9681 (define-public java-fasterxml-jackson-annotations
9682 (package
9683 (name "java-fasterxml-jackson-annotations")
9684 (version "2.9.4")
9685 (source (origin
9686 (method url-fetch)
9687 (uri (string-append "https://github.com/FasterXML/"
9688 "jackson-annotations/archive/"
9689 "jackson-annotations-" version ".tar.gz"))
9690 (sha256
9691 (base32
9692 "0mr95xd0da6a4g95zvrl1ryk5n5zv2rc696w3xnsr5hxk2gicfc4"))))
9693 (build-system ant-build-system)
9694 (arguments
9695 `(#:jar-name "jackson-annotations.jar"
9696 #:source-dir "src/main/java"
9697 #:test-dir "src/test"))
9698 (native-inputs
9699 `(("junit" ,java-junit)))
9700 (home-page "https://github.com/FasterXML/jackson-annotations")
9701 (synopsis "General purpose annotations for the Jackson Data Processor")
9702 (description "This package contains general purpose annotations for the
9703 Jackson Data Processor, used on value and handler types. The only annotations
9704 not included are ones that require dependency to the Databind package.")
9705 (license license:asl2.0)))
9706
9707 (define-public java-fasterxml-jackson-core
9708 (package
9709 (name "java-fasterxml-jackson-core")
9710 (version "2.9.4")
9711 (source (origin
9712 (method url-fetch)
9713 (uri (string-append "https://github.com/FasterXML/"
9714 "jackson-core/archive/"
9715 "jackson-core-" version ".tar.gz"))
9716 (sha256
9717 (base32
9718 "159hsnk17jr1gyzkf01cxvsn45srnk37g949r7364qlsr527gjgd"))))
9719 (build-system ant-build-system)
9720 (arguments
9721 `(#:jar-name "jackson-core.jar"
9722 #:source-dir "src/main/java"
9723 #:test-dir "src/test"
9724 #:test-exclude
9725 (list
9726 ;; Expected failure. pom.xml excludes these
9727 "**/failing/**"
9728 ;; Base classes that have no constructor for junit
9729 "**/BaseTest.java"
9730 "**/ConcurrencyReadTest.java"
9731 "**/ManualCharAccessTest.java"
9732 "**/ManualCharAccessTest.java"
9733 "**/TrailingCommasTest.java"
9734 "**/AsyncMissingValuesInObjectTest.java"
9735 "**/AsyncMissingValuesInArrayTest.java")
9736 #:phases
9737 (modify-phases %standard-phases
9738 (add-before 'configure 'generate-PackageVersion.java
9739 (lambda _
9740 (let* ((out "src/main/java/com/fasterxml/jackson/core/json/PackageVersion.java")
9741 (in (string-append out ".in")))
9742 (copy-file in out)
9743 (substitute* out
9744 (("@package@") "com.fasterxml.jackson.core.json")
9745 (("@projectversion@") ,version)
9746 (("@projectgroupid@") "com.fasterxml.jackson.core")
9747 (("@projectartifactid@") "jackson-core")))
9748 #t))
9749 (add-before 'build 'copy-resources
9750 (lambda _
9751 (copy-recursively "src/main/resources"
9752 "build/classes")
9753 #t))
9754 (add-before 'check 'copy-test-resources
9755 (lambda _
9756 (copy-recursively "src/test/resources"
9757 "build/test-classes")
9758 #t)))))
9759 (native-inputs
9760 `(("junit" ,java-junit)
9761 ("hamcrest" ,java-hamcrest-core)))
9762 (home-page "https://github.com/FasterXML/jackson-core")
9763 (synopsis "Low-level streaming parser and generator abstractions")
9764 (description "This package contains core low-level incremental
9765 (streaming) parser and generator abstractions used by the Jackson Data
9766 Processor. It also includes the default implementation of handler types
9767 (parser, generator) that handle JSON format.")
9768 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
9769
9770 (define-public java-fasterxml-jackson-databind
9771 (package
9772 (name "java-fasterxml-jackson-databind")
9773 (version "2.9.4")
9774 (source (origin
9775 (method url-fetch)
9776 (uri (string-append "https://github.com/FasterXML/"
9777 "jackson-databind/archive/"
9778 "jackson-databind-" version ".tar.gz"))
9779 (sha256
9780 (base32
9781 "1zd2cw4z6kdkbx8za96xh9pyicv2a2l7y0rkcx2fqd8hv6d47s08"))))
9782 (build-system ant-build-system)
9783 (arguments
9784 `(#:jar-name "jackson-databind.jar"
9785 #:source-dir "src/main/java"
9786 #:tests? #f; requires javax.measures for which I can't find a free implementation
9787 #:phases
9788 (modify-phases %standard-phases
9789 (add-before 'configure 'generate-PackageVersion.java
9790 (lambda _
9791 (let* ((out "src/main/java/com/fasterxml/jackson/databind/cfg/PackageVersion.java")
9792 (in (string-append out ".in")))
9793 (copy-file in out)
9794 (substitute* out
9795 (("@package@") "com.fasterxml.jackson.databind.cfg")
9796 (("@projectversion@") ,version)
9797 (("@projectgroupid@") "com.fasterxml.jackson.databind")
9798 (("@projectartifactid@") "jackson-databind")))
9799 #t))
9800 (add-before 'build 'copy-resources
9801 (lambda _
9802 (copy-recursively "src/main/resources" "build/classes")
9803 #t)))))
9804 (inputs
9805 `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
9806 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)))
9807 (home-page "https://github.com/FasterXML/jackson-databind")
9808 (synopsis "Data-binding functionality and tree-model for the Jackson Data Processor")
9809 (description "This package contains the general-purpose data-binding
9810 functionality and tree-model for Jackson Data Processor. It builds on core
9811 streaming parser/generator package, and uses Jackson Annotations for
9812 configuration.")
9813 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
9814
9815 (define-public java-fasterxml-jackson-modules-base-jaxb
9816 (package
9817 (name "java-fasterxml-jackson-modules-base-jaxb")
9818 (version "2.9.4")
9819 (source (origin
9820 (method url-fetch)
9821 (uri (string-append "https://github.com/FasterXML/"
9822 "jackson-modules-base/archive/"
9823 "jackson-modules-base-" version ".tar.gz"))
9824 (sha256
9825 (base32
9826 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
9827 (build-system ant-build-system)
9828 (arguments
9829 `(#:jar-name "jackson-modules-base-jaxb.jar"
9830 #:source-dir "jaxb/src/main/java"
9831 #:test-dir "jaxb/src/test"
9832 #:test-exclude
9833 ;; Base class for tests
9834 (list "**/BaseJaxbTest.java")
9835 #:phases
9836 (modify-phases %standard-phases
9837 (add-before 'configure 'generate-PackageVersion.java
9838 (lambda _
9839 (let* ((out (string-append "jaxb/src/main/java/com/fasterxml/"
9840 "jackson/module/jaxb/PackageVersion.java"))
9841 (in (string-append out ".in")))
9842 (copy-file in out)
9843 (substitute* out
9844 (("@package@") "com.fasterxml.jackson.module.jaxb")
9845 (("@projectversion@") ,version)
9846 (("@projectgroupid@") "com.fasterxml.jackson.module.jaxb")
9847 (("@projectartifactid@") "jackson-module-jaxb")))
9848 #t))
9849 (add-before 'build 'copy-resources
9850 (lambda _
9851 (copy-recursively "jaxb/src/main/resources" "build/classes")
9852 #t)))))
9853 (inputs
9854 `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
9855 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
9856 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)))
9857 (native-inputs
9858 `(("java-junit" ,java-junit)))
9859 (home-page "https://github.com/FasterXML/jackson-modules-base")
9860 (synopsis "Jaxb annotations jackson module")
9861 (description "This package is the jaxb annotations module for jackson.")
9862 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
9863
9864 (define-public java-fasterxml-jackson-modules-base-mrbean
9865 (package
9866 (name "java-fasterxml-jackson-modules-base-mrbean")
9867 (version "2.9.4")
9868 (source (origin
9869 (method url-fetch)
9870 (uri (string-append "https://github.com/FasterXML/"
9871 "jackson-modules-base/archive/"
9872 "jackson-modules-base-" version ".tar.gz"))
9873 (sha256
9874 (base32
9875 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
9876 (build-system ant-build-system)
9877 (arguments
9878 `(#:jar-name "jackson-modules-base-mrbean.jar"
9879 #:source-dir "mrbean/src/main/java"
9880 #:test-dir "mrbean/src/test"
9881 #:test-exclude
9882 ;; Base class for tests
9883 (list "**/BaseTest.java")
9884 #:phases
9885 (modify-phases %standard-phases
9886 (add-before 'configure 'generate-PackageVersion.java
9887 (lambda _
9888 (let* ((out (string-append "mrbean/src/main/java/com/fasterxml/"
9889 "jackson/module/mrbean/PackageVersion.java"))
9890 (in (string-append out ".in")))
9891 (copy-file in out)
9892 (substitute* out
9893 (("@package@") "com.fasterxml.jackson.module.mrbean")
9894 (("@projectversion@") ,version)
9895 (("@projectgroupid@") "com.fasterxml.jackson.module.mrbean")
9896 (("@projectartifactid@") "jackson-module-mrbean")))
9897 #t)))))
9898 (inputs
9899 `(("java-asm" ,java-asm)
9900 ("java-fasterxml-jackson-annotations"
9901 ,java-fasterxml-jackson-annotations)
9902 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
9903 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)))
9904 (native-inputs
9905 `(("java-junit" ,java-junit)))
9906 (home-page "https://github.com/FasterXML/jackson-modules-base")
9907 (synopsis "POJO type materialization for Java")
9908 (description "This package implements POJO type materialization.
9909 Databinders can construct implementation classes for Java interfaces as part
9910 of deserialization.")
9911 (license license:asl2.0)))
9912
9913 (define-public java-snakeyaml
9914 (package
9915 (name "java-snakeyaml")
9916 (version "1.18")
9917 (source (origin
9918 (method url-fetch)
9919 (uri (string-append "https://bitbucket.org/asomov/snakeyaml/get/v"
9920 version ".tar.gz"))
9921 (file-name (string-append name "-" version ".tar.gz"))
9922 (sha256
9923 (base32
9924 "0474cqcv46zgv9bhms2vgawakq1vyj0hp3h3f1bfys46msia90bh"))))
9925 (build-system ant-build-system)
9926 (arguments
9927 `(#:jar-name "java-snakeyaml.jar"
9928 #:source-dir "src/main/java"
9929 ;; Tests require velocity, a cyclic dependency, and
9930 ;; java-spring-framework-context which is not packaged.
9931 #:tests? #f))
9932 (home-page "https://bitbucket.org/asomov/snakeyaml")
9933 (synopsis "YAML processor")
9934 (description "SnakeYAML is a YAML processor for the Java Virtual Machine.")
9935 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
9936
9937 (define-public java-fasterxml-jackson-dataformat-yaml
9938 (package
9939 (name "java-fasterxml-jackson-dataformat-yaml")
9940 (version "2.9.4")
9941 (source (origin
9942 (method url-fetch)
9943 (uri (string-append "https://github.com/FasterXML/"
9944 "jackson-dataformats-text/archive/"
9945 "jackson-dataformats-text-" version ".tar.gz"))
9946 (sha256
9947 (base32
9948 "1hikl06khaxbg439avf442qifcadap8w0lx13f0nnhp2vh3dkbz7"))))
9949 (build-system ant-build-system)
9950 (arguments
9951 `(#:jar-name "jackson-dataformat-yaml.jar"
9952 #:source-dir "yaml/src/main/java"
9953 #:test-dir "yaml/src/test"
9954 #:test-exclude (list "**/failing/**.java")
9955 #:phases
9956 (modify-phases %standard-phases
9957 (add-before 'configure 'generate-PackageVersion.java
9958 (lambda _
9959 (let* ((out "yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/PackageVersion.java")
9960 (in (string-append out ".in")))
9961 (copy-file in out)
9962 (substitute* out
9963 (("@package@") "com.fasterxml.jackson.dataformat.yaml")
9964 (("@projectversion@") ,version)
9965 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.yaml")
9966 (("@projectartifactid@") "jackson-dataformat-yaml")))
9967 #t)))))
9968 (inputs
9969 `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
9970 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
9971 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
9972 ("java-snakeyaml" ,java-snakeyaml)))
9973 (native-inputs
9974 `(("junit" ,java-junit)
9975 ("hamcrest" ,java-hamcrest-core)
9976 ("java-ops4j-pax-exam-core-spi" ,java-ops4j-pax-exam-core-spi)
9977 ("java-ops4j-pax-exam-core-junit" ,java-ops4j-pax-exam-core-junit)
9978 ("java-ops4j-pax-exam" ,java-ops4j-pax-exam-core)))
9979 (home-page "https://github.com/FasterXML/jackson-dataformats-text")
9980 (synopsis "Yaml backend for Jackson")
9981 (description "Dataformat backends are used to support format alternatives
9982 to JSON, supported by default. This is done by sub-classing Jackson core
9983 abstractions.")
9984 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
9985
9986 (define-public java-stax2-api
9987 (package
9988 (name "java-stax2-api")
9989 (version "4.0.0")
9990 (source (origin
9991 (method url-fetch)
9992 (uri (string-append "https://github.com/FasterXML/stax2-api/archive/"
9993 "stax2-api-" version ".tar.gz"))
9994 (sha256
9995 (base32
9996 "1amc1si0l0hyyw2sawmnzy4hkna3z6fp195y4nm5m9wb9ld5awkq"))))
9997 (build-system ant-build-system)
9998 (arguments
9999 `(#:jar-name "java-stax2-api.jar"
10000 #:source-dir "src/main/java"
10001 #:tests? #f)); no tests
10002 (home-page "https://github.com/FasterXML/stax2-api")
10003 (synopsis "Stax2 API")
10004 (description "Stax2 API is an extension to basic Stax 1.0 API that adds
10005 significant new functionalities, such as full-featured bi-direction validation
10006 interface and high-performance Typed Access API.")
10007 (license license:bsd-2)))
10008
10009 (define-public java-woodstox-core
10010 (package
10011 (name "java-woodstox-core")
10012 (version "5.0.3")
10013 (source (origin
10014 (method git-fetch)
10015 (uri (git-reference
10016 (url "https://github.com/FasterXML/woodstox")
10017 (commit (string-append "woodstox-core-" version))))
10018 (file-name (git-file-name name version))
10019 (sha256
10020 (base32
10021 "0bfylk24a967hwxprxqbg6cdvm6n4ldcarp54yg980viwvjiglyp"))))
10022 (build-system ant-build-system)
10023 (arguments
10024 `(#:jar-name "woodstox.jar"
10025 #:test-exclude
10026 (list "**/Base*.java" "failing/**")
10027 #:phases
10028 (modify-phases %standard-phases
10029 (add-before 'build 'remove-msv-dep
10030 (lambda _
10031 ;; we don't need osgi, and it depends on msv
10032 (delete-file-recursively "src/main/java/com/ctc/wstx/osgi")
10033 ;; msv's latest release is from 2011 and we don't need it
10034 (delete-file-recursively "src/main/java/com/ctc/wstx/msv")
10035 (delete-file-recursively "src/test/java/wstxtest/osgi")
10036 (delete-file-recursively "src/test/java/wstxtest/msv")
10037 #t))
10038 (add-before 'build 'copy-resources
10039 (lambda _
10040 (copy-recursively "src/main/resources" "build/classes")
10041 #t)))))
10042 (inputs
10043 `(("stax2" ,java-stax2-api)))
10044 (native-inputs
10045 `(("junit" ,java-junit)))
10046 (home-page "https://github.com/FasterXML/woodstox")
10047 (synopsis "Stax XML API implementation")
10048 (description "Woodstox is a stax XML API implementation.")
10049 (license license:asl2.0)))
10050
10051 (define-public java-fasterxml-jackson-dataformat-xml
10052 (package
10053 (name "java-fasterxml-jackson-dataformat-xml")
10054 (version "2.9.4")
10055 (source (origin
10056 (method git-fetch)
10057 (uri (git-reference
10058 (url "https://github.com/FasterXML/jackson-dataformat-xml")
10059 (commit (string-append "jackson-dataformat-xml-" version))))
10060 (file-name (git-file-name name version))
10061 (sha256
10062 (base32
10063 "0s1wl65mbs57c2hz2v8rnh8i04y5lpyyvnjz562j5j6b83vwwpfx"))))
10064 (build-system ant-build-system)
10065 (arguments
10066 `(#:jar-name "jackson-dataformat-xml.jar"
10067 #:source-dir "src/main/java"
10068 #:test-exclude
10069 (list "**/failing/**")
10070 #:phases
10071 (modify-phases %standard-phases
10072 (add-before 'configure 'generate-PackageVersion.java
10073 (lambda _
10074 (let* ((out "src/main/java/com/fasterxml/jackson/dataformat/xml/PackageVersion.java")
10075 (in (string-append out ".in")))
10076 (copy-file in out)
10077 (newline)
10078 (substitute* out
10079 (("@package@") "com.fasterxml.jackson.dataformat.xml")
10080 (("@projectversion@") ,version)
10081 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.xml")
10082 (("@projectartifactid@") "jackson-dataformat-xml")))
10083 #t))
10084 (add-before 'build 'copy-resources
10085 (lambda _
10086 (copy-recursively "src/main/resources" "build/classes")
10087 #t)))))
10088 (inputs
10089 `(("jackson-annotations" ,java-fasterxml-jackson-annotations)
10090 ("jackson-core" ,java-fasterxml-jackson-core)
10091 ("jackson-modules-base-jaxb" ,java-fasterxml-jackson-modules-base-jaxb)
10092 ("jackson-databind" ,java-fasterxml-jackson-databind)
10093 ("stax2-api" ,java-stax2-api)
10094 ("woodstox" ,java-woodstox-core)))
10095 (native-inputs
10096 `(("junit" ,java-junit)
10097 ("hamcrest" ,java-hamcrest-core)))
10098 (home-page "https://github.com/FasterXML/jackson-dataformat-xml")
10099 (synopsis "Read and write XML")
10100 (description "This package contains Jackson extension component for reading
10101 and writing XML encoded data.
10102
10103 Further, the goal is to emulate how JAXB data-binding works with \"Code-first\"
10104 approach (that is, no support is added for \"Schema-first\" approach). Support
10105 for JAXB annotations is provided by JAXB annotation module; this module
10106 provides low-level abstractions (@code{JsonParser}, @code{JsonGenerator},
10107 @code{JsonFactory}) as well as small number of higher level overrides needed to
10108 make data-binding work.")
10109 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10110
10111 (define-public java-hdrhistogram
10112 (package
10113 (name "java-hdrhistogram")
10114 (version "2.1.9")
10115 (source (origin
10116 (method git-fetch)
10117 (uri (git-reference
10118 (url "https://github.com/HdrHistogram/HdrHistogram")
10119 (commit (string-append "HdrHistogram-" version))))
10120 (file-name (git-file-name name version))
10121 (sha256
10122 (base32
10123 "1cw8aa1vk258k42xs6wpy72m4gbai540jq032qsa7c5586iawx2d"))))
10124 (build-system ant-build-system)
10125 (arguments
10126 `(#:jar-name "java-hdrhistogram.jar"
10127 #:source-dir "src/main/java"
10128 #:phases
10129 (modify-phases %standard-phases
10130 (add-after 'unpack 'make-files-writable
10131 (lambda _
10132 (for-each make-file-writable (find-files "."))
10133 #t))
10134 (add-before 'configure 'set-version
10135 (lambda _
10136 (let* ((version-java "src/main/java/org/HdrHistogram/Version.java")
10137 (template (string-append version-java ".template")))
10138 (copy-file template version-java)
10139 (substitute* version-java
10140 (("\\$VERSION\\$") ,version)
10141 (("\\$BUILD_TIME\\$") "0"))
10142 #t))))))
10143 (native-inputs
10144 `(("junit" ,java-junit)
10145 ("hamcrest" ,java-hamcrest-core)))
10146 (home-page "https://hdrhistogram.github.io/HdrHistogram")
10147 (synopsis "High dynamic range histogram")
10148 (description "Hdrhistogram creates histograms that support
10149 recording and analyzing sampled data value counts across a configurable integer
10150 value range with configurable value precision within the range. Value precision
10151 is expressed as the number of significant digits in the value recording, and
10152 provides control over value quantization behavior across the value range and
10153 the subsequent value resolution at any given level.")
10154 (license license:public-domain)))
10155
10156 (define-public java-cofoja
10157 (package
10158 (name "java-cofoja")
10159 (version "1.3")
10160 (source (origin
10161 (method git-fetch)
10162 (uri (git-reference
10163 (url "https://github.com/nhatminhle/cofoja")
10164 (commit (string-append "v" version))))
10165 (file-name (string-append "java-cofoja-" version "-checkout"))
10166 (sha256
10167 (base32
10168 "0p7sz8y5xgpi5rx1qwn6587fkd52qr3ha3ybh14gqcyxhikl525w"))))
10169 (build-system ant-build-system)
10170 (arguments
10171 `(#:build-target "dist"
10172 #:test-target "test"
10173 #:jdk ,icedtea-8
10174 #:make-flags
10175 (list "-Ddist.dir=dist")
10176 #:modules ((guix build ant-build-system)
10177 (guix build java-utils)
10178 (guix build utils)
10179 (srfi srfi-1)
10180 (ice-9 match))
10181 #:phases
10182 (modify-phases %standard-phases
10183 ;; The bulid system ignores the class path the ant-build-system sets
10184 ;; up and instead expects to find all dependencies in the "lib"
10185 ;; directory.
10186 (add-after 'unpack 'create-libdir
10187 (lambda* (#:key inputs #:allow-other-keys)
10188 (mkdir-p "lib")
10189 (for-each
10190 (lambda (file)
10191 (let ((target (string-append "lib/" (basename file))))
10192 (unless (file-exists? target)
10193 (symlink file target))))
10194 (append-map (match-lambda
10195 ((label . dir)
10196 (find-files dir "\\.jar$")))
10197 inputs))
10198 #t))
10199 (replace 'install (install-jars "dist")))))
10200 (inputs
10201 `(("java-asm" ,java-asm)))
10202 (native-inputs
10203 `(("java-junit" ,java-junit)))
10204 (home-page "https://github.com/nhatminhle/cofoja")
10205 (synopsis "Contracts for Java")
10206 (description "Contracts for Java, or Cofoja for short, is a contract
10207 programming framework and test tool for Java, which uses annotation processing
10208 and bytecode instrumentation to provide run-time checking. (In particular,
10209 this is not a static analysis tool.)")
10210 (license license:lgpl3+)))
10211
10212 (define-public java-aopalliance
10213 (package
10214 (name "java-aopalliance")
10215 (version "1.0")
10216 (source (origin
10217 (method git-fetch)
10218 ;; Note: this git repository is not official, but contains the
10219 ;; source code that is in the CVS repository. Downloading the
10220 ;; tarball from sourceforge is undeterministic, and the cvs download
10221 ;; fails.
10222 (uri (git-reference
10223 (url "https://github.com/hoverruan/aopalliance")
10224 (commit "0d7757ae204e5876f69431421fe9bc2a4f01e8a0")))
10225 (file-name (string-append name "-" version))
10226 (sha256
10227 (base32
10228 "0rsg2b0v3hxlq2yk1i3m2gw3xwq689j3cwx9wbxvqfpdcjbca0qr"))))
10229 (build-system ant-build-system)
10230 (arguments
10231 `(#:jar-name "java-aopalliance.jar"
10232 #:jdk ,icedtea-8
10233 #:tests? #f; no tests
10234 #:source-dir "aopalliance/src/main"
10235 #:modules ((guix build ant-build-system)
10236 (guix build utils)
10237 (guix build maven pom)
10238 (guix build java-utils)
10239 (sxml simple))
10240 #:phases
10241 (modify-phases %standard-phases
10242 (add-before 'install 'create-pom
10243 (lambda _
10244 (with-output-to-file "pom.xml"
10245 (lambda _
10246 (sxml->xml
10247 `((project
10248 (modelVersion "4.0.0")
10249 (name "aopalliance")
10250 (groupId "aopalliance")
10251 (artifactId "aopalliance")
10252 (version "1.0"))))))
10253 #t))
10254 (replace 'install
10255 (install-from-pom "pom.xml")))))
10256 (home-page "http://aopalliance.sourceforge.net")
10257 (synopsis "Aspect-Oriented Programming")
10258 (description "The AOP Alliance project is a joint project between several
10259 software engineering people who are interested in Aspect-Oriented Programming
10260 (AOP) and Java.")
10261 (license license:public-domain)))
10262
10263 (define-public java-javax-inject
10264 (package
10265 (name "java-javax-inject")
10266 (version "1")
10267 (source (origin
10268 (method git-fetch)
10269 (uri (git-reference
10270 (url "https://github.com/javax-inject/javax-inject")
10271 (commit version)))
10272 (file-name (git-file-name name version))
10273 (sha256
10274 (base32
10275 "1rspl0nkvk1jif6nccikw93xic6ljj2b6kpy2mffwi2mnvc13j7x"))))
10276 (build-system ant-build-system)
10277 (arguments
10278 `(#:jar-name "java-javax-inject.jar"
10279 #:tests? #f; no tests
10280 #:phases
10281 (modify-phases %standard-phases
10282 (replace 'install
10283 (install-from-pom "pom.xml")))))
10284 (home-page "https://github.com/javax-inject/javax-inject")
10285 (synopsis "JSR-330: Dependency Injection for Java")
10286 (description "This package specifies a means for obtaining objects in such
10287 a way as to maximize reusability, testability and maintainability compared to
10288 traditional approaches such as constructors, factories, and service locators
10289 (e.g., JNDI). This process, known as dependency injection, is beneficial to
10290 most nontrivial applications.
10291
10292 Many types depend on other types. For example, a @var{Stopwatch} might depend
10293 on a @var{TimeSource}. The types on which a type depends are known as its
10294 dependencies. The process of finding an instance of a dependency to use at run
10295 time is known as resolving the dependency. If no such instance can be found,
10296 the dependency is said to be unsatisfied, and the application is broken.")
10297 (license license:asl2.0)))
10298
10299 (define-public java-guice
10300 (package
10301 (name "java-guice")
10302 (version "4.1")
10303 (source (origin
10304 (method git-fetch)
10305 (uri (git-reference
10306 (url "https://github.com/google/guice")
10307 (commit version)))
10308 (file-name (git-file-name name version))
10309 (modules '((guix build utils)))
10310 (snippet
10311 `(begin
10312 (for-each delete-file (find-files "." ".*.jar")) #t))
10313 (sha256
10314 (base32
10315 "18im5hdfl4q1b9chww2s1ii60sn3ydyyar32a2sf2p2g8zlbdswq"))))
10316 (build-system ant-build-system)
10317 (arguments
10318 `(#:jar-name "java-guice.jar"
10319 #:jdk ,icedtea-8
10320 #:tests? #f; FIXME: tests are not in a java sub directory
10321 #:source-dir "core/src"
10322 #:phases
10323 (modify-phases %standard-phases
10324 (add-after 'unpack 'make-files-writable
10325 (lambda _
10326 (for-each make-file-writable (find-files "."))
10327 #t))
10328 (replace 'install
10329 (install-from-pom "core/pom.xml")))))
10330 (propagated-inputs
10331 `(("java-aopalliance" ,java-aopalliance)
10332 ("java-asm" ,java-asm)
10333 ("java-cglib" ,java-cglib)
10334 ("java-guava" ,java-guava)
10335 ("java-javax-inject" ,java-javax-inject)
10336 ("java-guice-parent-pom" ,java-guice-parent-pom)))
10337 (home-page "https://github.com/google/guice")
10338 (synopsis "Lightweight dependency injection framework")
10339 (description "Guice is a lightweight dependency injection framework for
10340 Java 6 and above.")
10341 (license license:asl2.0)))
10342
10343 (define-public java-guice-servlet
10344 (package
10345 (inherit java-guice)
10346 (name "java-guice-servlet")
10347 (arguments
10348 `(#:jar-name "guice-servlet.jar"
10349 #:source-dir "extensions/servlet/src/"
10350 #:jdk ,icedtea-8
10351 #:tests? #f ; FIXME: not in a java subdir
10352 #:phases
10353 (modify-phases %standard-phases
10354 (add-after 'unpack 'make-files-writable
10355 (lambda _
10356 (for-each make-file-writable (find-files "."))
10357 #t)))))
10358 (inputs
10359 `(("guice" ,java-guice)
10360 ("servlet" ,java-classpathx-servletapi)
10361 ,@(package-inputs java-guice)))))
10362
10363 (define java-guice-parent-pom
10364 (package
10365 (inherit java-guice)
10366 (name "java-guice-parent-pom")
10367 (arguments
10368 `(#:tests? #f
10369 #:phases
10370 (modify-phases %standard-phases
10371 (delete 'configure)
10372 (delete 'build)
10373 (add-after 'install 'install-extensions
10374 (install-pom-file "extensions/pom.xml"))
10375 (replace 'install
10376 (install-pom-file "pom.xml")))))
10377 (propagated-inputs
10378 `(("java-google-parent-pom" ,java-google-parent-pom-5)))))
10379
10380 (define java-google-parent-pom-5
10381 (package
10382 (name "java-google-parent-pom")
10383 (version "5")
10384 (source (origin
10385 (method git-fetch)
10386 (uri (git-reference
10387 (url "https://github.com/google/google-maven-parents")
10388 (commit (string-append "google-" version))))
10389 (file-name (git-file-name name version))
10390 (sha256
10391 (base32
10392 "0zb7hx24p8k8rfdvix2vsbfqn73jhrycdndvhf8j5gbii9wbqibv"))))
10393 (build-system ant-build-system)
10394 (arguments
10395 `(#:tests? #f
10396 #:phases
10397 (modify-phases %standard-phases
10398 (delete 'configure)
10399 (delete 'build)
10400 (replace 'install
10401 (install-pom-file "pom.xml")))))
10402 (home-page "https://github.com/google/google-maven-parents")
10403 (synopsis "Google parent pom")
10404 (description "This package contains the Maven parent POM for other Google
10405 Java projects.")
10406 (license license:asl2.0)))
10407
10408 (define-public java-assertj
10409 (package
10410 (name "java-assertj")
10411 (version "3.8.0")
10412 (source (origin
10413 (method git-fetch)
10414 (uri (git-reference
10415 (url "https://github.com/joel-costigliola/assertj-core")
10416 (commit (string-append "assertj-core-" version))))
10417 (file-name (git-file-name name version))
10418 (sha256
10419 (base32
10420 "1k35cg2in7pzk4pbdjryr0pll5lgk1r6ngrn0j8cdlgi7w8zh2d1"))))
10421 (build-system ant-build-system)
10422 (arguments
10423 `(#:jar-name "java-assertj.jar"
10424 #:jdk ,icedtea-8
10425 #:source-dir "src/main/java"
10426 #:tests? #f)); depends on tng-junit which depends on assertj
10427 (inputs
10428 `(("cglib" ,java-cglib)
10429 ("junit" ,java-junit)
10430 ("hamcrest" ,java-hamcrest-core)))
10431 (native-inputs
10432 `(("mockito" ,java-mockito-1)))
10433 (home-page "https://joel-costigliola.github.io/assertj/index.html")
10434 (synopsis "Fluent assertions for java")
10435 (description "AssertJ core is a Java library that provides a fluent
10436 interface for writing assertions. Its main goal is to improve test code
10437 readability and make maintenance of tests easier.")
10438 (license license:asl2.0)))
10439
10440 (define-public java-jboss-javassist
10441 (package
10442 (name "java-jboss-javassist")
10443 (version "3.21.0")
10444 (source (origin
10445 (method git-fetch)
10446 (uri (git-reference
10447 (url "https://github.com/jboss-javassist/javassist")
10448 (commit
10449 (string-append "rel_"
10450 (string-map
10451 (lambda (x) (if (eq? x #\.) #\_ x)) version)
10452 "_ga"))))
10453 (file-name (git-file-name name version))
10454 (sha256
10455 (base32
10456 "0h3zlcyqiaq01fspm69h7vki67raw305w89p4ha8vlhpzw02qifm"))
10457 (modules '((guix build utils)))
10458 (snippet
10459 '(begin
10460 (delete-file "javassist.jar")))))
10461 (build-system ant-build-system)
10462 (arguments
10463 `(#:jar-name "java-jboss-javassist.jar"
10464 #:jdk ,icedtea-8
10465 #:source-dir "src/main"
10466 #:tests? #f; FIXME: requires junit-awtui and junit-swingui from junit3
10467 #:phases
10468 (modify-phases %standard-phases
10469 (add-after 'unpack 'make-files-writable
10470 (lambda _
10471 (for-each make-file-writable (find-files "."))
10472 #t)))))
10473 (native-inputs
10474 `(("junit" ,java-junit)))
10475 (home-page "https://github.com/jboss-javassist/javassist")
10476 (synopsis "Java bytecode engineering toolkit")
10477 (description "Javassist (JAVA programming ASSISTant) makes Java bytecode
10478 manipulation simple. It is a class library for editing bytecodes in Java; it
10479 enables Java programs to define a new class at runtime and to modify a class
10480 file when the JVM loads it.")
10481 (license (list license:gpl2 license:cddl1.0)))); either gpl2 only or cddl.
10482
10483 (define-public java-jcommander
10484 (package
10485 (name "java-jcommander")
10486 (version "1.71")
10487 (source (origin
10488 (method git-fetch)
10489 (uri (git-reference
10490 (url "https://github.com/cbeust/jcommander")
10491 (commit version)))
10492 (file-name (git-file-name name version))
10493 (sha256
10494 (base32
10495 "12vcpc19sd7jhvjgp7xz1qjanfix162xb3x2q5zah93rjklj1h57"))))
10496 (build-system ant-build-system)
10497 (arguments
10498 `(#:jar-name "java-jcommander.jar"
10499 #:jdk ,icedtea-8
10500 #:tests? #f; requires testng which depends on jcommander
10501 #:source-dir "src/main/java"))
10502 (home-page "https://jcommander.org")
10503 (synopsis "Command line parameters parser")
10504 (description "JCommander is a very small Java framework that makes it
10505 trivial to parse command line parameters. Parameters are declared with
10506 annotations.")
10507 (license license:asl2.0)))
10508
10509 (define-public java-bsh
10510 (package
10511 (name "java-bsh")
10512 (version "2.0b6")
10513 (source (origin
10514 (method git-fetch)
10515 (uri (git-reference
10516 (url "https://github.com/beanshell/beanshell")
10517 (commit version)))
10518 (file-name (git-file-name name version))
10519 (sha256
10520 (base32
10521 "0kz3f0xjack6c9syssi4qjw1rbd3q5963sk5pmr143hiibxa9csw"))
10522 (modules '((guix build utils)))
10523 (snippet
10524 '(begin
10525 ;; Delete bundled third-party jar archives.
10526 (for-each delete-file (find-files "." ".*.jar$"))
10527 (for-each (lambda (file) (chmod file #o644))
10528 (find-files "." "."))
10529 #t))))
10530 (build-system ant-build-system)
10531 (arguments
10532 `(#:build-target "jarall"
10533 #:test-target "junit-tests-all"
10534 #:make-flags (list "-DDATE" "(no date for reproducibility)")
10535 #:phases
10536 (modify-phases %standard-phases
10537 (add-before 'install 'fix-pom
10538 (lambda _
10539 (substitute* "pom.xml"
10540 (("org.apache-extras.beanshell") "org.beanshell"))
10541 #t))
10542 (replace 'install
10543 (install-from-pom "pom.xml")))))
10544 (inputs
10545 `(("java-classpathx-servletapi" ,java-classpathx-servletapi)
10546 ("java-commons-bsf" ,java-commons-bsf)))
10547 (native-inputs
10548 `(("java-junit" ,java-junit)
10549 ("javacc" ,javacc-3)))
10550 (home-page "http://beanshell.org/")
10551 (synopsis "Lightweight Scripting for Java")
10552 (description "BeanShell is a small, free, embeddable Java source
10553 interpreter with object scripting language features, written in Java.
10554 BeanShell dynamically executes standard Java syntax and extends it with common
10555 scripting conveniences such as loose types, commands, and method closures like
10556 those in Perl and JavaScript.")
10557 (license license:asl2.0)))
10558
10559 (define-public java-fest-util
10560 (package
10561 (name "java-fest-util")
10562 (version "1.2.5")
10563 (source (origin
10564 (method git-fetch)
10565 (uri (git-reference
10566 (url "https://github.com/alexruiz/fest-util/")
10567 (commit (string-append "fest-util-" version))))
10568 (file-name (git-file-name name version))
10569 (sha256
10570 (base32
10571 "02kgal7v85snyyvcsxvn4qphid455f4smh2wri1il8d9asw0djbz"))))
10572 (build-system ant-build-system)
10573 (arguments
10574 `(#:jar-name "java-fest-util.jar"
10575 #:source-dir "src/main/java"))
10576 (native-inputs
10577 `(("junit" ,java-junit)
10578 ("hamcrest" ,java-hamcrest-core)))
10579 (home-page "https://github.com/alexruiz/fest-util")
10580 (synopsis "FEST common utilities")
10581 (description "Common utilities used in all FEST module.")
10582 (license license:asl2.0)))
10583
10584 (define-public java-fest-test
10585 (package
10586 (name "java-fest-test")
10587 (version "2.1.0")
10588 (source (origin
10589 (method git-fetch)
10590 (uri (git-reference
10591 (url "https://github.com/alexruiz/fest-test/")
10592 (commit (string-append "fest-test-" version))))
10593 (file-name (git-file-name name version))
10594 (sha256
10595 (base32
10596 "0mg1d2jfh7kbx2c40dchbjr6d8pv59snsyb13mfxsr7xk5n69qbn"))))
10597 (build-system ant-build-system)
10598 (arguments
10599 `(#:jar-name "java-fest-test.jar"
10600 #:source-dir "src/main/java"
10601 #:tests? #f)); no tests
10602 (inputs
10603 `(("junit" ,java-junit)))
10604 (home-page "https://github.com/alexruiz/fest-test")
10605 (synopsis "Common FEST testing infrastructure")
10606 (description "Fest-test contains the common FEST testing infrastructure.")
10607 (license license:asl2.0)))
10608
10609 (define-public java-fest-assert
10610 (package
10611 (name "java-fest-assert")
10612 (version "2.0M10")
10613 (source (origin
10614 (method git-fetch)
10615 (uri (git-reference
10616 (url "https://github.com/alexruiz/fest-assert-2.x/")
10617 (commit (string-append "fest-assert-core-" version))))
10618 (file-name (git-file-name name version))
10619 (sha256
10620 (base32
10621 "1cp8zzyag3s85fz2w68sda9zzaal1y5f9wl8g72wkm12an40w6by"))))
10622 (build-system ant-build-system)
10623 (arguments
10624 `(#:jar-name "java-fest-assert.jar"
10625 #:source-dir "src/main/java"
10626 #:test-exclude
10627 (list
10628 "**/Abstract*.java"
10629 "**/*BaseTest.java"
10630 ;; Unable to set MockitoNamingPolicy on cglib generator which creates FastClasses
10631 "**/MessageFormatter_format_Test.java"
10632 "**/internal/*/*_assert*_Test.java")))
10633 (inputs
10634 `(("java-fest-util" ,java-fest-util)))
10635 (native-inputs
10636 `(("java-junit" ,java-junit)
10637 ("java-fest-test" ,java-fest-test)
10638 ("java-hamcrest-core" ,java-hamcrest-core)
10639 ("java-mockito" ,java-mockito-1)
10640 ("java-cglib" ,java-cglib)
10641 ("java-objenesis" ,java-objenesis)
10642 ("java-asm" ,java-asm)))
10643 (home-page "https://github.com/alexruiz/fest-assert-2.x")
10644 (synopsis "FEST fluent assertions")
10645 (description "FEST-Assert provides a fluent interface for assertions.")
10646 (license license:asl2.0)))
10647
10648 (define-public java-testng
10649 (package
10650 (name "java-testng")
10651 (version "6.14.3")
10652 (source (origin
10653 (method git-fetch)
10654 (uri (git-reference
10655 (url "https://github.com/cbeust/testng")
10656 (commit version)))
10657 (file-name (string-append name "-" version "-checkout"))
10658 (sha256
10659 (base32
10660 "0y6vq30i5g276kw0v2bhbvci22ijg7ax49ap2611yqlhbs4d6dqv"))))
10661 (build-system ant-build-system)
10662 (arguments
10663 `(#:jdk ,icedtea-8; java.util.function
10664 #:jar-name "java-testng.jar"
10665 #:source-dir "src/main/java"
10666 #:phases
10667 (modify-phases %standard-phases
10668 ;; FIXME: I don't know why these tests fail
10669 (add-after 'unpack 'delete-failing-tests
10670 (lambda _
10671 (substitute* "src/test/resources/testng.xml"
10672 (("<class name=\"test.configuration.github1625.TestRunnerIssue1625\"/>") "")
10673 (("<class name=\"test.serviceloader.ServiceLoaderTest\" />") ""))
10674 #t))
10675 ;; We don't have groovy
10676 (add-after 'unpack 'delete-groovy-tests
10677 (lambda _
10678 (delete-file-recursively "src/test/java/test/dependent/issue1648/")
10679 (substitute* "src/test/resources/testng.xml"
10680 (("<class name=\"test.dependent.issue1648.TestRunner\"/>") ""))
10681 #t))
10682 (add-before 'build 'copy-resources
10683 (lambda _
10684 (copy-recursively "src/main/resources" "build/classes")
10685 #t))
10686 (add-before 'check 'copy-test-resources
10687 (lambda _
10688 (copy-recursively "src/test/resources" "build/test-classes")
10689 #t))
10690 (replace 'check
10691 (lambda _
10692 (invoke "ant" "compile-tests")
10693 ;; we don't have groovy
10694 (substitute* "src/test/resources/testng.xml"
10695 (("<class name=\"test.groovy.GroovyTest\" />") ""))
10696 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
10697 ":build/classes"
10698 ":build/test-classes")
10699 "-Dtest.resources.dir=src/test/resources"
10700 "org.testng.TestNG" "src/test/resources/testng.xml"))))))
10701 (propagated-inputs
10702 `(("junit" ,java-junit)
10703 ("java-jsr305" ,java-jsr305)
10704 ("java-bsh" ,java-bsh)
10705 ("java-jcommander" ,java-jcommander)
10706 ("java-guice" ,java-guice)
10707 ("snakeyaml" ,java-snakeyaml)))
10708 (native-inputs
10709 `(("guava" ,java-guava)
10710 ("java-javax-inject" ,java-javax-inject)
10711 ("java-hamcrest" ,java-hamcrest-all)
10712 ("java-assertj" ,java-assertj)
10713 ("java-mockito" ,java-mockito-1)
10714 ("cglib" ,java-cglib)
10715 ("asm" ,java-asm)
10716 ("aopalliance" ,java-aopalliance)))
10717 (home-page "https://testng.org")
10718 (synopsis "Testing framework")
10719 (description "TestNG is a testing framework inspired from JUnit and NUnit
10720 but introducing some new functionalities that make it more powerful and easier
10721 to use.")
10722 (license license:asl2.0)))
10723
10724 (define-public java-jnacl
10725 (let ((commit "094e819afdd63ea81a499b3bcb42a271006bebd9")
10726 (revision "2"))
10727 (package
10728 (name "java-jnacl")
10729 (version (string-append "0.1.0-" revision "." (string-take commit 7)))
10730 (source (origin
10731 (method git-fetch)
10732 (uri (git-reference
10733 (url "https://github.com/neilalexander/jnacl")
10734 (commit commit)))
10735 (file-name (git-file-name name version))
10736 (sha256
10737 (base32
10738 "1d6g6xhn83byv5943n7935wwjsk0ibk0qdvqgr699qqgqqmwisbb"))))
10739 (build-system ant-build-system)
10740 (arguments
10741 `(#:jar-name "jnacl.jar"
10742 #:source-dir "src/main/java"
10743 #:jdk ,icedtea-8
10744 #:phases
10745 (modify-phases %standard-phases
10746 (add-before 'build 'fix-tests
10747 (lambda _
10748 (substitute* '("src/test/java/com/neilalexander/jnacl/NaClTest.java"
10749 "src/test/java/com/neilalexander/jnacl/NaclSecretBoxTest.java")
10750 (("assertions.Assertions") "assertions.api.Assertions"))
10751 #t))
10752 (replace 'check
10753 (lambda _
10754 (invoke "ant" "compile-tests")
10755 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
10756 ":build/classes"
10757 ":build/test-classes")
10758 "org.testng.TestNG" "-testclass"
10759 "build/test-classes/com/neilalexander/jnacl/NaclSecretBoxTest.class")
10760 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
10761 ":build/classes"
10762 ":build/test-classes")
10763 "org.testng.TestNG" "-testclass"
10764 "build/test-classes/com/neilalexander/jnacl/NaClTest.class"))))))
10765 (native-inputs
10766 `(("java-testng" ,java-testng)
10767 ("java-fest-util" ,java-fest-util)
10768 ("java-fest-assert" ,java-fest-assert)))
10769 (home-page "https://github.com/neilalexander/jnacl")
10770 (synopsis "Java implementation of NaCl")
10771 (description "Pure Java implementation of the NaCl: Networking and
10772 Cryptography library.")
10773 (license license:bsd-2))))
10774
10775 (define-public java-mvel2
10776 (package
10777 (name "java-mvel2")
10778 (version "2.3.1")
10779 (source (origin
10780 (method url-fetch)
10781 (uri (string-append "https://github.com/mvel/mvel/archive/mvel2-"
10782 version ".Final.tar.gz"))
10783 (sha256
10784 (base32
10785 "01ph5s9gm16l2qz58lg21w6fna7xmmrj7f9bzqr1jim7h9557d3z"))))
10786 (build-system ant-build-system)
10787 (arguments
10788 `(#:jar-name "mvel2.jar"
10789 #:source-dir "src/main/java"
10790 #:test-exclude
10791 (list "**/Abstract*.java"
10792 ;; Base class with no tests
10793 "**/MVELThreadTest.java")
10794 #:phases
10795 (modify-phases %standard-phases
10796 (add-after 'install 'install-bin
10797 (lambda* (#:key outputs #:allow-other-keys)
10798 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
10799 (mkdir-p bin)
10800 (with-output-to-file (string-append bin "/mvel2")
10801 (lambda _
10802 (display
10803 (string-append
10804 "#!" (which "bash") "\n"
10805 "if [ \"$#\" -ne \"2\" ]; then\n"
10806 "echo 'Usage: mvel2 <script> <out.dir>'\n"
10807 "exit\n"
10808 "fi\n"
10809 "java -Dout.dir=$2 -cp " (getenv "CLASSPATH")
10810 ":" (assoc-ref outputs "out") "/share/java/mvel2.jar"
10811 " org.mvel2.sh.Main $1"))))
10812 (chmod (string-append bin "/mvel2") #o755))
10813 #t)))))
10814 (native-inputs
10815 `(("junit" ,java-junit)
10816 ("hamcrest" ,java-hamcrest-core)))
10817 (home-page "https://github.com/mvel/mvel")
10818 (synopsis "MVFLEX Expression Language")
10819 (description "MVEL has largely been inspired by Java syntax, but has some
10820 fundamental differences aimed at making it more efficient as an expression
10821 language, such as operators that directly support collection, array and string
10822 matching, as well as regular expressions. MVEL is used to evaluate expressions
10823 written using Java syntax.
10824
10825 In addition to the expression language, MVEL serves as a templating language for
10826 configuration and string construction.")
10827 (license license:asl2.0)))
10828
10829 (define-public java-commons-jexl-2
10830 (package
10831 (name "java-commons-jexl")
10832 (version "2.1.1")
10833 (source (origin
10834 (method url-fetch)
10835 (uri (string-append "mirror://apache/commons/jexl/source/"
10836 "commons-jexl-" version "-src.tar.gz"))
10837 (sha256
10838 (base32
10839 "1ai7632bwwaxglb0nbpblpr2jw5g20afrsaq372ipkphi3ncy1jz"))))
10840 (build-system ant-build-system)
10841 (arguments
10842 `(#:jar-name "commons-jexl-2.jar"
10843 #:jdk ,icedtea-8
10844 #:source-dir "src/main/java"
10845 #:phases
10846 (modify-phases %standard-phases
10847 (add-before 'check 'disable-broken-tests
10848 (lambda* (#:key inputs #:allow-other-keys)
10849 (with-directory-excursion "src/test/java/org/apache/commons/jexl2/"
10850 (substitute* "ArithmeticTest.java"
10851 (("asserter.assertExpression\\(\"3 / 0\"") "//")
10852 (("asserter.assertExpression\\(\"imanull") "//"))
10853 ;; This test fails with "ambiguous method invocation"
10854 (delete-file "CacheTest.java")
10855 ;; This test doesn't have access to the temp directory
10856 (substitute* "ClassCreatorTest.java"
10857 (("java.io.tmpdir") "user.dir"))
10858 ;; This test fails in trying to detect whether it can run.
10859 (substitute* "ClassCreator.java"
10860 (("boolean canRun =.*") "boolean canRun = false;\n"))
10861 ;; ...and these tests depend on it.
10862 (delete-file "scripting/JexlScriptEngineOptionalTest.java")
10863 (delete-file "scripting/JexlScriptEngineTest.java"))
10864 #t))
10865 (add-before 'build 'run-javacc
10866 (lambda _
10867 (with-directory-excursion "src/main/java/org/apache/commons/jexl2/parser/"
10868 (invoke "java" "jjtree" "Parser.jjt")
10869 (invoke "java" "javacc" "Parser.jj"))
10870 #t)))))
10871 (inputs
10872 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)))
10873 (native-inputs
10874 `(("java-junit" ,java-junit)
10875 ("java-hamcrest-core" ,java-hamcrest-core)
10876 ("javacc" ,javacc-4)))
10877 (home-page "https://commons.apache.org/proper/commons-jexl/")
10878 (synopsis "Java Expression Language ")
10879 (description "JEXL is a library intended to facilitate the implementation
10880 of dynamic and scripting features in applications and frameworks written in
10881 Java. JEXL implements an Expression Language based on some extensions to the
10882 JSTL Expression Language supporting most of the constructs seen in
10883 shell-script or ECMAScript. Its goal is to expose scripting features usable
10884 by technical operatives or consultants working with enterprise platforms.")
10885 (license license:asl2.0)))
10886
10887 (define-public java-lz4
10888 (package
10889 (name "java-lz4")
10890 (version "1.4.0")
10891 (source (origin
10892 (method git-fetch)
10893 (uri (git-reference
10894 (url "https://github.com/lz4/lz4-java")
10895 (commit version)))
10896 (file-name (git-file-name name version))
10897 (sha256
10898 (base32
10899 "0ydjakhv3cz34mfvv14qrh2ksdxifgjwwagjy7r46qr3f68hnf6y"))))
10900 (build-system ant-build-system)
10901 (arguments
10902 `(#:jar-name "lz4.jar"
10903 #:jdk ,icedtea-8
10904 #:source-dir "src/java:src/java-unsafe"
10905 #:tests? #f; FIXME: requires more dependencies
10906 #:phases
10907 (modify-phases %standard-phases
10908 (add-after 'unpack 'make-files-writable
10909 (lambda _
10910 (for-each make-file-writable (find-files "."))
10911 #t))
10912 (add-before 'configure 'generate-source
10913 (lambda _
10914 (with-directory-excursion "src/build/source_templates"
10915 (invoke "mvel2" "../gen_sources.mvel" "../../java"))
10916 #t)))))
10917 (native-inputs
10918 `(("mvel" ,java-mvel2)))
10919 (home-page "https://jpountz.github.io/lz4-java")
10920 (synopsis "Compression algorithm")
10921 (description "LZ4 - Java is a Java port of the popular lz4 compression
10922 algorithms and xxHash hashing algorithm.")
10923 (license license:asl2.0)))
10924
10925 (define-public java-bouncycastle
10926 (package
10927 (name "java-bouncycastle")
10928 (version "1.67")
10929 (source (origin
10930 (method git-fetch)
10931 (uri (git-reference
10932 (url "http://git.bouncycastle.org/repositories/bc-java")
10933 ;(url "https://github.com/bcgit/bc-java")
10934 (commit (string-append "r1rv" (substring version 2 4)))))
10935 (file-name (git-file-name name version))
10936 (sha256
10937 (base32
10938 "1449q7fyh03s1q0bqljcrhgacwcyqmg2bbvb3z084avgapwsainz"))
10939 (modules '((guix build utils)))
10940 (snippet
10941 '(begin
10942 (for-each delete-file
10943 (find-files "." "\\.jar$"))
10944 #t))))
10945 (build-system ant-build-system)
10946 (arguments
10947 `(#:jdk ,icedtea-8
10948 #:tests? #f
10949 #:phases
10950 (modify-phases %standard-phases
10951 (replace 'build
10952 (lambda _
10953 (invoke "ant" "-f" "ant/jdk15+.xml" "build-provider")
10954 (invoke "ant" "-f" "ant/jdk15+.xml" "build")))
10955 ;; FIXME: the tests freeze.
10956 ;; (replace 'check
10957 ;; (lambda _
10958 ;; (invoke "ant" "-f" "ant/jdk15+.xml" "test")))
10959 (replace 'install
10960 (install-jars "build/artifacts/jdk1.5/jars")))))
10961 (inputs
10962 `(("java-javax-mail" ,java-javax-mail)))
10963 (native-inputs
10964 `(("unzip" ,unzip)
10965 ("junit" ,java-junit)
10966 ("java-native-access" ,java-native-access)
10967 ("java-native-access-platform" ,java-native-access-platform)))
10968 (home-page "https://www.bouncycastle.org")
10969 (synopsis "Cryptographic library")
10970 (description "Bouncy Castle is a cryptographic library for the Java
10971 programming language.")
10972 (license license:expat)))
10973
10974 (define-public java-lmax-disruptor
10975 (package
10976 (name "java-lmax-disruptor")
10977 (version "3.3.7")
10978 (source (origin
10979 (method url-fetch)
10980 (uri (string-append "https://github.com/LMAX-Exchange/disruptor/"
10981 "archive/" version ".tar.gz"))
10982 (file-name (string-append name "-" version ".tar.gz"))
10983 (sha256
10984 (base32
10985 "17da2gwj5abnlsfgn2xqjk5lgzbg4vkb0hdv2dvc8r2fx4bi7w3g"))))
10986 (build-system ant-build-system)
10987 (arguments
10988 `(#:jar-name "java-lmax-disruptor.jar"
10989 #:jdk ,icedtea-8
10990 #:tests? #f)); tests hang
10991 (inputs
10992 `(("junit" ,java-junit)
10993 ("java-hdrhistogram" ,java-hdrhistogram)
10994 ("java-jmock" ,java-jmock)
10995 ("java-jmock-legacy" ,java-jmock-legacy)
10996 ("java-jmock-junit4" ,java-jmock-junit4)
10997 ("java-hamcrest-all" ,java-hamcrest-all)))
10998 (native-inputs
10999 `(("cglib" ,java-cglib)
11000 ("objenesis" ,java-objenesis)
11001 ("asm" ,java-asm)))
11002 (home-page "https://www.lmax.com/disruptor")
11003 (synopsis "High performance inter-thread communication")
11004 (description "LMAX Disruptor is a software pattern and software component
11005 for high performance inter-thread communication that avoids the need for
11006 message queues or resource locking.")
11007 (license license:asl2.0)))
11008
11009 (define-public java-commons-bcel
11010 (package
11011 (name "java-commons-bcel")
11012 (version "6.1")
11013 (source (origin
11014 (method url-fetch)
11015 (uri (string-append "mirror://apache/commons/bcel/source/bcel-"
11016 version "-src.tar.gz"))
11017 (sha256
11018 (base32
11019 "0j3x1rxd673k07psclk8k13rqh0x0mf2yy5qiwkiw4z3afa568jy"))))
11020 (build-system ant-build-system)
11021 (arguments
11022 `(#:jar-name "bcel.jar"
11023 #:jdk ,icedtea-8
11024 #:source-dir "src/main/java"
11025 #:test-dir "src/test/java"
11026 ;; FIXME: Tests require the unpackaged jna.
11027 #:tests? #f))
11028 (home-page "https://commons.apache.org/proper/commons-bcel/")
11029 (synopsis "Byte code engineering library")
11030 (description "The Byte Code Engineering Library (Apache Commons BCEL) is
11031 intended to give users a convenient way to analyze, create, and
11032 manipulate (binary) Java class files. Classes are represented by objects
11033 which contain all the symbolic information of the given class: methods, fields
11034 and byte code instructions, in particular.
11035
11036 Such objects can be read from an existing file, be transformed by a
11037 program (e.g. a class loader at run-time) and written to a file again. An
11038 even more interesting application is the creation of classes from scratch at
11039 run-time. The @dfn{Byte Code Engineering Library} (BCEL) may be also useful
11040 if you want to learn about the @dfn{Java Virtual Machine} (JVM) and the format
11041 of Java @code{.class} files.")
11042 (license license:asl2.0)))
11043
11044 (define-public java-xerial-core
11045 (package
11046 (name "java-xerial-core")
11047 (version "2.1")
11048 (source (origin
11049 (method url-fetch)
11050 (uri (string-append "https://github.com/xerial/xerial-java/archive/"
11051 version ".tar.gz"))
11052 (file-name (string-append name "-" version ".tar.gz"))
11053 (sha256
11054 (base32
11055 "0d3g863i41bgalpa4xr3vm1h140l091n8iwgq5qvby5yivns9y8d"))))
11056 (build-system ant-build-system)
11057 (arguments
11058 `(#:jar-name "xerial-core.jar"
11059 #:source-dir "xerial-core/src/main/java"
11060 #:test-dir "xerial-core/src/test"
11061 #:phases
11062 (modify-phases %standard-phases
11063 (add-before 'build 'copy-resources
11064 (lambda _
11065 (copy-recursively "xerial-core/src/main/resources"
11066 "build/classes")
11067 #t)))))
11068 (native-inputs
11069 `(("junit" ,java-junit)
11070 ("hamcrest" ,java-hamcrest-core)))
11071 (home-page "https://github.com/xerial/xerial-java")
11072 (synopsis "Data management libraries for Java")
11073 (description "Xerial is a set of data management libraries for the Java
11074 programming language. The ultimate goal of the Xerial project is to manage
11075 everything as database, including class objects, text format data, data
11076 streams, etc.")
11077 (license license:asl2.0)))
11078
11079 (define-public java-powermock-reflect
11080 (package
11081 (name "java-powermock-reflect")
11082 (version "1.7.3")
11083 (source (origin
11084 (method url-fetch)
11085 (uri (string-append "https://github.com/powermock/powermock/"
11086 "archive/powermock-" version ".tar.gz"))
11087 (file-name (string-append name "-" version ".tar.gz"))
11088 (sha256
11089 (base32
11090 "0sbgi5vqq7k72wzcdjb20s370vyd4hsbnx71pzb8ishml3gy7fwy"))
11091 (patches
11092 (search-patches "java-powermock-fix-java-files.patch"))))
11093 (build-system ant-build-system)
11094 (arguments
11095 `(#:jar-name "java-powermock-reflect.jar"
11096 #:jdk ,icedtea-8
11097 #:source-dir "powermock-reflect/src/main/java"
11098 #:test-dir "powermock-reflect/src/test"))
11099 (inputs
11100 `(("java-objenesis" ,java-objenesis)))
11101 (native-inputs
11102 `(("junit" ,java-junit)
11103 ("cglib" ,java-cglib)
11104 ("asm" ,java-asm)
11105 ("hamcrest" ,java-hamcrest-core)
11106 ("assertj" ,java-assertj)))
11107 (home-page "https://github.com/powermock/powermock")
11108 (synopsis "Mock library extension framework")
11109 (description "PowerMock is a framework that extends other mock libraries
11110 such as EasyMock with more powerful capabilities. PowerMock uses a custom
11111 classloader and bytecode manipulation to enable mocking of static methods,
11112 constructors, final classes and methods, private methods, removal of static
11113 initializers and more. By using a custom classloader no changes need to be
11114 done to the IDE or continuous integration servers which simplifies adoption.")
11115 (license license:asl2.0)))
11116
11117 (define-public java-powermock-core
11118 (package
11119 (inherit java-powermock-reflect)
11120 (name "java-powermock-core")
11121 (arguments
11122 `(#:jar-name "java-powermock-core.jar"
11123 #:source-dir "powermock-core/src/main/java"
11124 #:test-dir "powermock-core/src/test"
11125 #:tests? #f; requires powermock-api
11126 #:jdk ,icedtea-8
11127 #:phases
11128 (modify-phases %standard-phases
11129 (add-before 'build 'copy-resources
11130 (lambda _
11131 (copy-recursively "powermock-core/src/main/resources"
11132 "build/classes")
11133 #t)))))
11134 (inputs
11135 `(("reflect" ,java-powermock-reflect)
11136 ("javassist" ,java-jboss-javassist)))
11137 (native-inputs
11138 `(("junit" ,java-junit)
11139 ("assertj" ,java-assertj)
11140 ("mockito" ,java-mockito-1)))))
11141
11142 (define-public java-powermock-api-support
11143 (package
11144 (inherit java-powermock-reflect)
11145 (name "java-powermock-api-support")
11146 (build-system ant-build-system)
11147 (arguments
11148 `(#:jar-name "java-powermock-api-support.jar"
11149 #:jdk ,icedtea-8
11150 #:source-dir "powermock-api/powermock-api-support/src/main/java"
11151 #:tests? #f)); no tests
11152 (inputs
11153 `(("core" ,java-powermock-core)
11154 ("reflect" ,java-powermock-reflect)))))
11155
11156 (define-public java-powermock-modules-junit4-common
11157 (package
11158 (inherit java-powermock-reflect)
11159 (name "java-powermock-modules-junit4-common")
11160 (build-system ant-build-system)
11161 (arguments
11162 `(#:jar-name "java-powermock-modules-junit4-common.jar"
11163 #:jdk ,icedtea-8
11164 #:source-dir "powermock-modules/powermock-module-junit4-common/src/main/java"
11165 #:test-dir "powermock-modules/powermock-module-junit4-common/src/test"))
11166 (inputs
11167 `(("core" ,java-powermock-core)
11168 ("easymock" ,java-easymock)
11169 ("reflect" ,java-powermock-reflect)
11170 ("hamcrest" ,java-hamcrest-core)
11171 ("cglib" ,java-cglib)))))
11172
11173 (define-public java-powermock-modules-junit4
11174 (package
11175 (inherit java-powermock-reflect)
11176 (name "java-powermock-modules-junit4")
11177 (build-system ant-build-system)
11178 (arguments
11179 `(#:jar-name "java-powermock-modules-junit4.jar"
11180 #:jdk ,icedtea-8
11181 #:source-dir "powermock-modules/powermock-module-junit4/src/main/java"
11182 #:test-dir "powermock-modules/powermock-module-junit4/src/test"
11183 #:phases
11184 (modify-phases %standard-phases
11185 (add-before 'build 'fix-junit-detection
11186 (lambda _
11187 ;; Our junit version is 4.12-SNAPSHOT
11188 (substitute* (find-files "powermock-modules/powermock-module-junit4"
11189 "PowerMockJUnit4MethodValidator.java")
11190 (("4.12") "4.12-SNAPSHOT"))
11191 #t)))))
11192 (inputs
11193 `(("core" ,java-powermock-core)
11194 ("reflect" ,java-powermock-reflect)
11195 ("common" ,java-powermock-modules-junit4-common)
11196 ("cglib" ,java-cglib)))
11197 (native-inputs
11198 `(("easymock" ,java-easymock)
11199 ("hamcrest" ,java-hamcrest-core)
11200 ("objenesis" ,java-objenesis)
11201 ("asm" ,java-asm)
11202 ("junit" ,java-junit)))))
11203
11204 (define-public java-powermock-api-easymock
11205 (package
11206 (inherit java-powermock-reflect)
11207 (name "java-powermock-api-easymock")
11208 (build-system ant-build-system)
11209 (arguments
11210 `(#:jar-name "java-powermock-api-easymock.jar"
11211 #:jdk ,icedtea-8
11212 #:source-dir "powermock-api/powermock-api-easymock/src/main/java"
11213 #:tests? #f; no tests
11214 #:phases
11215 (modify-phases %standard-phases
11216 (add-before 'build 'fix-file
11217 (lambda _
11218 ;; FIXME: This looks wrong, but it fixes a build error.
11219 (with-directory-excursion "powermock-api/powermock-api-easymock"
11220 (substitute* "src/main/java/org/powermock/api/easymock/PowerMock.java"
11221 (("classLoader instanceof MockClassLoader") "false")
11222 (("\\(\\(MockClassLoader\\) classLoader\\).*;") ";")))
11223 #t)))))
11224 (inputs
11225 `(("core" ,java-powermock-core)
11226 ("easymock" ,java-easymock)
11227 ("reflect" ,java-powermock-reflect)
11228 ("support" ,java-powermock-api-support)
11229 ("cglib" ,java-cglib)))))
11230
11231 (define-public java-jboss-jms-api-spec
11232 (package
11233 (name "java-jboss-jms-api-spec")
11234 (version "2.0")
11235 (source (origin
11236 (method url-fetch)
11237 (uri (string-append "https://github.com/jboss/jboss-jms-api_spec/"
11238 "archive/jboss-jms-api_" version
11239 "_spec-1.0.1.Final.tar.gz"))
11240 (sha256
11241 (base32
11242 "07bqblw9kq2i8q92bz70fvavq5xjfkaixl8xa0m0cypjgy82rb7m"))))
11243 (build-system ant-build-system)
11244 (arguments
11245 `(#:jar-name "java-jboss-jms-api_spec.jar"
11246 #:jdk ,icedtea-8
11247 #:source-dir "."
11248 #:tests? #f)); no tests
11249 (home-page "https://github.com/jboss/jboss-jms-api_spec")
11250 (synopsis "Java Message Service API specification")
11251 (description "Java Message Service (JMS) API is used to send messages
11252 messages between two or more clients. It is a messaging standard that allows
11253 application components to create, send, receive, and read messages.")
11254 ; either gpl2 only with GPL Classpath Exception, or cddl.
11255 (license (list license:gpl2 license:cddl1.0))))
11256
11257 (define-public java-mail
11258 (package
11259 (name "java-mail")
11260 (version "1.6.0")
11261 (source (origin
11262 (method url-fetch)
11263 (uri (string-append "https://github.com/javaee/javamail/archive/"
11264 "JAVAMAIL-1_6_0.tar.gz"))
11265 (sha256
11266 (base32
11267 "1b4rg7fpj50ld90a71iz2m4gm3f5cnw18p3q3rbrrryjip46kx92"))))
11268 (build-system ant-build-system)
11269 (arguments
11270 `(#:jar-name "java-mail.jar"
11271 #:jdk ,icedtea-8
11272 #:source-dir "mail/src/main/java"
11273 #:test-dir "mail/src/test"
11274 #:test-exclude
11275 (list "**/CollectorFormatterTest.java"
11276 "**/CompactFormatterTest.java"
11277 "**/DurationFilterTest.java"
11278 "**/MailHandlerTest.java"
11279 "**/GetLocalAddressTest.java"
11280 ;; FIXME: both end with:
11281 ;; java.lang.ClassNotFoundException:
11282 ;; javax.mail.internet.MimeMultipartParseTest
11283 "**/MimeMultipartParseTest.java"
11284 "**/SearchTermSerializationTest.java")
11285 #:phases
11286 (modify-phases %standard-phases
11287 (add-before 'configure 'move-version.java
11288 (lambda _
11289 (copy-file "mail/src/main/resources/javax/mail/Version.java"
11290 "mail/src/main/java/javax/mail/Version.java")
11291 #t))
11292 (add-before 'build 'copy-resources
11293 (lambda _
11294 (copy-recursively "mail/src/main/resources/META-INF"
11295 "build/classes/META-INF")
11296 #t)))))
11297 (native-inputs
11298 `(("junit" ,java-junit)
11299 ("hamcrest" ,java-hamcrest-core)))
11300 (home-page "https://javaee.github.io/javamail/")
11301 (synopsis "Mail-related functionality in Java")
11302 (description "The JavaMail API provides a platform-independent and
11303 protocol-independent framework to build mail and messaging applications.")
11304 ;; General Public License Version 2 only ("GPL") or the Common Development
11305 ;; and Distribution License("CDDL")
11306 (license (list license:cddl1.1
11307 license:gpl2)))); with classpath exception
11308
11309 (define-public java-jeromq
11310 (package
11311 (name "java-jeromq")
11312 (version "0.4.3")
11313 (source (origin
11314 (method git-fetch)
11315 (uri (git-reference
11316 (url "https://github.com/zeromq/jeromq")
11317 (commit (string-append "v" version))))
11318 (file-name (string-append name "-" version "-checkout"))
11319 (sha256
11320 (base32
11321 "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj"))
11322 (patches (search-patches "java-jeromq-fix-tests.patch"))))
11323 (build-system ant-build-system)
11324 (arguments
11325 `(#:jar-name "java-jeromq.jar"
11326 #:source-dir "src/main/java"
11327 #:jdk ,icedtea-8
11328 #:test-exclude
11329 (list
11330 "**/Abstract*.java"
11331 ;; Requires network
11332 "**/ZBeaconTest.java"
11333 ;; Failures
11334 "**/DealerSpecTest.java"
11335 "**/CustomDecoderTest.java"
11336 "**/CustomEncoderTest.java"
11337 "**/ConnectRidTest.java"
11338 "**/ReqSpecTest.java"
11339 "**/PushPullSpecTest.java"
11340 "**/PubSubHwmTest.java"
11341 "**/RouterSpecTest.java"
11342 "**/ProxyTest.java")))
11343 (inputs
11344 `(("java-jnacl" ,java-jnacl)))
11345 (native-inputs
11346 `(("java-hamcrest-core" ,java-hamcrest-core)
11347 ("junit" ,java-junit)))
11348 (home-page "http://zeromq.org/bindings:java")
11349 (synopsis "Java binding for 0MQ")
11350 (description "Jeromq provides the java bindings for 0MQ.")
11351 (license license:mpl2.0)))
11352
11353 (define-public java-kafka-clients
11354 (package
11355 (name "java-kafka-clients")
11356 (version "1.0.0")
11357 (source (origin
11358 (method url-fetch)
11359 (uri (string-append "mirror://apache/kafka/" version "/kafka-"
11360 version "-src.tgz"))
11361 (sha256
11362 (base32
11363 "1yxmnsmliwm7671q5yy9bl4jdqyyn00n26cggz9brwczx80w1vfq"))))
11364 (build-system ant-build-system)
11365 (arguments
11366 `(#:jar-name "java-kafka-clients.jar"
11367 #:jdk ,icedtea-8
11368 #:source-dir "clients/src/main/java"
11369 #:test-dir "clients/src/test"
11370 #:test-exclude
11371 (list
11372 ;; This file does not contain a class
11373 "**/IntegrationTest.java"
11374 ;; Requires network
11375 "**/ClientUtilsTest.java"
11376 ;; End with errors that seem related to our powermock
11377 "**/KafkaProducerTest.java"
11378 "**/BufferPoolTest.java")))
11379 (inputs
11380 `(("java-slf4j-api" ,java-slf4j-api)
11381 ("java-lz4" ,java-lz4)))
11382 (native-inputs
11383 `(("junit" ,java-junit)
11384 ("hamcrest" ,java-hamcrest-all)
11385 ("objenesis" ,java-objenesis)
11386 ("asm" ,java-asm)
11387 ("cglib" ,java-cglib)
11388 ("javassist" ,java-jboss-javassist)
11389 ("snappy" ,java-snappy)
11390 ("easymock" ,java-easymock)
11391 ("powermock" ,java-powermock-core)
11392 ("powermock-easymock" ,java-powermock-api-easymock)
11393 ("powermock-junit4-common" ,java-powermock-modules-junit4-common)
11394 ("powermock-junit4" ,java-powermock-modules-junit4)
11395 ("powermock-support" ,java-powermock-api-support)
11396 ("java-bouncycastle" ,java-bouncycastle)))
11397 (home-page "https://kafka.apache.org")
11398 (synopsis "Distributed streaming platform")
11399 (description "Kafka is a distributed streaming platform, which means:
11400 @itemize
11401 @item it can publish and subscribe to streams of records;
11402 @item it can store streams of records in a fault-tolerant way;
11403 @item it can process streams of records as they occur.
11404 @end itemize")
11405 ;; Either cddl or gpl2 only.
11406 (license (list license:cddl1.1; actually cddl1.1
11407 license:gpl2)))); with classpath exception
11408
11409 (define-public java-jdom
11410 (package
11411 (name "java-jdom")
11412 (version "1.1.3")
11413 (source (origin
11414 (method url-fetch)
11415 (uri (string-append "http://jdom.org/dist/binary/archive/jdom-"
11416 version ".tar.gz"))
11417 (sha256
11418 (base32
11419 "07wdpm3jwwc9q38kmdw40fvbmv6jzjrkrf8m0zqs58f79a672wfl"))))
11420 (build-system ant-build-system)
11421 (arguments
11422 `(#:build-target "package"
11423 #:tests? #f; tests are run as part of the build process
11424 #:phases
11425 (modify-phases %standard-phases
11426 (replace 'install
11427 (install-jars "build")))))
11428 (home-page "http://jdom.org/")
11429 (synopsis "Access, manipulate, and output XML data")
11430 (description "Java-based solution for accessing, manipulating, and
11431 outputting XML data from Java code.")
11432 (license license:bsd-4)))
11433
11434 (define-public java-geronimo-xbean-reflect
11435 (package
11436 (name "java-geronimo-xbean-reflect")
11437 (version "4.5")
11438 (source (origin
11439 (method svn-fetch)
11440 (uri (svn-reference
11441 (url "https://svn.apache.org/repos/asf/geronimo/xbean/tags/xbean-4.5/")
11442 (revision 1807396)))
11443 (file-name (string-append name "-" version))
11444 (sha256
11445 (base32
11446 "18q3i6jgm6rkw8aysfgihgywrdc5nvijrwnslmi3ww497jvri6ja"))))
11447 (build-system ant-build-system)
11448 (arguments
11449 `(#:jar-name "geronimo-xbean-reflect.jar"
11450 #:source-dir "xbean-reflect/src/main/java"
11451 #:test-dir "xbean-reflect/src/test"
11452 #:jdk ,icedtea-8
11453 #:test-exclude
11454 (list "**/Abstract*.java" "**/AsmParameterNameLoaderTest.java"
11455 "**/ObjectRecipeTest.java" "**/ParameterNameLoaderTest.java"
11456 "**/RecipeHelperTest.java" "**/XbeanAsmParameterNameLoaderTest.java")
11457 #:phases
11458 (modify-phases %standard-phases
11459 (add-before 'build 'fix-source
11460 (lambda _
11461 (let ((dir "xbean-reflect/src/main/java/org/apache/xbean/recipe/"))
11462 ;; org.apache.xbean.asm6 is actually repackaged java-asm
11463 (substitute* (string-append dir "XbeanAsmParameterNameLoader.java")
11464 (("org.apache.xbean.asm5") "org.objectweb.asm"))
11465 #t)))
11466 (replace 'install (install-from-pom "xbean-reflect/pom.xml")))))
11467 (inputs
11468 `(("asm" ,java-asm)
11469 ("log4j" ,java-log4j-api)
11470 ("log4j-1.2" ,java-log4j-1.2-api)
11471 ("log4j-core" ,java-log4j-core)
11472 ("logging" ,java-commons-logging-minimal)))
11473 (propagated-inputs
11474 `(("java-geronimo-parent-pom" ,java-geronimo-parent-pom)))
11475 (native-inputs
11476 `(("junit" ,java-junit)))
11477 (home-page "https://geronimo.apache.org/maven/xbean/3.6/xbean-reflect/")
11478 (synopsis "Dependency injection helper")
11479 (description "Xbean-reflect provides very flexible ways to create objects
11480 and graphs of objects for dependency injection frameworks")
11481 (license license:asl2.0)))
11482
11483 (define java-geronimo-genesis-2.1
11484 (package
11485 (name "java-geronimo-genesis")
11486 (version "2.1")
11487 (source (origin
11488 (method svn-fetch)
11489 (uri (svn-reference
11490 (url (string-append "https://svn.apache.org/repos/asf/"
11491 "geronimo/genesis/tags/genesis-"
11492 version))
11493 (revision 1807396)))
11494 (file-name (string-append name "-" version "-source"))
11495 (sha256
11496 (base32
11497 "119yn795jvnjf52si84q192s8wag1k013iabg78b7wnadssnnh31"))))
11498 (build-system ant-build-system)
11499 (arguments
11500 `(#:tests? #f
11501 #:phases
11502 (modify-phases %standard-phases
11503 (delete 'configure)
11504 (delete 'build)
11505 (replace 'install
11506 (install-pom-file "pom.xml"))
11507 (add-after 'install 'install-enforcer-rules
11508 (install-pom-file "genesis-enforcer-rules/pom.xml"))
11509 (add-after 'install 'install-flava
11510 (install-pom-file "genesis-default-flava/pom.xml"))
11511 (add-after 'install 'install-packaging
11512 (install-pom-file "genesis-packaging/pom.xml"))
11513 (add-after 'install-flava 'install-flava-java4
11514 (install-pom-file "genesis-default-flava/genesis-java1.4-flava/pom.xml"))
11515 (add-after 'install-flava 'install-flava-java5
11516 (install-pom-file "genesis-default-flava/genesis-java5-flava/pom.xml"))
11517 (add-after 'install-flava 'install-flava-java6
11518 (install-pom-file "genesis-default-flava/genesis-java6-flava/pom.xml")))))
11519 (propagated-inputs
11520 `(("apache-parent-pom" ,apache-parent-pom-13)))
11521 (home-page "https://geronimo.apache.org")
11522 (synopsis "Collection of maven POM files for the Geronimo project")
11523 (description "Apache Geronimo is a server runtime. This package contains
11524 only pom files used by other components in the Geronimo project.")
11525 (license license:asl2.0)))
11526
11527 (define java-geronimo-parent-pom
11528 (package
11529 (inherit java-geronimo-xbean-reflect)
11530 (name "java-geronimo-parent-pom")
11531 (arguments
11532 `(#:tests? #f
11533 #:phases
11534 (modify-phases %standard-phases
11535 (delete 'configure)
11536 (delete 'build)
11537 (replace 'install
11538 (install-pom-file "pom.xml")))))
11539 (propagated-inputs
11540 `(("java-geronimo-genesis" ,java-geronimo-genesis-2.1)))))
11541
11542 (define-public java-geronimo-xbean-bundleutils
11543 (package
11544 (inherit java-geronimo-xbean-reflect)
11545 (name "java-geronimo-xbean-bundleutils")
11546 (arguments
11547 `(#:jar-name "geronimo-xbean-bundleutils.jar"
11548 #:source-dir "xbean-bundleutils/src/main/java"
11549 #:test-dir "xbean-bundleutils/src/test"
11550 #:phases
11551 (modify-phases %standard-phases
11552 (add-before 'build 'fix-java
11553 (lambda _
11554 ;; We use a more recent version of osgi, so this file requires
11555 ;; more interface method implementations.
11556 (substitute* "xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java"
11557 (("import org.osgi.framework.ServiceRegistration;")
11558 "import org.osgi.framework.ServiceRegistration;
11559 import org.osgi.framework.ServiceFactory;
11560 import java.util.Collection;
11561 import org.osgi.framework.ServiceObjects;")
11562 (("public Bundle getBundle\\(\\)")
11563 "@Override
11564 public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
11565 throw new UnsupportedOperationException();
11566 }
11567 @Override
11568 public <S> ServiceRegistration<S> registerService(Class<S> clazz,
11569 ServiceFactory<S> factory, Dictionary<String, ?> properties) {
11570 throw new UnsupportedOperationException();
11571 }
11572 public Bundle getBundle()"))
11573 #t)))))
11574 (inputs
11575 `(("java-slf4j" ,java-slf4j-api)
11576 ("java-asm" ,java-asm)
11577 ("java-osgi-framework" ,java-osgi-framework)
11578 ("java-eclipse-osgi" ,java-eclipse-osgi)
11579 ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)))))
11580
11581 (define-public java-geronimo-xbean-asm-util
11582 (package
11583 (inherit java-geronimo-xbean-reflect)
11584 (name "java-geronimo-xbean-asm-util")
11585 (arguments
11586 `(#:jar-name "geronimo-xbean-asm-util.jar"
11587 #:source-dir "xbean-asm-util/src/main/java"
11588 #:tests? #f)); no tests
11589 (inputs
11590 `(("java-asm" ,java-asm)))
11591 (native-inputs '())))
11592
11593 (define-public java-geronimo-xbean-finder
11594 (package
11595 (inherit java-geronimo-xbean-reflect)
11596 (name "java-geronimo-xbean-finder")
11597 (arguments
11598 `(#:jar-name "geronimo-xbean-finder.jar"
11599 #:source-dir "xbean-finder/src/main/java"
11600 #:test-dir "xbean-finder/src/test"))
11601 (inputs
11602 `(("java-slf4j-api" ,java-slf4j-api)
11603 ("java-asm" ,java-asm)
11604 ("java-geronimo-xbean-bundleutils" ,java-geronimo-xbean-bundleutils)
11605 ("java-geronimo-xbean-asm-util" ,java-geronimo-xbean-asm-util)
11606 ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)
11607 ("java-osgi-framework" ,java-osgi-framework)))
11608 (native-inputs
11609 `(("java-junit" ,java-junit)
11610 ("java-hamcrest-core" ,java-hamcrest-core)))))
11611
11612 (define-public java-gson
11613 (package
11614 (name "java-gson")
11615 (version "2.8.2")
11616 (source (origin
11617 (method url-fetch)
11618 (uri (string-append "https://github.com/google/gson/archive/"
11619 "gson-parent-" version ".tar.gz"))
11620 (sha256
11621 (base32
11622 "1j4qnp7v046q0k48c4kyf69sxaasx2h949d3cqwsm3kzxms3x0f9"))))
11623 (build-system ant-build-system)
11624 (arguments
11625 `(#:jar-name "gson.jar"
11626 #:source-dir "gson/src/main/java"
11627 #:test-dir "gson/src/test"))
11628 (native-inputs
11629 `(("java-junit" ,java-junit)
11630 ("java-hamcrest-core" ,java-hamcrest-core)))
11631 (home-page "https://github.com/google/gson")
11632 (synopsis "Java serialization/deserialization library from/to JSON")
11633 (description "Gson is a Java library that can be used to convert Java
11634 Objects into their JSON representation. It can also be used to convert a JSON
11635 string to an equivalent Java object. Gson can work with arbitrary Java objects
11636 including pre-existing objects that you do not have source-code of.")
11637 (license license:asl2.0)))
11638
11639 (define-public java-hawtjni
11640 (package
11641 (name "java-hawtjni")
11642 (version "1.15")
11643 (source (origin
11644 (method url-fetch)
11645 (uri (string-append "https://github.com/fusesource/hawtjni/archive/"
11646 "hawtjni-project-" version ".tar.gz"))
11647 (sha256
11648 (base32
11649 "1bqfd732rmh6svyx17fpw9175gc9gzkcbyps2yyrf50c3zzjas6g"))))
11650 (build-system ant-build-system)
11651 (arguments
11652 `(#:jar-name "hawtjni.jar"
11653 #:source-dir "hawtjni-generator/src/main/java:hawtjni-runtime/src/main/java"
11654 #:tests? #f; no tests
11655 #:phases
11656 (modify-phases %standard-phases
11657 (add-before 'build 'build-native
11658 (lambda* (#:key inputs #:allow-other-keys)
11659 (let ((include (string-append "-I" (assoc-ref inputs "jdk") "/include/linux")))
11660 (with-directory-excursion "hawtjni-generator/src/main/resources/"
11661 (invoke "gcc" "-c" "hawtjni.c" "-o" "hawtjni.o"
11662 "-fPIC" "-O2" include)
11663 (invoke "gcc" "-c" "hawtjni-callback.c" "-o" "hawtjni-callback.o"
11664 "-fPIC" "-O2" include)
11665 (invoke "gcc" "-o" "libhawtjni.so" "-shared"
11666 "hawtjni.o" "hawtjni-callback.o")))
11667 #t))
11668 (add-after 'install 'install-native
11669 (lambda* (#:key outputs #:allow-other-keys)
11670 (let* ((out (assoc-ref outputs "out"))
11671 (lib (string-append out "/lib"))
11672 (inc (string-append out "/include")))
11673 (with-directory-excursion "hawtjni-generator/src/main/resources/"
11674 (install-file "libhawtjni.so" lib)
11675 (install-file "hawtjni.h" inc)))
11676 #t))
11677 (add-before 'install 'install-parent
11678 (install-pom-file "pom.xml"))
11679 (replace 'install
11680 (install-from-pom "hawtjni-runtime/pom.xml")))))
11681 (inputs
11682 `(("java-commons-cli" ,java-commons-cli)
11683 ("java-asm" ,java-asm)
11684 ("java-geronimo-xbean-finder" ,java-geronimo-xbean-finder)))
11685 (home-page "https://fusesource.github.io/hawtjni/")
11686 (synopsis "JNI code generator")
11687 (description "HawtJNI is a code generator that produces the JNI code needed
11688 to implement Java native methods. It is based on the jnigen code generator
11689 that is part of the SWT Tools project.")
11690 (license license:asl2.0)))
11691
11692 (define-public java-jansi-native
11693 (package
11694 (name "java-jansi-native")
11695 (version "1.7")
11696 (source (origin
11697 (method url-fetch)
11698 (uri (string-append "https://github.com/fusesource/jansi-native/"
11699 "archive/jansi-native-" version ".tar.gz"))
11700 (sha256
11701 (base32
11702 "0j2ydlgxbzbgshqkwghbxxxnbnx1mmjgd6k5fw6xfvxw1z956yqf"))))
11703 (build-system ant-build-system)
11704 (arguments
11705 `(#:jar-name "jansi-native.jar"
11706 #:source-dir "src/main/java"
11707 #:tests? #f; no tests
11708 #:phases
11709 (modify-phases %standard-phases
11710 (add-before 'build 'build-native
11711 (lambda* (#:key inputs #:allow-other-keys)
11712 ;; there are more required files for windows in windows/
11713 (with-directory-excursion "src/main/native-package/src"
11714 (substitute* "jansi_ttyname.c"
11715 (("#include \"jansi_.*") ""))
11716 (invoke "gcc" "-c" "jansi_ttyname.c" "-o" "jansi_ttyname.o"
11717 (string-append "-I" (assoc-ref inputs "java-hawtjni")
11718 "/include")
11719 (string-append "-I" (assoc-ref inputs "jdk")
11720 "/include/linux")
11721 "-fPIC" "-O2")
11722 (invoke "gcc" "-o" "libjansi.so" "-shared" "jansi_ttyname.o"))))
11723 (add-before 'build 'install-native
11724 (lambda _
11725 (let ((dir (string-append "build/classes/META-INF/native/"
11726 ,(match (%current-system)
11727 ((or "i686-linux" "armhf-linux")
11728 "linux32")
11729 ((or "x86_64-linux" "aarch64-linux"
11730 "mips64el-linux")
11731 "linux64")
11732 (_ "unknown-kernel")))))
11733 (install-file "src/main/native-package/src/libjansi.so" dir))
11734 #t))
11735 (add-after 'install 'install-native
11736 (lambda* (#:key outputs #:allow-other-keys)
11737 (install-file "src/main/native-package/src/jansi.h"
11738 (string-append (assoc-ref outputs "out") "/include"))
11739 #t))
11740 (add-before 'install 'fix-pom
11741 (lambda _
11742 ;; pom contains variables to complete name, but we don't support that
11743 (substitute* "pom.xml"
11744 (("\\$\\{platform\\}") "native"))
11745 #t))
11746 (replace 'install
11747 (install-from-pom "pom.xml")))))
11748 (propagated-inputs
11749 `(("java-hawtjni" ,java-hawtjni)))
11750 (home-page "https://fusesource.github.io/jansi/")
11751 (synopsis "Native library for jansi")
11752 (description "This package provides the native library for jansi, a small
11753 Java library that allows you to use ANSI escape sequences to format your
11754 console output.")
11755 (license license:asl2.0)))
11756
11757 (define-public java-jansi
11758 (package
11759 (name "java-jansi")
11760 (version "1.16")
11761 (source (origin
11762 (method url-fetch)
11763 (uri (string-append "https://github.com/fusesource/jansi/archive/"
11764 "jansi-project-" version ".tar.gz"))
11765 (sha256
11766 (base32
11767 "11kh3144i3fzp21dpy8zg52mjmsr214k7km9p8ly0rqk2px0qq2z"))))
11768 (build-system ant-build-system)
11769 (arguments
11770 `(#:jar-name "jansi.jar"
11771 #:source-dir "jansi/src/main/java"
11772 #:test-dir "jansi/src/test"
11773 #:phases
11774 (modify-phases %standard-phases
11775 (add-after 'check 'clear-term
11776 (lambda _
11777 (invoke "echo" "-e" "\\e[0m")))
11778 (add-before 'install 'install-parent
11779 (install-pom-file "pom.xml"))
11780 (add-before 'install 'fix-pom
11781 (lambda _
11782 ;; pom adds jansi native versions for different platforms, but we
11783 ;; only need one, so use native instead
11784 (substitute* "jansi/pom.xml"
11785 (("windows32") "native")
11786 (("windows64") "native")
11787 (("osx") "native")
11788 (("linux32") "native")
11789 (("linux64") "native")
11790 (("freebsd32") "native")
11791 (("freebsd64") "native"))
11792 #t))
11793 (replace 'install
11794 (install-from-pom "jansi/pom.xml")))))
11795 (propagated-inputs
11796 `(("java-jansi-native" ,java-jansi-native)))
11797 (native-inputs
11798 `(("java-junit" ,java-junit)
11799 ("java-hamcrest-core" ,java-hamcrest-core)))
11800 (home-page "https://fusesource.github.io/jansi/")
11801 (synopsis "Portable ANSI escape sequences")
11802 (description "Jansi is a Java library that allows you to use ANSI escape
11803 sequences to format your console output which works on every platform.")
11804 (license license:asl2.0)))
11805
11806 (define-public java-jboss-el-api-spec
11807 (package
11808 (name "java-jboss-el-api-spec")
11809 (version "3.0")
11810 (source (origin
11811 (method url-fetch)
11812 (uri (string-append "https://github.com/jboss/jboss-el-api_spec/"
11813 "archive/jboss-el-api_" version
11814 "_spec-1.0.7.Final.tar.gz"))
11815 (sha256
11816 (base32
11817 "1j45ljxalwlibxl7g7iv952sjxkw275m8vyxxij8l6wdd5pf0pdh"))))
11818 (build-system ant-build-system)
11819 (arguments
11820 `(#:jar-name "java-jboss-el-api_spec.jar"
11821 #:modules ((guix build ant-build-system)
11822 (guix build utils)
11823 (guix build maven pom)
11824 (guix build java-utils)
11825 (sxml simple))
11826 #:phases
11827 (modify-phases %standard-phases
11828 ;; the origin of javax.el:javax.el-api is unknown, so we use this package
11829 ;; instead, which implements the same thing. We override the pom file
11830 ;; to "rename" the package so it can be found by maven.
11831 (add-before 'install 'override-pom
11832 (lambda _
11833 (delete-file "pom.xml")
11834 (with-output-to-file "pom.xml"
11835 (lambda _
11836 (sxml->xml
11837 `(project
11838 (modelVersion "4.0.0")
11839 (name "el-api")
11840 (groupId "javax.el")
11841 (artifactId "javax.el-api")
11842 (version "3.0")))))
11843 #t))
11844 (replace 'install
11845 (install-from-pom "pom.xml")))))
11846 (inputs
11847 `(("java-junit" ,java-junit)))
11848 (home-page "https://github.com/jboss/jboss-el-api_spec")
11849 (synopsis "JSR-341 expression language 3.0 API")
11850 (description "This package contains an implementation of the JSR-341
11851 specification for the expression language 3.0. It implements an expression
11852 language inspired by ECMAScript and XPath. This language is used with
11853 JavaServer Pages (JSP).")
11854 ;; Either GPL2 only or CDDL.
11855 (license (list license:gpl2 license:cddl1.1))))
11856
11857 (define-public java-jboss-interceptors-api-spec
11858 (package
11859 (name "java-jboss-interceptors-api-spec")
11860 (version "1.2")
11861 (source (origin
11862 (method url-fetch)
11863 (uri (string-append "https://github.com/jboss/jboss-interceptors-api_spec/"
11864 "archive/jboss-interceptors-api_" version
11865 "_spec-1.0.0.Final.tar.gz"))
11866 (sha256
11867 (base32
11868 "0wv8x0jp9a5qxlrgkhb5jdk2gr6vi87b4j4kjb8ryxiy9gn8g51z"))))
11869 (build-system ant-build-system)
11870 (arguments
11871 `(#:jar-name "java-jboss-interceptors-api_spec.jar"
11872 #:jdk ,icedtea-8
11873 #:source-dir "."
11874 #:tests? #f; no tests
11875 #:modules ((guix build ant-build-system)
11876 (guix build utils)
11877 (guix build maven pom)
11878 (guix build java-utils)
11879 (sxml simple))
11880 #:phases
11881 (modify-phases %standard-phases
11882 ;; the origin of javax.interceptor:javax.interceptor-api is unknown,
11883 ;; so we use this package instead, which implements the same thing.
11884 ;; We override the pom file to "rename" the package so it can be found
11885 ;; by maven.
11886 (add-before 'install 'override-pom
11887 (lambda _
11888 (delete-file "pom.xml")
11889 (with-output-to-file "pom.xml"
11890 (lambda _
11891 (sxml->xml
11892 `(project
11893 (modelVersion "4.0.0")
11894 (name "interceptor-api")
11895 (groupId "javax.interceptor")
11896 (artifactId "javax.interceptor-api")
11897 (version "3.0")))))
11898 #t))
11899 (replace 'install
11900 (install-from-pom "pom.xml")))))
11901 (home-page "https://github.com/jboss/jboss-interceptors-api_spec")
11902 (synopsis "Interceptors 1.2 API classes from JSR 318")
11903 (description "Java-jboss-interceptors-api-spec implements the Interceptors
11904 API. Interceptors are used to interpose on business method invocations and
11905 specific events.")
11906 ;; Either GPL2 only or CDDL.
11907 (license (list license:gpl2 license:cddl1.1))))
11908
11909 (define-public java-cdi-api
11910 (package
11911 (name "java-cdi-api")
11912 (version "2.0")
11913 (source (origin
11914 (method url-fetch)
11915 (uri (string-append "https://github.com/cdi-spec/cdi/archive/"
11916 version ".tar.gz"))
11917 (file-name (string-append name "-" version ".tar.gz"))
11918 (sha256
11919 (base32
11920 "1iv8b8bp07c5kmqic14jsr868vycjv4qv02lf3pkgp9z21mnfg5y"))))
11921 (build-system ant-build-system)
11922 (arguments
11923 `(#:source-dir "api/src/main/java"
11924 #:jar-name "java-cdi-api.jar"
11925 #:test-dir "api/src/test"
11926 #:jdk ,icedtea-8
11927 #:tests? #f; Tests fail because we don't have a CDI provider yet
11928 #:phases
11929 (modify-phases %standard-phases
11930 (replace 'install
11931 (install-from-pom "api/pom.xml")))))
11932 (propagated-inputs
11933 `(("java-javax-inject" ,java-javax-inject)
11934 ("java-jboss-el-api-spec" ,java-jboss-el-api-spec)
11935 ("java-jboss-interceptors-api-spec" ,java-jboss-interceptors-api-spec)
11936 ("java-weld-parent-pom" ,java-weld-parent-pom)))
11937 (native-inputs
11938 `(("java-testng" ,java-testng)
11939 ("java-hamcrest-core" ,java-hamcrest-core)))
11940 (home-page "http://cdi-spec.org/")
11941 (synopsis "Contexts and Dependency Injection APIs")
11942 (description "Java-cdi-api contains the required APIs for Contexts and
11943 Dependency Injection (CDI).")
11944 (license license:asl2.0)))
11945
11946 (define-public java-joda-convert
11947 (package
11948 (name "java-joda-convert")
11949 (version "1.9.2")
11950 (source (origin
11951 (method url-fetch)
11952 (uri (string-append "https://github.com/JodaOrg/joda-convert/archive/v"
11953 version ".tar.gz"))
11954 (file-name (string-append name "-" version ".tar.gz"))
11955 (sha256
11956 (base32
11957 "0vp346xz7dh9br4q7xazhc7hvzf76a6hf95fki9bg67q5jr0kjh7"))))
11958 (build-system ant-build-system)
11959 (arguments
11960 `(#:jar-name (string-append ,name "-" ,version ".jar")
11961 #:source-dir "src/main/java"
11962 #:test-include (list "**/Test*.java")
11963 ;; Contains only interfaces and base classes (no test)
11964 #:test-exclude (list "**/test*/**.java")))
11965 (inputs
11966 `(("java-guava" ,java-guava)))
11967 (native-inputs
11968 `(("java-junit" ,java-junit)
11969 ("java-hamcrest-core" ,java-hamcrest-core)))
11970 (home-page "https://www.joda.org/joda-convert/")
11971 (synopsis "Conversion between Objects and Strings")
11972 (description "Joda-Convert provides a small set of classes to aid
11973 conversion between Objects and Strings. It is not intended to tackle the
11974 wider problem of Object to Object transformation.")
11975 (license license:asl2.0)))
11976
11977 (define-public java-joda-time
11978 (package
11979 (name "java-joda-time")
11980 (version "2.9.9")
11981 (source (origin
11982 (method url-fetch)
11983 (uri (string-append "https://github.com/JodaOrg/joda-time/archive/v"
11984 version ".tar.gz"))
11985 (file-name (string-append name "-" version ".tar.gz"))
11986 (sha256
11987 (base32
11988 "1i9x91mi7yg2pasl0k3912f1pg46n37sps6rdb0v1gs8hj9ppwc1"))))
11989 (build-system ant-build-system)
11990 (arguments
11991 `(#:jar-name "java-joda-time.jar"
11992 #:source-dir "src/main/java"
11993 #:test-include (list "**/Test*.java")
11994 ;; There is no runnable test in these files
11995 #:test-exclude (list "**/Test*Chronology.java" "**/Test*Field.java")
11996 #:phases
11997 (modify-phases %standard-phases
11998 (add-after 'build 'build-resources
11999 (lambda _
12000 (mkdir-p "build/classes/org/joda/time/tz/data")
12001 (mkdir-p "build/classes/org/joda/time/format")
12002 ;; This will produce the following exception:
12003 ;; java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap"
12004 ;; which is normal, because it doesn't exist yet. It still generates
12005 ;; the same file as in the binary one can find on maven.
12006 (invoke "java" "-cp"
12007 (string-append "build/classes:" (getenv "CLASSPATH"))
12008 "org.joda.time.tz.ZoneInfoCompiler"
12009 "-src" "src/main/java/org/joda/time/tz/src"
12010 "-dst" "build/classes/org/joda/time/tz/data"
12011 "africa" "antarctica" "asia" "australasia"
12012 "europe" "northamerica" "southamerica"
12013 "pacificnew" "etcetera" "backward" "systemv")
12014 (for-each (lambda (f)
12015 (copy-file f (string-append
12016 "build/classes/org/joda/time/format/"
12017 (basename f))))
12018 (find-files "src/main/java/org/joda/time/format" ".*.properties"))
12019 #t))
12020 (add-before 'install 'regenerate-jar
12021 (lambda _
12022 ;; We need to regenerate the jar file to add generated data.
12023 (delete-file "build/jar/java-joda-time.jar")
12024 (invoke "ant" "jar")))
12025 (add-before 'check 'copy-test-resources
12026 (lambda _
12027 (mkdir-p "build/test-classes/org/joda/time/tz/data")
12028 (copy-file "src/test/resources/tzdata/ZoneInfoMap"
12029 "build/test-classes/org/joda/time/tz/data/ZoneInfoMap")
12030 (copy-recursively "src/test/resources" "build/test-classes")
12031 #t)))))
12032 (inputs
12033 `(("java-joda-convert" ,java-joda-convert)))
12034 (native-inputs
12035 `(("java-junit" ,java-junit)
12036 ("java-hamcrest-core" ,java-hamcrest-core)
12037 ("tzdata" ,tzdata)))
12038 (home-page "https://www.joda.org/joda-time/")
12039 (synopsis "Replacement for the Java date and time classes")
12040 (description "Joda-Time is a replacement for the Java date and time
12041 classes prior to Java SE 8.")
12042 (license license:asl2.0)))
12043
12044 (define-public java-xerces
12045 (package
12046 (name "java-xerces")
12047 (version "2.12.1")
12048 (source
12049 (origin
12050 (method url-fetch)
12051 (uri (string-append "mirror://apache/xerces/j/source/"
12052 "Xerces-J-src." version ".tar.gz"))
12053 (sha256
12054 (base32 "0494kq36gw3nah19ifb720vwxbpg4ww0k6m3zq6wyanw6a083p6s"))
12055 (patches (search-patches
12056 "java-xerces-xjavac_taskdef.patch"
12057 "java-xerces-build_dont_unzip.patch"
12058 "java-xerces-bootclasspath.patch"))))
12059 (build-system ant-build-system)
12060 (arguments
12061 `(#:tests? #f;; Test files are not present
12062 #:test-target "test"
12063 #:jdk ,icedtea-8
12064 #:phases
12065 (modify-phases %standard-phases
12066 (add-after 'unpack 'create-build.properties
12067 (lambda* (#:key inputs #:allow-other-keys)
12068 (let ((jaxp (assoc-ref inputs "java-jaxp"))
12069 (resolver (assoc-ref inputs "java-apache-xml-commons-resolver")))
12070 (with-output-to-file "build.properties"
12071 (lambda _
12072 (format #t
12073 "jar.jaxp = ~a/share/java/jaxp.jar~@
12074 jar.apis-ext = ~a/share/java/jaxp.jar~@
12075 jar.resolver = ~a/share/java/xml-resolver.jar~%"
12076 jaxp jaxp resolver)))
12077 ;; Make xerces use our version of jaxp in tests
12078 (substitute* "build.xml"
12079 (("xml-apis.jar")
12080 (string-append jaxp "/share/java/jaxp.jar"))
12081 (("\\$\\{tools.dir\\}/\\$\\{jar.apis\\}")
12082 "${jar.apis}")))
12083 #t))
12084 (replace 'install (install-jars "build")))))
12085 (inputs
12086 `(("java-apache-xml-commons-resolver" ,java-apache-xml-commons-resolver)
12087 ("java-jaxp" ,java-jaxp)))
12088 (home-page "https://xerces.apache.org/xerces2-j/")
12089 (synopsis "Validating XML parser for Java with DOM level 3 support")
12090 (description "The Xerces2 Java parser is the reference implementation of
12091 XNI, the Xerces Native Interface, and also a fully conforming XML Schema
12092 processor.
12093
12094 Xerces2-J supports the following standards and APIs:
12095
12096 @itemize
12097 @item eXtensible Markup Language (XML) 1.0 Second Edition Recommendation
12098 @item Namespaces in XML Recommendation
12099 @item Document Object Model (DOM) Level 2 Core, Events, and Traversal and
12100 Range Recommendations
12101 @item Simple API for XML (SAX) 2.0.1 Core and Extension
12102 @item Java APIs for XML Processing (JAXP) 1.2.01
12103 @item XML Schema 1.0 Structures and Datatypes Recommendations
12104 @item Experimental implementation of the Document Object Model (DOM) Level 3
12105 Core and Load/Save Working Drafts
12106 @item Provides a partial implementation of the XML Inclusions (XInclude) W3C
12107 Candidate Recommendation
12108 @end itemize
12109
12110 Xerces is now able to parse documents written according to the XML 1.1
12111 Candidate Recommendation, except that it does not yet provide an option to
12112 enable normalization checking as described in section 2.13 of this
12113 specification. It also handles namespaces according to the XML Namespaces 1.1
12114 Candidate Recommendation, and will correctly serialize XML 1.1 documents if
12115 the DOM level 3 load/save API's are in use.")
12116 (license license:asl2.0)))
12117
12118 (define-public java-jakarta-regexp
12119 (package
12120 (name "java-jakarta-regexp")
12121 (version "1.5")
12122 (source
12123 (origin
12124 (method url-fetch)
12125 (uri (string-append
12126 "https://archive.apache.org/dist/jakarta/regexp/jakarta-regexp-"
12127 version ".tar.gz"))
12128 (sha256
12129 (base32
12130 "0zg9rmyif48dck0cv6ynpxv23mmcsx265am1fnnxss7brgw0ms3r"))))
12131 (build-system ant-build-system)
12132 (arguments
12133 `(#:test-target "test"
12134 #:phases
12135 (modify-phases %standard-phases
12136 (replace 'install
12137 (lambda* (#:key outputs #:allow-other-keys)
12138 (let* ((out (assoc-ref outputs "out"))
12139 (out-share (string-append out "/share/java")))
12140 (mkdir-p out-share)
12141 (for-each (lambda (name)
12142 (install-file name out-share))
12143 (find-files "build" "^jakarta-regexp-.*\\.jar$"))
12144 #t))))))
12145 (home-page "https://attic.apache.org/projects/jakarta-regexp.html")
12146 (synopsis "Regular expression parser generator for Java.")
12147 (description "@code{jakarta-regexp} is an old regular expression parser
12148 generator for Java.")
12149 (license license:asl2.0)))
12150
12151 (define-public java-jline
12152 (package
12153 (name "java-jline")
12154 (version "1.0")
12155 (source (origin
12156 (method url-fetch)
12157 (uri (string-append "https://github.com/jline/jline1/archive/jline-"
12158 version ".tar.gz"))
12159 (sha256
12160 (base32
12161 "0bi3p6vrh7a6v0fbpb6rx9plpmx5zk3lr352xzdbz2jcxg499wir"))))
12162 (build-system ant-build-system)
12163 (arguments
12164 `(#:jar-name "jline.jar"
12165 #:source-dir "src/main/java"
12166 #:test-dir "src/test"
12167 #:phases
12168 (modify-phases %standard-phases
12169 (add-before 'build 'copy-resources
12170 (lambda _
12171 (copy-recursively "src/main/resources" "build/classes")
12172 #t)))))
12173 (native-inputs
12174 `(("java-junit" ,java-junit)))
12175 (home-page "https://jline.github.io")
12176 (synopsis "Console input handling library")
12177 (description "JLine is a Java library for handling console input. It is
12178 similar in functionality to BSD editline and GNU readline but with additional
12179 features that bring it on par with the Z shell line editor.")
12180 (license license:bsd-3)))
12181
12182 (define-public java-jline-2
12183 (package
12184 (inherit java-jline)
12185 (version "2.14.5")
12186 (source (origin
12187 (method url-fetch)
12188 (uri (string-append "https://github.com/jline/jline2/archive/jline-"
12189 version ".tar.gz"))
12190 (sha256
12191 (base32
12192 "1c6qa26mf0viw8hg4jnv72s7i1qb1gh1l8rrzcdvqhqhx82rkdlf"))))
12193 (arguments
12194 `(#:jdk ,icedtea-8
12195 ,@(package-arguments java-jline)))
12196 (inputs
12197 `(("java-jansi" ,java-jansi)
12198 ("java-jansi-native" ,java-jansi-native)))
12199 (native-inputs
12200 `(("java-powermock-modules-junit4" ,java-powermock-modules-junit4)
12201 ("java-powermock-modules-junit4-common" ,java-powermock-modules-junit4-common)
12202 ("java-powermock-api-easymock" ,java-powermock-api-easymock)
12203 ("java-powermock-api-support" ,java-powermock-api-support)
12204 ("java-powermock-core" ,java-powermock-core)
12205 ("java-powermock-reflect" ,java-powermock-reflect)
12206 ("java-easymock" ,java-easymock)
12207 ("java-jboss-javassist" ,java-jboss-javassist)
12208 ("java-objenesis" ,java-objenesis)
12209 ("java-asm" ,java-asm)
12210 ("java-hamcrest-core" ,java-hamcrest-core)
12211 ("java-cglib" ,java-cglib)
12212 ("java-junit" ,java-junit)
12213 ("java-hawtjni" ,java-hawtjni)))))
12214
12215 (define-public java-xmlunit
12216 (package
12217 (name "java-xmlunit")
12218 (version "2.5.1")
12219 (source (origin
12220 (method url-fetch)
12221 (uri (string-append "https://github.com/xmlunit/xmlunit/archive/v"
12222 version ".tar.gz"))
12223 (file-name (string-append name "-" version ".tar.gz"))
12224 (sha256
12225 (base32
12226 "035rivlnmwhfqj0fzviciv0bkh1h95ps1iwnh2kjcvdbk5nccm4z"))))
12227 (build-system ant-build-system)
12228 (arguments
12229 `(#:jar-name "java-xmlunit.jar"
12230 #:source-dir "xmlunit-core/src/main/java"
12231 #:test-dir "xmlunit-core/src/test"
12232 #:phases
12233 (modify-phases %standard-phases
12234 (add-before 'check 'copy-test-resources
12235 (lambda* (#:key inputs #:allow-other-keys)
12236 (copy-recursively (assoc-ref inputs "resources") "../test-resources")
12237 #t)))))
12238 (native-inputs
12239 `(("java-junit" ,java-junit)
12240 ("java-mockito-1" ,java-mockito-1)
12241 ("java-hamcrest-all" ,java-hamcrest-all)
12242 ("java-objenesis" ,java-objenesis)
12243 ("java-asm" ,java-asm)
12244 ("java-cglib" ,java-cglib)
12245 ("resources"
12246 ,(origin
12247 (method git-fetch)
12248 (uri (git-reference
12249 (url "https://github.com/xmlunit/test-resources")
12250 (commit "a590d2ae865c3e0455691d76ba8eefccc2215aec")))
12251 (file-name "java-xmlunit-test-resources")
12252 (sha256
12253 (base32
12254 "0r0glj37pg5l868yjz78gckr91cs8fysxxbp9p328dssssi91agr"))))))
12255 (home-page "https://www.xmlunit.org/")
12256 (synopsis "XML output testing")
12257 (description "XMLUnit provides you with the tools to verify the XML you
12258 emit is the one you want to create. It provides helpers to validate against
12259 an XML Schema, assert the values of XPath queries or compare XML documents
12260 against expected outcomes.")
12261 (license license:asl2.0)))
12262
12263 (define-public java-xmlunit-legacy
12264 (package
12265 (inherit java-xmlunit)
12266 (name "java-xmlunit-legacy")
12267 (arguments
12268 `(#:jar-name "java-xmlunit-legacy.jar"
12269 #:source-dir "xmlunit-legacy/src/main/java"
12270 #:test-dir "xmlunit-legacy/src/test"))
12271 (inputs
12272 `(("java-xmlunit" ,java-xmlunit)
12273 ("java-junit" ,java-junit)))
12274 (native-inputs
12275 `(("java-mockito-1" ,java-mockito-1)))))
12276
12277 (define-public java-xmlunit-matchers
12278 (package
12279 (inherit java-xmlunit)
12280 (name "java-xmlunit-matchers")
12281 (arguments
12282 `(#:jar-name "java-xmlunit-matchers.jar"
12283 #:source-dir "xmlunit-matchers/src/main/java"
12284 #:test-dir "xmlunit-matchers/src/test"
12285 #:test-exclude
12286 ;; Cannot open xsd for http://www.xmlunit.org/test-support/Book.xsd
12287 (list "**/ValidationMatcherTest.java")
12288 #:phases
12289 (modify-phases %standard-phases
12290 (add-before 'build 'copy-test-class
12291 (lambda _
12292 (copy-file "xmlunit-core/src/test/java/org/xmlunit/TestResources.java"
12293 "xmlunit-matchers/src/test/java/org/xmlunit/TestResources.java")
12294 #t))
12295 (add-before 'build 'fix-test-resources-path
12296 (lambda _
12297 (substitute* (find-files "xmlunit-matchers/src/test" ".*.java")
12298 (("../test-resources") "test-resources"))
12299 #t))
12300 (add-before 'check 'copy-test-resources
12301 (lambda* (#:key inputs #:allow-other-keys)
12302 (copy-recursively (assoc-ref inputs "resources") "test-resources")
12303 #t)))))
12304 (inputs
12305 `(("java-xmlunit" ,java-xmlunit)
12306 ("java-junit" ,java-junit)))))
12307
12308 (define-public java-openchart2
12309 (package
12310 (name "java-openchart2")
12311 (version "1.4.3")
12312 (source (origin
12313 (method url-fetch)
12314 (uri (string-append "http://download.approximatrix.com/openchart2/"
12315 "openchart2-" version ".source.zip"))
12316 (sha256
12317 (base32
12318 "1xq96zm5r02n1blja0072jmmsifmxc40lbyfbnmcnr6mw42frh4g"))))
12319 (build-system ant-build-system)
12320 (arguments
12321 `(#:test-target "test"
12322 #:phases
12323 (modify-phases %standard-phases
12324 (add-after 'unpack 'fix-junit-errors
12325 (lambda _
12326 (with-directory-excursion "unittest/src/com/approximatrix/charting/"
12327 (substitute* '("coordsystem/ticklocator/NumericXTickLocatorTest.java"
12328 "coordsystem/ticklocator/NumericYTickLocatorTest.java"
12329 "coordsystem/ticklocator/ObjectXTickLocatorTest.java"
12330 "model/DefaultChartDataModelConstraintsTest.java"
12331 "model/MultiScatterDataModelConstraintsTest.java"
12332 "model/threedimensional/DotPlotDataModelConstraintsTest.java")
12333 (("(assertEquals[^;]+);" before _)
12334 (string-append (string-drop-right before 2) ", 1E-6);"))))
12335 #t))
12336 (replace 'install (install-jars ".")))))
12337 (native-inputs
12338 `(("unzip" ,unzip)
12339 ("java-junit" ,java-junit)
12340 ("java-hamcrest-core" ,java-hamcrest-core)))
12341 (home-page "https://approximatrix.com/products/openchart2/")
12342 (synopsis "Simple plotting for Java")
12343 (description "Openchart2 provides a simple, yet powerful, interface for
12344 Java programmers to create two-dimensional charts and plots. The library
12345 features an assortment of graph styles, including advanced scatter plots, bar
12346 graphs, and pie charts.")
12347 (license license:lgpl2.1+)))
12348
12349 (define-public java-commons-httpclient
12350 (package
12351 (name "java-commons-httpclient")
12352 (version "3.1")
12353 (source (origin
12354 (method url-fetch)
12355 (uri (string-append "mirror://apache/httpcomponents/"
12356 "commons-httpclient/source/commons-httpclient-"
12357 version "-src.tar.gz"))
12358 (sha256
12359 (base32
12360 "1wlpn3cfy3d4inxy6g7wxcsa8p7sshn6aldk9y4ia3lb879rd97r"))))
12361 (build-system ant-build-system)
12362 (arguments
12363 `(#:build-target "compile"
12364 #:test-target "test"
12365 #:tests? #f; requires junit-textui (junit 3)
12366 #:phases
12367 (modify-phases %standard-phases
12368 (add-before 'build 'fix-accent
12369 (lambda _
12370 (for-each (lambda (file)
12371 (with-fluids ((%default-port-encoding "ISO-8859-1"))
12372 (substitute* file
12373 (("\\* @author Ortwin .*") "* @author Ortwin Glueck\n"))))
12374 '("src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java"
12375 "src/examples/TrivialApp.java" "src/examples/ClientApp.java"
12376 "src/test/org/apache/commons/httpclient/TestHttps.java"
12377 "src/test/org/apache/commons/httpclient/TestURIUtil2.java"))
12378 #t))
12379 (replace 'install
12380 (lambda* (#:key outputs #:allow-other-keys)
12381 (invoke "ant" "dist"
12382 (string-append "-Ddist.home=" (assoc-ref outputs "out")
12383 "/share/java"))
12384 #t)))))
12385 (propagated-inputs
12386 `(("java-commons-logging" ,java-commons-logging-minimal)
12387 ("java-commons-codec" ,java-commons-codec)))
12388 (home-page "https://hc.apache.org")
12389 (synopsis "HTTP/1.1 compliant HTTP agent implementation")
12390 (description "This package contains an HTTP/1.1 compliant HTTP agent
12391 implementation. It also provides reusable components for client-side
12392 authentication, HTTP state management, and HTTP connection management.")
12393 (license license:asl2.0)))
12394
12395 (define-public java-commons-vfs
12396 (package
12397 (name "java-commons-vfs")
12398 (version "2.2")
12399 (source (origin
12400 (method url-fetch)
12401 (uri (string-append "mirror://apache/commons/vfs/source/"
12402 "commons-vfs2-distribution-" version "-src.tar.gz"))
12403 (file-name (string-append name "-" version ".tar.gz"))
12404 (sha256
12405 (base32
12406 "1cnq1iaghbp4cslpnvwbp83i5v234x87irssqynhwpfgw7caf1s3"))
12407 (modules '((guix build utils)))
12408 (snippet
12409 '(begin
12410 (for-each delete-file
12411 (find-files "." "\\.jar$"))
12412 #t))))
12413 (build-system ant-build-system)
12414 (arguments
12415 `(#:jar-name "commons-vfs.jar"
12416 #:source-dir "commons-vfs2/src/main/java"
12417 #:test-dir "commons-vfs2/src/test"
12418 ; FIXME: tests depend on many things: apache sshd, hadoop, ftpserver, ...
12419 #:tests? #f
12420 #:phases
12421 (modify-phases %standard-phases
12422 (add-before 'build 'remove-hadoop-and-webdav
12423 ; Remove these files as they are not required and depend on difficult
12424 ; packages.
12425 (lambda _
12426 (for-each delete-file-recursively
12427 '("commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/webdav"
12428 "commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs"))
12429 #t)))))
12430 (inputs
12431 `(("java-commons-collections4" ,java-commons-collections4)
12432 ("java-commons-compress" ,java-commons-compress)
12433 ("java-commons-httpclient" ,java-commons-httpclient)
12434 ("java-commons-logging-minimal" ,java-commons-logging-minimal)
12435 ("java-commons-net" ,java-commons-net)
12436 ("java-jsch" ,java-jsch)))
12437 (home-page "https://commons.apache.org/proper/commons-vfs/")
12438 (synopsis "Java file system library")
12439 (description "Commons VFS provides a single API for accessing various
12440 different file systems. It presents a uniform view of the files from various
12441 different sources, such as the files on local disk, on an HTTP server, or
12442 inside a Zip archive.")
12443 (license license:asl2.0)))
12444
12445 (define-public java-jakarta-oro
12446 (package
12447 (name "java-jakarta-oro")
12448 (version "2.0.8")
12449 (source (origin
12450 (method url-fetch)
12451 (uri (string-append "mirror://apache/jakarta/oro/"
12452 "jakarta-oro-" version ".tar.gz"))
12453 (sha256
12454 (base32
12455 "0rpmnsskiwmsy8r0sckz5n5dbvh3vkxx8hpm177c754r8xy3qksc"))
12456 (modules '((guix build utils)))
12457 (snippet
12458 `(begin
12459 (delete-file (string-append "jakarta-oro-" ,version ".jar"))
12460 #t))))
12461 (build-system ant-build-system)
12462 (arguments
12463 `(#:build-target "package"
12464 #:make-flags (list "-DDATE" "(no recorded date for reproducibility)")
12465 #:tests? #f; tests are run as part of the build process
12466 #:phases
12467 (modify-phases %standard-phases
12468 (replace 'install
12469 (install-jars ,(string-append "jakarta-oro-" version))))))
12470 (home-page "https://jakarta.apache.org/oro/")
12471 (synopsis "Text-processing for Java")
12472 (description "The Jakarta-ORO Java classes are a set of text-processing
12473 Java classes that provide Perl5 compatible regular expressions, AWK-like
12474 regular expressions, glob expressions, and utility classes for performing
12475 substitutions, splits, filtering filenames, etc. This library is the successor
12476 of the OROMatcher, AwkTools, PerlTools, and TextTools libraries originally
12477 from ORO, Inc.")
12478 (license license:asl1.1)))
12479
12480 (define-public java-native-access
12481 (package
12482 (name "java-native-access")
12483 (version "4.5.1")
12484 (source (origin
12485 (method url-fetch)
12486 (uri (string-append "https://github.com/java-native-access/jna/"
12487 "archive/" version ".tar.gz"))
12488 (file-name (string-append name "-" version ".tar.gz"))
12489 (sha256
12490 (base32
12491 "0zrpzkib6b905i018a9pqlzkqinphywr6y4jwv6mwp63jjqvqkd9"))
12492 (modules '((guix build utils)))
12493 (snippet
12494 `(begin
12495 (for-each delete-file (find-files "." ".*.jar"))
12496 (delete-file-recursively "native/libffi")
12497 (delete-file-recursively "dist")
12498 #t))))
12499 (build-system ant-build-system)
12500 (arguments
12501 `(#:tests? #f; FIXME: tests require reflections.jar
12502 #:test-target "test"
12503 #:make-flags (list "-Ddynlink.native=true")
12504 #:phases
12505 (modify-phases %standard-phases
12506 (add-before 'build 'fix-build.xml
12507 (lambda* (#:key inputs #:allow-other-keys)
12508 (substitute* "build.xml"
12509 ;; Since we removed the bundled ant.jar, give the correct path
12510 (("lib/ant.jar") (string-append (assoc-ref inputs "ant") "/lib/ant.jar"))
12511 ;; We removed generated native libraries. We can only rebuild one
12512 ;; so don't fail if we can't find a native library for another architecture.
12513 (("zipfileset") "zipfileset erroronmissingarchive=\"false\""))
12514 ;; Copy test dependencies
12515 (copy-file (car (find-files (assoc-ref inputs "java-junit") "jar$"))
12516 "lib/junit.jar")
12517 (copy-file (car (find-files (assoc-ref inputs "java-hamcrest-core")
12518 "jar$"))
12519 "lib/hamcrest-core.jar")
12520 ;; FIXME: once reflections.jar is built, copy it to lib/test.
12521 #t))
12522 (add-before 'build 'build-native
12523 (lambda _
12524 (invoke "ant" "-Ddynlink.native=true" "native")
12525 #t))
12526 (replace 'install
12527 (install-jars "build")))))
12528 (inputs
12529 `(("libffi" ,libffi)
12530 ("libx11" ,libx11)
12531 ("libxt" ,libxt)))
12532 (native-inputs
12533 `(("java-junit" ,java-junit)
12534 ("java-hamcrest-core" ,java-hamcrest-core)))
12535 (home-page "https://github.com/java-native-access/jna")
12536 (synopsis "Access to native shared libraries from Java")
12537 (description "JNA provides Java programs easy access to native shared
12538 libraries without writing anything but Java code - no JNI or native code is
12539 required. JNA allows you to call directly into native functions using natural
12540 Java method invocation.")
12541 ;; Java Native Access project (JNA) is dual-licensed under 2
12542 ;; alternative Free licenses: LGPL 2.1 or later and Apache License 2.0.
12543 (license (list
12544 license:asl2.0
12545 license:lgpl2.1+))))
12546
12547 (define-public java-native-access-platform
12548 (package
12549 (inherit java-native-access)
12550 (name "java-native-access-platform")
12551 (arguments
12552 `(#:test-target "test"
12553 #:tests? #f; require jna-test.jar
12554 #:phases
12555 (modify-phases %standard-phases
12556 (add-before 'build 'chdir
12557 (lambda _
12558 (chdir "contrib/platform")
12559 #t))
12560 (add-after 'chdir 'fix-ant
12561 (lambda* (#:key inputs #:allow-other-keys)
12562 (substitute* "nbproject/project.properties"
12563 (("../../build/jna.jar")
12564 (string-append (assoc-ref inputs "java-native-access")
12565 "/share/java/jna.jar"))
12566 (("../../lib/hamcrest-core-.*.jar")
12567 (car (find-files (assoc-ref inputs "java-hamcrest-core")
12568 "jar$")))
12569 (("../../lib/junit.jar")
12570 (car (find-files (assoc-ref inputs "java-junit")
12571 "jar$"))))
12572 #t))
12573 (replace 'install
12574 (install-jars "dist")))))
12575 (inputs
12576 `(("java-native-access" ,java-native-access)))
12577 (synopsis "Cross-platform mappings for jna")
12578 (description "java-native-access-platform has cross-platform mappings
12579 and mappings for a number of commonly used platform functions, including a
12580 large number of Win32 mappings as well as a set of utility classes that
12581 simplify native access.")))
12582
12583 (define-public java-jsch-agentproxy-core
12584 (package
12585 (name "java-jsch-agentproxy-core")
12586 (version "0.0.8")
12587 (source (origin
12588 (method url-fetch)
12589 (uri (string-append "https://github.com/ymnk/jsch-agent-proxy/archive/"
12590 version ".tar.gz"))
12591 (file-name (string-append name "-" version ".tar.gz"))
12592 (sha256
12593 (base32
12594 "02iqg6jbc1kxvfzqcg6wy9ygqxfm82bw5rf6vnswqy4y572niz4q"))))
12595 (build-system ant-build-system)
12596 (arguments
12597 `(#:jar-name "jsch-agentproxy-core.jar"
12598 #:source-dir "jsch-agent-proxy-core/src/main/java"
12599 #:tests? #f)); no tests
12600 (home-page "https://github.com/ymnk/jsch-agent-proxy")
12601 (synopsis "Core component of the proxy to ssh-agent and Pageant in Java")
12602 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
12603 and Pageant included Putty. It will be easily integrated into JSch, and users
12604 will be allowed to use these programs for authentication.")
12605 (license license:bsd-3)))
12606
12607 (define-public java-jsch-agentproxy-sshagent
12608 (package
12609 (inherit java-jsch-agentproxy-core)
12610 (name "java-jsch-agentproxy-sshagent")
12611 (arguments
12612 `(#:jar-name "jsch-agentproxy-sshagent.jar"
12613 #:source-dir "jsch-agent-proxy-sshagent/src/main/java"
12614 #:tests? #f)); no tests
12615 (inputs
12616 `(("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)))
12617 (synopsis "Proxy to ssh-agent")
12618 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
12619 and Pageant included in Putty. This component contains the code for a proxy to
12620 ssh-agent.")))
12621
12622 (define-public java-jsch-agentproxy-usocket-jna
12623 (package
12624 (inherit java-jsch-agentproxy-core)
12625 (name "java-jsch-agentproxy-usocket-jna")
12626 (arguments
12627 `(#:jar-name "jsch-agentproxy-usocket-jna.jar"
12628 #:source-dir "jsch-agent-proxy-usocket-jna/src/main/java"
12629 #:tests? #f)); no tests
12630 (inputs
12631 `(("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)
12632 ("java-native-access" ,java-native-access)))
12633 (synopsis "USocketFactory implementation using JNA")
12634 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
12635 and Pageant included in Putty. This component contains an implementation of
12636 USocketFactory using @dfn{JNA} (Java Native Access).")))
12637
12638 (define-public java-jsch-agentproxy-pageant
12639 (package
12640 (inherit java-jsch-agentproxy-core)
12641 (name "java-jsch-agentproxy-pageant")
12642 (arguments
12643 `(#:jar-name "jsch-agentproxy-pageant.jar"
12644 #:source-dir "jsch-agent-proxy-pageant/src/main/java"
12645 #:tests? #f)); no tests
12646 (inputs
12647 `(("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)
12648 ("java-native-access" ,java-native-access)
12649 ("java-native-access-platform" ,java-native-access-platform)))
12650 (synopsis "Proxy to pageant")
12651 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
12652 and Pageant included in Putty. This component contains the code for a proxy to
12653 pageant.")))
12654
12655 (define-public java-jsch-agentproxy-usocket-nc
12656 (package
12657 (inherit java-jsch-agentproxy-core)
12658 (name "java-jsch-agentproxy-usocket-nc")
12659 (arguments
12660 `(#:jar-name "jsch-agentproxy-usocket-nc.jar"
12661 #:source-dir "jsch-agent-proxy-usocket-nc/src/main/java"
12662 #:tests? #f)); no tests
12663 (inputs
12664 `(("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)))
12665 (synopsis "USocketFactory implementation using netcat")
12666 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
12667 and Pageant included in Putty. This component contains an implementation of
12668 USocketFactory using netcat.")))
12669
12670 (define-public java-jsch-agentproxy-connector-factory
12671 (package
12672 (inherit java-jsch-agentproxy-core)
12673 (name "java-jsch-agentproxy-connector-factory")
12674 (arguments
12675 `(#:jar-name "jsch-agentproxy-connector-factory.jar"
12676 #:source-dir "jsch-agent-proxy-connector-factory/src/main/java"
12677 #:tests? #f)); no tests
12678 (inputs
12679 `(("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)
12680 ("java-jsch-agentproxy-sshagent" ,java-jsch-agentproxy-sshagent)
12681 ("java-jsch-agentproxy-usocket-jna" ,java-jsch-agentproxy-usocket-jna)
12682 ("java-jsch-agentproxy-pageant" ,java-jsch-agentproxy-pageant)
12683 ("java-jsch-agentproxy-usocket-nc" ,java-jsch-agentproxy-usocket-nc)))
12684 (synopsis "Connector factory for jsch agent proxy")
12685 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
12686 and Pageant included in Putty. This component contains a connector factory.")))
12687
12688 (define-public java-jsch-agentproxy-jsch
12689 (package
12690 (inherit java-jsch-agentproxy-core)
12691 (name "java-jsch-agentproxy-jsch")
12692 (arguments
12693 `(#:jar-name "jsch-agentproxy-jsch.jar"
12694 #:source-dir "jsch-agent-proxy-jsch/src/main/java"
12695 #:tests? #f)); no tests
12696 (inputs
12697 `(("java-jsch" ,java-jsch)
12698 ("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)))
12699 (synopsis "JSch integration library for agentproxy")
12700 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
12701 and Pageant included in Putty. This component contains a library to use
12702 jsch-agent-proxy with JSch.")))
12703
12704 (define-public java-apache-ivy
12705 (package
12706 (name "java-apache-ivy")
12707 (version "2.4.0")
12708 (source (origin
12709 (method url-fetch)
12710 (uri (string-append "mirror://apache//ant/ivy/" version
12711 "/apache-ivy-" version "-src.tar.gz"))
12712 (sha256
12713 (base32
12714 "1xkfn57g2m7l6y0xdq75x5rnrgk52m9jx2xah70g3ggl8750hbr0"))
12715 (patches
12716 (search-patches
12717 "java-apache-ivy-port-to-latest-bouncycastle.patch"))))
12718 (build-system ant-build-system)
12719 (arguments
12720 `(#:jar-name "ivy.jar"
12721 #:tests? #f
12722 #:phases
12723 (modify-phases %standard-phases
12724 (add-before 'build 'remove-example
12725 (lambda _
12726 (delete-file-recursively "src/example")
12727 #t))
12728 (add-before 'build 'copy-resources
12729 (lambda _
12730 (with-directory-excursion "src/java"
12731 (for-each (lambda (file)
12732 (install-file file (string-append "../../build/classes/" (dirname file))))
12733 (append
12734 (find-files "." ".*.css")
12735 (find-files "." ".*.ent")
12736 (find-files "." ".*.html")
12737 (find-files "." ".*.properties")
12738 (find-files "." ".*.xsd")
12739 (find-files "." ".*.xsl")
12740 (find-files "." ".*.xml"))))
12741 #t))
12742 (add-before 'build 'fix-vfs
12743 (lambda _
12744 (substitute*
12745 '("src/java/org/apache/ivy/plugins/repository/vfs/VfsRepository.java"
12746 "src/java/org/apache/ivy/plugins/repository/vfs/VfsResource.java")
12747 (("import org.apache.commons.vfs") "import org.apache.commons.vfs2"))
12748 #t))
12749 (add-before 'install 'copy-manifest
12750 (lambda _
12751 (install-file "META-INF/MANIFEST.MF" "build/classes/META-INF")
12752 #t))
12753 (add-before 'install 'repack
12754 (lambda _
12755 (invoke "jar" "-cmf" "build/classes/META-INF/MANIFEST.MF" "build/jar/ivy.jar"
12756 "-C" "build/classes" ".")))
12757 (add-after 'install 'install-bin
12758 (lambda* (#:key outputs #:allow-other-keys)
12759 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
12760 (ivy (string-append bin "/ivy"))
12761 (jar (string-append (assoc-ref outputs "out") "/share/java/ivy.jar")))
12762 (mkdir-p bin)
12763 (with-output-to-file ivy
12764 (lambda _
12765 (display (string-append
12766 "#!" (which "sh") "\n"
12767 "if [[ -z $CLASSPATH ]]; then\n"
12768 " cp=\"" (getenv "CLASSPATH") ":" jar "\"\n"
12769 "else\n"
12770 " cp=\"" (getenv "CLASSPATH") ":" jar ":$CLASSPATH\"\n"
12771 "fi\n"
12772 (which "java") " -cp $cp org.apache.ivy.Main $@\n"))))
12773 (chmod ivy #o755)
12774 #t))))))
12775 (inputs
12776 `(("java-bouncycastle" ,java-bouncycastle)
12777 ("java-commons-cli" ,java-commons-cli)
12778 ("java-commons-collections" ,java-commons-collections)
12779 ("java-commons-httpclient" ,java-commons-httpclient)
12780 ("java-commons-lang" ,java-commons-lang)
12781 ("java-commons-vfs" ,java-commons-vfs)
12782 ("java-jakarta-oro" ,java-jakarta-oro)
12783 ("java-jsch" ,java-jsch)
12784 ("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)
12785 ("java-jsch-agentproxy-connector-factory" ,java-jsch-agentproxy-connector-factory)
12786 ("java-jsch-agentproxy-jsch" ,java-jsch-agentproxy-jsch)
12787 ("java-junit" ,java-junit)))
12788 (home-page "https://ant.apache.org/ivy")
12789 (synopsis "Dependency manager for the Java programming language")
12790 (description "Ivy is a tool for managing (recording, tracking, resolving
12791 and reporting) project dependencies. It is characterized by the following:
12792
12793 @itemize
12794 @item flexibility and configurability - Ivy is essentially process agnostic
12795 and is not tied to any methodology or structure. Instead it provides the
12796 necessary flexibility and configurability to be adapted to a broad range
12797 of dependency management and build processes.
12798 @item tight integration with Apache Ant - while available as a standalone tool,
12799 Ivy works particularly well with Apache Ant providing a number of
12800 powerful Ant tasks ranging from dependency resolution to dependency
12801 reporting and publication.
12802 @end itemize")
12803 (license license:asl2.0)))
12804
12805 (define-public java-eclipse-sisu-inject
12806 (package
12807 (name "java-eclipse-sisu-inject")
12808 (version "0.3.4")
12809 (source (origin
12810 (method git-fetch)
12811 (uri (git-reference
12812 (url "https://github.com/eclipse/sisu.inject/")
12813 (commit (string-append "releases/" version))))
12814 (file-name (git-file-name name version))
12815 (sha256
12816 (base32
12817 "16044sizdb0rjbhlfbmcnpds5y7by7dyn9b0c11606aikqi8k3x6"))))
12818 (build-system ant-build-system)
12819 (arguments
12820 `(#:jar-name "eclipse-sisu-inject.jar"
12821 #:source-dir "org.eclipse.sisu.inject/src"
12822 #:tests? #f; no tests
12823 #:phases
12824 (modify-phases %standard-phases
12825 (replace 'install
12826 (install-from-pom "org.eclipse.sisu.inject/pom.xml")))))
12827 (propagated-inputs
12828 `(("java-guice" ,java-guice)
12829 ("java-sisu-inject-parent-pom" ,java-sisu-inject-parent-pom)))
12830 (inputs
12831 `(("java-guice-servlet" ,java-guice-servlet)
12832 ("java-javax-inject" ,java-javax-inject)
12833 ("java-javaee-servletapi" ,java-javaee-servletapi)
12834 ("java-junit" ,java-junit)
12835 ("java-slf4j-api" ,java-slf4j-api)
12836 ("java-jsr305" ,java-jsr305)
12837 ("java-jsr250" ,java-jsr250)
12838 ("java-cdi-api" ,java-cdi-api)
12839 ("java-osgi-framework" ,java-osgi-framework)
12840 ("java-osgi-util-tracker" ,java-osgi-util-tracker)
12841 ("java-testng" ,java-testng)))
12842 (home-page "https://www.eclipse.org/sisu/")
12843 (synopsis "Classpath scanning, auto-binding, and dynamic auto-wiring")
12844 (description "Sisu is a modular JSR330-based container that supports
12845 classpath scanning, auto-binding, and dynamic auto-wiring. Sisu uses
12846 Google-Guice to perform dependency injection and provide the core JSR330
12847 support, but removes the need to write explicit bindings in Guice modules.
12848 Integration with other containers via the Eclipse Extension Registry and the
12849 OSGi Service Registry is a goal of this project.")
12850 (license license:epl1.0)))
12851
12852 (define java-sisu-inject-parent-pom
12853 (package
12854 (inherit java-eclipse-sisu-inject)
12855 (name "java-sisu-inject-parent-pom")
12856 (arguments
12857 `(#:tests? #f
12858 #:phases
12859 (modify-phases %standard-phases
12860 (delete 'configure)
12861 (delete 'build)
12862 (replace 'install
12863 (install-pom-file "pom.xml")))))
12864 (propagated-inputs '())))
12865
12866 (define-public java-eclipse-sisu-plexus
12867 (package
12868 (name "java-eclipse-sisu-plexus")
12869 (version "0.3.4")
12870 (source (origin
12871 (method git-fetch)
12872 (uri (git-reference
12873 (url "https://github.com/eclipse/sisu.plexus")
12874 (commit (string-append "releases/" version))))
12875 (file-name (git-file-name name version))
12876 (sha256
12877 (base32
12878 "17mjlajnsqnk07cc58h1qpxrif85yb2m2y0pyba48yjjgikk8r9f"))
12879 (modules '((guix build utils)))
12880 (snippet
12881 '(begin
12882 (for-each delete-file (find-files "." ".*.jar"))
12883 (rename-file "org.eclipse.sisu.plexus.tests/src"
12884 "org.eclipse.sisu.plexus.tests/java")
12885 #t))))
12886 (build-system ant-build-system)
12887 (arguments
12888 `(#:jar-name "eclipse-sisu-plexus.jar"
12889 #:source-dir "org.eclipse.sisu.plexus/src"
12890 #:test-dir "org.eclipse.sisu.plexus.tests"
12891 #:test-exclude
12892 (list
12893 ;; This test fails probably because we can't generate the necessary
12894 ;; meta-inf files.
12895 "**/PlexusLoggingTest.*"
12896 ;; FIXME: This test fails because of some injection error
12897 "**/PlexusRequirementTest.*")
12898 #:jdk ,icedtea-8
12899 #:phases
12900 (modify-phases %standard-phases
12901 (add-before 'build 'copy-resources
12902 (lambda _
12903 (install-file "org.eclipse.sisu.plexus/META-INF/plexus/components.xml"
12904 "build/classes/META-INF/plexus")
12905 #t))
12906 (add-before 'check 'build-test-jar
12907 (lambda _
12908 (with-directory-excursion "org.eclipse.sisu.plexus.tests/resources/component-jar/src/main/"
12909 (mkdir "build")
12910 (with-directory-excursion "java"
12911 (apply invoke "javac" "-cp"
12912 (string-append (getenv "CLASSPATH")
12913 ":../../../../../build/classes")
12914 (find-files "." ".*.java"))
12915 (for-each (lambda (file) (install-file file (string-append "../build/" file)))
12916 (find-files "." ".*.jar")))
12917 (mkdir-p "build/META-INF/plexus")
12918 (copy-file "resources/META-INF/plexus/components.xml"
12919 "build/META-INF/plexus/components.xml")
12920 (with-directory-excursion "build"
12921 (invoke "jar" "cf" "../../../component-jar-0.1.jar" ".")))
12922 (with-directory-excursion "org.eclipse.sisu.plexus.tests/"
12923 (copy-recursively "META-INF" "../build/test-classes/META-INF")
12924 (substitute* "java/org/eclipse/sisu/plexus/DefaultPlexusContainerTest.java"
12925 (("resources/component-jar")
12926 "org.eclipse.sisu.plexus.tests/resources/component-jar")))
12927 #t))
12928 (replace 'install
12929 (install-from-pom "org.eclipse.sisu.plexus/pom.xml")))))
12930 (propagated-inputs
12931 `(("java-plexus-classworlds" ,java-plexus-classworlds)
12932 ("java-plexus-utils" ,java-plexus-utils)
12933 ("java-plexus-component-annotations" ,java-plexus-component-annotations)
12934 ("java-cdi-api" ,java-cdi-api)
12935 ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
12936 ("java-sisu-plexus-parent-pom" ,java-sisu-plexus-parent-pom)))
12937 (inputs
12938 `(("java-osgi-framework" ,java-osgi-framework)
12939 ("java-slf4j-api" ,java-slf4j-api)
12940 ("java-javax-inject" ,java-javax-inject)
12941 ("java-guice" ,java-guice)
12942 ("java-guava" ,java-guava)
12943 ("java-aopalliance" ,java-aopalliance)
12944 ("java-asm" ,java-asm)
12945 ("java-cglib" ,java-cglib)))
12946 (native-inputs
12947 `(("java-junit" ,java-junit)))
12948 (home-page "https://www.eclipse.org/sisu/")
12949 (synopsis "Plexus support for the sisu container")
12950 (description "Sisu is a modular JSR330-based container that supports
12951 classpath scanning, auto-binding, and dynamic auto-wiring. This package
12952 adds Plexus support to the Sisu-Inject container.")
12953 (license license:epl1.0)))
12954
12955 (define java-sisu-plexus-parent-pom
12956 (package
12957 (inherit java-eclipse-sisu-plexus)
12958 (name "java-sisu-plexus-parent-pom")
12959 (arguments
12960 `(#:tests? #f
12961 #:phases
12962 (modify-phases %standard-phases
12963 (delete 'configure)
12964 (delete 'build)
12965 (replace 'install
12966 (install-pom-file "pom.xml")))))
12967 (propagated-inputs
12968 `(("java-sonatype-oss-parent-pom-9" ,java-sonatype-oss-parent-pom-9)))))
12969
12970 (define-public java-commons-compiler
12971 (package
12972 (name "java-commons-compiler")
12973 (version "3.0.8")
12974 (source (origin
12975 (method git-fetch)
12976 (uri (git-reference
12977 (url "https://github.com/janino-compiler/janino")
12978 (commit "91aa95686d1e4ca3b16a984a03a38686572331b2")))
12979 (file-name (string-append name "-" version))
12980 (sha256
12981 (base32
12982 "04hfdl59sgh20qkxzgnibvs8f9hy6n7znxwpk611y5d89977y62r"))
12983 (modules '((guix build utils)))
12984 (snippet
12985 '(begin
12986 (for-each delete-file
12987 (find-files "." "\\.jar$"))
12988 #t))))
12989 (build-system ant-build-system)
12990 (arguments
12991 `(#:jar-name "commons-compiler.jar"
12992 #:source-dir "commons-compiler/src/main"
12993 #:tests? #f)); no tests
12994 (home-page "https://github.com/janino-compiler/janino")
12995 (synopsis "Java compiler")
12996 (description "Commons-compiler contains an API for janino, including the
12997 @code{IExpressionEvaluator}, @code{IScriptEvaluator}, @code{IClassBodyEvaluator}
12998 and @code{ISimpleCompiler} interfaces.")
12999 (license license:bsd-3)))
13000
13001 (define-public java-janino
13002 (package
13003 (inherit java-commons-compiler)
13004 (name "java-janino")
13005 (arguments
13006 `(#:jar-name "janino.jar"
13007 #:source-dir "src/main/java"
13008 #:phases
13009 (modify-phases %standard-phases
13010 (add-before 'configure 'chdir
13011 (lambda _
13012 (chdir "janino")
13013 #t)))))
13014 (inputs
13015 `(("java-commons-compiler" ,java-commons-compiler)))
13016 (native-inputs
13017 `(("java-junit" ,java-junit)
13018 ("java-hamcrest-core" ,java-hamcrest-core)))
13019 (description "Janino is a Java compiler. Janino can compile a set of
13020 source files to a set of class files like @code{javac}, but also compile a
13021 Java expression, block, class body or source file in memory, load the bytecode
13022 and execute it directly in the same JVM. @code{janino} can also be used for
13023 static code analysis or code manipulation.")))
13024
13025 (define-public java-logback-core
13026 (package
13027 (name "java-logback-core")
13028 (version "1.2.3")
13029 (source (origin
13030 (method url-fetch)
13031 (uri (string-append "https://github.com/qos-ch/logback/archive/v_"
13032 version ".tar.gz"))
13033 (file-name (string-append name "-" version ".tar.gz"))
13034 (sha256
13035 (base32
13036 "1x6ga74yfgm94cfx98gybakbrlilx8i2gn6dx13l40kasmys06mi"))
13037 (modules '((guix build utils)))
13038 (snippet
13039 '(begin
13040 (delete-file-recursively "logback-access/lib")
13041 #t))))
13042 (build-system ant-build-system)
13043 (arguments
13044 `(#:jar-name "logback.jar"
13045 #:source-dir "src/main/java"
13046 #:test-dir "src/test"
13047 #:test-exclude
13048 ;; These tests fail with Unable to set MockitoNamingPolicy on cglib generator
13049 ;; which creates FastClasses
13050 (list "**/AllCoreTest.*"
13051 "**/AutoFlushingObjectWriterTest.*"
13052 "**/PackageTest.*"
13053 "**/ResilientOutputStreamTest.*"
13054 ;; And we still don't want to run abstract classes
13055 "**/Abstract*.*")
13056 #:phases
13057 (modify-phases %standard-phases
13058 (add-before 'configure 'chdir
13059 (lambda _
13060 (chdir "logback-core")
13061 #t)))))
13062 (inputs
13063 `(("java-javax-mail" ,java-javax-mail)
13064 ("servlet" ,java-javaee-servletapi)
13065 ("java-commons-compiler" ,java-commons-compiler)
13066 ("java-janino" ,java-janino)))
13067 (native-inputs
13068 `(("java-junit" ,java-junit)
13069 ("java-hamcrest-core" ,java-hamcrest-core)
13070 ("java-mockito-1" ,java-mockito-1)
13071 ("java-cglib" ,java-cglib)
13072 ("java-asm" ,java-asm)
13073 ("java-objenesis" ,java-objenesis)
13074 ("java-joda-time" ,java-joda-time)))
13075 (home-page "https://logback.qos.ch")
13076 (synopsis "Logging for java")
13077 (description "Logback is intended as a successor to the popular log4j project.
13078 This module lays the groundwork for the other two modules.")
13079 ;; Either epl1.0 or lgpl2.1
13080 (license (list license:epl1.0
13081 license:lgpl2.1))))
13082
13083 (define-public java-logback-classic
13084 (package
13085 (inherit java-logback-core)
13086 (name "java-logback-classic")
13087 (arguments
13088 `(#:jar-name "logback-classic.jar"
13089 #:source-dir "src/main/java"
13090 #:test-dir "src/test"
13091 #:tests? #f; tests require more packages: h2, greenmail, hsql, subethamail, slf4j, log4j, felix
13092 #:jdk ,icedtea-8
13093 #:phases
13094 (modify-phases %standard-phases
13095 (add-before 'configure 'chdir
13096 (lambda _
13097 (chdir "logback-classic")
13098 #t))
13099 (replace 'build
13100 (lambda* (#:key inputs #:allow-other-keys)
13101 (mkdir-p "build/classes")
13102 (setenv "CLASSPATH"
13103 (string-join
13104 (apply append (map (lambda (input)
13105 (find-files (assoc-ref inputs input)
13106 ".*.jar"))
13107 '("java-logback-core" "java-slf4j-api"
13108 "java-commons-compiler" "servlet"
13109 "groovy")))
13110 ":"))
13111 (apply invoke "groovyc" "-d" "build/classes" "-j"
13112 (find-files "src/main/" ".*\\.(groovy|java)$"))
13113 (invoke "ant" "jar")
13114 #t)))))
13115 (inputs
13116 `(("java-logback-core" ,java-logback-core)
13117 ("java-slf4j-api" ,java-slf4j-api)
13118 ,@(package-inputs java-logback-core)))
13119 (native-inputs
13120 `(("groovy" ,groovy)))
13121 (description "Logback is intended as a successor to the popular log4j project.
13122 This module can be assimilated to a significantly improved version of log4j.
13123 Moreover, @code{logback-classic} natively implements the slf4j API so that you
13124 can readily switch back and forth between logback and other logging frameworks
13125 such as log4j or @code{java.util.logging} (JUL).")))
13126
13127 (define-public java-jgit
13128 (package
13129 (name "java-jgit")
13130 (version "4.7.0.201704051617-r")
13131 (source (origin
13132 (method url-fetch)
13133 (uri (string-append "https://repo1.maven.org/maven2/"
13134 "org/eclipse/jgit/org.eclipse.jgit/"
13135 version "/org.eclipse.jgit-"
13136 version "-sources.jar"))
13137 (sha256
13138 (base32
13139 "13ii4jn02ynzq6i7gsyi21k2i94jpc85wf6bcm31q4cyvzv0mk4k"))))
13140 (build-system ant-build-system)
13141 (arguments
13142 `(#:tests? #f ; There are no tests to run.
13143 #:jar-name "jgit.jar"
13144 ;; JGit must be built with a JDK supporting Java 8.
13145 #:jdk ,icedtea-8
13146 ;; Target our older default JDK.
13147 #:make-flags (list "-Dtarget=1.7")
13148 #:phases
13149 (modify-phases %standard-phases
13150 ;; The jar file generated by the default build.xml does not include
13151 ;; the text properties files, so we need to add them.
13152 (add-after 'build 'add-properties
13153 (lambda* (#:key jar-name #:allow-other-keys)
13154 (with-directory-excursion "src"
13155 (apply invoke "jar" "-uf"
13156 (string-append "../build/jar/" jar-name)
13157 (find-files "." "\\.properties$")))
13158 #t)))))
13159 (inputs
13160 `(("java-classpathx-servletapi" ,java-classpathx-servletapi)
13161 ("java-javaewah" ,java-javaewah)
13162 ("java-jsch" ,java-jsch)
13163 ("java-slf4j-api" ,java-slf4j-api)))
13164 (home-page "https://eclipse.org/jgit/")
13165 (synopsis "Java library implementing the Git version control system")
13166 (description "JGit is a lightweight, pure Java library implementing the
13167 Git version control system, providing repository access routines, support for
13168 network protocols, and core version control algorithms.")
13169 (license license:edl1.0)))
13170
13171 ;; For axoloti. This package can still be built with icedtea-7, which is
13172 ;; currently used as the default JDK.
13173 (define-public java-jgit-4.2
13174 (package (inherit java-jgit)
13175 (version "4.2.0.201601211800-r")
13176 (source (origin
13177 (method url-fetch)
13178 (uri (string-append "https://repo1.maven.org/maven2/"
13179 "org/eclipse/jgit/org.eclipse.jgit/"
13180 version "/org.eclipse.jgit-"
13181 version "-sources.jar"))
13182 (sha256
13183 (base32
13184 "15gm537iivhnzlkjym4x3wn5jqdjdragsw9pdpzqqg21nrc817mm"))))
13185 (build-system ant-build-system)
13186 (arguments
13187 (substitute-keyword-arguments (package-arguments java-jgit)
13188 ;; Build for default JDK.
13189 ((#:jdk _) icedtea-7)
13190 ((#:phases phases)
13191 `(modify-phases ,phases
13192 (add-after 'unpack 'use-latest-javaewah-API
13193 (lambda _
13194 (substitute* "src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java"
13195 (("wordinbits") "WORD_IN_BITS"))
13196 #t))))))
13197 (inputs
13198 `(("java-javaewah" ,java-javaewah)
13199 ("java-jsch" ,java-jsch)
13200 ("java-slf4j-api" ,java-slf4j-api)))))
13201
13202 (define-public abcl
13203 (package
13204 (name "abcl")
13205 (version "1.8.0")
13206 (source
13207 (origin
13208 (method url-fetch)
13209 (uri (string-append "https://abcl.org/releases/"
13210 version "/abcl-src-" version ".tar.gz"))
13211 (sha256
13212 (base32
13213 "0zr5mmqyj484vza089l8vc88d07g0m8ymxzglvar3ydwyvi1x1qx"))
13214 (patches
13215 (search-patches
13216 "abcl-fix-build-xml.patch"))))
13217 (build-system ant-build-system)
13218 (native-inputs
13219 `(("java-junit" ,java-junit)))
13220 (arguments
13221 `(#:build-target "abcl.jar"
13222 #:test-target "abcl.test"
13223 #:phases
13224 (modify-phases %standard-phases
13225 (replace 'install
13226 (lambda* (#:key outputs #:allow-other-keys)
13227 (let ((share (string-append (assoc-ref outputs "out")
13228 "/share/java/"))
13229 (bin (string-append (assoc-ref outputs "out")
13230 "/bin/")))
13231 (mkdir-p share)
13232 (install-file "dist/abcl.jar" share)
13233 (install-file "dist/abcl-contrib.jar" share)
13234 (mkdir-p bin)
13235 (with-output-to-file (string-append bin "abcl")
13236 (lambda _
13237 (let ((classpath (string-append
13238 share "abcl.jar"
13239 ":"
13240 share "abcl-contrib.jar")))
13241 (display (string-append
13242 "#!" (which "sh") "\n"
13243 "if [[ -z $CLASSPATH ]]; then\n"
13244 " cp=\"" classpath "\"\n"
13245 "else\n"
13246 " cp=\"" classpath ":$CLASSPATH\"\n"
13247 "fi\n"
13248 "exec " (which "java")
13249 " -cp $cp org.armedbear.lisp.Main $@\n")))))
13250 (chmod (string-append bin "abcl") #o755)
13251 #t))))))
13252 (home-page "https://abcl.org/")
13253 (synopsis "Common Lisp Implementation on the JVM")
13254 (description
13255 "@dfn{Armed Bear Common Lisp} (ABCL) is a full implementation of the Common
13256 Lisp language featuring both an interpreter and a compiler, running in the
13257 JVM. It supports JSR-223 (Java scripting API): it can be a scripting engine
13258 in any Java application. Additionally, it can be used to implement (parts of)
13259 the application using Java to Lisp integration APIs.")
13260 (license (list license:gpl2+
13261 ;; named-readtables is released under 3 clause BSD
13262 license:bsd-3
13263 ;; jfli is released under CPL 1.0
13264 license:cpl1.0))))
13265
13266 (define-public java-jsonp-api
13267 (package
13268 (name "java-jsonp-api")
13269 (version "1.1.6")
13270 (source (origin
13271 (method git-fetch)
13272 (uri (git-reference
13273 (url "https://github.com/eclipse-ee4j/jsonp")
13274 (commit (string-append "1.1-" version "-RELEASE"))))
13275 (file-name (git-file-name name version))
13276 (sha256
13277 (base32
13278 "0zrj03hkr3jdmqlb4ipjr37cqpp2q2814qpmxi7srlwpdqs0ibgc"))))
13279 (build-system ant-build-system)
13280 (arguments
13281 `(#:jar-name "jsonp-api.jar"
13282 #:tests? #f
13283 #:source-dir "api/src/main/java"
13284 #:test-dir "api/src/test"))
13285 (home-page "https://eclipse-ee4j.github.io/jsonp/")
13286 (synopsis "JSON Processing in Java")
13287 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
13288 parse, generate, transform and query) JSON messages. It produces and
13289 consumes JSON text in a streaming fashion (similar to StAX API for XML)
13290 and allows building a Java object model for JSON text using API classes
13291 (similar to DOM API for XML).")
13292 ;; either gpl2 only with classpath exception, or epl2.0.
13293 (license (list license:gpl2
13294 license:epl2.0))))
13295
13296 (define-public java-jsonp-impl
13297 (package
13298 (inherit java-jsonp-api)
13299 (name "java-jsonp-impl")
13300 (arguments
13301 `(#:jar-name "jsonp-impl.jar"
13302 #:tests? #f
13303 #:source-dir "impl/src/main/java"
13304 #:test-dir "impl/src/test"
13305 #:phases
13306 (modify-phases %standard-phases
13307 (add-before 'build 'copy-resources
13308 (lambda _
13309 (copy-recursively
13310 "impl/src/main/resources/"
13311 "build/classes")
13312 #t)))))
13313 (propagated-inputs
13314 `(("java-jsonp-api" ,java-jsonp-api)))
13315 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
13316 parse, generate, transform and query) JSON messages. This package contains
13317 a reference implementation of that API.")))
13318
13319 (define-public java-xmp
13320 (package
13321 (name "java-xmp")
13322 (version "5.1.3")
13323 (source (origin
13324 (method url-fetch)
13325 (uri (string-append "http://download.macromedia.com/pub/developer"
13326 "/xmp/sdk/XMPCoreJava-" version ".zip"))
13327 (sha256
13328 (base32
13329 "14nai2mmsg7l5ya2y5mx4w4lr1az3sk2fjz6hiy4zdrsavgvl1g7"))))
13330 (build-system ant-build-system)
13331 (arguments
13332 `(#:build-target "build"
13333 #:tests? #f; no tests
13334 #:phases
13335 (modify-phases %standard-phases
13336 (add-after 'unpack 'chdir
13337 (lambda _
13338 (chdir "XMPCore")
13339 #t))
13340 (add-before 'build 'fix-timestamp
13341 (lambda _
13342 (substitute* "build.xml"
13343 (("\\$\\{BuildDate\\}") "1970 Jan 01 00:00:00-GMT"))
13344 #t))
13345 (replace 'install
13346 (install-jars "."))
13347 (add-after 'install 'install-doc
13348 (lambda* (#:key outputs #:allow-other-keys)
13349 (copy-recursively
13350 "docs"
13351 (string-append (assoc-ref outputs "out") "/share/doc/java-xmp"))
13352 #t)))))
13353 (native-inputs
13354 `(("unzip" ,unzip)))
13355 (home-page "https://www.adobe.com/devnet/xmp.html")
13356 (synopsis "Extensible Metadat Platform (XMP) support in Java")
13357 (description "Adobe's Extensible Metadata Platform (XMP) is a labeling
13358 technology that allows you to embed data about a file, known as metadata,
13359 into the file itself. The XMP Toolkit for Java is based on the C++ XMPCore
13360 library and the API is similar.")
13361 (license license:bsd-3)))
13362
13363 (define-public java-args4j
13364 (package
13365 (name "java-args4j")
13366 (version "2.33")
13367 (source (origin
13368 (method git-fetch)
13369 (uri (git-reference
13370 (url "https://github.com/kohsuke/args4j")
13371 (commit (string-append "args4j-site-" version))))
13372 (file-name (git-file-name name version))
13373 (sha256
13374 (base32
13375 "0w061fg65qrsm1a0lz0vyprsyidj31krjb459qi2lw0y78xza26s"))))
13376 (build-system ant-build-system)
13377 (arguments
13378 `(#:jar-name "args4j.jar"
13379 #:source-dir "args4j/src"
13380 #:test-dir "args4j/test"
13381 #:test-exclude
13382 (list "**/ExampleTest.*"
13383 "**/ExternalConfiguredTest.*" ; fails to find a file
13384 ;; We still don't want to run abstract classes
13385 "**/Abstract*.*")
13386 #:phases
13387 (modify-phases %standard-phases
13388 (add-before 'check 'fix-test-dir
13389 (lambda _
13390 (substitute* "build.xml"
13391 (("/java\">") "\">"))
13392 #t))
13393 (add-before 'build 'copy-resources
13394 (lambda _
13395 (let ((from-prefix "args4j/src/org/kohsuke/args4j/")
13396 (to-prefix "build/classes/org/kohsuke/args4j/"))
13397 (for-each (lambda (f)
13398 (install-file
13399 (string-append from-prefix f)
13400 (string-append to-prefix (dirname f))))
13401 (list "Messages.properties"
13402 "Messages_de.properties"
13403 "Messages_en.properties"
13404 "Messages_ru.properties"
13405 "spi/Messages.properties"
13406 "spi/Messages_de.properties"
13407 "spi/Messages_en.properties"
13408 "spi/Messages_ru.properties")))
13409 #t)))))
13410 (native-inputs
13411 `(("java-junit" ,java-junit)))
13412 (home-page "https://args4j.kohsuke.org/")
13413 (synopsis "Command line parser library")
13414 (description "Args4j is a small Java class library that makes it easy to
13415 parse command line options/arguments in your CUI application.")
13416 (license license:expat)))
13417
13418 (define-public java-metadata-extractor
13419 (package
13420 (name "java-metadata-extractor")
13421 (version "2.11.0")
13422 (source (origin
13423 (method git-fetch)
13424 (uri (git-reference
13425 (url "https://github.com/drewnoakes/metadata-extractor")
13426 (commit version)))
13427 (file-name (git-file-name name version))
13428 (sha256
13429 (base32
13430 "06yrq0swrl1r40yjbk5kqzjxr04jlkq9lfi711jvfgjf5kp2qinj"))))
13431 (build-system ant-build-system)
13432 (arguments
13433 `(#:jar-name "metadata-extractor.jar"
13434 #:source-dir "Source"
13435 #:test-dir "Tests"
13436 #:phases
13437 (modify-phases %standard-phases
13438 (add-before 'check 'fix-test-dir
13439 (lambda _
13440 (substitute* "build.xml"
13441 (("/java\">") "\">"))
13442 #t)))))
13443 (propagated-inputs
13444 `(("java-xmp" ,java-xmp)))
13445 (native-inputs
13446 `(("java-hamcrest-core" ,java-hamcrest-core)
13447 ("java-junit" ,java-junit)))
13448 (home-page "https://github.com/drewnoakes/metadata-extractor")
13449 (synopsis "Extract metadata from image and video files")
13450 (description "Metadata-extractor is a straightforward Java library for
13451 reading metadata from image files. It is able to read metadata in Exif,
13452 IPTC, XMP, ICC and more formats.")
13453 (license license:asl2.0)))
13454
13455 (define-public java-svg-salamander
13456 (package
13457 (name "java-svg-salamander")
13458 (version "1.1.2")
13459 (source (origin
13460 (method git-fetch)
13461 (uri (git-reference
13462 (url "https://github.com/blackears/svgSalamander")
13463 (commit (string-append "v" version))))
13464 (file-name (git-file-name name version))
13465 (sha256
13466 (base32
13467 "1zv3kjdkf6iqf02x6ln76254y634j2ji448y706a65lsbfjmmicf"))
13468 (modules '((guix build utils)))
13469 (snippet
13470 '(begin
13471 (for-each delete-file (find-files "." ".*.jar"))
13472 #t))
13473 (patches
13474 (search-patches "java-svg-salamander-Fix-non-det.patch"))))
13475 (build-system ant-build-system)
13476 (arguments
13477 `(#:tests? #f; no tests
13478 #:phases
13479 (modify-phases %standard-phases
13480 (add-after 'unpack 'chdir
13481 (lambda _
13482 (chdir "svg-core")
13483 #t))
13484 (add-before 'build 'copy-jars
13485 (lambda* (#:key inputs #:allow-other-keys)
13486 (copy-file (car (find-files (assoc-ref inputs "javacc") "\\.jar$"))
13487 "../libraries/javacc.jar")
13488 (copy-file (car (find-files (assoc-ref inputs "ant") "ant\\.jar$"))
13489 "../libraries/ant.jar")
13490 #t))
13491 (replace 'install
13492 (install-jars "dist")))))
13493 (native-inputs
13494 `(("javacc" ,javacc)))
13495 (home-page "https://github.com/blackears/svgSalamander")
13496 (synopsis "SVG engine for Java")
13497 (description "SVG Salamander is an SVG engine for Java that's designed
13498 to be small, fast, and allow programmers to use it with a minimum of fuss.
13499 It's in particular targeted for making it easy to integrate SVG into Java
13500 games and making it much easier for artists to design 2D game content - from
13501 rich interactive menus to charts and graphcs to complex animations.")
13502 (license license:bsd-2)))
13503
13504 (define-public java-jboss-transaction-api-spec
13505 (package
13506 (name "java-jboss-transaction-api-spec")
13507 (version "1.2+1.1.1")
13508 (source (origin
13509 (method git-fetch)
13510 (uri (git-reference
13511 (url "https://github.com/jboss/jboss-transaction-api_spec")
13512 (commit "jboss-transaction-api_1.2_spec-1.1.1.Final")))
13513 (file-name (git-file-name name version))
13514 (sha256
13515 (base32
13516 "1xbfq5hvb86izflydxrqqv3k26c1ba2m0ap6m97shqrsdi9by4wy"))))
13517 (build-system ant-build-system)
13518 (arguments
13519 `(#:jar-name "java-jboss-transaction-api_spec.jar"
13520 #:source-dir "src/main/java"
13521 #:tests? #f)); no tests
13522 (inputs
13523 `(("java-cdi-api" ,java-cdi-api)
13524 ("java-jboss-interceptors-api-spec" ,java-jboss-interceptors-api-spec)))
13525 (home-page "https://github.com/jboss/jboss-transaction-api_spec")
13526 (synopsis "Generic transaction management API in Java")
13527 (description "Java-jboss-transaction-api-spec implements the Transactions
13528 API. A transaction is a unit of work containing one or more operations
13529 involving one or more shared resources having ACID (Atomicity, Consistency,
13530 Isolation and Durability) properties.")
13531 ;; either gpl2 only with classpath exception or cddl.
13532 (license (list license:gpl2 license:cddl1.0))))
13533
13534 (define-public java-picocli
13535 (package
13536 (name "java-picocli")
13537 (version "4.3.2")
13538 (source (origin
13539 (method git-fetch)
13540 (uri (git-reference
13541 (url "https://github.com/remkop/picocli")
13542 (commit (string-append "v" version))))
13543 (file-name (git-file-name name version))
13544 (sha256
13545 (base32
13546 "1sxp6rxjfgjd98ly14b3d15dvxkm5wg4g46w12jyhmr0kmkaca3c"))))
13547 (build-system ant-build-system)
13548 (arguments
13549 `(#:jar-name "picocli.jar"
13550 #:source-dir "src/main/java"
13551 ;; Tests require missing dependencies (junitparams, system-rules)
13552 #:tests? #f))
13553 (home-page "https://picocli.info")
13554 (synopsis "REPL for the JVM")
13555 (description "Picocli is a framework for building command line applications
13556 for the JVM. It supports colors, autocompletion, subcommands, and more. Written
13557 in Java, usable from Groovy, Kotlin, Scala, etc.")
13558 (license license:asl2.0)))
13559
13560 (define-public java-jetbrains-annotations
13561 (package
13562 (name "java-jetbrains-annotations")
13563 (version "19.0.0")
13564 (source (origin
13565 (method git-fetch)
13566 (uri (git-reference
13567 (url "https://github.com/JetBrains/java-annotations")
13568 (commit version)))
13569 (file-name (git-file-name name version))
13570 (sha256
13571 (base32
13572 "0z6i1xs60cd5ffz23c49sq68wn5mphhs3xpar1n93ppama2ng80v"))))
13573 (build-system ant-build-system)
13574 (arguments
13575 `(#:jar-name "jetbrains-annotations.jar"
13576 #:source-dir "common/src/main/java:java8/src/main/java"
13577 #:tests? #f)); no tests
13578 (home-page "https://github.com/JetBrains/java-annotations")
13579 (synopsis "Annotations for Java and other JVM languages")
13580 (description "This package contains a set of Java annotations which can be
13581 used in JVM-based languages. They serve as an additional documentation and
13582 can be interpreted by IDEs and static analysis tools to improve code analysis.")
13583 (license license:expat)))
13584
13585 (define-public java-javaparser
13586 (package
13587 (name "java-javaparser")
13588 (version "3.16.1")
13589 (source (origin
13590 (method git-fetch)
13591 (uri (git-reference
13592 (url "https://github.com/javaparser/javaparser")
13593 (commit (string-append "javaparser-parent-" version))))
13594 (file-name (git-file-name name version))
13595 (sha256
13596 (base32
13597 "1a4jk12ffa31fa0y8vda0739vpfj1206p0nha842b7bixbvwamv9"))
13598 (modules '((guix build utils)))
13599 (snippet
13600 '(begin
13601 (for-each delete-file
13602 (find-files "." "\\.jar$"))
13603 #t))))
13604 (build-system ant-build-system)
13605 (arguments
13606 `(#:tests? #f; tests require jbehave and junit5
13607 #:phases
13608 (modify-phases %standard-phases
13609 (add-before 'build 'fill-template
13610 (lambda _
13611 (with-directory-excursion "javaparser-core/src/main"
13612 (copy-file "java-templates/com/github/javaparser/JavaParserBuild.java"
13613 "java/com/github/javaparser/JavaParserBuild.java")
13614 (substitute* "java/com/github/javaparser/JavaParserBuild.java"
13615 (("\\$\\{project.version\\}") ,version)
13616 (("\\$\\{project.name\\}") "javaparser")
13617 (("\\$\\{project.build.finalName\\}") "javaparser")
13618 (("\\$\\{maven.version\\}") "fake")
13619 (("\\$\\{maven.build.version\\}") "fake")
13620 (("\\$\\{build.timestamp\\}") "0")
13621 (("\\$\\{java.vendor\\}") "Guix")
13622 (("\\$\\{java.vendor.url\\}") "https://gnu.org/software/guix")
13623 (("\\$\\{java.version\\}") "1.8")
13624 (("\\$\\{os.arch\\}") "any")
13625 (("\\$\\{os.name\\}") "GuixSD")
13626 (("\\$\\{os.version\\}") "not available")))
13627 #t))
13628 (add-before 'build 'generate-javacc
13629 (lambda _
13630 (with-directory-excursion "javaparser-core/src/main/java"
13631 (invoke "java" "javacc" "../javacc/java.jj"))
13632 #t))
13633 (add-before 'build 'copy-javacc-support
13634 (lambda _
13635 (with-directory-excursion "javaparser-core/src/main"
13636 (copy-recursively "javacc-support" "java"))
13637 #t))
13638 (replace 'build
13639 (lambda _
13640 (define (build name)
13641 (format #t "Building ~a~%" name)
13642 (delete-file-recursively "build/classes")
13643 (mkdir-p "build/classes")
13644 (apply invoke "javac"
13645 "-cp" (string-append (getenv "CLASSPATH") ":"
13646 (string-join (find-files "build/jar" ".")
13647 ":"))
13648 "-d" "build/classes"
13649 (find-files (string-append name "/src/main/java")
13650 ".*.java"))
13651 (invoke "jar" "-cf" (string-append "build/jar/" name ".jar")
13652 "-C" "build/classes" "."))
13653 (mkdir-p "build/classes")
13654 (mkdir-p "build/test-classes")
13655 (mkdir-p "build/jar")
13656 (build "javaparser-core")
13657 (build "javaparser-core-serialization")
13658 (build "javaparser-core-generators")
13659 (build "javaparser-core-metamodel-generator")
13660 (build "javaparser-symbol-solver-core")
13661 #t))
13662 (replace 'install
13663 (install-jars "build/jar")))))
13664 (inputs
13665 `(("java-guava" ,java-guava)
13666 ("java-jboss-javassist" ,java-jboss-javassist)
13667 ("java-jsonp-api" ,java-jsonp-api)))
13668 (native-inputs
13669 `(("javacc" ,javacc)))
13670 (home-page "http://javaparser.org/")
13671 (synopsis "Parser for Java")
13672 (description
13673 "This project contains a set of libraries implementing a Java 1.0 - Java
13674 11 Parser with advanced analysis functionalities.")
13675 (license (list
13676 ;; either lgpl or asl
13677 license:lgpl3+
13678 license:asl2.0))))