gnu: python-babel: Update to 2.7.0.
[guix.git] / gnu / packages / java.scm
blob2dad131c00b4d1adb8e39d6b03e9e10fc4fff32b
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
4 ;;; Copyright © 2016, 2017 Roel Janssen <roel@gnu.org>
5 ;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
6 ;;; Copyright © 2017, 2018 Julien Lepiller <julien@lepiller.eu>
7 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
8 ;;; Copyright © 2016, 2017, 2018 Alex Vong <alexvong1995@gmail.com>
9 ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2018, 2019 Gábor Boskovits <boskovits@gmail.com>
11 ;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
12 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
13 ;;;
14 ;;; This file is part of GNU Guix.
15 ;;;
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
20 ;;;
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 ;;; GNU General Public License for more details.
25 ;;;
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
29 (define-module (gnu packages java)
30   #:use-module ((guix licenses) #:prefix license:)
31   #:use-module (guix packages)
32   #:use-module (guix download)
33   #:use-module (guix hg-download)
34   #:use-module (guix git-download)
35   #:use-module (guix svn-download)
36   #:use-module (guix utils)
37   #:use-module (guix build-system ant)
38   #:use-module (guix build-system gnu)
39   #:use-module (guix build-system trivial)
40   #:use-module (gnu packages)
41   #:use-module (gnu packages attr)
42   #:use-module (gnu packages autotools)
43   #:use-module (gnu packages base)
44   #:use-module (gnu packages bash)
45   #:use-module (gnu packages certs)
46   #:use-module (gnu packages cpio)
47   #:use-module (gnu packages cups)
48   #:use-module (gnu packages compression)
49   #:use-module (gnu packages elf)
50   #:use-module (gnu packages fontutils)
51   #:use-module (gnu packages gawk)
52   #:use-module (gnu packages gettext)
53   #:use-module (gnu packages gcc)
54   #:use-module (gnu packages gl)
55   #:use-module (gnu packages ghostscript) ;lcms
56   #:use-module (gnu packages gnome)
57   #:use-module (gnu packages groovy)
58   #:use-module (gnu packages gtk)
59   #:use-module (gnu packages guile)
60   #:use-module (gnu packages icu4c)
61   #:use-module (gnu packages image)
62   #:use-module (gnu packages java-compression)
63   #:use-module (gnu packages libffi)
64   #:use-module (gnu packages linux) ;alsa
65   #:use-module (gnu packages maths)
66   #:use-module (gnu packages nss)
67   #:use-module (gnu packages onc-rpc)
68   #:use-module (gnu packages web)
69   #:use-module (gnu packages wget)
70   #:use-module (gnu packages pkg-config)
71   #:use-module (gnu packages perl)
72   #:use-module (gnu packages popt)
73   #:use-module (gnu packages kerberos)
74   #:use-module (gnu packages xml)
75   #:use-module (gnu packages xorg)
76   #:use-module (gnu packages texinfo)
77   #:use-module ((srfi srfi-1) #:select (fold alist-delete))
78   #:use-module (srfi srfi-11)
79   #:use-module (ice-9 match))
82 ;;;
83 ;;; Java bootstrap toolchain.
84 ;;;
86 ;; The Java bootstrap begins with Jikes, a Java compiler written in C++.  We
87 ;; use it to build a simple version of GNU Classpath, the Java standard
88 ;; library.  We chose version 0.93 because it is the last version that can be
89 ;; built with Jikes.  With Jikes and this version of GNU Classpath we can
90 ;; build JamVM, a Java Virtual Machine.  We build version 1.5.1 because it is
91 ;; the last version of JamVM that works with a version of GNU classpath that
92 ;; does not require ECJ.  These three packages make up the bootstrap JDK.
94 ;; This is sufficient to build an older version of Ant, which is needed to
95 ;; build an older version of ECJ, an incremental Java compiler, both of which
96 ;; are written in Java.
98 ;; ECJ is needed to build the latest release (0.99) and the development
99 ;; version of GNU Classpath.  The development version of GNU Classpath has
100 ;; much more support for Java 1.6 than the latest release, but we need to
101 ;; build 0.99 first to get a working version of javah.  ECJ, the development
102 ;; version of GNU Classpath, and the latest version of JamVM make up the
103 ;; second stage JDK with which we can build the OpenJDK with the Icedtea 1.x
104 ;; build framework.  We then build the more recent JDKs Icedtea 2.x and
105 ;; Icedtea 3.x.
107 (define jikes
108   (package
109     (name "jikes")
110     (version "1.22")
111     (source (origin
112               (method url-fetch)
113               (uri (string-append "mirror://sourceforge/jikes/Jikes/"
114                                   version "/jikes-" version ".tar.bz2"))
115               (sha256
116                (base32
117                 "1qqldrp74pzpy5ly421srqn30qppmm9cvjiqdngk8hf47dv2rc0c"))))
118     (build-system gnu-build-system)
119     (home-page "http://jikes.sourceforge.net/")
120     (synopsis "Compiler for the Java language")
121     (description "Jikes is a compiler that translates Java source files as
122 defined in The Java Language Specification into the bytecoded instruction set
123 and binary format defined in The Java Virtual Machine Specification.")
124     (license license:ibmpl1.0)))
126 ;; This is the last version of GNU Classpath that can be built without ECJ.
127 (define classpath-bootstrap
128   (package
129     (name "classpath")
130     (version "0.93")
131     (source (origin
132               (method url-fetch)
133               (uri (string-append "mirror://gnu/classpath/classpath-"
134                                   version ".tar.gz"))
135               (sha256
136                (base32
137                 "0i99wf9xd3hw1sj2sazychb9prx8nadxh2clgvk3zlmb28v0jbfz"))
138               (patches (search-patches "classpath-aarch64-support.patch"))))
139     (build-system gnu-build-system)
140     (arguments
141      `(#:configure-flags
142        (list (string-append "JAVAC="
143                             (assoc-ref %build-inputs "jikes")
144                             "/bin/jikes")
145              "--disable-Werror"
146              "--disable-gmp"
147              "--disable-gtk-peer"
148              "--disable-gconf-peer"
149              "--disable-plugin"
150              "--disable-dssi"
151              "--disable-alsa"
152              "--disable-gjdoc")
153        #:phases
154        (modify-phases %standard-phases
155          (add-after 'install 'install-data
156            (lambda _ (invoke "make" "install-data"))))))
157     (native-inputs
158      `(("jikes" ,jikes)
159        ("fastjar" ,fastjar)
160        ("libltdl" ,libltdl)
161        ("pkg-config" ,pkg-config)))
162     (home-page "https://www.gnu.org/software/classpath/")
163     (synopsis "Essential libraries for Java")
164     (description "GNU Classpath is a project to create core class libraries
165 for use with runtimes, compilers and tools for the Java programming
166 language.")
167     ;; GPLv2 or later, with special linking exception.
168     (license license:gpl2+)))
170 ;; This is the last version of JamVM that works with a version of GNU
171 ;; classpath that does not require ECJ.
172 (define jamvm-1-bootstrap
173   (package
174     (name "jamvm")
175     (version "1.5.1")
176     (source (origin
177               (method url-fetch)
178               (uri (string-append "mirror://sourceforge/jamvm/jamvm/"
179                                   "JamVM%20" version "/jamvm-"
180                                   version ".tar.gz"))
181               (patches (search-patches "jamvm-arm.patch"))
182               (sha256
183                (base32
184                 "06lhi03l3b0h48pc7x58bk9my2nrcf1flpmglvys3wyad6yraf36"))))
185     (build-system gnu-build-system)
186     (arguments
187      `(#:configure-flags
188        (list (string-append "--with-classpath-install-dir="
189                             (assoc-ref %build-inputs "classpath")))))
190     (inputs
191      `(("classpath" ,classpath-bootstrap)
192        ("jikes" ,jikes)
193        ("zlib" ,zlib)))
194     (home-page "http://jamvm.sourceforge.net/")
195     (synopsis "Small Java Virtual Machine")
196     (description "JamVM is a Java Virtual Machine conforming to the JVM
197 specification edition 2 (blue book).  It is extremely small.  However, unlike
198 other small VMs it supports the full spec, including object finalisation and
199 JNI.")
200     (license license:gpl2+)))
202 (define ant-bootstrap
203   (package
204     (name "ant-bootstrap")
205     ;; The 1.10.x series requires Java 8.  1.9.0 and later use generics, which
206     ;; are not supported.  The 1.8.x series is the last to use only features
207     ;; supported by Jikes.
208     (version "1.8.4")
209     (source (origin
210               (method url-fetch)
211               (uri (string-append "http://archive.apache.org/dist/"
212                                   "ant/source/apache-ant-"
213                                   version "-src.tar.bz2"))
214               (sha256
215                (base32
216                 "1cg0lga887qz5iizh6mlkxp01lciymrhmp7wzxpl6zpnldxmzrjx"))))
217     (build-system gnu-build-system)
218     (arguments
219      `(#:imported-modules ((guix build syscalls)
220                            ,@%gnu-build-system-modules)
221        #:modules ((srfi srfi-1)
222                   (guix build gnu-build-system)
223                   (guix build utils)
224                   (guix build syscalls))
225        #:tests? #f ; no "check" target
226        #:phases
227        (modify-phases %standard-phases
228          (delete 'bootstrap)
229          (delete 'configure)
230          (replace 'build
231            (lambda* (#:key inputs #:allow-other-keys)
232              (setenv "JAVA_HOME" (assoc-ref inputs "jamvm"))
233              (setenv "JAVACMD"
234                      (string-append (assoc-ref inputs "jamvm")
235                                     "/bin/jamvm"))
236              (setenv "JAVAC"
237                      (string-append (assoc-ref inputs "jikes")
238                                     "/bin/jikes"))
239              (setenv "CLASSPATH"
240                      (string-append (assoc-ref inputs "jamvm")
241                                     "/lib/rt.jar"))
243              ;; Ant complains if this file doesn't exist.
244              (setenv "HOME" "/tmp")
245              (with-output-to-file "/tmp/.ant.properties"
246                (lambda _ (display "")))
248              ;; Use jikes instead of javac for <javac ...> tags in build.xml
249              (setenv "ANT_OPTS" "-Dbuild.compiler=jikes")
251              ;; jikes produces lots of warnings, but they are not very
252              ;; interesting, so we silence them.
253              (setenv "$BOOTJAVAC_OPTS" "-nowarn")
255              ;; Without these JamVM options the build may freeze.
256              (substitute* "bootstrap.sh"
257                (("^\"\\$\\{JAVACMD\\}\" " m)
258                 ,@(if (string-prefix? "armhf" (or (%current-system)
259                                                   (%current-target-system)))
260                       `((string-append m "-Xnocompact "))
261                       `((string-append m "-Xnocompact -Xnoinlining ")))))
263              ;; Disable tests because we are bootstrapping and thus don't have
264              ;; any of the dependencies required to build and run the tests.
265              (substitute* "build.xml"
266                (("depends=\"jars,test-jar\"") "depends=\"jars\""))
267              (invoke "bash" "bootstrap.sh"
268                      (string-append "-Ddist.dir="
269                                     (assoc-ref %outputs "out")))))
270          (add-after 'build 'strip-jar-timestamps ;based on ant-build-system
271            (lambda* (#:key outputs #:allow-other-keys)
272              (define (repack-archive jar)
273                (let* ((dir (mkdtemp! "jar-contents.XXXXXX"))
274                       (manifest (string-append dir "/META-INF/MANIFESTS.MF")))
275                  (with-directory-excursion dir
276                    (invoke "unzip" jar))
277                  (delete-file jar)
278                  ;; XXX: copied from (gnu build install)
279                  (for-each (lambda (file)
280                              (let ((s (lstat file)))
281                                (unless (eq? (stat:type s) 'symlink)
282                                  (utime file  0 0 0 0))))
283                            (find-files dir #:directories? #t))
284                  ;; It is important that the manifest appears first.
285                  (with-directory-excursion dir
286                    (let* ((files (find-files "." ".*" #:directories? #t))
287                           ;; To ensure that the reference scanner can
288                           ;; detect all store references in the jars
289                           ;; we disable compression with the "-0" option.
290                           (command (if (file-exists? manifest)
291                                        `("zip" "-0" "-X" ,jar ,manifest
292                                          ,@files)
293                                        `("zip" "-0" "-X" ,jar ,@files))))
294                      (apply invoke command)))))
295              (for-each repack-archive
296                     (find-files
297                      (string-append (assoc-ref %outputs "out") "/lib")
298                      "\\.jar$"))
299              #t))
300          (delete 'install))))
301     (native-inputs
302      `(("jikes" ,jikes)
303        ("jamvm" ,jamvm-1-bootstrap)
304        ("unzip" ,unzip)
305        ("zip" ,zip)))
306     (home-page "http://ant.apache.org")
307     (synopsis "Build tool for Java")
308     (description
309      "Ant is a platform-independent build tool for Java.  It is similar to
310 make but is implemented using the Java language, requires the Java platform,
311 and is best suited to building Java projects.  Ant uses XML to describe the
312 build process and its dependencies, whereas Make uses Makefile format.")
313     (license license:asl2.0)))
315 ;; Version 3.2.2 is the last version without a dependency on a full-fledged
316 ;; compiler for Java 1.5.
317 (define ecj-bootstrap
318   (package
319     (name "ecj-bootstrap")
320     (version "3.2.2")
321     (source (origin
322               (method url-fetch)
323               (uri (string-append "http://archive.eclipse.org/eclipse/"
324                                   "downloads/drops/R-" version
325                                   "-200702121330/ecjsrc.zip"))
326               (sha256
327                (base32
328                 "05hj82kxd23qaglsjkaqcj944riisjha7acf7h3ljhrjyljx8307"))))
329     ;; It would be so much easier if we could use the ant-build-system, but we
330     ;; cannot as we don't have ant at this point.  We use ecj for
331     ;; bootstrapping the JDK.
332     (build-system gnu-build-system)
333     (arguments
334      `(#:modules ((guix build gnu-build-system)
335                   (guix build utils)
336                   (srfi srfi-1))
337        #:tests? #f ; there are no tests
338        #:phases
339        (modify-phases %standard-phases
340          (replace 'configure
341            (lambda* (#:key inputs #:allow-other-keys)
342              (setenv "CLASSPATH"
343                      (string-join
344                       (cons (string-append (assoc-ref inputs "jamvm")
345                                            "/lib/rt.jar")
346                             (find-files (string-append
347                                          (assoc-ref inputs "ant-bootstrap")
348                                          "/lib")
349                                         "\\.jar$"))
350                       ":"))
351              #t))
352          (replace 'build
353            (lambda* (#:key inputs #:allow-other-keys)
354              ;; The unpack phase enters the "org" directory by mistake.
355              (chdir "..")
357              ;; Create a simple manifest to make ecj executable.
358              (with-output-to-file "manifest"
359                (lambda _
360                  (display "Manifest-Version: 1.0
361 Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n")))
363              ;; Compile it all!
364              (and (apply invoke "jikes"
365                          (find-files "." "\\.java$"))
366                   (invoke "fastjar" "cvfm"
367                           "ecj-bootstrap.jar" "manifest" "."))))
368          (replace 'install
369            (lambda* (#:key outputs #:allow-other-keys)
370              (let ((share (string-append (assoc-ref outputs "out")
371                                          "/share/java/")))
372                (mkdir-p share)
373                (install-file "ecj-bootstrap.jar" share)
374                #t))))))
375     (native-inputs
376      `(("ant-bootstrap" ,ant-bootstrap)
377        ("unzip" ,unzip)
378        ("jikes" ,jikes)
379        ("jamvm" ,jamvm-1-bootstrap)
380        ("fastjar" ,fastjar)))
381     (home-page "https://eclipse.org")
382     (synopsis "Eclipse Java development tools core batch compiler")
383     (description "This package provides the Eclipse Java core batch compiler
384 for bootstrapping purposes.  The @dfn{Eclipse compiler for Java} (ecj) is a
385 requirement for all GNU Classpath releases after version 0.93.")
386     (license license:epl1.0)))
388 (define ecj-javac-wrapper
389   (package (inherit ecj-bootstrap)
390     (name "ecj-javac-wrapper")
391     (source #f)
392     (build-system trivial-build-system)
393     (arguments
394      `(#:modules ((guix build utils))
395        #:builder
396        (begin
397          (use-modules (guix build utils))
398          (let* ((bin    (string-append (assoc-ref %outputs "out") "/bin"))
399                 (target (string-append bin "/javac"))
400                 (guile  (string-append (assoc-ref %build-inputs "guile")
401                                        "/bin/guile"))
402                 (ecj    (string-append (assoc-ref %build-inputs "ecj-bootstrap")
403                                        "/share/java/ecj-bootstrap.jar"))
404                 (java   (string-append (assoc-ref %build-inputs "jamvm")
405                                        "/bin/jamvm"))
406                 (bootcp (let ((jvmlib (string-append (assoc-ref %build-inputs "classpath")
407                                                      "/share/classpath")))
408                           (string-append jvmlib "/glibj.zip:"
409                                          jvmlib "/tools.zip"))))
410            (mkdir-p bin)
411            (with-output-to-file target
412              (lambda _
413                (format #t "#!~a --no-auto-compile\n!#\n" guile)
414                (write
415                 `(begin (use-modules (ice-9 match)
416                                      (ice-9 receive)
417                                      (ice-9 hash-table)
418                                      (srfi srfi-1)
419                                      (srfi srfi-26))
420                         (define defaults
421                           '(("-bootclasspath" ,bootcp)
422                             ("-source" "1.5")
423                             ("-target" "1.5")
424                             ("-cp"     ".")))
425                         (define (main args)
426                           (let ((classpath (getenv "CLASSPATH")))
427                             (setenv "CLASSPATH"
428                                     (string-join (list ,ecj
429                                                        ,(string-append (assoc-ref %build-inputs "jamvm")
430                                                                        "/lib/rt.jar")
431                                                        (or classpath ""))
432                                                  ":")))
433                           (receive (vm-args other-args)
434                               ;; Separate VM arguments from arguments to ECJ.
435                               (partition (cut string-prefix? "-J" <>)
436                                          (fold (lambda (default acc)
437                                                  (if (member (first default) acc)
438                                                      acc (append default acc)))
439                                                args defaults))
440                             (apply system* ,java
441                                    (append
442                                     ;; Remove "-J" prefix
443                                     (map (cut string-drop <> 2) vm-args)
444                                     '("org.eclipse.jdt.internal.compiler.batch.Main")
445                                     (cons "-nowarn" other-args)))))
446                         ;; Entry point
447                         (let ((args (cdr (command-line))))
448                           (if (null? args)
449                               (format (current-error-port) "javac: no arguments given!\n")
450                               (main args)))))))
451            (chmod target #o755)
452            #t))))
453     (native-inputs
454      `(("guile" ,guile-2.2)
455        ("ecj-bootstrap" ,ecj-bootstrap)
456        ("jamvm" ,jamvm-1-bootstrap)
457        ("classpath" ,classpath-bootstrap)))
458     (description "This package provides a wrapper around the @dfn{Eclipse
459 compiler for Java} (ecj) with a command line interface that is compatible with
460 the standard javac executable.")))
462 ;; The classpath-bootstrap was built without a virtual machine, so it does not
463 ;; provide a wrapper for javah.  We cannot build the development version of
464 ;; Classpath without javah.
465 (define classpath-0.99
466   (package (inherit classpath-bootstrap)
467     (version "0.99")
468     (source (origin
469               (method url-fetch)
470               (uri (string-append "mirror://gnu/classpath/classpath-"
471                                   version ".tar.gz"))
472               (sha256
473                (base32
474                 "1j7cby4k66f1nvckm48xcmh352b1d1b33qk7l6hi7dp9i9zjjagr"))
475               (patches (search-patches "classpath-aarch64-support.patch"))))
476     (arguments
477      `(#:configure-flags
478        (list (string-append "--with-ecj-jar="
479                             (assoc-ref %build-inputs "ecj-bootstrap")
480                             "/share/java/ecj-bootstrap.jar")
481              (string-append "JAVAC="
482                             (assoc-ref %build-inputs "ecj-javac-wrapper")
483                             "/bin/javac")
484              (string-append "JAVA="
485                             (assoc-ref %build-inputs "jamvm")
486                             "/bin/jamvm")
487              "GCJ_JAVAC_TRUE=no"
488              "ac_cv_prog_java_works=yes"  ; trust me
489              "--disable-Werror"
490              "--disable-gmp"
491              "--disable-gtk-peer"
492              "--disable-gconf-peer"
493              "--disable-plugin"
494              "--disable-dssi"
495              "--disable-alsa"
496              "--disable-gjdoc")
497        #:phases
498        (modify-phases %standard-phases
499          (add-after 'install 'install-data
500            (lambda _ (invoke "make" "install-data"))))))
501     (native-inputs
502      `(("ecj-bootstrap" ,ecj-bootstrap)
503        ("ecj-javac-wrapper" ,ecj-javac-wrapper)
504        ("fastjar" ,fastjar)
505        ("jamvm" ,jamvm-1-bootstrap)
506        ("classpath" ,classpath-bootstrap)
507        ("libltdl" ,libltdl)
508        ("pkg-config" ,pkg-config)))))
510 ;; We need this because classpath-bootstrap does not provide all of the tools
511 ;; we need to build classpath-devel.
512 (define classpath-jamvm-wrappers
513   (package (inherit classpath-0.99)
514     (name "classpath-jamvm-wrappers")
515     (source #f)
516     (build-system trivial-build-system)
517     (arguments
518      `(#:modules ((guix build utils))
519        #:builder
520        (begin
521          (use-modules (guix build utils))
522          (let* ((bash      (assoc-ref %build-inputs "bash"))
523                 (jamvm     (assoc-ref %build-inputs "jamvm"))
524                 (classpath (assoc-ref %build-inputs "classpath"))
525                 (bin       (string-append (assoc-ref %outputs "out")
526                                           "/bin/")))
527            (mkdir-p bin)
528            (for-each (lambda (tool)
529                        (with-output-to-file (string-append bin tool)
530                          (lambda _
531                            ,@(if (string-prefix? "armhf" (or (%current-system)
532                                                              (%current-target-system)))
533                                  `((format #t "#!~a/bin/sh
534 ~a/bin/jamvm -Xnocompact -classpath ~a/share/classpath/tools.zip \
535 gnu.classpath.tools.~a.~a $@"
536                                    bash jamvm classpath tool
537                                    (if (string=? "native2ascii" tool)
538                                        "Native2ASCII" "Main")))
539                                  `((format #t "#!~a/bin/sh
540 ~a/bin/jamvm -Xnocompact -Xnoinlining -classpath ~a/share/classpath/tools.zip \
541 gnu.classpath.tools.~a.~a $@"
542                                    bash jamvm classpath tool
543                                    (if (string=? "native2ascii" tool)
544                                        "Native2ASCII" "Main"))))))
545                        (chmod (string-append bin tool) #o755))
546                      (list "javah"
547                            "rmic"
548                            "rmid"
549                            "orbd"
550                            "rmiregistry"
551                            "native2ascii"))
552            #t))))
553     (native-inputs
554      `(("bash" ,bash)
555        ("jamvm" ,jamvm-1-bootstrap)
556        ("classpath" ,classpath-0.99)))
557     (inputs '())
558     (synopsis "Executables from GNU Classpath")
559     (description "This package provides wrappers around the tools provided by
560 the GNU Classpath library.  They are executed by the JamVM virtual
561 machine.")))
563 ;; The last release of GNU Classpath is 0.99 and it happened in 2012.  Since
564 ;; then Classpath has gained much more support for Java 1.6.
565 (define-public classpath-devel
566   (let ((commit "e7c13ee0cf2005206fbec0eca677f8cf66d5a103")
567         (revision "1"))
568     (package (inherit classpath-bootstrap)
569       (version (string-append "0.99-" revision "." (string-take commit 9)))
570       (source (origin
571                 (method git-fetch)
572                 (uri (git-reference
573                       (url "https://git.savannah.gnu.org/git/classpath.git")
574                       (commit commit)))
575                 (file-name (string-append "classpath-" version "-checkout"))
576                 (sha256
577                  (base32
578                   "1v2rww76ww322mpg3s12a1kkc6gkp31bm9gcxs532h0wq285fiw4"))))
579       (arguments
580        `(#:make-flags
581          ;; Ensure that the initial heap size is smaller than the maximum
582          ;; size.  By default only Xmx is set, which can lead to invalid
583          ;; memory settings on some machines with a lot of memory.
584          '("JAVAC_MEM_OPT=-J-Xms512M -J-Xmx768M")
585          #:configure-flags
586          (list (string-append "--with-ecj-jar="
587                               (assoc-ref %build-inputs "ecj-bootstrap")
588                               "/share/java/ecj-bootstrap.jar")
589                (string-append "--with-javac="
590                               (assoc-ref %build-inputs "ecj-javac-wrapper")
591                               "/bin/javac")
592                (string-append "JAVA="
593                               (assoc-ref %build-inputs "jamvm")
594                               "/bin/jamvm")
595                "GCJ_JAVAC_TRUE=no"
596                "ac_cv_prog_java_works=yes" ; trust me
597                "--disable-Werror"
598                "--disable-gmp"
599                "--disable-gtk-peer"
600                "--disable-gconf-peer"
601                "--disable-plugin"
602                "--disable-dssi"
603                "--disable-alsa"
604                "--disable-gjdoc")
605          #:phases
606          (modify-phases %standard-phases
607            ;; XXX The bootstrap phase executes autogen.sh, which fails after
608            ;; complaining about the lack of gettext.
609            (replace 'bootstrap
610              (lambda _ (invoke "autoreconf" "-vif")))
611            (add-after 'unpack 'remove-unsupported-annotations
612              (lambda _
613                (substitute* (find-files "java" "\\.java$")
614                  (("@Override") ""))
615                #t))
616            (add-after 'install 'install-data
617              (lambda _ (invoke "make" "install-data"))))))
618       (native-inputs
619        `(("autoconf" ,autoconf)
620          ("automake" ,automake)
621          ("libtool" ,libtool)
622          ("gettext" ,gettext-minimal)
623          ("texinfo" ,texinfo)
624          ("classpath-jamvm-wrappers" ,classpath-jamvm-wrappers) ; for javah
625          ("ecj-bootstrap" ,ecj-bootstrap)
626          ("ecj-javac-wrapper" ,ecj-javac-wrapper)
627          ("fastjar" ,fastjar)
628          ("jamvm" ,jamvm-1-bootstrap)
629          ("libltdl" ,libltdl)
630          ("pkg-config" ,pkg-config))))))
632 (define jamvm
633   (package (inherit jamvm-1-bootstrap)
634     (version "2.0.0")
635     (source (origin
636               (method url-fetch)
637               (uri (string-append "mirror://sourceforge/jamvm/jamvm/"
638                                   "JamVM%20" version "/jamvm-"
639                                   version ".tar.gz"))
640               (sha256
641                (base32
642                 "1nl0zxz8y5x8gwsrm7n32bry4dx8x70p8z3s9jbdvs8avyb8whkn"))))
643     (build-system gnu-build-system)
644     (arguments
645      `(#:configure-flags
646        (list (string-append "--with-classpath-install-dir="
647                             (assoc-ref %build-inputs "classpath")))))
648     (inputs
649      `(("classpath" ,classpath-devel)
650        ("ecj-javac-wrapper" ,ecj-javac-wrapper)
651        ("zlib" ,zlib)))))
653 (define ecj-javac-wrapper-final
654   (package (inherit ecj-javac-wrapper)
655     (native-inputs
656      `(("guile" ,guile-2.2)
657        ("ecj-bootstrap" ,ecj-bootstrap)
658        ("jamvm" ,jamvm)
659        ("classpath" ,classpath-devel)))))
661 ;; The bootstrap JDK consisting of jamvm, classpath-devel,
662 ;; ecj-javac-wrapper-final cannot build Icedtea 2.x directly, because it's
663 ;; written in Java 7.  It can, however, build the unmaintained Icedtea 1.x,
664 ;; which uses Java 6 only.
665 (define-public icedtea-6
666   (package
667     (name "icedtea")
668     (version "1.13.13")
669     (source (origin
670               (method url-fetch)
671               (uri (string-append
672                     "http://icedtea.wildebeest.org/download/source/icedtea6-"
673                     version ".tar.xz"))
674               (sha256
675                (base32
676                 "0bg9sb4f7qbq77c0zf9m17p47ga0kf0r9622g9p12ysg26jd1ksg"))
677               (modules '((guix build utils)))
678               (snippet
679                '(begin
680                   (substitute* "Makefile.in"
681                     ;; do not leak information about the build host
682                     (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
683                      "DISTRIBUTION_ID=\"\\\"guix\\\"\""))
684                   #t))))
685     (build-system gnu-build-system)
686     (outputs '("out"   ; Java Runtime Environment
687                "jdk"   ; Java Development Kit
688                "doc")) ; all documentation
689     (arguments
690      `(;; There are many failing tests and many are known to fail upstream.
691        #:tests? #f
693        ;; The DSOs use $ORIGIN to refer to each other, but (guix build
694        ;; gremlin) doesn't support it yet, so skip this phase.
695        #:validate-runpath? #f
697        #:modules ((guix build utils)
698                   (guix build gnu-build-system)
699                   (srfi srfi-19))
701        #:configure-flags
702        `("--enable-bootstrap"
703          "--enable-nss"
704          "--without-rhino"
705          "--with-parallel-jobs"
706          "--disable-downloading"
707          "--disable-tests"
708          ,(string-append "--with-ecj="
709                          (assoc-ref %build-inputs "ecj")
710                          "/share/java/ecj-bootstrap.jar")
711          ,(string-append "--with-jar="
712                          (assoc-ref %build-inputs "fastjar")
713                          "/bin/fastjar")
714          ,(string-append "--with-jdk-home="
715                          (assoc-ref %build-inputs "classpath"))
716          ,(string-append "--with-java="
717                          (assoc-ref %build-inputs "jamvm")
718                          "/bin/jamvm"))
719        #:phases
720        (modify-phases %standard-phases
721          (replace 'unpack
722            (lambda* (#:key source inputs #:allow-other-keys)
723              (invoke "tar" "xvf" source)
724              (chdir (string-append "icedtea6-" ,version))
725              (mkdir "openjdk")
726              (copy-recursively (assoc-ref inputs "openjdk-src") "openjdk")
727              ;; The convenient OpenJDK source bundle is no longer
728              ;; available for download, so we have to take the sources
729              ;; from the Mercurial repositories and change the Makefile
730              ;; to avoid tests for the OpenJDK zip archive.
731              (with-directory-excursion "openjdk"
732                (for-each (lambda (part)
733                            (mkdir part)
734                            (copy-recursively
735                             (assoc-ref inputs
736                                        (string-append part "-src"))
737                             part))
738                          '("jdk" "corba"
739                            "langtools" "jaxp" "jaxws")))
740              (with-directory-excursion "openjdk"
741                (invoke "tar" "xvf" (assoc-ref inputs "hotspot-src"))
742                (rename-file "hg-checkout" "hotspot"))
743              (substitute* "Makefile.in"
744                (("echo \"ERROR: No up-to-date OpenJDK zip available\"; exit -1;")
745                 "echo \"trust me\";")
746                ;; The contents of the bootstrap directory must be
747                ;; writeable but when copying from the store they are
748                ;; not.
749                (("mkdir -p lib/rt" line)
750                 (string-append line "; chmod -R u+w $(BOOT_DIR)")))
751              (invoke "chmod" "-R" "u+w" "openjdk")))
752          (add-after 'unpack 'use-classpath
753            (lambda* (#:key inputs #:allow-other-keys)
754              (let ((jvmlib (assoc-ref inputs "classpath"))
755                    (jamvm  (assoc-ref inputs "jamvm")))
756                ;; Classpath does not provide rt.jar.
757                (substitute* "Makefile.in"
758                  (("\\$\\(SYSTEM_JDK_DIR\\)/jre/lib/rt.jar")
759                   (string-append jvmlib "/share/classpath/glibj.zip")))
760                ;; Make sure we can find all classes.
761                (setenv "CLASSPATH"
762                        (string-append jvmlib "/share/classpath/glibj.zip:"
763                                       jvmlib "/share/classpath/tools.zip:"
764                                       jamvm  "/lib/rt.jar"))
765                (setenv "JAVACFLAGS"
766                        (string-append "-cp "
767                                       jvmlib "/share/classpath/glibj.zip:"
768                                       jvmlib "/share/classpath/tools.zip")))
769              #t))
770          (add-after 'unpack 'patch-patches
771            (lambda _
772              ;; shebang in patches so that they apply cleanly
773              (substitute* '("patches/jtreg-jrunscript.patch"
774                             "patches/hotspot/hs23/drop_unlicensed_test.patch")
775                (("#!/bin/sh") (string-append "#!" (which "sh"))))
776              #t))
777          (add-after 'unpack 'patch-paths
778            (lambda* (#:key inputs #:allow-other-keys)
779              ;; buildtree.make generates shell scripts, so we need to replace
780              ;; the generated shebang
781              (substitute* '("openjdk/hotspot/make/linux/makefiles/buildtree.make")
782                (("/bin/sh") (which "bash")))
784              (let ((corebin (string-append
785                              (assoc-ref inputs "coreutils") "/bin/"))
786                    (binbin  (string-append
787                              (assoc-ref inputs "binutils") "/bin/"))
788                    (grepbin (string-append
789                              (assoc-ref inputs "grep") "/bin/")))
790                (substitute* '("openjdk/jdk/make/common/shared/Defs-linux.gmk"
791                               "openjdk/corba/make/common/shared/Defs-linux.gmk")
792                  (("UNIXCOMMAND_PATH  = /bin/")
793                   (string-append "UNIXCOMMAND_PATH = " corebin))
794                  (("USRBIN_PATH  = /usr/bin/")
795                   (string-append "USRBIN_PATH = " corebin))
796                  (("DEVTOOLS_PATH *= */usr/bin/")
797                   (string-append "DEVTOOLS_PATH = " corebin))
798                  (("COMPILER_PATH *= */usr/bin/")
799                   (string-append "COMPILER_PATH = "
800                                  (assoc-ref inputs "gcc") "/bin/"))
801                  (("DEF_OBJCOPY *=.*objcopy")
802                   (string-append "DEF_OBJCOPY = " (which "objcopy"))))
804                ;; fix path to alsa header
805                (substitute* "openjdk/jdk/make/common/shared/Sanity.gmk"
806                  (("ALSA_INCLUDE=/usr/include/alsa/version.h")
807                   (string-append "ALSA_INCLUDE="
808                                  (assoc-ref inputs "alsa-lib")
809                                  "/include/alsa/version.h")))
811                ;; fix hard-coded utility paths
812                (substitute* '("openjdk/jdk/make/common/shared/Defs-utils.gmk"
813                               "openjdk/corba/make/common/shared/Defs-utils.gmk")
814                  (("ECHO *=.*echo")
815                   (string-append "ECHO = " (which "echo")))
816                  (("^GREP *=.*grep")
817                   (string-append "GREP = " (which "grep")))
818                  (("EGREP *=.*egrep")
819                   (string-append "EGREP = " (which "egrep")))
820                  (("CPIO *=.*cpio")
821                   (string-append "CPIO = " (which "cpio")))
822                  (("READELF *=.*readelf")
823                   (string-append "READELF = " (which "readelf")))
824                  (("^ *AR *=.*ar")
825                   (string-append "AR = " (which "ar")))
826                  (("^ *TAR *=.*tar")
827                   (string-append "TAR = " (which "tar")))
828                  (("AS *=.*as")
829                   (string-append "AS = " (which "as")))
830                  (("LD *=.*ld")
831                   (string-append "LD = " (which "ld")))
832                  (("STRIP *=.*strip")
833                   (string-append "STRIP = " (which "strip")))
834                  (("NM *=.*nm")
835                   (string-append "NM = " (which "nm")))
836                  (("^SH *=.*sh")
837                   (string-append "SH = " (which "bash")))
838                  (("^FIND *=.*find")
839                   (string-append "FIND = " (which "find")))
840                  (("LDD *=.*ldd")
841                   (string-append "LDD = " (which "ldd")))
842                  (("NAWK *=.*(n|g)awk")
843                   (string-append "NAWK = " (which "gawk")))
844                  (("XARGS *=.*xargs")
845                   (string-append "XARGS = " (which "xargs")))
846                  (("UNZIP *=.*unzip")
847                   (string-append "UNZIP = " (which "unzip")))
848                  (("ZIPEXE *=.*zip")
849                   (string-append "ZIPEXE = " (which "zip")))
850                  (("SED *=.*sed")
851                   (string-append "SED = " (which "sed"))))
853                ;; Some of these timestamps cause problems as they are more than
854                ;; 10 years ago, failing the build process.
855                (substitute*
856                    "openjdk/jdk/src/share/classes/java/util/CurrencyData.properties"
857                  (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
858                  (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
859                  (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
860                  (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY"))
861                #t)))
862          (add-before 'configure 'set-additional-paths
863            (lambda* (#:key inputs #:allow-other-keys)
864              (setenv "CPATH"
865                      (string-append (assoc-ref inputs "libxrender")
866                                     "/include/X11/extensions" ":"
867                                     (assoc-ref inputs "libxtst")
868                                     "/include/X11/extensions" ":"
869                                     (assoc-ref inputs "libxinerama")
870                                     "/include/X11/extensions" ":"
871                                     (or (getenv "CPATH") "")))
872              (setenv "ALT_CUPS_HEADERS_PATH"
873                      (string-append (assoc-ref inputs "cups")
874                                     "/include"))
875              (setenv "ALT_FREETYPE_HEADERS_PATH"
876                      (string-append (assoc-ref inputs "freetype")
877                                     "/include"))
878              (setenv "ALT_FREETYPE_LIB_PATH"
879                      (string-append (assoc-ref inputs "freetype")
880                                     "/lib"))
881              #t))
882          (add-before 'build 'disable-os-version-check
883            ;; allow build on linux major version change
884            (lambda _
885              (setenv "DISABLE_HOTSPOT_OS_VERSION_CHECK" "ok")
886              #t))
887          (replace 'install
888            (lambda* (#:key outputs #:allow-other-keys)
889              (let ((doc (string-append (assoc-ref outputs "doc")
890                                        "/share/doc/icedtea"))
891                    (jre (assoc-ref outputs "out"))
892                    (jdk (assoc-ref outputs "jdk")))
893                (copy-recursively "openjdk.build/docs" doc)
894                (copy-recursively "openjdk.build/j2re-image" jre)
895                (copy-recursively "openjdk.build/j2sdk-image" jdk))
896              #t)))))
897     (native-inputs
898      `(("ant" ,ant-bootstrap)
899        ("alsa-lib" ,alsa-lib)
900        ("attr" ,attr)
901        ("classpath" ,classpath-devel)
902        ("coreutils" ,coreutils)
903        ("cpio" ,cpio)
904        ("cups" ,cups)
905        ("ecj" ,ecj-bootstrap)
906        ("ecj-javac" ,ecj-javac-wrapper-final)
907        ("fastjar" ,fastjar)
908        ("fontconfig" ,fontconfig)
909        ("freetype" ,freetype)
910        ("gcc" ,gcc-4.9) ; there's a segmentation fault when compiling with gcc-5 or gcc-7
911        ("gtk" ,gtk+-2)
912        ("gawk" ,gawk)
913        ("giflib" ,giflib)
914        ("grep" ,grep)
915        ("jamvm" ,jamvm)
916        ("lcms" ,lcms)
917        ("libjpeg" ,libjpeg)
918        ("libnsl" ,libnsl)
919        ("libpng" ,libpng)
920        ("libtool" ,libtool)
921        ("libx11" ,libx11)
922        ("libxcomposite" ,libxcomposite)
923        ("libxi" ,libxi)
924        ("libxinerama" ,libxinerama)
925        ("libxrender" ,libxrender)
926        ("libxslt" ,libxslt) ;for xsltproc
927        ("libxt" ,libxt)
928        ("libxtst" ,libxtst)
929        ("mit-krb5" ,mit-krb5)
930        ("nss" ,nss)
931        ("nss-certs" ,nss-certs)
932        ("perl" ,perl)
933        ("pkg-config" ,pkg-config)
934        ("procps" ,procps) ;for "free", even though I'm not sure we should use it
935        ("unzip" ,unzip)
936        ("wget" ,wget)
937        ("which" ,which)
938        ("zip" ,zip)
939        ("zlib" ,zlib)
940        ("openjdk-src"
941         ,(origin
942            (method hg-fetch)
943            (uri (hg-reference
944                  (url "http://hg.openjdk.java.net/jdk6/jdk6/")
945                  (changeset "jdk6-b41")))
946            (sha256
947             (base32
948              "14q47yfg586fs64w30g8mk92m5dkxsvr36zzh0ra99xk5x0x96mv"))))
949        ("jdk-src"
950         ,(origin
951            (method hg-fetch)
952            (uri (hg-reference
953                  (url "http://hg.openjdk.java.net/jdk6/jdk6/jdk/")
954                  (changeset "jdk6-b41")))
955            (sha256
956             (base32
957              "165824nhg1k1dx6zs9dny0j49rmk35jw5b13dmz8c77jfajml4v9"))))
958        ("hotspot-src"
959         ,(origin
960            (method hg-fetch)
961            (uri (hg-reference
962                  (url "http://hg.openjdk.java.net/jdk6/jdk6/hotspot/")
963                  (changeset "jdk6-b41")))
964            (sha256
965             (base32
966              "07lc1z4k5dj9nrc1wvwmpvxr3xgxrdkdh53xb95skk5ij49yagfd"))
967            (patches
968             (search-patches "icedtea-6-hotspot-gcc-segfault-workaround.patch"))))
969        ("corba-src"
970         ,(origin
971            (method hg-fetch)
972            (uri (hg-reference
973                  (url "http://hg.openjdk.java.net/jdk6/jdk6/corba/")
974                  (changeset "jdk6-b41")))
975            (sha256
976             (base32
977              "1p9g1r9dnax2iwp7yb59qx7m4nmshqhwmrb2b8jj8zgbd9dl2i3q"))))
978        ("langtools-src"
979         ,(origin
980            (method hg-fetch)
981            (uri (hg-reference
982                  (url "http://hg.openjdk.java.net/jdk6/jdk6/langtools/")
983                  (changeset "jdk6-b41")))
984            (sha256
985             (base32
986              "1x52wd67fynbbd9ild6fb4wvba3f5hhwk03qdjfazd0a1qr37z3d"))))
987        ("jaxp-src"
988         ,(origin
989            (method hg-fetch)
990            (uri (hg-reference
991                  (url "http://hg.openjdk.java.net/jdk6/jdk6/jaxp/")
992                  (changeset "jdk6-b41")))
993            (sha256
994             (base32
995              "0shlqrvzpr4nrkmv215lbxnby63s3yvbdh1yxcayznsyqwa4nlxm"))))
996        ("jaxws-src"
997         ,(origin
998            (method hg-fetch)
999            (uri (hg-reference
1000                  (url "http://hg.openjdk.java.net/jdk6/jdk6/jaxws/")
1001                  (changeset "jdk6-b41")))
1002            (sha256
1003             (base32
1004              "0835lkw8vib1xhp8lxnybhlvzdh699hbi4mclxanydjk63zbpxk0"))))))
1005     (home-page "http://icedtea.classpath.org")
1006     (synopsis "Java development kit")
1007     (description
1008      "This package provides the OpenJDK built with the IcedTea build harness.
1009 This version of the OpenJDK is no longer maintained and is only used for
1010 bootstrapping purposes.")
1011     ;; IcedTea is released under the GPL2 + Classpath exception, which is the
1012     ;; same license as both GNU Classpath and OpenJDK.
1013     (license license:gpl2+)))
1015 (define-public icedtea-7
1016   (let* ((version "2.6.13")
1017          (drop (lambda (name hash)
1018                  (origin
1019                    (method url-fetch)
1020                    (uri (string-append
1021                          "http://icedtea.classpath.org/download/drops"
1022                          "/icedtea7/" version "/" name ".tar.bz2"))
1023                    (sha256 (base32 hash))))))
1024     (package
1025       (name "icedtea")
1026       (version version)
1027       (source (origin
1028                 (method url-fetch)
1029                 (uri (string-append
1030                       "http://icedtea.wildebeest.org/download/source/icedtea-"
1031                       version ".tar.xz"))
1032                 (sha256
1033                  (base32
1034                   "1w331rdqx1dcx2xb0fmjmrkdc71xqn20fxsgw8by4xhiblh88khh"))
1035                 (modules '((guix build utils)))
1036                 (snippet
1037                  '(begin
1038                     (substitute* "Makefile.in"
1039                       ;; do not leak information about the build host
1040                       (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
1041                        "DISTRIBUTION_ID=\"\\\"guix\\\"\""))
1042                     #t))))
1043       (build-system gnu-build-system)
1044       (outputs '("out"   ; Java Runtime Environment
1045                  "jdk"   ; Java Development Kit
1046                  "doc")) ; all documentation
1047       (arguments
1048        `(;; There are many test failures.  Some are known to
1049          ;; fail upstream, others relate to not having an X
1050          ;; server running at test time, yet others are a
1051          ;; complete mystery to me.
1053          ;; hotspot:   passed: 241; failed: 45; error: 2
1054          ;; langtools: passed: 1,934; failed: 26
1055          ;; jdk:       unknown
1056          #:tests? #f
1058          ;; The DSOs use $ORIGIN to refer to each other, but (guix build
1059          ;; gremlin) doesn't support it yet, so skip this phase.
1060          #:validate-runpath? #f
1062          ;; Apparently, the C locale is needed for some of the tests.
1063          #:locale "C"
1065          #:modules ((guix build utils)
1066                     (guix build gnu-build-system)
1067                     (ice-9 match)
1068                     (ice-9 popen)
1069                     (srfi srfi-19)
1070                     (srfi srfi-26))
1072          #:configure-flags
1073          ;; TODO: package pcsc and sctp, and add to inputs
1074          `("--disable-system-pcsc"
1075            "--disable-system-sctp"
1076            "--enable-bootstrap"
1077            "--enable-nss"
1078            "--without-rhino"
1079            "--disable-downloading"
1080            "--disable-tests"        ;they are run in the check phase instead
1081            "--with-openjdk-src-dir=./openjdk.src"
1082            ,(string-append "--with-jdk-home="
1083                            (assoc-ref %build-inputs "jdk")))
1085          #:phases
1086          (modify-phases %standard-phases
1087            (replace 'unpack
1088              (lambda* (#:key source inputs #:allow-other-keys)
1089                (let ((target (string-append "icedtea-" ,version))
1090                      (unpack (lambda* (name #:optional dir)
1091                                (let ((dir (or dir
1092                                               (string-drop-right name 5))))
1093                                  (mkdir dir)
1094                                  (invoke "tar" "xvf"
1095                                          (assoc-ref inputs name)
1096                                          "-C" dir
1097                                          "--strip-components=1")))))
1098                  (mkdir target)
1099                  (invoke "tar" "xvf" source
1100                          "-C" target "--strip-components=1")
1101                  (chdir target)
1102                  (unpack "openjdk-src" "openjdk.src")
1103                  (with-directory-excursion "openjdk.src"
1104                    (for-each unpack
1105                              (filter (cut string-suffix? "-drop" <>)
1106                                      (map (match-lambda
1107                                             ((name . _) name))
1108                                           inputs))))
1109                  #t)))
1110            (add-after 'unpack 'fix-x11-extension-include-path
1111              (lambda* (#:key inputs #:allow-other-keys)
1112                (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
1113                  (((string-append "\\$\\(firstword \\$\\(wildcard "
1114                                   "\\$\\(OPENWIN_HOME\\)"
1115                                   "/include/X11/extensions\\).*$"))
1116                   (string-append (assoc-ref inputs "libxrender")
1117                                  "/include/X11/extensions"
1118                                  " -I" (assoc-ref inputs "libxtst")
1119                                  "/include/X11/extensions"
1120                                  " -I" (assoc-ref inputs "libxinerama")
1121                                  "/include/X11/extensions"))
1122                  (("\\$\\(wildcard /usr/include/X11/extensions\\)\\)") ""))
1123                #t))
1124            (add-after 'unpack 'patch-paths
1125              (lambda _
1126                ;; buildtree.make generates shell scripts, so we need to replace
1127                ;; the generated shebang
1128                (substitute* '("openjdk.src/hotspot/make/linux/makefiles/buildtree.make")
1129                  (("/bin/sh") (which "bash")))
1131                (let ((corebin (string-append
1132                                (assoc-ref %build-inputs "coreutils") "/bin/"))
1133                      (binbin  (string-append
1134                                (assoc-ref %build-inputs "binutils") "/bin/"))
1135                      (grepbin (string-append
1136                                (assoc-ref %build-inputs "grep") "/bin/")))
1137                  (substitute* '("openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
1138                                 "openjdk.src/corba/make/common/shared/Defs-linux.gmk")
1139                    (("UNIXCOMMAND_PATH  = /bin/")
1140                     (string-append "UNIXCOMMAND_PATH = " corebin))
1141                    (("USRBIN_PATH  = /usr/bin/")
1142                     (string-append "USRBIN_PATH = " corebin))
1143                    (("DEVTOOLS_PATH *= */usr/bin/")
1144                     (string-append "DEVTOOLS_PATH = " corebin))
1145                    (("COMPILER_PATH *= */usr/bin/")
1146                     (string-append "COMPILER_PATH = "
1147                                    (assoc-ref %build-inputs "gcc") "/bin/"))
1148                    (("DEF_OBJCOPY *=.*objcopy")
1149                     (string-append "DEF_OBJCOPY = " (which "objcopy"))))
1151                  ;; fix path to alsa header
1152                  (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
1153                    (("ALSA_INCLUDE=/usr/include/alsa/version.h")
1154                     (string-append "ALSA_INCLUDE="
1155                                    (assoc-ref %build-inputs "alsa-lib")
1156                                    "/include/alsa/version.h")))
1158                  ;; fix hard-coded utility paths
1159                  (substitute* '("openjdk.src/jdk/make/common/shared/Defs-utils.gmk"
1160                                 "openjdk.src/corba/make/common/shared/Defs-utils.gmk")
1161                    (("ECHO *=.*echo")
1162                     (string-append "ECHO = " (which "echo")))
1163                    (("^GREP *=.*grep")
1164                     (string-append "GREP = " (which "grep")))
1165                    (("EGREP *=.*egrep")
1166                     (string-append "EGREP = " (which "egrep")))
1167                    (("CPIO *=.*cpio")
1168                     (string-append "CPIO = " (which "cpio")))
1169                    (("READELF *=.*readelf")
1170                     (string-append "READELF = " (which "readelf")))
1171                    (("^ *AR *=.*ar")
1172                     (string-append "AR = " (which "ar")))
1173                    (("^ *TAR *=.*tar")
1174                     (string-append "TAR = " (which "tar")))
1175                    (("AS *=.*as")
1176                     (string-append "AS = " (which "as")))
1177                    (("LD *=.*ld")
1178                     (string-append "LD = " (which "ld")))
1179                    (("STRIP *=.*strip")
1180                     (string-append "STRIP = " (which "strip")))
1181                    (("NM *=.*nm")
1182                     (string-append "NM = " (which "nm")))
1183                    (("^SH *=.*sh")
1184                     (string-append "SH = " (which "bash")))
1185                    (("^FIND *=.*find")
1186                     (string-append "FIND = " (which "find")))
1187                    (("LDD *=.*ldd")
1188                     (string-append "LDD = " (which "ldd")))
1189                    (("NAWK *=.*(n|g)awk")
1190                     (string-append "NAWK = " (which "gawk")))
1191                    (("XARGS *=.*xargs")
1192                     (string-append "XARGS = " (which "xargs")))
1193                    (("UNZIP *=.*unzip")
1194                     (string-append "UNZIP = " (which "unzip")))
1195                    (("ZIPEXE *=.*zip")
1196                     (string-append "ZIPEXE = " (which "zip")))
1197                    (("SED *=.*sed")
1198                     (string-append "SED = " (which "sed"))))
1200                  ;; Some of these timestamps cause problems as they are more than
1201                  ;; 10 years ago, failing the build process.
1202                  (substitute*
1203                      "openjdk.src/jdk/src/share/classes/java/util/CurrencyData.properties"
1204                    (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
1205                    (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
1206                    (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
1207                    (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY")))
1208                #t))
1209            (add-before 'configure 'set-additional-paths
1210              (lambda* (#:key inputs #:allow-other-keys)
1211                (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
1212                  (("ALSA_INCLUDE=/usr/include/alsa/version.h")
1213                   (string-append "ALSA_INCLUDE="
1214                                  (assoc-ref inputs "alsa-lib")
1215                                  "/include/alsa/version.h")))
1216                (setenv "CC" "gcc")
1217                (setenv "CPATH"
1218                        (string-append (assoc-ref inputs "libxcomposite")
1219                                       "/include/X11/extensions" ":"
1220                                       (assoc-ref inputs "libxrender")
1221                                       "/include/X11/extensions" ":"
1222                                       (assoc-ref inputs "libxtst")
1223                                       "/include/X11/extensions" ":"
1224                                       (assoc-ref inputs "libxinerama")
1225                                       "/include/X11/extensions" ":"
1226                                       (or (getenv "CPATH") "")))
1227                (setenv "ALT_OBJCOPY" (which "objcopy"))
1228                (setenv "ALT_CUPS_HEADERS_PATH"
1229                        (string-append (assoc-ref inputs "cups")
1230                                       "/include"))
1231                (setenv "ALT_FREETYPE_HEADERS_PATH"
1232                        (string-append (assoc-ref inputs "freetype")
1233                                       "/include"))
1234                (setenv "ALT_FREETYPE_LIB_PATH"
1235                        (string-append (assoc-ref inputs "freetype")
1236                                       "/lib"))
1237                #t))
1238            (add-before 'build 'disable-os-version-check
1239            ;; allow build on linux major version change
1240            (lambda _
1241              (setenv "DISABLE_HOTSPOT_OS_VERSION_CHECK" "ok")
1242              #t))
1243            (add-before 'check 'fix-test-framework
1244              (lambda _
1245                ;; Fix PATH in test environment
1246                (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
1247                  (("PATH=/bin:/usr/bin")
1248                   (string-append "PATH=" (getenv "PATH"))))
1249                (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
1250                  (("/usr/bin/env") (which "env")))
1251                (substitute* "openjdk.src/hotspot/test/test_env.sh"
1252                  (("/bin/rm") (which "rm"))
1253                  (("/bin/cp") (which "cp"))
1254                  (("/bin/mv") (which "mv")))
1255                #t))
1256            (add-before 'check 'fix-hotspot-tests
1257              (lambda _
1258                (with-directory-excursion "openjdk.src/hotspot/test/"
1259                  (substitute* "jprt.config"
1260                    (("PATH=\"\\$\\{path4sdk\\}\"")
1261                     (string-append "PATH=" (getenv "PATH")))
1262                    (("make=/usr/bin/make")
1263                     (string-append "make=" (which "make"))))
1264                  (substitute* '("runtime/6626217/Test6626217.sh"
1265                                 "runtime/7110720/Test7110720.sh")
1266                    (("/bin/rm") (which "rm"))
1267                    (("/bin/cp") (which "cp"))
1268                    (("/bin/mv") (which "mv"))))
1269                #t))
1270            (add-before 'check 'fix-jdk-tests
1271              (lambda _
1272                (with-directory-excursion "openjdk.src/jdk/test/"
1273                  (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
1274                    (("/bin/pwd") (which "pwd")))
1275                  (substitute* "com/sun/jdi/ShellScaffold.sh"
1276                    (("/bin/kill") (which "kill")))
1277                  (substitute* "start-Xvfb.sh"
1278                    ;;(("/usr/bin/X11/Xvfb") (which "Xvfb"))
1279                    (("/usr/bin/nohup")    (which "nohup")))
1280                  (substitute* "javax/security/auth/Subject/doAs/Test.sh"
1281                    (("/bin/rm") (which "rm")))
1282                  (substitute* "tools/launcher/MultipleJRE.sh"
1283                    (("echo \"#!/bin/sh\"")
1284                     (string-append "echo \"#!" (which "rm") "\""))
1285                    (("/usr/bin/zip") (which "zip")))
1286                  (substitute* "com/sun/jdi/OnThrowTest.java"
1287                    (("#!/bin/sh") (string-append "#!" (which "sh"))))
1288                  (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
1289                    (("/usr/bin/uptime") (which "uptime")))
1290                  (substitute* "java/lang/ProcessBuilder/Basic.java"
1291                    (("/usr/bin/env") (which "env"))
1292                    (("/bin/false") (which "false"))
1293                    (("/bin/true") (which "true"))
1294                    (("/bin/cp") (which "cp"))
1295                    (("/bin/sh") (which "sh")))
1296                  (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
1297                    (("/bin/sh") (which "sh")))
1298                  (substitute* "java/lang/ProcessBuilder/Zombies.java"
1299                    (("/usr/bin/perl") (which "perl"))
1300                    (("/bin/ps") (which "ps"))
1301                    (("/bin/true") (which "true")))
1302                  (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
1303                    (("/usr/bin/tee") (which "tee")))
1304                  (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
1305                    (("/bin/true") (which "true")))
1306                  (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
1307                    (("/bin/cat") (which "cat")))
1308                  (substitute* "java/lang/Runtime/exec/ExitValue.java"
1309                    (("/bin/sh") (which "sh"))
1310                    (("/bin/true") (which "true"))
1311                    (("/bin/kill") (which "kill")))
1312                  (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
1313                    (("/usr/bin/echo") (which "echo")))
1314                  (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
1315                    (("/usr/bin/cat") (which "cat")))
1316                  (substitute* "java/lang/Runtime/exec/SleepyCat.java"
1317                    (("/bin/cat") (which "cat"))
1318                    (("/bin/sleep") (which "sleep"))
1319                    (("/bin/sh") (which "sh")))
1320                  (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
1321                    (("/bin/cat") (which "cat")))
1322                  (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
1323                    (("/bin/chmod") (which "chmod")))
1324                  (substitute* "java/util/zip/ZipFile/Assortment.java"
1325                    (("/bin/sh") (which "sh"))))
1326                #t))
1327            (replace 'check
1328              (lambda _
1329                ;; The "make check-*" targets always return zero, so we need to
1330                ;; check for errors in the associated log files to determine
1331                ;; whether any tests have failed.
1332                (use-modules (ice-9 rdelim))
1333                (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
1334                       (checker (lambda (port)
1335                                  (let loop ()
1336                                    (let ((line (read-line port)))
1337                                      (cond
1338                                       ((eof-object? line) #t)
1339                                       ((regexp-exec error-pattern line)
1340                                        (error "test failed"))
1341                                       (else (loop)))))))
1342                       (run-test (lambda (test)
1343                                   (invoke "make" test)
1344                                   (call-with-input-file
1345                                       (string-append "test/" test ".log")
1346                                     checker))))
1347                  (when #f                 ; skip tests
1348                    (run-test "check-hotspot")
1349                    (run-test "check-langtools")
1350                    (run-test "check-jdk"))
1351                  #t)))
1352            (replace 'install
1353              (lambda* (#:key outputs #:allow-other-keys)
1354                (let ((doc (string-append (assoc-ref outputs "doc")
1355                                          "/share/doc/icedtea"))
1356                      (jre (assoc-ref outputs "out"))
1357                      (jdk (assoc-ref outputs "jdk")))
1358                  (copy-recursively "openjdk.build/docs" doc)
1359                  (copy-recursively "openjdk.build/j2re-image" jre)
1360                  (copy-recursively "openjdk.build/j2sdk-image" jdk))
1361                #t))
1362            ;; Some of the libraries in the lib/amd64 folder link to libjvm.so.
1363            ;; But that shared object is located in the server/ folder, so it
1364            ;; cannot be found.  This phase creates a symbolic link in the
1365            ;; lib/amd64 folder so that the other libraries can find it.
1366            ;;
1367            ;; See:
1368            ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1369            ;;
1370            ;; FIXME: Find the bug in the build system, so that this symlink is
1371            ;; not needed.
1372            (add-after 'install 'install-libjvm
1373              (lambda* (#:key inputs outputs #:allow-other-keys)
1374                (let* ((lib-path (string-append (assoc-ref outputs "out")
1375                                                "/lib/amd64")))
1376                  (symlink (string-append lib-path "/server/libjvm.so")
1377                           (string-append lib-path "/libjvm.so")))
1378                #t))
1379            ;; By default IcedTea only generates an empty keystore.  In order to
1380            ;; be able to use certificates in Java programs we need to generate a
1381            ;; keystore from a set of certificates.  For convenience we use the
1382            ;; certificates from the nss-certs package.
1383            (add-after 'install 'install-keystore
1384              (lambda* (#:key inputs outputs #:allow-other-keys)
1385                (let* ((keystore  "cacerts")
1386                       (certs-dir (string-append (assoc-ref inputs "nss-certs")
1387                                                 "/etc/ssl/certs"))
1388                       (keytool   (string-append (assoc-ref outputs "jdk")
1389                                                 "/bin/keytool")))
1390                  (define (extract-cert file target)
1391                    (call-with-input-file file
1392                      (lambda (in)
1393                        (call-with-output-file target
1394                          (lambda (out)
1395                            (let loop ((line (read-line in 'concat))
1396                                       (copying? #f))
1397                              (cond
1398                               ((eof-object? line) #t)
1399                               ((string-prefix? "-----BEGIN" line)
1400                                (display line out)
1401                                (loop (read-line in 'concat) #t))
1402                               ((string-prefix? "-----END" line)
1403                                (display line out)
1404                                #t)
1405                               (else
1406                                (when copying? (display line out))
1407                                (loop (read-line in 'concat) copying?)))))))))
1408                  (define (import-cert cert)
1409                    (format #t "Importing certificate ~a\n" (basename cert))
1410                    (let ((temp "tmpcert"))
1411                      (extract-cert cert temp)
1412                      (let ((port (open-pipe* OPEN_WRITE keytool
1413                                              "-import"
1414                                              "-alias" (basename cert)
1415                                              "-keystore" keystore
1416                                              "-storepass" "changeit"
1417                                              "-file" temp)))
1418                        (display "yes\n" port)
1419                        (when (not (zero? (status:exit-val (close-pipe port))))
1420                          (format #t "failed to import ~a\n" cert)))
1421                      (delete-file temp)))
1423                  ;; This is necessary because the certificate directory contains
1424                  ;; files with non-ASCII characters in their names.
1425                  (setlocale LC_ALL "en_US.utf8")
1426                  (setenv "LC_ALL" "en_US.utf8")
1428                  (for-each import-cert (find-files certs-dir "\\.pem$"))
1429                  (mkdir-p (string-append (assoc-ref outputs "out")
1430                                          "/lib/security"))
1431                  (mkdir-p (string-append (assoc-ref outputs "jdk")
1432                                          "/jre/lib/security"))
1434                  ;; The cacerts files we are going to overwrite are chmod'ed as
1435                  ;; read-only (444) in icedtea-8 (which derives from this
1436                  ;; package).  We have to change this so we can overwrite them.
1437                  (chmod (string-append (assoc-ref outputs "out")
1438                                        "/lib/security/" keystore) #o644)
1439                  (chmod (string-append (assoc-ref outputs "jdk")
1440                                        "/jre/lib/security/" keystore) #o644)
1442                  (install-file keystore
1443                                (string-append (assoc-ref outputs "out")
1444                                               "/lib/security"))
1445                  (install-file keystore
1446                                (string-append (assoc-ref outputs "jdk")
1447                                               "/jre/lib/security"))
1448                  #t))))))
1449       (native-inputs
1450        `(("openjdk-src"
1451           ,(drop "openjdk"
1452                  "0l34ikyf62hbzlf9032alzkkqvf7bpmckz4gvirvph755w7gka8l"))
1453          ("corba-drop"
1454           ,(drop "corba"
1455                  "050gv2jbg1pi6qkn8w18bwpbklfa5b0kymjvan9pncddbj8m84fz"))
1456          ("jaxp-drop"
1457           ,(drop "jaxp"
1458                  "1k6yldwnxfzdg5926r1nlfv8d1r1j7rlp2nkz6gqh05vgyamnfhl"))
1459          ("jaxws-drop"
1460           ,(drop "jaxws"
1461                  "110j7jlz47x2gg6f7653x12mssan5kvj9l9h1m1c8c92drfxbqyk"))
1462          ("jdk-drop"
1463           ,(drop "jdk"
1464                  "0d1mca38ksxvdskp9im3pp7fdijhj1n3lwq9w13r9s4v3qyskgdd"))
1465          ("langtools-drop"
1466           ,(drop "langtools"
1467                  "0nq5236fzxn3p6x8cgncl56mzcmsj07q9gymysnws4c8byc6n0qj"))
1468          ("hotspot-drop"
1469           ,(origin
1470              (method url-fetch)
1471              (uri (string-append
1472                    "http://icedtea.classpath.org/downloads/drops"
1473                    "/icedtea7/" version "/hotspot.tar.bz2"))
1474              (sha256
1475               (base32
1476                "17bdv39n4lh8l5737c96f3xgamx4y305m067p01cywgp7zaddqws"))
1477              (patches (search-patches
1478                        "icedtea-7-hotspot-gcc-segfault-workaround.patch"))))
1479          ("ant" ,ant-bootstrap)
1480          ("attr" ,attr)
1481          ("coreutils" ,coreutils)
1482          ("diffutils" ,diffutils)       ;for tests
1483          ("gawk" ,gawk)
1484          ("grep" ,grep)
1485          ("libtool" ,libtool)
1486          ("pkg-config" ,pkg-config)
1487          ("wget" ,wget)
1488          ("which" ,which)
1489          ("cpio" ,cpio)
1490          ("zip" ,zip)
1491          ("unzip" ,unzip)
1492          ("fastjar" ,fastjar)
1493          ("libxslt" ,libxslt)           ;for xsltproc
1494          ("nss-certs" ,nss-certs)
1495          ("perl" ,perl)
1496          ("procps" ,procps) ;for "free", even though I'm not sure we should use it
1497          ("jdk" ,icedtea-6 "jdk")))
1498       (inputs
1499        `(("alsa-lib" ,alsa-lib)
1500          ("cups" ,cups)
1501          ("libx11" ,libx11)
1502          ("libxcomposite" ,libxcomposite)
1503          ("libxt" ,libxt)
1504          ("libxtst" ,libxtst)
1505          ("libxi" ,libxi)
1506          ("libxinerama" ,libxinerama)
1507          ("libxrender" ,libxrender)
1508          ("libjpeg" ,libjpeg)
1509          ("libpng" ,libpng)
1510          ("mit-krb5" ,mit-krb5)
1511          ("nss" ,nss)
1512          ("giflib" ,giflib)
1513          ("fontconfig" ,fontconfig)
1514          ("freetype" ,freetype)
1515          ("lcms" ,lcms)
1516          ("zlib" ,zlib)
1517          ("gtk" ,gtk+-2)))
1518       (home-page "http://icedtea.classpath.org")
1519       (synopsis "Java development kit")
1520       (description
1521        "This package provides the Java development kit OpenJDK built with the
1522 IcedTea build harness.")
1523       ;; IcedTea is released under the GPL2 + Classpath exception, which is the
1524       ;; same license as both GNU Classpath and OpenJDK.
1525       (license license:gpl2+))))
1527 (define-public icedtea-8
1528   (let* ((version "3.7.0")
1529          (drop (lambda (name hash)
1530                  (origin
1531                    (method url-fetch)
1532                    (uri (string-append
1533                          "http://icedtea.classpath.org/download/drops"
1534                          "/icedtea8/" version "/" name ".tar.xz"))
1535                    (sha256 (base32 hash))))))
1536     (package (inherit icedtea-7)
1537       (version "3.7.0")
1538       (source (origin
1539                 (method url-fetch)
1540                 (uri (string-append
1541                       "http://icedtea.wildebeest.org/download/source/icedtea-"
1542                       version ".tar.xz"))
1543                 (sha256
1544                  (base32
1545                   "09yqzn8rpccs7cyv89hhy5zlznpgqw5x3jz0w1ccp0cz1vgs8l5w"))
1546                 (modules '((guix build utils)))
1547                 (snippet
1548                  '(begin
1549                     (substitute* '("configure"
1550                                    "acinclude.m4")
1551                       ;; Do not embed build time
1552                       (("(DIST_ID=\"Custom build).*$" _ prefix)
1553                        (string-append prefix "\"\n"))
1554                       ;; Do not leak information about the build host
1555                       (("DIST_NAME=\"\\$build_os\"")
1556                        "DIST_NAME=\"guix\""))
1557                     #t))))
1558       (arguments
1559        `(#:imported-modules
1560          ((guix build ant-build-system)
1561           (guix build syscalls)
1562           ,@%gnu-build-system-modules)
1563          ,@(substitute-keyword-arguments (package-arguments icedtea-7)
1564              ((#:modules modules)
1565               `((guix build utils)
1566                 (guix build gnu-build-system)
1567                 ((guix build ant-build-system) #:prefix ant:)
1568                 (ice-9 match)
1569                 (ice-9 popen)
1570                 (srfi srfi-19)
1571                 (srfi srfi-26)))
1572              ((#:configure-flags flags)
1573               `(let ((jdk (assoc-ref %build-inputs "jdk")))
1574                  `( ;;"--disable-bootstrap"
1575                    "--enable-bootstrap"
1576                    "--enable-nss"
1577                    "--disable-downloading"
1578                    "--disable-system-pcsc"
1579                    "--disable-system-sctp"
1580                    "--disable-tests"  ;they are run in the check phase instead
1581                    "--with-openjdk-src-dir=./openjdk.src"
1582                    ,(string-append "--with-jdk-home=" jdk))))
1583              ((#:phases phases)
1584               `(modify-phases ,phases
1585                  (delete 'fix-x11-extension-include-path)
1586                  (delete 'patch-paths)
1587                  (delete 'set-additional-paths)
1588                  (delete 'patch-patches)
1589                  ;; Prevent the keytool from recording the current time when
1590                  ;; adding certificates at build time.
1591                  (add-after 'unpack 'patch-keystore
1592                    (lambda _
1593                      (substitute* "openjdk.src/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java"
1594                        (("date = new Date\\(\\);")
1595                         "\
1596 date = (System.getenv(\"SOURCE_DATE_EPOCH\") != null) ?\
1597 new Date(Long.parseLong(System.getenv(\"SOURCE_DATE_EPOCH\"))) :\
1598 new Date();"))
1599                      #t))
1600                  (add-after 'unpack 'patch-jni-libs
1601                    ;; Hardcode dynamically loaded libraries.
1602                    (lambda _
1603                      (let* ((library-path (search-path-as-string->list
1604                                            (getenv "LIBRARY_PATH")))
1605                             (find-library (lambda (name)
1606                                             (search-path
1607                                              library-path
1608                                              (string-append "lib" name ".so")))))
1609                        (for-each
1610                         (lambda (file)
1611                           (catch 'decoding-error
1612                             (lambda ()
1613                               (substitute* file
1614                                 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
1615                                   _ name version)
1616                                  (format #f "\"~a\""  (find-library name)))
1617                                 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
1618                                  (format #f "\"~a\"" (find-library name)))))
1619                             (lambda _
1620                               ;; Those are safe to skip.
1621                               (format (current-error-port)
1622                                       "warning: failed to substitute: ~a~%"
1623                                       file))))
1624                         (find-files "openjdk.src/jdk/src/solaris/native"
1625                                     "\\.c|\\.h"))
1626                        #t)))
1627                  (replace 'install
1628                    (lambda* (#:key outputs #:allow-other-keys)
1629                      (let ((doc (string-append (assoc-ref outputs "doc")
1630                                                "/share/doc/icedtea"))
1631                            (jre (assoc-ref outputs "out"))
1632                            (jdk (assoc-ref outputs "jdk")))
1633                        (copy-recursively "openjdk.build/docs" doc)
1634                        (copy-recursively "openjdk.build/images/j2re-image" jre)
1635                        (copy-recursively "openjdk.build/images/j2sdk-image" jdk)
1636                        ;; Install the nss.cfg file to JRE to enable SSL/TLS
1637                        ;; support via NSS.
1638                        (copy-file (string-append jdk "/jre/lib/security/nss.cfg")
1639                                   (string-append jre "/lib/security/nss.cfg"))
1640                        #t)))
1641                  (add-after 'install 'strip-jar-timestamps
1642                    (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))))
1643       (native-inputs
1644        `(("jdk" ,icedtea-7 "jdk")
1645          ("openjdk-src"
1646           ,(drop "openjdk"
1647                  "1mj6xgmw31i6qd30qi9dmv7160fbcfq5ikz1jwjihdg2793il19p"))
1648          ("aarch32-drop"
1649           ,(drop "aarch32"
1650                  "1wb8k5zm40zld0986dvmlh5xh3gyixbg9h26sl662zy92amhmyyg"))
1651          ("corba-drop"
1652           ,(drop "corba"
1653                  "11ma4zz0599cy70xd219v7a8vin7p96xrhhz3wsaw6cjhkzpagah"))
1654          ("jaxp-drop"
1655           ,(drop "jaxp"
1656                  "14m1y0z0fbm5z5zjw3vnq85py8dma84bi3f9cw8rhdyc6skk8q4i"))
1657          ("jaxws-drop"
1658           ,(drop "jaxws"
1659                  "09andnm6xaasnp963hgx42yiflifiljp9z7z85jrfyc5z8a5whmf"))
1660          ("jdk-drop"
1661           ,(drop "jdk"
1662                  "0s6lcpc0zckz2fnq98aqf28nz9y3wbi41a3kyaqqa2abwbkm1zwl"))
1663          ("langtools-drop"
1664           ,(drop "langtools"
1665                  "15wizy123vhk40chl1b4p552jf2pw2hdww0myf11qab425axz4nw"))
1666          ("hotspot-drop"
1667           ,(origin
1668              (method url-fetch)
1669              (uri (string-append
1670                    "http://icedtea.classpath.org/download/drops"
1671                    "/icedtea8/" version "/hotspot.tar.xz"))
1672              (sha256
1673               (base32
1674                "1ciz1w9j0kz7s1dxdhyqq71nla9icyz6qvn0b9z2zgkklqa98qmm"))
1675              (patches (search-patches
1676                        "icedtea-7-hotspot-gcc-segfault-workaround.patch"))))
1677          ("nashorn-drop"
1678           ,(drop "nashorn"
1679                  "19pzl3ppaw8j6r5cnyp8qiw3hxijh3hdc46l39g5yfhdl4pr4hpa"))
1680          ("shenandoah-drop"
1681           ,(drop "shenandoah"
1682                  "0k33anxdzw1icn072wynfmmdjhsv50hay0j1sfkfxny12rb3vgdy"))
1683          ,@(fold alist-delete (package-native-inputs icedtea-7)
1684                  '("jdk" "openjdk-src" "corba-drop" "jaxp-drop" "jaxws-drop"
1685                    "jdk-drop" "langtools-drop" "hotspot-drop")))))))
1687 (define-public openjdk9
1688   (package
1689     (name "openjdk")
1690     (version "9.181")
1691     (source (origin
1692               (method url-fetch)
1693               (uri "https://hg.openjdk.java.net/jdk/jdk/archive/3cc80be736f2.tar.bz2")
1694               (file-name (string-append name "-" version ".tar.bz2"))
1695               (sha256
1696                (base32
1697                 "01ihmyf7k5z17wbr7xig7y40l9f01d5zjgkcmawn1102hw5kchpq"))
1698               (modules '((guix build utils)))
1699               (snippet
1700                 `(begin
1701                    (for-each delete-file (find-files "." ".*.bin$"))
1702                    (for-each delete-file (find-files "." ".*.exe$"))
1703                    (for-each delete-file (find-files "." ".*.jar$"))
1704                    #t))))
1705     (build-system gnu-build-system)
1706     (outputs '("out" "jdk" "doc"))
1707     (arguments
1708      `(#:tests? #f; require jtreg
1709        #:imported-modules
1710        ((guix build syscalls)
1711         ,@%gnu-build-system-modules)
1712        #:phases
1713        (modify-phases %standard-phases
1714          (add-after 'patch-source-shebangs 'fix-java-shebangs
1715            (lambda _
1716              ;; This file was "fixed" by patch-source-shebangs, but it requires
1717              ;; this exact first line.
1718              (substitute* "jdk/make/data/blacklistedcertsconverter/blacklisted.certs.pem"
1719                (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))
1720              #t))
1721          (replace 'configure
1722            (lambda* (#:key inputs outputs #:allow-other-keys)
1723              ;; TODO: unbundle libpng and lcms
1724              (invoke "bash" "./configure"
1725                      (string-append "--with-freetype=" (assoc-ref inputs "freetype"))
1726                      "--disable-freetype-bundling"
1727                      "--disable-warnings-as-errors"
1728                      "--disable-hotspot-gtest"
1729                      "--with-giflib=system"
1730                      "--with-libjpeg=system"
1731                      (string-append "--prefix=" (assoc-ref outputs "out")))
1732              #t))
1733          (replace 'build
1734            (lambda _
1735              (with-output-to-file ".src-rev"
1736                (lambda _
1737                  (display ,version)))
1738              (setenv "GUIX_LD_WRAPPER_ALLOW_IMPURITIES" "yes")
1739              (invoke "make" "all")
1740              #t))
1741          ;; Some of the libraries in the lib/ folder link to libjvm.so.
1742          ;; But that shared object is located in the server/ folder, so it
1743          ;; cannot be found.  This phase creates a symbolic link in the
1744          ;; lib/ folder so that the other libraries can find it.
1745          ;;
1746          ;; See:
1747          ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1748          ;;
1749          ;; FIXME: Find the bug in the build system, so that this symlink is
1750          ;; not needed.
1751          (add-after 'install 'install-libjvm
1752            (lambda* (#:key inputs outputs #:allow-other-keys)
1753              (let* ((lib-out (string-append (assoc-ref outputs "out")
1754                                              "/lib"))
1755                     (lib-jdk (string-append (assoc-ref outputs "jdk")
1756                                              "/lib")))
1757                (symlink (string-append lib-jdk "/server/libjvm.so")
1758                         (string-append lib-jdk "/libjvm.so"))
1759                (symlink (string-append lib-out "/server/libjvm.so")
1760                         (string-append lib-out "/libjvm.so")))
1761              #t))
1762          (replace 'install
1763            (lambda* (#:key outputs #:allow-other-keys)
1764              (let ((out (assoc-ref outputs "out"))
1765                    (jdk (assoc-ref outputs "jdk"))
1766                    (doc (assoc-ref outputs "doc"))
1767                    (images (car (find-files "build" ".*-server-release"
1768                                             #:directories? #t))))
1769                (copy-recursively (string-append images "/images/jdk") jdk)
1770                (copy-recursively (string-append images "/images/jre") out)
1771                (copy-recursively (string-append images "/images/docs") doc))
1772              #t))
1773          (add-after 'install 'strip-zip-timestamps
1774            (lambda* (#:key outputs #:allow-other-keys)
1775              (use-modules (guix build syscalls))
1776              (for-each (lambda (zip)
1777                          (let ((dir (mkdtemp! "zip-contents.XXXXXX")))
1778                            (with-directory-excursion dir
1779                              (invoke "unzip" zip))
1780                            (delete-file zip)
1781                            (for-each (lambda (file)
1782                                        (let ((s (lstat file)))
1783                                          (unless (eq? (stat:type s) 'symlink)
1784                                            (format #t "reset ~a~%" file)
1785                                            (utime file 0 0 0 0))))
1786                              (find-files dir #:directories? #t))
1787                            (with-directory-excursion dir
1788                              (let ((files (find-files "." ".*" #:directories? #t)))
1789                                (apply invoke "zip" "-0" "-X" zip files)))))
1790                (find-files (assoc-ref outputs "doc") ".*.zip$"))
1791              #t)))))
1792     (inputs
1793      `(("alsa-lib" ,alsa-lib)
1794        ("cups" ,cups)
1795        ("fontconfig" ,fontconfig)
1796        ("freetype" ,freetype)
1797        ("giflib" ,giflib)
1798        ("lcms" ,lcms)
1799        ("libelf" ,libelf)
1800        ("libjpeg" ,libjpeg)
1801        ("libice" ,libice)
1802        ("libpng" ,libpng)
1803        ("libx11" ,libx11)
1804        ("libxcomposite" ,libxcomposite)
1805        ("libxi" ,libxi)
1806        ("libxinerama" ,libxinerama)
1807        ("libxrender" ,libxrender)
1808        ("libxt" ,libxt)
1809        ("libxtst" ,libxtst)))
1810     (native-inputs
1811      `(("icedtea-8" ,icedtea-8)
1812        ("icedtea-8:jdk" ,icedtea-8 "jdk")
1813        ("unzip" ,unzip)
1814        ("which" ,which)
1815        ("zip" ,zip)))
1816     (home-page "https://openjdk.java.net/projects/jdk9/")
1817     (synopsis "Java development kit")
1818     (description
1819      "This package provides the Java development kit OpenJDK.")
1820     (license license:gpl2+)))
1822 (define-public openjdk10
1823   (package
1824     (inherit openjdk9)
1825     (name "openjdk")
1826     (version "10.46")
1827     (source (origin
1828               (method url-fetch)
1829               (uri "http://hg.openjdk.java.net/jdk/jdk/archive/6fa770f9f8ab.tar.bz2")
1830               (file-name (string-append name "-" version ".tar.bz2"))
1831               (sha256
1832                (base32
1833                 "0zywq2203b4hx4jms9vbwvjcj1d3k2v3qpx4s33729fkpmid97r4"))
1834               (patches (search-patches
1835                         "openjdk-10-idlj-reproducibility.patch"))
1836               (modules '((guix build utils)))
1837               (snippet
1838                 `(begin
1839                    (for-each delete-file (find-files "." ".*.bin$"))
1840                    (for-each delete-file (find-files "." ".*.exe$"))
1841                    (for-each delete-file (find-files "." ".*.jar$"))
1842                    #t))))
1843     (arguments
1844       (substitute-keyword-arguments (package-arguments openjdk9)
1845         ((#:phases phases)
1846          `(modify-phases ,phases
1847             (replace 'fix-java-shebangs
1848               (lambda _
1849                 ;; This file was "fixed" by patch-source-shebangs, but it requires
1850                 ;; this exact first line.
1851                 (substitute* "make/data/blacklistedcertsconverter/blacklisted.certs.pem"
1852                   (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))
1853                 #t))
1854             (replace 'configure
1855               (lambda* (#:key inputs outputs #:allow-other-keys)
1856                 (invoke "bash" "./configure"
1857                         (string-append "--with-freetype=" (assoc-ref inputs "freetype"))
1858                         "--disable-freetype-bundling"
1859                         "--disable-warnings-as-errors"
1860                         "--disable-hotspot-gtest"
1861                         "--with-giflib=system"
1862                         "--with-libjpeg=system"
1863                         "--with-native-debug-symbols=zipped"
1864                         (string-append "--prefix=" (assoc-ref outputs "out")))
1865                 #t))))))
1866     (native-inputs
1867      `(("openjdk9" ,openjdk9)
1868        ("openjdk9:jdk" ,openjdk9 "jdk")
1869        ("unzip" ,unzip)
1870        ("which" ,which)
1871        ("zip" ,zip)))))
1873 (define-public openjdk11
1874   (package
1875     (name "openjdk")
1876     (version "11.28")
1877     (source (origin
1878               (method url-fetch)
1879               (uri "http://hg.openjdk.java.net/jdk/jdk/archive/76072a077ee1.tar.bz2")
1880               (file-name (string-append name "-" version ".tar.bz2"))
1881               (sha256
1882                (base32
1883                 "0v705w1s9lrqalzahir78pk397rkk9gfvzq821yv8h3xha0bqi6w"))
1884               (modules '((guix build utils)))
1885               (snippet
1886                 `(begin
1887                    (for-each delete-file (find-files "." ".*.bin$"))
1888                    (for-each delete-file (find-files "." ".*.exe$"))
1889                    (for-each delete-file (find-files "." ".*.jar$"))
1890                    #t))))
1891     (build-system gnu-build-system)
1892     (outputs '("out" "jdk" "doc"))
1893     (arguments
1894      `(#:imported-modules
1895        ((guix build syscalls)
1896         (ice-9 binary-ports)
1897         (rnrs bytevectors)
1898         ,@%gnu-build-system-modules)
1899        #:tests? #f; requires jtreg
1900        ;; TODO package jtreg
1901        ;; disable parallel builds, as the openjdk build system does not like -j
1902        #:parallel-build? #f
1903        #:parallel-tests? #f
1904        ;; reenable parallel builds and tests by adding the flags manually
1905        #:make-flags (list (string-append "JOBS=" (number->string (parallel-job-count))))
1906        #:configure-flags
1907        `("--disable-option-checking" ; --enable-fast-install default flag errors otherwise
1908          "--disable-warnings-as-errors"
1909          ;; make validate-runpath pass, see: http://issues.guix.info/issue/32894
1910          "--with-native-debug-symbols=zipped"
1911          ;; do not use the bundled libraries
1912          "--with-giflib=system"
1913          "--with-lcms=system"
1914          "--with-libjpeg=system"
1915          "--with-libpng=system"
1916          "--with-version-pre="
1917          ;; allow the build system to locate the system freetype
1918          ,(string-append "--with-freetype-include="
1919                          (assoc-ref %build-inputs "freetype") "/include")
1920          ,(string-append "--with-freetype-lib="
1921                          (assoc-ref %build-inputs "freetype") "/lib"))
1922        ;; TODO
1923        #:phases
1924        (modify-phases %standard-phases
1925          (add-after 'patch-source-shebangs 'fix-java-shebangs
1926            (lambda _
1927              ;; This file was "fixed" by patch-source-shebangs, but it requires
1928              ;; this exact first line.
1929              (substitute* "make/data/blacklistedcertsconverter/blacklisted.certs.pem"
1930                (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))
1931              #t))
1932          (replace 'build
1933            (lambda _
1934              (with-output-to-file ".src-rev"
1935                (lambda _
1936                  (display ,version)))
1937              (setenv "GUIX_LD_WRAPPER_ALLOW_IMPURITIES" "yes")
1938              (invoke "make" "all")
1939              #t))
1940          ;; jdk 11 does not build jre by default any more
1941          ;; building it anyways
1942          ;; for further information see:
1943          ;; https://github.com/AdoptOpenJDK/openjdk-build/issues/356
1944          (add-after 'build 'build-jre
1945            (lambda _
1946              (invoke "make" "legacy-jre-image")
1947              #t))
1948          (replace 'install
1949            (lambda* (#:key outputs #:allow-other-keys)
1950              (let ((out (assoc-ref outputs "out"))
1951                    (jdk (assoc-ref outputs "jdk"))
1952                    (doc (assoc-ref outputs "doc"))
1953                    (images (car (find-files "build" ".*-server-release"
1954                                             #:directories? #t))))
1955                (copy-recursively (string-append images "/images/jdk") jdk)
1956                (copy-recursively (string-append images "/images/jre") out)
1957                (copy-recursively (string-append images "/images/docs") doc))
1958              #t))
1959          ;; Some of the libraries in the lib/ folder link to libjvm.so.
1960          ;; But that shared object is located in the server/ folder, so it
1961          ;; cannot be found.  This phase creates a symbolic link in the
1962          ;; lib/ folder so that the other libraries can find it.
1963          ;;
1964          ;; See:
1965          ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1966          ;;
1967          ;; FIXME: Find the bug in the build system, so that this symlink is
1968          ;; not needed.
1969          (add-after 'install 'install-libjvm
1970            (lambda* (#:key inputs outputs #:allow-other-keys)
1971              (let* ((lib-out (string-append (assoc-ref outputs "out")
1972                                              "/lib"))
1973                     (lib-jdk (string-append (assoc-ref outputs "jdk")
1974                                              "/lib")))
1975                (symlink (string-append lib-jdk "/server/libjvm.so")
1976                         (string-append lib-jdk "/libjvm.so"))
1977                (symlink (string-append lib-out "/server/libjvm.so")
1978                         (string-append lib-out "/libjvm.so")))
1979              #t))
1980          (add-after 'install 'strip-character-data-timestamps
1981            (lambda* (#:key outputs #:allow-other-keys)
1982              (use-modules (guix build syscalls))
1983              (let ((archive (string-append
1984                              (assoc-ref outputs "jdk") "/lib/src.zip"))
1985                    (dir (mkdtemp! "zip-contents.XXXXXX")))
1986                (with-directory-excursion dir
1987                  (invoke "unzip" archive))
1988                (delete-file archive)
1989                (with-directory-excursion dir
1990                  (let ((char-data-files (find-files "." "CharacterData.*")))
1991                    (for-each (lambda (file)
1992                                (substitute* file
1993                                  (((string-append "This file was generated "
1994                                                  "AUTOMATICALLY from a template "
1995                                                  "file.*"))
1996                                   (string-append "This file was generated "
1997                                                  "AUTOMATICALLY from a template "
1998                                                  "file"))))
1999                              char-data-files)))
2000                (with-directory-excursion dir
2001                  (let ((files (find-files "." ".*" #:directories? #t)))
2002                    (apply invoke "zip" "-0" "-X" archive files))))))
2003          (add-after 'strip-character-data-timestamps 'strip-archive-timestamps
2004            (lambda* (#:key outputs #:allow-other-keys)
2005              (use-modules (guix build syscalls)
2006                           (ice-9 binary-ports)
2007                           (rnrs bytevectors))
2008              (letrec ((repack-archive
2009                     (lambda (archive)
2010                       (let ((dir (mkdtemp! "zip-contents.XXXXXX")))
2011                         (with-directory-excursion dir
2012                           (invoke "unzip" archive))
2013                         (delete-file archive)
2014                         (for-each (compose repack-archive canonicalize-path)
2015                                   (find-files dir "(ct.sym|.*.jar)$"))
2016                         (let ((reset-file-timestamp
2017                                (lambda (file)
2018                                  (let ((s (lstat file)))
2019                                    (unless (eq? (stat:type s) 'symlink)
2020                                      (format #t "reset ~a~%" file)
2021                                      (utime file 0 0 0 0))))))
2022                           (for-each reset-file-timestamp
2023                                     (find-files dir #:directories? #t)))
2024                         (with-directory-excursion dir
2025                           (let ((files (find-files "." ".*" #:directories? #t)))
2026                             (apply invoke "zip" "-0" "-X" archive files)))))))
2027                (for-each repack-archive
2028                          (find-files (assoc-ref outputs "doc") ".*.zip$"))
2029                (for-each repack-archive
2030                          (find-files (assoc-ref outputs "jdk")
2031                                      ".*.(zip|jar|diz)$"))
2032                (repack-archive (string-append (assoc-ref outputs "jdk") "/lib/ct.sym"))
2033                (let ((repack-jmod
2034                       (lambda (file-name)
2035                         (call-with-input-file file-name
2036                           (lambda (file)
2037                             (let ((header #vu8(#x4a #x4d #x01 #x00)))
2038                               (if (equal? (get-bytevector-n
2039                                            file (bytevector-length header))
2040                                           header)
2041                                   (let* ((header-length (bytevector-length header))
2042                                          (temp-file (mkstemp!
2043                                                      (string-copy
2044                                                       "temp-file.XXXXXX")))
2045                                          (temp-filename (port-filename temp-file))
2046                                          (content-length
2047                                           (- (stat:size (stat file))
2048                                              header-length)))
2049                              (sendfile temp-file file content-length header-length)
2050                              (delete-file file-name)
2051                              (close-port temp-file)
2052                              (repack-archive (canonicalize-path temp-filename))
2053                              (call-with-output-file file-name
2054                                (lambda (file)
2055                                  (put-bytevector file header)
2056                                  (call-with-input-file temp-filename
2057                                    (lambda (temp-file)
2058                                      (sendfile
2059                                       file temp-file
2060                                       (stat:size (stat temp-file)) 0)))))))))))))
2061                  (for-each repack-jmod
2062                            (find-files (assoc-ref outputs "jdk") ".*.jmod$")))
2063              #t)))
2064          (add-after 'install 'remove-timestamp-from-api-summary
2065            (lambda* (#:key outputs #:allow-other-keys)
2066              (substitute* (string-append (assoc-ref outputs "doc")
2067                                          "/api/overview-summary.html")
2068                (("Generated by javadoc \\(11-internal\\).*$")
2069                 "Generated by javadoc (11-internal) -->\n"))
2070              #t)))))
2071     (inputs
2072      `(("alsa-lib" ,alsa-lib)
2073        ("cups" ,cups)
2074        ("fontconfig" ,fontconfig)
2075        ("freetype" ,freetype)
2076        ("giflib" ,giflib)
2077        ("lcms" ,lcms)
2078        ("libjpeg" ,libjpeg)
2079        ("libpng" ,libpng)
2080        ("libx11" ,libx11)
2081        ("libxext" ,libxext)
2082        ("libxrender" ,libxrender)
2083        ("libxt" ,libxt)
2084        ("libxtst" ,libxtst)))
2085     (native-inputs
2086      `(("autoconf" ,autoconf)
2087        ("openjdk10" ,openjdk10)
2088        ("openjdk10:jdk" ,openjdk10 "jdk")
2089        ("pkg-config" ,pkg-config)
2090        ("unzip" ,unzip)
2091        ("which" ,which)
2092        ("zip" ,zip)))
2093     (home-page "https://openjdk.java.net/projects/jdk/11/")
2094     (synopsis "Java development kit")
2095     (description
2096      "This package provides the Java development kit OpenJDK.")
2097     (license license:gpl2+)))
2099 (define-public icedtea icedtea-8)
2102 (define-public ant/java8
2103   (package (inherit ant-bootstrap)
2104     (name "ant")
2105     (version "1.10.1")
2106     (source (origin
2107               (method url-fetch)
2108               (uri (string-append "mirror://apache/ant/source/apache-ant-"
2109                                   version "-src.tar.gz"))
2110               (sha256
2111                (base32
2112                 "10p3dh77lkzzzcy32dk9azljixzadp46fggjfbvgkl8mmb8cxxv8"))
2113               (modules '((guix build utils)))
2114               (snippet
2115                '(begin
2116                   (for-each delete-file
2117                             (find-files "lib/optional" "\\.jar$"))
2118                   #t))))
2119     (arguments
2120      (substitute-keyword-arguments (package-arguments ant-bootstrap)
2121        ((#:phases phases)
2122         `(modify-phases ,phases
2123            (add-after 'unpack 'remove-scripts
2124              ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
2125              ;; wrappers.
2126              (lambda _
2127                (for-each delete-file
2128                          (find-files "src/script"
2129                                      "(.*\\.(bat|cmd)|runant.*|antRun.*)"))
2130                #t))
2131            (replace 'build
2132              (lambda* (#:key inputs outputs #:allow-other-keys)
2133                (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
2135                ;; Disable tests to avoid dependency on hamcrest-core, which needs
2136                ;; Ant to build.  This is necessary in addition to disabling the
2137                ;; "check" phase, because the dependency on "test-jar" would always
2138                ;; result in the tests to be run.
2139                (substitute* "build.xml"
2140                  (("depends=\"jars,test-jar\"") "depends=\"jars\""))
2141                (invoke "bash" "bootstrap.sh"
2142                        (string-append "-Ddist.dir="
2143                                       (assoc-ref outputs "out")))))))))
2144     (native-inputs
2145      `(("jdk" ,icedtea-8 "jdk")
2146        ("zip" ,zip)
2147        ("unzip" ,unzip)))))
2149 ;; The 1.9.x series is the last that can be built with GCJ.  The 1.10.x series
2150 ;; requires Java 8.
2151 (define-public ant
2152   (package (inherit ant/java8)
2153     (version "1.9.9")
2154     (source (origin
2155               (method url-fetch)
2156               (uri (string-append "mirror://apache/ant/source/apache-ant-"
2157                                   version "-src.tar.gz"))
2158               (sha256
2159                (base32
2160                 "1k28mka0m3isy9yr8gz84kz1f3f879rwaxrd44vdn9xbfwvwk86n"))))
2161     (native-inputs
2162      `(("jdk" ,icedtea-7 "jdk")
2163        ("zip" ,zip)
2164        ("unzip" ,unzip)))))
2166 (define-public ant-apache-bcel
2167   (package
2168     (inherit ant/java8)
2169     (name "ant-apache-bcel")
2170     (arguments
2171      (substitute-keyword-arguments (package-arguments ant/java8)
2172        ((#:phases phases)
2173         `(modify-phases ,phases
2174            (add-after 'unpack 'link-bcel
2175              (lambda* (#:key inputs #:allow-other-keys)
2176                (for-each (lambda (file)
2177                            (symlink file
2178                                     (string-append "lib/optional/"
2179                                                    (basename file))))
2180                          (find-files (assoc-ref inputs "java-commons-bcel")
2181                                      "\\.jar$"))
2182                #t))
2183            (add-after 'build 'install
2184              (lambda* (#:key outputs #:allow-other-keys)
2185                (let* ((out   (assoc-ref outputs "out"))
2186                       (share (string-append out "/share/java"))
2187                       (bin   (string-append out "/bin"))
2188                       (lib   (string-append out "/lib")))
2189                  (mkdir-p share)
2190                  (install-file (string-append lib "/ant-apache-bcel.jar") share)
2191                  (delete-file-recursively bin)
2192                  (delete-file-recursively lib)
2193                  #t)))))))
2194     (inputs
2195      `(("java-commons-bcel" ,java-commons-bcel)
2196        ,@(package-inputs ant/java8)))))
2198 (define-public ant-junit
2199   (package
2200     (inherit ant/java8)
2201     (name "ant-junit")
2202     (arguments
2203      (substitute-keyword-arguments (package-arguments ant/java8)
2204        ((#:phases phases)
2205         `(modify-phases ,phases
2206            (add-after 'unpack 'link-junit
2207              (lambda* (#:key inputs #:allow-other-keys)
2208                (for-each (lambda (file)
2209                            (symlink file
2210                                     (string-append "lib/optional/"
2211                                                    (basename file))))
2212                          (find-files (assoc-ref inputs "java-junit")
2213                                      "\\.jar$"))
2214                #t))
2215            (add-after 'build 'install
2216              (lambda* (#:key outputs #:allow-other-keys)
2217                (let* ((out   (assoc-ref outputs "out"))
2218                       (share (string-append out "/share/java"))
2219                       (bin   (string-append out "/bin"))
2220                       (lib   (string-append out "/lib")))
2221                  (mkdir-p share)
2222                  (install-file (string-append lib "/ant-junit.jar") share)
2223                  (delete-file-recursively bin)
2224                  (delete-file-recursively lib)
2225                  #t)))))))
2226     (inputs
2227      `(("java-junit" ,java-junit)
2228        ,@(package-inputs ant/java8)))))
2230 (define-public javacc-4
2231   (package
2232     (name "javacc")
2233     (version "4.1")
2234     (source (origin
2235               (method git-fetch)
2236               (uri (git-reference
2237                     (url "https://github.com/javacc/javacc.git")
2238                     (commit "release_41")))
2239               (file-name (string-append "javacc-" version "-checkout"))
2240               (sha256
2241                (base32
2242                 "07ysav7j8r1c6h8qxrgqk6lwdp74ly0ad1935lragxml0qqc3ka0"))
2243               (modules '((guix build utils)))
2244               ;; delete bundled jars
2245               (snippet '(begin (delete-file-recursively "lib") #t))))
2246     (build-system ant-build-system)
2247     ;; Tests fail with
2248     ;; /tmp/guix-build-javacc-4.1.drv-0/source/test/javacodeLA/build.xml:60:
2249     ;; JAVACODE failed
2250     (arguments
2251      `(#:tests? #f
2252        #:phases
2253        (modify-phases %standard-phases
2254          ;; Delete tests to avoid build failure (we don't run them anyway).
2255          (add-after 'unpack 'delete-tests
2256            (lambda _
2257              (for-each delete-file
2258                        '("src/org/javacc/JavaCCTestCase.java"
2259                          "src/org/javacc/parser/ExpansionTest.java"
2260                          "src/org/javacc/parser/OptionsTest.java"
2261                          "src/org/javacc/jjtree/JJTreeOptionsTest.java"))
2262              (for-each delete-file-recursively
2263                        '("src/org/javacc/parser/test"
2264                          "src/org/javacc/jjdoc/test"))
2265              #t))
2266          (replace 'install (install-jars "bin/lib")))))
2267     (home-page "https://javacc.org/")
2268     (synopsis "Java parser generator")
2269     (description "Java Compiler Compiler (JavaCC) is the most popular parser
2270 generator for use with Java applications.  A parser generator is a tool that
2271 reads a grammar specification and converts it to a Java program that can
2272 recognize matches to the grammar.  In addition to the parser generator itself,
2273 JavaCC provides other standard capabilities related to parser generation such
2274 as tree building (via a tool called JJTree included with JavaCC), actions,
2275 debugging, etc.")
2276     (license license:bsd-3)))
2278 (define-public javacc
2279   (package
2280     (inherit javacc-4)
2281     (version "7.0.4")
2282     (source
2283      (origin
2284        (method git-fetch)
2285        (uri (git-reference
2286              (url "https://github.com/javacc/javacc.git")
2287              (commit version)))
2288        (file-name (git-file-name "javacc" version))
2289        (sha256
2290         (base32 "18kkak3gda93gr25jrgy6q00g0jr8i24ri2wk4kybz1v234fxx9i"))
2291        (modules '((guix build utils)))
2292        ;; Delete bundled jars.
2293        (snippet '(begin (for-each delete-file-recursively
2294                                   '("bootstrap" "lib"))
2295                         #t))))
2296     (arguments
2297      `(#:make-flags                     ; bootstrap from javacc-4
2298        (list (string-append "-Dbootstrap-jar="
2299                             (assoc-ref %build-inputs "javacc")
2300                             "/share/java/javacc.jar"))
2301        #:test-target "test"
2302        #:phases
2303        (modify-phases %standard-phases
2304          (replace 'install (install-jars "target")))))
2305     (native-inputs
2306      `(("javacc" ,javacc-4)))))
2308 ;; This is the last 3.x release of ECJ
2309 (define-public java-ecj-3
2310   (package
2311     (name "java-ecj")
2312     (version "3.8.2")
2313     (source (origin
2314               (method url-fetch)
2315               (uri (string-append "http://archive.eclipse.org/eclipse/"
2316                                   "downloads/drops/R-" version
2317                                   "-201301310800/ecjsrc-" version ".jar"))
2318               (sha256
2319                (base32
2320                 "01mdj14jw11g1jfnki4fi8229p0c6zzckd38zqy2w4m3cjcvsx04"))))
2321     (build-system ant-build-system)
2322     (arguments
2323      `(#:tests? #f ; none included
2324        #:jdk ,icedtea-7 ; doesn't build with JDK8+
2325        #:make-flags (list "-f" "src/build.xml")
2326        #:build-target "build"
2327        #:phases
2328        (modify-phases %standard-phases
2329          (add-after 'unpack 'fix-manifest
2330            (lambda _
2331              ;; Record the main class to make ecj executable.
2332              (with-atomic-file-replacement "src/META-INF/MANIFEST.MF"
2333                (lambda (in out)
2334                  (display "Manifest-Version: 1.0
2335 Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n"
2336                           out)))
2337              #t))
2338          (replace 'install (install-jars ".")))))
2339     (home-page "https://eclipse.org")
2340     (synopsis "Eclipse Java development tools core batch compiler")
2341     (description "This package provides the Eclipse Java core batch compiler.")
2342     (license license:epl1.0)))
2344 ;; This is needed for java-cisd-args4j
2345 (define-public java-ecj-3.5
2346   (package (inherit java-ecj-3)
2347     (version "3.5.1")
2348     (source (origin
2349               (method url-fetch/zipbomb)
2350               (uri (string-append "http://archive.eclipse.org/eclipse/"
2351                                   "downloads/drops/R-" version
2352                                   "-200909170800/ecjsrc-" version ".zip"))
2353               (sha256
2354                (base32
2355                 "1vnl2mavisc567bip736xzsvvbjif5279wc4a7pbdik5wlir8qr7"))))
2356     (build-system ant-build-system)
2357     (arguments
2358      `(#:tests? #f ; none included
2359        #:jdk ,icedtea-7 ; doesn't build with JDK8+
2360        #:build-target "build"
2361        #:phases
2362        (modify-phases %standard-phases
2363          (add-after 'unpack 'fix-manifest
2364            (lambda _
2365              ;; Record the main class to make ecj executable.
2366              (with-atomic-file-replacement "META-INF/MANIFEST.MF"
2367                (lambda (in out)
2368                  (dump-port in out)
2369                  (display "Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n"
2370                           out)))
2371              #t))
2372          (replace 'install (install-jars ".")))))
2373     (native-inputs
2374      `(("unzip" ,unzip)))))
2376 (define-public java-cisd-base
2377   (let ((revision 38938)
2378         (base-version "14.12.0"))
2379     (package
2380       (name "java-cisd-base")
2381       (version (string-append base-version "-" (number->string revision)))
2382       (source (origin
2383                 (method svn-fetch)
2384                 (uri (svn-reference
2385                       (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2386                                           "base/tags/release/"
2387                                           (version-major+minor base-version)
2388                                           ".x/" base-version "/base/"))
2389                       (revision revision)))
2390                 (file-name (string-append "java-cisd-base-" version "-checkout"))
2391                 (sha256
2392                  (base32
2393                   "1i5adyf7nzclb0wydgwa1az04qliid8035vpahaandmkmigbnxiy"))
2394                 (modules '((guix build utils)))
2395                 (snippet
2396                  '(begin
2397                     ;; Delete included gradle jar
2398                     (delete-file-recursively "gradle/wrapper")
2399                     ;; Delete pre-built native libraries
2400                     (delete-file-recursively "libs")
2401                     #t))))
2402       (build-system ant-build-system)
2403       (arguments
2404        `(#:make-flags '("-file" "build/build.xml")
2405          #:test-target "jar-test"
2406          #:jdk ,icedtea-8
2407          #:phases
2408          (modify-phases %standard-phases
2409            (add-after 'unpack 'unpack-build-resources
2410              (lambda* (#:key inputs #:allow-other-keys)
2411                (copy-recursively (assoc-ref inputs "build-resources")
2412                                  "../build_resources")
2413                #t))
2414            (add-after 'unpack-build-resources 'fix-dependencies
2415              (lambda* (#:key inputs #:allow-other-keys)
2416                (substitute* "build/build.xml"
2417                  (("\\$\\{lib\\}/testng/testng-jdk15.jar")
2418                   (string-append (assoc-ref inputs "java-testng")
2419                                  "/share/java/java-testng.jar"))
2420                  (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
2421                   (string-append (assoc-ref inputs "java-commons-lang")
2422                                  "/share/java/commons-lang-"
2423                                  ,(package-version java-commons-lang) ".jar"))
2424                  (("\\$\\{lib\\}/commons-io/commons-io.jar")
2425                   (string-append (assoc-ref inputs "java-commons-io")
2426                                  "/share/java/commons-io-"
2427                                  ,(package-version java-commons-io)
2428                                  "-SNAPSHOT.jar"))
2429                  ;; Remove dependency on svn
2430                  (("<build-info.*") "")
2431                  (("\\$\\{revision.number\\}")
2432                   ,(number->string revision))
2433                  (("\\$\\{version.number\\}") ,base-version))
2434                ;; Remove dependency on classycle
2435                (substitute* "../build_resources/ant/build-common.xml"
2436                  (("<taskdef name=\"dependency-checker.*") "")
2437                  (("classname=\"classycle.*") "")
2438                  (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
2439                #t))
2440            ;; A few tests fail because of the lack of a proper /etc/groups and
2441            ;; /etc/passwd file in the build container.
2442            (add-after 'unpack 'disable-broken-tests
2443              (lambda _
2444                (substitute* "sourceTest/java/ch/systemsx/cisd/base/AllTests.java"
2445                  (("Unix.isOperational\\(\\)") "false"))
2446                #t))
2447            ;; These decorators are almost useless and pull in an unpackaged
2448            ;; dependency.
2449            (add-after 'unpack 'remove-useless-decorators
2450              (lambda _
2451                (substitute* "source/java/ch/systemsx/cisd/base/unix/Unix.java"
2452                  (("@Private") "")
2453                  (("import ch.rinn.restrictions.Private;") ""))
2454                (substitute* "sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java"
2455                  (("@Friend.*") "")
2456                  (("import ch.rinn.restrictions.Friend;") ""))
2457                #t))
2458            (add-before 'configure 'build-native-code
2459              (lambda* (#:key inputs #:allow-other-keys)
2460                (let ((jdk (assoc-ref inputs "jdk"))
2461                      (dir ,(match (%current-system)
2462                              ("i686-linux"
2463                               "i386-Linux")
2464                              ((or "armhf-linux" "aarch64-linux")
2465                               "arm-Linux")
2466                              ((or "x86_64-linux")
2467                               "amd64-Linux")
2468                              (_ "unknown-Linux"))))
2469                  (with-directory-excursion "source/c"
2470                    (invoke "gcc" "-shared" "-O3" "-fPIC" "unix.c"
2471                            (string-append "-I" jdk "/include")
2472                            (string-append "-I" jdk "/include/linux")
2473                            "-o" "libunix.so")
2474                    (invoke "gcc" "-shared" "-O3" "-fPIC"
2475                            "-DMACHINE_BYTE_ORDER=1"
2476                            "copyCommon.c"
2477                            "copyByteChar.c"
2478                            "copyByteDouble.c"
2479                            "copyByteFloat.c"
2480                            "copyByteInt.c"
2481                            "copyByteLong.c"
2482                            "copyByteShort.c"
2483                            (string-append "-I" jdk "/include")
2484                            (string-append "-I" jdk "/include/linux")
2485                            "-o" "libnativedata.so"))
2486                  (install-file "source/c/libunix.so"
2487                                (string-append "libs/native/unix/" dir))
2488                  (install-file "source/c/libnativedata.so"
2489                                (string-append "libs/native/nativedata/" dir))
2490                  #t)))
2491            ;; In the "check" phase we only build the test executable.
2492            (add-after 'check 'run-tests
2493              (lambda _
2494                (invoke "java" "-jar" "targets/dist/sis-base-test.jar")
2495                (delete-file "targets/dist/sis-base-test.jar")
2496                #t))
2497            (replace 'install (install-jars "targets/dist")))))
2498       (native-inputs
2499        `(("jdk" ,icedtea-8)
2500          ("java-commons-lang" ,java-commons-lang)
2501          ("java-commons-io" ,java-commons-io)
2502          ("java-testng" ,java-testng)
2503          ("build-resources"
2504           ,(origin
2505              (method svn-fetch)
2506              (uri (svn-reference
2507                    (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2508                                        "base/tags/release/"
2509                                        (version-major+minor base-version)
2510                                        ".x/" base-version
2511                                        "/build_resources/"))
2512                    (revision revision)))
2513              (sha256
2514               (base32
2515                "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
2516       (home-page "http://svnsis.ethz.ch")
2517       (synopsis "Utility classes for libraries from ETH Zurich")
2518       (description "This library supplies some utility classes needed for
2519 libraries from the SIS division at ETH Zurich like jHDF5.")
2520       ;; The C sources are under a non-copyleft license, which looks like a
2521       ;; variant of the BSD licenses.  The whole package is under the ASL2.0.
2522       (license (list license:asl2.0
2523                      (license:non-copyleft "file://source/c/COPYING"))))))
2525 (define-public java-cisd-args4j
2526   (let ((revision 39162)
2527         (base-version "9.11.2"))
2528     (package
2529       (name "java-cisd-args4j")
2530       (version (string-append base-version "-" (number->string revision)))
2531       (source (origin
2532                 (method svn-fetch)
2533                 (uri (svn-reference
2534                       (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2535                                           "args4j/tags/release/"
2536                                           (version-major+minor base-version)
2537                                           ".x/" base-version "/args4j/"))
2538                       (revision revision)))
2539                 (file-name (string-append "java-cisd-args4j-" version "-checkout"))
2540                 (sha256
2541                  (base32
2542                   "0hhqznjaivq7ips7mkwas78z42s6djsm20rrs7g1zd59rcsakxn2"))))
2543       (build-system ant-build-system)
2544       (arguments
2545        `(#:make-flags '("-file" "build/build.xml")
2546          #:tests? #f ; there are no tests
2547          ;; There are weird build failures with JDK8, such as: "The type
2548          ;; java.io.ObjectInputStream cannot be resolved. It is indirectly
2549          ;; referenced from required .class files"
2550          #:jdk ,icedtea-7
2551          #:modules ((guix build ant-build-system)
2552                     (guix build utils)
2553                     (guix build java-utils)
2554                     (sxml simple)
2555                     (sxml transform)
2556                     (sxml xpath))
2557          #:phases
2558          (modify-phases %standard-phases
2559            (add-after 'unpack 'unpack-build-resources
2560              (lambda* (#:key inputs #:allow-other-keys)
2561                (mkdir-p "../build_resources")
2562                (invoke "tar" "xf" (assoc-ref inputs "build-resources")
2563                        "-C" "../build_resources"
2564                        "--strip-components=1")
2565                (mkdir-p "../build_resources/lib")
2566                #t))
2567            (add-after 'unpack-build-resources 'fix-dependencies
2568              (lambda* (#:key inputs #:allow-other-keys)
2569                ;; FIXME: There should be a more convenient abstraction for
2570                ;; editing XML files.
2571                (with-directory-excursion "../build_resources/ant/"
2572                  (chmod "build-common.xml" #o664)
2573                  (call-with-output-file "build-common.xml.new"
2574                    (lambda (port)
2575                      (sxml->xml
2576                       (pre-post-order
2577                        (with-input-from-file "build-common.xml"
2578                          (lambda _ (xml->sxml #:trim-whitespace? #t)))
2579                        `(;; Remove dependency on classycle and custom ant tasks
2580                          (taskdef   . ,(lambda (tag . kids)
2581                                          (let ((name ((sxpath '(name *text*)) kids)))
2582                                            (if (or (member "build-info" name)
2583                                                    (member "dependency-checker" name)
2584                                                    (member "build-java-subprojects" name)
2585                                                    (member "project-classpath" name))
2586                                                '() ; skip
2587                                                `(,tag ,@kids)))))
2588                          (typedef   . ,(lambda (tag . kids)
2589                                          (let ((name ((sxpath '(name *text*)) kids)))
2590                                            (if (member "recursive-jar" name)
2591                                                '() ; skip
2592                                                `(,tag ,@kids)))))
2593                          (build-java-subprojects . ,(lambda _ '()))
2594                          ;; Ignore everything else
2595                          (*default* . ,(lambda (tag . kids) `(,tag ,@kids)))
2596                          (*text*    . ,(lambda (_ txt) txt))))
2597                       port)))
2598                  (rename-file "build-common.xml.new" "build-common.xml"))
2599                (substitute* "build/build.xml"
2600                  (("\\$\\{lib\\}/cisd-base/cisd-base.jar")
2601                   (string-append (assoc-ref inputs "java-cisd-base")
2602                                  "/share/java/sis-base.jar"))
2603                  ;; Remove dependency on svn
2604                  (("<build-info.*") "")
2605                  (("\\$\\{revision.number\\}")
2606                   ,(number->string revision))
2607                  (("\\$\\{version.number\\}") ,base-version)
2608                  ;; Don't use custom ant tasks.
2609                  (("recursive-jar") "jar")
2610                  (("<project-classpath.*") ""))
2611                #t))
2612            (replace 'install (install-jars "targets/dist")))))
2613       (inputs
2614        `(("java-cisd-base" ,java-cisd-base)))
2615       (native-inputs
2616        `(("ecj" ,java-ecj-3.5)
2617          ("build-resources"
2618           ,(origin
2619              (method svn-fetch)
2620              (uri (svn-reference
2621                    (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2622                                        "args4j/tags/release/"
2623                                        (version-major+minor base-version)
2624                                        ".x/" base-version
2625                                        "/build_resources/"))
2626                    (revision revision)))
2627              (sha256
2628               (base32
2629                "056cam4k8pll7ass31sy6gwn8g8719njc41yf4l02b0342nilkyf"))
2630              (modules '((guix build utils)))
2631              ;; Delete bundled pre-built jars.
2632              (snippet
2633               '(begin (delete-file-recursively "lib/") #t))))))
2634       (home-page "http://svnsis.ethz.ch")
2635       (synopsis "Command line parser library")
2636       (description "This package provides a parser for command line arguments.")
2637       (license license:asl2.0))))
2639 (define-public java-cisd-jhdf5
2640   (let ((revision 39162)
2641         (base-version "14.12.6"))
2642     (package
2643       (name "java-cisd-jhdf5")
2644       (version (string-append base-version "-" (number->string revision)))
2645       (source (origin
2646                 (method svn-fetch)
2647                 (uri (svn-reference
2648                       (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2649                                           "jhdf5/tags/release/"
2650                                           (version-major+minor base-version)
2651                                           ".x/" base-version "/jhdf5/"))
2652                       (revision revision)))
2653                 (file-name (string-append "java-cisd-jhdf5-" version "-checkout"))
2654                 (sha256
2655                  (base32
2656                   "13i17s2hn0q9drdqvp8csy7770p3hdbh9rp30ihln2ldkfawdmz0"))
2657                 (modules '((guix build utils)))
2658                 (snippet
2659                  '(begin
2660                     ;; Delete included gradle jar
2661                     (delete-file-recursively "gradle/wrapper")
2662                     ;; Delete pre-built native libraries
2663                     (delete-file-recursively "libs")
2664                     #t))))
2665       (build-system ant-build-system)
2666       (arguments
2667        `(#:make-flags '("-file" "build/build.xml")
2668          #:build-target "jar-all"
2669          #:test-target "jar-test"
2670          #:jdk ,icedtea-8
2671          #:phases
2672          (modify-phases %standard-phases
2673            ;; FIXME: this build phase fails.
2674            (delete 'generate-jar-indices)
2675            ;; Don't erase results from the build phase when building tests.
2676            (add-after 'unpack 'separate-test-target-from-clean
2677              (lambda _
2678                (substitute* "build/build.xml"
2679                  (("\"jar-test\" depends=\"clean, ")
2680                   "\"jar-test\" depends=\""))
2681                #t))
2682            (add-after 'unpack 'unpack-build-resources
2683              (lambda* (#:key inputs #:allow-other-keys)
2684                (copy-recursively (assoc-ref inputs "build-resources")
2685                                  "../build_resources")
2686                (delete-file-recursively "../build_resources/lib/")
2687                (mkdir-p "../build_resources/lib")
2688                ;; Remove dependency on classycle
2689                (substitute* "../build_resources/ant/build-common.xml"
2690                  (("<taskdef name=\"dependency-checker.*") "")
2691                  (("classname=\"classycle.*") "")
2692                  (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
2693                ;; Remove dependency on svn
2694                (substitute* "build/build.xml"
2695                  (("<build-info.*") "")
2696                  (("\\$\\{revision.number\\}")
2697                   ,(number->string revision))
2698                  (("\\$\\{version.number\\}") ,base-version))
2699                #t))
2700            (add-after 'unpack-build-resources 'fix-dependencies
2701              (lambda* (#:key inputs #:allow-other-keys)
2702                (substitute* "../build_resources/ant/build-common.xml"
2703                  (("../libraries/testng/testng-jdk15.jar")
2704                   (string-append (assoc-ref inputs "java-testng")
2705                                  "/share/java/java-testng.jar")))
2706                (substitute* "build/build.xml"
2707                  (("\\$\\{lib\\}/sis-base/sis-base.jar")
2708                   (string-append (assoc-ref inputs "java-cisd-base")
2709                                  "/share/java/sis-base.jar"))
2710                  (("\\$\\{lib\\}/cisd-args4j/cisd-args4j.jar")
2711                   (string-append (assoc-ref inputs "java-cisd-args4j")
2712                                  "/share/java/cisd-args4j.jar"))
2713                  (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
2714                   (string-append (assoc-ref inputs "java-commons-lang")
2715                                  "/share/java/commons-lang-"
2716                                  ,(package-version java-commons-lang) ".jar"))
2717                  (("\\$\\{lib\\}/commons-io/commons-io.jar")
2718                   (string-append (assoc-ref inputs "java-commons-io")
2719                                  "/share/java/commons-io-"
2720                                  ,(package-version java-commons-io)
2721                                  "-SNAPSHOT.jar"))
2722                  (("\\$\\{lib\\}/testng/testng-jdk15.jar")
2723                   (string-append (assoc-ref inputs "java-testng")
2724                                  "/share/java/java-testng.jar"))
2725                  (("\\$\\{lib\\}/junit4/junit.jar")
2726                   (string-append (assoc-ref inputs "java-junit")
2727                                  "/share/java/junit.jar"))
2728                  (("\\$\\{lib\\}/jmock/hamcrest/hamcrest-core.jar")
2729                   (string-append (assoc-ref inputs "java-hamcrest-core")
2730                                  "/share/java/hamcrest-core.jar")))
2731                ;; Remove dependency on ch.rinn.restrictions
2732                (with-directory-excursion "source/java/ch/systemsx/cisd/hdf5/"
2733                  (substitute* '("BitSetConversionUtils.java"
2734                                 "HDF5Utils.java")
2735                    (("import ch.rinn.restrictions.Private;") "")
2736                    (("@Private") "")))
2737                (with-directory-excursion "sourceTest/java/ch/systemsx/cisd/hdf5/"
2738                  (substitute* '("BitSetConversionTest.java"
2739                                 "h5ar/HDF5ArchiverTest.java")
2740                    (("import ch.rinn.restrictions.Friend;") "")
2741                    (("@Friend.*") ""))
2742                  ;; Remove leftovers from removing @Friend
2743                  (substitute* "h5ar/HDF5ArchiverTest.java"
2744                    (("\\{ HDF5Archiver.class, IdCache.class, LinkRecord.class \\}\\)")
2745                     "")))
2746                #t))
2747            (add-before 'configure 'build-native-library
2748              (lambda* (#:key inputs #:allow-other-keys)
2749                (let ((jdk  (assoc-ref inputs "jdk"))
2750                      (hdf5 (assoc-ref inputs "hdf5"))
2751                      (dir  ,(match (%current-system)
2752                               ("i686-linux"
2753                                "i386-Linux")
2754                               ((or "armhf-linux" "aarch64-linux")
2755                                "arm-Linux")
2756                               ((or "x86_64-linux")
2757                                "amd64-Linux")
2758                               (_ "unknown-Linux"))))
2759                  (with-directory-excursion "source/c"
2760                    (apply invoke `("gcc" "-shared" "-O3"
2761                                    "-fPIC"
2762                                    "-Wl,--exclude-libs,ALL"
2763                                    ,@(find-files "jhdf5" "\\.c$")
2764                                    ,@(find-files "hdf-java" "\\.c$")
2765                                    ,(string-append "-I" hdf5 "/include")
2766                                    ,(string-append "-I" jdk "/include")
2767                                    ,(string-append "-I" jdk "/include/linux")
2768                                    ,(string-append hdf5 "/lib/libhdf5.a")
2769                                    "-o" "libjhdf5.so" "-lz")))
2770                  (install-file "source/c/libjhdf5.so"
2771                                (string-append "libs/native/jhdf5/" dir))
2772                  #t)))
2773            ;; In the "check" phase we only build the test executable.
2774            (add-after 'check 'run-tests
2775              (lambda _
2776                (invoke "java" "-jar" "targets/dist/sis-jhdf5-test.jar")
2777                (delete-file "targets/dist/sis-jhdf5-test.jar")
2778                #t))
2779            (replace 'install
2780              (install-jars "targets/dist")))))
2781       (inputs
2782        `(("java-cisd-base" ,java-cisd-base)
2783          ("java-cisd-args4j" ,java-cisd-args4j)
2784          ("java-commons-lang" ,java-commons-lang)
2785          ("java-commons-io" ,java-commons-io)
2786          ("hdf5" ,hdf5)
2787          ("zlib" ,zlib)))
2788       (native-inputs
2789        `(("jdk" ,icedtea-8)
2790          ("java-testng" ,java-testng)
2791          ("java-junit" ,java-junit)
2792          ("java-jmock" ,java-jmock)
2793          ("java-hamcrest-core" ,java-hamcrest-core)
2794          ("build-resources"
2795           ,(origin
2796              (method svn-fetch)
2797              (uri (svn-reference
2798                    (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2799                                        "jhdf5/tags/release/"
2800                                        (version-major+minor base-version)
2801                                        ".x/" base-version
2802                                        "/build_resources/"))
2803                    (revision revision)))
2804              (sha256
2805               (base32
2806                "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
2807       (home-page "https://wiki-bsse.ethz.ch/display/JHDF5/")
2808       (synopsis "Java binding for HDF5")
2809       (description "JHDF5 is a high-level API in Java for reading and writing
2810 HDF5 files, building on the libraries provided by the HDF Group.")
2811       ;; The C sources are under a non-copyleft license, which looks like a
2812       ;; variant of the BSD licenses.  The whole package is under the ASL2.0.
2813       (license (list license:asl2.0
2814                      (license:non-copyleft "file://source/c/COPYING"))))))
2816 (define-public java-classpathx-servletapi
2817   (package
2818     (name "java-classpathx-servletapi")
2819     (version "3.0.1")
2820     (source (origin
2821               (method url-fetch)
2822               (uri (string-append "mirror://gnu/classpathx/servletapi/"
2823                                   "servletapi-" version ".tar.gz"))
2824               (sha256
2825                (base32
2826                 "07d8h051siga2f33fra72hk12sbq1bxa4jifjg0qj0vfazjjff0x"))))
2827     (build-system ant-build-system)
2828     (arguments
2829      `(#:tests? #f ; there is no test target
2830        #:build-target "compile"
2831        #:make-flags
2832        (list "-Dbuild.compiler=javac1.8"
2833              (string-append "-Ddist=" (assoc-ref %outputs "out")))
2834        #:phases
2835        (modify-phases %standard-phases
2836          (replace 'install
2837            (lambda* (#:key make-flags #:allow-other-keys)
2838              (apply invoke `("ant" "dist" ,@make-flags)))))))
2839     (home-page "https://www.gnu.org/software/classpathx/")
2840     (synopsis "Java servlet API implementation")
2841     (description "This is the GNU servlet API distribution, part of the
2842 ClasspathX project.  It provides implementations of version 3.0 of the servlet
2843 API and version 2.1 of the Java ServerPages API.")
2844     (license license:gpl3+)))
2846 (define-public java-javaee-servletapi
2847   (package
2848     (name "java-javaee-servletapi")
2849     (version "3.1.0")
2850     (source (origin
2851               (method url-fetch)
2852               (uri (string-append "https://github.com/javaee/servlet-spec/"
2853                                   "archive/" version ".zip"))
2854               (file-name (string-append name "-" version ".zip"))
2855               (sha256
2856                (base32
2857                 "0m6p13vgfb1ihich1jp5j6fqlhkjsrkn32c86bsbkryp38ipwg8w"))))
2858     (build-system ant-build-system)
2859     (arguments
2860      `(#:jar-name "javax-servletapi.jar"
2861        ;; no tests
2862        #:tests? #f
2863        #:source-dir "src/main/java"))
2864     (native-inputs
2865      `(("unzip" ,unzip)))
2866     (home-page "https://javaee.github.io/servlet-spec/")
2867     (synopsis "Java servlet API")
2868     (description "Java Servlet is the foundation web specification in the
2869 Java Enterprise Platform.  Developers can build web applications using the
2870 Servlet API to interact with the request/response workflow.  This project
2871 provides information on the continued development of the Java Servlet
2872 specification.")
2873     ;; Main code is dual-licensed by Oracle under either GLP2 or CDDL 1.1.
2874     ;; Some files are licensed under ASL 2.0.
2875     (license (list license:asl2.0 license:gpl2 license:cddl1.1))))
2877 (define-public java-swt
2878   (package
2879     (name "java-swt")
2880     (version "4.7.1a")
2881     (source
2882      ;; The types of many variables and procedures differ in the sources
2883      ;; dependent on whether the target architecture is a 32-bit system or a
2884      ;; 64-bit system.  Instead of patching the sources on demand in a build
2885      ;; phase we download either the 32-bit archive (which mostly uses "int"
2886      ;; types) or the 64-bit archive (which mostly uses "long" types).
2887      (let ((hash32 "09q0cbh90d90q3a7dx9430kc4m6bijrkr4lajrmzzvi0jjdpq4v9")
2888            (hash64 "17k5hs75a87ssmc5xhwdfdm2gn4zba0r837l2455za01krnkaa2q")
2889            (file32 "x86")
2890            (file64 "x86_64"))
2891        (let-values (((hash file)
2892                      (match (or (%current-target-system) (%current-system))
2893                        ("x86_64-linux" (values hash64 file64))
2894                        (_              (values hash32 file32)))))
2895          (origin
2896            (method url-fetch)
2897            (uri (string-append
2898                  "http://download.eclipse.org/eclipse/downloads/drops4/"
2899                  "R-" version "-201710090410/swt-" version
2900                  "-gtk-linux-" file ".zip"))
2901            (sha256 (base32 hash))))))
2902     (build-system ant-build-system)
2903     (arguments
2904      `(#:jar-name "swt.jar"
2905        #:jdk ,icedtea-8
2906        #:tests? #f ; no "check" target
2907        #:phases
2908        (modify-phases %standard-phases
2909          (replace 'unpack
2910            (lambda* (#:key source #:allow-other-keys)
2911              (mkdir "swt")
2912              (invoke "unzip" source "-d" "swt")
2913              (chdir "swt")
2914              (mkdir "src")
2915              (invoke "unzip" "src.zip" "-d" "src")))
2916          ;; The classpath contains invalid icecat jars.  Since we don't need
2917          ;; anything other than the JDK on the classpath, we can simply unset
2918          ;; it.
2919          (add-after 'configure 'unset-classpath
2920            (lambda _ (unsetenv "CLASSPATH") #t))
2921          (add-before 'build 'build-native
2922            (lambda* (#:key inputs outputs #:allow-other-keys)
2923              (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
2924                ;; Build shared libraries.  Users of SWT have to set the system
2925                ;; property swt.library.path to the "lib" directory of this
2926                ;; package output.
2927                (mkdir-p lib)
2928                (setenv "OUTPUT_DIR" lib)
2929                (with-directory-excursion "src"
2930                  (invoke "bash" "build.sh")))))
2931          (add-after 'install 'install-native
2932            (lambda* (#:key outputs #:allow-other-keys)
2933              (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
2934                (for-each (lambda (file)
2935                            (install-file file lib))
2936                          (find-files "." "\\.so$"))
2937                #t))))))
2938     (inputs
2939      `(("gtk" ,gtk+-2)
2940        ("libxtst" ,libxtst)
2941        ("libxt" ,libxt)
2942        ("mesa" ,mesa)
2943        ("glu" ,glu)))
2944     (native-inputs
2945      `(("pkg-config" ,pkg-config)
2946        ("unzip" ,unzip)))
2947     (home-page "https://www.eclipse.org/swt/")
2948     (synopsis "Widget toolkit for Java")
2949     (description
2950      "SWT is a widget toolkit for Java designed to provide efficient, portable
2951 access to the user-interface facilities of the operating systems on which it
2952 is implemented.")
2953     ;; SWT code is licensed under EPL1.0
2954     ;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
2955     ;; Cairo bindings contain code under MPL1.1
2956     ;; XULRunner 1.9 bindings contain code under MPL2.0
2957     (license (list
2958               license:epl1.0
2959               license:mpl1.1
2960               license:mpl2.0
2961               license:lgpl2.1+))))
2963 (define-public java-xz
2964   (package
2965    (name "java-xz")
2966    (version "1.6")
2967    (source (origin
2968      (method url-fetch)
2969      (uri (string-append "http://tukaani.org/xz/xz-java-" version ".zip"))
2970      (sha256
2971       (base32
2972        "1z3p1ri1gvl07inxn0agx44ck8n7wrzfmvkz8nbq3njn8r9wba8x"))))
2973    (build-system ant-build-system)
2974    (arguments
2975     `(#:tests? #f ; There are no tests to run.
2976       #:jar-name ,(string-append "xz-" version  ".jar")
2977       #:phases
2978       (modify-phases %standard-phases
2979         ;; The unpack phase enters the "maven" directory by accident.
2980         (add-after 'unpack 'chdir
2981           (lambda _ (chdir "..") #t)))))
2982    (native-inputs
2983     `(("unzip" ,unzip)))
2984    (home-page "https://tukaani.org/xz/java.html")
2985    (synopsis "Implementation of XZ data compression in pure Java")
2986    (description "This library aims to be a complete implementation of XZ data
2987 compression in pure Java.  Single-threaded streamed compression and
2988 decompression and random access decompression have been fully implemented.")
2989    (license license:public-domain)))
2991 ;; java-hamcrest-core uses qdox version 1.12.  We package this version instead
2992 ;; of the latest release.
2993 (define-public java-qdox-1.12
2994   (package
2995     (name "java-qdox")
2996     (version "1.12.1")
2997     (source (origin
2998               (method url-fetch)
2999               (uri (string-append "http://central.maven.org/maven2/"
3000                                   "com/thoughtworks/qdox/qdox/" version
3001                                   "/qdox-" version "-sources.jar"))
3002               (sha256
3003                (base32
3004                 "0hlfbqq2avf5s26wxkksqmkdyk6zp9ggqn37c468m96mjv0n9xfl"))))
3005     (build-system ant-build-system)
3006     (arguments
3007      `(;; Tests require junit
3008        #:tests? #f
3009        #:jar-name "qdox.jar"
3010        #:phases
3011        (modify-phases %standard-phases
3012          (replace 'unpack
3013            (lambda* (#:key source #:allow-other-keys)
3014              (mkdir "src")
3015              (with-directory-excursion "src"
3016                (invoke "jar" "-xf" source))))
3017          ;; At this point we don't have junit, so we must remove the API
3018          ;; tests.
3019          (add-after 'unpack 'delete-tests
3020            (lambda _
3021              (delete-file-recursively "src/com/thoughtworks/qdox/junit")
3022              #t)))))
3023     (home-page "http://qdox.codehaus.org/")
3024     (synopsis "Parse definitions from Java source files")
3025     (description
3026      "QDox is a high speed, small footprint parser for extracting
3027 class/interface/method definitions from source files complete with JavaDoc
3028 @code{@@tags}.  It is designed to be used by active code generators or
3029 documentation tools.")
3030     (license license:asl2.0)))
3032 (define-public java-jarjar
3033   (package
3034     (name "java-jarjar")
3035     (version "1.4")
3036     (source (origin
3037               (method url-fetch)
3038               (uri (string-append
3039                     "https://storage.googleapis.com/google-code-archive-downloads/v2/"
3040                     "code.google.com/jarjar/jarjar-src-" version ".zip"))
3041               (sha256
3042                (base32
3043                 "1v8irhni9cndcw1l1wxqgry013s2kpj0qqn57lj2ji28xjq8ndjl"))
3044               (modules '((guix build utils)))
3045               (snippet
3046                '(begin
3047                   ;; Delete bundled thirds-party jar archives.
3048                   ;; TODO: unbundle maven-plugin-api.
3049                   (delete-file "lib/asm-4.0.jar")
3050                   (delete-file "lib/asm-commons-4.0.jar")
3051                   (delete-file "lib/junit-4.8.1.jar")
3052                   #t))))
3053     (build-system ant-build-system)
3054     (arguments
3055      `(;; Tests require junit, which ultimately depends on this package.
3056        #:tests? #f
3057        #:build-target "jar"
3058        #:phases
3059        (modify-phases %standard-phases
3060          (add-before 'build 'do-not-use-bundled-asm
3061            (lambda* (#:key inputs #:allow-other-keys)
3062              (substitute* "build.xml"
3063                (("<path id=\"path.build\">")
3064                 (string-append "<path id=\"path.build\"><fileset dir=\""
3065                                (assoc-ref inputs "java-asm-bootstrap")
3066                                "/share/java\" includes=\"**/*.jar\"/>"))
3067                (("<zipfileset src=\"lib/asm-4.0.jar\"/>") "")
3068                (("lib/asm-commons-4.0.jar")
3069                 (string-append (assoc-ref inputs "java-asm-bootstrap")
3070                                "/share/java/asm-6.0.jar"))
3071                (("<include name=\"org/objectweb/asm/commons/Remap\\*\\.class\"/>")
3072                 (string-append "<include name=\"org/objectweb/asm/"
3073                                "commons/Remap*.class\"/>"
3074                                "<include name=\"org/objectweb/asm/*.class\"/>"
3075                                "<include name=\"org/objectweb/asm/"
3076                                "signature/*.class\"/>"
3077                                "<include name=\"org/objectweb/asm/"
3078                                "commons/SignatureRemapper.class\"/>")))
3079              #t))
3080          (replace 'install
3081            (lambda* (#:key outputs #:allow-other-keys)
3082              (let ((target (string-append (assoc-ref outputs "out")
3083                                           "/share/java")))
3084                (install-file (string-append "dist/jarjar-" ,version ".jar")
3085                              target))
3086              #t)))))
3087     (inputs
3088      `(("java-asm-bootstrap" ,java-asm-bootstrap)))
3089     (native-inputs
3090      `(("unzip" ,unzip)))
3091     (home-page "https://code.google.com/archive/p/jarjar/")
3092     (synopsis "Repackage Java libraries")
3093     (description
3094      "Jar Jar Links is a utility that makes it easy to repackage Java
3095 libraries and embed them into your own distribution.  Jar Jar Links includes
3096 an Ant task that extends the built-in @code{jar} task.")
3097     (license license:asl2.0)))
3099 (define-public java-hamcrest-core
3100   (package
3101     (name "java-hamcrest-core")
3102     (version "1.3")
3103     (source (origin
3104               (method url-fetch)
3105               (uri (string-append "https://github.com/hamcrest/JavaHamcrest/"
3106                                   "archive/hamcrest-java-" version ".tar.gz"))
3107               (sha256
3108                (base32
3109                 "11g0s105fmwzijbv08lx8jlb521yravjmxnpgdx08fvg1kjivhva"))
3110               (modules '((guix build utils)))
3111               (snippet
3112                '(begin
3113                   ;; Delete bundled thirds-party jar archives.
3114                   (delete-file-recursively "lib")
3115                   #t))))
3116     (build-system ant-build-system)
3117     (arguments
3118      `(#:tests? #f ; Tests require junit
3119        #:modules ((guix build ant-build-system)
3120                   (guix build utils)
3121                   (srfi srfi-1))
3122        #:make-flags (list (string-append "-Dversion=" ,version))
3123        #:test-target "unit-test"
3124        #:build-target "core"
3125        #:phases
3126        (modify-phases %standard-phases
3127          ;; Disable unit tests, because they require junit, which requires
3128          ;; hamcrest-core.  We also give a fixed value to the "Built-Date"
3129          ;; attribute from the manifest for reproducibility.
3130          (add-before 'configure 'patch-build.xml
3131            (lambda _
3132              (substitute* "build.xml"
3133                (("unit-test, ") "")
3134                (("\\$\\{build.timestamp\\}") "guix"))
3135              #t))
3136          ;; Java's "getMethods()" returns methods in an unpredictable order.
3137          ;; To make the output of the generated code deterministic we must
3138          ;; sort the array of methods.
3139          (add-after 'unpack 'make-method-order-deterministic
3140            (lambda _
3141              (substitute* "hamcrest-generator/src/main/java/org/hamcrest/generator/ReflectiveFactoryReader.java"
3142                (("import java\\.util\\.Iterator;" line)
3143                 (string-append line "\n"
3144                                "import java.util.Arrays; import java.util.Comparator;"))
3145                (("allMethods = cls\\.getMethods\\(\\);" line)
3146                 (string-append "_" line
3147                                "
3148 private Method[] getSortedMethods() {
3149   Arrays.sort(_allMethods, new Comparator<Method>() {
3150     @Override
3151     public int compare(Method a, Method b) {
3152       return a.toString().compareTo(b.toString());
3153     }
3154   });
3155   return _allMethods;
3158 private Method[] allMethods = getSortedMethods();")))
3159              #t))
3160          (add-before 'build 'do-not-use-bundled-qdox
3161            (lambda* (#:key inputs #:allow-other-keys)
3162              (substitute* "build.xml"
3163                (("lib/generator/qdox-1.12.jar")
3164                 (string-append (assoc-ref inputs "java-qdox-1.12")
3165                                "/share/java/qdox.jar")))
3166              #t))
3167          ;; build.xml searches for .jar files in this directoy, which
3168          ;; we remove  from the source archive.
3169          (add-before 'build 'create-dummy-directories
3170            (lambda _
3171              (mkdir-p "lib/integration")
3172              #t))
3173          (replace 'install
3174            (lambda* (#:key outputs #:allow-other-keys)
3175              (let* ((target (string-append (assoc-ref outputs "out")
3176                                            "/share/java/"))
3177                     (version-suffix ,(string-append "-" version ".jar"))
3178                     (install-without-version-suffix
3179                      (lambda (jar)
3180                        (copy-file jar
3181                                   (string-append target
3182                                                  (basename jar version-suffix)
3183                                                  ".jar")))))
3184                (mkdir-p target)
3185                (for-each
3186                 install-without-version-suffix
3187                 (find-files "build"
3188                             (lambda (name _)
3189                               (and (string-suffix? ".jar" name)
3190                                    (not (string-suffix? "-sources.jar" name)))))))
3191              #t)))))
3192     (native-inputs
3193      `(("java-qdox-1.12" ,java-qdox-1.12)
3194        ("java-jarjar" ,java-jarjar)))
3195     (home-page "http://hamcrest.org/")
3196     (synopsis "Library of matchers for building test expressions")
3197     (description
3198      "This package provides a library of matcher objects (also known as
3199 constraints or predicates) allowing @code{match} rules to be defined
3200 declaratively, to be used in other frameworks.  Typical scenarios include
3201 testing frameworks, mocking libraries and UI validation rules.")
3202     (license license:bsd-2)))
3204 (define-public java-junit
3205   (package
3206     (name "java-junit")
3207     (version "4.12")
3208     (source (origin
3209               (method url-fetch)
3210               (uri (string-append "https://github.com/junit-team/junit/"
3211                                   "archive/r" version ".tar.gz"))
3212               (file-name (string-append name "-" version ".tar.gz"))
3213               (sha256
3214                (base32
3215                 "090dn5v1vs0b3acyaqc0gjf6p8lmd2h24wfzsbq7sly6b214anws"))
3216               (modules '((guix build utils)))
3217               (snippet
3218                '(begin
3219                   ;; Delete bundled jar archives.
3220                   (delete-file-recursively "lib")
3221                   #t))))
3222     (build-system ant-build-system)
3223     (arguments
3224      `(#:tests? #f ; no tests
3225        #:jar-name "junit.jar"))
3226     (inputs
3227      `(("java-hamcrest-core" ,java-hamcrest-core)))
3228     (home-page "http://junit.org/")
3229     (synopsis "Test framework for Java")
3230     (description
3231      "JUnit is a simple framework to write repeatable tests for Java projects.
3232 JUnit provides assertions for testing expected results, test fixtures for
3233 sharing common test data, and test runners for running tests.")
3234     (license license:epl1.0)))
3236 (define-public java-plexus-utils
3237   (package
3238     (name "java-plexus-utils")
3239     (version "3.2.0")
3240     (source (origin
3241               (method url-fetch)
3242               (uri (string-append "https://github.com/codehaus-plexus/"
3243                                   "plexus-utils/archive/plexus-utils-"
3244                                   version ".tar.gz"))
3245               (sha256
3246                (base32
3247                 "1ihfigar20lvk4pinii7dq05i173xphhw4iyrk6gjfy04m01j2lz"))))
3248     (build-system ant-build-system)
3249     ;; FIXME: The default build.xml does not include a target to install
3250     ;; javadoc files.
3251     (arguments
3252      `(#:jar-name "plexus-utils.jar"
3253        #:source-dir "src/main"
3254        #:phases
3255        (modify-phases %standard-phases
3256          (add-after 'unpack 'fix-reference-to-/bin-and-/usr
3257            (lambda _
3258              (substitute* "src/main/java/org/codehaus/plexus/util/\
3259 cli/shell/BourneShell.java"
3260                (("/bin/sh") (which "sh"))
3261                (("/usr/")   (getcwd)))
3262              #t))
3263          (add-after 'unpack 'fix-or-disable-broken-tests
3264            (lambda _
3265              (with-directory-excursion "src/test/java/org/codehaus/plexus/util"
3266                (substitute* '("cli/CommandlineTest.java"
3267                               "cli/shell/BourneShellTest.java")
3268                  (("/bin/sh")   (which "sh"))
3269                  (("/bin/echo") (which "echo")))
3271                ;; This test depends on MavenProjectStub, but we don't have
3272                ;; a package for Maven.
3273                (delete-file "introspection/ReflectionValueExtractorTest.java")
3275                ;; FIXME: The command line tests fail, maybe because they use
3276                ;; absolute paths.
3277                (delete-file "cli/CommandlineTest.java"))
3278              #t)))))
3279     (native-inputs
3280      `(("java-hamcrest-core" ,java-hamcrest-core)
3281        ("java-junit" ,java-junit)))
3282     (home-page "http://codehaus-plexus.github.io/plexus-utils/")
3283     (synopsis "Common utilities for the Plexus framework")
3284     (description "This package provides various Java utility classes for the
3285 Plexus framework to ease working with strings, files, command lines, XML and
3286 more.")
3287     (license license:asl2.0)))
3289 (define-public java-plexus-interpolation
3290   (package
3291     (name "java-plexus-interpolation")
3292     (version "1.23")
3293     (source (origin
3294               (method url-fetch)
3295               (uri (string-append "https://github.com/codehaus-plexus/"
3296                                   "plexus-interpolation/archive/"
3297                                   "plexus-interpolation-" version ".tar.gz"))
3298               (sha256
3299                (base32
3300                 "03377yzlx5q440m6sxxgv6a5qb8fl30zzcgxgc0hxk5qgl2z1jjn"))))
3301     (build-system ant-build-system)
3302     (arguments
3303      `(#:jar-name "plexus-interpolation.jar"
3304        #:source-dir "src/main"))
3305     (native-inputs
3306      `(("java-junit" ,java-junit)
3307        ("java-hamcrest-core" ,java-hamcrest-core)))
3308     (home-page "http://codehaus-plexus.github.io/plexus-interpolation/")
3309     (synopsis "Java components for interpolating ${} strings and the like")
3310     (description "Plexus interpolator is a modular, flexible interpolation
3311 framework for the expression language style commonly seen in Maven, Plexus,
3312 and other related projects.
3314 It has its foundation in the @code{org.codehaus.plexus.utils.interpolation}
3315 package within @code{plexus-utils}, but has been separated in order to allow
3316 these two libraries to vary independently of one another.")
3317     (license license:asl2.0)))
3319 (define-public java-plexus-classworlds
3320   (package
3321     (name "java-plexus-classworlds")
3322     (version "2.5.2")
3323     (source (origin
3324               (method url-fetch)
3325               (uri (string-append "https://github.com/codehaus-plexus/"
3326                                   "plexus-classworlds/archive/plexus-classworlds-"
3327                                   version ".tar.gz"))
3328               (sha256
3329                (base32
3330                 "1qm4p0rl8d82lzhsiwnviw11jnq44s0gflg78zq152xyyr2xmh8g"))))
3331     (build-system ant-build-system)
3332     (arguments
3333      `(#:jar-name "plexus-classworlds.jar"
3334        #:source-dir "src/main"
3335        #:tests? #f));; FIXME: we need to generate some resources as in pom.xml
3336     (native-inputs
3337      `(("java-junit" ,java-junit)))
3338     (home-page "http://codehaus-plexus.github.io/plexus-classworlds/")
3339     (synopsis "Java class loader framework")
3340     (description "Plexus classworlds replaces the native @code{ClassLoader}
3341 mechanism of Java.  It is especially useful for dynamic loading of application
3342 components.")
3343     (license license:asl2.0)))
3345 (define java-plexus-container-default-bootstrap
3346   (package
3347     (name "java-plexus-container-default-bootstrap")
3348     (version "1.7.1")
3349     (source (origin
3350               (method url-fetch)
3351               (uri (string-append "https://github.com/codehaus-plexus/plexus-containers"
3352                                   "/archive/plexus-containers-" version ".tar.gz"))
3353               (sha256
3354                (base32
3355                 "0xw5g30qf4a83608rw9v2hv8pfsz7d69dkdhk6r0wia4q78hh1pc"))))
3356     (build-system ant-build-system)
3357     (arguments
3358      `(#:jar-name "container-default.jar"
3359        #:source-dir "plexus-container-default/src/main/java"
3360        #:test-dir "plexus-container-default/src/test"
3361        #:jdk ,icedtea-8
3362        #:tests? #f; requires plexus-archiver, which depends on this package
3363        #:phases
3364        (modify-phases %standard-phases
3365          (add-before 'build 'copy-resources
3366            (lambda _
3367              (copy-recursively
3368                "plexus-container-default/src/main/resources/"
3369                "build/classes")
3370              #t)))))
3371     (inputs
3372      `(("worldclass" ,java-plexus-classworlds)
3373        ("xbean" ,java-geronimo-xbean-reflect)
3374        ("utils" ,java-plexus-utils)
3375        ("junit" ,java-junit)
3376        ("guava" ,java-guava)))
3377     (home-page "https://github.com/codehaus-plexus/plexus-containers")
3378     (synopsis "Inversion-of-control container")
3379     (description "Plexus-default-container is Plexus' inversion-of-control
3380 (@dfn{IoC}) container.  It is composed of its public API and its default
3381 implementation.")
3382     (license license:asl2.0)))
3384 (define-public java-plexus-io
3385   (package
3386     (name "java-plexus-io")
3387     (version "3.0.0")
3388     (source (origin
3389               (method url-fetch)
3390               (uri (string-append "https://github.com/codehaus-plexus/plexus-io"
3391                                   "/archive/plexus-io-" version ".tar.gz"))
3392               (sha256
3393                (base32
3394                 "0f2j41kihaymxkpbm55smpxjja235vad8cgz94frfy3ppcp021dw"))))
3395     (build-system ant-build-system)
3396     (arguments
3397      `(#:jar-name "plexus-io.jar"
3398        #:source-dir "src/main/java"
3399        #:test-dir "src/test"
3400        #:jdk ,icedtea-8
3401        #:phases
3402        (modify-phases %standard-phases
3403          (add-before 'build 'copy-resources
3404            (lambda _
3405              (mkdir-p "build/classes/META-INF/plexus")
3406              (copy-file "src/main/resources/META-INF/plexus/components.xml"
3407                         "build/classes/META-INF/plexus/components.xml")
3408              #t)))))
3409     (inputs
3410      `(("utils" ,java-plexus-utils)
3411        ("commons-io" ,java-commons-io)
3412        ("java-jsr305" ,java-jsr305)))
3413     (native-inputs
3414      `(("junit" ,java-junit)
3415        ("hamcrest" ,java-hamcrest-core)
3416        ("guava" ,java-guava)
3417        ("classworlds" ,java-plexus-classworlds)
3418        ("xbean" ,java-geronimo-xbean-reflect)
3419        ("container-default" ,java-plexus-container-default-bootstrap)))
3420     (home-page "https://github.com/codehaus-plexus/plexus-io")
3421     (synopsis "I/O plexus components")
3422     (description "Plexus IO is a set of plexus components, which are designed
3423 for use in I/O operations.  This implementation using plexus components allows
3424 reusing it in maven.")
3425     (license license:asl2.0)))
3427 (define-public java-plexus-archiver
3428   (package
3429     (name "java-plexus-archiver")
3430     (version "4.1.0")
3431     (source (origin
3432               (method url-fetch)
3433               (uri (string-append "https://github.com/codehaus-plexus/plexus-archiver"
3434                                   "/archive/plexus-archiver-" version ".tar.gz"))
3435               (sha256
3436                (base32
3437                 "0ry6i92gli0mvdmfih2vgs0lkf9yvx18h2ajxim66yg6yipnp0hg"))))
3438     (build-system ant-build-system)
3439     (arguments
3440      `(#:jar-name "plexus-archiver.jar"
3441        #:source-dir "src/main/java"
3442        #:jdk ,icedtea-8
3443        #:test-dir "src/test"
3444        #:test-exclude (list "**/Abstract*.java" "**/Base*.java")
3445        #:phases
3446        (modify-phases %standard-phases
3447          (add-before 'check 'remove-failing
3448            (lambda _
3449              ;; Requires an older version of plexus container
3450              (delete-file
3451               "src/test/java/org/codehaus/plexus/archiver/DuplicateFilesTest.java")
3452              #t))
3453          (add-before 'check 'fix-test-building
3454            (lambda _
3455              (substitute* "build.xml"
3456                (("srcdir=\"src/test\"") "srcdir=\"src/test/java\""))
3457              #t))
3458          (add-before 'build 'copy-resources
3459            (lambda _
3460              (mkdir-p "build/classes/META-INF/plexus")
3461              (copy-file "src/main/resources/META-INF/plexus/components.xml"
3462                         "build/classes/META-INF/plexus/components.xml")
3463              #t)))))
3464     (inputs
3465      `(("utils" ,java-plexus-utils)
3466        ("commons-io" ,java-commons-io)
3467        ("snappy" ,java-iq80-snappy)
3468        ("io" ,java-plexus-io)
3469        ("compress" ,java-commons-compress)
3470        ("container-default" ,java-plexus-container-default-bootstrap)
3471        ("snappy" ,java-snappy)
3472        ("java-jsr305" ,java-jsr305)))
3473     (native-inputs
3474      `(("java-hamcrest-core" ,java-hamcrest-core)
3475        ("junit" ,java-junit)
3476        ("classworld" ,java-plexus-classworlds)
3477        ("xbean" ,java-geronimo-xbean-reflect)
3478        ("xz" ,java-tukaani-xz)
3479        ("guava" ,java-guava)))
3480     (home-page "https://github.com/codehaus-plexus/plexus-archiver")
3481     (synopsis "Archiver component of the Plexus project")
3482     (description "Plexus-archiver contains a component to deal with project
3483 archives (jar).")
3484     (license license:asl2.0)))
3486 (define-public java-plexus-container-default
3487   (package
3488     (inherit java-plexus-container-default-bootstrap)
3489     (name "java-plexus-container-default")
3490     (arguments
3491      `(#:jar-name "container-default.jar"
3492        #:source-dir "plexus-container-default/src/main/java"
3493        #:test-dir "plexus-container-default/src/test"
3494        #:test-exclude (list ;"**/*Test.java"
3495                             "**/Abstract*.java"
3496                             ;; Requires plexus-hierarchy
3497                             "**/PlexusHierarchyTest.java"
3498                             ;; Failures
3499                             "**/ComponentRealmCompositionTest.java"
3500                             "**/PlexusContainerTest.java")
3501        #:jdk ,icedtea-8
3502        #:phases
3503        (modify-phases %standard-phases
3504          (add-before 'build 'copy-resources
3505            (lambda _
3506              (copy-recursively
3507                "plexus-container-default/src/main/resources/"
3508                "build/classes")
3509              #t))
3510          (add-before 'check 'fix-paths
3511            (lambda _
3512              (let ((dir "plexus-container-default/src/test/java/org/codehaus"))
3513                (substitute*
3514                  (string-append
3515                    dir "/plexus/component/composition/"
3516                    "ComponentRealmCompositionTest.java")
3517                  (("src/test") "plexus-container-default/src/test"))
3518                #t))))))
3519     (inputs
3520      `(("worldclass" ,java-plexus-classworlds)
3521        ("xbean" ,java-geronimo-xbean-reflect)
3522        ("utils" ,java-plexus-utils)
3523        ("junit" ,java-junit)
3524        ("guava" ,java-guava)))
3525     (native-inputs
3526      `(("archiver" ,java-plexus-archiver)
3527        ("hamcrest" ,java-hamcrest-core)))))
3529 (define-public java-plexus-component-annotations
3530   (package
3531     (inherit java-plexus-container-default)
3532     (name "java-plexus-component-annotations")
3533     (arguments
3534      `(#:jar-name "plexus-component-annotations.jar"
3535        #:source-dir "plexus-component-annotations/src/main/java"
3536        #:tests? #f)); no tests
3537     (inputs '())
3538     (native-inputs '())
3539     (synopsis "Plexus descriptors generator")
3540     (description "This package is a Maven plugin to generate Plexus descriptors
3541 from source tags and class annotations.")))
3543 (define-public java-plexus-cipher
3544   (package
3545     (name "java-plexus-cipher")
3546     (version "1.7")
3547     (source (origin
3548               (method url-fetch)
3549               (uri (string-append "https://github.com/codehaus-plexus/plexus-cipher"
3550                                   "/archive/plexus-cipher-" version ".tar.gz"))
3551               (sha256
3552                (base32
3553                 "1j3r8xzlxlk340snkjp6lk2ilkxlkn8qavsfiq01f43xmvv8ymk3"))))
3554     (build-system ant-build-system)
3555     (arguments
3556      `(#:jar-name "plexus-cipher.jar"
3557        #:source-dir "src/main/java"
3558        #:jdk ,icedtea-8
3559        #:tests? #f; FIXME: requires sisu-inject-bean
3560        #:phases
3561        (modify-phases %standard-phases
3562          (add-before 'build 'copy-resources
3563            (lambda _
3564              (copy-recursively "src/main/resources" "build/classes")
3565              (mkdir-p "build/classes/META-INF/sisu")
3566              (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
3567                (lambda _
3568                  (display "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
3569              #t)))))
3570     (inputs
3571      `(("java-cdi-api" ,java-cdi-api)
3572        ("java-javax-inject" ,java-javax-inject)))
3573     (home-page "https://github.com/sonatype/plexus-cipher")
3574     (synopsis "Encryption/decryption Component")
3575     (description "Plexus-cipher contains a component to deal with encryption
3576 and decryption.")
3577     (license license:asl2.0)))
3579 (define-public java-plexus-compiler-api
3580   (package
3581     (name "java-plexus-compiler-api")
3582     (version "2.8.4")
3583     (source (origin
3584               (method url-fetch)
3585               (uri (string-append "https://github.com/codehaus-plexus/plexus-compiler"
3586                                   "/archive/plexus-compiler-" version ".tar.gz"))
3587               (sha256
3588                (base32
3589                 "09vmxs0807wsd26nbrwwj5l8ycmzazqycj52l7w6wjvkryywi69h"))))
3590     (build-system ant-build-system)
3591     (arguments
3592      `(#:jar-name "plexus-compiler-api.jar"
3593        #:source-dir "plexus-compiler-api/src/main/java"
3594        #:jdk ,icedtea-8
3595        #:test-dir "plexus-compiler-api/src/test"))
3596     (inputs
3597      `(("java-plexus-container-default" ,java-plexus-container-default)
3598        ("java-plexus-util" ,java-plexus-utils)))
3599     (native-inputs
3600      `(("java-junit" ,java-junit)))
3601     (home-page "https://github.com/codehaus-plexus/plexus-compiler")
3602     (synopsis "Plexus Compilers component's API to manipulate compilers")
3603     (description "This package contains the API used by components to manipulate
3604 compilers.")
3605     (license (list license:asl2.0
3606                    license:expat))))
3608 (define-public java-plexus-compiler-javac
3609   (package
3610     (inherit java-plexus-compiler-api)
3611     (name "java-plexus-compiler-javac")
3612     (arguments
3613      `(#:jar-name "plexus-compiler-javac.jar"
3614        #:source-dir "plexus-compilers/plexus-compiler-javac/src/main/java"
3615        #:jdk ,icedtea-8
3616        #:tests? #f; depends on compiler-test -> maven-core -> ... -> this package.
3617        #:test-dir "plexus-compilers/plexus-compiler-javac/src/test"))
3618     (inputs
3619      `(("java-plexus-compiler-api" ,java-plexus-compiler-api)
3620        ("java-plexus-utils" ,java-plexus-utils)
3621        ("java-plexus-container-default" ,java-plexus-container-default)))
3622     (native-inputs
3623      `(("java-junit" ,java-junit)))
3624     (synopsis "Javac Compiler support for Plexus Compiler component")
3625     (description "This package contains the Javac Compiler support for Plexus
3626 Compiler component.")))
3628 (define-public java-plexus-sec-dispatcher
3629   (package
3630     (name "java-plexus-sec-dispatcher")
3631     (version "1.4") ;; Newest release listed at the Maven Central Repository.
3632     (source (origin
3633               ;; This project doesn't tag releases or publish tarballs, so we take
3634               ;; the "prepare release plexus-sec-dispatcher-1.4" git commit.
3635               (method url-fetch)
3636               (uri (string-append "https://github.com/sonatype/plexus-sec-dispatcher/"
3637                                   "archive/7db8f88048.tar.gz"))
3638               (sha256
3639                (base32
3640                 "1smfrk4n7xbrsxpxcp2j4i0j8q86j73w0w6xg7qz83dp6dagdjgp"))
3641               (file-name (string-append name "-" version ".tar.gz"))))
3642     (arguments
3643      `(#:jar-name "plexus-sec-dispatcher.jar"
3644        #:source-dir "src/main/java"
3645        #:jdk ,icedtea-8
3646        #:phases
3647        (modify-phases %standard-phases
3648          (add-before 'build 'generate-models
3649            (lambda* (#:key inputs #:allow-other-keys)
3650              (define (modello-single-mode file version mode)
3651                (invoke "java"
3652                        "org.codehaus.modello.ModelloCli"
3653                        file mode "src/main/java" version
3654                        "false" "true"))
3655              (let ((file "src/main/mdo/settings-security.mdo"))
3656                (modello-single-mode file "1.0.0" "java")
3657                (modello-single-mode file "1.0.0" "xpp3-reader")
3658                (modello-single-mode file "1.0.0" "xpp3-writer"))
3659              #t))
3660          (add-before 'build 'generate-components.xml
3661            (lambda _
3662              (mkdir-p "build/classes/META-INF/plexus")
3663              (with-output-to-file "build/classes/META-INF/plexus/components.xml"
3664                (lambda _
3665                  (display
3666                    "<component-set>\n
3667   <components>\n
3668     <component>\n
3669       <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role>\n
3670       <role-hint>default</role-hint>\n
3671       <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation>\n
3672       <description></description>\n
3673       <requirements>\n
3674         <requirement>\n
3675           <role>org.sonatype.plexus.components.cipher.PlexusCipher</role>\n
3676           <field-name>_cipher</field-name>\n
3677         </requirement>\n
3678         <requirement>\n
3679           <role>org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor</role>\n
3680           <field-name>_decryptors</field-name>\n
3681         </requirement>\n
3682       </requirements>\n
3683       <configuration>\n
3684         <_configuration-file>~/.settings-security.xml</_configuration-file>\n
3685       </configuration>\n
3686     </component>\n
3687   </components>\n
3688 </component-set>\n")))
3689              #t))
3690          (add-before 'check 'fix-paths
3691            (lambda _
3692              (copy-recursively "src/test/resources" "target")
3693              #t)))))
3694     (inputs
3695      `(("java-plexus-cipher" ,java-plexus-cipher)))
3696     (native-inputs
3697      `(("java-modello-core" ,java-modello-core)
3698        ;; for modello:
3699        ("java-plexus-container-default" ,java-plexus-container-default)
3700        ("java-plexus-classworlds" ,java-plexus-classworlds)
3701        ("java-plexus-utils" ,java-plexus-utils)
3702        ("java-guava" ,java-guava)
3703        ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
3704        ("java-sisu-build-api" ,java-sisu-build-api)
3705        ;; modello plugins:
3706        ("java-modellop-plugins-java" ,java-modello-plugins-java)
3707        ("java-modellop-plugins-xml" ,java-modello-plugins-xml)
3708        ("java-modellop-plugins-xpp3" ,java-modello-plugins-xpp3)
3709        ;; for tests
3710        ("java-junit" ,java-junit)))
3711     (build-system ant-build-system)
3712     (home-page "https://github.com/sonatype/plexus-sec-dispatcher")
3713     (synopsis "Plexus Security Dispatcher Component")
3714     (description "This package is the Plexus Security Dispatcher Component.
3715 This component decrypts a string passed to it.")
3716     (license license:asl2.0)))
3718 (define-public java-plexus-cli
3719   (package
3720     (name "java-plexus-cli")
3721     (version "1.7")
3722     (source (origin
3723               (method git-fetch)
3724               (uri (git-reference
3725                      (url "https://github.com/sonatype/plexus-cli")
3726                      (commit "a776afa6bca84e5107bedb69440329cdb24ed645")))
3727               (file-name (string-append name "-" version))
3728               (sha256
3729                (base32
3730                 "0xjrlay605rypv3zd7y24vlwf0039bil3n2cqw54r1ddpysq46vx"))))
3731     (build-system ant-build-system)
3732     (arguments
3733      `(#:jar-name "plexus-cli.jar"
3734        #:source-dir "src/main/java"
3735        #:jdk ,icedtea-8
3736        #:test-dir "src/test"))
3737     (inputs
3738      `(("java-commons-cli" ,java-commons-cli)
3739        ("java-plexus-container-default" ,java-plexus-container-default)
3740        ("java-plexus-classworlds" ,java-plexus-classworlds)))
3741     (native-inputs
3742      `(("java-plexus-utils" ,java-plexus-utils)
3743        ("java-junit" ,java-junit)
3744        ("java-guava" ,java-guava)))
3745     (home-page "https://codehaus-plexus.github.io/plexus-cli")
3746     (synopsis "CLI building library for plexus")
3747     (description "This package is a library to help creating CLI around
3748 Plexus components.")
3749     (license license:asl2.0)))
3751 (define-public java-sisu-build-api
3752   (package
3753     (name "java-sisu-build-api")
3754     (version "0.0.7")
3755     (source (origin
3756               (method url-fetch)
3757               (uri (string-append "https://github.com/sonatype/sisu-build-api/"
3758                                   "archive/plexus-build-api-" version ".tar.gz"))
3759               (sha256
3760                (base32
3761                 "1c3rrpma3x634xp2rm2p5iskfhzdyc7qfbhjzr70agrl1jwghgy2"))))
3762     (build-system ant-build-system)
3763     (arguments
3764      `(#:jar-name "sisu-build-api.jar"
3765        #:source-dir "src/main/java"
3766        #:jdk ,icedtea-8
3767        #:tests? #f; FIXME: how to run the tests?
3768        #:phases
3769        (modify-phases %standard-phases
3770          (add-before 'build 'copy-resources
3771            (lambda _
3772              (copy-recursively "src/main/resources" "build/classes")
3773              (substitute* (find-files "build/classes")
3774                (("\\$\\{project.version\\}") ,version))
3775              #t))
3776          (add-before 'build 'generate-plexus-compontent
3777            (lambda _
3778              (mkdir-p "build/classes/META-INF/plexus")
3779              ;; This file is required for plexus to inject this package.
3780              ;; FIXME: how is it generated?
3781              (with-output-to-file "build/classes/META-INF/plexus/components.xml"
3782                (lambda _
3783                  (display
3784                    "<component-set>\n
3785   <components>\n
3786     <component>\n
3787       <role>org.sonatype.plexus.build.incremental.BuildContext</role>\n
3788       <role-hint>default</role-hint>\n
3789       <implementation>org.sonatype.plexus.build.incremental.DefaultBuildContext</implementation>\n
3790       <description>Filesystem based non-incremental build context implementation\n
3791 which behaves as if all files were just created.</description>\n
3792     </component>\n
3793   </components>\n
3794 </component-set>\n")))
3795              #t)))))
3796     (inputs
3797      `(("java-plexus-utils" ,java-plexus-utils)
3798        ("java-plexus-container-default" ,java-plexus-container-default)))
3799     (home-page "https://github.com/sonatype/sisu-build-api/")
3800     (synopsis "Base build API for maven")
3801     (description "This package contains the base build API for maven and
3802 a default implementation of it.  This API is about scanning files in a
3803 project and determining what files need to be rebuilt.")
3804     (license license:asl2.0)))
3806 (define-public java-modello-core
3807   (package
3808     (name "java-modello-core")
3809     (version "1.9.1")
3810     (source (origin
3811               (method url-fetch)
3812               (uri (string-append "https://github.com/codehaus-plexus/modello"
3813                                   "/archive/modello-" version ".tar.gz"))
3814               (sha256
3815                (base32
3816                 "0l2pvns8pmlrmjm3iknp7gpg3654y1m8qhy55b19sdwdchdcyxfh"))))
3817     (build-system ant-build-system)
3818     (arguments
3819      `(#:jar-name "modello-core.jar"
3820        #:source-dir "modello-core/src/main/java"
3821        #:test-dir "modello-core/src/test"
3822        #:main-class "org.codehaus.modello.ModelloCli"
3823        #:jdk ,icedtea-8
3824        #:phases
3825        (modify-phases %standard-phases
3826          (add-before 'build 'copy-resources
3827            (lambda _
3828              (mkdir-p "build/classes/META-INF/plexus")
3829              (copy-file "modello-core/src/main/resources/META-INF/plexus/components.xml"
3830                         "build/classes/META-INF/plexus/components.xml")
3831              #t))
3832          (add-before 'check 'fix-tests
3833            (lambda _
3834              (with-directory-excursion "modello-core/src/test/java/org/codehaus"
3835                (substitute* '("modello/core/DefaultModelloCoreTest.java"
3836                               "modello/core/io/ModelReaderTest.java")
3837                  (("src/test") "modello-core/src/test")))
3838              #t)))))
3839     (inputs
3840      `(("java-plexus-utils" ,java-plexus-utils)
3841        ("java-plexus-container-default" ,java-plexus-container-default)
3842        ("java-sisu-build-api" ,java-sisu-build-api)))
3843     (native-inputs
3844      `(("java-junit" ,java-junit)
3845        ("java-plexus-classworlds" ,java-plexus-classworlds)
3846        ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
3847        ("java-guava" ,java-guava)))
3848     (home-page "http://codehaus-plexus.github.io/modello/")
3849     (synopsis "Framework for code generation from a simple model")
3850     (description "Modello is a framework for code generation from a simple model.
3852 Modello generates code from a simple model format: based on a plugin
3853 architecture, various types of code and descriptors can be generated from the
3854 single model, including Java POJOs, XML/JSON/YAML marshallers/unmarshallers,
3855 XSD and documentation.")
3856     (license (list
3857                license:expat
3858                ;; Although this package uses only files licensed under expat,
3859                ;; other parts of the source are licensed under different
3860                ;; licenses.  We include them to be inherited by other packages.
3861                license:asl2.0
3862                ;; Some files in modello-plugin-java are licensed under a
3863                ;; 5-clause BSD license.
3864                (license:non-copyleft
3865                  (string-append "file:///modello-plugins/modello-plugin-java/"
3866                                 "src/main/java/org/codehaus/modello/plugin/"
3867                                 "java/javasource/JNaming.java"))))))
3869 (define-public java-modello-plugins-java
3870   (package
3871     (inherit java-modello-core)
3872     (name "java-modello-plugins-java")
3873     (arguments
3874      `(#:jar-name "modello-plugins-java.jar"
3875        #:source-dir "modello-plugins/modello-plugin-java/src/main/java"
3876        #:test-dir "modello-plugins/modello-plugin-java/src/test"
3877        #:jdk ,icedtea-8
3878        #:tests? #f; requires maven-model, which depends on this package
3879        #:phases
3880        (modify-phases %standard-phases
3881          (add-before 'build 'copy-resources
3882            (lambda _
3883              (mkdir-p "build/classes")
3884              (copy-recursively "modello-plugins/modello-plugin-java/src/main/resources"
3885                                "build/classes")
3886              #t)))))
3887     (inputs
3888      `(("java-modello-core" ,java-modello-core)
3889        ,@(package-inputs java-modello-core)))
3890     (synopsis "Modello Java Plugin")
3891     (description "Modello Java Plugin generates Java objects for the model.")))
3893 (define-public java-modello-plugins-xml
3894   (package
3895     (inherit java-modello-core)
3896     (name "java-modello-plugins-xml")
3897     (arguments
3898      `(#:jar-name "modello-plugins-xml.jar"
3899        #:source-dir "modello-plugins/modello-plugin-xml/src/main/java"
3900        #:test-dir "modello-plugins/modello-plugin-xml/src/test"
3901        #:jdk ,icedtea-8
3902        #:phases
3903        (modify-phases %standard-phases
3904          (add-before 'build 'copy-resources
3905            (lambda _
3906              (mkdir-p "build/classes")
3907              (copy-recursively
3908                "modello-plugins/modello-plugin-xml/src/main/resources"
3909                "build/classes")
3910              #t))
3911          (add-before 'check 'fix-paths
3912            (lambda _
3913              (with-directory-excursion "modello-plugins/modello-plugin-xml/src/test"
3914                (substitute*
3915                  "java/org/codehaus/modello/plugins/xml/XmlModelloPluginTest.java"
3916                  (("src/test") "modello-plugins/modello-plugin-xml/src/test")))
3917              #t)))))
3918     (inputs
3919      `(("java-modello-core" ,java-modello-core)
3920        ("java-modello-plugins-java" ,java-modello-plugins-java)
3921        ,@(package-inputs java-modello-core)))
3922     (synopsis "Modello XML Plugin")
3923     (description "Modello XML Plugin contains shared code for every plugins
3924 working on XML representation of the model.")))
3926 (define-public java-modello-test
3927   (package
3928     (inherit java-modello-core)
3929     (name "java-modello-test")
3930     (arguments
3931      `(#:jar-name "modello-test.jar"
3932        #:source-dir "modello-test/src/main/java"
3933        #:tests? #f; no tests
3934        #:jdk ,icedtea-8))
3935     (inputs
3936      `(("java-plexus-utils" ,java-plexus-utils)
3937        ("java-plexus-compiler-api" ,java-plexus-compiler-api)
3938        ("java-plexus-compiler-javac" ,java-plexus-compiler-javac)
3939        ("java-plexus-container-default" ,java-plexus-container-default)))
3940     (synopsis "Modello test package")
3941     (description "The modello test package contains the basis to create
3942 Modello generator unit-tests, including sample models and xml files to test
3943 every feature for every plugin.")))
3945 (define-public java-modello-plugins-xpp3
3946   (package
3947     (inherit java-modello-core)
3948     (name "java-modello-plugins-xpp3")
3949     (arguments
3950      `(#:jar-name "modello-plugins-xpp3.jar"
3951        #:source-dir "modello-plugins/modello-plugin-xpp3/src/main/java"
3952        #:test-dir "modello-plugins/modello-plugin-xpp3/src/test"
3953        ;; One of the test dependencies is maven-model which depends on this package.
3954        #:tests? #f
3955        #:jdk ,icedtea-8
3956        #:phases
3957        (modify-phases %standard-phases
3958          (add-before 'build 'copy-resources
3959            (lambda _
3960              (mkdir-p "build/classes")
3961              (copy-recursively "modello-plugins/modello-plugin-xpp3/src/main/resources"
3962                                "build/classes")
3963              #t)))))
3964     (inputs
3965      `(("java-modello-core" ,java-modello-core)
3966        ("java-modello-plugins-java" ,java-modello-plugins-java)
3967        ("java-modello-plugins-xml" ,java-modello-plugins-xml)
3968        ,@(package-inputs java-modello-core)))
3969     (native-inputs
3970      `(("java-xmlunit" ,java-xmlunit)
3971        ("java-modello-test" ,java-modello-test)
3972        ,@(package-native-inputs java-modello-core)))
3973     (synopsis "Modello XPP3 Plugin")
3974     (description "The modello XPP3 plugin generates XML readers and writers based
3975 on the XPP3 API (XML Pull Parser).")))
3977 (define-public java-asm
3978   (package
3979     (name "java-asm")
3980     (version "6.0")
3981     (source (origin
3982               (method url-fetch)
3983               (uri (string-append "http://download.forge.ow2.org/asm/"
3984                                   "asm-" version ".tar.gz"))
3985               (sha256
3986                (base32
3987                 "115l5pqblirdkmzi32dxx7gbcm4jy0s14y5wircr6h8jdr9aix00"))))
3988     (build-system ant-build-system)
3989     (propagated-inputs
3990      `(("java-aqute-bndlib" ,java-aqute-bndlib)
3991        ("java-aqute-libg" ,java-aqute-libg)))
3992     (arguments
3993      `(#:build-target "compile"
3994        ;; The tests require an old version of Janino, which no longer compiles
3995        ;; with the JDK7.
3996        #:tests? #f
3997        #:make-flags
3998        (list
3999         ;; We don't need these extra ant tasks, but the build system asks us to
4000         ;; provide a path anyway.
4001         "-Dobjectweb.ant.tasks.path=dummy-path"
4002         ;; The java-aqute.bndlib JAR file will be put onto the classpath and
4003         ;; used during the build automatically by ant-build-system, but
4004         ;; java-asm's build.xml fails unless we provide something here.
4005         "-Dbiz.aQute.bnd.path=dummy-path")
4006        #:phases
4007        (modify-phases %standard-phases
4008          (add-before 'install 'build-jars
4009            (lambda* (#:key make-flags #:allow-other-keys)
4010              ;; We cannot use the "jar" target because it depends on a couple
4011              ;; of unpackaged, complicated tools.
4012              (mkdir "dist")
4013              (invoke "jar"
4014                      "-cf" (string-append "dist/asm-" ,version ".jar")
4015                      "-C" "output/build/tmp" ".")))
4016          (replace 'install
4017            (install-jars "dist")))))
4018     (native-inputs
4019      `(("java-junit" ,java-junit)))
4020     (home-page "http://asm.ow2.org/")
4021     (synopsis "Very small and fast Java bytecode manipulation framework")
4022     (description "ASM is an all purpose Java bytecode manipulation and
4023 analysis framework.  It can be used to modify existing classes or dynamically
4024 generate classes, directly in binary form.  The provided common
4025 transformations and analysis algorithms allow to easily assemble custom
4026 complex transformations and code analysis tools.")
4027     (license license:bsd-3)))
4029 (define java-asm-bootstrap
4030   (package
4031     (inherit java-asm)
4032     (name "java-asm-bootstrap")
4033     (arguments
4034      (substitute-keyword-arguments (package-arguments java-asm)
4035        ((#:tests? _) #f)))
4036     (native-inputs `())
4037     (propagated-inputs
4038      `(("java-aqute-bndlib" ,java-aqute-bndlib-bootstrap)
4039        ("java-aqute-libg" ,java-aqute-libg-bootstrap)
4040        ,@(delete `("java-aqute-bndlib" ,java-aqute-bndlib)
4041                  (delete `("java-aqute-libg" ,java-aqute-libg)
4042                          (package-inputs java-asm)))))))
4044 (define-public java-cglib
4045   (package
4046     (name "java-cglib")
4047     (version "3.2.4")
4048     (source
4049      (origin
4050        (method git-fetch)
4051        (uri (git-reference
4052              (url "https://github.com/cglib/cglib.git")
4053              (commit (string-append
4054                       "RELEASE_"
4055                       (string-map (lambda (c) (if (char=? c #\.) #\_ c))
4056                                   version)))))
4057        (file-name (git-file-name name version))
4058        (sha256
4059         (base32 "186451jms2zfp47yd8kxd77az2cqal1my2br7klgyp8fpl4qfg8v"))))
4060     (build-system ant-build-system)
4061     (arguments
4062      `(;; FIXME: tests fail because junit runs
4063        ;; "net.sf.cglib.transform.AbstractTransformTest", which does not seem
4064        ;; to describe a test at all.
4065        #:tests? #f
4066        #:jar-name "cglib.jar"
4067        #:phases
4068        (modify-phases %standard-phases
4069          (add-after 'unpack 'chdir
4070            (lambda _ (chdir "cglib") #t)))))
4071     (inputs
4072      `(("java-asm" ,java-asm)
4073        ("java-junit" ,java-junit)))
4074     (home-page "https://github.com/cglib/cglib/")
4075     (synopsis "Java byte code generation library")
4076     (description "The byte code generation library CGLIB is a high level API
4077 to generate and transform Java byte code.")
4078     (license license:asl2.0)))
4080 (define-public java-objenesis
4081   (package
4082     (name "java-objenesis")
4083     (version "2.5.1")
4084     (source (origin
4085               (method url-fetch)
4086               (uri (string-append "https://github.com/easymock/objenesis/"
4087                                   "archive/" version ".tar.gz"))
4088               (file-name (string-append "objenesis-" version ".tar.gz"))
4089               (sha256
4090                (base32
4091                 "1va5qz1i2wawwavhnxfzxnfgrcaflz9p1pg03irrjh4nd3rz8wh6"))))
4092     (build-system ant-build-system)
4093     (arguments
4094      `(#:jar-name "objenesis.jar"
4095        #:source-dir "main/src/"
4096        #:test-dir "main/src/test/"))
4097     (native-inputs
4098      `(("java-junit" ,java-junit)
4099        ("java-hamcrest-core" ,java-hamcrest-core)))
4100     (home-page "http://objenesis.org/")
4101     (synopsis "Bypass the constructor when creating an object")
4102     (description "Objenesis is a small Java library that serves one purpose:
4103 to instantiate a new object of a particular class.  It is common to see
4104 restrictions in libraries stating that classes must require a default
4105 constructor.  Objenesis aims to overcome these restrictions by bypassing the
4106 constructor on object instantiation.")
4107     (license license:asl2.0)))
4109 (define-public java-easymock
4110   (package
4111     (name "java-easymock")
4112     (version "3.4")
4113     (source (origin
4114               (method url-fetch)
4115               (uri (string-append "https://github.com/easymock/easymock/"
4116                                   "archive/easymock-" version ".tar.gz"))
4117               (sha256
4118                (base32
4119                 "1yzg0kv256ndr57gpav46cyv4a1ns5sj722l50zpxk3j6sk9hnmi"))))
4120     (build-system ant-build-system)
4121     (arguments
4122      `(#:jar-name "easymock.jar"
4123        #:source-dir "core/src/main"
4124        #:test-dir "core/src/test"
4125        #:phases
4126        (modify-phases %standard-phases
4127          ;; FIXME: Android support requires the following packages to be
4128          ;; available: com.google.dexmaker.stock.ProxyBuilder
4129          (add-after 'unpack 'delete-android-support
4130            (lambda _
4131              (with-directory-excursion "core/src/main/java/org/easymock/internal"
4132                (substitute* "MocksControl.java"
4133                  (("AndroidSupport.isAndroid\\(\\)") "false")
4134                  (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
4135                (delete-file "AndroidClassProxyFactory.java"))
4136              #t))
4137          (add-after 'unpack 'delete-broken-tests
4138            (lambda _
4139              (with-directory-excursion "core/src/test/java/org/easymock"
4140                ;; This test depends on dexmaker.
4141                (delete-file "tests2/ClassExtensionHelperTest.java")
4143                ;; This is not a test.
4144                (delete-file "tests/BaseEasyMockRunnerTest.java")
4146                ;; This test should be executed with a different runner...
4147                (delete-file "tests2/EasyMockAnnotationsTest.java")
4148                ;; ...but deleting it means that we also have to delete these
4149                ;; dependent files.
4150                (delete-file "tests2/EasyMockRunnerTest.java")
4151                (delete-file "tests2/EasyMockRuleTest.java")
4153                ;; This test fails because the file "easymock.properties" does
4154                ;; not exist.
4155                (delete-file "tests2/EasyMockPropertiesTest.java"))
4156              #t)))))
4157     (inputs
4158      `(("java-asm" ,java-asm)
4159        ("java-cglib" ,java-cglib)
4160        ("java-objenesis" ,java-objenesis)))
4161     (native-inputs
4162      `(("java-junit" ,java-junit)
4163        ("java-hamcrest-core" ,java-hamcrest-core)))
4164     (home-page "http://easymock.org")
4165     (synopsis "Java library providing mock objects for unit tests")
4166     (description "EasyMock is a Java library that provides an easy way to use
4167 mock objects in unit testing.")
4168     (license license:asl2.0)))
4170 (define-public java-jmock-1
4171   (package
4172     (name "java-jmock")
4173     (version "1.2.0")
4174     (source (origin
4175               (method url-fetch)
4176               (uri (string-append "https://github.com/jmock-developers/"
4177                                   "jmock-library/archive/" version ".tar.gz"))
4178               (file-name (string-append "jmock-" version ".tar.gz"))
4179               (sha256
4180                (base32
4181                 "0xmrlhq0fszldkbv281k9463mv496143vvmqwpxp62yzjvdkx9w0"))))
4182     (build-system ant-build-system)
4183     (arguments
4184      `(#:build-target "jars"
4185        #:test-target "run.tests"
4186        #:phases
4187        (modify-phases %standard-phases
4188          (replace 'install (install-jars "build")))))
4189     (home-page "http://www.jmock.org")
4190     (synopsis "Mock object library for test-driven development")
4191     (description "JMock is a library that supports test-driven development of
4192 Java code with mock objects.  Mock objects help you design and test the
4193 interactions between the objects in your programs.
4195 The jMock library
4197 @itemize
4198 @item makes it quick and easy to define mock objects
4199 @item lets you precisely specify the interactions between
4200   your objects, reducing the brittleness of your tests
4201 @item plugs into your favourite test framework
4202 @item is easy to extend.
4203 @end itemize\n")
4204     (license license:bsd-3)))
4206 (define-public java-jmock
4207   (package
4208     (inherit java-jmock-1)
4209     (name "java-jmock")
4210     (version "2.8.2")
4211     (source (origin
4212               (method url-fetch)
4213               (uri (string-append "https://github.com/jmock-developers/"
4214                                   "jmock-library/archive/" version ".tar.gz"))
4215               (file-name (string-append name "-" version ".tar.gz"))
4216               (sha256
4217                (base32
4218                 "18650a9g8xffcsdb6w91pbswa7f40fp2sh6s3nclkclz5dbzq8f0"))))
4219     (inputs
4220      `(("java-hamcrest-all" ,java-hamcrest-all)
4221        ("java-asm" ,java-asm)
4222        ("java-bsh" ,java-bsh)
4223        ("java-junit" ,java-junit)))
4224     (native-inputs
4225      `(("cglib" ,java-cglib)))
4226     (arguments
4227      `(#:jar-name "java-jmock.jar"
4228        #:source-dir "jmock/src/main/java"
4229        #:test-dir "jmock/src/test"))))
4231 (define-public java-jmock-junit4
4232   (package
4233     (inherit java-jmock)
4234     (name "java-jmock-junit4")
4235     (arguments
4236      `(#:jar-name "java-jmock-junit4.jar"
4237        #:source-dir "jmock-junit4/src/main/java"
4238        #:test-dir "jmock-junit4/src/test"))
4239     (inputs
4240      `(("java-hamcrest-all" ,java-hamcrest-all)
4241        ("java-asm" ,java-asm)
4242        ("java-bsh" ,java-bsh)
4243        ("java-jmock" ,java-jmock)
4244        ("java-jumit" ,java-junit)))))
4246 (define-public java-jmock-legacy
4247   (package
4248     (inherit java-jmock)
4249     (name "java-jmock-legacy")
4250     (arguments
4251      `(#:jar-name "java-jmock-legacy.jar"
4252        #:source-dir "jmock-legacy/src/main/java"
4253        #:test-dir "jmock-legacy/src/test"
4254        #:phases
4255        (modify-phases %standard-phases
4256          (add-before 'check 'copy-tests
4257            (lambda _
4258              ;; This file is a dependancy of some tests
4259              (let ((file "org/jmock/test/acceptance/PackageProtectedType.java"))
4260                (copy-file (string-append "jmock/src/test/java/" file)
4261                           (string-append "jmock-legacy/src/test/java/" file))
4262                #t))))))
4263     (inputs
4264      `(("java-hamcrest-all" ,java-hamcrest-all)
4265        ("java-objenesis" ,java-objenesis)
4266        ("java-cglib" ,java-cglib)
4267        ("java-jmock" ,java-jmock)
4268        ("java-asm" ,java-asm)
4269        ("java-bsh" ,java-bsh)
4270        ("java-junit" ,java-junit)))
4271     (native-inputs
4272      `(("java-jmock-junit4" ,java-jmock-junit4)))))
4274 (define-public java-hamcrest-all
4275   (package (inherit java-hamcrest-core)
4276     (name "java-hamcrest-all")
4277     (arguments
4278      `(#:jdk ,icedtea-8
4279        ,@(substitute-keyword-arguments (package-arguments java-hamcrest-core)
4280            ((#:build-target _) "bigjar")
4281            ((#:phases phases)
4282             `(modify-phases ,phases
4283                ;; Some build targets override the classpath, so we need to patch
4284                ;; the build.xml to ensure that required dependencies are on the
4285                ;; classpath.
4286                (add-after 'unpack 'patch-classpath-for-integration
4287                  (lambda* (#:key inputs #:allow-other-keys)
4288                    (substitute* "build.xml"
4289                      ((" build/hamcrest-library-\\$\\{version\\}.jar" line)
4290                       (string-join
4291                        (cons line
4292                              (append
4293                               (find-files (assoc-ref inputs "java-junit") "\\.jar$")
4294                               (find-files (assoc-ref inputs "java-jmock") "\\.jar$")
4295                               (find-files (assoc-ref inputs "java-easymock") "\\.jar$")))
4296                        ";"))
4297                      (("build/hamcrest-core-\\$\\{version\\}\\.jar")
4298                       (string-append (assoc-ref inputs "java-hamcrest-core")
4299                                      "/share/java/hamcrest-core.jar")))
4300                    #t)))))))
4301     (inputs
4302      `(("java-junit" ,java-junit)
4303        ("java-jmock" ,java-jmock-1)
4304        ;; This is necessary because of what seems to be a race condition.
4305        ;; This package would sometimes fail to build because hamcrest-core.jar
4306        ;; could not be found, even though it is built as part of this package.
4307        ;; Adding java-hamcrest-core appears to fix this problem.  See
4308        ;; https://debbugs.gnu.org/31390 for more information.
4309        ("java-hamcrest-core" ,java-hamcrest-core)
4310        ("java-easymock" ,java-easymock)
4311        ,@(package-inputs java-hamcrest-core)))))
4313 (define-public java-jopt-simple
4314   (package
4315     (name "java-jopt-simple")
4316     (version "5.0.3")
4317     (source (origin
4318               (method url-fetch)
4319               (uri (string-append "http://repo1.maven.org/maven2/"
4320                                   "net/sf/jopt-simple/jopt-simple/"
4321                                   version "/jopt-simple-"
4322                                   version "-sources.jar"))
4323               (sha256
4324                (base32
4325                 "1v8bzmwmw6qq20gm42xyay6vrd567dra4vqwhgjnqqjz1gs9f8qa"))))
4326     (build-system ant-build-system)
4327     (arguments
4328      `(#:tests? #f ; there are no tests
4329        #:jar-name "jopt-simple.jar"))
4330     (home-page "https://pholser.github.io/jopt-simple/")
4331     (synopsis "Java library for parsing command line options")
4332     (description "JOpt Simple is a Java library for parsing command line
4333 options, such as those you might pass to an invocation of @code{javac}.  In
4334 the interest of striving for simplicity, as closely as possible JOpt Simple
4335 attempts to honor the command line option syntaxes of POSIX @code{getopt} and
4336 GNU @code{getopt_long}.  It also aims to make option parser configuration and
4337 retrieval of options and their arguments simple and expressive, without being
4338 overly clever.")
4339     (license license:expat)))
4341 (define-public java-commons-math3
4342   (package
4343     (name "java-commons-math3")
4344     (version "3.6.1")
4345     (source (origin
4346               (method url-fetch)
4347               (uri (string-append "mirror://apache/commons/math/source/"
4348                                   "commons-math3-" version "-src.tar.gz"))
4349               (sha256
4350                (base32
4351                 "19l6yp44qc5g7wg816nbn5z3zq3xxzwimvbm4a8pczgvpi4i85s6"))))
4352     (build-system ant-build-system)
4353     (arguments
4354      `(#:build-target "jar"
4355        #:test-target "test"
4356        #:make-flags
4357        (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
4358              (junit    (assoc-ref %build-inputs "java-junit")))
4359          (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
4360                (string-append "-Dhamcrest.jar=" hamcrest
4361                               "/share/java/hamcrest-core.jar")))
4362        #:phases
4363        (modify-phases %standard-phases
4364          ;; We want to build the jar in the build phase and run the tests
4365          ;; later in a separate phase.
4366          (add-after 'unpack 'untangle-targets
4367            (lambda _
4368              (substitute* "build.xml"
4369                (("name=\"jar\" depends=\"test\"")
4370                 "name=\"jar\" depends=\"compile\""))
4371              #t))
4372          ;; There is no install target.
4373          (replace 'install
4374            (install-jars "target")))))
4375     (native-inputs
4376      `(("java-junit" ,java-junit)
4377        ("java-hamcrest-core" ,java-hamcrest-core)))
4378     (home-page "http://commons.apache.org/math/")
4379     (synopsis "Apache Commons mathematics library")
4380     (description "Commons Math is a library of lightweight, self-contained
4381 mathematics and statistics components addressing the most common problems not
4382 available in the Java programming language or Commons Lang.")
4383     (license license:asl2.0)))
4385 (define-public java-jmh
4386   (package
4387     (name "java-jmh")
4388     (version "1.17.5")
4389     (source (origin
4390               (method hg-fetch)
4391               (uri (hg-reference
4392                     (url "http://hg.openjdk.java.net/code-tools/jmh/")
4393                     (changeset version)))
4394               (file-name (string-append name "-" version "-checkout"))
4395               (sha256
4396                (base32
4397                 "1fxyxhg9famwcg1prc4cgwb5wzyxqavn3cjm5vz8605xz7x5k084"))))
4398     (build-system ant-build-system)
4399     (arguments
4400      `(#:jar-name "jmh-core.jar"
4401        #:source-dir "jmh-core/src/main"
4402        #:test-dir "jmh-core/src/test"
4403        #:phases
4404        (modify-phases %standard-phases
4405          ;; This seems to be a bug in the JDK.  It may not be necessary in
4406          ;; future versions of the JDK.
4407          (add-after 'unpack 'fix-bug
4408            (lambda _
4409              (with-directory-excursion
4410                  "jmh-core/src/main/java/org/openjdk/jmh/runner/options"
4411                (substitute* '("IntegerValueConverter.java"
4412                               "ThreadsValueConverter.java")
4413                  (("public Class<Integer> valueType")
4414                   "public Class<? extends Integer> valueType")))
4415              #t)))))
4416     (inputs
4417      `(("java-jopt-simple" ,java-jopt-simple)
4418        ("java-commons-math3" ,java-commons-math3)))
4419     (native-inputs
4420      `(("java-junit" ,java-junit)
4421        ("java-hamcrest-core" ,java-hamcrest-core)))
4422     (home-page "http://openjdk.java.net/projects/code-tools/jmh/")
4423     (synopsis "Benchmark harness for the JVM")
4424     (description "JMH is a Java harness for building, running, and analysing
4425 nano/micro/milli/macro benchmarks written in Java and other languages
4426 targeting the JVM.")
4427     ;; GPLv2 only
4428     (license license:gpl2)))
4430 (define-public java-commons-collections4
4431   (package
4432     (name "java-commons-collections4")
4433     (version "4.1")
4434     (source (origin
4435               (method url-fetch)
4436               (uri (string-append "mirror://apache/commons/collections/source/"
4437                                   "commons-collections4-" version "-src.tar.gz"))
4438               (sha256
4439                (base32
4440                 "1krfhvggympq4avk7gh6qafzf6b9ip6r1m4lmacikyx04039m0wl"))))
4441     (build-system ant-build-system)
4442     (arguments
4443      `(#:test-target "test"
4444        #:make-flags
4445        (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
4446              (junit    (assoc-ref %build-inputs "java-junit"))
4447              (easymock (assoc-ref %build-inputs "java-easymock")))
4448          (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
4449                (string-append "-Dhamcrest.jar=" hamcrest
4450                               "/share/java/hamcrest-core.jar")
4451                (string-append "-Deasymock.jar=" easymock
4452                               "/share/java/easymock.jar")))
4453        #:phases
4454        (modify-phases %standard-phases
4455          (replace 'install
4456            (install-jars "target")))))
4457     (native-inputs
4458      `(("java-junit" ,java-junit)
4459        ("java-hamcrest-core" ,java-hamcrest-core)
4460        ("java-easymock" ,java-easymock)))
4461     (home-page "http://commons.apache.org/collections/")
4462     (synopsis "Collections framework")
4463     (description "The Java Collections Framework is the recognised standard
4464 for collection handling in Java.  Commons-Collections seek to build upon the
4465 JDK classes by providing new interfaces, implementations and utilities.  There
4466 are many features, including:
4468 @itemize
4469 @item @code{Bag} interface for collections that have a number of copies of
4470   each object
4471 @item @code{BidiMap} interface for maps that can be looked up from value to
4472   key as well and key to value
4473 @item @code{MapIterator} interface to provide simple and quick iteration over
4474   maps
4475 @item Transforming decorators that alter each object as it is added to the
4476   collection
4477 @item Composite collections that make multiple collections look like one
4478 @item Ordered maps and sets that retain the order elements are added in,
4479   including an LRU based map
4480 @item Reference map that allows keys and/or values to be garbage collected
4481   under close control
4482 @item Many comparator implementations
4483 @item Many iterator implementations
4484 @item Adapter classes from array and enumerations to collections
4485 @item Utilities to test or create typical set-theory properties of collections
4486   such as union, intersection, and closure.
4487 @end itemize\n")
4488     (license license:asl2.0)))
4490 (define-public java-commons-collections
4491   (package
4492     (inherit java-commons-collections4)
4493     (name "java-commons-collections")
4494     (version "3.2.2")
4495     (source (origin
4496               (method url-fetch)
4497               (uri (string-append "mirror://apache/commons/collections/source/"
4498                                   "commons-collections-" version "-src.tar.gz"))
4499               (sha256
4500                (base32
4501                 "055r51a5lfc3z7rkxnxmnn1npvkvda7636hjpm4qk7cnfzz98387"))
4502               (patches
4503                (search-patches "java-commons-collections-fix-java8.patch"))))
4504     (arguments
4505       (substitute-keyword-arguments (package-arguments java-commons-collections4)
4506         ((#:phases phases)
4507           `(modify-phases ,phases
4508             ;; The manifest is required by the build procedure
4509             (add-before 'build 'add-manifest
4510               (lambda _
4511                 (mkdir-p "build/conf")
4512                 (call-with-output-file "build/conf/MANIFEST.MF"
4513                   (lambda (file)
4514                     (format file "Manifest-Version: 1.0\n")))
4515                 #t))
4516             (replace 'install
4517               (install-jars "build"))))))))
4519 (define java-commons-collections-test-classes
4520   (package
4521     (inherit java-commons-collections)
4522     (arguments
4523      `(#:jar-name "commons-collections-test-classes.jar"
4524        #:source-dir "src/test"
4525        #:tests? #f))
4526     (inputs
4527      `(("collection" ,java-commons-collections)))))
4529 (define-public java-commons-beanutils
4530   (package
4531     (name "java-commons-beanutils")
4532     (version "1.9.3")
4533     (source (origin
4534               (method url-fetch)
4535               (uri (string-append "mirror://apache/commons/beanutils/source/"
4536                                   "commons-beanutils-" version "-src.tar.gz"))
4537               (sha256
4538                (base32
4539                 "03cs0bq3sl1sdc7py9g3qnf8n9h473nrkvd3d251kaqv6a2ab7qk"))))
4540     (build-system ant-build-system)
4541     (arguments
4542      `(#:test-target "test"
4543        #:tests? #f
4544        #:phases
4545        (modify-phases %standard-phases
4546          (replace 'install
4547            (lambda* (#:key outputs #:allow-other-keys)
4548              (rename-file (string-append "dist/commons-beanutils-" ,version
4549                                          "-SNAPSHOT.jar")
4550                           "commons-beanutils.jar")
4551              (install-file "commons-beanutils.jar"
4552                (string-append (assoc-ref outputs "out") "/share/java/"))
4553              #t)))))
4554     (inputs
4555      `(("logging" ,java-commons-logging-minimal)
4556        ("collections" ,java-commons-collections)))
4557     (native-inputs
4558      `(("junit" ,java-junit)
4559        ("collections-test" ,java-commons-collections-test-classes)))
4560     (home-page "http://commons.apache.org/beanutils/")
4561     (synopsis "Dynamically set or get properties in Java")
4562     (description "BeanUtils provides a simplified interface to reflection and
4563 introspection to set or get dynamically determined properties through their
4564 setter and getter method.")
4565     (license license:asl2.0)))
4567 (define-public java-commons-io
4568   (package
4569     (name "java-commons-io")
4570     (version "2.5")
4571     (source
4572      (origin
4573        (method url-fetch)
4574        (uri (string-append "mirror://apache/commons/io/source/"
4575                            "commons-io-" version "-src.tar.gz"))
4576        (sha256
4577         (base32
4578          "0q5y41jrcjvx9hzs47x5kdhnasdy6rm4bzqd2jxl02w717m7a7v3"))))
4579     (build-system ant-build-system)
4580     (outputs '("out" "doc"))
4581     (arguments
4582      `(#:test-target "test"
4583        #:make-flags
4584        (list (string-append "-Djunit.jar="
4585                             (assoc-ref %build-inputs "java-junit")
4586                             "/share/java/junit.jar"))
4587        #:phases
4588        (modify-phases %standard-phases
4589          (add-after 'build 'build-javadoc ant-build-javadoc)
4590          (replace 'install (install-jars "target"))
4591          (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
4592     (native-inputs
4593      `(("java-junit" ,java-junit)
4594        ("java-hamcrest-core" ,java-hamcrest-core)))
4595     (home-page "http://commons.apache.org/io/")
4596     (synopsis "Common useful IO related classes")
4597     (description "Commons-IO contains utility classes, stream implementations,
4598 file filters and endian classes.")
4599     (license license:asl2.0)))
4601 (define-public java-commons-exec-1.1
4602   (package
4603     (name "java-commons-exec")
4604     (version "1.1")
4605     (source
4606      (origin
4607        (method url-fetch)
4608        (uri (string-append "mirror://apache/commons/exec/source/"
4609                            "commons-exec-" version "-src.tar.gz"))
4610        (sha256
4611         (base32
4612          "025dk8xgj10lxwwwqp0hng2rn7fr4vcirxzydqzx9k4dim667alk"))))
4613     (build-system ant-build-system)
4614     (arguments
4615      `(#:test-target "test"
4616        #:make-flags
4617        (list (string-append "-Dmaven.junit.jar="
4618                             (assoc-ref %build-inputs "java-junit")
4619                             "/share/java/junit.jar"))
4620        #:phases
4621        (modify-phases %standard-phases
4622          (add-before 'build 'delete-network-tests
4623            (lambda _
4624              (delete-file "src/test/java/org/apache/commons/exec/DefaultExecutorTest.java")
4625              (substitute* "src/test/java/org/apache/commons/exec/TestRunner.java"
4626               (("suite\\.addTestSuite\\(DefaultExecutorTest\\.class\\);") ""))
4627              #t))
4628          ;; The "build" phase automatically tests.
4629          (delete 'check)
4630          (replace 'install (install-jars "target")))))
4631     (native-inputs
4632      `(("java-junit" ,java-junit)))
4633     (home-page "http://commons.apache.org/proper/commons-exec/")
4634     (synopsis "Common program execution related classes")
4635     (description "Commons-Exec simplifies executing external processes.")
4636     (license license:asl2.0)))
4638 (define-public java-commons-exec
4639   (package
4640     (inherit java-commons-exec-1.1)
4641     (version "1.3")
4642     (source
4643      (origin
4644        (method url-fetch)
4645        (uri (string-append "mirror://apache/commons/exec/source/"
4646                            "commons-exec-" version "-src.tar.gz"))
4647        (sha256
4648         (base32
4649          "17yb4h6f8l49c5iyyvda4z2nmw0bxrx857nrwmsr7mmpb7x441yv"))))
4650     (arguments
4651      `(#:test-target "test"
4652        #:make-flags
4653        (list (string-append "-Dmaven.junit.jar="
4654                             (assoc-ref %build-inputs "java-junit")
4655                             "/share/java/junit.jar")
4656              "-Dmaven.compiler.source=1.7"
4657              "-Dmaven.compiler.target=1.7")
4658        #:phases
4659        (modify-phases %standard-phases
4660          (add-before 'build 'delete-network-tests
4661            (lambda* (#:key inputs #:allow-other-keys)
4662              ;; This test hangs indefinitely.
4663              (delete-file "src/test/java/org/apache/commons/exec/issues/Exec60Test.java")
4664              (substitute* "src/test/java/org/apache/commons/exec/issues/Exec41Test.java"
4665               (("ping -c 10 127.0.0.1") "sleep 10"))
4666              (substitute* "src/test/java/org/apache/commons/exec/issues/Exec49Test.java"
4667               (("/bin/ls") "ls"))
4668              (call-with-output-file "src/test/scripts/ping.sh"
4669                (lambda (port)
4670                  (format port "#!~a/bin/sh\nsleep $1\n"
4671                               (assoc-ref inputs "bash"))))
4672              #t))
4673          ;; The "build" phase automatically tests.
4674          (delete 'check)
4675          (replace 'install (install-jars "target")))))
4676     (native-inputs
4677      `(("java-junit" ,java-junit)
4678        ("java-hamcrest-core" ,java-hamcrest-core)))))
4680 (define-public java-commons-lang
4681   (package
4682     (name "java-commons-lang")
4683     (version "2.6")
4684     (source
4685      (origin
4686        (method url-fetch)
4687        (uri (string-append "mirror://apache/commons/lang/source/"
4688                            "commons-lang-" version "-src.tar.gz"))
4689        (sha256
4690         (base32 "1mxwagqadzx1b2al7i0z1v0r235aj2njdyijf02szq0vhmqrfiq5"))))
4691     (build-system ant-build-system)
4692     (outputs '("out" "doc"))
4693     (arguments
4694      `(#:test-target "test"
4695        #:test-exclude (list "**/Abstract*.java" "**/Random*.java")
4696        #:phases
4697        (modify-phases %standard-phases
4698          (add-after 'build 'build-javadoc ant-build-javadoc)
4699          (add-before 'check 'disable-failing-test
4700            (lambda _
4701              ;; Disable a failing test
4702              (substitute* "src/test/java/org/apache/commons/lang/\
4703 time/FastDateFormatTest.java"
4704                (("public void testFormat\\(\\)")
4705                 "public void disabled_testFormat()"))
4706              #t))
4707          (replace 'install (install-jars "target"))
4708          (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
4709     (native-inputs
4710      `(("java-junit" ,java-junit)))
4711     (home-page "http://commons.apache.org/lang/")
4712     (synopsis "Extension of the java.lang package")
4713     (description "The Commons Lang components contains a set of Java classes
4714 that provide helper methods for standard Java classes, especially those found
4715 in the @code{java.lang} package in the Sun JDK.  The following classes are
4716 included:
4718 @itemize
4719 @item StringUtils - Helper for @code{java.lang.String}.
4720 @item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets
4721   of characters such as @code{[a-z]} and @code{[abcdez]}.
4722 @item RandomStringUtils - Helper for creating randomised strings.
4723 @item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
4724 @item NumberRange - A range of numbers with an upper and lower bound.
4725 @item ObjectUtils - Helper for @code{java.lang.Object}.
4726 @item SerializationUtils - Helper for serializing objects.
4727 @item SystemUtils - Utility class defining the Java system properties.
4728 @item NestedException package - A sub-package for the creation of nested
4729   exceptions.
4730 @item Enum package - A sub-package for the creation of enumerated types.
4731 @item Builder package - A sub-package for the creation of @code{equals},
4732   @code{hashCode}, @code{compareTo} and @code{toString} methods.
4733 @end itemize\n")
4734     (license license:asl2.0)))
4736 (define-public java-commons-lang3
4737   (package
4738     (name "java-commons-lang3")
4739     (version "3.4")
4740     (source
4741      (origin
4742        (method url-fetch)
4743        (uri (string-append "mirror://apache/commons/lang/source/"
4744                            "commons-lang3-" version "-src.tar.gz"))
4745        (sha256
4746         (base32 "0xpshb9spjhplq5a7mr0y1bgfw8190ik4xj8f569xidfcki1d6kg"))))
4747     (build-system ant-build-system)
4748     (outputs '("out" "doc"))
4749     (arguments
4750      `(#:test-target "test"
4751        #:make-flags
4752        (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-all"))
4753              (junit    (assoc-ref %build-inputs "java-junit"))
4754              (easymock (assoc-ref %build-inputs "java-easymock"))
4755              (io       (assoc-ref %build-inputs "java-commons-io")))
4756          (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
4757                (string-append "-Dhamcrest.jar=" hamcrest
4758                               "/share/java/hamcrest-all.jar")
4759                (string-append "-Dcommons-io.jar=" io
4760                               "/share/java/commons-io-"
4761                               ,(package-version java-commons-io)
4762                               "-SNAPSHOT.jar")
4763                (string-append "-Deasymock.jar=" easymock
4764                               "/share/java/easymock.jar")))
4765        #:phases
4766        (modify-phases %standard-phases
4767          (add-after 'build 'build-javadoc ant-build-javadoc)
4768          (replace 'install (install-jars "target"))
4769          (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
4770     (native-inputs
4771      `(("java-junit" ,java-junit)
4772        ("java-commons-io" ,java-commons-io)
4773        ("java-hamcrest-all" ,java-hamcrest-all)
4774        ("java-easymock" ,java-easymock)))
4775     (home-page "http://commons.apache.org/lang/")
4776     (synopsis "Extension of the java.lang package")
4777     (description "The Commons Lang components contains a set of Java classes
4778 that provide helper methods for standard Java classes, especially those found
4779 in the @code{java.lang} package.  The following classes are included:
4781 @itemize
4782 @item StringUtils - Helper for @code{java.lang.String}.
4783 @item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets of
4784   characters such as @code{[a-z]} and @code{[abcdez]}.
4785 @item RandomStringUtils - Helper for creating randomised strings.
4786 @item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
4787 @item NumberRange - A range of numbers with an upper and lower bound.
4788 @item ObjectUtils - Helper for @code{java.lang.Object}.
4789 @item SerializationUtils - Helper for serializing objects.
4790 @item SystemUtils - Utility class defining the Java system properties.
4791 @item NestedException package - A sub-package for the creation of nested
4792    exceptions.
4793 @item Enum package - A sub-package for the creation of enumerated types.
4794 @item Builder package - A sub-package for the creation of @code{equals},
4795   @code{hashCode}, @code{compareTo} and @code{toString} methods.
4796 @end itemize\n")
4797     (license license:asl2.0)))
4799 (define-public java-commons-bsf
4800   (package
4801     (name "java-commons-bsf")
4802     (version "2.4.0")
4803     (source (origin
4804               (method url-fetch)
4805               (uri (string-append "mirror://apache/commons/bsf/source/bsf-src-"
4806                                   version ".tar.gz"))
4807               (sha256
4808                (base32
4809                 "1sbamr8jl32p1jgf59nw0b2w9qivyg145954hm6ly54cfgsqrdas"))
4810               (modules '((guix build utils)))
4811               (snippet
4812                '(begin
4813                   (for-each delete-file
4814                             (find-files "." "\\.jar$"))
4815                   #t))))
4816     (build-system ant-build-system)
4817     (arguments
4818      `(#:build-target "jar"
4819        #:tests? #f; No test file
4820        #:modules ((guix build ant-build-system)
4821                   (guix build utils)
4822                   (guix build java-utils)
4823                   (sxml simple))
4824        #:phases
4825        (modify-phases %standard-phases
4826          (add-before 'build 'create-properties
4827            (lambda _
4828              ;; This file is missing from the distribution
4829              (call-with-output-file "build-properties.xml"
4830                (lambda (port)
4831                  (sxml->xml
4832                   `(project (@ (basedir ".") (name "build-properties") (default ""))
4833                      (property (@ (name "project.name") (value "bsf")))
4834                      (property (@ (name "source.level") (value "1.5")))
4835                      (property (@ (name "build.lib") (value "build/jar")))
4836                      (property (@ (name "src.dir") (value "src")))
4837                      (property (@ (name "tests.dir") (value "src/org/apache/bsf/test")))
4838                      (property (@ (name "build.tests") (value "build/test-classes")))
4839                      (property (@ (name "build.dest") (value "build/classes"))))
4840                   port)))
4841              #t))
4842          (replace 'install (install-jars "build")))))
4843     (native-inputs
4844      `(("java-junit" ,java-junit)))
4845     (inputs
4846      `(("java-commons-logging-minimal" ,java-commons-logging-minimal)))
4847     (home-page "https://commons.apache.org/proper/commons-bsf")
4848     (synopsis "Bean Scripting Framework")
4849     (description "The Bean Scripting Framework (BSF) is a set of Java classes
4850 which provides scripting language support within Java applications, and access
4851 to Java objects and methods from scripting languages.  BSF allows one to write
4852 JSPs in languages other than Java while providing access to the Java class
4853 library.  In addition, BSF permits any Java application to be implemented in
4854 part (or dynamically extended) by a language that is embedded within it.  This
4855 is achieved by providing an API that permits calling scripting language engines
4856 from within Java, as well as an object registry that exposes Java objects to
4857 these scripting language engines.")
4858     (license license:asl2.0)))
4860 (define-public java-commons-jxpath
4861   (package
4862     (name "java-commons-jxpath")
4863     (version "1.3")
4864     (source (origin
4865               (method url-fetch)
4866               (uri (string-append "mirror://apache/commons/jxpath/source/"
4867                                   "commons-jxpath-" version "-src.tar.gz"))
4868               (sha256
4869                (base32
4870                 "1rpgg31ayn9fwr4bfi2i1ij0npcg79ad2fv0w9hacvawsyc42cfs"))))
4871     (build-system ant-build-system)
4872     (arguments
4873      `(#:jar-name "commons-jxpath.jar"
4874        ;; tests require more dependencies, including mockrunner which depends on old software
4875        #:tests? #f
4876        #:source-dir "src/java"))
4877     (inputs
4878      `(("servlet" ,java-classpathx-servletapi)
4879        ("java-jdom" ,java-jdom)
4880        ("java-commons-beanutils" ,java-commons-beanutils)))
4881     (native-inputs
4882      `(("java-junit" ,java-junit)))
4883     (home-page "http://commons.apache.org/jxpath/")
4884     (synopsis "Simple interpreter of an expression language called XPath.")
4885     (description "The org.apache.commons.jxpath package defines a simple
4886 interpreter of an expression language called XPath.  JXPath applies XPath
4887 expressions to graphs of objects of all kinds: JavaBeans, Maps, Servlet
4888 contexts, DOM etc, including mixtures thereof.")
4889     (license license:asl2.0)))
4891 (define-public java-jsr250
4892   (package
4893     (name "java-jsr250")
4894     (version "1.3")
4895     (source (origin
4896               (method url-fetch)
4897               (uri (string-append "https://repo1.maven.org/maven2/"
4898                                   "javax/annotation/javax.annotation-api/"
4899                                   version "/javax.annotation-api-"
4900                                   version "-sources.jar"))
4901               (sha256
4902                (base32
4903                 "08clh8n4n9wfglf75qsqfjs6yf79f7x6hqx38cn856pksszv50kz"))))
4904     (build-system ant-build-system)
4905     (arguments
4906      `(#:tests? #f ; no tests included
4907        #:jdk ,icedtea-8
4908        #:jar-name "jsr250.jar"))
4909     (home-page "https://jcp.org/en/jsr/detail?id=250")
4910     (synopsis "Security-related annotations")
4911     (description "This package provides annotations for security.  It provides
4912 packages in the @code{javax.annotation} and @code{javax.annotation.security}
4913 namespaces.")
4914     ;; either cddl or gpl2 only, with classpath exception
4915     (license (list license:cddl1.0
4916                    license:gpl2))))
4918 (define-public java-jsr305
4919   (package
4920     (name "java-jsr305")
4921     (version "3.0.1")
4922     (source (origin
4923               (method url-fetch)
4924               (uri (string-append "https://repo1.maven.org/maven2/"
4925                                   "com/google/code/findbugs/"
4926                                   "jsr305/" version "/jsr305-"
4927                                   version "-sources.jar"))
4928               (sha256
4929                (base32
4930                 "1rh6jin9v7jqpq3kf1swl868l8i94r636n03pzpsmgr8v0lh9j2n"))))
4931     (build-system ant-build-system)
4932     (arguments
4933      `(#:tests? #f ; no tests included
4934        #:jar-name "jsr305.jar"))
4935     (home-page "http://findbugs.sourceforge.net/")
4936     (synopsis "Annotations for the static analyzer called findbugs")
4937     (description "This package provides annotations for the findbugs package.
4938 It provides packages in the @code{javax.annotations} namespace.")
4939     (license license:asl2.0)))
4941 (define-public java-guava
4942   (package
4943     (name "java-guava")
4944     ;; This is the last release of Guava that can be built with Java 7.
4945     (version "20.0")
4946     (source (origin
4947               (method url-fetch)
4948               (uri (string-append "https://github.com/google/guava/"
4949                                   "releases/download/v" version
4950                                   "/guava-" version "-sources.jar"))
4951               (sha256
4952                (base32
4953                 "1gawrs5gi6j5hcfxdgpnfli75vb9pfi4sn09pnc8xacr669yajwr"))))
4954     (build-system ant-build-system)
4955     (arguments
4956      `(#:tests? #f                      ; no tests included
4957        #:jar-name "guava.jar"
4958        #:phases
4959        (modify-phases %standard-phases
4960          (add-after 'unpack 'trim-sources
4961            (lambda _
4962              (with-directory-excursion "src/com/google/common"
4963                ;; Remove annotations to avoid extra dependencies:
4964                ;; * "j2objc" annotations are used when converting Java to
4965                ;;   Objective C;
4966                ;; * "errorprone" annotations catch common Java mistakes at
4967                ;;   compile time;
4968                ;; * "IgnoreJRERequirement" is used for Android.
4969                (substitute* (find-files "." "\\.java$")
4970                  (("import com.google.j2objc.*") "")
4971                  (("import com.google.errorprone.annotation.*") "")
4972                  (("import org.codehaus.mojo.animal_sniffer.*") "")
4973                  (("@CanIgnoreReturnValue") "")
4974                  (("@LazyInit") "")
4975                  (("@WeakOuter") "")
4976                  (("@RetainedWith") "")
4977                  (("@Weak") "")
4978                  (("@ForOverride") "")
4979                  (("@J2ObjCIncompatible") "")
4980                  (("@IgnoreJRERequirement") "")))
4981              #t)))))
4982     (inputs
4983      `(("java-jsr305" ,java-jsr305)))
4984     (home-page "https://github.com/google/guava")
4985     (synopsis "Google core libraries for Java")
4986     (description "Guava is a set of core libraries that includes new
4987 collection types (such as multimap and multiset), immutable collections, a
4988 graph library, functional types, an in-memory cache, and APIs/utilities for
4989 concurrency, I/O, hashing, primitives, reflection, string processing, and much
4990 more!")
4991     (license license:asl2.0)))
4993 ;; The java-commons-logging package provides adapters to many different
4994 ;; logging frameworks.  To avoid an excessive dependency graph we try to build
4995 ;; it with only a minimal set of adapters.
4996 (define-public java-commons-logging-minimal
4997   (package
4998     (name "java-commons-logging-minimal")
4999     (version "1.2")
5000     (source (origin
5001               (method url-fetch)
5002               (uri (string-append "mirror://apache/commons/logging/source/"
5003                                   "commons-logging-" version "-src.tar.gz"))
5004               (sha256
5005                (base32
5006                 "10bwcy5w8d7y39n0krlwhnp8ds3kj5zhmzj0zxnkw0qdlsjmsrj9"))))
5007     (build-system ant-build-system)
5008     (arguments
5009      `(#:tests? #f ; avoid dependency on logging frameworks
5010        #:jar-name "commons-logging-minimal.jar"
5011        #:phases
5012        (modify-phases %standard-phases
5013          (add-after 'unpack 'delete-adapters-and-tests
5014            (lambda _
5015              ;; Delete all adapters except for NoOpLog, SimpleLog, and
5016              ;; LogFactoryImpl.  NoOpLog is required to build; LogFactoryImpl
5017              ;; is used by applications; SimpleLog is the only actually usable
5018              ;; implementation that does not depend on another logging
5019              ;; framework.
5020              (for-each
5021               (lambda (file)
5022                 (delete-file (string-append
5023                               "src/main/java/org/apache/commons/logging/impl/" file)))
5024               (list "Jdk13LumberjackLogger.java"
5025                     "WeakHashtable.java"
5026                     "Log4JLogger.java"
5027                     "ServletContextCleaner.java"
5028                     "Jdk14Logger.java"
5029                     "AvalonLogger.java"
5030                     "LogKitLogger.java"))
5031              (delete-file-recursively "src/test")
5032              #t)))))
5033     (home-page "http://commons.apache.org/logging/")
5034     (synopsis "Common API for logging implementations")
5035     (description "The Logging package is a thin bridge between different
5036 logging implementations.  A library that uses the commons-logging API can be
5037 used with any logging implementation at runtime.")
5038     (license license:asl2.0)))
5040 ;; This is the last release of the 1.x series.
5041 (define-public java-mockito-1
5042   (package
5043     (name "java-mockito")
5044     (version "1.10.19")
5045     (source (origin
5046               (method url-fetch)
5047               (uri (string-append "http://repo1.maven.org/maven2/"
5048                                   "org/mockito/mockito-core/" version
5049                                   "/mockito-core-" version "-sources.jar"))
5050               (sha256
5051                (base32
5052                 "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc"))))
5053     (build-system ant-build-system)
5054     (arguments
5055      `(#:jar-name "mockito.jar"
5056        #:tests? #f ; no tests included
5057        ;; FIXME: patch-and-repack does not support jars, so we have to apply
5058        ;; patches in build phases.
5059        #:phases
5060        (modify-phases %standard-phases
5061          ;; Mockito was developed against a different version of hamcrest,
5062          ;; which does not require matcher implementations to provide an
5063          ;; implementation of the "describeMismatch" method.  We add this
5064          ;; simple definition to pass the build with our version of hamcrest.
5065          (add-after 'unpack 'fix-hamcrest-build-error
5066            (lambda _
5067              (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java"
5068                (("public Matcher getActualMatcher\\(\\) .*" line)
5069                 (string-append "
5070     public void describeMismatch(Object item, Description description) {
5071         actualMatcher.describeMismatch(item, description);
5072     }"
5073                                line)))
5074              #t))
5075          ;; Mockito bundles cglib.  We have a cglib package, so let's use
5076          ;; that instead.
5077          (add-after 'unpack 'use-system-libraries
5078            (lambda _
5079              (with-directory-excursion "src/org/mockito/internal/creation/cglib"
5080                (substitute* '("CGLIBHacker.java"
5081                               "CglibMockMaker.java"
5082                               "ClassImposterizer.java"
5083                               "DelegatingMockitoMethodProxy.java"
5084                               "MethodInterceptorFilter.java"
5085                               "MockitoNamingPolicy.java"
5086                               "SerializableMockitoMethodProxy.java"
5087                               "SerializableNoOp.java")
5088                  (("import org.mockito.cglib") "import net.sf.cglib")))
5089              #t)))))
5090     (inputs
5091      `(("java-junit" ,java-junit)
5092        ("java-objenesis" ,java-objenesis)
5093        ("java-cglib" ,java-cglib)
5094        ("java-hamcrest-core" ,java-hamcrest-core)))
5095     (home-page "http://mockito.org")
5096     (synopsis "Mockito is a mock library for Java")
5097     (description "Mockito is a mocking library for Java which lets you write
5098 tests with a clean and simple API.  It generates mocks using reflection, and
5099 it records all mock invocations, including methods arguments.")
5100     (license license:asl2.0)))
5102 (define-public java-httpcomponents-httpcore
5103   (package
5104     (name "java-httpcomponents-httpcore")
5105     (version "4.4.6")
5106     (source (origin
5107               (method url-fetch)
5108               (uri (string-append "mirror://apache//httpcomponents/httpcore/"
5109                                   "source/httpcomponents-core-"
5110                                   version "-src.tar.gz"))
5111               (sha256
5112                (base32
5113                 "02bwcf38y4vgwq7kj2s6q7qrmma641r5lacivm16kgxvb2j6h1vy"))))
5114     (build-system ant-build-system)
5115     (arguments
5116      `(#:jar-name "httpcomponents-httpcore.jar"
5117        #:phases
5118        (modify-phases %standard-phases
5119          (add-after 'unpack 'chdir
5120            (lambda _ (chdir "httpcore") #t)))))
5121     (inputs
5122      `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
5123        ("java-commons-lang3" ,java-commons-lang3)))
5124     (native-inputs
5125      `(("java-junit" ,java-junit)
5126        ("java-mockito" ,java-mockito-1)))
5127     (home-page "https://hc.apache.org/httpcomponents-core-4.4.x/index.html")
5128     (synopsis "Low level HTTP transport components")
5129     (description "HttpCore is a set of low level HTTP transport components
5130 that can be used to build custom client and server side HTTP services with a
5131 minimal footprint.  HttpCore supports two I/O models: blocking I/O model based
5132 on the classic Java I/O and non-blocking, event driven I/O model based on Java
5133 NIO.
5135 This package provides the blocking I/O model library.")
5136     (license license:asl2.0)))
5138 (define-public java-httpcomponents-httpcore-nio
5139   (package (inherit java-httpcomponents-httpcore)
5140     (name "java-httpcomponents-httpcore-nio")
5141     (arguments
5142      `(#:jar-name "httpcomponents-httpcore-nio.jar"
5143        #:phases
5144        (modify-phases %standard-phases
5145          (add-after 'unpack 'chdir
5146            (lambda _ (chdir "httpcore-nio") #t)))))
5147     (inputs
5148      `(("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
5149        ("java-hamcrest-core" ,java-hamcrest-core)
5150        ,@(package-inputs java-httpcomponents-httpcore)))
5151     (description "HttpCore is a set of low level HTTP transport components
5152 that can be used to build custom client and server side HTTP services with a
5153 minimal footprint.  HttpCore supports two I/O models: blocking I/O model based
5154 on the classic Java I/O and non-blocking, event driven I/O model based on Java
5155 NIO.
5157 This package provides the non-blocking I/O model library based on Java
5158 NIO.")))
5160 (define-public java-httpcomponents-httpcore-ab
5161   (package (inherit java-httpcomponents-httpcore)
5162     (name "java-httpcomponents-httpcore-ab")
5163     (arguments
5164      `(#:jar-name "httpcomponents-httpcore-ab.jar"
5165        #:phases
5166        (modify-phases %standard-phases
5167          (add-after 'unpack 'chdir
5168            (lambda _ (chdir "httpcore-ab") #t)))))
5169     (inputs
5170      `(("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
5171        ("java-commons-cli" ,java-commons-cli)
5172        ("java-hamcrest-core" ,java-hamcrest-core)
5173        ,@(package-inputs java-httpcomponents-httpcore)))
5174     (synopsis "Apache HttpCore benchmarking tool")
5175     (description "This package provides the HttpCore benchmarking tool.  It is
5176 an Apache AB clone based on HttpCore.")))
5178 (define-public java-httpcomponents-httpclient
5179   (package
5180     (name "java-httpcomponents-httpclient")
5181     (version "4.5.3")
5182     (source (origin
5183               (method url-fetch)
5184               (uri (string-append "mirror://apache/httpcomponents/httpclient/"
5185                                   "source/httpcomponents-client-"
5186                                   version "-src.tar.gz"))
5187               (sha256
5188                (base32
5189                 "1428399s7qy3cim5wc6f3ks4gl9nf9vkjpfmnlap3jflif7g2pj1"))))
5190     (build-system ant-build-system)
5191     (arguments
5192      `(#:jar-name "httpcomponents-httpclient.jar"
5193        #:phases
5194        (modify-phases %standard-phases
5195          (add-after 'unpack 'chdir
5196            (lambda _ (chdir "httpclient") #t)))))
5197     (inputs
5198      `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
5199        ("java-commons-codec" ,java-commons-codec)
5200        ("java-hamcrest-core" ,java-hamcrest-core)
5201        ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
5202        ("java-mockito" ,java-mockito-1)
5203        ("java-junit" ,java-junit)))
5204     (home-page "https://hc.apache.org/httpcomponents-client-ga/")
5205     (synopsis "HTTP client library for Java")
5206     (description "Although the @code{java.net} package provides basic
5207 functionality for accessing resources via HTTP, it doesn't provide the full
5208 flexibility or functionality needed by many applications.  @code{HttpClient}
5209 seeks to fill this void by providing an efficient, up-to-date, and
5210 feature-rich package implementing the client side of the most recent HTTP
5211 standards and recommendations.")
5212     (license license:asl2.0)))
5214 (define-public java-httpcomponents-httpmime
5215   (package (inherit java-httpcomponents-httpclient)
5216     (name "java-httpcomponents-httpmime")
5217     (arguments
5218      `(#:jar-name "httpcomponents-httpmime.jar"
5219        #:phases
5220        (modify-phases %standard-phases
5221          (add-after 'unpack 'chdir
5222            (lambda _ (chdir "httpmime") #t)))))
5223     (inputs
5224      `(("java-httpcomponents-httpclient" ,java-httpcomponents-httpclient)
5225        ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
5226        ("java-junit" ,java-junit)
5227        ("java-hamcrest-core" ,java-hamcrest-core)))))
5229 (define-public java-commons-net
5230   (package
5231     (name "java-commons-net")
5232     (version "3.6")
5233     (source (origin
5234               (method url-fetch)
5235               (uri (string-append "mirror://apache/commons/net/source/"
5236                                   "commons-net-" version "-src.tar.gz"))
5237               (sha256
5238                (base32
5239                 "0n0cmnddk9qdqhjvka8pc6hd9mn2qi3166f1s6xk32h7rfy1adxr"))))
5240     (build-system ant-build-system)
5241     (arguments
5242      `(;; FIXME: MainTest.java tries to read "examples.properties" (which
5243        ;; should be "resources/examples/examples.properties"), but gets "null"
5244        ;; instead.
5245        #:tests? #f
5246        #:jar-name "commons-net.jar"))
5247     (native-inputs
5248      `(("java-junit" ,java-junit)
5249        ("java-hamcrest-core" ,java-hamcrest-core)))
5250     (home-page "http://commons.apache.org/net/")
5251     (synopsis "Client library for many basic Internet protocols")
5252     (description "The Apache Commons Net library implements the client side of
5253 many basic Internet protocols.  The purpose of the library is to provide
5254 fundamental protocol access, not higher-level abstractions.")
5255     (license license:asl2.0)))
5257 (define-public java-jsch
5258   (package
5259     (name "java-jsch")
5260     (version "0.1.55")
5261     (source (origin
5262               (method url-fetch)
5263               (uri (string-append "mirror://sourceforge/jsch/jsch/"
5264                                   version "/jsch-" version ".zip"))
5265               (sha256
5266                (base32
5267                 "1lxyjwvmwa723wcf3bqn816hkvc03vz4xhbsi7bvfhrz2rpgcfq6"))))
5268     (build-system ant-build-system)
5269     (arguments
5270      `(#:build-target "dist"
5271        #:tests? #f                      ; no tests included
5272        #:phases
5273        (modify-phases %standard-phases
5274          (replace 'install (install-jars "dist")))))
5275     (native-inputs
5276      `(("unzip" ,unzip)))
5277     (home-page "http://www.jcraft.com/jsch/")
5278     (synopsis "Pure Java implementation of SSH2")
5279     (description "JSch is a pure Java implementation of SSH2.  JSch allows you
5280 to connect to an SSH server and use port forwarding, X11 forwarding, file
5281 transfer, etc., and you can integrate its functionality into your own Java
5282 programs.")
5283     (license license:bsd-3)))
5285 (define-public java-commons-compress
5286   (package
5287     (name "java-commons-compress")
5288     (version "1.13")
5289     (source (origin
5290               (method url-fetch)
5291               (uri (string-append "mirror://apache/commons/compress/source/"
5292                                   "commons-compress-" version "-src.tar.gz"))
5293               (sha256
5294                (base32
5295                 "1vjqvavrn0babffn1kciz6v52ibwq2vwhzlb95hazis3lgllnxc8"))))
5296     (build-system ant-build-system)
5297     (arguments
5298      `(#:jar-name "commons-compress.jar"
5299        #:phases
5300        (modify-phases %standard-phases
5301          (add-after 'unpack 'delete-bad-tests
5302            (lambda _
5303              (with-directory-excursion "src/test/java/org/apache/commons/compress/"
5304                ;; FIXME: These tests really should not fail.  Maybe they are
5305                ;; indicative of problems with our Java packaging work.
5307                ;; This test fails with a null pointer exception.
5308                (delete-file "archivers/sevenz/SevenZOutputFileTest.java")
5309                ;; This test fails to open test resources.
5310                (delete-file "archivers/zip/ExplodeSupportTest.java")
5312                ;; FIXME: This test adds a dependency on powermock, which is hard to
5313                ;; package at this point.
5314                ;; https://github.com/powermock/powermock
5315                (delete-file "archivers/sevenz/SevenZNativeHeapTest.java"))
5316              #t)))))
5317     (inputs
5318      `(("java-junit" ,java-junit)
5319        ("java-hamcrest-core" ,java-hamcrest-core)
5320        ("java-mockito" ,java-mockito-1)
5321        ("java-xz" ,java-xz)))
5322     (home-page "https://commons.apache.org/proper/commons-compress/")
5323     (synopsis "Java library for working with compressed files")
5324     (description "The Apache Commons Compress library defines an API for
5325 working with compressed files such as ar, cpio, Unix dump, tar, zip, gzip, XZ,
5326 Pack200, bzip2, 7z, arj, lzma, snappy, DEFLATE, lz4 and Z files.")
5327     (license license:asl2.0)))
5329 (define-public java-commons-csv
5330   (package
5331     (name "java-commons-csv")
5332     (version "1.4")
5333     (source (origin
5334               (method url-fetch)
5335               (uri (string-append "mirror://apache/commons/csv/source/"
5336                                   "commons-csv-" version "-src.tar.gz"))
5337               (sha256
5338                (base32
5339                 "1l89m0fm2s3xx3v3iynvangymfg2vlyngaj6fgsi457nmsw7m7ij"))))
5340     (build-system ant-build-system)
5341     (arguments
5342      `(#:jar-name "commons-csv.jar"
5343        #:source-dir "src/main/java"
5344        #:tests? #f)); FIXME: requires java-h2
5345     (inputs
5346      `(("java-hamcrest-core" ,java-hamcrest-core)
5347        ("java-commons-io" ,java-commons-io)
5348        ("java-commons-lang3" ,java-commons-lang3)
5349        ("junit" ,java-junit)))
5350     (home-page "https://commons.apache.org/proper/commons-csv/")
5351     (synopsis "Read and write CSV documents")
5352     (description "Commons CSV reads and writes files in variations of the Comma
5353 Separated Value (CSV) format.  The most common CSV formats are predefined in the
5354 CSVFormat class:
5356 @itemize
5357 @item Microsoft Excel
5358 @item Informix UNLOAD
5359 @item Informix UNLOAD CSV
5360 @item MySQL
5361 @item RFC 4180
5362 @item TDF
5363 @end itemize
5365 Custom formats can be created using a fluent style API.")
5366     (license license:asl2.0)))
5368 (define-public java-osgi-annotation
5369   (package
5370     (name "java-osgi-annotation")
5371     (version "6.0.0")
5372     (source (origin
5373               (method url-fetch)
5374               (uri (string-append "https://repo1.maven.org/maven2/"
5375                                   "org/osgi/org.osgi.annotation/" version "/"
5376                                   "org.osgi.annotation-" version "-sources.jar"))
5377               (sha256
5378                (base32
5379                 "1q718mb7gqg726rh6pc2hcisn8v50nv35abbir0jypmffhiii85w"))))
5380     (build-system ant-build-system)
5381     (arguments
5382      `(#:tests? #f ; no tests
5383        #:jar-name "osgi-annotation.jar"))
5384     (home-page "https://www.osgi.org")
5385     (synopsis "Annotation module of OSGi framework")
5386     (description
5387      "OSGi, for Open Services Gateway initiative framework, is a module system
5388 and service platform for the Java programming language.  This package contains
5389 the OSGi annotation module, providing additional services to help dynamic
5390 components.")
5391     (license license:asl2.0)))
5393 (define-public java-osgi-core
5394   (package
5395     (name "java-osgi-core")
5396     (version "6.0.0")
5397     (source (origin
5398               (method url-fetch)
5399               (uri (string-append "https://repo1.maven.org/maven2/"
5400                                   "org/osgi/org.osgi.core/" version "/"
5401                                   "org.osgi.core-" version "-sources.jar"))
5402               (sha256
5403                (base32
5404                 "19bpf5jx32jq9789gyhin35q5v7flmw0p9mk7wbgqpxqfmxyiabv"))))
5405     (build-system ant-build-system)
5406     (arguments
5407      `(#:tests? #f ; no tests
5408        #:jar-name "osgi-core.jar"))
5409     (inputs
5410      `(("java-osgi-annotation" ,java-osgi-annotation)))
5411     (home-page "https://www.osgi.org")
5412     (synopsis "Core module of OSGi framework")
5413     (description
5414      "OSGi, for Open Services Gateway initiative framework, is a module system
5415 and service platform for the Java programming language.  This package contains
5416 the OSGi Core module.")
5417     (license license:asl2.0)))
5419 (define-public java-osgi-service-event
5420   (package
5421     (name "java-osgi-service-event")
5422     (version "1.3.1")
5423     (source (origin
5424               (method url-fetch)
5425               (uri (string-append "https://repo1.maven.org/maven2/"
5426                                   "org/osgi/org.osgi.service.event/"
5427                                   version "/org.osgi.service.event-"
5428                                   version "-sources.jar"))
5429               (sha256
5430                (base32
5431                 "1nyhlgagwym75bycnjczwbnpymv2iw84zbhvvzk84g9q736i6qxm"))))
5432     (build-system ant-build-system)
5433     (arguments
5434      `(#:tests? #f ; no tests
5435        #:jar-name "osgi-service-event.jar"))
5436     (inputs
5437      `(("java-osgi-annotation" ,java-osgi-annotation)
5438        ("java-osgi-core" ,java-osgi-core)))
5439     (home-page "https://www.osgi.org")
5440     (synopsis "OSGi service event module")
5441     (description
5442      "OSGi, for Open Services Gateway initiative framework, is a module system
5443 and service platform for the Java programming language.  This package contains
5444 the OSGi @code{org.osgi.service.event} module.")
5445     (license license:asl2.0)))
5447 (define-public java-eclipse-osgi
5448   (package
5449     (name "java-eclipse-osgi")
5450     (version "3.11.3")
5451     (source (origin
5452               (method url-fetch)
5453               (uri (string-append "https://repo1.maven.org/maven2/"
5454                                   "org/eclipse/platform/org.eclipse.osgi/"
5455                                   version "/org.eclipse.osgi-"
5456                                   version "-sources.jar"))
5457               (sha256
5458                (base32
5459                 "00cqc6lb29n0zv68b4l842vzkwawvbr7gshfdygsk8sicvcq2c7b"))))
5460     (build-system ant-build-system)
5461     (arguments
5462      `(#:tests? #f ; no tests included
5463        #:jar-name "eclipse-equinox-osgi.jar"))
5464     (inputs
5465      `(("java-osgi-annotation" ,java-osgi-annotation)))
5466     (home-page "http://www.eclipse.org/equinox/")
5467     (synopsis "Eclipse Equinox OSGi framework")
5468     (description "This package provides an implementation of the OSGi Core
5469 specification.")
5470     (license license:epl1.0)))
5472 (define-public java-eclipse-equinox-common
5473   (package
5474     (name "java-eclipse-equinox-common")
5475     (version "3.10.200")
5476     (source (origin
5477               (method url-fetch)
5478               (uri (string-append "https://repo1.maven.org/maven2/"
5479                                   "org/eclipse/platform/org.eclipse.equinox.common/"
5480                                   version "/org.eclipse.equinox.common-"
5481                                   version "-sources.jar"))
5482               (sha256
5483                (base32
5484                 "1yn8ij6xsljlf35sr2l7wvyvc0ss4n1rv0ry5zkgb49dj4hyrqrj"))))
5485     (build-system ant-build-system)
5486     (arguments
5487      `(#:tests? #f ; no tests included
5488        #:jar-name "eclipse-equinox-common.jar"))
5489     (inputs
5490      `(("java-eclipse-osgi" ,java-eclipse-osgi)))
5491     (home-page "http://www.eclipse.org/equinox/")
5492     (synopsis "Common Eclipse runtime")
5493     (description "This package provides the common Eclipse runtime.")
5494     (license license:epl1.0)))
5496 (define-public java-eclipse-core-jobs
5497   (package
5498     (name "java-eclipse-core-jobs")
5499     (version "3.8.0")
5500     (source (origin
5501               (method url-fetch)
5502               (uri (string-append "https://repo1.maven.org/maven2/"
5503                                   "org/eclipse/platform/org.eclipse.core.jobs/"
5504                                   version "/org.eclipse.core.jobs-"
5505                                   version "-sources.jar"))
5506               (sha256
5507                (base32
5508                 "0395b8lh0km8vhzjnchvs1rii1qz48hyvb2wqfaq4yhklbwihq4b"))))
5509     (build-system ant-build-system)
5510     (arguments
5511      `(#:tests? #f ; no tests included
5512        #:jar-name "eclipse-core-jobs.jar"))
5513     (inputs
5514      `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5515        ("java-eclipse-osgi" ,java-eclipse-osgi)))
5516     (home-page "http://www.eclipse.org/equinox/")
5517     (synopsis "Eclipse jobs mechanism")
5518     (description "This package provides the Eclipse jobs mechanism.")
5519     (license license:epl1.0)))
5521 (define-public java-eclipse-equinox-registry
5522   (package
5523     (name "java-eclipse-equinox-registry")
5524     (version "3.6.100")
5525     (source (origin
5526               (method url-fetch)
5527               (uri (string-append "https://repo1.maven.org/maven2/"
5528                                   "org/eclipse/platform/org.eclipse.equinox.registry/"
5529                                   version "/org.eclipse.equinox.registry-"
5530                                   version "-sources.jar"))
5531               (sha256
5532                (base32
5533                 "1i9sgymh2fy5vdgk5y7s3qvrlbgh4l93ddqi3v4zmca7hwrlhf9k"))))
5534     (build-system ant-build-system)
5535     (arguments
5536      `(#:tests? #f ; no tests included
5537        #:jar-name "eclipse-equinox-registry.jar"))
5538     (inputs
5539      `(("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
5540        ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5541        ("java-eclipse-osgi" ,java-eclipse-osgi)))
5542     (home-page "http://www.eclipse.org/equinox/")
5543     (synopsis "Eclipse extension registry support")
5544     (description "This package provides support for the Eclipse extension
5545 registry.")
5546     (license license:epl1.0)))
5548 (define-public java-eclipse-equinox-app
5549   (package
5550     (name "java-eclipse-equinox-app")
5551     (version "1.3.400")
5552     (source (origin
5553               (method url-fetch)
5554               (uri (string-append "https://repo1.maven.org/maven2/"
5555                                   "org/eclipse/platform/org.eclipse.equinox.app/"
5556                                   version "/org.eclipse.equinox.app-"
5557                                   version "-sources.jar"))
5558               (sha256
5559                (base32
5560                 "0nhvbp93y203ar7y59gb0mz3w2d3jlqhr0c9hii9bcfpmr7imdab"))))
5561     (build-system ant-build-system)
5562     (arguments
5563      `(#:tests? #f ; no tests included
5564        #:jar-name "eclipse-equinox-app.jar"))
5565     (inputs
5566      `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5567        ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5568        ("java-eclipse-osgi" ,java-eclipse-osgi)
5569        ("java-osgi-service-event" ,java-osgi-service-event)))
5570     (home-page "http://www.eclipse.org/equinox/")
5571     (synopsis "Equinox application container")
5572     (description "This package provides the Equinox application container for
5573 Eclipse.")
5574     (license license:epl1.0)))
5576 (define-public java-eclipse-equinox-preferences
5577   (package
5578     (name "java-eclipse-equinox-preferences")
5579     (version "3.6.1")
5580     (source (origin
5581               (method url-fetch)
5582               (uri (string-append "https://repo1.maven.org/maven2/"
5583                                   "org/eclipse/platform/org.eclipse.equinox.preferences/"
5584                                   version "/org.eclipse.equinox.preferences-"
5585                                   version "-sources.jar"))
5586               (sha256
5587                (base32
5588                 "0k7w6c141sqym4fy3af0qkwpy4pdh2vsjpjba6rp5fxyqa24v0a2"))))
5589     (build-system ant-build-system)
5590     (arguments
5591      `(#:tests? #f ; no tests included
5592        #:jar-name "eclipse-equinox-preferences.jar"))
5593     (inputs
5594      `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5595        ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5596        ("java-eclipse-osgi" ,java-eclipse-osgi)))
5597     (home-page "http://www.eclipse.org/equinox/")
5598     (synopsis "Eclipse preferences mechanism")
5599     (description "This package provides the Eclipse preferences mechanism with
5600 the module @code{org.eclipse.equinox.preferences}.")
5601     (license license:epl1.0)))
5603 (define-public java-eclipse-core-contenttype
5604   (package
5605     (name "java-eclipse-core-contenttype")
5606     (version "3.5.100")
5607     (source (origin
5608               (method url-fetch)
5609               (uri (string-append "https://repo1.maven.org/maven2/"
5610                                   "org/eclipse/platform/org.eclipse.core.contenttype/"
5611                                   version "/org.eclipse.core.contenttype-"
5612                                   version "-sources.jar"))
5613               (sha256
5614                (base32
5615                 "1wcqcv7ijwv5rh748vz3x9pkmjl9w1r0k0026k56n8yjl4rrmspi"))))
5616     (build-system ant-build-system)
5617     (arguments
5618      `(#:tests? #f ; no tests included
5619        #:jar-name "eclipse-core-contenttype.jar"))
5620     (inputs
5621      `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5622        ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5623        ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5624        ("java-eclipse-osgi" ,java-eclipse-osgi)))
5625     (home-page "http://www.eclipse.org/")
5626     (synopsis "Eclipse content mechanism")
5627     (description "This package provides the Eclipse content mechanism in the
5628 @code{org.eclipse.core.contenttype} module.")
5629     (license license:epl1.0)))
5631 (define-public java-eclipse-core-runtime
5632   (package
5633     (name "java-eclipse-core-runtime")
5634     (version "3.15.100")
5635     (source (origin
5636               (method url-fetch)
5637               (uri (string-append "https://repo1.maven.org/maven2/"
5638                                   "org/eclipse/platform/org.eclipse.core.runtime/"
5639                                   version "/org.eclipse.core.runtime-"
5640                                   version "-sources.jar"))
5641               (sha256
5642                (base32
5643                 "0l8xayacsbjvz5hypx2fv47vpw2n4dspamcfb3hx30x9hj8vmg7r"))))
5644     (build-system ant-build-system)
5645     (arguments
5646      `(#:tests? #f ; no tests included
5647        #:jar-name "eclipse-core-runtime.jar"))
5648     (inputs
5649      `(("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
5650        ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
5651        ("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
5652        ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5653        ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5654        ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5655        ("java-eclipse-osgi" ,java-eclipse-osgi)))
5656     (home-page "https://www.eclipse.org/")
5657     (synopsis "Eclipse core runtime")
5658     (description "This package provides the Eclipse core runtime with the
5659 module @code{org.eclipse.core.runtime}.")
5660     (license license:epl1.0)))
5662 (define-public java-eclipse-core-filesystem
5663   (package
5664     (name "java-eclipse-core-filesystem")
5665     (version "1.6.1")
5666     (source (origin
5667               (method url-fetch)
5668               (uri (string-append "https://repo1.maven.org/maven2/"
5669                                   "org/eclipse/platform/org.eclipse.core.filesystem/"
5670                                   version "/org.eclipse.core.filesystem-"
5671                                   version "-sources.jar"))
5672               (sha256
5673                (base32
5674                 "0km1bhwjim4rfy3pkvjhvy31kgsyf2ncx0mlkmbf5n6g57pphdyj"))))
5675     (build-system ant-build-system)
5676     (arguments
5677      `(#:tests? #f ; no tests included
5678        #:jar-name "eclipse-core-filesystem.jar"))
5679     (inputs
5680      `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5681        ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5682        ("java-eclipse-osgi" ,java-eclipse-osgi)))
5683     (home-page "https://www.eclipse.org/")
5684     (synopsis "Eclipse core file system")
5685     (description "This package provides the Eclipse core file system with the
5686 module @code{org.eclipse.core.filesystem}.")
5687     (license license:epl1.0)))
5689 (define-public java-eclipse-core-expressions
5690   (package
5691     (name "java-eclipse-core-expressions")
5692     (version "3.5.100")
5693     (source (origin
5694               (method url-fetch)
5695               (uri (string-append "https://repo1.maven.org/maven2/"
5696                                   "org/eclipse/platform/org.eclipse.core.expressions/"
5697                                   version "/org.eclipse.core.expressions-"
5698                                   version "-sources.jar"))
5699               (sha256
5700                (base32
5701                 "18bw2l875gmygvpagpgk9l24qzbdjia4ag12nw6fi8v8yaq4987f"))))
5702     (build-system ant-build-system)
5703     (arguments
5704      `(#:tests? #f ; no tests included
5705        #:jar-name "eclipse-core-expressions.jar"))
5706     (inputs
5707      `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5708        ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5709        ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5710        ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5711        ("java-eclipse-osgi" ,java-eclipse-osgi)))
5712     (home-page "https://www.eclipse.org/")
5713     (synopsis "Eclipse core expression language")
5714     (description "This package provides the Eclipse core expression language
5715 with the @code{org.eclipse.core.expressions} module.")
5716     (license license:epl1.0)))
5718 (define-public java-eclipse-core-variables
5719   (package
5720     (name "java-eclipse-core-variables")
5721     (version "3.3.0")
5722     (source (origin
5723               (method url-fetch)
5724               (uri (string-append "https://repo1.maven.org/maven2/"
5725                                   "org/eclipse/platform/org.eclipse.core.variables/"
5726                                   version "/org.eclipse.core.variables-"
5727                                   version "-sources.jar"))
5728               (sha256
5729                (base32
5730                 "12dirh03zi4n5x5cj07vzrhkmnqy6h9q10h9j605pagmpmifyxmy"))))
5731     (build-system ant-build-system)
5732     (arguments
5733      `(#:tests? #f ; no tests included
5734        #:jar-name "eclipse-core-variables.jar"))
5735     (inputs
5736      `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5737        ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5738        ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5739        ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5740        ("java-eclipse-osgi" ,java-eclipse-osgi)))
5741     (home-page "https://www.eclipse.org/platform")
5742     (synopsis "Eclipse core variables")
5743     (description "This package provides the Eclipse core variables module
5744 @code{org.eclipse.core.variables}.")
5745     (license license:epl1.0)))
5747 (define-public java-eclipse-ant-core
5748   (package
5749     (name "java-eclipse-ant-core")
5750     (version "3.4.100")
5751     (source (origin
5752               (method url-fetch)
5753               (uri (string-append "https://repo1.maven.org/maven2/"
5754                                   "org/eclipse/platform/org.eclipse.ant.core/"
5755                                   version "/org.eclipse.ant.core-"
5756                                   version "-sources.jar"))
5757               (sha256
5758                (base32
5759                 "11g3if794qjlk98mz9zch22rr56sd7z63vn4i7k2icr8cq5bfqg7"))))
5760     (build-system ant-build-system)
5761     (arguments
5762      `(#:tests? #f ; no tests included
5763        #:jar-name "eclipse-ant-core.jar"))
5764     (inputs
5765      `(("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
5766        ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5767        ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5768        ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5769        ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
5770        ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5771        ("java-eclipse-core-variables" ,java-eclipse-core-variables)
5772        ("java-eclipse-osgi" ,java-eclipse-osgi)))
5773     (home-page "https://www.eclipse.org/platform")
5774     (synopsis "Ant build tool core libraries")
5775     (description "This package provides the ant build tool core libraries with
5776 the module @code{org.eclipse.ant.core}.")
5777     (license license:epl1.0)))
5779 (define-public java-eclipse-core-resources
5780   (package
5781     (name "java-eclipse-core-resources")
5782     (version "3.13.200")
5783     (source (origin
5784               (method url-fetch)
5785               (uri (string-append "https://repo1.maven.org/maven2/"
5786                                   "org/eclipse/platform/org.eclipse.core.resources/"
5787                                   version "/org.eclipse.core.resources-"
5788                                   version "-sources.jar"))
5789               (sha256
5790                (base32
5791                 "1sn3b6ky72hkvxcgf9b2jkpbdh3y8lbhi9xxwv1dsiddpkkq91hs"))))
5792     (build-system ant-build-system)
5793     (arguments
5794      `(#:tests? #f ; no tests included
5795        #:jar-name "eclipse-core-resources.jar"))
5796     (inputs
5797      `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5798        ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5799        ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5800        ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
5801        ("java-eclipse-core-expressions" ,java-eclipse-core-expressions)
5802        ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
5803        ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
5804        ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5805        ("java-eclipse-ant-core" ,java-eclipse-ant-core)
5806        ("java-eclipse-osgi" ,java-eclipse-osgi)))
5807     (home-page "https://www.eclipse.org/")
5808     (synopsis "Eclipse core resource management")
5809     (description "This package provides the Eclipse core resource management
5810 module @code{org.eclipse.core.resources}.")
5811     (license license:epl1.0)))
5813 (define-public java-eclipse-compare-core
5814   (package
5815     (name "java-eclipse-compare-core")
5816     (version "3.6.0")
5817     (source (origin
5818               (method url-fetch)
5819               (uri (string-append "https://repo1.maven.org/maven2/"
5820                                   "org/eclipse/platform/org.eclipse.compare.core/"
5821                                   version "/org.eclipse.compare.core-"
5822                                   version "-sources.jar"))
5823               (sha256
5824                (base32
5825                 "10g37r0pbiffyv2wk35c6g5lwzkdipkl0kkjp41v84dln46xm4dg"))))
5826     (build-system ant-build-system)
5827     (arguments
5828      `(#:tests? #f ; no tests included
5829        #:jar-name "eclipse-compare-core.jar"))
5830     (inputs
5831      `(("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5832        ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5833        ("java-eclipse-osgi" ,java-eclipse-osgi)
5834        ("java-icu4j" ,java-icu4j)))
5835     (home-page "https://www.eclipse.org/")
5836     (synopsis "Eclipse core compare support")
5837     (description "This package provides the Eclipse core compare support
5838 module @code{org.eclipse.compare.core}.")
5839     (license license:epl1.0)))
5841 (define-public java-eclipse-team-core
5842   (package
5843     (name "java-eclipse-team-core")
5844     (version "3.8.0")
5845     (source (origin
5846               (method url-fetch)
5847               (uri (string-append "https://repo1.maven.org/maven2/"
5848                                   "org/eclipse/platform/org.eclipse.team.core/"
5849                                   version "/org.eclipse.team.core-"
5850                                   version "-sources.jar"))
5851               (sha256
5852                (base32
5853                 "02j2jzqgb26zx2d5ahxmvijw6j4r0la90zl5c3i65x6z19ciyam7"))))
5854     (build-system ant-build-system)
5855     (arguments
5856      `(#:tests? #f ; no tests included
5857        #:jar-name "eclipse-team-core.jar"))
5858     (inputs
5859      `(("java-eclipse-compare-core" ,java-eclipse-compare-core)
5860        ("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
5861        ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
5862        ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
5863        ("java-eclipse-core-resources" ,java-eclipse-core-resources)
5864        ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5865        ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5866        ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5867        ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5868        ("java-eclipse-osgi" ,java-eclipse-osgi)))
5869     (home-page "https://www.eclipse.org/platform")
5870     (synopsis "Eclipse team support core")
5871     (description "This package provides the Eclipse team support core module
5872 @code{org.eclipse.team.core}.")
5873     (license license:epl1.0)))
5875 (define-public java-eclipse-core-commands
5876   (package
5877     (name "java-eclipse-core-commands")
5878     (version "3.8.1")
5879     (source (origin
5880               (method url-fetch)
5881               (uri (string-append "https://repo1.maven.org/maven2/"
5882                                   "org/eclipse/platform/org.eclipse.core.commands/"
5883                                   version "/org.eclipse.core.commands-"
5884                                   version "-sources.jar"))
5885               (sha256
5886                (base32
5887                 "0yjn482qndcfrsq3jd6vnhcylp16420f5aqkrwr8spsprjigjcr9"))))
5888     (build-system ant-build-system)
5889     (arguments
5890      `(#:tests? #f ; no tests included
5891        #:jar-name "eclipse-core-commands.jar"))
5892     (inputs
5893      `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)))
5894     (home-page "https://www.eclipse.org/platform")
5895     (synopsis "Eclipse core commands")
5896     (description "This package provides Eclipse core commands in the module
5897 @code{org.eclipse.core.commands}.")
5898     (license license:epl1.0)))
5900 (define-public java-eclipse-text
5901   (package
5902     (name "java-eclipse-text")
5903     (version "3.6.0")
5904     (source (origin
5905               (method url-fetch)
5906               (uri (string-append "https://repo1.maven.org/maven2/"
5907                                   "org/eclipse/platform/org.eclipse.text/"
5908                                   version "/org.eclipse.text-"
5909                                   version "-sources.jar"))
5910               (sha256
5911                (base32
5912                 "0scz70vzz5qs5caji9f5q01vkqnvip7dpri1q07l8wbbdcxn4cq1"))))
5913     (build-system ant-build-system)
5914     (arguments
5915      `(#:tests? #f ; no tests included
5916        #:jar-name "eclipse-text.jar"
5917        #:phases
5918        (modify-phases %standard-phases
5919          ;; When creating a new category we must make sure that the new list
5920          ;; matches List<Position>.  By default it seems to be too generic
5921          ;; (ArrayList<Object>), so we specialize it to ArrayList<Position>.
5922          ;; Without this we get this error:
5923          ;;
5924          ;; [javac] .../src/org/eclipse/jface/text/AbstractDocument.java:376:
5925          ;;      error: method put in interface Map<K,V> cannot be applied to given types;
5926          ;; [javac]                     fPositions.put(category, new ArrayList<>());
5927          ;; [javac]                               ^
5928          ;; [javac]   required: String,List<Position>
5929          ;; [javac]   found: String,ArrayList<Object>
5930          ;; [javac]   reason: actual argument ArrayList<Object> cannot be converted
5931          ;;              to List<Position> by method invocation conversion
5932          ;; [javac]   where K,V are type-variables:
5933          ;; [javac]     K extends Object declared in interface Map
5934          ;; [javac]     V extends Object declared in interface Map
5935          ;;
5936          ;; I don't know if this is a good fix.  I suspect it is not, but it
5937          ;; seems to work.
5938          (add-after 'unpack 'fix-compilation-error
5939            (lambda _
5940              (substitute* "src/org/eclipse/jface/text/AbstractDocument.java"
5941                (("Positions.put\\(category, new ArrayList<>\\(\\)\\);")
5942                 "Positions.put(category, new ArrayList<Position>());"))
5943              #t)))))
5944     (inputs
5945      `(("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5946        ("java-eclipse-core-commands" ,java-eclipse-core-commands)
5947        ("java-icu4j" ,java-icu4j)))
5948     (home-page "http://www.eclipse.org/platform")
5949     (synopsis "Eclipse text library")
5950     (description "Platform Text is part of the Platform UI project and
5951 provides the basic building blocks for text and text editors within Eclipse
5952 and contributes the Eclipse default text editor.")
5953     (license license:epl1.0)))
5955 (define-public java-eclipse-jdt-core
5956   (package
5957     (name "java-eclipse-jdt-core")
5958     (version "3.16.0")
5959     (source (origin
5960               (method url-fetch)
5961               (uri (string-append "https://repo1.maven.org/maven2/"
5962                                   "org/eclipse/jdt/org.eclipse.jdt.core/"
5963                                   version "/org.eclipse.jdt.core-"
5964                                   version "-sources.jar"))
5965               (sha256
5966                (base32
5967                 "1g560yr9v2kzv34gc2m3ifpgnj7krcdd6h4gd4z83pwqacwkfz0k"))))
5968     (build-system ant-build-system)
5969     (arguments
5970      `(#:tests? #f ; no tests included
5971        #:jar-name "eclipse-jdt-core.jar"
5972        #:phases
5973        (modify-phases %standard-phases
5974          (add-after 'unpack 'move-sources
5975            (lambda _
5976              (with-directory-excursion "src/jdtCompilerAdaptersrc/"
5977                (for-each (lambda (file)
5978                            (install-file file (string-append "../" (dirname file))))
5979                          (find-files "." ".*")))
5980              (delete-file-recursively "src/jdtCompilerAdaptersrc/")
5981              #t))
5982          (add-before 'build 'copy-resources
5983            (lambda _
5984              (with-directory-excursion "src"
5985                (for-each (lambda (file)
5986                            (install-file file (string-append "../build/classes/" (dirname file))))
5987                          (find-files "." ".*.(props|properties|rsc)")))
5988              #t)))))
5989     (inputs
5990      `(("java-eclipse-core-contenttype" ,java-eclipse-core-contenttype)
5991        ("java-eclipse-core-filesystem" ,java-eclipse-core-filesystem)
5992        ("java-eclipse-core-jobs" ,java-eclipse-core-jobs)
5993        ("java-eclipse-core-resources" ,java-eclipse-core-resources)
5994        ("java-eclipse-core-runtime" ,java-eclipse-core-runtime)
5995        ("java-eclipse-equinox-app" ,java-eclipse-equinox-app)
5996        ("java-eclipse-equinox-common" ,java-eclipse-equinox-common)
5997        ("java-eclipse-equinox-preferences" ,java-eclipse-equinox-preferences)
5998        ("java-eclipse-equinox-registry" ,java-eclipse-equinox-registry)
5999        ("java-eclipse-osgi" ,java-eclipse-osgi)
6000        ("java-eclipse-text" ,java-eclipse-text)))
6001     (home-page "https://www.eclipse.org/jdt")
6002     (synopsis "Java development tools core libraries")
6003     (description "This package provides the core libraries of the Eclipse Java
6004 development tools.")
6005     (license license:epl1.0)))
6007 (define-public java-eclipse-jdt-compiler-apt
6008   (package
6009     (name "java-eclipse-jdt-compiler-apt")
6010     (version "1.3.400")
6011     (source (origin
6012               (method url-fetch)
6013               (uri (string-append "https://repo1.maven.org/maven2/"
6014                                   "org/eclipse/jdt/org.eclipse.jdt.compiler.apt/"
6015                                   version "/org.eclipse.jdt.compiler.apt-"
6016                                   version "-sources.jar"))
6017               (sha256
6018                (base32
6019                 "1s285k9p2ixdqrknb40jbbvw682n9a7l5lqpn583a8pvlzg2l6r8"))))
6020     (build-system ant-build-system)
6021     (arguments
6022      `(#:tests? #f ; no tests included
6023        #:jar-name "eclipse-jdt-compiler-apt.jar"
6024        #:jdk ,openjdk11))
6025     (inputs
6026      `(("java-eclipse-jdt-core" ,java-eclipse-jdt-core)))
6027     (home-page "https://www.eclipse.org/jdt/apt/")
6028     (synopsis "Annotation processing tool")
6029     (description "APT stands for Annotation Processing Tool.  APT provides a
6030 means for generating files and compiling new Java classes based on annotations
6031 found in your source code.")
6032     (license license:epl2.0)))
6034 (define-public java-javax-mail
6035   (package
6036     (name "java-javax-mail")
6037     (version "1.5.6")
6038     (source (origin
6039               (method url-fetch)
6040               (uri (string-append "https://repo1.maven.org/maven2/"
6041                                   "com/sun/mail/javax.mail/"
6042                                   version "/javax.mail-"
6043                                   version "-sources.jar"))
6044               (sha256
6045                (base32
6046                 "0sdlfgsc2b5s89xv1261y8i0jijcja019k2x1c8ngfn582w4jly9"))))
6047     (build-system ant-build-system)
6048     (arguments
6049      `(#:tests? #f ; no tests
6050        #:jar-name "javax-mail.jar"))
6051     (home-page "https://javamail.java.net")
6052     (synopsis "Reference implementation of the JavaMail API")
6053     (description
6054      "This package provides versions of the JavaMail API implementation, IMAP,
6055 SMTP, and POP3 service providers, some examples, and documentation for the
6056 JavaMail API.")
6057     ;; GPLv2 only with "classpath exception".
6058     (license license:gpl2)))
6060 (define-public java-log4j-api
6061   (package
6062     (name "java-log4j-api")
6063     (version "2.4.1")
6064     (source (origin
6065               (method url-fetch)
6066               (uri (string-append "mirror://apache/logging/log4j/" version
6067                                   "/apache-log4j-" version "-src.tar.gz"))
6068               (sha256
6069                (base32
6070                 "0j5p9gik0jysh37nlrckqbky12isy95cpwg2gv5fas1rcdqbraxd"))))
6071     (build-system ant-build-system)
6072     (arguments
6073      `(#:tests? #f ; tests require unpackaged software
6074        #:jar-name "log4j-api.jar"
6075        #:make-flags
6076        (list (string-append "-Ddist.dir=" (assoc-ref %outputs "out")
6077                             "/share/java"))
6078        #:phases
6079        (modify-phases %standard-phases
6080          (add-after 'unpack 'enter-dir
6081            (lambda _ (chdir "log4j-api") #t))
6082          ;; FIXME: The tests require additional software that has not been
6083          ;; packaged yet, such as
6084          ;; * org.apache.maven
6085          ;; * org.apache.felix
6086          (add-after 'enter-dir 'delete-tests
6087            (lambda _ (delete-file-recursively "src/test") #t)))))
6088     (inputs
6089      `(("java-osgi-core" ,java-osgi-core)
6090        ("java-hamcrest-core" ,java-hamcrest-core)
6091        ("java-junit" ,java-junit)))
6092     (home-page "http://logging.apache.org/log4j/2.x/")
6093     (synopsis "API module of the Log4j logging framework for Java")
6094     (description
6095      "This package provides the API module of the Log4j logging framework for
6096 Java.")
6097     (license license:asl2.0)))
6099 (define-public java-log4j-core
6100   (package
6101     (inherit java-log4j-api)
6102     (name "java-log4j-core")
6103     (inputs
6104      `(("java-osgi-core" ,java-osgi-core)
6105        ("java-hamcrest-core" ,java-hamcrest-core)
6106        ("java-log4j-api" ,java-log4j-api)
6107        ("java-mail" ,java-mail)
6108        ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
6109        ("java-lmax-disruptor" ,java-lmax-disruptor)
6110        ("java-kafka" ,java-kafka-clients)
6111        ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
6112        ("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
6113        ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
6114        ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
6115        ("java-fasterxml-jackson-dataformat-xml" ,java-fasterxml-jackson-dataformat-xml)
6116        ("java-fasterxml-jackson-dataformat-yaml" ,java-fasterxml-jackson-dataformat-yaml)
6117        ("java-commons-compress" ,java-commons-compress)
6118        ("java-commons-csv" ,java-commons-csv)
6119        ("java-jeromq" ,java-jeromq)
6120        ("java-junit" ,java-junit)))
6121     (native-inputs
6122      `(("hamcrest" ,java-hamcrest-all)
6123        ("java-commons-io" ,java-commons-io)
6124        ("java-commons-lang3" ,java-commons-lang3)
6125        ("slf4j" ,java-slf4j-api)))
6126     (arguments
6127      `(#:tests? #f ; tests require more dependencies
6128        #:test-dir "src/test"
6129        #:source-dir "src/main/java"
6130        #:jar-name "log4j-core.jar"
6131        #:jdk ,icedtea-8
6132        #:make-flags
6133        (list (string-append "-Ddist.dir=" (assoc-ref %outputs "out")
6134                             "/share/java"))
6135        #:phases
6136        (modify-phases %standard-phases
6137          (add-after 'unpack 'enter-dir
6138            (lambda _ (chdir "log4j-core") #t)))))
6139     (synopsis "Core component of the Log4j framework")
6140     (description "This package provides the core component of the Log4j
6141 logging framework for Java.")))
6143 (define-public java-log4j-1.2-api
6144   (package
6145     (inherit java-log4j-api)
6146     (name "java-log4j-1.2-api")
6147     (arguments
6148      `(#:jar-name "java-log4j-1.2-api.jar"
6149        #:source-dir "log4j-1.2-api/src/main/java"
6150        #:jdk ,icedtea-8
6151        ;; Tests require maven-model (and other maven subprojects), which is a
6152        ;; cyclic dependency.
6153        #:tests? #f))
6154     (inputs
6155      `(("log4j-api" ,java-log4j-api)
6156        ("log4j-core" ,java-log4j-core)
6157        ("osgi-core" ,java-osgi-core)
6158        ("eclipse-osgi" ,java-eclipse-osgi)
6159        ("java-lmax-disruptor" ,java-lmax-disruptor)))))
6161 (define-public java-commons-cli
6162   (package
6163     (name "java-commons-cli")
6164     (version "1.4")
6165     (source (origin
6166               (method url-fetch)
6167               (uri (string-append "mirror://apache/commons/cli/source/"
6168                                   "commons-cli-" version "-src.tar.gz"))
6169               (sha256
6170                (base32
6171                 "05hgi2z01fqz374y719gl1dxzqvzci5af071zm7vxrjg9vczipm1"))))
6172     (build-system ant-build-system)
6173     ;; TODO: javadoc
6174     (arguments
6175      `(#:jar-name "commons-cli.jar"))
6176     (native-inputs
6177      `(("java-junit" ,java-junit)
6178        ("java-hamcrest-core" ,java-hamcrest-core)))
6179     (home-page "http://commons.apache.org/cli/")
6180     (synopsis "Command line arguments and options parsing library")
6181     (description "The Apache Commons CLI library provides an API for parsing
6182 command line options passed to programs.  It is also able to print help
6183 messages detailing the options available for a command line tool.
6185 Commons CLI supports different types of options:
6187 @itemize
6188 @item POSIX like options (ie. tar -zxvf foo.tar.gz)
6189 @item GNU like long options (ie. du --human-readable --max-depth=1)
6190 @item Java like properties (ie. java -Djava.awt.headless=true Foo)
6191 @item Short options with value attached (ie. gcc -O2 foo.c)
6192 @item long options with single hyphen (ie. ant -projecthelp)
6193 @end itemize
6195 This is a part of the Apache Commons Project.")
6196     (license license:asl2.0)))
6198 (define-public java-commons-codec
6199   (package
6200     (name "java-commons-codec")
6201     (version "1.10")
6202     (source (origin
6203               (method url-fetch)
6204               (uri (string-append "mirror://apache/commons/codec/source/"
6205                                   "commons-codec-" version "-src.tar.gz"))
6206               (sha256
6207                (base32
6208                 "1w9qg30y4s0x8gnmr2fgj4lyplfn788jqxbcz27lf5kbr6n8xr65"))))
6209     (build-system ant-build-system)
6210     (outputs '("out" "doc"))
6211     (arguments
6212      `(#:test-target "test"
6213        #:make-flags
6214        (let ((hamcrest (assoc-ref %build-inputs "java-hamcrest-core"))
6215              (junit    (assoc-ref %build-inputs "java-junit")))
6216          (list (string-append "-Djunit.jar=" junit "/share/java/junit.jar")
6217                (string-append "-Dhamcrest.jar=" hamcrest
6218                               "/share/java/hamcrest-core.jar")
6219                ;; Do not append version to jar.
6220                "-Dfinal.name=commons-codec"))
6221        #:phases
6222        (modify-phases %standard-phases
6223          (add-after 'build 'build-javadoc ant-build-javadoc)
6224          (replace 'install (install-jars "dist"))
6225          (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
6226     (native-inputs
6227      `(("java-junit" ,java-junit)
6228        ("java-hamcrest-core" ,java-hamcrest-core)))
6229     (home-page "http://commons.apache.org/codec/")
6230     (synopsis "Common encoders and decoders such as Base64, Hex, Phonetic and URLs")
6231     (description "The codec package contains simple encoder and decoders for
6232 various formats such as Base64 and Hexadecimal.  In addition to these widely
6233 used encoders and decoders, the codec package also maintains a collection of
6234 phonetic encoding utilities.
6236 This is a part of the Apache Commons Project.")
6237     (license license:asl2.0)))
6239 (define-public java-commons-daemon
6240   (package
6241     (name "java-commons-daemon")
6242     (version "1.0.15")
6243     (source (origin
6244               (method url-fetch)
6245               (uri (string-append "mirror://apache/commons/daemon/source/"
6246                                   "commons-daemon-" version "-src.tar.gz"))
6247               (sha256
6248                (base32
6249                 "0ci46kq8jpz084ccwq0mmkahcgsmh20ziclp2jf5i0djqv95gvhi"))))
6250     (build-system ant-build-system)
6251     (arguments
6252      `(#:test-target "test"
6253        #:phases
6254        (modify-phases %standard-phases
6255          (add-after 'build 'build-javadoc ant-build-javadoc)
6256          (replace 'install (install-jars "dist"))
6257          (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
6258     (native-inputs
6259      `(("java-junit" ,java-junit)))
6260     (home-page "http://commons.apache.org/daemon/")
6261     (synopsis "Library to launch Java applications as daemons")
6262     (description "The Daemon package from Apache Commons can be used to
6263 implement Java applications which can be launched as daemons.  For example the
6264 program will be notified about a shutdown so that it can perform cleanup tasks
6265 before its process of execution is destroyed by the operation system.
6267 This package contains the Java library.  You will also need the actual binary
6268 for your architecture which is provided by the jsvc package.
6270 This is a part of the Apache Commons Project.")
6271     (license license:asl2.0)))
6273 (define-public java-javaewah
6274   (package
6275     (name "java-javaewah")
6276     (version "1.1.6")
6277     (source (origin
6278               (method url-fetch)
6279               (uri (string-append "https://github.com/lemire/javaewah/"
6280                                   "archive/JavaEWAH-" version ".tar.gz"))
6281               (sha256
6282                (base32
6283                 "1n7j1r1h24wlhwv9zdcj6yqjrhma2ixwyzm15l5vrv6yqjs6753b"))))
6284     (build-system ant-build-system)
6285     (arguments `(#:jar-name "javaewah.jar"))
6286     (inputs
6287      `(("java-junit" ,java-junit)
6288        ("java-hamcrest-core" ,java-hamcrest-core)))
6289     (home-page "https://github.com/lemire/javaewah")
6290     (synopsis "Compressed alternative to the Java @code{BitSet} class")
6291     (description "This is a word-aligned compressed variant of the Java
6292 @code{Bitset} class.  It provides both a 64-bit and a 32-bit RLE-like
6293 compression scheme.  It can be used to implement bitmap indexes.
6295 The goal of word-aligned compression is not to achieve the best compression,
6296 but rather to improve query processing time. Hence, JavaEWAH tries to save CPU
6297 cycles, maybe at the expense of storage.  However, the EWAH scheme is always
6298 more efficient storage-wise than an uncompressed bitmap (as implemented in the
6299 @code{BitSet} class by Sun).")
6300     ;; GPL2.0 derivates are explicitly allowed.
6301     (license license:asl2.0)))
6303 (define-public java-slf4j-api
6304   (package
6305     (name "java-slf4j-api")
6306     (version "1.7.25")
6307     (source (origin
6308               (method url-fetch)
6309               (uri (string-append "https://www.slf4j.org/dist/slf4j-"
6310                                   version ".tar.gz"))
6311               (sha256
6312                (base32
6313                 "13j51sgzmhhdrfa74gkal5zpip7r1440dh7zsi2c8bpb2zs1v8kb"))
6314               (modules '((guix build utils)))
6315               ;; Delete bundled jars.
6316               (snippet
6317                '(begin
6318                   (for-each delete-file (find-files "." "\\.jar$"))
6319                   #t))))
6320     (build-system ant-build-system)
6321     (arguments
6322      `(#:jar-name "slf4j-api.jar"
6323        #:source-dir "slf4j-api/src/main"
6324        #:test-dir "slf4j-api/src/test"
6325        #:phases
6326        (modify-phases %standard-phases
6327          (add-after 'build 'regenerate-jar
6328            (lambda _
6329              ;; pom.xml ignores these files in the jar creation process. If we don't,
6330              ;; we get the error "This code should have never made it into slf4j-api.jar"
6331              (delete-file-recursively "build/classes/org/slf4j/impl")
6332              (invoke "jar" "-cf" "build/jar/slf4j-api.jar" "-C"
6333                      "build/classes" ".")))
6334          (add-before 'check 'dont-test-abstract-classes
6335            (lambda _
6336              ;; abstract classes are not meant to be run with junit
6337              (substitute* "build.xml"
6338                (("<include name=\"\\*\\*/\\*Test.java\" />")
6339                 (string-append "<include name=\"**/*Test.java\" />"
6340                                "<exclude name=\"**/MultithreadedInitializationTest"
6341                                ".java\" />")))
6342              #t)))))
6343     (inputs
6344      `(("java-junit" ,java-junit)
6345        ("java-hamcrest-core" ,java-hamcrest-core)))
6346     (home-page "https://www.slf4j.org/")
6347     (synopsis "Simple logging facade for Java")
6348     (description "The Simple Logging Facade for Java (SLF4J) serves as a
6349 simple facade or abstraction for various logging
6350 frameworks (e.g. @code{java.util.logging}, @code{logback}, @code{log4j})
6351 allowing the end user to plug in the desired logging framework at deployment
6352 time.")
6353     (license license:expat)))
6355 (define java-slf4j-api-bootstrap
6356   (package
6357     (inherit java-slf4j-api)
6358     (name "java-slf4j-api-bootstrap")
6359     (inputs `())
6360     (arguments
6361      (substitute-keyword-arguments (package-arguments java-slf4j-api)
6362        ((#:tests? _ #f) #f)))))
6364 (define-public java-slf4j-simple
6365   (package
6366     (name "java-slf4j-simple")
6367     (version "1.7.25")
6368     (source (package-source java-slf4j-api))
6369     (build-system ant-build-system)
6370     (arguments
6371      `(#:jar-name "slf4j-simple.jar"
6372        #:source-dir "slf4j-simple/src/main"
6373        #:test-dir "slf4j-simple/src/test"
6374        #:phases
6375        (modify-phases %standard-phases
6376          ;; The tests need some test classes from slf4j-api
6377          (add-before 'check 'build-slf4j-api-test-helpers
6378            (lambda _
6379              ;; Add current dir to CLASSPATH ...
6380              (setenv "CLASSPATH"
6381                      (string-append (getcwd) ":" (getenv "CLASSPATH")))
6382              ;; ... and build test helper classes here:
6383              (apply invoke
6384                     `("javac" "-d" "."
6385                       ,@(find-files "slf4j-api/src/test" ".*\\.java"))))))))
6386     (inputs
6387      `(("java-junit" ,java-junit)
6388        ("java-hamcrest-core" ,java-hamcrest-core)
6389        ("java-slf4j-api" ,java-slf4j-api)))
6390     (home-page "https://www.slf4j.org/")
6391     (synopsis "Simple implementation of simple logging facade for Java")
6392     (description "SLF4J binding for the Simple implementation, which outputs
6393 all events to System.err.  Only messages of level INFO and higher are
6394 printed.")
6395     (license license:expat)))
6397 (define-public antlr2
6398   (package
6399     (name "antlr2")
6400     (version "2.7.7")
6401     (source (origin
6402               (method url-fetch)
6403               (uri (string-append "http://www.antlr2.org/download/antlr-"
6404                                   version ".tar.gz"))
6405               (sha256
6406                (base32
6407                 "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5"))
6408               (modules '((guix build utils)))
6409               (snippet
6410                '(begin
6411                   (delete-file "antlr.jar")
6412                   (substitute* "lib/cpp/antlr/CharScanner.hpp"
6413                     (("#include <map>")
6414                      (string-append
6415                       "#include <map>\n"
6416                       "#define EOF (-1)\n"
6417                       "#include <strings.h>")))
6418                   (substitute* "configure"
6419                     (("/bin/sh") "sh"))
6420                   #t))))
6421     (build-system gnu-build-system)
6422     (arguments
6423      `(#:tests? #f ; no test target
6424        #:imported-modules ((guix build ant-build-system)
6425                            (guix build syscalls)
6426                            ,@%gnu-build-system-modules)
6427        #:modules (((guix build ant-build-system) #:prefix ant:)
6428                   (guix build gnu-build-system)
6429                   (guix build utils))
6430        #:phases
6431        (modify-phases %standard-phases
6432          (add-after 'install 'strip-jar-timestamps
6433            (assoc-ref ant:%standard-phases 'strip-jar-timestamps))
6434          (add-before 'configure 'fix-timestamp
6435            (lambda _
6436              (substitute* "configure"
6437                (("^TIMESTAMP.*") "TIMESTAMP=19700101\n"))
6438              #t))
6439          (add-after 'configure 'fix-bin-ls
6440            (lambda _
6441              (substitute* (find-files "." "Makefile")
6442                (("/bin/ls") "ls"))
6443              #t)))))
6444     (native-inputs
6445      `(("which" ,which)
6446        ("zip" ,zip)
6447        ("java" ,icedtea "jdk")))
6448     (inputs
6449      `(("java" ,icedtea)))
6450     (home-page "http://www.antlr2.org")
6451     (synopsis "Framework for constructing recognizers, compilers, and translators")
6452     (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
6453 is a language tool that provides a framework for constructing recognizers,
6454 compilers, and translators from grammatical descriptions containing Java, C#,
6455 C++, or Python actions.  ANTLR provides excellent support for tree construction,
6456 tree walking, and translation.")
6457     (license license:public-domain)))
6459 (define-public java-stringtemplate-3
6460   (package
6461     (name "java-stringtemplate")
6462     (version "3.2.1")
6463     (source (origin
6464               (method url-fetch)
6465               (uri (string-append "https://github.com/antlr/website-st4/raw/"
6466                                   "gh-pages/download/stringtemplate-"
6467                                   version ".tar.gz"))
6468               (sha256
6469                (base32
6470                 "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is"))))
6471     (build-system ant-build-system)
6472     (arguments
6473      `(#:jar-name (string-append ,name "-" ,version ".jar")
6474        #:test-dir "test"
6475        #:modules ((guix build ant-build-system)
6476                   (guix build utils)
6477                   (srfi srfi-1))
6478        #:phases
6479        (modify-phases %standard-phases
6480          (add-before 'check 'fix-tests
6481            (lambda _
6482              (substitute* "build.xml"
6483                (("\\$\\{test.home\\}/java")
6484                 "${test.home}/org"))
6485              #t))
6486          (add-before 'build 'generate-grammar
6487            (lambda _
6488              (with-directory-excursion "src/org/antlr/stringtemplate/language/"
6489                (for-each (lambda (file)
6490                            (format #t "~a\n" file)
6491                            (invoke "antlr" file))
6492                          '("template.g" "angle.bracket.template.g" "action.g"
6493                            "eval.g" "group.g" "interface.g")))
6494              #t)))))
6495     (native-inputs
6496      `(("antlr" ,antlr2)
6497        ("java-junit" ,java-junit)))
6498     (home-page "http://www.stringtemplate.org")
6499     (synopsis "Template engine to generate formatted text output")
6500     (description "StringTemplate is a java template engine (with ports for C#,
6501 Objective-C, JavaScript, Scala) for generating source code, web pages, emails,
6502 or any other formatted text output.  StringTemplate is particularly good at
6503 code generators, multiple site skins, and internationalization / localization.
6504 StringTemplate also powers ANTLR.")
6505     (license license:bsd-3)))
6507 ;; antlr3 is partially written using antlr3 grammar files. It also depends on
6508 ;; ST4 (stringtemplate4), which is also partially written using antlr3 grammar
6509 ;; files and uses antlr3 at runtime. The latest version requires a recent version
6510 ;; of antlr3 at runtime.
6511 ;; Fortunately, ST4 4.0.6 can be built with an older antlr3, and we use antlr3.3.
6512 ;; This version of ST4 is sufficient for the latest antlr3.
6513 ;; We use ST4 4.0.6 to build a boostrap antlr3 (latest version), and build
6514 ;; the latest ST4 with it. Then we build our final antlr3 that will be linked
6515 ;; against the latest ST4.
6516 ;; antlr3.3 still depends on antlr3 to generate some files, so we use an
6517 ;; even older version, antlr3.1, to generate them. Fortunately antlr3.1 uses
6518 ;; only grammar files with the antlr2 syntax.
6519 ;; So we build antlr3.1 -> antlr3.3 -> ST4.0.6 -> antlr3-bootstrap -> ST4 -> antlr3.
6521 (define-public java-stringtemplate
6522   (package (inherit java-stringtemplate-3)
6523     (name "java-stringtemplate")
6524     (version "4.0.8")
6525     (source (origin
6526               (method url-fetch)
6527               (uri (string-append "https://github.com/antlr/stringtemplate4/archive/"
6528                                   version ".tar.gz"))
6529               (file-name (string-append name "-" version ".tar.gz"))
6530               (sha256
6531                (base32
6532                 "1pri8hqa95rfdkjy55icl5q1m09zwp5k67ib14abas39s4v3w087"))))
6533     (build-system ant-build-system)
6534     (arguments
6535      `(#:jar-name (string-append ,name "-" ,version ".jar")
6536        #:tests? #f ; FIXME: tests fail for unknown reasons
6537        #:test-dir "test"
6538        #:modules ((guix build ant-build-system)
6539                   (guix build utils)
6540                   (srfi srfi-1))
6541        #:phases
6542        (modify-phases %standard-phases
6543          (add-before 'check 'fix-test-target
6544            (lambda _
6545              (substitute* "build.xml"
6546                (("\\$\\{test.home\\}/java") "${test.home}/")
6547                (("\\*Test.java") "Test*.java"))
6548              #t))
6549          (add-before 'build 'generate-grammar
6550            (lambda _
6551              (with-directory-excursion "src/org/stringtemplate/v4/compiler/"
6552                (for-each (lambda (file)
6553                            (format #t "~a\n" file)
6554                            (invoke "antlr3" file))
6555                          '("STParser.g" "Group.g" "CodeGenerator.g")))
6556              #t)))))
6557     (inputs
6558      `(("antlr3" ,antlr3-bootstrap)
6559        ("antlr2" ,antlr2)
6560        ("java-stringtemplate" ,java-stringtemplate-3)
6561        ("java-junit" ,java-junit)))))
6563 (define java-stringtemplate-4.0.6
6564   (package (inherit java-stringtemplate)
6565     (name "java-stringtemplate")
6566     (version "4.0.6")
6567     (source (origin
6568               (method url-fetch)
6569               (uri (string-append "https://github.com/antlr/stringtemplate4/archive/ST-"
6570                                   version ".tar.gz"))
6571               (file-name (string-append name "-" version ".tar.gz"))
6572               (sha256
6573                (base32
6574                 "0hjmh1ahdsh3w825i67mli9l4nncc4l6hdbf9ma91jvlj590sljp"))))
6575     (inputs
6576      `(("antlr3" ,antlr3-3.3)
6577        ("antlr2" ,antlr2)
6578        ("java-stringtemplate" ,java-stringtemplate-3)))))
6580 (define-public antlr3
6581   (package
6582     (name "antlr3")
6583     (version "3.5.2")
6584     (source (origin
6585               (method url-fetch)
6586               (uri (string-append "https://github.com/antlr/antlr3/archive/"
6587                                   version ".tar.gz"))
6588               (file-name (string-append name "-" version ".tar.gz"))
6589               (sha256
6590                (base32
6591                 "0218v683081lg54z9hvjxinhxd4dqp870jx6n39gslm0bkyi4vd6"))))
6592     (build-system ant-build-system)
6593     (arguments
6594      `(#:jar-name (string-append ,name "-" ,version ".jar")
6595        #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3"
6596        #:tests? #f
6597        #:phases
6598        (modify-phases %standard-phases
6599          (add-after 'install 'bin-install
6600            (lambda* (#:key inputs outputs #:allow-other-keys)
6601              (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
6602                    (bin (string-append (assoc-ref outputs "out") "/bin")))
6603                (mkdir-p bin)
6604                (with-output-to-file (string-append bin "/antlr3")
6605                  (lambda _
6606                    (display
6607                      (string-append "#!" (which "sh") "\n"
6608                                     "java -cp " jar "/" ,name "-" ,version ".jar:"
6609                                     (string-concatenate
6610                                       (find-files (assoc-ref inputs "stringtemplate")
6611                                                   ".*\\.jar"))
6612                                     ":"
6613                                     (string-concatenate
6614                                       (find-files (assoc-ref inputs "stringtemplate4")
6615                                                   ".*\\.jar"))
6616                                     ":"
6617                                     (string-concatenate
6618                                       (find-files (string-append
6619                                                     (assoc-ref inputs "antlr")
6620                                                     "/lib")
6621                                                   ".*\\.jar"))
6622                                     " org.antlr.Tool $*"))))
6623                (chmod (string-append bin "/antlr3") #o755))
6624              #t))
6625          (add-before 'build 'generate-grammar
6626            (lambda _
6627              (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/")
6628              (for-each (lambda (file)
6629                          (display file)
6630                          (newline)
6631                          (invoke "antlr3" file))
6632                        '("ANTLR.g" "ANTLRTreePrinter.g" "ActionAnalysis.g"
6633                          "AssignTokenTypesWalker.g"
6634                          "ActionTranslator.g" "TreeToNFAConverter.g"
6635                          "ANTLRv3.g" "ANTLRv3Tree.g" "LeftRecursiveRuleWalker.g"
6636                          "CodeGenTreeWalker.g" "DefineGrammarItemsWalker.g"))
6637              (substitute* "ANTLRParser.java"
6638                (("public Object getTree") "public GrammarAST getTree"))
6639              (substitute* "ANTLRv3Parser.java"
6640                (("public Object getTree") "public CommonTree getTree"))
6641              (chdir "../../../../../java")
6642              (substitute* "org/antlr/tool/LeftRecursiveRuleAnalyzer.java"
6643                (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*;
6644 import org.antlr.grammar.v3.ANTLRTreePrinter;"))
6645              (substitute* "org/antlr/tool/ErrorManager.java"
6646                (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") ""))
6647              (chdir "../../../..")
6648              #t))
6649          (add-before 'build 'fix-build-xml
6650            (lambda _
6651              (substitute* "build.xml"
6652                (("<exec") "<copy todir=\"${classes.dir}\">
6653 <fileset dir=\"tool/src/main/resources\">
6654 <include name=\"**/*.stg\"/>
6655 <include name=\"**/*.st\"/>
6656 <include name=\"**/*.sti\"/>
6657 <include name=\"**/STLexer.tokens\"/>
6658 </fileset>
6659 </copy><exec"))
6660              #t)))))
6661     (native-inputs
6662      `(("antlr" ,antlr2)
6663        ("antlr3" ,antlr3-bootstrap)))
6664     (inputs
6665      `(("junit" ,java-junit)
6666        ("stringtemplate" ,java-stringtemplate-3)
6667        ("stringtemplate4" ,java-stringtemplate)))
6668     (propagated-inputs
6669      `(("stringtemplate" ,java-stringtemplate-3)
6670        ("antlr" ,antlr2)
6671        ("stringtemplate4" ,java-stringtemplate-4.0.6)))
6672     (home-page "http://www.antlr3.org")
6673     (synopsis "Framework for constructing recognizers, compilers, and translators")
6674     (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
6675 is a language tool that provides a framework for constructing recognizers,
6676 compilers, and translators from grammatical descriptions containing Java, C#,
6677 C++, or Python actions.  ANTLR provides excellent support for tree construction,
6678 tree walking, and translation.")
6679     (license license:bsd-3)))
6681 (define antlr3-bootstrap
6682   (package
6683     (inherit antlr3)
6684     (name "antlr3-bootstrap")
6685     (native-inputs
6686      `(("antlr" ,antlr2)
6687        ("antlr3" ,antlr3-3.3)))
6688     (inputs
6689      `(("junit" ,java-junit)))))
6691 (define antlr3-3.3
6692   (package
6693     (inherit antlr3)
6694     (name "antlr3")
6695     (version "3.3")
6696     (source (origin
6697               (method url-fetch)
6698               (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
6699                                   "gh-pages/download/antlr-"
6700                                   version ".tar.gz"))
6701               (sha256
6702                (base32
6703                 "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m"))
6704               (patches
6705                (search-patches "antlr3-3_3-fix-java8-compilation.patch"))))
6706     (arguments
6707      `(#:jar-name (string-append ,name "-" ,version ".jar")
6708        #:source-dir (string-join '("tool/src/main/java"
6709                                    "runtime/Java/src/main/java"
6710                                    "tool/src/main/antlr2"
6711                                    "tool/src/main/antlr3")
6712                                  ":")
6713        #:tests? #f  ; FIXME: tests seem to require maven plugin
6714        #:modules ((guix build ant-build-system)
6715                   (guix build utils)
6716                   (srfi srfi-1))
6717        #:phases
6718        (modify-phases %standard-phases
6719          (add-after 'install 'bin-install
6720            (lambda* (#:key inputs outputs #:allow-other-keys)
6721              (let* ((out (assoc-ref outputs "out"))
6722                     (jar (string-append out "/share/java"))
6723                     (bin (string-append out "/bin")))
6724                (mkdir-p bin)
6725                (with-output-to-file (string-append bin "/antlr3")
6726                  (lambda _
6727                    (display
6728                     (string-append
6729                      "#!" (which "sh") "\n"
6730                      "java -cp " jar "/antlr3-3.3.jar:"
6731                      (string-join
6732                       (append (find-files (assoc-ref inputs "java-stringtemplate")
6733                                           ".*\\.jar$")
6734                               (find-files (string-append (assoc-ref inputs "antlr")
6735                                                          "/lib")
6736                                           ".*\\.jar$"))
6737                       ":")
6738                      " org.antlr.Tool $*"))))
6739                (chmod (string-append bin "/antlr3") #o755)
6740                #t)))
6741          (add-before 'build 'generate-grammar
6742            (lambda _
6743              (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java"
6744                (("import org.antlr.grammar.v2.\\*;")
6745                 "import org.antlr.grammar.v2.*;\n
6746 import org.antlr.grammar.v2.TreeToNFAConverter;\n
6747 import org.antlr.grammar.v2.DefineGrammarItemsWalker;\n
6748 import org.antlr.grammar.v2.ANTLRTreePrinter;"))
6749              (with-directory-excursion "tool/src/main/antlr2/org/antlr/grammar/v2/"
6750                (for-each (lambda (file)
6751                            (format #t "~a\n" file)
6752                            (invoke "antlr" file))
6753                          '("antlr.g" "antlr.print.g" "assign.types.g"
6754                            "buildnfa.g" "codegen.g" "define.g")))
6755              (with-directory-excursion "tool/src/main/antlr3/org/antlr/grammar/v3/"
6756                (for-each (lambda (file)
6757                            (format #t "~a\n" file)
6758                            (invoke "antlr3" file))
6759                          '("ActionAnalysis.g" "ActionTranslator.g" "ANTLRv3.g"
6760                            "ANTLRv3Tree.g")))
6761              #t))
6762          (add-before 'build 'fix-build-xml
6763            (lambda _
6764              (substitute* "build.xml"
6765                (("<exec") "<copy todir=\"${classes.dir}\">
6766 <fileset dir=\"tool/src/main/resources\">
6767 <include name=\"**/*.stg\"/>
6768 <include name=\"**/*.st\"/>
6769 <include name=\"**/*.sti\"/>
6770 <include name=\"**/STLexer.tokens\"/>
6771 </fileset>
6772 </copy><exec"))
6773              #t)))))
6774     (native-inputs
6775      `(("antlr" ,antlr2)
6776        ("antlr3" ,antlr3-3.1)))
6777     (inputs
6778      `(("junit" ,java-junit)))
6779     (propagated-inputs
6780      `(("java-stringtemplate" ,java-stringtemplate-3)
6781        ("antlr" ,antlr2)
6782        ("antlr3" ,antlr3-3.1)))))
6784 (define antlr3-3.1
6785   (package
6786     (inherit antlr3)
6787     (version "3.1")
6788     (source (origin
6789               (method url-fetch)
6790               (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
6791                                   "gh-pages/download/antlr-"
6792                                   version ".tar.gz"))
6793               (sha256
6794                (base32
6795                 "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z"))
6796               (patches
6797                (search-patches "antlr3-3_1-fix-java8-compilation.patch"))))
6798     (arguments
6799      `(#:jar-name (string-append "antlr3-" ,version ".jar")
6800        #:source-dir "src:runtime/Java/src"
6801        #:tests? #f
6802        #:phases
6803        (modify-phases %standard-phases
6804          (add-after 'install 'bin-install
6805            (lambda* (#:key inputs outputs #:allow-other-keys)
6806              (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
6807                    (bin (string-append (assoc-ref outputs "out") "/bin")))
6808                (mkdir-p bin)
6809                (with-output-to-file (string-append bin "/antlr3")
6810                  (lambda _
6811                    (display
6812                      (string-append "#!" (which "sh") "\n"
6813                                     "java -cp " jar "/antlr3-3.1.jar:"
6814                                     (string-concatenate
6815                                       (find-files (assoc-ref inputs "stringtemplate")
6816                                                   ".*\\.jar"))
6817                                     ":"
6818                                     (string-concatenate
6819                                       (find-files (string-append
6820                                                     (assoc-ref inputs "antlr")
6821                                                     "/lib")
6822                                                   ".*\\.jar"))
6823                                     " org.antlr.Tool $*"))))
6824                (chmod (string-append bin "/antlr3") #o755))
6825              #t))
6826          (add-before 'build 'generate-grammar
6827            (lambda _
6828              (let ((dir "src/org/antlr/tool/"))
6829                (for-each (lambda (file)
6830                            (display file)
6831                            (newline)
6832                            (invoke "antlr" "-o" dir (string-append dir file)))
6833                          '("antlr.g" "antlr.print.g" "assign.types.g"
6834                            "buildnfa.g" "define.g")))
6835              (format #t "codegen.g\n")
6836              (invoke "antlr" "-o" "src/org/antlr/codegen"
6837                      "src/org/antlr/codegen/codegen.g")
6838              #t))
6839          (add-before 'build 'fix-build-xml
6840            (lambda _
6841              (substitute* "build.xml"
6842                (("<exec") "<copy todir=\"${classes.dir}\">
6843 <fileset dir=\"src\">
6844 <include name=\"**/*.stg\"/>
6845 <include name=\"**/*.st\"/>
6846 <include name=\"**/*.sti\"/>
6847 <include name=\"**/STLexer.tokens\"/>
6848 </fileset>
6849 </copy><exec"))
6850              #t)))))
6851     (native-inputs
6852      `(("antlr" ,antlr2)))
6853     (inputs
6854      `(("junit" ,java-junit)))
6855     (propagated-inputs
6856      `(("stringtemplate" ,java-stringtemplate-3)))))
6858 (define-public java-commons-cli-1.2
6859   ;; This is a bootstrap dependency for Maven2.
6860   (package
6861     (inherit java-commons-cli)
6862     (version "1.2")
6863     (source (origin
6864               (method url-fetch)
6865               (uri (string-append "mirror://apache/commons/cli/source/"
6866                                   "commons-cli-" version "-src.tar.gz"))
6867               (sha256
6868                (base32
6869                 "0rvfgzgv2pc1m091dfj3ih9ddsjjppr1f1wf0qmc3bk6b1kwv2dm"))))
6870     (arguments
6871      `(#:jar-name "commons-cli.jar"
6872        #:phases
6873        (modify-phases %standard-phases
6874          (add-before 'check 'fix-build-xml
6875            (lambda* (#:key inputs #:allow-other-keys)
6876              (substitute* "build.xml"
6877                (("dir=\"\\$\\{test.home\\}/java\"")
6878                 "dir=\"${test.home}\""))
6879              #t)))))
6880     (native-inputs
6881      `(("java-junit" ,java-junit)))))
6883 (define-public java-microemulator-cldc
6884   (package
6885     (name "java-microemulator-cldc")
6886     (version "2.0.4")
6887     (source (origin
6888               (method url-fetch)
6889               (uri (string-append "https://github.com/barteo/microemu/archive/"
6890                                   "microemulator_"
6891                                   (string-map (lambda (c) (if (char=? c #\.) #\_ c))
6892                                               version)
6893                                   ".tar.gz"))
6894               (file-name (string-append name "-" version ".tar.gz"))
6895               (sha256
6896                (base32
6897                 "1x1apmz38gkppxnwnygwmi12j54v4p258v8ddzn6dldkk7vak1ll"))))
6898     (build-system ant-build-system)
6899     (arguments
6900      `(#:jar-name "microemulator-cldc.jar"
6901        #:source-dir "microemu-cldc/src/main/java"
6902        #:tests? #f)); Requires even older software
6903     (home-page "https://github.com/barteo/microemu")
6904     (synopsis "J2ME CLDC emulator")
6905     (description "Microemulator is a Java 2 Micro Edition (J2ME) CLDC/MIDP
6906 Emulator.  It allows to demonstrate MIDlet based applications in web browser
6907 applet and can be run as a standalone java application.")
6908     (license (list license:asl2.0
6909                    ;; or altenatively:
6910                    license:lgpl2.1+))))
6912 (define-public java-datanucleus-javax-persistence
6913   (package
6914     (name "java-datanucleus-javax-persistence")
6915     (version "2.2.0")
6916     (source (origin
6917               (method url-fetch)
6918               (uri (string-append "https://github.com/datanucleus/"
6919                                   "javax.persistence/archive/javax.persistence-"
6920                                   version "-release.tar.gz"))
6921               (sha256
6922                (base32
6923                 "11jx0fjwgc2hhbqqgdd6m1pf2fplf9vslppygax0y1z5csnqjhpx"))))
6924     (build-system ant-build-system)
6925     (arguments
6926      `(#:jar-name "java-datanucleus-javax-persistence.jar"
6927        #:jdk ,icedtea-8
6928        #:source-dir "src/main/java"
6929        #:tests? #f)); no tests
6930     (home-page "https://github.com/datanucleus/javax.persistence")
6931     (synopsis "JPA API")
6932     (description "This package contains a clean definition of JPA API intended
6933 for use with DataNucleus JPA since the JCP haven't provided an official JPA API
6934 jar.  See @url{http://java.net/projects/jpa-spec/downloads} for the specification
6935 used to generate this API.")
6936     (license (list license:edl1.0 license:epl1.0))))
6938 (define-public java-osgi-cmpn
6939   (package
6940     (name "java-osgi-cmpn")
6941     (version "6.0.0")
6942     (source (origin
6943               (method url-fetch)
6944               (uri (string-append "http://central.maven.org/maven2/"
6945                                   "org/osgi/osgi.cmpn/" version "/osgi.cmpn-"
6946                                   version "-sources.jar"))
6947               (sha256
6948                (base32
6949                 "1lmb6xyrmkqdhv1kayf0514rlwq6ypvs4m44ibrck3snp8241wys"))))
6950     (build-system ant-build-system)
6951     (arguments
6952      `(#:jar-name "osgi-cmpn.jar"
6953        #:tests? #f)); no tests
6954     (inputs
6955      `(("annotation" ,java-osgi-annotation)
6956        ("core" ,java-osgi-core)
6957        ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
6958        ("microemulator" ,java-microemulator-cldc)
6959        ("servlet" ,java-classpathx-servletapi)))
6960     (home-page "https://www.osgi.org")
6961     (synopsis "Compendium specification module of OSGi framework")
6962     (description
6963       "OSGi, for Open Services Gateway initiative framework, is a module system
6964 and service platform for the Java programming language.  This package contains
6965 the compendium specification module, providing interfaces and classes for use
6966 in compiling bundles.")
6967     (license license:asl2.0)))
6969 (define-public java-osgi-service-component-annotations
6970   (package
6971     (name "java-osgi-service-component-annotations")
6972     (version "1.3.0")
6973     (source (origin
6974               (method url-fetch)
6975               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
6976                                   "org.osgi.service.component.annotations/"
6977                                   version "/org.osgi.service.component.annotations-"
6978                                   version "-sources.jar"))
6979               (sha256
6980                (base32
6981                 "15rq9cmp4fpn74q44m4j35qsqmjf5lx3hcrk6pzvbhc08igic2f0"))))
6982     (build-system ant-build-system)
6983     (arguments
6984      `(#:jar-name "osgi-service-component-annotations.jar"
6985        #:tests? #f)); no tests
6986     (inputs
6987      `(("annotation" ,java-osgi-annotation)))
6988     (home-page "https://www.osgi.org")
6989     (synopsis "Support annotations for osgi-service-component")
6990     (description
6991       "OSGi, for Open Services Gateway initiative framework, is a module system
6992 and service platform for the Java programming language.  This package contains
6993 the support annotations for osgi-service-component.")
6994     (license license:asl2.0)))
6996 (define-public java-osgi-dto
6997   (package
6998     (name "java-osgi-dto")
6999     (version "1.0.0")
7000     (source (origin
7001               (method url-fetch)
7002               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
7003                                   "org.osgi.dto/" version "/org.osgi.dto-"
7004                                   version "-sources.jar"))
7005               (sha256
7006                (base32
7007                 "0f4bqjzadn0hwk6sd3h5gvbyfp3yci1s6r0v770cc15p0pg627yr"))))
7008     (build-system ant-build-system)
7009     (arguments
7010      `(#:jar-name "osgi-dto.jar"
7011        #:tests? #f)); no tests
7012     (inputs
7013      `(("annotation" ,java-osgi-annotation)))
7014     (home-page "https://www.osgi.org")
7015     (synopsis "Data Transfer Objects")
7016     (description
7017       "OSGi, for Open Services Gateway initiative framework, is a module system
7018 and service platform for the Java programming language.  This package contains
7019 the Data Transfer Objects.  It is easily serializable having only public fields
7020 of primitive types and their wrapper classes, Strings, and DTOs.  List, Set,
7021 Map and array aggregates may also be used.  The aggregates must only hold
7022 objects of the listed types or aggregates.")
7023     (license license:asl2.0)))
7025 (define-public java-osgi-resource
7026   (package
7027     (name "java-osgi-resource")
7028     (version "1.0.0")
7029     (source (origin
7030               (method url-fetch)
7031               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
7032                                   "org.osgi.resource/"
7033                                   version "/org.osgi.resource-"
7034                                   version "-sources.jar"))
7035               (sha256
7036                (base32
7037                 "0hi0fsc5v99q22bd7lrkvpz1y0ds4w9arjldpwsrcpqvz2js7q2d"))))
7038     (build-system ant-build-system)
7039     (arguments
7040      `(#:jar-name "osgi-resource.jar"
7041        #:tests? #f)); no tests
7042     (inputs
7043      `(("annotation" ,java-osgi-annotation)
7044        ("dto" ,java-osgi-dto)))
7045     (home-page "https://www.osgi.org")
7046     (synopsis "OSGI Resource")
7047     (description
7048       "OSGi, for Open Services Gateway initiative framework, is a module system
7049 and service platform for the Java programming language.  This package contains
7050 the definition of common types in osgi packages.")
7051     (license license:asl2.0)))
7053 (define-public java-osgi-namespace-contract
7054   (package
7055     (name "java-osgi-namespace-contract")
7056     (version "1.0.0")
7057     (source (origin
7058               (method url-fetch)
7059               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
7060                                   "org.osgi.namespace.contract/"
7061                                   version "/org.osgi.namespace.contract-"
7062                                   version "-sources.jar"))
7063               (sha256
7064                (base32
7065                 "1iz4f2i0fvqrlq90ki9nfzcfpvy2av434ri25bglywqssx8mmp36"))))
7066     (build-system ant-build-system)
7067     (inputs
7068      `(("resource" ,java-osgi-resource)
7069        ("annotation" ,java-osgi-annotation)))
7070     (arguments
7071      `(#:jar-name "osgi-namespace-contract.jar"
7072        #:tests? #f)); no tests
7073     (home-page "https://www.osgi.org")
7074     (synopsis "Contract Capability and Requirement Namespace")
7075     (description
7076       "OSGi, for Open Services Gateway initiative framework, is a module system
7077 and service platform for the Java programming language.  This package contains
7078 the names for the attributes and directives for a namespace with contracts.")
7079     (license license:asl2.0)))
7081 (define-public java-osgi-namespace-extender
7082   (package
7083     (name "java-osgi-namespace-extender")
7084     (version "1.0.1")
7085     (source (origin
7086               (method url-fetch)
7087               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
7088                                   "org.osgi.namespace.extender/"
7089                                   version "/org.osgi.namespace.extender-"
7090                                   version "-sources.jar"))
7091               (sha256
7092                (base32
7093                 "0jgqiak2i05qv6j3gd33xlaifzzc0ylxxk376v2x0apfg3vvixmz"))))
7094     (build-system ant-build-system)
7095     (inputs
7096      `(("resource" ,java-osgi-resource)
7097        ("annotation" ,java-osgi-annotation)))
7098     (arguments
7099      `(#:jar-name "osgi-namespace-extendent.jar"
7100        #:tests? #f)); no tests
7101     (home-page "https://www.osgi.org")
7102     (synopsis "Extender Capability and Requirement Namespace")
7103     (description
7104       "OSGi, for Open Services Gateway initiative framework, is a module system
7105 and service platform for the Java programming language.  This package contains
7106 the names for the attributes and directives for an extender namespace.")
7107     (license license:asl2.0)))
7109 (define-public java-osgi-namespace-service
7110   (package
7111     (name "java-osgi-namespace-service")
7112     (version "1.0.0")
7113     (source (origin
7114               (method url-fetch)
7115               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
7116                                   "org.osgi.namespace.service/"
7117                                   version "/org.osgi.namespace.service-"
7118                                   version "-sources.jar"))
7119               (sha256
7120                (base32
7121                 "0qmw8n2449nkmm56d1znz9zhazb6ya3vsimd5bf5jg23zzhgl8c8"))))
7122     (build-system ant-build-system)
7123     (inputs
7124      `(("resource" ,java-osgi-resource)
7125        ("annotation" ,java-osgi-annotation)))
7126     (arguments
7127      `(#:jar-name "osgi-namespace-service.jar"
7128        #:tests? #f)); no tests
7129     (home-page "https://www.osgi.org")
7130     (synopsis "Service Capability and Requirement Namespace")
7131     (description
7132       "OSGi, for Open Services Gateway initiative framework, is a module system
7133 and service platform for the Java programming language.  This package contains
7134 the names for the attributes and directives for a service namespace.")
7135     (license license:asl2.0)))
7137 (define-public java-osgi-util-function
7138   (package
7139     (name "java-osgi-util-function")
7140     (version "1.0.0")
7141     (source (origin
7142               (method url-fetch)
7143               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
7144                                   "org.osgi.util.function/"
7145                                   version "/org.osgi.util.function-"
7146                                   version "-sources.jar"))
7147               (sha256
7148                (base32
7149                 "04l7j3hwmmj28w23m7paca0afzncs42j2mdr3liqq8kvp548sc6x"))))
7150     (build-system ant-build-system)
7151     (arguments
7152      `(#:jar-name "osgi-util-function.jar"
7153        #:tests? #f)); no tests
7154     (inputs
7155      `(("annotation" ,java-osgi-annotation)))
7156     (home-page "https://www.osgi.org")
7157     (synopsis "OSGI Util Function")
7158     (description
7159       "OSGi, for Open Services Gateway initiative framework, is a module system
7160 and service platform for the Java programming language.  This package contains
7161 an interface for a function that accepts a single argument and produces a result.")
7162     (license license:asl2.0)))
7164 (define-public java-osgi-util-promise
7165   (package
7166     (name "java-osgi-util-promise")
7167     (version "1.0.0")
7168     (source (origin
7169               (method url-fetch)
7170               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
7171                                   "org.osgi.util.promise/"
7172                                   version "/org.osgi.util.promise-"
7173                                   version "-sources.jar"))
7174               (sha256
7175                (base32
7176                 "0y34dwiflg1c4ahvkswpf9z02xph2sr9fm04ia5493x3lshpw22c"))))
7177     (build-system ant-build-system)
7178     (arguments
7179      `(#:jar-name "osgi-util-promise.jar"
7180        #:tests? #f)); no tests
7181     (inputs
7182      `(("annotation" ,java-osgi-annotation)
7183        ("function" ,java-osgi-util-function)))
7184     (home-page "https://www.osgi.org")
7185     (synopsis "Promise of a value")
7186     (description
7187       "OSGi, for Open Services Gateway initiative framework, is a module system
7188 and service platform for the Java programming language.  This package contains
7189 an interface and utilitary classes for promises.  A Promise represents a future
7190 value.  It handles the interactions for asynchronous processing.")
7191     (license license:asl2.0)))
7193 (define-public java-osgi-service-metatype-annotations
7194   (package
7195     (name "java-osgi-service-metatype-annotations")
7196     (version "1.3.0")
7197     (source (origin
7198               (method url-fetch)
7199               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
7200                                   "org.osgi.service.metatype.annotations/"
7201                                   version "/org.osgi.service.metatype.annotations-"
7202                                   version "-sources.jar"))
7203               (sha256
7204                (base32
7205                 "12rwm3349wk80vm88rcdgs4435m4jxkpkj5mrx326skkz2c6hyw6"))))
7206     (build-system ant-build-system)
7207     (arguments
7208      `(#:jar-name "osgi-service-metatype-annotations.jar"
7209        #:tests? #f)); no tests
7210     (inputs
7211      `(("annotation" ,java-osgi-annotation)))
7212     (home-page "https://www.osgi.org")
7213     (synopsis "Support annotations for metatype")
7214     (description
7215       "OSGi, for Open Services Gateway initiative framework, is a module system
7216 and service platform for the Java programming language.  This package contains
7217 the support annotations for metatype.")
7218     (license license:asl2.0)))
7220 (define-public java-osgi-service-repository
7221   (package
7222     (name "java-osgi-service-repository")
7223     (version "1.1.0")
7224     (source (origin
7225               (method url-fetch)
7226               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
7227                                   "org.osgi.service.repository/"
7228                                   version "/org.osgi.service.repository-"
7229                                   version "-sources.jar"))
7230               (sha256
7231                (base32
7232                 "1k41mhg7b58pd8nsghr2qwcjrxdnf1p9spsw9v11k4257g6rl06n"))))
7233     (build-system ant-build-system)
7234     (arguments
7235      `(#:jar-name "osgi-service-repository.jar"
7236        #:tests? #f)); no tests
7237     (inputs
7238      `(("annotation" ,java-osgi-annotation)
7239        ("promise" ,java-osgi-util-promise)
7240        ("resource" ,java-osgi-resource)))
7241     (home-page "https://www.osgi.org")
7242     (synopsis "OSGI service repository")
7243     (description
7244       "OSGi, for Open Services Gateway initiative framework, is a module system
7245 and service platform for the Java programming language.  This package contains
7246 a repository service that contains resources.")
7247     (license license:asl2.0)))
7249 (define-public java-osgi-framework
7250   (package
7251     (name "java-osgi-framework")
7252     (version "1.8.0")
7253     (source (origin
7254               (method url-fetch)
7255               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
7256                                   "org.osgi.framework/" version "/org.osgi.framework-"
7257                                   version "-sources.jar"))
7258               (sha256
7259                (base32
7260                 "1lwp2zfad3rybcc6q9bwz8xsgkc92ypzy5p6x54387f1qj65m73s"))))
7261     (build-system ant-build-system)
7262     (arguments
7263      `(#:jar-name "osgi-framework.jar"
7264        #:tests? #f)); no tests
7265     (inputs
7266      `(("annotation" ,java-osgi-annotation)
7267        ("resource" ,java-osgi-resource)
7268        ("dto" ,java-osgi-dto)))
7269     (home-page "https://www.osgi.org")
7270     (synopsis "OSGi framework")
7271     (description
7272       "OSGi, for Open Services Gateway initiative framework, is a module system
7273 and service platform for the Java programming language.")
7274     (license license:asl2.0)))
7276 (define-public java-osgi-service-log
7277   (package
7278     (name "java-osgi-service-log")
7279     (version "1.3.0")
7280     (source (origin
7281               (method url-fetch)
7282               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
7283                                   "org.osgi.service.log/"
7284                                   version "/org.osgi.service.log-"
7285                                   version "-sources.jar"))
7286               (sha256
7287                (base32
7288                 "1029j30dzcwializzca0j3fkhwwz08kmmsha5agw1iccscimj6r0"))))
7289     (build-system ant-build-system)
7290     (arguments
7291      `(#:jar-name "osgi-service-log.jar"
7292        #:tests? #f)); no tests
7293     (inputs
7294      `(("java-osgi-framework" ,java-osgi-framework)))
7295     (home-page "https://www.osgi.org")
7296     (synopsis "Provides methods for bundles to write messages to the log")
7297     (description
7298       "OSGi, for Open Services Gateway initiative framework, is a module system
7299 and service platform for the Java programming language.  This package contains
7300 the log service.")
7301     (license license:asl2.0)))
7303 (define-public java-osgi-service-jdbc
7304   (package
7305     (name "java-osgi-service-jdbc")
7306     (version "1.0.0")
7307     (source (origin
7308               (method url-fetch)
7309               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
7310                                   "org.osgi.service.jdbc/"
7311                                   version "/org.osgi.service.jdbc-"
7312                                   version "-sources.jar"))
7313               (sha256
7314                (base32
7315                 "11iln5v7bk469cgb9ddkrz9sa95b3733gqgaqw9xf5g6wq652yjz"))))
7316     (build-system ant-build-system)
7317     (arguments
7318      `(#:jar-name "osgi-service-jdbc.jar"
7319        #:tests? #f)); no tests
7320     (home-page "https://www.osgi.org")
7321     (synopsis "Factory for JDBC connection factories")
7322     (description
7323       "OSGi, for Open Services Gateway initiative framework, is a module system
7324 and service platform for the Java programming language.  This package contains
7325 a factory for JDBC connection factories.  There are 3 preferred connection
7326 factories for getting JDBC connections:
7328 @itemize
7329 @item @code{javax.sql.DataSource};
7330 @item @code{javax.sql.ConnectionPoolDataSource};
7331 @item @code{javax.sql.XADataSource}.
7332 @end itemize")
7333     (license license:asl2.0)))
7335 (define-public java-osgi-service-resolver
7336   (package
7337     (name "java-osgi-service-resolver")
7338     (version "1.0.1")
7339     (source (origin
7340               (method url-fetch)
7341               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
7342                                   "org.osgi.service.resolver/"
7343                                   version "/org.osgi.service.resolver-"
7344                                   version "-sources.jar"))
7345               (sha256
7346                (base32
7347                 "1dzqn1ryfi2rq4zwsgp44bmj2wlfydjg1qbxw2b0z4xdjjy55vxd"))))
7348     (build-system ant-build-system)
7349     (arguments
7350      `(#:jar-name "osgi-service-resolver.jar"
7351        #:tests? #f)); no tests
7352     (inputs
7353      `(("annotation" ,java-osgi-annotation)
7354        ("resource" ,java-osgi-resource)))
7355     (home-page "https://www.osgi.org")
7356     (synopsis "OSGI Resolver service")
7357     (description
7358       "OSGi, for Open Services Gateway initiative framework, is a module system
7359 and service platform for the Java programming language.  This package contains
7360 a resolver service that resolves the specified resources in the context supplied
7361 by the caller.")
7362     (license license:asl2.0)))
7364 (define-public java-osgi-util-tracker
7365   (package
7366     (name "java-osgi-util-tracker")
7367     (version "1.5.1")
7368     (source (origin
7369               (method url-fetch)
7370               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
7371                                   "org.osgi.util.tracker/"
7372                                   version "/org.osgi.util.tracker-"
7373                                   version "-sources.jar"))
7374               (sha256
7375                (base32
7376                 "0c4fh9vxwzsx59r8dygda0gq2gx3z5vfhc3jsphlqwf5w0h403lz"))))
7377     (build-system ant-build-system)
7378     (arguments
7379      `(#:jar-name "osgi-util-tracker.jar"
7380        #:tests? #f)); no tests
7381     (inputs
7382      `(("framework" ,java-osgi-framework)
7383        ("annotation" ,java-osgi-annotation)))
7384     (home-page "https://www.osgi.org")
7385     (synopsis "Bundle tracking")
7386     (description
7387       "OSGi, for Open Services Gateway initiative framework, is a module system
7388 and service platform for the Java programming language.  This package contains
7389 bundle tracking utility classes.")
7390     (license license:asl2.0)))
7392 (define-public java-osgi-service-cm
7393   (package
7394     (name "java-osgi-service-cm")
7395     (version "1.5.0")
7396     (source (origin
7397               (method url-fetch)
7398               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
7399                                   "org.osgi.service.cm/"
7400                                   version "/org.osgi.service.cm-"
7401                                   version "-sources.jar"))
7402               (sha256
7403                (base32
7404                 "1z8kap48y3xi0ggj8v6czglfnpnd94mmismgi2wbqhj1nl5fzbp6"))))
7405     (build-system ant-build-system)
7406     (arguments
7407      `(#:jar-name "osgi-service-cm.jar"
7408        #:tests? #f)); no tests
7409     (inputs
7410      `(("framework" ,java-osgi-framework)
7411        ("annotation" ,java-osgi-annotation)))
7412     (home-page "https://www.osgi.org")
7413     (synopsis "OSGI Configuration Management")
7414     (description
7415       "OSGi, for Open Services Gateway initiative framework, is a module system
7416 and service platform for the Java programming language.  This package contains
7417 utility classes for the configuration of services.")
7418     (license license:asl2.0)))
7420 (define-public java-osgi-service-packageadmin
7421   (package
7422     (name "java-osgi-service-packageadmin")
7423     (version "1.2.0")
7424     (source (origin
7425               (method url-fetch)
7426               (uri (string-append "http://central.maven.org/maven2/org/osgi/"
7427                                   "org.osgi.service.packageadmin/"
7428                                   version "/org.osgi.service.packageadmin-"
7429                                   version "-sources.jar"))
7430               (sha256
7431                (base32
7432                 "041mpxzi7g36wmcily6y4ccn3jx15akpdy8gmhyb7m98x7qfvn52"))))
7433     (build-system ant-build-system)
7434     (arguments
7435      `(#:jar-name "osgi-service-packageadmin.jar"
7436        #:tests? #f)); no tests
7437     (inputs
7438      `(("framework" ,java-osgi-framework)))
7439     (home-page "https://www.osgi.org")
7440     (synopsis "OSGI Package Administration")
7441     (description
7442       "OSGi, for Open Services Gateway initiative framework, is a module system
7443 and service platform for the Java programming language.  This package contains
7444 the packageadmin service.")
7445     (license license:asl2.0)))
7447 (define-public java-ops4j-base-lang
7448   (package
7449     (name "java-ops4j-base-lang")
7450     (version "1.5.0")
7451     (source (origin
7452               (method url-fetch)
7453               (uri (string-append "https://github.com/ops4j/org.ops4j.base/"
7454                                   "archive/base-" version ".tar.gz"))
7455               (sha256
7456                (base32
7457                 "18hl3lpchgpv8yh5rlk39l2gif5dlfgb8gxjmncf39pr2dprkniw"))))
7458     (build-system ant-build-system)
7459     (arguments
7460      `(#:jar-name "java-ops4j-base-lang.jar"
7461        #:source-dir "ops4j-base-lang/src/main/java"
7462        #:tests? #f; no tests
7463        #:phases
7464        (modify-phases %standard-phases
7465          (add-before 'build 'add-test-file
7466            (lambda _
7467              ;; That file is required by a test in ops4j-pax-exam-core-spi
7468              (mkdir-p "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang")
7469              (with-output-to-file "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang/pom.properties"
7470                (lambda _
7471                  (display
7472                    (string-append
7473                      "version=" ,version "\n"
7474                      "groupId=org.ops4j.base"
7475                      "artifactId=ops4j-base-lang\n"))))
7476              #t)))))
7477     (home-page "https://ops4j1.jira.com/wiki/spaces/base/overview")
7478     (synopsis "Utility classes and extensions to be used in OPS4J projects")
7479     (description "OPS4J stands for Open Participation Software for Java.  This
7480 package contains utilities and extensions related to @code{java.lang}.")
7481     (license license:asl2.0)))
7483 (define-public java-ops4j-base-monitors
7484   (package
7485     (inherit java-ops4j-base-lang)
7486     (name "java-ops4j-base-monitors")
7487     (arguments
7488      `(#:jar-name "java-ops4j-base-monitors.jar"
7489        #:source-dir "ops4j-base-monitors/src/main/java"
7490        #:tests? #f)); no tests
7491     (inputs
7492      `(("lang" ,java-ops4j-base-lang)))
7493     (description "OPS4J stands for Open Participation Software for Java.  This
7494 package contains utilities and extensions related to monitoring.")))
7496 (define-public java-ops4j-base-io
7497   (package
7498     (inherit java-ops4j-base-lang)
7499     (name "java-ops4j-base-io")
7500     (arguments
7501      `(#:jar-name "java-ops4j-base-io.jar"
7502        #:source-dir "ops4j-base-io/src/main/java"
7503        #:test-dir "ops4j-base-io/src/test"
7504        #:test-exclude
7505        (list "**/ListerTest.java")))
7506     (inputs
7507      `(("lang" ,java-ops4j-base-monitors)
7508        ("lang" ,java-ops4j-base-lang)))
7509     (native-inputs
7510      `(("junit" ,java-junit)
7511        ("hamcrest" ,java-hamcrest-core)))
7512     (description "OPS4J stands for Open Participation Software for Java.  This
7513 package contains utilities and extensions related to handling streams and files.")))
7515 (define-public java-ops4j-base-util
7516   (package
7517     (inherit java-ops4j-base-lang)
7518     (name "java-ops4j-base-util")
7519     (arguments
7520      `(#:jar-name "java-ops4j-base-util.jar"
7521        #:source-dir "ops4j-base-util/src/main/java"
7522        #:test-dir "ops4j-base-util/src/test"))
7523     (inputs
7524      `(("lang" ,java-ops4j-base-lang)))
7525     (native-inputs
7526      `(("junit" ,java-junit)))
7527     (description "OPS4J stands for Open Participation Software for Java.  This
7528 package contains utilities and extensions related to environment, i18n and
7529 mime types.")))
7531 (define-public java-ops4j-base-util-property
7532   (package
7533     (inherit java-ops4j-base-lang)
7534     (name "java-ops4j-base-util-property")
7535     (arguments
7536      `(#:jar-name "java-ops4j-base-util-property.jar"
7537        #:source-dir "ops4j-base-util-property/src/main/java"
7538        #:tests? #f)); no tests
7539     (inputs
7540      `(("lang" ,java-ops4j-base-lang)
7541        ("util" ,java-ops4j-base-util)))
7542     (description "OPS4J stands for Open Participation Software for Java.  This
7543 package contains utilities and extensions related to resolving properties from
7544 different sources.")))
7546 (define-public java-ops4j-base-store
7547   (package
7548     (inherit java-ops4j-base-lang)
7549     (name "java-ops4j-base-store")
7550     (arguments
7551      `(#:jar-name "java-ops4j-base-store.jar"
7552        #:source-dir "ops4j-base-store/src/main/java"
7553        #:tests? #f)); no tests
7554     (inputs
7555      `(("lang" ,java-ops4j-base-lang)
7556        ("slf4j" ,java-slf4j-api)
7557        ("io" ,java-ops4j-base-io)))
7558     (description "OPS4J stands for Open Participation Software for Java.  This
7559 package contains utilities for storing and retrieving data from an
7560 @code{InputStream}.")))
7562 (define-public java-ops4j-base-spi
7563   (package
7564     (inherit java-ops4j-base-lang)
7565     (name "java-ops4j-base-spi")
7566     (arguments
7567      `(#:jar-name "java-ops4j-base-spi.jar"
7568        #:source-dir "ops4j-base-spi/src/main/java"
7569        #:test-dir "ops4j-base-spi/src/test"))
7570     (native-inputs
7571      `(("junit" ,java-junit)
7572        ("hamcrest" ,java-hamcrest-core)))
7573     (description "OPS4J stands for Open Participation Software for Java.  This
7574 package contains utilities for obtaining services via the Java SE 6
7575 @code{ServiceLoader}.")))
7577 (define-public java-aqute-bnd-annotation
7578   (package
7579     (name "java-aqute-bnd-annotation")
7580     (version "3.5.0")
7581     (source (origin
7582               (method url-fetch)
7583               (uri (string-append "https://github.com/bndtools/bnd/archive/"
7584                                   version ".REL.tar.gz"))
7585               (file-name (string-append name "-" version ".tar.gz"))
7586               (sha256
7587                (base32
7588                 "1ggyiq0as0f6cz333a0dh98j72kmvv5pf2s47v9554yh905lfqdl"))))
7589     (build-system ant-build-system)
7590     (arguments
7591      `(#:jar-name "java-aqute-bnd-annotation.jar"
7592        #:source-dir "biz.aQute.bnd.annotation/src"
7593        #:tests? #f)); empty test dir
7594     (home-page "http://bnd.bndtools.org/")
7595     (synopsis "Tools for OSGi")
7596     (description "Bnd is a swiss army knife for OSGi, it creates manifest
7597 headers based on analyzing the class code, it verifies the project settings,
7598 it manages project dependencies, gives diffs jars, and much more.")
7599     (license license:asl2.0)))
7601 (define-public java-aqute-libg
7602   (package
7603     (inherit java-aqute-bnd-annotation)
7604     (name "java-aqute-libg")
7605     (arguments
7606      `(#:jar-name "java-aqute-libg.jar"
7607        ;; The build fails when source/target more recent than 1.7. This
7608        ;; is a known issue. See: https://github.com/bndtools/bnd/issues/1327
7609        ;;
7610        ;; It is closed as won't fix. There is no way to change the source
7611        ;; so that it works on 1.8, and still works on 1.6, the upstream
7612        ;; target. It work fine on 1.7, so we use 1.7.
7613        #:make-flags (list "-Dant.build.javac.source=1.7"
7614                           "-Dant.build.javac.target=1.7")
7615        #:phases
7616        (modify-phases %standard-phases
7617          (add-before 'configure 'chdir
7618            ;; Change to aQute.libg directory, so that the relative
7619            ;; paths in the tests aren't broken.
7620            (lambda _
7621              (chdir "aQute.libg")
7622              #t))
7623          (add-before 'check 'create-test-directory
7624            ;; Copy the test directory to test/java, since that's where
7625            ;; ant-build-system's default project in build.xml expects to find
7626            ;; the test classes. Leave a copy in the original place to not
7627            ;; break paths in tests.
7628            (lambda _
7629              (mkdir "src/test")
7630              (copy-recursively "test" "src/test/java")
7631              #t)))))
7632     (inputs
7633      `(("slf4j" ,java-slf4j-api)
7634        ("osgi-annot" ,java-osgi-annotation)
7635        ("java-osgi-cmpn" ,java-osgi-cmpn)
7636        ("osgi" ,java-osgi-core)))
7637     (native-inputs
7638      `(("hamcrest" ,java-hamcrest-core)
7639        ("java-junit" ,java-junit)))))
7641 (define java-aqute-libg-bootstrap
7642   (package
7643     (inherit java-aqute-libg)
7644     (name "java-aqute-libg-bootstrap")
7645     (arguments
7646      ;; Disable tests, at this stage of bootstrap we have no test frameworks.
7647      (substitute-keyword-arguments (package-arguments java-aqute-libg)
7648        ((#:tests? _ #f) #f)))
7649     (inputs
7650      `(("slf4j-bootstrap" ,java-slf4j-api-bootstrap)
7651        ,@(delete `("slf4j" ,java-slf4j-api)
7652                  (package-inputs java-aqute-libg))))
7653     (native-inputs '())))
7655 (define-public java-aqute-bndlib
7656   (package
7657     (inherit java-aqute-bnd-annotation)
7658     (name "java-aqute-bndlib")
7659     (arguments
7660      `(#:jar-name "java-bndlib.jar"
7661        #:source-dir "biz.aQute.bndlib/src"
7662        #:tests? #f)); no tests
7663     (inputs
7664      `(("slf4j" ,java-slf4j-api)
7665        ("osgi-annot" ,java-osgi-annotation)
7666        ("java-aqute-libg" ,java-aqute-libg)
7667        ("java-aqute-bnd-annotation" ,java-aqute-bnd-annotation)
7668        ("java-osgi-service-component-annotations" ,java-osgi-service-component-annotations)
7669        ("java-osgi-service-repository" ,java-osgi-service-repository)
7670        ("java-osgi-service-log" ,java-osgi-service-log)
7671        ("java-osgi-service-metatype-annotations" ,java-osgi-service-metatype-annotations)
7672        ("java-osgi-namespace-contract" ,java-osgi-namespace-contract)
7673        ("java-osgi-namespace-extender" ,java-osgi-namespace-extender)
7674        ("java-osgi-namespace-service" ,java-osgi-namespace-service)
7675        ("promise" ,java-osgi-util-promise)
7676        ("osgi" ,java-osgi-core)))))
7678 (define java-aqute-bndlib-bootstrap
7679   (package
7680     (inherit java-aqute-bndlib)
7681     (name "java-aqute-bndlib-bootstrap")
7682     (inputs
7683      `(("slf4j-bootstrap" ,java-slf4j-api-bootstrap)
7684        ("java-aqute-libg-bootstrap" ,java-aqute-libg-bootstrap)
7685        ,@(delete `("slf4j" ,java-slf4j-api)
7686                  (delete `("java-aqute-libg" ,java-aqute-libg)
7687                          (package-inputs java-aqute-bndlib)))))))
7689 (define-public java-ops4j-pax-tinybundles
7690   (package
7691     (name "java-ops4j-pax-tinybundles")
7692     (version "2.1.1")
7693     (source (origin
7694               (method url-fetch)
7695               (uri (string-append "https://github.com/ops4j/org.ops4j.pax.tinybundles/"
7696                                   "archive/tinybundles-" version ".tar.gz"))
7697               (sha256
7698                (base32
7699                 "0y0gq3pvv0iir2b885lmlwnvr724vv7vklzhhr4fs27d7mdkj871"))))
7700     (arguments
7701      `(#:jar-name "java-ops4j-pax-tinybundles.jar"
7702        #:source-dir "src/main/java"
7703        #:test-exclude
7704        ;; Abstract base classes for other tests
7705        (list "**/BndTest.java" "**/CoreTest.java")
7706        #:phases
7707        (modify-phases %standard-phases
7708          (add-before 'check 'fix-version
7709            (lambda _
7710              ;; This test has a reference to an old version of bndlib we are not
7711              ;; packaging.  It uses the version referenced in pom.xml.  We replace
7712              ;; it with our own version.
7713              (substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
7714                (("[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*")
7715                 ,(package-version java-aqute-bndlib)))
7716              #t)))))
7717     (inputs
7718      `(("lang" ,java-ops4j-base-lang)
7719        ("io" ,java-ops4j-base-io)
7720        ("store" ,java-ops4j-base-store)
7721        ("slf4j" ,java-slf4j-api)
7722        ("libg" ,java-aqute-libg)
7723        ("bndlib" ,java-aqute-bndlib)))
7724     (native-inputs
7725      `(("junit" ,java-junit)
7726        ("hamcrest" ,java-hamcrest-core)
7727        ("log4j" ,java-log4j-api)
7728        ("bndannotation" ,java-aqute-bnd-annotation)
7729        ("framework" ,java-osgi-framework)))
7730     (build-system ant-build-system)
7731     (home-page "https://ops4j1.jira.com/wiki/spaces/ops4j/pages/12060312/Tinybundles")
7732     (synopsis "Java APIs to create OSGi related artifacts")
7733     (description "Tinybundles is all about creating OSGi related artifacts like
7734 Bundles, Fragments and Deployment Packages with Java Api.  It is very convenient
7735 to create such artifacts on-the-fly inside Tests (like in Pax Exam).  On the
7736 other hand, this library can be a foundation of real end user tools that need
7737 to create those artifacts.")
7738     (license license:asl2.0)))
7740 (define-public java-ops4j-pax-exam-core
7741   (package
7742     (name "java-ops4j-pax-exam-core")
7743     (version "4.11.0")
7744     (source (origin
7745               (method url-fetch)
7746               (uri (string-append "https://github.com/ops4j/org.ops4j.pax.exam2/"
7747                                   "archive/exam-reactor-" version ".tar.gz"))
7748               (sha256
7749                (base32
7750                 "08mzw8nkah3rj3vznlplnawspxhp61zgvb44ifqa1rni1cvbms2g"))))
7751     (arguments
7752      `(#:jar-name "java-ops4j-pax-exam-core.jar"
7753        #:source-dir "core/pax-exam/src/main/java"
7754        #:test-dir "core/pax-exam/src/test"))
7755     (inputs
7756      `(("slf4j" ,java-slf4j-api)
7757        ("lang" ,java-ops4j-base-lang)
7758        ("io" ,java-ops4j-base-io)
7759        ("util-property" ,java-ops4j-base-util-property)
7760        ("util-store" ,java-ops4j-base-store)
7761        ("java-osgi-core" ,java-osgi-core)))
7762     (native-inputs
7763      `(("junit" ,java-junit)
7764        ("hamcrest" ,java-hamcrest-core)))
7765     (build-system ant-build-system)
7766     (home-page "https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/overview")
7767     (synopsis "In-Container Testing for OSGi, Java EE and CDI")
7768     (description "Pax Exam creates OSGi bundles for testing purposes.  It lets
7769 the user take control of the OSGi framework, the test framework (e.g. JUnit) and
7770 the system under test at the same time.")
7771     (license license:asl2.0)))
7773 (define-public java-ops4j-pax-exam-core-spi
7774   (package
7775     (inherit java-ops4j-pax-exam-core)
7776     (name "java-ops4j-pax-exam-core-spi")
7777     (arguments
7778      `(#:jar-name "java-ops4j-pax-exam-spi.jar"
7779        #:source-dir "src/main/java"
7780        #:test-exclude
7781        (list
7782          ;; Abstract base class, not a test
7783          "**/BaseStagedReactorTest.java"
7784          ;; Depends on org.mortbay.jetty.testwars:test-war-dump
7785          "**/WarBuilderTest.java")
7786        #:phases
7787        (modify-phases %standard-phases
7788          (add-before 'configure 'chdir
7789            (lambda _
7790              ;; Tests assume we are in this directory
7791              (chdir "core/pax-exam-spi")
7792              #t))
7793          (add-before 'check 'fix-tests
7794            (lambda _
7795              ;; One test checks that this file is present.
7796              (mkdir-p "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi")
7797              (with-output-to-file
7798                "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi/pom.properties"
7799                (lambda _
7800                  (display
7801                    (string-append "artifactId = pax-exam-spi\n"
7802                                   "version = " ,(package-version java-ops4j-pax-exam-core-spi)))))
7803              ;; Maven puts compilation results in the target directory, while we
7804              ;; put them in the build directory.
7805              (substitute* '("src/test/java/org/ops4j/pax/exam/spi/war/WarBuilderTest.java"
7806                             "src/test/java/org/ops4j/pax/exam/spi/war/WarTestProbeBuilderTest.java"
7807                             "src/test/java/org/ops4j/pax/exam/spi/war/ZipBuilderTest.java")
7808                (("target") "build"))
7809              ;; One test is expected to fail, but it doesn't throw the expected exception
7810              (substitute* "src/test/java/org/ops4j/pax/exam/spi/reactors/BaseStagedReactorTest.java"
7811                (("AssertionError") "IllegalArgumentException"))
7812              #t)))))
7813     (inputs
7814      `(("java-ops4j-pax-exam-core" ,java-ops4j-pax-exam-core)
7815        ("lang" ,java-ops4j-base-lang)
7816        ("monitors" ,java-ops4j-base-monitors)
7817        ("store" ,java-ops4j-base-store)
7818        ("io" ,java-ops4j-base-io)
7819        ("spi" ,java-ops4j-base-spi)
7820        ("osgi" ,java-osgi-core)
7821        ("slf4j" ,java-slf4j-api)
7822        ("tinybundles" ,java-ops4j-pax-tinybundles)))
7823     (native-inputs
7824      `(("mockito" ,java-mockito-1)
7825        ("junit" ,java-junit)
7826        ("hamcrest" ,java-hamcrest-core)
7827        ("cglib" ,java-cglib)
7828        ("objenesis" ,java-objenesis)
7829        ("asm" ,java-asm)))))
7831 (define-public java-ops4j-pax-exam-core-junit
7832   (package
7833     (inherit java-ops4j-pax-exam-core)
7834     (name "java-ops4j-pax-exam-core-junit")
7835     (arguments
7836      `(#:jar-name "ops4j-pax-exam-core-junit.jar"
7837        #:source-dir "drivers/pax-exam-junit4/src/main/java"
7838        #:tests? #f)); no tests
7839     (inputs
7840      `(("junit" ,java-junit)
7841        ("slf4j" ,java-slf4j-api)
7842        ("core" ,java-ops4j-pax-exam-core)
7843        ("spi" ,java-ops4j-pax-exam-core-spi)))
7844     (native-inputs '())))
7846 (define-public java-fasterxml-jackson-annotations
7847   (package
7848     (name "java-fasterxml-jackson-annotations")
7849     (version "2.9.4")
7850     (source (origin
7851               (method url-fetch)
7852               (uri (string-append "https://github.com/FasterXML/"
7853                                   "jackson-annotations/archive/"
7854                                   "jackson-annotations-" version ".tar.gz"))
7855               (sha256
7856                (base32
7857                 "0mr95xd0da6a4g95zvrl1ryk5n5zv2rc696w3xnsr5hxk2gicfc4"))))
7858     (build-system ant-build-system)
7859     (arguments
7860      `(#:jar-name "jackson-annotations.jar"
7861        #:source-dir "src/main/java"
7862        #:test-dir "src/test"))
7863     (native-inputs
7864      `(("junit" ,java-junit)))
7865     (home-page "https://github.com/FasterXML/jackson-annotations")
7866     (synopsis "General purpose annotations for the Jackson Data Processor")
7867     (description "This package contains general purpose annotations for the
7868 Jackson Data Processor, used on value and handler types.  The only annotations
7869 not included are ones that require dependency to the Databind package.")
7870     (license license:asl2.0)))
7872 (define-public java-fasterxml-jackson-core
7873   (package
7874     (name "java-fasterxml-jackson-core")
7875     (version "2.9.4")
7876     (source (origin
7877               (method url-fetch)
7878               (uri (string-append "https://github.com/FasterXML/"
7879                                   "jackson-core/archive/"
7880                                   "jackson-core-" version ".tar.gz"))
7881               (sha256
7882                (base32
7883                 "159hsnk17jr1gyzkf01cxvsn45srnk37g949r7364qlsr527gjgd"))))
7884     (build-system ant-build-system)
7885     (arguments
7886      `(#:jar-name "jackson-core.jar"
7887        #:source-dir "src/main/java"
7888        #:test-dir "src/test"
7889        #:test-exclude
7890        (list
7891          ;; Expected failure.  pom.xml excludes these
7892          "**/failing/**"
7893          ;; Base classes that have no constructor for junit
7894          "**/BaseTest.java"
7895          "**/ConcurrencyReadTest.java"
7896          "**/ManualCharAccessTest.java"
7897          "**/ManualCharAccessTest.java"
7898          "**/TrailingCommasTest.java"
7899          "**/AsyncMissingValuesInObjectTest.java"
7900          "**/AsyncMissingValuesInArrayTest.java")
7901        #:phases
7902        (modify-phases %standard-phases
7903          (add-before 'configure 'generate-PackageVersion.java
7904            (lambda _
7905              (let* ((out "src/main/java/com/fasterxml/jackson/core/json/PackageVersion.java")
7906                     (in (string-append out ".in")))
7907                (copy-file in out)
7908                (substitute* out
7909                  (("@package@") "com.fasterxml.jackson.core.json")
7910                  (("@projectversion@") ,version)
7911                  (("@projectgroupid@") "com.fasterxml.jackson.core")
7912                  (("@projectartifactid@") "jackson-core")))
7913              #t))
7914          (add-before 'build 'copy-resources
7915            (lambda _
7916              (copy-recursively "src/main/resources"
7917                                "build/classes")
7918              #t))
7919          (add-before 'check 'copy-test-resources
7920            (lambda _
7921              (copy-recursively "src/test/resources"
7922                                "build/test-classes")
7923              #t)))))
7924     (native-inputs
7925      `(("junit" ,java-junit)
7926        ("hamcrest" ,java-hamcrest-core)))
7927     (home-page "https://github.com/FasterXML/jackson-core")
7928     (synopsis "")
7929     (description "")
7930     (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
7932 (define-public java-fasterxml-jackson-databind
7933   (package
7934     (name "java-fasterxml-jackson-databind")
7935     (version "2.9.4")
7936     (source (origin
7937               (method url-fetch)
7938               (uri (string-append "https://github.com/FasterXML/"
7939                                   "jackson-databind/archive/"
7940                                   "jackson-databind-" version ".tar.gz"))
7941               (sha256
7942                (base32
7943                 "1zd2cw4z6kdkbx8za96xh9pyicv2a2l7y0rkcx2fqd8hv6d47s08"))))
7944     (build-system ant-build-system)
7945     (arguments
7946      `(#:jar-name "jackson-databind.jar"
7947        #:source-dir "src/main/java"
7948        #:tests? #f; requires javax.measures for which I can't find a free implementation
7949        #:phases
7950        (modify-phases %standard-phases
7951          (add-before 'configure 'generate-PackageVersion.java
7952            (lambda _
7953              (let* ((out "src/main/java/com/fasterxml/jackson/databind/cfg/PackageVersion.java")
7954                     (in (string-append out ".in")))
7955                (copy-file in out)
7956                (substitute* out
7957                  (("@package@") "com.fasterxml.jackson.databind.cfg")
7958                  (("@projectversion@") ,version)
7959                  (("@projectgroupid@") "com.fasterxml.jackson.databind")
7960                  (("@projectartifactid@") "jackson-databind")))
7961              #t))
7962          (add-before 'build 'copy-resources
7963            (lambda _
7964              (copy-recursively "src/main/resources" "build/classes")
7965              #t)))))
7966     (inputs
7967      `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
7968        ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)))
7969     (home-page "https://github.com/FasterXML/jackson-databind")
7970     (synopsis "Data-binding functionality and tree-model for the Jackson Data Processor")
7971     (description "This package contains the general-purpose data-binding
7972 functionality and tree-model for Jackson Data Processor.  It builds on core
7973 streaming parser/generator package, and uses Jackson Annotations for
7974 configuration.")
7975     (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
7977 (define-public java-fasterxml-jackson-modules-base-jaxb
7978   (package
7979     (name "java-fasterxml-jackson-modules-base-jaxb")
7980     (version "2.9.4")
7981     (source (origin
7982               (method url-fetch)
7983               (uri (string-append "https://github.com/FasterXML/"
7984                                   "jackson-modules-base/archive/"
7985                                   "jackson-modules-base-" version ".tar.gz"))
7986               (sha256
7987                (base32
7988                 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
7989     (build-system ant-build-system)
7990     (arguments
7991      `(#:jar-name "jackson-modules-base-jaxb.jar"
7992        #:source-dir "jaxb/src/main/java"
7993        #:test-dir "jaxb/src/test"
7994        #:test-exclude
7995        ;; Base class for tests
7996        (list "**/BaseJaxbTest.java")
7997        #:phases
7998        (modify-phases %standard-phases
7999          (add-before 'configure 'generate-PackageVersion.java
8000            (lambda _
8001              (let* ((out (string-append "jaxb/src/main/java/com/fasterxml/"
8002                                         "jackson/module/jaxb/PackageVersion.java"))
8003                     (in (string-append out ".in")))
8004                (copy-file in out)
8005                (substitute* out
8006                  (("@package@") "com.fasterxml.jackson.module.jaxb")
8007                  (("@projectversion@") ,version)
8008                  (("@projectgroupid@") "com.fasterxml.jackson.module.jaxb")
8009                  (("@projectartifactid@") "jackson-module-jaxb")))
8010              #t))
8011          (add-before 'build 'copy-resources
8012            (lambda _
8013              (copy-recursively "jaxb/src/main/resources" "build/classes")
8014              #t)))))
8015     (inputs
8016      `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
8017        ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
8018        ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)))
8019     (native-inputs
8020      `(("java-junit" ,java-junit)))
8021     (home-page "https://github.com/FasterXML/jackson-modules-base")
8022     (synopsis "Jaxb annotations jackson module")
8023     (description "This package is the jaxb annotations module for jackson.")
8024     (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
8026 (define-public java-fasterxml-jackson-modules-base-mrbean
8027   (package
8028     (name "java-fasterxml-jackson-modules-base-mrbean")
8029     (version "2.9.4")
8030     (source (origin
8031               (method url-fetch)
8032               (uri (string-append "https://github.com/FasterXML/"
8033                                   "jackson-modules-base/archive/"
8034                                   "jackson-modules-base-" version ".tar.gz"))
8035               (sha256
8036                (base32
8037                 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
8038     (build-system ant-build-system)
8039     (arguments
8040      `(#:jar-name "jackson-modules-base-mrbean.jar"
8041        #:source-dir "mrbean/src/main/java"
8042        #:test-dir "mrbean/src/test"
8043        #:test-exclude
8044        ;; Base class for tests
8045        (list "**/BaseTest.java")
8046        #:phases
8047        (modify-phases %standard-phases
8048          (add-before 'configure 'generate-PackageVersion.java
8049            (lambda _
8050              (let* ((out (string-append "mrbean/src/main/java/com/fasterxml/"
8051                                         "jackson/module/mrbean/PackageVersion.java"))
8052                     (in (string-append out ".in")))
8053                (copy-file in out)
8054                (substitute* out
8055                  (("@package@") "com.fasterxml.jackson.module.mrbean")
8056                  (("@projectversion@") ,version)
8057                  (("@projectgroupid@") "com.fasterxml.jackson.module.mrbean")
8058                  (("@projectartifactid@") "jackson-module-mrbean")))
8059              #t)))))
8060     (inputs
8061      `(("java-asm" ,java-asm)
8062        ("java-fasterxml-jackson-annotations"
8063         ,java-fasterxml-jackson-annotations)
8064        ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
8065        ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)))
8066     (native-inputs
8067      `(("java-junit" ,java-junit)))
8068     (home-page "https://github.com/FasterXML/jackson-modules-base")
8069     (synopsis "POJO type materialization for Java")
8070     (description "This package implements POJO type materialization.
8071 Databinders can construct implementation classes for Java interfaces as part
8072 of deserialization.")
8073     (license license:asl2.0)))
8075 (define-public java-snakeyaml
8076   (package
8077     (name "java-snakeyaml")
8078     (version "1.18")
8079     (source (origin
8080               (method url-fetch)
8081               (uri (string-append "https://bitbucket.org/asomov/snakeyaml/get/v"
8082                                   version ".tar.gz"))
8083               (file-name (string-append name "-" version ".tar.gz"))
8084               (sha256
8085                (base32
8086                 "0rf5ha6w0waz50jz2479jsrbgmd0dnx0gs337m126j5z7zlmg7mg"))))
8087     (build-system ant-build-system)
8088     (arguments
8089      `(#:jar-name "java-snakeyaml.jar"
8090        #:source-dir "src/main/java"
8091        ;; Tests require velocity, a cyclic dependency, and
8092        ;; java-spring-framework-context which is not packaged.
8093        #:tests? #f))
8094     (home-page "https://bitbucket.org/asomov/snakeyaml")
8095     (synopsis "YAML processor")
8096     (description "SnakeYAML is a YAML processor for the Java Virtual Machine.")
8097     (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
8099 (define-public java-fasterxml-jackson-dataformat-yaml
8100   (package
8101     (name "java-fasterxml-jackson-dataformat-yaml")
8102     (version "2.9.4")
8103     (source (origin
8104               (method url-fetch)
8105               (uri (string-append "https://github.com/FasterXML/"
8106                                   "jackson-dataformats-text/archive/"
8107                                   "jackson-dataformats-text-" version ".tar.gz"))
8108               (sha256
8109                (base32
8110                 "1hikl06khaxbg439avf442qifcadap8w0lx13f0nnhp2vh3dkbz7"))))
8111     (build-system ant-build-system)
8112     (arguments
8113      `(#:jar-name "jackson-dataformat-yaml.jar"
8114        #:source-dir "yaml/src/main/java"
8115        #:test-dir "yaml/src/test"
8116        #:test-exclude (list "**/failing/**.java")
8117        #:phases
8118        (modify-phases %standard-phases
8119          (add-before 'configure 'generate-PackageVersion.java
8120            (lambda _
8121              (let* ((out "yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/PackageVersion.java")
8122                     (in (string-append out ".in")))
8123                (copy-file in out)
8124                (substitute* out
8125                  (("@package@") "com.fasterxml.jackson.dataformat.yaml")
8126                  (("@projectversion@") ,version)
8127                  (("@projectgroupid@") "com.fasterxml.jackson.dataformat.yaml")
8128                  (("@projectartifactid@") "jackson-dataformat-yaml")))
8129              #t)))))
8130     (inputs
8131      `(("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
8132        ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
8133        ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
8134        ("java-snakeyaml" ,java-snakeyaml)))
8135     (native-inputs
8136      `(("junit" ,java-junit)
8137        ("hamcrest" ,java-hamcrest-core)
8138        ("java-ops4j-pax-exam-core-spi" ,java-ops4j-pax-exam-core-spi)
8139        ("java-ops4j-pax-exam-core-junit" ,java-ops4j-pax-exam-core-junit)
8140        ("java-ops4j-pax-exam" ,java-ops4j-pax-exam-core)))
8141     (home-page "https://github.com/FasterXML/jackson-dataformats-text")
8142     (synopsis "Yaml backend for Jackson")
8143     (description "Dataformat backends are used to support format alternatives
8144 to JSON, supported by default.  This is done by sub-classing Jackson core
8145 abstractions.")
8146     (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
8148 (define-public java-stax2-api
8149   (package
8150     (name "java-stax2-api")
8151     (version "4.0.0")
8152     (source (origin
8153               (method url-fetch)
8154               (uri (string-append "https://github.com/FasterXML/stax2-api/archive/"
8155                                   "stax2-api-" version ".tar.gz"))
8156               (sha256
8157                (base32
8158                 "1amc1si0l0hyyw2sawmnzy4hkna3z6fp195y4nm5m9wb9ld5awkq"))))
8159     (build-system ant-build-system)
8160     (arguments
8161      `(#:jar-name "java-stax2-api.jar"
8162        #:source-dir "src/main/java"
8163        #:tests? #f)); no tests
8164     (home-page "https://github.com/FasterXML/stax2-api")
8165     (synopsis "Stax2 API")
8166     (description "Stax2 API is an extension to basic Stax 1.0 API that adds
8167 significant new functionalities, such as full-featured bi-direction validation
8168 interface and high-performance Typed Access API.")
8169     (license license:bsd-2)))
8171 (define-public java-woodstox-core
8172   (package
8173     (name "java-woodstox-core")
8174     (version "5.0.3")
8175     (source (origin
8176               (method url-fetch)
8177               (uri (string-append "https://github.com/FasterXML/woodstox/archive/"
8178                                   "woodstox-core-" version ".tar.gz"))
8179               (sha256
8180                (base32
8181                 "1i7pdgb8jbw6gdy5kmm0l6rz109n2ns92pqalpyp24vb8vlvdfd4"))))
8182     (build-system ant-build-system)
8183     (arguments
8184      `(#:jar-name "woodstox.jar"
8185        #:test-exclude
8186        (list "**/Base*.java" "failing/**")
8187        #:phases
8188        (modify-phases %standard-phases
8189          (add-before 'build 'remove-msv-dep
8190            (lambda _
8191              ;; we don't need osgi, and it depends on msv
8192              (delete-file-recursively "src/main/java/com/ctc/wstx/osgi")
8193              ;; msv's latest release is from 2011 and we don't need it
8194              (delete-file-recursively "src/main/java/com/ctc/wstx/msv")
8195              (delete-file-recursively "src/test/java/wstxtest/osgi")
8196              (delete-file-recursively "src/test/java/wstxtest/msv")
8197              #t))
8198          (add-before 'build 'copy-resources
8199            (lambda _
8200              (copy-recursively "src/main/resources" "build/classes")
8201              #t)))))
8202     (inputs
8203      `(("stax2" ,java-stax2-api)))
8204     (native-inputs
8205      `(("junit" ,java-junit)))
8206     (home-page "https://github.com/FasterXML/woodstox")
8207     (synopsis "Stax XML API implementation")
8208     (description "Woodstox is a stax XML API implementation.")
8209     (license license:asl2.0)))
8211 (define-public java-fasterxml-jackson-dataformat-xml
8212   (package
8213     (name "java-fasterxml-jackson-dataformat-xml")
8214     (version "2.9.4")
8215     (source (origin
8216               (method url-fetch)
8217               (uri (string-append "https://github.com/FasterXML/"
8218                                   "jackson-dataformat-xml/archive/"
8219                                   "jackson-dataformat-xml-" version ".tar.gz"))
8220               (sha256
8221                (base32
8222                 "111fkkl90w31jbf30kgj82qdcxlw4sxppki7i198liw0ck1jcavq"))))
8223     (build-system ant-build-system)
8224     (arguments
8225      `(#:jar-name "jackson-dataformat-xml.jar"
8226        #:source-dir "src/main/java"
8227        #:test-exclude
8228        (list "**/failing/**")
8229        #:phases
8230        (modify-phases %standard-phases
8231          (add-before 'configure 'generate-PackageVersion.java
8232            (lambda _
8233              (let* ((out "src/main/java/com/fasterxml/jackson/dataformat/xml/PackageVersion.java")
8234                     (in (string-append out ".in")))
8235                (copy-file in out)
8236                (newline)
8237                (substitute* out
8238                  (("@package@") "com.fasterxml.jackson.dataformat.xml")
8239                  (("@projectversion@") ,version)
8240                  (("@projectgroupid@") "com.fasterxml.jackson.dataformat.xml")
8241                  (("@projectartifactid@") "jackson-dataformat-xml")))
8242              #t))
8243          (add-before 'build 'copy-resources
8244            (lambda _
8245              (copy-recursively "src/main/resources" "build/classes")
8246              #t)))))
8247     (inputs
8248      `(("jackson-annotations" ,java-fasterxml-jackson-annotations)
8249        ("jackson-core" ,java-fasterxml-jackson-core)
8250        ("jackson-modules-base-jaxb" ,java-fasterxml-jackson-modules-base-jaxb)
8251        ("jackson-databind" ,java-fasterxml-jackson-databind)
8252        ("stax2-api" ,java-stax2-api)
8253        ("woodstox" ,java-woodstox-core)))
8254     (native-inputs
8255      `(("junit" ,java-junit)
8256        ("hamcrest" ,java-hamcrest-core)))
8257     (home-page "https://github.com/FasterXML/jackson-dataformat-xml")
8258     (synopsis "Read and write XML")
8259     (description "This package contains Jackson extension component for reading
8260 and writing XML encoded data.
8262 Further, the goal is to emulate how JAXB data-binding works with \"Code-first\"
8263 approach (that is, no support is added for \"Schema-first\" approach).  Support
8264 for JAXB annotations is provided by JAXB annotation module; this module
8265 provides low-level abstractions (@code{JsonParser}, @code{JsonGenerator},
8266 @code{JsonFactory}) as well as small number of higher level overrides needed to
8267 make data-binding work.")
8268     (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
8270 (define-public java-hdrhistogram
8271   (package
8272     (name "java-hdrhistogram")
8273     (version "2.1.9")
8274     (source (origin
8275               (method url-fetch)
8276               (uri (string-append "https://github.com/HdrHistogram/HdrHistogram/"
8277                                   "archive/HdrHistogram-" version ".tar.gz"))
8278               (sha256
8279                (base32
8280                 "1sicbmc3sr42nw93qbkb26q9rn33ag33k6k77phjc3j5h5gjffqv"))))
8281     (build-system ant-build-system)
8282     (arguments
8283      `(#:jar-name "java-hdrhistogram.jar"
8284        #:source-dir "src/main/java"
8285        #:phases
8286        (modify-phases %standard-phases
8287          (add-before 'configure 'set-version
8288            (lambda _
8289              (let* ((version-java "src/main/java/org/HdrHistogram/Version.java")
8290                     (template (string-append version-java ".template")))
8291                (copy-file template version-java)
8292                (substitute* version-java
8293                  (("\\$VERSION\\$") ,version)
8294                  (("\\$BUILD_TIME\\$") "0"))
8295                #t))))))
8296     (native-inputs
8297      `(("junit" ,java-junit)
8298        ("hamcrest" ,java-hamcrest-core)))
8299     (home-page "https://hdrhistogram.github.io/HdrHistogram")
8300     (synopsis "High dynamic range histogram")
8301     (description "Hdrhistogram allows to create histograms that support
8302 recording and analyzing sampled data value counts across a configurable integer
8303 value range with configurable value precision within the range.  Value precision
8304 is expressed as the number of significant digits in the value recording, and
8305 provides control over value quantization behavior across the value range and
8306 the subsequent value resolution at any given level.")
8307     (license license:public-domain)))
8309 (define-public java-cofoja
8310   (package
8311     (name "java-cofoja")
8312     (version "1.3")
8313     (source (origin
8314               (method git-fetch)
8315               (uri (git-reference
8316                     (url "https://github.com/nhatminhle/cofoja.git")
8317                     (commit (string-append "v" version))))
8318               (file-name (string-append "java-cofoja-" version "-checkout"))
8319               (sha256
8320                (base32
8321                 "0p7sz8y5xgpi5rx1qwn6587fkd52qr3ha3ybh14gqcyxhikl525w"))))
8322     (build-system ant-build-system)
8323     (arguments
8324      `(#:build-target "dist"
8325        #:test-target "test"
8326        #:jdk ,icedtea-8
8327        #:make-flags
8328        (list "-Ddist.dir=dist")
8329        #:modules ((guix build ant-build-system)
8330                   (guix build java-utils)
8331                   (guix build utils)
8332                   (srfi srfi-1)
8333                   (ice-9 match))
8334        #:phases
8335        (modify-phases %standard-phases
8336          ;; The bulid system ignores the class path the ant-build-system sets
8337          ;; up and instead expects to find all dependencies in the "lib"
8338          ;; directory.
8339          (add-after 'unpack 'create-libdir
8340            (lambda* (#:key inputs #:allow-other-keys)
8341              (mkdir-p "lib")
8342              (for-each
8343               (lambda (file)
8344                 (let ((target (string-append "lib/" (basename file))))
8345                   (unless (file-exists? target)
8346                     (symlink file target))))
8347               (append-map (match-lambda
8348                             ((label . dir)
8349                              (find-files dir "\\.jar$")))
8350                           inputs))
8351              #t))
8352          (replace 'install (install-jars "dist")))))
8353     (inputs
8354      `(("java-asm" ,java-asm)))
8355     (native-inputs
8356      `(("java-junit" ,java-junit)))
8357     (home-page "https://github.com/nhatminhle/cofoja")
8358     (synopsis "Contracts for Java")
8359     (description "Contracts for Java, or Cofoja for short, is a contract
8360 programming framework and test tool for Java, which uses annotation processing
8361 and bytecode instrumentation to provide run-time checking. (In particular,
8362 this is not a static analysis tool.)")
8363     (license license:lgpl3+)))
8365 (define-public java-aopalliance
8366   (package
8367     (name "java-aopalliance")
8368     (version "1.0")
8369     (source (origin
8370               (method git-fetch)
8371               ;; Note: this git repository is not official, but contains the
8372               ;; source code that is in the CVS repository.  Downloading the
8373               ;; tarball from sourceforge is undeterministic, and the cvs download
8374               ;; fails.
8375               (uri (git-reference
8376                      (url "https://github.com/hoverruan/aopalliance")
8377                      (commit "0d7757ae204e5876f69431421fe9bc2a4f01e8a0")))
8378               (file-name (string-append name "-" version))
8379               (sha256
8380                (base32
8381                 "0rsg2b0v3hxlq2yk1i3m2gw3xwq689j3cwx9wbxvqfpdcjbca0qr"))))
8382     (build-system ant-build-system)
8383     (arguments
8384      `(#:jar-name "java-aopalliance.jar"
8385        #:jdk ,icedtea-8
8386        #:tests? #f; no tests
8387        #:source-dir "aopalliance/src/main"))
8388     (home-page "http://aopalliance.sourceforge.net")
8389     (synopsis "Aspect-Oriented Programming")
8390     (description "The AOP Alliance project is a joint project between several
8391 software engineering people who are interested in Aspect-Oriented Programming
8392 (AOP) and Java.")
8393     (license license:public-domain)))
8395 (define-public java-javax-inject
8396   (package
8397     (name "java-javax-inject")
8398     (version "tck-1")
8399     (source (origin
8400               (method url-fetch)
8401               (uri (string-append "https://github.com/javax-inject/javax-inject/"
8402                                   "archive/javax.inject-" version ".tar.gz"))
8403               (sha256
8404                (base32
8405                 "1ydrlvh2r7vr1g7lhjwy3w2dggpj9h6pix1lakkkgdywb365n6g0"))))
8406     (build-system ant-build-system)
8407     (arguments
8408      `(#:jar-name "java-javax-inject.jar"
8409        #:jdk ,icedtea-8
8410        #:tests? #f)); no tests
8411     (home-page "http://github.com/javax-inject/javax-inject")
8412     (synopsis "JSR-330: Dependency Injection for Java")
8413     (description "This package specifies a means for obtaining objects in such
8414 a way as to maximize reusability, testability and maintainability compared to
8415 traditional approaches such as constructors, factories, and service locators
8416 (e.g., JNDI).  This process, known as dependency injection, is beneficial to
8417 most nontrivial applications.
8419 Many types depend on other types.  For example, a @var{Stopwatch} might depend
8420 on a @var{TimeSource}.  The types on which a type depends are known as its
8421 dependencies.  The process of finding an instance of a dependency to use at run
8422 time is known as resolving the dependency.  If no such instance can be found,
8423 the dependency is said to be unsatisfied, and the application is broken.")
8424     (license license:asl2.0)))
8426 (define-public java-guice
8427   (package
8428     (name "java-guice")
8429     (version "4.1")
8430     (source (origin
8431               (method url-fetch)
8432               (uri (string-append "https://github.com/google/guice/archive/"
8433                                   version ".tar.gz"))
8434               (file-name (string-append name "-" version ".tar.gz"))
8435               (modules '((guix build utils)))
8436               (snippet
8437                `(begin
8438                   (for-each delete-file (find-files "." ".*.jar"))))
8439               (sha256
8440                (base32
8441                 "0dwmqjzlavb144ywqqglj3h68hqszkff8ai0a42hyb5il0qh4rbp"))))
8442     (build-system ant-build-system)
8443     (arguments
8444      `(#:jar-name "java-guice.jar"
8445        #:jdk ,icedtea-8
8446        #:tests? #f; FIXME: tests are not in a java sub directory
8447        #:source-dir "core/src"))
8448     (inputs
8449      `(("guava" ,java-guava)
8450        ("java-cglib" ,java-cglib)
8451        ("java-aopalliance" ,java-aopalliance)
8452        ("java-javax-inject" ,java-javax-inject)
8453        ("java-asm" ,java-asm)))
8454     (home-page "https://github.com/google/guice")
8455     (synopsis "Lightweight dependency injection framework")
8456     (description "Guice is a lightweight dependency injection framework fo
8457 Java 6 and above.")
8458     (license license:asl2.0)))
8460 (define-public java-guice-servlet
8461   (package
8462     (inherit java-guice)
8463     (name "java-guice-servlet")
8464     (arguments
8465      `(#:jar-name "guice-servlet.jar"
8466        #:source-dir "extensions/servlet/src/"
8467        #:jdk ,icedtea-8
8468        #:tests? #f)); FIXME: not in a java subdir
8469     (inputs
8470      `(("guice" ,java-guice)
8471        ("servlet"  ,java-classpathx-servletapi)
8472        ,@(package-inputs java-guice)))))
8474 (define-public java-assertj
8475   (package
8476     (name "java-assertj")
8477     (version "3.8.0")
8478     (source (origin
8479               (method url-fetch)
8480               (uri (string-append "https://github.com/joel-costigliola/"
8481                                   "assertj-core/archive/"
8482                                   "assertj-core-" version ".tar.gz"))
8483               (sha256
8484                (base32
8485                 "1kf124fxskf548rklkg86294w2x6ajqrff94rrhyqns31danqkfz"))))
8486     (build-system ant-build-system)
8487     (arguments
8488      `(#:jar-name "java-assertj.jar"
8489        #:jdk ,icedtea-8
8490        #:source-dir "src/main/java"
8491        #:tests? #f)); depends on tng-junit which depends on assertj
8492     (inputs
8493      `(("cglib" ,java-cglib)
8494        ("junit" ,java-junit)
8495        ("hamcrest" ,java-hamcrest-core)))
8496     (native-inputs
8497      `(("mockito" ,java-mockito-1)))
8498     (home-page "https://joel-costigliola.github.io/assertj/index.html")
8499     (synopsis "Fluent assertions for java")
8500     (description "AssertJ core is a Java library that provides a fluent
8501 interface for writing assertions.  Its main goal is to improve test code
8502 readability and make maintenance of tests easier.")
8503     (license license:asl2.0)))
8505 (define-public java-jboss-javassist
8506   (package
8507     (name "java-jboss-javassist")
8508     (version "3.21.0")
8509     (source (origin
8510               (method url-fetch)
8511               (uri (string-append "https://github.com/jboss-javassist/javassist/"
8512                                   "archive/rel_"
8513                                   (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
8514                                   "_ga.tar.gz"))
8515               (sha256
8516                (base32
8517                 "10lpcr3sbf7y6fq6fc2h2ik7rqrivwcy4747bg0kxhwszil3cfmf"))))
8518     (build-system ant-build-system)
8519     (arguments
8520      `(#:jar-name "java-jboss-javassist.jar"
8521        #:jdk ,icedtea-8
8522        #:source-dir "src/main"
8523        #:tests? #f; FIXME: requires junit-awtui and junit-swingui from junit3
8524        #:phases
8525        (modify-phases %standard-phases
8526          (add-before 'configure 'remove-binary
8527            (lambda _
8528              (delete-file "javassist.jar")
8529              #t)))))
8530     (native-inputs
8531      `(("junit" ,java-junit)))
8532     (home-page "https://github.com/jboss-javassist/javassist")
8533     (synopsis "Java bytecode engineering toolkit")
8534     (description "Javassist (JAVA programming ASSISTant) makes Java bytecode
8535 manipulation simple.  It is a class library for editing bytecodes in Java; it
8536 enables Java programs to define a new class at runtime and to modify a class
8537 file when the JVM loads it.")
8538     (license (list license:gpl2 license:cddl1.0)))); either gpl2 only or cddl.
8540 (define-public java-jcommander
8541   (package
8542     (name "java-jcommander")
8543     (version "1.71")
8544     (source (origin
8545               (method url-fetch)
8546               (uri (string-append "https://github.com/cbeust/jcommander/archive/"
8547                                   version ".tar.gz"))
8548               (file-name (string-append name "-" version ".tar.gz"))
8549               (sha256
8550                (base32
8551                 "1f5k2ckay6qjc3d3w3d7bc0p3cx3c7n6p6zxvw1kibqdr0q98wlx"))))
8552     (build-system ant-build-system)
8553     (arguments
8554      `(#:jar-name "java-jcommander.jar"
8555        #:jdk ,icedtea-8
8556        #:tests? #f; requires testng which depends on jcommander
8557        #:source-dir "src/main/java"))
8558     (home-page "http://jcommander.org")
8559     (synopsis "Command line parameters parser")
8560     (description "JCommander is a very small Java framework that makes it
8561 trivial to parse command line parameters.  Parameters are declared with
8562 annotations.")
8563     (license license:asl2.0)))
8565 (define-public java-bsh
8566   (package
8567     (name "java-bsh")
8568     (version "2.0b6")
8569     (source (origin
8570               (method url-fetch)
8571               (uri (string-append "https://github.com/beanshell/beanshell/archive/"
8572                                   version ".tar.gz"))
8573               (file-name (string-append name "-" version ".tar.gz"))
8574               (sha256
8575                (base32
8576                 "1bawkxk6jyc75hxvzkpz689h73cn3f222m0ar3nvb0dal2b85kfv"))))
8577     (build-system ant-build-system)
8578     (arguments
8579      `(#:build-target "jarall"
8580        #:test-target "junit-tests-all"
8581        #:phases
8582        (modify-phases %standard-phases
8583          (replace 'install
8584            (lambda* (#:key outputs #:allow-other-keys)
8585              (let ((share (string-append (assoc-ref outputs "out") "/share/java")))
8586                (mkdir-p share)
8587                (copy-file "dist/bsh-2.0b6.jar" (string-append share "/bsh-2.0b6.jar"))
8588                #t))))))
8589     (home-page "http://beanshell.org/")
8590     (synopsis "Lightweight Scripting for Java")
8591     (description "BeanShell is a small, free, embeddable Java source
8592 interpreter with object scripting language features, written in Java.
8593 BeanShell dynamically executes standard Java syntax and extends it with common
8594 scripting conveniences such as loose types, commands, and method closures like
8595 those in Perl and JavaScript.")
8596     (license license:asl2.0)))
8598 (define-public java-fest-util
8599   (package
8600     (name "java-fest-util")
8601     (version "1.2.5")
8602     (source (origin
8603               (method url-fetch)
8604               (uri (string-append "https://github.com/alexruiz/fest-util/"
8605                                   "archive/fest-util-" version ".tar.gz"))
8606               (sha256
8607                (base32
8608                 "05g6hljz5mdaakk8d7g32klbhz9bdwp3qlj6rdaggdidxs3x1sb8"))))
8609     (build-system ant-build-system)
8610     (arguments
8611      `(#:jar-name "java-fest-util.jar"
8612        #:source-dir "src/main/java"))
8613     (native-inputs
8614      `(("junit" ,java-junit)
8615        ("hamcrest" ,java-hamcrest-core)))
8616     (home-page "https://github.com/alexruiz/fest-util")
8617     (synopsis "FEST common utilities")
8618     (description "Common utilities used in all FEST module.")
8619     (license license:asl2.0)))
8621 (define-public java-fest-test
8622   (package
8623     (name "java-fest-test")
8624     (version "2.1.0")
8625     (source (origin
8626               (method url-fetch)
8627               (uri (string-append "https://github.com/alexruiz/fest-test/"
8628                                   "archive/fest-test-" version ".tar.gz"))
8629               (sha256
8630                (base32
8631                 "1rxfbw6l9vc65iy1x3fb617qc6y4w2k430pgf1mfbxfdlxbm0f7g"))))
8632     (build-system ant-build-system)
8633     (arguments
8634      `(#:jar-name "java-fest-test.jar"
8635        #:source-dir "src/main/java"
8636        #:tests? #f)); no tests
8637     (inputs
8638      `(("junit" ,java-junit)))
8639     (home-page "https://github.com/alexruiz/fest-test")
8640     (synopsis "Common FEST testing infrastructure")
8641     (description "Fest-test contains the common FEST testing infrastructure.")
8642     (license license:asl2.0)))
8644 (define-public java-fest-assert
8645   (package
8646     (name "java-fest-assert")
8647     (version "2.0M10")
8648     (source (origin
8649               (method url-fetch)
8650               (uri (string-append "https://github.com/alexruiz/fest-assert-2.x/"
8651                                   "archive/fest-assert-core-" version ".tar.gz"))
8652               (sha256
8653                (base32
8654                 "1bi0iqavikzww6rxvz5jyg7y6bflv95s6ibryxx0xfcxrrw6i5lw"))))
8655     (build-system ant-build-system)
8656     (arguments
8657      `(#:jar-name "java-fest-assert.jar"
8658        #:source-dir "src/main/java"
8659        #:test-exclude
8660        (list
8661          "**/Abstract*.java"
8662          "**/*BaseTest.java"
8663          ;; Unable to set MockitoNamingPolicy on cglib generator which creates FastClasses
8664          "**/MessageFormatter_format_Test.java"
8665          "**/internal/*/*_assert*_Test.java")))
8666     (inputs
8667      `(("java-fest-util" ,java-fest-util)))
8668     (native-inputs
8669      `(("java-junit" ,java-junit)
8670        ("java-fest-test" ,java-fest-test)
8671        ("java-hamcrest-core" ,java-hamcrest-core)
8672        ("java-mockito" ,java-mockito-1)
8673        ("java-cglib" ,java-cglib)
8674        ("java-objenesis" ,java-objenesis)
8675        ("java-asm" ,java-asm)))
8676     (home-page "https://github.com/alexruiz/fest-assert-2.x")
8677     (synopsis "FEST fluent assertions")
8678     (description "FEST-Assert provides a fluent interface for assertions.")
8679     (license license:asl2.0)))
8681 (define-public java-testng
8682   (package
8683     (name "java-testng")
8684     (version "6.14.3")
8685     (source (origin
8686               (method git-fetch)
8687               (uri (git-reference
8688                     (url "https://github.com/cbeust/testng.git")
8689                     (commit version)))
8690               (file-name (string-append name "-" version "-checkout"))
8691               (sha256
8692                (base32
8693                 "0y6vq30i5g276kw0v2bhbvci22ijg7ax49ap2611yqlhbs4d6dqv"))))
8694     (build-system ant-build-system)
8695     (arguments
8696      `(#:jdk ,icedtea-8; java.util.function
8697        #:jar-name "java-testng.jar"
8698        #:source-dir "src/main/java"
8699        #:phases
8700        (modify-phases %standard-phases
8701          ;; FIXME: I don't know why these tests fail
8702          (add-after 'unpack 'delete-failing-tests
8703            (lambda _
8704              (substitute* "src/test/resources/testng.xml"
8705                (("<class name=\"test.configuration.github1625.TestRunnerIssue1625\"/>") "")
8706                (("<class name=\"test.serviceloader.ServiceLoaderTest\" />") ""))
8707              #t))
8708          ;; We don't have groovy
8709          (add-after 'unpack 'delete-groovy-tests
8710            (lambda _
8711              (delete-file-recursively "src/test/java/test/dependent/issue1648/")
8712              (substitute* "src/test/resources/testng.xml"
8713                (("<class name=\"test.dependent.issue1648.TestRunner\"/>") ""))
8714              #t))
8715          (add-before 'build 'copy-resources
8716            (lambda _
8717              (copy-recursively "src/main/resources" "build/classes")
8718              #t))
8719          (add-before 'check 'copy-test-resources
8720            (lambda _
8721              (copy-recursively "src/test/resources" "build/test-classes")
8722              #t))
8723          (replace 'check
8724            (lambda _
8725              (invoke "ant" "compile-tests")
8726              ;; we don't have groovy
8727              (substitute* "src/test/resources/testng.xml"
8728                (("<class name=\"test.groovy.GroovyTest\" />") ""))
8729              (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
8730                                                  ":build/classes"
8731                                                  ":build/test-classes")
8732                      "-Dtest.resources.dir=src/test/resources"
8733                      "org.testng.TestNG" "src/test/resources/testng.xml"))))))
8734     (propagated-inputs
8735      `(("junit" ,java-junit)
8736        ("java-jsr305" ,java-jsr305)
8737        ("java-bsh" ,java-bsh)
8738        ("java-jcommander" ,java-jcommander)
8739        ("java-guice" ,java-guice)
8740        ("snakeyaml" ,java-snakeyaml)))
8741     (native-inputs
8742      `(("guava" ,java-guava)
8743        ("java-javax-inject" ,java-javax-inject)
8744        ("java-hamcrest" ,java-hamcrest-all)
8745        ("java-assertj" ,java-assertj)
8746        ("java-mockito" ,java-mockito-1)
8747        ("cglib" ,java-cglib)
8748        ("asm" ,java-asm)
8749        ("aopalliance" ,java-aopalliance)))
8750     (home-page "http://testng.org")
8751     (synopsis "Testing framework")
8752     (description "TestNG is a testing framework inspired from JUnit and NUnit
8753 but introducing some new functionalities that make it more powerful and easier
8754 to use.")
8755     (license license:asl2.0)))
8757 (define-public java-jnacl
8758   (let ((commit "094e819afdd63ea81a499b3bcb42a271006bebd9")
8759         (revision "2"))
8760     (package
8761       (name "java-jnacl")
8762       (version (string-append "0.1.0-" revision "." (string-take commit 7)))
8763       (source (origin
8764                 (method git-fetch)
8765                 (uri (git-reference
8766                       (url "https://github.com/neilalexander/jnacl.git")
8767                       (commit commit)))
8768                 (file-name (git-file-name name version))
8769                 (sha256
8770                  (base32
8771                   "1d6g6xhn83byv5943n7935wwjsk0ibk0qdvqgr699qqgqqmwisbb"))))
8772       (build-system ant-build-system)
8773       (arguments
8774        `(#:jar-name "jnacl.jar"
8775          #:source-dir "src/main/java"
8776          #:jdk ,icedtea-8
8777          #:phases
8778          (modify-phases %standard-phases
8779            (add-before 'build 'fix-tests
8780              (lambda _
8781                (substitute* '("src/test/java/com/neilalexander/jnacl/NaClTest.java"
8782                               "src/test/java/com/neilalexander/jnacl/NaclSecretBoxTest.java")
8783                  (("assertions.Assertions") "assertions.api.Assertions"))
8784                #t))
8785            (replace 'check
8786              (lambda _
8787                (invoke "ant" "compile-tests")
8788                (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
8789                                                    ":build/classes"
8790                                                    ":build/test-classes")
8791                        "org.testng.TestNG" "-testclass"
8792                        "build/test-classes/com/neilalexander/jnacl/NaclSecretBoxTest.class")
8793                (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
8794                                                    ":build/classes"
8795                                                    ":build/test-classes")
8796                        "org.testng.TestNG" "-testclass"
8797                        "build/test-classes/com/neilalexander/jnacl/NaClTest.class"))))))
8798       (native-inputs
8799        `(("java-testng" ,java-testng)
8800          ("java-fest-util" ,java-fest-util)
8801          ("java-fest-assert" ,java-fest-assert)))
8802       (home-page "https://github.com/neilalexander/jnacl")
8803       (synopsis "Java implementation of NaCl")
8804       (description "Pure Java implementation of the NaCl: Networking and
8805 Cryptography library.")
8806       (license license:bsd-2))))
8808 (define-public java-mvel2
8809   (package
8810     (name "java-mvel2")
8811     (version "2.3.1")
8812     (source (origin
8813               (method url-fetch)
8814               (uri (string-append "https://github.com/mvel/mvel/archive/mvel2-"
8815                                   version ".Final.tar.gz"))
8816               (sha256
8817                (base32
8818                 "01ph5s9gm16l2qz58lg21w6fna7xmmrj7f9bzqr1jim7h9557d3z"))))
8819     (build-system ant-build-system)
8820     (arguments
8821      `(#:jar-name "mvel2.jar"
8822        #:source-dir "src/main/java"
8823        #:test-exclude
8824        (list "**/Abstract*.java"
8825              ;; Base class with no tests
8826              "**/MVELThreadTest.java")
8827        #:phases
8828        (modify-phases %standard-phases
8829          (add-after 'install 'install-bin
8830            (lambda* (#:key outputs #:allow-other-keys)
8831              (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
8832                (mkdir-p bin)
8833                (with-output-to-file (string-append bin "/mvel2")
8834                  (lambda _
8835                    (display
8836                      (string-append
8837                        "#!" (which "bash") "\n"
8838                        "if [ \"$#\" -ne \"2\" ]; then\n"
8839                        "echo 'Usage: mvel2 <script> <out.dir>'\n"
8840                        "exit\n"
8841                        "fi\n"
8842                        "java -Dout.dir=$2 -cp " (getenv "CLASSPATH")
8843                        ":" (assoc-ref outputs "out") "/share/java/mvel2.jar"
8844                        " org.mvel2.sh.Main $1"))))
8845                (chmod (string-append bin "/mvel2") #o755))
8846              #t)))))
8847     (native-inputs
8848      `(("junit" ,java-junit)
8849        ("hamcrest" ,java-hamcrest-core)))
8850     (home-page "https://github.com/mvel/mvel")
8851     (synopsis "MVFLEX Expression Language")
8852     (description "MVEL has largely been inspired by Java syntax, but has some
8853 fundamental differences aimed at making it more efficient as an expression
8854 language, such as operators that directly support collection, array and string
8855 matching, as well as regular expressions.  MVEL is used to evaluate expressions
8856 written using Java syntax.
8858 In addition to the expression language, MVEL serves as a templating language for
8859 configuration and string construction.")
8860     (license license:asl2.0)))
8862 (define-public java-commons-jexl-2
8863   (package
8864     (name "java-commons-jexl")
8865     (version "2.1.1")
8866     (source (origin
8867               (method url-fetch)
8868               (uri (string-append "mirror://apache/commons/jexl/source/"
8869                                   "commons-jexl-" version "-src.tar.gz"))
8870               (sha256
8871                (base32
8872                 "1ai7632bwwaxglb0nbpblpr2jw5g20afrsaq372ipkphi3ncy1jz"))))
8873     (build-system ant-build-system)
8874     (arguments
8875      `(#:jar-name "commons-jexl-2.jar"
8876        #:jdk ,icedtea-8
8877        #:source-dir "src/main/java"
8878        #:phases
8879        (modify-phases %standard-phases
8880          (add-before 'check 'disable-broken-tests
8881            (lambda* (#:key inputs #:allow-other-keys)
8882              (with-directory-excursion "src/test/java/org/apache/commons/jexl2/"
8883                (substitute* "ArithmeticTest.java"
8884                  (("asserter.assertExpression\\(\"3 / 0\"") "//")
8885                  (("asserter.assertExpression\\(\"imanull") "//"))
8886                ;; This test fails with "ambiguous method invocation"
8887                (delete-file "CacheTest.java")
8888                ;; This test doesn't have access to the temp directory
8889                (substitute* "ClassCreatorTest.java"
8890                  (("java.io.tmpdir") "user.dir"))
8891                ;; This test fails in trying to detect whether it can run.
8892                (substitute* "ClassCreator.java"
8893                  (("boolean canRun =.*") "boolean canRun = false;\n"))
8894                ;; ...and these tests depend on it.
8895                (delete-file "scripting/JexlScriptEngineOptionalTest.java")
8896                (delete-file "scripting/JexlScriptEngineTest.java"))
8897              #t))
8898          (add-before 'build 'run-javacc
8899            (lambda _
8900              (with-directory-excursion "src/main/java/org/apache/commons/jexl2/parser/"
8901                (invoke "java" "jjtree" "Parser.jjt")
8902                (invoke "java" "javacc" "Parser.jj"))
8903              #t)))))
8904     (inputs
8905      `(("java-commons-logging-minimal" ,java-commons-logging-minimal)))
8906     (native-inputs
8907      `(("java-junit" ,java-junit)
8908        ("java-hamcrest-core" ,java-hamcrest-core)
8909        ("javacc" ,javacc-4)))
8910     (home-page "https://commons.apache.org/proper/commons-jexl/")
8911     (synopsis "Java Expression Language ")
8912     (description "JEXL is a library intended to facilitate the implementation
8913 of dynamic and scripting features in applications and frameworks written in
8914 Java.  JEXL implements an Expression Language based on some extensions to the
8915 JSTL Expression Language supporting most of the constructs seen in
8916 shell-script or ECMAScript.  Its goal is to expose scripting features usable
8917 by technical operatives or consultants working with enterprise platforms.")
8918     (license license:asl2.0)))
8920 (define-public java-lz4
8921   (package
8922     (name "java-lz4")
8923     (version "1.4.0")
8924     (source (origin
8925               (method url-fetch)
8926               (uri (string-append "https://github.com/lz4/lz4-java/archive/"
8927                                   version ".tar.gz"))
8928               (file-name (string-append name "-" version ".tar.gz"))
8929               (sha256
8930                (base32
8931                 "096dm57p2lzqk28n0j2p52x2j3cvnsd2dfqn43n7vbwrkjsy7y54"))))
8932     (build-system ant-build-system)
8933     (arguments
8934      `(#:jar-name "lz4.jar"
8935        #:jdk ,icedtea-8
8936        #:source-dir "src/java:src/java-unsafe"
8937        #:tests? #f; FIXME: requires more dependencies
8938        #:phases
8939        (modify-phases %standard-phases
8940          (add-before 'configure 'generate-source
8941            (lambda _
8942              (with-directory-excursion "src/build/source_templates"
8943                (invoke "mvel2" "../gen_sources.mvel" "../../java"))
8944              #t)))))
8945     (native-inputs
8946      `(("mvel" ,java-mvel2)))
8947     (home-page "https://jpountz.github.io/lz4-java")
8948     (synopsis "Compression algorithm")
8949     (description "LZ4 - Java is a Java port of the popular lz4 compression
8950 algorithms and xxHash hashing algorithm.")
8951     (license license:asl2.0)))
8953 (define-public java-bouncycastle
8954   (package
8955     (name "java-bouncycastle")
8956     (version "1.60")
8957     (source (origin
8958               (method url-fetch)
8959               (uri (string-append "https://github.com/bcgit/bc-java/archive/r"
8960                                   (substring version 0 1) "v"
8961                                   (substring version 2 4) ".tar.gz"))
8962               (sha256
8963                (base32
8964                 "0v434513y708qc87k4xz13p2kzydc736lk3ks67df9mg11s7hchv"))
8965               (modules '((guix build utils)))
8966               (snippet
8967                '(begin
8968                   (for-each delete-file
8969                             (find-files "." "\\.jar$"))
8970                   #t))))
8971     (build-system ant-build-system)
8972     (arguments
8973      `(#:jdk ,icedtea-8
8974        #:tests? #f
8975        #:phases
8976        (modify-phases %standard-phases
8977          (replace 'build
8978            (lambda _
8979              (invoke "ant" "-f" "ant/jdk15+.xml" "build-provider")
8980              (invoke "ant" "-f" "ant/jdk15+.xml" "build")))
8981          ;; FIXME: the tests freeze.
8982          ;; (replace 'check
8983          ;;   (lambda _
8984          ;;     (invoke "ant" "-f" "ant/jdk15+.xml" "test")))
8985          (replace 'install
8986            (install-jars "build/artifacts/jdk1.5/jars")))))
8987     (inputs
8988      `(("java-javax-mail" ,java-javax-mail)))
8989     (native-inputs
8990      `(("unzip" ,unzip)
8991        ("junit" ,java-junit)
8992        ("java-native-access" ,java-native-access)
8993        ("java-native-access-platform" ,java-native-access-platform)))
8994     (home-page "https://www.bouncycastle.org")
8995     (synopsis "Cryptographic library")
8996     (description "Bouncy Castle is a cryptographic library for the Java
8997 programming language.")
8998     (license license:expat)))
9000 (define-public java-lmax-disruptor
9001   (package
9002     (name "java-lmax-disruptor")
9003     (version "3.3.7")
9004     (source (origin
9005               (method url-fetch)
9006               (uri (string-append "https://github.com/LMAX-Exchange/disruptor/"
9007                                   "archive/" version ".tar.gz"))
9008               (file-name (string-append name "-" version ".tar.gz"))
9009               (sha256
9010                (base32
9011                 "17da2gwj5abnlsfgn2xqjk5lgzbg4vkb0hdv2dvc8r2fx4bi7w3g"))))
9012     (build-system ant-build-system)
9013     (arguments
9014      `(#:jar-name "java-lmax-disruptor.jar"
9015        #:jdk ,icedtea-8
9016        #:tests? #f)); tests hang
9017     (inputs
9018      `(("junit" ,java-junit)
9019        ("java-hdrhistogram" ,java-hdrhistogram)
9020        ("java-jmock" ,java-jmock)
9021        ("java-jmock-legacy" ,java-jmock-legacy)
9022        ("java-jmock-junit4" ,java-jmock-junit4)
9023        ("java-hamcrest-all" ,java-hamcrest-all)))
9024     (native-inputs
9025      `(("cglib" ,java-cglib)
9026        ("objenesis" ,java-objenesis)
9027        ("asm" ,java-asm)))
9028     (home-page "https://www.lmax.com/disruptor")
9029     (synopsis "High performance inter-thread communication")
9030     (description "LMAX Disruptor is a software pattern and software component
9031 for high performance inter-thread communication that avoids the need for
9032 message queues or resource locking.")
9033     (license license:asl2.0)))
9035 (define-public java-commons-bcel
9036   (package
9037     (name "java-commons-bcel")
9038     (version "6.1")
9039     (source (origin
9040               (method url-fetch)
9041               (uri (string-append "mirror://apache/commons/bcel/source/bcel-"
9042                                   version "-src.tar.gz"))
9043               (sha256
9044                (base32
9045                 "0j3x1rxd673k07psclk8k13rqh0x0mf2yy5qiwkiw4z3afa568jy"))))
9046     (build-system ant-build-system)
9047     (arguments
9048      `(#:jar-name "bcel.jar"
9049        #:jdk ,icedtea-8
9050        #:source-dir "src/main/java"
9051        #:test-dir "src/test/java"
9052        ;; FIXME: Tests require the unpackaged jna.
9053        #:tests? #f))
9054     (home-page "https://commons.apache.org/proper/commons-bcel/")
9055     (synopsis "Byte code engineering library")
9056     (description "The Byte Code Engineering Library (Apache Commons BCEL) is
9057 intended to give users a convenient way to analyze, create, and
9058 manipulate (binary) Java class files.  Classes are represented by objects
9059 which contain all the symbolic information of the given class: methods, fields
9060 and byte code instructions, in particular.
9062 Such objects can be read from an existing file, be transformed by a
9063 program (e.g. a class loader at run-time) and written to a file again.  An
9064 even more interesting application is the creation of classes from scratch at
9065 run-time.  The @dfn{Byte Code Engineering Library} (BCEL) may be also useful
9066 if you want to learn about the @dfn{Java Virtual Machine} (JVM) and the format
9067 of Java @code{.class} files.")
9068     (license license:asl2.0)))
9070 (define-public java-xerial-core
9071   (package
9072     (name "java-xerial-core")
9073     (version "2.1")
9074     (source (origin
9075               (method url-fetch)
9076               (uri (string-append "https://github.com/xerial/xerial-java/archive/"
9077                                   version ".tar.gz"))
9078               (file-name (string-append name "-" version ".tar.gz"))
9079               (sha256
9080                (base32
9081                 "0d3g863i41bgalpa4xr3vm1h140l091n8iwgq5qvby5yivns9y8d"))))
9082     (build-system ant-build-system)
9083     (arguments
9084      `(#:jar-name "xerial-core.jar"
9085        #:source-dir "xerial-core/src/main/java"
9086        #:test-dir "xerial-core/src/test"
9087        #:phases
9088        (modify-phases %standard-phases
9089          (add-before 'build 'copy-resources
9090            (lambda _
9091              (copy-recursively "xerial-core/src/main/resources"
9092                                "build/classes")
9093              #t)))))
9094     (native-inputs
9095      `(("junit" ,java-junit)
9096        ("hamcrest" ,java-hamcrest-core)))
9097     (home-page "https://github.com/xerial/xerial-java")
9098     (synopsis "Data management libraries for Java")
9099     (description "Xerial is a set of data management libraries for the Java
9100 programming language.  The ultimate goal of the Xerial project is to manage
9101 everything as database, including class objects, text format data, data
9102 streams, etc.")
9103     (license license:asl2.0)))
9105 (define-public java-powermock-reflect
9106   (package
9107     (name "java-powermock-reflect")
9108     (version "1.7.3")
9109     (source (origin
9110               (method url-fetch)
9111               (uri (string-append "https://github.com/powermock/powermock/"
9112                                   "archive/powermock-" version ".tar.gz"))
9113               (file-name (string-append name "-" version ".tar.gz"))
9114               (sha256
9115                (base32
9116                 "0sbgi5vqq7k72wzcdjb20s370vyd4hsbnx71pzb8ishml3gy7fwy"))
9117               (patches
9118                 (search-patches "java-powermock-fix-java-files.patch"))))
9119     (build-system ant-build-system)
9120     (arguments
9121      `(#:jar-name "java-powermock-reflect.jar"
9122        #:jdk ,icedtea-8
9123        #:source-dir "powermock-reflect/src/main/java"
9124        #:test-dir "powermock-reflect/src/test"))
9125     (inputs
9126      `(("java-objenesis" ,java-objenesis)))
9127     (native-inputs
9128      `(("junit" ,java-junit)
9129        ("cglib" ,java-cglib)
9130        ("asm" ,java-asm)
9131        ("hamcrest" ,java-hamcrest-core)
9132        ("assertj" ,java-assertj)))
9133     (home-page "https://github.com/powermock/powermock")
9134     (synopsis "Mock library extension framework")
9135     (description "PowerMock is a framework that extends other mock libraries
9136 such as EasyMock with more powerful capabilities.  PowerMock uses a custom
9137 classloader and bytecode manipulation to enable mocking of static methods,
9138 constructors, final classes and methods, private methods, removal of static
9139 initializers and more.  By using a custom classloader no changes need to be
9140 done to the IDE or continuous integration servers which simplifies adoption.")
9141     (license license:asl2.0)))
9143 (define-public java-powermock-core
9144   (package
9145     (inherit java-powermock-reflect)
9146     (name "java-powermock-core")
9147     (arguments
9148      `(#:jar-name "java-powermock-core.jar"
9149        #:source-dir "powermock-core/src/main/java"
9150        #:test-dir "powermock-core/src/test"
9151        #:tests? #f; requires powermock-api
9152        #:jdk ,icedtea-8
9153        #:phases
9154        (modify-phases %standard-phases
9155          (add-before 'build 'copy-resources
9156            (lambda _
9157              (copy-recursively "powermock-core/src/main/resources"
9158                                "build/classes")
9159              #t)))))
9160     (inputs
9161      `(("reflect" ,java-powermock-reflect)
9162        ("javassist" ,java-jboss-javassist)))
9163     (native-inputs
9164      `(("junit" ,java-junit)
9165        ("assertj" ,java-assertj)
9166        ("mockito" ,java-mockito-1)))))
9168 (define-public java-powermock-api-support
9169   (package
9170     (inherit java-powermock-reflect)
9171     (name "java-powermock-api-support")
9172     (build-system ant-build-system)
9173     (arguments
9174      `(#:jar-name "java-powermock-api-support.jar"
9175        #:jdk ,icedtea-8
9176        #:source-dir "powermock-api/powermock-api-support/src/main/java"
9177        #:tests? #f)); no tests
9178     (inputs
9179      `(("core" ,java-powermock-core)
9180        ("reflect" ,java-powermock-reflect)))))
9182 (define-public java-powermock-modules-junit4-common
9183   (package
9184     (inherit java-powermock-reflect)
9185     (name "java-powermock-modules-junit4-common")
9186     (build-system ant-build-system)
9187     (arguments
9188      `(#:jar-name "java-powermock-modules-junit4-common.jar"
9189        #:jdk ,icedtea-8
9190        #:source-dir "powermock-modules/powermock-module-junit4-common/src/main/java"
9191        #:test-dir "powermock-modules/powermock-module-junit4-common/src/test"))
9192     (inputs
9193      `(("core" ,java-powermock-core)
9194        ("easymock" ,java-easymock)
9195        ("reflect" ,java-powermock-reflect)
9196        ("hamcrest" ,java-hamcrest-core)
9197        ("cglib" ,java-cglib)))))
9199 (define-public java-powermock-modules-junit4
9200   (package
9201     (inherit java-powermock-reflect)
9202     (name "java-powermock-modules-junit4")
9203     (build-system ant-build-system)
9204     (arguments
9205      `(#:jar-name "java-powermock-modules-junit4.jar"
9206        #:jdk ,icedtea-8
9207        #:source-dir "powermock-modules/powermock-module-junit4/src/main/java"
9208        #:test-dir "powermock-modules/powermock-module-junit4/src/test"
9209        #:phases
9210        (modify-phases %standard-phases
9211          (add-before 'build 'fix-junit-detection
9212            (lambda _
9213              ;; Our junit version is 4.12-SNAPSHOT
9214              (substitute* (find-files "powermock-modules/powermock-module-junit4"
9215                                       "PowerMockJUnit4MethodValidator.java")
9216                (("4.12") "4.12-SNAPSHOT"))
9217              #t)))))
9218     (inputs
9219      `(("core" ,java-powermock-core)
9220        ("reflect" ,java-powermock-reflect)
9221        ("common" ,java-powermock-modules-junit4-common)
9222        ("cglib" ,java-cglib)))
9223     (native-inputs
9224      `(("easymock" ,java-easymock)
9225        ("hamcrest" ,java-hamcrest-core)
9226        ("objenesis" ,java-objenesis)
9227        ("asm" ,java-asm)
9228        ("junit" ,java-junit)))))
9230 (define-public java-powermock-api-easymock
9231   (package
9232     (inherit java-powermock-reflect)
9233     (name "java-powermock-api-easymock")
9234     (build-system ant-build-system)
9235     (arguments
9236      `(#:jar-name "java-powermock-api-easymock.jar"
9237        #:jdk ,icedtea-8
9238        #:source-dir "powermock-api/powermock-api-easymock/src/main/java"
9239        #:tests? #f; no tests
9240        #:phases
9241        (modify-phases %standard-phases
9242          (add-before 'build 'fix-file
9243            (lambda _
9244              ;; FIXME: This looks wrong, but it fixes a build error.
9245              (with-directory-excursion "powermock-api/powermock-api-easymock"
9246                (substitute* "src/main/java/org/powermock/api/easymock/PowerMock.java"
9247                  (("classLoader instanceof MockClassLoader") "false")
9248                  (("\\(\\(MockClassLoader\\) classLoader\\).*;") ";")))
9249              #t)))))
9250     (inputs
9251      `(("core" ,java-powermock-core)
9252        ("easymock" ,java-easymock)
9253        ("reflect" ,java-powermock-reflect)
9254        ("support" ,java-powermock-api-support)
9255        ("cglib" ,java-cglib)))))
9257 (define-public java-jboss-jms-api-spec
9258   (package
9259     (name "java-jboss-jms-api-spec")
9260     (version "2.0")
9261     (source (origin
9262               (method url-fetch)
9263               (uri (string-append "https://github.com/jboss/jboss-jms-api_spec/"
9264                                   "archive/jboss-jms-api_" version
9265                                   "_spec-1.0.1.Final.tar.gz"))
9266               (sha256
9267                (base32
9268                 "07bqblw9kq2i8q92bz70fvavq5xjfkaixl8xa0m0cypjgy82rb7m"))))
9269     (build-system ant-build-system)
9270     (arguments
9271      `(#:jar-name "java-jboss-jms-api_spec.jar"
9272        #:jdk ,icedtea-8
9273        #:source-dir "."
9274        #:tests? #f)); no tests
9275     (home-page "https://github.com/jboss/jboss-jms-api_spec")
9276     (synopsis "Java Message Service API specification")
9277     (description "Java Message Service (JMS) API is used to send messages
9278 messages between two or more clients.  It is a messaging standard that allows
9279 application components to create, send, receive, and read messages.")
9280     ; either gpl2 only with GPL Classpath Exception, or cddl.
9281     (license (list license:gpl2 license:cddl1.0))))
9283 (define-public java-mail
9284   (package
9285     (name "java-mail")
9286     (version "1.6.0")
9287     (source (origin
9288               (method url-fetch)
9289               (uri (string-append "https://github.com/javaee/javamail/archive/"
9290                                   "JAVAMAIL-1_6_0.tar.gz"))
9291               (sha256
9292                (base32
9293                 "1b4rg7fpj50ld90a71iz2m4gm3f5cnw18p3q3rbrrryjip46kx92"))))
9294     (build-system ant-build-system)
9295     (arguments
9296      `(#:jar-name "java-mail.jar"
9297        #:jdk ,icedtea-8
9298        #:source-dir "mail/src/main/java"
9299        #:test-dir "mail/src/test"
9300        #:test-exclude
9301        (list "**/CollectorFormatterTest.java"
9302              "**/CompactFormatterTest.java"
9303              "**/DurationFilterTest.java"
9304              "**/MailHandlerTest.java"
9305              "**/GetLocalAddressTest.java"
9306              ;; FIXME: both end with:
9307              ;; java.lang.ClassNotFoundException:
9308              ;; javax.mail.internet.MimeMultipartParseTest
9309              "**/MimeMultipartParseTest.java"
9310              "**/SearchTermSerializationTest.java")
9311        #:phases
9312        (modify-phases %standard-phases
9313          (add-before 'configure 'move-version.java
9314            (lambda _
9315              (copy-file "mail/src/main/resources/javax/mail/Version.java"
9316                         "mail/src/main/java/javax/mail/Version.java")
9317              #t))
9318          (add-before 'build 'copy-resources
9319            (lambda _
9320              (copy-recursively "mail/src/main/resources/META-INF"
9321                                "build/classes/META-INF")
9322              #t)))))
9323     (native-inputs
9324      `(("junit" ,java-junit)
9325        ("hamcrest" ,java-hamcrest-core)))
9326     (home-page "https://javaee.github.io/javamail/")
9327     (synopsis "Mail-related functionnalities in Java")
9328     (description "The JavaMail API provides a platform-independent and
9329 protocol-independent framework to build mail and messaging applications.")
9330     ;; General Public License Version 2 only ("GPL") or the Common Development
9331     ;; and Distribution License("CDDL")
9332     (license (list license:cddl1.1
9333                    license:gpl2)))); with classpath exception
9335 (define-public java-jeromq
9336   (package
9337     (name "java-jeromq")
9338     (version "0.4.3")
9339     (source (origin
9340               (method git-fetch)
9341               (uri (git-reference
9342                     (url "https://github.com/zeromq/jeromq.git")
9343                     (commit (string-append "v" version))))
9344               (file-name (string-append name "-" version "-checkout"))
9345               (sha256
9346                (base32
9347                 "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj"))
9348               (patches (search-patches "java-jeromq-fix-tests.patch"))))
9349     (build-system ant-build-system)
9350     (arguments
9351      `(#:jar-name "java-jeromq.jar"
9352        #:source-dir "src/main/java"
9353        #:jdk ,icedtea-8
9354        #:test-exclude
9355        (list
9356          "**/Abstract*.java"
9357          ;; Requires network
9358          "**/ZBeaconTest.java"
9359          ;; Failures
9360          "**/DealerSpecTest.java"
9361          "**/CustomDecoderTest.java"
9362          "**/CustomEncoderTest.java"
9363          "**/ConnectRidTest.java"
9364          "**/ReqSpecTest.java"
9365          "**/PushPullSpecTest.java"
9366          "**/PubSubHwmTest.java"
9367          "**/RouterSpecTest.java"
9368          "**/ProxyTest.java")))
9369     (inputs
9370      `(("java-jnacl" ,java-jnacl)))
9371     (native-inputs
9372      `(("java-hamcrest-core" ,java-hamcrest-core)
9373        ("junit" ,java-junit)))
9374     (home-page "http://zeromq.org/bindings:java")
9375     (synopsis "Java binding for 0MQ")
9376     (description "Jeromq provides the java bindings for 0MQ.")
9377     (license license:mpl2.0)))
9379 (define-public java-kafka-clients
9380   (package
9381     (name "java-kafka-clients")
9382     (version "1.0.0")
9383     (source (origin
9384               (method url-fetch)
9385               (uri (string-append "mirror://apache/kafka/" version "/kafka-"
9386                                   version "-src.tgz"))
9387               (sha256
9388                (base32
9389                 "1yxmnsmliwm7671q5yy9bl4jdqyyn00n26cggz9brwczx80w1vfq"))))
9390     (build-system ant-build-system)
9391     (arguments
9392      `(#:jar-name "java-kafka-clients.jar"
9393        #:jdk ,icedtea-8
9394        #:source-dir "clients/src/main/java"
9395        #:test-dir "clients/src/test"
9396        #:test-exclude
9397        (list
9398          ;; This file does not contain a class
9399          "**/IntegrationTest.java"
9400          ;; Requires network
9401          "**/ClientUtilsTest.java"
9402          ;; End with errors that seem related to our powermock
9403          "**/KafkaProducerTest.java"
9404          "**/BufferPoolTest.java")))
9405     (inputs
9406      `(("java-slf4j-api" ,java-slf4j-api)
9407        ("java-lz4" ,java-lz4)))
9408     (native-inputs
9409      `(("junit" ,java-junit)
9410        ("hamcrest" ,java-hamcrest-all)
9411        ("objenesis" ,java-objenesis)
9412        ("asm" ,java-asm)
9413        ("cglib" ,java-cglib)
9414        ("javassist" ,java-jboss-javassist)
9415        ("snappy" ,java-snappy)
9416        ("easymock" ,java-easymock)
9417        ("powermock" ,java-powermock-core)
9418        ("powermock-easymock" ,java-powermock-api-easymock)
9419        ("powermock-junit4-common" ,java-powermock-modules-junit4-common)
9420        ("powermock-junit4" ,java-powermock-modules-junit4)
9421        ("powermock-support" ,java-powermock-api-support)
9422        ("java-bouncycastle" ,java-bouncycastle)))
9423     (home-page "https://kafka.apache.org")
9424     (synopsis "Distributed streaming platform")
9425     (description "Kafka is a distributed streaming platform, which means:
9426 @itemize
9427 @item it can publish and subscribe to streams of records;
9428 @item it can store streams of records in a fault-tolerant way;
9429 @item it can process streams of records as they occur.
9430 @end itemize")
9431     ;; Either cddl or gpl2 only.
9432     (license (list license:cddl1.1; actually cddl1.1
9433                    license:gpl2)))); with classpath exception
9435 (define-public java-jdom
9436   (package
9437     (name "java-jdom")
9438     (version "1.1.3")
9439     (source (origin
9440               (method url-fetch)
9441               (uri (string-append "http://jdom.org/dist/binary/archive/jdom-"
9442                                   version ".tar.gz"))
9443               (sha256
9444                (base32
9445                 "07wdpm3jwwc9q38kmdw40fvbmv6jzjrkrf8m0zqs58f79a672wfl"))))
9446     (build-system ant-build-system)
9447     (arguments
9448      `(#:build-target "package"
9449        #:tests? #f; tests are run as part of the build process
9450        #:phases
9451        (modify-phases %standard-phases
9452          (replace 'install
9453            (install-jars "build")))))
9454     (home-page "http://jdom.org/")
9455     (synopsis "Access, manipulate, and output XML data")
9456     (description "Java-based solution for accessing, manipulating, and
9457 outputting XML data from Java code.")
9458     (license license:bsd-4)))
9460 (define-public java-geronimo-xbean-reflect
9461   (package
9462     (name "java-geronimo-xbean-reflect")
9463     (version "4.5")
9464     (source (origin
9465               (method svn-fetch)
9466               (uri (svn-reference
9467                      (url "https://svn.apache.org/repos/asf/geronimo/xbean/tags/xbean-4.5/")
9468                      (revision 1807396)))
9469               (file-name (string-append name "-" version))
9470               (sha256
9471                (base32
9472                 "18q3i6jgm6rkw8aysfgihgywrdc5nvijrwnslmi3ww497jvri6ja"))))
9473     (build-system ant-build-system)
9474     (arguments
9475      `(#:jar-name "geronimo-xbean-reflect.jar"
9476        #:source-dir "xbean-reflect/src/main/java"
9477        #:test-dir "xbean-reflect/src/test"
9478        #:jdk ,icedtea-8
9479        #:test-exclude
9480        (list "**/Abstract*.java" "**/AsmParameterNameLoaderTest.java"
9481              "**/ObjectRecipeTest.java" "**/ParameterNameLoaderTest.java"
9482              "**/RecipeHelperTest.java" "**/XbeanAsmParameterNameLoaderTest.java")
9483        #:phases
9484        (modify-phases %standard-phases
9485          (add-before 'build 'fix-source
9486            (lambda _
9487              (let ((dir "xbean-reflect/src/main/java/org/apache/xbean/recipe/"))
9488                ;; org.apache.xbean.asm6 is actually repackaged java-asm
9489                (substitute* (string-append dir "XbeanAsmParameterNameLoader.java")
9490                  (("org.apache.xbean.asm5") "org.objectweb.asm"))
9491                #t))))))
9492     (inputs
9493      `(("asm" ,java-asm)
9494        ("log4j" ,java-log4j-api)
9495        ("log4j-1.2" ,java-log4j-1.2-api)
9496        ("log4j-core" ,java-log4j-core)
9497        ("logging" ,java-commons-logging-minimal)))
9498     (native-inputs
9499      `(("junit" ,java-junit)))
9500     (home-page "https://geronimo.apache.org/maven/xbean/3.6/xbean-reflect/")
9501     (synopsis "Dependency injection helper")
9502     (description "Xbean-reflect provides very flexible ways to create objects
9503 and graphs of objects for dependency injection frameworks")
9504     (license license:asl2.0)))
9506 (define-public java-geronimo-xbean-bundleutils
9507   (package
9508     (inherit java-geronimo-xbean-reflect)
9509     (name "java-geronimo-xbean-bundleutils")
9510     (arguments
9511      `(#:jar-name "geronimo-xbean-bundleutils.jar"
9512        #:source-dir "xbean-bundleutils/src/main/java"
9513        #:test-dir "xbean-bundleutils/src/test"
9514        #:phases
9515        (modify-phases %standard-phases
9516          (add-before 'build 'fix-java
9517            (lambda _
9518              ;; We use a more recent version of osgi, so this file requires
9519              ;; more interface method implementations.
9520              (substitute* "xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java"
9521                (("import org.osgi.framework.ServiceRegistration;")
9522                 "import org.osgi.framework.ServiceRegistration;
9523 import org.osgi.framework.ServiceFactory;
9524 import java.util.Collection;
9525 import org.osgi.framework.ServiceObjects;")
9526                (("public Bundle getBundle\\(\\)")
9527                 "@Override
9528 public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
9529  throw new UnsupportedOperationException();
9531 @Override
9532 public <S> ServiceRegistration<S> registerService(Class<S> clazz,
9533         ServiceFactory<S> factory, Dictionary<String, ?> properties) {
9534  throw new UnsupportedOperationException();
9536 public Bundle getBundle()"))
9537              #t)))))
9538     (inputs
9539      `(("java-slf4j" ,java-slf4j-api)
9540        ("java-asm" ,java-asm)
9541        ("java-osgi-framework" ,java-osgi-framework)
9542        ("java-eclipse-osgi" ,java-eclipse-osgi)
9543        ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)))))
9545 (define-public java-geronimo-xbean-asm-util
9546   (package
9547     (inherit java-geronimo-xbean-reflect)
9548     (name "java-geronimo-xbean-asm-util")
9549     (arguments
9550      `(#:jar-name "geronimo-xbean-asm-util.jar"
9551        #:source-dir "xbean-asm-util/src/main/java"
9552        #:tests? #f)); no tests
9553     (inputs
9554      `(("java-asm" ,java-asm)))
9555     (native-inputs '())))
9557 (define-public java-geronimo-xbean-finder
9558   (package
9559     (inherit java-geronimo-xbean-reflect)
9560     (name "java-geronimo-xbean-finder")
9561     (arguments
9562      `(#:jar-name "geronimo-xbean-finder.jar"
9563        #:source-dir "xbean-finder/src/main/java"
9564        #:test-dir "xbean-finder/src/test"))
9565     (inputs
9566      `(("java-slf4j-api" ,java-slf4j-api)
9567        ("java-asm" ,java-asm)
9568        ("java-geronimo-xbean-bundleutils" ,java-geronimo-xbean-bundleutils)
9569        ("java-geronimo-xbean-asm-util" ,java-geronimo-xbean-asm-util)
9570        ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)
9571        ("java-osgi-framework" ,java-osgi-framework)))
9572     (native-inputs
9573      `(("java-junit" ,java-junit)
9574        ("java-hamcrest-core" ,java-hamcrest-core)))))
9576 (define-public java-gson
9577   (package
9578     (name "java-gson")
9579     (version "2.8.2")
9580     (source (origin
9581               (method url-fetch)
9582               (uri (string-append "https://github.com/google/gson/archive/"
9583                                   "gson-parent-" version ".tar.gz"))
9584               (sha256
9585                (base32
9586                 "1j4qnp7v046q0k48c4kyf69sxaasx2h949d3cqwsm3kzxms3x0f9"))))
9587     (build-system ant-build-system)
9588     (arguments
9589      `(#:jar-name "gson.jar"
9590        #:source-dir "gson/src/main/java"
9591        #:test-dir "gson/src/test"))
9592     (native-inputs
9593      `(("java-junit" ,java-junit)
9594        ("java-hamcrest-core" ,java-hamcrest-core)))
9595     (home-page "https://github.com/google/gson")
9596     (synopsis "Java serialization/deserialization library from/to JSON")
9597     (description "Gson is a Java library that can be used to convert Java
9598 Objects into their JSON representation.  It can also be used to convert a JSON
9599 string to an equivalent Java object.  Gson can work with arbitrary Java objects
9600 including pre-existing objects that you do not have source-code of.")
9601     (license license:asl2.0)))
9603 (define-public java-hawtjni
9604   (package
9605     (name "java-hawtjni")
9606     (version "1.15")
9607     (source (origin
9608               (method url-fetch)
9609               (uri (string-append "https://github.com/fusesource/hawtjni/archive/"
9610                                   "hawtjni-project-" version ".tar.gz"))
9611               (sha256
9612                (base32
9613                 "1bqfd732rmh6svyx17fpw9175gc9gzkcbyps2yyrf50c3zzjas6g"))))
9614     (build-system ant-build-system)
9615     (arguments
9616      `(#:jar-name "hawtjni.jar"
9617        #:source-dir "hawtjni-generator/src/main/java:hawtjni-runtime/src/main/java"
9618        #:tests? #f; no tests
9619        #:phases
9620        (modify-phases %standard-phases
9621          (add-before 'build 'build-native
9622            (lambda* (#:key inputs #:allow-other-keys)
9623              (let ((include (string-append "-I" (assoc-ref inputs "jdk") "/include/linux")))
9624                (with-directory-excursion "hawtjni-generator/src/main/resources/"
9625                  (invoke "gcc" "-c" "hawtjni.c" "-o" "hawtjni.o"
9626                          "-fPIC" "-O2" include)
9627                  (invoke "gcc" "-c" "hawtjni-callback.c" "-o" "hawtjni-callback.o"
9628                          "-fPIC" "-O2" include)
9629                  (invoke "gcc" "-o" "libhawtjni.so" "-shared"
9630                          "hawtjni.o" "hawtjni-callback.o")))
9631              #t))
9632          (add-after 'install 'install-native
9633            (lambda* (#:key outputs #:allow-other-keys)
9634              (let* ((out (assoc-ref outputs "out"))
9635                     (lib (string-append out "/lib"))
9636                     (inc (string-append out "/include")))
9637                (with-directory-excursion "hawtjni-generator/src/main/resources/"
9638                  (install-file "libhawtjni.so" lib)
9639                  (install-file "hawtjni.h" inc)))
9640              #t)))))
9641     (inputs
9642      `(("java-commons-cli" ,java-commons-cli)
9643        ("java-asm" ,java-asm)
9644        ("java-geronimo-xbean-finder" ,java-geronimo-xbean-finder)))
9645     (home-page "https://fusesource.github.io/hawtjni/")
9646     (synopsis "JNI code generator")
9647     (description "HawtJNI is a code generator that produces the JNI code needed
9648 to implement Java native methods.  It is based on the jnigen code generator
9649 that is part of the SWT Tools project.")
9650     (license license:asl2.0)))
9652 (define-public java-jansi-native
9653   (package
9654     (name "java-jansi-native")
9655     (version "1.7")
9656     (source (origin
9657               (method url-fetch)
9658               (uri (string-append "https://github.com/fusesource/jansi-native/"
9659                                   "archive/jansi-native-" version ".tar.gz"))
9660               (sha256
9661                (base32
9662                 "0j2ydlgxbzbgshqkwghbxxxnbnx1mmjgd6k5fw6xfvxw1z956yqf"))))
9663     (build-system ant-build-system)
9664     (arguments
9665      `(#:jar-name "jansi-native.jar"
9666        #:source-dir "src/main/java"
9667        #:tests? #f; no tests
9668        #:phases
9669        (modify-phases %standard-phases
9670          (add-before 'build 'build-native
9671            (lambda* (#:key inputs #:allow-other-keys)
9672              ;; there are more required files for windows in windows/
9673              (with-directory-excursion "src/main/native-package/src"
9674                (substitute* "jansi_ttyname.c"
9675                  (("#include \"jansi_.*") ""))
9676                (invoke "gcc" "-c" "jansi_ttyname.c" "-o" "jansi_ttyname.o"
9677                        (string-append "-I" (assoc-ref inputs "java-hawtjni")
9678                                       "/include")
9679                        (string-append "-I" (assoc-ref inputs "jdk")
9680                                       "/include/linux")
9681                        "-fPIC" "-O2")
9682                (invoke "gcc" "-o" "libjansi.so" "-shared" "jansi_ttyname.o"))))
9683          (add-before 'build 'install-native
9684            (lambda _
9685              (let ((dir (string-append "build/classes/META-INF/native/"
9686                                        ,(match (%current-system)
9687                                           ((or "i686-linux" "armhf-linux")
9688                                            "linux32")
9689                                           ((or "x86_64-linux" "aarch64-linux"
9690                                                "mips64el-linux")
9691                                            "linux64")))))
9692                (install-file "src/main/native-package/src/libjansi.so" dir))
9693              #t))
9694          (add-after 'install 'install-native
9695            (lambda* (#:key outputs #:allow-other-keys)
9696              (install-file "src/main/native-package/src/jansi.h"
9697                            (string-append (assoc-ref outputs "out") "/include"))
9698              #t)))))
9699     (inputs
9700      `(("java-hawtjni" ,java-hawtjni)))
9701     (home-page "https://fusesource.github.io/jansi/")
9702     (synopsis "Native library for jansi")
9703     (description "This package provides the native library for jansi, a small
9704 Java library that allows you to use ANSI escape sequences to format your
9705 console output.")
9706     (license license:asl2.0)))
9708 (define-public java-jansi
9709   (package
9710     (name "java-jansi")
9711     (version "1.16")
9712     (source (origin
9713               (method url-fetch)
9714               (uri (string-append "https://github.com/fusesource/jansi/archive/"
9715                                   "jansi-project-" version ".tar.gz"))
9716               (sha256
9717                (base32
9718                 "11kh3144i3fzp21dpy8zg52mjmsr214k7km9p8ly0rqk2px0qq2z"))))
9719     (build-system ant-build-system)
9720     (arguments
9721      `(#:jar-name "jansi.jar"
9722        #:source-dir "jansi/src/main/java"
9723        #:test-dir "jansi/src/test"
9724        #:phases
9725        (modify-phases %standard-phases
9726          (add-after 'check 'clear-term
9727            (lambda _
9728              (invoke "echo" "-e" "\\e[0m"))))))
9729     (inputs
9730      `(("java-jansi-native" ,java-jansi-native)))
9731     (native-inputs
9732      `(("java-junit" ,java-junit)
9733        ("java-hamcrest-core" ,java-hamcrest-core)))
9734     (home-page "https://fusesource.github.io/jansi/")
9735     (synopsis "Portable ANSI escape sequences")
9736     (description "Jansi is a Java library that allows you to use ANSI escape
9737 sequences to format your console output which works on every platform.")
9738     (license license:asl2.0)))
9740 (define-public java-jboss-el-api-spec
9741   (package
9742     (name "java-jboss-el-api-spec")
9743     (version "3.0")
9744     (source (origin
9745               (method url-fetch)
9746               (uri (string-append "https://github.com/jboss/jboss-el-api_spec/"
9747                                   "archive/jboss-el-api_" version
9748                                   "_spec-1.0.7.Final.tar.gz"))
9749               (sha256
9750                (base32
9751                 "1j45ljxalwlibxl7g7iv952sjxkw275m8vyxxij8l6wdd5pf0pdh"))))
9752     (build-system ant-build-system)
9753     (arguments
9754      `(#:jar-name "java-jboss-el-api_spec.jar"
9755        #:jdk ,icedtea-8))
9756     (inputs
9757      `(("java-junit" ,java-junit)))
9758     (home-page "https://github.com/jboss/jboss-el-api_spec")
9759     (synopsis "JSR-341 expression language 3.0 API")
9760     (description "This package contains an implementation of the JSR-341
9761 specification for the expression language 3.0.  It implements an expression
9762 language inspired by ECMAScript and XPath.  This language is used with
9763 JavaServer Pages (JSP).")
9764     ;; Either GPL2 only or CDDL.
9765     (license (list license:gpl2 license:cddl1.1))))
9767 (define-public java-jboss-interceptors-api-spec
9768   (package
9769     (name "java-jboss-interceptors-api-spec")
9770     (version "1.2")
9771     (source (origin
9772               (method url-fetch)
9773               (uri (string-append "https://github.com/jboss/jboss-interceptors-api_spec/"
9774                                   "archive/jboss-interceptors-api_" version
9775                                   "_spec-1.0.0.Final.tar.gz"))
9776               (sha256
9777                (base32
9778                 "0wv8x0jp9a5qxlrgkhb5jdk2gr6vi87b4j4kjb8ryxiy9gn8g51z"))))
9779     (build-system ant-build-system)
9780     (arguments
9781      `(#:jar-name "java-jboss-interceptors-api_spec.jar"
9782        #:jdk ,icedtea-8
9783        #:source-dir "."
9784        #:tests? #f)); no tests
9785     (home-page "https://github.com/jboss/jboss-interceptors-api_spec")
9786     (synopsis "Interceptors 1.2 API classes from JSR 318")
9787     (description "Java-jboss-interceptors-api-spec implements the Interceptors
9788 API.  Interceptors are used to interpose on business method invocations and
9789 specific events.")
9790     ;; Either GPL2 only or CDDL.
9791     (license (list license:gpl2 license:cddl1.1))))
9793 (define-public java-cdi-api
9794   (package
9795     (name "java-cdi-api")
9796     (version "2.0")
9797     (source (origin
9798               (method url-fetch)
9799               (uri (string-append "https://github.com/cdi-spec/cdi/archive/"
9800                                   version ".tar.gz"))
9801               (file-name (string-append name "-" version ".tar.gz"))
9802               (sha256
9803                (base32
9804                 "1iv8b8bp07c5kmqic14jsr868vycjv4qv02lf3pkgp9z21mnfg5y"))))
9805     (build-system ant-build-system)
9806     (arguments
9807      `(#:source-dir "api/src/main/java"
9808        #:jar-name "java-cdi-api.jar"
9809        #:test-dir "api/src/test"
9810        #:jdk ,icedtea-8
9811        #:tests? #f)); Tests fail because we don't have a CDI provider yet
9812     (inputs
9813      `(("java-javax-inject" ,java-javax-inject)
9814        ("java-jboss-el-api-spec" ,java-jboss-el-api-spec)
9815        ("java-jboss-interceptors-api-spec" ,java-jboss-interceptors-api-spec)))
9816     (native-inputs
9817      `(("java-testng" ,java-testng)
9818        ("java-hamcrest-core" ,java-hamcrest-core)))
9819     (home-page "http://cdi-spec.org/")
9820     (synopsis "Contexts and Dependency Injection APIs")
9821     (description "Java-cdi-api contains the required APIs for Contexts and
9822 Dependency Injection (CDI).")
9823     (license license:asl2.0)))
9825 (define-public java-joda-convert
9826   (package
9827     (name "java-joda-convert")
9828     (version "1.9.2")
9829     (source (origin
9830               (method url-fetch)
9831               (uri (string-append "https://github.com/JodaOrg/joda-convert/archive/v"
9832                                   version ".tar.gz"))
9833               (file-name (string-append name "-" version ".tar.gz"))
9834               (sha256
9835                (base32
9836                 "0vp346xz7dh9br4q7xazhc7hvzf76a6hf95fki9bg67q5jr0kjh7"))))
9837     (build-system ant-build-system)
9838     (arguments
9839      `(#:jar-name (string-append ,name "-" ,version ".jar")
9840        #:source-dir "src/main/java"
9841        #:test-include (list "**/Test*.java")
9842        ;; Contains only interfaces and base classes (no test)
9843        #:test-exclude (list "**/test*/**.java")))
9844     (inputs
9845      `(("java-guava" ,java-guava)))
9846     (native-inputs
9847      `(("java-junit" ,java-junit)
9848        ("java-hamcrest-core" ,java-hamcrest-core)))
9849     (home-page "http://www.joda.org/joda-convert/")
9850     (synopsis "Conversion between Objects and Strings")
9851     (description "Joda-Convert provides a small set of classes to aid
9852 conversion between Objects and Strings.  It is not intended to tackle the
9853 wider problem of Object to Object transformation.")
9854     (license license:asl2.0)))
9856 (define-public java-joda-time
9857   (package
9858     (name "java-joda-time")
9859     (version "2.9.9")
9860     (source (origin
9861               (method url-fetch)
9862               (uri (string-append "https://github.com/JodaOrg/joda-time/archive/v"
9863                                   version ".tar.gz"))
9864               (file-name (string-append name "-" version ".tar.gz"))
9865               (sha256
9866                (base32
9867                 "1i9x91mi7yg2pasl0k3912f1pg46n37sps6rdb0v1gs8hj9ppwc1"))))
9868     (build-system ant-build-system)
9869     (arguments
9870      `(#:jar-name "java-joda-time.jar"
9871        #:source-dir "src/main/java"
9872        #:test-include (list "**/Test*.java")
9873        ;; There is no runnable test in these files
9874        #:test-exclude (list "**/Test*Chronology.java" "**/Test*Field.java")
9875        #:phases
9876        (modify-phases %standard-phases
9877          (add-after 'build 'build-resources
9878            (lambda _
9879              (mkdir-p "build/classes/org/joda/time/tz/data")
9880              (mkdir-p "build/classes/org/joda/time/format")
9881              ;; This will produce the following exception:
9882              ;; java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap"
9883              ;; which is normal, because it doesn't exist yet. It still generates
9884              ;; the same file as in the binary one can find on maven.
9885              (invoke "java" "-cp"
9886                      (string-append "build/classes:" (getenv "CLASSPATH"))
9887                      "org.joda.time.tz.ZoneInfoCompiler"
9888                      "-src" "src/main/java/org/joda/time/tz/src"
9889                      "-dst" "build/classes/org/joda/time/tz/data"
9890                      "africa" "antarctica" "asia" "australasia"
9891                      "europe" "northamerica" "southamerica"
9892                      "pacificnew" "etcetera" "backward" "systemv")
9893              (for-each (lambda (f)
9894                          (copy-file f (string-append
9895                                         "build/classes/org/joda/time/format/"
9896                                         (basename f))))
9897                (find-files "src/main/java/org/joda/time/format" ".*.properties"))
9898              #t))
9899          (add-before 'install 'regenerate-jar
9900            (lambda _
9901              ;; We need to regenerate the jar file to add generated data.
9902              (delete-file "build/jar/java-joda-time.jar")
9903              (invoke "ant" "jar")))
9904          (add-before 'check 'copy-test-resources
9905            (lambda _
9906              (mkdir-p "build/test-classes/org/joda/time/tz/data")
9907              (copy-file "src/test/resources/tzdata/ZoneInfoMap"
9908                         "build/test-classes/org/joda/time/tz/data/ZoneInfoMap")
9909              (copy-recursively "src/test/resources" "build/test-classes")
9910              #t)))))
9911     (inputs
9912      `(("java-joda-convert" ,java-joda-convert)))
9913     (native-inputs
9914      `(("java-junit" ,java-junit)
9915        ("java-hamcrest-core" ,java-hamcrest-core)
9916        ("tzdata" ,tzdata)))
9917     (home-page "http://www.joda.org/joda-time/")
9918     (synopsis "Replacement for the Java date and time classes")
9919     (description "Joda-Time is a replacement for the Java date and time
9920 classes prior to Java SE 8.")
9921     (license license:asl2.0)))
9923 (define-public java-xerces
9924   (package
9925     (name "java-xerces")
9926     (version "2.11.0")
9927     (source
9928      (origin
9929        (method url-fetch)
9930        (uri (string-append "mirror://apache/xerces/j/source/"
9931                            "Xerces-J-src." version ".tar.gz"))
9932        (sha256
9933         (base32 "1006igwy2lqrmjvdk64v8dg6qbk9c29pm8xxx7r87n0vnpvmx6pm"))
9934        (patches (search-patches
9935                  "java-xerces-xjavac_taskdef.patch"
9936                  "java-xerces-build_dont_unzip.patch"
9937                  "java-xerces-bootclasspath.patch"))))
9938     (build-system ant-build-system)
9939     (arguments
9940      `(#:tests? #f;; Test files are not present
9941        #:test-target "test"
9942        #:jdk ,icedtea-8
9943        #:phases
9944        (modify-phases %standard-phases
9945          (add-after 'unpack 'create-build.properties
9946           (lambda* (#:key inputs #:allow-other-keys)
9947             (let ((jaxp (assoc-ref inputs "java-jaxp"))
9948                   (resolver (assoc-ref inputs "java-apache-xml-commons-resolver")))
9949               (with-output-to-file "build.properties"
9950                 (lambda _
9951                   (format #t
9952                    "jar.jaxp = ~a/share/java/jaxp.jar~@
9953                    jar.apis-ext = ~a/share/java/jaxp.jar~@
9954                    jar.resolver = ~a/share/java/xml-resolver.jar~%"
9955                    jaxp jaxp resolver)))
9956               ;; Make xerces use our version of jaxp in tests
9957               (substitute* "build.xml"
9958                 (("xml-apis.jar")
9959                  (string-append jaxp "/share/java/jaxp.jar"))
9960                 (("\\$\\{tools.dir\\}/\\$\\{jar.apis\\}")
9961                  "${jar.apis}")))
9962             #t))
9963          (replace 'install (install-jars "build")))))
9964     (inputs
9965      `(("java-apache-xml-commons-resolver" ,java-apache-xml-commons-resolver)
9966        ("java-jaxp" ,java-jaxp)))
9967     (home-page "https://xerces.apache.org/xerces2-j/")
9968     (synopsis "Validating XML parser for Java with DOM level 3 support")
9969     (description "The Xerces2 Java parser is the reference implementation of
9970 XNI, the Xerces Native Interface, and also a fully conforming XML Schema
9971 processor.
9973 Xerces2-J supports the following standards and APIs:
9975 @itemize
9976 @item eXtensible Markup Language (XML) 1.0 Second Edition Recommendation
9977 @item Namespaces in XML Recommendation
9978 @item Document Object Model (DOM) Level 2 Core, Events, and Traversal and
9979       Range Recommendations
9980 @item Simple API for XML (SAX) 2.0.1 Core and Extension
9981 @item Java APIs for XML Processing (JAXP) 1.2.01
9982 @item XML Schema 1.0 Structures and Datatypes Recommendations
9983 @item Experimental implementation of the Document Object Model (DOM) Level 3
9984       Core and Load/Save Working Drafts
9985 @item Provides a partial implementation of the XML Inclusions (XInclude) W3C
9986       Candidate Recommendation
9987 @end itemize
9989 Xerces is now able to parse documents written according to the XML 1.1
9990 Candidate Recommendation, except that it does not yet provide an option to
9991 enable normalization checking as described in section 2.13 of this
9992 specification.  It also handles namespaces according to the XML Namespaces 1.1
9993 Candidate Recommendation, and will correctly serialize XML 1.1 documents if
9994 the DOM level 3 load/save API's are in use.")
9995     (license license:asl2.0)))
9997 (define-public java-jakarta-regexp
9998   (package
9999     (name "java-jakarta-regexp")
10000     (version "1.5")
10001     (source
10002       (origin
10003         (method url-fetch)
10004         (uri (string-append
10005               "https://archive.apache.org/dist/jakarta/regexp/jakarta-regexp-"
10006               version ".tar.gz"))
10007         (sha256
10008          (base32
10009           "0zg9rmyif48dck0cv6ynpxv23mmcsx265am1fnnxss7brgw0ms3r"))))
10010     (build-system ant-build-system)
10011     (arguments
10012      `(#:test-target "test"
10013        #:phases
10014        (modify-phases %standard-phases
10015           (replace 'install
10016             (lambda* (#:key outputs #:allow-other-keys)
10017               (let* ((out (assoc-ref outputs "out"))
10018                      (out-share (string-append out "/share/java")))
10019                 (mkdir-p out-share)
10020                 (for-each (lambda (name)
10021                             (install-file name out-share))
10022                           (find-files "build" "^jakarta-regexp-.*\\.jar$"))
10023                 #t))))))
10024     (home-page "https://attic.apache.org/projects/jakarta-regexp.html")
10025     (synopsis "Regular expression parser generator for Java.")
10026     (description "@code{jakarta-regexp} is an old regular expression parser
10027 generator for Java.")
10028     (license license:asl2.0)))
10030 (define-public java-jline
10031   (package
10032     (name "java-jline")
10033     (version "1.0")
10034     (source (origin
10035               (method url-fetch)
10036               (uri (string-append "https://github.com/jline/jline1/archive/jline-"
10037                                   version ".tar.gz"))
10038               (sha256
10039                (base32
10040                 "0bi3p6vrh7a6v0fbpb6rx9plpmx5zk3lr352xzdbz2jcxg499wir"))))
10041     (build-system ant-build-system)
10042     (arguments
10043      `(#:jar-name "jline.jar"
10044        #:source-dir "src/main/java"
10045        #:test-dir "src/test"
10046        #:phases
10047        (modify-phases %standard-phases
10048          (add-before 'build 'copy-resources
10049            (lambda _
10050              (copy-recursively "src/main/resources" "build/classes")
10051              #t)))))
10052     (native-inputs
10053      `(("java-junit" ,java-junit)))
10054     (home-page "https://jline.github.io")
10055     (synopsis "Console input handling library")
10056     (description "JLine is a Java library for handling console input.  It is
10057 similar in functionality to BSD editline and GNU readline but with additional
10058 features that bring it on par with the Z shell line editor.")
10059     (license license:bsd-3)))
10061 (define-public java-jline-2
10062   (package
10063     (inherit java-jline)
10064     (version "2.14.5")
10065     (source (origin
10066               (method url-fetch)
10067               (uri (string-append "https://github.com/jline/jline2/archive/jline-"
10068                                   version ".tar.gz"))
10069               (sha256
10070                (base32
10071                 "1c6qa26mf0viw8hg4jnv72s7i1qb1gh1l8rrzcdvqhqhx82rkdlf"))))
10072     (arguments
10073      `(#:jdk ,icedtea-8
10074        ,@(package-arguments java-jline)))
10075     (inputs
10076      `(("java-jansi" ,java-jansi)
10077        ("java-jansi-native" ,java-jansi-native)))
10078     (native-inputs
10079      `(("java-powermock-modules-junit4" ,java-powermock-modules-junit4)
10080        ("java-powermock-modules-junit4-common" ,java-powermock-modules-junit4-common)
10081        ("java-powermock-api-easymock" ,java-powermock-api-easymock)
10082        ("java-powermock-api-support" ,java-powermock-api-support)
10083        ("java-powermock-core" ,java-powermock-core)
10084        ("java-powermock-reflect" ,java-powermock-reflect)
10085        ("java-easymock" ,java-easymock)
10086        ("java-jboss-javassist" ,java-jboss-javassist)
10087        ("java-objenesis" ,java-objenesis)
10088        ("java-asm" ,java-asm)
10089        ("java-hamcrest-core" ,java-hamcrest-core)
10090        ("java-cglib" ,java-cglib)
10091        ("java-junit" ,java-junit)
10092        ("java-hawtjni" ,java-hawtjni)))))
10094 (define-public java-xmlunit
10095   (package
10096     (name "java-xmlunit")
10097     (version "2.5.1")
10098     (source (origin
10099               (method url-fetch)
10100               (uri (string-append "https://github.com/xmlunit/xmlunit/archive/v"
10101                                   version ".tar.gz"))
10102               (file-name (string-append name "-" version ".tar.gz"))
10103               (sha256
10104                (base32
10105                 "035rivlnmwhfqj0fzviciv0bkh1h95ps1iwnh2kjcvdbk5nccm4z"))))
10106     (build-system ant-build-system)
10107     (arguments
10108      `(#:jar-name "java-xmlunit.jar"
10109        #:source-dir "xmlunit-core/src/main/java"
10110        #:test-dir "xmlunit-core/src/test"
10111        #:phases
10112        (modify-phases %standard-phases
10113          (add-before 'check 'copy-test-resources
10114            (lambda* (#:key inputs #:allow-other-keys)
10115              (copy-recursively (assoc-ref inputs "resources") "../test-resources")
10116              #t)))))
10117     (native-inputs
10118      `(("java-junit" ,java-junit)
10119        ("java-mockito-1" ,java-mockito-1)
10120        ("java-hamcrest-all" ,java-hamcrest-all)
10121        ("java-objenesis" ,java-objenesis)
10122        ("java-asm" ,java-asm)
10123        ("java-cglib" ,java-cglib)
10124        ("resources"
10125         ,(origin
10126            (method git-fetch)
10127            (uri (git-reference
10128                   (url "https://github.com/xmlunit/test-resources.git")
10129                   (commit "a590d2ae865c3e0455691d76ba8eefccc2215aec")))
10130            (file-name "java-xmlunit-test-resources")
10131            (sha256
10132             (base32
10133              "0r0glj37pg5l868yjz78gckr91cs8fysxxbp9p328dssssi91agr"))))))
10134     (home-page "http://www.xmlunit.org/")
10135     (synopsis "XML output testing")
10136     (description "XMLUnit provides you with the tools to verify the XML you
10137 emit is the one you want to create.  It provides helpers to validate against
10138 an XML Schema, assert the values of XPath queries or compare XML documents
10139 against expected outcomes.")
10140     (license license:asl2.0)))
10142 (define-public java-xmlunit-legacy
10143   (package
10144     (inherit java-xmlunit)
10145     (name "java-xmlunit-legacy")
10146     (arguments
10147      `(#:jar-name "java-xmlunit-legacy.jar"
10148        #:source-dir "xmlunit-legacy/src/main/java"
10149        #:test-dir "xmlunit-legacy/src/test"))
10150     (inputs
10151      `(("java-xmlunit" ,java-xmlunit)
10152        ("java-junit" ,java-junit)))
10153     (native-inputs
10154      `(("java-mockito-1" ,java-mockito-1)))))
10156 (define-public java-xmlunit-matchers
10157   (package
10158     (inherit java-xmlunit)
10159     (name "java-xmlunit-matchers")
10160     (arguments
10161      `(#:jar-name "java-xmlunit-matchers.jar"
10162        #:source-dir "xmlunit-matchers/src/main/java"
10163        #:test-dir "xmlunit-matchers/src/test"
10164        #:test-exclude
10165        ;; Cannot open xsd for http://www.xmlunit.org/test-support/Book.xsd
10166        (list "**/ValidationMatcherTest.java")
10167        #:phases
10168        (modify-phases %standard-phases
10169          (add-before 'build 'copy-test-class
10170            (lambda _
10171              (copy-file "xmlunit-core/src/test/java/org/xmlunit/TestResources.java"
10172                         "xmlunit-matchers/src/test/java/org/xmlunit/TestResources.java")
10173              #t))
10174          (add-before 'build 'fix-test-resources-path
10175            (lambda _
10176              (substitute* (find-files "xmlunit-matchers/src/test" ".*.java")
10177                (("../test-resources") "test-resources"))
10178              #t))
10179          (add-before 'check 'copy-test-resources
10180            (lambda* (#:key inputs #:allow-other-keys)
10181              (copy-recursively (assoc-ref inputs "resources") "test-resources")
10182              #t)))))
10183     (inputs
10184      `(("java-xmlunit" ,java-xmlunit)
10185        ("java-junit" ,java-junit)))))
10187 (define-public java-openchart2
10188   (package
10189     (name "java-openchart2")
10190     (version "1.4.3")
10191     (source (origin
10192               (method url-fetch)
10193               (uri (string-append "http://download.approximatrix.com/openchart2/"
10194                                   "openchart2-" version ".source.zip"))
10195               (sha256
10196                (base32
10197                 "1xq96zm5r02n1blja0072jmmsifmxc40lbyfbnmcnr6mw42frh4g"))))
10198     (build-system ant-build-system)
10199     (arguments
10200      `(#:test-target "test"
10201        #:phases
10202        (modify-phases %standard-phases
10203          (add-after 'unpack 'fix-junit-errors
10204            (lambda _
10205              (with-directory-excursion "unittest/src/com/approximatrix/charting/"
10206                (substitute* '("coordsystem/ticklocator/NumericXTickLocatorTest.java"
10207                               "coordsystem/ticklocator/NumericYTickLocatorTest.java"
10208                               "coordsystem/ticklocator/ObjectXTickLocatorTest.java"
10209                               "model/DefaultChartDataModelConstraintsTest.java"
10210                               "model/MultiScatterDataModelConstraintsTest.java"
10211                               "model/threedimensional/DotPlotDataModelConstraintsTest.java")
10212                  (("(assertEquals[^;]+);" before _)
10213                   (string-append (string-drop-right before 2) ", 1E-6);"))))
10214              #t))
10215          (replace 'install (install-jars ".")))))
10216     (native-inputs
10217      `(("unzip" ,unzip)
10218        ("java-junit" ,java-junit)
10219        ("java-hamcrest-core" ,java-hamcrest-core)))
10220     (home-page "http://approximatrix.com/products/openchart2/")
10221     (synopsis "Simple plotting for Java")
10222     (description "Openchart2 provides a simple, yet powerful, interface for
10223 Java programmers to create two-dimensional charts and plots.  The library
10224 features an assortment of graph styles, including advanced scatter plots, bar
10225 graphs, and pie charts.")
10226     (license license:lgpl2.1+)))
10228 (define-public java-commons-httpclient
10229   (package
10230     (name "java-commons-httpclient")
10231     (version "3.1")
10232     (source (origin
10233               (method url-fetch)
10234               (uri (string-append "https://archive.apache.org/dist/httpcomponents/"
10235                                   "commons-httpclient/source/commons-httpclient-"
10236                                   version "-src.tar.gz"))
10237               (sha256
10238                (base32
10239                 "1wlpn3cfy3d4inxy6g7wxcsa8p7sshn6aldk9y4ia3lb879rd97r"))))
10240     (build-system ant-build-system)
10241     (arguments
10242      `(#:build-target "compile"
10243        #:test-target "test"
10244        #:tests? #f; requires junit-textui (junit 3)
10245        #:phases
10246        (modify-phases %standard-phases
10247          (add-before 'build 'fix-accent
10248            (lambda _
10249              (for-each (lambda (file)
10250                          (with-fluids ((%default-port-encoding "ISO-8859-1"))
10251                           (substitute* file
10252                             (("\\* @author Ortwin .*") "* @author Ortwin Glueck\n"))))
10253                '("src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java"
10254                  "src/examples/TrivialApp.java" "src/examples/ClientApp.java"
10255                  "src/test/org/apache/commons/httpclient/TestHttps.java"
10256                  "src/test/org/apache/commons/httpclient/TestURIUtil2.java"))
10257              #t))
10258          (replace 'install
10259            (lambda* (#:key outputs #:allow-other-keys)
10260              (invoke "ant" "dist"
10261                      (string-append "-Ddist.home=" (assoc-ref outputs "out")
10262                                     "/share/java"))
10263              #t)))))
10264     (propagated-inputs
10265      `(("java-commons-logging" ,java-commons-logging-minimal)
10266        ("java-commons-codec" ,java-commons-codec)))
10267     (home-page "https://hc.apache.org")
10268     (synopsis "HTTP/1.1 compliant HTTP agent implementation")
10269     (description "This package contains an HTTP/1.1 compliant HTTP agent
10270 implementation.  It also provides reusable components for client-side
10271 authentication, HTTP state management, and HTTP connection management.")
10272     (license license:asl2.0)))
10274 (define-public java-commons-vfs
10275   (package
10276     (name "java-commons-vfs")
10277     (version "2.2")
10278     (source (origin
10279               (method url-fetch)
10280               (uri (string-append "mirror://apache/commons/vfs/source/"
10281                                   "commons-vfs2-distribution-" version "-src.tar.gz"))
10282               (file-name (string-append name "-" version ".tar.gz"))
10283               (sha256
10284                (base32
10285                 "1cnq1iaghbp4cslpnvwbp83i5v234x87irssqynhwpfgw7caf1s3"))
10286               (modules '((guix build utils)))
10287               (snippet
10288                '(begin
10289                   (for-each delete-file
10290                             (find-files "." "\\.jar$"))
10291                   #t))))
10292     (build-system ant-build-system)
10293     (arguments
10294      `(#:jar-name "commons-vfs.jar"
10295        #:source-dir "commons-vfs2/src/main/java"
10296        #:test-dir "commons-vfs2/src/test"
10297        ; FIXME: tests depend on many things: apache sshd, hadoop, ftpserver, ...
10298        #:tests? #f
10299        #:phases
10300        (modify-phases %standard-phases
10301          (add-before 'build 'remove-hadoop-and-webdav
10302            ; Remove these files as they are not required and depend on difficult
10303            ; packages.
10304            (lambda _
10305              (for-each delete-file-recursively
10306                '("commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/webdav"
10307                  "commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs"))
10308              #t)))))
10309     (inputs
10310      `(("java-commons-collections4" ,java-commons-collections4)
10311        ("java-commons-compress" ,java-commons-compress)
10312        ("java-commons-httpclient" ,java-commons-httpclient)
10313        ("java-commons-logging-minimal" ,java-commons-logging-minimal)
10314        ("java-commons-net" ,java-commons-net)
10315        ("java-jsch" ,java-jsch)))
10316     (home-page "http://commons.apache.org/proper/commons-vfs/")
10317     (synopsis "Java file system library")
10318     (description "Commons VFS provides a single API for accessing various
10319 different file systems.  It presents a uniform view of the files from various
10320 different sources, such as the files on local disk, on an HTTP server, or
10321 inside a Zip archive.")
10322     (license license:asl2.0)))
10324 (define-public java-jakarta-oro
10325   (package
10326     (name "java-jakarta-oro")
10327     (version "2.0.8")
10328     (source (origin
10329               (method url-fetch)
10330               (uri (string-append "https://archive.apache.org/dist/jakarta/oro/"
10331                                   "jakarta-oro-" version ".tar.gz"))
10332               (sha256
10333                (base32
10334                 "0rpmnsskiwmsy8r0sckz5n5dbvh3vkxx8hpm177c754r8xy3qksc"))
10335               (modules '((guix build utils)))
10336               (snippet
10337                `(begin
10338                   (delete-file (string-append "jakarta-oro-" ,version ".jar"))
10339                   #t))))
10340     (build-system ant-build-system)
10341     (arguments
10342      `(#:build-target "package"
10343        #:tests? #f; tests are run as part of the build process
10344        #:phases
10345        (modify-phases %standard-phases
10346          (replace 'install
10347            (install-jars ,(string-append "jakarta-oro-" version))))))
10348     (home-page "https://jakarta.apache.org/oro/")
10349     (synopsis "Text-processing for Java")
10350     (description "The Jakarta-ORO Java classes are a set of text-processing
10351 Java classes that provide Perl5 compatible regular expressions, AWK-like
10352 regular expressions, glob expressions, and utility classes for performing
10353 substitutions, splits, filtering filenames, etc.  This library is the successor
10354 of the OROMatcher, AwkTools, PerlTools, and TextTools libraries originally
10355 from ORO, Inc.")
10356     (license license:asl1.1)))
10358 (define-public java-native-access
10359   (package
10360     (name "java-native-access")
10361     (version "4.5.1")
10362     (source (origin
10363               (method url-fetch)
10364               (uri (string-append "https://github.com/java-native-access/jna/"
10365                                   "archive/" version ".tar.gz"))
10366               (file-name (string-append name "-" version ".tar.gz"))
10367               (sha256
10368                (base32
10369                 "0zrpzkib6b905i018a9pqlzkqinphywr6y4jwv6mwp63jjqvqkd9"))
10370               (modules '((guix build utils)))
10371               (snippet
10372                 `(begin
10373                    (for-each delete-file (find-files "." ".*.jar"))
10374                    (delete-file-recursively "native/libffi")
10375                    (delete-file-recursively "dist")
10376                    #t))))
10377     (build-system ant-build-system)
10378     (arguments
10379      `(#:tests? #f; FIXME: tests require reflections.jar
10380        #:test-target "test"
10381        #:make-flags (list "-Ddynlink.native=true")
10382        #:phases
10383        (modify-phases %standard-phases
10384          (add-before 'build 'fix-build.xml
10385            (lambda* (#:key inputs #:allow-other-keys)
10386              (substitute* "build.xml"
10387                ;; Since we removed the bundled ant.jar, give the correct path
10388                (("lib/ant.jar") (string-append (assoc-ref inputs "ant") "/lib/ant.jar"))
10389                ;; We removed generated native libraries. We can only rebuild one
10390                ;; so don't fail if we can't find a native library for another architecture.
10391                (("zipfileset") "zipfileset erroronmissingarchive=\"false\""))
10392              ;; Copy test dependencies
10393              (copy-file (string-append (assoc-ref inputs "java-junit")
10394                                        "/share/java/junit.jar")
10395                         "lib/junit.jar")
10396              (copy-file (string-append (assoc-ref inputs "java-hamcrest-core")
10397                                        "/share/java/hamcrest-core.jar")
10398                         "lib/hamcrest-core.jar")
10399              ;; FIXME: once reflections.jar is built, copy it to lib/test.
10400              #t))
10401          (add-before 'build 'build-native
10402            (lambda _
10403              (invoke "ant" "-Ddynlink.native=true" "native")
10404              #t))
10405          (replace 'install
10406            (install-jars "build")))))
10407     (inputs
10408      `(("libffi" ,libffi)
10409        ("libx11" ,libx11)
10410        ("libxt" ,libxt)))
10411     (native-inputs
10412      `(("java-junit" ,java-junit)
10413        ("java-hamcrest-core" ,java-hamcrest-core)))
10414     (home-page "https://github.com/java-native-access/jna")
10415     (synopsis "Access to native shared libraries from Java")
10416     (description "JNA provides Java programs easy access to native shared
10417 libraries without writing anything but Java code - no JNI or native code is
10418 required.  JNA allows you to call directly into native functions using natural
10419 Java method invocation.")
10420     ;; Java Native Access project (JNA) is dual-licensed under 2
10421     ;; alternative Free licenses: LGPL 2.1 or later and Apache License 2.0.
10422     (license (list
10423                license:asl2.0
10424                license:lgpl2.1+))))
10426 (define-public java-native-access-platform
10427   (package
10428     (inherit java-native-access)
10429     (name "java-native-access-platform")
10430     (arguments
10431      `(#:test-target "test"
10432        #:tests? #f; require jna-test.jar
10433        #:phases
10434        (modify-phases %standard-phases
10435          (add-before 'build 'chdir
10436            (lambda _
10437              (chdir "contrib/platform")
10438              #t))
10439          (add-after 'chdir 'fix-ant
10440            (lambda* (#:key inputs #:allow-other-keys)
10441              (substitute* "nbproject/project.properties"
10442                (("../../build/jna.jar")
10443                 (string-append (assoc-ref inputs "java-native-access")
10444                                "/share/java/jna.jar"))
10445                (("../../lib/hamcrest-core-.*.jar")
10446                 (string-append (assoc-ref inputs "java-hamcrest-core")
10447                                "/share/java/hamcrest-core.jar"))
10448                (("../../lib/junit.jar")
10449                 (string-append (assoc-ref inputs "java-junit")
10450                                "/share/java/junit.jar")))
10451              #t))
10452          (replace 'install
10453            (install-jars "dist")))))
10454     (inputs
10455      `(("java-native-access" ,java-native-access)))
10456     (synopsis "Cross-platform mappings for jna")
10457     (description "java-native-access-platfrom has cross-platform mappings
10458 and mappings for a number of commonly used platform functions, including a
10459 large number of Win32 mappings as well as a set of utility classes that
10460 simplify native access.")))
10462 (define-public java-jsch-agentproxy-core
10463   (package
10464     (name "java-jsch-agentproxy-core")
10465     (version "0.0.8")
10466     (source (origin
10467               (method url-fetch)
10468               (uri (string-append "https://github.com/ymnk/jsch-agent-proxy/archive/"
10469                                   version ".tar.gz"))
10470               (file-name (string-append name "-" version ".tar.gz"))
10471               (sha256
10472                (base32
10473                 "02iqg6jbc1kxvfzqcg6wy9ygqxfm82bw5rf6vnswqy4y572niz4q"))))
10474     (build-system ant-build-system)
10475     (arguments
10476      `(#:jar-name "jsch-agentproxy-core.jar"
10477        #:source-dir "jsch-agent-proxy-core/src/main/java"
10478        #:tests? #f)); no tests
10479     (home-page "https://github.com/ymnk/jsch-agent-proxy")
10480     (synopsis "Core component of the proxy to ssh-agent and Pageant in Java")
10481     (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
10482 and Pageant included Putty.  It will be easily integrated into JSch, and users
10483 will be allowed to use these programs for authentication.")
10484     (license license:bsd-3)))
10486 (define-public java-jsch-agentproxy-sshagent
10487   (package
10488     (inherit java-jsch-agentproxy-core)
10489     (name "java-jsch-agentproxy-sshagent")
10490     (arguments
10491      `(#:jar-name "jsch-agentproxy-sshagent.jar"
10492        #:source-dir "jsch-agent-proxy-sshagent/src/main/java"
10493        #:tests? #f)); no tests
10494     (inputs
10495      `(("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)))
10496     (synopsis "Proxy to ssh-agent")
10497     (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
10498 and Pageant included in Putty. This component contains the code for a proxy to
10499 ssh-agent.")))
10501 (define-public java-jsch-agentproxy-usocket-jna
10502   (package
10503     (inherit java-jsch-agentproxy-core)
10504     (name "java-jsch-agentproxy-usocket-jna")
10505     (arguments
10506      `(#:jar-name "jsch-agentproxy-usocket-jna.jar"
10507        #:source-dir "jsch-agent-proxy-usocket-jna/src/main/java"
10508        #:tests? #f)); no tests
10509     (inputs
10510      `(("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)
10511        ("java-native-access" ,java-native-access)))
10512     (synopsis "USocketFactory implementation using JNA")
10513     (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
10514 and Pageant included in Putty. This component contains an implementation of
10515 USocketFactory using @dfn{JNA} (Java Native Access).")))
10517 (define-public java-jsch-agentproxy-pageant
10518   (package
10519     (inherit java-jsch-agentproxy-core)
10520     (name "java-jsch-agentproxy-pageant")
10521     (arguments
10522      `(#:jar-name "jsch-agentproxy-pageant.jar"
10523        #:source-dir "jsch-agent-proxy-pageant/src/main/java"
10524        #:tests? #f)); no tests
10525     (inputs
10526      `(("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)
10527        ("java-native-access" ,java-native-access)
10528        ("java-native-access-platform" ,java-native-access-platform)))
10529     (synopsis "Proxy to pageant")
10530     (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
10531 and Pageant included in Putty. This component contains the code for a proxy to
10532 pageant.")))
10534 (define-public java-jsch-agentproxy-usocket-nc
10535   (package
10536     (inherit java-jsch-agentproxy-core)
10537     (name "java-jsch-agentproxy-usocket-nc")
10538     (arguments
10539      `(#:jar-name "jsch-agentproxy-usocket-nc.jar"
10540        #:source-dir "jsch-agent-proxy-usocket-nc/src/main/java"
10541        #:tests? #f)); no tests
10542     (inputs
10543      `(("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)))
10544     (synopsis "USocketFactory implementation using netcat")
10545     (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
10546 and Pageant included in Putty. This component contains an implementation of
10547 USocketFactory using netcat.")))
10549 (define-public java-jsch-agentproxy-connector-factory
10550   (package
10551     (inherit java-jsch-agentproxy-core)
10552     (name "java-jsch-agentproxy-connector-factory")
10553     (arguments
10554      `(#:jar-name "jsch-agentproxy-connector-factory.jar"
10555        #:source-dir "jsch-agent-proxy-connector-factory/src/main/java"
10556        #:tests? #f)); no tests
10557     (inputs
10558      `(("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)
10559        ("java-jsch-agentproxy-sshagent" ,java-jsch-agentproxy-sshagent)
10560        ("java-jsch-agentproxy-usocket-jna" ,java-jsch-agentproxy-usocket-jna)
10561        ("java-jsch-agentproxy-pageant" ,java-jsch-agentproxy-pageant)
10562        ("java-jsch-agentproxy-usocket-nc" ,java-jsch-agentproxy-usocket-nc)))
10563     (synopsis "Connector factory for jsch agent proxy")
10564     (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
10565 and Pageant included in Putty. This component contains a connector factory.")))
10567 (define-public java-jsch-agentproxy-jsch
10568   (package
10569     (inherit java-jsch-agentproxy-core)
10570     (name "java-jsch-agentproxy-jsch")
10571     (arguments
10572      `(#:jar-name "jsch-agentproxy-jsch.jar"
10573        #:source-dir "jsch-agent-proxy-jsch/src/main/java"
10574        #:tests? #f)); no tests
10575     (inputs
10576      `(("java-jsch" ,java-jsch)
10577        ("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)))
10578     (synopsis "JSch integration library for agentproxy")
10579     (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
10580 and Pageant included in Putty. This component contains a library to use
10581 jsch-agent-proxy with JSch.")))
10583 (define-public java-apache-ivy
10584   (package
10585     (name "java-apache-ivy")
10586     (version "2.4.0")
10587     (source (origin
10588               (method url-fetch)
10589               (uri (string-append "mirror://apache//ant/ivy/" version
10590                                   "/apache-ivy-" version "-src.tar.gz"))
10591               (sha256
10592                (base32
10593                 "1xkfn57g2m7l6y0xdq75x5rnrgk52m9jx2xah70g3ggl8750hbr0"))
10594               (patches
10595                 (search-patches
10596                   "java-apache-ivy-port-to-latest-bouncycastle.patch"))))
10597     (build-system ant-build-system)
10598     (arguments
10599      `(#:jar-name "ivy.jar"
10600        #:tests? #f
10601        #:phases
10602        (modify-phases %standard-phases
10603          (add-before 'build 'remove-example
10604            (lambda _
10605              (delete-file-recursively "src/example")
10606              #t))
10607          (add-before 'build 'copy-resources
10608            (lambda _
10609              (with-directory-excursion "src/java"
10610                (for-each (lambda (file)
10611                            (install-file file (string-append "../../build/classes/" (dirname file))))
10612                  (append
10613                    (find-files "." ".*.css")
10614                    (find-files "." ".*.ent")
10615                    (find-files "." ".*.html")
10616                    (find-files "." ".*.properties")
10617                    (find-files "." ".*.xsd")
10618                    (find-files "." ".*.xsl")
10619                    (find-files "." ".*.xml"))))
10620              #t))
10621          (add-before 'build 'fix-vfs
10622            (lambda _
10623              (substitute*
10624                '("src/java/org/apache/ivy/plugins/repository/vfs/VfsRepository.java"
10625                  "src/java/org/apache/ivy/plugins/repository/vfs/VfsResource.java")
10626                (("import org.apache.commons.vfs") "import org.apache.commons.vfs2"))
10627              #t))
10628          (add-before 'install 'copy-manifest
10629            (lambda _
10630              (install-file "META-INF/MANIFEST.MF" "build/classes/META-INF")
10631              #t))
10632          (add-before 'install 'repack
10633            (lambda _
10634              (invoke "jar" "-cmf" "build/classes/META-INF/MANIFEST.MF" "build/jar/ivy.jar"
10635                      "-C" "build/classes" ".")))
10636          (add-after 'install 'install-bin
10637            (lambda* (#:key outputs #:allow-other-keys)
10638              (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
10639                     (ivy (string-append bin "/ivy"))
10640                     (jar (string-append (assoc-ref outputs "out") "/share/java/ivy.jar")))
10641                (mkdir-p bin)
10642                (with-output-to-file ivy
10643                  (lambda _
10644                    (display (string-append
10645                               "#!" (which "sh") "\n"
10646                               "if [[ -z $CLASSPATH ]]; then\n"
10647                               "  cp=\"" (getenv "CLASSPATH") ":" jar "\"\n"
10648                               "else\n"
10649                               "  cp=\"" (getenv "CLASSPATH") ":" jar ":$CLASSPATH\"\n"
10650                               "fi\n"
10651                               (which "java") " -cp $cp org.apache.ivy.Main $@\n"))))
10652                (chmod ivy #o755)
10653                #t))))))
10654     (inputs
10655      `(("java-bouncycastle" ,java-bouncycastle)
10656        ("java-commons-cli" ,java-commons-cli)
10657        ("java-commons-collections" ,java-commons-collections)
10658        ("java-commons-httpclient" ,java-commons-httpclient)
10659        ("java-commons-lang" ,java-commons-lang)
10660        ("java-commons-vfs" ,java-commons-vfs)
10661        ("java-jakarta-oro" ,java-jakarta-oro)
10662        ("java-jsch" ,java-jsch)
10663        ("java-jsch-agentproxy-core" ,java-jsch-agentproxy-core)
10664        ("java-jsch-agentproxy-connector-factory" ,java-jsch-agentproxy-connector-factory)
10665        ("java-jsch-agentproxy-jsch" ,java-jsch-agentproxy-jsch)
10666        ("java-junit" ,java-junit)))
10667     (home-page "https://ant.apache.org/ivy")
10668     (synopsis "Dependency manager for the Java programming language")
10669     (description "Ivy is a tool for managing (recording, tracking, resolving
10670 and reporting) project dependencies.  It is characterized by the following:
10672 @itemize
10673 @item flexibility and configurability - Ivy is essentially process agnostic
10674       and is not tied to any methodology or structure.  Instead it provides the
10675       necessary flexibility and configurability to be adapted to a broad range
10676       of dependency management and build processes.
10677 @item tight integration with Apache Ant - while available as a standalone tool,
10678       Ivy works particularly well with Apache Ant providing a number of
10679       powerful Ant tasks ranging from dependency resolution to dependency
10680       reporting and publication.
10681 @end itemize")
10682     (license license:asl2.0)))
10684 (define-public java-eclipse-sisu-inject
10685   (package
10686     (name "java-eclipse-sisu-inject")
10687     (version "0.3.3")
10688     (source (origin
10689               (method git-fetch)
10690               (uri (git-reference
10691                      (url "https://github.com/eclipse/sisu.inject/")
10692                      (commit "releases/0.3.3")))
10693               (file-name (git-file-name name version))
10694               (sha256
10695                (base32
10696                 "0gibc9x0bw0f4ls086fx73610fcspz9g2as7kcpcfhvl5znysvg7"))))
10697     (build-system ant-build-system)
10698     (arguments
10699      `(#:jar-name "eclipse-sisu-inject.jar"
10700        #:source-dir "org.eclipse.sisu.inject/src"
10701        #:jdk ,icedtea-8
10702        #:tests? #f)); no tests
10703     (inputs
10704      `(("java-guice" ,java-guice)
10705        ("java-guice-servlet" ,java-guice-servlet)
10706        ("java-javax-inject" ,java-javax-inject)
10707        ("java-javaee-servletapi" ,java-javaee-servletapi)
10708        ("java-junit" ,java-junit)
10709        ("java-slf4j-api" ,java-slf4j-api)
10710        ("java-jsr305" ,java-jsr305)
10711        ("java-jsr250" ,java-jsr250)
10712        ("java-cdi-api" ,java-cdi-api)
10713        ("java-osgi-framework" ,java-osgi-framework)
10714        ("java-osgi-util-tracker" ,java-osgi-util-tracker)
10715        ("java-testng" ,java-testng)))
10716     (home-page "https://www.eclipse.org/sisu/")
10717     (synopsis "Classpath scanning, auto-binding, and dynamic auto-wiring")
10718     (description "Sisu is a modular JSR330-based container that supports
10719 classpath scanning, auto-binding, and dynamic auto-wiring.  Sisu uses
10720 Google-Guice to perform dependency injection and provide the core JSR330
10721 support, but removes the need to write explicit bindings in Guice modules.
10722 Integration with other containers via the Eclipse Extension Registry and the
10723 OSGi Service Registry is a goal of this project.")
10724     (license license:epl1.0)))
10726 (define-public java-eclipse-sisu-plexus
10727   (package
10728     (name "java-eclipse-sisu-plexus")
10729     (version "0.3.3")
10730     (source (origin
10731               (method url-fetch)
10732               (uri (string-append "https://github.com/eclipse/sisu.plexus/"
10733                                   "archive/releases/" version ".tar.gz"))
10734               (sha256
10735                (base32
10736                 "0lbj7nxy5j0z71k407zbb82icfqh7midrfk0fb3fa3jzdjz0d9d9"))
10737               (modules '((guix build utils)))
10738               (snippet
10739                '(begin
10740                   (for-each delete-file (find-files "." ".*.jar"))
10741                   (rename-file "org.eclipse.sisu.plexus.tests/src"
10742                                "org.eclipse.sisu.plexus.tests/java")
10743                   #t))))
10744     (build-system ant-build-system)
10745     (arguments
10746      `(#:jar-name "eclipse-sisu-plexus.jar"
10747        #:source-dir "org.eclipse.sisu.plexus/src"
10748        #:test-dir "org.eclipse.sisu.plexus.tests"
10749        #:test-exclude
10750        (list
10751          ;; This test fails probably because we can't generate the necessary
10752          ;; meta-inf files.
10753          "**/PlexusLoggingTest.*"
10754          ;; FIXME: This test fails because of some injection error
10755          "**/PlexusRequirementTest.*")
10756        #:jdk ,icedtea-8
10757        #:phases
10758        (modify-phases %standard-phases
10759          (add-before 'build 'copy-resources
10760            (lambda _
10761              (install-file "org.eclipse.sisu.plexus/META-INF/plexus/components.xml"
10762                            "build/classes/META-INF/plexus")
10763              #t))
10764          (add-before 'check 'build-test-jar
10765            (lambda _
10766              (with-directory-excursion "org.eclipse.sisu.plexus.tests/resources/component-jar/src/main/"
10767                (mkdir "build")
10768                (with-directory-excursion "java"
10769                  (apply invoke "javac" "-cp"
10770                         (string-append (getenv "CLASSPATH")
10771                                        ":../../../../../build/classes")
10772                         (find-files "." ".*.java"))
10773                  (for-each (lambda (file) (install-file file (string-append "../build/" file)))
10774                            (find-files "." ".*.jar")))
10775                (mkdir-p "build/META-INF/plexus")
10776                (copy-file "resources/META-INF/plexus/components.xml"
10777                           "build/META-INF/plexus/components.xml")
10778                (with-directory-excursion "build"
10779                  (invoke "jar" "cf" "../../../component-jar-0.1.jar" ".")))
10780              (with-directory-excursion "org.eclipse.sisu.plexus.tests/"
10781                (copy-recursively "META-INF" "../build/test-classes/META-INF")
10782                (substitute* "java/org/eclipse/sisu/plexus/DefaultPlexusContainerTest.java"
10783                  (("resources/component-jar")
10784                   "org.eclipse.sisu.plexus.tests/resources/component-jar")))
10785              #t)))))
10786     (inputs
10787      `(("java-plexus-classworlds" ,java-plexus-classworlds)
10788        ("java-plexus-util" ,java-plexus-utils)
10789        ("java-plexus-component-annotations" ,java-plexus-component-annotations)
10790        ("java-osgi-framework" ,java-osgi-framework)
10791        ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
10792        ("java-guice" ,java-guice)
10793        ("java-javax-inject" ,java-javax-inject)
10794        ("java-slf4j-api" ,java-slf4j-api)
10795        ("java-junit" ,java-junit)))
10796     (native-inputs
10797      `(("java-guava" ,java-guava)
10798        ("java-aopalliance" ,java-aopalliance)
10799        ("java-cglib" ,java-cglib)
10800        ("java-asm" ,java-asm)))
10801     (home-page "https://www.eclipse.org/sisu/")
10802     (synopsis "Plexus support for the sisu container")
10803     (description "Sisu is a modular JSR330-based container that supports
10804 classpath scanning, auto-binding, and dynamic auto-wiring.  This package
10805 adds Plexus support to the Sisu-Inject container.")
10806     (license license:epl1.0)))
10808 (define-public java-commons-compiler
10809   (package
10810     (name "java-commons-compiler")
10811     (version "3.0.8")
10812     (source (origin
10813               (method git-fetch)
10814               (uri (git-reference
10815                      (url "https://github.com/janino-compiler/janino")
10816                      (commit "91aa95686d1e4ca3b16a984a03a38686572331b2")))
10817               (file-name (string-append name "-" version))
10818               (sha256
10819                (base32
10820                 "04hfdl59sgh20qkxzgnibvs8f9hy6n7znxwpk611y5d89977y62r"))
10821               (modules '((guix build utils)))
10822               (snippet
10823                '(begin
10824                   (for-each delete-file
10825                             (find-files "." "\\.jar$"))
10826                   #t))))
10827     (build-system ant-build-system)
10828     (arguments
10829      `(#:jar-name "commons-compiler.jar"
10830        #:source-dir "commons-compiler/src/main"
10831        #:tests? #f)); no tests
10832     (home-page "https://github.com/janino-compiler/janino")
10833     (synopsis "Java compiler")
10834     (description "Commons-compiler contains an API for janino, including the
10835 @code{IExpressionEvaluator}, @code{IScriptEvaluator}, @code{IClassBodyEvaluator}
10836 and @code{ISimpleCompiler} interfaces.")
10837     (license license:bsd-3)))
10839 (define-public java-janino
10840   (package
10841     (inherit java-commons-compiler)
10842     (name "java-janino")
10843     (arguments
10844      `(#:jar-name "janino.jar"
10845        #:source-dir "src/main/java"
10846        #:phases
10847        (modify-phases %standard-phases
10848          (add-before 'configure 'chdir
10849            (lambda _
10850              (chdir "janino")
10851              #t)))))
10852     (inputs
10853      `(("java-commons-compiler" ,java-commons-compiler)))
10854     (native-inputs
10855      `(("java-junit" ,java-junit)
10856        ("java-hamcrest-core" ,java-hamcrest-core)))
10857     (description "Janino is a Java compiler.  Janino can compile a set of
10858 source files to a set of class files like @code{javac}, but also compile a
10859 Java expression, block, class body or source file in memory, load the bytecode
10860 and execute it directly in the same JVM.  @code{janino} can also be used for
10861 static code analysis or code manipulation.")))
10863 (define-public java-logback-core
10864   (package
10865     (name "java-logback-core")
10866     (version "1.2.3")
10867     (source (origin
10868               (method url-fetch)
10869               (uri (string-append "https://github.com/qos-ch/logback/archive/v_"
10870                                   version ".tar.gz"))
10871               (file-name (string-append name "-" version ".tar.gz"))
10872               (sha256
10873                (base32
10874                 "1x6ga74yfgm94cfx98gybakbrlilx8i2gn6dx13l40kasmys06mi"))
10875               (modules '((guix build utils)))
10876               (snippet
10877                '(begin
10878                   (delete-file-recursively "logback-access/lib")
10879                   #t))))
10880     (build-system ant-build-system)
10881     (arguments
10882      `(#:jar-name "logback.jar"
10883        #:source-dir "src/main/java"
10884        #:test-dir "src/test"
10885        #:test-exclude
10886        ;; These tests fail with Unable to set MockitoNamingPolicy on cglib generator
10887        ;; which creates FastClasses
10888        (list "**/AllCoreTest.*"
10889              "**/AutoFlushingObjectWriterTest.*"
10890              "**/PackageTest.*"
10891              "**/ResilientOutputStreamTest.*"
10892              ;; And we still don't want to run abstract classes
10893              "**/Abstract*.*")
10894        #:phases
10895        (modify-phases %standard-phases
10896          (add-before 'configure 'chdir
10897            (lambda _
10898              (chdir "logback-core")
10899              #t)))))
10900     (inputs
10901      `(("java-javax-mail" ,java-javax-mail)
10902        ("servlet" ,java-javaee-servletapi)
10903        ("java-commons-compiler" ,java-commons-compiler)
10904        ("java-janino" ,java-janino)))
10905     (native-inputs
10906      `(("java-junit" ,java-junit)
10907        ("java-hamcrest-core" ,java-hamcrest-core)
10908        ("java-mockito-1" ,java-mockito-1)
10909        ("java-cglib" ,java-cglib)
10910        ("java-asm" ,java-asm)
10911        ("java-objenesis" ,java-objenesis)
10912        ("java-joda-time" ,java-joda-time)))
10913     (home-page "https://logback.qos.ch")
10914     (synopsis "Logging for java")
10915     (description "Logback is intended as a successor to the popular log4j project.
10916 This module lays the groundwork for the other two modules.")
10917     ;; Either epl1.0 or lgpl2.1
10918     (license (list license:epl1.0
10919                    license:lgpl2.1))))
10921 (define-public java-logback-classic
10922   (package
10923     (inherit java-logback-core)
10924     (name "java-logback-classic")
10925     (arguments
10926      `(#:jar-name "logback-classic.jar"
10927        #:source-dir "src/main/java"
10928        #:test-dir "src/test"
10929        #:tests? #f; tests require more packages: h2, greenmail, hsql, subethamail, slf4j, log4j, felix
10930        #:jdk ,icedtea-8
10931        #:phases
10932        (modify-phases %standard-phases
10933          (add-before 'configure 'chdir
10934            (lambda _
10935              (chdir "logback-classic")
10936              #t))
10937          (replace 'build
10938            (lambda* (#:key inputs #:allow-other-keys)
10939              (mkdir-p "build/classes")
10940              (setenv "CLASSPATH"
10941                      (string-join
10942                        (apply append (map (lambda (input)
10943                                             (find-files (assoc-ref inputs input)
10944                                                         ".*.jar"))
10945                                           '("java-logback-core" "java-slf4j-api"
10946                                             "java-commons-compiler" "servlet"
10947                                             "groovy")))
10948                        ":"))
10949              (apply invoke "groovyc" "-d" "build/classes" "-j"
10950                     (find-files "src/main/" ".*\\.(groovy|java)$"))
10951              (invoke "ant" "jar")
10952              #t)))))
10953     (inputs
10954      `(("java-logback-core" ,java-logback-core)
10955        ("java-slf4j-api" ,java-slf4j-api)
10956        ,@(package-inputs java-logback-core)))
10957     (native-inputs
10958      `(("groovy" ,groovy)))
10959     (description "Logback is intended as a successor to the popular log4j project.
10960 This module can be assimilated to a significantly improved version of log4j.
10961 Moreover, @code{logback-classic} natively implements the slf4j API so that you
10962 can readily switch back and forth between logback and other logging frameworks
10963 such as log4j or @code{java.util.logging} (JUL).")))
10965 (define-public java-qdox
10966   (package
10967     (name "java-qdox")
10968     ; Newer version exists, but this version is required by java-plexus-component-metadata
10969     (version "2.0-M2")
10970     (source (origin
10971               (method url-fetch)
10972               ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
10973               ;; Older releases at https://github.com/codehaus/qdox/
10974               ;; Note: The release at maven is pre-generated. The release at
10975               ;; github requires jflex.
10976               (uri (string-append "http://central.maven.org/maven2/"
10977                                   "com/thoughtworks/qdox/qdox/" version
10978                                   "/qdox-" version "-sources.jar"))
10979               (sha256
10980                (base32
10981                 "10xxrcaicq6axszcr2jpygisa4ch4sinyx5q7kqqxv4lknrmxp5x"))))
10982     (build-system ant-build-system)
10983     (arguments
10984      `(#:jar-name "qdox.jar"
10985        #:tests? #f)); no tests
10986     (home-page "http://qdox.codehaus.org/")
10987     (synopsis "Parse definitions from Java source files")
10988     (description "QDox is a high speed, small footprint parser for extracting
10989 class/interface/method definitions from source files complete with JavaDoc
10990 @code{@@tags}.  It is designed to be used by active code generators or
10991 documentation tools.")
10992     (license license:asl2.0)))
10994 (define-public java-jgit
10995   (package
10996     (name "java-jgit")
10997     (version "4.7.0.201704051617-r")
10998     (source (origin
10999               (method url-fetch)
11000               (uri (string-append "https://repo1.maven.org/maven2/"
11001                                   "org/eclipse/jgit/org.eclipse.jgit/"
11002                                   version "/org.eclipse.jgit-"
11003                                   version "-sources.jar"))
11004               (sha256
11005                (base32
11006                 "13ii4jn02ynzq6i7gsyi21k2i94jpc85wf6bcm31q4cyvzv0mk4k"))))
11007     (build-system ant-build-system)
11008     (arguments
11009      `(#:tests? #f                      ; There are no tests to run.
11010        #:jar-name "jgit.jar"
11011        ;; JGit must be built with a JDK supporting Java 8.
11012        #:jdk ,icedtea-8
11013        ;; Target our older default JDK.
11014        #:make-flags (list "-Dtarget=1.7")
11015        #:phases
11016        (modify-phases %standard-phases
11017          ;; The jar file generated by the default build.xml does not include
11018          ;; the text properties files, so we need to add them.
11019          (add-after 'build 'add-properties
11020            (lambda* (#:key jar-name #:allow-other-keys)
11021              (with-directory-excursion "src"
11022                (apply invoke "jar" "-uf"
11023                       (string-append "../build/jar/" jar-name)
11024                       (find-files "." "\\.properties$")))
11025              #t)))))
11026     (inputs
11027      `(("java-classpathx-servletapi" ,java-classpathx-servletapi)
11028        ("java-javaewah" ,java-javaewah)
11029        ("java-jsch" ,java-jsch)
11030        ("java-slf4j-api" ,java-slf4j-api)))
11031     (home-page "https://eclipse.org/jgit/")
11032     (synopsis "Java library implementing the Git version control system")
11033     (description "JGit is a lightweight, pure Java library implementing the
11034 Git version control system, providing repository access routines, support for
11035 network protocols, and core version control algorithms.")
11036     (license license:edl1.0)))
11038 ;; For axoloti.  This package can still be built with icedtea-7, which is
11039 ;; currently used as the default JDK.
11040 (define-public java-jgit-4.2
11041   (package (inherit java-jgit)
11042     (version "4.2.0.201601211800-r")
11043     (source (origin
11044               (method url-fetch)
11045               (uri (string-append "https://repo1.maven.org/maven2/"
11046                                   "org/eclipse/jgit/org.eclipse.jgit/"
11047                                   version "/org.eclipse.jgit-"
11048                                   version "-sources.jar"))
11049               (sha256
11050                (base32
11051                 "15gm537iivhnzlkjym4x3wn5jqdjdragsw9pdpzqqg21nrc817mm"))))
11052     (build-system ant-build-system)
11053     (arguments
11054      (substitute-keyword-arguments (package-arguments java-jgit)
11055        ;; Build for default JDK.
11056        ((#:jdk _) icedtea-7)
11057        ((#:phases phases)
11058         `(modify-phases ,phases
11059            (add-after 'unpack 'use-latest-javaewah-API
11060              (lambda _
11061                (substitute* "src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java"
11062                  (("wordinbits") "WORD_IN_BITS"))
11063                #t))))))
11064     (inputs
11065      `(("java-javaewah" ,java-javaewah)
11066        ("java-jsch" ,java-jsch)
11067        ("java-slf4j-api" ,java-slf4j-api)))))