gnu: Add java-tunnelvisionlabs-antlr4-runtime-annotations.
[jackhill/guix/guix.git] / gnu / packages / java.scm
CommitLineData
0760e3a1 1;;; GNU Guix --- Functional package management for GNU
b7a1cac6 2;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
559239af 3;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
ea9e58ef 4;;; Copyright © 2016, 2017 Roel Janssen <roel@gnu.org>
717b6ba6 5;;; Copyright © 2017, 2019 Carlo Zancanaro <carlo@zancanaro.id.au>
30b7704a 6;;; Copyright © 2017-2020 Julien Lepiller <julien@lepiller.eu>
88f256a1 7;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
1d47ea86 8;;; Copyright © 2016, 2017, 2018 Alex Vong <alexvong1995@gmail.com>
1c8ba10a 9;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
0bc11cc7 10;;; Copyright © 2018, 2019 Gábor Boskovits <boskovits@gmail.com>
d0e9ded7 11;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
2703d573 12;;; Copyright © 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
60f5ab0b 13;;; Copyright © 2019, 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
9820d6ed 14;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
f1cf62f5
RG
15;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
16;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
0760e3a1
RW
17;;;
18;;; This file is part of GNU Guix.
19;;;
20;;; GNU Guix is free software; you can redistribute it and/or modify it
21;;; under the terms of the GNU General Public License as published by
22;;; the Free Software Foundation; either version 3 of the License, or (at
23;;; your option) any later version.
24;;;
25;;; GNU Guix is distributed in the hope that it will be useful, but
26;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28;;; GNU General Public License for more details.
29;;;
30;;; You should have received a copy of the GNU General Public License
31;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32
33(define-module (gnu packages java)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix packages)
36 #:use-module (guix download)
62c9bfaa 37 #:use-module (guix hg-download)
72885a4c 38 #:use-module (guix git-download)
78745d33 39 #:use-module (guix svn-download)
77ae4145 40 #:use-module ((guix build utils) #:select (alist-replace))
f6789047 41 #:use-module (guix utils)
068e476f 42 #:use-module (guix build-system ant)
0760e3a1 43 #:use-module (guix build-system gnu)
6a5829d9 44 #:use-module (guix build-system trivial)
0760e3a1
RW
45 #:use-module (gnu packages)
46 #:use-module (gnu packages attr)
47 #:use-module (gnu packages autotools)
48 #:use-module (gnu packages base)
49 #:use-module (gnu packages bash)
f21403e2 50 #:use-module (gnu packages certs)
0760e3a1
RW
51 #:use-module (gnu packages cpio)
52 #:use-module (gnu packages cups)
53 #:use-module (gnu packages compression)
dd741059 54 #:use-module (gnu packages elf)
0760e3a1
RW
55 #:use-module (gnu packages fontutils)
56 #:use-module (gnu packages gawk)
72885a4c 57 #:use-module (gnu packages gettext)
8581c813 58 #:use-module (gnu packages gl)
0760e3a1
RW
59 #:use-module (gnu packages ghostscript) ;lcms
60 #:use-module (gnu packages gnome)
3a69f5f2 61 #:use-module (gnu packages groovy)
0760e3a1 62 #:use-module (gnu packages gtk)
6a5829d9 63 #:use-module (gnu packages guile)
afb5858d 64 #:use-module (gnu packages icu4c)
0760e3a1 65 #:use-module (gnu packages image)
24155bf4 66 #:use-module (gnu packages java-compression)
c4fd86f9 67 #:use-module (gnu packages libffi)
0760e3a1 68 #:use-module (gnu packages linux) ;alsa
2f0d0418 69 #:use-module (gnu packages maths)
015e8774 70 #:use-module (gnu packages maven)
b916b638 71 #:use-module (gnu packages maven-parent-pom)
aff0cce9 72 #:use-module (gnu packages nss)
bcb078a4 73 #:use-module (gnu packages onc-rpc)
5766984b 74 #:use-module (gnu packages web)
0760e3a1 75 #:use-module (gnu packages wget)
0760e3a1
RW
76 #:use-module (gnu packages pkg-config)
77 #:use-module (gnu packages perl)
c4fd86f9 78 #:use-module (gnu packages popt)
89e34644 79 #:use-module (gnu packages kerberos)
0760e3a1
RW
80 #:use-module (gnu packages xml)
81 #:use-module (gnu packages xorg)
f6789047 82 #:use-module (gnu packages texinfo)
2d15f601
RW
83 #:use-module ((srfi srfi-1) #:select (fold alist-delete))
84 #:use-module (srfi srfi-11)
85 #:use-module (ice-9 match))
0760e3a1 86
e1ae3587
RW
87\f
88;;;
89;;; Java bootstrap toolchain.
90;;;
91
92;; The Java bootstrap begins with Jikes, a Java compiler written in C++. We
269fb7d3
RW
93;; use it to build a simple version of GNU Classpath, the Java standard
94;; library. We chose version 0.93 because it is the last version that can be
95;; built with Jikes. With Jikes and this version of GNU Classpath we can
96;; build JamVM, a Java Virtual Machine. We build version 1.5.1 because it is
97;; the last version of JamVM that works with a version of GNU classpath that
98;; does not require ECJ. These three packages make up the bootstrap JDK.
99
100;; This is sufficient to build an older version of Ant, which is needed to
101;; build an older version of ECJ, an incremental Java compiler, both of which
102;; are written in Java.
e1ae3587 103;;
269fb7d3
RW
104;; ECJ is needed to build the latest release (0.99) and the development
105;; version of GNU Classpath. The development version of GNU Classpath has
106;; much more support for Java 1.6 than the latest release, but we need to
107;; build 0.99 first to get a working version of javah. ECJ, the development
108;; version of GNU Classpath, and the latest version of JamVM make up the
109;; second stage JDK with which we can build the OpenJDK with the Icedtea 1.x
110;; build framework. We then build the more recent JDKs Icedtea 2.x and
111;; Icedtea 3.x.
e1ae3587 112
f1cf62f5
RG
113(define-public libantlr3c
114 (package
115 (name "libantlr3c")
116 (version "3.4")
117 (source
118 (origin
119 (method url-fetch)
120 (uri
121 (string-append "https://www.antlr3.org/download/C/"
122 name "-" version ".tar.gz"))
123 (sha256
124 (base32 "0lpbnb4dq4azmsvlhp6khq1gy42kyqyjv8gww74g5lm2y6blm4fa"))))
125 (build-system gnu-build-system)
126 (arguments
127 `(#:configure-flags (list "--enable-debuginfo" "--disable-static")
128 #:phases (modify-phases %standard-phases
129 (replace 'configure
130 (lambda* (#:key build target native-inputs inputs outputs
131 (configure-flags '()) out-of-source? system
132 #:allow-other-keys)
133 (let ((configure (assoc-ref %standard-phases 'configure))
134 (enable-64bit? (member system '("aarch64-linux"
135 "x86_64-linux"
136 "mips64el-linux"))))
137 (configure #:build build #:target target
138 #:native-inputs native-inputs
139 #:inputs inputs #:outputs outputs
140 #:configure-flags `(,(if enable-64bit?
141 "--enable-64bit"
142 '())
143 ,@configure-flags)
144 #:out-of-source? out-of-source?)))))))
145 (synopsis "ANTLR C Library")
146 (description "LIBANTLR3C provides run-time C libraries for ANTLR3 (ANother
147Tool for Language Recognition v3).")
148 (home-page "https://www.antlr3.org/")
149 (license license:bsd-3)))
150
e1ae3587
RW
151(define jikes
152 (package
153 (name "jikes")
154 (version "1.22")
155 (source (origin
156 (method url-fetch)
157 (uri (string-append "mirror://sourceforge/jikes/Jikes/"
158 version "/jikes-" version ".tar.bz2"))
159 (sha256
160 (base32
161 "1qqldrp74pzpy5ly421srqn30qppmm9cvjiqdngk8hf47dv2rc0c"))))
162 (build-system gnu-build-system)
163 (home-page "http://jikes.sourceforge.net/")
164 (synopsis "Compiler for the Java language")
165 (description "Jikes is a compiler that translates Java source files as
166defined in The Java Language Specification into the bytecoded instruction set
167and binary format defined in The Java Virtual Machine Specification.")
168 (license license:ibmpl1.0)))
169
880939c1
PN
170(define-public drip
171 ;; Last release is from 2014, with a few important commits afterwards.
172 (let ((commit "a4bd00df0199e78243847f06cc04ecaea31f8f08"))
173 (package
174 (name "drip")
175 (version (git-version "0.2.4" "1" commit))
176 (source (origin
177 (method git-fetch)
178 (uri (git-reference
179 (url "https://github.com/ninjudd/drip")
180 (commit commit)))
181 (file-name (git-file-name name version))
182 (sha256
183 (base32
184 "0wzmjwfyldr3jn49517xd8yn7dgdk8h88qkga3kjyg1zc375ylg2"))))
185 (build-system gnu-build-system)
186 (native-inputs
187 `(("jdk" ,icedtea "jdk")))
188 (arguments
189 `(#:tests? #f ; No tests.
190 #:phases
191 (modify-phases %standard-phases
192 (delete 'configure)
193 (add-before 'install 'fix-wrapper
194 (lambda* (#:key inputs #:allow-other-keys)
195 (let ((jps (string-append (assoc-ref inputs "jdk") "/bin/jps")))
196 (substitute* "bin/drip"
197 (("jps") jps)
198 (("brew update && brew upgrade drip") "guix pull && guix install drip")
199 ;; No need to make:
200 (("\\(cd -- \"\\$drip_dir\" && make -s\\) \\|\\| exit 1") "")
201 ;; No need to include source:
202 (("\\[\\[ -r \\$drip_dir/src/org/flatland/drip/Main\\.java \\]\\]")
203 "true"))
204 #t)))
205 (replace 'install
206 (lambda* (#:key outputs #:allow-other-keys)
207 (let* ((out (assoc-ref outputs "out"))
208 (bin (string-append out "/bin"))
209 (share (string-append out "/share/drip")))
210 (mkdir-p bin)
211 (for-each
212 (lambda (file)
213 (install-file (string-append "bin/" file) bin))
214 '("drip" "drip_daemon" "drip_proxy"))
215 (install-file "drip.jar" share)
216 (substitute* (string-append bin "/drip")
217 (("drip_dir=\\$bin_dir/..")
218 (string-append "drip_dir=" share)))
219 #t))))))
220 (home-page "https://github.com/ninjudd/drip")
221 (synopsis "Faster Java Virtual Machine launching")
222 (description "Drip is a launcher for the Java Virtual Machine that
223provides much faster startup times than the @command{java} command. The @command{drip}
224script is intended to be a drop-in replacement for the @command{java} command,
225only faster.")
226 (license license:epl1.0))))
227
45f762ee
RW
228;; This is the last version of GNU Classpath that can be built without ECJ.
229(define classpath-bootstrap
2551fee8 230 (package
45f762ee
RW
231 (name "classpath")
232 (version "0.93")
2551fee8
RW
233 (source (origin
234 (method url-fetch)
45f762ee
RW
235 (uri (string-append "mirror://gnu/classpath/classpath-"
236 version ".tar.gz"))
2551fee8
RW
237 (sha256
238 (base32
bab9793f
EF
239 "0i99wf9xd3hw1sj2sazychb9prx8nadxh2clgvk3zlmb28v0jbfz"))
240 (patches (search-patches "classpath-aarch64-support.patch"))))
2551fee8
RW
241 (build-system gnu-build-system)
242 (arguments
243 `(#:configure-flags
45f762ee
RW
244 (list (string-append "JAVAC="
245 (assoc-ref %build-inputs "jikes")
246 "/bin/jikes")
2551fee8
RW
247 "--disable-Werror"
248 "--disable-gmp"
249 "--disable-gtk-peer"
45f762ee 250 "--disable-gconf-peer"
2551fee8
RW
251 "--disable-plugin"
252 "--disable-dssi"
253 "--disable-alsa"
45f762ee
RW
254 "--disable-gjdoc")
255 #:phases
256 (modify-phases %standard-phases
4fb59c9e
RW
257 ;; XXX: This introduces a memory leak as we remove a call to free up
258 ;; memory for the file name string. This was necessary because of a
259 ;; runtime error that would have prevented us from building
260 ;; ant-bootstrap later. See https://issues.guix.gnu.org/issue/36685
261 ;; for the gnarly details.
262 (add-after 'unpack 'remove-call-to-free
263 (lambda _
264 (substitute* "native/jni/java-io/java_io_VMFile.c"
265 (("result = cpio_isFileExists.*" m)
266 (string-append m "\n//")))
267 #t))
45f762ee 268 (add-after 'install 'install-data
0c66a4eb 269 (lambda _ (invoke "make" "install-data"))))))
2551fee8
RW
270 (native-inputs
271 `(("jikes" ,jikes)
272 ("fastjar" ,fastjar)
45f762ee 273 ("libltdl" ,libltdl)
2551fee8 274 ("pkg-config" ,pkg-config)))
45f762ee
RW
275 (home-page "https://www.gnu.org/software/classpath/")
276 (synopsis "Essential libraries for Java")
277 (description "GNU Classpath is a project to create core class libraries
278for use with runtimes, compilers and tools for the Java programming
279language.")
280 ;; GPLv2 or later, with special linking exception.
281 (license license:gpl2+)))
57f6c50d 282
063629aa
RW
283;; This is the last version of JamVM that works with a version of GNU
284;; classpath that does not require ECJ.
285(define jamvm-1-bootstrap
57f6c50d 286 (package
063629aa
RW
287 (name "jamvm")
288 (version "1.5.1")
57f6c50d
RW
289 (source (origin
290 (method url-fetch)
063629aa
RW
291 (uri (string-append "mirror://sourceforge/jamvm/jamvm/"
292 "JamVM%20" version "/jamvm-"
293 version ".tar.gz"))
6c9dca5a
SS
294 (patches (search-patches "jamvm-1.5.1-aarch64-support.patch"
295 "jamvm-1.5.1-armv7-support.patch"))
57f6c50d
RW
296 (sha256
297 (base32
cff1e095
298 "06lhi03l3b0h48pc7x58bk9my2nrcf1flpmglvys3wyad6yraf36"))
299 (snippet
300 '(begin
301 ;; Remove precompiled software.
302 (delete-file "lib/classes.zip")
303 #t))))
57f6c50d
RW
304 (build-system gnu-build-system)
305 (arguments
c4fd86f9 306 `(#:configure-flags
063629aa 307 (list (string-append "--with-classpath-install-dir="
fc37b4af
RW
308 (assoc-ref %build-inputs "classpath"))
309 "--disable-int-caching"
310 "--enable-runtime-reloc-checks"
6c9dca5a
SS
311 "--enable-ffi")
312 #:phases
313 ,(if (string-prefix? "aarch64" (or (%current-system)
314 (%current-target-system)))
315 ;; Makefiles and the configure script need to be regenerated to
316 ;; incorporate support for AArch64.
317 '(modify-phases %standard-phases
318 (replace 'bootstrap
319 (lambda _ (invoke "autoreconf" "-vif"))))
320 '%standard-phases)))
57f6c50d 321 (inputs
063629aa 322 `(("classpath" ,classpath-bootstrap)
57f6c50d 323 ("jikes" ,jikes)
fc37b4af 324 ("libffi" ,libffi)
cff1e095 325 ("zip" ,zip)
063629aa 326 ("zlib" ,zlib)))
6c9dca5a
SS
327 (native-inputs
328 (if (string-prefix? "aarch64" (or (%current-system)
329 (%current-target-system)))
330 ;; Additional packages needed for autoreconf.
331 `(("autoconf" ,autoconf)
332 ("automake" ,automake)
333 ("libtool" ,libtool))
334 '()))
063629aa
RW
335 (home-page "http://jamvm.sourceforge.net/")
336 (synopsis "Small Java Virtual Machine")
337 (description "JamVM is a Java Virtual Machine conforming to the JVM
338specification edition 2 (blue book). It is extremely small. However, unlike
339other small VMs it supports the full spec, including object finalisation and
340JNI.")
341 (license license:gpl2+)))
2551fee8 342
5783bd77
RW
343(define ant-bootstrap
344 (package
345 (name "ant-bootstrap")
346 ;; The 1.10.x series requires Java 8. 1.9.0 and later use generics, which
347 ;; are not supported. The 1.8.x series is the last to use only features
ff4d9fdf
RW
348 ;; supported by Jikes.
349 (version "1.8.4")
5783bd77
RW
350 (source (origin
351 (method url-fetch)
9a01efa2 352 (uri (string-append "mirror://apache/"
5783bd77
RW
353 "ant/source/apache-ant-"
354 version "-src.tar.bz2"))
355 (sha256
356 (base32
ff4d9fdf 357 "1cg0lga887qz5iizh6mlkxp01lciymrhmp7wzxpl6zpnldxmzrjx"))))
5783bd77
RW
358 (build-system gnu-build-system)
359 (arguments
cded3a75
GB
360 `(#:imported-modules ((guix build syscalls)
361 ,@%gnu-build-system-modules)
362 #:modules ((srfi srfi-1)
363 (guix build gnu-build-system)
364 (guix build utils)
365 (guix build syscalls))
366 #:tests? #f ; no "check" target
5783bd77
RW
367 #:phases
368 (modify-phases %standard-phases
d4fd4c3a 369 (delete 'bootstrap)
5783bd77
RW
370 (delete 'configure)
371 (replace 'build
372 (lambda* (#:key inputs #:allow-other-keys)
aa432388 373 (setenv "JAVA_HOME" (assoc-ref inputs "jamvm"))
5783bd77 374 (setenv "JAVACMD"
aa432388
RW
375 (string-append (assoc-ref inputs "jamvm")
376 "/bin/jamvm"))
5783bd77 377 (setenv "JAVAC"
aa432388
RW
378 (string-append (assoc-ref inputs "jikes")
379 "/bin/jikes"))
380 (setenv "CLASSPATH"
381 (string-append (assoc-ref inputs "jamvm")
382 "/lib/rt.jar"))
5783bd77 383
d4fd4c3a
RW
384 ;; Ant complains if this file doesn't exist.
385 (setenv "HOME" "/tmp")
386 (with-output-to-file "/tmp/.ant.properties"
387 (lambda _ (display "")))
5783bd77
RW
388
389 ;; Use jikes instead of javac for <javac ...> tags in build.xml
390 (setenv "ANT_OPTS" "-Dbuild.compiler=jikes")
391
392 ;; jikes produces lots of warnings, but they are not very
393 ;; interesting, so we silence them.
394 (setenv "$BOOTJAVAC_OPTS" "-nowarn")
395
d4fd4c3a
RW
396 ;; Without these JamVM options the build may freeze.
397 (substitute* "bootstrap.sh"
398 (("^\"\\$\\{JAVACMD\\}\" " m)
a495998b
EF
399 ,@(if (string-prefix? "armhf" (or (%current-system)
400 (%current-target-system)))
401 `((string-append m "-Xnocompact "))
402 `((string-append m "-Xnocompact -Xnoinlining ")))))
d4fd4c3a 403
5783bd77
RW
404 ;; Disable tests because we are bootstrapping and thus don't have
405 ;; any of the dependencies required to build and run the tests.
406 (substitute* "build.xml"
407 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
8e14634a
EF
408 (invoke "bash" "bootstrap.sh"
409 (string-append "-Ddist.dir="
410 (assoc-ref %outputs "out")))))
cded3a75
GB
411 (add-after 'build 'strip-jar-timestamps ;based on ant-build-system
412 (lambda* (#:key outputs #:allow-other-keys)
413 (define (repack-archive jar)
414 (let* ((dir (mkdtemp! "jar-contents.XXXXXX"))
415 (manifest (string-append dir "/META-INF/MANIFESTS.MF")))
416 (with-directory-excursion dir
417 (invoke "unzip" jar))
418 (delete-file jar)
419 ;; XXX: copied from (gnu build install)
420 (for-each (lambda (file)
421 (let ((s (lstat file)))
422 (unless (eq? (stat:type s) 'symlink)
423 (utime file 0 0 0 0))))
424 (find-files dir #:directories? #t))
425 ;; It is important that the manifest appears first.
426 (with-directory-excursion dir
427 (let* ((files (find-files "." ".*" #:directories? #t))
428 ;; To ensure that the reference scanner can
429 ;; detect all store references in the jars
430 ;; we disable compression with the "-0" option.
431 (command (if (file-exists? manifest)
432 `("zip" "-0" "-X" ,jar ,manifest
433 ,@files)
434 `("zip" "-0" "-X" ,jar ,@files))))
435 (apply invoke command)))))
436 (for-each repack-archive
437 (find-files
438 (string-append (assoc-ref %outputs "out") "/lib")
439 "\\.jar$"))
440 #t))
5783bd77
RW
441 (delete 'install))))
442 (native-inputs
443 `(("jikes" ,jikes)
cded3a75
GB
444 ("jamvm" ,jamvm-1-bootstrap)
445 ("unzip" ,unzip)
b42b5afd 446 ("zip" ,zip)))
0b1d71b2 447 (home-page "https://ant.apache.org")
5783bd77
RW
448 (synopsis "Build tool for Java")
449 (description
450 "Ant is a platform-independent build tool for Java. It is similar to
451make but is implemented using the Java language, requires the Java platform,
452and is best suited to building Java projects. Ant uses XML to describe the
453build process and its dependencies, whereas Make uses Makefile format.")
454 (license license:asl2.0)))
455
5461721f
RW
456;; Version 3.2.2 is the last version without a dependency on a full-fledged
457;; compiler for Java 1.5.
458(define ecj-bootstrap
459 (package
460 (name "ecj-bootstrap")
461 (version "3.2.2")
462 (source (origin
463 (method url-fetch)
464 (uri (string-append "http://archive.eclipse.org/eclipse/"
465 "downloads/drops/R-" version
466 "-200702121330/ecjsrc.zip"))
467 (sha256
468 (base32
469 "05hj82kxd23qaglsjkaqcj944riisjha7acf7h3ljhrjyljx8307"))))
470 ;; It would be so much easier if we could use the ant-build-system, but we
471 ;; cannot as we don't have ant at this point. We use ecj for
472 ;; bootstrapping the JDK.
473 (build-system gnu-build-system)
474 (arguments
475 `(#:modules ((guix build gnu-build-system)
476 (guix build utils)
477 (srfi srfi-1))
478 #:tests? #f ; there are no tests
479 #:phases
480 (modify-phases %standard-phases
481 (replace 'configure
482 (lambda* (#:key inputs #:allow-other-keys)
483 (setenv "CLASSPATH"
484 (string-join
6c775dc6
RW
485 (cons (string-append (assoc-ref inputs "jamvm")
486 "/lib/rt.jar")
487 (find-files (string-append
488 (assoc-ref inputs "ant-bootstrap")
489 "/lib")
490 "\\.jar$"))
5461721f
RW
491 ":"))
492 #t))
493 (replace 'build
494 (lambda* (#:key inputs #:allow-other-keys)
495 ;; The unpack phase enters the "org" directory by mistake.
496 (chdir "..")
497
498 ;; Create a simple manifest to make ecj executable.
499 (with-output-to-file "manifest"
500 (lambda _
501 (display "Manifest-Version: 1.0
502Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n")))
503
504 ;; Compile it all!
0b302a16
EF
505 (and (apply invoke "jikes"
506 (find-files "." "\\.java$"))
507 (invoke "fastjar" "cvfm"
508 "ecj-bootstrap.jar" "manifest" "."))))
5461721f
RW
509 (replace 'install
510 (lambda* (#:key outputs #:allow-other-keys)
511 (let ((share (string-append (assoc-ref outputs "out")
512 "/share/java/")))
513 (mkdir-p share)
514 (install-file "ecj-bootstrap.jar" share)
515 #t))))))
516 (native-inputs
517 `(("ant-bootstrap" ,ant-bootstrap)
518 ("unzip" ,unzip)
6c775dc6
RW
519 ("jikes" ,jikes)
520 ("jamvm" ,jamvm-1-bootstrap)
5461721f
RW
521 ("fastjar" ,fastjar)))
522 (home-page "https://eclipse.org")
523 (synopsis "Eclipse Java development tools core batch compiler")
524 (description "This package provides the Eclipse Java core batch compiler
525for bootstrapping purposes. The @dfn{Eclipse compiler for Java} (ecj) is a
526requirement for all GNU Classpath releases after version 0.93.")
527 (license license:epl1.0)))
528
6a5829d9
RW
529(define ecj-javac-wrapper
530 (package (inherit ecj-bootstrap)
531 (name "ecj-javac-wrapper")
532 (source #f)
533 (build-system trivial-build-system)
534 (arguments
535 `(#:modules ((guix build utils))
536 #:builder
c4f06c11 537 (begin
6a5829d9
RW
538 (use-modules (guix build utils))
539 (let* ((bin (string-append (assoc-ref %outputs "out") "/bin"))
540 (target (string-append bin "/javac"))
541 (guile (string-append (assoc-ref %build-inputs "guile")
542 "/bin/guile"))
543 (ecj (string-append (assoc-ref %build-inputs "ecj-bootstrap")
544 "/share/java/ecj-bootstrap.jar"))
c4f06c11
RW
545 (java (string-append (assoc-ref %build-inputs "jamvm")
546 "/bin/jamvm"))
547 (bootcp (let ((jvmlib (string-append (assoc-ref %build-inputs "classpath")
548 "/share/classpath")))
51602aac
RW
549 (string-append jvmlib "/glibj.zip:"
550 jvmlib "/tools.zip"))))
6a5829d9
RW
551 (mkdir-p bin)
552 (with-output-to-file target
553 (lambda _
554 (format #t "#!~a --no-auto-compile\n!#\n" guile)
555 (write
556 `(begin (use-modules (ice-9 match)
557 (ice-9 receive)
558 (ice-9 hash-table)
559 (srfi srfi-1)
560 (srfi srfi-26))
561 (define defaults
562 '(("-bootclasspath" ,bootcp)
563 ("-source" "1.5")
564 ("-target" "1.5")
565 ("-cp" ".")))
566 (define (main args)
567 (let ((classpath (getenv "CLASSPATH")))
568 (setenv "CLASSPATH"
c4f06c11
RW
569 (string-join (list ,ecj
570 ,(string-append (assoc-ref %build-inputs "jamvm")
571 "/lib/rt.jar")
572 (or classpath ""))
573 ":")))
6a5829d9
RW
574 (receive (vm-args other-args)
575 ;; Separate VM arguments from arguments to ECJ.
576 (partition (cut string-prefix? "-J" <>)
577 (fold (lambda (default acc)
578 (if (member (first default) acc)
579 acc (append default acc)))
580 args defaults))
581 (apply system* ,java
582 (append
583 ;; Remove "-J" prefix
584 (map (cut string-drop <> 2) vm-args)
585 '("org.eclipse.jdt.internal.compiler.batch.Main")
586 (cons "-nowarn" other-args)))))
587 ;; Entry point
588 (let ((args (cdr (command-line))))
589 (if (null? args)
590 (format (current-error-port) "javac: no arguments given!\n")
591 (main args)))))))
592 (chmod target #o755)
593 #t))))
594 (native-inputs
595 `(("guile" ,guile-2.2)
596 ("ecj-bootstrap" ,ecj-bootstrap)
c4f06c11
RW
597 ("jamvm" ,jamvm-1-bootstrap)
598 ("classpath" ,classpath-bootstrap)))
6a5829d9
RW
599 (description "This package provides a wrapper around the @dfn{Eclipse
600compiler for Java} (ecj) with a command line interface that is compatible with
601the standard javac executable.")))
602
8778da03
RW
603;; The classpath-bootstrap was built without a virtual machine, so it does not
604;; provide a wrapper for javah. We cannot build the development version of
605;; Classpath without javah.
606(define classpath-0.99
607 (package (inherit classpath-bootstrap)
d3551e86
RW
608 (version "0.99")
609 (source (origin
610 (method url-fetch)
611 (uri (string-append "mirror://gnu/classpath/classpath-"
612 version ".tar.gz"))
613 (sha256
614 (base32
bab9793f
EF
615 "1j7cby4k66f1nvckm48xcmh352b1d1b33qk7l6hi7dp9i9zjjagr"))
616 (patches (search-patches "classpath-aarch64-support.patch"))))
d3551e86
RW
617 (arguments
618 `(#:configure-flags
619 (list (string-append "--with-ecj-jar="
620 (assoc-ref %build-inputs "ecj-bootstrap")
621 "/share/java/ecj-bootstrap.jar")
622 (string-append "JAVAC="
623 (assoc-ref %build-inputs "ecj-javac-wrapper")
624 "/bin/javac")
625 (string-append "JAVA="
8778da03
RW
626 (assoc-ref %build-inputs "jamvm")
627 "/bin/jamvm")
d3551e86
RW
628 "GCJ_JAVAC_TRUE=no"
629 "ac_cv_prog_java_works=yes" ; trust me
630 "--disable-Werror"
631 "--disable-gmp"
632 "--disable-gtk-peer"
633 "--disable-gconf-peer"
634 "--disable-plugin"
635 "--disable-dssi"
636 "--disable-alsa"
637 "--disable-gjdoc")
638 #:phases
639 (modify-phases %standard-phases
640 (add-after 'install 'install-data
15a59c21 641 (lambda _ (invoke "make" "install-data"))))))
d3551e86
RW
642 (native-inputs
643 `(("ecj-bootstrap" ,ecj-bootstrap)
644 ("ecj-javac-wrapper" ,ecj-javac-wrapper)
645 ("fastjar" ,fastjar)
8778da03
RW
646 ("jamvm" ,jamvm-1-bootstrap)
647 ("classpath" ,classpath-bootstrap)
d3551e86 648 ("libltdl" ,libltdl)
8778da03 649 ("pkg-config" ,pkg-config)))))
d3551e86 650
c98d7a66
RW
651;; We need this because classpath-bootstrap does not provide all of the tools
652;; we need to build classpath-devel.
04d7cae2 653(define classpath-jamvm-wrappers
c98d7a66 654 (package (inherit classpath-0.99)
04d7cae2
RW
655 (name "classpath-jamvm-wrappers")
656 (source #f)
657 (build-system trivial-build-system)
658 (arguments
659 `(#:modules ((guix build utils))
660 #:builder
661 (begin
662 (use-modules (guix build utils))
663 (let* ((bash (assoc-ref %build-inputs "bash"))
664 (jamvm (assoc-ref %build-inputs "jamvm"))
665 (classpath (assoc-ref %build-inputs "classpath"))
666 (bin (string-append (assoc-ref %outputs "out")
667 "/bin/")))
668 (mkdir-p bin)
669 (for-each (lambda (tool)
670 (with-output-to-file (string-append bin tool)
671 (lambda _
e3ec1258
EF
672 ,@(if (string-prefix? "armhf" (or (%current-system)
673 (%current-target-system)))
674 `((format #t "#!~a/bin/sh
675~a/bin/jamvm -Xnocompact -classpath ~a/share/classpath/tools.zip \
676gnu.classpath.tools.~a.~a $@"
677 bash jamvm classpath tool
678 (if (string=? "native2ascii" tool)
679 "Native2ASCII" "Main")))
680 `((format #t "#!~a/bin/sh
40e3a197 681~a/bin/jamvm -Xnocompact -Xnoinlining -classpath ~a/share/classpath/tools.zip \
04d7cae2
RW
682gnu.classpath.tools.~a.~a $@"
683 bash jamvm classpath tool
684 (if (string=? "native2ascii" tool)
e3ec1258 685 "Native2ASCII" "Main"))))))
04d7cae2
RW
686 (chmod (string-append bin tool) #o755))
687 (list "javah"
688 "rmic"
689 "rmid"
690 "orbd"
691 "rmiregistry"
692 "native2ascii"))
693 #t))))
694 (native-inputs
695 `(("bash" ,bash)
c98d7a66
RW
696 ("jamvm" ,jamvm-1-bootstrap)
697 ("classpath" ,classpath-0.99)))
04d7cae2
RW
698 (inputs '())
699 (synopsis "Executables from GNU Classpath")
700 (description "This package provides wrappers around the tools provided by
701the GNU Classpath library. They are executed by the JamVM virtual
702machine.")))
703
72885a4c
RW
704;; The last release of GNU Classpath is 0.99 and it happened in 2012. Since
705;; then Classpath has gained much more support for Java 1.6.
706(define-public classpath-devel
707 (let ((commit "e7c13ee0cf2005206fbec0eca677f8cf66d5a103")
708 (revision "1"))
8778da03 709 (package (inherit classpath-bootstrap)
72885a4c
RW
710 (version (string-append "0.99-" revision "." (string-take commit 9)))
711 (source (origin
712 (method git-fetch)
713 (uri (git-reference
5f13bf09 714 (url "https://git.savannah.gnu.org/git/classpath.git")
72885a4c 715 (commit commit)))
51988e3a 716 (file-name (string-append "classpath-" version "-checkout"))
72885a4c
RW
717 (sha256
718 (base32
2995be77
SS
719 "1v2rww76ww322mpg3s12a1kkc6gkp31bm9gcxs532h0wq285fiw4"))
720 (patches (search-patches "classpath-aarch64-support.patch"))))
72885a4c 721 (arguments
93c103ab
RW
722 `(#:make-flags
723 ;; Ensure that the initial heap size is smaller than the maximum
724 ;; size. By default only Xmx is set, which can lead to invalid
725 ;; memory settings on some machines with a lot of memory.
726 '("JAVAC_MEM_OPT=-J-Xms512M -J-Xmx768M")
727 #:configure-flags
72885a4c
RW
728 (list (string-append "--with-ecj-jar="
729 (assoc-ref %build-inputs "ecj-bootstrap")
730 "/share/java/ecj-bootstrap.jar")
93c103ab 731 (string-append "--with-javac="
72885a4c
RW
732 (assoc-ref %build-inputs "ecj-javac-wrapper")
733 "/bin/javac")
734 (string-append "JAVA="
735 (assoc-ref %build-inputs "jamvm")
736 "/bin/jamvm")
737 "GCJ_JAVAC_TRUE=no"
738 "ac_cv_prog_java_works=yes" ; trust me
739 "--disable-Werror"
740 "--disable-gmp"
741 "--disable-gtk-peer"
742 "--disable-gconf-peer"
743 "--disable-plugin"
744 "--disable-dssi"
745 "--disable-alsa"
746 "--disable-gjdoc")
747 #:phases
748 (modify-phases %standard-phases
2a69f48e
RW
749 ;; XXX The bootstrap phase executes autogen.sh, which fails after
750 ;; complaining about the lack of gettext.
751 (replace 'bootstrap
752 (lambda _ (invoke "autoreconf" "-vif")))
72885a4c
RW
753 (add-after 'unpack 'remove-unsupported-annotations
754 (lambda _
755 (substitute* (find-files "java" "\\.java$")
756 (("@Override") ""))
757 #t))
758 (add-after 'install 'install-data
4c65eb43 759 (lambda _ (invoke "make" "install-data"))))))
72885a4c
RW
760 (native-inputs
761 `(("autoconf" ,autoconf)
762 ("automake" ,automake)
763 ("libtool" ,libtool)
764 ("gettext" ,gettext-minimal)
765 ("texinfo" ,texinfo)
766 ("classpath-jamvm-wrappers" ,classpath-jamvm-wrappers) ; for javah
767 ("ecj-bootstrap" ,ecj-bootstrap)
b5a0d427 768 ("ecj-javac-wrapper" ,ecj-javac-wrapper)
72885a4c 769 ("fastjar" ,fastjar)
58d2b135 770 ("jamvm" ,jamvm-1-bootstrap)
72885a4c
RW
771 ("libltdl" ,libltdl)
772 ("pkg-config" ,pkg-config))))))
773
58d2b135
RW
774(define jamvm
775 (package (inherit jamvm-1-bootstrap)
776 (version "2.0.0")
777 (source (origin
778 (method url-fetch)
779 (uri (string-append "mirror://sourceforge/jamvm/jamvm/"
780 "JamVM%20" version "/jamvm-"
781 version ".tar.gz"))
782 (sha256
783 (base32
cff1e095 784 "1nl0zxz8y5x8gwsrm7n32bry4dx8x70p8z3s9jbdvs8avyb8whkn"))
a2120060 785 (patches
2995be77
SS
786 (search-patches "jamvm-2.0.0-disable-branch-patching.patch"
787 "jamvm-2.0.0-opcode-guard.patch"
788 "jamvm-2.0.0-aarch64-support.patch"))
cff1e095
789 (snippet
790 '(begin
791 ;; Remove precompiled software.
792 (delete-file "src/classlib/gnuclasspath/lib/classes.zip")
793 #t))))
58d2b135
RW
794 (build-system gnu-build-system)
795 (arguments
2995be77
SS
796 (substitute-keyword-arguments (package-arguments jamvm-1-bootstrap)
797 ((#:configure-flags _)
798 '(list (string-append "--with-classpath-install-dir="
799 (assoc-ref %build-inputs "classpath"))))))
8c6091e3
RW
800 (inputs
801 `(("classpath" ,classpath-devel)
b5a0d427 802 ("ecj-javac-wrapper" ,ecj-javac-wrapper)
cff1e095 803 ("zip" ,zip)
8c6091e3
RW
804 ("zlib" ,zlib)))))
805
b5a0d427
RW
806(define ecj-javac-wrapper-final
807 (package (inherit ecj-javac-wrapper)
1bf56c72
RW
808 (native-inputs
809 `(("guile" ,guile-2.2)
810 ("ecj-bootstrap" ,ecj-bootstrap)
811 ("jamvm" ,jamvm)
812 ("classpath" ,classpath-devel)))))
813
98419316 814;; The bootstrap JDK consisting of jamvm, classpath-devel,
b5a0d427
RW
815;; ecj-javac-wrapper-final cannot build Icedtea 2.x directly, because it's
816;; written in Java 7. It can, however, build the unmaintained Icedtea 1.x,
817;; which uses Java 6 only.
98419316
RW
818(define-public icedtea-6
819 (package
820 (name "icedtea")
821 (version "1.13.13")
822 (source (origin
823 (method url-fetch)
824 (uri (string-append
825 "http://icedtea.wildebeest.org/download/source/icedtea6-"
826 version ".tar.xz"))
827 (sha256
828 (base32
829 "0bg9sb4f7qbq77c0zf9m17p47ga0kf0r9622g9p12ysg26jd1ksg"))
830 (modules '((guix build utils)))
831 (snippet
6cbee49d
MW
832 '(begin
833 (substitute* "Makefile.in"
834 ;; do not leak information about the build host
835 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
836 "DISTRIBUTION_ID=\"\\\"guix\\\"\""))
837 #t))))
98419316
RW
838 (build-system gnu-build-system)
839 (outputs '("out" ; Java Runtime Environment
840 "jdk" ; Java Development Kit
841 "doc")) ; all documentation
842 (arguments
843 `(;; There are many failing tests and many are known to fail upstream.
844 #:tests? #f
845
846 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
847 ;; gremlin) doesn't support it yet, so skip this phase.
848 #:validate-runpath? #f
849
850 #:modules ((guix build utils)
851 (guix build gnu-build-system)
852 (srfi srfi-19))
853
854 #:configure-flags
855 `("--enable-bootstrap"
856 "--enable-nss"
857 "--without-rhino"
858 "--with-parallel-jobs"
859 "--disable-downloading"
860 "--disable-tests"
861 ,(string-append "--with-ecj="
862 (assoc-ref %build-inputs "ecj")
863 "/share/java/ecj-bootstrap.jar")
864 ,(string-append "--with-jar="
865 (assoc-ref %build-inputs "fastjar")
866 "/bin/fastjar")
867 ,(string-append "--with-jdk-home="
868 (assoc-ref %build-inputs "classpath"))
869 ,(string-append "--with-java="
870 (assoc-ref %build-inputs "jamvm")
871 "/bin/jamvm"))
872 #:phases
873 (modify-phases %standard-phases
874 (replace 'unpack
875 (lambda* (#:key source inputs #:allow-other-keys)
2c8ac364
MW
876 (invoke "tar" "xvf" source)
877 (chdir (string-append "icedtea6-" ,version))
878 (mkdir "openjdk")
879 (copy-recursively (assoc-ref inputs "openjdk-src") "openjdk")
880 ;; The convenient OpenJDK source bundle is no longer
881 ;; available for download, so we have to take the sources
882 ;; from the Mercurial repositories and change the Makefile
883 ;; to avoid tests for the OpenJDK zip archive.
884 (with-directory-excursion "openjdk"
885 (for-each (lambda (part)
886 (mkdir part)
887 (copy-recursively
888 (assoc-ref inputs
889 (string-append part "-src"))
890 part))
873325b0 891 '("jdk" "corba"
2c8ac364 892 "langtools" "jaxp" "jaxws")))
873325b0
MB
893 (with-directory-excursion "openjdk"
894 (invoke "tar" "xvf" (assoc-ref inputs "hotspot-src"))
895 (rename-file "hg-checkout" "hotspot"))
306c1e61
RW
896 (substitute* "patches/freetypeversion.patch"
897 (("REQUIRED_FREETYPE_VERSION = 2.2.1")
898 "REQUIRED_FREETYPE_VERSION = 2.10.1"))
2c8ac364
MW
899 (substitute* "Makefile.in"
900 (("echo \"ERROR: No up-to-date OpenJDK zip available\"; exit -1;")
901 "echo \"trust me\";")
902 ;; The contents of the bootstrap directory must be
903 ;; writeable but when copying from the store they are
904 ;; not.
905 (("mkdir -p lib/rt" line)
906 (string-append line "; chmod -R u+w $(BOOT_DIR)")))
907 (invoke "chmod" "-R" "u+w" "openjdk")))
98419316
RW
908 (add-after 'unpack 'use-classpath
909 (lambda* (#:key inputs #:allow-other-keys)
b5a0d427
RW
910 (let ((jvmlib (assoc-ref inputs "classpath"))
911 (jamvm (assoc-ref inputs "jamvm")))
98419316
RW
912 ;; Classpath does not provide rt.jar.
913 (substitute* "Makefile.in"
914 (("\\$\\(SYSTEM_JDK_DIR\\)/jre/lib/rt.jar")
915 (string-append jvmlib "/share/classpath/glibj.zip")))
916 ;; Make sure we can find all classes.
917 (setenv "CLASSPATH"
918 (string-append jvmlib "/share/classpath/glibj.zip:"
b5a0d427
RW
919 jvmlib "/share/classpath/tools.zip:"
920 jamvm "/lib/rt.jar"))
98419316
RW
921 (setenv "JAVACFLAGS"
922 (string-append "-cp "
923 jvmlib "/share/classpath/glibj.zip:"
924 jvmlib "/share/classpath/tools.zip")))
925 #t))
926 (add-after 'unpack 'patch-patches
927 (lambda _
928 ;; shebang in patches so that they apply cleanly
929 (substitute* '("patches/jtreg-jrunscript.patch"
930 "patches/hotspot/hs23/drop_unlicensed_test.patch")
931 (("#!/bin/sh") (string-append "#!" (which "sh"))))
932 #t))
933 (add-after 'unpack 'patch-paths
934 (lambda* (#:key inputs #:allow-other-keys)
935 ;; buildtree.make generates shell scripts, so we need to replace
936 ;; the generated shebang
937 (substitute* '("openjdk/hotspot/make/linux/makefiles/buildtree.make")
938 (("/bin/sh") (which "bash")))
939
940 (let ((corebin (string-append
941 (assoc-ref inputs "coreutils") "/bin/"))
942 (binbin (string-append
943 (assoc-ref inputs "binutils") "/bin/"))
944 (grepbin (string-append
945 (assoc-ref inputs "grep") "/bin/")))
946 (substitute* '("openjdk/jdk/make/common/shared/Defs-linux.gmk"
947 "openjdk/corba/make/common/shared/Defs-linux.gmk")
948 (("UNIXCOMMAND_PATH = /bin/")
949 (string-append "UNIXCOMMAND_PATH = " corebin))
950 (("USRBIN_PATH = /usr/bin/")
951 (string-append "USRBIN_PATH = " corebin))
952 (("DEVTOOLS_PATH *= */usr/bin/")
953 (string-append "DEVTOOLS_PATH = " corebin))
954 (("COMPILER_PATH *= */usr/bin/")
955 (string-append "COMPILER_PATH = "
956 (assoc-ref inputs "gcc") "/bin/"))
957 (("DEF_OBJCOPY *=.*objcopy")
958 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
959
960 ;; fix path to alsa header
961 (substitute* "openjdk/jdk/make/common/shared/Sanity.gmk"
962 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
963 (string-append "ALSA_INCLUDE="
964 (assoc-ref inputs "alsa-lib")
965 "/include/alsa/version.h")))
966
967 ;; fix hard-coded utility paths
968 (substitute* '("openjdk/jdk/make/common/shared/Defs-utils.gmk"
969 "openjdk/corba/make/common/shared/Defs-utils.gmk")
970 (("ECHO *=.*echo")
971 (string-append "ECHO = " (which "echo")))
972 (("^GREP *=.*grep")
973 (string-append "GREP = " (which "grep")))
974 (("EGREP *=.*egrep")
975 (string-append "EGREP = " (which "egrep")))
976 (("CPIO *=.*cpio")
977 (string-append "CPIO = " (which "cpio")))
978 (("READELF *=.*readelf")
979 (string-append "READELF = " (which "readelf")))
980 (("^ *AR *=.*ar")
981 (string-append "AR = " (which "ar")))
982 (("^ *TAR *=.*tar")
983 (string-append "TAR = " (which "tar")))
984 (("AS *=.*as")
985 (string-append "AS = " (which "as")))
986 (("LD *=.*ld")
987 (string-append "LD = " (which "ld")))
988 (("STRIP *=.*strip")
989 (string-append "STRIP = " (which "strip")))
990 (("NM *=.*nm")
991 (string-append "NM = " (which "nm")))
992 (("^SH *=.*sh")
993 (string-append "SH = " (which "bash")))
994 (("^FIND *=.*find")
995 (string-append "FIND = " (which "find")))
996 (("LDD *=.*ldd")
997 (string-append "LDD = " (which "ldd")))
998 (("NAWK *=.*(n|g)awk")
999 (string-append "NAWK = " (which "gawk")))
1000 (("XARGS *=.*xargs")
1001 (string-append "XARGS = " (which "xargs")))
1002 (("UNZIP *=.*unzip")
1003 (string-append "UNZIP = " (which "unzip")))
1004 (("ZIPEXE *=.*zip")
1005 (string-append "ZIPEXE = " (which "zip")))
1006 (("SED *=.*sed")
1007 (string-append "SED = " (which "sed"))))
1008
1009 ;; Some of these timestamps cause problems as they are more than
1010 ;; 10 years ago, failing the build process.
1011 (substitute*
1012 "openjdk/jdk/src/share/classes/java/util/CurrencyData.properties"
1013 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
1014 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
1015 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
1016 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY"))
1017 #t)))
1018 (add-before 'configure 'set-additional-paths
1019 (lambda* (#:key inputs #:allow-other-keys)
1020 (setenv "CPATH"
1021 (string-append (assoc-ref inputs "libxrender")
1022 "/include/X11/extensions" ":"
1023 (assoc-ref inputs "libxtst")
1024 "/include/X11/extensions" ":"
1025 (assoc-ref inputs "libxinerama")
1026 "/include/X11/extensions" ":"
1027 (or (getenv "CPATH") "")))
1028 (setenv "ALT_CUPS_HEADERS_PATH"
1029 (string-append (assoc-ref inputs "cups")
1030 "/include"))
1031 (setenv "ALT_FREETYPE_HEADERS_PATH"
1032 (string-append (assoc-ref inputs "freetype")
1033 "/include"))
1034 (setenv "ALT_FREETYPE_LIB_PATH"
1035 (string-append (assoc-ref inputs "freetype")
1036 "/lib"))
1037 #t))
0bc11cc7
GB
1038 (add-before 'build 'disable-os-version-check
1039 ;; allow build on linux major version change
1040 (lambda _
1041 (setenv "DISABLE_HOTSPOT_OS_VERSION_CHECK" "ok")
1042 #t))
98419316
RW
1043 (replace 'install
1044 (lambda* (#:key outputs #:allow-other-keys)
1045 (let ((doc (string-append (assoc-ref outputs "doc")
1046 "/share/doc/icedtea"))
1047 (jre (assoc-ref outputs "out"))
1048 (jdk (assoc-ref outputs "jdk")))
1049 (copy-recursively "openjdk.build/docs" doc)
1050 (copy-recursively "openjdk.build/j2re-image" jre)
1051 (copy-recursively "openjdk.build/j2sdk-image" jdk))
1052 #t)))))
1053 (native-inputs
1054 `(("ant" ,ant-bootstrap)
1055 ("alsa-lib" ,alsa-lib)
1056 ("attr" ,attr)
1057 ("classpath" ,classpath-devel)
1058 ("coreutils" ,coreutils)
1059 ("cpio" ,cpio)
1060 ("cups" ,cups)
1061 ("ecj" ,ecj-bootstrap)
b5a0d427 1062 ("ecj-javac" ,ecj-javac-wrapper-final)
98419316
RW
1063 ("fastjar" ,fastjar)
1064 ("fontconfig" ,fontconfig)
1065 ("freetype" ,freetype)
1066 ("gtk" ,gtk+-2)
1067 ("gawk" ,gawk)
1068 ("giflib" ,giflib)
1069 ("grep" ,grep)
1070 ("jamvm" ,jamvm)
1071 ("lcms" ,lcms)
4bd428a7 1072 ("libjpeg" ,libjpeg-turbo)
bcb078a4 1073 ("libnsl" ,libnsl)
98419316
RW
1074 ("libpng" ,libpng)
1075 ("libtool" ,libtool)
1076 ("libx11" ,libx11)
1077 ("libxcomposite" ,libxcomposite)
1078 ("libxi" ,libxi)
1079 ("libxinerama" ,libxinerama)
1080 ("libxrender" ,libxrender)
1081 ("libxslt" ,libxslt) ;for xsltproc
1082 ("libxt" ,libxt)
1083 ("libxtst" ,libxtst)
1084 ("mit-krb5" ,mit-krb5)
1085 ("nss" ,nss)
1086 ("nss-certs" ,nss-certs)
1087 ("perl" ,perl)
1088 ("pkg-config" ,pkg-config)
1089 ("procps" ,procps) ;for "free", even though I'm not sure we should use it
1090 ("unzip" ,unzip)
1091 ("wget" ,wget)
1092 ("which" ,which)
1093 ("zip" ,zip)
1094 ("zlib" ,zlib)
1095 ("openjdk-src"
1096 ,(origin
1097 (method hg-fetch)
1098 (uri (hg-reference
1099 (url "http://hg.openjdk.java.net/jdk6/jdk6/")
1100 (changeset "jdk6-b41")))
1101 (sha256
1102 (base32
1103 "14q47yfg586fs64w30g8mk92m5dkxsvr36zzh0ra99xk5x0x96mv"))))
1104 ("jdk-src"
1105 ,(origin
1106 (method hg-fetch)
1107 (uri (hg-reference
1108 (url "http://hg.openjdk.java.net/jdk6/jdk6/jdk/")
1109 (changeset "jdk6-b41")))
1110 (sha256
1111 (base32
1112 "165824nhg1k1dx6zs9dny0j49rmk35jw5b13dmz8c77jfajml4v9"))))
1113 ("hotspot-src"
1114 ,(origin
1115 (method hg-fetch)
1116 (uri (hg-reference
1117 (url "http://hg.openjdk.java.net/jdk6/jdk6/hotspot/")
1118 (changeset "jdk6-b41")))
1119 (sha256
1120 (base32
1cdff8cd
GB
1121 "07lc1z4k5dj9nrc1wvwmpvxr3xgxrdkdh53xb95skk5ij49yagfd"))
1122 (patches
1123 (search-patches "icedtea-6-hotspot-gcc-segfault-workaround.patch"))))
98419316
RW
1124 ("corba-src"
1125 ,(origin
1126 (method hg-fetch)
1127 (uri (hg-reference
1128 (url "http://hg.openjdk.java.net/jdk6/jdk6/corba/")
1129 (changeset "jdk6-b41")))
1130 (sha256
1131 (base32
1132 "1p9g1r9dnax2iwp7yb59qx7m4nmshqhwmrb2b8jj8zgbd9dl2i3q"))))
1133 ("langtools-src"
1134 ,(origin
1135 (method hg-fetch)
1136 (uri (hg-reference
1137 (url "http://hg.openjdk.java.net/jdk6/jdk6/langtools/")
1138 (changeset "jdk6-b41")))
1139 (sha256
1140 (base32
1141 "1x52wd67fynbbd9ild6fb4wvba3f5hhwk03qdjfazd0a1qr37z3d"))))
1142 ("jaxp-src"
1143 ,(origin
1144 (method hg-fetch)
1145 (uri (hg-reference
1146 (url "http://hg.openjdk.java.net/jdk6/jdk6/jaxp/")
1147 (changeset "jdk6-b41")))
1148 (sha256
1149 (base32
1150 "0shlqrvzpr4nrkmv215lbxnby63s3yvbdh1yxcayznsyqwa4nlxm"))))
1151 ("jaxws-src"
1152 ,(origin
1153 (method hg-fetch)
1154 (uri (hg-reference
1155 (url "http://hg.openjdk.java.net/jdk6/jdk6/jaxws/")
1156 (changeset "jdk6-b41")))
1157 (sha256
1158 (base32
1159 "0835lkw8vib1xhp8lxnybhlvzdh699hbi4mclxanydjk63zbpxk0"))))))
1160 (home-page "http://icedtea.classpath.org")
1161 (synopsis "Java development kit")
1162 (description
1163 "This package provides the OpenJDK built with the IcedTea build harness.
1164This version of the OpenJDK is no longer maintained and is only used for
1165bootstrapping purposes.")
1166 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
1167 ;; same license as both GNU Classpath and OpenJDK.
1168 (license license:gpl2+)))
1169
a243e12a 1170(define-public icedtea-7
7f6485e7 1171 (let* ((version "2.6.13")
f6789047
RW
1172 (drop (lambda (name hash)
1173 (origin
1174 (method url-fetch)
1175 (uri (string-append
d30ce4a7 1176 "http://icedtea.classpath.org/download/drops"
f6789047
RW
1177 "/icedtea7/" version "/" name ".tar.bz2"))
1178 (sha256 (base32 hash))))))
71053e14
RW
1179 (package
1180 (name "icedtea")
f6789047
RW
1181 (version version)
1182 (source (origin
1183 (method url-fetch)
1184 (uri (string-append
1185 "http://icedtea.wildebeest.org/download/source/icedtea-"
1186 version ".tar.xz"))
1187 (sha256
1188 (base32
7f6485e7 1189 "1w331rdqx1dcx2xb0fmjmrkdc71xqn20fxsgw8by4xhiblh88khh"))
f6789047
RW
1190 (modules '((guix build utils)))
1191 (snippet
6cbee49d
MW
1192 '(begin
1193 (substitute* "Makefile.in"
1194 ;; do not leak information about the build host
1195 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
1196 "DISTRIBUTION_ID=\"\\\"guix\\\"\""))
1197 #t))))
71053e14
RW
1198 (build-system gnu-build-system)
1199 (outputs '("out" ; Java Runtime Environment
1200 "jdk" ; Java Development Kit
1201 "doc")) ; all documentation
f6789047
RW
1202 (arguments
1203 `(;; There are many test failures. Some are known to
1204 ;; fail upstream, others relate to not having an X
1205 ;; server running at test time, yet others are a
1206 ;; complete mystery to me.
1207
1208 ;; hotspot: passed: 241; failed: 45; error: 2
1209 ;; langtools: passed: 1,934; failed: 26
1210 ;; jdk: unknown
1211 #:tests? #f
71053e14
RW
1212
1213 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
1214 ;; gremlin) doesn't support it yet, so skip this phase.
1215 #:validate-runpath? #f
1216
f6789047
RW
1217 ;; Apparently, the C locale is needed for some of the tests.
1218 #:locale "C"
71053e14
RW
1219
1220 #:modules ((guix build utils)
1221 (guix build gnu-build-system)
1222 (ice-9 match)
1223 (ice-9 popen)
71053e14
RW
1224 (srfi srfi-19)
1225 (srfi srfi-26))
1226
1227 #:configure-flags
e2098e2d
RW
1228 ;; TODO: package pcsc and sctp, and add to inputs
1229 `("--disable-system-pcsc"
1230 "--disable-system-sctp"
1231 "--enable-bootstrap"
1232 "--enable-nss"
1233 "--without-rhino"
1234 "--disable-downloading"
1235 "--disable-tests" ;they are run in the check phase instead
1236 "--with-openjdk-src-dir=./openjdk.src"
1237 ,(string-append "--with-jdk-home="
1238 (assoc-ref %build-inputs "jdk")))
71053e14
RW
1239
1240 #:phases
1241 (modify-phases %standard-phases
1242 (replace 'unpack
1243 (lambda* (#:key source inputs #:allow-other-keys)
1244 (let ((target (string-append "icedtea-" ,version))
1245 (unpack (lambda* (name #:optional dir)
1246 (let ((dir (or dir
1247 (string-drop-right name 5))))
1248 (mkdir dir)
2c8ac364
MW
1249 (invoke "tar" "xvf"
1250 (assoc-ref inputs name)
1251 "-C" dir
1252 "--strip-components=1")))))
71053e14 1253 (mkdir target)
2c8ac364
MW
1254 (invoke "tar" "xvf" source
1255 "-C" target "--strip-components=1")
1256 (chdir target)
1257 (unpack "openjdk-src" "openjdk.src")
1258 (with-directory-excursion "openjdk.src"
1259 (for-each unpack
1260 (filter (cut string-suffix? "-drop" <>)
1261 (map (match-lambda
1262 ((name . _) name))
1263 inputs))))
1264 #t)))
6b7e09ae
RW
1265 (add-after 'unpack 'patch-bitrot
1266 (lambda _
1267 (substitute* '("patches/boot/revert-6973616.patch"
1268 "openjdk.src/jdk/make/common/shared/Defs-versions.gmk")
1269 (("REQUIRED_FREETYPE_VERSION = 2.2.1")
1270 "REQUIRED_FREETYPE_VERSION = 2.10.1"))
1271 ;; As of attr 2.4.48 this header is no longer
1272 ;; included. It is provided by the libc instead.
1273 (substitute* '("configure"
1274 "openjdk.src/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c")
1275 (("attr/xattr.h") "sys/xattr.h"))
1276 #t))
71053e14
RW
1277 (add-after 'unpack 'fix-x11-extension-include-path
1278 (lambda* (#:key inputs #:allow-other-keys)
1279 (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
1280 (((string-append "\\$\\(firstword \\$\\(wildcard "
1281 "\\$\\(OPENWIN_HOME\\)"
1282 "/include/X11/extensions\\).*$"))
1283 (string-append (assoc-ref inputs "libxrender")
1284 "/include/X11/extensions"
1285 " -I" (assoc-ref inputs "libxtst")
1286 "/include/X11/extensions"
1287 " -I" (assoc-ref inputs "libxinerama")
1288 "/include/X11/extensions"))
1289 (("\\$\\(wildcard /usr/include/X11/extensions\\)\\)") ""))
1290 #t))
1291 (add-after 'unpack 'patch-paths
1292 (lambda _
1293 ;; buildtree.make generates shell scripts, so we need to replace
1294 ;; the generated shebang
1295 (substitute* '("openjdk.src/hotspot/make/linux/makefiles/buildtree.make")
1296 (("/bin/sh") (which "bash")))
1297
1298 (let ((corebin (string-append
1299 (assoc-ref %build-inputs "coreutils") "/bin/"))
1300 (binbin (string-append
1301 (assoc-ref %build-inputs "binutils") "/bin/"))
1302 (grepbin (string-append
1303 (assoc-ref %build-inputs "grep") "/bin/")))
1304 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
1305 "openjdk.src/corba/make/common/shared/Defs-linux.gmk")
1306 (("UNIXCOMMAND_PATH = /bin/")
1307 (string-append "UNIXCOMMAND_PATH = " corebin))
1308 (("USRBIN_PATH = /usr/bin/")
1309 (string-append "USRBIN_PATH = " corebin))
1310 (("DEVTOOLS_PATH *= */usr/bin/")
1311 (string-append "DEVTOOLS_PATH = " corebin))
1312 (("COMPILER_PATH *= */usr/bin/")
1313 (string-append "COMPILER_PATH = "
1314 (assoc-ref %build-inputs "gcc") "/bin/"))
1315 (("DEF_OBJCOPY *=.*objcopy")
1316 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
1317
1318 ;; fix path to alsa header
1319 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
1320 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
1321 (string-append "ALSA_INCLUDE="
1322 (assoc-ref %build-inputs "alsa-lib")
1323 "/include/alsa/version.h")))
1324
1325 ;; fix hard-coded utility paths
1326 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-utils.gmk"
1327 "openjdk.src/corba/make/common/shared/Defs-utils.gmk")
1328 (("ECHO *=.*echo")
1329 (string-append "ECHO = " (which "echo")))
1330 (("^GREP *=.*grep")
1331 (string-append "GREP = " (which "grep")))
1332 (("EGREP *=.*egrep")
1333 (string-append "EGREP = " (which "egrep")))
1334 (("CPIO *=.*cpio")
1335 (string-append "CPIO = " (which "cpio")))
1336 (("READELF *=.*readelf")
1337 (string-append "READELF = " (which "readelf")))
1338 (("^ *AR *=.*ar")
1339 (string-append "AR = " (which "ar")))
1340 (("^ *TAR *=.*tar")
1341 (string-append "TAR = " (which "tar")))
1342 (("AS *=.*as")
1343 (string-append "AS = " (which "as")))
1344 (("LD *=.*ld")
1345 (string-append "LD = " (which "ld")))
1346 (("STRIP *=.*strip")
1347 (string-append "STRIP = " (which "strip")))
1348 (("NM *=.*nm")
1349 (string-append "NM = " (which "nm")))
1350 (("^SH *=.*sh")
1351 (string-append "SH = " (which "bash")))
1352 (("^FIND *=.*find")
1353 (string-append "FIND = " (which "find")))
1354 (("LDD *=.*ldd")
1355 (string-append "LDD = " (which "ldd")))
1356 (("NAWK *=.*(n|g)awk")
1357 (string-append "NAWK = " (which "gawk")))
1358 (("XARGS *=.*xargs")
1359 (string-append "XARGS = " (which "xargs")))
1360 (("UNZIP *=.*unzip")
1361 (string-append "UNZIP = " (which "unzip")))
1362 (("ZIPEXE *=.*zip")
1363 (string-append "ZIPEXE = " (which "zip")))
1364 (("SED *=.*sed")
1365 (string-append "SED = " (which "sed"))))
1366
1367 ;; Some of these timestamps cause problems as they are more than
1368 ;; 10 years ago, failing the build process.
1369 (substitute*
1370 "openjdk.src/jdk/src/share/classes/java/util/CurrencyData.properties"
1371 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
1372 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
1373 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
1374 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY")))
1375 #t))
1376 (add-before 'configure 'set-additional-paths
1377 (lambda* (#:key inputs #:allow-other-keys)
e2098e2d
RW
1378 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
1379 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
1380 (string-append "ALSA_INCLUDE="
1381 (assoc-ref inputs "alsa-lib")
1382 "/include/alsa/version.h")))
1383 (setenv "CC" "gcc")
1384 (setenv "CPATH"
1385 (string-append (assoc-ref inputs "libxcomposite")
1386 "/include/X11/extensions" ":"
1387 (assoc-ref inputs "libxrender")
1388 "/include/X11/extensions" ":"
1389 (assoc-ref inputs "libxtst")
1390 "/include/X11/extensions" ":"
1391 (assoc-ref inputs "libxinerama")
1392 "/include/X11/extensions" ":"
1393 (or (getenv "CPATH") "")))
1394 (setenv "ALT_OBJCOPY" (which "objcopy"))
1395 (setenv "ALT_CUPS_HEADERS_PATH"
1396 (string-append (assoc-ref inputs "cups")
1397 "/include"))
1398 (setenv "ALT_FREETYPE_HEADERS_PATH"
1399 (string-append (assoc-ref inputs "freetype")
1400 "/include"))
1401 (setenv "ALT_FREETYPE_LIB_PATH"
1402 (string-append (assoc-ref inputs "freetype")
1403 "/lib"))
71053e14 1404 #t))
59199e1a
GB
1405 (add-before 'build 'disable-os-version-check
1406 ;; allow build on linux major version change
1407 (lambda _
1408 (setenv "DISABLE_HOTSPOT_OS_VERSION_CHECK" "ok")
1409 #t))
71053e14
RW
1410 (add-before 'check 'fix-test-framework
1411 (lambda _
1412 ;; Fix PATH in test environment
1413 (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
1414 (("PATH=/bin:/usr/bin")
1415 (string-append "PATH=" (getenv "PATH"))))
1416 (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
1417 (("/usr/bin/env") (which "env")))
1418 (substitute* "openjdk.src/hotspot/test/test_env.sh"
1419 (("/bin/rm") (which "rm"))
1420 (("/bin/cp") (which "cp"))
1421 (("/bin/mv") (which "mv")))
1422 #t))
1423 (add-before 'check 'fix-hotspot-tests
1424 (lambda _
1425 (with-directory-excursion "openjdk.src/hotspot/test/"
1426 (substitute* "jprt.config"
1427 (("PATH=\"\\$\\{path4sdk\\}\"")
1428 (string-append "PATH=" (getenv "PATH")))
1429 (("make=/usr/bin/make")
1430 (string-append "make=" (which "make"))))
1431 (substitute* '("runtime/6626217/Test6626217.sh"
1432 "runtime/7110720/Test7110720.sh")
1433 (("/bin/rm") (which "rm"))
1434 (("/bin/cp") (which "cp"))
1435 (("/bin/mv") (which "mv"))))
1436 #t))
1437 (add-before 'check 'fix-jdk-tests
1438 (lambda _
1439 (with-directory-excursion "openjdk.src/jdk/test/"
1440 (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
1441 (("/bin/pwd") (which "pwd")))
1442 (substitute* "com/sun/jdi/ShellScaffold.sh"
1443 (("/bin/kill") (which "kill")))
1444 (substitute* "start-Xvfb.sh"
1445 ;;(("/usr/bin/X11/Xvfb") (which "Xvfb"))
1446 (("/usr/bin/nohup") (which "nohup")))
1447 (substitute* "javax/security/auth/Subject/doAs/Test.sh"
1448 (("/bin/rm") (which "rm")))
1449 (substitute* "tools/launcher/MultipleJRE.sh"
1450 (("echo \"#!/bin/sh\"")
1451 (string-append "echo \"#!" (which "rm") "\""))
1452 (("/usr/bin/zip") (which "zip")))
1453 (substitute* "com/sun/jdi/OnThrowTest.java"
1454 (("#!/bin/sh") (string-append "#!" (which "sh"))))
1455 (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
1456 (("/usr/bin/uptime") (which "uptime")))
1457 (substitute* "java/lang/ProcessBuilder/Basic.java"
1458 (("/usr/bin/env") (which "env"))
1459 (("/bin/false") (which "false"))
1460 (("/bin/true") (which "true"))
1461 (("/bin/cp") (which "cp"))
1462 (("/bin/sh") (which "sh")))
1463 (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
1464 (("/bin/sh") (which "sh")))
1465 (substitute* "java/lang/ProcessBuilder/Zombies.java"
1466 (("/usr/bin/perl") (which "perl"))
1467 (("/bin/ps") (which "ps"))
1468 (("/bin/true") (which "true")))
1469 (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
1470 (("/usr/bin/tee") (which "tee")))
1471 (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
1472 (("/bin/true") (which "true")))
1473 (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
1474 (("/bin/cat") (which "cat")))
1475 (substitute* "java/lang/Runtime/exec/ExitValue.java"
1476 (("/bin/sh") (which "sh"))
1477 (("/bin/true") (which "true"))
1478 (("/bin/kill") (which "kill")))
1479 (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
1480 (("/usr/bin/echo") (which "echo")))
1481 (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
1482 (("/usr/bin/cat") (which "cat")))
1483 (substitute* "java/lang/Runtime/exec/SleepyCat.java"
1484 (("/bin/cat") (which "cat"))
1485 (("/bin/sleep") (which "sleep"))
1486 (("/bin/sh") (which "sh")))
1487 (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
1488 (("/bin/cat") (which "cat")))
1489 (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
1490 (("/bin/chmod") (which "chmod")))
1491 (substitute* "java/util/zip/ZipFile/Assortment.java"
1492 (("/bin/sh") (which "sh"))))
1493 #t))
1494 (replace 'check
1495 (lambda _
1496 ;; The "make check-*" targets always return zero, so we need to
1497 ;; check for errors in the associated log files to determine
1498 ;; whether any tests have failed.
1499 (use-modules (ice-9 rdelim))
1500 (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
1501 (checker (lambda (port)
1502 (let loop ()
1503 (let ((line (read-line port)))
1504 (cond
1505 ((eof-object? line) #t)
2c8ac364
MW
1506 ((regexp-exec error-pattern line)
1507 (error "test failed"))
71053e14
RW
1508 (else (loop)))))))
1509 (run-test (lambda (test)
2c8ac364 1510 (invoke "make" test)
71053e14
RW
1511 (call-with-input-file
1512 (string-append "test/" test ".log")
1513 checker))))
2c8ac364
MW
1514 (when #f ; skip tests
1515 (run-test "check-hotspot")
1516 (run-test "check-langtools")
fa41a089
MW
1517 (run-test "check-jdk"))
1518 #t)))
71053e14
RW
1519 (replace 'install
1520 (lambda* (#:key outputs #:allow-other-keys)
1521 (let ((doc (string-append (assoc-ref outputs "doc")
1522 "/share/doc/icedtea"))
1523 (jre (assoc-ref outputs "out"))
1524 (jdk (assoc-ref outputs "jdk")))
1525 (copy-recursively "openjdk.build/docs" doc)
1526 (copy-recursively "openjdk.build/j2re-image" jre)
1527 (copy-recursively "openjdk.build/j2sdk-image" jdk))
1528 #t))
491dc2fb
RJ
1529 ;; Some of the libraries in the lib/amd64 folder link to libjvm.so.
1530 ;; But that shared object is located in the server/ folder, so it
1531 ;; cannot be found. This phase creates a symbolic link in the
1532 ;; lib/amd64 folder so that the other libraries can find it.
1533 ;;
1534 ;; See:
1535 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1536 ;;
1537 ;; FIXME: Find the bug in the build system, so that this symlink is
1538 ;; not needed.
1539 (add-after 'install 'install-libjvm
1540 (lambda* (#:key inputs outputs #:allow-other-keys)
1541 (let* ((lib-path (string-append (assoc-ref outputs "out")
d3e22bcc
LC
1542 ;; See 'INSTALL_ARCH_DIR' in
1543 ;; 'configure'.
1b6f99ea
RW
1544 ,(match (%current-system)
1545 ("i686-linux"
048d21a8 1546 "/lib/i386")
1b6f99ea 1547 ("x86_64-linux"
048d21a8 1548 "/lib/amd64")
d3e22bcc 1549 ("armhf-linux"
048d21a8 1550 "/lib/arm")
d3e22bcc 1551 ("aarch64-linux"
41763008
EF
1552 "/lib/aarch64")
1553 ;; We need a catch-all, dropping
1554 ;; '-linux' works in most cases.
1555 (_
1556 (string-append
1557 "/lib/"
1558 (string-drop-right
1559 (%current-system) 6)))))))
491dc2fb
RJ
1560 (symlink (string-append lib-path "/server/libjvm.so")
1561 (string-append lib-path "/libjvm.so")))
1562 #t))
71053e14
RW
1563 ;; By default IcedTea only generates an empty keystore. In order to
1564 ;; be able to use certificates in Java programs we need to generate a
1565 ;; keystore from a set of certificates. For convenience we use the
1566 ;; certificates from the nss-certs package.
1567 (add-after 'install 'install-keystore
1568 (lambda* (#:key inputs outputs #:allow-other-keys)
1569 (let* ((keystore "cacerts")
1570 (certs-dir (string-append (assoc-ref inputs "nss-certs")
1571 "/etc/ssl/certs"))
1572 (keytool (string-append (assoc-ref outputs "jdk")
1573 "/bin/keytool")))
1574 (define (extract-cert file target)
1575 (call-with-input-file file
1576 (lambda (in)
1577 (call-with-output-file target
1578 (lambda (out)
1579 (let loop ((line (read-line in 'concat))
1580 (copying? #f))
1581 (cond
1582 ((eof-object? line) #t)
1583 ((string-prefix? "-----BEGIN" line)
1584 (display line out)
1585 (loop (read-line in 'concat) #t))
1586 ((string-prefix? "-----END" line)
1587 (display line out)
1588 #t)
1589 (else
1590 (when copying? (display line out))
1591 (loop (read-line in 'concat) copying?)))))))))
1592 (define (import-cert cert)
1593 (format #t "Importing certificate ~a\n" (basename cert))
1594 (let ((temp "tmpcert"))
1595 (extract-cert cert temp)
1596 (let ((port (open-pipe* OPEN_WRITE keytool
1597 "-import"
1598 "-alias" (basename cert)
1599 "-keystore" keystore
1600 "-storepass" "changeit"
1601 "-file" temp)))
1602 (display "yes\n" port)
1603 (when (not (zero? (status:exit-val (close-pipe port))))
1604 (format #t "failed to import ~a\n" cert)))
1605 (delete-file temp)))
1606
1607 ;; This is necessary because the certificate directory contains
1608 ;; files with non-ASCII characters in their names.
1609 (setlocale LC_ALL "en_US.utf8")
1610 (setenv "LC_ALL" "en_US.utf8")
1611
1612 (for-each import-cert (find-files certs-dir "\\.pem$"))
1613 (mkdir-p (string-append (assoc-ref outputs "out")
1614 "/lib/security"))
1615 (mkdir-p (string-append (assoc-ref outputs "jdk")
1616 "/jre/lib/security"))
1617
1618 ;; The cacerts files we are going to overwrite are chmod'ed as
1619 ;; read-only (444) in icedtea-8 (which derives from this
1620 ;; package). We have to change this so we can overwrite them.
1621 (chmod (string-append (assoc-ref outputs "out")
1622 "/lib/security/" keystore) #o644)
1623 (chmod (string-append (assoc-ref outputs "jdk")
1624 "/jre/lib/security/" keystore) #o644)
1625
1626 (install-file keystore
1627 (string-append (assoc-ref outputs "out")
1628 "/lib/security"))
1629 (install-file keystore
1630 (string-append (assoc-ref outputs "jdk")
1631 "/jre/lib/security"))
1632 #t))))))
f6789047 1633 (native-inputs
d9148890 1634 `(("openjdk-src"
f6789047 1635 ,(drop "openjdk"
7f6485e7 1636 "0l34ikyf62hbzlf9032alzkkqvf7bpmckz4gvirvph755w7gka8l"))
f6789047
RW
1637 ("corba-drop"
1638 ,(drop "corba"
7f6485e7 1639 "050gv2jbg1pi6qkn8w18bwpbklfa5b0kymjvan9pncddbj8m84fz"))
f6789047
RW
1640 ("jaxp-drop"
1641 ,(drop "jaxp"
7f6485e7 1642 "1k6yldwnxfzdg5926r1nlfv8d1r1j7rlp2nkz6gqh05vgyamnfhl"))
f6789047
RW
1643 ("jaxws-drop"
1644 ,(drop "jaxws"
7f6485e7 1645 "110j7jlz47x2gg6f7653x12mssan5kvj9l9h1m1c8c92drfxbqyk"))
f6789047
RW
1646 ("jdk-drop"
1647 ,(drop "jdk"
7f6485e7 1648 "0d1mca38ksxvdskp9im3pp7fdijhj1n3lwq9w13r9s4v3qyskgdd"))
f6789047
RW
1649 ("langtools-drop"
1650 ,(drop "langtools"
7f6485e7 1651 "0nq5236fzxn3p6x8cgncl56mzcmsj07q9gymysnws4c8byc6n0qj"))
f6789047 1652 ("hotspot-drop"
db024183
GB
1653 ,(origin
1654 (method url-fetch)
1655 (uri (string-append
1656 "http://icedtea.classpath.org/downloads/drops"
1657 "/icedtea7/" version "/hotspot.tar.bz2"))
1658 (sha256
1659 (base32
1660 "17bdv39n4lh8l5737c96f3xgamx4y305m067p01cywgp7zaddqws"))
1661 (patches (search-patches
1662 "icedtea-7-hotspot-gcc-segfault-workaround.patch"))))
e2098e2d 1663 ("ant" ,ant-bootstrap)
71053e14 1664 ("attr" ,attr)
71053e14
RW
1665 ("coreutils" ,coreutils)
1666 ("diffutils" ,diffutils) ;for tests
1667 ("gawk" ,gawk)
1668 ("grep" ,grep)
1669 ("libtool" ,libtool)
1670 ("pkg-config" ,pkg-config)
1671 ("wget" ,wget)
1672 ("which" ,which)
1673 ("cpio" ,cpio)
1674 ("zip" ,zip)
1675 ("unzip" ,unzip)
1676 ("fastjar" ,fastjar)
1677 ("libxslt" ,libxslt) ;for xsltproc
1678 ("nss-certs" ,nss-certs)
1679 ("perl" ,perl)
1680 ("procps" ,procps) ;for "free", even though I'm not sure we should use it
e2098e2d 1681 ("jdk" ,icedtea-6 "jdk")))
b711df02 1682 (inputs
71053e14
RW
1683 `(("alsa-lib" ,alsa-lib)
1684 ("cups" ,cups)
1685 ("libx11" ,libx11)
1686 ("libxcomposite" ,libxcomposite)
1687 ("libxt" ,libxt)
1688 ("libxtst" ,libxtst)
1689 ("libxi" ,libxi)
1690 ("libxinerama" ,libxinerama)
1691 ("libxrender" ,libxrender)
4bd428a7 1692 ("libjpeg" ,libjpeg-turbo)
71053e14
RW
1693 ("libpng" ,libpng)
1694 ("mit-krb5" ,mit-krb5)
1695 ("nss" ,nss)
1696 ("giflib" ,giflib)
1697 ("fontconfig" ,fontconfig)
1698 ("freetype" ,freetype)
1699 ("lcms" ,lcms)
1700 ("zlib" ,zlib)
1701 ("gtk" ,gtk+-2)))
1702 (home-page "http://icedtea.classpath.org")
1703 (synopsis "Java development kit")
1704 (description
1705 "This package provides the Java development kit OpenJDK built with the
1706IcedTea build harness.")
d3e22bcc
LC
1707
1708 ;; 'configure' lists "mips" and "mipsel", but not "mips64el'.
1709 (supported-systems (delete "mips64el-linux" %supported-systems))
1710
71053e14
RW
1711 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
1712 ;; same license as both GNU Classpath and OpenJDK.
1713 (license license:gpl2+))))
d2540f80 1714
349a3147 1715(define-public icedtea-8
1d97d8ff 1716 (let* ((version "3.7.0")
349a3147
RW
1717 (drop (lambda (name hash)
1718 (origin
1719 (method url-fetch)
1720 (uri (string-append
db531f73 1721 "http://icedtea.classpath.org/download/drops"
349a3147
RW
1722 "/icedtea8/" version "/" name ".tar.xz"))
1723 (sha256 (base32 hash))))))
1724 (package (inherit icedtea-7)
1d97d8ff 1725 (version "3.7.0")
349a3147
RW
1726 (source (origin
1727 (method url-fetch)
1728 (uri (string-append
1729 "http://icedtea.wildebeest.org/download/source/icedtea-"
1730 version ".tar.xz"))
1731 (sha256
1732 (base32
1d97d8ff 1733 "09yqzn8rpccs7cyv89hhy5zlznpgqw5x3jz0w1ccp0cz1vgs8l5w"))
349a3147
RW
1734 (modules '((guix build utils)))
1735 (snippet
0c729ef4 1736 '(begin
f2785bd6
RW
1737 (substitute* '("configure"
1738 "acinclude.m4")
0c729ef4
RW
1739 ;; Do not embed build time
1740 (("(DIST_ID=\"Custom build).*$" _ prefix)
1741 (string-append prefix "\"\n"))
1742 ;; Do not leak information about the build host
1743 (("DIST_NAME=\"\\$build_os\"")
1744 "DIST_NAME=\"guix\""))
1745 #t))))
349a3147 1746 (arguments
f2785bd6
RW
1747 `(#:imported-modules
1748 ((guix build ant-build-system)
1749 (guix build syscalls)
1750 ,@%gnu-build-system-modules)
1751 ,@(substitute-keyword-arguments (package-arguments icedtea-7)
1752 ((#:modules modules)
1753 `((guix build utils)
1754 (guix build gnu-build-system)
1755 ((guix build ant-build-system) #:prefix ant:)
1756 (ice-9 match)
1757 (ice-9 popen)
1758 (srfi srfi-19)
1759 (srfi srfi-26)))
1760 ((#:configure-flags flags)
1761 `(let ((jdk (assoc-ref %build-inputs "jdk")))
1762 `( ;;"--disable-bootstrap"
1763 "--enable-bootstrap"
1764 "--enable-nss"
1765 "--disable-downloading"
1766 "--disable-system-pcsc"
1767 "--disable-system-sctp"
1768 "--disable-tests" ;they are run in the check phase instead
1769 "--with-openjdk-src-dir=./openjdk.src"
1770 ,(string-append "--with-jdk-home=" jdk))))
1771 ((#:phases phases)
1772 `(modify-phases ,phases
1773 (delete 'fix-x11-extension-include-path)
1774 (delete 'patch-paths)
1775 (delete 'set-additional-paths)
1776 (delete 'patch-patches)
6b7e09ae 1777 (delete 'patch-bitrot)
f2785bd6
RW
1778 ;; Prevent the keytool from recording the current time when
1779 ;; adding certificates at build time.
1780 (add-after 'unpack 'patch-keystore
1781 (lambda _
1782 (substitute* "openjdk.src/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java"
1783 (("date = new Date\\(\\);")
1784 "\
1785date = (System.getenv(\"SOURCE_DATE_EPOCH\") != null) ?\
1786new Date(Long.parseLong(System.getenv(\"SOURCE_DATE_EPOCH\"))) :\
1787new Date();"))
1788 #t))
1789 (add-after 'unpack 'patch-jni-libs
1790 ;; Hardcode dynamically loaded libraries.
1791 (lambda _
1792 (let* ((library-path (search-path-as-string->list
1793 (getenv "LIBRARY_PATH")))
1794 (find-library (lambda (name)
1795 (search-path
1796 library-path
1797 (string-append "lib" name ".so")))))
1798 (for-each
1799 (lambda (file)
1800 (catch 'decoding-error
1801 (lambda ()
1802 (substitute* file
1803 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
1804 _ name version)
1805 (format #f "\"~a\"" (find-library name)))
1806 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
1807 (format #f "\"~a\"" (find-library name)))))
1808 (lambda _
1809 ;; Those are safe to skip.
1810 (format (current-error-port)
1811 "warning: failed to substitute: ~a~%"
1812 file))))
1813 (find-files "openjdk.src/jdk/src/solaris/native"
1814 "\\.c|\\.h"))
1815 #t)))
1816 (replace 'install
1817 (lambda* (#:key outputs #:allow-other-keys)
1818 (let ((doc (string-append (assoc-ref outputs "doc")
1819 "/share/doc/icedtea"))
1820 (jre (assoc-ref outputs "out"))
1821 (jdk (assoc-ref outputs "jdk")))
1822 (copy-recursively "openjdk.build/docs" doc)
1823 (copy-recursively "openjdk.build/images/j2re-image" jre)
1824 (copy-recursively "openjdk.build/images/j2sdk-image" jdk)
1825 ;; Install the nss.cfg file to JRE to enable SSL/TLS
1826 ;; support via NSS.
1827 (copy-file (string-append jdk "/jre/lib/security/nss.cfg")
1828 (string-append jre "/lib/security/nss.cfg"))
1829 #t)))
1830 (add-after 'install 'strip-jar-timestamps
1831 (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))))
349a3147
RW
1832 (native-inputs
1833 `(("jdk" ,icedtea-7 "jdk")
1834 ("openjdk-src"
1835 ,(drop "openjdk"
1d97d8ff 1836 "1mj6xgmw31i6qd30qi9dmv7160fbcfq5ikz1jwjihdg2793il19p"))
12eecbf0
LF
1837 ("aarch32-drop"
1838 ,(drop "aarch32"
1d97d8ff 1839 "1wb8k5zm40zld0986dvmlh5xh3gyixbg9h26sl662zy92amhmyyg"))
349a3147
RW
1840 ("corba-drop"
1841 ,(drop "corba"
1d97d8ff 1842 "11ma4zz0599cy70xd219v7a8vin7p96xrhhz3wsaw6cjhkzpagah"))
349a3147
RW
1843 ("jaxp-drop"
1844 ,(drop "jaxp"
1d97d8ff 1845 "14m1y0z0fbm5z5zjw3vnq85py8dma84bi3f9cw8rhdyc6skk8q4i"))
349a3147
RW
1846 ("jaxws-drop"
1847 ,(drop "jaxws"
1d97d8ff 1848 "09andnm6xaasnp963hgx42yiflifiljp9z7z85jrfyc5z8a5whmf"))
349a3147
RW
1849 ("jdk-drop"
1850 ,(drop "jdk"
1d97d8ff 1851 "0s6lcpc0zckz2fnq98aqf28nz9y3wbi41a3kyaqqa2abwbkm1zwl"))
349a3147
RW
1852 ("langtools-drop"
1853 ,(drop "langtools"
1d97d8ff 1854 "15wizy123vhk40chl1b4p552jf2pw2hdww0myf11qab425axz4nw"))
349a3147 1855 ("hotspot-drop"
673135df
GB
1856 ,(origin
1857 (method url-fetch)
1858 (uri (string-append
1859 "http://icedtea.classpath.org/download/drops"
1860 "/icedtea8/" version "/hotspot.tar.xz"))
1861 (sha256
1862 (base32
1863 "1ciz1w9j0kz7s1dxdhyqq71nla9icyz6qvn0b9z2zgkklqa98qmm"))
1864 (patches (search-patches
1865 "icedtea-7-hotspot-gcc-segfault-workaround.patch"))))
349a3147
RW
1866 ("nashorn-drop"
1867 ,(drop "nashorn"
1d97d8ff 1868 "19pzl3ppaw8j6r5cnyp8qiw3hxijh3hdc46l39g5yfhdl4pr4hpa"))
fd34d4f4
LF
1869 ("shenandoah-drop"
1870 ,(drop "shenandoah"
1d97d8ff 1871 "0k33anxdzw1icn072wynfmmdjhsv50hay0j1sfkfxny12rb3vgdy"))
349a3147 1872 ,@(fold alist-delete (package-native-inputs icedtea-7)
e2098e2d 1873 '("jdk" "openjdk-src" "corba-drop" "jaxp-drop" "jaxws-drop"
349a3147
RW
1874 "jdk-drop" "langtools-drop" "hotspot-drop")))))))
1875
dd741059
JL
1876(define-public openjdk9
1877 (package
1878 (name "openjdk")
1879 (version "9.181")
1880 (source (origin
1881 (method url-fetch)
1882 (uri "https://hg.openjdk.java.net/jdk/jdk/archive/3cc80be736f2.tar.bz2")
1883 (file-name (string-append name "-" version ".tar.bz2"))
1884 (sha256
1885 (base32
1886 "01ihmyf7k5z17wbr7xig7y40l9f01d5zjgkcmawn1102hw5kchpq"))
1887 (modules '((guix build utils)))
1888 (snippet
1889 `(begin
b7a1cac6
RW
1890 (for-each delete-file
1891 (find-files "." ".*.(bin|exe|jar)$"))
dd741059
JL
1892 #t))))
1893 (build-system gnu-build-system)
1894 (outputs '("out" "jdk" "doc"))
1895 (arguments
1896 `(#:tests? #f; require jtreg
f5789c26 1897 #:make-flags '("all")
dd741059
JL
1898 #:imported-modules
1899 ((guix build syscalls)
1900 ,@%gnu-build-system-modules)
1901 #:phases
1902 (modify-phases %standard-phases
1903 (add-after 'patch-source-shebangs 'fix-java-shebangs
1904 (lambda _
1905 ;; This file was "fixed" by patch-source-shebangs, but it requires
1906 ;; this exact first line.
1907 (substitute* "jdk/make/data/blacklistedcertsconverter/blacklisted.certs.pem"
1908 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))
1909 #t))
1910 (replace 'configure
1911 (lambda* (#:key inputs outputs #:allow-other-keys)
1912 ;; TODO: unbundle libpng and lcms
1913 (invoke "bash" "./configure"
1914 (string-append "--with-freetype=" (assoc-ref inputs "freetype"))
1915 "--disable-freetype-bundling"
1916 "--disable-warnings-as-errors"
1917 "--disable-hotspot-gtest"
1918 "--with-giflib=system"
1919 "--with-libjpeg=system"
1920 (string-append "--prefix=" (assoc-ref outputs "out")))
1921 #t))
f5789c26 1922 (add-before 'build 'write-source-revision-file
dd741059
JL
1923 (lambda _
1924 (with-output-to-file ".src-rev"
1925 (lambda _
1926 (display ,version)))
dd741059 1927 #t))
f5789c26
RW
1928 (replace 'build
1929 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
1930 (apply invoke "make"
1931 `(,@(if parallel-build?
1932 (list (string-append "JOBS="
1933 (number->string (parallel-job-count))))
1934 '())
1935 ,@make-flags))))
dd741059
JL
1936 ;; Some of the libraries in the lib/ folder link to libjvm.so.
1937 ;; But that shared object is located in the server/ folder, so it
1938 ;; cannot be found. This phase creates a symbolic link in the
1939 ;; lib/ folder so that the other libraries can find it.
1940 ;;
1941 ;; See:
1942 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1943 ;;
1944 ;; FIXME: Find the bug in the build system, so that this symlink is
1945 ;; not needed.
1946 (add-after 'install 'install-libjvm
1947 (lambda* (#:key inputs outputs #:allow-other-keys)
1948 (let* ((lib-out (string-append (assoc-ref outputs "out")
1949 "/lib"))
1950 (lib-jdk (string-append (assoc-ref outputs "jdk")
1951 "/lib")))
1952 (symlink (string-append lib-jdk "/server/libjvm.so")
1953 (string-append lib-jdk "/libjvm.so"))
1954 (symlink (string-append lib-out "/server/libjvm.so")
1955 (string-append lib-out "/libjvm.so")))
1956 #t))
1957 (replace 'install
1958 (lambda* (#:key outputs #:allow-other-keys)
1959 (let ((out (assoc-ref outputs "out"))
1960 (jdk (assoc-ref outputs "jdk"))
1961 (doc (assoc-ref outputs "doc"))
1962 (images (car (find-files "build" ".*-server-release"
1963 #:directories? #t))))
1964 (copy-recursively (string-append images "/images/jdk") jdk)
1965 (copy-recursively (string-append images "/images/jre") out)
1966 (copy-recursively (string-append images "/images/docs") doc))
1967 #t))
1968 (add-after 'install 'strip-zip-timestamps
1969 (lambda* (#:key outputs #:allow-other-keys)
1970 (use-modules (guix build syscalls))
1971 (for-each (lambda (zip)
1972 (let ((dir (mkdtemp! "zip-contents.XXXXXX")))
1973 (with-directory-excursion dir
1974 (invoke "unzip" zip))
1975 (delete-file zip)
1976 (for-each (lambda (file)
1977 (let ((s (lstat file)))
1978 (unless (eq? (stat:type s) 'symlink)
1979 (format #t "reset ~a~%" file)
1980 (utime file 0 0 0 0))))
1981 (find-files dir #:directories? #t))
1982 (with-directory-excursion dir
1983 (let ((files (find-files "." ".*" #:directories? #t)))
1984 (apply invoke "zip" "-0" "-X" zip files)))))
1985 (find-files (assoc-ref outputs "doc") ".*.zip$"))
1986 #t)))))
1987 (inputs
1988 `(("alsa-lib" ,alsa-lib)
1989 ("cups" ,cups)
1990 ("fontconfig" ,fontconfig)
1991 ("freetype" ,freetype)
1992 ("giflib" ,giflib)
1993 ("lcms" ,lcms)
1994 ("libelf" ,libelf)
4bd428a7 1995 ("libjpeg" ,libjpeg-turbo)
dd741059
JL
1996 ("libice" ,libice)
1997 ("libpng" ,libpng)
1998 ("libx11" ,libx11)
1999 ("libxcomposite" ,libxcomposite)
2000 ("libxi" ,libxi)
2001 ("libxinerama" ,libxinerama)
2002 ("libxrender" ,libxrender)
2003 ("libxt" ,libxt)
2004 ("libxtst" ,libxtst)))
2005 (native-inputs
2006 `(("icedtea-8" ,icedtea-8)
2007 ("icedtea-8:jdk" ,icedtea-8 "jdk")
f5789c26 2008 ;; XXX: The build system fails with newer versions of GNU Make.
5fd0c288 2009 ("make@4.2" ,gnu-make-4.2)
dd741059
JL
2010 ("unzip" ,unzip)
2011 ("which" ,which)
2012 ("zip" ,zip)))
2013 (home-page "https://openjdk.java.net/projects/jdk9/")
2014 (synopsis "Java development kit")
2015 (description
2016 "This package provides the Java development kit OpenJDK.")
2017 (license license:gpl2+)))
2018
16b89ecc
JL
2019(define-public openjdk10
2020 (package
2021 (inherit openjdk9)
2022 (name "openjdk")
2023 (version "10.46")
2024 (source (origin
2025 (method url-fetch)
2026 (uri "http://hg.openjdk.java.net/jdk/jdk/archive/6fa770f9f8ab.tar.bz2")
2027 (file-name (string-append name "-" version ".tar.bz2"))
2028 (sha256
2029 (base32
2030 "0zywq2203b4hx4jms9vbwvjcj1d3k2v3qpx4s33729fkpmid97r4"))
accb5c31
GB
2031 (patches (search-patches
2032 "openjdk-10-idlj-reproducibility.patch"))
16b89ecc
JL
2033 (modules '((guix build utils)))
2034 (snippet
2035 `(begin
49ad6aec 2036 (for-each delete-file (find-files "." ".*.(bin|exe|jar)$"))
16b89ecc
JL
2037 #t))))
2038 (arguments
2039 (substitute-keyword-arguments (package-arguments openjdk9)
2040 ((#:phases phases)
2041 `(modify-phases ,phases
2042 (replace 'fix-java-shebangs
2043 (lambda _
2044 ;; This file was "fixed" by patch-source-shebangs, but it requires
2045 ;; this exact first line.
2046 (substitute* "make/data/blacklistedcertsconverter/blacklisted.certs.pem"
2047 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))
2048 #t))
2049 (replace 'configure
2050 (lambda* (#:key inputs outputs #:allow-other-keys)
2051 (invoke "bash" "./configure"
2052 (string-append "--with-freetype=" (assoc-ref inputs "freetype"))
2053 "--disable-freetype-bundling"
2054 "--disable-warnings-as-errors"
2055 "--disable-hotspot-gtest"
2056 "--with-giflib=system"
2057 "--with-libjpeg=system"
2058 "--with-native-debug-symbols=zipped"
2059 (string-append "--prefix=" (assoc-ref outputs "out")))
2060 #t))))))
2061 (native-inputs
2062 `(("openjdk9" ,openjdk9)
2063 ("openjdk9:jdk" ,openjdk9 "jdk")
5fd0c288 2064 ("make@4.2" ,gnu-make-4.2)
16b89ecc
JL
2065 ("unzip" ,unzip)
2066 ("which" ,which)
2067 ("zip" ,zip)))))
2068
95bc85b7
GB
2069(define-public openjdk11
2070 (package
2071 (name "openjdk")
2072 (version "11.28")
2073 (source (origin
2074 (method url-fetch)
2075 (uri "http://hg.openjdk.java.net/jdk/jdk/archive/76072a077ee1.tar.bz2")
2076 (file-name (string-append name "-" version ".tar.bz2"))
2077 (sha256
2078 (base32
2079 "0v705w1s9lrqalzahir78pk397rkk9gfvzq821yv8h3xha0bqi6w"))
2080 (modules '((guix build utils)))
2081 (snippet
2082 `(begin
62d46ad6 2083 (for-each delete-file (find-files "." ".*.(bin|exe|jar)$"))
95bc85b7
GB
2084 #t))))
2085 (build-system gnu-build-system)
2086 (outputs '("out" "jdk" "doc"))
2087 (arguments
2088 `(#:imported-modules
2089 ((guix build syscalls)
2090 (ice-9 binary-ports)
2091 (rnrs bytevectors)
2092 ,@%gnu-build-system-modules)
2093 #:tests? #f; requires jtreg
2094 ;; TODO package jtreg
95bc85b7
GB
2095 #:configure-flags
2096 `("--disable-option-checking" ; --enable-fast-install default flag errors otherwise
2097 "--disable-warnings-as-errors"
2098 ;; make validate-runpath pass, see: http://issues.guix.info/issue/32894
2099 "--with-native-debug-symbols=zipped"
2100 ;; do not use the bundled libraries
2101 "--with-giflib=system"
2102 "--with-lcms=system"
2103 "--with-libjpeg=system"
2104 "--with-libpng=system"
70d23edf 2105 "--with-version-pre="
95bc85b7
GB
2106 ;; allow the build system to locate the system freetype
2107 ,(string-append "--with-freetype-include="
2108 (assoc-ref %build-inputs "freetype") "/include")
2109 ,(string-append "--with-freetype-lib="
2110 (assoc-ref %build-inputs "freetype") "/lib"))
95bc85b7
GB
2111 #:phases
2112 (modify-phases %standard-phases
2113 (add-after 'patch-source-shebangs 'fix-java-shebangs
2114 (lambda _
2115 ;; This file was "fixed" by patch-source-shebangs, but it requires
2116 ;; this exact first line.
2117 (substitute* "make/data/blacklistedcertsconverter/blacklisted.certs.pem"
2118 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))
2119 #t))
7b82e1cd 2120 (add-before 'build 'write-source-revision-file
95bc85b7
GB
2121 (lambda _
2122 (with-output-to-file ".src-rev"
2123 (lambda _
2124 (display ,version)))
95bc85b7 2125 #t))
7b82e1cd
RW
2126 (replace 'build
2127 (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
2128 (apply invoke "make" "all"
2129 `(,@(if parallel-build?
2130 (list (string-append "JOBS="
2131 (number->string (parallel-job-count))))
2132 '())
2133 ,@make-flags))))
95bc85b7
GB
2134 ;; jdk 11 does not build jre by default any more
2135 ;; building it anyways
2136 ;; for further information see:
2137 ;; https://github.com/AdoptOpenJDK/openjdk-build/issues/356
2138 (add-after 'build 'build-jre
7b82e1cd
RW
2139 (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
2140 (apply invoke "make" "legacy-jre-image"
2141 `(,@(if parallel-build?
2142 (list (string-append "JOBS="
2143 (number->string (parallel-job-count))))
2144 '())
2145 ,@make-flags))))
95bc85b7
GB
2146 (replace 'install
2147 (lambda* (#:key outputs #:allow-other-keys)
2148 (let ((out (assoc-ref outputs "out"))
2149 (jdk (assoc-ref outputs "jdk"))
2150 (doc (assoc-ref outputs "doc"))
2151 (images (car (find-files "build" ".*-server-release"
2152 #:directories? #t))))
2153 (copy-recursively (string-append images "/images/jdk") jdk)
2154 (copy-recursively (string-append images "/images/jre") out)
2155 (copy-recursively (string-append images "/images/docs") doc))
2156 #t))
2157 ;; Some of the libraries in the lib/ folder link to libjvm.so.
2158 ;; But that shared object is located in the server/ folder, so it
2159 ;; cannot be found. This phase creates a symbolic link in the
2160 ;; lib/ folder so that the other libraries can find it.
2161 ;;
2162 ;; See:
2163 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
2164 ;;
2165 ;; FIXME: Find the bug in the build system, so that this symlink is
2166 ;; not needed.
2167 (add-after 'install 'install-libjvm
2168 (lambda* (#:key inputs outputs #:allow-other-keys)
2169 (let* ((lib-out (string-append (assoc-ref outputs "out")
2170 "/lib"))
2171 (lib-jdk (string-append (assoc-ref outputs "jdk")
2172 "/lib")))
2173 (symlink (string-append lib-jdk "/server/libjvm.so")
2174 (string-append lib-jdk "/libjvm.so"))
2175 (symlink (string-append lib-out "/server/libjvm.so")
2176 (string-append lib-out "/libjvm.so")))
2177 #t))
2178 (add-after 'install 'strip-character-data-timestamps
2179 (lambda* (#:key outputs #:allow-other-keys)
2180 (use-modules (guix build syscalls))
2181 (let ((archive (string-append
2182 (assoc-ref outputs "jdk") "/lib/src.zip"))
2183 (dir (mkdtemp! "zip-contents.XXXXXX")))
2184 (with-directory-excursion dir
2185 (invoke "unzip" archive))
2186 (delete-file archive)
2187 (with-directory-excursion dir
2188 (let ((char-data-files (find-files "." "CharacterData.*")))
2189 (for-each (lambda (file)
2190 (substitute* file
2191 (((string-append "This file was generated "
2192 "AUTOMATICALLY from a template "
2193 "file.*"))
2194 (string-append "This file was generated "
2195 "AUTOMATICALLY from a template "
2196 "file"))))
2197 char-data-files)))
2198 (with-directory-excursion dir
2199 (let ((files (find-files "." ".*" #:directories? #t)))
2200 (apply invoke "zip" "-0" "-X" archive files))))))
2201 (add-after 'strip-character-data-timestamps 'strip-archive-timestamps
2202 (lambda* (#:key outputs #:allow-other-keys)
2203 (use-modules (guix build syscalls)
2204 (ice-9 binary-ports)
2205 (rnrs bytevectors))
2206 (letrec ((repack-archive
2207 (lambda (archive)
2208 (let ((dir (mkdtemp! "zip-contents.XXXXXX")))
2209 (with-directory-excursion dir
2210 (invoke "unzip" archive))
2211 (delete-file archive)
2212 (for-each (compose repack-archive canonicalize-path)
2213 (find-files dir "(ct.sym|.*.jar)$"))
2214 (let ((reset-file-timestamp
2215 (lambda (file)
2216 (let ((s (lstat file)))
2217 (unless (eq? (stat:type s) 'symlink)
2218 (format #t "reset ~a~%" file)
2219 (utime file 0 0 0 0))))))
2220 (for-each reset-file-timestamp
2221 (find-files dir #:directories? #t)))
2222 (with-directory-excursion dir
2223 (let ((files (find-files "." ".*" #:directories? #t)))
2224 (apply invoke "zip" "-0" "-X" archive files)))))))
2225 (for-each repack-archive
2226 (find-files (assoc-ref outputs "doc") ".*.zip$"))
2227 (for-each repack-archive
2228 (find-files (assoc-ref outputs "jdk")
2229 ".*.(zip|jar|diz)$"))
2230 (repack-archive (string-append (assoc-ref outputs "jdk") "/lib/ct.sym"))
2231 (let ((repack-jmod
2232 (lambda (file-name)
2233 (call-with-input-file file-name
2234 (lambda (file)
2235 (let ((header #vu8(#x4a #x4d #x01 #x00)))
2236 (if (equal? (get-bytevector-n
2237 file (bytevector-length header))
2238 header)
2239 (let* ((header-length (bytevector-length header))
2240 (temp-file (mkstemp!
2241 (string-copy
2242 "temp-file.XXXXXX")))
2243 (temp-filename (port-filename temp-file))
2244 (content-length
2245 (- (stat:size (stat file))
2246 header-length)))
2247 (sendfile temp-file file content-length header-length)
2248 (delete-file file-name)
2249 (close-port temp-file)
2250 (repack-archive (canonicalize-path temp-filename))
2251 (call-with-output-file file-name
2252 (lambda (file)
2253 (put-bytevector file header)
2254 (call-with-input-file temp-filename
2255 (lambda (temp-file)
2256 (sendfile
2257 file temp-file
2258 (stat:size (stat temp-file)) 0)))))))))))))
2259 (for-each repack-jmod
2260 (find-files (assoc-ref outputs "jdk") ".*.jmod$")))
2261 #t)))
2262 (add-after 'install 'remove-timestamp-from-api-summary
2263 (lambda* (#:key outputs #:allow-other-keys)
2264 (substitute* (string-append (assoc-ref outputs "doc")
2265 "/api/overview-summary.html")
2266 (("Generated by javadoc \\(11-internal\\).*$")
2267 "Generated by javadoc (11-internal) -->\n"))
2268 #t)))))
2269 (inputs
2270 `(("alsa-lib" ,alsa-lib)
2271 ("cups" ,cups)
2272 ("fontconfig" ,fontconfig)
2273 ("freetype" ,freetype)
2274 ("giflib" ,giflib)
2275 ("lcms" ,lcms)
4bd428a7 2276 ("libjpeg" ,libjpeg-turbo)
95bc85b7
GB
2277 ("libpng" ,libpng)
2278 ("libx11" ,libx11)
2279 ("libxext" ,libxext)
2280 ("libxrender" ,libxrender)
2281 ("libxt" ,libxt)
2282 ("libxtst" ,libxtst)))
2283 (native-inputs
2284 `(("autoconf" ,autoconf)
2285 ("openjdk10" ,openjdk10)
2286 ("openjdk10:jdk" ,openjdk10 "jdk")
5fd0c288 2287 ("make" ,gnu-make-4.2)
95bc85b7
GB
2288 ("pkg-config" ,pkg-config)
2289 ("unzip" ,unzip)
2290 ("which" ,which)
2291 ("zip" ,zip)))
2292 (home-page "https://openjdk.java.net/projects/jdk/11/")
2293 (synopsis "Java development kit")
2294 (description
2295 "This package provides the Java development kit OpenJDK.")
2296 (license license:gpl2+)))
2297
64dc8e9e
GB
2298(define-public openjdk12
2299 (package
2300 (inherit openjdk11)
2301 (name "openjdk")
2302 (version "12.33")
2303 (source (origin
2304 (method url-fetch)
2305 (uri "http://hg.openjdk.java.net/jdk/jdk/archive/0276cba45aac.tar.bz2")
2306 (file-name (string-append name "-" version ".tar.bz2"))
2307 (sha256
2308 (base32
2309 "0mbhdrk12b6878kby0flnbak7444dlpm0ihlmf92vk59y1c02bc2"))
2310 (modules '((guix build utils)))
2311 (snippet
2312 `(begin
c7c9370d 2313 (for-each delete-file (find-files "." ".*.(bin|exe|jar)$"))
64dc8e9e
GB
2314 #t))))
2315 (inputs
2316 `(("alsa-lib" ,alsa-lib)
2317 ("cups" ,cups)
2318 ("fontconfig" ,fontconfig)
2319 ("freetype" ,freetype)
2320 ("giflib" ,giflib)
2321 ("lcms" ,lcms)
4bd428a7 2322 ("libjpeg" ,libjpeg-turbo)
64dc8e9e
GB
2323 ("libpng" ,libpng)
2324 ("libx11" ,libx11)
2325 ("libxext" ,libxext)
2326 ("libxrandr" ,libxrandr)
2327 ("libxrender" ,libxrender)
2328 ("libxt" ,libxt)
2329 ("libxtst" ,libxtst)))
2330 (native-inputs
2331 `(("autoconf" ,autoconf)
2332 ("openjdk11" ,openjdk11)
2333 ("openjdk11:jdk" ,openjdk11 "jdk")
5fd0c288 2334 ("make@4.2" ,gnu-make-4.2)
64dc8e9e
GB
2335 ("pkg-config" ,pkg-config)
2336 ("unzip" ,unzip)
2337 ("which" ,which)
2338 ("zip" ,zip)))
2339 (home-page "https://openjdk.java.net/projects/jdk/12")))
2340
c4618174
NZ
2341(define-public openjdk13
2342 (package
2343 (inherit openjdk12)
2344 (name "openjdk")
2345 (version "13.0")
2346 (source (origin
2347 (method url-fetch)
2348 (uri "http://hg.openjdk.java.net/jdk/jdk13/archive/9c250a7600e1.tar.bz2")
2349 (file-name (string-append name "-" version ".tar.bz2"))
2350 (sha256
2351 (base32
2352 "0v0ljvx5dyzp96dw4z4ksw3pvasil7783mgnmd1wk9gads5ab8iq"))
2353 (modules '((guix build utils)))
2354 (snippet
2355 `(begin
2356 (for-each delete-file (find-files "." ".*.(bin|exe|jar)$"))
2357 #t))))
2358 (inputs
2359 `(("alsa-lib" ,alsa-lib)
2360 ("cups" ,cups)
2361 ("fontconfig" ,fontconfig)
2362 ("freetype" ,freetype)
2363 ("giflib" ,giflib)
2364 ("lcms" ,lcms)
2365 ("libjpeg" ,libjpeg-turbo)
2366 ("libpng" ,libpng)
2367 ("libx11" ,libx11)
2368 ("libxext" ,libxext)
2369 ("libxrandr" ,libxrandr)
2370 ("libxrender" ,libxrender)
2371 ("libxt" ,libxt)
2372 ("libxtst" ,libxtst)))
2373 (native-inputs
2374 `(("autoconf" ,autoconf)
2375 ("openjdk12:jdk" ,openjdk12 "jdk")
2376 ("make@4.2" ,gnu-make-4.2)
2377 ("pkg-config" ,pkg-config)
2378 ("unzip" ,unzip)
2379 ("which" ,which)
2380 ("zip" ,zip)))
2381 (home-page "https://openjdk.java.net/projects/jdk/13")))
2382
65a11a59
NZ
2383(define-public openjdk14
2384 (package
2385 (inherit openjdk13)
2386 (name "openjdk")
2387 (version "14.0")
2388 (source (origin
2389 (method url-fetch)
2390 (uri "http://hg.openjdk.java.net/jdk/jdk14/archive/bc54620a3848.tar.bz2")
2391 (file-name (string-append name "-" version ".tar.bz2"))
2392 (sha256
2393 (base32
2394 "0z485pk7r1xpw8004g4nrwrzj17sabgx8yfdbxwfvzkjp8qyajch"))
2395 (modules '((guix build utils)))
2396 (snippet
2397 `(begin
2398 ;; The m4 macro uses 'help' to search for builtins, which is
2399 ;; not available in bash-minimal
2400 (substitute* "make/autoconf/basics.m4"
2401 (("if help") "if command -v"))
2402 (for-each delete-file (find-files "." ".*.(bin|exe|jar)$"))
2403 #t))))
2404 (inputs
2405 `(("alsa-lib" ,alsa-lib)
2406 ("cups" ,cups)
2407 ("fontconfig" ,fontconfig)
2408 ("freetype" ,freetype)
2409 ("giflib" ,giflib)
2410 ("lcms" ,lcms)
2411 ("libjpeg" ,libjpeg-turbo)
2412 ("libpng" ,libpng)
2413 ("libx11" ,libx11)
2414 ("libxext" ,libxext)
2415 ("libxrandr" ,libxrandr)
2416 ("libxrender" ,libxrender)
2417 ("libxt" ,libxt)
2418 ("libxtst" ,libxtst)))
2419 (native-inputs
2420 `(("autoconf" ,autoconf)
2421 ("make@4.2" ,gnu-make-4.2)
2422 ("openjdk13:jdk" ,openjdk13 "jdk")
2423 ("pkg-config" ,pkg-config)
2424 ("unzip" ,unzip)
2425 ("which" ,which)
2426 ("zip" ,zip)))
2427 (home-page "https://openjdk.java.net/projects/jdk/14")))
2428
33aa65e0 2429(define-public icedtea icedtea-8)
068e476f 2430
5490480c 2431\f
8bbd0408
RW
2432(define-public ant/java8
2433 (package (inherit ant-bootstrap)
2434 (name "ant")
00848717 2435 (version "1.10.8")
8bbd0408
RW
2436 (source (origin
2437 (method url-fetch)
2438 (uri (string-append "mirror://apache/ant/source/apache-ant-"
2439 version "-src.tar.gz"))
2440 (sha256
2441 (base32
00848717 2442 "066k2isig5xm70cihj9p73hkp5w7h5zbfqz5kxb6cwr9cb86xl2k"))
8bbd0408
RW
2443 (modules '((guix build utils)))
2444 (snippet
2445 '(begin
2446 (for-each delete-file
2447 (find-files "lib/optional" "\\.jar$"))
2448 #t))))
2449 (arguments
2450 (substitute-keyword-arguments (package-arguments ant-bootstrap)
2451 ((#:phases phases)
2452 `(modify-phases ,phases
2453 (add-after 'unpack 'remove-scripts
2454 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
2455 ;; wrappers.
2456 (lambda _
2457 (for-each delete-file
2458 (find-files "src/script"
2459 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))
2460 #t))
2461 (replace 'build
2462 (lambda* (#:key inputs outputs #:allow-other-keys)
2463 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
2464
2465 ;; Disable tests to avoid dependency on hamcrest-core, which needs
2466 ;; Ant to build. This is necessary in addition to disabling the
2467 ;; "check" phase, because the dependency on "test-jar" would always
2468 ;; result in the tests to be run.
2469 (substitute* "build.xml"
00848717 2470 (("depends=\"jars,test-jar") "depends=\"jars"))
2c8ac364
MW
2471 (invoke "bash" "bootstrap.sh"
2472 (string-append "-Ddist.dir="
2473 (assoc-ref outputs "out")))))))))
8bbd0408 2474 (native-inputs
1c7ef07e
GB
2475 `(("jdk" ,icedtea-8 "jdk")
2476 ("zip" ,zip)
2477 ("unzip" ,unzip)))))
8bbd0408 2478
e441fc56
RW
2479;; The 1.9.x series is the last that can be built with GCJ. The 1.10.x series
2480;; requires Java 8.
2481(define-public ant
2482 (package (inherit ant/java8)
2039cf37 2483 (version "1.9.15")
e441fc56
RW
2484 (source (origin
2485 (method url-fetch)
2486 (uri (string-append "mirror://apache/ant/source/apache-ant-"
2487 version "-src.tar.gz"))
2488 (sha256
2489 (base32
2039cf37 2490 "1xy30f1w5gaqk6g3f0vw7ygix4rb6032qkcw42y4z8wd9jihgygd"))))
e441fc56 2491 (native-inputs
3b6ba18b
GB
2492 `(("jdk" ,icedtea-7 "jdk")
2493 ("zip" ,zip)
2494 ("unzip" ,unzip)))))
e441fc56 2495
9ce7ac99
RW
2496(define-public ant-apache-bcel
2497 (package
2498 (inherit ant/java8)
2499 (name "ant-apache-bcel")
2500 (arguments
2501 (substitute-keyword-arguments (package-arguments ant/java8)
2502 ((#:phases phases)
2503 `(modify-phases ,phases
2504 (add-after 'unpack 'link-bcel
2505 (lambda* (#:key inputs #:allow-other-keys)
2506 (for-each (lambda (file)
2507 (symlink file
2508 (string-append "lib/optional/"
2509 (basename file))))
2510 (find-files (assoc-ref inputs "java-commons-bcel")
2511 "\\.jar$"))
2512 #t))
2513 (add-after 'build 'install
2514 (lambda* (#:key outputs #:allow-other-keys)
2515 (let* ((out (assoc-ref outputs "out"))
2516 (share (string-append out "/share/java"))
2517 (bin (string-append out "/bin"))
2518 (lib (string-append out "/lib")))
2519 (mkdir-p share)
2520 (install-file (string-append lib "/ant-apache-bcel.jar") share)
2521 (delete-file-recursively bin)
2522 (delete-file-recursively lib)
2523 #t)))))))
2524 (inputs
2525 `(("java-commons-bcel" ,java-commons-bcel)
2526 ,@(package-inputs ant/java8)))))
2527
fa6c4213
RW
2528(define-public ant-junit
2529 (package
2530 (inherit ant/java8)
2531 (name "ant-junit")
2532 (arguments
2533 (substitute-keyword-arguments (package-arguments ant/java8)
2534 ((#:phases phases)
2535 `(modify-phases ,phases
2536 (add-after 'unpack 'link-junit
2537 (lambda* (#:key inputs #:allow-other-keys)
2538 (for-each (lambda (file)
2539 (symlink file
2540 (string-append "lib/optional/"
2541 (basename file))))
2542 (find-files (assoc-ref inputs "java-junit")
2543 "\\.jar$"))
2544 #t))
2545 (add-after 'build 'install
2546 (lambda* (#:key outputs #:allow-other-keys)
2547 (let* ((out (assoc-ref outputs "out"))
2548 (share (string-append out "/share/java"))
2549 (bin (string-append out "/bin"))
2550 (lib (string-append out "/lib")))
2551 (mkdir-p share)
2552 (install-file (string-append lib "/ant-junit.jar") share)
2553 (delete-file-recursively bin)
2554 (delete-file-recursively lib)
2555 #t)))))))
2556 (inputs
2557 `(("java-junit" ,java-junit)
2558 ,@(package-inputs ant/java8)))))
2559
7214fbd2
JL
2560(define-public java-openjfx-build
2561 (package
2562 (name "java-openjfx-build")
2563 ;; This is a java-8 version
2564 (version "8.202")
2565 (source (origin
2566 (method hg-fetch)
2567 (uri (hg-reference
c19293ad
AA
2568 (url "http://hg.openjdk.java.net/openjfx/8u-dev/rt")
2569 (changeset (string-append
2570 (string-join (string-split version #\.) "u")
2571 "-ga"))))
7214fbd2 2572 (file-name (string-append name "-" version "-checkout"))
2c2b1ef8
BH
2573 (modules '((guix build utils)))
2574 (snippet
2575 '(begin
2576 ;; Delete included gradle jar
2577 (delete-file-recursively "gradle/wrapper")
2578 #t))
7214fbd2
JL
2579 (sha256
2580 (base32
d9ef5aeb
AA
2581 "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))
2582 (patches (search-patches "java-openjfx-build-jdk_version.patch"))))
7214fbd2
JL
2583 (build-system ant-build-system)
2584 (arguments
2585 `(#:jar-name "java-openjfx.jar"
2586 #:source-dir "buildSrc/src/main/java"
2587 #:test-dir "buildSrc/src/test"
2588 #:phases
2589 (modify-phases %standard-phases
2590 (add-before 'configure 'generate-jsl-parser
2591 (lambda _
2592 (invoke "antlr3" "-o"
2593 "buildSrc/src/main/java/com/sun/scenario/effect/compiler"
2594 "buildSrc/src/main/antlr/JSL.g"))))))
2595 (inputs
2596 `(("antlr3" ,antlr3)
2597 ("java-stringtemplate" ,java-stringtemplate)))
2598 (native-inputs
2599 `(("java-junit" ,java-junit)
2600 ("java-hamcrest-core" ,java-hamcrest-core)))
2601 (home-page "https://openjfx.io")
2602 (synopsis "Graphical application toolkit in Java")
2603 (description "OpenJFX is a client application platform for desktop,
2604mobile and embedded systems built on Java. Its goal is to produce a
2605modern, efficient, and fully featured toolkit for developing rich client
2606applications. This package contains base classes for the OpenJFX
2607distribution and helper classes for building other parts of the
2608distribution.")
2609 (license license:gpl2))) ;gpl2 only, with classpath exception
2610
46f05439
JL
2611(define-public java-openjfx-base
2612 (package (inherit java-openjfx-build)
2613 (name "java-openjfx-base")
2614 (arguments
2615 `(#:jar-name "java-openjfx-base.jar"
2616 #:source-dir "modules/base/src/main/java:modules/base/src/main/java8:modules/base/src/main/version-info"
2617 #:test-dir "modules/base/src/test"
2618 #:phases
2619 (modify-phases %standard-phases
2620 (add-before 'check 'remove-empty-file
2621 (lambda _
2622 (with-directory-excursion "modules/base/src/test/java"
2623 ;; These files are completely commented, but junit expects them to
2624 ;; contain a class, so tests fail.
2625 (delete-file
2626 "com/sun/javafx/property/adapter/PropertyDescriptorTest.java")
2627 (delete-file
2628 "com/sun/javafx/property/adapter/ReadOnlyPropertyDescriptorTest.java")
2629 (delete-file "javafx/beans/property/PropertiesTest.java")
2630 (delete-file
2631 "javafx/beans/property/adapter/ReadOnlyJavaBeanPropertyBuilder_General_Test.java")
2632 ;; This one fails
2633 (delete-file "com/sun/javafx/runtime/VersionInfoTest.java"))
2634 #t)))))
2635 (propagated-inputs
2636 `(("java-openjfx-build" ,java-openjfx-build)))
2637 (description "OpenJFX is a client application platform for desktop,
2638mobile and embedded systems built on Java. Its goal is to produce a
2639modern, efficient, and fully featured toolkit for developing rich client
2640applications. This package contains base classes for the OpenJFX
2641distribution.")))
36f73d70
JL
2642
2643(define-public java-openjfx-graphics
2644 (package (inherit java-openjfx-build)
2645 (name "java-openjfx-graphics")
2646 (arguments
2647 `(#:jar-name "java-openjfx-graphics.jar"
2648 #:source-dir "modules/graphics/src/main/java"
2649 #:tests? #f; require X
2650 #:test-dir "modules/graphics/src/test"))
2651 (propagated-inputs
2652 `(("java-openjfx-base" ,java-openjfx-base)
2653 ("java-swt" ,java-swt)))
2654 (description "OpenJFX is a client application platform for desktop,
2655mobile and embedded systems built on Java. Its goal is to produce a
2656modern, efficient, and fully featured toolkit for developing rich client
2657applications. This package contains graphics-related classes for the
2658OpenJFX distribution.")))
68a13319
JL
2659
2660(define-public java-openjfx-media
2661 (package (inherit java-openjfx-build)
2662 (name "java-openjfx-media")
2663 (propagated-inputs
2664 `(("java-openjxf-graphics" ,java-openjfx-graphics)))
2665 (arguments
2666 `(#:jar-name "java-openjfx-media.jar"
2667 #:source-dir "modules/media/src/main/java"
2668 #:tests? #f)); no tests
2669 (description "OpenJFX is a client application platform for desktop,
2670mobile and embedded systems built on Java. Its goal is to produce a
2671modern, efficient, and fully featured toolkit for developing rich client
2672applications. This package contains media-related classes for the
2673OpenJFX distribution.")))
46f05439 2674
53fb0476 2675(define-public javacc-4
fc8d100b
RW
2676 (package
2677 (name "javacc")
53fb0476 2678 (version "4.1")
fc8d100b 2679 (source (origin
53fb0476
AV
2680 (method git-fetch)
2681 (uri (git-reference
b0e7b699 2682 (url "https://github.com/javacc/javacc")
53fb0476
AV
2683 (commit "release_41")))
2684 (file-name (string-append "javacc-" version "-checkout"))
fc8d100b
RW
2685 (sha256
2686 (base32
6662d65f
AV
2687 "07ysav7j8r1c6h8qxrgqk6lwdp74ly0ad1935lragxml0qqc3ka0"))
2688 (modules '((guix build utils)))
2689 ;; delete bundled jars
2690 (snippet '(begin (delete-file-recursively "lib") #t))))
fc8d100b 2691 (build-system ant-build-system)
53fb0476
AV
2692 ;; Tests fail with
2693 ;; /tmp/guix-build-javacc-4.1.drv-0/source/test/javacodeLA/build.xml:60:
2694 ;; JAVACODE failed
fc8d100b 2695 (arguments
53fb0476 2696 `(#:tests? #f
fc8d100b
RW
2697 #:phases
2698 (modify-phases %standard-phases
6662d65f
AV
2699 ;; Delete tests to avoid build failure (we don't run them anyway).
2700 (add-after 'unpack 'delete-tests
fc8d100b 2701 (lambda _
6662d65f
AV
2702 (for-each delete-file
2703 '("src/org/javacc/JavaCCTestCase.java"
2704 "src/org/javacc/parser/ExpansionTest.java"
2705 "src/org/javacc/parser/OptionsTest.java"
2706 "src/org/javacc/jjtree/JJTreeOptionsTest.java"))
2707 (for-each delete-file-recursively
2708 '("src/org/javacc/parser/test"
2709 "src/org/javacc/jjdoc/test"))
2710 #t))
53fb0476 2711 (replace 'install (install-jars "bin/lib")))))
fc8d100b
RW
2712 (home-page "https://javacc.org/")
2713 (synopsis "Java parser generator")
2714 (description "Java Compiler Compiler (JavaCC) is the most popular parser
2715generator for use with Java applications. A parser generator is a tool that
2716reads a grammar specification and converts it to a Java program that can
2717recognize matches to the grammar. In addition to the parser generator itself,
2718JavaCC provides other standard capabilities related to parser generation such
2719as tree building (via a tool called JJTree included with JavaCC), actions,
2720debugging, etc.")
2721 (license license:bsd-3)))
2722
aabaac7d
JL
2723;; javacc-3, as javacc-4 is not properly bootstrapped: is contains a javacc.jar
2724;; in the bootstrap/ directory.
2725(define-public javacc-3
2726 (package
2727 (inherit javacc-4)
2728 (version "3.2")
2729 (source (origin
2730 (method git-fetch)
2731 (uri (git-reference
2732 (url "https://github.com/javacc/javacc.git")
2733 (commit "release_32")))
2734 (file-name (string-append "javacc-" version "-checkout"))
2735 (sha256
2736 (base32
2737 "1pyf1xyh8gk83nxqn2v2mdws32l68ydznha41cxa4l2kkbq1v1g3"))))
2738 (arguments
2739 `(#:tests? #f
2740 #:phases
2741 (modify-phases %standard-phases
2742 (add-before 'build 'set-java-version
2743 (lambda _
2744 (for-each
2745 (lambda (file)
2746 (substitute* file
2747 (("debug=") "source=\"1.4\" debug=")))
2748 (find-files "." "build.xml"))
2749 #t))
2750 (replace 'install (install-jars "bin/lib")))))))
2751
53fb0476
AV
2752(define-public javacc
2753 (package
2754 (inherit javacc-4)
6b66e470 2755 (version "7.0.4")
ebf8048d
TGR
2756 (source
2757 (origin
2758 (method git-fetch)
2759 (uri (git-reference
b0e7b699 2760 (url "https://github.com/javacc/javacc")
ebf8048d
TGR
2761 (commit version)))
2762 (file-name (git-file-name "javacc" version))
2763 (sha256
2764 (base32 "18kkak3gda93gr25jrgy6q00g0jr8i24ri2wk4kybz1v234fxx9i"))
2765 (modules '((guix build utils)))
2766 ;; Delete bundled jars.
2767 (snippet '(begin (for-each delete-file-recursively
2768 '("bootstrap" "lib"))
2769 #t))))
6688c41e 2770 (arguments
6b66e470 2771 `(#:make-flags ; bootstrap from javacc-4
33428d12
AV
2772 (list (string-append "-Dbootstrap-jar="
2773 (assoc-ref %build-inputs "javacc")
2774 "/share/java/javacc.jar"))
2775 #:test-target "test"
6688c41e
RW
2776 #:phases
2777 (modify-phases %standard-phases
16fdf2f5
JL
2778 (replace 'install (install-jars "target"))
2779 (add-after 'install 'install-bin
2780 (lambda* (#:key outputs inputs #:allow-other-keys)
2781 (let* ((out (assoc-ref outputs "out"))
2782 (dir (string-append out "/share/java"))
2783 (bin (string-append out "/bin"))
2784 (javacc (string-append bin "/javacc")))
2785 (mkdir-p bin)
2786 (with-output-to-file javacc
2787 (lambda _
2788 (display
2789 (string-append "#!/bin/sh\n"
2790 (assoc-ref inputs "jdk") "/bin/java"
2791 " -cp " dir "/javacc.jar" " `basename $0`" " $*"))))
2792 (chmod javacc #o755)
2793 ;; symlink to different names to affect the first argument and
2794 ;; change the behavior of the jar file.
2795 (symlink javacc (string-append bin "/jjdoc"))
2796 (symlink javacc (string-append bin "/jjtree"))
2797 #t))))))
2798
33428d12
AV
2799 (native-inputs
2800 `(("javacc" ,javacc-4)))))
6688c41e 2801
c1cb8576
RW
2802;; This is the last 3.x release of ECJ
2803(define-public java-ecj-3
2804 (package
2805 (name "java-ecj")
2806 (version "3.8.2")
2807 (source (origin
2808 (method url-fetch)
2809 (uri (string-append "http://archive.eclipse.org/eclipse/"
2810 "downloads/drops/R-" version
2811 "-201301310800/ecjsrc-" version ".jar"))
2812 (sha256
2813 (base32
2814 "01mdj14jw11g1jfnki4fi8229p0c6zzckd38zqy2w4m3cjcvsx04"))))
2815 (build-system ant-build-system)
2816 (arguments
2817 `(#:tests? #f ; none included
2818 #:jdk ,icedtea-7 ; doesn't build with JDK8+
2819 #:make-flags (list "-f" "src/build.xml")
2820 #:build-target "build"
2821 #:phases
2822 (modify-phases %standard-phases
2823 (add-after 'unpack 'fix-manifest
2824 (lambda _
2825 ;; Record the main class to make ecj executable.
2826 (with-atomic-file-replacement "src/META-INF/MANIFEST.MF"
2827 (lambda (in out)
2828 (display "Manifest-Version: 1.0
2829Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n"
2c8ac364
MW
2830 out)))
2831 #t))
c1cb8576
RW
2832 (replace 'install (install-jars ".")))))
2833 (home-page "https://eclipse.org")
2834 (synopsis "Eclipse Java development tools core batch compiler")
2835 (description "This package provides the Eclipse Java core batch compiler.")
2836 (license license:epl1.0)))
2837
f201b18e
RW
2838;; This is needed for java-cisd-args4j
2839(define-public java-ecj-3.5
2840 (package (inherit java-ecj-3)
2841 (version "3.5.1")
2842 (source (origin
2843 (method url-fetch/zipbomb)
2844 (uri (string-append "http://archive.eclipse.org/eclipse/"
2845 "downloads/drops/R-" version
2846 "-200909170800/ecjsrc-" version ".zip"))
2847 (sha256
2848 (base32
2849 "1vnl2mavisc567bip736xzsvvbjif5279wc4a7pbdik5wlir8qr7"))))
2850 (build-system ant-build-system)
2851 (arguments
2852 `(#:tests? #f ; none included
2853 #:jdk ,icedtea-7 ; doesn't build with JDK8+
2854 #:build-target "build"
2855 #:phases
2856 (modify-phases %standard-phases
2857 (add-after 'unpack 'fix-manifest
2858 (lambda _
2859 ;; Record the main class to make ecj executable.
2860 (with-atomic-file-replacement "META-INF/MANIFEST.MF"
2861 (lambda (in out)
2862 (dump-port in out)
2863 (display "Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n"
2c8ac364
MW
2864 out)))
2865 #t))
f201b18e
RW
2866 (replace 'install (install-jars ".")))))
2867 (native-inputs
2868 `(("unzip" ,unzip)))))
2869
bc3497a5
BH
2870(define-public java-ecj
2871 (package (inherit java-ecj-3)
2872 (version "4.6.3")
2873 (source
2874 (origin
2875 (method url-fetch)
2876 (uri (string-append
2877 "http://archive.eclipse.org/eclipse/downloads/drops4/R-"
2878 version
2879 "-201703010400/ecjsrc-"
2880 version
2881 ".jar"))
2882 (sha256
2883 (base32
2884 "11cfgsdgznja1pvlxkjbqykxd7pcd5655vkm7s44xmahmap15gpl"))))
2885 (arguments
2886 `(#:tests? #f ; none included
2887 #:build-target "build"
2888 #:phases
2889 (modify-phases %standard-phases
2890 (add-after 'unpack 'fix-build.xml
2891 (lambda _
2892 (substitute* "src/build.xml"
2893 (("^.*MANIFEST.*$")
2894 ""))
2895 #t))
2896 (add-after 'unpack 'fix-prop
2897 (lambda _
2898 (substitute* "src/build.xml"
2899 (("^.*properties.*$")
2900 "<include name=\"**/*.properties\"/>
2901 <include name=\"**/*.props\"/>"))
2902 #t))
2903 (add-before 'build 'chdir
2904 (lambda _
2905 (chdir "src")
2906 #t))
2907 (replace 'install (install-jars ".")))))))
2908
30d55473
RW
2909(define-public java-cisd-base
2910 (let ((revision 38938)
2911 (base-version "14.12.0"))
2912 (package
2913 (name "java-cisd-base")
2914 (version (string-append base-version "-" (number->string revision)))
2915 (source (origin
2916 (method svn-fetch)
2917 (uri (svn-reference
2918 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2919 "base/tags/release/"
2920 (version-major+minor base-version)
2921 ".x/" base-version "/base/"))
2922 (revision revision)))
2923 (file-name (string-append "java-cisd-base-" version "-checkout"))
2924 (sha256
2925 (base32
2926 "1i5adyf7nzclb0wydgwa1az04qliid8035vpahaandmkmigbnxiy"))
2927 (modules '((guix build utils)))
2928 (snippet
2929 '(begin
2930 ;; Delete included gradle jar
2931 (delete-file-recursively "gradle/wrapper")
2932 ;; Delete pre-built native libraries
2933 (delete-file-recursively "libs")
2934 #t))))
2935 (build-system ant-build-system)
2936 (arguments
2937 `(#:make-flags '("-file" "build/build.xml")
2938 #:test-target "jar-test"
2939 #:jdk ,icedtea-8
2940 #:phases
2941 (modify-phases %standard-phases
2942 (add-after 'unpack 'unpack-build-resources
2943 (lambda* (#:key inputs #:allow-other-keys)
2944 (copy-recursively (assoc-ref inputs "build-resources")
2945 "../build_resources")
2946 #t))
2947 (add-after 'unpack-build-resources 'fix-dependencies
2948 (lambda* (#:key inputs #:allow-other-keys)
2949 (substitute* "build/build.xml"
2950 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
2951 (string-append (assoc-ref inputs "java-testng")
2952 "/share/java/java-testng.jar"))
2953 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
2954 (string-append (assoc-ref inputs "java-commons-lang")
2955 "/share/java/commons-lang-"
2956 ,(package-version java-commons-lang) ".jar"))
2957 (("\\$\\{lib\\}/commons-io/commons-io.jar")
2958 (string-append (assoc-ref inputs "java-commons-io")
3448c7ed 2959 "/lib/m2/commons-io/commons-io/"
30d55473 2960 ,(package-version java-commons-io)
3448c7ed
RW
2961 "/commons-io-"
2962 ,(package-version java-commons-io)
2963 ".jar"))
30d55473
RW
2964 ;; Remove dependency on svn
2965 (("<build-info.*") "")
2966 (("\\$\\{revision.number\\}")
2967 ,(number->string revision))
2968 (("\\$\\{version.number\\}") ,base-version))
2969 ;; Remove dependency on classycle
2970 (substitute* "../build_resources/ant/build-common.xml"
2971 (("<taskdef name=\"dependency-checker.*") "")
2972 (("classname=\"classycle.*") "")
2973 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
2974 #t))
2975 ;; A few tests fail because of the lack of a proper /etc/groups and
2976 ;; /etc/passwd file in the build container.
2977 (add-after 'unpack 'disable-broken-tests
2978 (lambda _
2979 (substitute* "sourceTest/java/ch/systemsx/cisd/base/AllTests.java"
2980 (("Unix.isOperational\\(\\)") "false"))
2981 #t))
2982 ;; These decorators are almost useless and pull in an unpackaged
2983 ;; dependency.
2984 (add-after 'unpack 'remove-useless-decorators
2985 (lambda _
2986 (substitute* "source/java/ch/systemsx/cisd/base/unix/Unix.java"
2987 (("@Private") "")
2988 (("import ch.rinn.restrictions.Private;") ""))
2989 (substitute* "sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java"
2990 (("@Friend.*") "")
2991 (("import ch.rinn.restrictions.Friend;") ""))
2992 #t))
2993 (add-before 'configure 'build-native-code
2994 (lambda* (#:key inputs #:allow-other-keys)
2995 (let ((jdk (assoc-ref inputs "jdk"))
2996 (dir ,(match (%current-system)
2997 ("i686-linux"
2998 "i386-Linux")
2999 ((or "armhf-linux" "aarch64-linux")
3000 "arm-Linux")
3001 ((or "x86_64-linux")
3002 "amd64-Linux")
3003 (_ "unknown-Linux"))))
3004 (with-directory-excursion "source/c"
3005 (invoke "gcc" "-shared" "-O3" "-fPIC" "unix.c"
3006 (string-append "-I" jdk "/include")
3007 (string-append "-I" jdk "/include/linux")
3008 "-o" "libunix.so")
3009 (invoke "gcc" "-shared" "-O3" "-fPIC"
3010 "-DMACHINE_BYTE_ORDER=1"
3011 "copyCommon.c"
3012 "copyByteChar.c"
3013 "copyByteDouble.c"
3014 "copyByteFloat.c"
3015 "copyByteInt.c"
3016 "copyByteLong.c"
3017 "copyByteShort.c"
3018 (string-append "-I" jdk "/include")
3019 (string-append "-I" jdk "/include/linux")
3020 "-o" "libnativedata.so"))
3021 (install-file "source/c/libunix.so"
3022 (string-append "libs/native/unix/" dir))
3023 (install-file "source/c/libnativedata.so"
3024 (string-append "libs/native/nativedata/" dir))
3025 #t)))
3026 ;; In the "check" phase we only build the test executable.
3027 (add-after 'check 'run-tests
3028 (lambda _
3029 (invoke "java" "-jar" "targets/dist/sis-base-test.jar")
3030 (delete-file "targets/dist/sis-base-test.jar")
3031 #t))
3032 (replace 'install (install-jars "targets/dist")))))
3033 (native-inputs
3034 `(("jdk" ,icedtea-8)
3035 ("java-commons-lang" ,java-commons-lang)
3036 ("java-commons-io" ,java-commons-io)
3037 ("java-testng" ,java-testng)
3038 ("build-resources"
3039 ,(origin
3040 (method svn-fetch)
3041 (uri (svn-reference
3042 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3043 "base/tags/release/"
3044 (version-major+minor base-version)
3045 ".x/" base-version
3046 "/build_resources/"))
3047 (revision revision)))
3048 (sha256
3049 (base32
3050 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
3051 (home-page "http://svnsis.ethz.ch")
3052 (synopsis "Utility classes for libraries from ETH Zurich")
3053 (description "This library supplies some utility classes needed for
3054libraries from the SIS division at ETH Zurich like jHDF5.")
3055 ;; The C sources are under a non-copyleft license, which looks like a
3056 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
3057 (license (list license:asl2.0
3058 (license:non-copyleft "file://source/c/COPYING"))))))
3059
04ddca26
RW
3060(define-public java-cisd-args4j
3061 (let ((revision 39162)
3062 (base-version "9.11.2"))
3063 (package
3064 (name "java-cisd-args4j")
3065 (version (string-append base-version "-" (number->string revision)))
3066 (source (origin
3067 (method svn-fetch)
3068 (uri (svn-reference
3069 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3070 "args4j/tags/release/"
3071 (version-major+minor base-version)
3072 ".x/" base-version "/args4j/"))
3073 (revision revision)))
3074 (file-name (string-append "java-cisd-args4j-" version "-checkout"))
3075 (sha256
3076 (base32
3077 "0hhqznjaivq7ips7mkwas78z42s6djsm20rrs7g1zd59rcsakxn2"))))
3078 (build-system ant-build-system)
3079 (arguments
3080 `(#:make-flags '("-file" "build/build.xml")
3081 #:tests? #f ; there are no tests
3082 ;; There are weird build failures with JDK8, such as: "The type
3083 ;; java.io.ObjectInputStream cannot be resolved. It is indirectly
3084 ;; referenced from required .class files"
3085 #:jdk ,icedtea-7
3086 #:modules ((guix build ant-build-system)
3087 (guix build utils)
3088 (guix build java-utils)
3089 (sxml simple)
3090 (sxml transform)
3091 (sxml xpath))
3092 #:phases
3093 (modify-phases %standard-phases
3094 (add-after 'unpack 'unpack-build-resources
3095 (lambda* (#:key inputs #:allow-other-keys)
3096 (mkdir-p "../build_resources")
3097 (invoke "tar" "xf" (assoc-ref inputs "build-resources")
3098 "-C" "../build_resources"
3099 "--strip-components=1")
3100 (mkdir-p "../build_resources/lib")
3101 #t))
3102 (add-after 'unpack-build-resources 'fix-dependencies
3103 (lambda* (#:key inputs #:allow-other-keys)
3104 ;; FIXME: There should be a more convenient abstraction for
3105 ;; editing XML files.
3106 (with-directory-excursion "../build_resources/ant/"
3107 (chmod "build-common.xml" #o664)
3108 (call-with-output-file "build-common.xml.new"
3109 (lambda (port)
3110 (sxml->xml
3111 (pre-post-order
3112 (with-input-from-file "build-common.xml"
3113 (lambda _ (xml->sxml #:trim-whitespace? #t)))
3114 `(;; Remove dependency on classycle and custom ant tasks
3115 (taskdef . ,(lambda (tag . kids)
3116 (let ((name ((sxpath '(name *text*)) kids)))
3117 (if (or (member "build-info" name)
3118 (member "dependency-checker" name)
3119 (member "build-java-subprojects" name)
3120 (member "project-classpath" name))
3121 '() ; skip
3122 `(,tag ,@kids)))))
3123 (typedef . ,(lambda (tag . kids)
3124 (let ((name ((sxpath '(name *text*)) kids)))
3125 (if (member "recursive-jar" name)
3126 '() ; skip
3127 `(,tag ,@kids)))))
3128 (build-java-subprojects . ,(lambda _ '()))
3129 ;; Ignore everything else
3130 (*default* . ,(lambda (tag . kids) `(,tag ,@kids)))
3131 (*text* . ,(lambda (_ txt) txt))))
3132 port)))
3133 (rename-file "build-common.xml.new" "build-common.xml"))
3134 (substitute* "build/build.xml"
3135 (("\\$\\{lib\\}/cisd-base/cisd-base.jar")
3136 (string-append (assoc-ref inputs "java-cisd-base")
3137 "/share/java/sis-base.jar"))
3138 ;; Remove dependency on svn
3139 (("<build-info.*") "")
3140 (("\\$\\{revision.number\\}")
3141 ,(number->string revision))
3142 (("\\$\\{version.number\\}") ,base-version)
3143 ;; Don't use custom ant tasks.
3144 (("recursive-jar") "jar")
3145 (("<project-classpath.*") ""))
3146 #t))
3147 (replace 'install (install-jars "targets/dist")))))
3148 (inputs
3149 `(("java-cisd-base" ,java-cisd-base)))
3150 (native-inputs
3151 `(("ecj" ,java-ecj-3.5)
3152 ("build-resources"
3153 ,(origin
3154 (method svn-fetch)
3155 (uri (svn-reference
3156 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3157 "args4j/tags/release/"
3158 (version-major+minor base-version)
3159 ".x/" base-version
3160 "/build_resources/"))
3161 (revision revision)))
3162 (sha256
3163 (base32
3164 "056cam4k8pll7ass31sy6gwn8g8719njc41yf4l02b0342nilkyf"))
3165 (modules '((guix build utils)))
3166 ;; Delete bundled pre-built jars.
3167 (snippet
3168 '(begin (delete-file-recursively "lib/") #t))))))
3169 (home-page "http://svnsis.ethz.ch")
3170 (synopsis "Command line parser library")
3171 (description "This package provides a parser for command line arguments.")
3172 (license license:asl2.0))))
3173
2f0d0418
RW
3174(define-public java-cisd-jhdf5
3175 (let ((revision 39162)
3176 (base-version "14.12.6"))
3177 (package
3178 (name "java-cisd-jhdf5")
3179 (version (string-append base-version "-" (number->string revision)))
3180 (source (origin
3181 (method svn-fetch)
3182 (uri (svn-reference
3183 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3184 "jhdf5/tags/release/"
3185 (version-major+minor base-version)
3186 ".x/" base-version "/jhdf5/"))
3187 (revision revision)))
3188 (file-name (string-append "java-cisd-jhdf5-" version "-checkout"))
3189 (sha256
3190 (base32
3191 "13i17s2hn0q9drdqvp8csy7770p3hdbh9rp30ihln2ldkfawdmz0"))
3192 (modules '((guix build utils)))
3193 (snippet
3194 '(begin
3195 ;; Delete included gradle jar
3196 (delete-file-recursively "gradle/wrapper")
3197 ;; Delete pre-built native libraries
3198 (delete-file-recursively "libs")
3199 #t))))
3200 (build-system ant-build-system)
3201 (arguments
3202 `(#:make-flags '("-file" "build/build.xml")
3203 #:build-target "jar-all"
3204 #:test-target "jar-test"
3205 #:jdk ,icedtea-8
3206 #:phases
3207 (modify-phases %standard-phases
1ed386fc
RW
3208 ;; FIXME: this build phase fails.
3209 (delete 'generate-jar-indices)
2f0d0418
RW
3210 ;; Don't erase results from the build phase when building tests.
3211 (add-after 'unpack 'separate-test-target-from-clean
3212 (lambda _
3213 (substitute* "build/build.xml"
3214 (("\"jar-test\" depends=\"clean, ")
3215 "\"jar-test\" depends=\""))
3216 #t))
3217 (add-after 'unpack 'unpack-build-resources
3218 (lambda* (#:key inputs #:allow-other-keys)
3219 (copy-recursively (assoc-ref inputs "build-resources")
3220 "../build_resources")
3221 (delete-file-recursively "../build_resources/lib/")
3222 (mkdir-p "../build_resources/lib")
3223 ;; Remove dependency on classycle
3224 (substitute* "../build_resources/ant/build-common.xml"
3225 (("<taskdef name=\"dependency-checker.*") "")
3226 (("classname=\"classycle.*") "")
3227 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
3228 ;; Remove dependency on svn
3229 (substitute* "build/build.xml"
3230 (("<build-info.*") "")
3231 (("\\$\\{revision.number\\}")
3232 ,(number->string revision))
3233 (("\\$\\{version.number\\}") ,base-version))
3234 #t))
3235 (add-after 'unpack-build-resources 'fix-dependencies
3236 (lambda* (#:key inputs #:allow-other-keys)
3237 (substitute* "../build_resources/ant/build-common.xml"
3238 (("../libraries/testng/testng-jdk15.jar")
3239 (string-append (assoc-ref inputs "java-testng")
3240 "/share/java/java-testng.jar")))
3241 (substitute* "build/build.xml"
3242 (("\\$\\{lib\\}/sis-base/sis-base.jar")
3243 (string-append (assoc-ref inputs "java-cisd-base")
3244 "/share/java/sis-base.jar"))
3245 (("\\$\\{lib\\}/cisd-args4j/cisd-args4j.jar")
3246 (string-append (assoc-ref inputs "java-cisd-args4j")
3247 "/share/java/cisd-args4j.jar"))
3248 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
3249 (string-append (assoc-ref inputs "java-commons-lang")
3250 "/share/java/commons-lang-"
3251 ,(package-version java-commons-lang) ".jar"))
3252 (("\\$\\{lib\\}/commons-io/commons-io.jar")
3253 (string-append (assoc-ref inputs "java-commons-io")
cd005bfe
RW
3254 "/lib/m2/commons-io/commons-io/"
3255 ,(package-version java-commons-io)
3256 "/commons-io-"
2f0d0418 3257 ,(package-version java-commons-io)
cd005bfe 3258 ".jar"))
2f0d0418
RW
3259 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
3260 (string-append (assoc-ref inputs "java-testng")
3261 "/share/java/java-testng.jar"))
3262 (("\\$\\{lib\\}/junit4/junit.jar")
fff4fcc4 3263 (car (find-files (assoc-ref inputs "java-junit") "jar$")))
2f0d0418 3264 (("\\$\\{lib\\}/jmock/hamcrest/hamcrest-core.jar")
fff4fcc4
JL
3265 (car (find-files (assoc-ref inputs "java-hamcrest-core")
3266 "jar$"))))
2f0d0418
RW
3267 ;; Remove dependency on ch.rinn.restrictions
3268 (with-directory-excursion "source/java/ch/systemsx/cisd/hdf5/"
3269 (substitute* '("BitSetConversionUtils.java"
3270 "HDF5Utils.java")
3271 (("import ch.rinn.restrictions.Private;") "")
3272 (("@Private") "")))
3273 (with-directory-excursion "sourceTest/java/ch/systemsx/cisd/hdf5/"
3274 (substitute* '("BitSetConversionTest.java"
3275 "h5ar/HDF5ArchiverTest.java")
3276 (("import ch.rinn.restrictions.Friend;") "")
3277 (("@Friend.*") ""))
3278 ;; Remove leftovers from removing @Friend
3279 (substitute* "h5ar/HDF5ArchiverTest.java"
3280 (("\\{ HDF5Archiver.class, IdCache.class, LinkRecord.class \\}\\)")
3281 "")))
3282 #t))
3283 (add-before 'configure 'build-native-library
3284 (lambda* (#:key inputs #:allow-other-keys)
3285 (let ((jdk (assoc-ref inputs "jdk"))
3286 (hdf5 (assoc-ref inputs "hdf5"))
3287 (dir ,(match (%current-system)
3288 ("i686-linux"
3289 "i386-Linux")
3290 ((or "armhf-linux" "aarch64-linux")
3291 "arm-Linux")
3292 ((or "x86_64-linux")
3293 "amd64-Linux")
3294 (_ "unknown-Linux"))))
3295 (with-directory-excursion "source/c"
3296 (apply invoke `("gcc" "-shared" "-O3"
3297 "-fPIC"
3298 "-Wl,--exclude-libs,ALL"
3299 ,@(find-files "jhdf5" "\\.c$")
3300 ,@(find-files "hdf-java" "\\.c$")
3301 ,(string-append "-I" hdf5 "/include")
3302 ,(string-append "-I" jdk "/include")
3303 ,(string-append "-I" jdk "/include/linux")
3304 ,(string-append hdf5 "/lib/libhdf5.a")
3305 "-o" "libjhdf5.so" "-lz")))
3306 (install-file "source/c/libjhdf5.so"
3307 (string-append "libs/native/jhdf5/" dir))
3308 #t)))
3309 ;; In the "check" phase we only build the test executable.
3310 (add-after 'check 'run-tests
3311 (lambda _
3312 (invoke "java" "-jar" "targets/dist/sis-jhdf5-test.jar")
3313 (delete-file "targets/dist/sis-jhdf5-test.jar")
3314 #t))
3315 (replace 'install
3316 (install-jars "targets/dist")))))
3317 (inputs
3318 `(("java-cisd-base" ,java-cisd-base)
3319 ("java-cisd-args4j" ,java-cisd-args4j)
3320 ("java-commons-lang" ,java-commons-lang)
3321 ("java-commons-io" ,java-commons-io)
3322 ("hdf5" ,hdf5)
3323 ("zlib" ,zlib)))
3324 (native-inputs
3325 `(("jdk" ,icedtea-8)
3326 ("java-testng" ,java-testng)
3327 ("java-junit" ,java-junit)
3328 ("java-jmock" ,java-jmock)
3329 ("java-hamcrest-core" ,java-hamcrest-core)
3330 ("build-resources"
3331 ,(origin
3332 (method svn-fetch)
3333 (uri (svn-reference
3334 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3335 "jhdf5/tags/release/"
3336 (version-major+minor base-version)
3337 ".x/" base-version
3338 "/build_resources/"))
3339 (revision revision)))
3340 (sha256
3341 (base32
3342 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
3343 (home-page "https://wiki-bsse.ethz.ch/display/JHDF5/")
3344 (synopsis "Java binding for HDF5")
3345 (description "JHDF5 is a high-level API in Java for reading and writing
3346HDF5 files, building on the libraries provided by the HDF Group.")
3347 ;; The C sources are under a non-copyleft license, which looks like a
3348 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
3349 (license (list license:asl2.0
3350 (license:non-copyleft "file://source/c/COPYING"))))))
3351
218d093b
RW
3352(define-public java-classpathx-servletapi
3353 (package
3354 (name "java-classpathx-servletapi")
ae307724 3355 (version "3.0.1")
218d093b
RW
3356 (source (origin
3357 (method url-fetch)
3358 (uri (string-append "mirror://gnu/classpathx/servletapi/"
3359 "servletapi-" version ".tar.gz"))
3360 (sha256
3361 (base32
ae307724 3362 "07d8h051siga2f33fra72hk12sbq1bxa4jifjg0qj0vfazjjff0x"))))
218d093b
RW
3363 (build-system ant-build-system)
3364 (arguments
3365 `(#:tests? #f ; there is no test target
3366 #:build-target "compile"
218d093b 3367 #:make-flags
ae307724 3368 (list "-Dbuild.compiler=javac1.8"
218d093b
RW
3369 (string-append "-Ddist=" (assoc-ref %outputs "out")))
3370 #:phases
3371 (modify-phases %standard-phases
3372 (replace 'install
3373 (lambda* (#:key make-flags #:allow-other-keys)
2c8ac364 3374 (apply invoke `("ant" "dist" ,@make-flags)))))))
218d093b
RW
3375 (home-page "https://www.gnu.org/software/classpathx/")
3376 (synopsis "Java servlet API implementation")
3377 (description "This is the GNU servlet API distribution, part of the
3378ClasspathX project. It provides implementations of version 3.0 of the servlet
3379API and version 2.1 of the Java ServerPages API.")
3380 (license license:gpl3+)))
3381
10d62a88
BH
3382(define-public java-javaee-servletapi
3383 (package
3384 (name "java-javaee-servletapi")
3385 (version "3.1.0")
44bac44c
BH
3386 (source (origin
3387 (method git-fetch)
3388 (uri (git-reference
b0e7b699 3389 (url "https://github.com/javaee/servlet-spec")
44bac44c
BH
3390 (commit version)))
3391 (file-name (git-file-name name version))
3392 (sha256
3393 (base32
3394 "0s03lj8w5an70lkqbjycgfrfk0kc07vbfav91jzk87gh3awf9ksl"))))
10d62a88
BH
3395 (build-system ant-build-system)
3396 (arguments
3397 `(#:jar-name "javax-servletapi.jar"
3398 ;; no tests
3399 #:tests? #f
8ea8d607
BH
3400 #:source-dir "src/main/java"
3401 #:phases
3402 (modify-phases %standard-phases
3403 (add-before 'build 'copy-resources
3404 (lambda _
3405 (mkdir-p "build/classes/javax/servlet/http")
3406 (let ((from-prefix "src/main/java/javax/servlet/")
3407 (to-prefix "build/classes/javax/servlet/"))
3408 (for-each (lambda (f)
3409 (copy-file (string-append from-prefix f)
3410 (string-append to-prefix f)))
3411 (list "LocalStrings_ja.properties"
3412 "LocalStrings.properties"
3413 "LocalStrings_fr.properties"
3414 "http/LocalStrings_es.properties"
3415 "http/LocalStrings_ja.properties"
3416 "http/LocalStrings.properties"
3417 "http/LocalStrings_fr.properties")))
3418 #t)))))
10d62a88
BH
3419 (native-inputs
3420 `(("unzip" ,unzip)))
3421 (home-page "https://javaee.github.io/servlet-spec/")
3422 (synopsis "Java servlet API")
3423 (description "Java Servlet is the foundation web specification in the
3424Java Enterprise Platform. Developers can build web applications using the
3425Servlet API to interact with the request/response workflow. This project
3426provides information on the continued development of the Java Servlet
3427specification.")
3428 ;; Main code is dual-licensed by Oracle under either GLP2 or CDDL 1.1.
3429 ;; Some files are licensed under ASL 2.0.
3430 (license (list license:asl2.0 license:gpl2 license:cddl1.1))))
3431
5490480c
RW
3432(define-public java-swt
3433 (package
3434 (name "java-swt")
8710d4dd 3435 (version "4.7.1a")
5490480c
RW
3436 (source
3437 ;; The types of many variables and procedures differ in the sources
3438 ;; dependent on whether the target architecture is a 32-bit system or a
3439 ;; 64-bit system. Instead of patching the sources on demand in a build
3440 ;; phase we download either the 32-bit archive (which mostly uses "int"
3441 ;; types) or the 64-bit archive (which mostly uses "long" types).
8710d4dd
RW
3442 (let ((hash32 "09q0cbh90d90q3a7dx9430kc4m6bijrkr4lajrmzzvi0jjdpq4v9")
3443 (hash64 "17k5hs75a87ssmc5xhwdfdm2gn4zba0r837l2455za01krnkaa2q")
5490480c
RW
3444 (file32 "x86")
3445 (file64 "x86_64"))
3446 (let-values (((hash file)
3447 (match (or (%current-target-system) (%current-system))
3448 ("x86_64-linux" (values hash64 file64))
3449 (_ (values hash32 file32)))))
3450 (origin
3451 (method url-fetch)
3452 (uri (string-append
8710d4dd
RW
3453 "http://download.eclipse.org/eclipse/downloads/drops4/"
3454 "R-" version "-201710090410/swt-" version
3455 "-gtk-linux-" file ".zip"))
5490480c
RW
3456 (sha256 (base32 hash))))))
3457 (build-system ant-build-system)
3458 (arguments
3459 `(#:jar-name "swt.jar"
8710d4dd 3460 #:jdk ,icedtea-8
5490480c
RW
3461 #:tests? #f ; no "check" target
3462 #:phases
3463 (modify-phases %standard-phases
3464 (replace 'unpack
3465 (lambda* (#:key source #:allow-other-keys)
2c8ac364
MW
3466 (mkdir "swt")
3467 (invoke "unzip" source "-d" "swt")
3468 (chdir "swt")
3469 (mkdir "src")
3470 (invoke "unzip" "src.zip" "-d" "src")))
5490480c
RW
3471 ;; The classpath contains invalid icecat jars. Since we don't need
3472 ;; anything other than the JDK on the classpath, we can simply unset
3473 ;; it.
3474 (add-after 'configure 'unset-classpath
3475 (lambda _ (unsetenv "CLASSPATH") #t))
3476 (add-before 'build 'build-native
3477 (lambda* (#:key inputs outputs #:allow-other-keys)
3478 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3479 ;; Build shared libraries. Users of SWT have to set the system
3480 ;; property swt.library.path to the "lib" directory of this
3481 ;; package output.
3482 (mkdir-p lib)
3483 (setenv "OUTPUT_DIR" lib)
3484 (with-directory-excursion "src"
2c8ac364 3485 (invoke "bash" "build.sh")))))
5490480c
RW
3486 (add-after 'install 'install-native
3487 (lambda* (#:key outputs #:allow-other-keys)
3488 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3489 (for-each (lambda (file)
3490 (install-file file lib))
3491 (find-files "." "\\.so$"))
3492 #t))))))
3493 (inputs
8710d4dd 3494 `(("gtk" ,gtk+-2)
5490480c
RW
3495 ("libxtst" ,libxtst)
3496 ("libxt" ,libxt)
3497 ("mesa" ,mesa)
3498 ("glu" ,glu)))
3499 (native-inputs
3500 `(("pkg-config" ,pkg-config)
3501 ("unzip" ,unzip)))
3502 (home-page "https://www.eclipse.org/swt/")
3503 (synopsis "Widget toolkit for Java")
3504 (description
3505 "SWT is a widget toolkit for Java designed to provide efficient, portable
3506access to the user-interface facilities of the operating systems on which it
3507is implemented.")
3508 ;; SWT code is licensed under EPL1.0
3509 ;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
3510 ;; Cairo bindings contain code under MPL1.1
3511 ;; XULRunner 1.9 bindings contain code under MPL2.0
3512 (license (list
3513 license:epl1.0
3514 license:mpl1.1
3515 license:mpl2.0
3516 license:lgpl2.1+))))
3517
04100c3b
RW
3518;; java-hamcrest-core uses qdox version 1.12. We package this version instead
3519;; of the latest release.
3520(define-public java-qdox-1.12
3521 (package
3522 (name "java-qdox")
3523 (version "1.12.1")
3524 (source (origin
3525 (method url-fetch)
3344bc49 3526 (uri (string-append "https://repo1.maven.org/maven2/"
04100c3b
RW
3527 "com/thoughtworks/qdox/qdox/" version
3528 "/qdox-" version "-sources.jar"))
3529 (sha256
3530 (base32
3531 "0hlfbqq2avf5s26wxkksqmkdyk6zp9ggqn37c468m96mjv0n9xfl"))))
3532 (build-system ant-build-system)
3533 (arguments
3534 `(;; Tests require junit
3535 #:tests? #f
3536 #:jar-name "qdox.jar"
3537 #:phases
3538 (modify-phases %standard-phases
3539 (replace 'unpack
3540 (lambda* (#:key source #:allow-other-keys)
3541 (mkdir "src")
3542 (with-directory-excursion "src"
2c8ac364 3543 (invoke "jar" "-xf" source))))
04100c3b
RW
3544 ;; At this point we don't have junit, so we must remove the API
3545 ;; tests.
3546 (add-after 'unpack 'delete-tests
3547 (lambda _
3548 (delete-file-recursively "src/com/thoughtworks/qdox/junit")
3549 #t)))))
3344bc49 3550 (home-page "https://github.com/codehaus/qdox")
04100c3b
RW
3551 (synopsis "Parse definitions from Java source files")
3552 (description
3553 "QDox is a high speed, small footprint parser for extracting
3554class/interface/method definitions from source files complete with JavaDoc
b13cf17f 3555@code{@@tags}. It is designed to be used by active code generators or
04100c3b
RW
3556documentation tools.")
3557 (license license:asl2.0)))
e7e28510 3558
5281ba17
BH
3559(define-public java-qdox
3560 (package
3561 (name "java-qdox")
3562 ; Newer version exists, but this version is required by java-plexus-component-metadata
3563 (version "2.0-M2")
3564 (source (origin
3565 (method url-fetch)
3566 ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
3567 ;; Older releases at https://github.com/codehaus/qdox/
3568 ;; Note: The release at maven is pre-generated. The release at
3569 ;; github requires jflex.
3570 (uri (string-append "https://repo1.maven.org/maven2/"
3571 "com/thoughtworks/qdox/qdox/" version
3572 "/qdox-" version "-sources.jar"))
3573 (sha256
3574 (base32
3575 "10xxrcaicq6axszcr2jpygisa4ch4sinyx5q7kqqxv4lknrmxp5x"))))
3576 (build-system ant-build-system)
3577 (arguments
3578 `(#:jar-name "qdox.jar"
0ab9eba7
JL
3579 #:tests? #f; no tests
3580 #:modules
3581 ((guix build ant-build-system)
3582 (guix build java-utils)
3583 (guix build utils)
3584 (sxml simple))
3585 #:phases
3586 (modify-phases %standard-phases
3587 (add-before 'install 'create-pom
3588 (lambda _
3589 (with-output-to-file "pom.xml"
3590 (lambda _
3591 (sxml->xml
3592 `((project
3593 (modelVersion "4.0.0")
3594 (name "QDox")
3595 (groupId "com.thoughtworks.qdox")
3596 (artifactId "qdox")
3597 (version ,,version))))))
3598 #t))
3599 (replace 'install
3600 (install-from-pom "pom.xml")))))
5281ba17
BH
3601 (home-page "https://github.com/codehaus/qdox")
3602 (synopsis "Parse definitions from Java source files")
3603 (description "QDox is a high speed, small footprint parser for extracting
3604class/interface/method definitions from source files complete with JavaDoc
3605@code{@@tags}. It is designed to be used by active code generators or
3606documentation tools.")
3607 (license license:asl2.0)))
3608
0ab9eba7
JL
3609(define-public java-qdox-2-M9
3610 (package
3611 (inherit java-qdox)
3612 (version "2.0-M9"); required by plexus-java
3613 (source (origin
3614 (method url-fetch)
3615 ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
3616 ;; Older releases at https://github.com/codehaus/qdox/
3617 ;; Note: The release at maven is pre-generated. The release at
3618 ;; github requires jflex.
3619 (uri (string-append "https://repo1.maven.org/maven2/"
3620 "com/thoughtworks/qdox/qdox/" version
3621 "/qdox-" version "-sources.jar"))
3622 (sha256
3623 (base32
3624 "1s2jnmx2dkwnaha12lcj26aynywgwa8sslc47z82wx8xai13y4fg"))))))
3625
e7e28510
RW
3626(define-public java-jarjar
3627 (package
3628 (name "java-jarjar")
3629 (version "1.4")
3630 (source (origin
3631 (method url-fetch)
3632 (uri (string-append
3633 "https://storage.googleapis.com/google-code-archive-downloads/v2/"
3634 "code.google.com/jarjar/jarjar-src-" version ".zip"))
3635 (sha256
3636 (base32
88aa75e9
GB
3637 "1v8irhni9cndcw1l1wxqgry013s2kpj0qqn57lj2ji28xjq8ndjl"))
3638 (modules '((guix build utils)))
3639 (snippet
3640 '(begin
3641 ;; Delete bundled thirds-party jar archives.
e0ee843f
JL
3642 (delete-file-recursively "lib")
3643 (delete-file "src/test/enumtest.jar")
3644 ;; the CLASSPATH needs this directory, create an empty one
3645 (mkdir-p "lib")
88aa75e9 3646 #t))))
e7e28510
RW
3647 (build-system ant-build-system)
3648 (arguments
3649 `(;; Tests require junit, which ultimately depends on this package.
3650 #:tests? #f
3651 #:build-target "jar"
3652 #:phases
3653 (modify-phases %standard-phases
88aa75e9
GB
3654 (add-before 'build 'do-not-use-bundled-asm
3655 (lambda* (#:key inputs #:allow-other-keys)
3656 (substitute* "build.xml"
3657 (("<path id=\"path.build\">")
3658 (string-append "<path id=\"path.build\"><fileset dir=\""
3659 (assoc-ref inputs "java-asm-bootstrap")
51087d51 3660 "/lib/m2\" includes=\"**/*.jar\"/>"))
88aa75e9
GB
3661 (("<zipfileset src=\"lib/asm-4.0.jar\"/>") "")
3662 (("lib/asm-commons-4.0.jar")
51087d51
JL
3663 (car (find-files (assoc-ref inputs "java-asm-bootstrap")
3664 "asm-6.0.jar")))
88aa75e9
GB
3665 (("<include name=\"org/objectweb/asm/commons/Remap\\*\\.class\"/>")
3666 (string-append "<include name=\"org/objectweb/asm/"
3667 "commons/Remap*.class\"/>"
3668 "<include name=\"org/objectweb/asm/*.class\"/>"
3669 "<include name=\"org/objectweb/asm/"
3670 "signature/*.class\"/>"
3671 "<include name=\"org/objectweb/asm/"
3672 "commons/SignatureRemapper.class\"/>")))
3673 #t))
e0ee843f
JL
3674 (add-before 'build 'remove-maven-dependency
3675 (lambda _
3676 ;; We do not need to build jarjar as a maven plugin just yet, so
3677 ;; remove this file. Maven requires jarjar (but not that plugin),
3678 ;; so removing it improves the bootstrap.
3679 (delete-file "src/main/com/tonicsystems/jarjar/JarJarMojo.java")
3680 #t))
e7e28510
RW
3681 (replace 'install
3682 (lambda* (#:key outputs #:allow-other-keys)
3683 (let ((target (string-append (assoc-ref outputs "out")
3684 "/share/java")))
3685 (install-file (string-append "dist/jarjar-" ,version ".jar")
3686 target))
3687 #t)))))
88aa75e9
GB
3688 (inputs
3689 `(("java-asm-bootstrap" ,java-asm-bootstrap)))
e7e28510
RW
3690 (native-inputs
3691 `(("unzip" ,unzip)))
3692 (home-page "https://code.google.com/archive/p/jarjar/")
3693 (synopsis "Repackage Java libraries")
3694 (description
3695 "Jar Jar Links is a utility that makes it easy to repackage Java
3696libraries and embed them into your own distribution. Jar Jar Links includes
3697an Ant task that extends the built-in @code{jar} task.")
3698 (license license:asl2.0)))
87c31a21
RW
3699
3700(define-public java-hamcrest-core
3701 (package
3702 (name "java-hamcrest-core")
3703 (version "1.3")
3704 (source (origin
2703d573
EF
3705 (method git-fetch)
3706 (uri (git-reference
3707 (url "https://github.com/hamcrest/JavaHamcrest/")
3708 (commit (string-append "hamcrest-java-" version))))
3709 (file-name (git-file-name name version))
87c31a21
RW
3710 (sha256
3711 (base32
2703d573 3712 "16fxxkrd31ahqvcaby30jgh3z1i0zxh51m24hxgz0z2agxj6bc63"))
87c31a21
RW
3713 (modules '((guix build utils)))
3714 (snippet
3715 '(begin
00672896
HG
3716 ;; Delete bundled thirds-party jar archives.
3717 (delete-file-recursively "lib")
87c31a21
RW
3718 #t))))
3719 (build-system ant-build-system)
3720 (arguments
3721 `(#:tests? #f ; Tests require junit
a8d3cb62 3722 #:modules ((guix build ant-build-system)
fff4fcc4 3723 (guix build java-utils)
a8d3cb62
RW
3724 (guix build utils)
3725 (srfi srfi-1))
87c31a21 3726 #:make-flags (list (string-append "-Dversion=" ,version))
fae0b4ca 3727 #:test-target "unit-test"
87c31a21
RW
3728 #:build-target "core"
3729 #:phases
3730 (modify-phases %standard-phases
3731 ;; Disable unit tests, because they require junit, which requires
3732 ;; hamcrest-core. We also give a fixed value to the "Built-Date"
3733 ;; attribute from the manifest for reproducibility.
3734 (add-before 'configure 'patch-build.xml
3735 (lambda _
3736 (substitute* "build.xml"
3737 (("unit-test, ") "")
3738 (("\\$\\{build.timestamp\\}") "guix"))
3739 #t))
3740 ;; Java's "getMethods()" returns methods in an unpredictable order.
3741 ;; To make the output of the generated code deterministic we must
3742 ;; sort the array of methods.
3743 (add-after 'unpack 'make-method-order-deterministic
3744 (lambda _
3745 (substitute* "hamcrest-generator/src/main/java/org/hamcrest/generator/ReflectiveFactoryReader.java"
3746 (("import java\\.util\\.Iterator;" line)
3747 (string-append line "\n"
3748 "import java.util.Arrays; import java.util.Comparator;"))
3749 (("allMethods = cls\\.getMethods\\(\\);" line)
3750 (string-append "_" line
3751 "
3752private Method[] getSortedMethods() {
3753 Arrays.sort(_allMethods, new Comparator<Method>() {
3754 @Override
3755 public int compare(Method a, Method b) {
3756 return a.toString().compareTo(b.toString());
3757 }
3758 });
3759 return _allMethods;
3760}
3761
2c8ac364
MW
3762private Method[] allMethods = getSortedMethods();")))
3763 #t))
87c31a21
RW
3764 (add-before 'build 'do-not-use-bundled-qdox
3765 (lambda* (#:key inputs #:allow-other-keys)
3766 (substitute* "build.xml"
3767 (("lib/generator/qdox-1.12.jar")
3768 (string-append (assoc-ref inputs "java-qdox-1.12")
3769 "/share/java/qdox.jar")))
3770 #t))
fab959d3
HG
3771 ;; build.xml searches for .jar files in this directoy, which
3772 ;; we remove from the source archive.
3773 (add-before 'build 'create-dummy-directories
3774 (lambda _
3775 (mkdir-p "lib/integration")
3776 #t))
fff4fcc4
JL
3777 (add-before 'build 'create-pom
3778 (lambda _
3779 (substitute* "pom/hamcrest-core.pom"
3780 (("@VERSION@") ,version))
3781 #t))
87c31a21 3782 (replace 'install
fff4fcc4 3783 (install-from-pom "pom/hamcrest-core.pom")))))
87c31a21
RW
3784 (native-inputs
3785 `(("java-qdox-1.12" ,java-qdox-1.12)
3786 ("java-jarjar" ,java-jarjar)))
fff4fcc4
JL
3787 (propagated-inputs
3788 `(("java-hamcrest-parent-pom" ,java-hamcrest-parent-pom)))
87c31a21
RW
3789 (home-page "http://hamcrest.org/")
3790 (synopsis "Library of matchers for building test expressions")
3791 (description
3792 "This package provides a library of matcher objects (also known as
3793constraints or predicates) allowing @code{match} rules to be defined
3794declaratively, to be used in other frameworks. Typical scenarios include
3795testing frameworks, mocking libraries and UI validation rules.")
3796 (license license:bsd-2)))
d0184f44 3797
fff4fcc4
JL
3798(define java-hamcrest-parent-pom
3799 (package
3800 (inherit java-hamcrest-core)
3801 (name "java-hamcrest-parent-pom")
3802 (propagated-inputs '())
3803 (native-inputs '())
3804 (arguments
3805 `(#:tests? #f
3806 #:phases
3807 (modify-phases %standard-phases
3808 (delete 'configure)
3809 (replace 'build
3810 (lambda _
3811 (substitute* "pom/hamcrest-parent.pom"
3812 (("@VERSION@") ,(package-version java-hamcrest-core)))
3813 #t))
3814 (replace 'install
3815 (install-pom-file "pom/hamcrest-parent.pom")))))))
3816
031516d6
JL
3817(define-public java-hamcrest-library
3818 (package
3819 (inherit java-hamcrest-core)
3820 (name "java-hamcrest-library")
3821 (arguments
3822 (substitute-keyword-arguments (package-arguments java-hamcrest-core)
fff4fcc4
JL
3823 ((#:build-target _) "library")
3824 ((#:phases phases)
3825 `(modify-phases ,phases
7bbe61f8
JL
3826 (add-after 'unpack 'patch-classpath-for-integration
3827 (lambda* (#:key inputs #:allow-other-keys)
3828 (substitute* "build.xml"
3829 (("build/hamcrest-core-\\$\\{version\\}\\.jar")
3830 (car (find-files (assoc-ref inputs "java-hamcrest-core")
3831 "jar$"))))
3832 #t))
fff4fcc4
JL
3833 (replace 'create-pom
3834 (lambda _
3835 (substitute* "pom/hamcrest-library.pom"
3836 (("@VERSION@") ,(package-version java-hamcrest-core)))
3837 #t))
3838 (replace 'install
3839 (install-from-pom "pom/hamcrest-library.pom"))))))
031516d6 3840 (propagated-inputs
fff4fcc4
JL
3841 `(("java-hamcrest-core" ,java-hamcrest-core)
3842 ("java-hamcrest-parent-pom" ,java-hamcrest-parent-pom)))))
031516d6 3843
d0184f44
RW
3844(define-public java-junit
3845 (package
3846 (name "java-junit")
3847 (version "4.12")
3848 (source (origin
42c1c59e
EF
3849 (method git-fetch)
3850 (uri (git-reference
3851 (url "https://github.com/junit-team/junit/")
3852 (commit (string-append "r" version))))
3853 (file-name (git-file-name name version))
d0184f44
RW
3854 (sha256
3855 (base32
42c1c59e 3856 "1j8avi91px1z8rjc89cfikwrvfifdmmsarwiyrcnr59ynvpz0v8h"))
d0184f44
RW
3857 (modules '((guix build utils)))
3858 (snippet
3859 '(begin
3860 ;; Delete bundled jar archives.
3861 (delete-file-recursively "lib")
3862 #t))))
3863 (build-system ant-build-system)
3864 (arguments
29428e10
JL
3865 `(#:jar-name "junit.jar"
3866 #:source-dir "src/main/java"
3867 #:test-dir "src/test"
3868 #:test-exclude (list "**/SimpleTest.java" "**/StackTracesTest.java"
3869 "**/RuleChainTest.java" "**/TestWatchmanTest.java")
3870 #:phases
3871 (modify-phases %standard-phases
3872 (add-before 'check 'copy-test-resources
3873 (lambda _
3874 (copy-recursively "src/test/resources" "build/test-classes")
fff4fcc4
JL
3875 #t))
3876 (replace 'install
3877 (install-from-pom "pom.xml")))))
29428e10 3878 (propagated-inputs
d0184f44 3879 `(("java-hamcrest-core" ,java-hamcrest-core)))
29428e10
JL
3880 (native-inputs
3881 `(("java-hamcrest-library" ,java-hamcrest-library)))
42c1c59e 3882 (home-page "https://junit.org/junit4/")
d0184f44
RW
3883 (synopsis "Test framework for Java")
3884 (description
3885 "JUnit is a simple framework to write repeatable tests for Java projects.
3886JUnit provides assertions for testing expected results, test fixtures for
3887sharing common test data, and test runners for running tests.")
3888 (license license:epl1.0)))
9fb20d01 3889
52a23d8e
JL
3890(define-public java-junitparams
3891 (package
3892 (name "java-junitparams")
3893 (version "1.1.1")
3894 (source (origin
3895 (method git-fetch)
3896 (uri (git-reference
3897 (url "https://github.com/Pragmatists/JUnitParams")
3898 (commit (string-append "JUnitParams-" version))))
3899 (file-name (git-file-name name version))
3900 (sha256
3901 (base32
3902 "0rb52xdfp99invyjrras3w0bf0a81cz30yd47rkkiyqcqj0y1q9b"))))
3903 (build-system ant-build-system)
3904 (arguments
3905 `(#:jar-name "junitparams.jar"
3906 #:source-dir "src/main/java"
3907 #:test-dir "src/test"
3908 #:test-exclude (list "**/SuperclassTest.java")))
3909 (inputs
3910 `(("java-junit" ,java-junit)))
3911 (native-inputs
3912 `(("java-junit" ,java-junit)
3913 ("java-hamcrest-core" ,java-hamcrest-core)
3914 ("java-assertj" ,java-assertj)))
3915 (home-page "https://github.com/Pragmatists/JUnitParams")
3916 (synopsis "Parameterised test support for JUnit")
3917 (description "The JUnitParams project adds a new runner to JUnit and
3918provides much easier and readable parametrised tests for JUnit.")
3919 (license license:asl2.0)))
3920
9fb20d01
RW
3921(define-public java-plexus-utils
3922 (package
3923 (name "java-plexus-utils")
b3971a5c
JL
3924 ;; sisu-build-api needs this version, later versions don't work
3925 (version "3.2.1")
9fb20d01 3926 (source (origin
c53badd4
EF
3927 (method git-fetch)
3928 (uri (git-reference
3929 (url "https://github.com/codehaus-plexus/plexus-utils")
3930 (commit (string-append "plexus-utils-" version))))
3931 (file-name (git-file-name name version))
9fb20d01
RW
3932 (sha256
3933 (base32
b3971a5c 3934 "1w169glixyk94jbczj8jzg897lsab46jihiaa3dhw0p06g35va8b"))))
9fb20d01
RW
3935 (build-system ant-build-system)
3936 ;; FIXME: The default build.xml does not include a target to install
3937 ;; javadoc files.
3938 (arguments
3939 `(#:jar-name "plexus-utils.jar"
3940 #:source-dir "src/main"
3941 #:phases
3942 (modify-phases %standard-phases
3943 (add-after 'unpack 'fix-reference-to-/bin-and-/usr
3944 (lambda _
3945 (substitute* "src/main/java/org/codehaus/plexus/util/\
3946cli/shell/BourneShell.java"
3947 (("/bin/sh") (which "sh"))
3948 (("/usr/") (getcwd)))
3949 #t))
3950 (add-after 'unpack 'fix-or-disable-broken-tests
3951 (lambda _
3952 (with-directory-excursion "src/test/java/org/codehaus/plexus/util"
3953 (substitute* '("cli/CommandlineTest.java"
3954 "cli/shell/BourneShellTest.java")
3955 (("/bin/sh") (which "sh"))
3956 (("/bin/echo") (which "echo")))
3957
3958 ;; This test depends on MavenProjectStub, but we don't have
3959 ;; a package for Maven.
3960 (delete-file "introspection/ReflectionValueExtractorTest.java")
3961
3962 ;; FIXME: The command line tests fail, maybe because they use
3963 ;; absolute paths.
b3971a5c
JL
3964 (delete-file "cli/CommandlineTest.java")
3965
3966 ;; These tests require openjdk jmh, which is not packaged yet
3967 (for-each delete-file (find-files "." "PerfTest.java$")))
3968 #t))
3969 (add-before 'build 'copy-resources
3970 (lambda _
3971 (copy-recursively "src/main/resources" "build/classes")
3972 #t))
3973 (replace 'install (install-from-pom "pom.xml")))))
9fb20d01 3974 (native-inputs
0cd8efcc
JL
3975 `(("java-hamcrest-core" ,java-hamcrest-core)
3976 ("java-junit" ,java-junit)))
b3971a5c
JL
3977 (propagated-inputs
3978 `(("plexus-parent-pom" ,plexus-parent-pom-5.1)))
1b4d40cf 3979 (home-page "https://codehaus-plexus.github.io/plexus-utils/")
9fb20d01
RW
3980 (synopsis "Common utilities for the Plexus framework")
3981 (description "This package provides various Java utility classes for the
3982Plexus framework to ease working with strings, files, command lines, XML and
3983more.")
3984 (license license:asl2.0)))
1e555562 3985
2ddf13ae
JL
3986(define-public java-plexus-utils-3.3.0
3987 (package
3988 (inherit java-plexus-utils)
3989 (version "3.3.0")
3990 (source (origin
3991 (method git-fetch)
3992 (uri (git-reference
3993 (url "https://github.com/codehaus-plexus/plexus-utils")
3994 (commit (string-append "plexus-utils-" version))))
3995 (file-name (git-file-name "java-plexus-utils" version))
3996 (sha256
3997 (base32
3998 "0d0fq21rzjy0j55kcp8w9k1rbq9rwr0r7cc8239p9jbz54vihp0g"))))))
3999
1e555562
HG
4000(define-public java-plexus-interpolation
4001 (package
4002 (name "java-plexus-interpolation")
6671d6a1 4003 (version "1.26")
1e555562 4004 (source (origin
c4b67ba3
EF
4005 (method git-fetch)
4006 (uri (git-reference
4007 (url "https://github.com/codehaus-plexus/plexus-interpolation")
4008 (commit (string-append "plexus-interpolation-" version))))
4009 (file-name (git-file-name name version))
1e555562
HG
4010 (sha256
4011 (base32
6671d6a1 4012 "1rahjmhywf6d5m32qzlc9izawyvcd71abfm9k03f13rs2xmfxzlh"))))
1e555562
HG
4013 (build-system ant-build-system)
4014 (arguments
4015 `(#:jar-name "plexus-interpolation.jar"
6671d6a1
JL
4016 #:source-dir "src/main"
4017 #:phases
4018 (modify-phases %standard-phases
4019 (replace 'install (install-from-pom "pom.xml")))))
4020 (propagated-inputs
4021 `(("plexus-parent-pom-5.1" ,plexus-parent-pom-5.1)))
1e555562
HG
4022 (native-inputs
4023 `(("java-junit" ,java-junit)
4024 ("java-hamcrest-core" ,java-hamcrest-core)))
35e74723 4025 (home-page "https://codehaus-plexus.github.io/plexus-interpolation/")
1e555562
HG
4026 (synopsis "Java components for interpolating ${} strings and the like")
4027 (description "Plexus interpolator is a modular, flexible interpolation
4028framework for the expression language style commonly seen in Maven, Plexus,
4029and other related projects.
4030
4031It has its foundation in the @code{org.codehaus.plexus.utils.interpolation}
4032package within @code{plexus-utils}, but has been separated in order to allow
4033these two libraries to vary independently of one another.")
4034 (license license:asl2.0)))
8f8ed9aa 4035
bb27eb0d
JL
4036(define-public java-plexus-classworlds
4037 (package
4038 (name "java-plexus-classworlds")
ae913096 4039 (version "2.6.0")
bb27eb0d 4040 (source (origin
9520b2b1
EF
4041 (method git-fetch)
4042 (uri (git-reference
4043 (url "https://github.com/codehaus-plexus/plexus-classworlds")
4044 (commit (string-append "plexus-classworlds-" version))))
4045 (file-name (git-file-name name version))
bb27eb0d
JL
4046 (sha256
4047 (base32
ae913096 4048 "034k2hgvj1saalwbnzrbg4n0zgzwcpz1lhlb8q4kgglsp9pmm03s"))))
bb27eb0d
JL
4049 (build-system ant-build-system)
4050 (arguments
4051 `(#:jar-name "plexus-classworlds.jar"
4052 #:source-dir "src/main"
ae913096
JL
4053 #:tests? #f;; FIXME: we need to generate some resources as in pom.xml
4054 #:phases
4055 (modify-phases %standard-phases
4056 (replace 'install (install-from-pom "pom.xml")))))
4057 (propagated-inputs
4058 `(("plexus-parent-pom-5.1" ,plexus-parent-pom-5.1)))
bb27eb0d
JL
4059 (native-inputs
4060 `(("java-junit" ,java-junit)))
268dc472 4061 (home-page "https://codehaus-plexus.github.io/plexus-classworlds/")
bb27eb0d 4062 (synopsis "Java class loader framework")
f4548394
TGR
4063 (description "Plexus classworlds replaces the native @code{ClassLoader}
4064mechanism of Java. It is especially useful for dynamic loading of application
bb27eb0d
JL
4065components.")
4066 (license license:asl2.0)))
4067
a7ad92ad 4068(define java-plexus-container-default-bootstrap
0726d4ea
JL
4069 (package
4070 (name "java-plexus-container-default-bootstrap")
4071 (version "1.7.1")
4072 (source (origin
3a26ea3a
EF
4073 (method git-fetch)
4074 (uri (git-reference
4075 (url "https://github.com/codehaus-plexus/plexus-containers")
4076 (commit (string-append "plexus-containers-" version))))
4077 (file-name (git-file-name name version))
0726d4ea
JL
4078 (sha256
4079 (base32
3a26ea3a 4080 "1316hrp5vqfv0aw7miq2fp0wwy833h66h502h29vnh5sxj27x228"))))
0726d4ea
JL
4081 (build-system ant-build-system)
4082 (arguments
4083 `(#:jar-name "container-default.jar"
4084 #:source-dir "plexus-container-default/src/main/java"
4085 #:test-dir "plexus-container-default/src/test"
0726d4ea
JL
4086 #:tests? #f; requires plexus-archiver, which depends on this package
4087 #:phases
4088 (modify-phases %standard-phases
02ed96dc
JL
4089 (add-before 'build 'fix-google-collections
4090 (lambda _
4091 ;; Google collections are now replaced with guava
4092 (substitute* "plexus-container-default/pom.xml"
4093 (("google-collections") "guava")
4094 (("com.google.collections") "com.google.guava"))
4095 #t))
0726d4ea
JL
4096 (add-before 'build 'copy-resources
4097 (lambda _
4098 (copy-recursively
4099 "plexus-container-default/src/main/resources/"
4100 "build/classes")
02ed96dc
JL
4101 #t))
4102 (replace 'install
4103 (install-from-pom "plexus-container-default/pom.xml")))))
4104 (propagated-inputs
4105 `(("java-plexus-worldclass" ,java-plexus-classworlds)
4106 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
4107 ("java-plexus-utils" ,java-plexus-utils)
4108 ("java-junit" ,java-junit)
4109 ("java-guava" ,java-guava)
4110 ("java-plexus-containers-parent-pom" ,java-plexus-containers-parent-pom)))
0726d4ea 4111 (home-page "https://github.com/codehaus-plexus/plexus-containers")
f4548394 4112 (synopsis "Inversion-of-control container")
0726d4ea 4113 (description "Plexus-default-container is Plexus' inversion-of-control
f4548394 4114(@dfn{IoC}) container. It is composed of its public API and its default
0726d4ea
JL
4115implementation.")
4116 (license license:asl2.0)))
4117
02ed96dc
JL
4118(define java-plexus-containers-parent-pom
4119 (package
4120 (inherit java-plexus-container-default-bootstrap)
4121 (name "java-plexus-containers-parent-pom")
4122 (arguments
4123 `(#:tests? #f
4124 #:phases
4125 (modify-phases %standard-phases
4126 (delete 'configure)
4127 (delete 'build)
4128 (replace 'install
4129 (install-pom-file "pom.xml")))))
4130 (propagated-inputs
4131 `(("plexus-parent-pom" ,plexus-parent-pom-4.0)))))
4132
0858b9dc
JL
4133(define-public java-plexus-io
4134 (package
4135 (name "java-plexus-io")
79265a45 4136 (version "3.2.0")
0858b9dc 4137 (source (origin
48fe942c
EF
4138 (method git-fetch)
4139 (uri (git-reference
4140 (url "https://github.com/codehaus-plexus/plexus-io")
4141 (commit (string-append "plexus-io-" version))))
4142 (file-name (git-file-name name version))
0858b9dc
JL
4143 (sha256
4144 (base32
79265a45 4145 "1r3wqfpbxq8vp4p914i8p88r0994rmcjw02hz14n11cfb6gsyvlr"))))
0858b9dc
JL
4146 (build-system ant-build-system)
4147 (arguments
4148 `(#:jar-name "plexus-io.jar"
4149 #:source-dir "src/main/java"
4150 #:test-dir "src/test"
0858b9dc
JL
4151 #:phases
4152 (modify-phases %standard-phases
4153 (add-before 'build 'copy-resources
4154 (lambda _
79265a45
JL
4155 (mkdir-p "build/classes")
4156 (copy-recursively "src/main/resources" "build/classes")
4157 (mkdir-p "build/test-classes")
4158 (copy-recursively "src/test/resources" "build/test-classes")
4159 #t))
4160 (replace 'install (install-from-pom "pom.xml")))))
4161 (propagated-inputs
4162 `(("java-plexus-utils" ,java-plexus-utils-3.3.0)
4163 ("java-commons-io" ,java-commons-io)
4164 ("plexus-parent-pom" ,plexus-parent-pom-5.1)))
0858b9dc 4165 (inputs
79265a45 4166 `(("java-jsr305" ,java-jsr305)))
0858b9dc
JL
4167 (native-inputs
4168 `(("junit" ,java-junit)
4169 ("hamcrest" ,java-hamcrest-core)
4170 ("guava" ,java-guava)
4171 ("classworlds" ,java-plexus-classworlds)
4172 ("xbean" ,java-geronimo-xbean-reflect)
4173 ("container-default" ,java-plexus-container-default-bootstrap)))
4174 (home-page "https://github.com/codehaus-plexus/plexus-io")
4175 (synopsis "I/O plexus components")
4176 (description "Plexus IO is a set of plexus components, which are designed
4177for use in I/O operations. This implementation using plexus components allows
4178reusing it in maven.")
4179 (license license:asl2.0)))
4180
b51df3ca
JL
4181(define-public java-plexus-archiver
4182 (package
4183 (name "java-plexus-archiver")
02ed96dc 4184 (version "4.2.2")
b51df3ca
JL
4185 (source (origin
4186 (method url-fetch)
4187 (uri (string-append "https://github.com/codehaus-plexus/plexus-archiver"
4188 "/archive/plexus-archiver-" version ".tar.gz"))
4189 (sha256
4190 (base32
02ed96dc 4191 "144n971r3lfrx3l12nf2scm80x4xdvgbkk4bjpa4vcvvdrll6qys"))))
b51df3ca
JL
4192 (build-system ant-build-system)
4193 (arguments
4194 `(#:jar-name "plexus-archiver.jar"
4195 #:source-dir "src/main/java"
b51df3ca
JL
4196 #:test-dir "src/test"
4197 #:test-exclude (list "**/Abstract*.java" "**/Base*.java")
4198 #:phases
4199 (modify-phases %standard-phases
4200 (add-before 'check 'remove-failing
4201 (lambda _
4202 ;; Requires an older version of plexus container
4203 (delete-file
2c8ac364
MW
4204 "src/test/java/org/codehaus/plexus/archiver/DuplicateFilesTest.java")
4205 #t))
6f737ae6
JL
4206 (add-before 'check 'fix-test-building
4207 (lambda _
4208 (substitute* "build.xml"
4209 (("srcdir=\"src/test\"") "srcdir=\"src/test/java\""))
4210 #t))
b51df3ca
JL
4211 (add-before 'build 'copy-resources
4212 (lambda _
02ed96dc
JL
4213 (mkdir-p "build/classes")
4214 (copy-recursively "src/main/resources" "build/classes")
4215 (mkdir-p "build/test-classes")
4216 (copy-recursively "src/test/resources" "build/test-classes")
4217 #t))
4218 (replace 'install (install-from-pom "pom.xml")))))
4219 (propagated-inputs
4220 `(("java-plexus-utils" ,java-plexus-utils-3.3.0)
4221 ("java-plexus-io" ,java-plexus-io)
4222 ("java-iq80-snappy" ,java-iq80-snappy)
4223 ("java-commons-compress" ,java-commons-compress)
4224 ("plexus-parent-pom" ,plexus-parent-pom-6.1)))
b51df3ca 4225 (inputs
02ed96dc
JL
4226 `(("java-jsr305" ,java-jsr305)
4227 ("java-plexus-container-default"
4228 ,java-plexus-container-default-bootstrap)))
b51df3ca 4229 (native-inputs
6f737ae6
JL
4230 `(("java-hamcrest-core" ,java-hamcrest-core)
4231 ("junit" ,java-junit)
b51df3ca
JL
4232 ("classworld" ,java-plexus-classworlds)
4233 ("xbean" ,java-geronimo-xbean-reflect)
d308bc01 4234 ("xz" ,java-xz)
b51df3ca
JL
4235 ("guava" ,java-guava)))
4236 (home-page "https://github.com/codehaus-plexus/plexus-archiver")
4237 (synopsis "Archiver component of the Plexus project")
4238 (description "Plexus-archiver contains a component to deal with project
4239archives (jar).")
4240 (license license:asl2.0)))
4241
a0837294
JL
4242(define-public java-plexus-container-default
4243 (package
4244 (inherit java-plexus-container-default-bootstrap)
4245 (name "java-plexus-container-default")
4246 (arguments
4247 `(#:jar-name "container-default.jar"
4248 #:source-dir "plexus-container-default/src/main/java"
4249 #:test-dir "plexus-container-default/src/test"
4250 #:test-exclude (list ;"**/*Test.java"
4251 "**/Abstract*.java"
4252 ;; Requires plexus-hierarchy
4253 "**/PlexusHierarchyTest.java"
4254 ;; Failures
4255 "**/ComponentRealmCompositionTest.java"
4256 "**/PlexusContainerTest.java")
a0837294
JL
4257 #:phases
4258 (modify-phases %standard-phases
51087d51
JL
4259 (add-before 'build 'fix-google-collections
4260 (lambda _
4261 ;; Google collections are now replaced with guava
4262 (substitute* "plexus-container-default/pom.xml"
4263 (("google-collections") "guava")
4264 (("com.google.collections") "com.google.guava"))
4265 #t))
a0837294
JL
4266 (add-before 'build 'copy-resources
4267 (lambda _
4268 (copy-recursively
4269 "plexus-container-default/src/main/resources/"
4270 "build/classes")
4271 #t))
4272 (add-before 'check 'fix-paths
4273 (lambda _
4274 (let ((dir "plexus-container-default/src/test/java/org/codehaus"))
4275 (substitute*
4276 (string-append
4277 dir "/plexus/component/composition/"
4278 "ComponentRealmCompositionTest.java")
4279 (("src/test") "plexus-container-default/src/test"))
51087d51
JL
4280 #t)))
4281 (replace 'install
4282 (install-from-pom "plexus-container-default/pom.xml")))))
a0837294
JL
4283 (inputs
4284 `(("worldclass" ,java-plexus-classworlds)
4285 ("xbean" ,java-geronimo-xbean-reflect)
4286 ("utils" ,java-plexus-utils)
4287 ("junit" ,java-junit)
4288 ("guava" ,java-guava)))
4289 (native-inputs
4290 `(("archiver" ,java-plexus-archiver)
4291 ("hamcrest" ,java-hamcrest-core)))))
4292
3214afab
JL
4293(define-public java-plexus-component-annotations
4294 (package
4295 (inherit java-plexus-container-default)
4296 (name "java-plexus-component-annotations")
4297 (arguments
4298 `(#:jar-name "plexus-component-annotations.jar"
4299 #:source-dir "plexus-component-annotations/src/main/java"
51087d51
JL
4300 #:tests? #f; no tests
4301 #:phases
4302 (modify-phases %standard-phases
4303 (replace 'install
4304 (install-from-pom "plexus-component-annotations/pom.xml")))))
4305 (propagated-inputs
4306 `(("java-plexus-containers-parent-pom" ,java-plexus-containers-parent-pom)))
3214afab
JL
4307 (inputs '())
4308 (native-inputs '())
4309 (synopsis "Plexus descriptors generator")
4310 (description "This package is a Maven plugin to generate Plexus descriptors
4311from source tags and class annotations.")))
4312
015e8774
JL
4313(define-public java-plexus-component-metadata
4314 (package
4315 (inherit java-plexus-container-default)
4316 (name "java-plexus-component-metadata")
4317 (arguments
4318 `(#:jar-name "plexus-component-metadata.jar"
4319 #:source-dir "src/main/java"
4320 #:test-dir "src/test"
4321 #:jdk ,icedtea-8
4322 #:phases
4323 (modify-phases %standard-phases
4324 (add-before 'configure 'chdir
4325 (lambda _
4326 (chdir "plexus-component-metadata")
4327 #t))
4328 (add-before 'build 'copy-resources
4329 (lambda _
4330 (copy-recursively "src/main/resources"
4331 "build/classes/")
4332 #t)))))
4333 (propagated-inputs
4334 `(("java-plexus-container-default" ,java-plexus-container-default)
4335 ("java-plexu-component-annotations" ,java-plexus-component-annotations)
4336 ("java-plexus-utils" ,java-plexus-utils)
4337 ("java-plexus-cli" ,java-plexus-cli)
4338 ("java-plexus-classworlds" ,java-plexus-classworlds)
4339 ("maven-plugin-api" ,maven-plugin-api)
4340 ("maven-plugin-annotations" ,maven-plugin-annotations)
4341 ("maven-core-bootstrap" ,maven-core-bootstrap)
4342 ("maven-model" ,maven-model)
4343 ("java-commons-cli" ,java-commons-cli)
4344 ("java-qdox" ,java-qdox)
4345 ("java-jdom2" ,java-jdom2)
4346 ("java-asm" ,java-asm)))
4347 (native-inputs
4348 `(("java-junit" ,java-junit)
4349 ("java-guava" ,java-guava)
4350 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)))
4351 (synopsis "Inversion-of-control container for Maven")
4352 (description "The Plexus project provides a full software stack for creating
4353and executing software projects. Based on the Plexus container, the
4354applications can utilise component-oriented programming to build modular,
4355reusable components that can easily be assembled and reused. This package
4356provides the Maven plugin generating the component metadata.")))
4357
4f77ba17
JL
4358(define-public java-plexus-cipher
4359 (package
4360 (name "java-plexus-cipher")
4361 (version "1.7")
4362 (source (origin
d0e64613
EF
4363 (method git-fetch)
4364 (uri (git-reference
4365 (url "https://github.com/codehaus-plexus/plexus-cipher")
4366 (commit (string-append "plexus-cipher-" version))))
4367 (file-name (git-file-name name version))
4f77ba17
JL
4368 (sha256
4369 (base32
d0e64613 4370 "0m638nzlxbmnbcj5cwdpgs326ab584yv0k803zlx37r6iqwvf6b0"))))
4f77ba17
JL
4371 (build-system ant-build-system)
4372 (arguments
4373 `(#:jar-name "plexus-cipher.jar"
4374 #:source-dir "src/main/java"
4f77ba17
JL
4375 #:tests? #f; FIXME: requires sisu-inject-bean
4376 #:phases
4377 (modify-phases %standard-phases
4378 (add-before 'build 'copy-resources
4379 (lambda _
4380 (copy-recursively "src/main/resources" "build/classes")
4381 (mkdir-p "build/classes/META-INF/sisu")
4382 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4383 (lambda _
4384 (display "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
51087d51
JL
4385 #t))
4386 (add-before 'install 'fix-test-dependency
4387 (lambda _
4388 ;; sisu-inject-bean is only used for tests, but its scope is "provided".
4389 (substitute* "pom.xml"
4390 (("provided") "test"))
4391 #t))
4392 (replace 'install (install-from-pom "pom.xml")))))
4f77ba17
JL
4393 (inputs
4394 `(("java-cdi-api" ,java-cdi-api)
4395 ("java-javax-inject" ,java-javax-inject)))
51087d51
JL
4396 (propagated-inputs
4397 `(("java-sonatype-spice-parent-pom" ,java-sonatype-spice-parent-pom-15)))
4398 (native-inputs
4399 `(("java-junit" ,java-junit)))
4f77ba17
JL
4400 (home-page "https://github.com/sonatype/plexus-cipher")
4401 (synopsis "Encryption/decryption Component")
4402 (description "Plexus-cipher contains a component to deal with encryption
4403and decryption.")
4404 (license license:asl2.0)))
4405
8630a080
JL
4406(define-public java-plexus-java
4407 (package
4408 (name "java-plexus-java")
4409 (version "0.9.10")
4410 (source (origin
4411 (method git-fetch)
4412 (uri (git-reference
4413 (url "https://github.com/codehaus-plexus/plexus-languages")
4414 (commit (string-append "plexus-languages-" version))))
4415 (file-name (git-file-name name version))
4416 (sha256
4417 (base32
4418 "0vmvgq5hfxs90yyxgssfpwq78l7vwx1ljwpkk594mrdr8sm668b5"))
4419 (modules '((guix build utils)))
4420 (snippet
4421 `(begin
4422 (for-each delete-file (find-files "." ".*.jar$"))
4423 #t))))
4424 (build-system ant-build-system)
4425 (arguments
4426 `(#:jar-name "plexus-java.java"
4427 #:source-dir "plexus-java/src/main/java"
4428 #:test-dir "plexus-java/src/test"
4429 #:tests? #f; require mockito 2
4430 #:phases
4431 (modify-phases %standard-phases
4432 (add-after 'build 'generate-metadata
4433 (lambda _
4434 (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
4435 "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
4436 "--source" "plexus-java/src/main/java"
4437 "--output" "build/classes/META-INF/plexus/components.xml"
4438 "--classes" "build/classes"
4439 "--descriptors" "build/classes/META-INF")
4440 (invoke "ant" "jar")
4441 #t))
4442 (add-before 'install 'install-parent
4443 (install-pom-file "pom.xml"))
4444 (replace 'install
4445 (install-from-pom "plexus-java/pom.xml")))))
4446 (propagated-inputs
4447 `(("java-asm" ,java-asm)
4448 ("java-qdox" ,java-qdox-2-M9)
4449 ("java-javax-inject" ,java-javax-inject)
4450 ("plexus-parent-pom" ,plexus-parent-pom-4.0)))
4451 (inputs
4452 `(("java-plexus-component-annotations" ,java-plexus-component-annotations)))
4453 (native-inputs
4454 `(("java-plexus-component-metadata" ,java-plexus-component-metadata)
4455 ("java-junit" ,java-junit)))
4456 (home-page "https://codehaus-plexus.github.io/plexus-languages/plexus-java")
4457 (synopsis "Shared language features for Java")
4458 (description "This package contains shared language features of the Java
4459language, for the plexus project.")
4460 (license license:asl2.0)))
4461
239126d4
JL
4462(define-public java-plexus-compiler-api
4463 (package
4464 (name "java-plexus-compiler-api")
a70182b0 4465 (version "2.8.4")
239126d4 4466 (source (origin
5723137a
EF
4467 (method git-fetch)
4468 (uri (git-reference
4469 (url "https://github.com/codehaus-plexus/plexus-compiler")
4470 (commit (string-append "plexus-compiler-" version))))
4471 (file-name (git-file-name name version))
239126d4
JL
4472 (sha256
4473 (base32
5723137a 4474 "1nq1gnn3s6z1j29gmi1hqbklsmm8b1lmnafb0191914f95mn18gk"))))
239126d4
JL
4475 (build-system ant-build-system)
4476 (arguments
4477 `(#:jar-name "plexus-compiler-api.jar"
4478 #:source-dir "plexus-compiler-api/src/main/java"
90a1d04c
JL
4479 #:test-dir "plexus-compiler-api/src/test"
4480 #:phases
4481 (modify-phases %standard-phases
4482 (replace 'install
4483 (install-from-pom "plexus-compiler-api/pom.xml")))))
4484 (propagated-inputs
239126d4 4485 `(("java-plexus-container-default" ,java-plexus-container-default)
90a1d04c 4486 ("java-plexus-compiler-pom" ,java-plexus-compiler-pom)
239126d4
JL
4487 ("java-plexus-util" ,java-plexus-utils)))
4488 (native-inputs
4489 `(("java-junit" ,java-junit)))
4490 (home-page "https://github.com/codehaus-plexus/plexus-compiler")
4491 (synopsis "Plexus Compilers component's API to manipulate compilers")
4492 (description "This package contains the API used by components to manipulate
4493compilers.")
4494 (license (list license:asl2.0
4495 license:expat))))
4496
90a1d04c
JL
4497(define java-plexus-compiler-pom
4498 (package
4499 (inherit java-plexus-compiler-api)
4500 (name "java-plexus-compiler-pom")
4501 (arguments
4502 `(#:tests? #f
4503 #:phases
4504 (modify-phases %standard-phases
4505 (delete 'configure)
4506 (delete 'build)
4507 (replace 'install
4508 (install-pom-file "pom.xml"))
4509 (add-after 'install 'install-compilers
4510 (install-pom-file "plexus-compilers/pom.xml")))))
4511 (propagated-inputs
4512 `(("plexus-components-parent-pom-4.0" ,plexus-components-parent-pom-4.0)))))
4513
4514(define plexus-components-parent-pom-4.0
4515 (package
4516 (name "plexus-components-parent-pom")
4517 (version "4.0")
4518 (source (origin
4519 (method git-fetch)
4520 (uri (git-reference
4521 (url "https://github.com/codehaus-plexus/plexus-components")
4522 (commit (string-append "plexus-components-" version))))
5723137a 4523 (file-name (git-file-name name version))
239126d4
JL
4524 (sha256
4525 (base32
90a1d04c 4526 "041bm8yv0m2i17mqg8zljib4ykpha7ijls2qfdwvkma4d39lhysi"))))
239126d4
JL
4527 (build-system ant-build-system)
4528 (arguments
90a1d04c
JL
4529 `(#:tests? #f
4530 #:phases
4531 (modify-phases %standard-phases
4532 (delete 'configure)
4533 (delete 'build)
4534 (replace 'install
4535 (install-pom-file "pom.xml")))))
4536 (propagated-inputs
4537 `(("plexus-parent-pom-4.0" ,plexus-parent-pom-4.0)))
4538 (home-page "https://codehaus-plexus.github.io/plexus-components")
4539 (synopsis "Plexus parent pom")
4540 (description "This package contains the Plexus components parent POM.")
4541 (license license:asl2.0)))
4542
4543(define-public java-plexus-compiler-manager
4544 (package
4545 (inherit java-plexus-compiler-api)
4546 (name "java-plexus-compiler-manager")
4547 (arguments
4548 `(#:jar-name "compiler-compiler-manager.java"
4549 #:source-dir "plexus-compiler-manager/src/main/java"
4550 #:test-dir "plexus-compiler-manager/src/test"
4551 #:tests? #f
4552 #:phases
4553 (modify-phases %standard-phases
4554 (add-after 'build 'generate-metadata
4555 (lambda _
4556 (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
4557 "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
4558 "--source" "plexus-compiler-manager/src/main/java"
4559 "--output" "build/classes/META-INF/plexus/components.xml"
4560 "--classes" "build/classes"
4561 "--descriptors" "build/classes/META-INF")
4562 (invoke "ant" "jar")
4563 #t))
4564 (add-after 'generate-metadata 'rebuild
4565 (lambda _
4566 (invoke "ant" "jar")
4567 #t))
4568 (replace 'install
4569 (install-from-pom "plexus-compiler-manager/pom.xml")))))
4570 (propagated-inputs
4571 `(("java-plexus-compiler-api" ,java-plexus-compiler-api)
4572 ("java-plexus-compiler-pom" ,java-plexus-compiler-pom)
4573 ("java-plexus-container-default" ,java-plexus-container-default)))
239126d4 4574 (native-inputs
90a1d04c
JL
4575 `(("unzip" ,unzip)
4576 ("java-plexus-component-metadata" ,java-plexus-component-metadata)))
4577 (synopsis "Compiler management for Plexus Compiler component")
4578 (description "Plexus Compiler is a Plexus component to use different
4579compilers through a uniform API. This component chooses the compiler
4580implementation to use in a project.")))
239126d4 4581
f8a519fa
JL
4582(define-public java-plexus-compiler-javac
4583 (package
4584 (inherit java-plexus-compiler-api)
4585 (name "java-plexus-compiler-javac")
4586 (arguments
4587 `(#:jar-name "plexus-compiler-javac.jar"
4588 #:source-dir "plexus-compilers/plexus-compiler-javac/src/main/java"
4589 #:jdk ,icedtea-8
4590 #:tests? #f; depends on compiler-test -> maven-core -> ... -> this package.
90a1d04c
JL
4591 #:test-dir "plexus-compilers/plexus-compiler-javac/src/test"
4592 #:modules ((guix build ant-build-system)
4593 (guix build utils)
4594 (guix build java-utils)
4595 (sxml simple))
4596 #:phases
4597 (modify-phases %standard-phases
4598 ;; We cannot use java-plexus-component-metadata to generate the metadata
4599 ;; because it ultimately depends on this package.
4600 ;; Create it manually instead
4601 (add-before 'build 'create-metadata
4602 (lambda _
4603 (let* ((dir "build/classes/META-INF/plexus")
4604 (file (string-append dir "/components.xml")))
4605 (mkdir-p dir)
4606 (with-output-to-file file
4607 (lambda _
4608 (sxml->xml
4609 `(component-set
4610 (components
4611 (component
4612 (role "org.codehaus.plexus.compiler.Compiler")
4613 (role-hint "javac")
4614 (implementation "org.codehaus.plexus.compiler.javac.JavacCompiler")
4615 (isolated-realm "false"))))))))
4616 #t))
4617 (replace 'install
4618 (install-from-pom "plexus-compilers/plexus-compiler-javac/pom.xml")))))
4619 (propagated-inputs
f8a519fa
JL
4620 `(("java-plexus-compiler-api" ,java-plexus-compiler-api)
4621 ("java-plexus-utils" ,java-plexus-utils)
4622 ("java-plexus-container-default" ,java-plexus-container-default)))
f8a519fa
JL
4623 (synopsis "Javac Compiler support for Plexus Compiler component")
4624 (description "This package contains the Javac Compiler support for Plexus
4625Compiler component.")))
4626
6a25a3b1
JL
4627(define plexus-components-pom-1.1.20
4628 (package
4629 (name "plexus-components-pom-1.1.20")
4630 (version "1.1.20")
4631 (source (origin
4632 (method git-fetch)
4633 (uri (git-reference
4634 (url "https://github.com/codehaus-plexus/plexus-components")
4635 (commit (string-append "plexus-components-" version))))
4636 (file-name (git-file-name name version))
4637 (sha256
4638 (base32
4639 "1q254k95m9icyfsvaw8c226midg8v6v436wvivhv7im825mnp5yb"))))
4640 (build-system ant-build-system)
4641 (arguments
4642 `(#:tests? #f
4643 #:phases
4644 (modify-phases %standard-phases
4645 (delete 'configure)
4646 (delete 'build)
4647 (replace 'install
4648 (install-pom-file "pom.xml")))))
4649 (propagated-inputs
4650 `(("plexus-parent-pom" ,plexus-parent-pom-3.1)))
4651 (home-page "https://github.com/codehaus-plexus/plexus-components")
4652 (synopsis "Maven parent pom for plexus packages")
4653 (description "This package contains the parent pom for plexus component
4654packages.")
4655 (license license:asl2.0)))
4656
4657(define-public java-plexus-digest
4658 (package
4659 (name "java-plexus-digest")
4660 (version "1.2")
4661 (source (origin
4662 (method git-fetch)
4663 (uri (git-reference
4664 (url "https://github.com/codehaus-plexus/plexus-digest")
4665 (commit "2a52ad1bda8297fa0e287163d2fa37245ec6a430")))
4666 (file-name (git-file-name name version))
4667 (sha256
4668 (base32
4669 "19w5wxsliz8r42niry68qa665kvjsb8081dazg9vgd3pca72w07x"))))
4670 (build-system ant-build-system)
4671 (arguments
4672 `(#:jar-name "plexus-digest.jar"
4673 #:source-dir "src/main/java"
4674 #:tests? #f
4675 #:phases
4676 (modify-phases %standard-phases
4677 (replace 'install
4678 (install-from-pom "pom.xml")))))
4679 (propagated-inputs
4680 `(("java-plexus-utils" ,java-plexus-utils)
4681 ("plexus-components-pom-1.1.20" ,plexus-components-pom-1.1.20)))
4682 (native-inputs
4683 `(("java-junit" ,java-junit)))
4684 (home-page "https://github.com/codehaus-plexus/plexus-digest")
4685 (synopsis "Hash function utilities for Java")
4686 (description "This package is a plexus component that contains hash
4687function utilities.")
4688 (license license:asl2.0)))
4689
0aa85081
JL
4690(define-public java-plexus-sec-dispatcher
4691 (package
4692 (name "java-plexus-sec-dispatcher")
4693 (version "1.4") ;; Newest release listed at the Maven Central Repository.
4694 (source (origin
4695 ;; This project doesn't tag releases or publish tarballs, so we take
4696 ;; the "prepare release plexus-sec-dispatcher-1.4" git commit.
d9e356a8
EF
4697 (method git-fetch)
4698 (uri (git-reference
4699 (url "https://github.com/sonatype/plexus-sec-dispatcher/")
4700 (commit "7db8f880486e192a1c5ea9544e01e756c3d49d0f")))
0aa85081
JL
4701 (sha256
4702 (base32
d9e356a8
EF
4703 "1ng4yliy4cqpjr4fxxjbpwyk1wkch5f8vblm1kvwf328s4gibszs"))
4704 (file-name (git-file-name name version))))
0aa85081
JL
4705 (arguments
4706 `(#:jar-name "plexus-sec-dispatcher.jar"
4707 #:source-dir "src/main/java"
0aa85081
JL
4708 #:phases
4709 (modify-phases %standard-phases
4710 (add-before 'build 'generate-models
4711 (lambda* (#:key inputs #:allow-other-keys)
4712 (define (modello-single-mode file version mode)
2c8ac364
MW
4713 (invoke "java"
4714 "org.codehaus.modello.ModelloCli"
4715 file mode "src/main/java" version
4716 "false" "true"))
0aa85081 4717 (let ((file "src/main/mdo/settings-security.mdo"))
0aa85081
JL
4718 (modello-single-mode file "1.0.0" "java")
4719 (modello-single-mode file "1.0.0" "xpp3-reader")
2c8ac364
MW
4720 (modello-single-mode file "1.0.0" "xpp3-writer"))
4721 #t))
0aa85081
JL
4722 (add-before 'build 'generate-components.xml
4723 (lambda _
4724 (mkdir-p "build/classes/META-INF/plexus")
4725 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
4726 (lambda _
4727 (display
4728 "<component-set>\n
4729 <components>\n
4730 <component>\n
4731 <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role>\n
4732 <role-hint>default</role-hint>\n
4733 <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation>\n
4734 <description></description>\n
4735 <requirements>\n
4736 <requirement>\n
4737 <role>org.sonatype.plexus.components.cipher.PlexusCipher</role>\n
4738 <field-name>_cipher</field-name>\n
4739 </requirement>\n
4740 <requirement>\n
4741 <role>org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor</role>\n
4742 <field-name>_decryptors</field-name>\n
4743 </requirement>\n
4744 </requirements>\n
4745 <configuration>\n
4746 <_configuration-file>~/.settings-security.xml</_configuration-file>\n
4747 </configuration>\n
4748 </component>\n
4749 </components>\n
2c8ac364
MW
4750</component-set>\n")))
4751 #t))
0aa85081
JL
4752 (add-before 'check 'fix-paths
4753 (lambda _
2c8ac364 4754 (copy-recursively "src/test/resources" "target")
51087d51
JL
4755 #t))
4756 (replace 'install (install-from-pom "pom.xml")))))
4757 (propagated-inputs
4758 `(("java-plexus-utils" ,java-plexus-utils)
4759 ("java-plexus-cipher" ,java-plexus-cipher)
4760 ("java-sonatype-spice-parent-pom" ,java-sonatype-spice-parent-pom-12)))
0aa85081
JL
4761 (native-inputs
4762 `(("java-modello-core" ,java-modello-core)
4763 ;; for modello:
4764 ("java-plexus-container-default" ,java-plexus-container-default)
4765 ("java-plexus-classworlds" ,java-plexus-classworlds)
4766 ("java-plexus-utils" ,java-plexus-utils)
4767 ("java-guava" ,java-guava)
4768 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
4769 ("java-sisu-build-api" ,java-sisu-build-api)
4770 ;; modello plugins:
4771 ("java-modellop-plugins-java" ,java-modello-plugins-java)
4772 ("java-modellop-plugins-xml" ,java-modello-plugins-xml)
4773 ("java-modellop-plugins-xpp3" ,java-modello-plugins-xpp3)
4774 ;; for tests
4775 ("java-junit" ,java-junit)))
4776 (build-system ant-build-system)
4777 (home-page "https://github.com/sonatype/plexus-sec-dispatcher")
4778 (synopsis "Plexus Security Dispatcher Component")
4779 (description "This package is the Plexus Security Dispatcher Component.
4780This component decrypts a string passed to it.")
4781 (license license:asl2.0)))
4782
7d65489f
JL
4783(define-public java-plexus-cli
4784 (package
4785 (name "java-plexus-cli")
4786 (version "1.7")
4787 (source (origin
4788 (method git-fetch)
4789 (uri (git-reference
4790 (url "https://github.com/sonatype/plexus-cli")
4791 (commit "a776afa6bca84e5107bedb69440329cdb24ed645")))
4792 (file-name (string-append name "-" version))
4793 (sha256
4794 (base32
4795 "0xjrlay605rypv3zd7y24vlwf0039bil3n2cqw54r1ddpysq46vx"))))
4796 (build-system ant-build-system)
4797 (arguments
4798 `(#:jar-name "plexus-cli.jar"
4799 #:source-dir "src/main/java"
4800 #:jdk ,icedtea-8
4801 #:test-dir "src/test"))
4802 (inputs
4803 `(("java-commons-cli" ,java-commons-cli)
4804 ("java-plexus-container-default" ,java-plexus-container-default)
4805 ("java-plexus-classworlds" ,java-plexus-classworlds)))
4806 (native-inputs
4807 `(("java-plexus-utils" ,java-plexus-utils)
4808 ("java-junit" ,java-junit)
4809 ("java-guava" ,java-guava)))
4810 (home-page "https://codehaus-plexus.github.io/plexus-cli")
4811 (synopsis "CLI building library for plexus")
4812 (description "This package is a library to help creating CLI around
4813Plexus components.")
4814 (license license:asl2.0)))
4815
8f524749
JL
4816(define-public java-sisu-build-api
4817 (package
4818 (name "java-sisu-build-api")
4819 (version "0.0.7")
4820 (source (origin
16c62763
EF
4821 (method git-fetch)
4822 (uri (git-reference
4823 (url "https://github.com/sonatype/sisu-build-api")
4824 (commit (string-append "plexus-build-api-" version))))
4825 (file-name (git-file-name name version))
8f524749
JL
4826 (sha256
4827 (base32
16c62763 4828 "1d5w6c58gkx30d51v7qwv1xrhc0ly76848gihmgshj19yf6yhca0"))))
8f524749
JL
4829 (build-system ant-build-system)
4830 (arguments
4831 `(#:jar-name "sisu-build-api.jar"
4832 #:source-dir "src/main/java"
4833 #:jdk ,icedtea-8
4834 #:tests? #f; FIXME: how to run the tests?
4835 #:phases
4836 (modify-phases %standard-phases
4837 (add-before 'build 'copy-resources
4838 (lambda _
4839 (copy-recursively "src/main/resources" "build/classes")
4840 (substitute* (find-files "build/classes")
4841 (("\\$\\{project.version\\}") ,version))
4842 #t))
4843 (add-before 'build 'generate-plexus-compontent
4844 (lambda _
4845 (mkdir-p "build/classes/META-INF/plexus")
4846 ;; This file is required for plexus to inject this package.
4847 ;; FIXME: how is it generated?
4848 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
4849 (lambda _
4850 (display
4851 "<component-set>\n
4852 <components>\n
4853 <component>\n
4854 <role>org.sonatype.plexus.build.incremental.BuildContext</role>\n
4855 <role-hint>default</role-hint>\n
4856 <implementation>org.sonatype.plexus.build.incremental.DefaultBuildContext</implementation>\n
4857 <description>Filesystem based non-incremental build context implementation\n
4858which behaves as if all files were just created.</description>\n
4859 </component>\n
4860 </components>\n
4861</component-set>\n")))
f0e3e6ca
JL
4862 #t))
4863 (replace 'install
4864 (install-from-pom "pom.xml")))))
8f524749
JL
4865 (inputs
4866 `(("java-plexus-utils" ,java-plexus-utils)
4867 ("java-plexus-container-default" ,java-plexus-container-default)))
4868 (home-page "https://github.com/sonatype/sisu-build-api/")
4869 (synopsis "Base build API for maven")
4870 (description "This package contains the base build API for maven and
4871a default implementation of it. This API is about scanning files in a
4872project and determining what files need to be rebuilt.")
4873 (license license:asl2.0)))
4874
b26c8b61
JL
4875(define-public java-modello-core
4876 (package
4877 (name "java-modello-core")
4878 (version "1.9.1")
4879 (source (origin
df9487c5
EF
4880 (method git-fetch)
4881 (uri (git-reference
4882 (url "https://github.com/codehaus-plexus/modello")
4883 (commit (string-append "modello-" version))))
4884 (file-name (git-file-name name version))
b26c8b61
JL
4885 (sha256
4886 (base32
df9487c5 4887 "1di6ni42aqllpdvkpyfcw70352vr2i8wf6hd5nhd9kmqjb5dj5j4"))))
b26c8b61
JL
4888 (build-system ant-build-system)
4889 (arguments
4890 `(#:jar-name "modello-core.jar"
4891 #:source-dir "modello-core/src/main/java"
4892 #:test-dir "modello-core/src/test"
4893 #:main-class "org.codehaus.modello.ModelloCli"
4894 #:jdk ,icedtea-8
4895 #:phases
4896 (modify-phases %standard-phases
4897 (add-before 'build 'copy-resources
4898 (lambda _
4899 (mkdir-p "build/classes/META-INF/plexus")
4900 (copy-file "modello-core/src/main/resources/META-INF/plexus/components.xml"
4901 "build/classes/META-INF/plexus/components.xml")
4902 #t))
4903 (add-before 'check 'fix-tests
4904 (lambda _
4905 (with-directory-excursion "modello-core/src/test/java/org/codehaus"
4906 (substitute* '("modello/core/DefaultModelloCoreTest.java"
4907 "modello/core/io/ModelReaderTest.java")
4908 (("src/test") "modello-core/src/test")))
4909 #t)))))
29534ff7 4910 (propagated-inputs
b26c8b61
JL
4911 `(("java-plexus-utils" ,java-plexus-utils)
4912 ("java-plexus-container-default" ,java-plexus-container-default)
4913 ("java-sisu-build-api" ,java-sisu-build-api)))
4914 (native-inputs
4915 `(("java-junit" ,java-junit)
4916 ("java-plexus-classworlds" ,java-plexus-classworlds)
4917 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
4918 ("java-guava" ,java-guava)))
7942a129 4919 (home-page "https://codehaus-plexus.github.io/modello/")
b26c8b61
JL
4920 (synopsis "Framework for code generation from a simple model")
4921 (description "Modello is a framework for code generation from a simple model.
4922
4923Modello generates code from a simple model format: based on a plugin
4924architecture, various types of code and descriptors can be generated from the
4925single model, including Java POJOs, XML/JSON/YAML marshallers/unmarshallers,
4926XSD and documentation.")
4927 (license (list
4928 license:expat
4929 ;; Although this package uses only files licensed under expat,
4930 ;; other parts of the source are licensed under different
4931 ;; licenses. We include them to be inherited by other packages.
4932 license:asl2.0
4933 ;; Some files in modello-plugin-java are licensed under a
4934 ;; 5-clause BSD license.
4935 (license:non-copyleft
4936 (string-append "file:///modello-plugins/modello-plugin-java/"
4937 "src/main/java/org/codehaus/modello/plugin/"
4938 "java/javasource/JNaming.java"))))))
4939
fc620bef
JL
4940(define-public java-modello-plugins-java
4941 (package
4942 (inherit java-modello-core)
4943 (name "java-modello-plugins-java")
4944 (arguments
4945 `(#:jar-name "modello-plugins-java.jar"
4946 #:source-dir "modello-plugins/modello-plugin-java/src/main/java"
4947 #:test-dir "modello-plugins/modello-plugin-java/src/test"
4948 #:jdk ,icedtea-8
4949 #:tests? #f; requires maven-model, which depends on this package
4950 #:phases
4951 (modify-phases %standard-phases
4952 (add-before 'build 'copy-resources
4953 (lambda _
4954 (mkdir-p "build/classes")
4955 (copy-recursively "modello-plugins/modello-plugin-java/src/main/resources"
4956 "build/classes")
4957 #t)))))
4958 (inputs
29534ff7 4959 `(("java-modello-core" ,java-modello-core)))
fc620bef
JL
4960 (synopsis "Modello Java Plugin")
4961 (description "Modello Java Plugin generates Java objects for the model.")))
4962
a0ce95ba
JL
4963(define-public java-modello-plugins-xml
4964 (package
4965 (inherit java-modello-core)
4966 (name "java-modello-plugins-xml")
4967 (arguments
4968 `(#:jar-name "modello-plugins-xml.jar"
4969 #:source-dir "modello-plugins/modello-plugin-xml/src/main/java"
4970 #:test-dir "modello-plugins/modello-plugin-xml/src/test"
4971 #:jdk ,icedtea-8
4972 #:phases
4973 (modify-phases %standard-phases
4974 (add-before 'build 'copy-resources
4975 (lambda _
4976 (mkdir-p "build/classes")
4977 (copy-recursively
4978 "modello-plugins/modello-plugin-xml/src/main/resources"
4979 "build/classes")
4980 #t))
4981 (add-before 'check 'fix-paths
4982 (lambda _
4983 (with-directory-excursion "modello-plugins/modello-plugin-xml/src/test"
4984 (substitute*
4985 "java/org/codehaus/modello/plugins/xml/XmlModelloPluginTest.java"
2c8ac364
MW
4986 (("src/test") "modello-plugins/modello-plugin-xml/src/test")))
4987 #t)))))
29534ff7 4988 (propagated-inputs
a0ce95ba 4989 `(("java-modello-core" ,java-modello-core)
29534ff7 4990 ("java-modello-plugins-java" ,java-modello-plugins-java)))
a0ce95ba
JL
4991 (synopsis "Modello XML Plugin")
4992 (description "Modello XML Plugin contains shared code for every plugins
4993working on XML representation of the model.")))
4994
e4708560
JL
4995(define-public java-modello-test
4996 (package
4997 (inherit java-modello-core)
4998 (name "java-modello-test")
4999 (arguments
5000 `(#:jar-name "modello-test.jar"
5001 #:source-dir "modello-test/src/main/java"
5002 #:tests? #f; no tests
5003 #:jdk ,icedtea-8))
5004 (inputs
5005 `(("java-plexus-utils" ,java-plexus-utils)
5006 ("java-plexus-compiler-api" ,java-plexus-compiler-api)
5007 ("java-plexus-compiler-javac" ,java-plexus-compiler-javac)
5008 ("java-plexus-container-default" ,java-plexus-container-default)))
5009 (synopsis "Modello test package")
5010 (description "The modello test package contains the basis to create
5011Modello generator unit-tests, including sample models and xml files to test
5012every feature for every plugin.")))
5013
36607d3b
JL
5014(define-public java-modello-plugins-xpp3
5015 (package
5016 (inherit java-modello-core)
5017 (name "java-modello-plugins-xpp3")
5018 (arguments
5019 `(#:jar-name "modello-plugins-xpp3.jar"
5020 #:source-dir "modello-plugins/modello-plugin-xpp3/src/main/java"
5021 #:test-dir "modello-plugins/modello-plugin-xpp3/src/test"
5022 ;; One of the test dependencies is maven-model which depends on this package.
5023 #:tests? #f
5024 #:jdk ,icedtea-8
5025 #:phases
5026 (modify-phases %standard-phases
5027 (add-before 'build 'copy-resources
5028 (lambda _
5029 (mkdir-p "build/classes")
5030 (copy-recursively "modello-plugins/modello-plugin-xpp3/src/main/resources"
5031 "build/classes")
5032 #t)))))
29534ff7 5033 (propagated-inputs
36607d3b
JL
5034 `(("java-modello-core" ,java-modello-core)
5035 ("java-modello-plugins-java" ,java-modello-plugins-java)
29534ff7 5036 ("java-modello-plugins-xml" ,java-modello-plugins-xml)))
36607d3b
JL
5037 (native-inputs
5038 `(("java-xmlunit" ,java-xmlunit)
5039 ("java-modello-test" ,java-modello-test)
5040 ,@(package-native-inputs java-modello-core)))
5041 (synopsis "Modello XPP3 Plugin")
5042 (description "The modello XPP3 plugin generates XML readers and writers based
5043on the XPP3 API (XML Pull Parser).")))
5044
8f8ed9aa
RW
5045(define-public java-asm
5046 (package
5047 (name "java-asm")
d0e9ded7 5048 (version "6.0")
8f8ed9aa
RW
5049 (source (origin
5050 (method url-fetch)
654f997d 5051 (uri (string-append "https://download.forge.ow2.org/asm/"
8f8ed9aa
RW
5052 "asm-" version ".tar.gz"))
5053 (sha256
5054 (base32
d0e9ded7 5055 "115l5pqblirdkmzi32dxx7gbcm4jy0s14y5wircr6h8jdr9aix00"))))
8f8ed9aa
RW
5056 (build-system ant-build-system)
5057 (arguments
5058 `(#:build-target "compile"
5059 ;; The tests require an old version of Janino, which no longer compiles
5060 ;; with the JDK7.
5061 #:tests? #f
d0e9ded7
GB
5062 #:make-flags
5063 (list
5064 ;; We don't need these extra ant tasks, but the build system asks us to
5065 ;; provide a path anyway.
5066 "-Dobjectweb.ant.tasks.path=dummy-path"
5067 ;; The java-aqute.bndlib JAR file will be put onto the classpath and
5068 ;; used during the build automatically by ant-build-system, but
5069 ;; java-asm's build.xml fails unless we provide something here.
5070 "-Dbiz.aQute.bnd.path=dummy-path")
8f8ed9aa
RW
5071 #:phases
5072 (modify-phases %standard-phases
30b7704a
JL
5073 (add-before 'build 'remove-bnd-dependency
5074 (lambda _
5075 ;; This file is the only one to require bnd, and is not needed
5076 ;; because we don't build a bundle.
5077 (delete-file "src/org/objectweb/asm/tools/ModuleInfoBndPlugin.java")
5078 #t))
8f8ed9aa
RW
5079 (add-before 'install 'build-jars
5080 (lambda* (#:key make-flags #:allow-other-keys)
5081 ;; We cannot use the "jar" target because it depends on a couple
5082 ;; of unpackaged, complicated tools.
5083 (mkdir "dist")
2c8ac364
MW
5084 (invoke "jar"
5085 "-cf" (string-append "dist/asm-" ,version ".jar")
5086 "-C" "output/build/tmp" ".")))
51087d51
JL
5087 (add-before 'install 'fix-pom
5088 (lambda _
5089 (substitute* (find-files "archive" "\\.pom$")
5090 (("@product.artifact@") ,version))
5091 #t))
5092 (add-before 'install 'install-parent
5093 (install-pom-file "archive/asm-parent.pom"))
8f8ed9aa 5094 (replace 'install
51087d51 5095 (install-from-pom "archive/asm.pom")))))
8f8ed9aa
RW
5096 (native-inputs
5097 `(("java-junit" ,java-junit)))
51087d51
JL
5098 (propagated-inputs
5099 `(("java-org-ow2-parent-pom" ,java-org-ow2-parent-pom-1.3)))
1e4ae551 5100 (home-page "https://asm.ow2.io/")
8f8ed9aa
RW
5101 (synopsis "Very small and fast Java bytecode manipulation framework")
5102 (description "ASM is an all purpose Java bytecode manipulation and
5103analysis framework. It can be used to modify existing classes or dynamically
5104generate classes, directly in binary form. The provided common
a4cb4d17 5105transformations and analysis algorithms allow easily assembling custom
8f8ed9aa
RW
5106complex transformations and code analysis tools.")
5107 (license license:bsd-3)))
607fe24a 5108
51087d51
JL
5109(define java-org-ow2-parent-pom-1.3
5110 (package
5111 (name "java-org-ow2-parent-pom")
5112 (version "1.3")
5113 (source (origin
5114 (method url-fetch)
5115 (uri "https://repo1.maven.org/maven2/org/ow2/ow2/1.3/ow2-1.3.pom")
5116 (sha256
5117 (base32
5118 "1yr8hfx8gffpppa4ii6cvrsq029a6x8hzy7nsavxhs60s9kmq8ai"))))
5119 (build-system ant-build-system)
5120 (arguments
5121 `(#:tests? #f
5122 #:phases
5123 (modify-phases %standard-phases
5124 (delete 'unpack)
5125 (delete 'build)
5126 (delete 'configure)
5127 (replace 'install
5128 (install-pom-file (assoc-ref %build-inputs "source"))))))
5129 (home-page "https://ow2.org")
5130 (synopsis "Ow2.org parent pom")
5131 (description "This package contains the parent pom for projects from ow2.org,
5132including java-asm.")
5133 (license license:lgpl2.1+)))
5134
bfb4004d
GB
5135(define java-asm-bootstrap
5136 (package
5137 (inherit java-asm)
5138 (name "java-asm-bootstrap")
5139 (arguments
5140 (substitute-keyword-arguments (package-arguments java-asm)
5141 ((#:tests? _) #f)))
30b7704a 5142 (native-inputs `())))
bfb4004d 5143
fafd543f
JL
5144(define-public java-asm-8
5145 (package
5146 (inherit java-asm)
5147 (version "8.0.1")
5148 (source (origin
5149 (method git-fetch)
5150 (uri (git-reference
5151 (url "https://gitlab.ow2.org/asm/asm")
5152 (commit (string-append
5153 "ASM_" (string-join (string-split version #\.)
5154 "_")))))
5155 (file-name (git-file-name "java-asm" version))
5156 (sha256
5157 (base32
5158 "1s6j27zc1i76gh891w2g48b1c3abp9w8zp5j54yb1vm5h8djkd69"))))
5159 (arguments
5160 `(#:jar-name "asm8.jar"
5161 #:source-dir "asm/src/main/java"
5162 #:test-dir "asm/src/test"
5163 ;; tests depend on junit5
5164 #:tests? #f))
5165 (propagated-inputs '())
5166 (native-inputs '())))
5167
d9d42624
JL
5168(define-public java-asm-tree-8
5169 (package
5170 (inherit java-asm-8)
5171 (name "java-asm-tree")
5172 (arguments
5173 `(#:jar-name "asm-tree.jar"
5174 #:source-dir "asm-tree/src/main/java"
5175 #:test-dir "asm-tree/src/test"
5176 ;; tests depend on junit5
5177 #:tests? #f))
5178 (inputs
5179 `(("java-asm" ,java-asm-8)))))
5180
d7f7c752
JL
5181(define-public java-asm-analysis-8
5182 (package
5183 (inherit java-asm-8)
5184 (name "java-asm-analysis")
5185 (arguments
5186 `(#:jar-name "asm-analysis.jar"
5187 #:source-dir "asm-analysis/src/main/java"
5188 #:test-dir "asm-analysis/src/test"
5189 ;; tests depend on junit5
5190 #:tests? #f))
5191 (inputs
5192 `(("java-asm" ,java-asm-8)
5193 ("java-asm-tree" ,java-asm-tree-8)))))
5194
f37de56a
JL
5195(define-public java-asm-util-8
5196 (package
5197 (inherit java-asm-8)
5198 (name "java-asm-util")
5199 (arguments
5200 `(#:jar-name "asm-util8.jar"
5201 #:source-dir "asm-util/src/main/java"
5202 #:test-dir "asm-util/src/test"
5203 ;; tests depend on junit5
5204 #:tests? #f))
5205 (inputs
5206 `(("java-asm" ,java-asm-8)
5207 ("java-asm-analysis" ,java-asm-analysis-8)
5208 ("java-asm-tree" ,java-asm-tree-8)))))
5209
607fe24a
RW
5210(define-public java-cglib
5211 (package
5212 (name "java-cglib")
5213 (version "3.2.4")
5c44505b
TGR
5214 (source
5215 (origin
5216 (method git-fetch)
5217 (uri (git-reference
b0e7b699 5218 (url "https://github.com/cglib/cglib")
5c44505b
TGR
5219 (commit (string-append
5220 "RELEASE_"
5221 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
5222 version)))))
5223 (file-name (git-file-name name version))
5224 (sha256
5225 (base32 "186451jms2zfp47yd8kxd77az2cqal1my2br7klgyp8fpl4qfg8v"))))
607fe24a
RW
5226 (build-system ant-build-system)
5227 (arguments
5228 `(;; FIXME: tests fail because junit runs
5229 ;; "net.sf.cglib.transform.AbstractTransformTest", which does not seem
5230 ;; to describe a test at all.
5231 #:tests? #f
5232 #:jar-name "cglib.jar"
5233 #:phases
5234 (modify-phases %standard-phases
5235 (add-after 'unpack 'chdir
5236 (lambda _ (chdir "cglib") #t)))))
5237 (inputs
5238 `(("java-asm" ,java-asm)
5239 ("java-junit" ,java-junit)))
5240 (home-page "https://github.com/cglib/cglib/")
5241 (synopsis "Java byte code generation library")
5242 (description "The byte code generation library CGLIB is a high level API
5243to generate and transform Java byte code.")
5244 (license license:asl2.0)))
33e34bfe
RW
5245
5246(define-public java-objenesis
5247 (package
5248 (name "java-objenesis")
5249 (version "2.5.1")
5250 (source (origin
3dc7a8ce
EF
5251 (method git-fetch)
5252 (uri (git-reference
5253 (url "https://github.com/easymock/objenesis")
5254 (commit version)))
5255 (file-name (git-file-name name version))
33e34bfe
RW
5256 (sha256
5257 (base32
3dc7a8ce 5258 "054yi200wj00x6dp1sxfrwgndwywadsbn8d8ij1j0v45j9g2vdya"))))
33e34bfe
RW
5259 (build-system ant-build-system)
5260 (arguments
5261 `(#:jar-name "objenesis.jar"
5262 #:source-dir "main/src/"
5263 #:test-dir "main/src/test/"))
5264 (native-inputs
5265 `(("java-junit" ,java-junit)
5266 ("java-hamcrest-core" ,java-hamcrest-core)))
5267 (home-page "http://objenesis.org/")
5268 (synopsis "Bypass the constructor when creating an object")
5269 (description "Objenesis is a small Java library that serves one purpose:
5270to instantiate a new object of a particular class. It is common to see
5271restrictions in libraries stating that classes must require a default
5272constructor. Objenesis aims to overcome these restrictions by bypassing the
5273constructor on object instantiation.")
5274 (license license:asl2.0)))
ae589876
RW
5275
5276(define-public java-easymock
5277 (package
5278 (name "java-easymock")
5279 (version "3.4")
5280 (source (origin
7cf90f64
EF
5281 (method git-fetch)
5282 (uri (git-reference
5283 (url "https://github.com/easymock/easymock/")
5284 (commit (string-append "easymock-" version))))
5285 (file-name (git-file-name name version))
ae589876
RW
5286 (sha256
5287 (base32
7cf90f64 5288 "02vybm8hc0i0n9sp2f2iiqn54zwqhq835f76wc6b2m7819z5a8dq"))))
ae589876
RW
5289 (build-system ant-build-system)
5290 (arguments
5291 `(#:jar-name "easymock.jar"
5292 #:source-dir "core/src/main"
5293 #:test-dir "core/src/test"
5294 #:phases
5295 (modify-phases %standard-phases
5296 ;; FIXME: Android support requires the following packages to be
5297 ;; available: com.google.dexmaker.stock.ProxyBuilder
5298 (add-after 'unpack 'delete-android-support
5299 (lambda _
5300 (with-directory-excursion "core/src/main/java/org/easymock/internal"
5301 (substitute* "MocksControl.java"
5302 (("AndroidSupport.isAndroid\\(\\)") "false")
5303 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
5304 (delete-file "AndroidClassProxyFactory.java"))
5305 #t))
5306 (add-after 'unpack 'delete-broken-tests
5307 (lambda _
5308 (with-directory-excursion "core/src/test/java/org/easymock"
5309 ;; This test depends on dexmaker.
5310 (delete-file "tests2/ClassExtensionHelperTest.java")
5311
5312 ;; This is not a test.
5313 (delete-file "tests/BaseEasyMockRunnerTest.java")
5314
5315 ;; This test should be executed with a different runner...
5316 (delete-file "tests2/EasyMockAnnotationsTest.java")
5317 ;; ...but deleting it means that we also have to delete these
5318 ;; dependent files.
5319 (delete-file "tests2/EasyMockRunnerTest.java")
5320 (delete-file "tests2/EasyMockRuleTest.java")
5321
5322 ;; This test fails because the file "easymock.properties" does
5323 ;; not exist.
5324 (delete-file "tests2/EasyMockPropertiesTest.java"))
5325 #t)))))
5326 (inputs
5327 `(("java-asm" ,java-asm)
5328 ("java-cglib" ,java-cglib)
5329 ("java-objenesis" ,java-objenesis)))
5330 (native-inputs
5331 `(("java-junit" ,java-junit)
5332 ("java-hamcrest-core" ,java-hamcrest-core)))
7cf90f64 5333 (home-page "https://easymock.org/")
ae589876
RW
5334 (synopsis "Java library providing mock objects for unit tests")
5335 (description "EasyMock is a Java library that provides an easy way to use
5336mock objects in unit testing.")
5337 (license license:asl2.0)))
7aa37023 5338
f12ad6c7
RW
5339(define-public java-jmock-1
5340 (package
5341 (name "java-jmock")
5342 (version "1.2.0")
5343 (source (origin
7cf26f24
EF
5344 (method git-fetch)
5345 (uri (git-reference
5346 (url "https://github.com/jmock-developers/jmock-library")
5347 (commit version)))
5348 (file-name (git-file-name name version))
f12ad6c7
RW
5349 (sha256
5350 (base32
7cf26f24 5351 "0lkga995xd9b9mmzxmcd301hlw83p1h78nibh7djlx7wydscr85z"))))
f12ad6c7
RW
5352 (build-system ant-build-system)
5353 (arguments
5354 `(#:build-target "jars"
5355 #:test-target "run.tests"
5356 #:phases
5357 (modify-phases %standard-phases
5358 (replace 'install (install-jars "build")))))
7cf26f24 5359 (home-page "http://jmock.org/")
f12ad6c7
RW
5360 (synopsis "Mock object library for test-driven development")
5361 (description "JMock is a library that supports test-driven development of
5362Java code with mock objects. Mock objects help you design and test the
5363interactions between the objects in your programs.
5364
5365The jMock library
5366
5367@itemize
5368@item makes it quick and easy to define mock objects
5369@item lets you precisely specify the interactions between
5370 your objects, reducing the brittleness of your tests
5371@item plugs into your favourite test framework
5372@item is easy to extend.
5373@end itemize\n")
5374 (license license:bsd-3)))
5375
045124ae
JL
5376(define-public java-jmock
5377 (package
5378 (inherit java-jmock-1)
5379 (name "java-jmock")
5380 (version "2.8.2")
5381 (source (origin
242af295
EF
5382 (method git-fetch)
5383 (uri (git-reference
5384 (url "https://github.com/jmock-developers/jmock-library")
5385 (commit version)))
5386 (file-name (git-file-name name version))
045124ae
JL
5387 (sha256
5388 (base32
242af295 5389 "12b7l22g3nrjvf2dzcw3z03fpd2chrgp0d8xkvn8w55rwb57pax6"))))
045124ae
JL
5390 (inputs
5391 `(("java-hamcrest-all" ,java-hamcrest-all)
5392 ("java-asm" ,java-asm)
5393 ("java-bsh" ,java-bsh)
5394 ("java-junit" ,java-junit)))
5395 (native-inputs
5396 `(("cglib" ,java-cglib)))
5397 (arguments
5398 `(#:jar-name "java-jmock.jar"
5399 #:source-dir "jmock/src/main/java"
5400 #:test-dir "jmock/src/test"))))
5401
25436c6d
JL
5402(define-public java-jmock-junit4
5403 (package
5404 (inherit java-jmock)
5405 (name "java-jmock-junit4")
5406 (arguments
5407 `(#:jar-name "java-jmock-junit4.jar"
5408 #:source-dir "jmock-junit4/src/main/java"
5409 #:test-dir "jmock-junit4/src/test"))
5410 (inputs
5411 `(("java-hamcrest-all" ,java-hamcrest-all)
5412 ("java-asm" ,java-asm)
5413 ("java-bsh" ,java-bsh)
5414 ("java-jmock" ,java-jmock)
5415 ("java-jumit" ,java-junit)))))
5416
e84b899d
JL
5417(define-public java-jmock-legacy
5418 (package
5419 (inherit java-jmock)
5420 (name "java-jmock-legacy")
5421 (arguments
5422 `(#:jar-name "java-jmock-legacy.jar"
5423 #:source-dir "jmock-legacy/src/main/java"
5424 #:test-dir "jmock-legacy/src/test"
5425 #:phases
5426 (modify-phases %standard-phases
5427 (add-before 'check 'copy-tests
5428 (lambda _
5429 ;; This file is a dependancy of some tests
5430 (let ((file "org/jmock/test/acceptance/PackageProtectedType.java"))
5431 (copy-file (string-append "jmock/src/test/java/" file)
5432 (string-append "jmock-legacy/src/test/java/" file))
5433 #t))))))
5434 (inputs
5435 `(("java-hamcrest-all" ,java-hamcrest-all)
5436 ("java-objenesis" ,java-objenesis)
5437 ("java-cglib" ,java-cglib)
5438 ("java-jmock" ,java-jmock)
5439 ("java-asm" ,java-asm)
5440 ("java-bsh" ,java-bsh)
5441 ("java-junit" ,java-junit)))
5442 (native-inputs
5443 `(("java-jmock-junit4" ,java-jmock-junit4)))))
5444
439c59da
RW
5445(define-public java-hamcrest-all
5446 (package (inherit java-hamcrest-core)
5447 (name "java-hamcrest-all")
5448 (arguments
bfc007e1
RW
5449 `(#:jdk ,icedtea-8
5450 ,@(substitute-keyword-arguments (package-arguments java-hamcrest-core)
5451 ((#:build-target _) "bigjar")
5452 ((#:phases phases)
5453 `(modify-phases ,phases
5454 ;; Some build targets override the classpath, so we need to patch
5455 ;; the build.xml to ensure that required dependencies are on the
5456 ;; classpath.
5457 (add-after 'unpack 'patch-classpath-for-integration
5458 (lambda* (#:key inputs #:allow-other-keys)
5459 (substitute* "build.xml"
5460 ((" build/hamcrest-library-\\$\\{version\\}.jar" line)
5461 (string-join
5462 (cons line
5463 (append
5464 (find-files (assoc-ref inputs "java-junit") "\\.jar$")
5465 (find-files (assoc-ref inputs "java-jmock") "\\.jar$")
5466 (find-files (assoc-ref inputs "java-easymock") "\\.jar$")))
2cc63e6f
RW
5467 ";"))
5468 (("build/hamcrest-core-\\$\\{version\\}\\.jar")
fff4fcc4
JL
5469 (car (find-files (assoc-ref inputs "java-hamcrest-core")
5470 "jar$"))))
5471 #t))
5472 (replace 'install
5473 (lambda* (#:key outputs #:allow-other-keys)
5474 (let* ((target (string-append (assoc-ref outputs "out")
5475 "/share/java/"))
5476 (version-suffix
5477 ,(string-append
5478 "-" (package-version java-hamcrest-core) ".jar"))
5479 (install-without-version-suffix
5480 (lambda (jar)
5481 (copy-file jar
5482 (string-append target
5483 (basename jar version-suffix)
5484 ".jar")))))
5485 (mkdir-p target)
5486 (for-each
5487 install-without-version-suffix
5488 (find-files "build"
5489 (lambda (name _)
5490 (and (string-suffix? ".jar" name)
5491 (not (string-suffix? "-sources.jar" name)))))))
bfc007e1 5492 #t)))))))
439c59da
RW
5493 (inputs
5494 `(("java-junit" ,java-junit)
5495 ("java-jmock" ,java-jmock-1)
2cc63e6f
RW
5496 ;; This is necessary because of what seems to be a race condition.
5497 ;; This package would sometimes fail to build because hamcrest-core.jar
5498 ;; could not be found, even though it is built as part of this package.
5499 ;; Adding java-hamcrest-core appears to fix this problem. See
5500 ;; https://debbugs.gnu.org/31390 for more information.
5501 ("java-hamcrest-core" ,java-hamcrest-core)
439c59da 5502 ("java-easymock" ,java-easymock)
439c59da
RW
5503 ,@(package-inputs java-hamcrest-core)))))
5504
7aa37023
RW
5505(define-public java-jopt-simple
5506 (package
5507 (name "java-jopt-simple")
5508 (version "5.0.3")
5509 (source (origin
5510 (method url-fetch)
5511 (uri (string-append "http://repo1.maven.org/maven2/"
5512 "net/sf/jopt-simple/jopt-simple/"
5513 version "/jopt-simple-"
5514 version "-sources.jar"))
5515 (sha256
5516 (base32
5517 "1v8bzmwmw6qq20gm42xyay6vrd567dra4vqwhgjnqqjz1gs9f8qa"))))
5518 (build-system ant-build-system)
5519 (arguments
5520 `(#:tests? #f ; there are no tests
5521 #:jar-name "jopt-simple.jar"))
5522 (home-page "https://pholser.github.io/jopt-simple/")
5523 (synopsis "Java library for parsing command line options")
5524 (description "JOpt Simple is a Java library for parsing command line
5525options, such as those you might pass to an invocation of @code{javac}. In
5526the interest of striving for simplicity, as closely as possible JOpt Simple
5527attempts to honor the command line option syntaxes of POSIX @code{getopt} and
5528GNU @code{getopt_long}. It also aims to make option parser configuration and
5529retrieval of options and their arguments simple and expressive, without being
5530overly clever.")
5531 (license license:expat)))
840969e8
RW
5532
5533(define-public java-commons-math3
5534 (package
5535 (name "java-commons-math3")
5536 (version "3.6.1")
5537 (source (origin
5538 (method url-fetch)
5539 (uri (string-append "mirror://apache/commons/math/source/"
5540 "commons-math3-" version "-src.tar.gz"))
5541 (sha256
5542 (base32
5543 "19l6yp44qc5g7wg816nbn5z3zq3xxzwimvbm4a8pczgvpi4i85s6"))))
5544 (build-system ant-build-system)
5545 (arguments
5546 `(#:build-target "jar"
5547 #:test-target "test"
5548 #:make-flags
5549 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
5550 (junit (assoc-ref %build-inputs "java-junit")))
fff4fcc4
JL
5551 (list (string-append "-Djunit.jar="
5552 (car (find-files junit "jar$")))
5553 (string-append "-Dhamcrest.jar="
5554 (car (find-files hamcrest ".*.jar$")))))
840969e8
RW
5555 #:phases
5556 (modify-phases %standard-phases
5557 ;; We want to build the jar in the build phase and run the tests
5558 ;; later in a separate phase.
5559 (add-after 'unpack 'untangle-targets
5560 (lambda _
5561 (substitute* "build.xml"
5562 (("name=\"jar\" depends=\"test\"")
5563 "name=\"jar\" depends=\"compile\""))
5564 #t))
5565 ;; There is no install target.
5566 (replace 'install
5567 (install-jars "target")))))
5568 (native-inputs
5569 `(("java-junit" ,java-junit)
5570 ("java-hamcrest-core" ,java-hamcrest-core)))
4f236f84 5571 (home-page "https://commons.apache.org/math/")
840969e8
RW
5572 (synopsis "Apache Commons mathematics library")
5573 (description "Commons Math is a library of lightweight, self-contained
5574mathematics and statistics components addressing the most common problems not
5575available in the Java programming language or Commons Lang.")
5576 (license license:asl2.0)))
62c9bfaa
RW
5577
5578(define-public java-jmh
5579 (package
5580 (name "java-jmh")
5581 (version "1.17.5")
5582 (source (origin
5583 (method hg-fetch)
5584 (uri (hg-reference
5585 (url "http://hg.openjdk.java.net/code-tools/jmh/")
5586 (changeset version)))
5587 (file-name (string-append name "-" version "-checkout"))
5588 (sha256
5589 (base32
5590 "1fxyxhg9famwcg1prc4cgwb5wzyxqavn3cjm5vz8605xz7x5k084"))))
5591 (build-system ant-build-system)
5592 (arguments
5593 `(#:jar-name "jmh-core.jar"
5594 #:source-dir "jmh-core/src/main"
5595 #:test-dir "jmh-core/src/test"
5596 #:phases
5597 (modify-phases %standard-phases
5598 ;; This seems to be a bug in the JDK. It may not be necessary in
5599 ;; future versions of the JDK.
5600 (add-after 'unpack 'fix-bug
5601 (lambda _
5602 (with-directory-excursion
5603 "jmh-core/src/main/java/org/openjdk/jmh/runner/options"
5604 (substitute* '("IntegerValueConverter.java"
5605 "ThreadsValueConverter.java")
5606 (("public Class<Integer> valueType")
5607 "public Class<? extends Integer> valueType")))
5608 #t)))))
5609 (inputs
5610 `(("java-jopt-simple" ,java-jopt-simple)
5611 ("java-commons-math3" ,java-commons-math3)))
5612 (native-inputs
5613 `(("java-junit" ,java-junit)
5614 ("java-hamcrest-core" ,java-hamcrest-core)))
e799400d 5615 (home-page "https://openjdk.java.net/projects/code-tools/jmh/")
62c9bfaa
RW
5616 (synopsis "Benchmark harness for the JVM")
5617 (description "JMH is a Java harness for building, running, and analysing
5618nano/micro/milli/macro benchmarks written in Java and other languages
f4548394 5619targeting the JVM.")
62c9bfaa
RW
5620 ;; GPLv2 only
5621 (license license:gpl2)))
56ebb4e9
RW
5622
5623(define-public java-commons-collections4
5624 (package
5625 (name "java-commons-collections4")
5626 (version "4.1")
5627 (source (origin
5628 (method url-fetch)
5629 (uri (string-append "mirror://apache/commons/collections/source/"
5630 "commons-collections4-" version "-src.tar.gz"))
5631 (sha256
5632 (base32
5633 "1krfhvggympq4avk7gh6qafzf6b9ip6r1m4lmacikyx04039m0wl"))))
5634 (build-system ant-build-system)
5635 (arguments
5636 `(#:test-target "test"
5637 #:make-flags
5638 (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
5639 (junit (assoc-ref %build-inputs "java-junit"))
5640 (easymock (assoc-ref %build-inputs "java-easymock")))
fff4fcc4
JL
5641 (list (string-append "-Djunit.jar="
5642 (car (find-files junit "jar$")))
5643 (string-append "-Dhamcrest.jar="
5644 (car (find-files hamcrest "jar$")))
56ebb4e9
RW
5645 (string-append "-Deasymock.jar=" easymock
5646 "/share/java/easymock.jar")))
5647 #:phases
5648 (modify-phases %standard-phases
5649 (replace 'install
5650 (install-jars "target")))))
5651 (native-inputs
5652 `(("java-junit" ,java-junit)
5653 ("java-hamcrest-core" ,java-hamcrest-core)
5654 ("java-easymock" ,java-easymock)))
21e207d2 5655 (home-page "https://commons.apache.org/collections/")
56ebb4e9
RW
5656 (synopsis "Collections framework")
5657 (description "The Java Collections Framework is the recognised standard
5658for collection handling in Java. Commons-Collections seek to build upon the
5659JDK classes by providing new interfaces, implementations and utilities. There
5660are many features, including:
5661
5662@itemize
5663@item @code{Bag} interface for collections that have a number of copies of
5664 each object
5665@item @code{BidiMap} interface for maps that can be looked up from value to
5666 key as well and key to value
5667@item @code{MapIterator} interface to provide simple and quick iteration over
5668 maps
5669@item Transforming decorators that alter each object as it is added to the
5670 collection
5671@item Composite collections that make multiple collections look like one
5672@item Ordered maps and sets that retain the order elements are added in,
5673 including an LRU based map
5674@item Reference map that allows keys and/or values to be garbage collected
5675 under close control
5676@item Many comparator implementations
5677@item Many iterator implementations
5678@item Adapter classes from array and enumerations to collections
5679@item Utilities to test or create typical set-theory properties of collections
5680 such as union, intersection, and closure.
5681@end itemize\n")
5682 (license license:asl2.0)))
6af63e65 5683
229a9864
JL
5684(define-public java-commons-collections
5685 (package
5686 (inherit java-commons-collections4)
5687 (name "java-commons-collections")
5688 (version "3.2.2")
5689 (source (origin
5690 (method url-fetch)
5691 (uri (string-append "mirror://apache/commons/collections/source/"
5692 "commons-collections-" version "-src.tar.gz"))
5693 (sha256
5694 (base32
7c7323e4
GB
5695 "055r51a5lfc3z7rkxnxmnn1npvkvda7636hjpm4qk7cnfzz98387"))
5696 (patches
5697 (search-patches "java-commons-collections-fix-java8.patch"))))
229a9864
JL
5698 (arguments
5699 (substitute-keyword-arguments (package-arguments java-commons-collections4)
5700 ((#:phases phases)
5701 `(modify-phases ,phases
5702 ;; The manifest is required by the build procedure
5703 (add-before 'build 'add-manifest
5704 (lambda _
5705 (mkdir-p "build/conf")
5706 (call-with-output-file "build/conf/MANIFEST.MF"
5707 (lambda (file)
2c8ac364
MW
5708 (format file "Manifest-Version: 1.0\n")))
5709 #t))
229a9864
JL
5710 (replace 'install
5711 (install-jars "build"))))))))
5712
5aa2f3f4
JL
5713(define java-commons-collections-test-classes
5714 (package
5715 (inherit java-commons-collections)
5716 (arguments
5717 `(#:jar-name "commons-collections-test-classes.jar"
5718 #:source-dir "src/test"
5719 #:tests? #f))
5720 (inputs
5721 `(("collection" ,java-commons-collections)))))
5722
5723(define-public java-commons-beanutils
5724 (package
5725 (name "java-commons-beanutils")
5726 (version "1.9.3")
5727 (source (origin
5728 (method url-fetch)
5729 (uri (string-append "mirror://apache/commons/beanutils/source/"
5730 "commons-beanutils-" version "-src.tar.gz"))
5731 (sha256
5732 (base32
5733 "03cs0bq3sl1sdc7py9g3qnf8n9h473nrkvd3d251kaqv6a2ab7qk"))))
5734 (build-system ant-build-system)
5735 (arguments
5736 `(#:test-target "test"
5737 #:tests? #f
5738 #:phases
5739 (modify-phases %standard-phases
5740 (replace 'install
5741 (lambda* (#:key outputs #:allow-other-keys)
5742 (rename-file (string-append "dist/commons-beanutils-" ,version
5743 "-SNAPSHOT.jar")
5744 "commons-beanutils.jar")
5745 (install-file "commons-beanutils.jar"
5746 (string-append (assoc-ref outputs "out") "/share/java/"))
5747 #t)))))
5748 (inputs
5749 `(("logging" ,java-commons-logging-minimal)
5750 ("collections" ,java-commons-collections)))
5751 (native-inputs
5752 `(("junit" ,java-junit)
5753 ("collections-test" ,java-commons-collections-test-classes)))
4f236f84 5754 (home-page "https://commons.apache.org/beanutils/")
5aa2f3f4
JL
5755 (synopsis "Dynamically set or get properties in Java")
5756 (description "BeanUtils provides a simplified interface to reflection and
5757introspection to set or get dynamically determined properties through their
5758setter and getter method.")
5759 (license license:asl2.0)))
5760
6af63e65
HG
5761(define-public java-commons-io
5762 (package
5763 (name "java-commons-io")
5764 (version "2.5")
5765 (source
5766 (origin
5767 (method url-fetch)
5768 (uri (string-append "mirror://apache/commons/io/source/"
5769 "commons-io-" version "-src.tar.gz"))
5770 (sha256
5771 (base32
5772 "0q5y41jrcjvx9hzs47x5kdhnasdy6rm4bzqd2jxl02w717m7a7v3"))))
5773 (build-system ant-build-system)
5774 (outputs '("out" "doc"))
5775 (arguments
5776 `(#:test-target "test"
5777 #:make-flags
5778 (list (string-append "-Djunit.jar="
fff4fcc4
JL
5779 (car (find-files (assoc-ref %build-inputs "java-junit")
5780 "jar$"))))
6af63e65
HG
5781 #:phases
5782 (modify-phases %standard-phases
5783 (add-after 'build 'build-javadoc ant-build-javadoc)
79265a45 5784 (replace 'install (install-from-pom "pom.xml"))
6af63e65
HG
5785 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
5786 (native-inputs
5787 `(("java-junit" ,java-junit)
5788 ("java-hamcrest-core" ,java-hamcrest-core)))
79265a45
JL
5789 (propagated-inputs
5790 `(("apache-commons-parent-pom" ,apache-commons-parent-pom-39)))
4f236f84 5791 (home-page "https://commons.apache.org/io/")
6af63e65
HG
5792 (synopsis "Common useful IO related classes")
5793 (description "Commons-IO contains utility classes, stream implementations,
5794file filters and endian classes.")
5795 (license license:asl2.0)))
d631b5f3 5796
46f9022c
DM
5797(define-public java-commons-exec-1.1
5798 (package
5799 (name "java-commons-exec")
5800 (version "1.1")
5801 (source
5802 (origin
5803 (method url-fetch)
5804 (uri (string-append "mirror://apache/commons/exec/source/"
5805 "commons-exec-" version "-src.tar.gz"))
5806 (sha256
5807 (base32
5808 "025dk8xgj10lxwwwqp0hng2rn7fr4vcirxzydqzx9k4dim667alk"))))
5809 (build-system ant-build-system)
5810 (arguments
5811 `(#:test-target "test"
5812 #:make-flags
5813 (list (string-append "-Dmaven.junit.jar="
fff4fcc4
JL
5814 (car (find-files (assoc-ref %build-inputs "java-junit")
5815 "jar$"))))
46f9022c
DM
5816 #:phases
5817 (modify-phases %standard-phases
5818 (add-before 'build 'delete-network-tests
5819 (lambda _
5820 (delete-file "src/test/java/org/apache/commons/exec/DefaultExecutorTest.java")
5821 (substitute* "src/test/java/org/apache/commons/exec/TestRunner.java"
5822 (("suite\\.addTestSuite\\(DefaultExecutorTest\\.class\\);") ""))
5823 #t))
5824 ;; The "build" phase automatically tests.
5825 (delete 'check)
5826 (replace 'install (install-jars "target")))))
5827 (native-inputs
5828 `(("java-junit" ,java-junit)))
31b85761 5829 (home-page "https://commons.apache.org/proper/commons-exec/")
46f9022c
DM
5830 (synopsis "Common program execution related classes")
5831 (description "Commons-Exec simplifies executing external processes.")
5832 (license license:asl2.0)))
5833
5834(define-public java-commons-exec
5835 (package
5836 (inherit java-commons-exec-1.1)
5837 (version "1.3")
5838 (source
5839 (origin
5840 (method url-fetch)
5841 (uri (string-append "mirror://apache/commons/exec/source/"
5842 "commons-exec-" version "-src.tar.gz"))
5843 (sha256
5844 (base32
5845 "17yb4h6f8l49c5iyyvda4z2nmw0bxrx857nrwmsr7mmpb7x441yv"))))
5846 (arguments
5847 `(#:test-target "test"
5848 #:make-flags
5849 (list (string-append "-Dmaven.junit.jar="
fff4fcc4
JL
5850 (car (find-files (assoc-ref %build-inputs "java-junit")
5851 "jar$")))
46f9022c
DM
5852 "-Dmaven.compiler.source=1.7"
5853 "-Dmaven.compiler.target=1.7")
5854 #:phases
5855 (modify-phases %standard-phases
5856 (add-before 'build 'delete-network-tests
5857 (lambda* (#:key inputs #:allow-other-keys)
5858 ;; This test hangs indefinitely.
5859 (delete-file "src/test/java/org/apache/commons/exec/issues/Exec60Test.java")
5860 (substitute* "src/test/java/org/apache/commons/exec/issues/Exec41Test.java"
5861 (("ping -c 10 127.0.0.1") "sleep 10"))
5862 (substitute* "src/test/java/org/apache/commons/exec/issues/Exec49Test.java"
5863 (("/bin/ls") "ls"))
5864 (call-with-output-file "src/test/scripts/ping.sh"
5865 (lambda (port)
5866 (format port "#!~a/bin/sh\nsleep $1\n"
5867 (assoc-ref inputs "bash"))))
5868 #t))
5869 ;; The "build" phase automatically tests.
5870 (delete 'check)
5871 (replace 'install (install-jars "target")))))
5872 (native-inputs
5873 `(("java-junit" ,java-junit)
5874 ("java-hamcrest-core" ,java-hamcrest-core)))))
5875
d631b5f3
HG
5876(define-public java-commons-lang
5877 (package
5878 (name "java-commons-lang")
5879 (version "2.6")
5880 (source
5881 (origin
5882 (method url-fetch)
5883 (uri (string-append "mirror://apache/commons/lang/source/"
5884 "commons-lang-" version "-src.tar.gz"))
5885 (sha256
5886 (base32 "1mxwagqadzx1b2al7i0z1v0r235aj2njdyijf02szq0vhmqrfiq5"))))
5887 (build-system ant-build-system)
5888 (outputs '("out" "doc"))
5889 (arguments
5890 `(#:test-target "test"
e5a96113 5891 #:test-exclude (list "**/Abstract*.java" "**/Random*.java")
d631b5f3
HG
5892 #:phases
5893 (modify-phases %standard-phases
5894 (add-after 'build 'build-javadoc ant-build-javadoc)
5895 (add-before 'check 'disable-failing-test
5896 (lambda _
5897 ;; Disable a failing test
5898 (substitute* "src/test/java/org/apache/commons/lang/\
5899time/FastDateFormatTest.java"
5900 (("public void testFormat\\(\\)")
5901 "public void disabled_testFormat()"))
5902 #t))
5903 (replace 'install (install-jars "target"))
5904 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
5905 (native-inputs
5906 `(("java-junit" ,java-junit)))
4f236f84 5907 (home-page "https://commons.apache.org/lang/")
d631b5f3
HG
5908 (synopsis "Extension of the java.lang package")
5909 (description "The Commons Lang components contains a set of Java classes
5910that provide helper methods for standard Java classes, especially those found
5911in the @code{java.lang} package in the Sun JDK. The following classes are
5912included:
5913
5914@itemize
5915@item StringUtils - Helper for @code{java.lang.String}.
5916@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets
5917 of characters such as @code{[a-z]} and @code{[abcdez]}.
5918@item RandomStringUtils - Helper for creating randomised strings.
5919@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
5920@item NumberRange - A range of numbers with an upper and lower bound.
5921@item ObjectUtils - Helper for @code{java.lang.Object}.
5922@item SerializationUtils - Helper for serializing objects.
5923@item SystemUtils - Utility class defining the Java system properties.
5924@item NestedException package - A sub-package for the creation of nested
5925 exceptions.
5926@item Enum package - A sub-package for the creation of enumerated types.
5927@item Builder package - A sub-package for the creation of @code{equals},
5928 @code{hashCode}, @code{compareTo} and @code{toString} methods.
5929@end itemize\n")
5930 (license license:asl2.0)))
82e18864
HG
5931
5932(define-public java-commons-lang3
5933 (package
5934 (name "java-commons-lang3")
b916b638 5935 (version "3.9")
82e18864
HG
5936 (source
5937 (origin
5938 (method url-fetch)
5939 (uri (string-append "mirror://apache/commons/lang/source/"
5940 "commons-lang3-" version "-src.tar.gz"))
5941 (sha256
b916b638 5942 (base32 "0s4ffbvsyl16c90l45ximsg4dwd8hmz7wsza3p308fw43h6mwhb6"))))
82e18864 5943 (build-system ant-build-system)
82e18864 5944 (arguments
b916b638
JL
5945 `(#:jar-name "commons-lang3.jar"
5946 #:source-dir "src/main/java"
5947 #:tests? #f; require junit5
82e18864
HG
5948 #:phases
5949 (modify-phases %standard-phases
b916b638
JL
5950 (replace 'install (install-from-pom "pom.xml")))))
5951 (propagated-inputs
5952 `(("apache-commons-parent-pom" ,apache-commons-parent-pom-48)))
4f236f84 5953 (home-page "https://commons.apache.org/lang/")
82e18864
HG
5954 (synopsis "Extension of the java.lang package")
5955 (description "The Commons Lang components contains a set of Java classes
5956that provide helper methods for standard Java classes, especially those found
5957in the @code{java.lang} package. The following classes are included:
5958
5959@itemize
5960@item StringUtils - Helper for @code{java.lang.String}.
5961@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets of
5962 characters such as @code{[a-z]} and @code{[abcdez]}.
5963@item RandomStringUtils - Helper for creating randomised strings.
5964@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
5965@item NumberRange - A range of numbers with an upper and lower bound.
5966@item ObjectUtils - Helper for @code{java.lang.Object}.
5967@item SerializationUtils - Helper for serializing objects.
5968@item SystemUtils - Utility class defining the Java system properties.
5969@item NestedException package - A sub-package for the creation of nested
5970 exceptions.
5971@item Enum package - A sub-package for the creation of enumerated types.
5972@item Builder package - A sub-package for the creation of @code{equals},
5973 @code{hashCode}, @code{compareTo} and @code{toString} methods.
5974@end itemize\n")
5975 (license license:asl2.0)))
1c188f4e 5976
afb13a10
JL
5977(define-public java-commons-bsf
5978 (package
5979 (name "java-commons-bsf")
5980 (version "2.4.0")
5981 (source (origin
5982 (method url-fetch)
5983 (uri (string-append "mirror://apache/commons/bsf/source/bsf-src-"
5984 version ".tar.gz"))
5985 (sha256
5986 (base32
5987 "1sbamr8jl32p1jgf59nw0b2w9qivyg145954hm6ly54cfgsqrdas"))
5988 (modules '((guix build utils)))
5989 (snippet
5990 '(begin
5991 (for-each delete-file
5992 (find-files "." "\\.jar$"))
5993 #t))))
5994 (build-system ant-build-system)
5995 (arguments
5996 `(#:build-target "jar"
5997 #:tests? #f; No test file
5998 #:modules ((guix build ant-build-system)
5999 (guix build utils)
6000 (guix build java-utils)
6001 (sxml simple))
6002 #:phases
6003 (modify-phases %standard-phases
6004 (add-before 'build 'create-properties
6005 (lambda _
6006 ;; This file is missing from the distribution
6007 (call-with-output-file "build-properties.xml"
6008 (lambda (port)
6009 (sxml->xml
6010 `(project (@ (basedir ".") (name "build-properties") (default ""))
6011 (property (@ (name "project.name") (value "bsf")))
6012 (property (@ (name "source.level") (value "1.5")))
6013 (property (@ (name "build.lib") (value "build/jar")))
6014 (property (@ (name "src.dir") (value "src")))
6015 (property (@ (name "tests.dir") (value "src/org/apache/bsf/test")))
6016 (property (@ (name "build.tests") (value "build/test-classes")))
6017 (property (@ (name "build.dest") (value "build/classes"))))
2c8ac364
MW
6018 port)))
6019 #t))
afb13a10
JL
6020 (replace 'install (install-jars "build")))))
6021 (native-inputs
6022 `(("java-junit" ,java-junit)))
6023 (inputs
6024 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)))
6025 (home-page "https://commons.apache.org/proper/commons-bsf")
6026 (synopsis "Bean Scripting Framework")
6027 (description "The Bean Scripting Framework (BSF) is a set of Java classes
6028which provides scripting language support within Java applications, and access
6029to Java objects and methods from scripting languages. BSF allows one to write
6030JSPs in languages other than Java while providing access to the Java class
6031library. In addition, BSF permits any Java application to be implemented in
6032part (or dynamically extended) by a language that is embedded within it. This
6033is achieved by providing an API that permits calling scripting language engines
6034from within Java, as well as an object registry that exposes Java objects to
6035these scripting language engines.")
6036 (license license:asl2.0)))
6037
66006fe5
JL
6038(define-public java-commons-jxpath
6039 (package
6040 (name "java-commons-jxpath")
6041 (version "1.3")
6042 (source (origin
6043 (method url-fetch)
6044 (uri (string-append "mirror://apache/commons/jxpath/source/"
6045 "commons-jxpath-" version "-src.tar.gz"))
6046 (sha256
6047 (base32
6048 "1rpgg31ayn9fwr4bfi2i1ij0npcg79ad2fv0w9hacvawsyc42cfs"))))
6049 (build-system ant-build-system)
6050 (arguments
6051 `(#:jar-name "commons-jxpath.jar"
6052 ;; tests require more dependencies, including mockrunner which depends on old software
6053 #:tests? #f
6054 #:source-dir "src/java"))
6055 (inputs
10eddaca 6056 `(("servlet" ,java-classpathx-servletapi)
66006fe5
JL
6057 ("java-jdom" ,java-jdom)
6058 ("java-commons-beanutils" ,java-commons-beanutils)))
6059 (native-inputs
6060 `(("java-junit" ,java-junit)))
4f236f84 6061 (home-page "https://commons.apache.org/jxpath/")
66006fe5
JL
6062 (synopsis "Simple interpreter of an expression language called XPath.")
6063 (description "The org.apache.commons.jxpath package defines a simple
6064interpreter of an expression language called XPath. JXPath applies XPath
6065expressions to graphs of objects of all kinds: JavaBeans, Maps, Servlet
6066contexts, DOM etc, including mixtures thereof.")
6067 (license license:asl2.0)))
6068
b635d272
JL
6069(define-public java-commons-pool
6070 (package
6071 (name "java-commons-pool")
6072 (version "2.6.2")
6073 (source (origin
6074 (method url-fetch)
6075 (uri (string-append "mirror://apache/commons/pool/source/"
6076 "commons-pool2-" version "-src.tar.gz"))
6077 (sha256
6078 (base32
6079 "1fi1hgqmq01bs6azbj3sfswxzadp2r8sjjfiq6ryilz1m50kvrv6"))))
6080 (arguments
6081 `(#:jar-name "common-pool.jar"
6082 #:source-dir "src/main/java"
6083 #:test-exclude
6084 (list "**/PerformanceTest.java")))
6085 (build-system ant-build-system)
6086 (inputs
6087 `(("java-cglib" ,java-cglib)))
6088 (native-inputs
6089 `(("java-junit" ,java-junit)
6090 ("java-hamcrest-core" ,java-hamcrest-core)
6091 ("java-asm" ,java-asm)
6092 ("java-objenesis" ,java-objenesis)))
6093 (home-page "https://commons.apache.org/proper/commons-pool/")
6094 (synopsis "Object-pooling API in Java")
6095 (description "The commons-pool package provides an object-pooling API
6096and a number of object pool implementations. This package defines a
6097handful of pooling interfaces and some base classes that may be useful when
6098creating new pool implementations.")
6099 (license license:asl2.0)))
6100
f31ea164
JL
6101(define-public java-commons-dbcp
6102 (package
6103 (name "java-commons-dbcp")
6104 (version "2.6.0")
6105 (source (origin
6106 (method url-fetch)
6107 (uri (string-append "mirror://apache/commons/dbcp/source/"
6108 "commons-dbcp2-" version "-src.tar.gz"))
6109 (sha256
6110 (base32
6111 "0axbvcbnf2l70fc3ybrlp3siw2w4ka9mia2pnx4py8gz54cpw3rc"))))
6112 (arguments
6113 `(#:source-dir "src/main/java"
6114 #:jar-name "java-commons-dbcp.jar"
6115 #:tests? #f)); requires apache-geronimo
6116 (inputs
6117 `(("java-commons-pool" ,java-commons-pool)
6118 ("java-commons-logging" ,java-commons-logging-minimal)
6119 ("java-jboss-transaction-api-spec" ,java-jboss-transaction-api-spec)))
6120 (native-inputs
6121 `(("java-junit" ,java-junit)))
6122 (build-system ant-build-system)
6123 (home-page "https://commons.apache.org/proper/commons-dbcp/")
6124 (synopsis "Database Connection Pool for Java")
6125 (description "Commons-dbcp allows you to share a pool of database
6126connections between users. Creating a new connection for each user can be
6127time consuming and even unfeasible when the number of simultaneous users is
6128very large. This package provides a way to share a poole of connections to
6129reduce that load.")
6130 (license license:asl2.0)))
6131
934b83e4
JL
6132(define-public java-commons-jcs
6133 (package
6134 (name "java-commons-jcs")
6135 (version "2.2.1")
6136 (source (origin
6137 (method url-fetch)
6138 (uri (string-append "mirror://apache/commons/jcs/source/"
6139 "commons-jcs-dist-" version "-src.tar.gz"))
6140 (sha256
6141 (base32
6142 "0syhq2npjbrl0azqfjm0gvash1qd5qjy4qmysxcrqjsk0nf9fa1q"))))
6143 (build-system ant-build-system)
6144 (arguments
6145 `(#:jar-name "commons-jcs.jar"
6146 #:source-dir "commons-jcs-core/src/main/java"
6147 #:test-dir "commons-jcs-core/src/test"
6148 #:tests? #f; requires hsqldb
6149 #:phases
6150 (modify-phases %standard-phases
6151 (add-before 'build 'prepare
6152 (lambda _
6153 (with-directory-excursion
6154 "commons-jcs-core/src/main/java/org/apache/commons/jcs"
6155 (substitute*
6156 "auxiliary/disk/jdbc/dsfactory/SharedPoolDataSourceFactory.java"
6157 (("commons.dbcp") "commons.dbcp2")
6158 ((".*\\.setMaxActive.*") ""))
6159 ;;; Remove dependency on velocity-tools
6160 (delete-file "admin/servlet/JCSAdminServlet.java"))
6161 #t)))))
6162 (propagated-inputs
6163 `(("java-classpathx-servletapi" ,java-classpathx-servletapi)
6164 ("java-commons-logging-minimal" ,java-commons-logging-minimal)
6165 ("java-commons-httpclient" ,java-commons-httpclient)
6166 ("java-commons-dbcp" ,java-commons-dbcp)))
6167 (native-inputs
6168 `(("java-junit" ,java-junit)))
6169 (home-page "https://commons.apache.org/proper/commons-jcs/")
6170 (synopsis "Distributed caching system in Java")
6171 (description "JCS is a distributed caching system written in Java. It
6172is intended to speed up applications by providing a means to manage cached
6173data of various dynamic natures. Like any caching system, JCS is most useful
6174for high read, low put applications. Latency times drop sharply and
6175bottlenecks move away from the database in an effectively cached system.")
6176 (license license:asl2.0)))
6177
a1a5ef20
JL
6178(define-public java-jsr250
6179 (package
6180 (name "java-jsr250")
6181 (version "1.3")
6182 (source (origin
6183 (method url-fetch)
6184 (uri (string-append "https://repo1.maven.org/maven2/"
6185 "javax/annotation/javax.annotation-api/"
6186 version "/javax.annotation-api-"
6187 version "-sources.jar"))
6188 (sha256
6189 (base32
6190 "08clh8n4n9wfglf75qsqfjs6yf79f7x6hqx38cn856pksszv50kz"))))
6191 (build-system ant-build-system)
6192 (arguments
6193 `(#:tests? #f ; no tests included
6194 #:jdk ,icedtea-8
51087d51
JL
6195 #:jar-name "jsr250.jar"
6196 #:modules ((guix build ant-build-system)
6197 (guix build utils)
6198 (guix build maven pom)
6199 (guix build java-utils)
6200 (sxml simple))
6201 #:phases
6202 (modify-phases %standard-phases
6203 (add-before 'install 'create-pom
6204 (lambda _
6205 (with-output-to-file "pom.xml"
6206 (lambda _
6207 (sxml->xml
6208 `((project
6209 (modelVersion "4.0.0")
6210 (name "jsr250")
6211 (groupId "javax.annotation")
6212 (artifactId "jsr250-api")
6213 (version ,,version))))))
6214 #t))
6215 (replace 'install
6216 (install-from-pom "pom.xml")))))
a1a5ef20
JL
6217 (home-page "https://jcp.org/en/jsr/detail?id=250")
6218 (synopsis "Security-related annotations")
6219 (description "This package provides annotations for security. It provides
6220packages in the @code{javax.annotation} and @code{javax.annotation.security}
6221namespaces.")
6222 ;; either cddl or gpl2 only, with classpath exception
6223 (license (list license:cddl1.0
6224 license:gpl2))))
6225
0d4a0d60
RW
6226(define-public java-jsr305
6227 (package
6228 (name "java-jsr305")
6229 (version "3.0.1")
6230 (source (origin
6231 (method url-fetch)
6232 (uri (string-append "https://repo1.maven.org/maven2/"
6233 "com/google/code/findbugs/"
6234 "jsr305/" version "/jsr305-"
6235 version "-sources.jar"))
6236 (sha256
6237 (base32
6238 "1rh6jin9v7jqpq3kf1swl868l8i94r636n03pzpsmgr8v0lh9j2n"))))
6239 (build-system ant-build-system)
6240 (arguments
6241 `(#:tests? #f ; no tests included
79265a45
JL
6242 #:jar-name "jsr305.jar"
6243 #:modules ((guix build ant-build-system)
6244 (guix build java-utils)
6245 (guix build maven pom)
6246 (guix build utils)
6247 (sxml simple))
6248 #:phases
6249 (modify-phases %standard-phases
6250 (add-before 'install 'create-pom
6251 (lambda _
6252 (with-output-to-file "pom.xml"
6253 (lambda _
6254 (sxml->xml
6255 `((project
6256 (modelVersion "4.0.0")
6257 (name "jsr305")
6258 (groupId "com.google.code.findbugs")
6259 (artifactId "jsr305")
6260 (version ,,version))))))
6261 #t))
6262 (replace 'install
6263 (install-from-pom "pom.xml")))))
0d4a0d60
RW
6264 (home-page "http://findbugs.sourceforge.net/")
6265 (synopsis "Annotations for the static analyzer called findbugs")
6266 (description "This package provides annotations for the findbugs package.
6267It provides packages in the @code{javax.annotations} namespace.")
6268 (license license:asl2.0)))
6269
4f3e47ea
RW
6270(define-public java-guava
6271 (package
6272 (name "java-guava")
6273 ;; This is the last release of Guava that can be built with Java 7.
6274 (version "20.0")
6275 (source (origin
02ed96dc
JL
6276 (method git-fetch)
6277 (uri (git-reference
6278 (url "https://github.com/google/guava/")
6279 (commit (string-append "v" version))))
2be973c3 6280 (file-name (git-file-name name version))
4f3e47ea
RW
6281 (sha256
6282 (base32
02ed96dc 6283 "00h5cawdjic1vind3yivzh1f58flvm1yfmhsyqwyvmbvj1vakysp"))))
4f3e47ea
RW
6284 (build-system ant-build-system)
6285 (arguments
6286 `(#:tests? #f ; no tests included
6287 #:jar-name "guava.jar"
02ed96dc 6288 #:source-dir "guava/src"
4f3e47ea
RW
6289 #:phases
6290 (modify-phases %standard-phases
6291 (add-after 'unpack 'trim-sources
6292 (lambda _
02ed96dc 6293 (with-directory-excursion "guava/src/com/google/common"
4f3e47ea
RW
6294 ;; Remove annotations to avoid extra dependencies:
6295 ;; * "j2objc" annotations are used when converting Java to
6296 ;; Objective C;
6297 ;; * "errorprone" annotations catch common Java mistakes at
6298 ;; compile time;
6299 ;; * "IgnoreJRERequirement" is used for Android.
6300 (substitute* (find-files "." "\\.java$")
6301 (("import com.google.j2objc.*") "")
6302 (("import com.google.errorprone.annotation.*") "")
6303 (("import org.codehaus.mojo.animal_sniffer.*") "")
6304 (("@CanIgnoreReturnValue") "")
6305 (("@LazyInit") "")
6306 (("@WeakOuter") "")
6307 (("@RetainedWith") "")
6308 (("@Weak") "")
6309 (("@ForOverride") "")
6310 (("@J2ObjCIncompatible") "")
6311 (("@IgnoreJRERequirement") "")))
02ed96dc
JL
6312 #t))
6313 (replace 'install (install-from-pom "guava/pom.xml")))))
4f3e47ea
RW
6314 (inputs
6315 `(("java-jsr305" ,java-jsr305)))
02ed96dc
JL
6316 (propagated-inputs
6317 `(("java-guava-parent-pom" ,java-guava-parent-pom)))
4f3e47ea
RW
6318 (home-page "https://github.com/google/guava")
6319 (synopsis "Google core libraries for Java")
6320 (description "Guava is a set of core libraries that includes new
6321collection types (such as multimap and multiset), immutable collections, a
6322graph library, functional types, an in-memory cache, and APIs/utilities for
6323concurrency, I/O, hashing, primitives, reflection, string processing, and much
6324more!")
6325 (license license:asl2.0)))
6326
02ed96dc
JL
6327(define java-guava-parent-pom
6328 (package
6329 (inherit java-guava)
6330 (name "java-guava-parent-pom")
6331 (arguments
6332 `(#:tests? #f
6333 #:phases
6334 (modify-phases %standard-phases
6335 (delete 'configure)
6336 (delete 'build)
6337 (replace 'install
6338 (install-pom-file "pom.xml")))))
6339 (propagated-inputs
6340 `(("java-sonatype-oss-parent-pom" ,java-sonatype-oss-parent-pom-7)))))
6341
af8f8281
RW
6342;; The java-commons-logging package provides adapters to many different
6343;; logging frameworks. To avoid an excessive dependency graph we try to build
6344;; it with only a minimal set of adapters.
6345(define-public java-commons-logging-minimal
6346 (package
6347 (name "java-commons-logging-minimal")
6348 (version "1.2")
6349 (source (origin
6350 (method url-fetch)
6351 (uri (string-append "mirror://apache/commons/logging/source/"
6352 "commons-logging-" version "-src.tar.gz"))
6353 (sha256
6354 (base32
6355 "10bwcy5w8d7y39n0krlwhnp8ds3kj5zhmzj0zxnkw0qdlsjmsrj9"))))
6356 (build-system ant-build-system)
6357 (arguments
6358 `(#:tests? #f ; avoid dependency on logging frameworks
6359 #:jar-name "commons-logging-minimal.jar"
6360 #:phases
6361 (modify-phases %standard-phases
6362 (add-after 'unpack 'delete-adapters-and-tests
6363 (lambda _
6364 ;; Delete all adapters except for NoOpLog, SimpleLog, and
6365 ;; LogFactoryImpl. NoOpLog is required to build; LogFactoryImpl
6366 ;; is used by applications; SimpleLog is the only actually usable
6367 ;; implementation that does not depend on another logging
6368 ;; framework.
6369 (for-each
6370 (lambda (file)
6371 (delete-file (string-append
6372 "src/main/java/org/apache/commons/logging/impl/" file)))
6373 (list "Jdk13LumberjackLogger.java"
6374 "WeakHashtable.java"
6375 "Log4JLogger.java"
6376 "ServletContextCleaner.java"
6377 "Jdk14Logger.java"
6378 "AvalonLogger.java"
6379 "LogKitLogger.java"))
6380 (delete-file-recursively "src/test")
6381 #t)))))
4f236f84 6382 (home-page "https://commons.apache.org/logging/")
af8f8281
RW
6383 (synopsis "Common API for logging implementations")
6384 (description "The Logging package is a thin bridge between different
6385logging implementations. A library that uses the commons-logging API can be
6386used with any logging implementation at runtime.")
6387 (license license:asl2.0)))
6388
90e65abe
RW
6389;; This is the last release of the 1.x series.
6390(define-public java-mockito-1
6391 (package
6392 (name "java-mockito")
6393 (version "1.10.19")
6394 (source (origin
6395 (method url-fetch)
6396 (uri (string-append "http://repo1.maven.org/maven2/"
6397 "org/mockito/mockito-core/" version
6398 "/mockito-core-" version "-sources.jar"))
6399 (sha256
6400 (base32
6401 "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc"))))
6402 (build-system ant-build-system)
6403 (arguments
6404 `(#:jar-name "mockito.jar"
6405 #:tests? #f ; no tests included
6406 ;; FIXME: patch-and-repack does not support jars, so we have to apply
6407 ;; patches in build phases.
6408 #:phases
6409 (modify-phases %standard-phases
6410 ;; Mockito was developed against a different version of hamcrest,
6411 ;; which does not require matcher implementations to provide an
6412 ;; implementation of the "describeMismatch" method. We add this
6413 ;; simple definition to pass the build with our version of hamcrest.
6414 (add-after 'unpack 'fix-hamcrest-build-error
6415 (lambda _
6416 (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java"
6417 (("public Matcher getActualMatcher\\(\\) .*" line)
6418 (string-append "
6419 public void describeMismatch(Object item, Description description) {
6420 actualMatcher.describeMismatch(item, description);
6421 }"
6422 line)))
6423 #t))
6424 ;; Mockito bundles cglib. We have a cglib package, so let's use
6425 ;; that instead.
6426 (add-after 'unpack 'use-system-libraries
6427 (lambda _
6428 (with-directory-excursion "src/org/mockito/internal/creation/cglib"
6429 (substitute* '("CGLIBHacker.java"
6430 "CglibMockMaker.java"
6431 "ClassImposterizer.java"
6432 "DelegatingMockitoMethodProxy.java"
6433 "MethodInterceptorFilter.java"
6434 "MockitoNamingPolicy.java"
6435 "SerializableMockitoMethodProxy.java"
6436 "SerializableNoOp.java")
6437 (("import org.mockito.cglib") "import net.sf.cglib")))
6438 #t)))))
6439 (inputs
6440 `(("java-junit" ,java-junit)
6441 ("java-objenesis" ,java-objenesis)
6442 ("java-cglib" ,java-cglib)
6443 ("java-hamcrest-core" ,java-hamcrest-core)))
6444 (home-page "http://mockito.org")
6445 (synopsis "Mockito is a mock library for Java")
6446 (description "Mockito is a mocking library for Java which lets you write
6447tests with a clean and simple API. It generates mocks using reflection, and
6448it records all mock invocations, including methods arguments.")
6449 (license license:asl2.0)))
6450
4f4d2e47
RW
6451(define-public java-httpcomponents-httpcore
6452 (package
6453 (name "java-httpcomponents-httpcore")
6454 (version "4.4.6")
6455 (source (origin
6456 (method url-fetch)
6457 (uri (string-append "mirror://apache//httpcomponents/httpcore/"
6458 "source/httpcomponents-core-"
6459 version "-src.tar.gz"))
6460 (sha256
6461 (base32
6462 "02bwcf38y4vgwq7kj2s6q7qrmma641r5lacivm16kgxvb2j6h1vy"))))
6463 (build-system ant-build-system)
6464 (arguments
6465 `(#:jar-name "httpcomponents-httpcore.jar"
6466 #:phases
6467 (modify-phases %standard-phases
6468 (add-after 'unpack 'chdir
6469 (lambda _ (chdir "httpcore") #t)))))
6470 (inputs
6471 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
6472 ("java-commons-lang3" ,java-commons-lang3)))
6473 (native-inputs
6474 `(("java-junit" ,java-junit)
6475 ("java-mockito" ,java-mockito-1)))
6476 (home-page "https://hc.apache.org/httpcomponents-core-4.4.x/index.html")
6477 (synopsis "Low level HTTP transport components")
6478 (description "HttpCore is a set of low level HTTP transport components
6479that can be used to build custom client and server side HTTP services with a
6480minimal footprint. HttpCore supports two I/O models: blocking I/O model based
6481on the classic Java I/O and non-blocking, event driven I/O model based on Java
6482NIO.
6483
6484This package provides the blocking I/O model library.")
6485 (license license:asl2.0)))
6486
3a068b43
RW
6487(define-public java-httpcomponents-httpcore-nio
6488 (package (inherit java-httpcomponents-httpcore)
6489 (name "java-httpcomponents-httpcore-nio")
6490 (arguments
6491 `(#:jar-name "httpcomponents-httpcore-nio.jar"
6492 #:phases
6493 (modify-phases %standard-phases
6494 (add-after 'unpack 'chdir
6495 (lambda _ (chdir "httpcore-nio") #t)))))
6496 (inputs
6497 `(("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
6498 ("java-hamcrest-core" ,java-hamcrest-core)
6499 ,@(package-inputs java-httpcomponents-httpcore)))
6500 (description "HttpCore is a set of low level HTTP transport components
6501that can be used to build custom client and server side HTTP services with a
6502minimal footprint. HttpCore supports two I/O models: blocking I/O model based
6503on the classic Java I/O and non-blocking, event driven I/O model based on Java
6504NIO.
6505
6506This package provides the non-blocking I/O model library based on Java
6507NIO.")))
6508
e1dd78f6
RW
6509(define-public java-httpcomponents-httpcore-ab
6510 (package (inherit java-httpcomponents-httpcore)
6511 (name "java-httpcomponents-httpcore-ab")
6512 (arguments
6513 `(#:jar-name "httpcomponents-httpcore-ab.jar"
6514 #:phases
6515 (modify-phases %standard-phases
6516 (add-after 'unpack 'chdir
6517 (lambda _ (chdir "httpcore-ab") #t)))))
6518 (inputs
6519 `(("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
6520 ("java-commons-cli" ,java-commons-cli)
6521 ("java-hamcrest-core" ,java-hamcrest-core)
6522 ,@(package-inputs java-httpcomponents-httpcore)))
6523 (synopsis "Apache HttpCore benchmarking tool")
6524 (description "This package provides the HttpCore benchmarking tool. It is
6525an Apache AB clone based on HttpCore.")))
6526
14a671d8
RW
6527(define-public java-httpcomponents-httpclient
6528 (package
6529 (name "java-httpcomponents-httpclient")
968bb682 6530 (version "4.5.12")
14a671d8
RW
6531 (source (origin
6532 (method url-fetch)
6533 (uri (string-append "mirror://apache/httpcomponents/httpclient/"
6534 "source/httpcomponents-client-"
6535 version "-src.tar.gz"))
6536 (sha256
6537 (base32
968bb682 6538 "1va99m2zc2liv0v9vn72p5ja8yz4s5wq7zpahaai5nr966kvxzkb"))))
14a671d8
RW
6539 (build-system ant-build-system)
6540 (arguments
6541 `(#:jar-name "httpcomponents-httpclient.jar"
6542 #:phases
6543 (modify-phases %standard-phases
6544 (add-after 'unpack 'chdir
6545 (lambda _ (chdir "httpclient") #t)))))
6546 (inputs
6547 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
6548 ("java-commons-codec" ,java-commons-codec)
6549 ("java-hamcrest-core" ,java-hamcrest-core)
6550 ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
6551 ("java-mockito" ,java-mockito-1)
6552 ("java-junit" ,java-junit)))
6553 (home-page "https://hc.apache.org/httpcomponents-client-ga/")
6554 (synopsis "HTTP client library for Java")
6555 (description "Although the @code{java.net} package provides basic
6556functionality for accessing resources via HTTP, it doesn't provide the full
6557flexibility or functionality needed by many applications. @code{HttpClient}
6558seeks to fill this void by providing an efficient, up-to-date, and
6559feature-rich package implementing the client side of the most recent HTTP
6560standards and recommendations.")
6561 (license license:asl2.0)))
6562
cbce5de2
RW
6563(define-public java-httpcomponents-httpmime
6564 (package (inherit java-httpcomponents-httpclient)
6565 (name "java-httpcomponents-httpmime")
6566 (arguments
6567 `(#:jar-name "httpcomponents-httpmime.jar"
6568 #:phases
6569 (modify-phases %standard-phases
6570 (add-after 'unpack 'chdir
6571 (lambda _ (chdir "httpmime") #t)))))
6572 (inputs
6573 `(("java-httpcomponents-httpclient" ,java-httpcomponents-httpclient)
6574 ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
6575 ("java-junit" ,java-junit)
6576 ("java-hamcrest-core" ,java-hamcrest-core)))))
6577
4b34c21f
RW
6578(define-public java-commons-net
6579 (package
6580 (name "java-commons-net")
6581 (version "3.6")
6582 (source (origin
6583 (method url-fetch)
6584 (uri (string-append "mirror://apache/commons/net/source/"
6585 "commons-net-" version "-src.tar.gz"))
6586 (sha256
6587 (base32
6588 "0n0cmnddk9qdqhjvka8pc6hd9mn2qi3166f1s6xk32h7rfy1adxr"))))
6589 (build-system ant-build-system)
6590 (arguments
6591 `(;; FIXME: MainTest.java tries to read "examples.properties" (which
6592 ;; should be "resources/examples/examples.properties"), but gets "null"
6593 ;; instead.
6594 #:tests? #f
6595 #:jar-name "commons-net.jar"))
6596 (native-inputs
6597 `(("java-junit" ,java-junit)
6598 ("java-hamcrest-core" ,java-hamcrest-core)))
4f236f84 6599 (home-page "https://commons.apache.org/net/")
4b34c21f
RW
6600 (synopsis "Client library for many basic Internet protocols")
6601 (description "The Apache Commons Net library implements the client side of
6602many basic Internet protocols. The purpose of the library is to provide
6603fundamental protocol access, not higher-level abstractions.")
6604 (license license:asl2.0)))
6605
808cb58f
RW
6606(define-public java-jsch
6607 (package
6608 (name "java-jsch")
1c8ba10a 6609 (version "0.1.55")
808cb58f
RW
6610 (source (origin
6611 (method url-fetch)
6612 (uri (string-append "mirror://sourceforge/jsch/jsch/"
6613 version "/jsch-" version ".zip"))
6614 (sha256
6615 (base32
1c8ba10a 6616 "1lxyjwvmwa723wcf3bqn816hkvc03vz4xhbsi7bvfhrz2rpgcfq6"))))
808cb58f
RW
6617 (build-system ant-build-system)
6618 (arguments
6619 `(#:build-target "dist"
1c8ba10a 6620 #:tests? #f ; no tests included
808cb58f
RW
6621 #:phases
6622 (modify-phases %standard-phases
6623 (replace 'install (install-jars "dist")))))
6624 (native-inputs
6625 `(("unzip" ,unzip)))
6626 (home-page "http://www.jcraft.com/jsch/")
6627 (synopsis "Pure Java implementation of SSH2")
6628 (description "JSch is a pure Java implementation of SSH2. JSch allows you
6629to connect to an SSH server and use port forwarding, X11 forwarding, file
6630transfer, etc., and you can integrate its functionality into your own Java
6631programs.")
6632 (license license:bsd-3)))
6633
a6244698
RW
6634(define-public java-commons-compress
6635 (package
6636 (name "java-commons-compress")
6637 (version "1.13")
6638 (source (origin
6639 (method url-fetch)
6640 (uri (string-append "mirror://apache/commons/compress/source/"
6641 "commons-compress-" version "-src.tar.gz"))
6642 (sha256
6643 (base32
6644 "1vjqvavrn0babffn1kciz6v52ibwq2vwhzlb95hazis3lgllnxc8"))))
6645 (build-system ant-build-system)
6646 (arguments
6647 `(#:jar-name "commons-compress.jar"
6648 #:phases
6649 (modify-phases %standard-phases
6650 (add-after 'unpack 'delete-bad-tests
6651 (lambda _
6652 (with-directory-excursion "src/test/java/org/apache/commons/compress/"
6653 ;; FIXME: These tests really should not fail. Maybe they are
6654 ;; indicative of problems with our Java packaging work.
6655
6656 ;; This test fails with a null pointer exception.
6657 (delete-file "archivers/sevenz/SevenZOutputFileTest.java")
6658 ;; This test fails to open test resources.
6659 (delete-file "archivers/zip/ExplodeSupportTest.java")
6660
6661 ;; FIXME: This test adds a dependency on powermock, which is hard to
6662 ;; package at this point.
6663 ;; https://github.com/powermock/powermock
6664 (delete-file "archivers/sevenz/SevenZNativeHeapTest.java"))
02ed96dc
JL
6665 #t))
6666 (replace 'install (install-from-pom "pom.xml")))))
6667 (propagated-inputs
6668 `(("java-xz" ,java-xz)
6669 ("apache-commons-parent-pom" ,apache-commons-parent-pom-41)))
6670 (native-inputs
a6244698 6671 `(("java-junit" ,java-junit)
02ed96dc 6672 ("java-mockito" ,java-mockito-1)))
a6244698
RW
6673 (home-page "https://commons.apache.org/proper/commons-compress/")
6674 (synopsis "Java library for working with compressed files")
6675 (description "The Apache Commons Compress library defines an API for
6676working with compressed files such as ar, cpio, Unix dump, tar, zip, gzip, XZ,
6677Pack200, bzip2, 7z, arj, lzma, snappy, DEFLATE, lz4 and Z files.")
6678 (license license:asl2.0)))
6679
51263ff5
JL
6680(define-public java-commons-csv
6681 (package
6682 (name "java-commons-csv")
6683 (version "1.4")
6684 (source (origin
6685 (method url-fetch)
6686 (uri (string-append "mirror://apache/commons/csv/source/"
6687 "commons-csv-" version "-src.tar.gz"))
6688 (sha256
6689 (base32
6690 "1l89m0fm2s3xx3v3iynvangymfg2vlyngaj6fgsi457nmsw7m7ij"))))
6691 (build-system ant-build-system)
6692 (arguments
6693 `(#:jar-name "commons-csv.jar"
6694 #:source-dir "src/main/java"
6695 #:tests? #f)); FIXME: requires java-h2
6696 (inputs
6697 `(("java-hamcrest-core" ,java-hamcrest-core)
6698 ("java-commons-io" ,java-commons-io)
6699 ("java-commons-lang3" ,java-commons-lang3)
6700 ("junit" ,java-junit)))
6701 (home-page "https://commons.apache.org/proper/commons-csv/")
6702 (synopsis "Read and write CSV documents")
6703 (description "Commons CSV reads and writes files in variations of the Comma
6704Separated Value (CSV) format. The most common CSV formats are predefined in the
6705CSVFormat class:
6706
6707@itemize
6708@item Microsoft Excel
6709@item Informix UNLOAD
6710@item Informix UNLOAD CSV
6711@item MySQL
6712@item RFC 4180
6713@item TDF
6714@end itemize
6715
6716Custom formats can be created using a fluent style API.")
6717 (license license:asl2.0)))
6718
6ee6d0b5
RW
6719(define-public java-osgi-annotation
6720 (package
6721 (name "java-osgi-annotation")
6722 (version "6.0.0")
6723 (source (origin
6724 (method url-fetch)
6725 (uri (string-append "https://repo1.maven.org/maven2/"
6726 "org/osgi/org.osgi.annotation/" version "/"
6727 "org.osgi.annotation-" version "-sources.jar"))
6728 (sha256
6729 (base32
6730 "1q718mb7gqg726rh6pc2hcisn8v50nv35abbir0jypmffhiii85w"))))
6731 (build-system ant-build-system)
6732 (arguments
6733 `(#:tests? #f ; no tests
6734 #:jar-name "osgi-annotation.jar"))
c353d014 6735 (home-page "https://www.osgi.org")
6ee6d0b5
RW
6736 (synopsis "Annotation module of OSGi framework")
6737 (description
6738 "OSGi, for Open Services Gateway initiative framework, is a module system
6739and service platform for the Java programming language. This package contains
6740the OSGi annotation module, providing additional services to help dynamic
6741components.")
6742 (license license:asl2.0)))
6743
37e2e5d4
RW
6744(define-public java-osgi-core
6745 (package
6746 (name "java-osgi-core")
6747 (version "6.0.0")
6748 (source (origin
6749 (method url-fetch)
6750 (uri (string-append "https://repo1.maven.org/maven2/"
6751 "org/osgi/org.osgi.core/" version "/"
6752 "org.osgi.core-" version "-sources.jar"))
6753 (sha256
6754 (base32
6755 "19bpf5jx32jq9789gyhin35q5v7flmw0p9mk7wbgqpxqfmxyiabv"))))
6756 (build-system ant-build-system)
6757 (arguments
6758 `(#:tests? #f ; no tests
6759 #:jar-name "osgi-core.jar"))
6760 (inputs
6761 `(("java-osgi-annotation" ,java-osgi-annotation)))
c353d014 6762 (home-page "https://www.osgi.org")
37e2e5d4
RW
6763 (synopsis "Core module of OSGi framework")
6764 (description
6765 "OSGi, for Open Services Gateway initiative framework, is a module system
6766and service platform for the Java programming language. This package contains
6767the OSGi Core module.")
6768 (license license:asl2.0)))
6769
8af92c8f
RW
6770(define-public java-osgi-service-event
6771 (package
6772 (name "java-osgi-service-event")
6773 (version "1.3.1")
6774 (source (origin
6775 (method url-fetch)
6776 (uri (string-append "https://repo1.maven.org/maven2/"
6777 "org/osgi/org.osgi.service.event/"
6778 version "/org.osgi.service.event-"
6779 version "-sources.jar"))
6780 (sha256
6781 (base32
6782 "1nyhlgagwym75bycnjczwbnpymv2iw84zbhvvzk84g9q736i6qxm"))))
6783 (build-system ant-build-system)
6784 (arguments
6785 `(#:tests? #f ; no tests
6786 #:jar-name "osgi-service-event.jar"))
6787 (inputs
6788 `(("java-osgi-annotation" ,java-osgi-annotation)
6789 ("java-osgi-core" ,java-osgi-core)))
c353d014 6790 (home-page "https://www.osgi.org")
8af92c8f
RW
6791 (synopsis "OSGi service event module")
6792 (description
6793 "OSGi, for Open Services Gateway initiative framework, is a module system
6794and service platform for the Java programming language. This package contains
6795the OSGi @code{org.osgi.service.event} module.")
6796 (license license:asl2.0)))
6797
674e93a0
RW
6798(define-public java-eclipse-osgi
6799 (package
6800 (name "java-eclipse-osgi")
6801 (version "3.11.3")
6802 (source (origin
6803 (method url-fetch)
6804 (uri (string-append "https://repo1.maven.org/maven2/"
6805 "org/eclipse/platform/org.eclipse.osgi/"
6806 version "/org.eclipse.osgi-"
6807 version "-sources.jar"))
6808 (sha256
6809 (base32
6810 "00cqc6lb29n0zv68b4l842vzkwawvbr7gshfdygsk8sicvcq2c7b"))))
6811 (build-system ant-build-system)
6812 (arguments
6813 `(#:tests? #f ; no tests included
6814 #:jar-name "eclipse-equinox-osgi.jar"))
6815 (inputs
6816 `(("java-osgi-annotation" ,java-osgi-annotation)))
6817 (home-page "http://www.eclipse.org/equinox/")
6818 (synopsis "Eclipse Equinox OSGi framework")
6819 (description "This package provides an implementation of the OSGi Core
6820specification.")
6821 (license license:epl1.0)))
6822
81b55b1e
RW
6823(define-public java-eclipse-equinox-common
6824 (package
6825 (name "java-eclipse-equinox-common")
e40e3792 6826 (version "3.10.200")
81b55b1e
RW
6827 (source (origin
6828 (method url-fetch)
6829 (uri (string-append "https://repo1.maven.org/maven2/"
6830 "org/eclipse/platform/org.eclipse.equinox.common/"
6831 version "/org.eclipse.equinox.common-"
6832 version "-sources.jar"))
6833 (sha256
6834 (base32
e40e3792 6835 "1yn8ij6xsljlf35sr2l7wvyvc0ss4n1rv0ry5zkgb49dj4hyrqrj"))))
81b55b1e
RW
6836 (build-system ant-build-system)
6837 (arguments
6838 `(#:tests? #f ; no tests included
6839 #:jar-name "eclipse-equinox-common.jar"))
6840 (inputs
6841 `(("java-eclipse-osgi" ,java-eclipse-osgi)))
6842 (home-page "http://www.eclipse.org/equinox/")
6843 (synopsis "Common Eclipse runtime")
6844 (description "This package provides the common Eclipse runtime.")
6845 (license license:epl1.0)))
6846
90368ad9
RW
6847(define-public java-eclipse-core-jobs
6848 (package
6849 (name "java-eclipse-core-jobs")
6850 (version "3.8.0")
6851 (source (origin
6852 (method url-fetch)
6853 (uri (string-append "https://repo1.maven.org/maven2/"
6854 "org/eclipse/platform/org.eclipse.core.jobs/"
6855 version "/org.eclipse.core.jobs-"
6856 version "-sources.jar"))
6857 (sha256
6858 (base32
6859 "0395b8lh0km8vhzjnchvs1rii1qz48hyvb2wqfaq4yhklbwihq4b"))))
6860 (build-system ant-build-system)
6861 (arguments
6862 `(#:tests? #f ; no tests included
6863 #:jar-name "eclipse-core-jobs.jar"))
6864 (inputs
6865 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
6866 ("java-eclipse-osgi" ,java-eclipse-osgi)))
6867 (home-page "http://www.eclipse.org/equinox/")
6868 (synopsis "Eclipse jobs mechanism")
6869 (description "This package provides the Eclipse jobs mechanism.")
6870 (license license:epl1.0)))
6871
fbaf09eb
RW
6872(define-public java-eclipse-equinox-registry
6873 (package
6874 (name "java-eclipse-equinox-registry")
6875 (version "3.6.100")
6876 (source (origin
6877 (method url-fetch)
6878 (uri (string-append "https://repo1.maven.org/maven2/"
6879 "org/eclipse/platform/org.eclipse.equinox.registry/"
6880 version "/org.eclipse.equinox.registry-"
6881 version "-sources.jar"))
6882 (sha256
6883 (base32
6884 "1i9sgymh2fy5vdgk5y7s3qvrlbgh4l93ddqi3v4zmca7hwrlhf9k"))))
6885 (build-system ant-build-system)
6886 (arguments
6887 `(#:tests? #f ; no tests included
6888 #:jar-name "eclipse-equinox-registry.jar"))
6889 (inputs
6890 `(("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
6891 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
6892 ("java-eclipse-osgi" ,java-eclipse-osgi)))
6893 (home-page "http://www.eclipse.org/equinox/")
6894 (synopsis "Eclipse extension registry support")
6895 (description "This package provides support for the Eclipse extension
6896registry.")
6897 (license license:epl1.0)))
6898
65214c87
RW
6899(define-public java-eclipse-equinox-app
6900 (package
6901 (name "java-eclipse-equinox-app")
6902 (version "1.3.400")
6903 (source (origin
6904 (method url-fetch)
6905 (uri (string-append "https://repo1.maven.org/maven2/"
6906 "org/eclipse/platform/org.eclipse.equinox.app/"
6907 version "/org.eclipse.equinox.app-"
6908 version "-sources.jar"))
6909 (sha256
6910 (base32
6911 "0nhvbp93y203ar7y59gb0mz3w2d3jlqhr0c9hii9bcfpmr7imdab"))))
6912 (build-system ant-build-system)
6913 (arguments
6914 `(#:tests? #f ; no tests included
6915 #:jar-name "eclipse-equinox-app.jar"))
6916 (inputs
6917 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
6918 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
6919 ("java-eclipse-osgi" ,java-eclipse-osgi)
6920 ("java-osgi-service-event" ,java-osgi-service-event)))
6921 (home-page "http://www.eclipse.org/equinox/")
6922 (synopsis "Equinox application container")
6923 (description "This package provides the Equinox application container for
6924Eclipse.")
6925 (license license:epl1.0)))
6926
3f970214
RW
6927(define-public java-eclipse-equinox-preferences
6928 (package
6929 (name "java-eclipse-equinox-preferences")
6930 (version "3.6.1")
6931 (source (origin
6932 (method url-fetch)
6933 (uri (string-append "https://repo1.maven.org/maven2/"
6934 "org/eclipse/platform/org.eclipse.equinox.preferences/"
6935 version "/org.eclipse.equinox.preferences-"
6936 version "-sources.jar"))
6937 (sha256
6938 (base32
6939 "0k7w6c141sqym4fy3af0qkwpy4pdh2vsjpjba6rp5fxyqa24v0a2"))))
6940 (build-system ant-build-system)
6941 (arguments
6942 `(#:tests? #f ; no tests included
6943 #:jar-name "eclipse-equinox-preferences.jar"))
6944 (inputs
6945 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
6946 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
6947 ("java-eclipse-osgi" ,java-eclipse-osgi)))
6948 (home-page "http://www.eclipse.org/equinox/")
6949 (synopsis "Eclipse preferences mechanism")
6950 (description "This package provides the Eclipse preferences mechanism with
6951the module @code{org.eclipse.equinox.preferences}.")
6952 (license license:epl1.0)))
6953
4ad3d4f3
RW
6954(define-public java-eclipse-core-contenttype
6955 (package
6956 (name "java-eclipse-core-contenttype")
6957 (version "3.5.100")
6958 (source (origin
6959 (method url-fetch)
6960 (uri (string-append "https://repo1.maven.org/maven2/"
6961 "org/eclipse/platform/org.eclipse.core.contenttype/"
6962 version "/org.eclipse.core.contenttype-"
6963 version "-sources.jar"))
6964 (sha256
6965 (base32
6966 "1wcqcv7ijwv5rh748vz3x9pkmjl9w1r0k0026k56n8yjl4rrmspi"))))
6967 (build-system ant-build-system)
6968 (arguments
6969 `(#:tests? #f ; no tests included
6970 #:jar-name "eclipse-core-contenttype.jar"))
6971 (inputs
6972 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
6973 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
6974 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
6975 ("java-eclipse-osgi" ,java-eclipse-osgi)))
6976 (home-page "http://www.eclipse.org/")
6977 (synopsis "Eclipse content mechanism")
6978 (description "This package provides the Eclipse content mechanism in the
6979@code{org.eclipse.core.contenttype} module.")
6980 (license license:epl1.0)))
6981
6a7f7e49
RW
6982(define-public java-eclipse-core-runtime
6983 (package
6984 (name "java-eclipse-core-runtime")
4fa9b6e6 6985 (version "3.15.100")
6a7f7e49
RW
6986 (source (origin
6987 (method url-fetch)
6988 (uri (string-append "https://repo1.maven.org/maven2/"
6989 "org/eclipse/platform/org.eclipse.core.runtime/"
6990 version "/org.eclipse.core.runtime-"
6991 version "-sources.jar"))
6992 (sha256
6993 (base32
4fa9b6e6 6994 "0l8xayacsbjvz5hypx2fv47vpw2n4dspamcfb3hx30x9hj8vmg7r"))))
6a7f7e49
RW
6995 (build-system ant-build-system)
6996 (arguments
6997 `(#:tests? #f ; no tests included
6998 #:jar-name "eclipse-core-runtime.jar"))
6999 (inputs
7000 `(("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
7001 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
7002 ("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
7003 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7004 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7005 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
7006 ("java-eclipse-osgi" ,java-eclipse-osgi)))
7007 (home-page "https://www.eclipse.org/")
7008 (synopsis "Eclipse core runtime")
7009 (description "This package provides the Eclipse core runtime with the
7010module @code{org.eclipse.core.runtime}.")
7011 (license license:epl1.0)))
7012
b3806a15
RW
7013(define-public java-eclipse-core-filesystem
7014 (package
7015 (name "java-eclipse-core-filesystem")
7016 (version "1.6.1")
7017 (source (origin
7018 (method url-fetch)
7019 (uri (string-append "https://repo1.maven.org/maven2/"
7020 "org/eclipse/platform/org.eclipse.core.filesystem/"
7021 version "/org.eclipse.core.filesystem-"
7022 version "-sources.jar"))
7023 (sha256
7024 (base32
7025 "0km1bhwjim4rfy3pkvjhvy31kgsyf2ncx0mlkmbf5n6g57pphdyj"))))
7026 (build-system ant-build-system)
7027 (arguments
7028 `(#:tests? #f ; no tests included
7029 #:jar-name "eclipse-core-filesystem.jar"))
7030 (inputs
7031 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7032 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7033 ("java-eclipse-osgi" ,java-eclipse-osgi)))
7034 (home-page "https://www.eclipse.org/")
7035 (synopsis "Eclipse core file system")
7036 (description "This package provides the Eclipse core file system with the
7037module @code{org.eclipse.core.filesystem}.")
7038 (license license:epl1.0)))
7039
e96060de
RW
7040(define-public java-eclipse-core-expressions
7041 (package
7042 (name "java-eclipse-core-expressions")
7043 (version "3.5.100")
7044 (source (origin
7045 (method url-fetch)
7046 (uri (string-append "https://repo1.maven.org/maven2/"
7047 "org/eclipse/platform/org.eclipse.core.expressions/"
7048 version "/org.eclipse.core.expressions-"
7049 version "-sources.jar"))
7050 (sha256
7051 (base32
7052 "18bw2l875gmygvpagpgk9l24qzbdjia4ag12nw6fi8v8yaq4987f"))))
7053 (build-system ant-build-system)
7054 (arguments
7055 `(#:tests? #f ; no tests included
7056 #:jar-name "eclipse-core-expressions.jar"))
7057 (inputs
7058 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7059 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7060 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
7061 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
7062 ("java-eclipse-osgi" ,java-eclipse-osgi)))
7063 (home-page "https://www.eclipse.org/")
7064 (synopsis "Eclipse core expression language")
7065 (description "This package provides the Eclipse core expression language
7066with the @code{org.eclipse.core.expressions} module.")
7067 (license license:epl1.0)))
7068
e8d0f7c8
RW
7069(define-public java-eclipse-core-variables
7070 (package
7071 (name "java-eclipse-core-variables")
7072 (version "3.3.0")
7073 (source (origin
7074 (method url-fetch)
7075 (uri (string-append "https://repo1.maven.org/maven2/"
7076 "org/eclipse/platform/org.eclipse.core.variables/"
7077 version "/org.eclipse.core.variables-"
7078 version "-sources.jar"))
7079 (sha256
7080 (base32
7081 "12dirh03zi4n5x5cj07vzrhkmnqy6h9q10h9j605pagmpmifyxmy"))))
7082 (build-system ant-build-system)
7083 (arguments
7084 `(#:tests? #f ; no tests included
7085 #:jar-name "eclipse-core-variables.jar"))
7086 (inputs
7087 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7088 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7089 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
7090 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
7091 ("java-eclipse-osgi" ,java-eclipse-osgi)))
7092 (home-page "https://www.eclipse.org/platform")
7093 (synopsis "Eclipse core variables")
7094 (description "This package provides the Eclipse core variables module
7095@code{org.eclipse.core.variables}.")
7096 (license license:epl1.0)))
7097
7c3d479e
RW
7098(define-public java-eclipse-ant-core
7099 (package
7100 (name "java-eclipse-ant-core")
7101 (version "3.4.100")
7102 (source (origin
7103 (method url-fetch)
7104 (uri (string-append "https://repo1.maven.org/maven2/"
7105 "org/eclipse/platform/org.eclipse.ant.core/"
7106 version "/org.eclipse.ant.core-"
7107 version "-sources.jar"))
7108 (sha256
7109 (base32
7110 "11g3if794qjlk98mz9zch22rr56sd7z63vn4i7k2icr8cq5bfqg7"))))
7111 (build-system ant-build-system)
7112 (arguments
7113 `(#:tests? #f ; no tests included
7114 #:jar-name "eclipse-ant-core.jar"))
7115 (inputs
7116 `(("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
7117 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7118 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7119 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
7120 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
7121 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
7122 ("java-eclipse-core-variables" ,java-eclipse-core-variables)
7123 ("java-eclipse-osgi" ,java-eclipse-osgi)))
7124 (home-page "https://www.eclipse.org/platform")
7125 (synopsis "Ant build tool core libraries")
7126 (description "This package provides the ant build tool core libraries with
7127the module @code{org.eclipse.ant.core}.")
7128 (license license:epl1.0)))
7129
6636f638
RW
7130(define-public java-eclipse-core-resources
7131 (package
7132 (name "java-eclipse-core-resources")
c8427a5e 7133 (version "3.13.200")
6636f638
RW
7134 (source (origin
7135 (method url-fetch)
7136 (uri (string-append "https://repo1.maven.org/maven2/"
7137 "org/eclipse/platform/org.eclipse.core.resources/"
7138 version "/org.eclipse.core.resources-"
7139 version "-sources.jar"))
7140 (sha256
7141 (base32
c8427a5e 7142 "1sn3b6ky72hkvxcgf9b2jkpbdh3y8lbhi9xxwv1dsiddpkkq91hs"))))
6636f638
RW
7143 (build-system ant-build-system)
7144 (arguments
7145 `(#:tests? #f ; no tests included
7146 #:jar-name "eclipse-core-resources.jar"))
7147 (inputs
7148 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7149 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
7150 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7151 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
7152 ("java-eclipse-core-expressions" ,java-eclipse-core-expressions)
7153 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
7154 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
7155 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
7156 ("java-eclipse-ant-core" ,java-eclipse-ant-core)
7157 ("java-eclipse-osgi" ,java-eclipse-osgi)))
7158 (home-page "https://www.eclipse.org/")
7159 (synopsis "Eclipse core resource management")
7160 (description "This package provides the Eclipse core resource management
7161module @code{org.eclipse.core.resources}.")
7162 (license license:epl1.0)))
7163
afb5858d
RW
7164(define-public java-eclipse-compare-core
7165 (package
7166 (name "java-eclipse-compare-core")
7167 (version "3.6.0")
7168 (source (origin
7169 (method url-fetch)
7170 (uri (string-append "https://repo1.maven.org/maven2/"
7171 "org/eclipse/platform/org.eclipse.compare.core/"
7172 version "/org.eclipse.compare.core-"
7173 version "-sources.jar"))
7174 (sha256
7175 (base32
7176 "10g37r0pbiffyv2wk35c6g5lwzkdipkl0kkjp41v84dln46xm4dg"))))
7177 (build-system ant-build-system)
7178 (arguments
7179 `(#:tests? #f ; no tests included
7180 #:jar-name "eclipse-compare-core.jar"))
7181 (inputs
7182 `(("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
7183 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7184 ("java-eclipse-osgi" ,java-eclipse-osgi)
7185 ("java-icu4j" ,java-icu4j)))
7186 (home-page "https://www.eclipse.org/")
7187 (synopsis "Eclipse core compare support")
7188 (description "This package provides the Eclipse core compare support
7189module @code{org.eclipse.compare.core}.")
7190 (license license:epl1.0)))
7191
1bb191fc
RW
7192(define-public java-eclipse-team-core
7193 (package
7194 (name "java-eclipse-team-core")
7195 (version "3.8.0")
7196 (source (origin
7197 (method url-fetch)
7198 (uri (string-append "https://repo1.maven.org/maven2/"
7199 "org/eclipse/platform/org.eclipse.team.core/"
7200 version "/org.eclipse.team.core-"
7201 version "-sources.jar"))
7202 (sha256
7203 (base32
7204 "02j2jzqgb26zx2d5ahxmvijw6j4r0la90zl5c3i65x6z19ciyam7"))))
7205 (build-system ant-build-system)
7206 (arguments
7207 `(#:tests? #f ; no tests included
7208 #:jar-name "eclipse-team-core.jar"))
7209 (inputs
7210 `(("java-eclipse-compare-core" ,java-eclipse-compare-core)
7211 ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
7212 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
7213 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
7214 ("java-eclipse-core-resources" ,java-eclipse-core-resources)
7215 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
7216 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7217 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7218 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
7219 ("java-eclipse-osgi" ,java-eclipse-osgi)))
7220 (home-page "https://www.eclipse.org/platform")
7221 (synopsis "Eclipse team support core")
7222 (description "This package provides the Eclipse team support core module
7223@code{org.eclipse.team.core}.")
7224 (license license:epl1.0)))
7225
31342529
RW
7226(define-public java-eclipse-core-commands
7227 (package
7228 (name "java-eclipse-core-commands")
7229 (version "3.8.1")
7230 (source (origin
7231 (method url-fetch)
7232 (uri (string-append "https://repo1.maven.org/maven2/"
7233 "org/eclipse/platform/org.eclipse.core.commands/"
7234 version "/org.eclipse.core.commands-"
7235 version "-sources.jar"))
7236 (sha256
7237 (base32
7238 "0yjn482qndcfrsq3jd6vnhcylp16420f5aqkrwr8spsprjigjcr9"))))
7239 (build-system ant-build-system)
7240 (arguments
7241 `(#:tests? #f ; no tests included
7242 #:jar-name "eclipse-core-commands.jar"))
7243 (inputs
7244 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)))
7245 (home-page "https://www.eclipse.org/platform")
7246 (synopsis "Eclipse core commands")
7247 (description "This package provides Eclipse core commands in the module
7248@code{org.eclipse.core.commands}.")
7249 (license license:epl1.0)))
7250
bf96acf7
RW
7251(define-public java-eclipse-text
7252 (package
7253 (name "java-eclipse-text")
7254 (version "3.6.0")
7255 (source (origin
7256 (method url-fetch)
7257 (uri (string-append "https://repo1.maven.org/maven2/"
7258 "org/eclipse/platform/org.eclipse.text/"
7259 version "/org.eclipse.text-"
7260 version "-sources.jar"))
7261 (sha256
7262 (base32
7263 "0scz70vzz5qs5caji9f5q01vkqnvip7dpri1q07l8wbbdcxn4cq1"))))
7264 (build-system ant-build-system)
7265 (arguments
7266 `(#:tests? #f ; no tests included
7267 #:jar-name "eclipse-text.jar"
7268 #:phases
7269 (modify-phases %standard-phases
7270 ;; When creating a new category we must make sure that the new list
7271 ;; matches List<Position>. By default it seems to be too generic
7272 ;; (ArrayList<Object>), so we specialize it to ArrayList<Position>.
7273 ;; Without this we get this error:
7274 ;;
7275 ;; [javac] .../src/org/eclipse/jface/text/AbstractDocument.java:376:
7276 ;; error: method put in interface Map<K,V> cannot be applied to given types;
7277 ;; [javac] fPositions.put(category, new ArrayList<>());
7278 ;; [javac] ^
7279 ;; [javac] required: String,List<Position>
7280 ;; [javac] found: String,ArrayList<Object>
7281 ;; [javac] reason: actual argument ArrayList<Object> cannot be converted
7282 ;; to List<Position> by method invocation conversion
7283 ;; [javac] where K,V are type-variables:
7284 ;; [javac] K extends Object declared in interface Map
7285 ;; [javac] V extends Object declared in interface Map
7286 ;;
7287 ;; I don't know if this is a good fix. I suspect it is not, but it
7288 ;; seems to work.
7289 (add-after 'unpack 'fix-compilation-error
7290 (lambda _
7291 (substitute* "src/org/eclipse/jface/text/AbstractDocument.java"
7292 (("Positions.put\\(category, new ArrayList<>\\(\\)\\);")
7293 "Positions.put(category, new ArrayList<Position>());"))
7294 #t)))))
7295 (inputs
7296 `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7297 ("java-eclipse-core-commands" ,java-eclipse-core-commands)
7298 ("java-icu4j" ,java-icu4j)))
7299 (home-page "http://www.eclipse.org/platform")
7300 (synopsis "Eclipse text library")
7301 (description "Platform Text is part of the Platform UI project and
7302provides the basic building blocks for text and text editors within Eclipse
7303and contributes the Eclipse default text editor.")
7304 (license license:epl1.0)))
7305
c24d11b7
RW
7306(define-public java-eclipse-jdt-core
7307 (package
7308 (name "java-eclipse-jdt-core")
43d6776b 7309 (version "3.16.0")
c24d11b7
RW
7310 (source (origin
7311 (method url-fetch)
7312 (uri (string-append "https://repo1.maven.org/maven2/"
7313 "org/eclipse/jdt/org.eclipse.jdt.core/"
7314 version "/org.eclipse.jdt.core-"
7315 version "-sources.jar"))
7316 (sha256
7317 (base32
43d6776b 7318 "1g560yr9v2kzv34gc2m3ifpgnj7krcdd6h4gd4z83pwqacwkfz0k"))))
c24d11b7
RW
7319 (build-system ant-build-system)
7320 (arguments
7321 `(#:tests? #f ; no tests included
84b226c2
RW
7322 #:jar-name "eclipse-jdt-core.jar"
7323 #:phases
7324 (modify-phases %standard-phases
7325 (add-after 'unpack 'move-sources
7326 (lambda _
7327 (with-directory-excursion "src/jdtCompilerAdaptersrc/"
7328 (for-each (lambda (file)
7329 (install-file file (string-append "../" (dirname file))))
7330 (find-files "." ".*")))
7331 (delete-file-recursively "src/jdtCompilerAdaptersrc/")
7332 #t))
7333 (add-before 'build 'copy-resources
7334 (lambda _
7335 (with-directory-excursion "src"
7336 (for-each (lambda (file)
7337 (install-file file (string-append "../build/classes/" (dirname file))))
7338 (find-files "." ".*.(props|properties|rsc)")))
7339 #t)))))
c24d11b7
RW
7340 (inputs
7341 `(("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
7342 ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
7343 ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
7344 ("java-eclipse-core-resources" ,java-eclipse-core-resources)
7345 ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
7346 ("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
7347 ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
7348 ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
7349 ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
7350 ("java-eclipse-osgi" ,java-eclipse-osgi)
7351 ("java-eclipse-text" ,java-eclipse-text)))
7352 (home-page "https://www.eclipse.org/jdt")
7353 (synopsis "Java development tools core libraries")
7354 (description "This package provides the core libraries of the Eclipse Java
7355development tools.")
7356 (license license:epl1.0)))
7357
74c2339f
RW
7358(define-public java-eclipse-jdt-compiler-apt
7359 (package
7360 (name "java-eclipse-jdt-compiler-apt")
7361 (version "1.3.400")
7362 (source (origin
7363 (method url-fetch)
7364 (uri (string-append "https://repo1.maven.org/maven2/"
7365 "org/eclipse/jdt/org.eclipse.jdt.compiler.apt/"
7366 version "/org.eclipse.jdt.compiler.apt-"
7367 version "-sources.jar"))
7368 (sha256
7369 (base32
7370 "1s285k9p2ixdqrknb40jbbvw682n9a7l5lqpn583a8pvlzg2l6r8"))))
7371 (build-system ant-build-system)
7372 (arguments
7373 `(#:tests? #f ; no tests included
7374 #:jar-name "eclipse-jdt-compiler-apt.jar"
7375 #:jdk ,openjdk11))
7376 (inputs
7377 `(("java-eclipse-jdt-core" ,java-eclipse-jdt-core)))
7378 (home-page "https://www.eclipse.org/jdt/apt/")
7379 (synopsis "Annotation processing tool")
7380 (description "APT stands for Annotation Processing Tool. APT provides a
7381means for generating files and compiling new Java classes based on annotations
7382found in your source code.")
7383 (license license:epl2.0)))
7384
a5cdcf6c
RW
7385(define-public java-javax-mail
7386 (package
7387 (name "java-javax-mail")
7388 (version "1.5.6")
7389 (source (origin
7390 (method url-fetch)
7391 (uri (string-append "https://repo1.maven.org/maven2/"
7392 "com/sun/mail/javax.mail/"
7393 version "/javax.mail-"
7394 version "-sources.jar"))
7395 (sha256
7396 (base32
7397 "0sdlfgsc2b5s89xv1261y8i0jijcja019k2x1c8ngfn582w4jly9"))))
7398 (build-system ant-build-system)
7399 (arguments
7400 `(#:tests? #f ; no tests
7401 #:jar-name "javax-mail.jar"))
7402 (home-page "https://javamail.java.net")
7403 (synopsis "Reference implementation of the JavaMail API")
7404 (description
7405 "This package provides versions of the JavaMail API implementation, IMAP,
7406SMTP, and POP3 service providers, some examples, and documentation for the
7407JavaMail API.")
7408 ;; GPLv2 only with "classpath exception".
7409 (license license:gpl2)))
7410
0e660c4d
RW
7411(define-public java-log4j-api
7412 (package
7413 (name "java-log4j-api")
7414 (version "2.4.1")
7415 (source (origin
7416 (method url-fetch)
7417 (uri (string-append "mirror://apache/logging/log4j/" version
7418 "/apache-log4j-" version "-src.tar.gz"))
7419 (sha256
7420 (base32
7421 "0j5p9gik0jysh37nlrckqbky12isy95cpwg2gv5fas1rcdqbraxd"))))
7422 (build-system ant-build-system)
7423 (arguments
7424 `(#:tests? #f ; tests require unpackaged software
7425 #:jar-name "log4j-api.jar"
7426 #:make-flags
7427 (list (string-append "-Ddist.dir=" (assoc-ref %outputs "out")
7428 "/share/java"))
7429 #:phases
7430 (modify-phases %standard-phases
7431 (add-after 'unpack 'enter-dir
7432 (lambda _ (chdir "log4j-api") #t))
7433 ;; FIXME: The tests require additional software that has not been
7434 ;; packaged yet, such as
7435 ;; * org.apache.maven
7436 ;; * org.apache.felix
7437 (add-after 'enter-dir 'delete-tests
7438 (lambda _ (delete-file-recursively "src/test") #t)))))
7439 (inputs
7440 `(("java-osgi-core" ,java-osgi-core)
7441 ("java-hamcrest-core" ,java-hamcrest-core)
7442 ("java-junit" ,java-junit)))
4d1ddb51 7443 (home-page "https://logging.apache.org/log4j/2.x/")
0e660c4d
RW
7444 (synopsis "API module of the Log4j logging framework for Java")
7445 (description
7446 "This package provides the API module of the Log4j logging framework for
7447Java.")
7448 (license license:asl2.0)))
7449
dfef4231
JL
7450(define-public java-log4j-core
7451 (package
7452 (inherit java-log4j-api)
7453 (name "java-log4j-core")
7454 (inputs
7455 `(("java-osgi-core" ,java-osgi-core)
7456 ("java-hamcrest-core" ,java-hamcrest-core)
7457 ("java-log4j-api" ,java-log4j-api)
7458 ("java-mail" ,java-mail)
7459 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
7460 ("java-lmax-disruptor" ,java-lmax-disruptor)
7461 ("java-kafka" ,java-kafka-clients)
7462 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
7463 ("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
7464 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
7465 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
7466 ("java-fasterxml-jackson-dataformat-xml" ,java-fasterxml-jackson-dataformat-xml)
7467 ("java-fasterxml-jackson-dataformat-yaml" ,java-fasterxml-jackson-dataformat-yaml)
7468 ("java-commons-compress" ,java-commons-compress)
7469 ("java-commons-csv" ,java-commons-csv)
7470 ("java-jeromq" ,java-jeromq)
7471 ("java-junit" ,java-junit)))
7472 (native-inputs
7473 `(("hamcrest" ,java-hamcrest-all)
7474 ("java-commons-io" ,java-commons-io)
7475 ("java-commons-lang3" ,java-commons-lang3)
7476 ("slf4j" ,java-slf4j-api)))
7477 (arguments
7478 `(#:tests? #f ; tests require more dependencies
7479 #:test-dir "src/test"
7480 #:source-dir "src/main/java"
7481 #:jar-name "log4j-core.jar"
7482 #:jdk ,icedtea-8
7483 #:make-flags
7484 (list (string-append "-Ddist.dir=" (assoc-ref %outputs "out")
7485 "/share/java"))
7486 #:phases
7487 (modify-phases %standard-phases
7488 (add-after 'unpack 'enter-dir
7489 (lambda _ (chdir "log4j-core") #t)))))
7490 (synopsis "Core component of the Log4j framework")
7491 (description "This package provides the core component of the Log4j
7492logging framework for Java.")))
7493
2caf873e
JL
7494(define-public java-log4j-1.2-api
7495 (package
7496 (inherit java-log4j-api)
7497 (name "java-log4j-1.2-api")
7498 (arguments
7499 `(#:jar-name "java-log4j-1.2-api.jar"
7500 #:source-dir "log4j-1.2-api/src/main/java"
7501 #:jdk ,icedtea-8
7502 ;; Tests require maven-model (and other maven subprojects), which is a
7503 ;; cyclic dependency.
7504 #:tests? #f))
7505 (inputs
7506 `(("log4j-api" ,java-log4j-api)
7507 ("log4j-core" ,java-log4j-core)
7508 ("osgi-core" ,java-osgi-core)
7509 ("eclipse-osgi" ,java-eclipse-osgi)
7510 ("java-lmax-disruptor" ,java-lmax-disruptor)))))
7511
1c188f4e
HG
7512(define-public java-commons-cli
7513 (package
7514 (name "java-commons-cli")
37602dd8 7515 (version "1.4")
1c188f4e
HG
7516 (source (origin
7517 (method url-fetch)
7518 (uri (string-append "mirror://apache/commons/cli/source/"
7519 "commons-cli-" version "-src.tar.gz"))
7520 (sha256
7521 (base32
37602dd8 7522 "05hgi2z01fqz374y719gl1dxzqvzci5af071zm7vxrjg9vczipm1"))))
1c188f4e
HG
7523 (build-system ant-build-system)
7524 ;; TODO: javadoc
7525 (arguments
51087d51
JL
7526 `(#:jar-name "commons-cli.jar"
7527 #:phases
7528 (modify-phases %standard-phases
7529 (replace 'install
7530 (install-from-pom "pom.xml")))))
1c188f4e
HG
7531 (native-inputs
7532 `(("java-junit" ,java-junit)
7533 ("java-hamcrest-core" ,java-hamcrest-core)))
1b3a6038 7534 (home-page "https://commons.apache.org/cli/")
1c188f4e
HG
7535 (synopsis "Command line arguments and options parsing library")
7536 (description "The Apache Commons CLI library provides an API for parsing
7537command line options passed to programs. It is also able to print help
7538messages detailing the options available for a command line tool.
7539
7540Commons CLI supports different types of options:
7541
7542@itemize
7543@item POSIX like options (ie. tar -zxvf foo.tar.gz)
7544@item GNU like long options (ie. du --human-readable --max-depth=1)
7545@item Java like properties (ie. java -Djava.awt.headless=true Foo)
7546@item Short options with value attached (ie. gcc -O2 foo.c)
7547@item long options with single hyphen (ie. ant -projecthelp)
7548@end itemize
7549
7550This is a part of the Apache Commons Project.")
7551 (license license:asl2.0)))
0a8519bc
HG
7552
7553(define-public java-commons-codec
7554 (package
7555 (name "java-commons-codec")
ba03666d 7556 (version "1.14")
0a8519bc
HG
7557 (source (origin
7558 (method url-fetch)
7559 (uri (string-append "mirror://apache/commons/codec/source/"
7560 "commons-codec-" version "-src.tar.gz"))
7561 (sha256
7562 (base32
ba03666d 7563 "11xr0agckkhm91pb5akf2mbk84yd54gyr178wj57gsm97fi7nkh9"))))
0a8519bc 7564 (build-system ant-build-system)
0a8519bc 7565 (arguments
ba03666d
JL
7566 `(#:jar-name "java-commons-codec.jar"
7567 #:source-dir "src/main/java"
7568 #:test-dir "src/test"
7569 #:test-exclude (list "**/*AbstractTest.java")
0a8519bc
HG
7570 #:phases
7571 (modify-phases %standard-phases
ba03666d
JL
7572 (add-before 'build 'copy-resources
7573 (lambda _
7574 (copy-recursively "src/main/resources"
7575 "build/classes")
7576 #t))
7577 (add-before 'check 'copy-test-resources
7578 (lambda _
7579 (copy-recursively "src/test/resources"
7580 "build/test-classes")
7581 #t))
7582 (replace 'install (install-from-pom "pom.xml")))))
0a8519bc 7583 (native-inputs
ba03666d
JL
7584 `(("java-commons-lang3" ,java-commons-lang3)
7585 ("java-junit" ,java-junit)))
7586 (propagated-inputs
7587 `(("apache-commons-parent-pom" ,apache-commons-parent-pom-50)))
77e1fe31 7588 (home-page "https://commons.apache.org/codec/")
0a8519bc
HG
7589 (synopsis "Common encoders and decoders such as Base64, Hex, Phonetic and URLs")
7590 (description "The codec package contains simple encoder and decoders for
7591various formats such as Base64 and Hexadecimal. In addition to these widely
7592used encoders and decoders, the codec package also maintains a collection of
7593phonetic encoding utilities.
7594
7595This is a part of the Apache Commons Project.")
7596 (license license:asl2.0)))
7d91c1b9
HG
7597
7598(define-public java-commons-daemon
7599 (package
7600 (name "java-commons-daemon")
b503ae3d 7601 (version "1.1.0")
7d91c1b9
HG
7602 (source (origin
7603 (method url-fetch)
7604 (uri (string-append "mirror://apache/commons/daemon/source/"
7605 "commons-daemon-" version "-src.tar.gz"))
7606 (sha256
7607 (base32
b503ae3d 7608 "141gkhfzv5v3pdhic6y4ardq2dhsa3v36j8wmmhy6f8mac48fp7n"))))
7d91c1b9
HG
7609 (build-system ant-build-system)
7610 (arguments
7611 `(#:test-target "test"
7612 #:phases
7613 (modify-phases %standard-phases
7614 (add-after 'build 'build-javadoc ant-build-javadoc)
7615 (replace 'install (install-jars "dist"))
7616 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
7617 (native-inputs
7618 `(("java-junit" ,java-junit)))
4f236f84 7619 (home-page "https://commons.apache.org/daemon/")
7d91c1b9
HG
7620 (synopsis "Library to launch Java applications as daemons")
7621 (description "The Daemon package from Apache Commons can be used to
7622implement Java applications which can be launched as daemons. For example the
7623program will be notified about a shutdown so that it can perform cleanup tasks
7624before its process of execution is destroyed by the operation system.
7625
7626This package contains the Java library. You will also need the actual binary
7627for your architecture which is provided by the jsvc package.
7628
7629This is a part of the Apache Commons Project.")
7630 (license license:asl2.0)))
9f68e74a 7631
eb270ecf
RW
7632(define-public java-javaewah
7633 (package
7634 (name "java-javaewah")
7635 (version "1.1.6")
7636 (source (origin
2876b233
EF
7637 (method git-fetch)
7638 (uri (git-reference
7639 (url "https://github.com/lemire/javaewah/")
7640 (commit (string-append "JavaEWAH-" version))))
7641 (file-name (git-file-name name version))
eb270ecf
RW
7642 (sha256
7643 (base32
2876b233 7644 "1m8qcb1py76v7avbjjrkvyy6fhr5dk2ywy73gbsxqry04gkm2nhw"))))
eb270ecf
RW
7645 (build-system ant-build-system)
7646 (arguments `(#:jar-name "javaewah.jar"))
7647 (inputs
7648 `(("java-junit" ,java-junit)
7649 ("java-hamcrest-core" ,java-hamcrest-core)))
7650 (home-page "https://github.com/lemire/javaewah")
7651 (synopsis "Compressed alternative to the Java @code{BitSet} class")
7652 (description "This is a word-aligned compressed variant of the Java
7653@code{Bitset} class. It provides both a 64-bit and a 32-bit RLE-like
7654compression scheme. It can be used to implement bitmap indexes.
7655
7656The goal of word-aligned compression is not to achieve the best compression,
2876b233 7657but rather to improve query processing time. Hence, JavaEWAH tries to save CPU
eb270ecf
RW
7658cycles, maybe at the expense of storage. However, the EWAH scheme is always
7659more efficient storage-wise than an uncompressed bitmap (as implemented in the
7660@code{BitSet} class by Sun).")
7661 ;; GPL2.0 derivates are explicitly allowed.
7662 (license license:asl2.0)))
7663
f8e4d022
RW
7664(define-public java-slf4j-api
7665 (package
7666 (name "java-slf4j-api")
7667 (version "1.7.25")
7668 (source (origin
7669 (method url-fetch)
7670 (uri (string-append "https://www.slf4j.org/dist/slf4j-"
7671 version ".tar.gz"))
7672 (sha256
7673 (base32
7674 "13j51sgzmhhdrfa74gkal5zpip7r1440dh7zsi2c8bpb2zs1v8kb"))
7675 (modules '((guix build utils)))
7676 ;; Delete bundled jars.
7677 (snippet
7678 '(begin
7679 (for-each delete-file (find-files "." "\\.jar$"))
7680 #t))))
7681 (build-system ant-build-system)
7682 (arguments
dcf7a8a6 7683 `(#:jar-name "slf4j-api.jar"
f8e4d022 7684 #:source-dir "slf4j-api/src/main"
dcf7a8a6
JL
7685 #:test-dir "slf4j-api/src/test"
7686 #:phases
7687 (modify-phases %standard-phases
7688 (add-after 'build 'regenerate-jar
7689 (lambda _
7690 ;; pom.xml ignores these files in the jar creation process. If we don't,
7691 ;; we get the error "This code should have never made it into slf4j-api.jar"
7692 (delete-file-recursively "build/classes/org/slf4j/impl")
2c8ac364
MW
7693 (invoke "jar" "-cf" "build/jar/slf4j-api.jar" "-C"
7694 "build/classes" ".")))
dcf7a8a6
JL
7695 (add-before 'check 'dont-test-abstract-classes
7696 (lambda _
7697 ;; abstract classes are not meant to be run with junit
7698 (substitute* "build.xml"
7699 (("<include name=\"\\*\\*/\\*Test.java\" />")
7700 (string-append "<include name=\"**/*Test.java\" />"
7701 "<exclude name=\"**/MultithreadedInitializationTest"
2c8ac364 7702 ".java\" />")))
51087d51
JL
7703 #t))
7704 (replace 'install
7705 (install-from-pom "slf4j-api/pom.xml")))))
7706 (propagated-inputs
7707 `(("java-slf4j-parent" ,java-slf4j-parent)))
7708 (native-inputs
f8e4d022
RW
7709 `(("java-junit" ,java-junit)
7710 ("java-hamcrest-core" ,java-hamcrest-core)))
7711 (home-page "https://www.slf4j.org/")
7712 (synopsis "Simple logging facade for Java")
7713 (description "The Simple Logging Facade for Java (SLF4J) serves as a
7714simple facade or abstraction for various logging
7715frameworks (e.g. @code{java.util.logging}, @code{logback}, @code{log4j})
7716allowing the end user to plug in the desired logging framework at deployment
7717time.")
7718 (license license:expat)))
7719
51087d51 7720(define java-slf4j-parent
6d047cc4
GB
7721 (package
7722 (inherit java-slf4j-api)
51087d51
JL
7723 (name "java-slf4j-parent")
7724 (native-inputs `())
7725 (propagated-inputs '())
6d047cc4 7726 (arguments
51087d51
JL
7727 `(#:tests? #f
7728 #:phases
7729 (modify-phases %standard-phases
7730 (delete 'build)
7731 (delete 'configure)
7732 (replace 'install
7733 (install-pom-file "pom.xml")))))))
6d047cc4 7734
88f256a1
TD
7735(define-public java-slf4j-simple
7736 (package
7737 (name "java-slf4j-simple")
7738 (version "1.7.25")
7739 (source (package-source java-slf4j-api))
7740 (build-system ant-build-system)
7741 (arguments
7742 `(#:jar-name "slf4j-simple.jar"
7743 #:source-dir "slf4j-simple/src/main"
7744 #:test-dir "slf4j-simple/src/test"
7745 #:phases
7746 (modify-phases %standard-phases
7747 ;; The tests need some test classes from slf4j-api
7748 (add-before 'check 'build-slf4j-api-test-helpers
7749 (lambda _
7750 ;; Add current dir to CLASSPATH ...
7751 (setenv "CLASSPATH"
7752 (string-append (getcwd) ":" (getenv "CLASSPATH")))
7753 ;; ... and build test helper classes here:
2c8ac364
MW
7754 (apply invoke
7755 `("javac" "-d" "."
51087d51
JL
7756 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
7757 (replace 'install
7758 (install-from-pom "slf4j-simple/pom.xml")))))
7759 (propagated-inputs
7760 `(("java-slf4j-api" ,java-slf4j-api)))
7761 (native-inputs
88f256a1 7762 `(("java-junit" ,java-junit)
51087d51 7763 ("java-hamcrest-core" ,java-hamcrest-core)))
88f256a1
TD
7764 (home-page "https://www.slf4j.org/")
7765 (synopsis "Simple implementation of simple logging facade for Java")
7766 (description "SLF4J binding for the Simple implementation, which outputs
7767all events to System.err. Only messages of level INFO and higher are
7768printed.")
7769 (license license:expat)))
7770
9f68e74a
JL
7771(define-public antlr2
7772 (package
7773 (name "antlr2")
7774 (version "2.7.7")
7775 (source (origin
7776 (method url-fetch)
7420c1ee 7777 (uri (string-append "https://www.antlr2.org/download/antlr-"
9f68e74a
JL
7778 version ".tar.gz"))
7779 (sha256
7780 (base32
7781 "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5"))
7782 (modules '((guix build utils)))
7783 (snippet
7784 '(begin
7785 (delete-file "antlr.jar")
7786 (substitute* "lib/cpp/antlr/CharScanner.hpp"
7787 (("#include <map>")
7788 (string-append
6d225e89
RW
7789 "#include <map>\n"
7790 "#define EOF (-1)\n"
7791 "#include <strings.h>")))
9f68e74a 7792 (substitute* "configure"
6d225e89
RW
7793 (("/bin/sh") "sh"))
7794 #t))))
9f68e74a
JL
7795 (build-system gnu-build-system)
7796 (arguments
6d225e89 7797 `(#:tests? #f ; no test target
3ad90395
RW
7798 #:imported-modules ((guix build ant-build-system)
7799 (guix build syscalls)
7800 ,@%gnu-build-system-modules)
7801 #:modules (((guix build ant-build-system) #:prefix ant:)
7802 (guix build gnu-build-system)
7803 (guix build utils))
9f68e74a
JL
7804 #:phases
7805 (modify-phases %standard-phases
7806 (add-after 'install 'strip-jar-timestamps
3ad90395 7807 (assoc-ref ant:%standard-phases 'strip-jar-timestamps))
79f6fc0d
JL
7808 (add-before 'configure 'fix-timestamp
7809 (lambda _
7810 (substitute* "configure"
7811 (("^TIMESTAMP.*") "TIMESTAMP=19700101\n"))
7812 #t))
9f68e74a
JL
7813 (add-after 'configure 'fix-bin-ls
7814 (lambda _
3ad90395
RW
7815 (substitute* (find-files "." "Makefile")
7816 (("/bin/ls") "ls"))
7817 #t)))))
9f68e74a
JL
7818 (native-inputs
7819 `(("which" ,which)
7820 ("zip" ,zip)
7821 ("java" ,icedtea "jdk")))
7822 (inputs
7823 `(("java" ,icedtea)))
7420c1ee 7824 (home-page "https://www.antlr2.org")
9f68e74a
JL
7825 (synopsis "Framework for constructing recognizers, compilers, and translators")
7826 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
7827is a language tool that provides a framework for constructing recognizers,
7828compilers, and translators from grammatical descriptions containing Java, C#,
7829C++, or Python actions. ANTLR provides excellent support for tree construction,
7830tree walking, and translation.")
7831 (license license:public-domain)))
a0f15eff 7832
e44112e1 7833(define-public java-stringtemplate-3
a0f15eff 7834 (package
e44112e1 7835 (name "java-stringtemplate")
a0f15eff
JL
7836 (version "3.2.1")
7837 (source (origin
7838 (method url-fetch)
7839 (uri (string-append "https://github.com/antlr/website-st4/raw/"
7840 "gh-pages/download/stringtemplate-"
7841 version ".tar.gz"))
7842 (sha256
7843 (base32
7844 "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is"))))
7845 (build-system ant-build-system)
7846 (arguments
129d926d 7847 `(#:jar-name (string-append ,name "-" ,version ".jar")
2fcda6d2 7848 #:test-dir "test"
b101b4e8
RW
7849 #:modules ((guix build ant-build-system)
7850 (guix build utils)
7851 (srfi srfi-1))
a0f15eff
JL
7852 #:phases
7853 (modify-phases %standard-phases
2fcda6d2
RW
7854 (add-before 'check 'fix-tests
7855 (lambda _
7856 (substitute* "build.xml"
7857 (("\\$\\{test.home\\}/java")
7858 "${test.home}/org"))
7859 #t))
a0f15eff
JL
7860 (add-before 'build 'generate-grammar
7861 (lambda _
b101b4e8 7862 (with-directory-excursion "src/org/antlr/stringtemplate/language/"
2c8ac364
MW
7863 (for-each (lambda (file)
7864 (format #t "~a\n" file)
7865 (invoke "antlr" file))
7866 '("template.g" "angle.bracket.template.g" "action.g"
7867 "eval.g" "group.g" "interface.g")))
7868 #t)))))
a0f15eff 7869 (native-inputs
2fcda6d2
RW
7870 `(("antlr" ,antlr2)
7871 ("java-junit" ,java-junit)))
ba11a8bd 7872 (home-page "https://www.stringtemplate.org")
a0f15eff
JL
7873 (synopsis "Template engine to generate formatted text output")
7874 (description "StringTemplate is a java template engine (with ports for C#,
7875Objective-C, JavaScript, Scala) for generating source code, web pages, emails,
7876or any other formatted text output. StringTemplate is particularly good at
7877code generators, multiple site skins, and internationalization / localization.
7878StringTemplate also powers ANTLR.")
7879 (license license:bsd-3)))
4ad8aed7
JL
7880
7881;; antlr3 is partially written using antlr3 grammar files. It also depends on
7882;; ST4 (stringtemplate4), which is also partially written using antlr3 grammar
7883;; files and uses antlr3 at runtime. The latest version requires a recent version
7884;; of antlr3 at runtime.
7885;; Fortunately, ST4 4.0.6 can be built with an older antlr3, and we use antlr3.3.
7886;; This version of ST4 is sufficient for the latest antlr3.
7887;; We use ST4 4.0.6 to build a boostrap antlr3 (latest version), and build
7888;; the latest ST4 with it. Then we build our final antlr3 that will be linked
7889;; against the latest ST4.
7890;; antlr3.3 still depends on antlr3 to generate some files, so we use an
7891;; even older version, antlr3.1, to generate them. Fortunately antlr3.1 uses
7892;; only grammar files with the antlr2 syntax.
7893;; So we build antlr3.1 -> antlr3.3 -> ST4.0.6 -> antlr3-bootstrap -> ST4 -> antlr3.
7894
64b7efc0 7895(define-public java-stringtemplate
407df789 7896 (package (inherit java-stringtemplate-3)
64b7efc0 7897 (name "java-stringtemplate")
4ad8aed7
JL
7898 (version "4.0.8")
7899 (source (origin
7900 (method url-fetch)
7901 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/"
7902 version ".tar.gz"))
7903 (file-name (string-append name "-" version ".tar.gz"))
7904 (sha256
7905 (base32
7906 "1pri8hqa95rfdkjy55icl5q1m09zwp5k67ib14abas39s4v3w087"))))
7907 (build-system ant-build-system)
7908 (arguments
6db77c7c
RW
7909 `(#:jar-name (string-append ,name "-" ,version ".jar")
7910 #:tests? #f ; FIXME: tests fail for unknown reasons
7911 #:test-dir "test"
f4aa4cfe
RW
7912 #:modules ((guix build ant-build-system)
7913 (guix build utils)
7914 (srfi srfi-1))
4ad8aed7
JL
7915 #:phases
7916 (modify-phases %standard-phases
6db77c7c
RW
7917 (add-before 'check 'fix-test-target
7918 (lambda _
7919 (substitute* "build.xml"
7920 (("\\$\\{test.home\\}/java") "${test.home}/")
7921 (("\\*Test.java") "Test*.java"))
7922 #t))
4ad8aed7 7923 (add-before 'build 'generate-grammar
f4aa4cfe
RW
7924 (lambda _
7925 (with-directory-excursion "src/org/stringtemplate/v4/compiler/"
2c8ac364
MW
7926 (for-each (lambda (file)
7927 (format #t "~a\n" file)
7928 (invoke "antlr3" file))
7929 '("STParser.g" "Group.g" "CodeGenerator.g")))
7930 #t)))))
4ad8aed7
JL
7931 (inputs
7932 `(("antlr3" ,antlr3-bootstrap)
7933 ("antlr2" ,antlr2)
6db77c7c
RW
7934 ("java-stringtemplate" ,java-stringtemplate-3)
7935 ("java-junit" ,java-junit)))))
4ad8aed7 7936
1345eeb0 7937(define java-stringtemplate-4.0.6
64b7efc0 7938 (package (inherit java-stringtemplate)
1345eeb0 7939 (name "java-stringtemplate")
4ad8aed7
JL
7940 (version "4.0.6")
7941 (source (origin
7942 (method url-fetch)
7943 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/ST-"
7944 version ".tar.gz"))
7945 (file-name (string-append name "-" version ".tar.gz"))
7946 (sha256
7947 (base32
7948 "0hjmh1ahdsh3w825i67mli9l4nncc4l6hdbf9ma91jvlj590sljp"))))
7949 (inputs
7950 `(("antlr3" ,antlr3-3.3)
7951 ("antlr2" ,antlr2)
e44112e1 7952 ("java-stringtemplate" ,java-stringtemplate-3)))))
4ad8aed7
JL
7953
7954(define-public antlr3
7955 (package
7956 (name "antlr3")
7957 (version "3.5.2")
7958 (source (origin
043ee597
EF
7959 (method git-fetch)
7960 (uri (git-reference
7961 (url "https://github.com/antlr/antlr3")
7962 (commit version)))
7963 (file-name (git-file-name name version))
4ad8aed7
JL
7964 (sha256
7965 (base32
043ee597 7966 "0cafavrjmzqhklghrk8c2jqxkdwxgzskm20pbrfd3r41cn00dpnf"))))
4ad8aed7
JL
7967 (build-system ant-build-system)
7968 (arguments
7969 `(#:jar-name (string-append ,name "-" ,version ".jar")
7970 #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3"
7971 #:tests? #f
7972 #:phases
7973 (modify-phases %standard-phases
7974 (add-after 'install 'bin-install
7975 (lambda* (#:key inputs outputs #:allow-other-keys)
7976 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
7977 (bin (string-append (assoc-ref outputs "out") "/bin")))
7978 (mkdir-p bin)
7979 (with-output-to-file (string-append bin "/antlr3")
7980 (lambda _
7981 (display
7982 (string-append "#!" (which "sh") "\n"
7983 "java -cp " jar "/" ,name "-" ,version ".jar:"
7984 (string-concatenate
7985 (find-files (assoc-ref inputs "stringtemplate")
7986 ".*\\.jar"))
7987 ":"
7988 (string-concatenate
7989 (find-files (assoc-ref inputs "stringtemplate4")
7990 ".*\\.jar"))
7991 ":"
7992 (string-concatenate
7993 (find-files (string-append
7994 (assoc-ref inputs "antlr")
7995 "/lib")
7996 ".*\\.jar"))
7997 " org.antlr.Tool $*"))))
2c8ac364
MW
7998 (chmod (string-append bin "/antlr3") #o755))
7999 #t))
4ad8aed7
JL
8000 (add-before 'build 'generate-grammar
8001 (lambda _
8002 (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/")
8003 (for-each (lambda (file)
8004 (display file)
8005 (newline)
2c8ac364 8006 (invoke "antlr3" file))
4ad8aed7
JL
8007 '("ANTLR.g" "ANTLRTreePrinter.g" "ActionAnalysis.g"
8008 "AssignTokenTypesWalker.g"
8009 "ActionTranslator.g" "TreeToNFAConverter.g"
8010 "ANTLRv3.g" "ANTLRv3Tree.g" "LeftRecursiveRuleWalker.g"
8011 "CodeGenTreeWalker.g" "DefineGrammarItemsWalker.g"))
8012 (substitute* "ANTLRParser.java"
8013 (("public Object getTree") "public GrammarAST getTree"))
8014 (substitute* "ANTLRv3Parser.java"
8015 (("public Object getTree") "public CommonTree getTree"))
8016 (chdir "../../../../../java")
4ad8aed7
JL
8017 (substitute* "org/antlr/tool/LeftRecursiveRuleAnalyzer.java"
8018 (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*;
8019import org.antlr.grammar.v3.ANTLRTreePrinter;"))
8020 (substitute* "org/antlr/tool/ErrorManager.java"
8021 (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") ""))
2c8ac364
MW
8022 (chdir "../../../..")
8023 #t))
4ad8aed7
JL
8024 (add-before 'build 'fix-build-xml
8025 (lambda _
8026 (substitute* "build.xml"
570f3b63
JL
8027 (("target name=\"compile\">")
8028 "target name=\"compile\">
8029<copy todir=\"${classes.dir}\">
4ad8aed7
JL
8030<fileset dir=\"tool/src/main/resources\">
8031<include name=\"**/*.stg\"/>
8032<include name=\"**/*.st\"/>
8033<include name=\"**/*.sti\"/>
8034<include name=\"**/STLexer.tokens\"/>
8035</fileset>
570f3b63 8036</copy>"))
2c8ac364 8037 #t)))))
4ad8aed7
JL
8038 (native-inputs
8039 `(("antlr" ,antlr2)
8040 ("antlr3" ,antlr3-bootstrap)))
8041 (inputs
8042 `(("junit" ,java-junit)
e44112e1 8043 ("stringtemplate" ,java-stringtemplate-3)
64b7efc0 8044 ("stringtemplate4" ,java-stringtemplate)))
4ad8aed7 8045 (propagated-inputs
e44112e1 8046 `(("stringtemplate" ,java-stringtemplate-3)
4ad8aed7 8047 ("antlr" ,antlr2)
1345eeb0 8048 ("stringtemplate4" ,java-stringtemplate-4.0.6)))
a264250b 8049 (home-page "https://www.antlr3.org")
4ad8aed7
JL
8050 (synopsis "Framework for constructing recognizers, compilers, and translators")
8051 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
8052is a language tool that provides a framework for constructing recognizers,
8053compilers, and translators from grammatical descriptions containing Java, C#,
8054C++, or Python actions. ANTLR provides excellent support for tree construction,
8055tree walking, and translation.")
8056 (license license:bsd-3)))
8057
8058(define antlr3-bootstrap
8059 (package
8060 (inherit antlr3)
8061 (name "antlr3-bootstrap")
8062 (native-inputs
8063 `(("antlr" ,antlr2)
8064 ("antlr3" ,antlr3-3.3)))
8065 (inputs
8066 `(("junit" ,java-junit)))))
8067
011f9412 8068(define-public antlr3-3.3
4ad8aed7
JL
8069 (package
8070 (inherit antlr3)
8071 (name "antlr3")
8072 (version "3.3")
8073 (source (origin
8074 (method url-fetch)
8075 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
8076 "gh-pages/download/antlr-"
8077 version ".tar.gz"))
8078 (sha256
8079 (base32
48c86220
GB
8080 "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m"))
8081 (patches
8082 (search-patches "antlr3-3_3-fix-java8-compilation.patch"))))
4ad8aed7
JL
8083 (arguments
8084 `(#:jar-name (string-append ,name "-" ,version ".jar")
a9540107
RW
8085 #:source-dir (string-join '("tool/src/main/java"
8086 "runtime/Java/src/main/java"
8087 "tool/src/main/antlr2"
8088 "tool/src/main/antlr3")
8089 ":")
8090 #:tests? #f ; FIXME: tests seem to require maven plugin
8091 #:modules ((guix build ant-build-system)
8092 (guix build utils)
8093 (srfi srfi-1))
4ad8aed7
JL
8094 #:phases
8095 (modify-phases %standard-phases
8096 (add-after 'install 'bin-install
8097 (lambda* (#:key inputs outputs #:allow-other-keys)
a9540107
RW
8098 (let* ((out (assoc-ref outputs "out"))
8099 (jar (string-append out "/share/java"))
8100 (bin (string-append out "/bin")))
4ad8aed7
JL
8101 (mkdir-p bin)
8102 (with-output-to-file (string-append bin "/antlr3")
8103 (lambda _
8104 (display
a9540107
RW
8105 (string-append
8106 "#!" (which "sh") "\n"
8107 "java -cp " jar "/antlr3-3.3.jar:"
8108 (string-join
8109 (append (find-files (assoc-ref inputs "java-stringtemplate")
8110 ".*\\.jar$")
8111 (find-files (string-append (assoc-ref inputs "antlr")
8112 "/lib")
8113 ".*\\.jar$"))
8114 ":")
8115 " org.antlr.Tool $*"))))
8116 (chmod (string-append bin "/antlr3") #o755)
8117 #t)))
4ad8aed7
JL
8118 (add-before 'build 'generate-grammar
8119 (lambda _
4ad8aed7
JL
8120 (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java"
8121 (("import org.antlr.grammar.v2.\\*;")
8122 "import org.antlr.grammar.v2.*;\n
8123import org.antlr.grammar.v2.TreeToNFAConverter;\n
8124import org.antlr.grammar.v2.DefineGrammarItemsWalker;\n
a9540107 8125import org.antlr.grammar.v2.ANTLRTreePrinter;"))
2c8ac364
MW
8126 (with-directory-excursion "tool/src/main/antlr2/org/antlr/grammar/v2/"
8127 (for-each (lambda (file)
8128 (format #t "~a\n" file)
8129 (invoke "antlr" file))
8130 '("antlr.g" "antlr.print.g" "assign.types.g"
8131 "buildnfa.g" "codegen.g" "define.g")))
8132 (with-directory-excursion "tool/src/main/antlr3/org/antlr/grammar/v3/"
8133 (for-each (lambda (file)
8134 (format #t "~a\n" file)
8135 (invoke "antlr3" file))
8136 '("ActionAnalysis.g" "ActionTranslator.g" "ANTLRv3.g"
8137 "ANTLRv3Tree.g")))
8138 #t))
4ad8aed7
JL
8139 (add-before 'build 'fix-build-xml
8140 (lambda _
8141 (substitute* "build.xml"
570f3b63
JL
8142 (("target name=\"compile\">")
8143 "target name=\"compile\">
8144<copy todir=\"${classes.dir}\">
4ad8aed7
JL
8145<fileset dir=\"tool/src/main/resources\">
8146<include name=\"**/*.stg\"/>
8147<include name=\"**/*.st\"/>
8148<include name=\"**/*.sti\"/>
8149<include name=\"**/STLexer.tokens\"/>
8150</fileset>
570f3b63 8151</copy>"))
a9540107 8152 #t)))))
4ad8aed7
JL
8153 (native-inputs
8154 `(("antlr" ,antlr2)
8155 ("antlr3" ,antlr3-3.1)))
8156 (inputs
8157 `(("junit" ,java-junit)))
8158 (propagated-inputs
e44112e1 8159 `(("java-stringtemplate" ,java-stringtemplate-3)
dcd62e8b 8160 ("antlr" ,antlr2)))))
4ad8aed7 8161
570f3b63 8162(define-public antlr3-3.1
4ad8aed7
JL
8163 (package
8164 (inherit antlr3)
4ad8aed7
JL
8165 (version "3.1")
8166 (source (origin
8167 (method url-fetch)
8168 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
8169 "gh-pages/download/antlr-"
8170 version ".tar.gz"))
8171 (sha256
8172 (base32
4c763b4d
GB
8173 "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z"))
8174 (patches
8175 (search-patches "antlr3-3_1-fix-java8-compilation.patch"))))
4ad8aed7 8176 (arguments
ec32bc98 8177 `(#:jar-name (string-append "antlr3-" ,version ".jar")
4ad8aed7
JL
8178 #:source-dir "src:runtime/Java/src"
8179 #:tests? #f
8180 #:phases
8181 (modify-phases %standard-phases
8182 (add-after 'install 'bin-install
8183 (lambda* (#:key inputs outputs #:allow-other-keys)
8184 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
8185 (bin (string-append (assoc-ref outputs "out") "/bin")))
8186 (mkdir-p bin)
8187 (with-output-to-file (string-append bin "/antlr3")
8188 (lambda _
8189 (display
8190 (string-append "#!" (which "sh") "\n"
57e37764 8191 "java -cp " jar "/antlr3-3.1.jar:"
4ad8aed7
JL
8192 (string-concatenate
8193 (find-files (assoc-ref inputs "stringtemplate")
8194 ".*\\.jar"))
8195 ":"
8196 (string-concatenate
8197 (find-files (string-append
8198 (assoc-ref inputs "antlr")
8199 "/lib")
8200 ".*\\.jar"))
8201 " org.antlr.Tool $*"))))
2c8ac364
MW
8202 (chmod (string-append bin "/antlr3") #o755))
8203 #t))
4ad8aed7
JL
8204 (add-before 'build 'generate-grammar
8205 (lambda _
8206 (let ((dir "src/org/antlr/tool/"))
8207 (for-each (lambda (file)
8208 (display file)
8209 (newline)
13f38d31 8210 (invoke "antlr" "-o" dir (string-append dir file)))
4ad8aed7
JL
8211 '("antlr.g" "antlr.print.g" "assign.types.g"
8212 "buildnfa.g" "define.g")))
8213 (format #t "codegen.g\n")
13f38d31
RW
8214 (invoke "antlr" "-o" "src/org/antlr/codegen"
8215 "src/org/antlr/codegen/codegen.g")
8216 #t))
4ad8aed7
JL
8217 (add-before 'build 'fix-build-xml
8218 (lambda _
8219 (substitute* "build.xml"
570f3b63
JL
8220 (("target name=\"compile\">")
8221 "target name=\"compile\">
8222<copy todir=\"${classes.dir}\">
4ad8aed7
JL
8223<fileset dir=\"src\">
8224<include name=\"**/*.stg\"/>
8225<include name=\"**/*.st\"/>
8226<include name=\"**/*.sti\"/>
8227<include name=\"**/STLexer.tokens\"/>
8228</fileset>
570f3b63 8229</copy>"))
2c8ac364 8230 #t)))))
4ad8aed7
JL
8231 (native-inputs
8232 `(("antlr" ,antlr2)))
8233 (inputs
8234 `(("junit" ,java-junit)))
8235 (propagated-inputs
e44112e1 8236 `(("stringtemplate" ,java-stringtemplate-3)))))
d44bcd7a 8237
1d630fe0
JL
8238(define-public java-treelayout
8239 (package
8240 (name "java-treelayout")
8241 (version "1.0.3")
8242 (source (origin
8243 (method git-fetch)
8244 (uri (git-reference
8245 (url "https://github.com/abego/treelayout")
8246 (commit (string-append "v" version))))
8247 (file-name (git-file-name name version))
8248 (sha256
8249 (base32
8250 "18my8ql9b1y0n0zrvkih7xfhf3dpgfhyfifvkcfhmwcvw3divxak"))))
8251 (build-system ant-build-system)
8252 (arguments
8253 `(#:jar-name (string-append ,name "-" ,version ".jar")
8254 #:source-dir "org.abego.treelayout/src/main/java"
8255 #:test-dir "org.abego.treelayout/src/test"))
8256 (inputs
8257 `(("java-junit" ,java-junit)))
8258 (native-inputs
8259 `(("java-hamcrest-core" ,java-hamcrest-core)))
8260 (home-page "http://treelayout.sourceforge.net")
8261 (synopsis "Tree Layout Algorithm in Java")
8262 (description "TreeLayout creates tree layouts for arbitrary trees. It is
8263not restricted to a specific output or format, but can be used for any kind of
8264two dimensional diagram. Examples are Swing based components, SVG files, etc.
8265This is possible because TreeLayout separates the layout of a tree from the
8266actual rendering.")
8267 (license license:bsd-3)))
8268
5d115440
JL
8269(define-public java-antlr4-runtime
8270 (package
8271 (name "java-antlr4-runtime")
8272 (version "4.8")
8273 (source (origin
8274 (method git-fetch)
8275 (uri (git-reference
8276 (url "https://github.com/antlr/antlr4")
8277 (commit version)))
8278 (file-name (git-file-name name version))
8279 (sha256
8280 (base32
8281 "1qal3add26qxskm85nk7r758arladn5rcyjinmhlhznmpbbv9j8m"))
8282 (patches
8283 (search-patches "java-antlr4-Add-standalone-generator.patch"
8284 "java-antlr4-fix-code-too-large.java"))))
8285 (build-system ant-build-system)
8286 (arguments
8287 `(#:jar-name "java-antlr4-runtime.jar"
8288 #:source-dir "runtime/Java/src/org"
8289 #:tests? #f; tests depend on java-antlr4 itself
8290 #:phases
8291 (modify-phases %standard-phases
8292 (add-before 'build 'copy-resources
8293 (lambda _
8294 (copy-recursively "runtime/Java/src/main/dot"
8295 "build/classes")
8296 #t)))))
8297 (home-page "https://antlr.org")
8298 (synopsis "ANTLR runtime library")
8299 (description "This package contains the runtime library used with generated
8300sources by ANTLR.")
8301 (license license:bsd-3)))
8302
f9a6e389
JL
8303(define-public antlr4
8304 (package
8305 (inherit java-antlr4-runtime)
8306 (name "antlr4")
8307 (arguments
8308 `(#:jar-name "antlr4.jar"
8309 #:source-dir "tool/src"
8310 #:test-dir "tool-testsuite/test:runtime-testsuite/test:runtime-testsuite/annotations/src"
8311 #:test-include (list "**/Test*.java")
8312 #:test-exclude (list
8313 ;; no runnable method
8314 "**/TestOutputReading.java"
8315 ;; no @Test methods
8316 "**/TestParserErrors.java"
8317 "**/TestSemPredEvalParser.java"
8318 "**/TestSets.java"
8319 "**/TestListeners.java"
8320 "**/TestParseTrees.java"
8321 "**/TestParserExec.java"
8322 "**/TestLexerErrors.java"
8323 "**/TestPerformance.java"
8324 "**/TestCompositeParsers.java"
8325 "**/TestLexerExec.java"
8326 "**/TestSemPredEvalLexer.java"
8327 "**/TestLeftRecursion.java"
8328 "**/TestFullContextParsing.java"
8329 "**/TestCompositeLexers.java"
8330 ;; Null pointer exception
8331 "**/TestCompositeGrammars.java"
8332 ;; Wrong assumption on emoji
8333 "**/TestUnicodeData.java")
8334 #:phases
8335 (modify-phases %standard-phases
8336 (add-before 'build 'fix-build.xml
8337 (lambda _
8338 ;; tests are not in a java subdirectory
8339 (substitute* "build.xml"
8340 (("\\$\\{test.home\\}/java") "${test.home}"))
8341 #t))
8342 ;; tests require to have a working antlr4 binary
8343 (delete 'check)
8344 (add-after 'bin-install 'check
8345 (lambda _
8346 (invoke "ant" "compile-tests")
8347 (invoke "ant" "check" "-Dtest.home=runtime-testsuite/annotations/src")
8348 (invoke "ant" "check" "-Dtest.home=runtime-testsuite/test")
8349 (invoke "ant" "check" "-Dtest.home=tool-testsuite/test")
8350 #t))
8351 (add-before 'check 'remove-unrelated-languages
8352 (lambda _
8353 ;; There are tests for other languages that ANTLR can generate, but
8354 ;; we don't have the infrastructure for that yet. Let's test Java
8355 ;; generation only.
8356 (for-each
8357 (lambda (language)
8358 (delete-file-recursively
8359 (string-append "runtime-testsuite/test/org/antlr/v4/test/runtime/"
8360 language)))
8361 '("cpp" "csharp" "go" "javascript" "php" "python" "python2"
8362 "python3" "swift"))
8363 #t))
8364 (add-before 'check 'generate-test-parsers
8365 (lambda* (#:key outputs #:allow-other-keys)
8366 (define (run-antlr dir filename package)
8367 (invoke "antlr4" "-lib" dir "-visitor" "-no-listener"
8368 "-package" package (string-append dir "/" filename)
8369 "-Xlog"))
8370 (setenv "PATH" (string-append (getenv "PATH") ":"
8371 (assoc-ref outputs "out") "/bin"))
8372 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
8373 "Java.g4" "org.antlr.v4.test.runtime.java.api")
8374 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
8375 "VisitorBasic.g4" "org.antlr.v4.test.runtime.java.api")
8376 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
8377 "VisitorCalc.g4" "org.antlr.v4.test.runtime.java.api")
8378 #t))
8379 (add-before 'check 'remove-graphemes
8380 (lambda _
8381 ;; When running antlr on grahemes.g4, we get a runtime exception:
8382 ;; set is empty. So delete the file that depends on it.
8383 (delete-file
8384 "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/perf/TimeLexerSpeed.java")
8385 #t))
8386 (add-after 'install 'bin-install
8387 (lambda* (#:key inputs outputs #:allow-other-keys)
8388 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
8389 (bin (string-append (assoc-ref outputs "out") "/bin")))
8390 (mkdir-p bin)
8391 (with-output-to-file (string-append bin "/antlr4")
8392 (lambda _
8393 (display
8394 (string-append "#!" (which "sh") "\n"
8395 "java -cp " jar "/antlr4.jar:"
8396 (string-join
8397 (apply
8398 append
8399 (map
8400 (lambda (input)
8401 (find-files (assoc-ref inputs input)
8402 ".*\\.jar"))
8403 '("antlr3" "java-stringtemplate"
8404 "java-antlr4-runtime" "java-treelayout"
8405 "java-jsonp-api" "java-icu4j")))
8406 ":")
8407 " org.antlr.v4.Tool $*"))))
8408 (chmod (string-append bin "/antlr4") #o755)
8409 #t)))
8410 (add-before 'build 'copy-resources
8411 (lambda _
8412 (copy-recursively "tool/resources/" "build/classes")
8413 #t))
8414 (add-before 'build 'generate-unicode
8415 (lambda _
8416 ;; First: build the generator
8417 (invoke "javac" "-cp" (getenv "CLASSPATH")
8418 "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java"
8419 "tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java")
8420 ;; Then use it
8421 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
8422 ":tool/src:runtime/Java")
8423 "org.antlr.v4.unicode.UnicodeRenderer"
8424 "tool/resources/org/antlr/v4/tool/templates"
8425 "unicodedata"
8426 "tool/src/org/antlr/v4/unicode/UnicodeData.java")
8427 ;; It seems there is a bug with our ST4
8428 (substitute* "tool/src/org/antlr/v4/unicode/UnicodeData.java"
8429 (("\\\\>") ">"))
8430 ;; Remove the additional file
8431 (delete-file "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java")
8432 #t))
8433 (add-before 'build 'generate-grammar
8434 (lambda* (#:key inputs #:allow-other-keys)
8435 (with-directory-excursion "tool/src/org/antlr/v4/parse"
8436 (for-each (lambda (file)
8437 (display file)
8438 (newline)
8439 (invoke "antlr3" file))
8440 '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g"
8441 "GrammarTreeVisitor.g" "ATNBuilder.g"
8442 "ActionSplitter.g" "LeftRecursiveRuleWalker.g")))
8443 (with-directory-excursion "tool/src/org/antlr/v4/codegen"
8444 (install-file "../parse/ANTLRParser.tokens" ".")
8445 (display "SourceGenTriggers.g\n")
8446 (invoke "antlr3" "SourceGenTriggers.g"))
8447 #t)))))
8448 (inputs
8449 `(("antlr3" ,antlr3)
8450 ("java-antlr4-runtime" ,java-antlr4-runtime)
8451 ("java-icu4j" ,java-icu4j)
8452 ("java-jsonp-api" ,java-jsonp-api)
8453 ("java-stringtemplate" ,java-stringtemplate)
8454 ("java-treelayout" ,java-treelayout)))
8455 (native-inputs
8456 `(("java-junit" ,java-junit)))
8457 (synopsis "Parser and lexer generator in Java")
8458 (description "ANTLR (ANother Tool for Language Recognition) is a powerful
8459parser generator for reading, processing, executing, or translating structured
8460text or binary files. It's widely used to build languages, tools, and
8461frameworks. From a grammar, ANTLR generates a parser that can build and walk
8462parse trees.")))
8463
57f6a915
JL
8464(define-public java-antlr4-runtime-4.1
8465 (package
8466 (inherit java-antlr4-runtime)
8467 (version "4.1")
8468 (source (origin
8469 (method git-fetch)
8470 (uri (git-reference
8471 (url "https://github.com/antlr/antlr4")
8472 (commit version)))
8473 (file-name (git-file-name "antlr4" version))
8474 (sha256
8475 (base32
8476 "1i8hmx5an58cjyvhji0xgpvd6lq00z1k1mjys025q2wqc25wv4c1"))))
8477 (arguments
8478 (substitute-keyword-arguments (package-arguments java-antlr4-runtime)
8479 ((#:phases phases)
8480 `(modify-phases ,phases
8481 (add-before 'configure 'chmod
8482 (lambda _
8483 (chmod "build.xml" #o644)
8484 #t))))))
8485 (inputs
8486 `(("java-treelayout" ,java-treelayout)))))
8487
77ae4145
JL
8488(define-public antlr4-4.1
8489 (package
8490 (inherit antlr4)
8491 (version (package-version java-antlr4-runtime-4.1))
8492 (source (package-source java-antlr4-runtime-4.1))
8493 (arguments
8494 (substitute-keyword-arguments (package-arguments antlr4)
8495 ((#:test-dir _)
8496 "tool/test")
8497 ((#:test-exclude excludes)
8498 `(list "**/TestParseErrors.java"
8499 "**/TestTopologicalSort.java"
8500 ,@excludes))
8501 ((#:phases phases)
8502 `(modify-phases ,phases
8503 (delete 'generate-unicode)
8504 (replace 'check
8505 (lambda _
8506 (invoke "ant" "check")
8507 #t))
8508 (add-before 'configure 'chmod
8509 (lambda _
8510 (chmod "build.xml" #o644)
8511 #t))
8512 (delete 'remove-graphemes)
8513 (delete 'remove-unrelated-languages)
8514 (delete 'generate-test-parsers)))))
8515 (inputs
8516 (alist-replace
8517 "java-antlr4-runtime" (list java-antlr4-runtime-4.1)
8518 (package-inputs antlr4)))))
8519
7d26b017
JL
8520(define-public java-tunnelvisionlabs-antlr4-runtime-annotations
8521 (package
8522 (inherit java-antlr4-runtime)
8523 (name "java-tunnelvisionlabs-antlr4-runtime-annotations")
8524 (version "4.7.4")
8525 (source (origin
8526 (method git-fetch)
8527 (uri (git-reference
8528 (url "https://github.com/tunnelvisionlabs/antlr4")
8529 (commit (string-append version "-opt"))))
8530 (file-name (git-file-name "java-tunnelvisionlabs-antlr4" version))
8531 (sha256
8532 (base32
8533 "1mf2lvvsszpialsk23ma83pwp50nd32lrbjpa847zlm5gmranbr8"))
8534 (patches
8535 (search-patches "java-antlr4-Add-standalone-generator.patch"
8536 "java-tunnelvisionlabs-antlr-code-too-large.patch"))))
8537 (arguments
8538 `(#:jar-name "java-antlr4-runtime-annotations.jar"
8539 #:source-dir "runtime/JavaAnnotations/src"
8540 #:tests? #f; no tests
8541 #:phases
8542 (modify-phases %standard-phases
8543 (add-after 'build 'copy-resources
8544 (lambda _
8545 (copy-recursively "runtime/JavaAnnotations/resources"
8546 "build/classes")
8547 #t))
8548 (add-after 'copy-resources 'rebuild-jar
8549 (lambda _
8550 (invoke "ant" "jar")
8551 #t)))))
8552 (inputs '())
8553 (native-inputs '())
8554 (synopsis "Annotations for ANTLR's runtime library")
8555 (description "This package contains annotations used during the build of
8556the runtime library of ANTLR.")))
8557
742242a5
GB
8558(define-public java-commons-cli-1.2
8559 ;; This is a bootstrap dependency for Maven2.
8560 (package
8561 (inherit java-commons-cli)
8562 (version "1.2")
8563 (source (origin
8564 (method url-fetch)
8565 (uri (string-append "mirror://apache/commons/cli/source/"
8566 "commons-cli-" version "-src.tar.gz"))
8567 (sha256
8568 (base32
8569 "0rvfgzgv2pc1m091dfj3ih9ddsjjppr1f1wf0qmc3bk6b1kwv2dm"))))
8570 (arguments
8571 `(#:jar-name "commons-cli.jar"
8572 #:phases
8573 (modify-phases %standard-phases
8574 (add-before 'check 'fix-build-xml
8575 (lambda* (#:key inputs #:allow-other-keys)
8576 (substitute* "build.xml"
8577 (("dir=\"\\$\\{test.home\\}/java\"")
8578 "dir=\"${test.home}\""))
8579 #t)))))
8580 (native-inputs
8581 `(("java-junit" ,java-junit)))))
30deadee
JL
8582
8583(define-public java-microemulator-cldc
8584 (package
8585 (name "java-microemulator-cldc")
8586 (version "2.0.4")
8587 (source (origin
8588 (method url-fetch)
8589 (uri (string-append "https://github.com/barteo/microemu/archive/"
8590 "microemulator_"
8591 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
8592 version)
8593 ".tar.gz"))
8594 (file-name (string-append name "-" version ".tar.gz"))
8595 (sha256
8596 (base32
8597 "1x1apmz38gkppxnwnygwmi12j54v4p258v8ddzn6dldkk7vak1ll"))))
8598 (build-system ant-build-system)
8599 (arguments
8600 `(#:jar-name "microemulator-cldc.jar"
8601 #:source-dir "microemu-cldc/src/main/java"
8602 #:tests? #f)); Requires even older software
8603 (home-page "https://github.com/barteo/microemu")
8604 (synopsis "J2ME CLDC emulator")
8605 (description "Microemulator is a Java 2 Micro Edition (J2ME) CLDC/MIDP
60738bdc 8606Emulator. It demonstrates MIDlet based applications in web browser
30deadee
JL
8607applet and can be run as a standalone java application.")
8608 (license (list license:asl2.0
8609 ;; or altenatively:
8610 license:lgpl2.1+))))
8e2f3e5e
JL
8611
8612(define-public java-datanucleus-javax-persistence
8613 (package
8614 (name "java-datanucleus-javax-persistence")
8615 (version "2.2.0")
8616 (source (origin
8617 (method url-fetch)
8618 (uri (string-append "https://github.com/datanucleus/"
8619 "javax.persistence/archive/javax.persistence-"
8620 version "-release.tar.gz"))
8621 (sha256
8622 (base32
8623 "11jx0fjwgc2hhbqqgdd6m1pf2fplf9vslppygax0y1z5csnqjhpx"))))
8624 (build-system ant-build-system)
8625 (arguments
8626 `(#:jar-name "java-datanucleus-javax-persistence.jar"
8627 #:jdk ,icedtea-8
8628 #:source-dir "src/main/java"
8629 #:tests? #f)); no tests
8630 (home-page "https://github.com/datanucleus/javax.persistence")
8631 (synopsis "JPA API")
8632 (description "This package contains a clean definition of JPA API intended
8633for use with DataNucleus JPA since the JCP haven't provided an official JPA API
8634jar. See @url{http://java.net/projects/jpa-spec/downloads} for the specification
8635used to generate this API.")
8636 (license (list license:edl1.0 license:epl1.0))))
3240ddbf
JL
8637
8638(define-public java-osgi-cmpn
8639 (package
8640 (name "java-osgi-cmpn")
8641 (version "6.0.0")
8642 (source (origin
8643 (method url-fetch)
7779ad50 8644 (uri (string-append "https://repo1.maven.org/maven2/"
3240ddbf
JL
8645 "org/osgi/osgi.cmpn/" version "/osgi.cmpn-"
8646 version "-sources.jar"))
8647 (sha256
8648 (base32
8649 "1lmb6xyrmkqdhv1kayf0514rlwq6ypvs4m44ibrck3snp8241wys"))))
8650 (build-system ant-build-system)
8651 (arguments
8652 `(#:jar-name "osgi-cmpn.jar"
8653 #:tests? #f)); no tests
8654 (inputs
8655 `(("annotation" ,java-osgi-annotation)
8656 ("core" ,java-osgi-core)
8657 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
8658 ("microemulator" ,java-microemulator-cldc)
8659 ("servlet" ,java-classpathx-servletapi)))
c353d014 8660 (home-page "https://www.osgi.org")
3240ddbf
JL
8661 (synopsis "Compendium specification module of OSGi framework")
8662 (description
8663 "OSGi, for Open Services Gateway initiative framework, is a module system
8664and service platform for the Java programming language. This package contains
8665the compendium specification module, providing interfaces and classes for use
8666in compiling bundles.")
8667 (license license:asl2.0)))
747c7574
JL
8668
8669(define-public java-osgi-service-component-annotations
8670 (package
8671 (name "java-osgi-service-component-annotations")
8672 (version "1.3.0")
8673 (source (origin
8674 (method url-fetch)
fa315559 8675 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
747c7574
JL
8676 "org.osgi.service.component.annotations/"
8677 version "/org.osgi.service.component.annotations-"
8678 version "-sources.jar"))
8679 (sha256
8680 (base32
8681 "15rq9cmp4fpn74q44m4j35qsqmjf5lx3hcrk6pzvbhc08igic2f0"))))
8682 (build-system ant-build-system)
8683 (arguments
8684 `(#:jar-name "osgi-service-component-annotations.jar"
8685 #:tests? #f)); no tests
8686 (inputs
8687 `(("annotation" ,java-osgi-annotation)))
c353d014 8688 (home-page "https://www.osgi.org")
747c7574
JL
8689 (synopsis "Support annotations for osgi-service-component")
8690 (description
8691 "OSGi, for Open Services Gateway initiative framework, is a module system
8692and service platform for the Java programming language. This package contains
8693the support annotations for osgi-service-component.")
8694 (license license:asl2.0)))
999b5fb4
JL
8695
8696(define-public java-osgi-dto
8697 (package
8698 (name "java-osgi-dto")
8699 (version "1.0.0")
8700 (source (origin
8701 (method url-fetch)
fc1c5dbd 8702 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
999b5fb4
JL
8703 "org.osgi.dto/" version "/org.osgi.dto-"
8704 version "-sources.jar"))
8705 (sha256
8706 (base32
8707 "0f4bqjzadn0hwk6sd3h5gvbyfp3yci1s6r0v770cc15p0pg627yr"))))
8708 (build-system ant-build-system)
8709 (arguments
8710 `(#:jar-name "osgi-dto.jar"
8711 #:tests? #f)); no tests
8712 (inputs
8713 `(("annotation" ,java-osgi-annotation)))
c353d014 8714 (home-page "https://www.osgi.org")
999b5fb4
JL
8715 (synopsis "Data Transfer Objects")
8716 (description
8717 "OSGi, for Open Services Gateway initiative framework, is a module system
8718and service platform for the Java programming language. This package contains
8719the Data Transfer Objects. It is easily serializable having only public fields
8720of primitive types and their wrapper classes, Strings, and DTOs. List, Set,
8721Map and array aggregates may also be used. The aggregates must only hold
8722objects of the listed types or aggregates.")
8723 (license license:asl2.0)))
c304ce6a
JL
8724
8725(define-public java-osgi-resource
8726 (package
8727 (name "java-osgi-resource")
8728 (version "1.0.0")
8729 (source (origin
8730 (method url-fetch)
1f2643fa 8731 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
c304ce6a
JL
8732 "org.osgi.resource/"
8733 version "/org.osgi.resource-"
8734 version "-sources.jar"))
8735 (sha256
8736 (base32
8737 "0hi0fsc5v99q22bd7lrkvpz1y0ds4w9arjldpwsrcpqvz2js7q2d"))))
8738 (build-system ant-build-system)
8739 (arguments
8740 `(#:jar-name "osgi-resource.jar"
8741 #:tests? #f)); no tests
8742 (inputs
8743 `(("annotation" ,java-osgi-annotation)
8744 ("dto" ,java-osgi-dto)))
c353d014 8745 (home-page "https://www.osgi.org")
c304ce6a
JL
8746 (synopsis "OSGI Resource")
8747 (description
8748 "OSGi, for Open Services Gateway initiative framework, is a module system
8749and service platform for the Java programming language. This package contains
8750the definition of common types in osgi packages.")
8751 (license license:asl2.0)))
c2b14516
JL
8752
8753(define-public java-osgi-namespace-contract
8754 (package
8755 (name "java-osgi-namespace-contract")
8756 (version "1.0.0")
8757 (source (origin
8758 (method url-fetch)
60f5ab0b 8759 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
c2b14516
JL
8760 "org.osgi.namespace.contract/"
8761 version "/org.osgi.namespace.contract-"
8762 version "-sources.jar"))
8763 (sha256
8764 (base32
8765 "1iz4f2i0fvqrlq90ki9nfzcfpvy2av434ri25bglywqssx8mmp36"))))
8766 (build-system ant-build-system)
8767 (inputs
8768 `(("resource" ,java-osgi-resource)
8769 ("annotation" ,java-osgi-annotation)))
8770 (arguments
8771 `(#:jar-name "osgi-namespace-contract.jar"
8772 #:tests? #f)); no tests
c353d014 8773 (home-page "https://www.osgi.org")
c2b14516
JL
8774 (synopsis "Contract Capability and Requirement Namespace")
8775 (description
8776 "OSGi, for Open Services Gateway initiative framework, is a module system
8777and service platform for the Java programming language. This package contains
8778the names for the attributes and directives for a namespace with contracts.")
8779 (license license:asl2.0)))
f809c963
JL
8780
8781(define-public java-osgi-namespace-extender
8782 (package
8783 (name "java-osgi-namespace-extender")
8784 (version "1.0.1")
8785 (source (origin
8786 (method url-fetch)
fccce661 8787 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
f809c963
JL
8788 "org.osgi.namespace.extender/"
8789 version "/org.osgi.namespace.extender-"
8790 version "-sources.jar"))
8791 (sha256
8792 (base32
8793 "0jgqiak2i05qv6j3gd33xlaifzzc0ylxxk376v2x0apfg3vvixmz"))))
8794 (build-system ant-build-system)
8795 (inputs
8796 `(("resource" ,java-osgi-resource)
8797 ("annotation" ,java-osgi-annotation)))
8798 (arguments
8799 `(#:jar-name "osgi-namespace-extendent.jar"
8800 #:tests? #f)); no tests
c353d014 8801 (home-page "https://www.osgi.org")
f809c963
JL
8802 (synopsis "Extender Capability and Requirement Namespace")
8803 (description
8804 "OSGi, for Open Services Gateway initiative framework, is a module system
8805and service platform for the Java programming language. This package contains
b784962d
JL
8806the names for the attributes and directives for an extender namespace.")
8807 (license license:asl2.0)))
8808
8809(define-public java-osgi-namespace-service
8810 (package
8811 (name "java-osgi-namespace-service")
8812 (version "1.0.0")
8813 (source (origin
8814 (method url-fetch)
ec4ba417 8815 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
b784962d
JL
8816 "org.osgi.namespace.service/"
8817 version "/org.osgi.namespace.service-"
8818 version "-sources.jar"))
8819 (sha256
8820 (base32
8821 "0qmw8n2449nkmm56d1znz9zhazb6ya3vsimd5bf5jg23zzhgl8c8"))))
8822 (build-system ant-build-system)
8823 (inputs
8824 `(("resource" ,java-osgi-resource)
8825 ("annotation" ,java-osgi-annotation)))
8826 (arguments
8827 `(#:jar-name "osgi-namespace-service.jar"
8828 #:tests? #f)); no tests
c353d014 8829 (home-page "https://www.osgi.org")
b784962d
JL
8830 (synopsis "Service Capability and Requirement Namespace")
8831 (description
8832 "OSGi, for Open Services Gateway initiative framework, is a module system
8833and service platform for the Java programming language. This package contains
8834the names for the attributes and directives for a service namespace.")
f809c963 8835 (license license:asl2.0)))
0f0c5218
JL
8836
8837(define-public java-osgi-util-function
8838 (package
8839 (name "java-osgi-util-function")
8840 (version "1.0.0")
8841 (source (origin
8842 (method url-fetch)
43be0299 8843 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
0f0c5218
JL
8844 "org.osgi.util.function/"
8845 version "/org.osgi.util.function-"
8846 version "-sources.jar"))
8847 (sha256
8848 (base32
8849 "04l7j3hwmmj28w23m7paca0afzncs42j2mdr3liqq8kvp548sc6x"))))
8850 (build-system ant-build-system)
8851 (arguments
8852 `(#:jar-name "osgi-util-function.jar"
8853 #:tests? #f)); no tests
8854 (inputs
8855 `(("annotation" ,java-osgi-annotation)))
c353d014 8856 (home-page "https://www.osgi.org")
0f0c5218
JL
8857 (synopsis "OSGI Util Function")
8858 (description
8859 "OSGi, for Open Services Gateway initiative framework, is a module system
8860and service platform for the Java programming language. This package contains
8861an interface for a function that accepts a single argument and produces a result.")
8862 (license license:asl2.0)))
27103135
JL
8863
8864(define-public java-osgi-util-promise
8865 (package
8866 (name "java-osgi-util-promise")
8867 (version "1.0.0")
8868 (source (origin
8869 (method url-fetch)
c962e6c4 8870 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
27103135
JL
8871 "org.osgi.util.promise/"
8872 version "/org.osgi.util.promise-"
8873 version "-sources.jar"))
8874 (sha256
8875 (base32
8876 "0y34dwiflg1c4ahvkswpf9z02xph2sr9fm04ia5493x3lshpw22c"))))
8877 (build-system ant-build-system)
8878 (arguments
8879 `(#:jar-name "osgi-util-promise.jar"
8880 #:tests? #f)); no tests
8881 (inputs
8882 `(("annotation" ,java-osgi-annotation)
8883 ("function" ,java-osgi-util-function)))
c353d014 8884 (home-page "https://www.osgi.org")
27103135
JL
8885 (synopsis "Promise of a value")
8886 (description
8887 "OSGi, for Open Services Gateway initiative framework, is a module system
8888and service platform for the Java programming language. This package contains
8889an interface and utilitary classes for promises. A Promise represents a future
8890value. It handles the interactions for asynchronous processing.")
8891 (license license:asl2.0)))
2b1fdb2b
JL
8892
8893(define-public java-osgi-service-metatype-annotations
8894 (package
8895 (name "java-osgi-service-metatype-annotations")
8896 (version "1.3.0")
8897 (source (origin
8898 (method url-fetch)
98b1985f 8899 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
2b1fdb2b
JL
8900 "org.osgi.service.metatype.annotations/"
8901 version "/org.osgi.service.metatype.annotations-"
8902 version "-sources.jar"))
8903 (sha256
8904 (base32
8905 "12rwm3349wk80vm88rcdgs4435m4jxkpkj5mrx326skkz2c6hyw6"))))
8906 (build-system ant-build-system)
8907 (arguments
8908 `(#:jar-name "osgi-service-metatype-annotations.jar"
8909 #:tests? #f)); no tests
8910 (inputs
8911 `(("annotation" ,java-osgi-annotation)))
c353d014 8912 (home-page "https://www.osgi.org")
2b1fdb2b
JL
8913 (synopsis "Support annotations for metatype")
8914 (description
8915 "OSGi, for Open Services Gateway initiative framework, is a module system
8916and service platform for the Java programming language. This package contains
8917the support annotations for metatype.")
8918 (license license:asl2.0)))
a13acfbe
JL
8919
8920(define-public java-osgi-service-repository
8921 (package
8922 (name "java-osgi-service-repository")
8923 (version "1.1.0")
8924 (source (origin
8925 (method url-fetch)
7a5c5017 8926 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
a13acfbe
JL
8927 "org.osgi.service.repository/"
8928 version "/org.osgi.service.repository-"
8929 version "-sources.jar"))
8930 (sha256
8931 (base32
8932 "1k41mhg7b58pd8nsghr2qwcjrxdnf1p9spsw9v11k4257g6rl06n"))))
8933 (build-system ant-build-system)
8934 (arguments
8935 `(#:jar-name "osgi-service-repository.jar"
8936 #:tests? #f)); no tests
8937 (inputs
8938 `(("annotation" ,java-osgi-annotation)
8939 ("promise" ,java-osgi-util-promise)
8940 ("resource" ,java-osgi-resource)))
c353d014 8941 (home-page "https://www.osgi.org")
a13acfbe
JL
8942 (synopsis "OSGI service repository")
8943 (description
8944 "OSGi, for Open Services Gateway initiative framework, is a module system
8945and service platform for the Java programming language. This package contains
8946a repository service that contains resources.")
8947 (license license:asl2.0)))
dfd91541
JL
8948
8949(define-public java-osgi-framework
8950 (package
8951 (name "java-osgi-framework")
8952 (version "1.8.0")
8953 (source (origin
8954 (method url-fetch)
05662561 8955 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
dfd91541
JL
8956 "org.osgi.framework/" version "/org.osgi.framework-"
8957 version "-sources.jar"))
8958 (sha256
8959 (base32
8960 "1lwp2zfad3rybcc6q9bwz8xsgkc92ypzy5p6x54387f1qj65m73s"))))
8961 (build-system ant-build-system)
8962 (arguments
8963 `(#:jar-name "osgi-framework.jar"
8964 #:tests? #f)); no tests
8965 (inputs
8966 `(("annotation" ,java-osgi-annotation)
8967 ("resource" ,java-osgi-resource)
8968 ("dto" ,java-osgi-dto)))
c353d014 8969 (home-page "https://www.osgi.org")
dfd91541
JL
8970 (synopsis "OSGi framework")
8971 (description
8972 "OSGi, for Open Services Gateway initiative framework, is a module system
8973and service platform for the Java programming language.")
8974 (license license:asl2.0)))
98c9f16c
JL
8975
8976(define-public java-osgi-service-log
8977 (package
8978 (name "java-osgi-service-log")
8979 (version "1.3.0")
8980 (source (origin
8981 (method url-fetch)
9b0bf25c 8982 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
98c9f16c
JL
8983 "org.osgi.service.log/"
8984 version "/org.osgi.service.log-"
8985 version "-sources.jar"))
8986 (sha256
8987 (base32
8988 "1029j30dzcwializzca0j3fkhwwz08kmmsha5agw1iccscimj6r0"))))
8989 (build-system ant-build-system)
8990 (arguments
8991 `(#:jar-name "osgi-service-log.jar"
8992 #:tests? #f)); no tests
8993 (inputs
8994 `(("java-osgi-framework" ,java-osgi-framework)))
c353d014 8995 (home-page "https://www.osgi.org")
98c9f16c
JL
8996 (synopsis "Provides methods for bundles to write messages to the log")
8997 (description
8998 "OSGi, for Open Services Gateway initiative framework, is a module system
8999and service platform for the Java programming language. This package contains
9000the log service.")
9001 (license license:asl2.0)))
dd76d44b
JL
9002
9003(define-public java-osgi-service-jdbc
9004 (package
9005 (name "java-osgi-service-jdbc")
9006 (version "1.0.0")
9007 (source (origin
9008 (method url-fetch)
4a6a7b2d 9009 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
dd76d44b
JL
9010 "org.osgi.service.jdbc/"
9011 version "/org.osgi.service.jdbc-"
9012 version "-sources.jar"))
9013 (sha256
9014 (base32
9015 "11iln5v7bk469cgb9ddkrz9sa95b3733gqgaqw9xf5g6wq652yjz"))))
9016 (build-system ant-build-system)
9017 (arguments
9018 `(#:jar-name "osgi-service-jdbc.jar"
9019 #:tests? #f)); no tests
c353d014 9020 (home-page "https://www.osgi.org")
dd76d44b
JL
9021 (synopsis "Factory for JDBC connection factories")
9022 (description
9023 "OSGi, for Open Services Gateway initiative framework, is a module system
9024and service platform for the Java programming language. This package contains
9025a factory for JDBC connection factories. There are 3 preferred connection
9026factories for getting JDBC connections:
9027
9028@itemize
9029@item @code{javax.sql.DataSource};
9030@item @code{javax.sql.ConnectionPoolDataSource};
9031@item @code{javax.sql.XADataSource}.
9032@end itemize")
9033 (license license:asl2.0)))
291d3f22
JL
9034
9035(define-public java-osgi-service-resolver
9036 (package
9037 (name "java-osgi-service-resolver")
9038 (version "1.0.1")
9039 (source (origin
9040 (method url-fetch)
b787534b 9041 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
291d3f22
JL
9042 "org.osgi.service.resolver/"
9043 version "/org.osgi.service.resolver-"
9044 version "-sources.jar"))
9045 (sha256
9046 (base32
9047 "1dzqn1ryfi2rq4zwsgp44bmj2wlfydjg1qbxw2b0z4xdjjy55vxd"))))
9048 (build-system ant-build-system)
9049 (arguments
9050 `(#:jar-name "osgi-service-resolver.jar"
9051 #:tests? #f)); no tests
9052 (inputs
9053 `(("annotation" ,java-osgi-annotation)
9054 ("resource" ,java-osgi-resource)))
c353d014 9055 (home-page "https://www.osgi.org")
291d3f22
JL
9056 (synopsis "OSGI Resolver service")
9057 (description
9058 "OSGi, for Open Services Gateway initiative framework, is a module system
9059and service platform for the Java programming language. This package contains
9060a resolver service that resolves the specified resources in the context supplied
9061by the caller.")
9062 (license license:asl2.0)))
1884bb81
JL
9063
9064(define-public java-osgi-util-tracker
9065 (package
9066 (name "java-osgi-util-tracker")
9067 (version "1.5.1")
9068 (source (origin
9069 (method url-fetch)
e0695da9 9070 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
1884bb81
JL
9071 "org.osgi.util.tracker/"
9072 version "/org.osgi.util.tracker-"
9073 version "-sources.jar"))
9074 (sha256
9075 (base32
9076 "0c4fh9vxwzsx59r8dygda0gq2gx3z5vfhc3jsphlqwf5w0h403lz"))))
9077 (build-system ant-build-system)
9078 (arguments
9079 `(#:jar-name "osgi-util-tracker.jar"
9080 #:tests? #f)); no tests
9081 (inputs
9082 `(("framework" ,java-osgi-framework)
9083 ("annotation" ,java-osgi-annotation)))
c353d014 9084 (home-page "https://www.osgi.org")
1884bb81
JL
9085 (synopsis "Bundle tracking")
9086 (description
9087 "OSGi, for Open Services Gateway initiative framework, is a module system
9088and service platform for the Java programming language. This package contains
9089bundle tracking utility classes.")
9090 (license license:asl2.0)))
fb9c48b8
JL
9091
9092(define-public java-osgi-service-cm
9093 (package
9094 (name "java-osgi-service-cm")
9095 (version "1.5.0")
9096 (source (origin
9097 (method url-fetch)
f8f2fefb 9098 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
fb9c48b8
JL
9099 "org.osgi.service.cm/"
9100 version "/org.osgi.service.cm-"
9101 version "-sources.jar"))
9102 (sha256
9103 (base32
9104 "1z8kap48y3xi0ggj8v6czglfnpnd94mmismgi2wbqhj1nl5fzbp6"))))
9105 (build-system ant-build-system)
9106 (arguments
9107 `(#:jar-name "osgi-service-cm.jar"
9108 #:tests? #f)); no tests
9109 (inputs
9110 `(("framework" ,java-osgi-framework)
9111 ("annotation" ,java-osgi-annotation)))
c353d014 9112 (home-page "https://www.osgi.org")
fb9c48b8
JL
9113 (synopsis "OSGI Configuration Management")
9114 (description
9115 "OSGi, for Open Services Gateway initiative framework, is a module system
9116and service platform for the Java programming language. This package contains
9117utility classes for the configuration of services.")
9118 (license license:asl2.0)))
500aac75
JL
9119
9120(define-public java-osgi-service-packageadmin
9121 (package
9122 (name "java-osgi-service-packageadmin")
9123 (version "1.2.0")
9124 (source (origin
9125 (method url-fetch)
839e3e89 9126 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
500aac75
JL
9127 "org.osgi.service.packageadmin/"
9128 version "/org.osgi.service.packageadmin-"
9129 version "-sources.jar"))
9130 (sha256
9131 (base32
9132 "041mpxzi7g36wmcily6y4ccn3jx15akpdy8gmhyb7m98x7qfvn52"))))
9133 (build-system ant-build-system)
9134 (arguments
9135 `(#:jar-name "osgi-service-packageadmin.jar"
9136 #:tests? #f)); no tests
9137 (inputs
9138 `(("framework" ,java-osgi-framework)))
c353d014 9139 (home-page "https://www.osgi.org")
500aac75
JL
9140 (synopsis "OSGI Package Administration")
9141 (description
9142 "OSGi, for Open Services Gateway initiative framework, is a module system
9143and service platform for the Java programming language. This package contains
9144the packageadmin service.")
9145 (license license:asl2.0)))
77a4f1ae
JL
9146
9147(define-public java-ops4j-base-lang
9148 (package
9149 (name "java-ops4j-base-lang")
9150 (version "1.5.0")
9151 (source (origin
9152 (method url-fetch)
9153 (uri (string-append "https://github.com/ops4j/org.ops4j.base/"
9154 "archive/base-" version ".tar.gz"))
9155 (sha256
9156 (base32
9157 "18hl3lpchgpv8yh5rlk39l2gif5dlfgb8gxjmncf39pr2dprkniw"))))
9158 (build-system ant-build-system)
9159 (arguments
9160 `(#:jar-name "java-ops4j-base-lang.jar"
9161 #:source-dir "ops4j-base-lang/src/main/java"
9162 #:tests? #f; no tests
9163 #:phases
9164 (modify-phases %standard-phases
9165 (add-before 'build 'add-test-file
9166 (lambda _
9167 ;; That file is required by a test in ops4j-pax-exam-core-spi
9168 (mkdir-p "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang")
9169 (with-output-to-file "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang/pom.properties"
9170 (lambda _
9171 (display
9172 (string-append
9173 "version=" ,version "\n"
9174 "groupId=org.ops4j.base"
2c8ac364
MW
9175 "artifactId=ops4j-base-lang\n"))))
9176 #t)))))
77a4f1ae
JL
9177 (home-page "https://ops4j1.jira.com/wiki/spaces/base/overview")
9178 (synopsis "Utility classes and extensions to be used in OPS4J projects")
9179 (description "OPS4J stands for Open Participation Software for Java. This
9180package contains utilities and extensions related to @code{java.lang}.")
9181 (license license:asl2.0)))
b2353495
JL
9182
9183(define-public java-ops4j-base-monitors
9184 (package
9185 (inherit java-ops4j-base-lang)
9186 (name "java-ops4j-base-monitors")
9187 (arguments
9188 `(#:jar-name "java-ops4j-base-monitors.jar"
9189 #:source-dir "ops4j-base-monitors/src/main/java"
9190 #:tests? #f)); no tests
9191 (inputs
9192 `(("lang" ,java-ops4j-base-lang)))
9193 (description "OPS4J stands for Open Participation Software for Java. This
9194package contains utilities and extensions related to monitoring.")))
322d349a
JL
9195
9196(define-public java-ops4j-base-io
9197 (package
9198 (inherit java-ops4j-base-lang)
9199 (name "java-ops4j-base-io")
9200 (arguments
9201 `(#:jar-name "java-ops4j-base-io.jar"
9202 #:source-dir "ops4j-base-io/src/main/java"
9203 #:test-dir "ops4j-base-io/src/test"
9204 #:test-exclude
9205 (list "**/ListerTest.java")))
9206 (inputs
9207 `(("lang" ,java-ops4j-base-monitors)
9208 ("lang" ,java-ops4j-base-lang)))
9209 (native-inputs
9210 `(("junit" ,java-junit)
9211 ("hamcrest" ,java-hamcrest-core)))
9212 (description "OPS4J stands for Open Participation Software for Java. This
9213package contains utilities and extensions related to handling streams and files.")))
559919c1
JL
9214
9215(define-public java-ops4j-base-util
9216 (package
9217 (inherit java-ops4j-base-lang)
9218 (name "java-ops4j-base-util")
9219 (arguments
9220 `(#:jar-name "java-ops4j-base-util.jar"
9221 #:source-dir "ops4j-base-util/src/main/java"
9222 #:test-dir "ops4j-base-util/src/test"))
9223 (inputs
9224 `(("lang" ,java-ops4j-base-lang)))
9225 (native-inputs
9226 `(("junit" ,java-junit)))
9227 (description "OPS4J stands for Open Participation Software for Java. This
9228package contains utilities and extensions related to environment, i18n and
9229mime types.")))
60dcec7a
JL
9230
9231(define-public java-ops4j-base-util-property
9232 (package
9233 (inherit java-ops4j-base-lang)
9234 (name "java-ops4j-base-util-property")
9235 (arguments
9236 `(#:jar-name "java-ops4j-base-util-property.jar"
9237 #:source-dir "ops4j-base-util-property/src/main/java"
9238 #:tests? #f)); no tests
9239 (inputs
9240 `(("lang" ,java-ops4j-base-lang)
9241 ("util" ,java-ops4j-base-util)))
9242 (description "OPS4J stands for Open Participation Software for Java. This
9243package contains utilities and extensions related to resolving properties from
9244different sources.")))
0edf8cf0
JL
9245
9246(define-public java-ops4j-base-store
9247 (package
9248 (inherit java-ops4j-base-lang)
9249 (name "java-ops4j-base-store")
9250 (arguments
9251 `(#:jar-name "java-ops4j-base-store.jar"
9252 #:source-dir "ops4j-base-store/src/main/java"
9253 #:tests? #f)); no tests
9254 (inputs
9255 `(("lang" ,java-ops4j-base-lang)
9256 ("slf4j" ,java-slf4j-api)
9257 ("io" ,java-ops4j-base-io)))
9258 (description "OPS4J stands for Open Participation Software for Java. This
9259package contains utilities for storing and retrieving data from an
9260@code{InputStream}.")))
214fcd8a
JL
9261
9262(define-public java-ops4j-base-spi
9263 (package
9264 (inherit java-ops4j-base-lang)
9265 (name "java-ops4j-base-spi")
9266 (arguments
9267 `(#:jar-name "java-ops4j-base-spi.jar"
9268 #:source-dir "ops4j-base-spi/src/main/java"
9269 #:test-dir "ops4j-base-spi/src/test"))
9270 (native-inputs
9271 `(("junit" ,java-junit)
9272 ("hamcrest" ,java-hamcrest-core)))
9273 (description "OPS4J stands for Open Participation Software for Java. This
9274package contains utilities for obtaining services via the Java SE 6
9275@code{ServiceLoader}.")))
e1edf42e
JL
9276
9277(define-public java-aqute-bnd-annotation
9278 (package
9279 (name "java-aqute-bnd-annotation")
2cac8891 9280 (version "3.5.0")
e1edf42e
JL
9281 (source (origin
9282 (method url-fetch)
9283 (uri (string-append "https://github.com/bndtools/bnd/archive/"
9284 version ".REL.tar.gz"))
9285 (file-name (string-append name "-" version ".tar.gz"))
9286 (sha256
9287 (base32
2cac8891 9288 "1ggyiq0as0f6cz333a0dh98j72kmvv5pf2s47v9554yh905lfqdl"))))
e1edf42e
JL
9289 (build-system ant-build-system)
9290 (arguments
9291 `(#:jar-name "java-aqute-bnd-annotation.jar"
9292 #:source-dir "biz.aQute.bnd.annotation/src"
9293 #:tests? #f)); empty test dir
27c0eade 9294 (home-page "https://bnd.bndtools.org/")
e1edf42e
JL
9295 (synopsis "Tools for OSGi")
9296 (description "Bnd is a swiss army knife for OSGi, it creates manifest
9297headers based on analyzing the class code, it verifies the project settings,
9298it manages project dependencies, gives diffs jars, and much more.")
9299 (license license:asl2.0)))
60ba2978
JL
9300
9301(define-public java-aqute-libg
9302 (package
9303 (inherit java-aqute-bnd-annotation)
9304 (name "java-aqute-libg")
9305 (arguments
9306 `(#:jar-name "java-aqute-libg.jar"
78754995
GB
9307 ;; The build fails when source/target more recent than 1.7. This
9308 ;; is a known issue. See: https://github.com/bndtools/bnd/issues/1327
9309 ;;
9310 ;; It is closed as won't fix. There is no way to change the source
9311 ;; so that it works on 1.8, and still works on 1.6, the upstream
9312 ;; target. It work fine on 1.7, so we use 1.7.
9313 #:make-flags (list "-Dant.build.javac.source=1.7"
9314 "-Dant.build.javac.target=1.7")
2ab089b7
GB
9315 #:phases
9316 (modify-phases %standard-phases
9317 (add-before 'configure 'chdir
9318 ;; Change to aQute.libg directory, so that the relative
9319 ;; paths in the tests aren't broken.
9320 (lambda _
9321 (chdir "aQute.libg")
9322 #t))
9323 (add-before 'check 'create-test-directory
9324 ;; Copy the test directory to test/java, since that's where
9325 ;; ant-build-system's default project in build.xml expects to find
9326 ;; the test classes. Leave a copy in the original place to not
9327 ;; break paths in tests.
9328 (lambda _
9329 (mkdir "src/test")
9330 (copy-recursively "test" "src/test/java")
9331 #t)))))
60ba2978
JL
9332 (inputs
9333 `(("slf4j" ,java-slf4j-api)
9334 ("osgi-annot" ,java-osgi-annotation)
9335 ("java-osgi-cmpn" ,java-osgi-cmpn)
2ab089b7
GB
9336 ("osgi" ,java-osgi-core)))
9337 (native-inputs
9338 `(("hamcrest" ,java-hamcrest-core)
9339 ("java-junit" ,java-junit)))))
5f26a131
JL
9340
9341(define-public java-aqute-bndlib
9342 (package
9343 (inherit java-aqute-bnd-annotation)
9344 (name "java-aqute-bndlib")
9345 (arguments
9346 `(#:jar-name "java-bndlib.jar"
9347 #:source-dir "biz.aQute.bndlib/src"
9348 #:tests? #f)); no tests
9349 (inputs
9350 `(("slf4j" ,java-slf4j-api)
9351 ("osgi-annot" ,java-osgi-annotation)
9352 ("java-aqute-libg" ,java-aqute-libg)
9353 ("java-aqute-bnd-annotation" ,java-aqute-bnd-annotation)
9354 ("java-osgi-service-component-annotations" ,java-osgi-service-component-annotations)
9355 ("java-osgi-service-repository" ,java-osgi-service-repository)
9356 ("java-osgi-service-log" ,java-osgi-service-log)
9357 ("java-osgi-service-metatype-annotations" ,java-osgi-service-metatype-annotations)
9358 ("java-osgi-namespace-contract" ,java-osgi-namespace-contract)
9359 ("java-osgi-namespace-extender" ,java-osgi-namespace-extender)
9360 ("java-osgi-namespace-service" ,java-osgi-namespace-service)
9361 ("promise" ,java-osgi-util-promise)
9362 ("osgi" ,java-osgi-core)))))
869803aa 9363
25aef81d
JL
9364(define-public java-ops4j-pax-tinybundles
9365 (package
9366 (name "java-ops4j-pax-tinybundles")
9367 (version "2.1.1")
9368 (source (origin
9369 (method url-fetch)
9370 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.tinybundles/"
9371 "archive/tinybundles-" version ".tar.gz"))
9372 (sha256
9373 (base32
9374 "0y0gq3pvv0iir2b885lmlwnvr724vv7vklzhhr4fs27d7mdkj871"))))
9375 (arguments
9376 `(#:jar-name "java-ops4j-pax-tinybundles.jar"
9377 #:source-dir "src/main/java"
9378 #:test-exclude
9379 ;; Abstract base classes for other tests
9380 (list "**/BndTest.java" "**/CoreTest.java")
9381 #:phases
9382 (modify-phases %standard-phases
9383 (add-before 'check 'fix-version
9384 (lambda _
9385 ;; This test has a reference to an old version of bndlib we are not
9386 ;; packaging. It uses the version referenced in pom.xml. We replace
9387 ;; it with our own version.
9388 (substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
0f277802 9389 (("[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*")
2c8ac364
MW
9390 ,(package-version java-aqute-bndlib)))
9391 #t)))))
25aef81d
JL
9392 (inputs
9393 `(("lang" ,java-ops4j-base-lang)
9394 ("io" ,java-ops4j-base-io)
9395 ("store" ,java-ops4j-base-store)
9396 ("slf4j" ,java-slf4j-api)
9397 ("libg" ,java-aqute-libg)
9398 ("bndlib" ,java-aqute-bndlib)))
9399 (native-inputs
9400 `(("junit" ,java-junit)
9401 ("hamcrest" ,java-hamcrest-core)
9402 ("log4j" ,java-log4j-api)
9403 ("bndannotation" ,java-aqute-bnd-annotation)
9404 ("framework" ,java-osgi-framework)))
9405 (build-system ant-build-system)
9406 (home-page "https://ops4j1.jira.com/wiki/spaces/ops4j/pages/12060312/Tinybundles")
9407 (synopsis "Java APIs to create OSGi related artifacts")
9408 (description "Tinybundles is all about creating OSGi related artifacts like
6fa0914a 9409Bundles, Fragments and Deployment Packages with Java Api. It is very convenient
25aef81d
JL
9410to create such artifacts on-the-fly inside Tests (like in Pax Exam). On the
9411other hand, this library can be a foundation of real end user tools that need
9412to create those artifacts.")
9413 (license license:asl2.0)))
e179add0
JL
9414
9415(define-public java-ops4j-pax-exam-core
9416 (package
9417 (name "java-ops4j-pax-exam-core")
9418 (version "4.11.0")
9419 (source (origin
9420 (method url-fetch)
9421 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.exam2/"
9422 "archive/exam-reactor-" version ".tar.gz"))
9423 (sha256
9424 (base32
9425 "08mzw8nkah3rj3vznlplnawspxhp61zgvb44ifqa1rni1cvbms2g"))))
9426 (arguments
9427 `(#:jar-name "java-ops4j-pax-exam-core.jar"
9428 #:source-dir "core/pax-exam/src/main/java"
9429 #:test-dir "core/pax-exam/src/test"))
9430 (inputs
9431 `(("slf4j" ,java-slf4j-api)
9432 ("lang" ,java-ops4j-base-lang)
9433 ("io" ,java-ops4j-base-io)
9434 ("util-property" ,java-ops4j-base-util-property)
9435 ("util-store" ,java-ops4j-base-store)
9436 ("java-osgi-core" ,java-osgi-core)))
9437 (native-inputs
9438 `(("junit" ,java-junit)
9439 ("hamcrest" ,java-hamcrest-core)))
9440 (build-system ant-build-system)
9441 (home-page "https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/overview")
9442 (synopsis "In-Container Testing for OSGi, Java EE and CDI")
9443 (description "Pax Exam creates OSGi bundles for testing purposes. It lets
9444the user take control of the OSGi framework, the test framework (e.g. JUnit) and
9445the system under test at the same time.")
9446 (license license:asl2.0)))
7a7c2b75
JL
9447
9448(define-public java-ops4j-pax-exam-core-spi
9449 (package
9450 (inherit java-ops4j-pax-exam-core)
9451 (name "java-ops4j-pax-exam-core-spi")
9452 (arguments
9453 `(#:jar-name "java-ops4j-pax-exam-spi.jar"
9454 #:source-dir "src/main/java"
9455 #:test-exclude
9456 (list
9457 ;; Abstract base class, not a test
9458 "**/BaseStagedReactorTest.java"
9459 ;; Depends on org.mortbay.jetty.testwars:test-war-dump
9460 "**/WarBuilderTest.java")
9461 #:phases
9462 (modify-phases %standard-phases
9463 (add-before 'configure 'chdir
9464 (lambda _
9465 ;; Tests assume we are in this directory
2c8ac364
MW
9466 (chdir "core/pax-exam-spi")
9467 #t))
7a7c2b75
JL
9468 (add-before 'check 'fix-tests
9469 (lambda _
9470 ;; One test checks that this file is present.
9471 (mkdir-p "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi")
9472 (with-output-to-file
9473 "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi/pom.properties"
9474 (lambda _
9475 (display
9476 (string-append "artifactId = pax-exam-spi\n"
9477 "version = " ,(package-version java-ops4j-pax-exam-core-spi)))))
9478 ;; Maven puts compilation results in the target directory, while we
9479 ;; put them in the build directory.
9480 (substitute* '("src/test/java/org/ops4j/pax/exam/spi/war/WarBuilderTest.java"
9481 "src/test/java/org/ops4j/pax/exam/spi/war/WarTestProbeBuilderTest.java"
9482 "src/test/java/org/ops4j/pax/exam/spi/war/ZipBuilderTest.java")
9483 (("target") "build"))
9484 ;; One test is expected to fail, but it doesn't throw the expected exception
9485 (substitute* "src/test/java/org/ops4j/pax/exam/spi/reactors/BaseStagedReactorTest.java"
2c8ac364
MW
9486 (("AssertionError") "IllegalArgumentException"))
9487 #t)))))
7a7c2b75
JL
9488 (inputs
9489 `(("java-ops4j-pax-exam-core" ,java-ops4j-pax-exam-core)
9490 ("lang" ,java-ops4j-base-lang)
9491 ("monitors" ,java-ops4j-base-monitors)
9492 ("store" ,java-ops4j-base-store)
9493 ("io" ,java-ops4j-base-io)
9494 ("spi" ,java-ops4j-base-spi)
9495 ("osgi" ,java-osgi-core)
9496 ("slf4j" ,java-slf4j-api)
9497 ("tinybundles" ,java-ops4j-pax-tinybundles)))
9498 (native-inputs
9499 `(("mockito" ,java-mockito-1)
9500 ("junit" ,java-junit)
9501 ("hamcrest" ,java-hamcrest-core)
9502 ("cglib" ,java-cglib)
9503 ("objenesis" ,java-objenesis)
9504 ("asm" ,java-asm)))))
4496d77f
JL
9505
9506(define-public java-ops4j-pax-exam-core-junit
9507 (package
9508 (inherit java-ops4j-pax-exam-core)
9509 (name "java-ops4j-pax-exam-core-junit")
9510 (arguments
9511 `(#:jar-name "ops4j-pax-exam-core-junit.jar"
9512 #:source-dir "drivers/pax-exam-junit4/src/main/java"
9513 #:tests? #f)); no tests
9514 (inputs
9515 `(("junit" ,java-junit)
9516 ("slf4j" ,java-slf4j-api)
9517 ("core" ,java-ops4j-pax-exam-core)
9518 ("spi" ,java-ops4j-pax-exam-core-spi)))
9519 (native-inputs '())))
cb05f60d
JL
9520
9521(define-public java-fasterxml-jackson-annotations
9522 (package
9523 (name "java-fasterxml-jackson-annotations")
93dceea4 9524 (version "2.9.4")
cb05f60d
JL
9525 (source (origin
9526 (method url-fetch)
9527 (uri (string-append "https://github.com/FasterXML/"
9528 "jackson-annotations/archive/"
9529 "jackson-annotations-" version ".tar.gz"))
9530 (sha256
9531 (base32
93dceea4 9532 "0mr95xd0da6a4g95zvrl1ryk5n5zv2rc696w3xnsr5hxk2gicfc4"))))
cb05f60d
JL
9533 (build-system ant-build-system)
9534 (arguments
9535 `(#:jar-name "jackson-annotations.jar"
9536 #:source-dir "src/main/java"
9537 #:test-dir "src/test"))
9538 (native-inputs
9539 `(("junit" ,java-junit)))
9540 (home-page "https://github.com/FasterXML/jackson-annotations")
9541 (synopsis "General purpose annotations for the Jackson Data Processor")
9542 (description "This package contains general purpose annotations for the
9543Jackson Data Processor, used on value and handler types. The only annotations
9544not included are ones that require dependency to the Databind package.")
9545 (license license:asl2.0)))
0b5481df
JL
9546
9547(define-public java-fasterxml-jackson-core
9548 (package
9549 (name "java-fasterxml-jackson-core")
38a0fc38 9550 (version "2.9.4")
0b5481df
JL
9551 (source (origin
9552 (method url-fetch)
9553 (uri (string-append "https://github.com/FasterXML/"
9554 "jackson-core/archive/"
9555 "jackson-core-" version ".tar.gz"))
9556 (sha256
9557 (base32
38a0fc38 9558 "159hsnk17jr1gyzkf01cxvsn45srnk37g949r7364qlsr527gjgd"))))
0b5481df
JL
9559 (build-system ant-build-system)
9560 (arguments
9561 `(#:jar-name "jackson-core.jar"
9562 #:source-dir "src/main/java"
9563 #:test-dir "src/test"
9564 #:test-exclude
9565 (list
9566 ;; Expected failure. pom.xml excludes these
9567 "**/failing/**"
9568 ;; Base classes that have no constructor for junit
9569 "**/BaseTest.java"
9570 "**/ConcurrencyReadTest.java"
9571 "**/ManualCharAccessTest.java"
9572 "**/ManualCharAccessTest.java"
9573 "**/TrailingCommasTest.java"
9574 "**/AsyncMissingValuesInObjectTest.java"
9575 "**/AsyncMissingValuesInArrayTest.java")
9576 #:phases
9577 (modify-phases %standard-phases
9578 (add-before 'configure 'generate-PackageVersion.java
9579 (lambda _
9580 (let* ((out "src/main/java/com/fasterxml/jackson/core/json/PackageVersion.java")
9581 (in (string-append out ".in")))
9582 (copy-file in out)
9583 (substitute* out
9584 (("@package@") "com.fasterxml.jackson.core.json")
9585 (("@projectversion@") ,version)
9586 (("@projectgroupid@") "com.fasterxml.jackson.core")
2c8ac364
MW
9587 (("@projectartifactid@") "jackson-core")))
9588 #t))
0b5481df
JL
9589 (add-before 'build 'copy-resources
9590 (lambda _
9591 (copy-recursively "src/main/resources"
2c8ac364
MW
9592 "build/classes")
9593 #t))
0b5481df
JL
9594 (add-before 'check 'copy-test-resources
9595 (lambda _
9596 (copy-recursively "src/test/resources"
2c8ac364
MW
9597 "build/test-classes")
9598 #t)))))
0b5481df
JL
9599 (native-inputs
9600 `(("junit" ,java-junit)
9601 ("hamcrest" ,java-hamcrest-core)))
9602 (home-page "https://github.com/FasterXML/jackson-core")
9603 (synopsis "")
9604 (description "")
9605 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
f234c7a0
JL
9606
9607(define-public java-fasterxml-jackson-databind
9608 (package
9609 (name "java-fasterxml-jackson-databind")
3c1edff5 9610 (version "2.9.4")
f234c7a0
JL
9611 (source (origin
9612 (method url-fetch)
9613 (uri (string-append "https://github.com/FasterXML/"
9614 "jackson-databind/archive/"
9615 "jackson-databind-" version ".tar.gz"))
9616 (sha256
9617 (base32
3c1edff5 9618 "1zd2cw4z6kdkbx8za96xh9pyicv2a2l7y0rkcx2fqd8hv6d47s08"))))
f234c7a0
JL
9619 (build-system ant-build-system)
9620 (arguments
9621 `(#:jar-name "jackson-databind.jar"
9622 #:source-dir "src/main/java"
9623 #:tests? #f; requires javax.measures for which I can't find a free implementation
9624 #:phases
9625 (modify-phases %standard-phases
9626 (add-before 'configure 'generate-PackageVersion.java
9627 (lambda _
9628 (let* ((out "src/main/java/com/fasterxml/jackson/databind/cfg/PackageVersion.java")
9629 (in (string-append out ".in")))
9630 (copy-file in out)
9631 (substitute* out
9632 (("@package@") "com.fasterxml.jackson.databind.cfg")
9633 (("@projectversion@") ,version)
9634 (("@projectgroupid@") "com.fasterxml.jackson.databind")
2c8ac364
MW
9635 (("@projectartifactid@") "jackson-databind")))
9636 #t))
f234c7a0
JL
9637 (add-before 'build 'copy-resources
9638 (lambda _
2c8ac364
MW
9639 (copy-recursively "src/main/resources" "build/classes")
9640 #t)))))
f234c7a0
JL
9641 (inputs
9642 `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
9643 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)))
9644 (home-page "https://github.com/FasterXML/jackson-databind")
9645 (synopsis "Data-binding functionality and tree-model for the Jackson Data Processor")
9646 (description "This package contains the general-purpose data-binding
9647functionality and tree-model for Jackson Data Processor. It builds on core
9648streaming parser/generator package, and uses Jackson Annotations for
9649configuration.")
9650 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
d57d8b89
JL
9651
9652(define-public java-fasterxml-jackson-modules-base-jaxb
9653 (package
9654 (name "java-fasterxml-jackson-modules-base-jaxb")
07207211 9655 (version "2.9.4")
d57d8b89
JL
9656 (source (origin
9657 (method url-fetch)
9658 (uri (string-append "https://github.com/FasterXML/"
9659 "jackson-modules-base/archive/"
9660 "jackson-modules-base-" version ".tar.gz"))
9661 (sha256
9662 (base32
07207211 9663 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
d57d8b89
JL
9664 (build-system ant-build-system)
9665 (arguments
9666 `(#:jar-name "jackson-modules-base-jaxb.jar"
9667 #:source-dir "jaxb/src/main/java"
9668 #:test-dir "jaxb/src/test"
9669 #:test-exclude
9670 ;; Base class for tests
9671 (list "**/BaseJaxbTest.java")
9672 #:phases
9673 (modify-phases %standard-phases
9674 (add-before 'configure 'generate-PackageVersion.java
9675 (lambda _
9676 (let* ((out (string-append "jaxb/src/main/java/com/fasterxml/"
9677 "jackson/module/jaxb/PackageVersion.java"))
9678 (in (string-append out ".in")))
9679 (copy-file in out)
9680 (substitute* out
9681 (("@package@") "com.fasterxml.jackson.module.jaxb")
9682 (("@projectversion@") ,version)
9683 (("@projectgroupid@") "com.fasterxml.jackson.module.jaxb")
2c8ac364
MW
9684 (("@projectartifactid@") "jackson-module-jaxb")))
9685 #t))
d57d8b89
JL
9686 (add-before 'build 'copy-resources
9687 (lambda _
2c8ac364
MW
9688 (copy-recursively "jaxb/src/main/resources" "build/classes")
9689 #t)))))
d57d8b89
JL
9690 (inputs
9691 `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
9692 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
9693 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)))
9694 (native-inputs
9695 `(("java-junit" ,java-junit)))
9696 (home-page "https://github.com/FasterXML/jackson-modules-base")
9697 (synopsis "Jaxb annotations jackson module")
9698 (description "This package is the jaxb annotations module for jackson.")
9699 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
0f296d37 9700
5165fb40
DM
9701(define-public java-fasterxml-jackson-modules-base-mrbean
9702 (package
9703 (name "java-fasterxml-jackson-modules-base-mrbean")
9704 (version "2.9.4")
9705 (source (origin
9706 (method url-fetch)
9707 (uri (string-append "https://github.com/FasterXML/"
9708 "jackson-modules-base/archive/"
9709 "jackson-modules-base-" version ".tar.gz"))
9710 (sha256
9711 (base32
9712 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
9713 (build-system ant-build-system)
9714 (arguments
9715 `(#:jar-name "jackson-modules-base-mrbean.jar"
9716 #:source-dir "mrbean/src/main/java"
9717 #:test-dir "mrbean/src/test"
9718 #:test-exclude
9719 ;; Base class for tests
9720 (list "**/BaseTest.java")
9721 #:phases
9722 (modify-phases %standard-phases
9723 (add-before 'configure 'generate-PackageVersion.java
9724 (lambda _
9725 (let* ((out (string-append "mrbean/src/main/java/com/fasterxml/"
9726 "jackson/module/mrbean/PackageVersion.java"))
9727 (in (string-append out ".in")))
9728 (copy-file in out)
9729 (substitute* out
9730 (("@package@") "com.fasterxml.jackson.module.mrbean")
9731 (("@projectversion@") ,version)
9732 (("@projectgroupid@") "com.fasterxml.jackson.module.mrbean")
9733 (("@projectartifactid@") "jackson-module-mrbean")))
9734 #t)))))
9735 (inputs
9736 `(("java-asm" ,java-asm)
9737 ("java-fasterxml-jackson-annotations"
9738 ,java-fasterxml-jackson-annotations)
9739 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
9740 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)))
9741 (native-inputs
9742 `(("java-junit" ,java-junit)))
9743 (home-page "https://github.com/FasterXML/jackson-modules-base")
9744 (synopsis "POJO type materialization for Java")
9745 (description "This package implements POJO type materialization.
9746Databinders can construct implementation classes for Java interfaces as part
9747of deserialization.")
9748 (license license:asl2.0)))
9749
0f296d37
JL
9750(define-public java-snakeyaml
9751 (package
9752 (name "java-snakeyaml")
9753 (version "1.18")
9754 (source (origin
9755 (method url-fetch)
9756 (uri (string-append "https://bitbucket.org/asomov/snakeyaml/get/v"
9757 version ".tar.gz"))
307856cd 9758 (file-name (string-append name "-" version ".tar.gz"))
0f296d37
JL
9759 (sha256
9760 (base32
b19f155c 9761 "0474cqcv46zgv9bhms2vgawakq1vyj0hp3h3f1bfys46msia90bh"))))
0f296d37
JL
9762 (build-system ant-build-system)
9763 (arguments
9764 `(#:jar-name "java-snakeyaml.jar"
9765 #:source-dir "src/main/java"
9766 ;; Tests require velocity, a cyclic dependency, and
9767 ;; java-spring-framework-context which is not packaged.
9768 #:tests? #f))
9769 (home-page "https://bitbucket.org/asomov/snakeyaml")
9770 (synopsis "YAML processor")
9771 (description "SnakeYAML is a YAML processor for the Java Virtual Machine.")
9772 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
087c8fd2
JL
9773
9774(define-public java-fasterxml-jackson-dataformat-yaml
9775 (package
9776 (name "java-fasterxml-jackson-dataformat-yaml")
1f2be88f 9777 (version "2.9.4")
087c8fd2
JL
9778 (source (origin
9779 (method url-fetch)
9780 (uri (string-append "https://github.com/FasterXML/"
9781 "jackson-dataformats-text/archive/"
9782 "jackson-dataformats-text-" version ".tar.gz"))
9783 (sha256
9784 (base32
1f2be88f 9785 "1hikl06khaxbg439avf442qifcadap8w0lx13f0nnhp2vh3dkbz7"))))
087c8fd2
JL
9786 (build-system ant-build-system)
9787 (arguments
9788 `(#:jar-name "jackson-dataformat-yaml.jar"
9789 #:source-dir "yaml/src/main/java"
9790 #:test-dir "yaml/src/test"
9791 #:test-exclude (list "**/failing/**.java")
9792 #:phases
9793 (modify-phases %standard-phases
9794 (add-before 'configure 'generate-PackageVersion.java
9795 (lambda _
9796 (let* ((out "yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/PackageVersion.java")
9797 (in (string-append out ".in")))
9798 (copy-file in out)
9799 (substitute* out
9800 (("@package@") "com.fasterxml.jackson.dataformat.yaml")
9801 (("@projectversion@") ,version)
9802 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.yaml")
2c8ac364
MW
9803 (("@projectartifactid@") "jackson-dataformat-yaml")))
9804 #t)))))
087c8fd2
JL
9805 (inputs
9806 `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
9807 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
9808 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
9809 ("java-snakeyaml" ,java-snakeyaml)))
9810 (native-inputs
9811 `(("junit" ,java-junit)
9812 ("hamcrest" ,java-hamcrest-core)
9813 ("java-ops4j-pax-exam-core-spi" ,java-ops4j-pax-exam-core-spi)
9814 ("java-ops4j-pax-exam-core-junit" ,java-ops4j-pax-exam-core-junit)
9815 ("java-ops4j-pax-exam" ,java-ops4j-pax-exam-core)))
9816 (home-page "https://github.com/FasterXML/jackson-dataformats-text")
9817 (synopsis "Yaml backend for Jackson")
9818 (description "Dataformat backends are used to support format alternatives
9819to JSON, supported by default. This is done by sub-classing Jackson core
9820abstractions.")
9821 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
6fd07b98
JL
9822
9823(define-public java-stax2-api
9824 (package
9825 (name "java-stax2-api")
9826 (version "4.0.0")
9827 (source (origin
9828 (method url-fetch)
9829 (uri (string-append "https://github.com/FasterXML/stax2-api/archive/"
9830 "stax2-api-" version ".tar.gz"))
9831 (sha256
9832 (base32
9833 "1amc1si0l0hyyw2sawmnzy4hkna3z6fp195y4nm5m9wb9ld5awkq"))))
9834 (build-system ant-build-system)
9835 (arguments
9836 `(#:jar-name "java-stax2-api.jar"
9837 #:source-dir "src/main/java"
9838 #:tests? #f)); no tests
9839 (home-page "https://github.com/FasterXML/stax2-api")
9840 (synopsis "Stax2 API")
9841 (description "Stax2 API is an extension to basic Stax 1.0 API that adds
9842significant new functionalities, such as full-featured bi-direction validation
9843interface and high-performance Typed Access API.")
9844 (license license:bsd-2)))
40f193f3
JL
9845
9846(define-public java-woodstox-core
9847 (package
9848 (name "java-woodstox-core")
9849 (version "5.0.3")
9850 (source (origin
9851 (method url-fetch)
9852 (uri (string-append "https://github.com/FasterXML/woodstox/archive/"
9853 "woodstox-core-" version ".tar.gz"))
9854 (sha256
9855 (base32
9856 "1i7pdgb8jbw6gdy5kmm0l6rz109n2ns92pqalpyp24vb8vlvdfd4"))))
9857 (build-system ant-build-system)
9858 (arguments
9859 `(#:jar-name "woodstox.jar"
9860 #:test-exclude
9861 (list "**/Base*.java" "failing/**")
9862 #:phases
9863 (modify-phases %standard-phases
9864 (add-before 'build 'remove-msv-dep
9865 (lambda _
9866 ;; we don't need osgi, and it depends on msv
9867 (delete-file-recursively "src/main/java/com/ctc/wstx/osgi")
9868 ;; msv's latest release is from 2011 and we don't need it
9869 (delete-file-recursively "src/main/java/com/ctc/wstx/msv")
9870 (delete-file-recursively "src/test/java/wstxtest/osgi")
2c8ac364
MW
9871 (delete-file-recursively "src/test/java/wstxtest/msv")
9872 #t))
40f193f3
JL
9873 (add-before 'build 'copy-resources
9874 (lambda _
2c8ac364
MW
9875 (copy-recursively "src/main/resources" "build/classes")
9876 #t)))))
40f193f3
JL
9877 (inputs
9878 `(("stax2" ,java-stax2-api)))
9879 (native-inputs
9880 `(("junit" ,java-junit)))
9881 (home-page "https://github.com/FasterXML/woodstox")
9882 (synopsis "Stax XML API implementation")
9883 (description "Woodstox is a stax XML API implementation.")
9884 (license license:asl2.0)))
262a4d33
JL
9885
9886(define-public java-fasterxml-jackson-dataformat-xml
9887 (package
9888 (name "java-fasterxml-jackson-dataformat-xml")
f3bbe029 9889 (version "2.9.4")
262a4d33
JL
9890 (source (origin
9891 (method url-fetch)
9892 (uri (string-append "https://github.com/FasterXML/"
9893 "jackson-dataformat-xml/archive/"
9894 "jackson-dataformat-xml-" version ".tar.gz"))
9895 (sha256
9896 (base32
f3bbe029 9897 "111fkkl90w31jbf30kgj82qdcxlw4sxppki7i198liw0ck1jcavq"))))
262a4d33
JL
9898 (build-system ant-build-system)
9899 (arguments
9900 `(#:jar-name "jackson-dataformat-xml.jar"
9901 #:source-dir "src/main/java"
9902 #:test-exclude
9903 (list "**/failing/**")
9904 #:phases
9905 (modify-phases %standard-phases
9906 (add-before 'configure 'generate-PackageVersion.java
9907 (lambda _
9908 (let* ((out "src/main/java/com/fasterxml/jackson/dataformat/xml/PackageVersion.java")
9909 (in (string-append out ".in")))
9910 (copy-file in out)
9911 (newline)
9912 (substitute* out
9913 (("@package@") "com.fasterxml.jackson.dataformat.xml")
9914 (("@projectversion@") ,version)
9915 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.xml")
2c8ac364
MW
9916 (("@projectartifactid@") "jackson-dataformat-xml")))
9917 #t))
262a4d33
JL
9918 (add-before 'build 'copy-resources
9919 (lambda _
2c8ac364
MW
9920 (copy-recursively "src/main/resources" "build/classes")
9921 #t)))))
262a4d33
JL
9922 (inputs
9923 `(("jackson-annotations" ,java-fasterxml-jackson-annotations)
9924 ("jackson-core" ,java-fasterxml-jackson-core)
9925 ("jackson-modules-base-jaxb" ,java-fasterxml-jackson-modules-base-jaxb)
9926 ("jackson-databind" ,java-fasterxml-jackson-databind)
9927 ("stax2-api" ,java-stax2-api)
9928 ("woodstox" ,java-woodstox-core)))
9929 (native-inputs
9930 `(("junit" ,java-junit)
9931 ("hamcrest" ,java-hamcrest-core)))
9932 (home-page "https://github.com/FasterXML/jackson-dataformat-xml")
9933 (synopsis "Read and write XML")
9934 (description "This package contains Jackson extension component for reading
9935and writing XML encoded data.
9936
9937Further, the goal is to emulate how JAXB data-binding works with \"Code-first\"
9938approach (that is, no support is added for \"Schema-first\" approach). Support
9939for JAXB annotations is provided by JAXB annotation module; this module
9940provides low-level abstractions (@code{JsonParser}, @code{JsonGenerator},
9941@code{JsonFactory}) as well as small number of higher level overrides needed to
9942make data-binding work.")
9943 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
90a127c7
JL
9944
9945(define-public java-hdrhistogram
9946 (package
9947 (name "java-hdrhistogram")
9948 (version "2.1.9")
9949 (source (origin
819ead35
EF
9950 (method git-fetch)
9951 (uri (git-reference
9952 (url "https://github.com/HdrHistogram/HdrHistogram")
9953 (commit (string-append "HdrHistogram-" version))))
9954 (file-name (git-file-name name version))
90a127c7
JL
9955 (sha256
9956 (base32
819ead35 9957 "1cw8aa1vk258k42xs6wpy72m4gbai540jq032qsa7c5586iawx2d"))))
90a127c7
JL
9958 (build-system ant-build-system)
9959 (arguments
9960 `(#:jar-name "java-hdrhistogram.jar"
9961 #:source-dir "src/main/java"
9962 #:phases
9963 (modify-phases %standard-phases
819ead35
EF
9964 (add-after 'unpack 'make-files-writable
9965 (lambda _
9966 (for-each make-file-writable (find-files "."))
9967 #t))
90a127c7
JL
9968 (add-before 'configure 'set-version
9969 (lambda _
9970 (let* ((version-java "src/main/java/org/HdrHistogram/Version.java")
9971 (template (string-append version-java ".template")))
9972 (copy-file template version-java)
9973 (substitute* version-java
9974 (("\\$VERSION\\$") ,version)
9975 (("\\$BUILD_TIME\\$") "0"))
9976 #t))))))
9977 (native-inputs
9978 `(("junit" ,java-junit)
9979 ("hamcrest" ,java-hamcrest-core)))
9980 (home-page "https://hdrhistogram.github.io/HdrHistogram")
9981 (synopsis "High dynamic range histogram")
61fa3c67 9982 (description "Hdrhistogram creates histograms that support
90a127c7
JL
9983recording and analyzing sampled data value counts across a configurable integer
9984value range with configurable value precision within the range. Value precision
9985is expressed as the number of significant digits in the value recording, and
9986provides control over value quantization behavior across the value range and
9987the subsequent value resolution at any given level.")
9988 (license license:public-domain)))
5d104a27 9989
c5ff11dc
RW
9990(define-public java-cofoja
9991 (package
9992 (name "java-cofoja")
9993 (version "1.3")
9994 (source (origin
9995 (method git-fetch)
9996 (uri (git-reference
b0e7b699 9997 (url "https://github.com/nhatminhle/cofoja")
c5ff11dc
RW
9998 (commit (string-append "v" version))))
9999 (file-name (string-append "java-cofoja-" version "-checkout"))
10000 (sha256
10001 (base32
10002 "0p7sz8y5xgpi5rx1qwn6587fkd52qr3ha3ybh14gqcyxhikl525w"))))
10003 (build-system ant-build-system)
10004 (arguments
10005 `(#:build-target "dist"
10006 #:test-target "test"
10007 #:jdk ,icedtea-8
10008 #:make-flags
10009 (list "-Ddist.dir=dist")
10010 #:modules ((guix build ant-build-system)
10011 (guix build java-utils)
10012 (guix build utils)
10013 (srfi srfi-1)
10014 (ice-9 match))
10015 #:phases
10016 (modify-phases %standard-phases
10017 ;; The bulid system ignores the class path the ant-build-system sets
10018 ;; up and instead expects to find all dependencies in the "lib"
10019 ;; directory.
10020 (add-after 'unpack 'create-libdir
10021 (lambda* (#:key inputs #:allow-other-keys)
10022 (mkdir-p "lib")
10023 (for-each
10024 (lambda (file)
10025 (let ((target (string-append "lib/" (basename file))))
10026 (unless (file-exists? target)
10027 (symlink file target))))
10028 (append-map (match-lambda
10029 ((label . dir)
10030 (find-files dir "\\.jar$")))
10031 inputs))
10032 #t))
10033 (replace 'install (install-jars "dist")))))
10034 (inputs
10035 `(("java-asm" ,java-asm)))
10036 (native-inputs
10037 `(("java-junit" ,java-junit)))
10038 (home-page "https://github.com/nhatminhle/cofoja")
10039 (synopsis "Contracts for Java")
10040 (description "Contracts for Java, or Cofoja for short, is a contract
10041programming framework and test tool for Java, which uses annotation processing
10042and bytecode instrumentation to provide run-time checking. (In particular,
10043this is not a static analysis tool.)")
10044 (license license:lgpl3+)))
10045
5d104a27
JL
10046(define-public java-aopalliance
10047 (package
10048 (name "java-aopalliance")
10049 (version "1.0")
10050 (source (origin
10051 (method git-fetch)
10052 ;; Note: this git repository is not official, but contains the
10053 ;; source code that is in the CVS repository. Downloading the
10054 ;; tarball from sourceforge is undeterministic, and the cvs download
10055 ;; fails.
10056 (uri (git-reference
10057 (url "https://github.com/hoverruan/aopalliance")
10058 (commit "0d7757ae204e5876f69431421fe9bc2a4f01e8a0")))
10059 (file-name (string-append name "-" version))
10060 (sha256
10061 (base32
10062 "0rsg2b0v3hxlq2yk1i3m2gw3xwq689j3cwx9wbxvqfpdcjbca0qr"))))
10063 (build-system ant-build-system)
10064 (arguments
10065 `(#:jar-name "java-aopalliance.jar"
10066 #:jdk ,icedtea-8
10067 #:tests? #f; no tests
6671d6a1
JL
10068 #:source-dir "aopalliance/src/main"
10069 #:modules ((guix build ant-build-system)
10070 (guix build utils)
10071 (guix build maven pom)
10072 (guix build java-utils)
10073 (sxml simple))
10074 #:phases
10075 (modify-phases %standard-phases
10076 (add-before 'install 'create-pom
10077 (lambda _
10078 (with-output-to-file "pom.xml"
10079 (lambda _
10080 (sxml->xml
10081 `((project
10082 (modelVersion "4.0.0")
10083 (name "aopalliance")
10084 (groupId "aopalliance")
10085 (artifactId "aopalliance")
10086 (version "1.0"))))))
10087 #t))
10088 (replace 'install
10089 (install-from-pom "pom.xml")))))
5d104a27
JL
10090 (home-page "http://aopalliance.sourceforge.net")
10091 (synopsis "Aspect-Oriented Programming")
10092 (description "The AOP Alliance project is a joint project between several
10093software engineering people who are interested in Aspect-Oriented Programming
10094(AOP) and Java.")
10095 (license license:public-domain)))
454536e0
JL
10096
10097(define-public java-javax-inject
10098 (package
10099 (name "java-javax-inject")
6671d6a1 10100 (version "1")
454536e0 10101 (source (origin
6671d6a1
JL
10102 (method git-fetch)
10103 (uri (git-reference
10104 (url "https://github.com/javax-inject/javax-inject")
10105 (commit version)))
10106 (file-name (git-file-name name version))
454536e0
JL
10107 (sha256
10108 (base32
6671d6a1 10109 "1rspl0nkvk1jif6nccikw93xic6ljj2b6kpy2mffwi2mnvc13j7x"))))
454536e0
JL
10110 (build-system ant-build-system)
10111 (arguments
10112 `(#:jar-name "java-javax-inject.jar"
6671d6a1
JL
10113 #:tests? #f; no tests
10114 #:phases
10115 (modify-phases %standard-phases
10116 (replace 'install
10117 (install-from-pom "pom.xml")))))
702a1012 10118 (home-page "https://github.com/javax-inject/javax-inject")
454536e0
JL
10119 (synopsis "JSR-330: Dependency Injection for Java")
10120 (description "This package specifies a means for obtaining objects in such
10121a way as to maximize reusability, testability and maintainability compared to
10122traditional approaches such as constructors, factories, and service locators
10123(e.g., JNDI). This process, known as dependency injection, is beneficial to
10124most nontrivial applications.
10125
10126Many types depend on other types. For example, a @var{Stopwatch} might depend
10127on a @var{TimeSource}. The types on which a type depends are known as its
10128dependencies. The process of finding an instance of a dependency to use at run
10129time is known as resolving the dependency. If no such instance can be found,
10130the dependency is said to be unsatisfied, and the application is broken.")
10131 (license license:asl2.0)))
5766984b
JL
10132
10133(define-public java-guice
10134 (package
10135 (name "java-guice")
10136 (version "4.1")
10137 (source (origin
b176f69f
EF
10138 (method git-fetch)
10139 (uri (git-reference
10140 (url "https://github.com/google/guice")
10141 (commit version)))
10142 (file-name (git-file-name name version))
9936ffe7
BH
10143 (modules '((guix build utils)))
10144 (snippet
10145 `(begin
b176f69f 10146 (for-each delete-file (find-files "." ".*.jar")) #t))
5766984b
JL
10147 (sha256
10148 (base32
b176f69f 10149 "18im5hdfl4q1b9chww2s1ii60sn3ydyyar32a2sf2p2g8zlbdswq"))))
5766984b
JL
10150 (build-system ant-build-system)
10151 (arguments
10152 `(#:jar-name "java-guice.jar"
10153 #:jdk ,icedtea-8
10154 #:tests? #f; FIXME: tests are not in a java sub directory
b176f69f
EF
10155 #:source-dir "core/src"
10156 #:phases
10157 (modify-phases %standard-phases
10158 (add-after 'unpack 'make-files-writable
10159 (lambda _
10160 (for-each make-file-writable (find-files "."))
6671d6a1
JL
10161 #t))
10162 (replace 'install
10163 (install-from-pom "core/pom.xml")))))
10164 (propagated-inputs
10165 `(("java-aopalliance" ,java-aopalliance)
10166 ("java-asm" ,java-asm)
5766984b 10167 ("java-cglib" ,java-cglib)
6671d6a1 10168 ("java-guava" ,java-guava)
5766984b 10169 ("java-javax-inject" ,java-javax-inject)
6671d6a1 10170 ("java-guice-parent-pom" ,java-guice-parent-pom)))
5766984b
JL
10171 (home-page "https://github.com/google/guice")
10172 (synopsis "Lightweight dependency injection framework")
b176f69f 10173 (description "Guice is a lightweight dependency injection framework for
5766984b
JL
10174Java 6 and above.")
10175 (license license:asl2.0)))
ec4e8ad7
JL
10176
10177(define-public java-guice-servlet
10178 (package
10179 (inherit java-guice)
10180 (name "java-guice-servlet")
10181 (arguments
10182 `(#:jar-name "guice-servlet.jar"
10183 #:source-dir "extensions/servlet/src/"
10184 #:jdk ,icedtea-8
b176f69f
EF
10185 #:tests? #f ; FIXME: not in a java subdir
10186 #:phases
10187 (modify-phases %standard-phases
10188 (add-after 'unpack 'make-files-writable
10189 (lambda _
10190 (for-each make-file-writable (find-files "."))
10191 #t)))))
ec4e8ad7
JL
10192 (inputs
10193 `(("guice" ,java-guice)
10eddaca 10194 ("servlet" ,java-classpathx-servletapi)
ec4e8ad7 10195 ,@(package-inputs java-guice)))))
b12fe1e5 10196
6671d6a1
JL
10197(define java-guice-parent-pom
10198 (package
10199 (inherit java-guice)
10200 (name "java-guice-parent-pom")
10201 (arguments
10202 `(#:tests? #f
10203 #:phases
10204 (modify-phases %standard-phases
10205 (delete 'configure)
10206 (delete 'build)
10207 (add-after 'install 'install-extensions
10208 (install-pom-file "extensions/pom.xml"))
10209 (replace 'install
10210 (install-pom-file "pom.xml")))))
10211 (propagated-inputs
10212 `(("java-google-parent-pom" ,java-google-parent-pom-5)))))
10213
10214(define java-google-parent-pom-5
10215 (package
10216 (name "java-google-parent-pom")
10217 (version "5")
10218 (source (origin
10219 (method git-fetch)
10220 (uri (git-reference
10221 (url "https://github.com/google/google-maven-parents")
10222 (commit (string-append "google-" version))))
10223 (file-name (git-file-name name version))
10224 (sha256
10225 (base32
10226 "0zb7hx24p8k8rfdvix2vsbfqn73jhrycdndvhf8j5gbii9wbqibv"))))
10227 (build-system ant-build-system)
10228 (arguments
10229 `(#:tests? #f
10230 #:phases
10231 (modify-phases %standard-phases
10232 (delete 'configure)
10233 (delete 'build)
10234 (replace 'install
10235 (install-pom-file "pom.xml")))))
10236 (home-page "https://github.com/google/google-maven-parents")
10237 (synopsis "Google parent pom")
10238 (description "This package contains the Maven parent POM for other Google
10239Java projects.")
10240 (license license:asl2.0)))
10241
b12fe1e5
JL
10242(define-public java-assertj
10243 (package
10244 (name "java-assertj")
10245 (version "3.8.0")
10246 (source (origin
04ca89d8
EF
10247 (method git-fetch)
10248 (uri (git-reference
10249 (url "https://github.com/joel-costigliola/assertj-core")
10250 (commit (string-append "assertj-core-" version))))
10251 (file-name (git-file-name name version))
b12fe1e5
JL
10252 (sha256
10253 (base32
04ca89d8 10254 "1k35cg2in7pzk4pbdjryr0pll5lgk1r6ngrn0j8cdlgi7w8zh2d1"))))
b12fe1e5
JL
10255 (build-system ant-build-system)
10256 (arguments
10257 `(#:jar-name "java-assertj.jar"
10258 #:jdk ,icedtea-8
10259 #:source-dir "src/main/java"
10260 #:tests? #f)); depends on tng-junit which depends on assertj
10261 (inputs
10262 `(("cglib" ,java-cglib)
10263 ("junit" ,java-junit)
10264 ("hamcrest" ,java-hamcrest-core)))
10265 (native-inputs
10266 `(("mockito" ,java-mockito-1)))
10267 (home-page "https://joel-costigliola.github.io/assertj/index.html")
10268 (synopsis "Fluent assertions for java")
10269 (description "AssertJ core is a Java library that provides a fluent
10270interface for writing assertions. Its main goal is to improve test code
10271readability and make maintenance of tests easier.")
10272 (license license:asl2.0)))
6768e0a7
JL
10273
10274(define-public java-jboss-javassist
10275 (package
10276 (name "java-jboss-javassist")
10277 (version "3.21.0")
10278 (source (origin
8b408789
EF
10279 (method git-fetch)
10280 (uri (git-reference
10281 (url "https://github.com/jboss-javassist/javassist")
10282 (commit
10283 (string-append "rel_"
10284 (string-map
10285 (lambda (x) (if (eq? x #\.) #\_ x)) version)
10286 "_ga"))))
10287 (file-name (git-file-name name version))
6768e0a7
JL
10288 (sha256
10289 (base32
87ce1fc5
EF
10290 "0h3zlcyqiaq01fspm69h7vki67raw305w89p4ha8vlhpzw02qifm"))
10291 (modules '((guix build utils)))
10292 (snippet
10293 '(begin
10294 (delete-file "javassist.jar")))))
6768e0a7
JL
10295 (build-system ant-build-system)
10296 (arguments
10297 `(#:jar-name "java-jboss-javassist.jar"
10298 #:jdk ,icedtea-8
10299 #:source-dir "src/main"
10300 #:tests? #f; FIXME: requires junit-awtui and junit-swingui from junit3
10301 #:phases
10302 (modify-phases %standard-phases
8b408789 10303 (add-after 'unpack 'make-files-writable
6768e0a7 10304 (lambda _
8b408789 10305 (for-each make-file-writable (find-files "."))
6768e0a7
JL
10306 #t)))))
10307 (native-inputs
10308 `(("junit" ,java-junit)))
10309 (home-page "https://github.com/jboss-javassist/javassist")
10310 (synopsis "Java bytecode engineering toolkit")
10311 (description "Javassist (JAVA programming ASSISTant) makes Java bytecode
10312manipulation simple. It is a class library for editing bytecodes in Java; it
10313enables Java programs to define a new class at runtime and to modify a class
10314file when the JVM loads it.")
10315 (license (list license:gpl2 license:cddl1.0)))); either gpl2 only or cddl.
a6dd06d0
JL
10316
10317(define-public java-jcommander
10318 (package
10319 (name "java-jcommander")
10320 (version "1.71")
10321 (source (origin
4e257acf
EF
10322 (method git-fetch)
10323 (uri (git-reference
10324 (url "https://github.com/cbeust/jcommander")
10325 (commit version)))
10326 (file-name (git-file-name name version))
a6dd06d0
JL
10327 (sha256
10328 (base32
4e257acf 10329 "12vcpc19sd7jhvjgp7xz1qjanfix162xb3x2q5zah93rjklj1h57"))))
a6dd06d0
JL
10330 (build-system ant-build-system)
10331 (arguments
10332 `(#:jar-name "java-jcommander.jar"
10333 #:jdk ,icedtea-8
10334 #:tests? #f; requires testng which depends on jcommander
10335 #:source-dir "src/main/java"))
dcfdc908 10336 (home-page "https://jcommander.org")
a6dd06d0
JL
10337 (synopsis "Command line parameters parser")
10338 (description "JCommander is a very small Java framework that makes it
10339trivial to parse command line parameters. Parameters are declared with
10340annotations.")
10341 (license license:asl2.0)))
11bc385b
JL
10342
10343(define-public java-bsh
10344 (package
10345 (name "java-bsh")
10346 (version "2.0b6")
10347 (source (origin
3e51f9eb
EF
10348 (method git-fetch)
10349 (uri (git-reference
10350 (url "https://github.com/beanshell/beanshell")
10351 (commit version)))
10352 (file-name (git-file-name name version))
11bc385b
JL
10353 (sha256
10354 (base32
b8d977b1
JL
10355 "0kz3f0xjack6c9syssi4qjw1rbd3q5963sk5pmr143hiibxa9csw"))
10356 (modules '((guix build utils)))
10357 (snippet
10358 '(begin
10359 ;; Delete bundled third-party jar archives.
10360 (for-each delete-file (find-files "." ".*.jar$"))
10361 (for-each (lambda (file) (chmod file #o644))
10362 (find-files "." "."))
10363 #t))))
11bc385b
JL
10364 (build-system ant-build-system)
10365 (arguments
10366 `(#:build-target "jarall"
10367 #:test-target "junit-tests-all"
c1fb0d8e 10368 #:make-flags (list "-DDATE" "(no date for reproducibility)")
11bc385b
JL
10369 #:phases
10370 (modify-phases %standard-phases
b8d977b1
JL
10371 (add-before 'install 'fix-pom
10372 (lambda _
10373 (substitute* "pom.xml"
10374 (("org.apache-extras.beanshell") "org.beanshell"))
10375 #t))
11bc385b 10376 (replace 'install
51087d51 10377 (install-from-pom "pom.xml")))))
b8d977b1
JL
10378 (inputs
10379 `(("java-classpathx-servletapi" ,java-classpathx-servletapi)
10380 ("java-commons-bsf" ,java-commons-bsf)))
10381 (native-inputs
10382 `(("java-junit" ,java-junit)
10383 ("javacc" ,javacc-3)))
11bc385b
JL
10384 (home-page "http://beanshell.org/")
10385 (synopsis "Lightweight Scripting for Java")
10386 (description "BeanShell is a small, free, embeddable Java source
10387interpreter with object scripting language features, written in Java.
10388BeanShell dynamically executes standard Java syntax and extends it with common
10389scripting conveniences such as loose types, commands, and method closures like
10390those in Perl and JavaScript.")
10391 (license license:asl2.0)))
7a343e97
JL
10392
10393(define-public java-fest-util
10394 (package
10395 (name "java-fest-util")
10396 (version "1.2.5")
10397 (source (origin
00f3190d
EF
10398 (method git-fetch)
10399 (uri (git-reference
10400 (url "https://github.com/alexruiz/fest-util/")
10401 (commit (string-append "fest-util-" version))))
10402 (file-name (git-file-name name version))
7a343e97
JL
10403 (sha256
10404 (base32
00f3190d 10405 "02kgal7v85snyyvcsxvn4qphid455f4smh2wri1il8d9asw0djbz"))))
7a343e97
JL
10406 (build-system ant-build-system)
10407 (arguments
10408 `(#:jar-name "java-fest-util.jar"
10409 #:source-dir "src/main/java"))
10410 (native-inputs
10411 `(("junit" ,java-junit)
10412 ("hamcrest" ,java-hamcrest-core)))
10413 (home-page "https://github.com/alexruiz/fest-util")
10414 (synopsis "FEST common utilities")
10415 (description "Common utilities used in all FEST module.")
10416 (license license:asl2.0)))
3c6c8358
JL
10417
10418(define-public java-fest-test
10419 (package
10420 (name "java-fest-test")
10421 (version "2.1.0")
10422 (source (origin
79e74008
EF
10423 (method git-fetch)
10424 (uri (git-reference
10425 (url "https://github.com/alexruiz/fest-test/")
10426 (commit (string-append "fest-test-" version))))
10427 (file-name (git-file-name name version))
3c6c8358
JL
10428 (sha256
10429 (base32
79e74008 10430 "0mg1d2jfh7kbx2c40dchbjr6d8pv59snsyb13mfxsr7xk5n69qbn"))))
3c6c8358
JL
10431 (build-system ant-build-system)
10432 (arguments
10433 `(#:jar-name "java-fest-test.jar"
10434 #:source-dir "src/main/java"
10435 #:tests? #f)); no tests
10436 (inputs
10437 `(("junit" ,java-junit)))
10438 (home-page "https://github.com/alexruiz/fest-test")
10439 (synopsis "Common FEST testing infrastructure")
10440 (description "Fest-test contains the common FEST testing infrastructure.")
10441 (license license:asl2.0)))
ca98e448
JL
10442
10443(define-public java-fest-assert
10444 (package
10445 (name "java-fest-assert")
10446 (version "2.0M10")
10447 (source (origin
e9917c69
EF
10448 (method git-fetch)
10449 (uri (git-reference
10450 (url "https://github.com/alexruiz/fest-assert-2.x/")
10451 (commit (string-append "fest-assert-core-" version))))
10452 (file-name (git-file-name name version))
ca98e448
JL
10453 (sha256
10454 (base32
e9917c69 10455 "1cp8zzyag3s85fz2w68sda9zzaal1y5f9wl8g72wkm12an40w6by"))))
ca98e448
JL
10456 (build-system ant-build-system)
10457 (arguments
10458 `(#:jar-name "java-fest-assert.jar"
10459 #:source-dir "src/main/java"
10460 #:test-exclude
10461 (list
10462 "**/Abstract*.java"
10463 "**/*BaseTest.java"
10464 ;; Unable to set MockitoNamingPolicy on cglib generator which creates FastClasses
10465 "**/MessageFormatter_format_Test.java"
10466 "**/internal/*/*_assert*_Test.java")))
10467 (inputs
10468 `(("java-fest-util" ,java-fest-util)))
10469 (native-inputs
10470 `(("java-junit" ,java-junit)
10471 ("java-fest-test" ,java-fest-test)
10472 ("java-hamcrest-core" ,java-hamcrest-core)
10473 ("java-mockito" ,java-mockito-1)
10474 ("java-cglib" ,java-cglib)
10475 ("java-objenesis" ,java-objenesis)
10476 ("java-asm" ,java-asm)))
10477 (home-page "https://github.com/alexruiz/fest-assert-2.x")
10478 (synopsis "FEST fluent assertions")
10479 (description "FEST-Assert provides a fluent interface for assertions.")
10480 (license license:asl2.0)))
0442d897
JL
10481
10482(define-public java-testng
10483 (package
10484 (name "java-testng")
3422e10e 10485 (version "6.14.3")
0442d897 10486 (source (origin
36b39d16
RW
10487 (method git-fetch)
10488 (uri (git-reference
b0e7b699 10489 (url "https://github.com/cbeust/testng")
36b39d16
RW
10490 (commit version)))
10491 (file-name (string-append name "-" version "-checkout"))
0442d897
JL
10492 (sha256
10493 (base32
3422e10e 10494 "0y6vq30i5g276kw0v2bhbvci22ijg7ax49ap2611yqlhbs4d6dqv"))))
0442d897
JL
10495 (build-system ant-build-system)
10496 (arguments
10497 `(#:jdk ,icedtea-8; java.util.function
10498 #:jar-name "java-testng.jar"
10499 #:source-dir "src/main/java"
10500 #:phases
10501 (modify-phases %standard-phases
36b39d16
RW
10502 ;; FIXME: I don't know why these tests fail
10503 (add-after 'unpack 'delete-failing-tests
10504 (lambda _
10505 (substitute* "src/test/resources/testng.xml"
10506 (("<class name=\"test.configuration.github1625.TestRunnerIssue1625\"/>") "")
10507 (("<class name=\"test.serviceloader.ServiceLoaderTest\" />") ""))
10508 #t))
10509 ;; We don't have groovy
10510 (add-after 'unpack 'delete-groovy-tests
10511 (lambda _
10512 (delete-file-recursively "src/test/java/test/dependent/issue1648/")
10513 (substitute* "src/test/resources/testng.xml"
10514 (("<class name=\"test.dependent.issue1648.TestRunner\"/>") ""))
10515 #t))
0442d897
JL
10516 (add-before 'build 'copy-resources
10517 (lambda _
10518 (copy-recursively "src/main/resources" "build/classes")
10519 #t))
10520 (add-before 'check 'copy-test-resources
10521 (lambda _
10522 (copy-recursively "src/test/resources" "build/test-classes")
10523 #t))
10524 (replace 'check
10525 (lambda _
2c8ac364 10526 (invoke "ant" "compile-tests")
0442d897
JL
10527 ;; we don't have groovy
10528 (substitute* "src/test/resources/testng.xml"
10529 (("<class name=\"test.groovy.GroovyTest\" />") ""))
2c8ac364
MW
10530 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
10531 ":build/classes"
10532 ":build/test-classes")
10533 "-Dtest.resources.dir=src/test/resources"
10534 "org.testng.TestNG" "src/test/resources/testng.xml"))))))
0442d897
JL
10535 (propagated-inputs
10536 `(("junit" ,java-junit)
10537 ("java-jsr305" ,java-jsr305)
10538 ("java-bsh" ,java-bsh)
10539 ("java-jcommander" ,java-jcommander)
10540 ("java-guice" ,java-guice)
10541 ("snakeyaml" ,java-snakeyaml)))
10542 (native-inputs
10543 `(("guava" ,java-guava)
10544 ("java-javax-inject" ,java-javax-inject)
10545 ("java-hamcrest" ,java-hamcrest-all)
10546 ("java-assertj" ,java-assertj)
36b39d16 10547 ("java-mockito" ,java-mockito-1)
0442d897
JL
10548 ("cglib" ,java-cglib)
10549 ("asm" ,java-asm)
10550 ("aopalliance" ,java-aopalliance)))
c9010605 10551 (home-page "https://testng.org")
0442d897
JL
10552 (synopsis "Testing framework")
10553 (description "TestNG is a testing framework inspired from JUnit and NUnit
10554but introducing some new functionalities that make it more powerful and easier
10555to use.")
10556 (license license:asl2.0)))
1717a7de
JL
10557
10558(define-public java-jnacl
3e87923a
RW
10559 (let ((commit "094e819afdd63ea81a499b3bcb42a271006bebd9")
10560 (revision "2"))
10561 (package
10562 (name "java-jnacl")
10563 (version (string-append "0.1.0-" revision "." (string-take commit 7)))
10564 (source (origin
10565 (method git-fetch)
10566 (uri (git-reference
b0e7b699 10567 (url "https://github.com/neilalexander/jnacl")
3e87923a 10568 (commit commit)))
6c34ad73 10569 (file-name (git-file-name name version))
3e87923a
RW
10570 (sha256
10571 (base32
10572 "1d6g6xhn83byv5943n7935wwjsk0ibk0qdvqgr699qqgqqmwisbb"))))
10573 (build-system ant-build-system)
10574 (arguments
8c7d32e0 10575 `(#:jar-name "jnacl.jar"
3e87923a
RW
10576 #:source-dir "src/main/java"
10577 #:jdk ,icedtea-8
10578 #:phases
10579 (modify-phases %standard-phases
10580 (add-before 'build 'fix-tests
10581 (lambda _
10582 (substitute* '("src/test/java/com/neilalexander/jnacl/NaClTest.java"
10583 "src/test/java/com/neilalexander/jnacl/NaclSecretBoxTest.java")
10584 (("assertions.Assertions") "assertions.api.Assertions"))
10585 #t))
10586 (replace 'check
10587 (lambda _
10588 (invoke "ant" "compile-tests")
10589 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
10590 ":build/classes"
10591 ":build/test-classes")
10592 "org.testng.TestNG" "-testclass"
10593 "build/test-classes/com/neilalexander/jnacl/NaclSecretBoxTest.class")
10594 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
10595 ":build/classes"
10596 ":build/test-classes")
10597 "org.testng.TestNG" "-testclass"
2c8ac364 10598 "build/test-classes/com/neilalexander/jnacl/NaClTest.class"))))))
3e87923a
RW
10599 (native-inputs
10600 `(("java-testng" ,java-testng)
10601 ("java-fest-util" ,java-fest-util)
10602 ("java-fest-assert" ,java-fest-assert)))
10603 (home-page "https://github.com/neilalexander/jnacl")
10604 (synopsis "Java implementation of NaCl")
10605 (description "Pure Java implementation of the NaCl: Networking and
1717a7de 10606Cryptography library.")
3e87923a 10607 (license license:bsd-2))))
eaf3cb7a
JL
10608
10609(define-public java-mvel2
10610 (package
10611 (name "java-mvel2")
10612 (version "2.3.1")
10613 (source (origin
10614 (method url-fetch)
10615 (uri (string-append "https://github.com/mvel/mvel/archive/mvel2-"
10616 version ".Final.tar.gz"))
10617 (sha256
10618 (base32
10619 "01ph5s9gm16l2qz58lg21w6fna7xmmrj7f9bzqr1jim7h9557d3z"))))
10620 (build-system ant-build-system)
10621 (arguments
10622 `(#:jar-name "mvel2.jar"
10623 #:source-dir "src/main/java"
10624 #:test-exclude
10625 (list "**/Abstract*.java"
10626 ;; Base class with no tests
10627 "**/MVELThreadTest.java")
10628 #:phases
10629 (modify-phases %standard-phases
10630 (add-after 'install 'install-bin
10631 (lambda* (#:key outputs #:allow-other-keys)
10632 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
10633 (mkdir-p bin)
10634 (with-output-to-file (string-append bin "/mvel2")
10635 (lambda _
10636 (display
10637 (string-append
10638 "#!" (which "bash") "\n"
10639 "if [ \"$#\" -ne \"2\" ]; then\n"
10640 "echo 'Usage: mvel2 <script> <out.dir>'\n"
10641 "exit\n"
10642 "fi\n"
10643 "java -Dout.dir=$2 -cp " (getenv "CLASSPATH")
10644 ":" (assoc-ref outputs "out") "/share/java/mvel2.jar"
10645 " org.mvel2.sh.Main $1"))))
10646 (chmod (string-append bin "/mvel2") #o755))
10647 #t)))))
10648 (native-inputs
10649 `(("junit" ,java-junit)
10650 ("hamcrest" ,java-hamcrest-core)))
10651 (home-page "https://github.com/mvel/mvel")
10652 (synopsis "MVFLEX Expression Language")
10653 (description "MVEL has largely been inspired by Java syntax, but has some
10654fundamental differences aimed at making it more efficient as an expression
10655language, such as operators that directly support collection, array and string
10656matching, as well as regular expressions. MVEL is used to evaluate expressions
10657written using Java syntax.
10658
10659In addition to the expression language, MVEL serves as a templating language for
10660configuration and string construction.")
10661 (license license:asl2.0)))
d54d7d31 10662
9e325e8c
RW
10663(define-public java-commons-jexl-2
10664 (package
10665 (name "java-commons-jexl")
10666 (version "2.1.1")
10667 (source (origin
10668 (method url-fetch)
10669 (uri (string-append "mirror://apache/commons/jexl/source/"
10670 "commons-jexl-" version "-src.tar.gz"))
10671 (sha256
10672 (base32
10673 "1ai7632bwwaxglb0nbpblpr2jw5g20afrsaq372ipkphi3ncy1jz"))))
10674 (build-system ant-build-system)
10675 (arguments
10676 `(#:jar-name "commons-jexl-2.jar"
10677 #:jdk ,icedtea-8
10678 #:source-dir "src/main/java"
10679 #:phases
10680 (modify-phases %standard-phases
10681 (add-before 'check 'disable-broken-tests
10682 (lambda* (#:key inputs #:allow-other-keys)
10683 (with-directory-excursion "src/test/java/org/apache/commons/jexl2/"
10684 (substitute* "ArithmeticTest.java"
10685 (("asserter.assertExpression\\(\"3 / 0\"") "//")
10686 (("asserter.assertExpression\\(\"imanull") "//"))
10687 ;; This test fails with "ambiguous method invocation"
10688 (delete-file "CacheTest.java")
10689 ;; This test doesn't have access to the temp directory
10690 (substitute* "ClassCreatorTest.java"
10691 (("java.io.tmpdir") "user.dir"))
10692 ;; This test fails in trying to detect whether it can run.
10693 (substitute* "ClassCreator.java"
10694 (("boolean canRun =.*") "boolean canRun = false;\n"))
10695 ;; ...and these tests depend on it.
10696 (delete-file "scripting/JexlScriptEngineOptionalTest.java")
10697 (delete-file "scripting/JexlScriptEngineTest.java"))
10698 #t))
10699 (add-before 'build 'run-javacc
10700 (lambda _
10701 (with-directory-excursion "src/main/java/org/apache/commons/jexl2/parser/"
080d0b60
RW
10702 (invoke "java" "jjtree" "Parser.jjt")
10703 (invoke "java" "javacc" "Parser.jj"))
10704 #t)))))
9e325e8c
RW
10705 (inputs
10706 `(("java-commons-logging-minimal" ,java-commons-logging-minimal)))
10707 (native-inputs
10708 `(("java-junit" ,java-junit)
10709 ("java-hamcrest-core" ,java-hamcrest-core)
10710 ("javacc" ,javacc-4)))
10711 (home-page "https://commons.apache.org/proper/commons-jexl/")
10712 (synopsis "Java Expression Language ")
10713 (description "JEXL is a library intended to facilitate the implementation
10714of dynamic and scripting features in applications and frameworks written in
10715Java. JEXL implements an Expression Language based on some extensions to the
10716JSTL Expression Language supporting most of the constructs seen in
10717shell-script or ECMAScript. Its goal is to expose scripting features usable
10718by technical operatives or consultants working with enterprise platforms.")
10719 (license license:asl2.0)))
10720
d54d7d31
JL
10721(define-public java-lz4
10722 (package
10723 (name "java-lz4")
10724 (version "1.4.0")
10725 (source (origin
6632fc28
EF
10726 (method git-fetch)
10727 (uri (git-reference
10728 (url "https://github.com/lz4/lz4-java")
10729 (commit version)))
10730 (file-name (git-file-name name version))
d54d7d31
JL
10731 (sha256
10732 (base32
6632fc28 10733 "0ydjakhv3cz34mfvv14qrh2ksdxifgjwwagjy7r46qr3f68hnf6y"))))
d54d7d31
JL
10734 (build-system ant-build-system)
10735 (arguments
10736 `(#:jar-name "lz4.jar"
10737 #:jdk ,icedtea-8
10738 #:source-dir "src/java:src/java-unsafe"
10739 #:tests? #f; FIXME: requires more dependencies
10740 #:phases
10741 (modify-phases %standard-phases
6632fc28
EF
10742 (add-after 'unpack 'make-files-writable
10743 (lambda _
10744 (for-each make-file-writable (find-files "."))
10745 #t))
d54d7d31
JL
10746 (add-before 'configure 'generate-source
10747 (lambda _
10748 (with-directory-excursion "src/build/source_templates"
1b6bc516
RW
10749 (invoke "mvel2" "../gen_sources.mvel" "../../java"))
10750 #t)))))
d54d7d31
JL
10751 (native-inputs
10752 `(("mvel" ,java-mvel2)))
10753 (home-page "https://jpountz.github.io/lz4-java")
10754 (synopsis "Compression algorithm")
10755 (description "LZ4 - Java is a Java port of the popular lz4 compression
10756algorithms and xxHash hashing algorithm.")
10757 (license license:asl2.0)))
62315865 10758
50d70a72 10759(define-public java-bouncycastle
62315865 10760 (package
50d70a72 10761 (name "java-bouncycastle")
248a9e16 10762 (version "1.60")
62315865 10763 (source (origin
a8f01c45
EF
10764 (method git-fetch)
10765 (uri (git-reference
10766 (url "http://git.bouncycastle.org/repositories/bc-java")
10767 ;(url "https://github.com/bcgit/bc-java")
10768 (commit (string-append "r1rv" (substring version 2 4)))))
10769 (file-name (git-file-name name version))
62315865
JL
10770 (sha256
10771 (base32
a8f01c45 10772 "1m921a1ac2dl797ffzg3d4j97ch308f25spb4jgsj3npfmmys5gb"))
50d70a72
JL
10773 (modules '((guix build utils)))
10774 (snippet
10775 '(begin
10776 (for-each delete-file
10777 (find-files "." "\\.jar$"))
10778 #t))))
62315865
JL
10779 (build-system ant-build-system)
10780 (arguments
50d70a72 10781 `(#:jdk ,icedtea-8
0c68f7fd 10782 #:tests? #f
62315865
JL
10783 #:phases
10784 (modify-phases %standard-phases
50d70a72 10785 (replace 'build
62315865 10786 (lambda _
50d70a72 10787 (invoke "ant" "-f" "ant/jdk15+.xml" "build-provider")
2c8ac364 10788 (invoke "ant" "-f" "ant/jdk15+.xml" "build")))
0c68f7fd
RW
10789 ;; FIXME: the tests freeze.
10790 ;; (replace 'check
10791 ;; (lambda _
10792 ;; (invoke "ant" "-f" "ant/jdk15+.xml" "test")))
50d70a72
JL
10793 (replace 'install
10794 (install-jars "build/artifacts/jdk1.5/jars")))))
10795 (inputs
10796 `(("java-javax-mail" ,java-javax-mail)))
31208367
JL
10797 (native-inputs
10798 `(("unzip" ,unzip)
50d70a72
JL
10799 ("junit" ,java-junit)
10800 ("java-native-access" ,java-native-access)
10801 ("java-native-access-platform" ,java-native-access-platform)))
31208367
JL
10802 (home-page "https://www.bouncycastle.org")
10803 (synopsis "Cryptographic library")
50d70a72
JL
10804 (description "Bouncy Castle is a cryptographic library for the Java
10805programming language.")
31208367 10806 (license license:expat)))
a53d9ac0
JL
10807
10808(define-public java-lmax-disruptor
10809 (package
10810 (name "java-lmax-disruptor")
10811 (version "3.3.7")
10812 (source (origin
10813 (method url-fetch)
10814 (uri (string-append "https://github.com/LMAX-Exchange/disruptor/"
10815 "archive/" version ".tar.gz"))
10816 (file-name (string-append name "-" version ".tar.gz"))
10817 (sha256
10818 (base32
10819 "17da2gwj5abnlsfgn2xqjk5lgzbg4vkb0hdv2dvc8r2fx4bi7w3g"))))
10820 (build-system ant-build-system)
10821 (arguments
10822 `(#:jar-name "java-lmax-disruptor.jar"
10823 #:jdk ,icedtea-8
10824 #:tests? #f)); tests hang
10825 (inputs
10826 `(("junit" ,java-junit)
10827 ("java-hdrhistogram" ,java-hdrhistogram)
10828 ("java-jmock" ,java-jmock)
10829 ("java-jmock-legacy" ,java-jmock-legacy)
10830 ("java-jmock-junit4" ,java-jmock-junit4)
10831 ("java-hamcrest-all" ,java-hamcrest-all)))
10832 (native-inputs
10833 `(("cglib" ,java-cglib)
10834 ("objenesis" ,java-objenesis)
10835 ("asm" ,java-asm)))
10836 (home-page "https://www.lmax.com/disruptor")
10837 (synopsis "High performance inter-thread communication")
10838 (description "LMAX Disruptor is a software pattern and software component
10839for high performance inter-thread communication that avoids the need for
10840message queues or resource locking.")
10841 (license license:asl2.0)))
5619556b 10842
5e3abfc8
RW
10843(define-public java-commons-bcel
10844 (package
10845 (name "java-commons-bcel")
10846 (version "6.1")
10847 (source (origin
10848 (method url-fetch)
10849 (uri (string-append "mirror://apache/commons/bcel/source/bcel-"
10850 version "-src.tar.gz"))
10851 (sha256
10852 (base32
10853 "0j3x1rxd673k07psclk8k13rqh0x0mf2yy5qiwkiw4z3afa568jy"))))
10854 (build-system ant-build-system)
10855 (arguments
10856 `(#:jar-name "bcel.jar"
10857 #:jdk ,icedtea-8
10858 #:source-dir "src/main/java"
10859 #:test-dir "src/test/java"
10860 ;; FIXME: Tests require the unpackaged jna.
10861 #:tests? #f))
10862 (home-page "https://commons.apache.org/proper/commons-bcel/")
10863 (synopsis "Byte code engineering library")
10864 (description "The Byte Code Engineering Library (Apache Commons BCEL) is
10865intended to give users a convenient way to analyze, create, and
10866manipulate (binary) Java class files. Classes are represented by objects
10867which contain all the symbolic information of the given class: methods, fields
10868and byte code instructions, in particular.
10869
10870Such objects can be read from an existing file, be transformed by a
10871program (e.g. a class loader at run-time) and written to a file again. An
10872even more interesting application is the creation of classes from scratch at
10873run-time. The @dfn{Byte Code Engineering Library} (BCEL) may be also useful
10874if you want to learn about the @dfn{Java Virtual Machine} (JVM) and the format
10875of Java @code{.class} files.")
10876 (license license:asl2.0)))
10877
5619556b
JL
10878(define-public java-xerial-core
10879 (package
10880 (name "java-xerial-core")
10881 (version "2.1")
10882 (source (origin
10883 (method url-fetch)
10884 (uri (string-append "https://github.com/xerial/xerial-java/archive/"
10885 version ".tar.gz"))
10886 (file-name (string-append name "-" version ".tar.gz"))
10887 (sha256
10888 (base32
10889 "0d3g863i41bgalpa4xr3vm1h140l091n8iwgq5qvby5yivns9y8d"))))
10890 (build-system ant-build-system)
10891 (arguments
10892 `(#:jar-name "xerial-core.jar"
10893 #:source-dir "xerial-core/src/main/java"
10894 #:test-dir "xerial-core/src/test"
10895 #:phases
10896 (modify-phases %standard-phases
10897 (add-before 'build 'copy-resources
10898 (lambda _
10899 (copy-recursively "xerial-core/src/main/resources"
10900 "build/classes")
10901 #t)))))
10902 (native-inputs
10903 `(("junit" ,java-junit)
10904 ("hamcrest" ,java-hamcrest-core)))
10905 (home-page "https://github.com/xerial/xerial-java")
f4548394 10906 (synopsis "Data management libraries for Java")
5619556b 10907 (description "Xerial is a set of data management libraries for the Java
f4548394 10908programming language. The ultimate goal of the Xerial project is to manage
5619556b
JL
10909everything as database, including class objects, text format data, data
10910streams, etc.")
10911 (license license:asl2.0)))
8d6a4815
JL
10912
10913(define-public java-powermock-reflect
10914 (package
10915 (name "java-powermock-reflect")
10916 (version "1.7.3")
10917 (source (origin
10918 (method url-fetch)
10919 (uri (string-append "https://github.com/powermock/powermock/"
10920 "archive/powermock-" version ".tar.gz"))
10921 (file-name (string-append name "-" version ".tar.gz"))
10922 (sha256
10923 (base32
10924 "0sbgi5vqq7k72wzcdjb20s370vyd4hsbnx71pzb8ishml3gy7fwy"))
10925 (patches
10926 (search-patches "java-powermock-fix-java-files.patch"))))
10927 (build-system ant-build-system)
10928 (arguments
10929 `(#:jar-name "java-powermock-reflect.jar"
10930 #:jdk ,icedtea-8
10931 #:source-dir "powermock-reflect/src/main/java"
10932 #:test-dir "powermock-reflect/src/test"))
10933 (inputs
10934 `(("java-objenesis" ,java-objenesis)))
10935 (native-inputs
10936 `(("junit" ,java-junit)
10937 ("cglib" ,java-cglib)
10938 ("asm" ,java-asm)
10939 ("hamcrest" ,java-hamcrest-core)
10940 ("assertj" ,java-assertj)))
10941 (home-page "https://github.com/powermock/powermock")
10942 (synopsis "Mock library extension framework")
10943 (description "PowerMock is a framework that extends other mock libraries
10944such as EasyMock with more powerful capabilities. PowerMock uses a custom
10945classloader and bytecode manipulation to enable mocking of static methods,
10946constructors, final classes and methods, private methods, removal of static
10947initializers and more. By using a custom classloader no changes need to be
10948done to the IDE or continuous integration servers which simplifies adoption.")
10949 (license license:asl2.0)))
d4a4d5da
JL
10950
10951(define-public java-powermock-core
10952 (package
10953 (inherit java-powermock-reflect)
10954 (name "java-powermock-core")
10955 (arguments
10956 `(#:jar-name "java-powermock-core.jar"
10957 #:source-dir "powermock-core/src/main/java"
10958 #:test-dir "powermock-core/src/test"
10959 #:tests? #f; requires powermock-api
59e0021c
JL
10960 #:jdk ,icedtea-8
10961 #:phases
10962 (modify-phases %standard-phases
10963 (add-before 'build 'copy-resources
10964 (lambda _
10965 (copy-recursively "powermock-core/src/main/resources"
2c8ac364
MW
10966 "build/classes")
10967 #t)))))
d4a4d5da
JL
10968 (inputs
10969 `(("reflect" ,java-powermock-reflect)
10970 ("javassist" ,java-jboss-javassist)))
10971 (native-inputs
10972 `(("junit" ,java-junit)
10973 ("assertj" ,java-assertj)
10974 ("mockito" ,java-mockito-1)))))
2d5d65d7
JL
10975
10976(define-public java-powermock-api-support
10977 (package
10978 (inherit java-powermock-reflect)
10979 (name "java-powermock-api-support")
10980 (build-system ant-build-system)
10981 (arguments
10982 `(#:jar-name "java-powermock-api-support.jar"
10983 #:jdk ,icedtea-8
10984 #:source-dir "powermock-api/powermock-api-support/src/main/java"
10985 #:tests? #f)); no tests
10986 (inputs
10987 `(("core" ,java-powermock-core)
10988 ("reflect" ,java-powermock-reflect)))))
6c21d46c
JL
10989
10990(define-public java-powermock-modules-junit4-common
10991 (package
10992 (inherit java-powermock-reflect)
10993 (name "java-powermock-modules-junit4-common")
10994 (build-system ant-build-system)
10995 (arguments
10996 `(#:jar-name "java-powermock-modules-junit4-common.jar"
10997 #:jdk ,icedtea-8
10998 #:source-dir "powermock-modules/powermock-module-junit4-common/src/main/java"
10999 #:test-dir "powermock-modules/powermock-module-junit4-common/src/test"))
11000 (inputs
11001 `(("core" ,java-powermock-core)
11002 ("easymock" ,java-easymock)
11003 ("reflect" ,java-powermock-reflect)
11004 ("hamcrest" ,java-hamcrest-core)
11005 ("cglib" ,java-cglib)))))
33db1681
JL
11006
11007(define-public java-powermock-modules-junit4
11008 (package
11009 (inherit java-powermock-reflect)
11010 (name "java-powermock-modules-junit4")
11011 (build-system ant-build-system)
11012 (arguments
11013 `(#:jar-name "java-powermock-modules-junit4.jar"
11014 #:jdk ,icedtea-8
11015 #:source-dir "powermock-modules/powermock-module-junit4/src/main/java"
1124683d
JL
11016 #:test-dir "powermock-modules/powermock-module-junit4/src/test"
11017 #:phases
11018 (modify-phases %standard-phases
11019 (add-before 'build 'fix-junit-detection
11020 (lambda _
11021 ;; Our junit version is 4.12-SNAPSHOT
11022 (substitute* (find-files "powermock-modules/powermock-module-junit4"
11023 "PowerMockJUnit4MethodValidator.java")
2c8ac364
MW
11024 (("4.12") "4.12-SNAPSHOT"))
11025 #t)))))
33db1681
JL
11026 (inputs
11027 `(("core" ,java-powermock-core)
11028 ("reflect" ,java-powermock-reflect)
11029 ("common" ,java-powermock-modules-junit4-common)
11030 ("cglib" ,java-cglib)))
11031 (native-inputs
11032 `(("easymock" ,java-easymock)
11033 ("hamcrest" ,java-hamcrest-core)
11034 ("objenesis" ,java-objenesis)
11035 ("asm" ,java-asm)
11036 ("junit" ,java-junit)))))
4d508975
JL
11037
11038(define-public java-powermock-api-easymock
11039 (package
11040 (inherit java-powermock-reflect)
11041 (name "java-powermock-api-easymock")
11042 (build-system ant-build-system)
11043 (arguments
11044 `(#:jar-name "java-powermock-api-easymock.jar"
11045 #:jdk ,icedtea-8
11046 #:source-dir "powermock-api/powermock-api-easymock/src/main/java"
11047 #:tests? #f; no tests
11048 #:phases
11049 (modify-phases %standard-phases
11050 (add-before 'build 'fix-file
11051 (lambda _
11052 ;; FIXME: This looks wrong, but it fixes a build error.
11053 (with-directory-excursion "powermock-api/powermock-api-easymock"
11054 (substitute* "src/main/java/org/powermock/api/easymock/PowerMock.java"
11055 (("classLoader instanceof MockClassLoader") "false")
11056 (("\\(\\(MockClassLoader\\) classLoader\\).*;") ";")))
11057 #t)))))
11058 (inputs
11059 `(("core" ,java-powermock-core)
11060 ("easymock" ,java-easymock)
11061 ("reflect" ,java-powermock-reflect)
11062 ("support" ,java-powermock-api-support)
11063 ("cglib" ,java-cglib)))))
5fb3e822
JL
11064
11065(define-public java-jboss-jms-api-spec
11066 (package
11067 (name "java-jboss-jms-api-spec")
11068 (version "2.0")
11069 (source (origin
11070 (method url-fetch)
11071 (uri (string-append "https://github.com/jboss/jboss-jms-api_spec/"
11072 "archive/jboss-jms-api_" version
11073 "_spec-1.0.1.Final.tar.gz"))
11074 (sha256
11075 (base32
11076 "07bqblw9kq2i8q92bz70fvavq5xjfkaixl8xa0m0cypjgy82rb7m"))))
11077 (build-system ant-build-system)
11078 (arguments
11079 `(#:jar-name "java-jboss-jms-api_spec.jar"
11080 #:jdk ,icedtea-8
11081 #:source-dir "."
11082 #:tests? #f)); no tests
11083 (home-page "https://github.com/jboss/jboss-jms-api_spec")
11084 (synopsis "Java Message Service API specification")
11085 (description "Java Message Service (JMS) API is used to send messages
11086messages between two or more clients. It is a messaging standard that allows
11087application components to create, send, receive, and read messages.")
11088 ; either gpl2 only with GPL Classpath Exception, or cddl.
11089 (license (list license:gpl2 license:cddl1.0))))
3ff47c66
JL
11090
11091(define-public java-mail
11092 (package
11093 (name "java-mail")
11094 (version "1.6.0")
11095 (source (origin
11096 (method url-fetch)
11097 (uri (string-append "https://github.com/javaee/javamail/archive/"
11098 "JAVAMAIL-1_6_0.tar.gz"))
11099 (sha256
11100 (base32
11101 "1b4rg7fpj50ld90a71iz2m4gm3f5cnw18p3q3rbrrryjip46kx92"))))
11102 (build-system ant-build-system)
11103 (arguments
11104 `(#:jar-name "java-mail.jar"
11105 #:jdk ,icedtea-8
11106 #:source-dir "mail/src/main/java"
11107 #:test-dir "mail/src/test"
11108 #:test-exclude
11109 (list "**/CollectorFormatterTest.java"
11110 "**/CompactFormatterTest.java"
11111 "**/DurationFilterTest.java"
11112 "**/MailHandlerTest.java"
11113 "**/GetLocalAddressTest.java"
11114 ;; FIXME: both end with:
11115 ;; java.lang.ClassNotFoundException:
11116 ;; javax.mail.internet.MimeMultipartParseTest
11117 "**/MimeMultipartParseTest.java"
11118 "**/SearchTermSerializationTest.java")
11119 #:phases
11120 (modify-phases %standard-phases
11121 (add-before 'configure 'move-version.java
11122 (lambda _
11123 (copy-file "mail/src/main/resources/javax/mail/Version.java"
218d1dde
RW
11124 "mail/src/main/java/javax/mail/Version.java")
11125 #t))
3ff47c66
JL
11126 (add-before 'build 'copy-resources
11127 (lambda _
11128 (copy-recursively "mail/src/main/resources/META-INF"
11129 "build/classes/META-INF")
11130 #t)))))
11131 (native-inputs
11132 `(("junit" ,java-junit)
11133 ("hamcrest" ,java-hamcrest-core)))
11134 (home-page "https://javaee.github.io/javamail/")
7230f6d5 11135 (synopsis "Mail-related functionality in Java")
3ff47c66
JL
11136 (description "The JavaMail API provides a platform-independent and
11137protocol-independent framework to build mail and messaging applications.")
11138 ;; General Public License Version 2 only ("GPL") or the Common Development
11139 ;; and Distribution License("CDDL")
11140 (license (list license:cddl1.1
11141 license:gpl2)))); with classpath exception
217b20e4
JL
11142
11143(define-public java-jeromq
11144 (package
11145 (name "java-jeromq")
4aa0a1df 11146 (version "0.4.3")
217b20e4 11147 (source (origin
4aa0a1df
RW
11148 (method git-fetch)
11149 (uri (git-reference
b0e7b699 11150 (url "https://github.com/zeromq/jeromq")
4aa0a1df
RW
11151 (commit (string-append "v" version))))
11152 (file-name (string-append name "-" version "-checkout"))
217b20e4
JL
11153 (sha256
11154 (base32
594bd3a0
GB
11155 "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj"))
11156 (patches (search-patches "java-jeromq-fix-tests.patch"))))
217b20e4
JL
11157 (build-system ant-build-system)
11158 (arguments
11159 `(#:jar-name "java-jeromq.jar"
11160 #:source-dir "src/main/java"
11161 #:jdk ,icedtea-8
11162 #:test-exclude
11163 (list
11164 "**/Abstract*.java"
11165 ;; Requires network
11166 "**/ZBeaconTest.java"
11167 ;; Failures
4aa0a1df 11168 "**/DealerSpecTest.java"
217b20e4 11169 "**/CustomDecoderTest.java"
594bd3a0
GB
11170 "**/CustomEncoderTest.java"
11171 "**/ConnectRidTest.java"
11172 "**/ReqSpecTest.java"
11173 "**/PushPullSpecTest.java"
11174 "**/PubSubHwmTest.java"
11175 "**/RouterSpecTest.java"
11176 "**/ProxyTest.java")))
217b20e4
JL
11177 (inputs
11178 `(("java-jnacl" ,java-jnacl)))
11179 (native-inputs
11180 `(("java-hamcrest-core" ,java-hamcrest-core)
11181 ("junit" ,java-junit)))
11182 (home-page "http://zeromq.org/bindings:java")
11183 (synopsis "Java binding for 0MQ")
11184 (description "Jeromq provides the java bindings for 0MQ.")
11185 (license license:mpl2.0)))
46c6905a
JL
11186
11187(define-public java-kafka-clients
11188 (package
11189 (name "java-kafka-clients")
11190 (version "1.0.0")
11191 (source (origin
11192 (method url-fetch)
11193 (uri (string-append "mirror://apache/kafka/" version "/kafka-"
11194 version "-src.tgz"))
11195 (sha256
11196 (base32
11197 "1yxmnsmliwm7671q5yy9bl4jdqyyn00n26cggz9brwczx80w1vfq"))))
11198 (build-system ant-build-system)
11199 (arguments
11200 `(#:jar-name "java-kafka-clients.jar"
11201 #:jdk ,icedtea-8
11202 #:source-dir "clients/src/main/java"
11203 #:test-dir "clients/src/test"
11204 #:test-exclude
11205 (list
11206 ;; This file does not contain a class
11207 "**/IntegrationTest.java"
11208 ;; Requires network
11209 "**/ClientUtilsTest.java"
11210 ;; End with errors that seem related to our powermock
11211 "**/KafkaProducerTest.java"
11212 "**/BufferPoolTest.java")))
11213 (inputs
11214 `(("java-slf4j-api" ,java-slf4j-api)
11215 ("java-lz4" ,java-lz4)))
11216 (native-inputs
11217 `(("junit" ,java-junit)
11218 ("hamcrest" ,java-hamcrest-all)
11219 ("objenesis" ,java-objenesis)
11220 ("asm" ,java-asm)
11221 ("cglib" ,java-cglib)
11222 ("javassist" ,java-jboss-javassist)
11223 ("snappy" ,java-snappy)
11224 ("easymock" ,java-easymock)
11225 ("powermock" ,java-powermock-core)
11226 ("powermock-easymock" ,java-powermock-api-easymock)
11227 ("powermock-junit4-common" ,java-powermock-modules-junit4-common)
11228 ("powermock-junit4" ,java-powermock-modules-junit4)
11229 ("powermock-support" ,java-powermock-api-support)
50d70a72 11230 ("java-bouncycastle" ,java-bouncycastle)))
46c6905a
JL
11231 (home-page "https://kafka.apache.org")
11232 (synopsis "Distributed streaming platform")
11233 (description "Kafka is a distributed streaming platform, which means:
11234@itemize
11235@item it can publish and subscribe to streams of records;
11236@item it can store streams of records in a fault-tolerant way;
11237@item it can process streams of records as they occur.
11238@end itemize")
11239 ;; Either cddl or gpl2 only.
11240 (license (list license:cddl1.1; actually cddl1.1
11241 license:gpl2)))); with classpath exception
0b54e190
JL
11242
11243(define-public java-jdom
11244 (package
11245 (name "java-jdom")
11246 (version "1.1.3")
11247 (source (origin
11248 (method url-fetch)
11249 (uri (string-append "http://jdom.org/dist/binary/archive/jdom-"
11250 version ".tar.gz"))
11251 (sha256
11252 (base32
11253 "07wdpm3jwwc9q38kmdw40fvbmv6jzjrkrf8m0zqs58f79a672wfl"))))
11254 (build-system ant-build-system)
11255 (arguments
11256 `(#:build-target "package"
11257 #:tests? #f; tests are run as part of the build process
11258 #:phases
11259 (modify-phases %standard-phases
11260 (replace 'install
11261 (install-jars "build")))))
11262 (home-page "http://jdom.org/")
11263 (synopsis "Access, manipulate, and output XML data")
11264 (description "Java-based solution for accessing, manipulating, and
11265outputting XML data from Java code.")
11266 (license license:bsd-4)))
78745d33
JL
11267
11268(define-public java-geronimo-xbean-reflect
11269 (package
11270 (name "java-geronimo-xbean-reflect")
11271 (version "4.5")
11272 (source (origin
11273 (method svn-fetch)
11274 (uri (svn-reference
11275 (url "https://svn.apache.org/repos/asf/geronimo/xbean/tags/xbean-4.5/")
11276 (revision 1807396)))
11277 (file-name (string-append name "-" version))
11278 (sha256
11279 (base32
11280 "18q3i6jgm6rkw8aysfgihgywrdc5nvijrwnslmi3ww497jvri6ja"))))
11281 (build-system ant-build-system)
11282 (arguments
11283 `(#:jar-name "geronimo-xbean-reflect.jar"
11284 #:source-dir "xbean-reflect/src/main/java"
11285 #:test-dir "xbean-reflect/src/test"
11286 #:jdk ,icedtea-8
11287 #:test-exclude
11288 (list "**/Abstract*.java" "**/AsmParameterNameLoaderTest.java"
11289 "**/ObjectRecipeTest.java" "**/ParameterNameLoaderTest.java"
11290 "**/RecipeHelperTest.java" "**/XbeanAsmParameterNameLoaderTest.java")
11291 #:phases
11292 (modify-phases %standard-phases
11293 (add-before 'build 'fix-source
11294 (lambda _
11295 (let ((dir "xbean-reflect/src/main/java/org/apache/xbean/recipe/"))
11296 ;; org.apache.xbean.asm6 is actually repackaged java-asm
11297 (substitute* (string-append dir "XbeanAsmParameterNameLoader.java")
11298 (("org.apache.xbean.asm5") "org.objectweb.asm"))
02ed96dc
JL
11299 #t)))
11300 (replace 'install (install-from-pom "xbean-reflect/pom.xml")))))
78745d33
JL
11301 (inputs
11302 `(("asm" ,java-asm)
11303 ("log4j" ,java-log4j-api)
11304 ("log4j-1.2" ,java-log4j-1.2-api)
11305 ("log4j-core" ,java-log4j-core)
11306 ("logging" ,java-commons-logging-minimal)))
02ed96dc
JL
11307 (propagated-inputs
11308 `(("java-geronimo-parent-pom" ,java-geronimo-parent-pom)))
78745d33
JL
11309 (native-inputs
11310 `(("junit" ,java-junit)))
11311 (home-page "https://geronimo.apache.org/maven/xbean/3.6/xbean-reflect/")
11312 (synopsis "Dependency injection helper")
11313 (description "Xbean-reflect provides very flexible ways to create objects
11314and graphs of objects for dependency injection frameworks")
11315 (license license:asl2.0)))
09c44196 11316
02ed96dc
JL
11317(define java-geronimo-genesis-2.1
11318 (package
11319 (name "java-geronimo-genesis")
11320 (version "2.1")
11321 (source (origin
11322 (method svn-fetch)
11323 (uri (svn-reference
11324 (url (string-append "https://svn.apache.org/repos/asf/"
11325 "geronimo/genesis/tags/genesis-"
11326 version))
11327 (revision 1807396)))
11328 (file-name (string-append name "-" version "-source"))
11329 (sha256
11330 (base32
11331 "119yn795jvnjf52si84q192s8wag1k013iabg78b7wnadssnnh31"))))
11332 (build-system ant-build-system)
11333 (arguments
11334 `(#:tests? #f
11335 #:phases
11336 (modify-phases %standard-phases
11337 (delete 'configure)
11338 (delete 'build)
11339 (replace 'install
11340 (install-pom-file "pom.xml"))
11341 (add-after 'install 'install-enforcer-rules
11342 (install-pom-file "genesis-enforcer-rules/pom.xml"))
11343 (add-after 'install 'install-flava
11344 (install-pom-file "genesis-default-flava/pom.xml"))
11345 (add-after 'install 'install-packaging
11346 (install-pom-file "genesis-packaging/pom.xml"))
11347 (add-after 'install-flava 'install-flava-java4
11348 (install-pom-file "genesis-default-flava/genesis-java1.4-flava/pom.xml"))
11349 (add-after 'install-flava 'install-flava-java5
11350 (install-pom-file "genesis-default-flava/genesis-java5-flava/pom.xml"))
11351 (add-after 'install-flava 'install-flava-java6
11352 (install-pom-file "genesis-default-flava/genesis-java6-flava/pom.xml")))))
11353 (propagated-inputs
11354 `(("apache-parent-pom" ,apache-parent-pom-13)))
11355 (home-page "https://geronimo.apache.org")
11356 (synopsis "Collection of maven POM files for the Geronimo project")
11357 (description "Apache Geronimo is a server runtime. This package contains
11358only pom files used by other components in the Geronimo project.")
11359 (license license:asl2.0)))
11360
11361(define java-geronimo-parent-pom
11362 (package
11363 (inherit java-geronimo-xbean-reflect)
11364 (name "java-geronimo-parent-pom")
11365 (arguments
11366 `(#:tests? #f
11367 #:phases
11368 (modify-phases %standard-phases
11369 (delete 'configure)
11370 (delete 'build)
11371 (replace 'install
11372 (install-pom-file "pom.xml")))))
11373 (propagated-inputs
11374 `(("java-geronimo-genesis" ,java-geronimo-genesis-2.1)))))
11375
3fda539b
JL
11376(define-public java-geronimo-xbean-bundleutils
11377 (package
11378 (inherit java-geronimo-xbean-reflect)
11379 (name "java-geronimo-xbean-bundleutils")
11380 (arguments
11381 `(#:jar-name "geronimo-xbean-bundleutils.jar"
11382 #:source-dir "xbean-bundleutils/src/main/java"
11383 #:test-dir "xbean-bundleutils/src/test"
11384 #:phases
11385 (modify-phases %standard-phases
11386 (add-before 'build 'fix-java
11387 (lambda _
11388 ;; We use a more recent version of osgi, so this file requires
11389 ;; more interface method implementations.
11390 (substitute* "xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java"
11391 (("import org.osgi.framework.ServiceRegistration;")
11392 "import org.osgi.framework.ServiceRegistration;
11393import org.osgi.framework.ServiceFactory;
11394import java.util.Collection;
11395import org.osgi.framework.ServiceObjects;")
11396 (("public Bundle getBundle\\(\\)")
11397 "@Override
11398public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
11399 throw new UnsupportedOperationException();
11400}
11401@Override
11402public <S> ServiceRegistration<S> registerService(Class<S> clazz,
11403 ServiceFactory<S> factory, Dictionary<String, ?> properties) {
11404 throw new UnsupportedOperationException();
11405}
11406public Bundle getBundle()"))
11407 #t)))))
11408 (inputs
11409 `(("java-slf4j" ,java-slf4j-api)
11410 ("java-asm" ,java-asm)
11411 ("java-osgi-framework" ,java-osgi-framework)
11412 ("java-eclipse-osgi" ,java-eclipse-osgi)
11413 ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)))))
6671d6a1 11414
0cb9ce32
JL
11415(define-public java-geronimo-xbean-asm-util
11416 (package
11417 (inherit java-geronimo-xbean-reflect)
11418 (name "java-geronimo-xbean-asm-util")
11419 (arguments
11420 `(#:jar-name "geronimo-xbean-asm-util.jar"
11421 #:source-dir "xbean-asm-util/src/main/java"
11422 #:tests? #f)); no tests
11423 (inputs
11424 `(("java-asm" ,java-asm)))
11425 (native-inputs '())))
6671d6a1 11426
8d510f65
JL
11427(define-public java-geronimo-xbean-finder
11428 (package
11429 (inherit java-geronimo-xbean-reflect)
11430 (name "java-geronimo-xbean-finder")
11431 (arguments
11432 `(#:jar-name "geronimo-xbean-finder.jar"
11433 #:source-dir "xbean-finder/src/main/java"
11434 #:test-dir "xbean-finder/src/test"))
11435 (inputs
11436 `(("java-slf4j-api" ,java-slf4j-api)
11437 ("java-asm" ,java-asm)
11438 ("java-geronimo-xbean-bundleutils" ,java-geronimo-xbean-bundleutils)
11439 ("java-geronimo-xbean-asm-util" ,java-geronimo-xbean-asm-util)
11440 ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)
11441 ("java-osgi-framework" ,java-osgi-framework)))
11442 (native-inputs
11443 `(("java-junit" ,java-junit)
11444 ("java-hamcrest-core" ,java-hamcrest-core)))))
3fda539b 11445
09c44196
JL
11446(define-public java-gson
11447 (package
11448 (name "java-gson")
11449 (version "2.8.2")
11450 (source (origin
11451 (method url-fetch)
11452 (uri (string-append "https://github.com/google/gson/archive/"
11453 "gson-parent-" version ".tar.gz"))
11454 (sha256
11455 (base32
11456 "1j4qnp7v046q0k48c4kyf69sxaasx2h949d3cqwsm3kzxms3x0f9"))))
11457 (build-system ant-build-system)
11458 (arguments
11459 `(#:jar-name "gson.jar"
11460 #:source-dir "gson/src/main/java"
11461 #:test-dir "gson/src/test"))
11462 (native-inputs
11463 `(("java-junit" ,java-junit)
11464 ("java-hamcrest-core" ,java-hamcrest-core)))
11465 (home-page "https://github.com/google/gson")
11466 (synopsis "Java serialization/deserialization library from/to JSON")
11467 (description "Gson is a Java library that can be used to convert Java
11468Objects into their JSON representation. It can also be used to convert a JSON
11469string to an equivalent Java object. Gson can work with arbitrary Java objects
11470including pre-existing objects that you do not have source-code of.")
11471 (license license:asl2.0)))
335aa20b
JL
11472
11473(define-public java-hawtjni
11474 (package
11475 (name "java-hawtjni")
11476 (version "1.15")
11477 (source (origin
11478 (method url-fetch)
11479 (uri (string-append "https://github.com/fusesource/hawtjni/archive/"
11480 "hawtjni-project-" version ".tar.gz"))
11481 (sha256
11482 (base32
11483 "1bqfd732rmh6svyx17fpw9175gc9gzkcbyps2yyrf50c3zzjas6g"))))
11484 (build-system ant-build-system)
11485 (arguments
11486 `(#:jar-name "hawtjni.jar"
11487 #:source-dir "hawtjni-generator/src/main/java:hawtjni-runtime/src/main/java"
11488 #:tests? #f; no tests
11489 #:phases
11490 (modify-phases %standard-phases
11491 (add-before 'build 'build-native
11492 (lambda* (#:key inputs #:allow-other-keys)
6338ea9a
RW
11493 (let ((include (string-append "-I" (assoc-ref inputs "jdk") "/include/linux")))
11494 (with-directory-excursion "hawtjni-generator/src/main/resources/"
11495 (invoke "gcc" "-c" "hawtjni.c" "-o" "hawtjni.o"
11496 "-fPIC" "-O2" include)
11497 (invoke "gcc" "-c" "hawtjni-callback.c" "-o" "hawtjni-callback.o"
11498 "-fPIC" "-O2" include)
11499 (invoke "gcc" "-o" "libhawtjni.so" "-shared"
11500 "hawtjni.o" "hawtjni-callback.o")))
11501 #t))
335aa20b
JL
11502 (add-after 'install 'install-native
11503 (lambda* (#:key outputs #:allow-other-keys)
11504 (let* ((out (assoc-ref outputs "out"))
11505 (lib (string-append out "/lib"))
11506 (inc (string-append out "/include")))
335aa20b 11507 (with-directory-excursion "hawtjni-generator/src/main/resources/"
6338ea9a
RW
11508 (install-file "libhawtjni.so" lib)
11509 (install-file "hawtjni.h" inc)))
b777e194
JL
11510 #t))
11511 (add-before 'install 'install-parent
11512 (install-pom-file "pom.xml"))
11513 (replace 'install
11514 (install-from-pom "hawtjni-runtime/pom.xml")))))
335aa20b
JL
11515 (inputs
11516 `(("java-commons-cli" ,java-commons-cli)
11517 ("java-asm" ,java-asm)
11518 ("java-geronimo-xbean-finder" ,java-geronimo-xbean-finder)))
11519 (home-page "https://fusesource.github.io/hawtjni/")
11520 (synopsis "JNI code generator")
11521 (description "HawtJNI is a code generator that produces the JNI code needed
11522to implement Java native methods. It is based on the jnigen code generator
11523that is part of the SWT Tools project.")
11524 (license license:asl2.0)))
d0c62afa
JL
11525
11526(define-public java-jansi-native
11527 (package
11528 (name "java-jansi-native")
11529 (version "1.7")
11530 (source (origin
11531 (method url-fetch)
11532 (uri (string-append "https://github.com/fusesource/jansi-native/"
11533 "archive/jansi-native-" version ".tar.gz"))
11534 (sha256
11535 (base32
11536 "0j2ydlgxbzbgshqkwghbxxxnbnx1mmjgd6k5fw6xfvxw1z956yqf"))))
11537 (build-system ant-build-system)
11538 (arguments
11539 `(#:jar-name "jansi-native.jar"
11540 #:source-dir "src/main/java"
11541 #:tests? #f; no tests
11542 #:phases
11543 (modify-phases %standard-phases
11544 (add-before 'build 'build-native
11545 (lambda* (#:key inputs #:allow-other-keys)
11546 ;; there are more required files for windows in windows/
11547 (with-directory-excursion "src/main/native-package/src"
11548 (substitute* "jansi_ttyname.c"
11549 (("#include \"jansi_.*") ""))
e85c1bf6
RW
11550 (invoke "gcc" "-c" "jansi_ttyname.c" "-o" "jansi_ttyname.o"
11551 (string-append "-I" (assoc-ref inputs "java-hawtjni")
11552 "/include")
11553 (string-append "-I" (assoc-ref inputs "jdk")
11554 "/include/linux")
11555 "-fPIC" "-O2")
2c8ac364 11556 (invoke "gcc" "-o" "libjansi.so" "-shared" "jansi_ttyname.o"))))
d0c62afa
JL
11557 (add-before 'build 'install-native
11558 (lambda _
11559 (let ((dir (string-append "build/classes/META-INF/native/"
11560 ,(match (%current-system)
11561 ((or "i686-linux" "armhf-linux")
11562 "linux32")
3c4103c8
LC
11563 ((or "x86_64-linux" "aarch64-linux"
11564 "mips64el-linux")
9820d6ed
JN
11565 "linux64")
11566 (_ "unknown-kernel")))))
d0c62afa
JL
11567 (install-file "src/main/native-package/src/libjansi.so" dir))
11568 #t))
11569 (add-after 'install 'install-native
11570 (lambda* (#:key outputs #:allow-other-keys)
d0c62afa
JL
11571 (install-file "src/main/native-package/src/jansi.h"
11572 (string-append (assoc-ref outputs "out") "/include"))
b777e194
JL
11573 #t))
11574 (add-before 'install 'fix-pom
11575 (lambda _
11576 ;; pom contains variables to complete name, but we don't support that
11577 (substitute* "pom.xml"
11578 (("\\$\\{platform\\}") "native"))
11579 #t))
11580 (replace 'install
11581 (install-from-pom "pom.xml")))))
11582 (propagated-inputs
d0c62afa
JL
11583 `(("java-hawtjni" ,java-hawtjni)))
11584 (home-page "https://fusesource.github.io/jansi/")
11585 (synopsis "Native library for jansi")
3d6925ef
RW
11586 (description "This package provides the native library for jansi, a small
11587Java library that allows you to use ANSI escape sequences to format your
11588console output.")
d0c62afa 11589 (license license:asl2.0)))
a87ea1ad
JL
11590
11591(define-public java-jansi
11592 (package
11593 (name "java-jansi")
11594 (version "1.16")
11595 (source (origin
11596 (method url-fetch)
11597 (uri (string-append "https://github.com/fusesource/jansi/archive/"
11598 "jansi-project-" version ".tar.gz"))
11599 (sha256
11600 (base32
11601 "11kh3144i3fzp21dpy8zg52mjmsr214k7km9p8ly0rqk2px0qq2z"))))
11602 (build-system ant-build-system)
11603 (arguments
11604 `(#:jar-name "jansi.jar"
11605 #:source-dir "jansi/src/main/java"
11606 #:test-dir "jansi/src/test"
11607 #:phases
11608 (modify-phases %standard-phases
11609 (add-after 'check 'clear-term
11610 (lambda _
b777e194
JL
11611 (invoke "echo" "-e" "\\e[0m")))
11612 (add-before 'install 'install-parent
11613 (install-pom-file "pom.xml"))
11614 (add-before 'install 'fix-pom
11615 (lambda _
11616 ;; pom adds jansi native versions for different platforms, but we
11617 ;; only need one, so use native instead
11618 (substitute* "jansi/pom.xml"
11619 (("windows32") "native")
11620 (("windows64") "native")
11621 (("osx") "native")
11622 (("linux32") "native")
11623 (("linux64") "native")
11624 (("freebsd32") "native")
11625 (("freebsd64") "native"))
11626 #t))
11627 (replace 'install
11628 (install-from-pom "jansi/pom.xml")))))
11629 (propagated-inputs
a87ea1ad
JL
11630 `(("java-jansi-native" ,java-jansi-native)))
11631 (native-inputs
11632 `(("java-junit" ,java-junit)
11633 ("java-hamcrest-core" ,java-hamcrest-core)))
11634 (home-page "https://fusesource.github.io/jansi/")
11635 (synopsis "Portable ANSI escape sequences")
11636 (description "Jansi is a Java library that allows you to use ANSI escape
11637sequences to format your console output which works on every platform.")
11638 (license license:asl2.0)))
cc061329
JL
11639
11640(define-public java-jboss-el-api-spec
11641 (package
11642 (name "java-jboss-el-api-spec")
11643 (version "3.0")
11644 (source (origin
11645 (method url-fetch)
11646 (uri (string-append "https://github.com/jboss/jboss-el-api_spec/"
11647 "archive/jboss-el-api_" version
11648 "_spec-1.0.7.Final.tar.gz"))
11649 (sha256
11650 (base32
11651 "1j45ljxalwlibxl7g7iv952sjxkw275m8vyxxij8l6wdd5pf0pdh"))))
11652 (build-system ant-build-system)
11653 (arguments
11654 `(#:jar-name "java-jboss-el-api_spec.jar"
51087d51
JL
11655 #:modules ((guix build ant-build-system)
11656 (guix build utils)
11657 (guix build maven pom)
11658 (guix build java-utils)
11659 (sxml simple))
11660 #:phases
11661 (modify-phases %standard-phases
11662 ;; the origin of javax.el:javax.el-api is unknown, so we use this package
11663 ;; instead, which implements the same thing. We override the pom file
11664 ;; to "rename" the package so it can be found by maven.
11665 (add-before 'install 'override-pom
11666 (lambda _
11667 (delete-file "pom.xml")
11668 (with-output-to-file "pom.xml"
11669 (lambda _
11670 (sxml->xml
11671 `(project
11672 (modelVersion "4.0.0")
11673 (name "el-api")
11674 (groupId "javax.el")
11675 (artifactId "javax.el-api")
11676 (version "3.0")))))
11677 #t))
11678 (replace 'install
11679 (install-from-pom "pom.xml")))))
cc061329
JL
11680 (inputs
11681 `(("java-junit" ,java-junit)))
11682 (home-page "https://github.com/jboss/jboss-el-api_spec")
11683 (synopsis "JSR-341 expression language 3.0 API")
11684 (description "This package contains an implementation of the JSR-341
11685specification for the expression language 3.0. It implements an expression
11686language inspired by ECMAScript and XPath. This language is used with
11687JavaServer Pages (JSP).")
11688 ;; Either GPL2 only or CDDL.
11689 (license (list license:gpl2 license:cddl1.1))))
cc03a786
JL
11690
11691(define-public java-jboss-interceptors-api-spec
11692 (package
11693 (name "java-jboss-interceptors-api-spec")
11694 (version "1.2")
11695 (source (origin
11696 (method url-fetch)
11697 (uri (string-append "https://github.com/jboss/jboss-interceptors-api_spec/"
11698 "archive/jboss-interceptors-api_" version
11699 "_spec-1.0.0.Final.tar.gz"))
11700 (sha256
11701 (base32
11702 "0wv8x0jp9a5qxlrgkhb5jdk2gr6vi87b4j4kjb8ryxiy9gn8g51z"))))
11703 (build-system ant-build-system)
11704 (arguments
11705 `(#:jar-name "java-jboss-interceptors-api_spec.jar"
11706 #:jdk ,icedtea-8
11707 #:source-dir "."
51087d51
JL
11708 #:tests? #f; no tests
11709 #:modules ((guix build ant-build-system)
11710 (guix build utils)
11711 (guix build maven pom)
11712 (guix build java-utils)
11713 (sxml simple))
11714 #:phases
11715 (modify-phases %standard-phases
11716 ;; the origin of javax.interceptor:javax.interceptor-api is unknown,
11717 ;; so we use this package instead, which implements the same thing.
11718 ;; We override the pom file to "rename" the package so it can be found
11719 ;; by maven.
11720 (add-before 'install 'override-pom
11721 (lambda _
11722 (delete-file "pom.xml")
11723 (with-output-to-file "pom.xml"
11724 (lambda _
11725 (sxml->xml
11726 `(project
11727 (modelVersion "4.0.0")
11728 (name "interceptor-api")
11729 (groupId "javax.interceptor")
11730 (artifactId "javax.interceptor-api")
11731 (version "3.0")))))
11732 #t))
11733 (replace 'install
11734 (install-from-pom "pom.xml")))))
cc03a786
JL
11735 (home-page "https://github.com/jboss/jboss-interceptors-api_spec")
11736 (synopsis "Interceptors 1.2 API classes from JSR 318")
11737 (description "Java-jboss-interceptors-api-spec implements the Interceptors
11738API. Interceptors are used to interpose on business method invocations and
11739specific events.")
11740 ;; Either GPL2 only or CDDL.
11741 (license (list license:gpl2 license:cddl1.1))))
a10a451c
JL
11742
11743(define-public java-cdi-api
11744 (package
11745 (name "java-cdi-api")
11746 (version "2.0")
11747 (source (origin
11748 (method url-fetch)
11749 (uri (string-append "https://github.com/cdi-spec/cdi/archive/"
11750 version ".tar.gz"))
11751 (file-name (string-append name "-" version ".tar.gz"))
11752 (sha256
11753 (base32
11754 "1iv8b8bp07c5kmqic14jsr868vycjv4qv02lf3pkgp9z21mnfg5y"))))
11755 (build-system ant-build-system)
11756 (arguments
11757 `(#:source-dir "api/src/main/java"
11758 #:jar-name "java-cdi-api.jar"
11759 #:test-dir "api/src/test"
11760 #:jdk ,icedtea-8
51087d51
JL
11761 #:tests? #f; Tests fail because we don't have a CDI provider yet
11762 #:phases
11763 (modify-phases %standard-phases
11764 (replace 'install
11765 (install-from-pom "api/pom.xml")))))
11766 (propagated-inputs
a10a451c
JL
11767 `(("java-javax-inject" ,java-javax-inject)
11768 ("java-jboss-el-api-spec" ,java-jboss-el-api-spec)
51087d51
JL
11769 ("java-jboss-interceptors-api-spec" ,java-jboss-interceptors-api-spec)
11770 ("java-weld-parent-pom" ,java-weld-parent-pom)))
a10a451c
JL
11771 (native-inputs
11772 `(("java-testng" ,java-testng)
11773 ("java-hamcrest-core" ,java-hamcrest-core)))
11774 (home-page "http://cdi-spec.org/")
11775 (synopsis "Contexts and Dependency Injection APIs")
11776 (description "Java-cdi-api contains the required APIs for Contexts and
11777Dependency Injection (CDI).")
11778 (license license:asl2.0)))
d57fd728
JL
11779
11780(define-public java-joda-convert
11781 (package
11782 (name "java-joda-convert")
11783 (version "1.9.2")
11784 (source (origin
11785 (method url-fetch)
11786 (uri (string-append "https://github.com/JodaOrg/joda-convert/archive/v"
11787 version ".tar.gz"))
11788 (file-name (string-append name "-" version ".tar.gz"))
11789 (sha256
11790 (base32
11791 "0vp346xz7dh9br4q7xazhc7hvzf76a6hf95fki9bg67q5jr0kjh7"))))
11792 (build-system ant-build-system)
11793 (arguments
11794 `(#:jar-name (string-append ,name "-" ,version ".jar")
11795 #:source-dir "src/main/java"
11796 #:test-include (list "**/Test*.java")
11797 ;; Contains only interfaces and base classes (no test)
11798 #:test-exclude (list "**/test*/**.java")))
11799 (inputs
11800 `(("java-guava" ,java-guava)))
11801 (native-inputs
11802 `(("java-junit" ,java-junit)
11803 ("java-hamcrest-core" ,java-hamcrest-core)))
c82ddf33 11804 (home-page "https://www.joda.org/joda-convert/")
d57fd728
JL
11805 (synopsis "Conversion between Objects and Strings")
11806 (description "Joda-Convert provides a small set of classes to aid
11807conversion between Objects and Strings. It is not intended to tackle the
11808wider problem of Object to Object transformation.")
11809 (license license:asl2.0)))
0158ea8a
JL
11810
11811(define-public java-joda-time
11812 (package
11813 (name "java-joda-time")
11814 (version "2.9.9")
11815 (source (origin
11816 (method url-fetch)
11817 (uri (string-append "https://github.com/JodaOrg/joda-time/archive/v"
11818 version ".tar.gz"))
11819 (file-name (string-append name "-" version ".tar.gz"))
11820 (sha256
11821 (base32
11822 "1i9x91mi7yg2pasl0k3912f1pg46n37sps6rdb0v1gs8hj9ppwc1"))))
11823 (build-system ant-build-system)
11824 (arguments
11825 `(#:jar-name "java-joda-time.jar"
11826 #:source-dir "src/main/java"
11827 #:test-include (list "**/Test*.java")
11828 ;; There is no runnable test in these files
11829 #:test-exclude (list "**/Test*Chronology.java" "**/Test*Field.java")
11830 #:phases
11831 (modify-phases %standard-phases
11832 (add-after 'build 'build-resources
11833 (lambda _
11834 (mkdir-p "build/classes/org/joda/time/tz/data")
11835 (mkdir-p "build/classes/org/joda/time/format")
6d0368eb
JL
11836 ;; This will produce the following exception:
11837 ;; java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap"
11838 ;; which is normal, because it doesn't exist yet. It still generates
11839 ;; the same file as in the binary one can find on maven.
11840 (invoke "java" "-cp"
11841 (string-append "build/classes:" (getenv "CLASSPATH"))
11842 "org.joda.time.tz.ZoneInfoCompiler"
11843 "-src" "src/main/java/org/joda/time/tz/src"
11844 "-dst" "build/classes/org/joda/time/tz/data"
11845 "africa" "antarctica" "asia" "australasia"
11846 "europe" "northamerica" "southamerica"
11847 "pacificnew" "etcetera" "backward" "systemv")
0158ea8a
JL
11848 (for-each (lambda (f)
11849 (copy-file f (string-append
11850 "build/classes/org/joda/time/format/"
11851 (basename f))))
11852 (find-files "src/main/java/org/joda/time/format" ".*.properties"))
11853 #t))
11854 (add-before 'install 'regenerate-jar
11855 (lambda _
11856 ;; We need to regenerate the jar file to add generated data.
11857 (delete-file "build/jar/java-joda-time.jar")
6d0368eb 11858 (invoke "ant" "jar")))
0158ea8a
JL
11859 (add-before 'check 'copy-test-resources
11860 (lambda _
11861 (mkdir-p "build/test-classes/org/joda/time/tz/data")
11862 (copy-file "src/test/resources/tzdata/ZoneInfoMap"
11863 "build/test-classes/org/joda/time/tz/data/ZoneInfoMap")
11864 (copy-recursively "src/test/resources" "build/test-classes")
11865 #t)))))
11866 (inputs
11867 `(("java-joda-convert" ,java-joda-convert)))
11868 (native-inputs
11869 `(("java-junit" ,java-junit)
11870 ("java-hamcrest-core" ,java-hamcrest-core)
11871 ("tzdata" ,tzdata)))
14544d2f 11872 (home-page "https://www.joda.org/joda-time/")
0158ea8a
JL
11873 (synopsis "Replacement for the Java date and time classes")
11874 (description "Joda-Time is a replacement for the Java date and time
11875classes prior to Java SE 8.")
11876 (license license:asl2.0)))
6d0368eb
JL
11877
11878(define-public java-xerces
11879 (package
11880 (name "java-xerces")
695fb93e 11881 (version "2.12.1")
6d0368eb
JL
11882 (source
11883 (origin
11884 (method url-fetch)
11885 (uri (string-append "mirror://apache/xerces/j/source/"
11886 "Xerces-J-src." version ".tar.gz"))
11887 (sha256
695fb93e 11888 (base32 "0494kq36gw3nah19ifb720vwxbpg4ww0k6m3zq6wyanw6a083p6s"))
6d0368eb
JL
11889 (patches (search-patches
11890 "java-xerces-xjavac_taskdef.patch"
11891 "java-xerces-build_dont_unzip.patch"
11892 "java-xerces-bootclasspath.patch"))))
11893 (build-system ant-build-system)
11894 (arguments
11895 `(#:tests? #f;; Test files are not present
11896 #:test-target "test"
11897 #:jdk ,icedtea-8
11898 #:phases
11899 (modify-phases %standard-phases
11900 (add-after 'unpack 'create-build.properties
11901 (lambda* (#:key inputs #:allow-other-keys)
11902 (let ((jaxp (assoc-ref inputs "java-jaxp"))
11903 (resolver (assoc-ref inputs "java-apache-xml-commons-resolver")))
11904 (with-output-to-file "build.properties"
11905 (lambda _
11906 (format #t
11907 "jar.jaxp = ~a/share/java/jaxp.jar~@
11908 jar.apis-ext = ~a/share/java/jaxp.jar~@
11909 jar.resolver = ~a/share/java/xml-resolver.jar~%"
11910 jaxp jaxp resolver)))
11911 ;; Make xerces use our version of jaxp in tests
11912 (substitute* "build.xml"
11913 (("xml-apis.jar")
11914 (string-append jaxp "/share/java/jaxp.jar"))
11915 (("\\$\\{tools.dir\\}/\\$\\{jar.apis\\}")
11916 "${jar.apis}")))
11917 #t))
11918 (replace 'install (install-jars "build")))))
11919 (inputs
11920 `(("java-apache-xml-commons-resolver" ,java-apache-xml-commons-resolver)
11921 ("java-jaxp" ,java-jaxp)))
11922 (home-page "https://xerces.apache.org/xerces2-j/")
11923 (synopsis "Validating XML parser for Java with DOM level 3 support")
11924 (description "The Xerces2 Java parser is the reference implementation of
11925XNI, the Xerces Native Interface, and also a fully conforming XML Schema
11926processor.
11927
11928Xerces2-J supports the following standards and APIs:
11929
11930@itemize
11931@item eXtensible Markup Language (XML) 1.0 Second Edition Recommendation
11932@item Namespaces in XML Recommendation
11933@item Document Object Model (DOM) Level 2 Core, Events, and Traversal and
11934 Range Recommendations
11935@item Simple API for XML (SAX) 2.0.1 Core and Extension
11936@item Java APIs for XML Processing (JAXP) 1.2.01
11937@item XML Schema 1.0 Structures and Datatypes Recommendations
11938@item Experimental implementation of the Document Object Model (DOM) Level 3
11939 Core and Load/Save Working Drafts
11940@item Provides a partial implementation of the XML Inclusions (XInclude) W3C
11941 Candidate Recommendation
11942@end itemize
11943
11944Xerces is now able to parse documents written according to the XML 1.1
11945Candidate Recommendation, except that it does not yet provide an option to
11946enable normalization checking as described in section 2.13 of this
11947specification. It also handles namespaces according to the XML Namespaces 1.1
11948Candidate Recommendation, and will correctly serialize XML 1.1 documents if
11949the DOM level 3 load/save API's are in use.")
11950 (license license:asl2.0)))
e06bf428 11951
ae6922ed
DM
11952(define-public java-jakarta-regexp
11953 (package
11954 (name "java-jakarta-regexp")
11955 (version "1.5")
11956 (source
11957 (origin
11958 (method url-fetch)
11959 (uri (string-append
11960 "https://archive.apache.org/dist/jakarta/regexp/jakarta-regexp-"
11961 version ".tar.gz"))
11962 (sha256
11963 (base32
11964 "0zg9rmyif48dck0cv6ynpxv23mmcsx265am1fnnxss7brgw0ms3r"))))
11965 (build-system ant-build-system)
11966 (arguments
11967 `(#:test-target "test"
11968 #:phases
11969 (modify-phases %standard-phases
11970 (replace 'install
11971 (lambda* (#:key outputs #:allow-other-keys)
11972 (let* ((out (assoc-ref outputs "out"))
11973 (out-share (string-append out "/share/java")))
11974 (mkdir-p out-share)
11975 (for-each (lambda (name)
11976 (install-file name out-share))
11977 (find-files "build" "^jakarta-regexp-.*\\.jar$"))
11978 #t))))))
11979 (home-page "https://attic.apache.org/projects/jakarta-regexp.html")
11980 (synopsis "Regular expression parser generator for Java.")
11981 (description "@code{jakarta-regexp} is an old regular expression parser
11982generator for Java.")
11983 (license license:asl2.0)))
11984
e06bf428
JL
11985(define-public java-jline
11986 (package
11987 (name "java-jline")
11988 (version "1.0")
11989 (source (origin
11990 (method url-fetch)
11991 (uri (string-append "https://github.com/jline/jline1/archive/jline-"
11992 version ".tar.gz"))
11993 (sha256
11994 (base32
11995 "0bi3p6vrh7a6v0fbpb6rx9plpmx5zk3lr352xzdbz2jcxg499wir"))))
11996 (build-system ant-build-system)
11997 (arguments
11998 `(#:jar-name "jline.jar"
11999 #:source-dir "src/main/java"
12000 #:test-dir "src/test"
12001 #:phases
12002 (modify-phases %standard-phases
12003 (add-before 'build 'copy-resources
12004 (lambda _
12005 (copy-recursively "src/main/resources" "build/classes")
12006 #t)))))
12007 (native-inputs
12008 `(("java-junit" ,java-junit)))
12009 (home-page "https://jline.github.io")
12010 (synopsis "Console input handling library")
12011 (description "JLine is a Java library for handling console input. It is
12012similar in functionality to BSD editline and GNU readline but with additional
12013features that bring it on par with the Z shell line editor.")
12014 (license license:bsd-3)))
7ac4f054 12015
49d74311
JL
12016(define-public java-jline-2
12017 (package
12018 (inherit java-jline)
12019 (version "2.14.5")
12020 (source (origin
12021 (method url-fetch)
12022 (uri (string-append "https://github.com/jline/jline2/archive/jline-"
12023 version ".tar.gz"))
12024 (sha256
12025 (base32
12026 "1c6qa26mf0viw8hg4jnv72s7i1qb1gh1l8rrzcdvqhqhx82rkdlf"))))
12027 (arguments
12028 `(#:jdk ,icedtea-8
12029 ,@(package-arguments java-jline)))
12030 (inputs
12031 `(("java-jansi" ,java-jansi)
12032 ("java-jansi-native" ,java-jansi-native)))
12033 (native-inputs
12034 `(("java-powermock-modules-junit4" ,java-powermock-modules-junit4)
12035 ("java-powermock-modules-junit4-common" ,java-powermock-modules-junit4-common)
12036 ("java-powermock-api-easymock" ,java-powermock-api-easymock)
12037 ("java-powermock-api-support" ,java-powermock-api-support)
12038 ("java-powermock-core" ,java-powermock-core)
12039 ("java-powermock-reflect" ,java-powermock-reflect)
12040 ("java-easymock" ,java-easymock)
12041 ("java-jboss-javassist" ,java-jboss-javassist)
12042 ("java-objenesis" ,java-objenesis)
12043 ("java-asm" ,java-asm)
12044 ("java-hamcrest-core" ,java-hamcrest-core)
12045 ("java-cglib" ,java-cglib)
12046 ("java-junit" ,java-junit)
12047 ("java-hawtjni" ,java-hawtjni)))))
12048
7ac4f054
JL
12049(define-public java-xmlunit
12050 (package
12051 (name "java-xmlunit")
12052 (version "2.5.1")
12053 (source (origin
12054 (method url-fetch)
12055 (uri (string-append "https://github.com/xmlunit/xmlunit/archive/v"
12056 version ".tar.gz"))
12057 (file-name (string-append name "-" version ".tar.gz"))
12058 (sha256
12059 (base32
12060 "035rivlnmwhfqj0fzviciv0bkh1h95ps1iwnh2kjcvdbk5nccm4z"))))
12061 (build-system ant-build-system)
12062 (arguments
12063 `(#:jar-name "java-xmlunit.jar"
12064 #:source-dir "xmlunit-core/src/main/java"
12065 #:test-dir "xmlunit-core/src/test"
12066 #:phases
12067 (modify-phases %standard-phases
12068 (add-before 'check 'copy-test-resources
12069 (lambda* (#:key inputs #:allow-other-keys)
12070 (copy-recursively (assoc-ref inputs "resources") "../test-resources")
12071 #t)))))
12072 (native-inputs
12073 `(("java-junit" ,java-junit)
12074 ("java-mockito-1" ,java-mockito-1)
12075 ("java-hamcrest-all" ,java-hamcrest-all)
12076 ("java-objenesis" ,java-objenesis)
12077 ("java-asm" ,java-asm)
12078 ("java-cglib" ,java-cglib)
12079 ("resources"
12080 ,(origin
12081 (method git-fetch)
12082 (uri (git-reference
b0e7b699 12083 (url "https://github.com/xmlunit/test-resources")
7ac4f054
JL
12084 (commit "a590d2ae865c3e0455691d76ba8eefccc2215aec")))
12085 (file-name "java-xmlunit-test-resources")
12086 (sha256
12087 (base32
12088 "0r0glj37pg5l868yjz78gckr91cs8fysxxbp9p328dssssi91agr"))))))
c4944d6c 12089 (home-page "https://www.xmlunit.org/")
7ac4f054
JL
12090 (synopsis "XML output testing")
12091 (description "XMLUnit provides you with the tools to verify the XML you
12092emit is the one you want to create. It provides helpers to validate against
12093an XML Schema, assert the values of XPath queries or compare XML documents
12094against expected outcomes.")
12095 (license license:asl2.0)))
73a1f10a
JL
12096
12097(define-public java-xmlunit-legacy
12098 (package
12099 (inherit java-xmlunit)
12100 (name "java-xmlunit-legacy")
12101 (arguments
12102 `(#:jar-name "java-xmlunit-legacy.jar"
12103 #:source-dir "xmlunit-legacy/src/main/java"
12104 #:test-dir "xmlunit-legacy/src/test"))
12105 (inputs
12106 `(("java-xmlunit" ,java-xmlunit)
12107 ("java-junit" ,java-junit)))
12108 (native-inputs
12109 `(("java-mockito-1" ,java-mockito-1)))))
93abc975 12110
f5cc5ead
JL
12111(define-public java-xmlunit-matchers
12112 (package
12113 (inherit java-xmlunit)
12114 (name "java-xmlunit-matchers")
12115 (arguments
12116 `(#:jar-name "java-xmlunit-matchers.jar"
12117 #:source-dir "xmlunit-matchers/src/main/java"
12118 #:test-dir "xmlunit-matchers/src/test"
12119 #:test-exclude
12120 ;; Cannot open xsd for http://www.xmlunit.org/test-support/Book.xsd
12121 (list "**/ValidationMatcherTest.java")
12122 #:phases
12123 (modify-phases %standard-phases
12124 (add-before 'build 'copy-test-class
12125 (lambda _
12126 (copy-file "xmlunit-core/src/test/java/org/xmlunit/TestResources.java"
12127 "xmlunit-matchers/src/test/java/org/xmlunit/TestResources.java")
12128 #t))
12129 (add-before 'build 'fix-test-resources-path
12130 (lambda _
12131 (substitute* (find-files "xmlunit-matchers/src/test" ".*.java")
12132 (("../test-resources") "test-resources"))
12133 #t))
12134 (add-before 'check 'copy-test-resources
12135 (lambda* (#:key inputs #:allow-other-keys)
12136 (copy-recursively (assoc-ref inputs "resources") "test-resources")
12137 #t)))))
12138 (inputs
12139 `(("java-xmlunit" ,java-xmlunit)
12140 ("java-junit" ,java-junit)))))
12141
93abc975
RW
12142(define-public java-openchart2
12143 (package
12144 (name "java-openchart2")
12145 (version "1.4.3")
12146 (source (origin
12147 (method url-fetch)
12148 (uri (string-append "http://download.approximatrix.com/openchart2/"
12149 "openchart2-" version ".source.zip"))
12150 (sha256
12151 (base32
12152 "1xq96zm5r02n1blja0072jmmsifmxc40lbyfbnmcnr6mw42frh4g"))))
12153 (build-system ant-build-system)
12154 (arguments
12155 `(#:test-target "test"
12156 #:phases
12157 (modify-phases %standard-phases
12158 (add-after 'unpack 'fix-junit-errors
12159 (lambda _
12160 (with-directory-excursion "unittest/src/com/approximatrix/charting/"
12161 (substitute* '("coordsystem/ticklocator/NumericXTickLocatorTest.java"
12162 "coordsystem/ticklocator/NumericYTickLocatorTest.java"
12163 "coordsystem/ticklocator/ObjectXTickLocatorTest.java"
12164 "model/DefaultChartDataModelConstraintsTest.java"
12165 "model/MultiScatterDataModelConstraintsTest.java"
12166 "model/threedimensional/DotPlotDataModelConstraintsTest.java")
12167 (("(assertEquals[^;]+);" before _)
12168 (string-append (string-drop-right before 2) ", 1E-6);"))))
12169 #t))
12170 (replace 'install (install-jars ".")))))
12171 (native-inputs
12172 `(("unzip" ,unzip)
12173 ("java-junit" ,java-junit)
12174 ("java-hamcrest-core" ,java-hamcrest-core)))
a809d632 12175 (home-page "https://approximatrix.com/products/openchart2/")
93abc975
RW
12176 (synopsis "Simple plotting for Java")
12177 (description "Openchart2 provides a simple, yet powerful, interface for
12178Java programmers to create two-dimensional charts and plots. The library
12179features an assortment of graph styles, including advanced scatter plots, bar
12180graphs, and pie charts.")
12181 (license license:lgpl2.1+)))
5f5b31c6
JL
12182
12183(define-public java-commons-httpclient
12184 (package
12185 (name "java-commons-httpclient")
12186 (version "3.1")
12187 (source (origin
12188 (method url-fetch)
9a01efa2 12189 (uri (string-append "mirror://apache/httpcomponents/"
5f5b31c6
JL
12190 "commons-httpclient/source/commons-httpclient-"
12191 version "-src.tar.gz"))
12192 (sha256
12193 (base32
12194 "1wlpn3cfy3d4inxy6g7wxcsa8p7sshn6aldk9y4ia3lb879rd97r"))))
12195 (build-system ant-build-system)
12196 (arguments
12197 `(#:build-target "compile"
12198 #:test-target "test"
12199 #:tests? #f; requires junit-textui (junit 3)
12200 #:phases
12201 (modify-phases %standard-phases
12202 (add-before 'build 'fix-accent
12203 (lambda _
12204 (for-each (lambda (file)
12205 (with-fluids ((%default-port-encoding "ISO-8859-1"))
12206 (substitute* file
12207 (("\\* @author Ortwin .*") "* @author Ortwin Glueck\n"))))
12208 '("src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java"
12209 "src/examples/TrivialApp.java" "src/examples/ClientApp.java"
12210 "src/test/org/apache/commons/httpclient/TestHttps.java"
2c8ac364
MW
12211 "src/test/org/apache/commons/httpclient/TestURIUtil2.java"))
12212 #t))
5f5b31c6
JL
12213 (replace 'install
12214 (lambda* (#:key outputs #:allow-other-keys)
12215 (invoke "ant" "dist"
12216 (string-append "-Ddist.home=" (assoc-ref outputs "out")
12217 "/share/java"))
12218 #t)))))
12219 (propagated-inputs
12220 `(("java-commons-logging" ,java-commons-logging-minimal)
12221 ("java-commons-codec" ,java-commons-codec)))
12222 (home-page "https://hc.apache.org")
12223 (synopsis "HTTP/1.1 compliant HTTP agent implementation")
12224 (description "This package contains an HTTP/1.1 compliant HTTP agent
12225implementation. It also provides reusable components for client-side
12226authentication, HTTP state management, and HTTP connection management.")
12227 (license license:asl2.0)))
5fe981dc
JL
12228
12229(define-public java-commons-vfs
12230 (package
12231 (name "java-commons-vfs")
12232 (version "2.2")
12233 (source (origin
12234 (method url-fetch)
12235 (uri (string-append "mirror://apache/commons/vfs/source/"
12236 "commons-vfs2-distribution-" version "-src.tar.gz"))
12237 (file-name (string-append name "-" version ".tar.gz"))
12238 (sha256
12239 (base32
12240 "1cnq1iaghbp4cslpnvwbp83i5v234x87irssqynhwpfgw7caf1s3"))
12241 (modules '((guix build utils)))
12242 (snippet
12243 '(begin
12244 (for-each delete-file
12245 (find-files "." "\\.jar$"))
12246 #t))))
12247 (build-system ant-build-system)
12248 (arguments
12249 `(#:jar-name "commons-vfs.jar"
12250 #:source-dir "commons-vfs2/src/main/java"
12251 #:test-dir "commons-vfs2/src/test"
12252 ; FIXME: tests depend on many things: apache sshd, hadoop, ftpserver, ...
12253 #:tests? #f
12254 #:phases
12255 (modify-phases %standard-phases
12256 (add-before 'build 'remove-hadoop-and-webdav
12257 ; Remove these files as they are not required and depend on difficult
12258 ; packages.
12259 (lambda _
12260 (for-each delete-file-recursively
12261 '("commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/webdav"
2c8ac364
MW
12262 "commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs"))
12263 #t)))))
5fe981dc
JL
12264 (inputs
12265 `(("java-commons-collections4" ,java-commons-collections4)
12266 ("java-commons-compress" ,java-commons-compress)
12267 ("java-commons-httpclient" ,java-commons-httpclient)
12268 ("java-commons-logging-minimal" ,java-commons-logging-minimal)
12269 ("java-commons-net" ,java-commons-net)
12270 ("java-jsch" ,java-jsch)))
4f236f84 12271 (home-page "https://commons.apache.org/proper/commons-vfs/")
52beae7b 12272 (synopsis "Java file system library")
5fe981dc
JL
12273 (description "Commons VFS provides a single API for accessing various
12274different file systems. It presents a uniform view of the files from various
12275different sources, such as the files on local disk, on an HTTP server, or
12276inside a Zip archive.")
12277 (license license:asl2.0)))
f7b512c0
JL
12278
12279(define-public java-jakarta-oro
12280 (package
12281 (name "java-jakarta-oro")
12282 (version "2.0.8")
12283 (source (origin
12284 (method url-fetch)
9a01efa2 12285 (uri (string-append "mirror://apache/jakarta/oro/"
f7b512c0
JL
12286 "jakarta-oro-" version ".tar.gz"))
12287 (sha256
12288 (base32
12289 "0rpmnsskiwmsy8r0sckz5n5dbvh3vkxx8hpm177c754r8xy3qksc"))
12290 (modules '((guix build utils)))
12291 (snippet
12292 `(begin
12293 (delete-file (string-append "jakarta-oro-" ,version ".jar"))
12294 #t))))
12295 (build-system ant-build-system)
12296 (arguments
12297 `(#:build-target "package"
c1b11a52 12298 #:make-flags (list "-DDATE" "(no recorded date for reproducibility)")
f7b512c0
JL
12299 #:tests? #f; tests are run as part of the build process
12300 #:phases
12301 (modify-phases %standard-phases
12302 (replace 'install
12303 (install-jars ,(string-append "jakarta-oro-" version))))))
12304 (home-page "https://jakarta.apache.org/oro/")
12305 (synopsis "Text-processing for Java")
12306 (description "The Jakarta-ORO Java classes are a set of text-processing
12307Java classes that provide Perl5 compatible regular expressions, AWK-like
12308regular expressions, glob expressions, and utility classes for performing
12309substitutions, splits, filtering filenames, etc. This library is the successor
12310of the OROMatcher, AwkTools, PerlTools, and TextTools libraries originally
12311from ORO, Inc.")
12312 (license license:asl1.1)))
a970288c
JL
12313
12314(define-public java-native-access
12315 (package
12316 (name "java-native-access")
12317 (version "4.5.1")
12318 (source (origin
12319 (method url-fetch)
12320 (uri (string-append "https://github.com/java-native-access/jna/"
12321 "archive/" version ".tar.gz"))
12322 (file-name (string-append name "-" version ".tar.gz"))
12323 (sha256
12324 (base32
12325 "0zrpzkib6b905i018a9pqlzkqinphywr6y4jwv6mwp63jjqvqkd9"))
12326 (modules '((guix build utils)))
12327 (snippet
12328 `(begin
12329 (for-each delete-file (find-files "." ".*.jar"))
12330 (delete-file-recursively "native/libffi")
12331 (delete-file-recursively "dist")
12332 #t))))
12333 (build-system ant-build-system)
12334 (arguments
12335 `(#:tests? #f; FIXME: tests require reflections.jar
12336 #:test-target "test"
12337 #:make-flags (list "-Ddynlink.native=true")
12338 #:phases
12339 (modify-phases %standard-phases
12340 (add-before 'build 'fix-build.xml
12341 (lambda* (#:key inputs #:allow-other-keys)
12342 (substitute* "build.xml"
12343 ;; Since we removed the bundled ant.jar, give the correct path
12344 (("lib/ant.jar") (string-append (assoc-ref inputs "ant") "/lib/ant.jar"))
12345 ;; We removed generated native libraries. We can only rebuild one
12346 ;; so don't fail if we can't find a native library for another architecture.
12347 (("zipfileset") "zipfileset erroronmissingarchive=\"false\""))
12348 ;; Copy test dependencies
fff4fcc4 12349 (copy-file (car (find-files (assoc-ref inputs "java-junit") "jar$"))
a970288c 12350 "lib/junit.jar")
fff4fcc4
JL
12351 (copy-file (car (find-files (assoc-ref inputs "java-hamcrest-core")
12352 "jar$"))
a970288c
JL
12353 "lib/hamcrest-core.jar")
12354 ;; FIXME: once reflections.jar is built, copy it to lib/test.
12355 #t))
12356 (add-before 'build 'build-native
12357 (lambda _
12358 (invoke "ant" "-Ddynlink.native=true" "native")
12359 #t))
12360 (replace 'install
12361 (install-jars "build")))))
12362 (inputs
12363 `(("libffi" ,libffi)
12364 ("libx11" ,libx11)
12365 ("libxt" ,libxt)))
12366 (native-inputs
12367 `(("java-junit" ,java-junit)
12368 ("java-hamcrest-core" ,java-hamcrest-core)))
12369 (home-page "https://github.com/java-native-access/jna")
12370 (synopsis "Access to native shared libraries from Java")
12371 (description "JNA provides Java programs easy access to native shared
12372libraries without writing anything but Java code - no JNI or native code is
12373required. JNA allows you to call directly into native functions using natural
12374Java method invocation.")
12375 ;; Java Native Access project (JNA) is dual-licensed under 2
12376 ;; alternative Free licenses: LGPL 2.1 or later and Apache License 2.0.
12377 (license (list
12378 license:asl2.0
12379 license:lgpl2.1+))))
cfb55cfc
JL
12380
12381(define-public java-native-access-platform
12382 (package
12383 (inherit java-native-access)
12384 (name "java-native-access-platform")
12385 (arguments
12386 `(#:test-target "test"
12387 #:tests? #f; require jna-test.jar
12388 #:phases
12389 (modify-phases %standard-phases
12390 (add-before 'build 'chdir
12391 (lambda _
12392 (chdir "contrib/platform")
12393 #t))
12394 (add-after 'chdir 'fix-ant
12395 (lambda* (#:key inputs #:allow-other-keys)
12396 (substitute* "nbproject/project.properties"
12397 (("../../build/jna.jar")
12398 (string-append (assoc-ref inputs "java-native-access")
12399 "/share/java/jna.jar"))
12400 (("../../lib/hamcrest-core-.*.jar")
fff4fcc4
JL
12401 (car (find-files (assoc-ref inputs "java-hamcrest-core")
12402 "jar$")))
cfb55cfc 12403 (("../../lib/junit.jar")
fff4fcc4
JL
12404 (car (find-files (assoc-ref inputs "java-junit")
12405 "jar$"))))
cfb55cfc
JL
12406 #t))
12407 (replace 'install
12408 (install-jars "dist")))))
12409 (inputs
12410 `(("java-native-access" ,java-native-access)))
12411 (synopsis "Cross-platform mappings for jna")
7230f6d5 12412 (description "java-native-access-platform has cross-platform mappings
cfb55cfc
JL
12413and mappings for a number of commonly used platform functions, including a
12414large number of Win32 mappings as well as a set of utility classes that
12415simplify native access.")))
470674a5
JL
12416
12417(define-public java-jsch-agentproxy-core
12418 (package
12419 (name "java-jsch-agentproxy-core")
12420 (version "0.0.8")
12421 (source (origin
12422 (method url-fetch)
12423 (uri (string-append "https://github.com/ymnk/jsch-agent-proxy/archive/"
12424 version ".tar.gz"))
12425 (file-name (string-append name "-" version ".tar.gz"))
12426 (sha256
12427 (base32
12428 "02iqg6jbc1kxvfzqcg6wy9ygqxfm82bw5rf6vnswqy4y572niz4q"))))
12429 (build-system ant-build-system)
12430 (arguments
12431 `(#:jar-name "jsch-agentproxy-core.jar"
12432 #:source-dir "jsch-agent-proxy-core/src/main/java"
12433 #:tests? #f)); no tests
12434 (home-page "https://github.com/ymnk/jsch-agent-proxy")
f1d79c97 12435 (synopsis "Core component of the proxy to ssh-agent and Pageant in Java")
470674a5
JL
12436 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
12437and Pageant included Putty. It will be easily integrated into JSch, and users
12438will be allowed to use these programs for authentication.")
12439 (license license:bsd-3)))
f1d79c97
JL
12440
12441(define-public java-jsch-agentproxy-sshagent
12442 (package
12443 (inherit java-jsch-agentproxy-core)
12444 (name "java-jsch-agentproxy-sshagent")
12445 (arguments
12446 `(#:jar-name "jsch-agentproxy-sshagent.jar"
12447 #:source-dir "jsch-agent-proxy-sshagent/src/main/java"
12448 #:tests? #f)); no tests
12449 (inputs
12450 `(("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)))
12451 (synopsis "Proxy to ssh-agent")
12452 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
12453and Pageant included in Putty. This component contains the code for a proxy to
12454ssh-agent.")))
f438e638
JL
12455
12456(define-public java-jsch-agentproxy-usocket-jna
12457 (package
12458 (inherit java-jsch-agentproxy-core)
12459 (name "java-jsch-agentproxy-usocket-jna")
12460 (arguments
12461 `(#:jar-name "jsch-agentproxy-usocket-jna.jar"
12462 #:source-dir "jsch-agent-proxy-usocket-jna/src/main/java"
12463 #:tests? #f)); no tests
12464 (inputs
12465 `(("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)
12466 ("java-native-access" ,java-native-access)))
12467 (synopsis "USocketFactory implementation using JNA")
12468 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
12469and Pageant included in Putty. This component contains an implementation of
12470USocketFactory using @dfn{JNA} (Java Native Access).")))
475225e3
JL
12471
12472(define-public java-jsch-agentproxy-pageant
12473 (package
12474 (inherit java-jsch-agentproxy-core)
12475 (name "java-jsch-agentproxy-pageant")
12476 (arguments
12477 `(#:jar-name "jsch-agentproxy-pageant.jar"
12478 #:source-dir "jsch-agent-proxy-pageant/src/main/java"
12479 #:tests? #f)); no tests
12480 (inputs
12481 `(("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)
12482 ("java-native-access" ,java-native-access)
12483 ("java-native-access-platform" ,java-native-access-platform)))
12484 (synopsis "Proxy to pageant")
12485 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
12486and Pageant included in Putty. This component contains the code for a proxy to
12487pageant.")))
96d6d9c7
JL
12488
12489(define-public java-jsch-agentproxy-usocket-nc
12490 (package
12491 (inherit java-jsch-agentproxy-core)
12492 (name "java-jsch-agentproxy-usocket-nc")
12493 (arguments
12494 `(#:jar-name "jsch-agentproxy-usocket-nc.jar"
12495 #:source-dir "jsch-agent-proxy-usocket-nc/src/main/java"
12496 #:tests? #f)); no tests
12497 (inputs
12498 `(("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)))
12499 (synopsis "USocketFactory implementation using netcat")
12500 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
12501and Pageant included in Putty. This component contains an implementation of
12502USocketFactory using netcat.")))
5a46b17b
JL
12503
12504(define-public java-jsch-agentproxy-connector-factory
12505 (package
12506 (inherit java-jsch-agentproxy-core)
12507 (name "java-jsch-agentproxy-connector-factory")
12508 (arguments
12509 `(#:jar-name "jsch-agentproxy-connector-factory.jar"
12510 #:source-dir "jsch-agent-proxy-connector-factory/src/main/java"
12511 #:tests? #f)); no tests
12512 (inputs
12513 `(("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)
12514 ("java-jsch-agentproxy-sshagent" ,java-jsch-agentproxy-sshagent)
12515 ("java-jsch-agentproxy-usocket-jna" ,java-jsch-agentproxy-usocket-jna)
12516 ("java-jsch-agentproxy-pageant" ,java-jsch-agentproxy-pageant)
12517 ("java-jsch-agentproxy-usocket-nc" ,java-jsch-agentproxy-usocket-nc)))
12518 (synopsis "Connector factory for jsch agent proxy")
12519 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
12520and Pageant included in Putty. This component contains a connector factory.")))
b0fbf596
JL
12521
12522(define-public java-jsch-agentproxy-jsch
12523 (package
12524 (inherit java-jsch-agentproxy-core)
12525 (name "java-jsch-agentproxy-jsch")
12526 (arguments
12527 `(#:jar-name "jsch-agentproxy-jsch.jar"
12528 #:source-dir "jsch-agent-proxy-jsch/src/main/java"
12529 #:tests? #f)); no tests
12530 (inputs
12531 `(("java-jsch" ,java-jsch)
12532 ("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)))
12533 (synopsis "JSch integration library for agentproxy")
12534 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
12535and Pageant included in Putty. This component contains a library to use
12536jsch-agent-proxy with JSch.")))
f1f4a4f0
JL
12537
12538(define-public java-apache-ivy
12539 (package
12540 (name "java-apache-ivy")
12541 (version "2.4.0")
12542 (source (origin
12543 (method url-fetch)
12544 (uri (string-append "mirror://apache//ant/ivy/" version
12545 "/apache-ivy-" version "-src.tar.gz"))
12546 (sha256
12547 (base32
12548 "1xkfn57g2m7l6y0xdq75x5rnrgk52m9jx2xah70g3ggl8750hbr0"))
12549 (patches
12550 (search-patches
12551 "java-apache-ivy-port-to-latest-bouncycastle.patch"))))
12552 (build-system ant-build-system)
12553 (arguments
12554 `(#:jar-name "ivy.jar"
12555 #:tests? #f
12556 #:phases
12557 (modify-phases %standard-phases
12558 (add-before 'build 'remove-example
12559 (lambda _
12560 (delete-file-recursively "src/example")
12561 #t))
12562 (add-before 'build 'copy-resources
12563 (lambda _
12564 (with-directory-excursion "src/java"
12565 (for-each (lambda (file)
12566 (install-file file (string-append "../../build/classes/" (dirname file))))
12567 (append
12568 (find-files "." ".*.css")
12569 (find-files "." ".*.ent")
12570 (find-files "." ".*.html")
12571 (find-files "." ".*.properties")
12572 (find-files "." ".*.xsd")
12573 (find-files "." ".*.xsl")
2c8ac364
MW
12574 (find-files "." ".*.xml"))))
12575 #t))
f1f4a4f0
JL
12576 (add-before 'build 'fix-vfs
12577 (lambda _
12578 (substitute*
12579 '("src/java/org/apache/ivy/plugins/repository/vfs/VfsRepository.java"
12580 "src/java/org/apache/ivy/plugins/repository/vfs/VfsResource.java")
12581 (("import org.apache.commons.vfs") "import org.apache.commons.vfs2"))
12582 #t))
12583 (add-before 'install 'copy-manifest
12584 (lambda _
12585 (install-file "META-INF/MANIFEST.MF" "build/classes/META-INF")
12586 #t))
12587 (add-before 'install 'repack
12588 (lambda _
12589 (invoke "jar" "-cmf" "build/classes/META-INF/MANIFEST.MF" "build/jar/ivy.jar"
2c8ac364 12590 "-C" "build/classes" ".")))
f1f4a4f0
JL
12591 (add-after 'install 'install-bin
12592 (lambda* (#:key outputs #:allow-other-keys)
12593 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
12594 (ivy (string-append bin "/ivy"))
12595 (jar (string-append (assoc-ref outputs "out") "/share/java/ivy.jar")))
12596 (mkdir-p bin)
12597 (with-output-to-file ivy
12598 (lambda _
12599 (display (string-append
12600 "#!" (which "sh") "\n"
12601 "if [[ -z $CLASSPATH ]]; then\n"
12602 " cp=\"" (getenv "CLASSPATH") ":" jar "\"\n"
12603 "else\n"
12604 " cp=\"" (getenv "CLASSPATH") ":" jar ":$CLASSPATH\"\n"
12605 "fi\n"
12606 (which "java") " -cp $cp org.apache.ivy.Main $@\n"))))
12607 (chmod ivy #o755)
12608 #t))))))
12609 (inputs
12610 `(("java-bouncycastle" ,java-bouncycastle)
12611 ("java-commons-cli" ,java-commons-cli)
12612 ("java-commons-collections" ,java-commons-collections)
12613 ("java-commons-httpclient" ,java-commons-httpclient)
12614 ("java-commons-lang" ,java-commons-lang)
12615 ("java-commons-vfs" ,java-commons-vfs)
12616 ("java-jakarta-oro" ,java-jakarta-oro)
12617 ("java-jsch" ,java-jsch)
12618 ("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)
12619 ("java-jsch-agentproxy-connector-factory" ,java-jsch-agentproxy-connector-factory)
12620 ("java-jsch-agentproxy-jsch" ,java-jsch-agentproxy-jsch)
12621 ("java-junit" ,java-junit)))
12622 (home-page "https://ant.apache.org/ivy")
12623 (synopsis "Dependency manager for the Java programming language")
12624 (description "Ivy is a tool for managing (recording, tracking, resolving
12625and reporting) project dependencies. It is characterized by the following:
12626
12627@itemize
12628@item flexibility and configurability - Ivy is essentially process agnostic
12629 and is not tied to any methodology or structure. Instead it provides the
12630 necessary flexibility and configurability to be adapted to a broad range
12631 of dependency management and build processes.
12632@item tight integration with Apache Ant - while available as a standalone tool,
12633 Ivy works particularly well with Apache Ant providing a number of
12634 powerful Ant tasks ranging from dependency resolution to dependency
12635 reporting and publication.
12636@end itemize")
12637 (license license:asl2.0)))
1a1810f5
JL
12638
12639(define-public java-eclipse-sisu-inject
12640 (package
12641 (name "java-eclipse-sisu-inject")
6671d6a1 12642 (version "0.3.4")
1a1810f5 12643 (source (origin
ae69b39e
BH
12644 (method git-fetch)
12645 (uri (git-reference
12646 (url "https://github.com/eclipse/sisu.inject/")
6671d6a1 12647 (commit (string-append "releases/" version))))
ae69b39e 12648 (file-name (git-file-name name version))
1a1810f5
JL
12649 (sha256
12650 (base32
6671d6a1 12651 "16044sizdb0rjbhlfbmcnpds5y7by7dyn9b0c11606aikqi8k3x6"))))
1a1810f5
JL
12652 (build-system ant-build-system)
12653 (arguments
12654 `(#:jar-name "eclipse-sisu-inject.jar"
12655 #:source-dir "org.eclipse.sisu.inject/src"
6671d6a1
JL
12656 #:tests? #f; no tests
12657 #:phases
12658 (modify-phases %standard-phases
12659 (replace 'install
12660 (install-from-pom "org.eclipse.sisu.inject/pom.xml")))))
12661 (propagated-inputs
1a1810f5 12662 `(("java-guice" ,java-guice)
6671d6a1
JL
12663 ("java-sisu-inject-parent-pom" ,java-sisu-inject-parent-pom)))
12664 (inputs
12665 `(("java-guice-servlet" ,java-guice-servlet)
1a1810f5 12666 ("java-javax-inject" ,java-javax-inject)
4b472f6a 12667 ("java-javaee-servletapi" ,java-javaee-servletapi)
1a1810f5
JL
12668 ("java-junit" ,java-junit)
12669 ("java-slf4j-api" ,java-slf4j-api)
12670 ("java-jsr305" ,java-jsr305)
12671 ("java-jsr250" ,java-jsr250)
12672 ("java-cdi-api" ,java-cdi-api)
12673 ("java-osgi-framework" ,java-osgi-framework)
12674 ("java-osgi-util-tracker" ,java-osgi-util-tracker)
12675 ("java-testng" ,java-testng)))
12676 (home-page "https://www.eclipse.org/sisu/")
12677 (synopsis "Classpath scanning, auto-binding, and dynamic auto-wiring")
12678 (description "Sisu is a modular JSR330-based container that supports
12679classpath scanning, auto-binding, and dynamic auto-wiring. Sisu uses
12680Google-Guice to perform dependency injection and provide the core JSR330
12681support, but removes the need to write explicit bindings in Guice modules.
12682Integration with other containers via the Eclipse Extension Registry and the
12683OSGi Service Registry is a goal of this project.")
12684 (license license:epl1.0)))
7049dea1 12685
6671d6a1
JL
12686(define java-sisu-inject-parent-pom
12687 (package
12688 (inherit java-eclipse-sisu-inject)
12689 (name "java-sisu-inject-parent-pom")
12690 (arguments
12691 `(#:tests? #f
12692 #:phases
12693 (modify-phases %standard-phases
12694 (delete 'configure)
12695 (delete 'build)
12696 (replace 'install
12697 (install-pom-file "pom.xml")))))
12698 (propagated-inputs '())))
12699
7049dea1
JL
12700(define-public java-eclipse-sisu-plexus
12701 (package
12702 (name "java-eclipse-sisu-plexus")
e0c0b078 12703 (version "0.3.4")
7049dea1 12704 (source (origin
3560a2cd
EF
12705 (method git-fetch)
12706 (uri (git-reference
b0e7b699 12707 (url "https://github.com/eclipse/sisu.plexus")
3560a2cd
EF
12708 (commit (string-append "releases/" version))))
12709 (file-name (git-file-name name version))
7049dea1
JL
12710 (sha256
12711 (base32
e0c0b078 12712 "17mjlajnsqnk07cc58h1qpxrif85yb2m2y0pyba48yjjgikk8r9f"))
7049dea1
JL
12713 (modules '((guix build utils)))
12714 (snippet
12715 '(begin
12716 (for-each delete-file (find-files "." ".*.jar"))
12717 (rename-file "org.eclipse.sisu.plexus.tests/src"
12718 "org.eclipse.sisu.plexus.tests/java")
12719 #t))))
12720 (build-system ant-build-system)
12721 (arguments
12722 `(#:jar-name "eclipse-sisu-plexus.jar"
12723 #:source-dir "org.eclipse.sisu.plexus/src"
12724 #:test-dir "org.eclipse.sisu.plexus.tests"
12725 #:test-exclude
12726 (list
12727 ;; This test fails probably because we can't generate the necessary
12728 ;; meta-inf files.
12729 "**/PlexusLoggingTest.*"
12730 ;; FIXME: This test fails because of some injection error
12731 "**/PlexusRequirementTest.*")
12732 #:jdk ,icedtea-8
12733 #:phases
12734 (modify-phases %standard-phases
12735 (add-before 'build 'copy-resources
12736 (lambda _
12737 (install-file "org.eclipse.sisu.plexus/META-INF/plexus/components.xml"
12738 "build/classes/META-INF/plexus")
12739 #t))
12740 (add-before 'check 'build-test-jar
12741 (lambda _
12742 (with-directory-excursion "org.eclipse.sisu.plexus.tests/resources/component-jar/src/main/"
12743 (mkdir "build")
12744 (with-directory-excursion "java"
12745 (apply invoke "javac" "-cp"
12746 (string-append (getenv "CLASSPATH")
12747 ":../../../../../build/classes")
12748 (find-files "." ".*.java"))
12749 (for-each (lambda (file) (install-file file (string-append "../build/" file)))
12750 (find-files "." ".*.jar")))
12751 (mkdir-p "build/META-INF/plexus")
12752 (copy-file "resources/META-INF/plexus/components.xml"
12753 "build/META-INF/plexus/components.xml")
12754 (with-directory-excursion "build"
12755 (invoke "jar" "cf" "../../../component-jar-0.1.jar" ".")))
12756 (with-directory-excursion "org.eclipse.sisu.plexus.tests/"
12757 (copy-recursively "META-INF" "../build/test-classes/META-INF")
12758 (substitute* "java/org/eclipse/sisu/plexus/DefaultPlexusContainerTest.java"
12759 (("resources/component-jar")
12760 "org.eclipse.sisu.plexus.tests/resources/component-jar")))
51087d51
JL
12761 #t))
12762 (replace 'install
12763 (install-from-pom "org.eclipse.sisu.plexus/pom.xml")))))
12764 (propagated-inputs
7049dea1 12765 `(("java-plexus-classworlds" ,java-plexus-classworlds)
51087d51 12766 ("java-plexus-utils" ,java-plexus-utils)
7049dea1 12767 ("java-plexus-component-annotations" ,java-plexus-component-annotations)
51087d51 12768 ("java-cdi-api" ,java-cdi-api)
7049dea1 12769 ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
51087d51
JL
12770 ("java-sisu-plexus-parent-pom" ,java-sisu-plexus-parent-pom)))
12771 (inputs
12772 `(("java-osgi-framework" ,java-osgi-framework)
7049dea1 12773 ("java-slf4j-api" ,java-slf4j-api)
51087d51
JL
12774 ("java-javax-inject" ,java-javax-inject)
12775 ("java-guice" ,java-guice)
12776 ("java-guava" ,java-guava)
7049dea1 12777 ("java-aopalliance" ,java-aopalliance)
51087d51
JL
12778 ("java-asm" ,java-asm)
12779 ("java-cglib" ,java-cglib)))
12780 (native-inputs
12781 `(("java-junit" ,java-junit)))
7049dea1
JL
12782 (home-page "https://www.eclipse.org/sisu/")
12783 (synopsis "Plexus support for the sisu container")
12784 (description "Sisu is a modular JSR330-based container that supports
12785classpath scanning, auto-binding, and dynamic auto-wiring. This package
12786adds Plexus support to the Sisu-Inject container.")
12787 (license license:epl1.0)))
3fa18fe7 12788
51087d51
JL
12789(define java-sisu-plexus-parent-pom
12790 (package
12791 (inherit java-eclipse-sisu-plexus)
12792 (name "java-sisu-plexus-parent-pom")
12793 (arguments
12794 `(#:tests? #f
12795 #:phases
12796 (modify-phases %standard-phases
12797 (delete 'configure)
12798 (delete 'build)
12799 (replace 'install
12800 (install-pom-file "pom.xml")))))
12801 (propagated-inputs
12802 `(("java-sonatype-oss-parent-pom-9" ,java-sonatype-oss-parent-pom-9)))))
12803
3fa18fe7
JL
12804(define-public java-commons-compiler
12805 (package
12806 (name "java-commons-compiler")
12807 (version "3.0.8")
12808 (source (origin
12809 (method git-fetch)
12810 (uri (git-reference
12811 (url "https://github.com/janino-compiler/janino")
12812 (commit "91aa95686d1e4ca3b16a984a03a38686572331b2")))
12813 (file-name (string-append name "-" version))
12814 (sha256
12815 (base32
12816 "04hfdl59sgh20qkxzgnibvs8f9hy6n7znxwpk611y5d89977y62r"))
12817 (modules '((guix build utils)))
12818 (snippet
12819 '(begin
12820 (for-each delete-file
12821 (find-files "." "\\.jar$"))
12822 #t))))
12823 (build-system ant-build-system)
12824 (arguments
12825 `(#:jar-name "commons-compiler.jar"
12826 #:source-dir "commons-compiler/src/main"
12827 #:tests? #f)); no tests
12828 (home-page "https://github.com/janino-compiler/janino")
12829 (synopsis "Java compiler")
12830 (description "Commons-compiler contains an API for janino, including the
12831@code{IExpressionEvaluator}, @code{IScriptEvaluator}, @code{IClassBodyEvaluator}
12832and @code{ISimpleCompiler} interfaces.")
12833 (license license:bsd-3)))
3402e651
JL
12834
12835(define-public java-janino
12836 (package
12837 (inherit java-commons-compiler)
12838 (name "java-janino")
12839 (arguments
12840 `(#:jar-name "janino.jar"
12841 #:source-dir "src/main/java"
12842 #:phases
12843 (modify-phases %standard-phases
12844 (add-before 'configure 'chdir
12845 (lambda _
2c8ac364
MW
12846 (chdir "janino")
12847 #t)))))
3402e651
JL
12848 (inputs
12849 `(("java-commons-compiler" ,java-commons-compiler)))
12850 (native-inputs
12851 `(("java-junit" ,java-junit)
12852 ("java-hamcrest-core" ,java-hamcrest-core)))
12853 (description "Janino is a Java compiler. Janino can compile a set of
12854source files to a set of class files like @code{javac}, but also compile a
12855Java expression, block, class body or source file in memory, load the bytecode
12856and execute it directly in the same JVM. @code{janino} can also be used for
12857static code analysis or code manipulation.")))
7d8207a4
JL
12858
12859(define-public java-logback-core
12860 (package
12861 (name "java-logback-core")
12862 (version "1.2.3")
12863 (source (origin
12864 (method url-fetch)
12865 (uri (string-append "https://github.com/qos-ch/logback/archive/v_"
12866 version ".tar.gz"))
b1ccd2a1 12867 (file-name (string-append name "-" version ".tar.gz"))
7d8207a4
JL
12868 (sha256
12869 (base32
12870 "1x6ga74yfgm94cfx98gybakbrlilx8i2gn6dx13l40kasmys06mi"))
12871 (modules '((guix build utils)))
12872 (snippet
2c8ac364
MW
12873 '(begin
12874 (delete-file-recursively "logback-access/lib")
12875 #t))))
7d8207a4
JL
12876 (build-system ant-build-system)
12877 (arguments
12878 `(#:jar-name "logback.jar"
12879 #:source-dir "src/main/java"
12880 #:test-dir "src/test"
12881 #:test-exclude
12882 ;; These tests fail with Unable to set MockitoNamingPolicy on cglib generator
12883 ;; which creates FastClasses
12884 (list "**/AllCoreTest.*"
12885 "**/AutoFlushingObjectWriterTest.*"
12886 "**/PackageTest.*"
12887 "**/ResilientOutputStreamTest.*"
12888 ;; And we still don't want to run abstract classes
12889 "**/Abstract*.*")
12890 #:phases
12891 (modify-phases %standard-phases
12892 (add-before 'configure 'chdir
12893 (lambda _
12894 (chdir "logback-core")
12895 #t)))))
12896 (inputs
12897 `(("java-javax-mail" ,java-javax-mail)
4b472f6a 12898 ("servlet" ,java-javaee-servletapi)
7d8207a4
JL
12899 ("java-commons-compiler" ,java-commons-compiler)
12900 ("java-janino" ,java-janino)))
12901 (native-inputs
12902 `(("java-junit" ,java-junit)
12903 ("java-hamcrest-core" ,java-hamcrest-core)
12904 ("java-mockito-1" ,java-mockito-1)
12905 ("java-cglib" ,java-cglib)
12906 ("java-asm" ,java-asm)
12907 ("java-objenesis" ,java-objenesis)
12908 ("java-joda-time" ,java-joda-time)))
12909 (home-page "https://logback.qos.ch")
12910 (synopsis "Logging for java")
12911 (description "Logback is intended as a successor to the popular log4j project.
12912This module lays the groundwork for the other two modules.")
12913 ;; Either epl1.0 or lgpl2.1
12914 (license (list license:epl1.0
12915 license:lgpl2.1))))
3a69f5f2
JL
12916
12917(define-public java-logback-classic
12918 (package
12919 (inherit java-logback-core)
12920 (name "java-logback-classic")
12921 (arguments
12922 `(#:jar-name "logback-classic.jar"
12923 #:source-dir "src/main/java"
12924 #:test-dir "src/test"
12925 #:tests? #f; tests require more packages: h2, greenmail, hsql, subethamail, slf4j, log4j, felix
12926 #:jdk ,icedtea-8
12927 #:phases
12928 (modify-phases %standard-phases
12929 (add-before 'configure 'chdir
12930 (lambda _
12931 (chdir "logback-classic")
12932 #t))
12933 (replace 'build
12934 (lambda* (#:key inputs #:allow-other-keys)
12935 (mkdir-p "build/classes")
12936 (setenv "CLASSPATH"
12937 (string-join
12938 (apply append (map (lambda (input)
12939 (find-files (assoc-ref inputs input)
12940 ".*.jar"))
12941 '("java-logback-core" "java-slf4j-api"
4b472f6a 12942 "java-commons-compiler" "servlet"
3a69f5f2
JL
12943 "groovy")))
12944 ":"))
12945 (apply invoke "groovyc" "-d" "build/classes" "-j"
12946 (find-files "src/main/" ".*\\.(groovy|java)$"))
12947 (invoke "ant" "jar")
12948 #t)))))
12949 (inputs
12950 `(("java-logback-core" ,java-logback-core)
12951 ("java-slf4j-api" ,java-slf4j-api)
12952 ,@(package-inputs java-logback-core)))
12953 (native-inputs
12954 `(("groovy" ,groovy)))
12955 (description "Logback is intended as a successor to the popular log4j project.
12956This module can be assimilated to a significantly improved version of log4j.
12957Moreover, @code{logback-classic} natively implements the slf4j API so that you
12958can readily switch back and forth between logback and other logging frameworks
12959such as log4j or @code{java.util.logging} (JUL).")))
ab621bf1 12960
c786dff0
LC
12961(define-public java-jgit
12962 (package
12963 (name "java-jgit")
12964 (version "4.7.0.201704051617-r")
12965 (source (origin
12966 (method url-fetch)
12967 (uri (string-append "https://repo1.maven.org/maven2/"
12968 "org/eclipse/jgit/org.eclipse.jgit/"
12969 version "/org.eclipse.jgit-"
12970 version "-sources.jar"))
12971 (sha256
12972 (base32
12973 "13ii4jn02ynzq6i7gsyi21k2i94jpc85wf6bcm31q4cyvzv0mk4k"))))
12974 (build-system ant-build-system)
12975 (arguments
12976 `(#:tests? #f ; There are no tests to run.
12977 #:jar-name "jgit.jar"
12978 ;; JGit must be built with a JDK supporting Java 8.
12979 #:jdk ,icedtea-8
12980 ;; Target our older default JDK.
12981 #:make-flags (list "-Dtarget=1.7")
12982 #:phases
12983 (modify-phases %standard-phases
12984 ;; The jar file generated by the default build.xml does not include
12985 ;; the text properties files, so we need to add them.
12986 (add-after 'build 'add-properties
12987 (lambda* (#:key jar-name #:allow-other-keys)
12988 (with-directory-excursion "src"
12989 (apply invoke "jar" "-uf"
12990 (string-append "../build/jar/" jar-name)
12991 (find-files "." "\\.properties$")))
12992 #t)))))
12993 (inputs
12994 `(("java-classpathx-servletapi" ,java-classpathx-servletapi)
12995 ("java-javaewah" ,java-javaewah)
12996 ("java-jsch" ,java-jsch)
12997 ("java-slf4j-api" ,java-slf4j-api)))
12998 (home-page "https://eclipse.org/jgit/")
12999 (synopsis "Java library implementing the Git version control system")
13000 (description "JGit is a lightweight, pure Java library implementing the
13001Git version control system, providing repository access routines, support for
13002network protocols, and core version control algorithms.")
13003 (license license:edl1.0)))
13004
13005;; For axoloti. This package can still be built with icedtea-7, which is
13006;; currently used as the default JDK.
13007(define-public java-jgit-4.2
13008 (package (inherit java-jgit)
13009 (version "4.2.0.201601211800-r")
13010 (source (origin
13011 (method url-fetch)
13012 (uri (string-append "https://repo1.maven.org/maven2/"
13013 "org/eclipse/jgit/org.eclipse.jgit/"
13014 version "/org.eclipse.jgit-"
13015 version "-sources.jar"))
13016 (sha256
13017 (base32
13018 "15gm537iivhnzlkjym4x3wn5jqdjdragsw9pdpzqqg21nrc817mm"))))
13019 (build-system ant-build-system)
13020 (arguments
13021 (substitute-keyword-arguments (package-arguments java-jgit)
13022 ;; Build for default JDK.
13023 ((#:jdk _) icedtea-7)
13024 ((#:phases phases)
13025 `(modify-phases ,phases
13026 (add-after 'unpack 'use-latest-javaewah-API
13027 (lambda _
13028 (substitute* "src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java"
13029 (("wordinbits") "WORD_IN_BITS"))
13030 #t))))))
13031 (inputs
13032 `(("java-javaewah" ,java-javaewah)
13033 ("java-jsch" ,java-jsch)
13034 ("java-slf4j-api" ,java-slf4j-api)))))
717b6ba6
CZ
13035
13036(define-public abcl
13037 (package
13038 (name "abcl")
514001e9 13039 (version "1.6.0")
717b6ba6
CZ
13040 (source
13041 (origin
13042 (method url-fetch)
13043 (uri (string-append "https://abcl.org/releases/"
13044 version "/abcl-src-" version ".tar.gz"))
13045 (sha256
13046 (base32
514001e9 13047 "0hvbcsffr8n2xwdixc8wyw1bfl9fxn2gyy0c4nma7j9zbn0wwgw9"))
717b6ba6
CZ
13048 (patches
13049 (search-patches
13050 "abcl-fix-build-xml.patch"))))
13051 (build-system ant-build-system)
13052 (native-inputs
13053 `(("java-junit" ,java-junit)))
13054 (arguments
13055 `(#:build-target "abcl.jar"
13056 #:test-target "abcl.test"
13057 #:phases
13058 (modify-phases %standard-phases
13059 (replace 'install
13060 (lambda* (#:key outputs #:allow-other-keys)
13061 (let ((share (string-append (assoc-ref outputs "out")
13062 "/share/java/"))
13063 (bin (string-append (assoc-ref outputs "out")
13064 "/bin/")))
13065 (mkdir-p share)
13066 (install-file "dist/abcl.jar" share)
13067 (install-file "dist/abcl-contrib.jar" share)
13068 (mkdir-p bin)
13069 (with-output-to-file (string-append bin "abcl")
13070 (lambda _
13071 (let ((classpath (string-append
13072 share "abcl.jar"
13073 ":"
13074 share "abcl-contrib.jar")))
13075 (display (string-append
13076 "#!" (which "sh") "\n"
13077 "if [[ -z $CLASSPATH ]]; then\n"
13078 " cp=\"" classpath "\"\n"
13079 "else\n"
13080 " cp=\"" classpath ":$CLASSPATH\"\n"
13081 "fi\n"
13082 "exec " (which "java")
13083 " -cp $cp org.armedbear.lisp.Main $@\n")))))
13084 (chmod (string-append bin "abcl") #o755)
13085 #t))))))
13086 (home-page "https://abcl.org/")
13087 (synopsis "Common Lisp Implementation on the JVM")
13088 (description
13089 "@dfn{Armed Bear Common Lisp} (ABCL) is a full implementation of the Common
13090Lisp language featuring both an interpreter and a compiler, running in the
13091JVM. It supports JSR-223 (Java scripting API): it can be a scripting engine
13092in any Java application. Additionally, it can be used to implement (parts of)
13093the application using Java to Lisp integration APIs.")
13094 (license (list license:gpl2+
13095 ;; named-readtables is released under 3 clause BSD
13096 license:bsd-3
13097 ;; jfli is released under CPL 1.0
13098 license:cpl1.0))))
da655b1e
JL
13099
13100(define-public java-jsonp-api
13101 (package
13102 (name "java-jsonp-api")
83c4c502 13103 (version "1.1.6")
da655b1e
JL
13104 (source (origin
13105 (method git-fetch)
13106 (uri (git-reference
13107 (url "https://github.com/eclipse-ee4j/jsonp")
83c4c502 13108 (commit (string-append "1.1-" version "-RELEASE"))))
da655b1e
JL
13109 (file-name (git-file-name name version))
13110 (sha256
13111 (base32
83c4c502 13112 "0zrj03hkr3jdmqlb4ipjr37cqpp2q2814qpmxi7srlwpdqs0ibgc"))))
da655b1e
JL
13113 (build-system ant-build-system)
13114 (arguments
13115 `(#:jar-name "jsonp-api.jar"
13116 #:tests? #f
13117 #:source-dir "api/src/main/java"
13118 #:test-dir "api/src/test"))
13119 (home-page "https://eclipse-ee4j.github.io/jsonp/")
13120 (synopsis "JSON Processing in Java")
13121 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
13122parse, generate, transform and query) JSON messages. It produces and
13123consumes JSON text in a streaming fashion (similar to StAX API for XML)
44a057a1 13124and allows building a Java object model for JSON text using API classes
da655b1e
JL
13125(similar to DOM API for XML).")
13126 ;; either gpl2 only with classpath exception, or epl2.0.
13127 (license (list license:gpl2
13128 license:epl2.0))))
d45f73c9
JL
13129
13130(define-public java-jsonp-impl
13131 (package
13132 (inherit java-jsonp-api)
13133 (name "java-jsonp-impl")
13134 (arguments
13135 `(#:jar-name "jsonp-impl.jar"
13136 #:tests? #f
13137 #:source-dir "impl/src/main/java"
83c4c502
JL
13138 #:test-dir "impl/src/test"
13139 #:phases
13140 (modify-phases %standard-phases
13141 (add-before 'build 'copy-resources
13142 (lambda _
13143 (copy-recursively
13144 "impl/src/main/resources/"
13145 "build/classes")
13146 #t)))))
d45f73c9
JL
13147 (propagated-inputs
13148 `(("java-jsonp-api" ,java-jsonp-api)))
13149 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
13150parse, generate, transform and query) JSON messages. This package contains
13151a reference implementation of that API.")))
357f4564
JL
13152
13153(define-public java-xmp
13154 (package
13155 (name "java-xmp")
13156 (version "5.1.3")
13157 (source (origin
13158 (method url-fetch)
13159 (uri (string-append "http://download.macromedia.com/pub/developer"
13160 "/xmp/sdk/XMPCoreJava-" version ".zip"))
13161 (sha256
13162 (base32
13163 "14nai2mmsg7l5ya2y5mx4w4lr1az3sk2fjz6hiy4zdrsavgvl1g7"))))
13164 (build-system ant-build-system)
13165 (arguments
13166 `(#:build-target "build"
13167 #:tests? #f; no tests
13168 #:phases
13169 (modify-phases %standard-phases
13170 (add-after 'unpack 'chdir
13171 (lambda _
13172 (chdir "XMPCore")
13173 #t))
13174 (add-before 'build 'fix-timestamp
13175 (lambda _
13176 (substitute* "build.xml"
13177 (("\\$\\{BuildDate\\}") "1970 Jan 01 00:00:00-GMT"))
13178 #t))
13179 (replace 'install
13180 (install-jars "."))
13181 (add-after 'install 'install-doc
13182 (lambda* (#:key outputs #:allow-other-keys)
13183 (copy-recursively
13184 "docs"
13185 (string-append (assoc-ref outputs "out") "/share/doc/java-xmp"))
13186 #t)))))
13187 (native-inputs
13188 `(("unzip" ,unzip)))
13189 (home-page "https://www.adobe.com/devnet/xmp.html")
13190 (synopsis "Extensible Metadat Platform (XMP) support in Java")
13191 (description "Adobe's Extensible Metadata Platform (XMP) is a labeling
13192technology that allows you to embed data about a file, known as metadata,
13193into the file itself. The XMP Toolkit for Java is based on the C++ XMPCore
13194library and the API is similar.")
13195 (license license:bsd-3)))
a005c63a
JL
13196
13197(define-public java-metadata-extractor
13198 (package
13199 (name "java-metadata-extractor")
13200 (version "2.11.0")
13201 (source (origin
13202 (method git-fetch)
13203 (uri (git-reference
13204 (url "https://github.com/drewnoakes/metadata-extractor")
13205 (commit version)))
13206 (file-name (git-file-name name version))
13207 (sha256
13208 (base32
13209 "06yrq0swrl1r40yjbk5kqzjxr04jlkq9lfi711jvfgjf5kp2qinj"))))
13210 (build-system ant-build-system)
13211 (arguments
13212 `(#:jar-name "metadata-extractor.jar"
13213 #:source-dir "Source"
13214 #:test-dir "Tests"
13215 #:phases
13216 (modify-phases %standard-phases
13217 (add-before 'check 'fix-test-dir
13218 (lambda _
13219 (substitute* "build.xml"
13220 (("/java\">") "\">"))
13221 #t)))))
13222 (propagated-inputs
13223 `(("java-xmp" ,java-xmp)))
13224 (native-inputs
13225 `(("java-hamcrest-core" ,java-hamcrest-core)
13226 ("java-junit" ,java-junit)))
13227 (home-page "https://github.com/drewnoakes/metadata-extractor")
13228 (synopsis "Extract metadata from image and video files")
13229 (description "Metadata-extractor is a straightforward Java library for
13230reading metadata from image files. It is able to read metadata in Exif,
13231IPTC, XMP, ICC and more formats.")
13232 (license license:asl2.0)))
0dd6089d
JL
13233
13234(define-public java-svg-salamander
13235 (package
13236 (name "java-svg-salamander")
13237 (version "1.1.2")
13238 (source (origin
13239 (method git-fetch)
13240 (uri (git-reference
13241 (url "https://github.com/blackears/svgSalamander")
13242 (commit (string-append "v" version))))
13243 (file-name (git-file-name name version))
13244 (sha256
13245 (base32
13246 "1zv3kjdkf6iqf02x6ln76254y634j2ji448y706a65lsbfjmmicf"))
13247 (modules '((guix build utils)))
13248 (snippet
58c3a4f5
BH
13249 '(begin
13250 (for-each delete-file (find-files "." ".*.jar"))
13251 #t))
0dd6089d
JL
13252 (patches
13253 (search-patches "java-svg-salamander-Fix-non-det.patch"))))
13254 (build-system ant-build-system)
13255 (arguments
13256 `(#:tests? #f; no tests
13257 #:phases
13258 (modify-phases %standard-phases
13259 (add-after 'unpack 'chdir
13260 (lambda _
13261 (chdir "svg-core")
13262 #t))
13263 (add-before 'build 'copy-jars
13264 (lambda* (#:key inputs #:allow-other-keys)
13265 (copy-file (car (find-files (assoc-ref inputs "javacc") "\\.jar$"))
13266 "../libraries/javacc.jar")
13267 (copy-file (car (find-files (assoc-ref inputs "ant") "ant\\.jar$"))
13268 "../libraries/ant.jar")
13269 #t))
13270 (replace 'install
13271 (install-jars "dist")))))
13272 (native-inputs
13273 `(("javacc" ,javacc)))
13274 (home-page "https://github.com/blackears/svgSalamander")
13275 (synopsis "SVG engine for Java")
13276 (description "SVG Salamander is an SVG engine for Java that's designed
13277to be small, fast, and allow programmers to use it with a minimum of fuss.
13278It's in particular targeted for making it easy to integrate SVG into Java
13279games and making it much easier for artists to design 2D game content - from
13280rich interactive menus to charts and graphcs to complex animations.")
13281 (license license:bsd-2)))
ff56e6ef
JL
13282
13283(define-public java-jboss-transaction-api-spec
13284 (package
13285 (name "java-jboss-transaction-api-spec")
13286 (version "1.2+1.1.1")
13287 (source (origin
13288 (method git-fetch)
13289 (uri (git-reference
13290 (url "https://github.com/jboss/jboss-transaction-api_spec")
13291 (commit "jboss-transaction-api_1.2_spec-1.1.1.Final")))
13292 (file-name (git-file-name name version))
13293 (sha256
13294 (base32
13295 "1xbfq5hvb86izflydxrqqv3k26c1ba2m0ap6m97shqrsdi9by4wy"))))
13296 (build-system ant-build-system)
13297 (arguments
13298 `(#:jar-name "java-jboss-transaction-api_spec.jar"
13299 #:source-dir "src/main/java"
13300 #:tests? #f)); no tests
13301 (inputs
13302 `(("java-cdi-api" ,java-cdi-api)
13303 ("java-jboss-interceptors-api-spec" ,java-jboss-interceptors-api-spec)))
13304 (home-page "https://github.com/jboss/jboss-transaction-api_spec")
13305 (synopsis "Generic transaction management API in Java")
13306 (description "Java-jboss-transaction-api-spec implements the Transactions
13307API. A transaction is a unit of work containing one or more operations
13308involving one or more shared resources having ACID (Atomicity, Consistency,
13309Isolation and Durability) properties.")
13310 ;; either gpl2 only with classpath exception or cddl.
13311 (license (list license:gpl2 license:cddl1.0))))
8ba990e6
JL
13312
13313(define-public java-picocli
13314 (package
13315 (name "java-picocli")
13316 (version "4.3.2")
13317 (source (origin
13318 (method git-fetch)
13319 (uri (git-reference
13320 (url "https://github.com/remkop/picocli")
13321 (commit (string-append "v" version))))
b5698f5b 13322 (file-name (git-file-name name version))
8ba990e6
JL
13323 (sha256
13324 (base32
13325 "1sxp6rxjfgjd98ly14b3d15dvxkm5wg4g46w12jyhmr0kmkaca3c"))))
13326 (build-system ant-build-system)
13327 (arguments
13328 `(#:jar-name "picocli.jar"
13329 #:source-dir "src/main/java"
13330 ;; Tests require missing dependencies (junitparams, system-rules)
13331 #:tests? #f))
13332 (home-page "https://picocli.info")
13333 (synopsis "REPL for the JVM")
13334 (description "Picocli is a framework for building command line applications
13335for the JVM. It supports colors, autocompletion, subcommands, and more. Written
13336in Java, usable from Groovy, Kotlin, Scala, etc.")
13337 (license license:asl2.0)))
a5f8d4e0
JL
13338
13339(define-public java-jetbrains-annotations
13340 (package
13341 (name "java-jetbrains-annotations")
13342 (version "19.0.0")
13343 (source (origin
13344 (method git-fetch)
13345 (uri (git-reference
13346 (url "https://github.com/JetBrains/java-annotations")
13347 (commit version)))
13348 (file-name (git-file-name name version))
13349 (sha256
13350 (base32
13351 "0z6i1xs60cd5ffz23c49sq68wn5mphhs3xpar1n93ppama2ng80v"))))
13352 (build-system ant-build-system)
13353 (arguments
13354 `(#:jar-name "jetbrains-annotations.jar"
13355 #:source-dir "common/src/main/java:java8/src/main/java"
13356 #:tests? #f)); no tests
13357 (home-page "https://github.com/JetBrains/java-annotations")
13358 (synopsis "Annotations for Java and other JVM languages")
13359 (description "This package contains a set of Java annotations which can be
13360used in JVM-based languages. They serve as an additional documentation and
13361can be interpreted by IDEs and static analysis tools to improve code analysis.")
13362 (license license:expat)))