projects/guix·blob dexed · refs

14828 lines · 617.9 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015-2024 Ricardo Wurmus <[email protected]>
3;;; Copyright © 2016 Leo Famulari <[email protected]>
4;;; Copyright © 2016, 2017 Roel Janssen <[email protected]>
5;;; Copyright © 2017, 2019, 2021 Carlo Zancanaro <[email protected]>
6;;; Copyright © 2017-2022 Julien Lepiller <[email protected]>
7;;; Copyright © 2017 Thomas Danckaert <[email protected]>
8;;; Copyright © 2016, 2017, 2018 Alex Vong <[email protected]>
9;;; Copyright © 2017, 2019, 2021 Tobias Geerinckx-Rice <[email protected]>
10;;; Copyright © 2018, 2019 Gábor Boskovits <[email protected]>
11;;; Copyright © 2018 Chris Marusich <[email protected]>
12;;; Copyright © 2018-2024 Efraim Flashner <[email protected]>
13;;; Copyright © 2019, 2020, 2021 Björn Höfling <[email protected]>
14;;; Copyright © 2020, 2025 Janneke Nieuwenhuizen <[email protected]>
15;;; Copyright © 2020 Raghav Gururajan <[email protected]>
16;;; Copyright © 2020, 2022, 2025 Maxim Cournoyer <[email protected]>
17;;; Copyright © 2021 Vincent Legoll <[email protected]>
18;;; Copyright © 2021 Mike Gerwitz <[email protected]>
19;;; Copyright © 2021 Pierre Langlois <[email protected]>
20;;; Copyright © 2021 Guillaume Le Vaillant <[email protected]>
21;;; Copyright © 2022, 2024, 2025 Artyom V. Poptsov <[email protected]>
22;;; Copyright © 2024 Paul A. Patience <[email protected]>
23;;; Copyright © 2024 Raven Hallsby <[email protected]>
24;;; Copyright © 2024 Hartmut Goebel <[email protected]>
25;;; Copyright © 2025 Zheng Junjie <[email protected]>
26;;; Copyright © 2025 Julian Flake <[email protected]>
27;;; Copyright © 2026 Mathieu Lirzin <[email protected]>
28;;;
29;;; This file is part of GNU Guix.
30;;;
31;;; GNU Guix is free software; you can redistribute it and/or modify it
32;;; under the terms of the GNU General Public License as published by
33;;; the Free Software Foundation; either version 3 of the License, or (at
34;;; your option) any later version.
35;;;
36;;; GNU Guix is distributed in the hope that it will be useful, but
37;;; WITHOUT ANY WARRANTY; without even the implied warranty of
38;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39;;; GNU General Public License for more details.
40;;;
41;;; You should have received a copy of the GNU General Public License
42;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
43
44(define-module (gnu packages java)
45 #:use-module ((guix licenses) #:prefix license:)
46 #:use-module (guix packages)
47 #:use-module (guix download)
48 #:use-module (guix hg-download)
49 #:use-module (guix git-download)
50 #:use-module (guix svn-download)
51 #:use-module ((guix build utils) #:select (alist-replace))
52 #:use-module (guix utils)
53 #:use-module (guix gexp)
54 #:use-module (guix build-system ant)
55 #:use-module (guix build-system cmake)
56 #:use-module (guix build-system gnu)
57 #:use-module (guix build-system maven)
58 #:use-module (guix build-system pyproject)
59 #:use-module (gnu packages)
60 #:use-module (gnu packages attr)
61 #:use-module (gnu packages autotools)
62 #:use-module (gnu packages base)
63 #:use-module (gnu packages bash)
64 #:use-module (gnu packages nss)
65 #:use-module (gnu packages cpio)
66 #:use-module (gnu packages cups)
67 #:use-module (gnu packages compression)
68 #:use-module (gnu packages elf)
69 #:use-module (gnu packages fontutils)
70 #:use-module (gnu packages freedesktop) ; wayland
71 #:use-module (gnu packages gawk)
72 #:use-module (gnu packages gcc)
73 #:use-module (gnu packages gettext)
74 #:use-module (gnu packages gl)
75 #:use-module (gnu packages ghostscript) ;lcms
76 #:use-module (gnu packages gnome)
77 #:use-module (gnu packages groovy)
78 #:use-module (gnu packages gtk)
79 #:use-module (gnu packages guile)
80 #:use-module (gnu packages icu4c)
81 #:use-module (gnu packages image)
82 #:use-module (gnu packages java-bootstrap)
83 #:use-module (gnu packages java-compression)
84 #:use-module (gnu packages java-xml)
85 #:use-module (gnu packages libffi)
86 #:use-module (gnu packages linux) ;alsa
87 #:use-module (gnu packages maths)
88 #:use-module (gnu packages maven)
89 #:use-module (gnu packages maven-parent-pom)
90 #:use-module (gnu packages ncurses)
91 #:use-module (gnu packages nss)
92 #:use-module (gnu packages onc-rpc)
93 #:use-module (gnu packages web)
94 #:use-module (gnu packages wget)
95 #:use-module (gnu packages pkg-config)
96 #:use-module (gnu packages perl)
97 #:use-module (gnu packages popt)
98 #:use-module (gnu packages python-build)
99 #:use-module (gnu packages kerberos)
100 #:use-module (gnu packages security-token)
101 #:use-module (gnu packages xml)
102 #:use-module (gnu packages xdisorg)
103 #:use-module (gnu packages xorg)
104 #:use-module (gnu packages texinfo)
105 #:use-module ((srfi srfi-1) #:select (fold alist-delete))
106 #:use-module (srfi srfi-11)
107 #:use-module (ice-9 match))
108
109(define-public icedtea-7
110 (let* ((version "2.6.13")
111 (drop (lambda* (name hash #:optional (patches '()))
112 (origin
113 (method url-fetch)
114 (uri (string-append
115 "http://icedtea.classpath.org/download/drops"
116 "/icedtea7/" version "/" name ".tar.bz2"))
117 (sha256 (base32 hash))
118 (patches patches)))))
119 (package
120 (name "icedtea")
121 (version version)
122 (source (origin
123 (method url-fetch)
124 (uri (string-append
125 "http://icedtea.wildebeest.org/download/source/icedtea-"
126 version ".tar.xz"))
127 (sha256
128 (base32
129 "1w331rdqx1dcx2xb0fmjmrkdc71xqn20fxsgw8by4xhiblh88khh"))
130 (modules '((guix build utils)))
131 (snippet
132 '(begin
133 (substitute* "Makefile.in"
134 ;; do not leak information about the build host
135 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
136 "DISTRIBUTION_ID=\"\\\"guix\\\"\""))
137 #t))))
138 (build-system gnu-build-system)
139 (outputs '("out" ; Java Runtime Environment
140 "jdk" ; Java Development Kit
141 "doc")) ; all documentation
142 (arguments
143 `(;; There are many test failures. Some are known to
144 ;; fail upstream, others relate to not having an X
145 ;; server running at test time, yet others are a
146 ;; complete mystery to me.
147
148 ;; hotspot: passed: 241; failed: 45; error: 2
149 ;; langtools: passed: 1,934; failed: 26
150 ;; jdk: unknown
151 #:tests? #f
152
153 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
154 ;; gremlin) doesn't support it yet, so skip this phase.
155 #:validate-runpath? #f
156
157 #:modules ((guix build utils)
158 (guix build gnu-build-system)
159 (ice-9 match)
160 (ice-9 popen)
161 (srfi srfi-19)
162 (srfi srfi-26))
163
164 #:configure-flags
165 ;; TODO: package sctp and add to inputs
166 `("--disable-system-sctp"
167 "--enable-system-pcsc"
168 "--enable-system-lcms"
169 "--enable-bootstrap"
170 "--enable-nss"
171 "--without-rhino"
172 ,(string-append "--with-parallel-jobs="
173 (number->string (parallel-job-count)))
174 "--disable-downloading"
175 "--disable-tests" ;they are run in the check phase instead
176 "--with-openjdk-src-dir=./openjdk.src"
177 ,(string-append "--with-ecj="
178 (assoc-ref %build-inputs "ecj4-javac-wrapper")
179 "/bin/javac")
180 ,(string-append "--with-jdk-home="
181 (assoc-ref %build-inputs "classpath"))
182 ,(string-append "--with-java="
183 (assoc-ref %build-inputs "jamvm")
184 "/bin/jamvm")
185 ,(string-append "--with-jar="
186 (assoc-ref %build-inputs "classpath")
187 "/bin/gjar"))
188 #:phases
189 (modify-phases %standard-phases
190 (replace 'unpack
191 (lambda* (#:key source inputs #:allow-other-keys)
192 (let ((target (string-append "icedtea-" ,version))
193 (unpack (lambda* (name #:optional dir)
194 (let ((dir (or dir
195 (string-drop-right name 5))))
196 (mkdir dir)
197 (invoke "tar" "xvf"
198 (assoc-ref inputs name)
199 "-C" dir
200 "--strip-components=1")))))
201 (mkdir target)
202 (invoke "tar" "xvf" source
203 "-C" target "--strip-components=1")
204 (chdir target)
205 (unpack "openjdk-src" "openjdk.src")
206 (with-directory-excursion "openjdk.src"
207 (for-each unpack
208 (filter (cut string-suffix? "-drop" <>)
209 (map (match-lambda
210 ((name . _) name))
211 inputs)))))))
212 (add-after 'unpack 'use-classpath
213 (lambda* (#:key inputs #:allow-other-keys)
214 (let ((tools (search-input-file inputs "/share/classpath/tools.zip"))
215 (rt.jar (search-input-file inputs "/lib/rt.jar")))
216 ;; GNU Classpath does not provide rt.jar, but jamvm provides
217 ;; Classpath's glibj.zip as rt.jar, so we just use that.
218 (substitute* "Makefile.in"
219 (("\\$\\(SYSTEM_JDK_DIR\\)/jre/lib/rt.jar") rt.jar))
220 ;; Make sure we can find all classes.
221 (setenv "CLASSPATH"
222 (string-append rt.jar ":" tools))
223 (setenv "JAVACFLAGS"
224 (string-append "-cp " rt.jar ":" tools)))))
225 (add-after 'unpack 'patch-bitrot
226 (lambda _
227 (substitute* '("patches/boot/revert-6973616.patch"
228 "openjdk.src/jdk/make/common/shared/Defs-versions.gmk")
229 (("REQUIRED_FREETYPE_VERSION = 2.2.1")
230 "REQUIRED_FREETYPE_VERSION = 2.10.1"))
231 ;; As of attr 2.4.48 this header is no longer
232 ;; included. It is provided by the libc instead.
233 (substitute* '("configure"
234 "openjdk.src/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c")
235 (("attr/xattr.h") "sys/xattr.h"))))
236 (add-after 'unpack 'fix-openjdk
237 (lambda _
238 (substitute* "openjdk.src/jdk/make/common/Defs-linux.gmk"
239 (("CFLAGS_COMMON = -fno-strict-aliasing" all)
240 (string-append all
241 " -fcommon"
242 " -Wno-error=implicit-function-declaration"
243 " -Wno-error=implicit-int"
244 " -Wno-error=incompatible-pointer-types"
245 " -Wno-error=int-conversion")))
246 (substitute*
247 '("openjdk.src/jdk/src/solaris/native/java/net/PlainSocketImpl.c"
248 "openjdk.src/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c")
249 (("#include <sys/sysctl.h>")
250 "#include <linux/sysctl.h>"))
251
252 ;; XXX 'ldd' in glibc 2.35 segfaults upon reading
253 ;; openjdk.build-boot/lib/amd64/libnio.so (!).
254 ;; It is only used as a verification step, so ignore it;
255 ;; try removing this substitution for newer versions of glibc.
256 (substitute* "openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
257 (("\\$\\(LDD\\) \\$1 &&")
258 ""))
259
260 ;; It looks like the "h = 31 * h + c" line of the jsum()
261 ;; function gets miscompiled. After a few iterations of the loop
262 ;; the result of "31 * h" is always 0x8000000000000000.
263 ;; Disable optimizations of dump.cpp as a workaround.
264 (substitute* "openjdk.src/hotspot/make/linux/makefiles/gcc.make"
265 (("OPT_CFLAGS/NOOPT.*" all)
266 (string-append all "\n"
267 "OPT_CFLAGS/dump.o += -O0")))))
268 (add-after 'unpack 'fix-x11-extension-include-path
269 (lambda* (#:key inputs #:allow-other-keys)
270 (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
271 (((string-append "\\$\\(firstword \\$\\(wildcard "
272 "\\$\\(OPENWIN_HOME\\)"
273 "/include/X11/extensions\\).*$"))
274 (string-append (assoc-ref inputs "libxrender")
275 "/include/X11/extensions"
276 " -I" (assoc-ref inputs "libxtst")
277 "/include/X11/extensions"
278 " -I" (assoc-ref inputs "libxinerama")
279 "/include/X11/extensions"))
280 (("\\$\\(wildcard /usr/include/X11/extensions\\)\\)") ""))))
281 (add-after 'unpack 'patch-paths
282 (lambda* (#:key inputs #:allow-other-keys)
283 ;; buildtree.make generates shell scripts, so we need to replace
284 ;; the generated shebang
285 (substitute* '("openjdk.src/hotspot/make/linux/makefiles/buildtree.make")
286 (("/bin/sh") (which "bash")))
287
288 (let ((corebin (string-append
289 (assoc-ref inputs "coreutils") "/bin/"))
290 (binbin (string-append
291 (assoc-ref inputs "binutils") "/bin/"))
292 (grepbin (string-append
293 (assoc-ref inputs "grep") "/bin/")))
294 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
295 "openjdk.src/corba/make/common/shared/Defs-linux.gmk")
296 (("UNIXCOMMAND_PATH = /bin/")
297 (string-append "UNIXCOMMAND_PATH = " corebin))
298 (("USRBIN_PATH = /usr/bin/")
299 (string-append "USRBIN_PATH = " corebin))
300 (("DEVTOOLS_PATH *= */usr/bin/")
301 (string-append "DEVTOOLS_PATH = " corebin))
302 (("COMPILER_PATH *= */usr/bin/")
303 (string-append "COMPILER_PATH = "
304 (assoc-ref inputs "gcc") "/bin/"))
305 (("DEF_OBJCOPY *=.*objcopy")
306 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
307
308 ;; fix path to alsa header
309 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
310 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
311 (string-append "ALSA_INCLUDE="
312 (assoc-ref inputs "alsa-lib")
313 "/include/alsa/version.h")))
314
315 ;; fix hard-coded utility paths
316 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-utils.gmk"
317 "openjdk.src/corba/make/common/shared/Defs-utils.gmk")
318 (("ECHO *=.*echo")
319 (string-append "ECHO = " (which "echo")))
320 (("^GREP *=.*grep")
321 (string-append "GREP = " (which "grep")))
322 (("EGREP *=.*egrep")
323 (string-append "EGREP = " (which "egrep")))
324 (("CPIO *=.*cpio")
325 (string-append "CPIO = " (which "cpio")))
326 (("READELF *=.*readelf")
327 (string-append "READELF = " (which "readelf")))
328 (("^ *AR *=.*ar")
329 (string-append "AR = " (which "ar")))
330 (("^ *TAR *=.*tar")
331 (string-append "TAR = " (which "tar")))
332 (("AS *=.*as")
333 (string-append "AS = " (which "as")))
334 (("LD *=.*ld")
335 (string-append "LD = " (which "ld")))
336 (("STRIP *=.*strip")
337 (string-append "STRIP = " (which "strip")))
338 (("NM *=.*nm")
339 (string-append "NM = " (which "nm")))
340 (("^SH *=.*sh")
341 (string-append "SH = " (which "bash")))
342 (("^FIND *=.*find")
343 (string-append "FIND = " (which "find")))
344 (("LDD *=.*ldd")
345 (string-append "LDD = " (which "ldd")))
346 (("NAWK *=.*(n|g)awk")
347 (string-append "NAWK = " (which "gawk")))
348 (("XARGS *=.*xargs")
349 (string-append "XARGS = " (which "xargs")))
350 (("UNZIP *=.*unzip")
351 (string-append "UNZIP = " (which "unzip")))
352 (("ZIPEXE *=.*zip")
353 (string-append "ZIPEXE = " (which "zip")))
354 (("SED *=.*sed")
355 (string-append "SED = " (which "sed"))))
356
357 ;; Some of these timestamps cause problems as they are more than
358 ;; 10 years ago, failing the build process.
359 (substitute*
360 "openjdk.src/jdk/src/share/classes/java/util/CurrencyData.properties"
361 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
362 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
363 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
364 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY")))))
365 (add-before 'configure 'set-additional-paths
366 (lambda* (#:key inputs #:allow-other-keys)
367 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
368 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
369 (string-append "ALSA_INCLUDE="
370 (assoc-ref inputs "alsa-lib")
371 "/include/alsa/version.h")))
372 (setenv "CC" "gcc")
373 (setenv "CPATH"
374 (string-append (assoc-ref inputs "libxcomposite")
375 "/include/X11/extensions" ":"
376 (assoc-ref inputs "libxrender")
377 "/include/X11/extensions" ":"
378 (assoc-ref inputs "libxtst")
379 "/include/X11/extensions" ":"
380 (assoc-ref inputs "libxinerama")
381 "/include/X11/extensions" ":"
382 (or (getenv "CPATH") "")))
383 (setenv "ALT_OBJCOPY" (which "objcopy"))
384 (setenv "ALT_CUPS_HEADERS_PATH"
385 (string-append (assoc-ref inputs "cups")
386 "/include"))
387 (setenv "ALT_FREETYPE_HEADERS_PATH"
388 (string-append (assoc-ref inputs "freetype")
389 "/include"))
390 (setenv "ALT_FREETYPE_LIB_PATH"
391 (string-append (assoc-ref inputs "freetype")
392 "/lib"))))
393 (add-before 'build 'disable-os-version-check
394 ;; allow build on linux major version change
395 (lambda _
396 (setenv "DISABLE_HOTSPOT_OS_VERSION_CHECK" "ok")))
397 (add-before 'check 'fix-test-framework
398 (lambda _
399 ;; Fix PATH in test environment
400 (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
401 (("PATH=/bin:/usr/bin")
402 (string-append "PATH=" (getenv "PATH"))))
403 (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
404 (("/usr/bin/env") (which "env")))
405 (substitute* "openjdk.src/hotspot/test/test_env.sh"
406 (("/bin/rm") (which "rm"))
407 (("/bin/cp") (which "cp"))
408 (("/bin/mv") (which "mv")))))
409 (add-before 'check 'fix-hotspot-tests
410 (lambda _
411 (with-directory-excursion "openjdk.src/hotspot/test/"
412 (substitute* "jprt.config"
413 (("PATH=\"\\$\\{path4sdk\\}\"")
414 (string-append "PATH=" (getenv "PATH")))
415 (("make=/usr/bin/make")
416 (string-append "make=" (which "make"))))
417 (substitute* '("runtime/6626217/Test6626217.sh"
418 "runtime/7110720/Test7110720.sh")
419 (("/bin/rm") (which "rm"))
420 (("/bin/cp") (which "cp"))
421 (("/bin/mv") (which "mv"))))))
422 (add-before 'check 'fix-jdk-tests
423 (lambda _
424 (with-directory-excursion "openjdk.src/jdk/test/"
425 (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
426 (("/bin/pwd") (which "pwd")))
427 (substitute* "com/sun/jdi/ShellScaffold.sh"
428 (("/bin/kill") (which "kill")))
429 (substitute* "start-Xvfb.sh"
430 ;;(("/usr/bin/X11/Xvfb") (which "Xvfb"))
431 (("/usr/bin/nohup") (which "nohup")))
432 (substitute* "javax/security/auth/Subject/doAs/Test.sh"
433 (("/bin/rm") (which "rm")))
434 (substitute* "tools/launcher/MultipleJRE.sh"
435 (("echo \"#!/bin/sh\"")
436 (string-append "echo \"#!" (which "rm") "\""))
437 (("/usr/bin/zip") (which "zip")))
438 (substitute* "com/sun/jdi/OnThrowTest.java"
439 (("#!/bin/sh") (string-append "#!" (which "sh"))))
440 (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
441 (("/usr/bin/uptime") (which "uptime")))
442 (substitute* "java/lang/ProcessBuilder/Basic.java"
443 (("/usr/bin/env") (which "env"))
444 (("/bin/false") (which "false"))
445 (("/bin/true") (which "true"))
446 (("/bin/cp") (which "cp"))
447 (("/bin/sh") (which "sh")))
448 (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
449 (("/bin/sh") (which "sh")))
450 (substitute* "java/lang/ProcessBuilder/Zombies.java"
451 (("/usr/bin/perl") (which "perl"))
452 (("/bin/ps") (which "ps"))
453 (("/bin/true") (which "true")))
454 (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
455 (("/usr/bin/tee") (which "tee")))
456 (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
457 (("/bin/true") (which "true")))
458 (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
459 (("/bin/cat") (which "cat")))
460 (substitute* "java/lang/Runtime/exec/ExitValue.java"
461 (("/bin/sh") (which "sh"))
462 (("/bin/true") (which "true"))
463 (("/bin/kill") (which "kill")))
464 (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
465 (("/usr/bin/echo") (which "echo")))
466 (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
467 (("/usr/bin/cat") (which "cat")))
468 (substitute* "java/lang/Runtime/exec/SleepyCat.java"
469 (("/bin/cat") (which "cat"))
470 (("/bin/sleep") (which "sleep"))
471 (("/bin/sh") (which "sh")))
472 (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
473 (("/bin/cat") (which "cat")))
474 (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
475 (("/bin/chmod") (which "chmod")))
476 (substitute* "java/util/zip/ZipFile/Assortment.java"
477 (("/bin/sh") (which "sh"))))))
478 (replace 'check
479 (lambda* (#:key tests? #:allow-other-keys)
480 ;; The "make check-*" targets always return zero, so we need to
481 ;; check for errors in the associated log files to determine
482 ;; whether any tests have failed.
483 (when tests?
484 (use-modules (ice-9 rdelim))
485 (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
486 (checker (lambda (port)
487 (let loop ()
488 (let ((line (read-line port)))
489 (cond
490 ((eof-object? line) #t)
491 ((regexp-exec error-pattern line)
492 (error "test failed"))
493 (else (loop)))))))
494 (run-test (lambda (test)
495 (invoke "make" test)
496 (call-with-input-file
497 (string-append "test/" test ".log")
498 checker))))
499 (run-test "check-hotspot")
500 (run-test "check-langtools")
501 (run-test "check-jdk")))))
502 (replace 'install
503 (lambda* (#:key outputs #:allow-other-keys)
504 (let ((doc (string-append (assoc-ref outputs "doc")
505 "/share/doc/icedtea"))
506 (jre (assoc-ref outputs "out"))
507 (jdk (assoc-ref outputs "jdk")))
508 (copy-recursively "openjdk.build/docs" doc)
509 (copy-recursively "openjdk.build/j2re-image" jre)
510 (copy-recursively "openjdk.build/j2sdk-image" jdk))))
511 ;; Some of the libraries in the lib/amd64 folder link to libjvm.so.
512 ;; But that shared object is located in the server/ folder, so it
513 ;; cannot be found. This phase creates a symbolic link in the
514 ;; lib/amd64 folder so that the other libraries can find it.
515 ;;
516 ;; See:
517 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
518 ;;
519 ;; FIXME: Find the bug in the build system, so that this symlink is
520 ;; not needed.
521 (add-after 'install 'install-libjvm
522 (lambda* (#:key inputs outputs #:allow-other-keys)
523 (let* ((lib-path (string-append (assoc-ref outputs "out")
524 ;; See 'INSTALL_ARCH_DIR' in
525 ;; 'configure'.
526 ,(match (%current-system)
527 ("i686-linux"
528 "/lib/i386")
529 ("x86_64-linux"
530 "/lib/amd64")
531 ("armhf-linux"
532 "/lib/arm")
533 ("aarch64-linux"
534 "/lib/aarch64")
535 ("powerpc-linux"
536 "/lib/ppc")
537 ;; We need a catch-all, dropping
538 ;; '-linux' works in most cases.
539 (_
540 (string-append
541 "/lib/"
542 (string-drop-right
543 (%current-system) 6)))))))
544 (symlink (string-append lib-path "/server/libjvm.so")
545 (string-append lib-path "/libjvm.so")))))
546 ;; By default IcedTea only generates an empty keystore. In order to
547 ;; be able to use certificates in Java programs we need to generate a
548 ;; keystore from a set of certificates. For convenience we use the
549 ;; certificates from the nss-certs package.
550 (add-after 'install 'install-keystore
551 (lambda* (#:key inputs outputs #:allow-other-keys)
552 (use-modules (ice-9 rdelim))
553 (let* ((keystore "cacerts")
554 (certs-dir (search-input-directory inputs
555 "etc/ssl/certs"))
556 (keytool (string-append (assoc-ref outputs "jdk")
557 "/bin/keytool")))
558 (define (extract-cert file target)
559 (call-with-input-file file
560 (lambda (in)
561 (call-with-output-file target
562 (lambda (out)
563 (let loop ((line (read-line in 'concat))
564 (copying? #f))
565 (cond
566 ((eof-object? line) #t)
567 ((string-prefix? "-----BEGIN" line)
568 (display line out)
569 (loop (read-line in 'concat) #t))
570 ((string-prefix? "-----END" line)
571 (display line out)
572 #t)
573 (else
574 (when copying? (display line out))
575 (loop (read-line in 'concat) copying?)))))))))
576 (define (import-cert cert)
577 (format #t "Importing certificate ~a\n" (basename cert))
578 (let ((temp "tmpcert"))
579 (extract-cert cert temp)
580 (let ((port (open-pipe* OPEN_WRITE keytool
581 "-import"
582 "-alias" (basename cert)
583 "-keystore" keystore
584 "-storepass" "changeit"
585 "-file" temp)))
586 (display "yes\n" port)
587 (when (not (zero? (status:exit-val (close-pipe port))))
588 (format #t "failed to import ~a\n" cert)))
589 (delete-file temp)))
590
591 ;; This is necessary because the certificate directory contains
592 ;; files with non-ASCII characters in their names.
593 (setlocale LC_ALL "C.UTF-8")
594 (setenv "LC_ALL" "C.UTF-8")
595
596 (for-each import-cert (find-files certs-dir "\\.pem$"))
597 (mkdir-p (string-append (assoc-ref outputs "out")
598 "/lib/security"))
599 (mkdir-p (string-append (assoc-ref outputs "jdk")
600 "/jre/lib/security"))
601
602 ;; The cacerts files we are going to overwrite are chmod'ed as
603 ;; read-only (444) in icedtea-8 (which derives from this
604 ;; package). We have to change this so we can overwrite them.
605 (chmod (string-append (assoc-ref outputs "out")
606 "/lib/security/" keystore) #o644)
607 (chmod (string-append (assoc-ref outputs "jdk")
608 "/jre/lib/security/" keystore) #o644)
609
610 (install-file keystore
611 (string-append (assoc-ref outputs "out")
612 "/lib/security"))
613 (install-file keystore
614 (string-append (assoc-ref outputs "jdk")
615 "/jre/lib/security"))))))))
616 (native-inputs
617 ;; XXX: Compiling with gcc-14 will encounter the following error:
618 ;; BUILD FAILED:
619 ;; /tmp/guix-build-icedtea-2.6.13.drv-0/icedtea-2.6.13/openjdk/langtools/
620 ;; make/build.xml:452: The following error occurred while executing this
621 ;; line:
622 ;; java.lang.AbstractMethodError: java.lang.Throwable.toString()Ljava/lang/String;
623 `(("gcc" ,gcc-13)
624 ("openjdk-src"
625 ,(drop "openjdk"
626 "0l34ikyf62hbzlf9032alzkkqvf7bpmckz4gvirvph755w7gka8l"))
627 ("corba-drop"
628 ,(drop "corba"
629 "050gv2jbg1pi6qkn8w18bwpbklfa5b0kymjvan9pncddbj8m84fz"))
630 ("jaxp-drop"
631 ,(drop "jaxp"
632 "1k6yldwnxfzdg5926r1nlfv8d1r1j7rlp2nkz6gqh05vgyamnfhl"))
633 ("jaxws-drop"
634 ,(drop "jaxws"
635 "110j7jlz47x2gg6f7653x12mssan5kvj9l9h1m1c8c92drfxbqyk"))
636 ("jdk-drop"
637 ,(drop "jdk"
638 "0d1mca38ksxvdskp9im3pp7fdijhj1n3lwq9w13r9s4v3qyskgdd"
639 (search-patches "jdk-currency-time-bomb.patch")))
640 ("langtools-drop"
641 ,(drop "langtools"
642 "0nq5236fzxn3p6x8cgncl56mzcmsj07q9gymysnws4c8byc6n0qj"))
643 ("hotspot-drop"
644 ,(origin
645 (method url-fetch)
646 (uri (string-append
647 "http://icedtea.classpath.org/downloads/drops"
648 "/icedtea7/" version "/hotspot.tar.bz2"))
649 (sha256
650 (base32
651 "17bdv39n4lh8l5737c96f3xgamx4y305m067p01cywgp7zaddqws"))
652 (patches (search-patches
653 "icedtea-7-hotspot-aarch64-use-c++98.patch"
654 "icedtea-7-hotspot-pointer-comparison.patch"))))
655 ("ant" ,ant-bootstrap)
656 ("attr" ,attr)
657 ("classpath" ,classpath-devel)
658 ("coreutils" ,coreutils)
659 ("diffutils" ,diffutils) ;for tests
660 ("ecj4-javac-wrapper" ,ecj4-javac-wrapper)
661 ("fastjar" ,fastjar) ;only for the configure phase; we actually use gjar
662 ("gawk" ,gawk)
663 ("grep" ,grep)
664 ("jamvm" ,jamvm-with-ecj4)
665 ("libtool" ,libtool)
666 ("pkg-config" ,pkg-config)
667 ("wget" ,wget)
668 ("which" ,which)
669 ("cpio" ,cpio)
670 ("zip" ,zip)
671 ("unzip" ,unzip)
672 ("libxslt" ,libxslt) ;for xsltproc
673 ("nss-certs" ,nss-certs)
674 ("perl" ,perl)
675 ("procps" ,procps))) ;for "free", even though I'm not sure we should use it
676 (inputs
677 (list alsa-lib
678 cups
679 fontconfig
680 freetype
681 giflib
682 gtk+-2
683 lcms
684 libjpeg-turbo
685 libpng
686 libx11
687 libxcomposite
688 libxi
689 libxinerama
690 libxrender
691 libxt
692 libxtst
693 mit-krb5
694 nss
695 pcsc-lite
696 zlib))
697 (home-page "https://icedtea.classpath.org")
698 (synopsis "Java development kit")
699 (description
700 "This package provides the Java development kit OpenJDK built with the
701IcedTea build harness.")
702
703 ;; 'configure' lists "mips" and "mipsel", but not "mips64el'.
704 (supported-systems (delete "mips64el-linux" %supported-systems))
705
706 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
707 ;; same license as both GNU Classpath and OpenJDK.
708 (license license:gpl2+))))
709
710(define-public icedtea-8
711 (let* ((version "3.19.0")
712 (drop (lambda* (name hash #:optional (patches '()))
713 (origin
714 (method url-fetch)
715 (uri (string-append
716 "http://icedtea.classpath.org/download/drops"
717 "/icedtea8/" version "/" name ".tar.xz"))
718 (sha256 (base32 hash))
719 (patches patches)))))
720 (package (inherit icedtea-7)
721 (version "3.19.0")
722 (source (origin
723 (method url-fetch)
724 (uri (string-append
725 "http://icedtea.wildebeest.org/download/source/icedtea-"
726 version ".tar.xz"))
727 (sha256
728 (base32
729 "1cmms7cb2sav3ywc36ynqmybzx73sl279rm6j8i5nqrmp98ixmpf"))
730 (modules '((guix build utils)))
731 (snippet
732 '(substitute* '("configure"
733 "acinclude.m4")
734 ;; Do not embed build time
735 (("(DIST_ID=\"Custom build).*$" _ prefix)
736 (string-append prefix "\"\n"))
737 ;; Do not leak information about the build host
738 (("DIST_NAME=\"\\$build_os\"")
739 "DIST_NAME=\"guix\"")))))
740 (arguments
741 `(#:imported-modules
742 ((guix build ant-build-system)
743 ,@%default-gnu-imported-modules)
744
745 #:disallowed-references ,(list (gexp-input
746 (this-package-native-input "jdk")
747 "jdk"))
748
749 ,@(substitute-keyword-arguments (package-arguments icedtea-7)
750 ((#:modules modules)
751 `((guix build utils)
752 (guix build gnu-build-system)
753 ((guix build ant-build-system) #:prefix ant:)
754 (ice-9 match)
755 (ice-9 popen)
756 (srfi srfi-19)
757 (srfi srfi-26)))
758 ((#:configure-flags flags)
759 `(let ((jdk (assoc-ref %build-inputs "jdk")))
760 `(,(string-append "CFLAGS=-fcommon"
761 " -Wno-error=implicit-function-declaration"
762 " -Wno-error=implicit-int"
763 " -Wno-error=incompatible-pointer-types"
764 " -Wno-error=int-conversion")
765 "CXXFLAGS=-fcommon"
766 "--enable-bootstrap"
767 "--enable-nss"
768 ,(string-append "--with-parallel-jobs="
769 (number->string (parallel-job-count)))
770 ;; Java Flight Recorder isn't supported on some architectures.
771 ,@(if ,(target-ppc32?)
772 `("--enable-jfr=no")
773 '())
774 "--disable-docs" ; This phase can take hours on slow machines.
775 "--disable-downloading"
776 "--disable-system-pcsc"
777 "--disable-system-sctp"
778 "--disable-tests" ;they are run in the check phase instead
779 "--with-openjdk-src-dir=./openjdk.src"
780 ,(string-append "--with-jdk-home=" jdk))))
781 ((#:phases phases)
782 `(modify-phases ,phases
783 (delete 'fix-x11-extension-include-path)
784 (delete 'patch-paths)
785 (delete 'set-additional-paths)
786 (delete 'patch-patches)
787 (delete 'patch-bitrot)
788 (delete 'use-classpath)
789 ;; Prevent passing -j (parallel-job-count) to make
790 (replace 'build
791 (lambda* (#:key (make-flags '()) #:allow-other-keys)
792 (apply invoke "make" make-flags)))
793 ;; Prevent the keytool from recording the current time when
794 ;; adding certificates at build time.
795 (add-after 'unpack 'patch-keystore
796 (lambda _
797 (substitute* "openjdk.src/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java"
798 (("date = new Date\\(\\);")
799 "\
800date = (System.getenv(\"SOURCE_DATE_EPOCH\") != null) ?\
801new Date(Long.parseLong(System.getenv(\"SOURCE_DATE_EPOCH\"))) :\
802new Date();"))
803 #t))
804 (add-after 'unpack 'patch-jni-libs
805 ;; Hardcode dynamically loaded libraries.
806 (lambda _
807 (define remove
808 (@ (srfi srfi-1) remove))
809
810 (define (icedtea-or-openjdk? path)
811 (or (string-contains path "openjdk")
812 (string-contains path "icedtea")))
813
814 (let* ((library-path (remove icedtea-or-openjdk?
815 (search-path-as-string->list
816 (getenv "LIBRARY_PATH"))))
817 (find-library (lambda (name)
818 (or (search-path
819 library-path
820 (string-append "lib" name ".so"))
821 (string-append "lib" name ".so")))))
822 (for-each
823 (lambda (file)
824 (catch 'decoding-error
825 (lambda ()
826 (substitute* file
827 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
828 _ name version)
829 (string-append "\"" (find-library name) "\""))
830 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
831 (string-append "\"" (find-library name) "\""))))
832 (lambda _
833 ;; Those are safe to skip.
834 (format (current-error-port)
835 "warning: failed to substitute: ~a~%"
836 file))))
837 (find-files "openjdk.src/jdk/src/solaris/native"
838 "\\.c|\\.h")))))
839 (replace 'fix-openjdk
840 (lambda _
841 (substitute*
842 '("openjdk.src/jdk/src/solaris/native/java/net/PlainSocketImpl.c"
843 "openjdk.src/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c")
844 (("#include <sys/sysctl.h>")
845 "#include <linux/sysctl.h>"))))
846 (replace 'install
847 (lambda* (#:key outputs #:allow-other-keys)
848 (let ((doc (string-append (assoc-ref outputs "doc")
849 "/share/doc/icedtea"))
850 (jre (assoc-ref outputs "out"))
851 (jdk (assoc-ref outputs "jdk")))
852 (copy-recursively "openjdk.build/docs" doc)
853 (copy-recursively "openjdk.build/images/j2re-image" jre)
854 (copy-recursively "openjdk.build/images/j2sdk-image" jdk)
855 ;; Install the nss.cfg file to JRE to enable SSL/TLS
856 ;; support via NSS.
857 (copy-file (string-append jdk "/jre/lib/security/nss.cfg")
858 (string-append jre "/lib/security/nss.cfg")))))
859 (add-after 'install 'strip-jar-timestamps
860 (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))))
861 (native-inputs
862 `(("jdk" ,icedtea-7 "jdk")
863 ("openjdk-src"
864 ,(drop "openjdk"
865 "1l3bzmd3s38scxpwamfhnwbv7vndgjq6hz3bl58437fgl9kgbl69"))
866 ("aarch32-drop"
867 ,(drop "aarch32"
868 "0k4dwpi3x3lj41rj32xyxbn76r7cb2g2whh44r1z4iwhw1xd2lpq"))
869 ("corba-drop"
870 ,(drop "corba"
871 "0xhh6gf5gh5c6vf1607xcy49wnp5prch2rim13x14wvsn817xf0r"))
872 ("jaxp-drop"
873 ,(drop "jaxp"
874 "043g335rgi5ipl8dp3q2cc3gcfhxk77ipxs43sv344z71bn8xmxr"))
875 ("jaxws-drop"
876 ,(drop "jaxws"
877 "1pc0pv4v2mn2mjc0vp19d94v2150xigyhxsmckqasy647zcm6w0r"))
878 ("jdk-drop"
879 ,(drop "jdk"
880 "1742lcm55l8zhi522x83v65ccr0rd6511q9rj7crw44x3ymdrhrv"
881 (search-patches "jdk-currency-time-bomb2.patch")))
882 ("langtools-drop"
883 ,(drop "langtools"
884 "08iz7p2xcddlphipf6gahyabr5cawlnydap12p1n4f0md069b50b"))
885 ("hotspot-drop"
886 ,(drop "hotspot"
887 "1ffaxfnb3yn1i7crivqigc1r1q0z6cp044i6nfring4z6c8pfhd2"))
888 ("nashorn-drop"
889 ,(drop "nashorn"
890 "15fn7cpm2i1npa88h57njxg0f8qkrqhrc30pb54d3hxlx5zyjl94"))
891 ("shenandoah-drop"
892 ,(drop "shenandoah"
893 "1jjzjjx1ykyhbc4llh8249dlr8j5g1ki6r7g9baj2mxyb9whc5nq"))
894 ,@(fold alist-delete (package-native-inputs icedtea-7)
895 '("openjdk-src" "corba-drop" "jaxp-drop" "jaxws-drop"
896 "jdk-drop" "langtools-drop" "hotspot-drop"
897 "classpath" "ecj4-javac-wrapper" "jamvm" "fastjar")))))))
898
899(define-public icedtea icedtea-8)
900
901(define-public openjdk9
902 (package
903 (name "openjdk")
904 (version "9.181")
905 (source (origin
906 (method hg-fetch)
907 (uri (hg-reference (url "https://hg.openjdk.org/jdk/jdk")
908 (changeset "jdk-9+181")))
909 (file-name (hg-file-name name version))
910 (modules '((guix build utils)))
911 (snippet '(for-each delete-file
912 (find-files "." ".*.(bin|exe|jar)$")))
913 (sha256
914 (base32
915 "1v92nzdqx07c35x945awzir4yk0fk22vky6fpp8mq9js930sxsz0"))
916 (patches
917 (search-patches "openjdk-9-pointer-comparison.patch"
918 "openjdk-9-classlist-reproducibility.patch"
919 "openjdk-currency-time-bomb.patch"
920 "openjdk-9-jar-reproducibility.patch"
921 "openjdk-9-module-reproducibility.patch"
922 "openjdk-9-module2-reproducibility.patch"
923 "openjdk-9-module3-reproducibility.patch"
924 "openjdk-9-idlj-reproducibility.patch"
925 "openjdk-9-setsignalhandler.patch"))))
926 (build-system gnu-build-system)
927 (outputs '("out" "jdk" "doc"))
928 (arguments
929 `(#:imported-modules
930 ((guix build ant-build-system)
931 ,@%default-gnu-imported-modules)
932 #:modules
933 ((guix build utils)
934 (guix build gnu-build-system)
935 (ice-9 popen))
936 #:tests? #f ; require jtreg
937 #:make-flags '("all")
938 #:disallowed-references
939 ,(list (this-package-native-input "icedtea")
940 (gexp-input (this-package-native-input "icedtea") "jdk"))
941
942 #:phases
943 (modify-phases %standard-phases
944 ,@(if (target-aarch64?)
945 `((add-after 'unpack 'patch-for-aarch64
946 (lambda _
947 (substitute* "hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp"
948 ;; This line is duplicated, so remove both occurrences,
949 ;; then add back one occurrence by substituting a
950 ;; comment that occurs once.
951 (("using MacroAssembler::call_VM_leaf_base;") "")
952 (("Interpreter specific version of call_VM_base")
953 "Interpreter specific version of call_VM_base
954 using MacroAssembler::call_VM_leaf_base;")))))
955 '())
956 (add-after 'patch-source-shebangs 'fix-java-shebangs
957 (lambda _
958 ;; This file was "fixed" by patch-source-shebangs, but it requires
959 ;; this exact first line.
960 (substitute* "jdk/make/data/blacklistedcertsconverter/blacklisted.certs.pem"
961 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))))
962 (replace 'configure
963 (lambda* (#:key inputs outputs #:allow-other-keys)
964 ;; TODO: unbundle libpng and lcms
965 (invoke "bash" "./configure"
966 ;; Add flags for compilation with gcc >= 10
967 ,(string-append "--with-extra-cflags=-fcommon"
968 " -fno-delete-null-pointer-checks"
969 " -fno-lifetime-dse"
970 ;; flags for compilation with gcc >= 14.
971 " -Wno-error=int-conversion")
972 (string-append "--with-freetype="
973 (assoc-ref inputs "freetype"))
974 "--disable-freetype-bundling"
975 "--disable-warnings-as-errors"
976 "--disable-hotspot-gtest"
977 "--with-giflib=system"
978 "--with-libjpeg=system"
979 (string-append "--prefix=" (assoc-ref outputs "out")))))
980 (add-before 'build 'write-source-revision-file
981 (lambda _
982 (with-output-to-file ".src-rev"
983 (lambda _
984 (display ,version)))))
985 (replace 'build
986 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
987 (apply invoke "make"
988 `(,@(if parallel-build?
989 (list (string-append "JOBS="
990 (number->string (parallel-job-count))))
991 '("JOBS=1"))
992 ,@make-flags))))
993 (add-after 'unpack 'patch-jni-libs
994 ;; Hardcode dynamically loaded libraries.
995 (lambda _
996 (define remove
997 (@ (srfi srfi-1) remove))
998
999 (define (icedtea-or-openjdk? path)
1000 (or (string-contains path "openjdk")
1001 (string-contains path "icedtea")))
1002
1003 (let* ((library-path (remove icedtea-or-openjdk?
1004 (search-path-as-string->list
1005 (getenv "LIBRARY_PATH"))))
1006 (find-library (lambda (name)
1007 (or (search-path
1008 library-path
1009 (string-append "lib" name ".so"))
1010 (string-append "lib" name ".so")))))
1011 (for-each
1012 (lambda (file)
1013 (catch 'decoding-error
1014 (lambda ()
1015 (substitute* file
1016 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
1017 _ name version)
1018 (string-append "\"" (find-library name) "\""))
1019 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
1020 (string-append "\"" (find-library name) "\""))))
1021 (lambda _
1022 ;; Those are safe to skip.
1023 (format (current-error-port)
1024 "warning: failed to substitute: ~a~%"
1025 file))))
1026 (find-files "."
1027 "\\.c$|\\.h$")))))
1028 ;; By default OpenJDK only generates an empty keystore. In order to
1029 ;; be able to use certificates in Java programs we need to generate a
1030 ;; keystore from a set of certificates. For convenience we use the
1031 ;; certificates from the nss-certs package.
1032 (add-after 'install 'install-keystore
1033 (lambda* (#:key inputs outputs #:allow-other-keys)
1034 (use-modules (ice-9 rdelim))
1035 (let* ((keystore "cacerts")
1036 (certs-dir (search-input-directory inputs
1037 "etc/ssl/certs"))
1038 (keytool (string-append (assoc-ref outputs "jdk")
1039 "/bin/keytool")))
1040 (define (extract-cert file target)
1041 (call-with-input-file file
1042 (lambda (in)
1043 (call-with-output-file target
1044 (lambda (out)
1045 (let loop ((line (read-line in 'concat))
1046 (copying? #f))
1047 (cond
1048 ((eof-object? line) #t)
1049 ((string-prefix? "-----BEGIN" line)
1050 (display line out)
1051 (loop (read-line in 'concat) #t))
1052 ((string-prefix? "-----END" line)
1053 (display line out)
1054 #t)
1055 (else
1056 (when copying? (display line out))
1057 (loop (read-line in 'concat) copying?)))))))))
1058 (define (import-cert cert)
1059 (format #t "Importing certificate ~a\n" (basename cert))
1060 (let ((temp "tmpcert"))
1061 (extract-cert cert temp)
1062 (let ((port (open-pipe* OPEN_WRITE keytool
1063 "-import"
1064 "-alias" (basename cert)
1065 "-keystore" keystore
1066 "-storepass" "changeit"
1067 "-file" temp)))
1068 (display "yes\n" port)
1069 (when (not (zero? (status:exit-val (close-pipe port))))
1070 (format #t "failed to import ~a\n" cert)))
1071 (delete-file temp)))
1072
1073 ;; This is necessary because the certificate directory contains
1074 ;; files with non-ASCII characters in their names.
1075 (setlocale LC_ALL "C.UTF-8")
1076 (setenv "LC_ALL" "C.UTF-8")
1077
1078 (copy-file (string-append (assoc-ref outputs "out")
1079 "/lib/security/cacerts")
1080 keystore)
1081 (chmod keystore #o644)
1082 (for-each import-cert (find-files certs-dir "\\.pem$"))
1083 (mkdir-p (string-append (assoc-ref outputs "out")
1084 "/lib/security"))
1085 (mkdir-p (string-append (assoc-ref outputs "jdk")
1086 "/lib/security"))
1087
1088 ;; The cacerts files we are going to overwrite are chmod'ed as
1089 ;; read-only (444) in icedtea-8 (which derives from this
1090 ;; package). We have to change this so we can overwrite them.
1091 (chmod (string-append (assoc-ref outputs "out")
1092 "/lib/security/" keystore) #o644)
1093 (chmod (string-append (assoc-ref outputs "jdk")
1094 "/lib/security/" keystore) #o644)
1095
1096 (install-file keystore
1097 (string-append (assoc-ref outputs "out")
1098 "/lib/security"))
1099 (install-file keystore
1100 (string-append (assoc-ref outputs "jdk")
1101 "/lib/security")))))
1102 ;; Some of the libraries in the lib/ folder link to libjvm.so.
1103 ;; But that shared object is located in the server/ folder, so it
1104 ;; cannot be found. This phase creates a symbolic link in the
1105 ;; lib/ folder so that the other libraries can find it.
1106 ;;
1107 ;; See:
1108 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1109 ;;
1110 ;; FIXME: Find the bug in the build system, so that this symlink is
1111 ;; not needed.
1112 (add-after 'install 'install-libjvm
1113 (lambda* (#:key inputs outputs #:allow-other-keys)
1114 (let* ((lib-out (string-append (assoc-ref outputs "out")
1115 "/lib"))
1116 (lib-jdk (string-append (assoc-ref outputs "jdk")
1117 "/lib")))
1118 (symlink (string-append lib-jdk "/server/libjvm.so")
1119 (string-append lib-jdk "/libjvm.so"))
1120 (symlink (string-append lib-out "/server/libjvm.so")
1121 (string-append lib-out "/libjvm.so")))))
1122 (replace 'install
1123 (lambda* (#:key outputs #:allow-other-keys)
1124 (let ((out (assoc-ref outputs "out"))
1125 (jdk (assoc-ref outputs "jdk"))
1126 (doc (assoc-ref outputs "doc"))
1127 (images (car (find-files "build" ".*-server-release"
1128 #:directories? #t))))
1129 (copy-recursively (string-append images "/images/jdk") jdk)
1130 (copy-recursively (string-append images "/images/jre") out)
1131 (copy-recursively (string-append images "/images/docs") doc))))
1132 (add-after 'install 'strip-zip-timestamps
1133 (lambda* (#:key outputs #:allow-other-keys)
1134 (for-each
1135 (lambda (zip)
1136 (let ((dir (mkdtemp "zip-contents.XXXXXX")))
1137 (with-directory-excursion dir
1138 ;; This is an exact copy of the implementation of invoke,
1139 ;; but this accepts exit code 1 as OK.
1140 (let ((code (system* "unzip" "--" zip)))
1141 ;; jmod files are zip files with an extra header in
1142 ;; front. unzip will warn about that -- but otherwise
1143 ;; work.
1144 (when (> (status:exit-val code) 1) ; 1 is just a warning
1145 (raise
1146 (condition
1147 (&invoke-error
1148 (program "unzip")
1149 (arguments (list "--" zip))
1150 (exit-status (status:exit-val code))
1151 (term-signal (status:term-sig code))
1152 (stop-signal (status:stop-sig code))))))))
1153 (delete-file zip)
1154 (for-each (lambda (file)
1155 (let ((s (lstat file)))
1156 (format #t "reset ~a~%" file)
1157 (utime file 1 1 0 0
1158 AT_SYMLINK_NOFOLLOW)))
1159 (find-files dir #:directories? #t))
1160 (with-directory-excursion dir
1161 (let ((files (cons "./META-INF/MANIFEST.MF"
1162 (append
1163 (find-files "./META-INF" ".*")
1164 ;; for jmod:
1165 (list "./classes/module-info.class")
1166 (find-files "." ".*")))))
1167 (apply invoke "zip" "--symlinks" "-0" "-X" zip files)
1168 (when (string-suffix? ".jmod" zip)
1169 (let ((new-zip (string-append zip "n"))
1170 (contents (call-with-input-file zip
1171 (@ (ice-9 binary-ports)
1172 get-bytevector-all))))
1173 (call-with-output-file new-zip
1174 (lambda (output-port)
1175 ((@ (ice-9 binary-ports) put-bytevector)
1176 output-port
1177 #vu8(#x4a #x4d #x01 #x00)) ; JM
1178 ((@ (ice-9 binary-ports) put-bytevector)
1179 output-port
1180 contents)))
1181 (rename-file new-zip zip)))))))
1182 (append (find-files (string-append
1183 (assoc-ref outputs "doc")
1184 "/api")
1185 "\\.zip$")
1186 (find-files (assoc-ref outputs "doc") "src\\.zip$")
1187 (find-files (assoc-ref outputs "jdk") "src\\.zip$")
1188 (find-files (assoc-ref outputs "jdk") "\\.jmod$")
1189 (find-files (assoc-ref outputs "jdk") "\\.diz$")
1190 (find-files (assoc-ref outputs "out") "\\.diz$")
1191
1192 (list (string-append (assoc-ref outputs "jdk")
1193 "/lib/jrt-fs.jar"))
1194 (find-files (string-append (assoc-ref outputs "jdk")
1195 "/demo")
1196 "\\.jar$"))))))))
1197 (inputs
1198 (list alsa-lib
1199 cups
1200 fontconfig
1201 freetype
1202 giflib
1203 lcms
1204 elfutils
1205 libjpeg-turbo
1206 libice
1207 libpng
1208 libx11
1209 libxcomposite
1210 libxi
1211 libxinerama
1212 libxrender
1213 libxt
1214 libxtst))
1215 (native-inputs
1216 (list icedtea-8
1217 `(,icedtea-8 "jdk")
1218 ;; XXX: The build system fails with newer versions of GNU Make.
1219 gnu-make-4.2
1220 nss-certs
1221 unzip
1222 which
1223 zip))
1224 (home-page "https://openjdk.org/projects/jdk9/")
1225 (synopsis "Java development kit")
1226 (description
1227 "This package provides the Java development kit OpenJDK.")
1228 (license license:gpl2+)))
1229
1230(define-public openjdk10
1231 (package
1232 (inherit openjdk9)
1233 (name "openjdk")
1234 (version "10.46")
1235 (source (origin
1236 (method hg-fetch)
1237 (uri (hg-reference (url "https://hg.openjdk.org/jdk/jdk")
1238 (changeset "jdk-10+46")))
1239 (file-name (hg-file-name name version))
1240 (modules '((guix build utils)))
1241 (snippet `(begin
1242 (for-each delete-file
1243 (find-files "." ".*.(bin|exe|jar)$"))))
1244 (sha256
1245 (base32
1246 "0i47ar8lxzjrkkiwbzybfxs473390h4jq9ahm3xqdvy5zpchxy3y"))
1247 (patches (search-patches
1248 "openjdk-10-char-reproducibility.patch"
1249 "openjdk-10-classlist-reproducibility.patch"
1250 "openjdk-10-corba-reproducibility.patch"
1251 "openjdk-10-idlj-reproducibility.patch"
1252 "openjdk-10-module-reproducibility.patch"
1253 "openjdk-10-module3-reproducibility.patch"
1254 "openjdk-10-module4-reproducibility.patch"
1255 "openjdk-10-jar-reproducibility.patch"
1256 "openjdk-10-jtask-reproducibility.patch"
1257 "openjdk-10-pointer-comparison.patch"
1258 "openjdk-10-setsignalhandler.patch"
1259 "openjdk-currency-time-bomb2.patch"))))
1260 (arguments
1261 (substitute-keyword-arguments (package-arguments openjdk9)
1262 ((#:phases phases)
1263 `(modify-phases ,phases
1264 ,@(if (target-aarch64?)
1265 `((replace 'patch-for-aarch64
1266 (lambda _
1267 (substitute* "src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp"
1268 ;; This line is duplicated, so remove both occurrences,
1269 ;; then add back one occurrence by substituting a
1270 ;; comment that occurs once.
1271 (("using MacroAssembler::call_VM_leaf_base;") "")
1272 (("Interpreter specific version of call_VM_base")
1273 (string-append "Interpreter specific version of call_VM_base\n"
1274 " using MacroAssembler::call_VM_leaf_base;"))))))
1275 '())
1276 (replace 'fix-java-shebangs
1277 (lambda _
1278 ;; This file was "fixed" by patch-source-shebangs, but it requires
1279 ;; this exact first line.
1280 (substitute* "make/data/blacklistedcertsconverter/blacklisted.certs.pem"
1281 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))))
1282 (add-after 'unpack 'remove-timestamping
1283 (lambda _
1284 (substitute* "./src/hotspot/share/runtime/vm_version.cpp"
1285 (("__DATE__") "")
1286 (("__TIME__") ""))))
1287 (replace 'configure
1288 (lambda* (#:key inputs outputs #:allow-other-keys)
1289 (invoke "bash" "./configure"
1290 ;; Add flags for compilation with gcc >= 10
1291 ,(string-append "--with-extra-cflags=-fcommon"
1292 " -fno-delete-null-pointer-checks"
1293 " -fno-lifetime-dse"
1294 ;; flags for compilation with gcc >= 14.
1295 " -Wno-error=int-conversion")
1296 (string-append "--with-freetype="
1297 (assoc-ref inputs "freetype"))
1298 "--disable-freetype-bundling"
1299 "--disable-warnings-as-errors"
1300 "--disable-hotspot-gtest"
1301 "--with-giflib=system"
1302 "--with-libjpeg=system"
1303 "--with-native-debug-symbols=zipped"
1304 (string-append "--prefix=" (assoc-ref outputs "out")))))
1305 (add-after 'unpack 'disable-warnings-as-errors
1306 (lambda _
1307 ;; It looks like the "--disable-warnings-as-errors" option of
1308 ;; the 'configure' phase is not working.
1309 (substitute* "make/autoconf/generated-configure.sh"
1310 (("-Werror") ""))))))
1311 ((#:disallowed-references _ '())
1312 `(,(this-package-native-input "openjdk9")
1313 ,(gexp-input (this-package-native-input "openjdk9") "jdk")))))
1314 (native-inputs
1315 `(("openjdk9" ,openjdk9)
1316 ("openjdk9:jdk" ,openjdk9 "jdk")
1317 ("[email protected]" ,gnu-make-4.2)
1318 ("nss-certs" ,nss-certs)
1319 ("unzip" ,unzip)
1320 ("which" ,which)
1321 ("zip" ,zip)))))
1322
1323(define-public openjdk11
1324 (package
1325 (name "openjdk")
1326 (version "11.0.22")
1327 (source (origin
1328 (method url-fetch)
1329 (uri (string-append "https://openjdk-sources.osci.io/openjdk11/openjdk-"
1330 version "-ga.tar.xz"))
1331 (file-name (string-append name "-" version ".tar.xz"))
1332 (sha256
1333 (base32
1334 "18ca4syp9xlrqjgyjkb1sp9835riy6aym5xs81r8byrz6jlb2473"))
1335 (modules '((guix build utils)))
1336 (snippet
1337 '(for-each delete-file (find-files "." "\\.(bin|exe|jar)$")))
1338 (patches
1339 (search-patches "openjdk-10-module3-reproducibility.patch"
1340 "openjdk-10-module4-reproducibility.patch"
1341 "openjdk-10-char-reproducibility.patch"
1342 "openjdk-11-classlist-reproducibility.patch"
1343 "openjdk-10-jar-reproducibility.patch"
1344 "openjdk-10-jtask-reproducibility.patch"
1345 "openjdk-currency-time-bomb2.patch"))))
1346 (build-system gnu-build-system)
1347 (outputs '("out" "jdk" "doc"))
1348 (arguments
1349 (list
1350 ;; Prevent a java.util.ConcurrentModificationException.
1351 #:parallel-build? #f
1352 #:modules `((guix build gnu-build-system)
1353 (guix build utils)
1354 (ice-9 match)
1355 (ice-9 popen)
1356 (srfi srfi-1)
1357 (srfi srfi-26))
1358
1359 #:disallowed-references
1360 (list (this-package-native-input "openjdk")
1361 (gexp-input (this-package-native-input "openjdk")
1362 "jdk"))
1363
1364 #:tests? #f ; requires jtreg
1365 ;; TODO package jtreg
1366 #:configure-flags
1367 #~(list
1368 ;; Add flags for compilation with gcc >= 10.
1369 #$(string-append "--with-extra-cflags=-fcommon"
1370 " -fno-delete-null-pointer-checks"
1371 " -fno-lifetime-dse"
1372 ;; flags for compilation with gcc >= 14.
1373 " -Wno-error=int-conversion")
1374 ;; Otherwise, the '--enable-fast-install' causes an error.
1375 "--disable-option-checking"
1376 "--disable-warnings-as-errors"
1377 ;; Make validate-runpath pass (see:
1378 ;; http://issues.guix.info/issue/32894).
1379 "--with-native-debug-symbols=zipped"
1380 ;; Do not use the bundled libraries.
1381 "--with-giflib=system"
1382 "--with-lcms=system"
1383 "--with-libjpeg=system"
1384 "--with-libpng=system"
1385 "--with-version-pre="
1386 ;; Should be set by SOURCE_DATE_EPOCH handler, but isn't being
1387 ;; set; do it manually.
1388 "--with-hotspot-build-time=1970-01-01T00:00:01"
1389 "--enable-reproducible-build" ; to be sure
1390 ;; Allow the build system to locate the system freetype.
1391 (string-append "--with-freetype-include="
1392 #$(this-package-input "freetype") "/include")
1393 (string-append "--with-freetype-lib="
1394 #$(this-package-input "freetype") "/lib"))
1395 #:phases
1396 #~(modify-phases %standard-phases
1397 (add-after 'patch-source-shebangs 'fix-java-shebangs
1398 (lambda _
1399 ;; This file was "fixed" by patch-source-shebangs, but it requires
1400 ;; this exact first line.
1401 (substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
1402 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))
1403 (add-after 'unpack 'remove-timestamping
1404 (lambda _
1405 (substitute* "src/hotspot/share/runtime/abstract_vm_version.cpp"
1406 (("__DATE__") "")
1407 (("__TIME__") ""))))
1408 (add-after 'unpack 'patch-jni-libs
1409 ;; Hardcode dynamically loaded libraries.
1410 (lambda _
1411 (define remove
1412 (@ (srfi srfi-1) remove))
1413
1414 (define (icedtea-or-openjdk? path)
1415 (or (string-contains path "openjdk")
1416 (string-contains path "icedtea")))
1417
1418 (let* ((library-path (remove icedtea-or-openjdk?
1419 (search-path-as-string->list
1420 (getenv "LIBRARY_PATH"))))
1421 (find-library (lambda (name)
1422 (or (search-path
1423 library-path
1424 (string-append "lib" name ".so"))
1425 (string-append "lib" name ".so")))))
1426 (for-each
1427 (lambda (file)
1428 (catch 'decoding-error
1429 (lambda ()
1430 (substitute* file
1431 (("VERSIONED_JNI_LIB_NAME\\(\"([^\"]*)\", \"([^\"]*)\"\\)"
1432 _ name version)
1433 (string-append "\"" (find-library name) "\""))
1434 (("JNI_LIB_NAME\\(\"([^\"]*)\"\\)" _ name)
1435 (string-append "\"" (find-library name) "\""))))
1436 (lambda _
1437 ;; Those are safe to skip.
1438 (format (current-error-port)
1439 "warning: failed to substitute: ~a~%"
1440 file))))
1441 (find-files "." "\\.c$|\\.h$")))))
1442 (add-before 'build 'write-source-revision-file
1443 (lambda _
1444 (with-output-to-file ".src-rev"
1445 (lambda _
1446 (display #$version)))))
1447 (replace 'build
1448 (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
1449 (apply invoke "make" "all"
1450 `(,@(if parallel-build?
1451 (list (string-append "JOBS="
1452 (number->string (parallel-job-count))))
1453 '("JOBS=1"))
1454 ,@make-flags))))
1455 ;; jdk 11 does not build jre by default any more; so explicitly build
1456 ;; it (see:
1457 ;; https://github.com/AdoptOpenJDK/openjdk-build/issues/356).
1458 (add-after 'build 'build-jre
1459 (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
1460 (apply invoke "make" "legacy-jre-image"
1461 `(,@(if parallel-build?
1462 (list (string-append "JOBS="
1463 (number->string (parallel-job-count))))
1464 '("JOBS=1"))
1465 ,@make-flags))))
1466 (replace 'install
1467 (lambda _
1468 (let ((images (car (find-files "build" "-server-release"
1469 #:directories? #t))))
1470 (copy-recursively (string-append images "/images/jdk")
1471 #$output:jdk)
1472 (copy-recursively (string-append images "/images/jre")
1473 #$output)
1474 (copy-recursively (string-append images "/images/docs")
1475 #$output:doc))))
1476 ;; Some of the libraries in the lib/ folder link to libjvm.so.
1477 ;; But that shared object is located in the server/ folder, so it
1478 ;; cannot be found. This phase creates a symbolic link in the
1479 ;; lib/ folder so that the other libraries can find it.
1480 ;;
1481 ;; See:
1482 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1483 ;;
1484 ;; FIXME: Find the bug in the build system, so that this symlink is
1485 ;; not needed.
1486 (add-after 'install 'install-libjvm
1487 (lambda _
1488 (let ((lib-out (string-append #$output "/lib"))
1489 (lib-jdk (string-append #$output:jdk "/lib")))
1490 (symlink (string-append lib-jdk "/server/libjvm.so")
1491 (string-append lib-jdk "/libjvm.so"))
1492 (symlink (string-append lib-out "/server/libjvm.so")
1493 (string-append lib-out "/libjvm.so")))))
1494 (add-after 'install 'strip-character-data-timestamps
1495 (lambda _
1496 (let ((archive (string-append #$output:jdk "/lib/src.zip"))
1497 (dir (mkdtemp "zip-contents.XXXXXX")))
1498 (with-directory-excursion dir
1499 (invoke "unzip" archive))
1500 (delete-file archive)
1501 (with-directory-excursion dir
1502 (let ((char-data-files (find-files "." "CharacterData")))
1503 (for-each (lambda (file)
1504 (substitute* file
1505 (((string-append "This file was generated "
1506 "AUTOMATICALLY from a template "
1507 "file.*"))
1508 (string-append "This file was generated "
1509 "AUTOMATICALLY from a template "
1510 "file"))))
1511 char-data-files)))
1512 (with-directory-excursion dir
1513 (let ((files (find-files "." #:directories? #t)))
1514 (apply invoke "zip" "-0" "-X" archive files))))))
1515 (add-after 'strip-character-data-timestamps 'remove-extraneous-files
1516 (lambda* (#:key outputs #:allow-other-keys)
1517 ;; Remove the *.diz and src.zip files for space considerations.
1518 ;; The former are compressed debuginfo files not typically
1519 ;; shipped with Java distributions, while the later corresponds
1520 ;; to Java core API source files.
1521 (for-each delete-file
1522 (append-map (cut find-files <> "(^src\\.zip|\\.diz)$")
1523 (map (match-lambda
1524 ((name . dir)
1525 dir))
1526 outputs)))))
1527 (add-after 'remove-extraneous-files 'strip-archive-timestamps
1528 (lambda _
1529 (use-modules (ice-9 binary-ports)
1530 (rnrs bytevectors))
1531 (letrec ((repack-archive
1532 (lambda (archive)
1533 (let ((dir (mkdtemp "zip-contents.XXXXXX")))
1534 (with-directory-excursion dir
1535 (invoke "unzip" archive))
1536 (delete-file archive)
1537 (for-each (compose repack-archive canonicalize-path)
1538 (find-files dir "(ct\\.sym|\\.jar)$"))
1539 (let ((reset-file-timestamp
1540 (lambda (file)
1541 (let ((s (lstat file)))
1542 (unless (eq? (stat:type s) 'symlink)
1543 (format #t "reset ~a~%" file)
1544 (utime file 0 0 0 0))))))
1545 (for-each reset-file-timestamp
1546 (find-files dir #:directories? #t)))
1547 (with-directory-excursion dir
1548 (let ((files (find-files "." #:directories? #t)))
1549 (apply invoke "zip" "-0" "-X" archive files)))))))
1550 (for-each repack-archive
1551 (find-files #$output:doc "\\.zip$"))
1552 (for-each repack-archive
1553 (find-files #$output:jdk "\\.(zip|jar)$"))
1554 (repack-archive (string-append #$output:jdk "/lib/ct.sym"))
1555 (let ((repack-jmod
1556 (lambda (file-name)
1557 (call-with-input-file file-name
1558 (lambda (file)
1559 (let ((header #vu8(#x4a #x4d #x01 #x00)))
1560 (if (equal? (get-bytevector-n
1561 file (bytevector-length header))
1562 header)
1563 (let* ((header-length (bytevector-length header))
1564 (temp-file (mkstemp!
1565 (string-copy
1566 "temp-file.XXXXXX")))
1567 (temp-filename (port-filename temp-file))
1568 (content-length
1569 (- (stat:size (stat file))
1570 header-length)))
1571 (sendfile temp-file file content-length header-length)
1572 (delete-file file-name)
1573 (close-port temp-file)
1574 (repack-archive (canonicalize-path temp-filename))
1575 (call-with-output-file file-name
1576 (lambda (file)
1577 (put-bytevector file header)
1578 (call-with-input-file temp-filename
1579 (lambda (temp-file)
1580 (sendfile
1581 file temp-file
1582 (stat:size (stat temp-file)) 0)))))))))))))
1583 (for-each repack-jmod
1584 (find-files #$output:jdk "\\.jmod$"))))))
1585 (add-after 'install 'remove-timestamp-from-api-summary
1586 (lambda _
1587 (substitute* (string-append #$output:doc
1588 "/api/overview-summary.html")
1589 (("Generated by javadoc \\(11-internal\\).*$")
1590 "Generated by javadoc (11-internal) -->\n")))))))
1591 (inputs
1592 (list alsa-lib
1593 cups
1594 fontconfig
1595 freetype
1596 giflib
1597 lcms
1598 libjpeg-turbo
1599 libpng
1600 libx11
1601 libxext
1602 libxrandr
1603 libxrender
1604 libxt
1605 libxtst))
1606 (native-inputs
1607 (list autoconf
1608 bash ; not bash-minimal, needs ulimit
1609 openjdk10
1610 `(,openjdk10 "jdk")
1611 gnu-make-4.2
1612 nss-certs
1613 pkg-config
1614 unzip
1615 which
1616 zip))
1617 (home-page "https://openjdk.org/projects/jdk/11/")
1618 (synopsis "Java development kit")
1619 (description
1620 "This package provides the Java development kit OpenJDK.")
1621 (license license:gpl2+)))
1622
1623(define-syntax make-openjdk
1624 ;; Return an OpenJDK package at VERSION with checksum HASH, using BOOTSTRAP,
1625 ;; the bootstrap package. One or more FIELD can be provided to further
1626 ;; refine the package definition; for convenience, the BASE, NAME and
1627 ;; VERSION are defined in their scope.
1628 (lambda (x)
1629 (syntax-case x ()
1630 ((_ bootstrap version* hash field ...)
1631 (with-syntax ((base (datum->syntax x 'base))
1632 (name (datum->syntax x 'name))
1633 (version (datum->syntax x 'version)))
1634 #'(let ((base (package
1635 (inherit bootstrap)
1636 (name "openjdk")
1637 (version version*)
1638 (source
1639 (origin
1640 (inherit (package-source bootstrap))
1641 (method git-fetch)
1642 (uri (git-reference
1643 (url (format
1644 #f "https://github.com/openjdk/jdk~au"
1645 (version-major version*)))
1646 (commit (string-append "jdk-" version*
1647 "-ga"))))
1648 (file-name (git-file-name name version))
1649 (sha256 (base32 hash))))
1650 (properties
1651 '((release-tag-prefix . "jdk-")
1652 (release-tag-suffix . "-ga")
1653 (release-tag-version-delimiter . ".")))
1654 (native-inputs
1655 (modify-inputs (package-native-inputs bootstrap)
1656 (replace "openjdk" bootstrap)))
1657 (home-page (string-append
1658 "https://openjdk.java.net/projects/jdk/"
1659 (version-major version)))))
1660 (name "openjdk")
1661 (version version*))
1662 (package
1663 (inherit base)
1664 field
1665 ...)))))))
1666
1667(define-public openjdk12
1668 (make-openjdk
1669 openjdk11 "12.33" "0pi2gwib3j2imi4l623iaywrmvfh9rqzh82lj2gxqbrmg55swvjf"
1670 (source
1671 (origin
1672 (method url-fetch)
1673 (uri "http://hg.openjdk.java.net/jdk/jdk/archive/0276cba45aac.tar.bz2")
1674 (file-name (string-append name "-" version ".tar.bz2"))
1675 (sha256
1676 (base32
1677 "0pi2gwib3j2imi4l623iaywrmvfh9rqzh82lj2gxqbrmg55swvjf"))
1678 (modules '((guix build utils)))
1679 (snippet
1680 '(for-each delete-file (find-files "." "\\.(bin|exe|jar)$")))
1681 (patches (search-patches "openjdk-10-setsignalhandler.patch"))))
1682 (arguments
1683 (substitute-keyword-arguments (package-arguments openjdk11)
1684 ;; Re-enable parallel build.
1685 ((#:parallel-build? _ #t) #t)
1686 ((#:phases phases)
1687 #~(modify-phases #$phases
1688 #$@(if (target-aarch64?)
1689 #~((add-after 'unpack 'patch-for-aarch64
1690 (lambda _
1691 (substitute* "src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp"
1692 ;; This line is duplicated, so remove both occurrences,
1693 ;; then add back one occurrence by substituting a
1694 ;; comment that occurs once.
1695 (("using MacroAssembler::call_VM_leaf_base;") "")
1696 (("Interpreter specific version of call_VM_base")
1697 (string-append "Interpreter specific version of call_VM_base\n"
1698 " using MacroAssembler::call_VM_leaf_base;"))))))
1699 #~())
1700 (replace 'remove-timestamping
1701 (lambda _
1702 (substitute* "src/hotspot/share/runtime/vm_version.cpp"
1703 (("__DATE__") "")
1704 (("__TIME__") ""))))
1705 (replace 'fix-java-shebangs
1706 (lambda _
1707 ;; 'blocked' was renamed to 'blacklisted' in this version for
1708 ;; some reason.
1709 (substitute* "make/data/blacklistedcertsconverter/\
1710blacklisted.certs.pem"
1711 (("^#!.*")
1712 "#! java BlacklistedCertsConverter SHA-256\n"))))))))))
1713
1714(define-public openjdk13
1715 (make-openjdk openjdk12 "13.0.14"
1716 "1v92i5rhahqkjw8mz09c9qasnxqc67ygy0y266kdmm534z0da755"
1717 (source (origin
1718 (inherit (package-source base))
1719 (patches (search-patches "openjdk-13-classlist-reproducibility.patch"
1720 "openjdk-10-jtask-reproducibility.patch"))))
1721 (arguments
1722 (substitute-keyword-arguments (package-arguments openjdk12)
1723 ((#:phases phases)
1724 #~(modify-phases #$phases
1725 (replace 'remove-timestamping
1726 (lambda _
1727 (substitute*
1728 "src/hotspot/share/runtime/abstract_vm_version.cpp"
1729 (("__DATE__") "")
1730 (("__TIME__") ""))))))))))
1731
1732(define-public openjdk14
1733 (make-openjdk
1734 openjdk13 "14.0.2"
1735 "07k9bsbxwyf2z2n50z96nvhsdai916mxdxcr5lm44jz7f6xrwfq6"
1736 (source (origin
1737 (inherit (package-source base))
1738 (snippet ;override snippet
1739 '(begin
1740 ;; The m4 macro uses 'help' to search for builtins, which is
1741 ;; not available in bash-minimal
1742 (substitute* "make/autoconf/basics.m4"
1743 (("if help") "if command -v"))
1744 (for-each delete-file (find-files "." "\\.(bin|exe|jar)$"))))
1745 (patches (search-patches "openjdk-10-setsignalhandler.patch"
1746 "openjdk-10-jtask-reproducibility.patch"
1747 "openjdk-13-classlist-reproducibility.patch"))))))
1748
1749(define-public openjdk15
1750 (make-openjdk
1751 openjdk14 "15.0.10"
1752 "0hdllv348bws6m992bh73jik18x0sv0k2m9l817b3zb7q802sp7x"
1753 (source (origin
1754 (inherit (package-source base))
1755 (modules '())
1756 (snippet #f)
1757 (patches
1758 (search-patches "openjdk-15-jtask-reproducibility.patch"
1759 "openjdk-15-xcursor-no-dynamic.patch"))))
1760 (inputs
1761 (modify-inputs (package-inputs base)
1762 (append libxcursor))) ;for our patch to work
1763 (native-inputs
1764 (modify-inputs (package-native-inputs base)
1765 (delete "make" ;remove old gnu-make-4.2
1766 "openjdk") ;to remove non-jdk output
1767 (append `(,openjdk14 "jdk"))))))
1768
1769(define-public openjdk16
1770 (make-openjdk openjdk15 "16.0.2"
1771 "0587px2qbz07g3xi4a3ya6m630p72dvkxcn0bj1813pxnwvcgigz"
1772 (source (origin
1773 (inherit (package-source base))
1774 (patches (search-patches "openjdk-15-xcursor-no-dynamic.patch"
1775 "openjdk-10-setsignalhandler.patch"))))))
1776
1777(define-public openjdk17
1778 (make-openjdk
1779 openjdk16 "17.0.10"
1780 "1bq1rqnipz6wdr05s20gm8nlpb3328ljxckzvc5ag0gf7fzlhn5f"
1781 (source (origin
1782 (inherit (package-source base))
1783 (patches (search-patches "openjdk-15-xcursor-no-dynamic.patch"))))
1784 (arguments
1785 (substitute-keyword-arguments (package-arguments openjdk16)
1786 ((#:phases phases)
1787 #~(modify-phases #$phases
1788 (replace 'fix-java-shebangs
1789 (lambda _
1790 ;; 'blacklisted' was renamed back to 'blocked'.
1791 (substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
1792 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))))
1793
1794(define-public openjdk18
1795 (make-openjdk openjdk17 "18.0.2.1"
1796 "0zxanjzz4p3psqahlidh55vx1ldanq70c2ygk3gcfn9a94vnr9rg"))
1797
1798(define-public openjdk19
1799 (make-openjdk openjdk18 "19.0.2"
1800 "08kvx7n8qhhfl25pig966881j5h4x7y0pf4brq16x0283fc0f4d4"
1801 (arguments
1802 (substitute-keyword-arguments (package-arguments openjdk18)
1803 ((#:phases phases)
1804 #~(modify-phases #$phases
1805 (replace 'fix-java-shebangs
1806 (lambda _
1807 ;; Update file path.
1808 (substitute* "src/java.base/share/data/blockedcertsconverter/blocked.certs.pem"
1809 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))
1810 (add-before 'configure 'define-java-environment-variables
1811 (lambda* (#:key inputs #:allow-other-keys)
1812 ;; Fix for "valid range 1980-01-01T00:00:02Z to 2099-12-31T23:59:59Z".
1813 (setenv "SOURCE_DATE_EPOCH" "1234567890")))))))))
1814
1815(define-public openjdk20
1816 (make-openjdk openjdk19 "20.0.2"
1817 "1af1v2c3d8x4c6shzl6cv9qwq7a4hn5map5pjh9vjcky0hkzd489"))
1818
1819(define-public openjdk21
1820 (make-openjdk openjdk20 "21.0.2"
1821 "0d1g3wnzr5whjpq8gvxq0h7kd7lxd3xgc6bh3kg8vzz096asn0kj"
1822 (source (origin
1823 (inherit (package-source base))
1824 (patches (search-patches "openjdk-21-fix-rpath.patch"
1825 "openjdk-15-xcursor-no-dynamic.patch"))))
1826 (arguments
1827 (substitute-keyword-arguments (package-arguments base)
1828 ((#:phases phases)
1829 #~(modify-phases #$phases
1830 (replace 'fix-java-shebangs
1831 (lambda _
1832 ;; 'blacklisted' was renamed back to 'blocked'.
1833 (substitute* "src/java.base/share/data/blockedcertsconverter/blocked.certs.pem"
1834 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))))
1835
1836(define-public openjdk22
1837 (make-openjdk
1838 openjdk21 "22.0.2"
1839 "1nj414yj6v9qrlm48yv5llr4jmgj9g20v6zsd39xrdx4x4x4p3b6"
1840 (arguments
1841 (substitute-keyword-arguments (package-arguments base)
1842 ((#:phases phases)
1843 #~(modify-phases #$phases
1844 (add-after 'unpack 'do-not-disable-new-dtags
1845 (lambda _
1846 ;; Our validate-runpath phases checks for RUNPATH, not RPATH.
1847 (substitute* "make/autoconf/flags-cflags.m4"
1848 ((" -Wl,--disable-new-dtags") ""))))))))))
1849
1850(define-public openjdk23
1851 (make-openjdk
1852 openjdk22 "23.0.2"
1853 "0kxllznzhgqfn8b97krg2yp1ag41g4phmgqahrvzafd2bq6zclnf"
1854 (source (origin
1855 (inherit (package-source base))
1856 ;; The 'openjdk-21-fix-rpath.patch' no longer applies, and it
1857 ;; appears not needed anymore. The
1858 ;; 'openjdk-15-xcursor-no-dynamic.patch' doesn't apply anymore;
1859 ;; the fix should be pursued in libx11 (see:
1860 ;; https://issues.guix.gnu.org/54654)
1861 (patches '())))))
1862
1863(define-public openjdk24
1864 (make-openjdk
1865 openjdk23 "24.0.1"
1866 "0h6sbzbjyqg85iml41pswdh2z3d7h2hhb0sd5yll37r1mj5lsxmx"))
1867
1868(define-public openjdk25
1869 (make-openjdk
1870 openjdk24 "25"
1871 "15yzj370qgkh7jfcm2jzr8g7ah9x0p8m85ang7q4y6lnzk23ni76"))
1872
1873;;; Convenience alias to point to the latest version of OpenJDK.
1874(define-public openjdk openjdk25)
1875
1876
1877;; This version of JBR is here in order to be able to build custom
1878;; IntelliJ plugins. Those usually need both jbr11 and jbr17 for
1879;; tests.
1880(define-public jbr11
1881 (package
1882 (inherit openjdk11)
1883 (name "jbr")
1884 (version "11_0_16-b2248")
1885 (source (origin
1886 (method git-fetch)
1887 (uri (git-reference
1888 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1889 (commit (string-append "jb" version))))
1890 (file-name (string-append name "-" version "-checkout"))
1891 (sha256
1892 (base32
1893 "1fnrdx0wb21ghm6jczjzk7b9fz9hbdzd62512xhwpzvca57v2z09"))))
1894 (arguments
1895 (substitute-keyword-arguments (package-arguments openjdk11)
1896 ((#:configure-flags configure-flags)
1897 #~(append #$configure-flags
1898 (list "--with-jvm-features=shenandoahgc"
1899 "--enable-cds=yes"
1900 "--with-vendor-name=JetBrains s.r.o"
1901 "--with-vendor-url=https://www.jetbrains.com/"
1902 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
1903 (synopsis "JetBrains Java Runtime")
1904 (description "This package provides a Java runtime environment for
1905and Java development kit. It supports enhanced class redefinition (DCEVM),
1906includes a number of improvements in font rendering, keyboards support,
1907windowing/focus subsystems, HiDPI, accessibility, and performance,
1908provides better desktop integration and bugfixes not yet present in
1909OpenJDK.")
1910 (home-page "https://www.jetbrains.com/")
1911 (license license:gpl2+)))
1912
1913(define-public jbr17
1914 (package
1915 (inherit openjdk17)
1916 (name "jbr")
1917 (version "17.0.11b1207.30")
1918 (source (origin
1919 (method git-fetch)
1920 (uri (git-reference
1921 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1922 (commit (string-append "jbr-release-" version))))
1923 (file-name (string-append name "-" version "-checkout"))
1924 (sha256
1925 (base32
1926 "5bbf5z8faf9sdkig2fwkj06hb7hs9s3bpzzvbqn2i75lbwqk3bln"))
1927 (patches (search-patches "jbr-17-xcursor-no-dynamic.patch"))))
1928 (arguments
1929 (substitute-keyword-arguments (package-arguments openjdk17)
1930 ((#:configure-flags configure-flags)
1931 #~(append #$configure-flags
1932 (list "--with-jvm-features=shenandoahgc"
1933 "--enable-cds=yes"
1934 "--with-vendor-name=JetBrains s.r.o"
1935 "--with-vendor-url=https://www.jetbrains.com/"
1936 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
1937 (synopsis "JetBrains Java Runtime")
1938 (description "This package provides a Java runtime environment for
1939and Java development kit. It supports enhanced class redefinition (DCEVM),
1940includes a number of improvements in font rendering, keyboards support,
1941windowing/focus subsystems, HiDPI, accessibility, and performance,
1942provides better desktop integration and bugfixes not yet present in
1943OpenJDK.")
1944 (home-page "https://www.jetbrains.com/")
1945 (license license:gpl2+)))
1946
1947(define-public jbr21
1948 (package
1949 (inherit openjdk21)
1950 (name "jbr")
1951 (version "21.0.3b509.11")
1952 (source (origin
1953 (method git-fetch)
1954 (uri (git-reference
1955 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1956 (commit (string-append "jbr-release-" version))))
1957 (file-name (string-append name "-" version "-checkout"))
1958 (sha256
1959 (base32
1960 "03xkghbp0b1czc2ags9n8ilprf9sy4bhsma0wf8xfapqn6d2sfyd"))
1961 (patches (search-patches "openjdk-21-fix-rpath.patch"
1962 "jbr-17-xcursor-no-dynamic.patch"))))
1963 (inputs
1964 `(("wayland" ,wayland)
1965 ("libxkbcommon" ,libxkbcommon) ; for wayland
1966 ,@(package-inputs openjdk21)))
1967 (arguments
1968 (substitute-keyword-arguments (package-arguments openjdk21)
1969 ((#:configure-flags configure-flags)
1970 #~(append #$configure-flags
1971 (list "--with-jvm-features=shenandoahgc"
1972 "--enable-cds=yes"
1973 "--with-vendor-name=JetBrains s.r.o"
1974 "--with-vendor-url=https://www.jetbrains.com/"
1975 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
1976 (synopsis "JetBrains Java Runtime")
1977 (description "This package provides a Java runtime environment for
1978and Java development kit. It supports enhanced class redefinition (DCEVM),
1979includes a number of improvements in font rendering, keyboards support,
1980windowing/focus subsystems, HiDPI, accessibility, and performance,
1981provides better desktop integration and bugfixes not yet present in
1982OpenJDK.")
1983 (home-page "https://www.jetbrains.com/")
1984 (license license:gpl2+)))
1985
1986
1987(define-public ant/java8
1988 (package
1989 (name "ant")
1990 (version "1.10.15")
1991 (source (origin
1992 (method url-fetch)
1993 (uri (string-append "mirror://apache/ant/source/apache-ant-"
1994 version "-src.tar.gz"))
1995 (sha256
1996 (base32
1997 "1ccr852dxg5affdqafg04gi3l89q5c6l9lqrz50jhj05kidljax2"))
1998 (modules '((guix build utils)))
1999 (snippet
2000 '(begin
2001 (for-each delete-file
2002 (find-files "lib/optional" "\\.jar$"))
2003 #t))))
2004 (build-system gnu-build-system)
2005 (arguments
2006 (list
2007 #:modules '((srfi srfi-1)
2008 (guix build gnu-build-system)
2009 (guix build utils))
2010 #:tests? #f ;no "check" target
2011 #:phases
2012 #~(modify-phases %standard-phases
2013 (add-after 'unpack 'remove-scripts
2014 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
2015 ;; wrappers.
2016 (lambda _
2017 (for-each delete-file
2018 (find-files "src/script"
2019 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))))
2020 (delete 'bootstrap)
2021 (delete 'configure)
2022 (replace 'build
2023 (lambda* (#:key inputs #:allow-other-keys)
2024 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
2025
2026 ;; Disable tests to avoid dependency on hamcrest-core, which needs
2027 ;; Ant to build. This is necessary in addition to disabling the
2028 ;; "check" phase, because the dependency on "test-jar" would always
2029 ;; result in the tests to be run.
2030 (substitute* "build.xml"
2031 (("depends=\"jars,test-jar") "depends=\"jars"))
2032 (invoke "bash" "bootstrap.sh"
2033 (string-append "-Ddist.dir=" #$output))))
2034 (add-after 'build 'strip-jar-timestamps ;based on ant-build-system
2035 (lambda _
2036 (define (repack-archive jar)
2037 (let* ((dir (mkdtemp "jar-contents.XXXXXX"))
2038 (manifest (string-append dir "/META-INF/MANIFESTS.MF")))
2039 (with-directory-excursion dir
2040 (invoke "unzip" jar))
2041 (delete-file jar)
2042 ;; XXX: copied from (gnu build install)
2043 (for-each (lambda (file)
2044 (let ((s (lstat file)))
2045 (unless (eq? (stat:type s) 'symlink)
2046 (utime file 0 0 0 0))))
2047 (find-files dir #:directories? #t))
2048 ;; It is important that the manifest appears first.
2049 (with-directory-excursion dir
2050 (let* ((files (find-files "." ".*" #:directories? #t))
2051 ;; To ensure that the reference scanner can
2052 ;; detect all store references in the jars
2053 ;; we disable compression with the "-0" option.
2054 (command (if (file-exists? manifest)
2055 `("zip" "-0" "-X" ,jar ,manifest
2056 ,@files)
2057 `("zip" "-0" "-X" ,jar ,@files))))
2058 (apply invoke command)))))
2059 (for-each repack-archive
2060 (find-files
2061 (string-append #$output "/lib")
2062 "\\.jar$"))))
2063 (delete 'install))))
2064 (native-inputs
2065 `(("jdk" ,icedtea-8 "jdk")
2066 ("zip" ,zip)
2067 ("unzip" ,unzip)))
2068 (home-page "https://ant.apache.org")
2069 (synopsis "Build tool for Java")
2070 (description
2071 "Ant is a platform-independent build tool for Java. It is similar to
2072make but is implemented using the Java language, requires the Java platform,
2073and is best suited to building Java projects. Ant uses XML to describe the
2074build process and its dependencies, whereas Make uses Makefile format.")
2075 (license license:asl2.0)))
2076
2077;; The 1.9.x series is the last that can be built with GCJ. The 1.10.x series
2078;; requires Java 8.
2079(define-public ant
2080 (package (inherit ant/java8)
2081 (version "1.9.15")
2082 (source (origin
2083 (method url-fetch)
2084 (uri (string-append "mirror://apache/ant/source/apache-ant-"
2085 version "-src.tar.gz"))
2086 (sha256
2087 (base32
2088 "1xy30f1w5gaqk6g3f0vw7ygix4rb6032qkcw42y4z8wd9jihgygd"))))
2089 ;; XXX: we do this to avoid a rebuild. This mess will be cleaned up
2090 ;; later.
2091 (arguments
2092 (substitute-keyword-arguments
2093 `(#:modules ((srfi srfi-1)
2094 (guix build gnu-build-system)
2095 (guix build utils))
2096 #:tests? #f ; no "check" target
2097 #:phases
2098 (modify-phases %standard-phases
2099 (delete 'bootstrap)
2100 (delete 'configure)
2101 (add-before 'build 'define-java-environment-variables
2102 (lambda* (#:key inputs #:allow-other-keys)
2103 ;; First, set environment variables (eases debugging on -K).
2104 (setenv "JAVA_HOME" (assoc-ref inputs "jamvm"))
2105 (setenv "JAVACMD" (search-input-file inputs "/bin/jamvm"))
2106 (setenv "JAVAC" (search-input-file inputs "/bin/jikes"))
2107 (setenv "CLASSPATH" (search-input-file inputs "/lib/rt.jar"))))
2108 (replace 'build
2109 (lambda* (#:key inputs outputs #:allow-other-keys)
2110 ;; Ant complains if this file doesn't exist.
2111 (setenv "HOME" "/tmp")
2112 (with-output-to-file "/tmp/.ant.properties"
2113 (lambda _ (display "")))
2114
2115 ;; Use jikes instead of javac for <javac ...> tags in build.xml
2116 (setenv "ANT_OPTS" "-Dbuild.compiler=jikes")
2117
2118 ;; jikes produces lots of warnings, but they are not very
2119 ;; interesting, so we silence them.
2120 (setenv "$BOOTJAVAC_OPTS" "-nowarn")
2121
2122 ;; Without these JamVM options the build may freeze.
2123 (substitute* "bootstrap.sh"
2124 (("^\"\\$\\{JAVACMD\\}\" " m)
2125 ,@(if (string-prefix? "armhf" (or (%current-system)
2126 (%current-target-system)))
2127 `((string-append m "-Xnocompact "))
2128 `((string-append m "-Xnocompact -Xnoinlining ")))))
2129
2130 ;; Disable tests because we are bootstrapping and thus don't have
2131 ;; any of the dependencies required to build and run the tests.
2132 (substitute* "build.xml"
2133 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
2134 (invoke "bash" "bootstrap.sh"
2135 (string-append "-Ddist.dir="
2136 (assoc-ref outputs "out")))))
2137 (add-after 'build 'strip-jar-timestamps ;based on ant-build-system
2138 (lambda* (#:key outputs #:allow-other-keys)
2139 (define (repack-archive jar)
2140 (let* ((dir (mkdtemp "jar-contents.XXXXXX"))
2141 (manifest (string-append dir "/META-INF/MANIFESTS.MF")))
2142 (with-directory-excursion dir
2143 (invoke "unzip" jar))
2144 (delete-file jar)
2145 ;; XXX: copied from (gnu build install)
2146 (for-each (lambda (file)
2147 (let ((s (lstat file)))
2148 (unless (eq? (stat:type s) 'symlink)
2149 (utime file 0 0 0 0))))
2150 (find-files dir #:directories? #t))
2151 ;; It is important that the manifest appears first.
2152 (with-directory-excursion dir
2153 (let* ((files (find-files "." ".*" #:directories? #t))
2154 ;; To ensure that the reference scanner can
2155 ;; detect all store references in the jars
2156 ;; we disable compression with the "-0" option.
2157 (command (if (file-exists? manifest)
2158 `("zip" "-0" "-X" ,jar ,manifest
2159 ,@files)
2160 `("zip" "-0" "-X" ,jar ,@files))))
2161 (apply invoke command)))))
2162 (for-each repack-archive
2163 (find-files
2164 (string-append (assoc-ref %outputs "out") "/lib")
2165 "\\.jar$"))))
2166 (delete 'install)))
2167 ((#:phases phases)
2168 `(modify-phases ,phases
2169 (delete 'define-java-environment-variables)
2170 (add-after 'unpack 'remove-scripts
2171 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
2172 ;; wrappers.
2173 (lambda _
2174 (for-each delete-file
2175 (find-files "src/script"
2176 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))
2177 #t))
2178 (replace 'build
2179 (lambda* (#:key inputs outputs #:allow-other-keys)
2180 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
2181
2182 ;; Disable tests to avoid dependency on hamcrest-core, which needs
2183 ;; Ant to build. This is necessary in addition to disabling the
2184 ;; "check" phase, because the dependency on "test-jar" would always
2185 ;; result in the tests to be run.
2186 (substitute* "build.xml"
2187 (("depends=\"jars,test-jar") "depends=\"jars"))
2188 (invoke "bash" "bootstrap.sh"
2189 (string-append "-Ddist.dir="
2190 (assoc-ref outputs "out")))))))))
2191 (native-inputs
2192 `(("jdk" ,icedtea-7 "jdk")
2193 ("zip" ,zip)
2194 ("unzip" ,unzip)))))
2195
2196(define-public ant-apache-bcel
2197 (package
2198 (inherit ant/java8)
2199 (name "ant-apache-bcel")
2200 (arguments
2201 (substitute-keyword-arguments (package-arguments ant/java8)
2202 ((#:phases phases)
2203 #~(modify-phases #$phases
2204 (add-after 'unpack 'link-bcel
2205 (lambda* (#:key inputs #:allow-other-keys)
2206 (for-each (lambda (file)
2207 (symlink file
2208 (string-append "lib/optional/"
2209 (basename file))))
2210 (find-files (assoc-ref inputs "java-commons-bcel")
2211 "\\.jar$"))))
2212 (add-after 'build 'install
2213 (lambda _
2214 (let ((share (string-append #$output "/share/java"))
2215 (bin (string-append #$output "/bin"))
2216 (lib (string-append #$output "/lib")))
2217 (mkdir-p share)
2218 (install-file (string-append lib "/ant-apache-bcel.jar") share)
2219 (delete-file-recursively bin)
2220 (delete-file-recursively lib))))))))
2221 (inputs
2222 (modify-inputs (package-inputs ant/java8)
2223 (prepend java-commons-bcel)))))
2224
2225(define-public ant-junit
2226 (package
2227 (inherit ant/java8)
2228 (name "ant-junit")
2229 (arguments
2230 (substitute-keyword-arguments (package-arguments ant/java8)
2231 ((#:phases phases)
2232 #~(modify-phases #$phases
2233 (add-after 'unpack 'link-junit
2234 (lambda* (#:key inputs #:allow-other-keys)
2235 (for-each (lambda (file)
2236 (symlink file
2237 (string-append "lib/optional/"
2238 (basename file))))
2239 (find-files (assoc-ref inputs "java-junit")
2240 "\\.jar$"))))
2241 (add-after 'build 'install
2242 (lambda _
2243 (let ((share (string-append #$output "/share/java"))
2244 (bin (string-append #$output "/bin"))
2245 (lib (string-append #$output "/lib")))
2246 (mkdir-p share)
2247 (install-file (string-append lib "/ant-junit.jar") share)
2248 (delete-file-recursively bin)
2249 (delete-file-recursively lib))))))))
2250 (inputs
2251 (modify-inputs (package-inputs ant/java8)
2252 (prepend java-junit)))))
2253
2254(define-public libantlr3c
2255 (package
2256 (name "libantlr3c")
2257 (version "3.4")
2258 (source
2259 (origin
2260 (method url-fetch)
2261 (uri
2262 (string-append "https://www.antlr3.org/download/C/"
2263 name "-" version ".tar.gz"))
2264 (sha256
2265 (base32 "0lpbnb4dq4azmsvlhp6khq1gy42kyqyjv8gww74g5lm2y6blm4fa"))))
2266 (build-system gnu-build-system)
2267 (arguments
2268 (list #:configure-flags
2269 #~(list "--enable-debuginfo"
2270 "--disable-static"
2271 #$@(if (target-64bit?)
2272 #~("--enable-64bit")
2273 #~())
2274 #$@(if (target-riscv64?)
2275 #~("--disable-abiflags")
2276 #~()))))
2277 (synopsis "ANTLR C Library")
2278 (description "LIBANTLR3C provides run-time C libraries for ANTLR3 (ANother
2279Tool for Language Recognition v3).")
2280 (home-page "https://www.antlr3.org/")
2281 (license license:bsd-3)))
2282
2283(define-public drip
2284 ;; Last release is from 2014, with a few important commits afterwards.
2285 (let ((commit "a4bd00df0199e78243847f06cc04ecaea31f8f08"))
2286 (package
2287 (name "drip")
2288 (version (git-version "0.2.4" "1" commit))
2289 (source (origin
2290 (method git-fetch)
2291 (uri (git-reference
2292 (url "https://github.com/ninjudd/drip")
2293 (commit commit)))
2294 (file-name (git-file-name name version))
2295 (sha256
2296 (base32
2297 "0wzmjwfyldr3jn49517xd8yn7dgdk8h88qkga3kjyg1zc375ylg2"))))
2298 (build-system gnu-build-system)
2299 (native-inputs
2300 `(("jdk" ,icedtea "jdk")))
2301 (arguments
2302 (list #:tests? #f ; No tests.
2303 #:phases
2304 #~(modify-phases %standard-phases
2305 (delete 'configure)
2306 (add-before 'build 'relax-gcc-14-strictness
2307 (lambda _
2308 (substitute* "Makefile"
2309 ((" gcc(.*)$" all options)
2310 (string-append
2311 " gcc"
2312 " -Wno-error=incompatible-pointer-types"
2313 " -Wno-error=implicit-function-declaration"
2314 options)))))
2315 (add-before 'install 'fix-wrapper
2316 (lambda* (#:key inputs #:allow-other-keys)
2317 (let ((jps (search-input-file inputs "/bin/jps")))
2318 (substitute* "bin/drip"
2319 (("jps") jps)
2320 (("brew update && brew upgrade drip") "guix pull && guix install drip")
2321 ;; No need to make:
2322 (("\\(cd -- \"\\$drip_dir\" && make -s\\) \\|\\| exit 1") "")
2323 ;; No need to include source:
2324 (("\\[\\[ -r \\$drip_dir/src/org/flatland/drip/Main\\.java \\]\\]")
2325 "true")))))
2326 (replace 'install
2327 (lambda* (#:key outputs #:allow-other-keys)
2328 (let* ((bin (string-append #$output "/bin"))
2329 (share (string-append #$output "/share/drip")))
2330 (mkdir-p bin)
2331 (for-each
2332 (lambda (file)
2333 (install-file (string-append "bin/" file) bin))
2334 '("drip" "drip_daemon" "drip_proxy"))
2335 (install-file "drip.jar" share)
2336 (substitute* (string-append bin "/drip")
2337 (("drip_dir=\\$bin_dir/..")
2338 (string-append "drip_dir=" share)))))))))
2339 (home-page "https://github.com/ninjudd/drip")
2340 (synopsis "Faster Java Virtual Machine launching")
2341 (description "Drip is a launcher for the Java Virtual Machine that
2342provides much faster startup times than the @command{java} command. The @command{drip}
2343script is intended to be a drop-in replacement for the @command{java} command,
2344only faster.")
2345 (license license:epl1.0))))
2346
2347(define-public java-openjfx-build
2348 (package
2349 (name "java-openjfx-build")
2350 ;; This is a java-8 version
2351 (version "8.202")
2352 (source (origin
2353 (method hg-fetch)
2354 (uri (hg-reference
2355 (url "http://hg.openjdk.java.net/openjfx/8u-dev/rt")
2356 (changeset (string-append
2357 (string-join (string-split version #\.) "u")
2358 "-ga"))))
2359 (file-name (string-append name "-" version "-checkout"))
2360 (modules '((guix build utils)))
2361 (snippet
2362 '(begin
2363 ;; Delete included gradle jar
2364 (delete-file-recursively "gradle/wrapper")
2365 #t))
2366 (sha256
2367 (base32
2368 "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))
2369 (patches (search-patches "java-openjfx-build-jdk_version.patch"))))
2370 (build-system ant-build-system)
2371 (arguments
2372 `(#:jar-name "java-openjfx.jar"
2373 #:source-dir "buildSrc/src/main/java"
2374 #:test-dir "buildSrc/src/test"
2375 #:phases
2376 (modify-phases %standard-phases
2377 (add-before 'configure 'generate-jsl-parser
2378 (lambda _
2379 (invoke "antlr3" "-o"
2380 "buildSrc/src/main/java/com/sun/scenario/effect/compiler"
2381 "buildSrc/src/main/antlr/JSL.g"))))))
2382 (inputs
2383 (list antlr3 java-stringtemplate))
2384 (native-inputs
2385 (list java-junit java-hamcrest-core))
2386 (home-page "https://openjfx.io")
2387 (synopsis "Graphical application toolkit in Java")
2388 (description "OpenJFX is a client application platform for desktop,
2389mobile and embedded systems built on Java. Its goal is to produce a
2390modern, efficient, and fully featured toolkit for developing rich client
2391applications. This package contains base classes for the OpenJFX
2392distribution and helper classes for building other parts of the
2393distribution.")
2394 (license license:gpl2))) ;gpl2 only, with classpath exception
2395
2396(define-public java-openjfx-base
2397 (package (inherit java-openjfx-build)
2398 (name "java-openjfx-base")
2399 (arguments
2400 `(#:jar-name "java-openjfx-base.jar"
2401 #:source-dir "modules/base/src/main/java:modules/base/src/main/java8:modules/base/src/main/version-info"
2402 #:test-dir "modules/base/src/test"
2403 #:phases
2404 (modify-phases %standard-phases
2405 (add-before 'check 'remove-empty-file
2406 (lambda _
2407 (with-directory-excursion "modules/base/src/test/java"
2408 ;; These files are completely commented, but junit expects them to
2409 ;; contain a class, so tests fail.
2410 (delete-file
2411 "com/sun/javafx/property/adapter/PropertyDescriptorTest.java")
2412 (delete-file
2413 "com/sun/javafx/property/adapter/ReadOnlyPropertyDescriptorTest.java")
2414 (delete-file "javafx/beans/property/PropertiesTest.java")
2415 (delete-file
2416 "javafx/beans/property/adapter/ReadOnlyJavaBeanPropertyBuilder_General_Test.java")
2417 ;; This one fails
2418 (delete-file "com/sun/javafx/runtime/VersionInfoTest.java"))
2419 #t)))))
2420 (propagated-inputs
2421 (list java-openjfx-build))
2422 (description "OpenJFX is a client application platform for desktop,
2423mobile and embedded systems built on Java. Its goal is to produce a
2424modern, efficient, and fully featured toolkit for developing rich client
2425applications. This package contains base classes for the OpenJFX
2426distribution.")))
2427
2428(define-public java-openjfx-graphics
2429 (package (inherit java-openjfx-build)
2430 (name "java-openjfx-graphics")
2431 (arguments
2432 `(#:jar-name "java-openjfx-graphics.jar"
2433 #:source-dir "modules/graphics/src/main/java"
2434 #:tests? #f; require X
2435 #:test-dir "modules/graphics/src/test"
2436 #:phases
2437 (modify-phases %standard-phases
2438 (add-after 'unpack 'copy-missing-file
2439 (lambda* (#:key inputs #:allow-other-keys)
2440 (let ((target "modules/graphics/src/main/native-prism-sw/JNativeSurface.c"))
2441 (copy-file (assoc-ref inputs "JNativeSurface.c") target)
2442 ;; XXX: looks like the missing file we found isn't *quite*
2443 ;; compatible...
2444 (substitute* target
2445 (("case TYPE_INT_ARGB:") "")))))
2446 (add-after 'build 'build-native
2447 (lambda* (#:key inputs outputs #:allow-other-keys)
2448 (let ((jdk (assoc-ref inputs "jdk"))
2449 (class-file->class-name
2450 (lambda (class-file)
2451 (string-map (lambda (c)
2452 (if (char=? c #\/) #\. c))
2453 (string-drop-right class-file
2454 (string-length ".class"))))))
2455 (setenv "CPPFLAGS"
2456 (string-append "-DINLINE=inline "
2457 "-DLINUX "
2458 "-I" jdk "/include "
2459 "-I" jdk "/include/linux "
2460 "-I " (getcwd) "/build/classes/include "
2461 "-I " (getcwd) "/modules/graphics/src/main/native-prism-sw"))
2462
2463 ;; Instructions have been adapted from buildSrc/linux.gradle
2464 (with-directory-excursion "build/classes"
2465 ;; Build prism
2466 (mkdir-p "include")
2467
2468 ;; Generate headers for prism
2469 (apply invoke "javah" "-d" "include" "-cp" "."
2470 (map class-file->class-name
2471 (append (find-files "com/sun/prism/impl" "\\.class$")
2472 (find-files "com/sun/prism" "PresentableState.*\\.class$"))))
2473
2474 ;; ...then for prism_sw
2475 (apply invoke "javah" "-d" "include" "-cp" "."
2476 (map class-file->class-name
2477 (find-files "com/sun/pisces" "\\.class$")))
2478
2479 ;; ...and for prism_es2
2480 (apply invoke "javah" "-d" "include" "-cp" "."
2481 (map class-file->class-name
2482 (find-files "com/sun/prism/es2" "\\.class$")))))
2483
2484 (with-directory-excursion "netbeans/native-prism"
2485 (invoke "make" "CONF=Release"))
2486 (with-directory-excursion "netbeans/native-prism-sw"
2487 (invoke "make" "CONF=Release"))
2488 ;; TODO: This fails due to unknown EGL procedure names
2489 #;
2490 (with-directory-excursion "netbeans/native-prism-es2"
2491 (invoke "make" "CONF=Release"))
2492
2493 (let* ((out (assoc-ref outputs "out"))
2494 (dir ,(match (%current-system)
2495 ("i686-linux"
2496 "i386")
2497 ((or "armhf-linux" "aarch64-linux")
2498 "arm")
2499 ((or "x86_64-linux")
2500 "amd64")
2501 (_ "unknown")))
2502 (target (string-append out "/share/" dir "/")))
2503 (mkdir-p target)
2504 (for-each (lambda (file)
2505 (let ((new-name
2506 (string-append "lib"
2507 (string-map
2508 (lambda (c)
2509 (if (char=? c #\-) #\_ c))
2510 (string-drop (basename file)
2511 (string-length "libnative-"))))))
2512 (copy-file file
2513 (string-append target new-name))))
2514 (find-files "netbeans" "\\.so$"))))))))
2515 (propagated-inputs
2516 (list java-openjfx-base))
2517 (inputs
2518 (list java-swt))
2519 ;; XXX: for unknown reasons
2520 ;; modules/graphics/src/main/native-prism-sw/JNativeSurface.c is missing
2521 ;; in this revision.
2522 (native-inputs
2523 `(("JNativeSurface.c"
2524 ,(origin
2525 (method url-fetch)
2526 (uri "https://raw.githubusercontent.com/openjdk/jfx/8u20-b02\
2527/modules/graphics/src/main/native-prism-sw/JNativeSurface.c")
2528 (sha256
2529 (base32
2530 "1kp15wbnd6rn0nciczp5ibq0ikby2yysvx1gnz5fa05vl2mm8mbm"))))))
2531 (description "OpenJFX is a client application platform for desktop,
2532mobile and embedded systems built on Java. Its goal is to produce a
2533modern, efficient, and fully featured toolkit for developing rich client
2534applications. This package contains graphics-related classes for the
2535OpenJFX distribution.")))
2536
2537(define-public java-openjfx-media
2538 (package (inherit java-openjfx-build)
2539 (name "java-openjfx-media")
2540 (propagated-inputs
2541 `(("java-openjxf-graphics" ,java-openjfx-graphics)))
2542 (arguments
2543 `(#:jar-name "java-openjfx-media.jar"
2544 #:source-dir "modules/media/src/main/java"
2545 #:tests? #f)); no tests
2546 (description "OpenJFX is a client application platform for desktop,
2547mobile and embedded systems built on Java. Its goal is to produce a
2548modern, efficient, and fully featured toolkit for developing rich client
2549applications. This package contains media-related classes for the
2550OpenJFX distribution.")))
2551
2552(define-public java-openjfx-controls
2553 (package (inherit java-openjfx-build)
2554 (name "java-openjfx-controls")
2555 (propagated-inputs
2556 `(("java-openjxf-graphics" ,java-openjfx-graphics)))
2557 (arguments
2558 `(#:jar-name "java-openjfx-controls.jar"
2559 #:source-dir "modules/controls/src/main/java"
2560 #:test-dir "modules/controls/src/test"
2561 ;; TODO: tests require com.sun.javafx.pgstub,
2562 ;; javafx.collections.MockSetObserver, and
2563 ;; com.sun.javafx.binding.ExpressionHelperUtility
2564 #:tests? #false
2565 #:phases
2566 (modify-phases %standard-phases
2567 (add-after 'unpack 'copy-resources
2568 (lambda _
2569 (copy-recursively "modules/controls/src/test/resources"
2570 "build/test-classes")
2571 (copy-recursively "modules/controls/src/main/resources"
2572 "build/classes"))))))
2573 (description "OpenJFX is a client application platform for desktop,
2574mobile and embedded systems built on Java. Its goal is to produce a
2575modern, efficient, and fully featured toolkit for developing rich client
2576applications. This package contains UI control classes for the
2577OpenJFX distribution.")))
2578
2579(define-public javacc-4
2580 (package
2581 (name "javacc")
2582 (version "4.1")
2583 (source (origin
2584 (method git-fetch)
2585 (uri (git-reference
2586 (url "https://github.com/javacc/javacc")
2587 (commit "release_41")))
2588 (file-name (string-append "javacc-" version "-checkout"))
2589 (sha256
2590 (base32
2591 "07ysav7j8r1c6h8qxrgqk6lwdp74ly0ad1935lragxml0qqc3ka0"))
2592 (modules '((guix build utils)))
2593 ;; delete bundled jars
2594 (snippet '(begin (delete-file-recursively "lib") #t))))
2595 (build-system ant-build-system)
2596 ;; Tests fail with
2597 ;; /tmp/guix-build-javacc-4.1.drv-0/source/test/javacodeLA/build.xml:60:
2598 ;; JAVACODE failed
2599 (arguments
2600 `(#:tests? #f
2601 #:phases
2602 (modify-phases %standard-phases
2603 ;; Delete tests to avoid build failure (we don't run them anyway).
2604 (add-after 'unpack 'delete-tests
2605 (lambda _
2606 (for-each delete-file
2607 '("src/org/javacc/JavaCCTestCase.java"
2608 "src/org/javacc/parser/ExpansionTest.java"
2609 "src/org/javacc/parser/OptionsTest.java"
2610 "src/org/javacc/jjtree/JJTreeOptionsTest.java"))
2611 (for-each delete-file-recursively
2612 '("src/org/javacc/parser/test"
2613 "src/org/javacc/jjdoc/test"))
2614 #t))
2615 (replace 'install (install-jars "bin/lib")))))
2616 (home-page "https://javacc.org/")
2617 (synopsis "Java parser generator")
2618 (description "Java Compiler Compiler (JavaCC) is the most popular parser
2619generator for use with Java applications. A parser generator is a tool that
2620reads a grammar specification and converts it to a Java program that can
2621recognize matches to the grammar. In addition to the parser generator itself,
2622JavaCC provides other standard capabilities related to parser generation such
2623as tree building (via a tool called JJTree included with JavaCC), actions,
2624debugging, etc.")
2625 (license license:bsd-3)))
2626
2627;; javacc-3, as javacc-4 is not properly bootstrapped: is contains a javacc.jar
2628;; in the bootstrap/ directory.
2629(define-public javacc-3
2630 (package
2631 (inherit javacc-4)
2632 (version "3.2")
2633 (source (origin
2634 (method git-fetch)
2635 (uri (git-reference
2636 (url "https://github.com/javacc/javacc")
2637 (commit "release_32")))
2638 (file-name (string-append "javacc-" version "-checkout"))
2639 (sha256
2640 (base32
2641 "1pyf1xyh8gk83nxqn2v2mdws32l68ydznha41cxa4l2kkbq1v1g3"))))
2642 (arguments
2643 `(#:tests? #f
2644 #:phases
2645 (modify-phases %standard-phases
2646 (add-before 'build 'set-java-version
2647 (lambda _
2648 (for-each
2649 (lambda (file)
2650 (substitute* file
2651 (("debug=") "source=\"1.4\" debug=")))
2652 (find-files "." "build.xml"))
2653 #t))
2654 (replace 'install (install-jars "bin/lib")))))))
2655
2656(define-public javacc
2657 (package
2658 (inherit javacc-4)
2659 (version "7.0.4")
2660 (source
2661 (origin
2662 (method git-fetch)
2663 (uri (git-reference
2664 (url "https://github.com/javacc/javacc")
2665 (commit version)))
2666 (file-name (git-file-name "javacc" version))
2667 (sha256
2668 (base32 "18kkak3gda93gr25jrgy6q00g0jr8i24ri2wk4kybz1v234fxx9i"))
2669 (modules '((guix build utils)))
2670 ;; Delete bundled jars.
2671 (snippet '(begin (for-each delete-file-recursively
2672 '("bootstrap" "lib"))))))
2673 (arguments
2674 `(#:make-flags ; bootstrap from javacc-4
2675 ,#~(list (string-append "-Dbootstrap-jar="
2676 #$(this-package-native-input "javacc")
2677 "/share/java/javacc.jar"))
2678 #:test-target "test"
2679 #:phases
2680 (modify-phases %standard-phases
2681 (replace 'install (install-jars "target"))
2682 (add-after 'install 'install-bin
2683 (lambda* (#:key outputs inputs #:allow-other-keys)
2684 (let* ((out (assoc-ref outputs "out"))
2685 (dir (string-append out "/share/java"))
2686 (bin (string-append out "/bin"))
2687 (javacc (string-append bin "/javacc")))
2688 (mkdir-p bin)
2689 (with-output-to-file javacc
2690 (lambda _
2691 (display
2692 (string-append "#!/bin/sh\n"
2693 (assoc-ref inputs "icedtea") "/bin/java"
2694 " -cp " dir "/javacc.jar" " `basename $0`" " $*"))))
2695 (chmod javacc #o755)
2696 ;; symlink to different names to affect the first argument and
2697 ;; change the behavior of the jar file.
2698 (symlink javacc (string-append bin "/jjdoc"))
2699 (symlink javacc (string-append bin "/jjtree"))))))))
2700 (native-inputs
2701 (list javacc-4))
2702 (inputs (list icedtea-8))))
2703
2704(define-public java-ecj
2705 (package
2706 (name "java-ecj")
2707 (version "4.6.3")
2708 (source
2709 (origin
2710 (method url-fetch)
2711 (uri (string-append "http://archive.eclipse.org/eclipse/"
2712 "downloads/drops4/R-" version "-201703010400/"
2713 "ecjsrc-" version ".jar"))
2714 (sha256
2715 (base32
2716 "11cfgsdgznja1pvlxkjbqykxd7pcd5655vkm7s44xmahmap15gpl"))))
2717 (build-system ant-build-system)
2718 (arguments
2719 `(#:tests? #f ; none included
2720 #:build-target "build"
2721 #:phases
2722 (modify-phases %standard-phases
2723 (add-after 'unpack 'fix-build.xml
2724 (lambda _
2725 (substitute* "src/build.xml"
2726 (("^.*MANIFEST.*$")
2727 "")
2728 (("^.*properties.*$")
2729 "<include name=\"**/*.properties\"/>
2730 <include name=\"**/*.props\"/>"))))
2731 (add-before 'build 'chdir
2732 (lambda _ (chdir "src")))
2733 (replace 'install (install-jars ".")))))
2734 (home-page "https://eclipse.org")
2735 (synopsis "Eclipse Java development tools core batch compiler")
2736 (description "This package provides the Eclipse Java core batch compiler.")
2737 (license license:epl1.0)))
2738
2739(define-public java-cisd-base
2740 (let ((revision 38938)
2741 (base-version "14.12.0"))
2742 (package
2743 (name "java-cisd-base")
2744 (version (string-append base-version "-" (number->string revision)))
2745 (source (origin
2746 (method svn-fetch)
2747 (uri (svn-reference
2748 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2749 "base/tags/release/"
2750 (version-major+minor base-version)
2751 ".x/" base-version "/base/"))
2752 (revision revision)))
2753 (file-name (string-append "java-cisd-base-" version "-checkout"))
2754 (sha256
2755 (base32
2756 "1i5adyf7nzclb0wydgwa1az04qliid8035vpahaandmkmigbnxiy"))
2757 (modules '((guix build utils)))
2758 (snippet
2759 '(begin
2760 ;; Delete included gradle jar
2761 (delete-file-recursively "gradle/wrapper")
2762 ;; Delete pre-built native libraries
2763 (delete-file-recursively "libs")
2764 #t))))
2765 (build-system ant-build-system)
2766 (arguments
2767 `(#:make-flags '("-file" "build/build.xml")
2768 #:test-target "jar-test"
2769 #:jdk ,icedtea-8
2770 #:phases
2771 (modify-phases %standard-phases
2772 (add-after 'unpack 'unpack-build-resources
2773 (lambda* (#:key inputs #:allow-other-keys)
2774 (copy-recursively (assoc-ref inputs "build-resources")
2775 "../build_resources")
2776 #t))
2777 (add-after 'unpack-build-resources 'fix-dependencies
2778 (lambda* (#:key inputs #:allow-other-keys)
2779 (substitute* "build/build.xml"
2780 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
2781 (search-input-file inputs
2782 "/share/java/java-testng.jar"))
2783 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
2784 (search-input-file inputs
2785 (string-append
2786 "/share/java/commons-lang-"
2787 ,(package-version java-commons-lang)
2788 ".jar")))
2789 (("\\$\\{lib\\}/commons-io/commons-io.jar")
2790 (search-input-file inputs
2791 (string-append
2792 "/lib/m2/commons-io/commons-io/"
2793 ,(package-version java-commons-io)
2794 "/commons-io-"
2795 ,(package-version java-commons-io)
2796 ".jar")))
2797 ;; Remove dependency on svn
2798 (("<build-info.*") "")
2799 (("\\$\\{revision.number\\}")
2800 ,(number->string revision))
2801 (("\\$\\{version.number\\}") ,base-version))
2802 ;; Remove dependency on classycle
2803 (substitute* "../build_resources/ant/build-common.xml"
2804 (("<taskdef name=\"dependency-checker.*") "")
2805 (("classname=\"classycle.*") "")
2806 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
2807 #t))
2808 ;; A few tests fail because of the lack of a proper /etc/groups and
2809 ;; /etc/passwd file in the build container.
2810 (add-after 'unpack 'disable-broken-tests
2811 (lambda _
2812 (substitute* "sourceTest/java/ch/systemsx/cisd/base/AllTests.java"
2813 (("Unix.isOperational\\(\\)") "false"))
2814 #t))
2815 ;; These decorators are almost useless and pull in an unpackaged
2816 ;; dependency.
2817 (add-after 'unpack 'remove-useless-decorators
2818 (lambda _
2819 (substitute* "source/java/ch/systemsx/cisd/base/unix/Unix.java"
2820 (("@Private") "")
2821 (("import ch.rinn.restrictions.Private;") ""))
2822 (substitute* "sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java"
2823 (("@Friend.*") "")
2824 (("import ch.rinn.restrictions.Friend;") ""))
2825 #t))
2826 (add-before 'configure 'build-native-code
2827 (lambda* (#:key inputs #:allow-other-keys)
2828 (let ((jdk (assoc-ref inputs "jdk"))
2829 (dir ,(match (%current-system)
2830 ("i686-linux"
2831 "i386-Linux")
2832 ((or "armhf-linux" "aarch64-linux")
2833 "arm-Linux")
2834 ((or "x86_64-linux")
2835 "amd64-Linux")
2836 (_ "unknown-Linux"))))
2837 (with-directory-excursion "source/c"
2838 (invoke "gcc" "-shared" "-O3" "-fPIC" "unix.c"
2839 (string-append "-I" jdk "/include")
2840 (string-append "-I" jdk "/include/linux")
2841 "-o" "libunix.so")
2842 (invoke "gcc" "-shared" "-O3" "-fPIC"
2843 "-DMACHINE_BYTE_ORDER=1"
2844 "copyCommon.c"
2845 "copyByteChar.c"
2846 "copyByteDouble.c"
2847 "copyByteFloat.c"
2848 "copyByteInt.c"
2849 "copyByteLong.c"
2850 "copyByteShort.c"
2851 (string-append "-I" jdk "/include")
2852 (string-append "-I" jdk "/include/linux")
2853 "-o" "libnativedata.so"))
2854 (install-file "source/c/libunix.so"
2855 (string-append "libs/native/unix/" dir))
2856 (install-file "source/c/libnativedata.so"
2857 (string-append "libs/native/nativedata/" dir))
2858 #t)))
2859 ;; In the "check" phase we only build the test executable.
2860 (add-after 'check 'run-tests
2861 (lambda _
2862 (invoke "java" "-jar" "targets/dist/sis-base-test.jar")
2863 (delete-file "targets/dist/sis-base-test.jar")
2864 #t))
2865 (replace 'install (install-jars "targets/dist")))))
2866 (native-inputs
2867 `(("jdk" ,icedtea-8)
2868 ("java-commons-lang" ,java-commons-lang)
2869 ("java-commons-io" ,java-commons-io)
2870 ("java-testng" ,java-testng)
2871 ("build-resources"
2872 ,(origin
2873 (method svn-fetch)
2874 (uri (svn-reference
2875 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2876 "base/tags/release/"
2877 (version-major+minor base-version)
2878 ".x/" base-version
2879 "/build_resources/"))
2880 (revision revision)))
2881 (sha256
2882 (base32
2883 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
2884 (home-page "https://svnsis.ethz.ch")
2885 (synopsis "Utility classes for libraries from ETH Zurich")
2886 (description "This library supplies some utility classes needed for
2887libraries from the SIS division at ETH Zurich like jHDF5.")
2888 ;; The C sources are under a non-copyleft license, which looks like a
2889 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
2890 (license (list license:asl2.0
2891 (license:non-copyleft "file://source/c/COPYING"))))))
2892
2893(define-public java-cisd-args4j
2894 (let ((revision 39162)
2895 (base-version "9.11.2"))
2896 (package
2897 (name "java-cisd-args4j")
2898 (version (string-append base-version "-" (number->string revision)))
2899 (source (origin
2900 (method svn-fetch)
2901 (uri (svn-reference
2902 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2903 "args4j/tags/release/"
2904 (version-major+minor base-version)
2905 ".x/" base-version "/args4j/"))
2906 (revision revision)))
2907 (file-name (string-append "java-cisd-args4j-" version "-checkout"))
2908 (sha256
2909 (base32
2910 "0hhqznjaivq7ips7mkwas78z42s6djsm20rrs7g1zd59rcsakxn2"))))
2911 (build-system ant-build-system)
2912 (arguments
2913 `(#:make-flags '("-file" "build/build.xml")
2914 #:tests? #f ; there are no tests
2915 #:modules ((guix build ant-build-system)
2916 (guix build utils)
2917 (guix build java-utils)
2918 (sxml simple)
2919 (sxml transform)
2920 (sxml xpath))
2921 #:phases
2922 (modify-phases %standard-phases
2923 (add-after 'unpack 'unpack-build-resources
2924 (lambda* (#:key inputs #:allow-other-keys)
2925 (mkdir-p "../build_resources")
2926 (copy-recursively (assoc-ref inputs "build-resources")
2927 "../build_resources")
2928 (mkdir-p "../build_resources/lib")))
2929 (add-after 'unpack-build-resources 'fix-dependencies
2930 (lambda* (#:key inputs #:allow-other-keys)
2931 ;; FIXME: There should be a more convenient abstraction for
2932 ;; editing XML files.
2933 (with-directory-excursion "../build_resources/ant/"
2934 (chmod "build-common.xml" #o664)
2935 (call-with-output-file "build-common.xml.new"
2936 (lambda (port)
2937 (sxml->xml
2938 (pre-post-order
2939 (with-input-from-file "build-common.xml"
2940 (lambda _ (xml->sxml #:trim-whitespace? #t)))
2941 `(;; Remove dependency on classycle and custom ant tasks
2942 (taskdef . ,(lambda (tag . kids)
2943 (let ((name ((sxpath '(name *text*)) kids)))
2944 (if (or (member "build-info" name)
2945 (member "dependency-checker" name)
2946 (member "build-java-subprojects" name)
2947 (member "project-classpath" name))
2948 '() ; skip
2949 `(,tag ,@kids)))))
2950 (typedef . ,(lambda (tag . kids)
2951 (let ((name ((sxpath '(name *text*)) kids)))
2952 (if (member "recursive-jar" name)
2953 '() ; skip
2954 `(,tag ,@kids)))))
2955 (build-java-subprojects . ,(lambda _ '()))
2956 ;; Ignore everything else
2957 (*default* . ,(lambda (tag . kids) `(,tag ,@kids)))
2958 (*text* . ,(lambda (_ txt) txt))))
2959 port)))
2960 (rename-file "build-common.xml.new" "build-common.xml"))
2961 (substitute* "build/build.xml"
2962 (("\\$\\{lib\\}/cisd-base/cisd-base.jar")
2963 (search-input-file inputs "/share/java/sis-base.jar"))
2964 ;; Remove dependency on svn
2965 (("<build-info.*") "")
2966 (("\\$\\{revision.number\\}")
2967 ,(number->string revision))
2968 (("\\$\\{version.number\\}") ,base-version)
2969 ;; Don't use custom ant tasks.
2970 (("recursive-jar") "jar")
2971 (("<project-classpath.*") ""))))
2972 (replace 'install (install-jars "targets/dist")))))
2973 (inputs
2974 (list java-cisd-base))
2975 (native-inputs
2976 `(("ecj" ,java-ecj)
2977 ("build-resources"
2978 ,(origin
2979 (method svn-fetch)
2980 (uri (svn-reference
2981 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2982 "args4j/tags/release/"
2983 (version-major+minor base-version)
2984 ".x/" base-version
2985 "/build_resources/"))
2986 (revision revision)))
2987 (sha256
2988 (base32
2989 "056cam4k8pll7ass31sy6gwn8g8719njc41yf4l02b0342nilkyf"))
2990 (modules '((guix build utils)))
2991 ;; Delete bundled pre-built jars.
2992 (snippet
2993 '(begin (delete-file-recursively "lib/") #t))))))
2994 (home-page "https://svnsis.ethz.ch")
2995 (synopsis "Command line parser library")
2996 (description "This package provides a parser for command line arguments.")
2997 (license license:asl2.0))))
2998
2999(define-public java-cisd-jhdf5
3000 (let ((revision 39162)
3001 (base-version "14.12.6"))
3002 (package
3003 (name "java-cisd-jhdf5")
3004 (version (string-append base-version "-" (number->string revision)))
3005 (source (origin
3006 (method svn-fetch)
3007 (uri (svn-reference
3008 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3009 "jhdf5/tags/release/"
3010 (version-major+minor base-version)
3011 ".x/" base-version "/jhdf5/"))
3012 (revision revision)))
3013 (file-name (string-append "java-cisd-jhdf5-" version "-checkout"))
3014 (sha256
3015 (base32
3016 "13i17s2hn0q9drdqvp8csy7770p3hdbh9rp30ihln2ldkfawdmz0"))
3017 (modules '((guix build utils)))
3018 (snippet
3019 '(begin
3020 ;; Delete included gradle jar
3021 (delete-file-recursively "gradle/wrapper")
3022 ;; Delete pre-built native libraries
3023 (delete-file-recursively "libs")))))
3024 (build-system ant-build-system)
3025 (arguments
3026 `(#:make-flags '("-file" "build/build.xml")
3027 #:build-target "jar-all"
3028 #:test-target "jar-test"
3029 #:phases
3030 (modify-phases %standard-phases
3031 ;; FIXME: this build phase fails.
3032 (delete 'generate-jar-indices)
3033 ;; Don't erase results from the build phase when building tests.
3034 (add-after 'unpack 'separate-test-target-from-clean
3035 (lambda _
3036 (substitute* "build/build.xml"
3037 (("\"jar-test\" depends=\"clean, ")
3038 "\"jar-test\" depends=\""))))
3039 (add-after 'unpack 'unpack-build-resources
3040 (lambda* (#:key inputs #:allow-other-keys)
3041 (copy-recursively (assoc-ref inputs "build-resources")
3042 "../build_resources")
3043 (delete-file-recursively "../build_resources/lib/")
3044 (mkdir-p "../build_resources/lib")
3045 ;; Remove dependency on classycle
3046 (substitute* "../build_resources/ant/build-common.xml"
3047 (("<taskdef name=\"dependency-checker.*") "")
3048 (("classname=\"classycle.*") "")
3049 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
3050 ;; Remove dependency on svn
3051 (substitute* "build/build.xml"
3052 (("<build-info.*") "")
3053 (("\\$\\{revision.number\\}")
3054 ,(number->string revision))
3055 (("\\$\\{version.number\\}") ,base-version))))
3056 (add-after 'unpack-build-resources 'fix-dependencies
3057 (lambda* (#:key inputs #:allow-other-keys)
3058 (substitute* "../build_resources/ant/build-common.xml"
3059 (("../libraries/testng/testng-jdk15.jar")
3060 (search-input-file inputs
3061 "/share/java/java-testng.jar")))
3062 (substitute* "build/build.xml"
3063 (("\\$\\{lib\\}/sis-base/sis-base.jar")
3064 (search-input-file inputs
3065 "/share/java/sis-base.jar"))
3066 (("\\$\\{lib\\}/cisd-args4j/cisd-args4j.jar")
3067 (search-input-file inputs
3068 "/share/java/cisd-args4j.jar"))
3069 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
3070 (search-input-file inputs
3071 (string-append
3072 "/share/java/commons-lang-"
3073 ,(package-version java-commons-lang)
3074 ".jar")))
3075 (("\\$\\{lib\\}/commons-io/commons-io.jar")
3076 (search-input-file inputs
3077 (string-append
3078 "/lib/m2/commons-io/commons-io/"
3079 ,(package-version java-commons-io)
3080 "/commons-io-"
3081 ,(package-version java-commons-io)
3082 ".jar")))
3083 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
3084 (search-input-file inputs
3085 "/share/java/java-testng.jar"))
3086 (("\\$\\{lib\\}/junit4/junit.jar")
3087 (car (find-files (assoc-ref inputs "java-junit") "jar$")))
3088 (("\\$\\{lib\\}/jmock/hamcrest/hamcrest-core.jar")
3089 (car (find-files (assoc-ref inputs "java-hamcrest-core")
3090 "jar$"))))
3091 ;; Remove dependency on ch.rinn.restrictions
3092 (with-directory-excursion "source/java/ch/systemsx/cisd/hdf5/"
3093 (substitute* '("BitSetConversionUtils.java"
3094 "HDF5Utils.java")
3095 (("import ch.rinn.restrictions.Private;") "")
3096 (("@Private") "")))
3097 (with-directory-excursion "sourceTest/java/ch/systemsx/cisd/hdf5/"
3098 (substitute* '("BitSetConversionTest.java"
3099 "h5ar/HDF5ArchiverTest.java")
3100 (("import ch.rinn.restrictions.Friend;") "")
3101 (("@Friend.*") ""))
3102 ;; Remove leftovers from removing @Friend
3103 (substitute* "h5ar/HDF5ArchiverTest.java"
3104 (("\\{ HDF5Archiver.class, IdCache.class, LinkRecord.class \\}\\)")
3105 "")))))
3106 (add-before 'configure 'build-native-library
3107 (lambda* (#:key inputs #:allow-other-keys)
3108 (let ((jdk (assoc-ref inputs "jdk"))
3109 (hdf5 (assoc-ref inputs "hdf5"))
3110 (dir ,(match (%current-system)
3111 ("i686-linux"
3112 "i386-Linux")
3113 ((or "armhf-linux" "aarch64-linux")
3114 "arm-Linux")
3115 ((or "x86_64-linux")
3116 "amd64-Linux")
3117 (_ "unknown-Linux"))))
3118 (with-directory-excursion "source/c"
3119 (apply invoke `("gcc" "-shared" "-O3"
3120 "-fPIC"
3121 "-Wl,--exclude-libs,ALL"
3122 "-Wno-error=implicit-function-declaration"
3123 ,@(find-files "jhdf5" "\\.c$")
3124 ,@(find-files "hdf-java" "\\.c$")
3125 ,(string-append "-I" hdf5 "/include")
3126 ,(string-append "-I" jdk "/include")
3127 ,(string-append "-I" jdk "/include/linux")
3128 ,(string-append hdf5 "/lib/libhdf5.a")
3129 "-o" "libjhdf5.so" "-lz")))
3130 (install-file "source/c/libjhdf5.so"
3131 (string-append "libs/native/jhdf5/" dir)))))
3132 ;; In the "check" phase we only build the test executable.
3133 (add-after 'check 'run-tests
3134 (lambda _
3135 (invoke "java" "-jar" "targets/dist/sis-jhdf5-test.jar")
3136 (delete-file "targets/dist/sis-jhdf5-test.jar")))
3137 (replace 'install
3138 (install-jars "targets/dist")))))
3139 (inputs
3140 (list java-cisd-base
3141 java-cisd-args4j
3142 java-commons-lang
3143 java-commons-io
3144 hdf5-1.8
3145 zlib))
3146 (native-inputs
3147 `(("jdk" ,icedtea-8)
3148 ("java-testng" ,java-testng)
3149 ("java-junit" ,java-junit)
3150 ("java-jmock" ,java-jmock)
3151 ("java-hamcrest-core" ,java-hamcrest-core)
3152 ("build-resources"
3153 ,(origin
3154 (method svn-fetch)
3155 (uri (svn-reference
3156 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3157 "jhdf5/tags/release/"
3158 (version-major+minor base-version)
3159 ".x/" base-version
3160 "/build_resources/"))
3161 (revision revision)))
3162 (sha256
3163 (base32
3164 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
3165 (home-page "https://wiki-bsse.ethz.ch/display/JHDF5/")
3166 (synopsis "Java binding for HDF5")
3167 (description "JHDF5 is a high-level API in Java for reading and writing
3168HDF5 files, building on the libraries provided by the HDF Group.")
3169 ;; The C sources are under a non-copyleft license, which looks like a
3170 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
3171 (license (list license:asl2.0
3172 (license:non-copyleft "file://source/c/COPYING"))))))
3173
3174(define-public java-classpathx-servletapi
3175 (package
3176 (name "java-classpathx-servletapi")
3177 (version "3.0.1")
3178 (source (origin
3179 (method url-fetch)
3180 (uri (string-append "mirror://gnu/classpathx/servletapi/"
3181 "servletapi-" version ".tar.gz"))
3182 (sha256
3183 (base32
3184 "07d8h051siga2f33fra72hk12sbq1bxa4jifjg0qj0vfazjjff0x"))))
3185 (build-system ant-build-system)
3186 (arguments
3187 `(#:tests? #f ; there is no test target
3188 #:build-target "compile"
3189 #:make-flags
3190 ,#~(list "-Dbuild.compiler=javac1.8"
3191 (string-append "-Ddist=" #$output))
3192 #:phases
3193 (modify-phases %standard-phases
3194 (replace 'install
3195 (lambda* (#:key make-flags #:allow-other-keys)
3196 (apply invoke `("ant" "dist" ,@make-flags)))))))
3197 (home-page "https://www.gnu.org/software/classpathx/")
3198 (synopsis "Java servlet API implementation")
3199 (description "This is the GNU servlet API distribution, part of the
3200ClasspathX project. It provides implementations of version 3.0 of the servlet
3201API and version 2.1 of the Java ServerPages API.")
3202 (license license:gpl3+)))
3203
3204(define-public java-javaee-servletapi
3205 (package
3206 (name "java-javaee-servletapi")
3207 (version "3.1.0")
3208 (source (origin
3209 (method git-fetch)
3210 (uri (git-reference
3211 (url "https://github.com/javaee/servlet-spec")
3212 (commit version)))
3213 (file-name (git-file-name name version))
3214 (sha256
3215 (base32
3216 "0s03lj8w5an70lkqbjycgfrfk0kc07vbfav91jzk87gh3awf9ksl"))))
3217 (build-system ant-build-system)
3218 (arguments
3219 `(#:jar-name "javax-servletapi.jar"
3220 ;; no tests
3221 #:tests? #f
3222 #:source-dir "src/main/java"
3223 #:phases
3224 (modify-phases %standard-phases
3225 (add-before 'build 'copy-resources
3226 (lambda _
3227 (mkdir-p "build/classes/javax/servlet/http")
3228 (let ((from-prefix "src/main/java/javax/servlet/")
3229 (to-prefix "build/classes/javax/servlet/"))
3230 (for-each (lambda (f)
3231 (copy-file (string-append from-prefix f)
3232 (string-append to-prefix f)))
3233 (list "LocalStrings_ja.properties"
3234 "LocalStrings.properties"
3235 "LocalStrings_fr.properties"
3236 "http/LocalStrings_es.properties"
3237 "http/LocalStrings_ja.properties"
3238 "http/LocalStrings.properties"
3239 "http/LocalStrings_fr.properties")))
3240 #t)))))
3241 (native-inputs
3242 (list unzip))
3243 (home-page "https://javaee.github.io/servlet-spec/")
3244 (synopsis "Java servlet API")
3245 (description "Java Servlet is the foundation web specification in the
3246Java Enterprise Platform. Developers can build web applications using the
3247Servlet API to interact with the request/response workflow. This project
3248provides information on the continued development of the Java Servlet
3249specification.")
3250 ;; Main code is dual-licensed by Oracle under either GLP2 or CDDL 1.1.
3251 ;; Some files are licensed under ASL 2.0.
3252 (license (list license:asl2.0 license:gpl2 license:cddl1.1))))
3253
3254(define-public java-swt
3255 (package
3256 (name "java-swt")
3257 (version "4.7.1a")
3258 (source
3259 ;; The types of many variables and procedures differ in the sources
3260 ;; dependent on whether the target architecture is a 32-bit system or a
3261 ;; 64-bit system. Instead of patching the sources on demand in a build
3262 ;; phase we download either the 32-bit archive (which mostly uses "int"
3263 ;; types) or the 64-bit archive (which mostly uses "long" types).
3264 (let ((hash32 "09q0cbh90d90q3a7dx9430kc4m6bijrkr4lajrmzzvi0jjdpq4v9")
3265 (hash64 "17k5hs75a87ssmc5xhwdfdm2gn4zba0r837l2455za01krnkaa2q")
3266 (file32 "x86")
3267 (file64 "x86_64"))
3268 (let-values (((hash file)
3269 (match (or (%current-target-system) (%current-system))
3270 ("x86_64-linux" (values hash64 file64))
3271 (_ (values hash32 file32)))))
3272 (origin
3273 (method url-fetch)
3274 (uri (string-append
3275 "https://archive.eclipse.org/eclipse/downloads/drops4/"
3276 "R-" version "-201710090410/swt-" version
3277 "-gtk-linux-" file ".zip"))
3278 (sha256 (base32 hash))))))
3279 (build-system ant-build-system)
3280 (arguments
3281 `(#:jar-name "swt.jar"
3282 #:jdk ,icedtea-8
3283 #:tests? #f ; no "check" target
3284 #:phases
3285 (modify-phases %standard-phases
3286 (replace 'unpack
3287 (lambda* (#:key source #:allow-other-keys)
3288 (mkdir "swt")
3289 (invoke "unzip" source "-d" "swt")
3290 (chdir "swt")
3291 (mkdir "src")
3292 (invoke "unzip" "src.zip" "-d" "src")))
3293 ;; The classpath contains invalid icecat jars. Since we don't need
3294 ;; anything other than the JDK on the classpath, we can simply unset
3295 ;; it.
3296 (add-after 'configure 'unset-classpath
3297 (lambda _ (unsetenv "CLASSPATH") #t))
3298 (add-before 'build 'build-native
3299 (lambda* (#:key inputs outputs #:allow-other-keys)
3300 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3301 ;; Build shared libraries. Users of SWT have to set the system
3302 ;; property swt.library.path to the "lib" directory of this
3303 ;; package output.
3304 (mkdir-p lib)
3305 (setenv "OUTPUT_DIR" lib)
3306 (setenv "CC" ,(cc-for-target))
3307 (with-directory-excursion "src"
3308 (invoke "bash" "build.sh")))))
3309 (add-after 'install 'install-native
3310 (lambda* (#:key outputs #:allow-other-keys)
3311 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3312 (for-each (lambda (file)
3313 (install-file file lib))
3314 (find-files "." "\\.so$"))
3315 #t))))))
3316 (inputs
3317 `(("gtk" ,gtk+-2)
3318 ("libxtst" ,libxtst)
3319 ("libxt" ,libxt)
3320 ("mesa" ,mesa)
3321 ("glu" ,glu)))
3322 (native-inputs
3323 (list pkg-config unzip))
3324 (home-page "https://www.eclipse.org/swt/")
3325 (synopsis "Widget toolkit for Java")
3326 (description
3327 "SWT is a widget toolkit for Java designed to provide efficient, portable
3328access to the user-interface facilities of the operating systems on which it
3329is implemented.")
3330 ;; SWT code is licensed under EPL1.0
3331 ;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
3332 ;; Cairo bindings contain code under MPL1.1
3333 ;; XULRunner 1.9 bindings contain code under MPL2.0
3334 (license (list
3335 license:epl1.0
3336 license:mpl1.1
3337 license:mpl2.0
3338 license:lgpl2.1+))))
3339
3340;; java-hamcrest-core uses qdox version 1.12. We package this version instead
3341;; of the latest release.
3342(define-public java-qdox-1.12
3343 (package
3344 (name "java-qdox")
3345 (version "1.12.1")
3346 (source (origin
3347 (method url-fetch)
3348 (uri (string-append "https://repo1.maven.org/maven2/"
3349 "com/thoughtworks/qdox/qdox/" version
3350 "/qdox-" version "-sources.jar"))
3351 (sha256
3352 (base32
3353 "0hlfbqq2avf5s26wxkksqmkdyk6zp9ggqn37c468m96mjv0n9xfl"))))
3354 (build-system ant-build-system)
3355 (arguments
3356 `(;; Tests require junit
3357 #:tests? #f
3358 #:jar-name "qdox.jar"
3359 #:phases
3360 (modify-phases %standard-phases
3361 (replace 'unpack
3362 (lambda* (#:key source #:allow-other-keys)
3363 (mkdir "src")
3364 (with-directory-excursion "src"
3365 (invoke "jar" "-xf" source))))
3366 ;; At this point we don't have junit, so we must remove the API
3367 ;; tests.
3368 (add-after 'unpack 'delete-tests
3369 (lambda _
3370 (delete-file-recursively "src/com/thoughtworks/qdox/junit")
3371 #t)))))
3372 (home-page "https://github.com/codehaus/qdox")
3373 (synopsis "Parse definitions from Java source files")
3374 (description
3375 "QDox is a high speed, small footprint parser for extracting
3376class/interface/method definitions from source files complete with JavaDoc
3377@code{@@tags}. It is designed to be used by active code generators or
3378documentation tools.")
3379 (license license:asl2.0)))
3380
3381(define-public java-qdox
3382 (package
3383 (name "java-qdox")
3384 ; Newer version exists, but this version is required by java-plexus-component-metadata
3385 (version "2.0-M2")
3386 (source (origin
3387 (method url-fetch)
3388 ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
3389 ;; Older releases at https://github.com/codehaus/qdox/
3390 ;; Note: The release at maven is pre-generated. The release at
3391 ;; github requires jflex.
3392 (uri (string-append "https://repo1.maven.org/maven2/"
3393 "com/thoughtworks/qdox/qdox/" version
3394 "/qdox-" version "-sources.jar"))
3395 (sha256
3396 (base32
3397 "10xxrcaicq6axszcr2jpygisa4ch4sinyx5q7kqqxv4lknrmxp5x"))))
3398 (build-system ant-build-system)
3399 (arguments
3400 `(#:jar-name "qdox.jar"
3401 #:tests? #f; no tests
3402 #:phases
3403 (modify-phases %standard-phases
3404 (add-before 'install 'create-pom
3405 (generate-pom.xml "pom.xml" "com.thoughtworks.qdox" "qdox" ,version
3406 #:name "QDox"))
3407 (replace 'install
3408 (install-from-pom "pom.xml")))))
3409 (home-page "https://github.com/codehaus/qdox")
3410 (synopsis "Parse definitions from Java source files")
3411 (description "QDox is a high speed, small footprint parser for extracting
3412class/interface/method definitions from source files complete with JavaDoc
3413@code{@@tags}. It is designed to be used by active code generators or
3414documentation tools.")
3415 (license license:asl2.0)))
3416
3417(define-public java-qdox-2-M9
3418 (package
3419 (inherit java-qdox)
3420 (version "2.0-M9"); required by plexus-java
3421 (source (origin
3422 (method url-fetch)
3423 ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
3424 ;; Older releases at https://github.com/codehaus/qdox/
3425 ;; Note: The release at maven is pre-generated. The release at
3426 ;; github requires jflex.
3427 (uri (string-append "https://repo1.maven.org/maven2/"
3428 "com/thoughtworks/qdox/qdox/" version
3429 "/qdox-" version "-sources.jar"))
3430 (sha256
3431 (base32
3432 "1s2jnmx2dkwnaha12lcj26aynywgwa8sslc47z82wx8xai13y4fg"))))
3433 (arguments
3434 (substitute-keyword-arguments (package-arguments java-qdox)
3435 ((#:phases phases)
3436 `(modify-phases ,phases
3437 (replace 'create-pom
3438 (generate-pom.xml "pom.xml" "com.thoughtworks.qdox" "qdox" ,version
3439 #:name "QDox"))))))))
3440
3441(define-public java-jarjar
3442 (package
3443 (name "java-jarjar")
3444 (version "1.4")
3445 (source (origin
3446 (method url-fetch)
3447 (uri (string-append
3448 "https://storage.googleapis.com/google-code-archive-downloads/v2/"
3449 "code.google.com/jarjar/jarjar-src-" version ".zip"))
3450 (sha256
3451 (base32
3452 "1v8irhni9cndcw1l1wxqgry013s2kpj0qqn57lj2ji28xjq8ndjl"))
3453 (modules '((guix build utils)))
3454 (snippet
3455 '(begin
3456 ;; Delete bundled thirds-party jar archives.
3457 (delete-file-recursively "lib")
3458 (delete-file "src/test/enumtest.jar")
3459 ;; the CLASSPATH needs this directory, create an empty one
3460 (mkdir-p "lib")
3461 #t))))
3462 (build-system ant-build-system)
3463 (arguments
3464 `(;; Tests require junit, which ultimately depends on this package.
3465 #:tests? #f
3466 #:build-target "jar"
3467 #:phases
3468 (modify-phases %standard-phases
3469 (add-before 'build 'do-not-use-bundled-asm
3470 (lambda* (#:key inputs #:allow-other-keys)
3471 (substitute* "build.xml"
3472 (("<path id=\"path.build\">")
3473 (string-append "<path id=\"path.build\"><fileset dir=\""
3474 (assoc-ref inputs "java-asm-bootstrap")
3475 "/lib/m2\" includes=\"**/*.jar\"/>"))
3476 (("<zipfileset src=\"lib/asm-4.0.jar\"/>") "")
3477 (("lib/asm-commons-4.0.jar")
3478 (car (find-files (assoc-ref inputs "java-asm-bootstrap")
3479 "asm-6.0.jar")))
3480 (("<include name=\"org/objectweb/asm/commons/Remap\\*\\.class\"/>")
3481 (string-append "<include name=\"org/objectweb/asm/"
3482 "commons/Remap*.class\"/>"
3483 "<include name=\"org/objectweb/asm/*.class\"/>"
3484 "<include name=\"org/objectweb/asm/"
3485 "signature/*.class\"/>"
3486 "<include name=\"org/objectweb/asm/"
3487 "commons/SignatureRemapper.class\"/>")))
3488 #t))
3489 (add-before 'build 'remove-maven-dependency
3490 (lambda _
3491 ;; We do not need to build jarjar as a maven plugin just yet, so
3492 ;; remove this file. Maven requires jarjar (but not that plugin),
3493 ;; so removing it improves the bootstrap.
3494 (delete-file "src/main/com/tonicsystems/jarjar/JarJarMojo.java")
3495 #t))
3496 (replace 'install
3497 (lambda* (#:key outputs #:allow-other-keys)
3498 (let ((target (string-append (assoc-ref outputs "out")
3499 "/share/java")))
3500 (install-file (string-append "dist/jarjar-" ,version ".jar")
3501 target))
3502 #t)))))
3503 (inputs
3504 (list java-asm-bootstrap))
3505 (native-inputs
3506 (list unzip))
3507 (home-page "https://code.google.com/archive/p/jarjar/")
3508 (synopsis "Repackage Java libraries")
3509 (description
3510 "Jar Jar Links is a utility that makes it easy to repackage Java
3511libraries and embed them into your own distribution. Jar Jar Links includes
3512an Ant task that extends the built-in @code{jar} task.")
3513 (license license:asl2.0)))
3514
3515(define-public java-hamcrest
3516 (package
3517 (name "java-hamcrest")
3518 (version "3.0")
3519 (source (origin
3520 (method git-fetch)
3521 (uri (git-reference
3522 (url "https://github.com/hamcrest/JavaHamcrest/")
3523 (commit (string-append "v" version))))
3524 (file-name (git-file-name name version))
3525 (sha256
3526 (base32
3527 "07cagv2ncs4y02fmwbll3r4rqpjf3zxs163ync24q3x9fplrxmly"))))
3528 (build-system ant-build-system)
3529 (arguments
3530 `(#:tests? #f ; Tests require junit
3531 #:source-dir "hamcrest/src/main"
3532 #:jar-name "hamcrest.jar"))
3533 (home-page "https://hamcrest.org/")
3534 (synopsis "Library of matchers for building test expressions")
3535 (description
3536 "This package provides a library of matcher objects (also known as
3537constraints or predicates) allowing @code{match} rules to be defined
3538declaratively, to be used in other frameworks. Typical scenarios include
3539testing frameworks, mocking libraries and UI validation rules.")
3540 (license license:bsd-3)))
3541
3542(define-public java-hamcrest-core
3543 (package
3544 (name "java-hamcrest-core")
3545 (version "1.3")
3546 (properties `((superseded . ,java-hamcrest)))
3547 (source (origin
3548 (method git-fetch)
3549 (uri (git-reference
3550 (url "https://github.com/hamcrest/JavaHamcrest/")
3551 (commit (string-append "hamcrest-java-" version))))
3552 (file-name (git-file-name name version))
3553 (sha256
3554 (base32
3555 "16fxxkrd31ahqvcaby30jgh3z1i0zxh51m24hxgz0z2agxj6bc63"))
3556 (modules '((guix build utils)))
3557 (snippet
3558 '(begin
3559 ;; Delete bundled thirds-party jar archives.
3560 (delete-file-recursively "lib")
3561 #t))))
3562 (build-system ant-build-system)
3563 (arguments
3564 `(#:tests? #f ; Tests require junit
3565 #:modules ((guix build ant-build-system)
3566 (guix build java-utils)
3567 (guix build utils)
3568 (srfi srfi-1))
3569 #:make-flags (list (string-append "-Dversion=" ,version))
3570 #:test-target "unit-test"
3571 #:build-target "core"
3572 #:phases
3573 (modify-phases %standard-phases
3574 ;; Disable unit tests, because they require junit, which requires
3575 ;; hamcrest-core. We also give a fixed value to the "Built-Date"
3576 ;; attribute from the manifest for reproducibility.
3577 (add-before 'configure 'patch-build.xml
3578 (lambda _
3579 (substitute* "build.xml"
3580 (("unit-test, ") "")
3581 (("\\$\\{build.timestamp\\}") "guix"))
3582 #t))
3583 ;; Java's "getMethods()" returns methods in an unpredictable order.
3584 ;; To make the output of the generated code deterministic we must
3585 ;; sort the array of methods.
3586 (add-after 'unpack 'make-method-order-deterministic
3587 (lambda _
3588 (substitute* "hamcrest-generator/src/main/java/org/hamcrest/generator/ReflectiveFactoryReader.java"
3589 (("import java\\.util\\.Iterator;" line)
3590 (string-append line "\n"
3591 "import java.util.Arrays; import java.util.Comparator;"))
3592 (("allMethods = cls\\.getMethods\\(\\);" line)
3593 (string-append "_" line
3594 "
3595private Method[] getSortedMethods() {
3596 Arrays.sort(_allMethods, new Comparator<Method>() {
3597 @Override
3598 public int compare(Method a, Method b) {
3599 return a.toString().compareTo(b.toString());
3600 }
3601 });
3602 return _allMethods;
3603}
3604
3605private Method[] allMethods = getSortedMethods();")))
3606 #t))
3607 (add-before 'build 'do-not-use-bundled-qdox
3608 (lambda* (#:key inputs #:allow-other-keys)
3609 (substitute* "build.xml"
3610 (("lib/generator/qdox-1.12.jar")
3611 (string-append (assoc-ref inputs "java-qdox-1.12")
3612 "/share/java/qdox.jar")))
3613 #t))
3614 ;; build.xml searches for .jar files in this directoy, which
3615 ;; we remove from the source archive.
3616 (add-before 'build 'create-dummy-directories
3617 (lambda _
3618 (mkdir-p "lib/integration")
3619 #t))
3620 (add-before 'build 'create-pom
3621 (lambda _
3622 (substitute* "pom/hamcrest-core.pom"
3623 (("@VERSION@") ,version))
3624 #t))
3625 (replace 'install
3626 (install-from-pom "pom/hamcrest-core.pom")))))
3627 (native-inputs
3628 `(("java-qdox-1.12" ,java-qdox-1.12)
3629 ("java-jarjar" ,java-jarjar)))
3630 (propagated-inputs
3631 (list java-hamcrest-parent-pom))
3632 (home-page "https://hamcrest.org/")
3633 (synopsis "Library of matchers for building test expressions")
3634 (description
3635 "This package provides a library of matcher objects (also known as
3636constraints or predicates) allowing @code{match} rules to be defined
3637declaratively, to be used in other frameworks. Typical scenarios include
3638testing frameworks, mocking libraries and UI validation rules.")
3639 (license license:bsd-2)))
3640
3641(define-public java-hamcrest-parent-pom
3642 (package
3643 (inherit java-hamcrest-core)
3644 (properties '((hidden? . #t)))
3645 (name "java-hamcrest-parent-pom")
3646 (propagated-inputs '())
3647 (native-inputs '())
3648 (arguments
3649 `(#:tests? #f
3650 #:phases
3651 (modify-phases %standard-phases
3652 (delete 'configure)
3653 (replace 'build
3654 (lambda _
3655 (substitute* "pom/hamcrest-parent.pom"
3656 (("@VERSION@") ,(package-version java-hamcrest-core)))
3657 #t))
3658 (replace 'install
3659 (install-pom-file "pom/hamcrest-parent.pom")))))))
3660
3661(define-public java-hamcrest-library
3662 (package
3663 (inherit java-hamcrest-core)
3664 (name "java-hamcrest-library")
3665 (properties `((superseded . ,java-hamcrest)))
3666 (arguments
3667 (substitute-keyword-arguments (package-arguments java-hamcrest-core)
3668 ((#:build-target _) "library")
3669 ((#:phases phases)
3670 `(modify-phases ,phases
3671 (add-after 'unpack 'patch-classpath-for-integration
3672 (lambda* (#:key inputs #:allow-other-keys)
3673 (substitute* "build.xml"
3674 (("build/hamcrest-core-\\$\\{version\\}\\.jar")
3675 (car (find-files (assoc-ref inputs "java-hamcrest-core")
3676 "jar$"))))
3677 #t))
3678 (replace 'create-pom
3679 (lambda _
3680 (substitute* "pom/hamcrest-library.pom"
3681 (("@VERSION@") ,(package-version java-hamcrest-core)))
3682 #t))
3683 (replace 'install
3684 (install-from-pom "pom/hamcrest-library.pom"))))))
3685 (propagated-inputs
3686 (list java-hamcrest-core java-hamcrest-parent-pom))))
3687
3688(define-public java-junit
3689 (package
3690 (name "java-junit")
3691 (version "4.12")
3692 (source (origin
3693 (method git-fetch)
3694 (uri (git-reference
3695 (url "https://github.com/junit-team/junit/")
3696 (commit (string-append "r" version))))
3697 (file-name (git-file-name name version))
3698 (sha256
3699 (base32
3700 "1j8avi91px1z8rjc89cfikwrvfifdmmsarwiyrcnr59ynvpz0v8h"))
3701 (modules '((guix build utils)))
3702 (snippet
3703 '(begin
3704 ;; Delete bundled jar archives.
3705 (delete-file-recursively "lib")
3706 #t))))
3707 (build-system ant-build-system)
3708 (arguments
3709 `(#:jar-name "junit.jar"
3710 #:source-dir "src/main/java"
3711 #:test-dir "src/test"
3712 #:test-exclude (list "**/SimpleTest.java" "**/StackTracesTest.java"
3713 "**/RuleChainTest.java" "**/TestWatchmanTest.java")
3714 #:phases
3715 (modify-phases %standard-phases
3716 (add-before 'check 'copy-test-resources
3717 (lambda _
3718 (copy-recursively "src/test/resources" "build/test-classes")
3719 #t))
3720 (replace 'install
3721 (install-from-pom "pom.xml")))))
3722 (propagated-inputs
3723 (list java-hamcrest-core))
3724 (native-inputs
3725 (list java-hamcrest-library))
3726 (home-page "https://junit.org/junit4/")
3727 (synopsis "Test framework for Java")
3728 (description
3729 "JUnit is a simple framework to write repeatable tests for Java projects.
3730JUnit provides assertions for testing expected results, test fixtures for
3731sharing common test data, and test runners for running tests.")
3732 (license license:epl1.0)))
3733
3734(define-public java-junitparams
3735 (package
3736 (name "java-junitparams")
3737 (version "1.1.1")
3738 (source (origin
3739 (method git-fetch)
3740 (uri (git-reference
3741 (url "https://github.com/Pragmatists/JUnitParams")
3742 (commit (string-append "JUnitParams-" version))))
3743 (file-name (git-file-name name version))
3744 (sha256
3745 (base32
3746 "0rb52xdfp99invyjrras3w0bf0a81cz30yd47rkkiyqcqj0y1q9b"))))
3747 (build-system ant-build-system)
3748 (arguments
3749 `(#:jar-name "junitparams.jar"
3750 #:source-dir "src/main/java"
3751 #:test-dir "src/test"
3752 #:test-exclude (list "**/SuperclassTest.java")))
3753 (inputs
3754 (list java-junit))
3755 (native-inputs
3756 (list java-junit java-hamcrest-core java-assertj))
3757 (home-page "https://github.com/Pragmatists/JUnitParams")
3758 (synopsis "Parameterised test support for JUnit")
3759 (description "The JUnitParams project adds a new runner to JUnit and
3760provides much easier and readable parametrised tests for JUnit.")
3761 (license license:asl2.0)))
3762
3763(define-public java-plexus-utils
3764 (package
3765 (name "java-plexus-utils")
3766 (version "3.3.0")
3767 (source (origin
3768 (method git-fetch)
3769 (uri (git-reference
3770 (url "https://github.com/codehaus-plexus/plexus-utils")
3771 (commit (string-append "plexus-utils-" version))))
3772 (file-name (git-file-name name version))
3773 (sha256
3774 (base32
3775 "0d0fq21rzjy0j55kcp8w9k1rbq9rwr0r7cc8239p9jbz54vihp0g"))))
3776 (build-system ant-build-system)
3777 ;; FIXME: The default build.xml does not include a target to install
3778 ;; javadoc files.
3779 (arguments
3780 `(#:jar-name "plexus-utils.jar"
3781 #:source-dir "src/main"
3782 #:phases
3783 (modify-phases %standard-phases
3784 (add-after 'unpack 'fix-reference-to-/bin-and-/usr
3785 (lambda _
3786 (substitute* "src/main/java/org/codehaus/plexus/util/\
3787cli/shell/BourneShell.java"
3788 (("/bin/sh") (which "sh"))
3789 (("/usr/") (getcwd)))
3790 #t))
3791 (add-after 'unpack 'fix-or-disable-broken-tests
3792 (lambda _
3793 (with-directory-excursion "src/test/java/org/codehaus/plexus/util"
3794 (substitute* '("cli/CommandlineTest.java"
3795 "cli/shell/BourneShellTest.java")
3796 (("/bin/sh") (which "sh"))
3797 (("/bin/echo") (which "echo")))
3798
3799 ;; This test depends on MavenProjectStub, but we don't have
3800 ;; a package for Maven.
3801 (delete-file "introspection/ReflectionValueExtractorTest.java")
3802
3803 ;; FIXME: The command line tests fail, maybe because they use
3804 ;; absolute paths.
3805 (delete-file "cli/CommandlineTest.java")
3806
3807 ;; These tests require openjdk jmh, which is not packaged yet
3808 (for-each delete-file (find-files "." "PerfTest.java$")))
3809 #t))
3810 (add-before 'build 'copy-resources
3811 (lambda _
3812 (copy-recursively "src/main/resources" "build/classes")
3813 #t))
3814 (replace 'install (install-from-pom "pom.xml")))))
3815 (native-inputs
3816 (list java-hamcrest-core java-junit))
3817 (propagated-inputs
3818 (list plexus-parent-pom-5.1))
3819 (home-page "https://codehaus-plexus.github.io/plexus-utils/")
3820 (synopsis "Common utilities for the Plexus framework")
3821 (description "This package provides various Java utility classes for the
3822Plexus framework to ease working with strings, files, command lines, XML and
3823more.")
3824 (license license:asl2.0)))
3825
3826(define-public java-plexus-utils-3.2.1
3827 (package
3828 (inherit java-plexus-utils)
3829 ;; plexus-build-api needs this version, later versions don't work
3830 (version "3.2.1")
3831 (source (origin
3832 (method git-fetch)
3833 (uri (git-reference
3834 (url "https://github.com/codehaus-plexus/plexus-utils")
3835 (commit (string-append "plexus-utils-" version))))
3836 (file-name (git-file-name "java-plexus-utils" version))
3837 (sha256
3838 (base32
3839 "1w169glixyk94jbczj8jzg897lsab46jihiaa3dhw0p06g35va8b"))))))
3840
3841(define-public java-plexus-interpolation
3842 (package
3843 (name "java-plexus-interpolation")
3844 (version "1.26")
3845 (source (origin
3846 (method git-fetch)
3847 (uri (git-reference
3848 (url "https://github.com/codehaus-plexus/plexus-interpolation")
3849 (commit (string-append "plexus-interpolation-" version))))
3850 (file-name (git-file-name name version))
3851 (sha256
3852 (base32
3853 "1rahjmhywf6d5m32qzlc9izawyvcd71abfm9k03f13rs2xmfxzlh"))))
3854 (build-system ant-build-system)
3855 (arguments
3856 `(#:jar-name "plexus-interpolation.jar"
3857 #:source-dir "src/main"
3858 #:phases
3859 (modify-phases %standard-phases
3860 (replace 'install (install-from-pom "pom.xml")))))
3861 (propagated-inputs
3862 `(("plexus-parent-pom-5.1" ,plexus-parent-pom-5.1)))
3863 (native-inputs
3864 (list java-junit java-hamcrest-core))
3865 (home-page "https://codehaus-plexus.github.io/plexus-interpolation/")
3866 (synopsis "Java components for interpolating ${} strings and the like")
3867 (description "Plexus interpolator is a modular, flexible interpolation
3868framework for the expression language style commonly seen in Maven, Plexus,
3869and other related projects.
3870
3871It has its foundation in the @code{org.codehaus.plexus.utils.interpolation}
3872package within @code{plexus-utils}, but has been separated in order to allow
3873these two libraries to vary independently of one another.")
3874 (license license:asl2.0)))
3875
3876(define-public java-plexus-classworlds
3877 (package
3878 (name "java-plexus-classworlds")
3879 (version "2.6.0")
3880 (source (origin
3881 (method git-fetch)
3882 (uri (git-reference
3883 (url "https://github.com/codehaus-plexus/plexus-classworlds")
3884 (commit (string-append "plexus-classworlds-" version))))
3885 (file-name (git-file-name name version))
3886 (sha256
3887 (base32
3888 "034k2hgvj1saalwbnzrbg4n0zgzwcpz1lhlb8q4kgglsp9pmm03s"))))
3889 (build-system ant-build-system)
3890 (arguments
3891 `(#:jar-name "plexus-classworlds.jar"
3892 #:source-dir "src/main"
3893 #:tests? #f;; FIXME: we need to generate some resources as in pom.xml
3894 #:phases
3895 (modify-phases %standard-phases
3896 (replace 'install (install-from-pom "pom.xml")))))
3897 (propagated-inputs
3898 `(("plexus-parent-pom-5.1" ,plexus-parent-pom-5.1)))
3899 (native-inputs
3900 (list java-junit))
3901 (home-page "https://codehaus-plexus.github.io/plexus-classworlds/")
3902 (synopsis "Java class loader framework")
3903 (description "Plexus classworlds replaces the native @code{ClassLoader}
3904mechanism of Java. It is especially useful for dynamic loading of application
3905components.")
3906 (license license:asl2.0)))
3907
3908(define java-plexus-container-default-bootstrap
3909 (package
3910 (name "java-plexus-container-default-bootstrap")
3911 (version "2.1.0")
3912 (source (origin
3913 (method git-fetch)
3914 (uri (git-reference
3915 (url "https://github.com/codehaus-plexus/plexus-containers")
3916 (commit (string-append "plexus-containers-" version))))
3917 (file-name (git-file-name name version))
3918 (sha256
3919 (base32
3920 "0r9yq67c1hvi1pz5wmx6x6hk5fmavp8a7yal3j5hkaad757firn1"))))
3921 (build-system ant-build-system)
3922 (arguments
3923 `(#:jar-name "container-default.jar"
3924 #:source-dir "plexus-container-default/src/main/java"
3925 #:test-dir "plexus-container-default/src/test"
3926 #:tests? #f; requires plexus-archiver, which depends on this package
3927 #:phases
3928 (modify-phases %standard-phases
3929 (add-before 'build 'fix-google-collections
3930 (lambda _
3931 ;; Google collections are now replaced with guava
3932 (substitute* "plexus-container-default/pom.xml"
3933 (("google-collections") "guava")
3934 (("com.google.collections") "com.google.guava"))
3935 #t))
3936 (add-before 'build 'copy-resources
3937 (lambda _
3938 (copy-recursively
3939 "plexus-container-default/src/main/resources/"
3940 "build/classes")
3941 #t))
3942 (replace 'install
3943 (install-from-pom "plexus-container-default/pom.xml")))))
3944 (propagated-inputs
3945 `(("java-plexus-worldclass" ,java-plexus-classworlds)
3946 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
3947 ("java-plexus-utils" ,java-plexus-utils)
3948 ("java-junit" ,java-junit)
3949 ("java-guava" ,java-guava)
3950 ("java-plexus-containers-parent-pom" ,java-plexus-containers-parent-pom)))
3951 (home-page "https://github.com/codehaus-plexus/plexus-containers")
3952 (synopsis "Inversion-of-control container")
3953 (description "Plexus-default-container is Plexus' inversion-of-control
3954(@dfn{IoC}) container. It is composed of its public API and its default
3955implementation.")
3956 (license license:asl2.0)))
3957
3958(define java-plexus-containers-parent-pom
3959 (package
3960 (inherit java-plexus-container-default-bootstrap)
3961 (name "java-plexus-containers-parent-pom")
3962 (arguments
3963 `(#:tests? #f
3964 #:phases
3965 (modify-phases %standard-phases
3966 (delete 'configure)
3967 (delete 'build)
3968 (replace 'install
3969 (install-pom-file "pom.xml")))))
3970 (propagated-inputs
3971 `(("plexus-parent-pom" ,plexus-parent-pom-4.0)))))
3972
3973(define-public java-plexus-io
3974 (package
3975 (name "java-plexus-io")
3976 (version "3.2.0")
3977 (source (origin
3978 (method git-fetch)
3979 (uri (git-reference
3980 (url "https://github.com/codehaus-plexus/plexus-io")
3981 (commit (string-append "plexus-io-" version))))
3982 (file-name (git-file-name name version))
3983 (sha256
3984 (base32
3985 "1r3wqfpbxq8vp4p914i8p88r0994rmcjw02hz14n11cfb6gsyvlr"))))
3986 (build-system ant-build-system)
3987 (arguments
3988 `(#:jar-name "plexus-io.jar"
3989 #:source-dir "src/main/java"
3990 #:test-dir "src/test"
3991 #:phases
3992 (modify-phases %standard-phases
3993 (add-before 'build 'copy-resources
3994 (lambda _
3995 (mkdir-p "build/classes")
3996 (copy-recursively "src/main/resources" "build/classes")
3997 (mkdir-p "build/test-classes")
3998 (copy-recursively "src/test/resources" "build/test-classes")
3999 #t))
4000 (replace 'install (install-from-pom "pom.xml")))))
4001 (propagated-inputs
4002 (list java-plexus-utils java-commons-io plexus-parent-pom-5.1))
4003 (inputs
4004 (list java-jsr305))
4005 (native-inputs
4006 `(("junit" ,java-junit)
4007 ("hamcrest" ,java-hamcrest-core)
4008 ("guava" ,java-guava)
4009 ("classworlds" ,java-plexus-classworlds)
4010 ("xbean" ,java-geronimo-xbean-reflect)
4011 ("container-default" ,java-plexus-container-default-bootstrap)))
4012 (home-page "https://github.com/codehaus-plexus/plexus-io")
4013 (synopsis "I/O plexus components")
4014 (description "Plexus IO is a set of plexus components, which are designed
4015for use in I/O operations. This implementation using plexus components allows
4016reusing it in maven.")
4017 (license license:asl2.0)))
4018
4019(define-public java-plexus-archiver
4020 (package
4021 (name "java-plexus-archiver")
4022 (version "4.2.2")
4023 (source (origin
4024 (method url-fetch)
4025 (uri (string-append "https://github.com/codehaus-plexus/plexus-archiver"
4026 "/archive/plexus-archiver-" version ".tar.gz"))
4027 (sha256
4028 (base32
4029 "144n971r3lfrx3l12nf2scm80x4xdvgbkk4bjpa4vcvvdrll6qys"))))
4030 (build-system ant-build-system)
4031 (arguments
4032 `(#:jar-name "plexus-archiver.jar"
4033 #:source-dir "src/main/java"
4034 #:test-dir "src/test"
4035 #:test-exclude (list "**/Abstract*.java" "**/Base*.java")
4036 #:phases
4037 (modify-phases %standard-phases
4038 (add-before 'check 'remove-failing
4039 (lambda _
4040 ;; Requires an older version of plexus container
4041 (delete-file
4042 "src/test/java/org/codehaus/plexus/archiver/DuplicateFilesTest.java")
4043 #t))
4044 (add-before 'check 'fix-test-building
4045 (lambda _
4046 (substitute* "build.xml"
4047 (("srcdir=\"src/test\"") "srcdir=\"src/test/java\""))
4048 #t))
4049 (add-before 'build 'copy-resources
4050 (lambda _
4051 (mkdir-p "build/classes")
4052 (copy-recursively "src/main/resources" "build/classes")
4053 (mkdir-p "build/test-classes")
4054 (copy-recursively "src/test/resources" "build/test-classes")
4055 #t))
4056 (replace 'install (install-from-pom "pom.xml")))))
4057 (propagated-inputs
4058 (list java-plexus-utils java-plexus-io java-iq80-snappy
4059 java-commons-compress plexus-parent-pom-6.1))
4060 (inputs
4061 `(("java-jsr305" ,java-jsr305)
4062 ("java-plexus-container-default"
4063 ,java-plexus-container-default-bootstrap)))
4064 (native-inputs
4065 `(("java-hamcrest-core" ,java-hamcrest-core)
4066 ("junit" ,java-junit)
4067 ("classworld" ,java-plexus-classworlds)
4068 ("xbean" ,java-geronimo-xbean-reflect)
4069 ("xz" ,java-xz)
4070 ("guava" ,java-guava)))
4071 (home-page "https://github.com/codehaus-plexus/plexus-archiver")
4072 (synopsis "Archiver component of the Plexus project")
4073 (description "Plexus-archiver contains a component to deal with project
4074archives (jar).")
4075 (license license:asl2.0)))
4076
4077(define-public java-plexus-container-default
4078 (package
4079 (inherit java-plexus-container-default-bootstrap)
4080 (name "java-plexus-container-default")
4081 (arguments
4082 `(#:jar-name "container-default.jar"
4083 #:source-dir "plexus-container-default/src/main/java"
4084 #:test-dir "plexus-container-default/src/test"
4085 #:test-exclude (list ;"**/*Test.java"
4086 "**/Abstract*.java"
4087 ;; Requires plexus-hierarchy
4088 "**/PlexusHierarchyTest.java"
4089 ;; Failures
4090 "**/ComponentRealmCompositionTest.java"
4091 "**/PlexusContainerTest.java")
4092 #:phases
4093 (modify-phases %standard-phases
4094 (add-before 'build 'fix-google-collections
4095 (lambda _
4096 ;; Google collections are now replaced with guava
4097 (substitute* "plexus-container-default/pom.xml"
4098 (("google-collections") "guava")
4099 (("com.google.collections") "com.google.guava"))
4100 #t))
4101 (add-before 'build 'copy-resources
4102 (lambda _
4103 (copy-recursively
4104 "plexus-container-default/src/main/resources/"
4105 "build/classes")
4106 #t))
4107 (add-before 'check 'fix-paths
4108 (lambda _
4109 (let ((dir "plexus-container-default/src/test/java/org/codehaus"))
4110 (substitute*
4111 (string-append
4112 dir "/plexus/component/composition/"
4113 "ComponentRealmCompositionTest.java")
4114 (("src/test") "plexus-container-default/src/test"))
4115 #t)))
4116 (replace 'install
4117 (install-from-pom "plexus-container-default/pom.xml")))))
4118 (inputs
4119 `(("worldclass" ,java-plexus-classworlds)
4120 ("xbean" ,java-geronimo-xbean-reflect)
4121 ("utils" ,java-plexus-utils)
4122 ("junit" ,java-junit)
4123 ("guava" ,java-guava)))
4124 (native-inputs
4125 `(("archiver" ,java-plexus-archiver)
4126 ("hamcrest" ,java-hamcrest-core)))))
4127
4128(define-public java-plexus-component-annotations
4129 (package
4130 (inherit java-plexus-container-default)
4131 (name "java-plexus-component-annotations")
4132 (arguments
4133 `(#:jar-name "plexus-component-annotations.jar"
4134 #:source-dir "plexus-component-annotations/src/main/java"
4135 #:tests? #f; no tests
4136 #:phases
4137 (modify-phases %standard-phases
4138 (replace 'install
4139 (install-from-pom "plexus-component-annotations/pom.xml")))))
4140 (propagated-inputs
4141 (list java-plexus-containers-parent-pom))
4142 (inputs '())
4143 (native-inputs '())
4144 (synopsis "Plexus descriptors generator")
4145 (description "This package is a Maven plugin to generate Plexus descriptors
4146from source tags and class annotations.")))
4147
4148(define-public java-plexus-component-metadata
4149 (package
4150 (inherit java-plexus-container-default)
4151 (name "java-plexus-component-metadata")
4152 (arguments
4153 `(#:jar-name "plexus-component-metadata.jar"
4154 #:source-dir "src/main/java"
4155 #:test-dir "src/test"
4156 #:jdk ,icedtea-8
4157 #:phases
4158 (modify-phases %standard-phases
4159 (add-before 'configure 'chdir
4160 (lambda _
4161 (chdir "plexus-component-metadata")
4162 #t))
4163 (add-before 'build 'copy-resources
4164 (lambda _
4165 (copy-recursively "src/main/resources"
4166 "build/classes/")
4167 #t))
4168 (add-before 'build 'fix-jdom
4169 (lambda _
4170 ;; The newer version of jdom now sets multiple features by default
4171 ;; that are not supported.
4172 ;; Skip these features
4173 (substitute* "src/main/java/org/codehaus/plexus/metadata/merge/MXParser.java"
4174 (("throw new XmlPullParserException\\(\"unsupporte feature \"\\+name\\);")
4175 "// skip"))))
4176 (add-before 'build 'reinstate-cli
4177 ;; The CLI was removed in 2.1.0, but we still need it to build some
4178 ;; maven dependencies, and some parts of maven itself. We can't use
4179 ;; the maven plugin for that yet.
4180 (lambda _
4181 (with-output-to-file "src/main/java/org/codehaus/plexus/metadata/PlexusMetadataGeneratorCli.java"
4182 (lambda _
4183 ;; Copied from a previous version of this package.
4184 (display "package org.codehaus.plexus.metadata;
4185
4186import java.io.File;
4187import java.util.Arrays;
4188import java.util.Collections;
4189
4190import org.apache.commons.cli.CommandLine;
4191import org.apache.commons.cli.OptionBuilder;
4192import org.apache.commons.cli.Options;
4193import org.codehaus.plexus.PlexusContainer;
4194import org.codehaus.plexus.tools.cli.AbstractCli;
4195
4196public class PlexusMetadataGeneratorCli
4197 extends AbstractCli
4198{
4199 public static final char SOURCE_DIRECTORY = 's';
4200 public static final char SOURCE_ENCODING = 'e';
4201 public static final char CLASSES_DIRECTORY = 'c';
4202 public static final char OUTPUT_FILE = 'o';
4203 public static final char DESCRIPTORS_DIRECTORY = 'm';
4204
4205 public static void main( String[] args )
4206 throws Exception
4207 {
4208 new PlexusMetadataGeneratorCli().execute( args );
4209 }
4210
4211 @Override
4212 public String getPomPropertiesPath()
4213 {
4214 return \"META-INF/maven/org.codehaus.plexus/plexus-metadata-generator/pom.properties\";
4215 }
4216
4217 @Override
4218 @SuppressWarnings(\"static-access\")
4219 public Options buildCliOptions( Options options )
4220 {
4221 options.addOption( OptionBuilder.withLongOpt( \"source\" ).hasArg().withDescription( \"Source directory.\" ).create( SOURCE_DIRECTORY ) );
4222 options.addOption( OptionBuilder.withLongOpt( \"encoding\" ).hasArg().withDescription( \"Source file encoding.\" ).create( SOURCE_ENCODING ) );
4223 options.addOption( OptionBuilder.withLongOpt( \"classes\" ).hasArg().withDescription( \"Classes directory.\" ).create( CLASSES_DIRECTORY ) );
4224 options.addOption( OptionBuilder.withLongOpt( \"output\" ).hasArg().withDescription( \"Output directory.\" ).create( OUTPUT_FILE ) );
4225 options.addOption( OptionBuilder.withLongOpt( \"descriptors\" ).hasArg().withDescription( \"Descriptors directory.\" ).create( DESCRIPTORS_DIRECTORY ) );
4226 return options;
4227 }
4228
4229 public void invokePlexusComponent( CommandLine cli, PlexusContainer plexus )
4230 throws Exception
4231 {
4232 MetadataGenerator metadataGenerator = plexus.lookup( MetadataGenerator.class );
4233
4234 MetadataGenerationRequest request = new MetadataGenerationRequest();
4235 request.classesDirectory = new File( cli.getOptionValue( CLASSES_DIRECTORY ) );
4236 request.classpath = Collections.emptyList();
4237 request.sourceDirectories = Arrays.asList( new String[]{ new File( cli.getOptionValue( SOURCE_DIRECTORY ) ).getAbsolutePath() } );
4238 request.sourceEncoding = cli.getOptionValue( SOURCE_ENCODING );
4239 request.useContextClassLoader = true;
4240 request.outputFile = new File( cli.getOptionValue( OUTPUT_FILE ) );
4241 request.componentDescriptorDirectory = new File( cli.getOptionValue( DESCRIPTORS_DIRECTORY ) );
4242
4243 metadataGenerator.generateDescriptor( request );
4244 }
4245}")))))
4246 (add-before 'check 'fix-test-location
4247 (lambda _
4248 (substitute* '("src/test/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriterTest.java"
4249 "src/test/java/org/codehaus/plexus/metadata/merge/ComponentsXmlMergerTest.java")
4250 (("target") "build")))))))
4251 (propagated-inputs
4252 `(("java-plexus-container-default" ,java-plexus-container-default)
4253 ("java-plexu-component-annotations" ,java-plexus-component-annotations)
4254 ("java-plexus-utils" ,java-plexus-utils)
4255 ("java-plexus-cli" ,java-plexus-cli)
4256 ("java-plexus-classworlds" ,java-plexus-classworlds)
4257 ("maven-plugin-api" ,maven-plugin-api)
4258 ("maven-plugin-annotations" ,maven-plugin-annotations)
4259 ("maven-core-bootstrap" ,maven-core-bootstrap)
4260 ("maven-model" ,maven-model)
4261 ("java-commons-cli" ,java-commons-cli)
4262 ("java-qdox" ,java-qdox)
4263 ("java-jdom2" ,java-jdom2)
4264 ("java-asm-8" ,java-asm-8)))
4265 (native-inputs
4266 (list java-junit java-guava java-geronimo-xbean-reflect))
4267 (synopsis "Inversion-of-control container for Maven")
4268 (description "The Plexus project provides a full software stack for creating
4269and executing software projects. Based on the Plexus container, the
4270applications can utilise component-oriented programming to build modular,
4271reusable components that can easily be assembled and reused. This package
4272provides the Maven plugin generating the component metadata.")))
4273
4274(define-public java-plexus-container-default-1.7
4275 (package
4276 (inherit java-plexus-container-default)
4277 (version "1.7.1")
4278 (source (origin
4279 (method git-fetch)
4280 (uri (git-reference
4281 (url "https://github.com/codehaus-plexus/plexus-containers")
4282 (commit (string-append "plexus-containers-" version))))
4283 (file-name (git-file-name "java-plexus-container-default" version))
4284 (sha256
4285 (base32
4286 "1316hrp5vqfv0aw7miq2fp0wwy833h66h502h29vnh5sxj27x228"))))))
4287
4288(define java-plexus-containers-parent-pom-1.7
4289 (package
4290 (inherit java-plexus-container-default-1.7)
4291 (name "java-plexus-containers-parent-pom")
4292 (arguments
4293 `(#:tests? #f
4294 #:phases
4295 (modify-phases %standard-phases
4296 (delete 'configure)
4297 (delete 'build)
4298 (replace 'install
4299 (install-pom-file "pom.xml")))))
4300 (propagated-inputs
4301 `(("plexus-parent-pom" ,plexus-parent-pom-4.0)))))
4302
4303(define-public java-plexus-component-annotations-1.7
4304 (package
4305 (inherit java-plexus-container-default-1.7)
4306 (name "java-plexus-component-annotations")
4307 (arguments
4308 `(#:jar-name "plexus-component-annotations.jar"
4309 #:source-dir "plexus-component-annotations/src/main/java"
4310 #:tests? #f; no tests
4311 #:phases
4312 (modify-phases %standard-phases
4313 (replace 'install
4314 (install-from-pom "plexus-component-annotations/pom.xml")))))
4315 (propagated-inputs
4316 `(("java-plexus-containers-parent-pom-1.7" ,java-plexus-containers-parent-pom-1.7)))
4317 (inputs '())
4318 (native-inputs '())
4319 (synopsis "Plexus descriptors generator")
4320 (description "This package is a Maven plugin to generate Plexus descriptors
4321from source tags and class annotations.")))
4322
4323(define-public java-plexus-component-metadata-1.7
4324 (package
4325 (inherit java-plexus-container-default-1.7)
4326 (name "java-plexus-component-metadata")
4327 (arguments
4328 `(#:jar-name "plexus-component-metadata.jar"
4329 #:source-dir "src/main/java"
4330 #:test-dir "src/test"
4331 #:phases
4332 (modify-phases %standard-phases
4333 (add-before 'configure 'chdir
4334 (lambda _
4335 (chdir "plexus-component-metadata")
4336 #t))
4337 (add-before 'build 'copy-resources
4338 (lambda _
4339 (copy-recursively "src/main/resources"
4340 "build/classes/")
4341 #t))
4342 (add-before 'build 'fix-jdom
4343 (lambda _
4344 ;; The newer version of jdom now sets multiple features by default
4345 ;; that are not supported.
4346 ;; Skip these features
4347 (substitute* "src/main/java/org/codehaus/plexus/metadata/merge/MXParser.java"
4348 (("throw new XmlPullParserException\\(\"unsupporte feature \"\\+name\\);")
4349 "// skip"))))
4350 (add-before 'check 'fix-test-location
4351 (lambda _
4352 (substitute* '("src/test/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriterTest.java"
4353 "src/test/java/org/codehaus/plexus/metadata/merge/ComponentsXmlMergerTest.java")
4354 (("target") "build")))))))
4355 (propagated-inputs
4356 (list java-plexus-container-default-1.7
4357 java-plexus-component-annotations-1.7
4358 java-plexus-utils
4359 java-plexus-cli
4360 java-plexus-cli
4361 java-plexus-classworlds
4362 maven-plugin-api
4363 maven-plugin-annotations
4364 maven-core-bootstrap
4365 maven-model
4366 java-commons-cli
4367 java-qdox
4368 java-jdom2
4369 java-asm-8))
4370 (native-inputs
4371 (list java-junit java-guava java-geronimo-xbean-reflect))
4372 (synopsis "Inversion-of-control container for Maven")
4373 (description "The Plexus project provides a full software stack for creating
4374and executing software projects. Based on the Plexus container, the
4375applications can utilise component-oriented programming to build modular,
4376reusable components that can easily be assembled and reused. This package
4377provides the Maven plugin generating the component metadata.")))
4378
4379(define-public java-plexus-cipher
4380 (package
4381 (name "java-plexus-cipher")
4382 (version "2.0")
4383 (source (origin
4384 (method git-fetch)
4385 (uri (git-reference
4386 (url "https://github.com/codehaus-plexus/plexus-cipher")
4387 (commit (string-append "plexus-cipher-" version))))
4388 (file-name (git-file-name name version))
4389 (sha256
4390 (base32
4391 "01fipdsm090n8j4207fl8kbxznkgkmkkgyazf53hm1nwn6na5aai"))))
4392 (build-system ant-build-system)
4393 (arguments
4394 `(#:jar-name "plexus-cipher.jar"
4395 #:source-dir "src/main/java"
4396 #:phases
4397 (modify-phases %standard-phases
4398 (add-before 'build 'generate-javax.inject.Named
4399 (lambda _
4400 (mkdir-p "build/classes/META-INF/sisu")
4401 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4402 (lambda _
4403 (display
4404 "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
4405 #t))
4406 (replace 'install (install-from-pom "pom.xml")))))
4407 (inputs
4408 `(("java-cdi-api" ,java-cdi-api)
4409 ("java-javax-inject" ,java-javax-inject)))
4410 (propagated-inputs
4411 `(("java-sonatype-spice-parent-pom" ,java-sonatype-spice-parent-pom-15)
4412 ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)))
4413 (native-inputs
4414 `(("java-junit" ,java-junit)))
4415 (home-page "https://github.com/sonatype/plexus-cipher")
4416 (synopsis "Encryption/decryption Component")
4417 (description "Plexus-cipher contains a component to deal with encryption
4418and decryption.")
4419 (license license:asl2.0)))
4420
4421(define-public java-plexus-cipher-1.7
4422 (package
4423 (inherit java-plexus-cipher)
4424 (version "1.7")
4425 (source (origin
4426 (method git-fetch)
4427 (uri (git-reference
4428 (url "https://github.com/codehaus-plexus/plexus-cipher")
4429 (commit (string-append "plexus-cipher-" version))))
4430 (file-name (git-file-name "java-plexus-cipher" version))
4431 (sha256
4432 (base32
4433 "0m638nzlxbmnbcj5cwdpgs326ab584yv0k803zlx37r6iqwvf6b0"))))
4434 (arguments
4435 `(#:jar-name "plexus-cipher.jar"
4436 #:source-dir "src/main/java"
4437 #:tests? #f; FIXME: requires sisu-inject-bean
4438 #:phases
4439 (modify-phases %standard-phases
4440 (add-before 'build 'copy-resources
4441 (lambda _
4442 (copy-recursively "src/main/resources" "build/classes")
4443 (mkdir-p "build/classes/META-INF/sisu")
4444 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4445 (lambda _
4446 (display "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
4447 #t))
4448 (add-before 'install 'fix-test-dependency
4449 (lambda _
4450 ;; sisu-inject-bean is only used for tests, but its scope is "provided".
4451 (substitute* "pom.xml"
4452 (("provided") "test"))
4453 #t))
4454 (replace 'install (install-from-pom "pom.xml")))))
4455 (propagated-inputs
4456 (list java-sonatype-spice-parent-pom-15))))
4457
4458(define-public java-plexus-java
4459 (package
4460 (name "java-plexus-java")
4461 (version "0.9.10")
4462 (source (origin
4463 (method git-fetch)
4464 (uri (git-reference
4465 (url "https://github.com/codehaus-plexus/plexus-languages")
4466 (commit (string-append "plexus-languages-" version))))
4467 (file-name (git-file-name name version))
4468 (sha256
4469 (base32
4470 "0vmvgq5hfxs90yyxgssfpwq78l7vwx1ljwpkk594mrdr8sm668b5"))
4471 (modules '((guix build utils)))
4472 (snippet
4473 `(begin
4474 (for-each delete-file (find-files "." ".*.jar$"))
4475 #t))))
4476 (build-system ant-build-system)
4477 (arguments
4478 `(#:jar-name "plexus-java.java"
4479 #:source-dir "plexus-java/src/main/java"
4480 #:test-dir "plexus-java/src/test"
4481 #:tests? #f; require mockito 2
4482 #:phases
4483 (modify-phases %standard-phases
4484 (add-after 'build 'generate-metadata
4485 (lambda _
4486 (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
4487 "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
4488 "--source" "plexus-java/src/main/java"
4489 "--output" "build/classes/META-INF/plexus/components.xml"
4490 "--classes" "build/classes"
4491 "--descriptors" "build/classes/META-INF")
4492 (invoke "ant" "jar")
4493 #t))
4494 (add-before 'install 'install-parent
4495 (install-pom-file "pom.xml"))
4496 (replace 'install
4497 (install-from-pom "plexus-java/pom.xml")))))
4498 (propagated-inputs
4499 (list java-asm java-qdox-2-M9 java-javax-inject
4500 plexus-parent-pom-4.0))
4501 (inputs
4502 (list java-plexus-component-annotations-1.7))
4503 (native-inputs
4504 (list java-plexus-component-metadata-1.7 java-junit))
4505 (home-page "https://codehaus-plexus.github.io/plexus-languages/plexus-java")
4506 (synopsis "Shared language features for Java")
4507 (description "This package contains shared language features of the Java
4508language, for the plexus project.")
4509 (license license:asl2.0)))
4510
4511(define-public java-plexus-compiler-api
4512 (package
4513 (name "java-plexus-compiler-api")
4514 (version "2.8.4")
4515 (source (origin
4516 (method git-fetch)
4517 (uri (git-reference
4518 (url "https://github.com/codehaus-plexus/plexus-compiler")
4519 (commit (string-append "plexus-compiler-" version))))
4520 (file-name (git-file-name name version))
4521 (sha256
4522 (base32
4523 "1nq1gnn3s6z1j29gmi1hqbklsmm8b1lmnafb0191914f95mn18gk"))))
4524 (build-system ant-build-system)
4525 (arguments
4526 `(#:jar-name "plexus-compiler-api.jar"
4527 #:source-dir "plexus-compiler-api/src/main/java"
4528 #:test-dir "plexus-compiler-api/src/test"
4529 #:phases
4530 (modify-phases %standard-phases
4531 (replace 'install
4532 (install-from-pom "plexus-compiler-api/pom.xml")))))
4533 (propagated-inputs
4534 `(("java-plexus-container-default" ,java-plexus-container-default)
4535 ("java-plexus-compiler-pom" ,java-plexus-compiler-pom)
4536 ("java-plexus-util" ,java-plexus-utils)))
4537 (native-inputs
4538 (list java-junit))
4539 (home-page "https://github.com/codehaus-plexus/plexus-compiler")
4540 (synopsis "Plexus Compilers component's API to manipulate compilers")
4541 (description "This package contains the API used by components to manipulate
4542compilers.")
4543 (license (list license:asl2.0
4544 license:expat))))
4545
4546(define java-plexus-compiler-pom
4547 (package
4548 (inherit java-plexus-compiler-api)
4549 (name "java-plexus-compiler-pom")
4550 (arguments
4551 `(#:tests? #f
4552 #:phases
4553 (modify-phases %standard-phases
4554 (delete 'configure)
4555 (delete 'build)
4556 (replace 'install
4557 (install-pom-file "pom.xml"))
4558 (add-after 'install 'install-compilers
4559 (install-pom-file "plexus-compilers/pom.xml")))))
4560 (propagated-inputs
4561 `(("plexus-components-parent-pom-4.0" ,plexus-components-parent-pom-4.0)))))
4562
4563(define plexus-components-parent-pom-4.0
4564 (package
4565 (name "plexus-components-parent-pom")
4566 (version "4.0")
4567 (source (origin
4568 (method git-fetch)
4569 (uri (git-reference
4570 (url "https://github.com/codehaus-plexus/plexus-components")
4571 (commit (string-append "plexus-components-" version))))
4572 (file-name (git-file-name name version))
4573 (sha256
4574 (base32
4575 "041bm8yv0m2i17mqg8zljib4ykpha7ijls2qfdwvkma4d39lhysi"))))
4576 (build-system ant-build-system)
4577 (arguments
4578 `(#:tests? #f
4579 #:phases
4580 (modify-phases %standard-phases
4581 (delete 'configure)
4582 (delete 'build)
4583 (replace 'install
4584 (install-pom-file "pom.xml")))))
4585 (propagated-inputs
4586 `(("plexus-parent-pom-4.0" ,plexus-parent-pom-4.0)))
4587 (home-page "https://codehaus-plexus.github.io/plexus-components")
4588 (synopsis "Plexus parent pom")
4589 (description "This package contains the Plexus components parent POM.")
4590 (license license:asl2.0)))
4591
4592(define-public java-plexus-compiler-manager
4593 (package
4594 (inherit java-plexus-compiler-api)
4595 (name "java-plexus-compiler-manager")
4596 (arguments
4597 `(#:jar-name "compiler-compiler-manager.java"
4598 #:source-dir "plexus-compiler-manager/src/main/java"
4599 #:test-dir "plexus-compiler-manager/src/test"
4600 #:tests? #f
4601 #:phases
4602 (modify-phases %standard-phases
4603 (add-after 'build 'generate-metadata
4604 (lambda _
4605 (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
4606 "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
4607 "--source" "plexus-compiler-manager/src/main/java"
4608 "--output" "build/classes/META-INF/plexus/components.xml"
4609 "--classes" "build/classes"
4610 "--descriptors" "build/classes/META-INF")
4611 (invoke "ant" "jar")
4612 #t))
4613 (add-after 'generate-metadata 'rebuild
4614 (lambda _
4615 (invoke "ant" "jar")
4616 #t))
4617 (replace 'install
4618 (install-from-pom "plexus-compiler-manager/pom.xml")))))
4619 (propagated-inputs
4620 (list java-plexus-compiler-api java-plexus-compiler-pom
4621 java-plexus-container-default-1.7))
4622 (native-inputs
4623 (list unzip java-plexus-component-metadata-1.7))
4624 (synopsis "Compiler management for Plexus Compiler component")
4625 (description "Plexus Compiler is a Plexus component to use different
4626compilers through a uniform API. This component chooses the compiler
4627implementation to use in a project.")))
4628
4629(define-public java-plexus-compiler-javac
4630 (package
4631 (inherit java-plexus-compiler-api)
4632 (name "java-plexus-compiler-javac")
4633 (arguments
4634 `(#:jar-name "plexus-compiler-javac.jar"
4635 #:source-dir "plexus-compilers/plexus-compiler-javac/src/main/java"
4636 #:jdk ,icedtea-8
4637 #:tests? #f; depends on compiler-test -> maven-core -> ... -> this package.
4638 #:test-dir "plexus-compilers/plexus-compiler-javac/src/test"
4639 #:modules ((guix build ant-build-system)
4640 (guix build utils)
4641 (guix build java-utils)
4642 (sxml simple))
4643 #:phases
4644 (modify-phases %standard-phases
4645 ;; We cannot use java-plexus-component-metadata to generate the metadata
4646 ;; because it ultimately depends on this package.
4647 ;; Create it manually instead
4648 (add-before 'build 'create-metadata
4649 (lambda _
4650 (let* ((dir "build/classes/META-INF/plexus")
4651 (file (string-append dir "/components.xml")))
4652 (mkdir-p dir)
4653 (with-output-to-file file
4654 (lambda _
4655 (sxml->xml
4656 `(component-set
4657 (components
4658 (component
4659 (role "org.codehaus.plexus.compiler.Compiler")
4660 (role-hint "javac")
4661 (implementation "org.codehaus.plexus.compiler.javac.JavacCompiler")
4662 (isolated-realm "false"))))))))
4663 #t))
4664 (replace 'install
4665 (install-from-pom "plexus-compilers/plexus-compiler-javac/pom.xml")))))
4666 (propagated-inputs
4667 (list java-plexus-compiler-api java-plexus-utils
4668 java-plexus-container-default))
4669 (synopsis "Javac Compiler support for Plexus Compiler component")
4670 (description "This package contains the Javac Compiler support for Plexus
4671Compiler component.")))
4672
4673(define plexus-components-pom-1.1.20
4674 (package
4675 (name "plexus-components-pom-1.1.20")
4676 (version "1.1.20")
4677 (source (origin
4678 (method git-fetch)
4679 (uri (git-reference
4680 (url "https://github.com/codehaus-plexus/plexus-components")
4681 (commit (string-append "plexus-components-" version))))
4682 (file-name (git-file-name name version))
4683 (sha256
4684 (base32
4685 "1q254k95m9icyfsvaw8c226midg8v6v436wvivhv7im825mnp5yb"))))
4686 (build-system ant-build-system)
4687 (arguments
4688 `(#:tests? #f
4689 #:phases
4690 (modify-phases %standard-phases
4691 (delete 'configure)
4692 (delete 'build)
4693 (replace 'install
4694 (install-pom-file "pom.xml")))))
4695 (propagated-inputs
4696 `(("plexus-parent-pom" ,plexus-parent-pom-3.1)))
4697 (home-page "https://github.com/codehaus-plexus/plexus-components")
4698 (synopsis "Maven parent pom for plexus packages")
4699 (description "This package contains the parent pom for plexus component
4700packages.")
4701 (license license:asl2.0)))
4702
4703(define-public java-plexus-digest
4704 (package
4705 (name "java-plexus-digest")
4706 (version "1.2")
4707 (source (origin
4708 (method git-fetch)
4709 (uri (git-reference
4710 (url "https://github.com/codehaus-plexus/plexus-digest")
4711 (commit "2a52ad1bda8297fa0e287163d2fa37245ec6a430")))
4712 (file-name (git-file-name name version))
4713 (sha256
4714 (base32
4715 "19w5wxsliz8r42niry68qa665kvjsb8081dazg9vgd3pca72w07x"))))
4716 (build-system ant-build-system)
4717 (arguments
4718 `(#:jar-name "plexus-digest.jar"
4719 #:source-dir "src/main/java"
4720 #:tests? #f
4721 #:phases
4722 (modify-phases %standard-phases
4723 (replace 'install
4724 (install-from-pom "pom.xml")))))
4725 (propagated-inputs
4726 (list java-plexus-utils plexus-components-pom-1.1.20))
4727 (native-inputs
4728 (list java-junit))
4729 (home-page "https://github.com/codehaus-plexus/plexus-digest")
4730 (synopsis "Hash function utilities for Java")
4731 (description "This package is a plexus component that contains hash
4732function utilities.")
4733 (license license:asl2.0)))
4734
4735(define-public java-plexus-sec-dispatcher
4736 (package
4737 (name "java-plexus-sec-dispatcher")
4738 (version "2.0")
4739 (source (origin
4740 (method git-fetch)
4741 (uri (git-reference
4742 (url "https://github.com/codehaus-plexus/plexus-sec-dispatcher")
4743 (commit (string-append "plexus-sec-dispatcher-" version))))
4744 (sha256
4745 (base32
4746 "0665zcyxkv2knydxgv2dn64zvy1dx9j9af12ds9s64qmzd1rk6pk"))
4747 (file-name (git-file-name name version))))
4748 (arguments
4749 `(#:jar-name "plexus-sec-dispatcher.jar"
4750 #:source-dir "src/main/java"
4751 #:phases
4752 (modify-phases %standard-phases
4753 (add-before 'build 'generate-models
4754 (lambda* (#:key inputs #:allow-other-keys)
4755 (define (modello-single-mode file version mode)
4756 (invoke "java"
4757 "org.codehaus.modello.ModelloCli"
4758 file mode "src/main/java" version
4759 "false" "true"))
4760 (let ((file "src/main/mdo/settings-security.mdo"))
4761 (modello-single-mode file "1.0.0" "java")
4762 (modello-single-mode file "1.0.0" "xpp3-reader")
4763 (modello-single-mode file "1.0.0" "xpp3-writer"))
4764 #t))
4765 (add-before 'build 'generate-javax.inject.Named
4766 (lambda _
4767 (mkdir-p "build/classes/META-INF/sisu")
4768 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4769 (lambda _
4770 (display
4771 "org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher\n")))
4772 #t))
4773 (add-before 'check 'fix-paths
4774 (lambda _
4775 (copy-recursively "src/test/resources" "target")
4776 #t))
4777 (replace 'install (install-from-pom "pom.xml")))))
4778 (propagated-inputs
4779 (list java-plexus-utils java-plexus-cipher plexus-parent-pom-8))
4780 (native-inputs
4781 (list java-javax-inject
4782 java-modello-core
4783 ;; for modello
4784 java-plexus-container-default
4785 java-plexus-classworlds
4786 java-plexus-utils
4787 java-guava
4788 java-geronimo-xbean-reflect
4789 ;; modello plugins
4790 java-modello-plugins-java
4791 java-modello-plugins-xml
4792 java-modello-plugins-xpp3
4793 ;; for tests
4794 java-junit))
4795 (build-system ant-build-system)
4796 (home-page "https://github.com/sonatype/plexus-sec-dispatcher")
4797 (synopsis "Plexus Security Dispatcher Component")
4798 (description "This package is the Plexus Security Dispatcher Component.
4799This component decrypts a string passed to it.")
4800 (license license:asl2.0)))
4801
4802(define-public java-plexus-sec-dispatcher-1.4
4803 (package
4804 (inherit java-plexus-sec-dispatcher)
4805 (version "1.4")
4806 (source (origin
4807 (method git-fetch)
4808 (uri (git-reference
4809 (url "https://github.com/codehaus-plexus/plexus-sec-dispatcher")
4810 (commit (string-append "sec-dispatcher-" version))))
4811 (sha256
4812 (base32
4813 "1ng4yliy4cqpjr4fxxjbpwyk1wkch5f8vblm1kvwf328s4gibszs"))
4814 (file-name (git-file-name "java-plexus-sec-dispatcher" version))))
4815 (arguments
4816 (substitute-keyword-arguments (package-arguments java-plexus-sec-dispatcher)
4817 ((#:phases phases)
4818 `(modify-phases ,phases
4819 (delete 'generate-javax.inject.Named)
4820 (add-before 'build 'generate-components.xml
4821 (lambda _
4822 (mkdir-p "build/classes/META-INF/plexus")
4823 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
4824 (lambda _
4825 (display
4826 "<component-set>\n
4827 <components>\n
4828 <component>\n
4829 <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role>\n
4830 <role-hint>default</role-hint>\n
4831 <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation>\n
4832 <description></description>\n
4833 <requirements>\n
4834 <requirement>\n
4835 <role>org.sonatype.plexus.components.cipher.PlexusCipher</role>\n
4836 <field-name>_cipher</field-name>\n
4837 </requirement>\n
4838 <requirement>\n
4839 <role>org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor</role>\n
4840 <field-name>_decryptors</field-name>\n
4841 </requirement>\n
4842 </requirements>\n
4843 <configuration>\n
4844 <_configuration-file>~/.settings-security.xml</_configuration-file>\n
4845 </configuration>\n
4846 </component>\n
4847 </components>\n
4848</component-set>\n")))))))))
4849 (propagated-inputs
4850 (list java-plexus-utils java-plexus-cipher-1.7
4851 java-sonatype-spice-parent-pom-12))))
4852
4853(define-public java-plexus-cli
4854 (package
4855 (name "java-plexus-cli")
4856 (version "1.7")
4857 (source (origin
4858 (method git-fetch)
4859 (uri (git-reference
4860 (url "https://github.com/sonatype/plexus-cli")
4861 (commit "a776afa6bca84e5107bedb69440329cdb24ed645")))
4862 (file-name (string-append name "-" version))
4863 (sha256
4864 (base32
4865 "0xjrlay605rypv3zd7y24vlwf0039bil3n2cqw54r1ddpysq46vx"))))
4866 (build-system ant-build-system)
4867 (arguments
4868 `(#:jar-name "plexus-cli.jar"
4869 #:source-dir "src/main/java"
4870 #:jdk ,icedtea-8
4871 #:test-dir "src/test"))
4872 (inputs
4873 (list java-commons-cli java-plexus-container-default
4874 java-plexus-classworlds))
4875 (native-inputs
4876 (list java-plexus-utils java-junit java-guava))
4877 (home-page "https://codehaus-plexus.github.io/plexus-cli")
4878 (synopsis "CLI building library for plexus")
4879 (description "This package is a library to help creating CLI around
4880Plexus components.")
4881 (license license:asl2.0)))
4882
4883(define-public java-plexus-build-api
4884 (package
4885 (name "java-plexus-build-api")
4886 (version "0.0.7")
4887 (source (origin
4888 (method git-fetch)
4889 (uri (git-reference
4890 (url "https://github.com/codehaus-plexus/plexus-build-api")
4891 (commit (string-append "plexus-build-api-" version))))
4892 (file-name (git-file-name name version))
4893 (sha256
4894 (base32
4895 "1d5w6c58gkx30d51v7qwv1xrhc0ly76848gihmgshj19yf6yhca0"))))
4896 (build-system ant-build-system)
4897 (arguments
4898 `(#:jar-name "plexus-build-api.jar"
4899 #:source-dir "src/main/java"
4900 #:jdk ,icedtea-8
4901 #:tests? #f; FIXME: how to run the tests?
4902 #:phases
4903 (modify-phases %standard-phases
4904 (add-before 'build 'copy-resources
4905 (lambda _
4906 (copy-recursively "src/main/resources" "build/classes")
4907 (substitute* (find-files "build/classes")
4908 (("\\$\\{project.version\\}") ,version))
4909 #t))
4910 (add-before 'build 'generate-plexus-compontent
4911 (lambda _
4912 (mkdir-p "build/classes/META-INF/plexus")
4913 ;; This file is required for plexus to inject this package.
4914 ;; FIXME: how is it generated?
4915 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
4916 (lambda _
4917 (display
4918 "<component-set>\n
4919 <components>\n
4920 <component>\n
4921 <role>org.sonatype.plexus.build.incremental.BuildContext</role>\n
4922 <role-hint>default</role-hint>\n
4923 <implementation>org.sonatype.plexus.build.incremental.DefaultBuildContext</implementation>\n
4924 <description>Filesystem based non-incremental build context implementation\n
4925which behaves as if all files were just created.</description>\n
4926 </component>\n
4927 </components>\n
4928</component-set>\n")))
4929 #t))
4930 (replace 'install
4931 (install-from-pom "pom.xml")))))
4932 (inputs
4933 (list java-plexus-utils-3.2.1 java-plexus-container-default))
4934 (home-page "https://github.com/codehaus-plexus/plexus-build-api/")
4935 (synopsis "Base build API for maven")
4936 (description "This package contains the base build API for maven and
4937a default implementation of it. This API is about scanning files in a
4938project and determining what files need to be rebuilt.")
4939 (license license:asl2.0)))
4940
4941(define-public java-modello-core
4942 (package
4943 (name "java-modello-core")
4944 (version "1.11")
4945 (source (origin
4946 (method git-fetch)
4947 (uri (git-reference
4948 (url "https://github.com/codehaus-plexus/modello")
4949 (commit (string-append "modello-" version))))
4950 (file-name (git-file-name name version))
4951 (sha256
4952 (base32
4953 "18885sim7z9j3wy19i9083y9kc8l9xxl2px823a96q4rnqj5z8s2"))))
4954 (build-system ant-build-system)
4955 (arguments
4956 `(#:jar-name "modello-core.jar"
4957 #:source-dir "modello-core/src/main/java"
4958 #:test-dir "modello-core/src/test"
4959 #:main-class "org.codehaus.modello.ModelloCli"
4960 #:jdk ,icedtea-8
4961 #:phases
4962 (modify-phases %standard-phases
4963 (add-before 'build 'copy-resources
4964 (lambda _
4965 (mkdir-p "build/classes/META-INF/plexus")
4966 (copy-file "modello-core/src/main/resources/META-INF/plexus/components.xml"
4967 "build/classes/META-INF/plexus/components.xml")
4968 #t))
4969 (add-before 'check 'fix-tests
4970 (lambda _
4971 (with-directory-excursion "modello-core/src/test/java/org/codehaus"
4972 (substitute* '("modello/core/DefaultModelloCoreTest.java"
4973 "modello/core/io/ModelReaderTest.java")
4974 (("src/test") "modello-core/src/test")))
4975 #t)))))
4976 (propagated-inputs
4977 (list java-plexus-utils java-plexus-container-default
4978 java-plexus-build-api))
4979 (native-inputs
4980 (list java-junit java-plexus-classworlds java-geronimo-xbean-reflect
4981 java-guava))
4982 (home-page "https://codehaus-plexus.github.io/modello/")
4983 (synopsis "Framework for code generation from a simple model")
4984 (description "Modello is a framework for code generation from a simple model.
4985
4986Modello generates code from a simple model format: based on a plugin
4987architecture, various types of code and descriptors can be generated from the
4988single model, including Java POJOs, XML/JSON/YAML marshallers/unmarshallers,
4989XSD and documentation.")
4990 (license (list
4991 license:expat
4992 ;; Although this package uses only files licensed under expat,
4993 ;; other parts of the source are licensed under different
4994 ;; licenses. We include them to be inherited by other packages.
4995 license:asl2.0
4996 ;; Some files in modello-plugin-java are licensed under a
4997 ;; 5-clause BSD license.
4998 (license:non-copyleft
4999 (string-append "file:///modello-plugins/modello-plugin-java/"
5000 "src/main/java/org/codehaus/modello/plugin/"
5001 "java/javasource/JNaming.java"))))))
5002
5003(define-public java-modello-plugins-java
5004 (package
5005 (inherit java-modello-core)
5006 (name "java-modello-plugins-java")
5007 (arguments
5008 `(#:jar-name "modello-plugins-java.jar"
5009 #:source-dir "modello-plugins/modello-plugin-java/src/main/java"
5010 #:test-dir "modello-plugins/modello-plugin-java/src/test"
5011 #:jdk ,icedtea-8
5012 #:tests? #f; requires maven-model, which depends on this package
5013 #:phases
5014 (modify-phases %standard-phases
5015 (add-before 'build 'copy-resources
5016 (lambda _
5017 (mkdir-p "build/classes")
5018 (copy-recursively "modello-plugins/modello-plugin-java/src/main/resources"
5019 "build/classes")
5020 #t)))))
5021 (inputs
5022 (list java-modello-core))
5023 (synopsis "Modello Java Plugin")
5024 (description "Modello Java Plugin generates Java objects for the model.")))
5025
5026(define-public java-modello-plugins-xml
5027 (package
5028 (inherit java-modello-core)
5029 (name "java-modello-plugins-xml")
5030 (arguments
5031 `(#:jar-name "modello-plugins-xml.jar"
5032 #:source-dir "modello-plugins/modello-plugin-xml/src/main/java"
5033 #:test-dir "modello-plugins/modello-plugin-xml/src/test"
5034 #:jdk ,icedtea-8
5035 #:phases
5036 (modify-phases %standard-phases
5037 (add-before 'build 'copy-resources
5038 (lambda _
5039 (mkdir-p "build/classes")
5040 (copy-recursively
5041 "modello-plugins/modello-plugin-xml/src/main/resources"
5042 "build/classes")
5043 #t))
5044 (add-before 'check 'fix-paths
5045 (lambda _
5046 (with-directory-excursion "modello-plugins/modello-plugin-xml/src/test"
5047 (substitute*
5048 "java/org/codehaus/modello/plugins/xml/XmlModelloPluginTest.java"
5049 (("src/test") "modello-plugins/modello-plugin-xml/src/test")))
5050 #t)))))
5051 (propagated-inputs
5052 (list java-modello-core java-modello-plugins-java))
5053 (synopsis "Modello XML Plugin")
5054 (description "Modello XML Plugin contains shared code for every plugins
5055working on XML representation of the model.")))
5056
5057(define-public java-modello-test
5058 (package
5059 (inherit java-modello-core)
5060 (name "java-modello-test")
5061 (arguments
5062 `(#:jar-name "modello-test.jar"
5063 #:source-dir "modello-test/src/main/java"
5064 #:tests? #f; no tests
5065 #:jdk ,icedtea-8))
5066 (inputs
5067 (list java-plexus-utils java-plexus-compiler-api
5068 java-plexus-compiler-javac java-plexus-container-default))
5069 (synopsis "Modello test package")
5070 (description "The modello test package contains the basis to create
5071Modello generator unit-tests, including sample models and xml files to test
5072every feature for every plugin.")))
5073
5074(define-public java-modello-plugins-xpp3
5075 (package
5076 (inherit java-modello-core)
5077 (name "java-modello-plugins-xpp3")
5078 (arguments
5079 `(#:jar-name "modello-plugins-xpp3.jar"
5080 #:source-dir "modello-plugins/modello-plugin-xpp3/src/main/java"
5081 #:test-dir "modello-plugins/modello-plugin-xpp3/src/test"
5082 ;; One of the test dependencies is maven-model which depends on this package.
5083 #:tests? #f
5084 #:jdk ,icedtea-8
5085 #:phases
5086 (modify-phases %standard-phases
5087 (add-before 'build 'copy-resources
5088 (lambda _
5089 (mkdir-p "build/classes")
5090 (copy-recursively "modello-plugins/modello-plugin-xpp3/src/main/resources"
5091 "build/classes")
5092 #t)))))
5093 (propagated-inputs
5094 (list java-modello-core java-modello-plugins-java
5095 java-modello-plugins-xml))
5096 (native-inputs
5097 (modify-inputs (package-native-inputs java-modello-core)
5098 (prepend java-xmlunit java-modello-test)))
5099 (synopsis "Modello XPP3 Plugin")
5100 (description "The modello XPP3 plugin generates XML readers and writers based
5101on the XPP3 API (XML Pull Parser).")))
5102
5103(define-public java-ow-util-ant-tasks
5104 (package
5105 (name "java-ow-util-ant-tasks")
5106 (version "1.3.2")
5107 (source (origin
5108 (method url-fetch)
5109 (uri (string-append
5110 "mirror://debian/pool/main/o/ow-util-ant-tasks/"
5111 "ow-util-ant-tasks_" version ".orig.tar.gz"))
5112 (sha256
5113 (base32
5114 "1y5ln1g36aligwcadqksdj18i5ghqnxn523wjbzy2zyd7w58fgy5"))))
5115 (build-system ant-build-system)
5116 (arguments
5117 `(#:jar-name "ow-util-ant-tasks.jar"
5118 #:tests? #f; no tests
5119 #:phases
5120 (modify-phases %standard-phases
5121 (add-before 'build 'delete-cyclic-dependency
5122 (lambda _
5123 ;; This file depends on asm-3, which depends on this package
5124 (delete-file "src/org/objectweb/util/ant/DependencyAnalyzer.java")
5125 ;; This file depends on xalan
5126 (delete-file "src/org/objectweb/util/ant/Xalan2Liaison.java")))
5127 (add-before 'build 'fix-new-ant
5128 (lambda _
5129 (substitute* "src/org/objectweb/util/ant/MultipleCopy.java"
5130 ((", destFile.getAbsolutePath\\(\\)")
5131 ", new String[] { destFile.getAbsolutePath() }")))))))
5132 (home-page "https://packages.debian.org/source/stretch/ow-util-ant-tasks")
5133 (synopsis "Replacement for base ant tasks")
5134 (description "This library is used in the legacy build process of several
5135key frameworks developed by ObjectWeb, among them legacy versions of the
5136ObjectWeb ASM bytecode manipulation framework.")
5137 (license license:lgpl2.0+)))
5138
5139(define-public java-asm
5140 (package
5141 (name "java-asm")
5142 (version "6.0")
5143 (source (origin
5144 (method url-fetch)
5145 (uri (string-append "https://download.forge.ow2.org/asm/"
5146 "asm-" version ".tar.gz"))
5147 (sha256
5148 (base32
5149 "115l5pqblirdkmzi32dxx7gbcm4jy0s14y5wircr6h8jdr9aix00"))))
5150 (build-system ant-build-system)
5151 (arguments
5152 `(#:build-target "compile"
5153 ;; The tests require an old version of Janino, which no longer compiles
5154 ;; with the JDK7.
5155 #:tests? #f
5156 #:make-flags
5157 (list
5158 ;; We don't need these extra ant tasks, but the build system asks us to
5159 ;; provide a path anyway.
5160 "-Dobjectweb.ant.tasks.path=dummy-path"
5161 ;; The java-aqute.bndlib JAR file will be put onto the classpath and
5162 ;; used during the build automatically by ant-build-system, but
5163 ;; java-asm's build.xml fails unless we provide something here.
5164 "-Dbiz.aQute.bnd.path=dummy-path")
5165 #:phases
5166 (modify-phases %standard-phases
5167 (add-before 'build 'remove-bnd-dependency
5168 (lambda _
5169 ;; This file is the only one to require bnd, and is not needed
5170 ;; because we don't build a bundle.
5171 (delete-file "src/org/objectweb/asm/tools/ModuleInfoBndPlugin.java")
5172 #t))
5173 (add-before 'install 'build-jars
5174 (lambda* (#:key make-flags #:allow-other-keys)
5175 ;; We cannot use the "jar" target because it depends on a couple
5176 ;; of unpackaged, complicated tools.
5177 (mkdir "dist")
5178 (invoke "jar"
5179 "-cf" (string-append "dist/asm-" ,version ".jar")
5180 "-C" "output/build/tmp" ".")))
5181 (add-before 'install 'fix-pom
5182 (lambda _
5183 (substitute* (find-files "archive" "\\.pom$")
5184 (("@product.artifact@") ,version))
5185 #t))
5186 (add-before 'install 'install-parent
5187 (install-pom-file "archive/asm-parent.pom"))
5188 (replace 'install
5189 (install-from-pom "archive/asm.pom")))))
5190 (native-inputs
5191 (list java-junit))
5192 (propagated-inputs
5193 (list java-org-ow2-parent-pom-1.3))
5194 (home-page "https://asm.ow2.io/")
5195 (synopsis "Very small and fast Java bytecode manipulation framework")
5196 (description "ASM is an all purpose Java bytecode manipulation and
5197analysis framework. It can be used to modify existing classes or dynamically
5198generate classes, directly in binary form. The provided common
5199transformations and analysis algorithms allow easily assembling custom
5200complex transformations and code analysis tools.")
5201 (license license:bsd-3)))
5202
5203(define-public java-org-ow2-parent-pom-1.3
5204 (package
5205 (name "java-org-ow2-parent-pom")
5206 (version "1.3")
5207 (source (origin
5208 (method url-fetch)
5209 (uri "https://repo1.maven.org/maven2/org/ow2/ow2/1.3/ow2-1.3.pom")
5210 (sha256
5211 (base32
5212 "1yr8hfx8gffpppa4ii6cvrsq029a6x8hzy7nsavxhs60s9kmq8ai"))))
5213 (build-system ant-build-system)
5214 (arguments
5215 `(#:tests? #f
5216 #:phases
5217 (modify-phases %standard-phases
5218 (delete 'unpack)
5219 (delete 'build)
5220 (delete 'configure)
5221 (replace 'install
5222 ,#~(install-pom-file #$source)))))
5223 (home-page "https://ow2.org")
5224 (synopsis "Ow2.org parent pom")
5225 (description "This package contains the parent pom for projects from ow2.org,
5226including java-asm.")
5227 (properties '((hidden? . #t)))
5228 (license license:lgpl2.1+)))
5229
5230(define-public java-asm-bootstrap
5231 (package
5232 (inherit java-asm)
5233 (name "java-asm-bootstrap")
5234 (properties '((hidden? . #t)))
5235 (arguments
5236 (substitute-keyword-arguments (package-arguments java-asm)
5237 ((#:tests? _) #f)))
5238 (native-inputs `())))
5239
5240(define-public java-asm-3
5241 (package
5242 (inherit java-asm)
5243 (version "3.1")
5244 (source (origin
5245 (method git-fetch)
5246 (uri (git-reference
5247 (url "https://gitlab.ow2.org/asm/asm")
5248 (commit "ASM_3_1")))
5249 (file-name (git-file-name "java-asm" version))
5250 (sha256
5251 (base32
5252 "0xbyf2sl8j6mrvfpg2da0vjdp906rac62l66gkk82x5cn3vc30h4"))
5253 (modules '((guix build utils)))
5254 (snippet `(for-each delete-file (find-files "." "\\.jar$")))))
5255 (arguments
5256 `(#:build-target "jar"
5257 #:test-target "test"
5258 #:tests? #f; require legacy test software
5259 #:phases
5260 (modify-phases %standard-phases
5261 (replace 'install (install-jars "output/dist"))
5262 (delete 'generate-jar-indices))))
5263 (native-inputs (list java-ow-util-ant-tasks))))
5264
5265(define-public java-asm-8
5266 (package
5267 (inherit java-asm)
5268 (version "8.0.1")
5269 (source (origin
5270 (method git-fetch)
5271 (uri (git-reference
5272 (url "https://gitlab.ow2.org/asm/asm")
5273 (commit (string-append
5274 "ASM_" (string-join (string-split version #\.)
5275 "_")))))
5276 (file-name (git-file-name "java-asm" version))
5277 (sha256
5278 (base32
5279 "1s6j27zc1i76gh891w2g48b1c3abp9w8zp5j54yb1vm5h8djkd69"))))
5280 (arguments
5281 `(#:jar-name "asm8.jar"
5282 #:source-dir "asm/src/main/java"
5283 #:test-dir "asm/src/test"
5284 ;; tests depend on junit5
5285 #:tests? #f))
5286 (propagated-inputs '())
5287 (native-inputs '())))
5288
5289(define-public java-asm-tree-8
5290 (package
5291 (inherit java-asm-8)
5292 (name "java-asm-tree")
5293 (arguments
5294 `(#:jar-name "asm-tree.jar"
5295 #:source-dir "asm-tree/src/main/java"
5296 #:test-dir "asm-tree/src/test"
5297 ;; tests depend on junit5
5298 #:tests? #f))
5299 (inputs
5300 (list java-asm-8))))
5301
5302(define-public java-asm-analysis-8
5303 (package
5304 (inherit java-asm-8)
5305 (name "java-asm-analysis")
5306 (arguments
5307 `(#:jar-name "asm-analysis.jar"
5308 #:source-dir "asm-analysis/src/main/java"
5309 #:test-dir "asm-analysis/src/test"
5310 ;; tests depend on junit5
5311 #:tests? #f))
5312 (inputs
5313 (list java-asm-8 java-asm-tree-8))))
5314
5315(define-public java-asm-util-8
5316 (package
5317 (inherit java-asm-8)
5318 (name "java-asm-util")
5319 (arguments
5320 `(#:jar-name "asm-util8.jar"
5321 #:source-dir "asm-util/src/main/java"
5322 #:test-dir "asm-util/src/test"
5323 ;; tests depend on junit5
5324 #:tests? #f))
5325 (inputs
5326 (list java-asm-8 java-asm-analysis-8 java-asm-tree-8))))
5327
5328(define-public java-asm-commons-8
5329 (package
5330 (inherit java-asm-8)
5331 (name "java-asm-commons")
5332 (arguments
5333 (list #:jar-name "asm-commons8.jar"
5334 #:source-dir "asm-commons/src/main/java"
5335 #:test-dir "asm-commons/src/test"
5336 ;; tests depend on junit5
5337 #:tests? #f))
5338 (inputs (list java-asm-8 java-asm-analysis-8 java-asm-tree-8))))
5339
5340(define-public java-asm-9
5341 (package
5342 (inherit java-asm)
5343 (version "9.4")
5344 (source (origin
5345 (method git-fetch)
5346 (uri (git-reference
5347 (url "https://gitlab.ow2.org/asm/asm")
5348 (commit (string-append
5349 "ASM_" (string-join (string-split version #\.)
5350 "_")))))
5351 (file-name (git-file-name "java-asm" version))
5352 (sha256
5353 (base32
5354 "0c00m638skr5md1p6y1c2xn11kj5w6sjapyvwp9mh70rw095bwzk"))))
5355 (arguments
5356 `(#:jar-name "asm9.jar"
5357 #:source-dir "asm/src/main/java"
5358 #:test-dir "asm/src/test"
5359 ;; tests depend on junit5
5360 #:tests? #f))
5361 (propagated-inputs '())
5362 (native-inputs '())))
5363
5364(define-public java-asm-tree-9
5365 (package
5366 (inherit java-asm-9)
5367 (name "java-asm-tree")
5368 (arguments
5369 `(#:jar-name "asm-tree.jar"
5370 #:source-dir "asm-tree/src/main/java"
5371 #:test-dir "asm-tree/src/test"
5372 ;; tests depend on junit5
5373 #:tests? #f))
5374 (inputs
5375 (list java-asm-9))))
5376
5377(define-public java-asm-analysis-9
5378 (package
5379 (inherit java-asm-9)
5380 (name "java-asm-analysis")
5381 (arguments
5382 `(#:jar-name "asm-analysis.jar"
5383 #:source-dir "asm-analysis/src/main/java"
5384 #:test-dir "asm-analysis/src/test"
5385 ;; tests depend on junit5
5386 #:tests? #f))
5387 (inputs
5388 (list java-asm-9 java-asm-tree-9))))
5389
5390(define-public java-asm-util-9
5391 (package
5392 (inherit java-asm-9)
5393 (name "java-asm-util")
5394 (arguments
5395 `(#:jar-name "asm-util8.jar"
5396 #:source-dir "asm-util/src/main/java"
5397 #:test-dir "asm-util/src/test"
5398 ;; tests depend on junit5
5399 #:tests? #f))
5400 (inputs
5401 (list java-asm-9 java-asm-analysis-9 java-asm-tree-9))))
5402
5403(define-public java-asm-commons-9
5404 (package
5405 (inherit java-asm-9)
5406 (name "java-asm-commons")
5407 (arguments
5408 (list #:jar-name "asm-commons8.jar"
5409 #:source-dir "asm-commons/src/main/java"
5410 #:test-dir "asm-commons/src/test"
5411 ;; tests depend on junit5
5412 #:tests? #f))
5413 (inputs (list java-asm-9 java-asm-analysis-9 java-asm-tree-9))))
5414
5415(define-public java-cglib
5416 (package
5417 (name "java-cglib")
5418 (version "3.3.0")
5419 (source
5420 (origin
5421 (method git-fetch)
5422 (uri (git-reference
5423 (url "https://github.com/cglib/cglib")
5424 (commit (string-append
5425 "RELEASE_"
5426 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
5427 version)))))
5428 (file-name (git-file-name name version))
5429 (sha256
5430 (base32 "1lnscamc6bnhh7jgij5garxagp3zn2jp4cbq0rsn4xr3l0cnd014"))))
5431 (build-system ant-build-system)
5432 (arguments
5433 `(;; FIXME: tests fail because junit runs
5434 ;; "net.sf.cglib.transform.AbstractTransformTest", which does not seem
5435 ;; to describe a test at all.
5436 #:tests? #f
5437 #:jar-name "cglib.jar"
5438 #:phases
5439 (modify-phases %standard-phases
5440 (add-after 'unpack 'chdir
5441 (lambda _ (chdir "cglib") #t)))))
5442 (native-inputs (list java-junit))
5443 (propagated-inputs (list java-asm-8))
5444 (home-page "https://github.com/cglib/cglib/")
5445 (synopsis "Java byte code generation library")
5446 (description "The byte code generation library CGLIB is a high level API
5447to generate and transform Java byte code.")
5448 (license license:asl2.0)))
5449
5450(define-public java-objenesis
5451 (package
5452 (name "java-objenesis")
5453 (version "3.3")
5454 (source (origin
5455 (method git-fetch)
5456 (uri (git-reference
5457 (url "https://github.com/easymock/objenesis")
5458 (commit version)))
5459 (file-name (git-file-name name version))
5460 (sha256
5461 (base32
5462 "1brlcn536p4s1v1f3vzxhr38lvyhc33wjrbj2x06kdrd8agy90cr"))))
5463 (build-system ant-build-system)
5464 (arguments
5465 `(#:tests? #f; require junit-5
5466 #:jar-name "objenesis.jar"
5467 #:source-dir "main/src/main/java"
5468 #:test-dir "main/src/test/"))
5469 (native-inputs
5470 (list java-junit java-hamcrest-core))
5471 (home-page "http://objenesis.org/")
5472 (synopsis "Bypass the constructor when creating an object")
5473 (description "Objenesis is a small Java library that serves one purpose:
5474to instantiate a new object of a particular class. It is common to see
5475restrictions in libraries stating that classes must require a default
5476constructor. Objenesis aims to overcome these restrictions by bypassing the
5477constructor on object instantiation.")
5478 (license license:asl2.0)))
5479
5480(define-public java-easymock
5481 (package
5482 (name "java-easymock")
5483 (version "3.4")
5484 (source (origin
5485 (method git-fetch)
5486 (uri (git-reference
5487 (url "https://github.com/easymock/easymock/")
5488 (commit (string-append "easymock-" version))))
5489 (file-name (git-file-name name version))
5490 (sha256
5491 (base32
5492 "02vybm8hc0i0n9sp2f2iiqn54zwqhq835f76wc6b2m7819z5a8dq"))))
5493 (build-system ant-build-system)
5494 (arguments
5495 `(#:jar-name "easymock.jar"
5496 #:source-dir "core/src/main"
5497 #:test-dir "core/src/test"
5498 #:phases
5499 (modify-phases %standard-phases
5500 ;; FIXME: Android support requires the following packages to be
5501 ;; available: com.google.dexmaker.stock.ProxyBuilder
5502 (add-after 'unpack 'delete-android-support
5503 (lambda _
5504 (with-directory-excursion "core/src/main/java/org/easymock/internal"
5505 (substitute* "MocksControl.java"
5506 (("AndroidSupport.isAndroid\\(\\)") "false")
5507 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
5508 (delete-file "AndroidClassProxyFactory.java"))
5509 #t))
5510 (add-after 'unpack 'delete-broken-tests
5511 (lambda _
5512 (with-directory-excursion "core/src/test/java/org/easymock"
5513 ;; This test depends on dexmaker.
5514 (delete-file "tests2/ClassExtensionHelperTest.java")
5515
5516 ;; This is not a test.
5517 (delete-file "tests/BaseEasyMockRunnerTest.java")
5518
5519 ;; This test should be executed with a different runner...
5520 (delete-file "tests2/EasyMockAnnotationsTest.java")
5521 ;; ...but deleting it means that we also have to delete these
5522 ;; dependent files.
5523 (delete-file "tests2/EasyMockRunnerTest.java")
5524 (delete-file "tests2/EasyMockRuleTest.java")
5525
5526 ;; This test fails because the file "easymock.properties" does
5527 ;; not exist.
5528 (delete-file "tests2/EasyMockPropertiesTest.java"))
5529 #t)))))
5530 (inputs
5531 (list java-cglib java-objenesis))
5532 (native-inputs
5533 (list java-junit java-hamcrest-core))
5534 (home-page "https://easymock.org/")
5535 (synopsis "Java library providing mock objects for unit tests")
5536 (description "EasyMock is a Java library that provides an easy way to use
5537mock objects in unit testing.")
5538 (license license:asl2.0)))
5539
5540(define-public java-easymock-3.2
5541 (package
5542 (inherit java-easymock)
5543 (name "java-easymock")
5544 (version "3.2")
5545 (source (origin
5546 (method git-fetch)
5547 (uri (git-reference
5548 (url "https://github.com/easymock/easymock/")
5549 (commit (string-append "easymock-" version))))
5550 (file-name (git-file-name name version))
5551 (sha256
5552 (base32
5553 "0cn6qqa261mhk9mwxrsz39lkkknfv2h7iprr5zw7wpz9p96dwgv4"))))
5554 (arguments
5555 (list #:jar-name "easymock.jar"
5556 #:source-dir "easymock/src/main"
5557 #:test-dir "easymock/src/test"
5558 #:phases
5559 #~(modify-phases %standard-phases
5560 (add-after 'unpack 'delete-android-support
5561 (lambda _
5562 (with-directory-excursion "easymock/src/main/java/org/easymock/internal"
5563 (substitute* "MocksControl.java"
5564 (("AndroidSupport.isAndroid\\(\\)") "false")
5565 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
5566 (delete-file "AndroidClassProxyFactory.java"))))
5567 (add-after 'unpack 'delete-broken-tests
5568 (lambda _
5569 (with-directory-excursion "easymock/src/test/java/org/easymock"
5570 ;; This test depends on dexmaker.
5571 (delete-file "tests2/ClassExtensionHelperTest.java")
5572 ;; This is not a test.
5573 (delete-file "tests/BaseEasyMockRunnerTest.java")
5574 ;; ...but deleting it means that we also have to delete these
5575 ;; dependent files.
5576 (delete-file "tests2/EasyMockRunnerTest.java")
5577 ;; This test fails because the file "easymock.properties" does
5578 ;; not exist.
5579 (delete-file "tests2/EasyMockPropertiesTest.java")))))))))
5580
5581(define-public java-easymock-class-extension
5582 (package
5583 (inherit java-easymock-3.2)
5584 (name "java-easymock-class-extension")
5585 (build-system ant-build-system)
5586 (arguments
5587 (list #:jar-name "easymock-class-extensions.jar"
5588 #:source-dir "easymock-classextension/src/main/java"
5589 #:test-dir "easymock-classextension/src/test"))
5590 (inputs (list java-asm-8
5591 java-easymock-3.2
5592 java-cglib
5593 java-objenesis))
5594 (native-inputs
5595 (list java-junit java-hamcrest-core))
5596 (home-page "https://easymock.org/")
5597 (synopsis "Easymock extension to mock classes")
5598 (description "This package provides an extension to earlier versions of
5599easymock that allows mocking classes.")
5600 (license license:asl2.0)))
5601
5602(define-public java-jmock-1
5603 (package
5604 (name "java-jmock")
5605 (version "1.2.0")
5606 (source (origin
5607 (method git-fetch)
5608 (uri (git-reference
5609 (url "https://github.com/jmock-developers/jmock-library")
5610 (commit version)))
5611 (file-name (git-file-name name version))
5612 (sha256
5613 (base32
5614 "0lkga995xd9b9mmzxmcd301hlw83p1h78nibh7djlx7wydscr85z"))))
5615 (build-system ant-build-system)
5616 (arguments
5617 `(#:build-target "jars"
5618 #:test-target "run.tests"
5619 #:phases
5620 (modify-phases %standard-phases
5621 (replace 'install (install-jars "build")))))
5622 (home-page "http://jmock.org/")
5623 (synopsis "Mock object library for test-driven development")
5624 (description "JMock is a library that supports test-driven development of
5625Java code with mock objects. Mock objects help you design and test the
5626interactions between the objects in your programs.
5627
5628The jMock library
5629
5630@itemize
5631@item makes it quick and easy to define mock objects
5632@item lets you precisely specify the interactions between
5633 your objects, reducing the brittleness of your tests
5634@item plugs into your favourite test framework
5635@item is easy to extend.
5636@end itemize\n")
5637 (license license:bsd-3)))
5638
5639(define-public java-jmock
5640 (package
5641 (inherit java-jmock-1)
5642 (name "java-jmock")
5643 (version "2.8.2")
5644 (source (origin
5645 (method git-fetch)
5646 (uri (git-reference
5647 (url "https://github.com/jmock-developers/jmock-library")
5648 (commit version)))
5649 (file-name (git-file-name name version))
5650 (sha256
5651 (base32
5652 "12b7l22g3nrjvf2dzcw3z03fpd2chrgp0d8xkvn8w55rwb57pax6"))))
5653 (inputs
5654 (list java-hamcrest-all java-bsh java-junit))
5655 (native-inputs
5656 `(("cglib" ,java-cglib)))
5657 (arguments
5658 `(#:jar-name "java-jmock.jar"
5659 #:source-dir "jmock/src/main/java"
5660 #:test-dir "jmock/src/test"))))
5661
5662(define-public java-jmock-junit4
5663 (package
5664 (inherit java-jmock)
5665 (name "java-jmock-junit4")
5666 (arguments
5667 `(#:jar-name "java-jmock-junit4.jar"
5668 #:source-dir "jmock-junit4/src/main/java"
5669 #:test-dir "jmock-junit4/src/test"))
5670 (inputs
5671 `(("java-hamcrest-all" ,java-hamcrest-all)
5672 ("java-bsh" ,java-bsh)
5673 ("java-jmock" ,java-jmock)
5674 ("java-jumit" ,java-junit)))))
5675
5676(define-public java-jmock-legacy
5677 (package
5678 (inherit java-jmock)
5679 (name "java-jmock-legacy")
5680 (arguments
5681 `(#:jar-name "java-jmock-legacy.jar"
5682 #:source-dir "jmock-legacy/src/main/java"
5683 #:test-dir "jmock-legacy/src/test"
5684 #:phases
5685 (modify-phases %standard-phases
5686 (add-before 'check 'copy-tests
5687 (lambda _
5688 ;; This file is a dependancy of some tests
5689 (let ((file "org/jmock/test/acceptance/PackageProtectedType.java"))
5690 (copy-file (string-append "jmock/src/test/java/" file)
5691 (string-append "jmock-legacy/src/test/java/" file))
5692 #t))))))
5693 (inputs
5694 (list java-hamcrest-all
5695 java-objenesis
5696 java-cglib
5697 java-jmock
5698 java-bsh
5699 java-junit))
5700 (native-inputs
5701 (list java-jmock-junit4))))
5702
5703(define-public java-hamcrest-all
5704 (package (inherit java-hamcrest-core)
5705 (name "java-hamcrest-all")
5706 (properties `((superseded . ,java-hamcrest)))
5707 (arguments
5708 `(#:jdk ,icedtea-8
5709 ,@(substitute-keyword-arguments (package-arguments java-hamcrest-core)
5710 ((#:build-target _) "bigjar")
5711 ((#:phases phases)
5712 `(modify-phases ,phases
5713 ;; Some build targets override the classpath, so we need to patch
5714 ;; the build.xml to ensure that required dependencies are on the
5715 ;; classpath.
5716 (add-after 'unpack 'patch-classpath-for-integration
5717 (lambda* (#:key inputs #:allow-other-keys)
5718 (substitute* "build.xml"
5719 ((" build/hamcrest-library-\\$\\{version\\}.jar" line)
5720 (string-join
5721 (cons line
5722 (append
5723 (find-files (assoc-ref inputs "java-junit") "\\.jar$")
5724 (find-files (assoc-ref inputs "java-jmock") "\\.jar$")
5725 (find-files (assoc-ref inputs "java-easymock") "\\.jar$")))
5726 ";"))
5727 (("build/hamcrest-core-\\$\\{version\\}\\.jar")
5728 (car (find-files (assoc-ref inputs "java-hamcrest-core")
5729 "jar$"))))
5730 #t))
5731 (replace 'install
5732 (lambda* (#:key outputs #:allow-other-keys)
5733 (let* ((target (string-append (assoc-ref outputs "out")
5734 "/share/java/"))
5735 (version-suffix
5736 ,(string-append
5737 "-" (package-version java-hamcrest-core) ".jar"))
5738 (install-without-version-suffix
5739 (lambda (jar)
5740 (copy-file jar
5741 (string-append target
5742 (basename jar version-suffix)
5743 ".jar")))))
5744 (mkdir-p target)
5745 (for-each
5746 install-without-version-suffix
5747 (find-files "build"
5748 (lambda (name _)
5749 (and (string-suffix? ".jar" name)
5750 (not (string-suffix? "-sources.jar" name)))))))
5751 #t)))))))
5752 (inputs
5753 (modify-inputs (package-inputs java-hamcrest-core)
5754 (prepend java-junit
5755 java-jmock-1
5756 ;; This is necessary because of what seems to be a race condition.
5757 ;; This package would sometimes fail to build because hamcrest-core.jar
5758 ;; could not be found, even though it is built as part of this package.
5759 ;; Adding java-hamcrest-core appears to fix this problem. See
5760 ;; https://debbugs.gnu.org/31390 for more information.
5761 java-hamcrest-core
5762 java-easymock)))))
5763
5764(define-public java-jopt-simple
5765 (package
5766 (name "java-jopt-simple")
5767 (version "5.0.3")
5768 (source (origin
5769 (method url-fetch)
5770 (uri (string-append "https://repo1.maven.org/maven2/"
5771 "net/sf/jopt-simple/jopt-simple/"
5772 version "/jopt-simple-"
5773 version "-sources.jar"))
5774 (sha256
5775 (base32
5776 "1v8bzmwmw6qq20gm42xyay6vrd567dra4vqwhgjnqqjz1gs9f8qa"))))
5777 (build-system ant-build-system)
5778 (arguments
5779 `(#:tests? #f ; there are no tests
5780 #:jar-name "jopt-simple.jar"
5781 #:phases
5782 (modify-phases %standard-phases
5783 (add-before 'install 'create-pom
5784 (generate-pom.xml "pom.xml" "net.sf.jopt-simple" "jopt-simple" ,version))
5785 (replace 'install
5786 (install-from-pom "pom.xml")))))
5787 (home-page "https://jopt-simple.github.io/jopt-simple/")
5788 (synopsis "Java library for parsing command line options")
5789 (description "JOpt Simple is a Java library for parsing command line
5790options, such as those you might pass to an invocation of @code{javac}. In
5791the interest of striving for simplicity, as closely as possible JOpt Simple
5792attempts to honor the command line option syntaxes of POSIX @code{getopt} and
5793GNU @code{getopt_long}. It also aims to make option parser configuration and
5794retrieval of options and their arguments simple and expressive, without being
5795overly clever.")
5796 (license license:expat)))
5797
5798;; Required by jmh
5799(define-public java-jopt-simple-4
5800 (package
5801 (inherit java-jopt-simple)
5802 (version "4.6")
5803 (source (origin
5804 (method url-fetch)
5805 (uri (string-append "https://repo1.maven.org/maven2/"
5806 "net/sf/jopt-simple/jopt-simple/"
5807 version "/jopt-simple-"
5808 version "-sources.jar"))
5809 (sha256
5810 (base32
5811 "0ny82zczxkn201ld0b7rps0ifzjhfs8m1ncdmy1f50145ciszkpd"))))
5812 (arguments
5813 (substitute-keyword-arguments (package-arguments java-jopt-simple)
5814 ((#:phases phases)
5815 `(modify-phases ,phases
5816 (replace 'create-pom
5817 (generate-pom.xml "pom.xml" "net.sf.jopt-simple" "jopt-simple"
5818 ,version))))))))
5819
5820(define-public java-commons-math3
5821 (package
5822 (name "java-commons-math3")
5823 (version "3.6.1")
5824 (source (origin
5825 (method url-fetch)
5826 (uri (string-append "mirror://apache/commons/math/source/"
5827 "commons-math3-" version "-src.tar.gz"))
5828 (sha256
5829 (base32
5830 "19l6yp44qc5g7wg816nbn5z3zq3xxzwimvbm4a8pczgvpi4i85s6"))))
5831 (build-system ant-build-system)
5832 (arguments
5833 `(#:build-target "jar"
5834 #:test-target "test"
5835 #:make-flags
5836 ,#~(let ((hamcrest #$(this-package-native-input "java-hamcrest-core"))
5837 (junit #$(this-package-native-input "java-junit")))
5838 (list (string-append "-Djunit.jar="
5839 (car (find-files junit "jar$")))
5840 (string-append "-Dhamcrest.jar="
5841 (car (find-files hamcrest ".*.jar$")))))
5842 #:phases
5843 (modify-phases %standard-phases
5844 ;; We want to build the jar in the build phase and run the tests
5845 ;; later in a separate phase.
5846 (add-after 'unpack 'untangle-targets
5847 (lambda _
5848 (substitute* "build.xml"
5849 (("name=\"jar\" depends=\"test\"")
5850 "name=\"jar\" depends=\"compile\""))))
5851 ;; There is no install target.
5852 (replace 'install
5853 (install-from-pom "pom.xml")))))
5854 (native-inputs
5855 (list java-junit java-hamcrest-core))
5856 (home-page "https://commons.apache.org/math/")
5857 (synopsis "Apache Commons mathematics library")
5858 (description "Commons Math is a library of lightweight, self-contained
5859mathematics and statistics components addressing the most common problems not
5860available in the Java programming language or Commons Lang.")
5861 (license license:asl2.0)))
5862
5863(define-public java-jmh
5864 (package
5865 (name "java-jmh")
5866 (version "1.32")
5867 (source (origin
5868 (method git-fetch)
5869 (uri (git-reference
5870 (url "https://github.com/openjdk/jmh")
5871 (commit version)))
5872 (file-name (git-file-name name version))
5873 (sha256
5874 (base32
5875 "0i7fa7l3gdqkkgz5ddayp6m46dgbj9rqlz35xffrcbyiz3gpljy0"))))
5876 (build-system maven-build-system)
5877 (arguments
5878 `(#:exclude
5879 (("org.apache.maven.plugins" .
5880 ("maven-source-plugin" "maven-archetype-plugin" "maven-shade-plugin"
5881 "maven-site-plugin" "maven-javadoc-plugin" "maven-eclipse-plugin"))
5882 ("com.mycila.maven-license-plugin" . ("maven-license-plugin"))
5883 ("org.apache.maven.wagon" . ("wagon-ssh")))
5884 #:maven-plugins
5885 (("maven-enforcer-plugin" ,maven-enforcer-plugin)
5886 ,@(default-maven-plugins))
5887 #:phases
5888 (modify-phases %standard-phases
5889 (add-after 'unpack 'remove-unnecessary
5890 (lambda _
5891 ;; requires org.apache.maven.archetype:archetype-packaging.
5892 ;; Its subprojects also require groovy, kotlin and scala,
5893 ;; respectively.
5894 (delete-file-recursively "jmh-archetypes"))))))
5895 (propagated-inputs
5896 (list java-jopt-simple-4 java-commons-math3))
5897 (native-inputs
5898 (list java-junit java-hamcrest-core))
5899 (home-page "https://openjdk.java.net/projects/code-tools/jmh/")
5900 (synopsis "Benchmark harness for the JVM")
5901 (description "JMH is a Java harness for building, running, and analysing
5902nano/micro/milli/macro benchmarks written in Java and other languages
5903targeting the JVM.")
5904 ;; GPLv2 only
5905 (license license:gpl2)))
5906
5907(define-public java-commons-collections4
5908 (package
5909 (name "java-commons-collections4")
5910 (version "4.1")
5911 (source (origin
5912 (method url-fetch)
5913 (uri (string-append "mirror://apache/commons/collections/source/"
5914 "commons-collections4-" version "-src.tar.gz"))
5915 (sha256
5916 (base32
5917 "1krfhvggympq4avk7gh6qafzf6b9ip6r1m4lmacikyx04039m0wl"))))
5918 (build-system ant-build-system)
5919 (arguments
5920 `(#:test-target "test"
5921 #:make-flags
5922 ,#~(let ((hamcrest #$(this-package-native-input "java-hamcrest-core"))
5923 (junit #$(this-package-native-input "java-junit"))
5924 (easymock #$(this-package-native-input "java-easymock")))
5925 (list (string-append "-Djunit.jar="
5926 (car (find-files junit "jar$")))
5927 (string-append "-Dhamcrest.jar="
5928 (car (find-files hamcrest "jar$")))
5929 (string-append "-Deasymock.jar=" easymock
5930 "/share/java/easymock.jar")))
5931 #:phases
5932 (modify-phases %standard-phases
5933 (replace 'install
5934 (install-jars "target")))))
5935 (native-inputs
5936 (list java-junit java-hamcrest-core java-easymock))
5937 (home-page "https://commons.apache.org/collections/")
5938 (synopsis "Collections framework")
5939 (description "The Java Collections Framework is the recognised standard
5940for collection handling in Java. Commons-Collections seek to build upon the
5941JDK classes by providing new interfaces, implementations and utilities. There
5942are many features, including:
5943
5944@itemize
5945@item @code{Bag} interface for collections that have a number of copies of
5946 each object
5947@item @code{BidiMap} interface for maps that can be looked up from value to
5948 key as well and key to value
5949@item @code{MapIterator} interface to provide simple and quick iteration over
5950 maps
5951@item Transforming decorators that alter each object as it is added to the
5952 collection
5953@item Composite collections that make multiple collections look like one
5954@item Ordered maps and sets that retain the order elements are added in,
5955 including an LRU based map
5956@item Reference map that allows keys and/or values to be garbage collected
5957 under close control
5958@item Many comparator implementations
5959@item Many iterator implementations
5960@item Adapter classes from array and enumerations to collections
5961@item Utilities to test or create typical set-theory properties of collections
5962 such as union, intersection, and closure.
5963@end itemize\n")
5964 (license license:asl2.0)))
5965
5966(define-public java-commons-collections
5967 (package
5968 (inherit java-commons-collections4)
5969 (name "java-commons-collections")
5970 (version "3.2.2")
5971 (source (origin
5972 (method url-fetch)
5973 (uri (string-append "mirror://apache/commons/collections/source/"
5974 "commons-collections-" version "-src.tar.gz"))
5975 (sha256
5976 (base32
5977 "055r51a5lfc3z7rkxnxmnn1npvkvda7636hjpm4qk7cnfzz98387"))
5978 (patches
5979 (search-patches "java-commons-collections-fix-java8.patch"))))
5980 (arguments
5981 (substitute-keyword-arguments (package-arguments java-commons-collections4)
5982 ((#:phases phases)
5983 `(modify-phases ,phases
5984 ;; The manifest is required by the build procedure
5985 (add-before 'build 'add-manifest
5986 (lambda _
5987 (mkdir-p "build/conf")
5988 (call-with-output-file "build/conf/MANIFEST.MF"
5989 (lambda (file)
5990 (format file "Manifest-Version: 1.0\n")))
5991 #t))
5992 (replace 'install
5993 (install-jars "build"))))))))
5994
5995(define java-commons-collections-test-classes
5996 (package
5997 (inherit java-commons-collections)
5998 (arguments
5999 `(#:jar-name "commons-collections-test-classes.jar"
6000 #:source-dir "src/test"
6001 #:tests? #f))
6002 (inputs
6003 `(("collection" ,java-commons-collections)))))
6004
6005(define-public java-commons-beanutils
6006 (package
6007 (name "java-commons-beanutils")
6008 (version "1.9.3")
6009 (source (origin
6010 (method url-fetch)
6011 (uri (string-append "mirror://apache/commons/beanutils/source/"
6012 "commons-beanutils-" version "-src.tar.gz"))
6013 (sha256
6014 (base32
6015 "03cs0bq3sl1sdc7py9g3qnf8n9h473nrkvd3d251kaqv6a2ab7qk"))))
6016 (build-system ant-build-system)
6017 (arguments
6018 `(#:test-target "test"
6019 #:tests? #f
6020 #:phases
6021 (modify-phases %standard-phases
6022 (replace 'install
6023 (lambda* (#:key outputs #:allow-other-keys)
6024 (rename-file (string-append "dist/commons-beanutils-" ,version
6025 "-SNAPSHOT.jar")
6026 "commons-beanutils.jar")
6027 (install-file "commons-beanutils.jar"
6028 (string-append (assoc-ref outputs "out") "/share/java/"))
6029 #t)))))
6030 (inputs
6031 `(("logging" ,java-commons-logging-minimal)
6032 ("collections" ,java-commons-collections)))
6033 (native-inputs
6034 `(("junit" ,java-junit)
6035 ("collections-test" ,java-commons-collections-test-classes)))
6036 (home-page "https://commons.apache.org/beanutils/")
6037 (synopsis "Dynamically set or get properties in Java")
6038 (description "BeanUtils provides a simplified interface to reflection and
6039introspection to set or get dynamically determined properties through their
6040setter and getter method.")
6041 (license license:asl2.0)))
6042
6043(define-public java-commons-io
6044 (package
6045 (name "java-commons-io")
6046 (version "2.5")
6047 (source
6048 (origin
6049 (method url-fetch)
6050 (uri (string-append "mirror://apache/commons/io/source/"
6051 "commons-io-" version "-src.tar.gz"))
6052 (sha256
6053 (base32
6054 "0q5y41jrcjvx9hzs47x5kdhnasdy6rm4bzqd2jxl02w717m7a7v3"))))
6055 (build-system ant-build-system)
6056 (outputs '("out" "doc"))
6057 (arguments
6058 `(#:test-target "test"
6059 #:make-flags
6060 ,#~(list (string-append "-Djunit.jar="
6061 (car (find-files #$(this-package-native-input "java-junit")
6062 "jar$"))))
6063 #:phases
6064 (modify-phases %standard-phases
6065 (add-after 'build 'build-javadoc ant-build-javadoc)
6066 (replace 'install (install-from-pom "pom.xml"))
6067 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
6068 (native-inputs
6069 (list java-junit java-hamcrest-core))
6070 (propagated-inputs
6071 (list apache-commons-parent-pom-39))
6072 (home-page "https://commons.apache.org/io/")
6073 (synopsis "Common useful IO related classes")
6074 (description "Commons-IO contains utility classes, stream implementations,
6075file filters and endian classes.")
6076 (license license:asl2.0)))
6077
6078(define-public java-commons-io-latest
6079 (package
6080 (inherit java-commons-io)
6081 (version "2.21.0")
6082 (source
6083 (origin
6084 (method url-fetch)
6085 (uri (string-append "mirror://apache/commons/io/source/"
6086 "commons-io-" version "-src.tar.gz"))
6087 (sha256
6088 (base32
6089 "0rr6hb8mm7fd6nrr8f81mvdpfalq01k03l3mzrlxx7g7lda40mb3"))))
6090 (outputs '("out"))
6091 (arguments
6092 `(#:tests? #f ;; tests require too many not yet packaged packages
6093 #:source-dir "src/main/java"
6094 #:jar-name "commons-io.jar"
6095 #:phases
6096 (modify-phases %standard-phases
6097 (replace 'install (install-from-pom "pom.xml")))))
6098 (native-inputs
6099 (list))
6100 (propagated-inputs
6101 (list apache-commons-parent-pom-78))))
6102
6103(define-public java-commons-exec-1.1
6104 (package
6105 (name "java-commons-exec")
6106 (version "1.1")
6107 (source
6108 (origin
6109 (method url-fetch)
6110 (uri (string-append "mirror://apache/commons/exec/source/"
6111 "commons-exec-" version "-src.tar.gz"))
6112 (sha256
6113 (base32
6114 "025dk8xgj10lxwwwqp0hng2rn7fr4vcirxzydqzx9k4dim667alk"))))
6115 (build-system ant-build-system)
6116 (arguments
6117 `(#:test-target "test"
6118 #:make-flags
6119 ,#~(list (string-append "-Dmaven.junit.jar="
6120 (car (find-files #$(this-package-native-input "java-junit")
6121 "jar$"))))
6122 #:phases
6123 (modify-phases %standard-phases
6124 (add-before 'build 'delete-network-tests
6125 (lambda _
6126 (delete-file "src/test/java/org/apache/commons/exec/DefaultExecutorTest.java")
6127 (substitute* "src/test/java/org/apache/commons/exec/TestRunner.java"
6128 (("suite\\.addTestSuite\\(DefaultExecutorTest\\.class\\);") ""))
6129 #t))
6130 ;; The "build" phase automatically tests.
6131 (delete 'check)
6132 (replace 'install (install-jars "target")))))
6133 (native-inputs
6134 (list java-junit))
6135 (home-page "https://commons.apache.org/proper/commons-exec/")
6136 (synopsis "Common program execution related classes")
6137 (description "Commons-Exec simplifies executing external processes.")
6138 (license license:asl2.0)))
6139
6140(define-public java-commons-exec
6141 (package
6142 (inherit java-commons-exec-1.1)
6143 (version "1.3")
6144 (source
6145 (origin
6146 (method url-fetch)
6147 (uri (string-append "mirror://apache/commons/exec/source/"
6148 "commons-exec-" version "-src.tar.gz"))
6149 (sha256
6150 (base32
6151 "17yb4h6f8l49c5iyyvda4z2nmw0bxrx857nrwmsr7mmpb7x441yv"))))
6152 (arguments
6153 `(#:test-target "test"
6154 #:make-flags
6155 ,#~(list (string-append "-Dmaven.junit.jar="
6156 (car (find-files #$(this-package-native-input "java-junit")
6157 "jar$")))
6158 "-Dmaven.compiler.source=1.7"
6159 "-Dmaven.compiler.target=1.7")
6160 #:phases
6161 (modify-phases %standard-phases
6162 (add-before 'build 'delete-network-tests
6163 (lambda* (#:key inputs #:allow-other-keys)
6164 ;; This test hangs indefinitely.
6165 (delete-file "src/test/java/org/apache/commons/exec/issues/Exec60Test.java")
6166 (substitute* "src/test/java/org/apache/commons/exec/issues/Exec41Test.java"
6167 (("ping -c 10 127.0.0.1") "sleep 10"))
6168 (substitute* "src/test/java/org/apache/commons/exec/issues/Exec49Test.java"
6169 (("/bin/ls") "ls"))
6170 (call-with-output-file "src/test/scripts/ping.sh"
6171 (lambda (port)
6172 (format port "#!~a/bin/sh\nsleep $1\n"
6173 (assoc-ref inputs "bash"))))
6174 #t))
6175 ;; The "build" phase automatically tests.
6176 (delete 'check)
6177 (replace 'install (install-jars "target")))))
6178 (native-inputs
6179 (list java-junit java-hamcrest-core))))
6180
6181(define-public java-commons-lang
6182 (package
6183 (name "java-commons-lang")
6184 (version "2.6")
6185 (source
6186 (origin
6187 (method url-fetch)
6188 (uri (string-append "mirror://apache/commons/lang/source/"
6189 "commons-lang-" version "-src.tar.gz"))
6190 (sha256
6191 (base32 "1mxwagqadzx1b2al7i0z1v0r235aj2njdyijf02szq0vhmqrfiq5"))))
6192 (build-system ant-build-system)
6193 (outputs '("out" "doc"))
6194 (arguments
6195 `(#:test-target "test"
6196 #:test-exclude (list "**/Abstract*.java" "**/Random*.java")
6197 #:phases
6198 (modify-phases %standard-phases
6199 (add-after 'build 'build-javadoc ant-build-javadoc)
6200 (add-before 'check 'disable-failing-test
6201 (lambda _
6202 ;; Disable a failing test
6203 (substitute* "src/test/java/org/apache/commons/lang/\
6204time/FastDateFormatTest.java"
6205 (("public void testFormat\\(\\)")
6206 "public void disabled_testFormat()"))
6207 #t))
6208 (replace 'install (install-jars "target"))
6209 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
6210 (native-inputs
6211 (list java-junit))
6212 (home-page "https://commons.apache.org/lang/")
6213 (synopsis "Extension of the java.lang package")
6214 (description "The Commons Lang components contains a set of Java classes
6215that provide helper methods for standard Java classes, especially those found
6216in the @code{java.lang} package in the Sun JDK. The following classes are
6217included:
6218
6219@itemize
6220@item StringUtils - Helper for @code{java.lang.String}.
6221@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets
6222 of characters such as @code{[a-z]} and @code{[abcdez]}.
6223@item RandomStringUtils - Helper for creating randomised strings.
6224@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
6225@item NumberRange - A range of numbers with an upper and lower bound.
6226@item ObjectUtils - Helper for @code{java.lang.Object}.
6227@item SerializationUtils - Helper for serializing objects.
6228@item SystemUtils - Utility class defining the Java system properties.
6229@item NestedException package - A sub-package for the creation of nested
6230 exceptions.
6231@item Enum package - A sub-package for the creation of enumerated types.
6232@item Builder package - A sub-package for the creation of @code{equals},
6233 @code{hashCode}, @code{compareTo} and @code{toString} methods.
6234@end itemize\n")
6235 (license license:asl2.0)))
6236
6237(define-public java-commons-lang3
6238 (package
6239 (name "java-commons-lang3")
6240 (version "3.20.0")
6241 (source
6242 (origin
6243 (method url-fetch)
6244 (uri (string-append "mirror://apache/commons/lang/source/"
6245 "commons-lang3-" version "-src.tar.gz"))
6246 (sha256
6247 (base32 "05b2zfmw1y6bnzf7v32zkhix0c0sab82lmr3ilxciza0l5w6nwya"))))
6248 (build-system ant-build-system)
6249 (arguments
6250 `(#:jar-name "commons-lang3.jar"
6251 #:source-dir "src/main/java"
6252 #:tests? #f; require junit5
6253 #:phases
6254 (modify-phases %standard-phases
6255 (replace 'install (install-from-pom "pom.xml")))))
6256 (propagated-inputs
6257 (list apache-commons-parent-pom-48))
6258 (home-page "https://commons.apache.org/lang/")
6259 (synopsis "Extension of the java.lang package")
6260 (description "The Commons Lang components contains a set of Java classes
6261that provide helper methods for standard Java classes, especially those found
6262in the @code{java.lang} package. The following classes are included:
6263
6264@itemize
6265@item StringUtils - Helper for @code{java.lang.String}.
6266@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets of
6267 characters such as @code{[a-z]} and @code{[abcdez]}.
6268@item RandomStringUtils - Helper for creating randomised strings.
6269@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
6270@item NumberRange - A range of numbers with an upper and lower bound.
6271@item ObjectUtils - Helper for @code{java.lang.Object}.
6272@item SerializationUtils - Helper for serializing objects.
6273@item SystemUtils - Utility class defining the Java system properties.
6274@item NestedException package - A sub-package for the creation of nested
6275 exceptions.
6276@item Enum package - A sub-package for the creation of enumerated types.
6277@item Builder package - A sub-package for the creation of @code{equals},
6278 @code{hashCode}, @code{compareTo} and @code{toString} methods.
6279@end itemize\n")
6280 (license license:asl2.0)))
6281
6282(define-public java-commons-bsf
6283 (package
6284 (name "java-commons-bsf")
6285 (version "2.4.0")
6286 (source (origin
6287 (method url-fetch)
6288 (uri (string-append "mirror://apache/commons/bsf/source/bsf-src-"
6289 version ".tar.gz"))
6290 (sha256
6291 (base32
6292 "1sbamr8jl32p1jgf59nw0b2w9qivyg145954hm6ly54cfgsqrdas"))
6293 (modules '((guix build utils)))
6294 (snippet
6295 '(begin
6296 (for-each delete-file
6297 (find-files "." "\\.jar$"))
6298 #t))))
6299 (build-system ant-build-system)
6300 (arguments
6301 `(#:build-target "jar"
6302 #:tests? #f; No test file
6303 #:modules ((guix build ant-build-system)
6304 (guix build utils)
6305 (guix build java-utils)
6306 (sxml simple))
6307 #:phases
6308 (modify-phases %standard-phases
6309 (add-before 'build 'create-properties
6310 (lambda _
6311 ;; This file is missing from the distribution
6312 (call-with-output-file "build-properties.xml"
6313 (lambda (port)
6314 (sxml->xml
6315 `(project (@ (basedir ".") (name "build-properties") (default ""))
6316 (property (@ (name "project.name") (value "bsf")))
6317 (property (@ (name "source.level") (value "1.5")))
6318 (property (@ (name "build.lib") (value "build/jar")))
6319 (property (@ (name "src.dir") (value "src")))
6320 (property (@ (name "tests.dir") (value "src/org/apache/bsf/test")))
6321 (property (@ (name "build.tests") (value "build/test-classes")))
6322 (property (@ (name "build.dest") (value "build/classes"))))
6323 port)))
6324 #t))
6325 (replace 'install (install-jars "build")))))
6326 (native-inputs
6327 (list java-junit))
6328 (inputs
6329 (list java-commons-logging-minimal))
6330 (home-page "https://commons.apache.org/proper/commons-bsf")
6331 (synopsis "Bean Scripting Framework")
6332 (description "The Bean Scripting Framework (BSF) is a set of Java classes
6333which provides scripting language support within Java applications, and access
6334to Java objects and methods from scripting languages. BSF allows one to write
6335JSPs in languages other than Java while providing access to the Java class
6336library. In addition, BSF permits any Java application to be implemented in
6337part (or dynamically extended) by a language that is embedded within it. This
6338is achieved by providing an API that permits calling scripting language engines
6339from within Java, as well as an object registry that exposes Java objects to
6340these scripting language engines.")
6341 (properties '((upstream-name . "bsf")))
6342 (license license:asl2.0)))
6343
6344(define-public java-commons-jxpath
6345 (package
6346 (name "java-commons-jxpath")
6347 (version "1.3")
6348 (source (origin
6349 (method url-fetch)
6350 (uri (string-append "mirror://apache/commons/jxpath/source/"
6351 "commons-jxpath-" version "-src.tar.gz"))
6352 (sha256
6353 (base32
6354 "1rpgg31ayn9fwr4bfi2i1ij0npcg79ad2fv0w9hacvawsyc42cfs"))))
6355 (build-system ant-build-system)
6356 (arguments
6357 `(#:jar-name "commons-jxpath.jar"
6358 ;; tests require more dependencies, including mockrunner which depends on old software
6359 #:tests? #f
6360 #:source-dir "src/java"))
6361 (inputs
6362 `(("servlet" ,java-classpathx-servletapi)
6363 ("java-jdom" ,java-jdom)
6364 ("java-commons-beanutils" ,java-commons-beanutils)))
6365 (native-inputs
6366 (list java-junit))
6367 (home-page "https://commons.apache.org/jxpath/")
6368 (synopsis "Simple interpreter of an expression language called XPath")
6369 (description "The org.apache.commons.jxpath package defines a simple
6370interpreter of an expression language called XPath. JXPath applies XPath
6371expressions to graphs of objects of all kinds: JavaBeans, Maps, Servlet
6372contexts, DOM etc, including mixtures thereof.")
6373 (license license:asl2.0)))
6374
6375(define-public java-commons-pool
6376 (package
6377 (name "java-commons-pool")
6378 (version "2.6.2")
6379 (source (origin
6380 (method url-fetch)
6381 (uri (string-append "mirror://apache/commons/pool/source/"
6382 "commons-pool2-" version "-src.tar.gz"))
6383 (sha256
6384 (base32
6385 "1fi1hgqmq01bs6azbj3sfswxzadp2r8sjjfiq6ryilz1m50kvrv6"))))
6386 (arguments
6387 `(#:jar-name "common-pool.jar"
6388 #:source-dir "src/main/java"
6389 #:test-exclude
6390 (list "**/PerformanceTest.java")))
6391 (build-system ant-build-system)
6392 (inputs
6393 (list java-cglib))
6394 (native-inputs
6395 (list java-junit java-hamcrest-core java-asm java-objenesis))
6396 (home-page "https://commons.apache.org/proper/commons-pool/")
6397 (synopsis "Object-pooling API in Java")
6398 (description "The commons-pool package provides an object-pooling API
6399and a number of object pool implementations. This package defines a
6400handful of pooling interfaces and some base classes that may be useful when
6401creating new pool implementations.")
6402 (properties '((upstream-name . "commons-pool2")))
6403 (license license:asl2.0)))
6404
6405(define-public java-commons-dbcp
6406 (package
6407 (name "java-commons-dbcp")
6408 (version "2.6.0")
6409 (source (origin
6410 (method url-fetch)
6411 (uri (string-append "mirror://apache/commons/dbcp/source/"
6412 "commons-dbcp2-" version "-src.tar.gz"))
6413 (sha256
6414 (base32
6415 "0axbvcbnf2l70fc3ybrlp3siw2w4ka9mia2pnx4py8gz54cpw3rc"))))
6416 (arguments
6417 `(#:source-dir "src/main/java"
6418 #:jar-name "java-commons-dbcp.jar"
6419 #:tests? #f)); requires apache-geronimo
6420 (inputs
6421 `(("java-commons-pool" ,java-commons-pool)
6422 ("java-commons-logging" ,java-commons-logging-minimal)
6423 ("java-jboss-transaction-api-spec" ,java-jboss-transaction-api-spec)))
6424 (native-inputs
6425 (list java-junit))
6426 (build-system ant-build-system)
6427 (home-page "https://commons.apache.org/proper/commons-dbcp/")
6428 (synopsis "Database Connection Pool for Java")
6429 (description "Commons-dbcp allows you to share a pool of database
6430connections between users. Creating a new connection for each user can be
6431time consuming and even unfeasible when the number of simultaneous users is
6432very large. This package provides a way to share a poole of connections to
6433reduce that load.")
6434 (properties '((upstream-name . "commons-dbcp2")))
6435 (license license:asl2.0)))
6436
6437(define-public java-commons-jcs
6438 (package
6439 (name "java-commons-jcs")
6440 (version "3.1")
6441 (source (origin
6442 (method url-fetch)
6443 (uri (string-append "mirror://apache/commons/jcs/source/"
6444 "commons-jcs3-dist-" version "-src.tar.gz"))
6445 (sha256
6446 (base32
6447 "0y1lm1xnsj99bf7y9mkvbzqfy8dr7ac8zcbkpsjgzb9vhabfsbac"))))
6448 (build-system ant-build-system)
6449 (arguments
6450 `(#:jar-name "commons-jcs.jar"
6451 #:source-dir "commons-jcs-core/src/main/java"
6452 #:test-dir "commons-jcs-core/src/test"
6453 #:tests? #f; requires hsqldb
6454 #:phases
6455 (modify-phases %standard-phases
6456 (add-before 'build 'copy-resources
6457 (lambda _
6458 (copy-recursively "commons-jcs-core/src/main/resources"
6459 "build/classes"))))))
6460 (propagated-inputs
6461 (list java-classpathx-servletapi
6462 java-commons-dbcp
6463 java-httpcomponents-httpclient
6464 java-httpcomponents-httpcore
6465 java-log4j-api))
6466 (native-inputs
6467 (list java-junit))
6468 (home-page "https://commons.apache.org/proper/commons-jcs/")
6469 (synopsis "Distributed caching system in Java")
6470 (description "JCS is a distributed caching system written in Java. It
6471is intended to speed up applications by providing a means to manage cached
6472data of various dynamic natures. Like any caching system, JCS is most useful
6473for high read, low put applications. Latency times drop sharply and
6474bottlenecks move away from the database in an effectively cached system.")
6475 (properties '((upstream-name . "commons-jcs3-dist")))
6476 (license license:asl2.0)))
6477
6478(define-public java-jsr250
6479 (package
6480 (name "java-jsr250")
6481 (version "1.3")
6482 (source (origin
6483 (method git-fetch)
6484 (uri (git-reference
6485 (url "https://github.com/javaee/javax.annotation")
6486 (commit version)))
6487 (file-name (git-file-name name version))
6488 (sha256
6489 (base32
6490 "1g22a9d75g01s9yxgdig0ss7i30j4ysnnp08gn4krn0wly4lpqq0"))))
6491 (build-system ant-build-system)
6492 (arguments
6493 `(#:tests? #f ; no tests included
6494 #:jdk ,icedtea-8
6495 #:jar-name "jsr250.jar"
6496 #:phases
6497 (modify-phases %standard-phases
6498 (replace 'install
6499 (install-from-pom "pom.xml")))))
6500 (propagated-inputs (list java-jvnet-parent-pom-3))
6501 (home-page "https://jcp.org/en/jsr/detail?id=250")
6502 (synopsis "Security-related annotations")
6503 (description "This package provides annotations for security. It provides
6504packages in the @code{javax.annotation} and @code{javax.annotation.security}
6505namespaces.")
6506 ;; either cddl or gpl2 only, with classpath exception
6507 (license (list license:cddl1.0
6508 license:gpl2))))
6509
6510(define-public java-jsr305
6511 (package
6512 (name "java-jsr305")
6513 (version "3.0.1")
6514 (source (origin
6515 (method url-fetch)
6516 (uri (string-append "https://repo1.maven.org/maven2/"
6517 "com/google/code/findbugs/"
6518 "jsr305/" version "/jsr305-"
6519 version "-sources.jar"))
6520 (sha256
6521 (base32
6522 "1rh6jin9v7jqpq3kf1swl868l8i94r636n03pzpsmgr8v0lh9j2n"))))
6523 (build-system ant-build-system)
6524 (arguments
6525 `(#:tests? #f ; no tests included
6526 #:jar-name "jsr305.jar"
6527 #:phases
6528 (modify-phases %standard-phases
6529 (add-before 'install 'create-pom
6530 (generate-pom.xml "pom.xml" "com.google.code.findbugs" "jsr305" ,version))
6531 (replace 'install
6532 (install-from-pom "pom.xml")))))
6533 (home-page "https://findbugs.sourceforge.net/")
6534 (synopsis "Annotations for the static analyzer called findbugs")
6535 (description "This package provides annotations for the findbugs package.
6536It provides packages in the @code{javax.annotations} namespace.")
6537 (license license:asl2.0)))
6538
6539(define-public java-error-prone-annotations
6540 (package
6541 (name "java-error-prone-annotations")
6542 (version "2.18.0")
6543 (source (origin
6544 (method git-fetch)
6545 (uri (git-reference
6546 (url "https://github.com/google/error-prone")
6547 (commit (string-append "v" version))))
6548 (file-name (git-file-name "java-error-prone" version))
6549 (sha256
6550 (base32
6551 "19sqsz0b308rhadr3ff10azdbqjq37nvrn9c06224dwpxap0931f"))))
6552 (build-system ant-build-system)
6553 (arguments
6554 `(#:tests? #f; no tests
6555 #:jar-name (string-append ,name "-" ,version ".jar")
6556 #:source-dir "annotations/src/main/java"
6557 #:test-dir "annotations/src/altest"
6558 #:phases
6559 (modify-phases %standard-phases
6560 (replace 'install (install-from-pom "annotations/pom.xml")))))
6561 (propagated-inputs (list java-error-prone-parent-pom java-jsr305))
6562 (home-page "https://errorprone.info")
6563 (synopsis "Java static analyzer at compile-time")
6564 (description "Error Prone is a static analysis tool for Java that catches
6565common programming mistakes at compile-time. This package contains annotations
6566used by programmers to guide the static analysis.")
6567 (license license:asl2.0)))
6568
6569(define java-error-prone-parent-pom
6570 (package
6571 (inherit java-error-prone-annotations)
6572 (name "java-error-prone-parent-pom")
6573 (arguments
6574 `(#:tests? #f
6575 #:phases
6576 (modify-phases %standard-phases
6577 (delete 'configure)
6578 (delete 'build)
6579 (replace 'install
6580 (install-pom-file "pom.xml")))))
6581 (propagated-inputs '())))
6582
6583(define-public java-guava
6584 (package
6585 (name "java-guava")
6586 (version "31.1")
6587 (source (origin
6588 (method git-fetch)
6589 (uri (git-reference
6590 (url "https://github.com/google/guava/")
6591 (commit (string-append "v" version))))
6592 (file-name (git-file-name name version))
6593 (sha256
6594 (base32
6595 "0sv1w5cnids9ad3l7qhrh3dh1wdqwc946iinsxryafr25wg5z1lp"))
6596 (patches
6597 (search-patches "java-guava-remove-annotation-deps.patch"))))
6598 (build-system ant-build-system)
6599 (arguments
6600 `(#:tests? #f ; no tests included
6601 #:jar-name "guava.jar"
6602 #:source-dir "guava/src"
6603 #:phases
6604 (modify-phases %standard-phases
6605 (add-after 'unpack 'trim-sources
6606 (lambda _
6607 (with-directory-excursion "guava/src/com/google/common"
6608 ;; Remove annotations to avoid extra dependencies:
6609 ;; * "j2objc" annotations are used when converting Java to
6610 ;; Objective C;
6611 ;; * "IgnoreJRERequirement" is used for Android.
6612 ;; * "Nullable" is used to catch NPE at build time.
6613 (substitute* (find-files "." "\\.java$")
6614 (("import com.google.j2objc.*") "")
6615 (("import org.checkerframework.checker.*") "")
6616 (("@ReflectionSupport.*") "")
6617 (("@WeakOuter") "")
6618 (("@RetainedWith") "")
6619 (("@Weak") "")
6620 (("@J2ObjCIncompatible") "")
6621 (("@IgnoreJRERequirement") "")
6622 (("@Nullable") "")))))
6623 ;; This is required by guava, but this is just an empty stub
6624 (add-before 'install 'install-listenablefuture-stub
6625 (install-pom-file "futures/listenablefuture9999/pom.xml"))
6626 (replace 'install (install-from-pom "guava/pom.xml")))))
6627 (inputs
6628 (list java-error-prone-annotations java-jsr305))
6629 (propagated-inputs
6630 (list java-guava-futures-failureaccess java-guava-parent-pom))
6631 (home-page "https://github.com/google/guava")
6632 (synopsis "Google core libraries for Java")
6633 (description "Guava is a set of core libraries that includes new
6634collection types (such as multimap and multiset), immutable collections, a
6635graph library, functional types, an in-memory cache, and APIs/utilities for
6636concurrency, I/O, hashing, primitives, reflection, string processing, and much
6637more!")
6638 (license license:asl2.0)))
6639
6640(define-public java-guava-futures-failureaccess
6641 (package
6642 (inherit java-guava)
6643 (name "java-guava-futures-failureaccess")
6644 (arguments
6645 `(#:tests? #f; no tests
6646 #:jar-name "guava-futures-failureaccess.jar"
6647 #:source-dir "futures/failureaccess/src"
6648 #:phases
6649 (modify-phases %standard-phases
6650 (replace 'install
6651 (install-from-pom "futures/failureaccess/pom.xml")))))
6652 (propagated-inputs
6653 `(("java-sonatype-oss-parent-pom" ,java-sonatype-oss-parent-pom-7)))))
6654
6655(define java-guava-parent-pom
6656 (package
6657 (inherit java-guava)
6658 (name "java-guava-parent-pom")
6659 (arguments
6660 `(#:tests? #f
6661 #:phases
6662 (modify-phases %standard-phases
6663 (delete 'configure)
6664 (delete 'build)
6665 (replace 'install
6666 (install-pom-file "pom.xml")))))
6667 (propagated-inputs
6668 `(("java-sonatype-oss-parent-pom" ,java-sonatype-oss-parent-pom-7)))))
6669
6670;; The java-commons-logging package provides adapters to many different
6671;; logging frameworks. To avoid an excessive dependency graph we try to build
6672;; it with only a minimal set of adapters.
6673(define-public java-commons-logging-minimal
6674 (package
6675 (name "java-commons-logging-minimal")
6676 (version "1.2")
6677 (source (origin
6678 (method url-fetch)
6679 (uri (string-append "mirror://apache/commons/logging/source/"
6680 "commons-logging-" version "-src.tar.gz"))
6681 (sha256
6682 (base32
6683 "10bwcy5w8d7y39n0krlwhnp8ds3kj5zhmzj0zxnkw0qdlsjmsrj9"))))
6684 (build-system ant-build-system)
6685 (arguments
6686 `(#:tests? #f ; avoid dependency on logging frameworks
6687 #:jar-name "commons-logging-minimal.jar"
6688 #:phases
6689 (modify-phases %standard-phases
6690 (add-after 'unpack 'delete-adapters-and-tests
6691 (lambda _
6692 ;; Delete all adapters except for NoOpLog, SimpleLog, and
6693 ;; LogFactoryImpl. NoOpLog is required to build; LogFactoryImpl
6694 ;; is used by applications; SimpleLog is the only actually usable
6695 ;; implementation that does not depend on another logging
6696 ;; framework.
6697 (for-each
6698 (lambda (file)
6699 (delete-file (string-append
6700 "src/main/java/org/apache/commons/logging/impl/" file)))
6701 (list "Jdk13LumberjackLogger.java"
6702 "WeakHashtable.java"
6703 "Log4JLogger.java"
6704 "ServletContextCleaner.java"
6705 "Jdk14Logger.java"
6706 "AvalonLogger.java"
6707 "LogKitLogger.java"))
6708 (delete-file-recursively "src/test")
6709 #t)))))
6710 (home-page "https://commons.apache.org/logging/")
6711 (synopsis "Common API for logging implementations")
6712 (description "The Logging package is a thin bridge between different
6713logging implementations. A library that uses the commons-logging API can be
6714used with any logging implementation at runtime.")
6715 (properties '((upstream-name . "commons-logging")))
6716 (license license:asl2.0)))
6717
6718;; This is the last release of the 1.x series.
6719(define-public java-mockito-1
6720 (package
6721 (name "java-mockito")
6722 (version "1.10.19")
6723 (source (origin
6724 (method url-fetch)
6725 (uri (string-append "https://repo1.maven.org/maven2/"
6726 "org/mockito/mockito-core/" version
6727 "/mockito-core-" version "-sources.jar"))
6728 (sha256
6729 (base32
6730 "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc"))))
6731 (build-system ant-build-system)
6732 (arguments
6733 `(#:jar-name "mockito.jar"
6734 #:tests? #f ; no tests included
6735 ;; FIXME: patch-and-repack does not support jars, so we have to apply
6736 ;; patches in build phases.
6737 #:phases
6738 (modify-phases %standard-phases
6739 ;; Mockito was developed against a different version of hamcrest,
6740 ;; which does not require matcher implementations to provide an
6741 ;; implementation of the "describeMismatch" method. We add this
6742 ;; simple definition to pass the build with our version of hamcrest.
6743 (add-after 'unpack 'fix-hamcrest-build-error
6744 (lambda _
6745 (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java"
6746 (("public Matcher getActualMatcher\\(\\) .*" line)
6747 (string-append "
6748 public void describeMismatch(Object item, Description description) {
6749 actualMatcher.describeMismatch(item, description);
6750 }"
6751 line)))
6752 #t))
6753 ;; Mockito bundles cglib. We have a cglib package, so let's use
6754 ;; that instead.
6755 (add-after 'unpack 'use-system-libraries
6756 (lambda _
6757 (with-directory-excursion "src/org/mockito/internal/creation/cglib"
6758 (substitute* '("CGLIBHacker.java"
6759 "CglibMockMaker.java"
6760 "ClassImposterizer.java"
6761 "DelegatingMockitoMethodProxy.java"
6762 "MethodInterceptorFilter.java"
6763 "MockitoNamingPolicy.java"
6764 "SerializableMockitoMethodProxy.java"
6765 "SerializableNoOp.java")
6766 (("import org.mockito.cglib") "import net.sf.cglib")))
6767 #t)))))
6768 (inputs
6769 (list java-junit java-objenesis java-cglib java-hamcrest-core))
6770 (home-page "http://mockito.org")
6771 (synopsis "Mockito is a mock library for Java")
6772 (description "Mockito is a mocking library for Java which lets you write
6773tests with a clean and simple API. It generates mocks using reflection, and
6774it records all mock invocations, including methods arguments.")
6775 (license license:asl2.0)))
6776
6777(define-public java-httpcomponents-httpcore
6778 (package
6779 (name "java-httpcomponents-httpcore")
6780 (version "4.4.6")
6781 (source (origin
6782 (method url-fetch)
6783 (uri (string-append "mirror://apache/httpcomponents/httpcore/"
6784 "source/httpcomponents-core-"
6785 version "-src.tar.gz"))
6786 (sha256
6787 (base32
6788 "02bwcf38y4vgwq7kj2s6q7qrmma641r5lacivm16kgxvb2j6h1vy"))))
6789 (build-system ant-build-system)
6790 (arguments
6791 `(#:jar-name "httpcomponents-httpcore.jar"
6792 #:phases
6793 (modify-phases %standard-phases
6794 (add-after 'unpack 'chdir
6795 (lambda _ (chdir "httpcore") #t)))))
6796 (inputs
6797 (list java-commons-logging-minimal java-commons-lang3))
6798 (native-inputs
6799 (list java-junit java-mockito-1))
6800 (home-page "https://hc.apache.org/httpcomponents-core-4.4.x/index.html")
6801 (synopsis "Low level HTTP transport components")
6802 (description "HttpCore is a set of low level HTTP transport components
6803that can be used to build custom client and server side HTTP services with a
6804minimal footprint. HttpCore supports two I/O models: blocking I/O model based
6805on the classic Java I/O and non-blocking, event driven I/O model based on Java
6806NIO.
6807
6808This package provides the blocking I/O model library.")
6809 (license license:asl2.0)))
6810
6811(define-public java-httpcomponents-httpcore-nio
6812 (package (inherit java-httpcomponents-httpcore)
6813 (name "java-httpcomponents-httpcore-nio")
6814 (arguments
6815 `(#:jar-name "httpcomponents-httpcore-nio.jar"
6816 #:phases
6817 (modify-phases %standard-phases
6818 (add-after 'unpack 'chdir
6819 (lambda _ (chdir "httpcore-nio") #t)))))
6820 (inputs
6821 (modify-inputs (package-inputs java-httpcomponents-httpcore)
6822 (prepend java-httpcomponents-httpcore java-hamcrest-core)))
6823 (description "HttpCore is a set of low level HTTP transport components
6824that can be used to build custom client and server side HTTP services with a
6825minimal footprint. HttpCore supports two I/O models: blocking I/O model based
6826on the classic Java I/O and non-blocking, event driven I/O model based on Java
6827NIO.
6828
6829This package provides the non-blocking I/O model library based on Java
6830NIO.")))
6831
6832(define-public java-httpcomponents-httpcore-ab
6833 (package (inherit java-httpcomponents-httpcore)
6834 (name "java-httpcomponents-httpcore-ab")
6835 (arguments
6836 `(#:jar-name "httpcomponents-httpcore-ab.jar"
6837 #:phases
6838 (modify-phases %standard-phases
6839 (add-after 'unpack 'chdir
6840 (lambda _ (chdir "httpcore-ab") #t)))))
6841 (inputs
6842 (modify-inputs (package-inputs java-httpcomponents-httpcore)
6843 (prepend java-httpcomponents-httpcore java-commons-cli
6844 java-hamcrest-core)))
6845 (synopsis "Apache HttpCore benchmarking tool")
6846 (description "This package provides the HttpCore benchmarking tool. It is
6847an Apache AB clone based on HttpCore.")))
6848
6849(define-public java-httpcomponents-httpcore-osgi
6850 (package (inherit java-httpcomponents-httpcore)
6851 (name "java-httpcomponents-httpcore-osgi")
6852 (arguments
6853 `(#:jar-name "httpcomponents-httpcore-osgi.jar"
6854 #:phases
6855 (modify-phases %standard-phases
6856 (add-after 'unpack 'chdir
6857 (lambda _ (chdir "httpcore-osgi"))))))
6858 (inputs
6859 (modify-inputs (package-inputs java-httpcomponents-httpcore)
6860 (prepend java-httpcomponents-httpcore
6861 java-httpcomponents-httpcore-nio
6862 java-hamcrest-core)))
6863 (native-inputs (list java-ops4j-pax-exam-core
6864 java-ops4j-pax-exam-core-junit
6865 java-ops4j-pax-exam-core-spi
6866 java-junit))
6867 (description "HttpCore is a set of low level HTTP transport components
6868that can be used to build custom client and server side HTTP services with a
6869minimal footprint. HttpCore supports two I/O models: blocking I/O model based
6870on the classic Java I/O and non-blocking, event driven I/O model based on Java
6871NIO.
6872
6873This package provides... some tests.")))
6874
6875(define-public java-httpcomponents-httpclient
6876 (package
6877 (name "java-httpcomponents-httpclient")
6878 (version "4.5.12")
6879 (source (origin
6880 (method url-fetch)
6881 (uri (string-append "mirror://apache/httpcomponents/httpclient/"
6882 "source/httpcomponents-client-"
6883 version "-src.tar.gz"))
6884 (sha256
6885 (base32
6886 "1va99m2zc2liv0v9vn72p5ja8yz4s5wq7zpahaai5nr966kvxzkb"))))
6887 (build-system ant-build-system)
6888 (arguments
6889 `(#:jar-name "httpcomponents-httpclient.jar"
6890 #:phases
6891 (modify-phases %standard-phases
6892 (add-after 'unpack 'chdir
6893 (lambda _ (chdir "httpclient") #t)))))
6894 (inputs
6895 (list java-commons-logging-minimal
6896 java-commons-codec
6897 java-hamcrest-core
6898 java-httpcomponents-httpcore
6899 java-mockito-1
6900 java-junit))
6901 (home-page "https://hc.apache.org/httpcomponents-client-ga/")
6902 (synopsis "HTTP client library for Java")
6903 (description "Although the @code{java.net} package provides basic
6904functionality for accessing resources via HTTP, it doesn't provide the full
6905flexibility or functionality needed by many applications. @code{HttpClient}
6906seeks to fill this void by providing an efficient, up-to-date, and
6907feature-rich package implementing the client side of the most recent HTTP
6908standards and recommendations.")
6909 (properties '((upstream-name . "httpcomponents-client")))
6910 (license license:asl2.0)))
6911
6912(define-public java-httpcomponents-httpclient-cache
6913 (package (inherit java-httpcomponents-httpclient)
6914 (name "java-httpcomponents-httpclient-cache")
6915 (arguments
6916 `(#:jar-name "httpcomponents-httpclient-cache.jar"
6917 #:source-dir "src/main/java"
6918 #:test-dir "src/test"
6919 #:tests? #f; tests are broken with current cglib.
6920 #:phases
6921 (modify-phases %standard-phases
6922 (add-after 'unpack 'delete-unused-impls
6923 (lambda _
6924 (for-each
6925 delete-file-recursively
6926 '("src/main/java/org/apache/http/impl/client/cache/ehcache/"
6927 "src/main/java/org/apache/http/impl/client/cache/memcached/"
6928 "src/test/java/org/apache/http/impl/client/cache/ehcache/"
6929 "src/test/java/org/apache/http/impl/client/cache/memcached/"))))
6930 (add-after 'unpack 'chdir
6931 (lambda _ (chdir "httpclient-cache"))))))
6932 (inputs
6933 (modify-inputs (package-inputs java-httpcomponents-httpclient)
6934 (prepend java-httpcomponents-httpclient
6935 java-httpcomponents-httpmime
6936 java-hamcrest-core)))
6937 (description "This package provides an API for caching accessed HTTP
6938resources.")))
6939
6940(define-public java-httpcomponents-httpclient-osgi
6941 (package (inherit java-httpcomponents-httpclient)
6942 (name "java-httpcomponents-httpclient-osgi")
6943 (arguments
6944 `(#:jar-name "httpcomponents-httpclient-osgi.jar"
6945 #:tests? #f; tests are broken with current cglib.
6946 #:phases
6947 (modify-phases %standard-phases
6948 (add-after 'unpack 'chdir
6949 (lambda _ (chdir "httpclient-osgi") #t)))))
6950 (inputs
6951 (modify-inputs (package-inputs java-httpcomponents-httpclient)
6952 (prepend java-httpcomponents-httpclient
6953 java-httpcomponents-httpclient-cache
6954 java-osgi-framework
6955 java-osgi-service-cm
6956 java-hamcrest-core)))))
6957
6958(define-public java-httpcomponents-httpmime
6959 (package (inherit java-httpcomponents-httpclient)
6960 (name "java-httpcomponents-httpmime")
6961 (arguments
6962 `(#:jar-name "httpcomponents-httpmime.jar"
6963 #:phases
6964 (modify-phases %standard-phases
6965 (add-after 'unpack 'chdir
6966 (lambda _ (chdir "httpmime") #t)))))
6967 (inputs
6968 (list java-httpcomponents-httpclient java-httpcomponents-httpcore
6969 java-junit java-hamcrest-core))))
6970
6971(define-public java-commons-net
6972 (package
6973 (name "java-commons-net")
6974 (version "3.6")
6975 (source (origin
6976 (method url-fetch)
6977 (uri (string-append "mirror://apache/commons/net/source/"
6978 "commons-net-" version "-src.tar.gz"))
6979 (sha256
6980 (base32
6981 "0n0cmnddk9qdqhjvka8pc6hd9mn2qi3166f1s6xk32h7rfy1adxr"))))
6982 (build-system ant-build-system)
6983 (arguments
6984 `(;; FIXME: MainTest.java tries to read "examples.properties" (which
6985 ;; should be "resources/examples/examples.properties"), but gets "null"
6986 ;; instead.
6987 #:tests? #f
6988 #:jar-name "commons-net.jar"))
6989 (native-inputs
6990 (list java-junit java-hamcrest-core))
6991 (home-page "https://commons.apache.org/net/")
6992 (synopsis "Client library for many basic Internet protocols")
6993 (description "The Apache Commons Net library implements the client side of
6994many basic Internet protocols. The purpose of the library is to provide
6995fundamental protocol access, not higher-level abstractions.")
6996 (license license:asl2.0)))
6997
6998(define-public java-jsch
6999 (package
7000 (name "java-jsch")
7001 (version "0.1.55")
7002 (source (origin
7003 (method url-fetch)
7004 (uri (string-append "mirror://sourceforge/jsch/jsch/"
7005 version "/jsch-" version ".zip"))
7006 (sha256
7007 (base32
7008 "1lxyjwvmwa723wcf3bqn816hkvc03vz4xhbsi7bvfhrz2rpgcfq6"))))
7009 (build-system ant-build-system)
7010 (arguments
7011 `(#:build-target "dist"
7012 #:tests? #f ; no tests included
7013 #:phases
7014 (modify-phases %standard-phases
7015 (replace 'install (install-jars "dist")))))
7016 (native-inputs
7017 (list unzip))
7018 (home-page "http://www.jcraft.com/jsch/")
7019 (synopsis "Pure Java implementation of SSH2")
7020 (description "JSch is a pure Java implementation of SSH2. JSch allows you
7021to connect to an SSH server and use port forwarding, X11 forwarding, file
7022transfer, etc., and you can integrate its functionality into your own Java
7023programs.")
7024 (license license:bsd-3)))
7025
7026(define-public java-commons-compress
7027 (package
7028 (name "java-commons-compress")
7029 (version "1.21")
7030 (source (origin
7031 (method url-fetch)
7032 (uri (string-append "mirror://apache/commons/compress/source/"
7033 "commons-compress-" version "-src.tar.gz"))
7034 (sha256
7035 (base32
7036 "1rkpb6xcyly1wnbx4q6iq6p5hrr0h1d0ppb5r07psc75cbmizjry"))))
7037 (build-system ant-build-system)
7038 (arguments
7039 `(#:jar-name "commons-compress.jar"
7040 #:source-dir "src/main/java"
7041 #:tests? #f; requires java-mockito-3
7042 #:phases
7043 (modify-phases %standard-phases
7044 (replace 'install (install-from-pom "pom.xml")))))
7045 (propagated-inputs
7046 (list java-asm-3
7047 java-brotli
7048 java-osgi-core
7049 java-xz
7050 java-zstd
7051 apache-commons-parent-pom-52))
7052 (home-page "https://commons.apache.org/proper/commons-compress/")
7053 (synopsis "Java library for working with compressed files")
7054 (description "The Apache Commons Compress library defines an API for
7055working with compressed files such as ar, cpio, Unix dump, tar, zip, gzip, XZ,
7056Pack200, bzip2, 7z, arj, lzma, snappy, DEFLATE, lz4 and Z files.")
7057 (license license:asl2.0)))
7058
7059(define-public java-commons-csv
7060 (package
7061 (name "java-commons-csv")
7062 (version "1.4")
7063 (source (origin
7064 (method url-fetch)
7065 (uri (string-append "mirror://apache/commons/csv/source/"
7066 "commons-csv-" version "-src.tar.gz"))
7067 (sha256
7068 (base32
7069 "1l89m0fm2s3xx3v3iynvangymfg2vlyngaj6fgsi457nmsw7m7ij"))))
7070 (build-system ant-build-system)
7071 (arguments
7072 `(#:jar-name "commons-csv.jar"
7073 #:source-dir "src/main/java"
7074 #:tests? #f)); FIXME: requires java-h2
7075 (inputs
7076 `(("java-hamcrest-core" ,java-hamcrest-core)
7077 ("java-commons-io" ,java-commons-io)
7078 ("java-commons-lang3" ,java-commons-lang3)
7079 ("junit" ,java-junit)))
7080 (home-page "https://commons.apache.org/proper/commons-csv/")
7081 (synopsis "Read and write CSV documents")
7082 (description "Commons CSV reads and writes files in variations of the Comma
7083Separated Value (CSV) format. The most common CSV formats are predefined in the
7084CSVFormat class:
7085
7086@itemize
7087@item Microsoft Excel
7088@item Informix UNLOAD
7089@item Informix UNLOAD CSV
7090@item MySQL
7091@item RFC 4180
7092@item TDF
7093@end itemize
7094
7095Custom formats can be created using a fluent style API.")
7096 (license license:asl2.0)))
7097
7098(define-public java-osgi-annotation
7099 (package
7100 (name "java-osgi-annotation")
7101 (version "6.0.0")
7102 (source (origin
7103 (method url-fetch)
7104 (uri (string-append "https://repo1.maven.org/maven2/"
7105 "org/osgi/org.osgi.annotation/" version "/"
7106 "org.osgi.annotation-" version "-sources.jar"))
7107 (sha256
7108 (base32
7109 "1q718mb7gqg726rh6pc2hcisn8v50nv35abbir0jypmffhiii85w"))))
7110 (build-system ant-build-system)
7111 (arguments
7112 `(#:tests? #f ; no tests
7113 #:jar-name "osgi-annotation.jar"
7114 #:phases
7115 (modify-phases %standard-phases
7116 (add-before 'install 'create-pom
7117 (generate-pom.xml "pom.xml" "osgi" "osgi-annotation" ,version))
7118 (replace 'install (install-from-pom "pom.xml")))))
7119 (home-page "https://www.osgi.org")
7120 (synopsis "Annotation module of OSGi framework")
7121 (description
7122 "OSGi, for Open Services Gateway initiative framework, is a module system
7123and service platform for the Java programming language. This package contains
7124the OSGi annotation module, providing additional services to help dynamic
7125components.")
7126 (license license:asl2.0)))
7127
7128(define-public java-osgi-core
7129 (package
7130 (name "java-osgi-core")
7131 (version "6.0.0")
7132 (source (origin
7133 (method url-fetch)
7134 (uri (string-append "https://repo1.maven.org/maven2/"
7135 "org/osgi/org.osgi.core/" version "/"
7136 "org.osgi.core-" version "-sources.jar"))
7137 (sha256
7138 (base32
7139 "19bpf5jx32jq9789gyhin35q5v7flmw0p9mk7wbgqpxqfmxyiabv"))))
7140 (build-system ant-build-system)
7141 (arguments
7142 `(#:tests? #f ; no tests
7143 #:jar-name "osgi-core.jar"
7144 #:phases
7145 (modify-phases %standard-phases
7146 (add-before 'install 'create-pom
7147 (generate-pom.xml "pom.xml" "org.osgi" "org.osgi.core" ,version))
7148 (replace 'install (install-from-pom "pom.xml")))))
7149 (inputs
7150 (list java-osgi-annotation))
7151 (home-page "https://www.osgi.org")
7152 (synopsis "Core module of OSGi framework")
7153 (description
7154 "OSGi, for Open Services Gateway initiative framework, is a module system
7155and service platform for the Java programming language. This package contains
7156the OSGi Core module.")
7157 (license license:asl2.0)))
7158
7159(define-public java-osgi-service-event
7160 (package
7161 (name "java-osgi-service-event")
7162 (version "1.3.1")
7163 (source (origin
7164 (method url-fetch)
7165 (uri (string-append "https://repo1.maven.org/maven2/"
7166 "org/osgi/org.osgi.service.event/"
7167 version "/org.osgi.service.event-"
7168 version "-sources.jar"))
7169 (sha256
7170 (base32
7171 "1nyhlgagwym75bycnjczwbnpymv2iw84zbhvvzk84g9q736i6qxm"))))
7172 (build-system ant-build-system)
7173 (arguments
7174 `(#:tests? #f ; no tests
7175 #:jar-name "osgi-service-event.jar"))
7176 (inputs
7177 (list java-osgi-annotation java-osgi-core))
7178 (home-page "https://www.osgi.org")
7179 (synopsis "OSGi service event module")
7180 (description
7181 "OSGi, for Open Services Gateway initiative framework, is a module system
7182and service platform for the Java programming language. This package contains
7183the OSGi @code{org.osgi.service.event} module.")
7184 (license license:asl2.0)))
7185
7186(define-public java-eclipse-osgi
7187 (package
7188 (name "java-eclipse-osgi")
7189 (version "3.11.3")
7190 (source (origin
7191 (method url-fetch)
7192 (uri (string-append "https://repo1.maven.org/maven2/"
7193 "org/eclipse/platform/org.eclipse.osgi/"
7194 version "/org.eclipse.osgi-"
7195 version "-sources.jar"))
7196 (sha256
7197 (base32
7198 "00cqc6lb29n0zv68b4l842vzkwawvbr7gshfdygsk8sicvcq2c7b"))))
7199 (build-system ant-build-system)
7200 (arguments
7201 `(#:tests? #f ; no tests included
7202 #:jar-name "eclipse-equinox-osgi.jar"))
7203 (inputs
7204 (list java-osgi-annotation))
7205 (home-page "https://www.eclipse.org/equinox/")
7206 (synopsis "Eclipse Equinox OSGi framework")
7207 (description "This package provides an implementation of the OSGi Core
7208specification.")
7209 (license license:epl1.0)))
7210
7211(define-public java-eclipse-equinox-common
7212 (package
7213 (name "java-eclipse-equinox-common")
7214 (version "3.10.200")
7215 (source (origin
7216 (method url-fetch)
7217 (uri (string-append "https://repo1.maven.org/maven2/"
7218 "org/eclipse/platform/org.eclipse.equinox.common/"
7219 version "/org.eclipse.equinox.common-"
7220 version "-sources.jar"))
7221 (sha256
7222 (base32
7223 "1yn8ij6xsljlf35sr2l7wvyvc0ss4n1rv0ry5zkgb49dj4hyrqrj"))))
7224 (build-system ant-build-system)
7225 (arguments
7226 `(#:tests? #f ; no tests included
7227 #:jar-name "eclipse-equinox-common.jar"))
7228 (inputs
7229 (list java-eclipse-osgi))
7230 (home-page "https://www.eclipse.org/equinox/")
7231 (synopsis "Common Eclipse runtime")
7232 (description "This package provides the common Eclipse runtime.")
7233 (license license:epl1.0)))
7234
7235(define-public java-eclipse-core-jobs
7236 (package
7237 (name "java-eclipse-core-jobs")
7238 (version "3.8.0")
7239 (source (origin
7240 (method url-fetch)
7241 (uri (string-append "https://repo1.maven.org/maven2/"
7242 "org/eclipse/platform/org.eclipse.core.jobs/"
7243 version "/org.eclipse.core.jobs-"
7244 version "-sources.jar"))
7245 (sha256
7246 (base32
7247 "0395b8lh0km8vhzjnchvs1rii1qz48hyvb2wqfaq4yhklbwihq4b"))))
7248 (build-system ant-build-system)
7249 (arguments
7250 `(#:tests? #f ; no tests included
7251 #:jar-name "eclipse-core-jobs.jar"))
7252 (inputs
7253 (list java-eclipse-equinox-common java-eclipse-osgi))
7254 (home-page "https://www.eclipse.org/equinox/")
7255 (synopsis "Eclipse jobs mechanism")
7256 (description "This package provides the Eclipse jobs mechanism.")
7257 (license license:epl1.0)))
7258
7259(define-public java-eclipse-equinox-registry
7260 (package
7261 (name "java-eclipse-equinox-registry")
7262 (version "3.6.100")
7263 (source (origin
7264 (method url-fetch)
7265 (uri (string-append "https://repo1.maven.org/maven2/"
7266 "org/eclipse/platform/org.eclipse.equinox.registry/"
7267 version "/org.eclipse.equinox.registry-"
7268 version "-sources.jar"))
7269 (sha256
7270 (base32
7271 "1i9sgymh2fy5vdgk5y7s3qvrlbgh4l93ddqi3v4zmca7hwrlhf9k"))))
7272 (build-system ant-build-system)
7273 (arguments
7274 `(#:tests? #f ; no tests included
7275 #:jar-name "eclipse-equinox-registry.jar"))
7276 (inputs
7277 (list java-eclipse-core-jobs java-eclipse-equinox-common
7278 java-eclipse-osgi))
7279 (home-page "https://www.eclipse.org/equinox/")
7280 (synopsis "Eclipse extension registry support")
7281 (description "This package provides support for the Eclipse extension
7282registry.")
7283 (license license:epl1.0)))
7284
7285(define-public java-eclipse-equinox-app
7286 (package
7287 (name "java-eclipse-equinox-app")
7288 (version "1.3.400")
7289 (source (origin
7290 (method url-fetch)
7291 (uri (string-append "https://repo1.maven.org/maven2/"
7292 "org/eclipse/platform/org.eclipse.equinox.app/"
7293 version "/org.eclipse.equinox.app-"
7294 version "-sources.jar"))
7295 (sha256
7296 (base32
7297 "0nhvbp93y203ar7y59gb0mz3w2d3jlqhr0c9hii9bcfpmr7imdab"))))
7298 (build-system ant-build-system)
7299 (arguments
7300 `(#:tests? #f ; no tests included
7301 #:jar-name "eclipse-equinox-app.jar"))
7302 (inputs
7303 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7304 java-eclipse-osgi java-osgi-service-event))
7305 (home-page "https://www.eclipse.org/equinox/")
7306 (synopsis "Equinox application container")
7307 (description "This package provides the Equinox application container for
7308Eclipse.")
7309 (license license:epl1.0)))
7310
7311(define-public java-eclipse-equinox-preferences
7312 (package
7313 (name "java-eclipse-equinox-preferences")
7314 (version "3.6.1")
7315 (source (origin
7316 (method url-fetch)
7317 (uri (string-append "https://repo1.maven.org/maven2/"
7318 "org/eclipse/platform/org.eclipse.equinox.preferences/"
7319 version "/org.eclipse.equinox.preferences-"
7320 version "-sources.jar"))
7321 (sha256
7322 (base32
7323 "0k7w6c141sqym4fy3af0qkwpy4pdh2vsjpjba6rp5fxyqa24v0a2"))))
7324 (build-system ant-build-system)
7325 (arguments
7326 `(#:tests? #f ; no tests included
7327 #:jar-name "eclipse-equinox-preferences.jar"))
7328 (inputs
7329 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7330 java-eclipse-osgi))
7331 (home-page "https://www.eclipse.org/equinox/")
7332 (synopsis "Eclipse preferences mechanism")
7333 (description "This package provides the Eclipse preferences mechanism with
7334the module @code{org.eclipse.equinox.preferences}.")
7335 (license license:epl1.0)))
7336
7337(define-public java-eclipse-core-contenttype
7338 (package
7339 (name "java-eclipse-core-contenttype")
7340 (version "3.5.100")
7341 (source (origin
7342 (method url-fetch)
7343 (uri (string-append "https://repo1.maven.org/maven2/"
7344 "org/eclipse/platform/org.eclipse.core.contenttype/"
7345 version "/org.eclipse.core.contenttype-"
7346 version "-sources.jar"))
7347 (sha256
7348 (base32
7349 "1wcqcv7ijwv5rh748vz3x9pkmjl9w1r0k0026k56n8yjl4rrmspi"))))
7350 (build-system ant-build-system)
7351 (arguments
7352 `(#:tests? #f ; no tests included
7353 #:jar-name "eclipse-core-contenttype.jar"))
7354 (inputs
7355 (list java-eclipse-equinox-common java-eclipse-equinox-preferences
7356 java-eclipse-equinox-registry java-eclipse-osgi))
7357 (home-page "https://www.eclipse.org/")
7358 (synopsis "Eclipse content mechanism")
7359 (description "This package provides the Eclipse content mechanism in the
7360@code{org.eclipse.core.contenttype} module.")
7361 (license license:epl1.0)))
7362
7363(define-public java-eclipse-core-runtime
7364 (package
7365 (name "java-eclipse-core-runtime")
7366 (version "3.15.100")
7367 (source (origin
7368 (method url-fetch)
7369 (uri (string-append "https://repo1.maven.org/maven2/"
7370 "org/eclipse/platform/org.eclipse.core.runtime/"
7371 version "/org.eclipse.core.runtime-"
7372 version "-sources.jar"))
7373 (sha256
7374 (base32
7375 "0l8xayacsbjvz5hypx2fv47vpw2n4dspamcfb3hx30x9hj8vmg7r"))))
7376 (build-system ant-build-system)
7377 (arguments
7378 `(#:tests? #f ; no tests included
7379 #:jar-name "eclipse-core-runtime.jar"))
7380 (inputs
7381 (list java-eclipse-core-contenttype
7382 java-eclipse-core-jobs
7383 java-eclipse-equinox-app
7384 java-eclipse-equinox-common
7385 java-eclipse-equinox-registry
7386 java-eclipse-equinox-preferences
7387 java-eclipse-osgi))
7388 (home-page "https://www.eclipse.org/")
7389 (synopsis "Eclipse core runtime")
7390 (description "This package provides the Eclipse core runtime with the
7391module @code{org.eclipse.core.runtime}.")
7392 (license license:epl1.0)))
7393
7394(define-public java-eclipse-core-filesystem
7395 (package
7396 (name "java-eclipse-core-filesystem")
7397 (version "1.6.1")
7398 (source (origin
7399 (method url-fetch)
7400 (uri (string-append "https://repo1.maven.org/maven2/"
7401 "org/eclipse/platform/org.eclipse.core.filesystem/"
7402 version "/org.eclipse.core.filesystem-"
7403 version "-sources.jar"))
7404 (sha256
7405 (base32
7406 "0km1bhwjim4rfy3pkvjhvy31kgsyf2ncx0mlkmbf5n6g57pphdyj"))))
7407 (build-system ant-build-system)
7408 (arguments
7409 `(#:tests? #f ; no tests included
7410 #:jar-name "eclipse-core-filesystem.jar"))
7411 (inputs
7412 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7413 java-eclipse-osgi))
7414 (home-page "https://www.eclipse.org/")
7415 (synopsis "Eclipse core file system")
7416 (description "This package provides the Eclipse core file system with the
7417module @code{org.eclipse.core.filesystem}.")
7418 (license license:epl1.0)))
7419
7420(define-public java-eclipse-core-expressions
7421 (package
7422 (name "java-eclipse-core-expressions")
7423 (version "3.5.100")
7424 (source (origin
7425 (method url-fetch)
7426 (uri (string-append "https://repo1.maven.org/maven2/"
7427 "org/eclipse/platform/org.eclipse.core.expressions/"
7428 version "/org.eclipse.core.expressions-"
7429 version "-sources.jar"))
7430 (sha256
7431 (base32
7432 "18bw2l875gmygvpagpgk9l24qzbdjia4ag12nw6fi8v8yaq4987f"))))
7433 (build-system ant-build-system)
7434 (arguments
7435 `(#:tests? #f ; no tests included
7436 #:jar-name "eclipse-core-expressions.jar"))
7437 (inputs
7438 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7439 java-eclipse-equinox-preferences java-eclipse-core-runtime
7440 java-eclipse-osgi))
7441 (home-page "https://www.eclipse.org/")
7442 (synopsis "Eclipse core expression language")
7443 (description "This package provides the Eclipse core expression language
7444with the @code{org.eclipse.core.expressions} module.")
7445 (license license:epl1.0)))
7446
7447(define-public java-eclipse-core-variables
7448 (package
7449 (name "java-eclipse-core-variables")
7450 (version "3.3.0")
7451 (source (origin
7452 (method url-fetch)
7453 (uri (string-append "https://repo1.maven.org/maven2/"
7454 "org/eclipse/platform/org.eclipse.core.variables/"
7455 version "/org.eclipse.core.variables-"
7456 version "-sources.jar"))
7457 (sha256
7458 (base32
7459 "12dirh03zi4n5x5cj07vzrhkmnqy6h9q10h9j605pagmpmifyxmy"))))
7460 (build-system ant-build-system)
7461 (arguments
7462 `(#:tests? #f ; no tests included
7463 #:jar-name "eclipse-core-variables.jar"))
7464 (inputs
7465 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7466 java-eclipse-equinox-preferences java-eclipse-core-runtime
7467 java-eclipse-osgi))
7468 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
7469 (synopsis "Eclipse core variables")
7470 (description "This package provides the Eclipse core variables module
7471@code{org.eclipse.core.variables}.")
7472 (license license:epl1.0)))
7473
7474(define-public java-eclipse-ant-core
7475 (package
7476 (name "java-eclipse-ant-core")
7477 (version "3.4.100")
7478 (source (origin
7479 (method url-fetch)
7480 (uri (string-append "https://repo1.maven.org/maven2/"
7481 "org/eclipse/platform/org.eclipse.ant.core/"
7482 version "/org.eclipse.ant.core-"
7483 version "-sources.jar"))
7484 (sha256
7485 (base32
7486 "11g3if794qjlk98mz9zch22rr56sd7z63vn4i7k2icr8cq5bfqg7"))))
7487 (build-system ant-build-system)
7488 (arguments
7489 `(#:tests? #f ; no tests included
7490 #:jar-name "eclipse-ant-core.jar"))
7491 (inputs
7492 (list java-eclipse-equinox-app
7493 java-eclipse-equinox-common
7494 java-eclipse-equinox-registry
7495 java-eclipse-equinox-preferences
7496 java-eclipse-core-contenttype
7497 java-eclipse-core-runtime
7498 java-eclipse-core-variables
7499 java-eclipse-osgi))
7500 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
7501 (synopsis "Ant build tool core libraries")
7502 (description "This package provides the ant build tool core libraries with
7503the module @code{org.eclipse.ant.core}.")
7504 (license license:epl1.0)))
7505
7506(define-public java-eclipse-core-resources
7507 (package
7508 (name "java-eclipse-core-resources")
7509 (version "3.13.200")
7510 (source (origin
7511 (method url-fetch)
7512 (uri (string-append "https://repo1.maven.org/maven2/"
7513 "org/eclipse/platform/org.eclipse.core.resources/"
7514 version "/org.eclipse.core.resources-"
7515 version "-sources.jar"))
7516 (sha256
7517 (base32
7518 "1sn3b6ky72hkvxcgf9b2jkpbdh3y8lbhi9xxwv1dsiddpkkq91hs"))))
7519 (build-system ant-build-system)
7520 (arguments
7521 `(#:tests? #f ; no tests included
7522 #:jar-name "eclipse-core-resources.jar"))
7523 (inputs
7524 (list java-eclipse-equinox-common
7525 java-eclipse-equinox-preferences
7526 java-eclipse-equinox-registry
7527 java-eclipse-core-contenttype
7528 java-eclipse-core-expressions
7529 java-eclipse-core-filesystem
7530 java-eclipse-core-jobs
7531 java-eclipse-core-runtime
7532 java-eclipse-ant-core
7533 java-eclipse-osgi))
7534 (home-page "https://www.eclipse.org/")
7535 (synopsis "Eclipse core resource management")
7536 (description "This package provides the Eclipse core resource management
7537module @code{org.eclipse.core.resources}.")
7538 (license license:epl1.0)))
7539
7540(define-public java-eclipse-compare-core
7541 (package
7542 (name "java-eclipse-compare-core")
7543 (version "3.6.0")
7544 (source (origin
7545 (method url-fetch)
7546 (uri (string-append "https://repo1.maven.org/maven2/"
7547 "org/eclipse/platform/org.eclipse.compare.core/"
7548 version "/org.eclipse.compare.core-"
7549 version "-sources.jar"))
7550 (sha256
7551 (base32
7552 "10g37r0pbiffyv2wk35c6g5lwzkdipkl0kkjp41v84dln46xm4dg"))))
7553 (build-system ant-build-system)
7554 (arguments
7555 `(#:tests? #f ; no tests included
7556 #:jar-name "eclipse-compare-core.jar"))
7557 (inputs
7558 (list java-eclipse-core-runtime java-eclipse-equinox-common
7559 java-eclipse-osgi java-icu4j))
7560 (home-page "https://www.eclipse.org/")
7561 (synopsis "Eclipse core compare support")
7562 (description "This package provides the Eclipse core compare support
7563module @code{org.eclipse.compare.core}.")
7564 (license license:epl1.0)))
7565
7566(define-public java-eclipse-team-core
7567 (package
7568 (name "java-eclipse-team-core")
7569 (version "3.8.0")
7570 (source (origin
7571 (method url-fetch)
7572 (uri (string-append "https://repo1.maven.org/maven2/"
7573 "org/eclipse/platform/org.eclipse.team.core/"
7574 version "/org.eclipse.team.core-"
7575 version "-sources.jar"))
7576 (sha256
7577 (base32
7578 "02j2jzqgb26zx2d5ahxmvijw6j4r0la90zl5c3i65x6z19ciyam7"))))
7579 (build-system ant-build-system)
7580 (arguments
7581 `(#:tests? #f ; no tests included
7582 #:jar-name "eclipse-team-core.jar"))
7583 (inputs
7584 (list java-eclipse-compare-core
7585 java-eclipse-core-contenttype
7586 java-eclipse-core-filesystem
7587 java-eclipse-core-jobs
7588 java-eclipse-core-resources
7589 java-eclipse-core-runtime
7590 java-eclipse-equinox-common
7591 java-eclipse-equinox-registry
7592 java-eclipse-equinox-preferences
7593 java-eclipse-osgi))
7594 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
7595 (synopsis "Eclipse team support core")
7596 (description "This package provides the Eclipse team support core module
7597@code{org.eclipse.team.core}.")
7598 (license license:epl1.0)))
7599
7600(define-public java-eclipse-core-commands
7601 (package
7602 (name "java-eclipse-core-commands")
7603 (version "3.8.1")
7604 (source (origin
7605 (method url-fetch)
7606 (uri (string-append "https://repo1.maven.org/maven2/"
7607 "org/eclipse/platform/org.eclipse.core.commands/"
7608 version "/org.eclipse.core.commands-"
7609 version "-sources.jar"))
7610 (sha256
7611 (base32
7612 "0yjn482qndcfrsq3jd6vnhcylp16420f5aqkrwr8spsprjigjcr9"))))
7613 (build-system ant-build-system)
7614 (arguments
7615 `(#:tests? #f ; no tests included
7616 #:jar-name "eclipse-core-commands.jar"))
7617 (inputs
7618 (list java-eclipse-equinox-common))
7619 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
7620 (synopsis "Eclipse core commands")
7621 (description "This package provides Eclipse core commands in the module
7622@code{org.eclipse.core.commands}.")
7623 (license license:epl1.0)))
7624
7625(define-public java-eclipse-text
7626 (package
7627 (name "java-eclipse-text")
7628 (version "3.6.0")
7629 (source (origin
7630 (method url-fetch)
7631 (uri (string-append "https://repo1.maven.org/maven2/"
7632 "org/eclipse/platform/org.eclipse.text/"
7633 version "/org.eclipse.text-"
7634 version "-sources.jar"))
7635 (sha256
7636 (base32
7637 "0scz70vzz5qs5caji9f5q01vkqnvip7dpri1q07l8wbbdcxn4cq1"))))
7638 (build-system ant-build-system)
7639 (arguments
7640 `(#:tests? #f ; no tests included
7641 #:jar-name "eclipse-text.jar"
7642 #:phases
7643 (modify-phases %standard-phases
7644 ;; When creating a new category we must make sure that the new list
7645 ;; matches List<Position>. By default it seems to be too generic
7646 ;; (ArrayList<Object>), so we specialize it to ArrayList<Position>.
7647 ;; Without this we get this error:
7648 ;;
7649 ;; [javac] .../src/org/eclipse/jface/text/AbstractDocument.java:376:
7650 ;; error: method put in interface Map<K,V> cannot be applied to given types;
7651 ;; [javac] fPositions.put(category, new ArrayList<>());
7652 ;; [javac] ^
7653 ;; [javac] required: String,List<Position>
7654 ;; [javac] found: String,ArrayList<Object>
7655 ;; [javac] reason: actual argument ArrayList<Object> cannot be converted
7656 ;; to List<Position> by method invocation conversion
7657 ;; [javac] where K,V are type-variables:
7658 ;; [javac] K extends Object declared in interface Map
7659 ;; [javac] V extends Object declared in interface Map
7660 ;;
7661 ;; I don't know if this is a good fix. I suspect it is not, but it
7662 ;; seems to work.
7663 (add-after 'unpack 'fix-compilation-error
7664 (lambda _
7665 (substitute* "src/org/eclipse/jface/text/AbstractDocument.java"
7666 (("Positions.put\\(category, new ArrayList<>\\(\\)\\);")
7667 "Positions.put(category, new ArrayList<Position>());"))
7668 #t)))))
7669 (inputs
7670 (list java-eclipse-equinox-common java-eclipse-core-commands
7671 java-icu4j))
7672 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
7673 (synopsis "Eclipse text library")
7674 (description "Platform Text is part of the Platform UI project and
7675provides the basic building blocks for text and text editors within Eclipse
7676and contributes the Eclipse default text editor.")
7677 (license license:epl1.0)))
7678
7679(define-public java-eclipse-jdt-core
7680 (package
7681 (name "java-eclipse-jdt-core")
7682 (version "3.16.0")
7683 (source (origin
7684 (method url-fetch)
7685 (uri (string-append "https://repo1.maven.org/maven2/"
7686 "org/eclipse/jdt/org.eclipse.jdt.core/"
7687 version "/org.eclipse.jdt.core-"
7688 version "-sources.jar"))
7689 (sha256
7690 (base32
7691 "1g560yr9v2kzv34gc2m3ifpgnj7krcdd6h4gd4z83pwqacwkfz0k"))))
7692 (build-system ant-build-system)
7693 (arguments
7694 `(#:tests? #f ; no tests included
7695 #:jar-name "eclipse-jdt-core.jar"
7696 #:phases
7697 (modify-phases %standard-phases
7698 (add-after 'unpack 'move-sources
7699 (lambda _
7700 (with-directory-excursion "src/jdtCompilerAdaptersrc/"
7701 (for-each (lambda (file)
7702 (install-file file (string-append "../" (dirname file))))
7703 (find-files "." ".*")))
7704 (delete-file-recursively "src/jdtCompilerAdaptersrc/")
7705 #t))
7706 (add-before 'build 'copy-resources
7707 (lambda _
7708 (with-directory-excursion "src"
7709 (for-each (lambda (file)
7710 (install-file file (string-append "../build/classes/" (dirname file))))
7711 (find-files "." ".*.(props|properties|rsc)")))
7712 #t)))))
7713 (inputs
7714 (list java-eclipse-core-contenttype
7715 java-eclipse-core-filesystem
7716 java-eclipse-core-jobs
7717 java-eclipse-core-resources
7718 java-eclipse-core-runtime
7719 java-eclipse-equinox-app
7720 java-eclipse-equinox-common
7721 java-eclipse-equinox-preferences
7722 java-eclipse-equinox-registry
7723 java-eclipse-osgi
7724 java-eclipse-text))
7725 (home-page "https://www.eclipse.org/jdt")
7726 (synopsis "Java development tools core libraries")
7727 (description "This package provides the core libraries of the Eclipse Java
7728development tools.")
7729 (license license:epl1.0)))
7730
7731(define-public java-eclipse-jdt-compiler-apt
7732 (package
7733 (name "java-eclipse-jdt-compiler-apt")
7734 (version "1.3.400")
7735 (source (origin
7736 (method url-fetch)
7737 (uri (string-append "https://repo1.maven.org/maven2/"
7738 "org/eclipse/jdt/org.eclipse.jdt.compiler.apt/"
7739 version "/org.eclipse.jdt.compiler.apt-"
7740 version "-sources.jar"))
7741 (sha256
7742 (base32
7743 "1s285k9p2ixdqrknb40jbbvw682n9a7l5lqpn583a8pvlzg2l6r8"))))
7744 (build-system ant-build-system)
7745 (arguments
7746 `(#:tests? #f ; no tests included
7747 #:jar-name "eclipse-jdt-compiler-apt.jar"
7748 #:jdk ,openjdk11))
7749 (inputs
7750 (list java-eclipse-jdt-core))
7751 (home-page "https://www.eclipse.org/jdt/apt/")
7752 (synopsis "Annotation processing tool")
7753 (description "APT stands for Annotation Processing Tool. APT provides a
7754means for generating files and compiling new Java classes based on annotations
7755found in your source code.")
7756 (license license:epl2.0)))
7757
7758(define-public java-eclipse-lsp4j-common
7759 (package
7760 (name "java-eclipse-lsp4j-common")
7761 (version "0.10.0")
7762 (source (origin
7763 (method git-fetch)
7764 (uri (git-reference
7765 (url "https://github.com/eclipse/lsp4j")
7766 (commit (string-append "v" version))))
7767 (file-name (git-file-name name version))
7768 (sha256
7769 (base32
7770 "17srrac0pkpybwwc21rzdvn762zzl9m80rlqihc9b4l55hkqpk98"))))
7771 (build-system ant-build-system)
7772 (home-page "https://eclipse.org/lsp4j/")
7773 (synopsis "LSP4J common package")
7774 (description "Eclipse LSP4J provides Java bindings for the Language
7775Server Protocol and the Debug Adapter Protocol. This package is a common
7776definition intended to be inherited by other packages.")
7777 (license license:epl2.0)))
7778
7779(define-public java-eclipse-lsp4j-debug
7780 (package
7781 (inherit java-eclipse-lsp4j-common)
7782 (name "java-eclipse-lsp4j-debug")
7783 (arguments
7784 `(#:jar-name "eclipse-lsp4j-debug.jar"
7785 #:jdk ,openjdk11
7786 #:tests? #f; tests fail with reflection errors
7787 #:source-dir "org.eclipse.lsp4j.debug/src/main/java"
7788 #:test-dir "org.eclipse.lsp4j.debug/src/test"
7789 #:phases
7790 (modify-phases %standard-phases
7791 (add-before 'build 'copy-xtend
7792 (lambda _
7793 (copy-recursively "org.eclipse.lsp4j.debug/src/main/xtend-gen"
7794 "org.eclipse.lsp4j.debug/src/main/java"))))))
7795 (native-inputs
7796 (list java-junit))
7797 (inputs
7798 `(("java-gson" ,java-gson-2.8.6)
7799 ("java-eclipse-lsp4j-generaor" ,java-eclipse-lsp4j-generator)
7800 ("java-eclipse-lsp4j-jsonrpc" ,java-eclipse-lsp4j-jsonrpc)
7801 ("java-eclipse-lsp4j-jsonrpc-debug" ,java-eclipse-lsp4j-jsonrpc-debug)
7802 ("java-eclipse-xtext-xbase-lib" ,java-eclipse-xtext-xbase-lib)))
7803 (synopsis "Eclipse LSP4J Java bindings for the Debug Server Protocol")
7804 (description "Eclipse LSP4J provides Java bindings for the Language
7805Server Protocol and the Debug Adapter Protocol. This package contains its
7806LSP4J Java bindings for the Debug Server Protocol.")))
7807
7808(define-public java-eclipse-lsp4j-generator
7809 (package
7810 (inherit java-eclipse-lsp4j-common)
7811 (name "java-eclipse-lsp4j-generator")
7812 (arguments
7813 `(#:jar-name "eclipse-lsp4j-generator.jar"
7814 #:jdk ,openjdk11
7815 #:tests? #f; no tests
7816 #:source-dir "org.eclipse.lsp4j.generator/src/main/java"))
7817 (inputs
7818 (list java-eclipse-lsp4j-jsonrpc))
7819 (synopsis "Eclipse LSP4J Generator")
7820 (description "Eclipse LSP4J provides Java bindings for the Language
7821Server Protocol and the Debug Adapter Protocol. This package contains its
7822LSP4J code generator for Language Server Protocol classes.")))
7823
7824(define-public java-eclipse-lsp4j-jsonrpc
7825 (package
7826 (inherit java-eclipse-lsp4j-common)
7827 (name "java-eclipse-lsp4j-jsonrpc")
7828 (arguments
7829 `(#:jar-name "eclipse-lsp4j-jsonrpc.jar"
7830 #:jdk ,openjdk11
7831 #:source-dir "org.eclipse.lsp4j.jsonrpc/src/main/java"
7832 #:test-dir "org.eclipse.lsp4j.jsonrpc/src/test"))
7833 (native-inputs
7834 (list java-junit))
7835 (inputs
7836 (list java-gson-2.8.6))
7837 (synopsis "Java JSON-RPC implementation")
7838 (description "Eclipse LSP4J provides Java bindings for the Language
7839Server Protocol and the Debug Adapter Protocol. This package contains its
7840JSON-RPC implementation.")))
7841
7842(define-public java-eclipse-lsp4j-jsonrpc-debug
7843 (package
7844 (inherit java-eclipse-lsp4j-common)
7845 (name "java-eclipse-lsp4j-jsonrpc-debug")
7846 (arguments
7847 `(#:jar-name "eclipse-lsp4j-jsonrpc-debug.jar"
7848 #:jdk ,openjdk11
7849 #:source-dir "org.eclipse.lsp4j.jsonrpc.debug/src/main/java"
7850 #:test-dir "org.eclipse.lsp4j.jsonrpc.debug/src/test"))
7851 (native-inputs
7852 (list java-junit))
7853 (inputs
7854 (list java-eclipse-lsp4j-jsonrpc java-gson-2.8.6))
7855 (synopsis "Java JSON-RPC implementation (debug protocol)")
7856 (description "Eclipse LSP4J provides Java bindings for the Language
7857Server Protocol and the Debug Adapter Protocol. This package contains its
7858JSON-RPC implementation's debug protocol.")))
7859
7860(define-public java-eclipse-xtext-xbase-lib
7861 (package
7862 (name "java-eclipse-xtext-xbase-lib")
7863 (version "2.25.0")
7864 (source (origin
7865 (method git-fetch)
7866 (uri (git-reference
7867 (url "https://github.com/eclipse/xtext-lib")
7868 (commit (string-append "v" version))))
7869 (file-name (git-file-name name version))
7870 (sha256
7871 (base32
7872 "13b9lf6lnsprkik665m1qcyyc8cs16k33xm7as4rjcfcpn4pln71"))))
7873 (build-system ant-build-system)
7874 (arguments
7875 `(#:jar-name "eclipse-xtext-xbase-lib.jar"
7876 #:jdk ,openjdk11
7877 #:tests? #f; TODO (maybe needs newer guava version?)
7878 #:source-dir "org.eclipse.xtext.xbase.lib/src"
7879 #:test-dir "org.eclipse.xtext.xbase.lib.tests/src"))
7880 (native-inputs
7881 (list java-junit))
7882 (inputs
7883 (list java-guava))
7884 (home-page "https://www.eclipse.org/Xtext/")
7885 (synopsis "Eclipse Xbase Runtime Library")
7886 (description "This package contains runtime libraries for Xbase languages
7887such as Xtend.")
7888 (license license:epl2.0)))
7889
7890(define-public java-javax-mail
7891 (package
7892 (name "java-javax-mail")
7893 (version "1.5.6")
7894 (source (origin
7895 (method url-fetch)
7896 (uri (string-append "https://repo1.maven.org/maven2/"
7897 "com/sun/mail/javax.mail/"
7898 version "/javax.mail-"
7899 version "-sources.jar"))
7900 (sha256
7901 (base32
7902 "0sdlfgsc2b5s89xv1261y8i0jijcja019k2x1c8ngfn582w4jly9"))))
7903 (build-system ant-build-system)
7904 (arguments
7905 `(#:tests? #f ; no tests
7906 #:jar-name "javax-mail.jar"))
7907 (home-page "https://javamail.java.net")
7908 (synopsis "Reference implementation of the JavaMail API")
7909 (description
7910 "This package provides versions of the JavaMail API implementation, IMAP,
7911SMTP, and POP3 service providers, some examples, and documentation for the
7912JavaMail API.")
7913 ;; GPLv2 only with "classpath exception".
7914 (license license:gpl2)))
7915
7916(define-public java-log4j-api
7917 (package
7918 (name "java-log4j-api")
7919 (version "2.17.1")
7920 (source (origin
7921 (method url-fetch)
7922 (uri (string-append "mirror://apache/logging/log4j/" version
7923 "/apache-log4j-" version "-src.tar.gz"))
7924 (sha256
7925 (base32
7926 "05xssljdgxfv8ql42db8ydjfsvvbdqmsgip75phybm259ydzbsd6"))))
7927 (build-system ant-build-system)
7928 (arguments
7929 `(#:tests? #f ; tests require unpackaged software
7930 #:jar-name "log4j-api.jar"
7931 #:make-flags
7932 ,#~(list (string-append "-Ddist.dir=" #$output "/share/java"))
7933 #:phases
7934 (modify-phases %standard-phases
7935 (add-after 'unpack 'enter-dir
7936 (lambda _ (chdir "log4j-api") #t))
7937 ;; FIXME: The tests require additional software that has not been
7938 ;; packaged yet, such as
7939 ;; * org.apache.maven
7940 ;; * org.apache.felix
7941 (add-after 'enter-dir 'delete-tests
7942 (lambda _ (delete-file-recursively "src/test") #t)))))
7943 (inputs
7944 (list java-osgi-core java-hamcrest-core java-junit))
7945 (properties '((cpe-name . "log4j")))
7946 (home-page "https://logging.apache.org/log4j/2.x/")
7947 (synopsis "API module of the Log4j logging framework for Java")
7948 (description
7949 "This package provides the API module of the Log4j logging framework for
7950Java.")
7951 (license license:asl2.0)))
7952
7953(define-public java-log4j-core
7954 (package
7955 (inherit java-log4j-api)
7956 (name "java-log4j-core")
7957 (inputs
7958 `(("java-osgi-core" ,java-osgi-core)
7959 ("java-hamcrest-core" ,java-hamcrest-core)
7960 ("java-log4j-api" ,java-log4j-api)
7961 ("java-mail" ,java-mail)
7962 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
7963 ("java-conversant-disruptor" ,java-conversant-disruptor)
7964 ("java-lmax-disruptor" ,java-lmax-disruptor)
7965 ("java-jctools-core" ,java-jctools-core-1)
7966 ("java-stax2-api" ,java-stax2-api)
7967 ("java-jansi" ,java-jansi)
7968 ("java-kafka" ,java-kafka-clients)
7969 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
7970 ("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
7971 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
7972 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
7973 ("java-fasterxml-jackson-dataformat-xml" ,java-fasterxml-jackson-dataformat-xml)
7974 ("java-fasterxml-jackson-dataformat-yaml" ,java-fasterxml-jackson-dataformat-yaml)
7975 ("java-commons-compress" ,java-commons-compress)
7976 ("java-commons-csv" ,java-commons-csv)
7977 ("java-jeromq" ,java-jeromq)
7978 ("java-junit" ,java-junit)))
7979 (native-inputs
7980 `(("hamcrest" ,java-hamcrest-all)
7981 ("java-commons-io" ,java-commons-io)
7982 ("java-commons-lang3" ,java-commons-lang3)
7983 ("slf4j" ,java-slf4j-api)))
7984 (arguments
7985 `(#:tests? #f ; tests require more dependencies
7986 #:test-dir "src/test"
7987 #:source-dir "src/main/java"
7988 #:jar-name "log4j-core.jar"
7989 #:jdk ,icedtea-8
7990 #:make-flags
7991 ,#~(list (string-append "-Ddist.dir=" #$output "/share/java"))
7992 #:phases
7993 (modify-phases %standard-phases
7994 (add-after 'unpack 'enter-dir
7995 (lambda _ (chdir "log4j-core") #t)))))
7996 (synopsis "Core component of the Log4j framework")
7997 (description "This package provides the core component of the Log4j
7998logging framework for Java.")))
7999
8000(define-public java-log4j-1.2-api
8001 (package
8002 (inherit java-log4j-api)
8003 (name "java-log4j-1.2-api")
8004 (arguments
8005 `(#:jar-name "java-log4j-1.2-api.jar"
8006 #:source-dir "log4j-1.2-api/src/main/java"
8007 #:jdk ,icedtea-8
8008 ;; Tests require maven-model (and other maven subprojects), which is a
8009 ;; cyclic dependency.
8010 #:tests? #f))
8011 (inputs
8012 `(("log4j-api" ,java-log4j-api)
8013 ("log4j-core" ,java-log4j-core)
8014 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
8015 ("osgi-core" ,java-osgi-core)
8016 ("eclipse-osgi" ,java-eclipse-osgi)
8017 ("java-lmax-disruptor" ,java-lmax-disruptor)))))
8018
8019(define-public java-commons-cli
8020 (package
8021 (name "java-commons-cli")
8022 (version "1.4")
8023 (source (origin
8024 (method url-fetch)
8025 (uri (string-append "mirror://apache/commons/cli/source/"
8026 "commons-cli-" version "-src.tar.gz"))
8027 (sha256
8028 (base32
8029 "05hgi2z01fqz374y719gl1dxzqvzci5af071zm7vxrjg9vczipm1"))))
8030 (build-system ant-build-system)
8031 ;; TODO: javadoc
8032 (arguments
8033 `(#:jar-name "commons-cli.jar"
8034 #:phases
8035 (modify-phases %standard-phases
8036 (replace 'install
8037 (install-from-pom "pom.xml")))))
8038 (native-inputs
8039 (list java-junit java-hamcrest-core))
8040 (home-page "https://commons.apache.org/cli/")
8041 (synopsis "Command line arguments and options parsing library")
8042 (description "The Apache Commons CLI library provides an API for parsing
8043command line options passed to programs. It is also able to print help
8044messages detailing the options available for a command line tool.
8045
8046Commons CLI supports different types of options:
8047
8048@itemize
8049@item POSIX like options (ie. tar -zxvf foo.tar.gz)
8050@item GNU like long options (ie. du --human-readable --max-depth=1)
8051@item Java like properties (ie. java -Djava.awt.headless=true Foo)
8052@item Short options with value attached (ie. gcc -O2 foo.c)
8053@item long options with single hyphen (ie. ant -projecthelp)
8054@end itemize
8055
8056This is a part of the Apache Commons Project.")
8057 (license license:asl2.0)))
8058
8059(define-public java-commons-text
8060 (package
8061 (name "java-commons-text")
8062 (version "1.15.0")
8063 (source (origin
8064 (method url-fetch)
8065 (uri (string-append "mirror://apache/commons/text/source/"
8066 "commons-text-" version "-src.tar.gz"))
8067 (sha256
8068 (base32
8069 "0k0y3pkgrzm84a0z1ifi4b9ydaglzm9pgvaw9phxdcwmcqxjbkc8"))))
8070 (build-system ant-build-system)
8071 (arguments
8072 (list #:jar-name "java-commons-text.jar"
8073 #:source-dir "src/main/java"
8074 #:test-dir "src/test"
8075 #:tests? #f ; Tests require JUnit5.
8076 #:phases
8077 #~(modify-phases %standard-phases
8078 (replace 'install
8079 (install-from-pom "pom.xml")))))
8080 (inputs
8081 (list java-commons-io))
8082 (propagated-inputs
8083 (list java-commons-lang3
8084 apache-commons-parent-pom-51))
8085 (home-page "https://commons.apache.org/text/")
8086 (synopsis "Library focused on algorithms working on strings")
8087 (description "Apache Commons Text is a library focused on algorithms
8088working on strings.
8089
8090This is a part of the Apache Commons Project.")
8091 (license license:asl2.0)))
8092
8093(define-public java-commons-codec
8094 (package
8095 (name "java-commons-codec")
8096 (version "1.15")
8097 (source (origin
8098 (method url-fetch)
8099 (uri (string-append "mirror://apache/commons/codec/source/"
8100 "commons-codec-" version "-src.tar.gz"))
8101 (sha256
8102 (base32
8103 "01z9qmg8fd8d7p7xxipwj1vi9bmvpgqyi29kldjz2x6vzwm171jj"))))
8104 (build-system ant-build-system)
8105 (arguments
8106 `(#:jar-name "java-commons-codec.jar"
8107 #:source-dir "src/main/java"
8108 #:test-dir "src/test"
8109 #:test-exclude (list "**/*AbstractTest.java")
8110 #:phases
8111 (modify-phases %standard-phases
8112 (add-before 'build 'copy-resources
8113 (lambda _
8114 (copy-recursively "src/main/resources"
8115 "build/classes")))
8116 (add-before 'check 'copy-test-resources
8117 (lambda _
8118 (copy-recursively "src/test/resources"
8119 "build/test-classes")))
8120 (add-before 'check 'skip-ravenous-test
8121 (lambda _
8122 ;; This test admits to being "memory hungry", but reliably fails
8123 ;; even on a machine that should have plenty (12 GiB). Skip it.
8124 (substitute*
8125 "src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java"
8126 (("\\bassertEnsureBufferSizeExpandsToMaxBufferSize.*;")
8127 "return;"))))
8128 (replace 'install (install-from-pom "pom.xml")))))
8129 (native-inputs
8130 (list java-commons-lang3 java-junit))
8131 (propagated-inputs
8132 (list apache-commons-parent-pom-52))
8133 (home-page "https://commons.apache.org/codec/")
8134 (synopsis "Common encoders and decoders such as Base64, Hex, Phonetic and URLs")
8135 (description "The codec package contains simple encoder and decoders for
8136various formats such as Base64 and Hexadecimal. In addition to these widely
8137used encoders and decoders, the codec package also maintains a collection of
8138phonetic encoding utilities.
8139
8140This is a part of the Apache Commons Project.")
8141 (license license:asl2.0)))
8142
8143(define-public java-commons-daemon
8144 (package
8145 (name "java-commons-daemon")
8146 (version "1.1.0")
8147 (source (origin
8148 (method url-fetch)
8149 (uri (string-append "mirror://apache/commons/daemon/source/"
8150 "commons-daemon-" version "-src.tar.gz"))
8151 (sha256
8152 (base32
8153 "141gkhfzv5v3pdhic6y4ardq2dhsa3v36j8wmmhy6f8mac48fp7n"))))
8154 (build-system ant-build-system)
8155 (arguments
8156 `(#:test-target "test"
8157 #:phases
8158 (modify-phases %standard-phases
8159 (add-after 'build 'build-javadoc ant-build-javadoc)
8160 (replace 'install (install-jars "dist"))
8161 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
8162 (native-inputs
8163 (list java-junit))
8164 (home-page "https://commons.apache.org/daemon/")
8165 (synopsis "Library to launch Java applications as daemons")
8166 (description "The Daemon package from Apache Commons can be used to
8167implement Java applications which can be launched as daemons. For example the
8168program will be notified about a shutdown so that it can perform cleanup tasks
8169before its process of execution is destroyed by the operation system.
8170
8171This package contains the Java library. You will also need the actual binary
8172for your architecture which is provided by the jsvc package.
8173
8174This is a part of the Apache Commons Project.")
8175 (license license:asl2.0)))
8176
8177(define-public java-javaewah
8178 (package
8179 (name "java-javaewah")
8180 (version "1.1.6")
8181 (source (origin
8182 (method git-fetch)
8183 (uri (git-reference
8184 (url "https://github.com/lemire/javaewah/")
8185 (commit (string-append "JavaEWAH-" version))))
8186 (file-name (git-file-name name version))
8187 (sha256
8188 (base32
8189 "1m8qcb1py76v7avbjjrkvyy6fhr5dk2ywy73gbsxqry04gkm2nhw"))))
8190 (build-system ant-build-system)
8191 (arguments `(#:jar-name "javaewah.jar"))
8192 (inputs
8193 (list java-junit java-hamcrest-core))
8194 (home-page "https://github.com/lemire/javaewah")
8195 (synopsis "Compressed alternative to the Java @code{BitSet} class")
8196 (description "This is a word-aligned compressed variant of the Java
8197@code{Bitset} class. It provides both a 64-bit and a 32-bit RLE-like
8198compression scheme. It can be used to implement bitmap indexes.
8199
8200The goal of word-aligned compression is not to achieve the best compression,
8201but rather to improve query processing time. Hence, JavaEWAH tries to save CPU
8202cycles, maybe at the expense of storage. However, the EWAH scheme is always
8203more efficient storage-wise than an uncompressed bitmap (as implemented in the
8204@code{BitSet} class by Sun).")
8205 ;; GPL2.0 derivates are explicitly allowed.
8206 (license license:asl2.0)))
8207
8208(define-public java-slf4j-api
8209 (package
8210 (name "java-slf4j-api")
8211 (version "1.7.25")
8212 (source (origin
8213 (method git-fetch)
8214 (uri (git-reference
8215 (url "https://github.com/qos-ch/slf4j")
8216 (commit (string-append "v_" version))))
8217 (file-name (git-file-name name version))
8218 (sha256
8219 (base32
8220 "15n42zq3k1iyn752nwdcbs44hxns2rmxhglwjfr4np7lxx56apjl"))
8221 (modules '((guix build utils)))
8222 ;; Delete bundled jars.
8223 (snippet
8224 '(begin
8225 (for-each delete-file (find-files "." "\\.jar$"))
8226 #t))))
8227 (build-system ant-build-system)
8228 (arguments
8229 `(#:jar-name "slf4j-api.jar"
8230 #:source-dir "slf4j-api/src/main"
8231 #:test-dir "slf4j-api/src/test"
8232 #:phases
8233 (modify-phases %standard-phases
8234 (add-after 'build 'regenerate-jar
8235 (lambda _
8236 ;; pom.xml ignores these files in the jar creation process. If we don't,
8237 ;; we get the error "This code should have never made it into slf4j-api.jar"
8238 (delete-file-recursively "build/classes/org/slf4j/impl")
8239 (invoke "jar" "-cf" "build/jar/slf4j-api.jar" "-C"
8240 "build/classes" ".")))
8241 (add-before 'check 'dont-test-abstract-classes
8242 (lambda _
8243 ;; abstract classes are not meant to be run with junit
8244 (substitute* "build.xml"
8245 (("<include name=\"\\*\\*/\\*Test.java\" />")
8246 (string-append "<include name=\"**/*Test.java\" />"
8247 "<exclude name=\"**/MultithreadedInitializationTest"
8248 ".java\" />")))
8249 #t))
8250 (replace 'install
8251 (install-from-pom "slf4j-api/pom.xml")))))
8252 (propagated-inputs
8253 (list java-slf4j-parent))
8254 (native-inputs
8255 (list java-junit java-hamcrest-core))
8256 (home-page "https://www.slf4j.org/")
8257 (synopsis "Simple logging facade for Java")
8258 (description "The Simple Logging Facade for Java (SLF4J) serves as a
8259simple facade or abstraction for various logging
8260frameworks (e.g. @code{java.util.logging}, @code{logback}, @code{log4j})
8261allowing the end user to plug in the desired logging framework at deployment
8262time.")
8263 (license license:expat)))
8264
8265(define java-slf4j-parent
8266 (package
8267 (inherit java-slf4j-api)
8268 (name "java-slf4j-parent")
8269 (native-inputs `())
8270 (propagated-inputs '())
8271 (arguments
8272 `(#:tests? #f
8273 #:phases
8274 (modify-phases %standard-phases
8275 (delete 'build)
8276 (delete 'configure)
8277 (replace 'install
8278 (install-pom-file "pom.xml")))))))
8279
8280(define-public java-slf4j-simple
8281 (package
8282 (name "java-slf4j-simple")
8283 (version "1.7.25")
8284 (source (package-source java-slf4j-api))
8285 (build-system ant-build-system)
8286 (arguments
8287 `(#:jar-name "slf4j-simple.jar"
8288 #:source-dir "slf4j-simple/src/main"
8289 #:test-dir "slf4j-simple/src/test"
8290 #:test-exclude (list "**/*SimpleLoggerMultithreadedInitializationTest.java")
8291 #:phases
8292 (modify-phases %standard-phases
8293 ;; The tests need some test classes from slf4j-api
8294 (add-before 'check 'build-slf4j-api-test-helpers
8295 (lambda _
8296 ;; Add current dir to CLASSPATH ...
8297 (setenv "CLASSPATH"
8298 (string-append (getcwd) ":" (getenv "CLASSPATH")))
8299 ;; ... and build test helper classes here:
8300 (apply invoke
8301 `("javac" "-d" "."
8302 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
8303 (replace 'install
8304 (install-from-pom "slf4j-simple/pom.xml")))))
8305 (propagated-inputs
8306 (list java-slf4j-api))
8307 (native-inputs
8308 (list java-junit java-hamcrest-core))
8309 (home-page "https://www.slf4j.org/")
8310 (synopsis "Simple implementation of simple logging facade for Java")
8311 (description "SLF4J binding for the Simple implementation, which outputs
8312all events to System.err. Only messages of level INFO and higher are
8313printed.")
8314 (license license:expat)))
8315
8316(define-public java-slf4j-nop
8317 (package
8318 (name "java-slf4j-nop")
8319 (version "1.7.25")
8320 (source (package-source java-slf4j-api))
8321 (build-system ant-build-system)
8322 (arguments
8323 `(#:jar-name "slf4j-nop.jar"
8324 #:source-dir "slf4j-nop/src/main"
8325 #:test-dir "slf4j-nop/src/test"
8326 #:phases (modify-phases %standard-phases
8327 ;; The tests need some test classes from slf4j-api
8328 (add-before 'check 'build-slf4j-api-test-helpers
8329 (lambda _
8330 ;; Add current dir to CLASSPATH ...
8331 (setenv "CLASSPATH"
8332 (string-append (getcwd) ":"
8333 (getenv "CLASSPATH")))
8334 ;; ... and build test helper classes here:
8335 (apply invoke
8336 `("javac" "-d" "."
8337 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
8338 (replace 'install
8339 (install-from-pom "slf4j-nop/pom.xml")))))
8340 (propagated-inputs (list java-slf4j-api))
8341 (native-inputs (list java-junit java-hamcrest-core))
8342 (home-page "https://www.slf4j.org/")
8343 (synopsis "SLF4J binding that silently discards all logging messages")
8344 (description "Binding/provider for NOP, an implementation that silently
8345discards all logging messages.")
8346 (license license:expat)))
8347
8348(define-public antlr2
8349 (package
8350 (name "antlr2")
8351 (version "2.7.7")
8352 (source (origin
8353 (method url-fetch)
8354 (uri (string-append "https://www.antlr2.org/download/antlr-"
8355 version ".tar.gz"))
8356 (sha256
8357 (base32
8358 "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5"))
8359 (modules '((guix build utils)))
8360 (snippet
8361 '(begin
8362 (delete-file "antlr.jar")
8363 (substitute* "lib/cpp/antlr/CharScanner.hpp"
8364 (("#include <map>")
8365 (string-append
8366 "#include <map>\n"
8367 "#define EOF (-1)\n"
8368 "#include <strings.h>")))
8369 (substitute* "configure"
8370 (("/bin/sh") "sh"))
8371 #t))))
8372 (build-system gnu-build-system)
8373 (arguments
8374 `(#:tests? #f ; no test target
8375 #:imported-modules ((guix build ant-build-system)
8376 ,@%default-gnu-imported-modules)
8377 #:modules (((guix build ant-build-system) #:prefix ant:)
8378 (guix build gnu-build-system)
8379 (guix build utils))
8380 #:phases
8381 (modify-phases %standard-phases
8382 (add-after 'install 'strip-jar-timestamps
8383 (assoc-ref ant:%standard-phases 'strip-jar-timestamps))
8384 (add-before 'configure 'fix-timestamp
8385 (lambda _
8386 (substitute* "configure"
8387 (("^TIMESTAMP.*") "TIMESTAMP=19700101\n"))
8388 #t))
8389 (add-after 'configure 'fix-bin-ls
8390 (lambda _
8391 (substitute* (find-files "." "Makefile")
8392 (("/bin/ls") "ls"))
8393 #t)))))
8394 (native-inputs
8395 `(("which" ,which)
8396 ("zip" ,zip)
8397 ("java" ,icedtea "jdk")))
8398 (inputs
8399 `(("java" ,icedtea)))
8400 (home-page "https://www.antlr2.org")
8401 (synopsis "Framework for constructing recognizers, compilers, and translators")
8402 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
8403is a language tool that provides a framework for constructing recognizers,
8404compilers, and translators from grammatical descriptions containing Java, C#,
8405C++, or Python actions. ANTLR provides excellent support for tree construction,
8406tree walking, and translation.")
8407 (license license:public-domain)))
8408
8409(define-public java-stringtemplate-3
8410 (package
8411 (name "java-stringtemplate")
8412 (version "3.2.1")
8413 (source (origin
8414 (method url-fetch)
8415 (uri (string-append "https://github.com/antlr/website-st4/raw/"
8416 "gh-pages/download/stringtemplate-"
8417 version ".tar.gz"))
8418 (sha256
8419 (base32
8420 "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is"))))
8421 (build-system ant-build-system)
8422 (arguments
8423 `(#:jar-name (string-append ,name "-" ,version ".jar")
8424 #:test-dir "test"
8425 #:modules ((guix build ant-build-system)
8426 (guix build utils)
8427 (srfi srfi-1))
8428 #:phases
8429 (modify-phases %standard-phases
8430 (add-before 'check 'fix-tests
8431 (lambda _
8432 (substitute* "build.xml"
8433 (("\\$\\{test.home\\}/java")
8434 "${test.home}/org"))
8435 #t))
8436 (add-before 'build 'generate-grammar
8437 (lambda _
8438 (with-directory-excursion "src/org/antlr/stringtemplate/language/"
8439 (for-each (lambda (file)
8440 (format #t "~a\n" file)
8441 (invoke "antlr" file))
8442 '("template.g" "angle.bracket.template.g" "action.g"
8443 "eval.g" "group.g" "interface.g")))
8444 #t)))))
8445 (native-inputs
8446 `(("antlr" ,antlr2)
8447 ("java-junit" ,java-junit)))
8448 (home-page "https://www.stringtemplate.org")
8449 (synopsis "Template engine to generate formatted text output")
8450 (description "StringTemplate is a java template engine (with ports for C#,
8451Objective-C, JavaScript, Scala) for generating source code, web pages, emails,
8452or any other formatted text output. StringTemplate is particularly good at
8453code generators, multiple site skins, and internationalization / localization.
8454StringTemplate also powers ANTLR.")
8455 (license license:bsd-3)))
8456
8457;; antlr3 is partially written using antlr3 grammar files. It also depends on
8458;; ST4 (stringtemplate4), which is also partially written using antlr3 grammar
8459;; files and uses antlr3 at runtime. The latest version requires a recent version
8460;; of antlr3 at runtime.
8461;; Fortunately, ST4 4.0.6 can be built with an older antlr3, and we use antlr3.3.
8462;; This version of ST4 is sufficient for the latest antlr3.
8463;; We use ST4 4.0.6 to build a boostrap antlr3 (latest version), and build
8464;; the latest ST4 with it. Then we build our final antlr3 that will be linked
8465;; against the latest ST4.
8466;; antlr3.3 still depends on antlr3 to generate some files, so we use an
8467;; even older version, antlr3.1, to generate them. Fortunately antlr3.1 uses
8468;; only grammar files with the antlr2 syntax.
8469;; So we build antlr3.1 -> antlr3.3 -> ST4.0.6 -> antlr3-bootstrap -> ST4 -> antlr3.
8470
8471(define-public java-stringtemplate
8472 (package (inherit java-stringtemplate-3)
8473 (name "java-stringtemplate")
8474 (version "4.0.8")
8475 (source (origin
8476 (method url-fetch)
8477 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/"
8478 version ".tar.gz"))
8479 (file-name (string-append name "-" version ".tar.gz"))
8480 (sha256
8481 (base32
8482 "1pri8hqa95rfdkjy55icl5q1m09zwp5k67ib14abas39s4v3w087"))))
8483 (build-system ant-build-system)
8484 (arguments
8485 `(#:jar-name (string-append ,name "-" ,version ".jar")
8486 #:tests? #f ; FIXME: tests fail for unknown reasons
8487 #:test-dir "test"
8488 #:modules ((guix build ant-build-system)
8489 (guix build utils)
8490 (srfi srfi-1))
8491 #:phases
8492 (modify-phases %standard-phases
8493 (add-before 'check 'fix-test-target
8494 (lambda _
8495 (substitute* "build.xml"
8496 (("\\$\\{test.home\\}/java") "${test.home}/")
8497 (("\\*Test.java") "Test*.java"))
8498 #t))
8499 (add-before 'build 'generate-grammar
8500 (lambda _
8501 (with-directory-excursion "src/org/stringtemplate/v4/compiler/"
8502 (for-each (lambda (file)
8503 (format #t "~a\n" file)
8504 (invoke "antlr3" file))
8505 '("STParser.g" "Group.g" "CodeGenerator.g")))
8506 #t)))))
8507 (inputs
8508 `(("antlr3" ,antlr3-bootstrap)
8509 ("antlr2" ,antlr2)
8510 ("java-stringtemplate" ,java-stringtemplate-3)
8511 ("java-junit" ,java-junit)))))
8512
8513(define java-stringtemplate-4.0.6
8514 (package (inherit java-stringtemplate)
8515 (name "java-stringtemplate")
8516 (version "4.0.6")
8517 (source (origin
8518 (method url-fetch)
8519 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/ST-"
8520 version ".tar.gz"))
8521 (file-name (string-append name "-" version ".tar.gz"))
8522 (sha256
8523 (base32
8524 "0hjmh1ahdsh3w825i67mli9l4nncc4l6hdbf9ma91jvlj590sljp"))))
8525 (inputs
8526 `(("antlr3" ,antlr3-3.3)
8527 ("antlr2" ,antlr2)
8528 ("java-stringtemplate" ,java-stringtemplate-3)))))
8529
8530(define-public antlr3
8531 (package
8532 (name "antlr3")
8533 (version "3.5.2")
8534 (source (origin
8535 (method git-fetch)
8536 (uri (git-reference
8537 (url "https://github.com/antlr/antlr3")
8538 (commit version)))
8539 (file-name (git-file-name name version))
8540 (sha256
8541 (base32
8542 "0cafavrjmzqhklghrk8c2jqxkdwxgzskm20pbrfd3r41cn00dpnf"))))
8543 (build-system ant-build-system)
8544 (arguments
8545 `(#:jar-name (string-append ,name "-" ,version ".jar")
8546 #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3"
8547 #:tests? #f
8548 #:phases
8549 (modify-phases %standard-phases
8550 (add-after 'install 'bin-install
8551 (lambda* (#:key inputs outputs #:allow-other-keys)
8552 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
8553 (bin (string-append (assoc-ref outputs "out") "/bin")))
8554 (mkdir-p bin)
8555 (with-output-to-file (string-append bin "/antlr3")
8556 (lambda _
8557 (display
8558 (string-append "#!" (which "sh") "\n"
8559 "java -cp " jar "/" ,name "-" ,version ".jar:"
8560 (string-concatenate
8561 (find-files (assoc-ref inputs "stringtemplate")
8562 ".*\\.jar"))
8563 ":"
8564 (string-concatenate
8565 (find-files (assoc-ref inputs "stringtemplate4")
8566 ".*\\.jar"))
8567 ":"
8568 (string-concatenate
8569 (find-files (string-append
8570 (assoc-ref inputs "antlr")
8571 "/lib")
8572 ".*\\.jar"))
8573 " org.antlr.Tool $*"))))
8574 (chmod (string-append bin "/antlr3") #o755))
8575 #t))
8576 (add-before 'build 'generate-grammar
8577 (lambda _
8578 (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/")
8579 (for-each (lambda (file)
8580 (display file)
8581 (newline)
8582 (invoke "antlr3" file))
8583 '("ANTLR.g" "ANTLRTreePrinter.g" "ActionAnalysis.g"
8584 "AssignTokenTypesWalker.g"
8585 "ActionTranslator.g" "TreeToNFAConverter.g"
8586 "ANTLRv3.g" "ANTLRv3Tree.g" "LeftRecursiveRuleWalker.g"
8587 "CodeGenTreeWalker.g" "DefineGrammarItemsWalker.g"))
8588 (substitute* "ANTLRParser.java"
8589 (("public Object getTree") "public GrammarAST getTree"))
8590 (substitute* "ANTLRv3Parser.java"
8591 (("public Object getTree") "public CommonTree getTree"))
8592 (chdir "../../../../../java")
8593 (substitute* "org/antlr/tool/LeftRecursiveRuleAnalyzer.java"
8594 (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*;
8595import org.antlr.grammar.v3.ANTLRTreePrinter;"))
8596 (substitute* "org/antlr/tool/ErrorManager.java"
8597 (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") ""))
8598 (chdir "../../../..")
8599 #t))
8600 (add-before 'build 'fix-build-xml
8601 (lambda _
8602 (substitute* "build.xml"
8603 (("target name=\"compile\">")
8604 "target name=\"compile\">
8605<copy todir=\"${classes.dir}\">
8606<fileset dir=\"tool/src/main/resources\">
8607<include name=\"**/*.stg\"/>
8608<include name=\"**/*.st\"/>
8609<include name=\"**/*.sti\"/>
8610<include name=\"**/STLexer.tokens\"/>
8611</fileset>
8612</copy>"))
8613 #t)))))
8614 (native-inputs
8615 `(("antlr" ,antlr2)
8616 ("antlr3" ,antlr3-bootstrap)))
8617 (inputs
8618 `(("junit" ,java-junit)
8619 ("stringtemplate" ,java-stringtemplate-3)
8620 ("stringtemplate4" ,java-stringtemplate)))
8621 (propagated-inputs
8622 `(("stringtemplate" ,java-stringtemplate-3)
8623 ("antlr" ,antlr2)
8624 ("stringtemplate4" ,java-stringtemplate-4.0.6)))
8625 (home-page "https://www.antlr3.org")
8626 (synopsis "Framework for constructing recognizers, compilers, and translators")
8627 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
8628is a language tool that provides a framework for constructing recognizers,
8629compilers, and translators from grammatical descriptions containing Java, C#,
8630C++, or Python actions. ANTLR provides excellent support for tree construction,
8631tree walking, and translation.")
8632 (license license:bsd-3)))
8633
8634(define antlr3-bootstrap
8635 (package
8636 (inherit antlr3)
8637 (name "antlr3-bootstrap")
8638 (native-inputs
8639 `(("antlr" ,antlr2)
8640 ("antlr3" ,antlr3-3.3)))
8641 (inputs
8642 `(("junit" ,java-junit)))))
8643
8644(define-public antlr3-3.3
8645 (package
8646 (inherit antlr3)
8647 (name "antlr3")
8648 (version "3.3")
8649 (source (origin
8650 (method url-fetch)
8651 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
8652 "gh-pages/download/antlr-"
8653 version ".tar.gz"))
8654 (sha256
8655 (base32
8656 "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m"))
8657 (patches
8658 (search-patches "antlr3-3_3-fix-java8-compilation.patch"))))
8659 (arguments
8660 `(#:jar-name (string-append ,name "-" ,version ".jar")
8661 #:source-dir (string-join '("tool/src/main/java"
8662 "runtime/Java/src/main/java"
8663 "tool/src/main/antlr2"
8664 "tool/src/main/antlr3")
8665 ":")
8666 #:tests? #f ; FIXME: tests seem to require maven plugin
8667 #:modules ((guix build ant-build-system)
8668 (guix build utils)
8669 (srfi srfi-1))
8670 #:phases
8671 (modify-phases %standard-phases
8672 (add-after 'install 'bin-install
8673 (lambda* (#:key inputs outputs #:allow-other-keys)
8674 (let* ((out (assoc-ref outputs "out"))
8675 (jar (string-append out "/share/java"))
8676 (bin (string-append out "/bin")))
8677 (mkdir-p bin)
8678 (with-output-to-file (string-append bin "/antlr3")
8679 (lambda _
8680 (display
8681 (string-append
8682 "#!" (which "sh") "\n"
8683 "java -cp " jar "/antlr3-3.3.jar:"
8684 (string-join
8685 (append (find-files (assoc-ref inputs "java-stringtemplate")
8686 ".*\\.jar$")
8687 (find-files (string-append (assoc-ref inputs "antlr")
8688 "/lib")
8689 ".*\\.jar$"))
8690 ":")
8691 " org.antlr.Tool $*"))))
8692 (chmod (string-append bin "/antlr3") #o755)
8693 #t)))
8694 (add-before 'build 'generate-grammar
8695 (lambda _
8696 (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java"
8697 (("import org.antlr.grammar.v2.\\*;")
8698 "import org.antlr.grammar.v2.*;\n
8699import org.antlr.grammar.v2.TreeToNFAConverter;\n
8700import org.antlr.grammar.v2.DefineGrammarItemsWalker;\n
8701import org.antlr.grammar.v2.ANTLRTreePrinter;"))
8702 (with-directory-excursion "tool/src/main/antlr2/org/antlr/grammar/v2/"
8703 (for-each (lambda (file)
8704 (format #t "~a\n" file)
8705 (invoke "antlr" file))
8706 '("antlr.g" "antlr.print.g" "assign.types.g"
8707 "buildnfa.g" "codegen.g" "define.g")))
8708 (with-directory-excursion "tool/src/main/antlr3/org/antlr/grammar/v3/"
8709 (for-each (lambda (file)
8710 (format #t "~a\n" file)
8711 (invoke "antlr3" file))
8712 '("ActionAnalysis.g" "ActionTranslator.g" "ANTLRv3.g"
8713 "ANTLRv3Tree.g")))
8714 #t))
8715 (add-before 'build 'fix-build-xml
8716 (lambda _
8717 (substitute* "build.xml"
8718 (("target name=\"compile\">")
8719 "target name=\"compile\">
8720<copy todir=\"${classes.dir}\">
8721<fileset dir=\"tool/src/main/resources\">
8722<include name=\"**/*.stg\"/>
8723<include name=\"**/*.st\"/>
8724<include name=\"**/*.sti\"/>
8725<include name=\"**/STLexer.tokens\"/>
8726</fileset>
8727</copy>"))
8728 #t)))))
8729 (native-inputs
8730 `(("antlr" ,antlr2)
8731 ("antlr3" ,antlr3-3.1)))
8732 (inputs
8733 `(("junit" ,java-junit)))
8734 (propagated-inputs
8735 `(("java-stringtemplate" ,java-stringtemplate-3)
8736 ("antlr" ,antlr2)))))
8737
8738(define-public antlr3-3.1
8739 (package
8740 (inherit antlr3)
8741 (version "3.1")
8742 (source (origin
8743 (method url-fetch)
8744 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
8745 "gh-pages/download/antlr-"
8746 version ".tar.gz"))
8747 (sha256
8748 (base32
8749 "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z"))
8750 (patches
8751 (search-patches "antlr3-3_1-fix-java8-compilation.patch"))))
8752 (arguments
8753 `(#:jar-name (string-append "antlr3-" ,version ".jar")
8754 #:source-dir "src:runtime/Java/src"
8755 #:tests? #f
8756 #:phases
8757 (modify-phases %standard-phases
8758 (add-after 'install 'bin-install
8759 (lambda* (#:key inputs outputs #:allow-other-keys)
8760 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
8761 (bin (string-append (assoc-ref outputs "out") "/bin")))
8762 (mkdir-p bin)
8763 (with-output-to-file (string-append bin "/antlr3")
8764 (lambda _
8765 (display
8766 (string-append "#!" (which "sh") "\n"
8767 "java -cp " jar "/antlr3-3.1.jar:"
8768 (string-concatenate
8769 (find-files (assoc-ref inputs "stringtemplate")
8770 ".*\\.jar"))
8771 ":"
8772 (string-concatenate
8773 (find-files (string-append
8774 (assoc-ref inputs "antlr")
8775 "/lib")
8776 ".*\\.jar"))
8777 " org.antlr.Tool $*"))))
8778 (chmod (string-append bin "/antlr3") #o755))
8779 #t))
8780 (add-before 'build 'generate-grammar
8781 (lambda _
8782 (let ((dir "src/org/antlr/tool/"))
8783 (for-each (lambda (file)
8784 (display file)
8785 (newline)
8786 (invoke "antlr" "-o" dir (string-append dir file)))
8787 '("antlr.g" "antlr.print.g" "assign.types.g"
8788 "buildnfa.g" "define.g")))
8789 (format #t "codegen.g\n")
8790 (invoke "antlr" "-o" "src/org/antlr/codegen"
8791 "src/org/antlr/codegen/codegen.g")
8792 #t))
8793 (add-before 'build 'fix-build-xml
8794 (lambda _
8795 (substitute* "build.xml"
8796 (("target name=\"compile\">")
8797 "target name=\"compile\">
8798<copy todir=\"${classes.dir}\">
8799<fileset dir=\"src\">
8800<include name=\"**/*.stg\"/>
8801<include name=\"**/*.st\"/>
8802<include name=\"**/*.sti\"/>
8803<include name=\"**/STLexer.tokens\"/>
8804</fileset>
8805</copy>"))
8806 #t)))))
8807 (native-inputs
8808 `(("antlr" ,antlr2)))
8809 (inputs
8810 `(("junit" ,java-junit)))
8811 (propagated-inputs
8812 `(("stringtemplate" ,java-stringtemplate-3)))))
8813
8814(define-public java-treelayout
8815 (package
8816 (name "java-treelayout")
8817 (version "1.0.3")
8818 (source (origin
8819 (method git-fetch)
8820 (uri (git-reference
8821 (url "https://github.com/abego/treelayout")
8822 (commit (string-append "v" version))))
8823 (file-name (git-file-name name version))
8824 (sha256
8825 (base32
8826 "18my8ql9b1y0n0zrvkih7xfhf3dpgfhyfifvkcfhmwcvw3divxak"))))
8827 (build-system ant-build-system)
8828 (arguments
8829 `(#:jar-name (string-append ,name "-" ,version ".jar")
8830 #:source-dir "org.abego.treelayout/src/main/java"
8831 #:test-dir "org.abego.treelayout/src/test"))
8832 (inputs
8833 (list java-junit))
8834 (native-inputs
8835 (list java-hamcrest-core))
8836 (home-page "https://treelayout.sourceforge.net")
8837 (synopsis "Tree Layout Algorithm in Java")
8838 (description "TreeLayout creates tree layouts for arbitrary trees. It is
8839not restricted to a specific output or format, but can be used for any kind of
8840two dimensional diagram. Examples are Swing based components, SVG files, etc.
8841This is possible because TreeLayout separates the layout of a tree from the
8842actual rendering.")
8843 (license license:bsd-3)))
8844
8845(define-public java-antlr4-runtime
8846 (package
8847 (name "java-antlr4-runtime")
8848 (version "4.10.1")
8849 (source (origin
8850 (method git-fetch)
8851 (uri (git-reference
8852 (url "https://github.com/antlr/antlr4")
8853 (commit version)))
8854 (file-name (git-file-name name version))
8855 (sha256
8856 (base32
8857 "0ldvd9jm4nrivaw7i7wh1q40q6xgzmzirsywiakbhg8sppagqlv7"))
8858 (patches
8859 (search-patches "java-antlr4-Add-standalone-generator.patch"))))
8860 (build-system ant-build-system)
8861 (arguments
8862 `(#:jar-name "java-antlr4-runtime.jar"
8863 #:source-dir "runtime/Java/src/org"
8864 #:tests? #f; tests depend on java-antlr4 itself
8865 #:phases
8866 (modify-phases %standard-phases
8867 (add-before 'build 'copy-resources
8868 (lambda _
8869 (copy-recursively "runtime/Java/src/main/dot"
8870 "build/classes")
8871 #t)))))
8872 (home-page "https://www.antlr.org")
8873 (synopsis "ANTLR runtime library")
8874 (description "This package contains the runtime library used with generated
8875sources by ANTLR.")
8876 (license license:bsd-3)))
8877
8878(define-public java-antlr4-runtime-cpp
8879 (package
8880 (inherit java-antlr4-runtime)
8881 (name "java-antlr4-runtime-cpp")
8882 (outputs '("out" "static"))
8883 (build-system cmake-build-system)
8884 (arguments
8885 (list
8886 ;; TODO: try to run the tests under
8887 ;; runtime-testsuite/test/org/antlr/v4/test/runtime/cpp with antlr4.
8888 #:tests? #f ;no CMake test target
8889 ;; TODO: Building the tests wants to download googletest.
8890 #:configure-flags #~'("-DANTLR_BUILD_CPP_TESTS=OFF")
8891 #:phases
8892 #~(modify-phases %standard-phases
8893 (add-after 'unpack 'chdir
8894 (lambda _
8895 (chdir "runtime/Cpp")))
8896 (add-after 'install 'move-static-library
8897 (lambda* (#:key outputs #:allow-other-keys)
8898 (let ((static (assoc-ref outputs "static"))
8899 (libantlr4-runtime.a (search-input-file
8900 outputs "lib/libantlr4-runtime.a")))
8901 (mkdir-p (string-append static "/lib"))
8902 (rename-file
8903 libantlr4-runtime.a
8904 (string-append static "/lib/"
8905 (basename libantlr4-runtime.a)))))))))
8906 (native-inputs (list pkg-config))
8907 (inputs (list `(,util-linux "lib"))) ;libuuid
8908 (synopsis "ANTL C++ runtime library")
8909 (description "This package contains the C++ runtime library used with C++
8910generated sources by ANTLR.")))
8911
8912(define-public java-antlr4-runtime-python
8913 (package
8914 (inherit java-antlr4-runtime)
8915 (name "java-antlr4-runtime-python")
8916 (outputs '("out"))
8917 (build-system pyproject-build-system)
8918 (arguments
8919 (list
8920 #:tests? #f ; tests require antlr
8921 #:phases
8922 #~(modify-phases %standard-phases
8923 (add-after 'unpack 'chdir
8924 (lambda _
8925 (chdir "runtime/Python3"))))))
8926 (native-inputs (list pkg-config python-setuptools))
8927 (inputs (list `(,util-linux "lib"))) ; libuuid
8928 (synopsis "ANTLR Python runtime library")
8929 (description "This package contains the Python runtime library used with
8930Python generated sources by ANTLR.")))
8931
8932(define-public antlr4
8933 (package
8934 (inherit java-antlr4-runtime)
8935 (name "antlr4")
8936 (arguments
8937 `(#:jar-name "antlr4.jar"
8938 #:source-dir "tool/src"
8939 #:test-dir "tool-testsuite/test:runtime-testsuite/test"
8940 #:test-include (list "**/Test*.java")
8941 #:test-exclude (list
8942 ;; These have no runnable methods and fail because
8943 ;; test-include above is too broad.
8944 "**/TestContext.java"
8945 "**/TestOutputReading.java"
8946 ;; no @Test methods
8947 "**/TestParserErrors.java"
8948 "**/TestSemPredEvalParser.java"
8949 "**/TestSets.java"
8950 "**/TestListeners.java"
8951 "**/TestParseTrees.java"
8952 "**/TestParserExec.java"
8953 "**/TestLexerErrors.java"
8954 "**/TestPerformance.java"
8955 "**/TestCompositeParsers.java"
8956 "**/TestLexerExec.java"
8957 "**/TestSemPredEvalLexer.java"
8958 "**/TestLeftRecursion.java"
8959 "**/TestFullContextParsing.java"
8960 "**/TestCompositeLexers.java"
8961 ;; Null pointer exception
8962 "**/TestCompositeGrammars.java")
8963 #:phases
8964 (modify-phases %standard-phases
8965 (add-before 'build 'fix-build.xml
8966 (lambda _
8967 ;; tests are not in a java subdirectory
8968 (substitute* "build.xml"
8969 (("\\$\\{test.home\\}/java") "${test.home}"))
8970 #t))
8971 ;; tests require to have a working antlr4 binary
8972 (delete 'check)
8973 (add-after 'install 'check
8974 (lambda _
8975 (invoke "ant" "compile-tests")
8976 (invoke "ant" "check" "-Dtest.home=runtime-testsuite/test")
8977 (invoke "ant" "check" "-Dtest.home=tool-testsuite/test")
8978 #t))
8979 (add-before 'check 'remove-unrelated-languages
8980 (lambda _
8981 ;; There are tests for other languages that ANTLR can generate, but
8982 ;; we don't have the infrastructure for that yet. Let's test Java
8983 ;; generation only.
8984 (for-each
8985 (lambda (language)
8986 (delete-file-recursively
8987 (string-append "runtime-testsuite/test/org/antlr/v4/test/runtime/"
8988 language)))
8989 '("cpp" "csharp" "go" "javascript" "php" "python" "python2"
8990 "python3" "swift"))
8991 #t))
8992 (add-before 'check 'generate-test-parsers
8993 (lambda* (#:key outputs #:allow-other-keys)
8994 (define (run-antlr dir filename package)
8995 (invoke "antlr4" "-lib" dir "-visitor" "-no-listener"
8996 "-package" package (string-append dir "/" filename)
8997 "-Xlog"))
8998 (setenv "PATH" (string-append (getenv "PATH") ":"
8999 (assoc-ref outputs "out") "/bin"))
9000 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
9001 "Java.g4" "org.antlr.v4.test.runtime.java.api")
9002 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
9003 "VisitorBasic.g4" "org.antlr.v4.test.runtime.java.api")
9004 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
9005 "VisitorCalc.g4" "org.antlr.v4.test.runtime.java.api")
9006 #t))
9007 (add-before 'check 'remove-graphemes
9008 (lambda _
9009 ;; When running antlr on grahemes.g4, we get a runtime exception:
9010 ;; set is empty. So delete the file that depends on it.
9011 (delete-file
9012 "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/perf/TimeLexerSpeed.java")
9013 #t))
9014 (add-after 'install 'bin-install
9015 (lambda* (#:key inputs outputs #:allow-other-keys)
9016 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
9017 (bin (string-append (assoc-ref outputs "out") "/bin")))
9018 (mkdir-p bin)
9019 (with-output-to-file (string-append bin "/antlr4")
9020 (lambda _
9021 (display
9022 (string-append "#!" (which "sh") "\n"
9023 "java -cp " jar "/antlr4.jar:"
9024 (string-join
9025 (apply
9026 append
9027 (map
9028 (lambda (input)
9029 (find-files (assoc-ref inputs input)
9030 ".*\\.jar"))
9031 '("antlr3" "java-stringtemplate"
9032 "java-antlr4-runtime" "java-treelayout"
9033 "java-jsonp-api" "java-icu4j")))
9034 ":")
9035 " org.antlr.v4.Tool $*"))))
9036 (chmod (string-append bin "/antlr4") #o755)
9037 #t)))
9038 (add-before 'build 'copy-resources
9039 (lambda _
9040 (copy-recursively "tool/resources/" "build/classes")
9041 #t))
9042 (add-before 'build 'generate-unicode
9043 (lambda _
9044 ;; First: build the generator
9045 (invoke "javac" "-cp" (getenv "CLASSPATH")
9046 "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java"
9047 "tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java")
9048 ;; Then use it
9049 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
9050 ":tool/src:runtime/Java")
9051 "org.antlr.v4.unicode.UnicodeRenderer"
9052 "tool/resources/org/antlr/v4/tool/templates"
9053 "unicodedata"
9054 "tool/src/org/antlr/v4/unicode/UnicodeData.java")
9055 ;; It seems there is a bug with our ST4
9056 (substitute* "tool/src/org/antlr/v4/unicode/UnicodeData.java"
9057 (("\\\\>") ">"))
9058 ;; Remove the additional file
9059 (delete-file "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java")
9060 #t))
9061 (add-before 'build 'generate-grammar
9062 (lambda* (#:key inputs #:allow-other-keys)
9063 (with-directory-excursion "tool/src/org/antlr/v4/parse"
9064 (for-each (lambda (file)
9065 (display file)
9066 (newline)
9067 (invoke "antlr3" file))
9068 '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g"
9069 "GrammarTreeVisitor.g" "ATNBuilder.g"
9070 "ActionSplitter.g" "LeftRecursiveRuleWalker.g")))
9071 (with-directory-excursion "tool/src/org/antlr/v4/codegen"
9072 (install-file "../parse/ANTLRParser.tokens" ".")
9073 (display "SourceGenTriggers.g\n")
9074 (invoke "antlr3" "SourceGenTriggers.g"))
9075 #t)))))
9076 (inputs
9077 (list antlr3
9078 java-antlr4-runtime
9079 java-icu4j
9080 java-jsonp-api
9081 java-stringtemplate
9082 java-treelayout))
9083 (native-inputs
9084 (list java-junit))
9085 (synopsis "Parser and lexer generator in Java")
9086 (description "ANTLR (ANother Tool for Language Recognition) is a powerful
9087parser generator for reading, processing, executing, or translating structured
9088text or binary files. It's widely used to build languages, tools, and
9089frameworks. From a grammar, ANTLR generates a parser that can build and walk
9090parse trees.")))
9091
9092(define-public java-antlr4-runtime-4.1
9093 (package
9094 (inherit java-antlr4-runtime)
9095 (version "4.1")
9096 (source (origin
9097 (method git-fetch)
9098 (uri (git-reference
9099 (url "https://github.com/antlr/antlr4")
9100 (commit version)))
9101 (file-name (git-file-name "antlr4" version))
9102 (sha256
9103 (base32
9104 "1i8hmx5an58cjyvhji0xgpvd6lq00z1k1mjys025q2wqc25wv4c1"))))
9105 (arguments
9106 (substitute-keyword-arguments (package-arguments java-antlr4-runtime)
9107 ((#:phases phases)
9108 `(modify-phases ,phases
9109 (add-before 'configure 'chmod
9110 (lambda _
9111 (chmod "build.xml" #o644)
9112 #t))))))
9113 (inputs
9114 (list java-treelayout))))
9115
9116(define-public antlr4-4.1
9117 (package
9118 (inherit antlr4)
9119 (version (package-version java-antlr4-runtime-4.1))
9120 (source (package-source java-antlr4-runtime-4.1))
9121 (arguments
9122 (substitute-keyword-arguments (package-arguments antlr4)
9123 ((#:test-dir _)
9124 "tool/test")
9125 ((#:test-exclude excludes)
9126 `(list "**/TestParseErrors.java"
9127 "**/TestTopologicalSort.java"
9128 ,@excludes))
9129 ((#:phases phases)
9130 `(modify-phases ,phases
9131 (delete 'generate-unicode)
9132 (replace 'check
9133 (lambda _
9134 (invoke "ant" "check")
9135 #t))
9136 (add-before 'configure 'chmod
9137 (lambda _
9138 (chmod "build.xml" #o644)
9139 #t))
9140 (delete 'remove-graphemes)
9141 (delete 'remove-unrelated-languages)
9142 (delete 'generate-test-parsers)))))
9143 (inputs
9144 (alist-replace
9145 "java-antlr4-runtime" (list java-antlr4-runtime-4.1)
9146 (package-inputs antlr4)))))
9147
9148(define-public java-tunnelvisionlabs-antlr4-runtime-annotations
9149 (package
9150 (inherit java-antlr4-runtime)
9151 (name "java-tunnelvisionlabs-antlr4-runtime-annotations")
9152 (version "4.7.4")
9153 (source (origin
9154 (method git-fetch)
9155 (uri (git-reference
9156 (url "https://github.com/tunnelvisionlabs/antlr4")
9157 (commit (string-append version "-opt"))))
9158 (file-name (git-file-name "java-tunnelvisionlabs-antlr4" version))
9159 (sha256
9160 (base32
9161 "1mf2lvvsszpialsk23ma83pwp50nd32lrbjpa847zlm5gmranbr8"))
9162 (patches
9163 (search-patches "java-antlr4-Add-standalone-generator.patch"
9164 "java-tunnelvisionlabs-antlr-code-too-large.patch"))))
9165 (arguments
9166 `(#:jar-name "java-antlr4-runtime-annotations.jar"
9167 #:source-dir "runtime/JavaAnnotations/src"
9168 #:tests? #f; no tests
9169 #:phases
9170 (modify-phases %standard-phases
9171 (add-after 'build 'copy-resources
9172 (lambda _
9173 (copy-recursively "runtime/JavaAnnotations/resources"
9174 "build/classes")
9175 #t))
9176 (add-after 'copy-resources 'rebuild-jar
9177 (lambda _
9178 (invoke "ant" "jar")
9179 #t)))))
9180 (inputs '())
9181 (native-inputs '())
9182 (synopsis "Annotations for ANTLR's runtime library")
9183 (description "This package contains annotations used during the build of
9184the runtime library of ANTLR.")))
9185
9186;; the runtime of this library requires a lexer that is generated by antlr4.
9187;; However, antlr4 itself requires this library at build and run-time. We
9188;; use [email protected], the closest version of antlr that doesn't need this
9189;; bootstrap process, to generate the lexer. The generated lexer is built
9190;; for the 4.1 runtime, which is slightly different from this runtime.
9191;; So, we build the runtime with antlr 4.1, with a broken xml lexer, that we
9192;; use to build antlr4. We then re-use this antlr4 to build the runtime, and
9193;; the proper, working, runtime to build antlr4 again.
9194(define java-tunnelvisionlabs-antlr4-runtime-bootstrap
9195 (package
9196 (inherit java-antlr4-runtime)
9197 (name "java-tunnelvisionlabs-antlr4-runtime")
9198 (version (package-version java-tunnelvisionlabs-antlr4-runtime-annotations))
9199 (source (package-source java-tunnelvisionlabs-antlr4-runtime-annotations))
9200 (arguments
9201 `(#:jar-name "java-antlr4-runtime.jar"
9202 #:source-dir "runtime/Java/src"
9203 #:tests? #f; tests require antlr4, but antlr4 depends on this package
9204 #:phases
9205 (modify-phases %standard-phases
9206 (add-before 'build 'generate-xpath-lexer
9207 (lambda _
9208 (invoke "antlr4" "-lib" "runtime/Java/src/org/antlr/v4/runtime/tree/xpath"
9209 "-visitor" "-no-listener"
9210 "-package" "org.antlr.v4.runtime.tree.xpath"
9211 "runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.g4")
9212 ;; Generated code is for an incompatible version of the runtime
9213 (substitute* "runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.java"
9214 (("LexerATNSimulator\\(this,_ATN,_decisionToDFA,_sharedContextCache\\)")
9215 "LexerATNSimulator(this,_ATN)"))
9216 #t))
9217 (add-before 'build 'copy-resources
9218 (lambda _
9219 (copy-recursively "runtime/Java/src/main/dot"
9220 "build/classes")
9221 #t)))))
9222 (native-inputs
9223 `(("antlr4" ,antlr4-4.1)
9224 ("java-tunnelvisionlabs-antlr4-runtime-annotations"
9225 ,java-tunnelvisionlabs-antlr4-runtime-annotations)))))
9226
9227(define java-tunnelvisionlabs-antlr4-bootstrap
9228 (package
9229 (inherit antlr4)
9230 (name "java-tunnelvisionlabs-antlr4")
9231 (version (package-version java-tunnelvisionlabs-antlr4-runtime-annotations))
9232 (source (package-source java-tunnelvisionlabs-antlr4-runtime-annotations))
9233 (arguments
9234 (substitute-keyword-arguments (package-arguments antlr4)
9235 ((#:test-dir _)
9236 "tool/test:runtime-testsuite/src")
9237 ((#:phases phases)
9238 `(modify-phases ,phases
9239 (delete 'remove-unrelated-languages)
9240 (delete 'remove-graphemes)
9241 (delete 'generate-test-parsers)
9242 (delete 'check)))))
9243 (native-inputs '())
9244 (inputs
9245 `(("antlr3" ,antlr3)
9246 ("java-antlr4-runtime" ,java-tunnelvisionlabs-antlr4-runtime-bootstrap)
9247 ("java-tunnelvisionlabs-antlr4-runtime-annotations"
9248 ,java-tunnelvisionlabs-antlr4-runtime-annotations)
9249 ("java-icu4j" ,java-icu4j)
9250 ("java-jsonp-api" ,java-jsonp-api)
9251 ("java-stringtemplate" ,java-stringtemplate)
9252 ("java-treelayout" ,java-treelayout)))))
9253
9254(define-public java-tunnelvisionlabs-antlr4-runtime
9255 (package
9256 (inherit java-tunnelvisionlabs-antlr4-runtime-bootstrap)
9257 (native-inputs
9258 (alist-replace
9259 "antlr4" (list java-tunnelvisionlabs-antlr4-bootstrap)
9260 (package-native-inputs java-tunnelvisionlabs-antlr4-runtime-bootstrap)))))
9261
9262(define-public java-tunnelvisionlabs-antlr4
9263 (package
9264 (inherit java-tunnelvisionlabs-antlr4-bootstrap)
9265 (inputs
9266 (alist-replace
9267 "java-antlr4-runtime" (list java-tunnelvisionlabs-antlr4-runtime)
9268 (package-inputs java-tunnelvisionlabs-antlr4-bootstrap)))))
9269
9270(define-public java-commons-cli-1.2
9271 ;; This is a bootstrap dependency for Maven2.
9272 (package
9273 (inherit java-commons-cli)
9274 (version "1.2")
9275 (source (origin
9276 (method url-fetch)
9277 (uri (string-append "mirror://apache/commons/cli/source/"
9278 "commons-cli-" version "-src.tar.gz"))
9279 (sha256
9280 (base32
9281 "0rvfgzgv2pc1m091dfj3ih9ddsjjppr1f1wf0qmc3bk6b1kwv2dm"))))
9282 (arguments
9283 `(#:jar-name "commons-cli.jar"
9284 #:phases
9285 (modify-phases %standard-phases
9286 (add-before 'check 'fix-build-xml
9287 (lambda* (#:key inputs #:allow-other-keys)
9288 (substitute* "build.xml"
9289 (("dir=\"\\$\\{test.home\\}/java\"")
9290 "dir=\"${test.home}\""))
9291 #t)))))
9292 (native-inputs
9293 (list java-junit))))
9294
9295(define-public java-microemulator-cldc
9296 (package
9297 (name "java-microemulator-cldc")
9298 (version "2.0.4")
9299 (source (origin
9300 (method url-fetch)
9301 (uri (string-append "https://github.com/barteo/microemu/archive/"
9302 "microemulator_"
9303 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
9304 version)
9305 ".tar.gz"))
9306 (file-name (string-append name "-" version ".tar.gz"))
9307 (sha256
9308 (base32
9309 "1x1apmz38gkppxnwnygwmi12j54v4p258v8ddzn6dldkk7vak1ll"))))
9310 (build-system ant-build-system)
9311 (arguments
9312 `(#:jar-name "microemulator-cldc.jar"
9313 #:source-dir "microemu-cldc/src/main/java"
9314 #:tests? #f)); Requires even older software
9315 (home-page "https://github.com/barteo/microemu")
9316 (synopsis "J2ME CLDC emulator")
9317 (description "Microemulator is a Java 2 Micro Edition (J2ME) CLDC/MIDP
9318Emulator. It demonstrates MIDlet based applications in web browser
9319applet and can be run as a standalone java application.")
9320 (license (list license:asl2.0
9321 ;; or altenatively:
9322 license:lgpl2.1+))))
9323
9324(define-public java-datanucleus-javax-persistence
9325 (package
9326 (name "java-datanucleus-javax-persistence")
9327 (version "2.2.0")
9328 (source (origin
9329 (method url-fetch)
9330 (uri (string-append "https://github.com/datanucleus/"
9331 "javax.persistence/archive/javax.persistence-"
9332 version "-release.tar.gz"))
9333 (sha256
9334 (base32
9335 "11jx0fjwgc2hhbqqgdd6m1pf2fplf9vslppygax0y1z5csnqjhpx"))))
9336 (build-system ant-build-system)
9337 (arguments
9338 `(#:jar-name "java-datanucleus-javax-persistence.jar"
9339 #:jdk ,icedtea-8
9340 #:source-dir "src/main/java"
9341 #:tests? #f)); no tests
9342 (home-page "https://github.com/datanucleus/javax.persistence")
9343 (synopsis "JPA API")
9344 (description "This package contains a clean definition of JPA API intended
9345for use with DataNucleus JPA since the JCP haven't provided an official JPA API
9346jar. See @url{http://java.net/projects/jpa-spec/downloads} for the specification
9347used to generate this API.")
9348 (license (list license:edl1.0 license:epl1.0))))
9349
9350(define-public java-osgi-cmpn
9351 (package
9352 (name "java-osgi-cmpn")
9353 (version "6.0.0")
9354 (source (origin
9355 (method url-fetch)
9356 (uri (string-append "https://repo1.maven.org/maven2/"
9357 "org/osgi/osgi.cmpn/" version "/osgi.cmpn-"
9358 version "-sources.jar"))
9359 (sha256
9360 (base32
9361 "1lmb6xyrmkqdhv1kayf0514rlwq6ypvs4m44ibrck3snp8241wys"))))
9362 (build-system ant-build-system)
9363 (arguments
9364 `(#:jar-name "osgi-cmpn.jar"
9365 #:tests? #f)); no tests
9366 (inputs
9367 `(("annotation" ,java-osgi-annotation)
9368 ("core" ,java-osgi-core)
9369 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
9370 ("microemulator" ,java-microemulator-cldc)
9371 ("servlet" ,java-classpathx-servletapi)))
9372 (home-page "https://www.osgi.org")
9373 (synopsis "Compendium specification module of OSGi framework")
9374 (description
9375 "OSGi, for Open Services Gateway initiative framework, is a module system
9376and service platform for the Java programming language. This package contains
9377the compendium specification module, providing interfaces and classes for use
9378in compiling bundles.")
9379 (license license:asl2.0)))
9380
9381(define-public java-osgi-service-component-annotations
9382 (package
9383 (name "java-osgi-service-component-annotations")
9384 (version "1.3.0")
9385 (source (origin
9386 (method url-fetch)
9387 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9388 "org.osgi.service.component.annotations/"
9389 version "/org.osgi.service.component.annotations-"
9390 version "-sources.jar"))
9391 (sha256
9392 (base32
9393 "15rq9cmp4fpn74q44m4j35qsqmjf5lx3hcrk6pzvbhc08igic2f0"))))
9394 (build-system ant-build-system)
9395 (arguments
9396 `(#:jar-name "osgi-service-component-annotations.jar"
9397 #:tests? #f)); no tests
9398 (inputs
9399 `(("annotation" ,java-osgi-annotation)))
9400 (home-page "https://www.osgi.org")
9401 (synopsis "Support annotations for osgi-service-component")
9402 (description
9403 "OSGi, for Open Services Gateway initiative framework, is a module system
9404and service platform for the Java programming language. This package contains
9405the support annotations for osgi-service-component.")
9406 (license license:asl2.0)))
9407
9408(define-public java-osgi-dto
9409 (package
9410 (name "java-osgi-dto")
9411 (version "1.0.0")
9412 (source (origin
9413 (method url-fetch)
9414 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9415 "org.osgi.dto/" version "/org.osgi.dto-"
9416 version "-sources.jar"))
9417 (sha256
9418 (base32
9419 "0f4bqjzadn0hwk6sd3h5gvbyfp3yci1s6r0v770cc15p0pg627yr"))))
9420 (build-system ant-build-system)
9421 (arguments
9422 `(#:jar-name "osgi-dto.jar"
9423 #:tests? #f)); no tests
9424 (inputs
9425 `(("annotation" ,java-osgi-annotation)))
9426 (home-page "https://www.osgi.org")
9427 (synopsis "Data Transfer Objects")
9428 (description
9429 "OSGi, for Open Services Gateway initiative framework, is a module system
9430and service platform for the Java programming language. This package contains
9431the Data Transfer Objects. It is easily serializable having only public fields
9432of primitive types and their wrapper classes, Strings, and DTOs. List, Set,
9433Map and array aggregates may also be used. The aggregates must only hold
9434objects of the listed types or aggregates.")
9435 (license license:asl2.0)))
9436
9437(define-public java-osgi-resource
9438 (package
9439 (name "java-osgi-resource")
9440 (version "1.0.0")
9441 (source (origin
9442 (method url-fetch)
9443 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9444 "org.osgi.resource/"
9445 version "/org.osgi.resource-"
9446 version "-sources.jar"))
9447 (sha256
9448 (base32
9449 "0hi0fsc5v99q22bd7lrkvpz1y0ds4w9arjldpwsrcpqvz2js7q2d"))))
9450 (build-system ant-build-system)
9451 (arguments
9452 `(#:jar-name "osgi-resource.jar"
9453 #:tests? #f)); no tests
9454 (inputs
9455 `(("annotation" ,java-osgi-annotation)
9456 ("dto" ,java-osgi-dto)))
9457 (home-page "https://www.osgi.org")
9458 (synopsis "OSGI Resource")
9459 (description
9460 "OSGi, for Open Services Gateway initiative framework, is a module system
9461and service platform for the Java programming language. This package contains
9462the definition of common types in osgi packages.")
9463 (license license:asl2.0)))
9464
9465(define-public java-osgi-namespace-contract
9466 (package
9467 (name "java-osgi-namespace-contract")
9468 (version "1.0.0")
9469 (source (origin
9470 (method url-fetch)
9471 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9472 "org.osgi.namespace.contract/"
9473 version "/org.osgi.namespace.contract-"
9474 version "-sources.jar"))
9475 (sha256
9476 (base32
9477 "1iz4f2i0fvqrlq90ki9nfzcfpvy2av434ri25bglywqssx8mmp36"))))
9478 (build-system ant-build-system)
9479 (inputs
9480 `(("resource" ,java-osgi-resource)
9481 ("annotation" ,java-osgi-annotation)))
9482 (arguments
9483 `(#:jar-name "osgi-namespace-contract.jar"
9484 #:tests? #f)); no tests
9485 (home-page "https://www.osgi.org")
9486 (synopsis "Contract Capability and Requirement Namespace")
9487 (description
9488 "OSGi, for Open Services Gateway initiative framework, is a module system
9489and service platform for the Java programming language. This package contains
9490the names for the attributes and directives for a namespace with contracts.")
9491 (license license:asl2.0)))
9492
9493(define-public java-osgi-namespace-extender
9494 (package
9495 (name "java-osgi-namespace-extender")
9496 (version "1.0.1")
9497 (source (origin
9498 (method url-fetch)
9499 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9500 "org.osgi.namespace.extender/"
9501 version "/org.osgi.namespace.extender-"
9502 version "-sources.jar"))
9503 (sha256
9504 (base32
9505 "0jgqiak2i05qv6j3gd33xlaifzzc0ylxxk376v2x0apfg3vvixmz"))))
9506 (build-system ant-build-system)
9507 (inputs
9508 `(("resource" ,java-osgi-resource)
9509 ("annotation" ,java-osgi-annotation)))
9510 (arguments
9511 `(#:jar-name "osgi-namespace-extendent.jar"
9512 #:tests? #f)); no tests
9513 (home-page "https://www.osgi.org")
9514 (synopsis "Extender Capability and Requirement Namespace")
9515 (description
9516 "OSGi, for Open Services Gateway initiative framework, is a module system
9517and service platform for the Java programming language. This package contains
9518the names for the attributes and directives for an extender namespace.")
9519 (license license:asl2.0)))
9520
9521(define-public java-osgi-namespace-service
9522 (package
9523 (name "java-osgi-namespace-service")
9524 (version "1.0.0")
9525 (source (origin
9526 (method url-fetch)
9527 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9528 "org.osgi.namespace.service/"
9529 version "/org.osgi.namespace.service-"
9530 version "-sources.jar"))
9531 (sha256
9532 (base32
9533 "0qmw8n2449nkmm56d1znz9zhazb6ya3vsimd5bf5jg23zzhgl8c8"))))
9534 (build-system ant-build-system)
9535 (inputs
9536 `(("resource" ,java-osgi-resource)
9537 ("annotation" ,java-osgi-annotation)))
9538 (arguments
9539 `(#:jar-name "osgi-namespace-service.jar"
9540 #:tests? #f)); no tests
9541 (home-page "https://www.osgi.org")
9542 (synopsis "Service Capability and Requirement Namespace")
9543 (description
9544 "OSGi, for Open Services Gateway initiative framework, is a module system
9545and service platform for the Java programming language. This package contains
9546the names for the attributes and directives for a service namespace.")
9547 (license license:asl2.0)))
9548
9549(define-public java-osgi-util-function
9550 (package
9551 (name "java-osgi-util-function")
9552 (version "1.0.0")
9553 (source (origin
9554 (method url-fetch)
9555 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9556 "org.osgi.util.function/"
9557 version "/org.osgi.util.function-"
9558 version "-sources.jar"))
9559 (sha256
9560 (base32
9561 "04l7j3hwmmj28w23m7paca0afzncs42j2mdr3liqq8kvp548sc6x"))))
9562 (build-system ant-build-system)
9563 (arguments
9564 `(#:jar-name "osgi-util-function.jar"
9565 #:tests? #f)); no tests
9566 (inputs
9567 `(("annotation" ,java-osgi-annotation)))
9568 (home-page "https://www.osgi.org")
9569 (synopsis "OSGI Util Function")
9570 (description
9571 "OSGi, for Open Services Gateway initiative framework, is a module system
9572and service platform for the Java programming language. This package contains
9573an interface for a function that accepts a single argument and produces a result.")
9574 (license license:asl2.0)))
9575
9576(define-public java-osgi-util-promise
9577 (package
9578 (name "java-osgi-util-promise")
9579 (version "1.0.0")
9580 (source (origin
9581 (method url-fetch)
9582 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9583 "org.osgi.util.promise/"
9584 version "/org.osgi.util.promise-"
9585 version "-sources.jar"))
9586 (sha256
9587 (base32
9588 "0y34dwiflg1c4ahvkswpf9z02xph2sr9fm04ia5493x3lshpw22c"))))
9589 (build-system ant-build-system)
9590 (arguments
9591 `(#:jar-name "osgi-util-promise.jar"
9592 #:tests? #f)); no tests
9593 (inputs
9594 `(("annotation" ,java-osgi-annotation)
9595 ("function" ,java-osgi-util-function)))
9596 (home-page "https://www.osgi.org")
9597 (synopsis "Promise of a value")
9598 (description
9599 "OSGi, for Open Services Gateway initiative framework, is a module system
9600and service platform for the Java programming language. This package contains
9601an interface and utilitary classes for promises. A Promise represents a future
9602value. It handles the interactions for asynchronous processing.")
9603 (license license:asl2.0)))
9604
9605(define-public java-osgi-service-metatype-annotations
9606 (package
9607 (name "java-osgi-service-metatype-annotations")
9608 (version "1.3.0")
9609 (source (origin
9610 (method url-fetch)
9611 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9612 "org.osgi.service.metatype.annotations/"
9613 version "/org.osgi.service.metatype.annotations-"
9614 version "-sources.jar"))
9615 (sha256
9616 (base32
9617 "12rwm3349wk80vm88rcdgs4435m4jxkpkj5mrx326skkz2c6hyw6"))))
9618 (build-system ant-build-system)
9619 (arguments
9620 `(#:jar-name "osgi-service-metatype-annotations.jar"
9621 #:tests? #f)); no tests
9622 (inputs
9623 `(("annotation" ,java-osgi-annotation)))
9624 (home-page "https://www.osgi.org")
9625 (synopsis "Support annotations for metatype")
9626 (description
9627 "OSGi, for Open Services Gateway initiative framework, is a module system
9628and service platform for the Java programming language. This package contains
9629the support annotations for metatype.")
9630 (license license:asl2.0)))
9631
9632(define-public java-osgi-service-repository
9633 (package
9634 (name "java-osgi-service-repository")
9635 (version "1.1.0")
9636 (source (origin
9637 (method url-fetch)
9638 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9639 "org.osgi.service.repository/"
9640 version "/org.osgi.service.repository-"
9641 version "-sources.jar"))
9642 (sha256
9643 (base32
9644 "1k41mhg7b58pd8nsghr2qwcjrxdnf1p9spsw9v11k4257g6rl06n"))))
9645 (build-system ant-build-system)
9646 (arguments
9647 `(#:jar-name "osgi-service-repository.jar"
9648 #:tests? #f)); no tests
9649 (inputs
9650 `(("annotation" ,java-osgi-annotation)
9651 ("promise" ,java-osgi-util-promise)
9652 ("resource" ,java-osgi-resource)))
9653 (home-page "https://www.osgi.org")
9654 (synopsis "OSGI service repository")
9655 (description
9656 "OSGi, for Open Services Gateway initiative framework, is a module system
9657and service platform for the Java programming language. This package contains
9658a repository service that contains resources.")
9659 (license license:asl2.0)))
9660
9661(define-public java-osgi-framework
9662 (package
9663 (name "java-osgi-framework")
9664 (version "1.8.0")
9665 (source (origin
9666 (method url-fetch)
9667 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9668 "org.osgi.framework/" version "/org.osgi.framework-"
9669 version "-sources.jar"))
9670 (sha256
9671 (base32
9672 "1lwp2zfad3rybcc6q9bwz8xsgkc92ypzy5p6x54387f1qj65m73s"))))
9673 (build-system ant-build-system)
9674 (arguments
9675 `(#:jar-name "osgi-framework.jar"
9676 #:tests? #f)); no tests
9677 (inputs
9678 `(("annotation" ,java-osgi-annotation)
9679 ("resource" ,java-osgi-resource)
9680 ("dto" ,java-osgi-dto)))
9681 (home-page "https://www.osgi.org")
9682 (synopsis "OSGi framework")
9683 (description
9684 "OSGi, for Open Services Gateway initiative framework, is a module system
9685and service platform for the Java programming language.")
9686 (license license:asl2.0)))
9687
9688(define-public java-osgi-service-log
9689 (package
9690 (name "java-osgi-service-log")
9691 (version "1.3.0")
9692 (source (origin
9693 (method url-fetch)
9694 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9695 "org.osgi.service.log/"
9696 version "/org.osgi.service.log-"
9697 version "-sources.jar"))
9698 (sha256
9699 (base32
9700 "1029j30dzcwializzca0j3fkhwwz08kmmsha5agw1iccscimj6r0"))))
9701 (build-system ant-build-system)
9702 (arguments
9703 `(#:jar-name "osgi-service-log.jar"
9704 #:tests? #f)); no tests
9705 (inputs
9706 (list java-osgi-framework))
9707 (home-page "https://www.osgi.org")
9708 (synopsis "Provides methods for bundles to write messages to the log")
9709 (description
9710 "OSGi, for Open Services Gateway initiative framework, is a module system
9711and service platform for the Java programming language. This package contains
9712the log service.")
9713 (license license:asl2.0)))
9714
9715(define-public java-osgi-service-jdbc
9716 (package
9717 (name "java-osgi-service-jdbc")
9718 (version "1.0.0")
9719 (source (origin
9720 (method url-fetch)
9721 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9722 "org.osgi.service.jdbc/"
9723 version "/org.osgi.service.jdbc-"
9724 version "-sources.jar"))
9725 (sha256
9726 (base32
9727 "11iln5v7bk469cgb9ddkrz9sa95b3733gqgaqw9xf5g6wq652yjz"))))
9728 (build-system ant-build-system)
9729 (arguments
9730 `(#:jar-name "osgi-service-jdbc.jar"
9731 #:tests? #f)); no tests
9732 (home-page "https://www.osgi.org")
9733 (synopsis "Factory for JDBC connection factories")
9734 (description
9735 "OSGi, for Open Services Gateway initiative framework, is a module system
9736and service platform for the Java programming language. This package contains
9737a factory for JDBC connection factories. There are 3 preferred connection
9738factories for getting JDBC connections:
9739
9740@itemize
9741@item @code{javax.sql.DataSource};
9742@item @code{javax.sql.ConnectionPoolDataSource};
9743@item @code{javax.sql.XADataSource}.
9744@end itemize")
9745 (license license:asl2.0)))
9746
9747(define-public java-osgi-service-resolver
9748 (package
9749 (name "java-osgi-service-resolver")
9750 (version "1.0.1")
9751 (source (origin
9752 (method url-fetch)
9753 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9754 "org.osgi.service.resolver/"
9755 version "/org.osgi.service.resolver-"
9756 version "-sources.jar"))
9757 (sha256
9758 (base32
9759 "1dzqn1ryfi2rq4zwsgp44bmj2wlfydjg1qbxw2b0z4xdjjy55vxd"))))
9760 (build-system ant-build-system)
9761 (arguments
9762 `(#:jar-name "osgi-service-resolver.jar"
9763 #:tests? #f)); no tests
9764 (inputs
9765 `(("annotation" ,java-osgi-annotation)
9766 ("resource" ,java-osgi-resource)))
9767 (home-page "https://www.osgi.org")
9768 (synopsis "OSGI Resolver service")
9769 (description
9770 "OSGi, for Open Services Gateway initiative framework, is a module system
9771and service platform for the Java programming language. This package contains
9772a resolver service that resolves the specified resources in the context supplied
9773by the caller.")
9774 (license license:asl2.0)))
9775
9776(define-public java-osgi-util-tracker
9777 (package
9778 (name "java-osgi-util-tracker")
9779 (version "1.5.1")
9780 (source (origin
9781 (method url-fetch)
9782 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9783 "org.osgi.util.tracker/"
9784 version "/org.osgi.util.tracker-"
9785 version "-sources.jar"))
9786 (sha256
9787 (base32
9788 "0c4fh9vxwzsx59r8dygda0gq2gx3z5vfhc3jsphlqwf5w0h403lz"))))
9789 (build-system ant-build-system)
9790 (arguments
9791 `(#:jar-name "osgi-util-tracker.jar"
9792 #:tests? #f)); no tests
9793 (inputs
9794 `(("framework" ,java-osgi-framework)
9795 ("annotation" ,java-osgi-annotation)))
9796 (home-page "https://www.osgi.org")
9797 (synopsis "Bundle tracking")
9798 (description
9799 "OSGi, for Open Services Gateway initiative framework, is a module system
9800and service platform for the Java programming language. This package contains
9801bundle tracking utility classes.")
9802 (license license:asl2.0)))
9803
9804(define-public java-osgi-service-cm
9805 (package
9806 (name "java-osgi-service-cm")
9807 (version "1.5.0")
9808 (source (origin
9809 (method url-fetch)
9810 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9811 "org.osgi.service.cm/"
9812 version "/org.osgi.service.cm-"
9813 version "-sources.jar"))
9814 (sha256
9815 (base32
9816 "1z8kap48y3xi0ggj8v6czglfnpnd94mmismgi2wbqhj1nl5fzbp6"))))
9817 (build-system ant-build-system)
9818 (arguments
9819 `(#:jar-name "osgi-service-cm.jar"
9820 #:tests? #f)); no tests
9821 (inputs
9822 `(("framework" ,java-osgi-framework)
9823 ("annotation" ,java-osgi-annotation)))
9824 (home-page "https://www.osgi.org")
9825 (synopsis "OSGI Configuration Management")
9826 (description
9827 "OSGi, for Open Services Gateway initiative framework, is a module system
9828and service platform for the Java programming language. This package contains
9829utility classes for the configuration of services.")
9830 (license license:asl2.0)))
9831
9832(define-public java-osgi-service-packageadmin
9833 (package
9834 (name "java-osgi-service-packageadmin")
9835 (version "1.2.0")
9836 (source (origin
9837 (method url-fetch)
9838 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9839 "org.osgi.service.packageadmin/"
9840 version "/org.osgi.service.packageadmin-"
9841 version "-sources.jar"))
9842 (sha256
9843 (base32
9844 "041mpxzi7g36wmcily6y4ccn3jx15akpdy8gmhyb7m98x7qfvn52"))))
9845 (build-system ant-build-system)
9846 (arguments
9847 `(#:jar-name "osgi-service-packageadmin.jar"
9848 #:tests? #f)); no tests
9849 (inputs
9850 `(("framework" ,java-osgi-framework)))
9851 (home-page "https://www.osgi.org")
9852 (synopsis "OSGI Package Administration")
9853 (description
9854 "OSGi, for Open Services Gateway initiative framework, is a module system
9855and service platform for the Java programming language. This package contains
9856the packageadmin service.")
9857 (license license:asl2.0)))
9858
9859(define-public java-ops4j-base-lang
9860 (package
9861 (name "java-ops4j-base-lang")
9862 (version "1.5.0")
9863 (source (origin
9864 (method url-fetch)
9865 (uri (string-append "https://github.com/ops4j/org.ops4j.base/"
9866 "archive/base-" version ".tar.gz"))
9867 (sha256
9868 (base32
9869 "18hl3lpchgpv8yh5rlk39l2gif5dlfgb8gxjmncf39pr2dprkniw"))))
9870 (build-system ant-build-system)
9871 (arguments
9872 `(#:jar-name "java-ops4j-base-lang.jar"
9873 #:source-dir "ops4j-base-lang/src/main/java"
9874 #:tests? #f; no tests
9875 #:phases
9876 (modify-phases %standard-phases
9877 (add-before 'build 'add-test-file
9878 (lambda _
9879 ;; That file is required by a test in ops4j-pax-exam-core-spi
9880 (mkdir-p "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang")
9881 (with-output-to-file "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang/pom.properties"
9882 (lambda _
9883 (display
9884 (string-append
9885 "version=" ,version "\n"
9886 "groupId=org.ops4j.base"
9887 "artifactId=ops4j-base-lang\n"))))
9888 #t)))))
9889 (home-page "https://ops4j1.jira.com/wiki/spaces/base/overview")
9890 (synopsis "Utility classes and extensions to be used in OPS4J projects")
9891 (description "OPS4J stands for Open Participation Software for Java. This
9892package contains utilities and extensions related to @code{java.lang}.")
9893 (license license:asl2.0)))
9894
9895(define-public java-ops4j-base-monitors
9896 (package
9897 (inherit java-ops4j-base-lang)
9898 (name "java-ops4j-base-monitors")
9899 (arguments
9900 `(#:jar-name "java-ops4j-base-monitors.jar"
9901 #:source-dir "ops4j-base-monitors/src/main/java"
9902 #:tests? #f)); no tests
9903 (inputs
9904 `(("lang" ,java-ops4j-base-lang)))
9905 (description "OPS4J stands for Open Participation Software for Java. This
9906package contains utilities and extensions related to monitoring.")))
9907
9908(define-public java-ops4j-base-io
9909 (package
9910 (inherit java-ops4j-base-lang)
9911 (name "java-ops4j-base-io")
9912 (arguments
9913 `(#:jar-name "java-ops4j-base-io.jar"
9914 #:source-dir "ops4j-base-io/src/main/java"
9915 #:test-dir "ops4j-base-io/src/test"
9916 #:test-exclude
9917 (list "**/ListerTest.java")))
9918 (inputs
9919 `(("lang" ,java-ops4j-base-monitors)
9920 ("lang" ,java-ops4j-base-lang)))
9921 (native-inputs
9922 `(("junit" ,java-junit)
9923 ("hamcrest" ,java-hamcrest-core)))
9924 (description "OPS4J stands for Open Participation Software for Java. This
9925package contains utilities and extensions related to handling streams and files.")))
9926
9927(define-public java-ops4j-base-util
9928 (package
9929 (inherit java-ops4j-base-lang)
9930 (name "java-ops4j-base-util")
9931 (arguments
9932 `(#:jar-name "java-ops4j-base-util.jar"
9933 #:source-dir "ops4j-base-util/src/main/java"
9934 #:test-dir "ops4j-base-util/src/test"))
9935 (inputs
9936 `(("lang" ,java-ops4j-base-lang)))
9937 (native-inputs
9938 `(("junit" ,java-junit)))
9939 (description "OPS4J stands for Open Participation Software for Java. This
9940package contains utilities and extensions related to environment, i18n and
9941mime types.")))
9942
9943(define-public java-ops4j-base-util-property
9944 (package
9945 (inherit java-ops4j-base-lang)
9946 (name "java-ops4j-base-util-property")
9947 (arguments
9948 `(#:jar-name "java-ops4j-base-util-property.jar"
9949 #:source-dir "ops4j-base-util-property/src/main/java"
9950 #:tests? #f)); no tests
9951 (inputs
9952 `(("lang" ,java-ops4j-base-lang)
9953 ("util" ,java-ops4j-base-util)))
9954 (description "OPS4J stands for Open Participation Software for Java. This
9955package contains utilities and extensions related to resolving properties from
9956different sources.")))
9957
9958(define-public java-ops4j-base-store
9959 (package
9960 (inherit java-ops4j-base-lang)
9961 (name "java-ops4j-base-store")
9962 (arguments
9963 `(#:jar-name "java-ops4j-base-store.jar"
9964 #:source-dir "ops4j-base-store/src/main/java"
9965 #:tests? #f)); no tests
9966 (inputs
9967 `(("lang" ,java-ops4j-base-lang)
9968 ("slf4j" ,java-slf4j-api)
9969 ("io" ,java-ops4j-base-io)))
9970 (description "OPS4J stands for Open Participation Software for Java. This
9971package contains utilities for storing and retrieving data from an
9972@code{InputStream}.")))
9973
9974(define-public java-ops4j-base-spi
9975 (package
9976 (inherit java-ops4j-base-lang)
9977 (name "java-ops4j-base-spi")
9978 (arguments
9979 `(#:jar-name "java-ops4j-base-spi.jar"
9980 #:source-dir "ops4j-base-spi/src/main/java"
9981 #:test-dir "ops4j-base-spi/src/test"))
9982 (native-inputs
9983 `(("junit" ,java-junit)
9984 ("hamcrest" ,java-hamcrest-core)))
9985 (description "OPS4J stands for Open Participation Software for Java. This
9986package contains utilities for obtaining services via the Java SE 6
9987@code{ServiceLoader}.")))
9988
9989(define-public java-aqute-bnd-annotation
9990 (package
9991 (name "java-aqute-bnd-annotation")
9992 (version "3.5.0")
9993 (source (origin
9994 (method url-fetch)
9995 (uri (string-append "https://github.com/bndtools/bnd/archive/"
9996 version ".REL.tar.gz"))
9997 (file-name (string-append name "-" version ".tar.gz"))
9998 (sha256
9999 (base32
10000 "1ggyiq0as0f6cz333a0dh98j72kmvv5pf2s47v9554yh905lfqdl"))))
10001 (build-system ant-build-system)
10002 (arguments
10003 `(#:jar-name "java-aqute-bnd-annotation.jar"
10004 #:source-dir "biz.aQute.bnd.annotation/src"
10005 #:tests? #f)); empty test dir
10006 (home-page "https://bnd.bndtools.org/")
10007 (synopsis "Tools for OSGi")
10008 (description "Bnd is a swiss army knife for OSGi, it creates manifest
10009headers based on analyzing the class code, it verifies the project settings,
10010it manages project dependencies, gives diffs jars, and much more.")
10011 (license license:asl2.0)))
10012
10013(define-public java-aqute-libg
10014 (package
10015 (inherit java-aqute-bnd-annotation)
10016 (name "java-aqute-libg")
10017 (arguments
10018 `(#:jar-name "java-aqute-libg.jar"
10019 ;; The build fails when source/target more recent than 1.7. This
10020 ;; is a known issue. See: https://github.com/bndtools/bnd/issues/1327
10021 ;;
10022 ;; It is closed as won't fix. There is no way to change the source
10023 ;; so that it works on 1.8, and still works on 1.6, the upstream
10024 ;; target. It work fine on 1.7, so we use 1.7.
10025 #:make-flags (list "-Dant.build.javac.source=1.7"
10026 "-Dant.build.javac.target=1.7")
10027 #:phases
10028 (modify-phases %standard-phases
10029 (add-before 'configure 'chdir
10030 ;; Change to aQute.libg directory, so that the relative
10031 ;; paths in the tests aren't broken.
10032 (lambda _
10033 (chdir "aQute.libg")
10034 #t))
10035 (add-before 'check 'create-test-directory
10036 ;; Copy the test directory to test/java, since that's where
10037 ;; ant-build-system's default project in build.xml expects to find
10038 ;; the test classes. Leave a copy in the original place to not
10039 ;; break paths in tests.
10040 (lambda _
10041 (mkdir "src/test")
10042 (copy-recursively "test" "src/test/java")
10043 #t)))))
10044 (inputs
10045 `(("slf4j" ,java-slf4j-api)
10046 ("osgi-annot" ,java-osgi-annotation)
10047 ("java-osgi-cmpn" ,java-osgi-cmpn)
10048 ("osgi" ,java-osgi-core)))
10049 (native-inputs
10050 `(("hamcrest" ,java-hamcrest-core)
10051 ("java-junit" ,java-junit)))))
10052
10053(define-public java-aqute-bndlib
10054 (package
10055 (inherit java-aqute-bnd-annotation)
10056 (name "java-aqute-bndlib")
10057 (arguments
10058 `(#:jar-name "java-bndlib.jar"
10059 #:source-dir "biz.aQute.bndlib/src"
10060 #:tests? #f)); no tests
10061 (inputs
10062 `(("slf4j" ,java-slf4j-api)
10063 ("osgi-annot" ,java-osgi-annotation)
10064 ("java-aqute-libg" ,java-aqute-libg)
10065 ("java-aqute-bnd-annotation" ,java-aqute-bnd-annotation)
10066 ("java-osgi-service-component-annotations" ,java-osgi-service-component-annotations)
10067 ("java-osgi-service-repository" ,java-osgi-service-repository)
10068 ("java-osgi-service-log" ,java-osgi-service-log)
10069 ("java-osgi-service-metatype-annotations" ,java-osgi-service-metatype-annotations)
10070 ("java-osgi-namespace-contract" ,java-osgi-namespace-contract)
10071 ("java-osgi-namespace-extender" ,java-osgi-namespace-extender)
10072 ("java-osgi-namespace-service" ,java-osgi-namespace-service)
10073 ("promise" ,java-osgi-util-promise)
10074 ("osgi" ,java-osgi-core)))))
10075
10076(define-public java-ops4j-pax-tinybundles
10077 (package
10078 (name "java-ops4j-pax-tinybundles")
10079 (version "2.1.1")
10080 (source (origin
10081 (method url-fetch)
10082 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.tinybundles/"
10083 "archive/tinybundles-" version ".tar.gz"))
10084 (sha256
10085 (base32
10086 "0y0gq3pvv0iir2b885lmlwnvr724vv7vklzhhr4fs27d7mdkj871"))))
10087 (arguments
10088 `(#:jar-name "java-ops4j-pax-tinybundles.jar"
10089 #:source-dir "src/main/java"
10090 #:test-exclude
10091 ;; Abstract base classes for other tests
10092 (list "**/BndTest.java" "**/CoreTest.java")
10093 #:phases
10094 (modify-phases %standard-phases
10095 (add-before 'check 'fix-version
10096 (lambda _
10097 ;; This test has a reference to an old version of bndlib we are not
10098 ;; packaging. It uses the version referenced in pom.xml. We replace
10099 ;; it with our own version.
10100 (substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
10101 (("[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*")
10102 ,(package-version java-aqute-bndlib)))
10103 #t)))))
10104 (inputs
10105 `(("lang" ,java-ops4j-base-lang)
10106 ("io" ,java-ops4j-base-io)
10107 ("store" ,java-ops4j-base-store)
10108 ("slf4j" ,java-slf4j-api)
10109 ("libg" ,java-aqute-libg)
10110 ("bndlib" ,java-aqute-bndlib)))
10111 (native-inputs
10112 `(("junit" ,java-junit)
10113 ("hamcrest" ,java-hamcrest-core)
10114 ("log4j" ,java-log4j-api)
10115 ("bndannotation" ,java-aqute-bnd-annotation)
10116 ("framework" ,java-osgi-framework)))
10117 (build-system ant-build-system)
10118 (home-page "https://ops4j1.jira.com/wiki/spaces/ops4j/pages/12060312/Tinybundles")
10119 (synopsis "Java APIs to create OSGi related artifacts")
10120 (description "Tinybundles is all about creating OSGi related artifacts like
10121Bundles, Fragments and Deployment Packages with Java Api. It is very convenient
10122to create such artifacts on-the-fly inside Tests (like in Pax Exam). On the
10123other hand, this library can be a foundation of real end user tools that need
10124to create those artifacts.")
10125 (license license:asl2.0)))
10126
10127(define-public java-ops4j-pax-exam-core
10128 (package
10129 (name "java-ops4j-pax-exam-core")
10130 (version "4.11.0")
10131 (source (origin
10132 (method url-fetch)
10133 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.exam2/"
10134 "archive/exam-reactor-" version ".tar.gz"))
10135 (sha256
10136 (base32
10137 "1b0f89gawxyl0pkqx9sicp6n58pirkzhjw41y749bwrkb6h99i26"))))
10138 (arguments
10139 (list #:jar-name "java-ops4j-pax-exam-core.jar"
10140 #:source-dir "core/pax-exam/src/main/java"
10141 #:test-dir "core/pax-exam/src/test"))
10142 (inputs
10143 (list java-slf4j-api
10144 java-ops4j-base-lang
10145 java-ops4j-base-io
10146 java-ops4j-base-util-property
10147 java-ops4j-base-store
10148 java-osgi-core))
10149 (native-inputs
10150 (list java-junit
10151 java-hamcrest-core))
10152 (build-system ant-build-system)
10153 (home-page "https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/overview")
10154 (synopsis "In-Container Testing for OSGi, Java EE and CDI")
10155 (description "Pax Exam creates OSGi bundles for testing purposes. It lets
10156the user take control of the OSGi framework, the test framework (e.g. JUnit) and
10157the system under test at the same time.")
10158 (license license:asl2.0)))
10159
10160(define-public java-ops4j-pax-exam-core-spi
10161 (package
10162 (inherit java-ops4j-pax-exam-core)
10163 (name "java-ops4j-pax-exam-core-spi")
10164 (arguments
10165 `(#:jar-name "java-ops4j-pax-exam-spi.jar"
10166 #:source-dir "src/main/java"
10167 #:test-exclude
10168 (list
10169 ;; Abstract base class, not a test
10170 "**/BaseStagedReactorTest.java"
10171 ;; Depends on org.mortbay.jetty.testwars:test-war-dump
10172 "**/WarBuilderTest.java")
10173 #:phases
10174 (modify-phases %standard-phases
10175 (add-before 'configure 'chdir
10176 (lambda _
10177 ;; Tests assume we are in this directory
10178 (chdir "core/pax-exam-spi")
10179 #t))
10180 (add-before 'check 'fix-tests
10181 (lambda _
10182 ;; One test checks that this file is present.
10183 (mkdir-p "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi")
10184 (with-output-to-file
10185 "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi/pom.properties"
10186 (lambda _
10187 (display
10188 (string-append "artifactId = pax-exam-spi\n"
10189 "version = " ,(package-version java-ops4j-pax-exam-core-spi)))))
10190 ;; Maven puts compilation results in the target directory, while we
10191 ;; put them in the build directory.
10192 (substitute* '("src/test/java/org/ops4j/pax/exam/spi/war/WarBuilderTest.java"
10193 "src/test/java/org/ops4j/pax/exam/spi/war/WarTestProbeBuilderTest.java"
10194 "src/test/java/org/ops4j/pax/exam/spi/war/ZipBuilderTest.java")
10195 (("target") "build"))
10196 ;; One test is expected to fail, but it doesn't throw the expected exception
10197 (substitute* "src/test/java/org/ops4j/pax/exam/spi/reactors/BaseStagedReactorTest.java"
10198 (("AssertionError") "IllegalArgumentException"))
10199 #t)))))
10200 (inputs
10201 `(("java-ops4j-pax-exam-core" ,java-ops4j-pax-exam-core)
10202 ("lang" ,java-ops4j-base-lang)
10203 ("monitors" ,java-ops4j-base-monitors)
10204 ("store" ,java-ops4j-base-store)
10205 ("io" ,java-ops4j-base-io)
10206 ("spi" ,java-ops4j-base-spi)
10207 ("osgi" ,java-osgi-core)
10208 ("slf4j" ,java-slf4j-api)
10209 ("tinybundles" ,java-ops4j-pax-tinybundles)))
10210 (native-inputs
10211 `(("mockito" ,java-mockito-1)
10212 ("junit" ,java-junit)
10213 ("hamcrest" ,java-hamcrest-core)
10214 ("cglib" ,java-cglib)
10215 ("objenesis" ,java-objenesis)))))
10216
10217(define-public java-ops4j-pax-exam-core-junit
10218 (package
10219 (inherit java-ops4j-pax-exam-core)
10220 (name "java-ops4j-pax-exam-core-junit")
10221 (arguments
10222 `(#:jar-name "ops4j-pax-exam-core-junit.jar"
10223 #:source-dir "drivers/pax-exam-junit4/src/main/java"
10224 #:tests? #f)); no tests
10225 (inputs
10226 `(("junit" ,java-junit)
10227 ("slf4j" ,java-slf4j-api)
10228 ("core" ,java-ops4j-pax-exam-core)
10229 ("spi" ,java-ops4j-pax-exam-core-spi)))
10230 (native-inputs '())))
10231
10232(define-public java-fasterxml-jackson-annotations
10233 (package
10234 (name "java-fasterxml-jackson-annotations")
10235 (version "2.9.4")
10236 (source (origin
10237 (method url-fetch)
10238 (uri (string-append "https://github.com/FasterXML/"
10239 "jackson-annotations/archive/"
10240 "jackson-annotations-" version ".tar.gz"))
10241 (sha256
10242 (base32
10243 "0mr95xd0da6a4g95zvrl1ryk5n5zv2rc696w3xnsr5hxk2gicfc4"))))
10244 (build-system ant-build-system)
10245 (arguments
10246 `(#:jar-name "jackson-annotations.jar"
10247 #:source-dir "src/main/java"
10248 #:test-dir "src/test"))
10249 (native-inputs
10250 `(("junit" ,java-junit)))
10251 (home-page "https://github.com/FasterXML/jackson-annotations")
10252 (synopsis "General purpose annotations for the Jackson Data Processor")
10253 (description "This package contains general purpose annotations for the
10254Jackson Data Processor, used on value and handler types. The only annotations
10255not included are ones that require dependency to the Databind package.")
10256 (license license:asl2.0)))
10257
10258(define-public java-fasterxml-jackson-core
10259 (package
10260 (name "java-fasterxml-jackson-core")
10261 (version "2.9.4")
10262 (source (origin
10263 (method url-fetch)
10264 (uri (string-append "https://github.com/FasterXML/"
10265 "jackson-core/archive/"
10266 "jackson-core-" version ".tar.gz"))
10267 (sha256
10268 (base32
10269 "159hsnk17jr1gyzkf01cxvsn45srnk37g949r7364qlsr527gjgd"))))
10270 (build-system ant-build-system)
10271 (arguments
10272 `(#:jar-name "jackson-core.jar"
10273 #:source-dir "src/main/java"
10274 #:test-dir "src/test"
10275 #:test-exclude
10276 (list
10277 ;; Expected failure. pom.xml excludes these
10278 "**/failing/**"
10279 ;; Base classes that have no constructor for junit
10280 "**/BaseTest.java"
10281 "**/ConcurrencyReadTest.java"
10282 "**/ManualCharAccessTest.java"
10283 "**/ManualCharAccessTest.java"
10284 "**/TrailingCommasTest.java"
10285 "**/AsyncMissingValuesInObjectTest.java"
10286 "**/AsyncMissingValuesInArrayTest.java")
10287 #:phases
10288 (modify-phases %standard-phases
10289 (add-before 'configure 'generate-PackageVersion.java
10290 (lambda _
10291 (let* ((out "src/main/java/com/fasterxml/jackson/core/json/PackageVersion.java")
10292 (in (string-append out ".in")))
10293 (copy-file in out)
10294 (substitute* out
10295 (("@package@") "com.fasterxml.jackson.core.json")
10296 (("@projectversion@") ,version)
10297 (("@projectgroupid@") "com.fasterxml.jackson.core")
10298 (("@projectartifactid@") "jackson-core")))
10299 #t))
10300 (add-before 'build 'copy-resources
10301 (lambda _
10302 (copy-recursively "src/main/resources"
10303 "build/classes")
10304 #t))
10305 (add-before 'check 'copy-test-resources
10306 (lambda _
10307 (copy-recursively "src/test/resources"
10308 "build/test-classes")
10309 #t)))))
10310 (native-inputs
10311 `(("junit" ,java-junit)
10312 ("hamcrest" ,java-hamcrest-core)))
10313 (home-page "https://github.com/FasterXML/jackson-core")
10314 (synopsis "Low-level streaming parser and generator abstractions")
10315 (description "This package contains core low-level incremental
10316(streaming) parser and generator abstractions used by the Jackson Data
10317Processor. It also includes the default implementation of handler types
10318(parser, generator) that handle JSON format.")
10319 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10320
10321(define-public java-fasterxml-jackson-databind
10322 (package
10323 (name "java-fasterxml-jackson-databind")
10324 (version "2.9.4")
10325 (source (origin
10326 (method url-fetch)
10327 (uri (string-append "https://github.com/FasterXML/"
10328 "jackson-databind/archive/"
10329 "jackson-databind-" version ".tar.gz"))
10330 (sha256
10331 (base32
10332 "1zd2cw4z6kdkbx8za96xh9pyicv2a2l7y0rkcx2fqd8hv6d47s08"))))
10333 (build-system ant-build-system)
10334 (arguments
10335 `(#:jar-name "jackson-databind.jar"
10336 #:source-dir "src/main/java"
10337 #:tests? #f; requires javax.measures for which I can't find a free implementation
10338 #:phases
10339 (modify-phases %standard-phases
10340 (add-before 'configure 'generate-PackageVersion.java
10341 (lambda _
10342 (let* ((out "src/main/java/com/fasterxml/jackson/databind/cfg/PackageVersion.java")
10343 (in (string-append out ".in")))
10344 (copy-file in out)
10345 (substitute* out
10346 (("@package@") "com.fasterxml.jackson.databind.cfg")
10347 (("@projectversion@") ,version)
10348 (("@projectgroupid@") "com.fasterxml.jackson.databind")
10349 (("@projectartifactid@") "jackson-databind")))
10350 #t))
10351 (add-before 'build 'copy-resources
10352 (lambda _
10353 (copy-recursively "src/main/resources" "build/classes")
10354 #t)))))
10355 (inputs
10356 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core))
10357 (home-page "https://github.com/FasterXML/jackson-databind")
10358 (synopsis "Data-binding functionality and tree-model for the Jackson Data Processor")
10359 (description "This package contains the general-purpose data-binding
10360functionality and tree-model for Jackson Data Processor. It builds on core
10361streaming parser/generator package, and uses Jackson Annotations for
10362configuration.")
10363 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10364
10365(define-public java-fasterxml-jackson-modules-base-jaxb
10366 (package
10367 (name "java-fasterxml-jackson-modules-base-jaxb")
10368 (version "2.9.4")
10369 (source (origin
10370 (method url-fetch)
10371 (uri (string-append "https://github.com/FasterXML/"
10372 "jackson-modules-base/archive/"
10373 "jackson-modules-base-" version ".tar.gz"))
10374 (sha256
10375 (base32
10376 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
10377 (build-system ant-build-system)
10378 (arguments
10379 `(#:jar-name "jackson-modules-base-jaxb.jar"
10380 #:source-dir "jaxb/src/main/java"
10381 #:test-dir "jaxb/src/test"
10382 #:test-exclude
10383 ;; Base class for tests
10384 (list "**/BaseJaxbTest.java")
10385 #:phases
10386 (modify-phases %standard-phases
10387 (add-before 'configure 'generate-PackageVersion.java
10388 (lambda _
10389 (let* ((out (string-append "jaxb/src/main/java/com/fasterxml/"
10390 "jackson/module/jaxb/PackageVersion.java"))
10391 (in (string-append out ".in")))
10392 (copy-file in out)
10393 (substitute* out
10394 (("@package@") "com.fasterxml.jackson.module.jaxb")
10395 (("@projectversion@") ,version)
10396 (("@projectgroupid@") "com.fasterxml.jackson.module.jaxb")
10397 (("@projectartifactid@") "jackson-module-jaxb")))
10398 #t))
10399 (add-before 'build 'copy-resources
10400 (lambda _
10401 (copy-recursively "jaxb/src/main/resources" "build/classes")
10402 #t)))))
10403 (inputs
10404 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core
10405 java-fasterxml-jackson-databind))
10406 (native-inputs
10407 (list java-junit))
10408 (home-page "https://github.com/FasterXML/jackson-modules-base")
10409 (synopsis "Jaxb annotations jackson module")
10410 (description "This package is the jaxb annotations module for jackson.")
10411 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10412
10413(define-public java-fasterxml-jackson-modules-base-mrbean
10414 (package
10415 (name "java-fasterxml-jackson-modules-base-mrbean")
10416 (version "2.9.4")
10417 (source (origin
10418 (method url-fetch)
10419 (uri (string-append "https://github.com/FasterXML/"
10420 "jackson-modules-base/archive/"
10421 "jackson-modules-base-" version ".tar.gz"))
10422 (sha256
10423 (base32
10424 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
10425 (build-system ant-build-system)
10426 (arguments
10427 `(#:jar-name "jackson-modules-base-mrbean.jar"
10428 #:source-dir "mrbean/src/main/java"
10429 #:test-dir "mrbean/src/test"
10430 #:test-exclude
10431 ;; Base class for tests
10432 (list "**/BaseTest.java")
10433 #:phases
10434 (modify-phases %standard-phases
10435 (add-before 'configure 'generate-PackageVersion.java
10436 (lambda _
10437 (let* ((out (string-append "mrbean/src/main/java/com/fasterxml/"
10438 "jackson/module/mrbean/PackageVersion.java"))
10439 (in (string-append out ".in")))
10440 (copy-file in out)
10441 (substitute* out
10442 (("@package@") "com.fasterxml.jackson.module.mrbean")
10443 (("@projectversion@") ,version)
10444 (("@projectgroupid@") "com.fasterxml.jackson.module.mrbean")
10445 (("@projectartifactid@") "jackson-module-mrbean")))
10446 #t)))))
10447 (inputs
10448 (list java-asm java-fasterxml-jackson-annotations
10449 java-fasterxml-jackson-core java-fasterxml-jackson-databind))
10450 (native-inputs
10451 (list java-junit))
10452 (home-page "https://github.com/FasterXML/jackson-modules-base")
10453 (synopsis "POJO type materialization for Java")
10454 (description "This package implements POJO type materialization.
10455Databinders can construct implementation classes for Java interfaces as part
10456of deserialization.")
10457 (license license:asl2.0)))
10458
10459(define-public java-snakeyaml
10460 (package
10461 (name "java-snakeyaml")
10462 (version "1.18")
10463 (source (origin
10464 (method url-fetch)
10465 (uri (string-append "https://bitbucket.org/asomov/snakeyaml/get/v"
10466 version ".tar.gz"))
10467 (file-name (string-append name "-" version ".tar.gz"))
10468 (sha256
10469 (base32
10470 "0474cqcv46zgv9bhms2vgawakq1vyj0hp3h3f1bfys46msia90bh"))))
10471 (build-system ant-build-system)
10472 (arguments
10473 `(#:jar-name "java-snakeyaml.jar"
10474 #:source-dir "src/main/java"
10475 ;; Tests require velocity, a cyclic dependency, and
10476 ;; java-spring-framework-context which is not packaged.
10477 #:tests? #f))
10478 (home-page "https://bitbucket.org/asomov/snakeyaml")
10479 (synopsis "YAML processor")
10480 (description "SnakeYAML is a YAML processor for the Java Virtual Machine.")
10481 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10482
10483(define-public java-fasterxml-jackson-dataformat-yaml
10484 (package
10485 (name "java-fasterxml-jackson-dataformat-yaml")
10486 (version "2.9.4")
10487 (source (origin
10488 (method url-fetch)
10489 (uri (string-append "https://github.com/FasterXML/"
10490 "jackson-dataformats-text/archive/"
10491 "jackson-dataformats-text-" version ".tar.gz"))
10492 (sha256
10493 (base32
10494 "1hikl06khaxbg439avf442qifcadap8w0lx13f0nnhp2vh3dkbz7"))))
10495 (build-system ant-build-system)
10496 (arguments
10497 `(#:jar-name "jackson-dataformat-yaml.jar"
10498 #:source-dir "yaml/src/main/java"
10499 #:test-dir "yaml/src/test"
10500 #:test-exclude (list "**/failing/**.java")
10501 #:phases
10502 (modify-phases %standard-phases
10503 (add-before 'configure 'generate-PackageVersion.java
10504 (lambda _
10505 (let* ((out "yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/PackageVersion.java")
10506 (in (string-append out ".in")))
10507 (copy-file in out)
10508 (substitute* out
10509 (("@package@") "com.fasterxml.jackson.dataformat.yaml")
10510 (("@projectversion@") ,version)
10511 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.yaml")
10512 (("@projectartifactid@") "jackson-dataformat-yaml")))
10513 #t)))))
10514 (inputs
10515 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core
10516 java-fasterxml-jackson-databind java-snakeyaml))
10517 (native-inputs
10518 `(("junit" ,java-junit)
10519 ("hamcrest" ,java-hamcrest-core)
10520 ("java-ops4j-pax-exam-core-spi" ,java-ops4j-pax-exam-core-spi)
10521 ("java-ops4j-pax-exam-core-junit" ,java-ops4j-pax-exam-core-junit)
10522 ("java-ops4j-pax-exam" ,java-ops4j-pax-exam-core)))
10523 (home-page "https://github.com/FasterXML/jackson-dataformats-text")
10524 (synopsis "Yaml backend for Jackson")
10525 (description "Dataformat backends are used to support format alternatives
10526to JSON, supported by default. This is done by sub-classing Jackson core
10527abstractions.")
10528 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10529
10530(define-public java-stax2-api
10531 (package
10532 (name "java-stax2-api")
10533 (version "4.0.0")
10534 (source (origin
10535 (method url-fetch)
10536 (uri (string-append "https://github.com/FasterXML/stax2-api/archive/"
10537 "stax2-api-" version ".tar.gz"))
10538 (sha256
10539 (base32
10540 "1amc1si0l0hyyw2sawmnzy4hkna3z6fp195y4nm5m9wb9ld5awkq"))))
10541 (build-system ant-build-system)
10542 (arguments
10543 `(#:jar-name "java-stax2-api.jar"
10544 #:source-dir "src/main/java"
10545 #:tests? #f)); no tests
10546 (home-page "https://github.com/FasterXML/stax2-api")
10547 (synopsis "Stax2 API")
10548 (description "Stax2 API is an extension to basic Stax 1.0 API that adds
10549significant new functionalities, such as full-featured bi-direction validation
10550interface and high-performance Typed Access API.")
10551 (license license:bsd-2)))
10552
10553(define-public java-woodstox-core
10554 (package
10555 (name "java-woodstox-core")
10556 (version "5.0.3")
10557 (source (origin
10558 (method git-fetch)
10559 (uri (git-reference
10560 (url "https://github.com/FasterXML/woodstox")
10561 (commit (string-append "woodstox-core-" version))))
10562 (file-name (git-file-name name version))
10563 (sha256
10564 (base32
10565 "0bfylk24a967hwxprxqbg6cdvm6n4ldcarp54yg980viwvjiglyp"))))
10566 (build-system ant-build-system)
10567 (arguments
10568 `(#:jar-name "woodstox.jar"
10569 #:test-exclude
10570 (list "**/Base*.java" "failing/**")
10571 #:phases
10572 (modify-phases %standard-phases
10573 (add-before 'build 'remove-msv-dep
10574 (lambda _
10575 ;; we don't need osgi, and it depends on msv
10576 (delete-file-recursively "src/main/java/com/ctc/wstx/osgi")
10577 ;; msv's latest release is from 2011 and we don't need it
10578 (delete-file-recursively "src/main/java/com/ctc/wstx/msv")
10579 (delete-file-recursively "src/test/java/wstxtest/osgi")
10580 (delete-file-recursively "src/test/java/wstxtest/msv")
10581 #t))
10582 (add-before 'build 'copy-resources
10583 (lambda _
10584 (copy-recursively "src/main/resources" "build/classes")
10585 #t)))))
10586 (inputs
10587 `(("stax2" ,java-stax2-api)))
10588 (native-inputs
10589 `(("junit" ,java-junit)))
10590 (home-page "https://github.com/FasterXML/woodstox")
10591 (synopsis "Stax XML API implementation")
10592 (description "Woodstox is a stax XML API implementation.")
10593 (license license:asl2.0)))
10594
10595(define-public java-fasterxml-jackson-dataformat-xml
10596 (package
10597 (name "java-fasterxml-jackson-dataformat-xml")
10598 (version "2.9.4")
10599 (source (origin
10600 (method git-fetch)
10601 (uri (git-reference
10602 (url "https://github.com/FasterXML/jackson-dataformat-xml")
10603 (commit (string-append "jackson-dataformat-xml-" version))))
10604 (file-name (git-file-name name version))
10605 (sha256
10606 (base32
10607 "0s1wl65mbs57c2hz2v8rnh8i04y5lpyyvnjz562j5j6b83vwwpfx"))))
10608 (build-system ant-build-system)
10609 (arguments
10610 `(#:jar-name "jackson-dataformat-xml.jar"
10611 #:source-dir "src/main/java"
10612 #:test-exclude
10613 (list "**/failing/**")
10614 #:phases
10615 (modify-phases %standard-phases
10616 (add-before 'configure 'generate-PackageVersion.java
10617 (lambda _
10618 (let* ((out "src/main/java/com/fasterxml/jackson/dataformat/xml/PackageVersion.java")
10619 (in (string-append out ".in")))
10620 (copy-file in out)
10621 (newline)
10622 (substitute* out
10623 (("@package@") "com.fasterxml.jackson.dataformat.xml")
10624 (("@projectversion@") ,version)
10625 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.xml")
10626 (("@projectartifactid@") "jackson-dataformat-xml")))
10627 #t))
10628 (add-before 'build 'copy-resources
10629 (lambda _
10630 (copy-recursively "src/main/resources" "build/classes")
10631 #t)))))
10632 (inputs
10633 `(("jackson-annotations" ,java-fasterxml-jackson-annotations)
10634 ("jackson-core" ,java-fasterxml-jackson-core)
10635 ("jackson-modules-base-jaxb" ,java-fasterxml-jackson-modules-base-jaxb)
10636 ("jackson-databind" ,java-fasterxml-jackson-databind)
10637 ("stax2-api" ,java-stax2-api)
10638 ("woodstox" ,java-woodstox-core)))
10639 (native-inputs
10640 `(("junit" ,java-junit)
10641 ("hamcrest" ,java-hamcrest-core)))
10642 (home-page "https://github.com/FasterXML/jackson-dataformat-xml")
10643 (synopsis "Read and write XML")
10644 (description "This package contains Jackson extension component for reading
10645and writing XML encoded data.
10646
10647Further, the goal is to emulate how JAXB data-binding works with \"Code-first\"
10648approach (that is, no support is added for \"Schema-first\" approach). Support
10649for JAXB annotations is provided by JAXB annotation module; this module
10650provides low-level abstractions (@code{JsonParser}, @code{JsonGenerator},
10651@code{JsonFactory}) as well as small number of higher level overrides needed to
10652make data-binding work.")
10653 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10654
10655(define-public java-hdrhistogram
10656 (package
10657 (name "java-hdrhistogram")
10658 (version "2.1.9")
10659 (source (origin
10660 (method git-fetch)
10661 (uri (git-reference
10662 (url "https://github.com/HdrHistogram/HdrHistogram")
10663 (commit (string-append "HdrHistogram-" version))))
10664 (file-name (git-file-name name version))
10665 (sha256
10666 (base32
10667 "1cw8aa1vk258k42xs6wpy72m4gbai540jq032qsa7c5586iawx2d"))))
10668 (build-system ant-build-system)
10669 (arguments
10670 `(#:jar-name "java-hdrhistogram.jar"
10671 #:source-dir "src/main/java"
10672 #:phases
10673 (modify-phases %standard-phases
10674 (add-after 'unpack 'make-files-writable
10675 (lambda _
10676 (for-each make-file-writable (find-files "."))
10677 #t))
10678 (add-before 'configure 'set-version
10679 (lambda _
10680 (let* ((version-java "src/main/java/org/HdrHistogram/Version.java")
10681 (template (string-append version-java ".template")))
10682 (copy-file template version-java)
10683 (substitute* version-java
10684 (("\\$VERSION\\$") ,version)
10685 (("\\$BUILD_TIME\\$") "0"))
10686 #t))))))
10687 (native-inputs
10688 `(("junit" ,java-junit)
10689 ("hamcrest" ,java-hamcrest-core)))
10690 (home-page "https://hdrhistogram.github.io/HdrHistogram")
10691 (synopsis "High dynamic range histogram")
10692 (description "Hdrhistogram creates histograms that support
10693recording and analyzing sampled data value counts across a configurable integer
10694value range with configurable value precision within the range. Value precision
10695is expressed as the number of significant digits in the value recording, and
10696provides control over value quantization behavior across the value range and
10697the subsequent value resolution at any given level.")
10698 (license license:public-domain)))
10699
10700(define-public java-cofoja
10701 (package
10702 (name "java-cofoja")
10703 (version "1.3")
10704 (source (origin
10705 (method git-fetch)
10706 (uri (git-reference
10707 (url "https://github.com/nhatminhle/cofoja")
10708 (commit (string-append "v" version))))
10709 (file-name (string-append "java-cofoja-" version "-checkout"))
10710 (sha256
10711 (base32
10712 "0p7sz8y5xgpi5rx1qwn6587fkd52qr3ha3ybh14gqcyxhikl525w"))))
10713 (build-system ant-build-system)
10714 (arguments
10715 `(#:build-target "dist"
10716 #:test-target "test"
10717 #:jdk ,icedtea-8
10718 #:make-flags
10719 (list "-Ddist.dir=dist")
10720 #:modules ((guix build ant-build-system)
10721 (guix build java-utils)
10722 (guix build utils)
10723 (srfi srfi-1)
10724 (ice-9 match))
10725 #:phases
10726 (modify-phases %standard-phases
10727 ;; The bulid system ignores the class path the ant-build-system sets
10728 ;; up and instead expects to find all dependencies in the "lib"
10729 ;; directory.
10730 (add-after 'unpack 'create-libdir
10731 (lambda* (#:key inputs #:allow-other-keys)
10732 (mkdir-p "lib")
10733 (for-each
10734 (lambda (file)
10735 (let ((target (string-append "lib/" (basename file))))
10736 (unless (file-exists? target)
10737 (symlink file target))))
10738 (append-map (match-lambda
10739 ((label . dir)
10740 (find-files dir "\\.jar$")))
10741 inputs))
10742 #t))
10743 (replace 'install (install-jars "dist")))))
10744 (inputs
10745 (list java-asm))
10746 (native-inputs
10747 (list java-junit))
10748 (home-page "https://github.com/nhatminhle/cofoja")
10749 (synopsis "Contracts for Java")
10750 (description "Contracts for Java, or Cofoja for short, is a contract
10751programming framework and test tool for Java, which uses annotation processing
10752and bytecode instrumentation to provide run-time checking. (In particular,
10753this is not a static analysis tool.)")
10754 (license license:lgpl3+)))
10755
10756(define-public java-aopalliance
10757 (package
10758 (name "java-aopalliance")
10759 (version "1.0")
10760 (source (origin
10761 (method git-fetch)
10762 ;; Note: this git repository is not official, but contains the
10763 ;; source code that is in the CVS repository. Downloading the
10764 ;; tarball from sourceforge is undeterministic, and the cvs download
10765 ;; fails.
10766 (uri (git-reference
10767 (url "https://github.com/hoverruan/aopalliance")
10768 (commit "0d7757ae204e5876f69431421fe9bc2a4f01e8a0")))
10769 (file-name (string-append name "-" version))
10770 (sha256
10771 (base32
10772 "0rsg2b0v3hxlq2yk1i3m2gw3xwq689j3cwx9wbxvqfpdcjbca0qr"))))
10773 (build-system ant-build-system)
10774 (arguments
10775 `(#:jar-name "java-aopalliance.jar"
10776 #:jdk ,icedtea-8
10777 #:tests? #f; no tests
10778 #:source-dir "aopalliance/src/main"
10779 #:phases
10780 (modify-phases %standard-phases
10781 (add-before 'install 'create-pom
10782 (generate-pom.xml "pom.xml" "aopalliance" "aopalliance" ,version))
10783 (replace 'install
10784 (install-from-pom "pom.xml")))))
10785 (home-page "https://aopalliance.sourceforge.net")
10786 (synopsis "Aspect-Oriented Programming")
10787 (description "The AOP Alliance project is a joint project between several
10788software engineering people who are interested in Aspect-Oriented Programming
10789(AOP) and Java.")
10790 (license license:public-domain)))
10791
10792(define-public java-javax-inject
10793 (package
10794 (name "java-javax-inject")
10795 (version "1")
10796 (source (origin
10797 (method git-fetch)
10798 (uri (git-reference
10799 (url "https://github.com/javax-inject/javax-inject")
10800 (commit version)))
10801 (file-name (git-file-name name version))
10802 (sha256
10803 (base32
10804 "1rspl0nkvk1jif6nccikw93xic6ljj2b6kpy2mffwi2mnvc13j7x"))))
10805 (build-system ant-build-system)
10806 (arguments
10807 `(#:jar-name "java-javax-inject.jar"
10808 #:tests? #f; no tests
10809 #:phases
10810 (modify-phases %standard-phases
10811 (replace 'install
10812 (install-from-pom "pom.xml")))))
10813 (home-page "https://github.com/javax-inject/javax-inject")
10814 (synopsis "JSR-330: Dependency Injection for Java")
10815 (description "This package specifies a means for obtaining objects in such
10816a way as to maximize reusability, testability and maintainability compared to
10817traditional approaches such as constructors, factories, and service locators
10818(e.g., JNDI). This process, known as dependency injection, is beneficial to
10819most nontrivial applications.
10820
10821Many types depend on other types. For example, a @var{Stopwatch} might depend
10822on a @var{TimeSource}. The types on which a type depends are known as its
10823dependencies. The process of finding an instance of a dependency to use at run
10824time is known as resolving the dependency. If no such instance can be found,
10825the dependency is said to be unsatisfied, and the application is broken.")
10826 (license license:asl2.0)))
10827
10828(define-public java-guice
10829 (package
10830 (name "java-guice")
10831 (version "4.1")
10832 (source (origin
10833 (method git-fetch)
10834 (uri (git-reference
10835 (url "https://github.com/google/guice")
10836 (commit version)))
10837 (file-name (git-file-name name version))
10838 (modules '((guix build utils)))
10839 (snippet
10840 `(begin
10841 (for-each delete-file (find-files "." ".*.jar")) #t))
10842 (sha256
10843 (base32
10844 "18im5hdfl4q1b9chww2s1ii60sn3ydyyar32a2sf2p2g8zlbdswq"))))
10845 (build-system ant-build-system)
10846 (arguments
10847 `(#:jar-name "java-guice.jar"
10848 #:jdk ,icedtea-8
10849 #:tests? #f; FIXME: tests are not in a java sub directory
10850 #:source-dir "core/src"
10851 #:phases
10852 (modify-phases %standard-phases
10853 (add-after 'unpack 'make-files-writable
10854 (lambda _
10855 (for-each make-file-writable (find-files "."))
10856 #t))
10857 (replace 'install
10858 (install-from-pom "core/pom.xml")))))
10859 (propagated-inputs
10860 (list java-aopalliance
10861 java-cglib
10862 java-guava
10863 java-javax-inject
10864 java-guice-parent-pom))
10865 (home-page "https://github.com/google/guice")
10866 (synopsis "Lightweight dependency injection framework")
10867 (description "Guice is a lightweight dependency injection framework for
10868Java 6 and above.")
10869 (license license:asl2.0)))
10870
10871(define-public java-guice-servlet
10872 (package
10873 (inherit java-guice)
10874 (name "java-guice-servlet")
10875 (arguments
10876 `(#:jar-name "guice-servlet.jar"
10877 #:source-dir "extensions/servlet/src/"
10878 #:jdk ,icedtea-8
10879 #:tests? #f ; FIXME: not in a java subdir
10880 #:phases
10881 (modify-phases %standard-phases
10882 (add-after 'unpack 'make-files-writable
10883 (lambda _
10884 (for-each make-file-writable (find-files "."))
10885 #t)))))
10886 (inputs
10887 `(("guice" ,java-guice)
10888 ("servlet" ,java-classpathx-servletapi)
10889 ,@(package-inputs java-guice)))))
10890
10891(define java-guice-parent-pom
10892 (package
10893 (inherit java-guice)
10894 (name "java-guice-parent-pom")
10895 (arguments
10896 `(#:tests? #f
10897 #:phases
10898 (modify-phases %standard-phases
10899 (delete 'configure)
10900 (delete 'build)
10901 (add-after 'install 'install-extensions
10902 (install-pom-file "extensions/pom.xml"))
10903 (replace 'install
10904 (install-pom-file "pom.xml")))))
10905 (propagated-inputs
10906 `(("java-google-parent-pom" ,java-google-parent-pom-5)))))
10907
10908(define java-google-parent-pom-5
10909 (package
10910 (name "java-google-parent-pom")
10911 (version "5")
10912 (source (origin
10913 (method git-fetch)
10914 (uri (git-reference
10915 (url "https://github.com/google/google-maven-parents")
10916 (commit (string-append "google-" version))))
10917 (file-name (git-file-name name version))
10918 (sha256
10919 (base32
10920 "0zb7hx24p8k8rfdvix2vsbfqn73jhrycdndvhf8j5gbii9wbqibv"))))
10921 (build-system ant-build-system)
10922 (arguments
10923 `(#:tests? #f
10924 #:phases
10925 (modify-phases %standard-phases
10926 (delete 'configure)
10927 (delete 'build)
10928 (replace 'install
10929 (install-pom-file "pom.xml")))))
10930 (home-page "https://github.com/google/google-maven-parents")
10931 (synopsis "Google parent pom")
10932 (description "This package contains the Maven parent POM for other Google
10933Java projects.")
10934 (license license:asl2.0)))
10935
10936(define-public java-assertj
10937 (package
10938 (name "java-assertj")
10939 (version "3.8.0")
10940 (source (origin
10941 (method git-fetch)
10942 (uri (git-reference
10943 (url "https://github.com/joel-costigliola/assertj-core")
10944 (commit (string-append "assertj-core-" version))))
10945 (file-name (git-file-name name version))
10946 (sha256
10947 (base32
10948 "1k35cg2in7pzk4pbdjryr0pll5lgk1r6ngrn0j8cdlgi7w8zh2d1"))))
10949 (build-system ant-build-system)
10950 (arguments
10951 `(#:jar-name "java-assertj.jar"
10952 #:jdk ,icedtea-8
10953 #:source-dir "src/main/java"
10954 #:tests? #f)); depends on tng-junit which depends on assertj
10955 (inputs
10956 `(("cglib" ,java-cglib)
10957 ("junit" ,java-junit)
10958 ("hamcrest" ,java-hamcrest-core)))
10959 (native-inputs
10960 `(("mockito" ,java-mockito-1)))
10961 (home-page "https://joel-costigliola.github.io/assertj/index.html")
10962 (synopsis "Fluent assertions for java")
10963 (description "AssertJ core is a Java library that provides a fluent
10964interface for writing assertions. Its main goal is to improve test code
10965readability and make maintenance of tests easier.")
10966 (license license:asl2.0)))
10967
10968(define-public java-jboss-javassist
10969 (package
10970 (name "java-jboss-javassist")
10971 (version "3.21.0")
10972 (source (origin
10973 (method git-fetch)
10974 (uri (git-reference
10975 (url "https://github.com/jboss-javassist/javassist")
10976 (commit
10977 (string-append "rel_"
10978 (string-map
10979 (lambda (x) (if (eq? x #\.) #\_ x)) version)
10980 "_ga"))))
10981 (file-name (git-file-name name version))
10982 (sha256
10983 (base32
10984 "0h3zlcyqiaq01fspm69h7vki67raw305w89p4ha8vlhpzw02qifm"))
10985 (modules '((guix build utils)))
10986 (snippet
10987 '(begin
10988 (delete-file "javassist.jar")))))
10989 (build-system ant-build-system)
10990 (arguments
10991 `(#:jar-name "java-jboss-javassist.jar"
10992 #:jdk ,icedtea-8
10993 #:source-dir "src/main"
10994 #:tests? #f; FIXME: requires junit-awtui and junit-swingui from junit3
10995 #:phases
10996 (modify-phases %standard-phases
10997 (add-after 'unpack 'make-files-writable
10998 (lambda _
10999 (for-each make-file-writable (find-files "."))
11000 #t)))))
11001 (native-inputs
11002 `(("junit" ,java-junit)))
11003 (home-page "https://github.com/jboss-javassist/javassist")
11004 (synopsis "Java bytecode engineering toolkit")
11005 (description "Javassist (JAVA programming ASSISTant) makes Java bytecode
11006manipulation simple. It is a class library for editing bytecodes in Java; it
11007enables Java programs to define a new class at runtime and to modify a class
11008file when the JVM loads it.")
11009 (license (list license:gpl2 license:cddl1.0)))); either gpl2 only or cddl.
11010
11011(define-public java-jcommander
11012 (package
11013 (name "java-jcommander")
11014 (version "1.71")
11015 (source (origin
11016 (method git-fetch)
11017 (uri (git-reference
11018 (url "https://github.com/cbeust/jcommander")
11019 (commit version)))
11020 (file-name (git-file-name name version))
11021 (sha256
11022 (base32
11023 "12vcpc19sd7jhvjgp7xz1qjanfix162xb3x2q5zah93rjklj1h57"))))
11024 (build-system ant-build-system)
11025 (arguments
11026 `(#:jar-name "java-jcommander.jar"
11027 #:jdk ,icedtea-8
11028 #:tests? #f; requires testng which depends on jcommander
11029 #:source-dir "src/main/java"))
11030 (home-page "https://jcommander.org")
11031 (synopsis "Command line parameters parser")
11032 (description "JCommander is a very small Java framework that makes it
11033trivial to parse command line parameters. Parameters are declared with
11034annotations.")
11035 (license license:asl2.0)))
11036
11037(define-public java-bsh
11038 (package
11039 (name "java-bsh")
11040 (version "2.1.1")
11041 (source (origin
11042 (method git-fetch)
11043 (uri (git-reference
11044 (url "https://github.com/beanshell/beanshell")
11045 (commit version)))
11046 (file-name (git-file-name name version))
11047 (sha256
11048 (base32
11049 "1a6y46yz2ba4mnlfv4bpd5pmzhgxrzk3s10xp05jz377nbp2izwg"))
11050 (modules '((guix build utils)))
11051 (snippet
11052 '(begin
11053 ;; Delete bundled third-party jar archives.
11054 (for-each delete-file (find-files "." ".*.jar$"))
11055 (for-each (lambda (file) (chmod file #o644))
11056 (find-files "." "."))
11057 #t))))
11058 (build-system ant-build-system)
11059 (arguments
11060 `(#:build-target "jarall"
11061 #:test-target "junit-tests-all"
11062 #:make-flags (list "-DDATE" "(no date for reproducibility)")
11063 #:phases
11064 (modify-phases %standard-phases
11065 (add-before 'check 'fix-test
11066 (lambda _
11067 (substitute* "tests/junitTests/src/bsh/Issue_55_Test.java"
11068 ((" BshScriptEngineFactory") " bsh.engine.BshScriptEngineFactory"))))
11069 (replace 'install
11070 (install-from-pom "pom.xml")))))
11071 (inputs
11072 (list java-classpathx-servletapi java-commons-bsf))
11073 (native-inputs
11074 (list java-junit javacc-3))
11075 (home-page "http://beanshell.org/")
11076 (synopsis "Lightweight Scripting for Java")
11077 (description "BeanShell is a small, free, embeddable Java source
11078interpreter with object scripting language features, written in Java.
11079BeanShell dynamically executes standard Java syntax and extends it with common
11080scripting conveniences such as loose types, commands, and method closures like
11081those in Perl and JavaScript.")
11082 (license license:asl2.0)))
11083
11084(define-public java-fest-util
11085 (package
11086 (name "java-fest-util")
11087 (version "1.2.5")
11088 (source (origin
11089 (method git-fetch)
11090 (uri (git-reference
11091 (url "https://github.com/alexruiz/fest-util/")
11092 (commit (string-append "fest-util-" version))))
11093 (file-name (git-file-name name version))
11094 (sha256
11095 (base32
11096 "02kgal7v85snyyvcsxvn4qphid455f4smh2wri1il8d9asw0djbz"))))
11097 (build-system ant-build-system)
11098 (arguments
11099 `(#:jar-name "java-fest-util.jar"
11100 #:source-dir "src/main/java"))
11101 (native-inputs
11102 `(("junit" ,java-junit)
11103 ("hamcrest" ,java-hamcrest-core)))
11104 (home-page "https://github.com/alexruiz/fest-util")
11105 (synopsis "FEST common utilities")
11106 (description "Common utilities used in all FEST module.")
11107 (license license:asl2.0)))
11108
11109(define-public java-fest-test
11110 (package
11111 (name "java-fest-test")
11112 (version "2.1.0")
11113 (source (origin
11114 (method git-fetch)
11115 (uri (git-reference
11116 (url "https://github.com/alexruiz/fest-test/")
11117 (commit (string-append "fest-test-" version))))
11118 (file-name (git-file-name name version))
11119 (sha256
11120 (base32
11121 "0mg1d2jfh7kbx2c40dchbjr6d8pv59snsyb13mfxsr7xk5n69qbn"))))
11122 (build-system ant-build-system)
11123 (arguments
11124 `(#:jar-name "java-fest-test.jar"
11125 #:source-dir "src/main/java"
11126 #:tests? #f)); no tests
11127 (inputs
11128 `(("junit" ,java-junit)))
11129 (home-page "https://github.com/alexruiz/fest-test")
11130 (synopsis "Common FEST testing infrastructure")
11131 (description "Fest-test contains the common FEST testing infrastructure.")
11132 (license license:asl2.0)))
11133
11134(define-public java-fest-assert
11135 (package
11136 (name "java-fest-assert")
11137 (version "2.0M10")
11138 (source (origin
11139 (method git-fetch)
11140 (uri (git-reference
11141 (url "https://github.com/alexruiz/fest-assert-2.x/")
11142 (commit (string-append "fest-assert-core-" version))))
11143 (file-name (git-file-name name version))
11144 (sha256
11145 (base32
11146 "1cp8zzyag3s85fz2w68sda9zzaal1y5f9wl8g72wkm12an40w6by"))))
11147 (build-system ant-build-system)
11148 (arguments
11149 `(#:jar-name "java-fest-assert.jar"
11150 #:source-dir "src/main/java"
11151 #:test-exclude
11152 (list
11153 "**/Abstract*.java"
11154 "**/*BaseTest.java"
11155 ;; Unable to set MockitoNamingPolicy on cglib generator which creates FastClasses
11156 "**/MessageFormatter_format_Test.java"
11157 "**/internal/*/*_assert*_Test.java")))
11158 (inputs
11159 (list java-fest-util))
11160 (native-inputs
11161 (list java-junit
11162 java-fest-test
11163 java-hamcrest-core
11164 java-mockito-1
11165 java-cglib
11166 java-objenesis))
11167 (home-page "https://github.com/alexruiz/fest-assert-2.x")
11168 (synopsis "FEST fluent assertions")
11169 (description "FEST-Assert provides a fluent interface for assertions.")
11170 (license license:asl2.0)))
11171
11172(define-public java-testng
11173 (package
11174 (name "java-testng")
11175 (version "6.14.3")
11176 (source (origin
11177 (method git-fetch)
11178 (uri (git-reference
11179 (url "https://github.com/cbeust/testng")
11180 (commit version)))
11181 (file-name (string-append name "-" version "-checkout"))
11182 (sha256
11183 (base32
11184 "0y6vq30i5g276kw0v2bhbvci22ijg7ax49ap2611yqlhbs4d6dqv"))))
11185 (build-system ant-build-system)
11186 (arguments
11187 (list
11188 #:jdk icedtea-8; java.util.function
11189 #:jar-name "java-testng.jar"
11190 #:source-dir "src/main/java"
11191 #:phases
11192 '(modify-phases %standard-phases
11193 (add-after 'unpack 'delete-failing-tests
11194 (lambda _
11195 ;; FIXME: I don't know why these tests fail
11196 (substitute* "src/test/resources/testng.xml"
11197 ;; expected:<[0]> but was:<[3]>
11198 (("<class name=\"test.configuration.github1625.TestRunnerIssue1625\"/>") "")
11199 ;; expected [3] but found [2]
11200 (("<class name=\"test.serviceloader.ServiceLoaderTest\" />") "")
11201 ;; This is a parallel test and we've observed that it fails
11202 ;; sometimes.
11203 (("<class name=\"test.dataprovider.DataProviderTest\"/>") ""))))
11204 ;; We don't have groovy
11205 (add-after 'unpack 'delete-groovy-tests
11206 (lambda _
11207 (delete-file-recursively "src/test/java/test/dependent/issue1648/")
11208 (substitute* "src/test/resources/testng.xml"
11209 (("<class name=\"test.dependent.issue1648.TestRunner\"/>") ""))))
11210 (add-before 'build 'copy-resources
11211 (lambda _
11212 (copy-recursively "src/main/resources" "build/classes")))
11213 (add-before 'check 'copy-test-resources
11214 (lambda _
11215 (copy-recursively "src/test/resources" "build/test-classes")))
11216 (replace 'check
11217 (lambda _
11218 (invoke "ant" "compile-tests")
11219 ;; we don't have groovy
11220 (substitute* "src/test/resources/testng.xml"
11221 (("<class name=\"test.groovy.GroovyTest\" />") ""))
11222 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
11223 ":build/classes"
11224 ":build/test-classes")
11225 "-Dtest.resources.dir=src/test/resources"
11226 "org.testng.TestNG" "src/test/resources/testng.xml"))))))
11227 (propagated-inputs
11228 (list java-junit
11229 java-jsr305
11230 java-bsh
11231 java-jcommander
11232 java-guice
11233 java-snakeyaml))
11234 (native-inputs
11235 (list java-guava
11236 java-javax-inject
11237 java-hamcrest-all
11238 java-assertj
11239 java-mockito-1
11240 java-cglib
11241 java-aopalliance))
11242 (home-page "https://testng.org")
11243 (synopsis "Testing framework")
11244 (description "TestNG is a testing framework inspired from JUnit and NUnit
11245but introducing some new functionalities that make it more powerful and easier
11246to use.")
11247 (license license:asl2.0)))
11248
11249(define-public java-jnacl
11250 (let ((commit "094e819afdd63ea81a499b3bcb42a271006bebd9")
11251 (revision "2"))
11252 (package
11253 (name "java-jnacl")
11254 (version (string-append "0.1.0-" revision "." (string-take commit 7)))
11255 (source (origin
11256 (method git-fetch)
11257 (uri (git-reference
11258 (url "https://github.com/neilalexander/jnacl")
11259 (commit commit)))
11260 (file-name (git-file-name name version))
11261 (sha256
11262 (base32
11263 "1d6g6xhn83byv5943n7935wwjsk0ibk0qdvqgr699qqgqqmwisbb"))))
11264 (build-system ant-build-system)
11265 (arguments
11266 `(#:jar-name "jnacl.jar"
11267 #:source-dir "src/main/java"
11268 #:jdk ,icedtea-8
11269 #:phases
11270 (modify-phases %standard-phases
11271 (add-before 'build 'fix-tests
11272 (lambda _
11273 (substitute* '("src/test/java/com/neilalexander/jnacl/NaClTest.java"
11274 "src/test/java/com/neilalexander/jnacl/NaclSecretBoxTest.java")
11275 (("assertions.Assertions") "assertions.api.Assertions"))
11276 #t))
11277 (replace 'check
11278 (lambda _
11279 (invoke "ant" "compile-tests")
11280 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
11281 ":build/classes"
11282 ":build/test-classes")
11283 "org.testng.TestNG" "-testclass"
11284 "build/test-classes/com/neilalexander/jnacl/NaclSecretBoxTest.class")
11285 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
11286 ":build/classes"
11287 ":build/test-classes")
11288 "org.testng.TestNG" "-testclass"
11289 "build/test-classes/com/neilalexander/jnacl/NaClTest.class"))))))
11290 (native-inputs
11291 (list java-testng java-fest-util java-fest-assert))
11292 (home-page "https://github.com/neilalexander/jnacl")
11293 (synopsis "Java implementation of NaCl")
11294 (description "Pure Java implementation of the NaCl: Networking and
11295Cryptography library.")
11296 (license license:bsd-2))))
11297
11298(define-public java-mvel2
11299 (package
11300 (name "java-mvel2")
11301 (version "2.3.1")
11302 (source (origin
11303 (method url-fetch)
11304 (uri (string-append "https://github.com/mvel/mvel/archive/mvel2-"
11305 version ".Final.tar.gz"))
11306 (sha256
11307 (base32
11308 "01ph5s9gm16l2qz58lg21w6fna7xmmrj7f9bzqr1jim7h9557d3z"))))
11309 (build-system ant-build-system)
11310 (arguments
11311 `(#:jar-name "mvel2.jar"
11312 #:source-dir "src/main/java"
11313 #:test-exclude
11314 (list "**/Abstract*.java"
11315 ;; Base class with no tests
11316 "**/MVELThreadTest.java")
11317 #:phases
11318 (modify-phases %standard-phases
11319 (add-after 'install 'install-bin
11320 (lambda* (#:key outputs #:allow-other-keys)
11321 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
11322 (mkdir-p bin)
11323 (with-output-to-file (string-append bin "/mvel2")
11324 (lambda _
11325 (display
11326 (string-append
11327 "#!" (which "bash") "\n"
11328 "if [ \"$#\" -ne \"2\" ]; then\n"
11329 "echo 'Usage: mvel2 <script> <out.dir>'\n"
11330 "exit\n"
11331 "fi\n"
11332 "java -Dout.dir=$2 -cp " (getenv "CLASSPATH")
11333 ":" (assoc-ref outputs "out") "/share/java/mvel2.jar"
11334 " org.mvel2.sh.Main $1"))))
11335 (chmod (string-append bin "/mvel2") #o755))
11336 #t)))))
11337 (native-inputs
11338 `(("junit" ,java-junit)
11339 ("hamcrest" ,java-hamcrest-core)))
11340 (home-page "https://github.com/mvel/mvel")
11341 (synopsis "MVFLEX Expression Language")
11342 (description "MVEL has largely been inspired by Java syntax, but has some
11343fundamental differences aimed at making it more efficient as an expression
11344language, such as operators that directly support collection, array and string
11345matching, as well as regular expressions. MVEL is used to evaluate expressions
11346written using Java syntax.
11347
11348In addition to the expression language, MVEL serves as a templating language for
11349configuration and string construction.")
11350 (license license:asl2.0)))
11351
11352(define-public java-commons-jexl-2
11353 (package
11354 (name "java-commons-jexl")
11355 (version "2.1.1")
11356 (source (origin
11357 (method url-fetch)
11358 (uri (string-append "mirror://apache/commons/jexl/source/"
11359 "commons-jexl-" version "-src.tar.gz"))
11360 (sha256
11361 (base32
11362 "1ai7632bwwaxglb0nbpblpr2jw5g20afrsaq372ipkphi3ncy1jz"))))
11363 (build-system ant-build-system)
11364 (arguments
11365 `(#:jar-name "commons-jexl-2.jar"
11366 #:jdk ,icedtea-8
11367 #:source-dir "src/main/java"
11368 #:phases
11369 (modify-phases %standard-phases
11370 (add-before 'check 'disable-broken-tests
11371 (lambda* (#:key inputs #:allow-other-keys)
11372 (with-directory-excursion "src/test/java/org/apache/commons/jexl2/"
11373 (substitute* "ArithmeticTest.java"
11374 (("asserter.assertExpression\\(\"3 / 0\"") "//")
11375 (("asserter.assertExpression\\(\"imanull") "//"))
11376 ;; This test fails with "ambiguous method invocation"
11377 (delete-file "CacheTest.java")
11378 ;; This test doesn't have access to the temp directory
11379 (substitute* "ClassCreatorTest.java"
11380 (("java.io.tmpdir") "user.dir"))
11381 ;; This test fails in trying to detect whether it can run.
11382 (substitute* "ClassCreator.java"
11383 (("boolean canRun =.*") "boolean canRun = false;\n"))
11384 ;; ...and these tests depend on it.
11385 (delete-file "scripting/JexlScriptEngineOptionalTest.java")
11386 (delete-file "scripting/JexlScriptEngineTest.java"))
11387 #t))
11388 (add-before 'build 'run-javacc
11389 (lambda _
11390 (with-directory-excursion "src/main/java/org/apache/commons/jexl2/parser/"
11391 (invoke "java" "jjtree" "Parser.jjt")
11392 (invoke "java" "javacc" "Parser.jj"))
11393 #t)))))
11394 (inputs
11395 (list java-commons-logging-minimal))
11396 (native-inputs
11397 (list java-junit java-hamcrest-core javacc-4))
11398 (home-page "https://commons.apache.org/proper/commons-jexl/")
11399 (synopsis "Java Expression Language")
11400 (description "JEXL is a library intended to facilitate the implementation
11401of dynamic and scripting features in applications and frameworks written in
11402Java. JEXL implements an Expression Language based on some extensions to the
11403JSTL Expression Language supporting most of the constructs seen in
11404shell-script or ECMAScript. Its goal is to expose scripting features usable
11405by technical operatives or consultants working with enterprise platforms.")
11406 (license license:asl2.0)))
11407
11408(define-public java-lz4
11409 (package
11410 (name "java-lz4")
11411 (version "1.4.0")
11412 (source (origin
11413 (method git-fetch)
11414 (uri (git-reference
11415 (url "https://github.com/lz4/lz4-java")
11416 (commit version)))
11417 (file-name (git-file-name name version))
11418 (sha256
11419 (base32
11420 "0ydjakhv3cz34mfvv14qrh2ksdxifgjwwagjy7r46qr3f68hnf6y"))))
11421 (build-system ant-build-system)
11422 (arguments
11423 `(#:jar-name "lz4.jar"
11424 #:jdk ,icedtea-8
11425 #:source-dir "src/java:src/java-unsafe"
11426 #:tests? #f; FIXME: requires more dependencies
11427 #:phases
11428 (modify-phases %standard-phases
11429 (add-after 'unpack 'make-files-writable
11430 (lambda _
11431 (for-each make-file-writable (find-files "."))
11432 #t))
11433 (add-before 'configure 'generate-source
11434 (lambda _
11435 (with-directory-excursion "src/build/source_templates"
11436 (invoke "mvel2" "../gen_sources.mvel" "../../java"))
11437 #t)))))
11438 (native-inputs
11439 `(("mvel" ,java-mvel2)))
11440 (home-page "https://jpountz.github.io/lz4-java")
11441 (synopsis "Compression algorithm")
11442 (description "LZ4 - Java is a Java port of the popular lz4 compression
11443algorithms and xxHash hashing algorithm.")
11444 (license license:asl2.0)))
11445
11446(define-public java-bouncycastle
11447 (package
11448 (name "java-bouncycastle")
11449 (version "1.67")
11450 (source (origin
11451 (method git-fetch)
11452 (uri (git-reference
11453 (url "http://git.bouncycastle.org/repositories/bc-java")
11454 ;(url "https://github.com/bcgit/bc-java")
11455 (commit (string-append "r1rv" (substring version 2 4)))))
11456 (file-name (git-file-name name version))
11457 (sha256
11458 (base32
11459 "1449q7fyh03s1q0bqljcrhgacwcyqmg2bbvb3z084avgapwsainz"))
11460 (modules '((guix build utils)))
11461 (snippet
11462 '(begin
11463 (for-each delete-file
11464 (find-files "." "\\.jar$"))
11465 #t))))
11466 (build-system ant-build-system)
11467 (arguments
11468 `(#:jdk ,icedtea-8
11469 #:tests? #f
11470 #:phases
11471 (modify-phases %standard-phases
11472 (replace 'build
11473 (lambda _
11474 (invoke "ant" "-f" "ant/jdk15+.xml" "build-provider")
11475 (invoke "ant" "-f" "ant/jdk15+.xml" "build")))
11476 ;; FIXME: the tests freeze.
11477 ;; (replace 'check
11478 ;; (lambda _
11479 ;; (invoke "ant" "-f" "ant/jdk15+.xml" "test")))
11480 (replace 'install
11481 (install-jars "build/artifacts/jdk1.5/jars")))))
11482 (inputs
11483 (list java-javax-mail))
11484 (native-inputs
11485 `(("unzip" ,unzip)
11486 ("junit" ,java-junit)
11487 ("java-native-access" ,java-native-access)
11488 ("java-native-access-platform" ,java-native-access-platform)))
11489 (home-page "https://www.bouncycastle.org")
11490 (synopsis "Cryptographic library")
11491 (description "Bouncy Castle is a cryptographic library for the Java
11492programming language.")
11493 (license license:expat)))
11494
11495(define-public java-lmax-disruptor
11496 (package
11497 (name "java-lmax-disruptor")
11498 (version "3.4.4")
11499 (source (origin
11500 (method git-fetch)
11501 (uri (git-reference
11502 (url "https://github.com/LMAX-Exchange/disruptor")
11503 (commit version)))
11504 (file-name (git-file-name name version))
11505 (sha256
11506 (base32
11507 "02c5kp3n8a73dq9ay7ar53s1k3x61z9yzc5ikqb03m6snr1wpfqn"))))
11508 (build-system ant-build-system)
11509 (arguments
11510 `(#:jar-name "java-lmax-disruptor.jar"
11511 #:jdk ,icedtea-8
11512 #:tests? #f)); tests hang
11513 (inputs
11514 `(("junit" ,java-junit)
11515 ("java-hdrhistogram" ,java-hdrhistogram)
11516 ("java-jmock" ,java-jmock)
11517 ("java-jmock-legacy" ,java-jmock-legacy)
11518 ("java-jmock-junit4" ,java-jmock-junit4)
11519 ("java-hamcrest-all" ,java-hamcrest-all)))
11520 (native-inputs
11521 `(("cglib" ,java-cglib)
11522 ("objenesis" ,java-objenesis)))
11523 (home-page "https://www.lmax.com/disruptor")
11524 (synopsis "High performance inter-thread communication")
11525 (description "LMAX Disruptor is a software pattern and software component
11526for high performance inter-thread communication that avoids the need for
11527message queues or resource locking.")
11528 (license license:asl2.0)))
11529
11530(define-public java-conversant-disruptor
11531 (package
11532 (name "java-conversant-disruptor")
11533 (version "1.2.19")
11534 (source (origin
11535 (method git-fetch)
11536 (uri (git-reference
11537 (url "https://github.com/conversant/disruptor")
11538 (commit version)))
11539 (file-name (git-file-name name version))
11540 (sha256
11541 (base32
11542 "0gx1dm7sfg7pa05cs4qby10gfcplai5b5lf1f7ik1a76dh3vhl0g"))))
11543 (build-system ant-build-system)
11544 (arguments
11545 `(#:jar-name "java-conversant-disruptor.jar"
11546 #:source-dir "src/main/java"
11547 #:phases
11548 (modify-phases %standard-phases
11549 (add-before 'build 'copy-resources
11550 (lambda _
11551 (copy-recursively "src/main/resources" "build/classes")))
11552 (add-before 'build 'remove-module
11553 (lambda _
11554 (delete-file "src/main/java/module-info.java"))))))
11555 (native-inputs
11556 (list java-junit))
11557 (home-page "https://github.com/conversant/disruptor")
11558 (synopsis "High performance intra-thread communication")
11559 (description "Conversant Disruptor is the highest performing intra-thread
11560transfer mechanism available in Java. Conversant Disruptor is an implementation
11561of this type of ring buffer that has almost no overhead and that exploits a
11562particularly simple design.")
11563 (license license:asl2.0)))
11564
11565(define-public java-jctools-core-1
11566 (package
11567 (name "java-jctools-core")
11568 (version "1.2.1")
11569 (source (origin
11570 (method git-fetch)
11571 (uri (git-reference
11572 (url "https://github.com/JCTools/JCTools")
11573 (commit (string-append "v" version))))
11574 (file-name (git-file-name name version))
11575 (sha256
11576 (base32
11577 "105my29nwd4djvdllmq8s3jdzbyplbkxzwmddxiiilb4yqr1pghb"))))
11578 (build-system ant-build-system)
11579 (arguments
11580 `(#:jar-name "java-jctools-core.jar"
11581 #:source-dir "jctools-core/src/main/java"
11582 #:test-dir "jctools-core/src/test"
11583 ;; The tests timeout on some architectures.
11584 #:tests? ,(not (or (target-aarch64?)
11585 (%current-target-system)))))
11586 (native-inputs
11587 (list java-junit java-hamcrest-all))
11588 (home-page "https://github.com/JCTools/JCTools")
11589 (synopsis "Concurrency tools for Java")
11590 (description "This library implements concurrent data structures that are
11591not natively available in Java.")
11592 (license license:asl2.0)))
11593
11594(define-public java-commons-bcel
11595 (package
11596 (name "java-commons-bcel")
11597 (version "6.1")
11598 (source (origin
11599 (method url-fetch)
11600 (uri (string-append "mirror://apache/commons/bcel/source/bcel-"
11601 version "-src.tar.gz"))
11602 (sha256
11603 (base32
11604 "0j3x1rxd673k07psclk8k13rqh0x0mf2yy5qiwkiw4z3afa568jy"))))
11605 (build-system ant-build-system)
11606 (arguments
11607 `(#:jar-name "bcel.jar"
11608 #:jdk ,icedtea-8
11609 #:source-dir "src/main/java"
11610 #:test-dir "src/test/java"
11611 ;; FIXME: Tests require the unpackaged jna.
11612 #:tests? #f))
11613 (home-page "https://commons.apache.org/proper/commons-bcel/")
11614 (synopsis "Byte code engineering library")
11615 (description "The Byte Code Engineering Library (Apache Commons BCEL) is
11616intended to give users a convenient way to analyze, create, and
11617manipulate (binary) Java class files. Classes are represented by objects
11618which contain all the symbolic information of the given class: methods, fields
11619and byte code instructions, in particular.
11620
11621Such objects can be read from an existing file, be transformed by a
11622program (e.g. a class loader at run-time) and written to a file again. An
11623even more interesting application is the creation of classes from scratch at
11624run-time. The @dfn{Byte Code Engineering Library} (BCEL) may be also useful
11625if you want to learn about the @dfn{Java Virtual Machine} (JVM) and the format
11626of Java @code{.class} files.")
11627 (properties '((upstream-name . "bcel")))
11628 (license license:asl2.0)))
11629
11630(define-public java-xerial-core
11631 (package
11632 (name "java-xerial-core")
11633 (version "2.1")
11634 (source (origin
11635 (method url-fetch)
11636 (uri (string-append "https://github.com/xerial/xerial-java/archive/"
11637 version ".tar.gz"))
11638 (file-name (string-append name "-" version ".tar.gz"))
11639 (sha256
11640 (base32
11641 "0d3g863i41bgalpa4xr3vm1h140l091n8iwgq5qvby5yivns9y8d"))))
11642 (build-system ant-build-system)
11643 (arguments
11644 `(#:jar-name "xerial-core.jar"
11645 #:source-dir "xerial-core/src/main/java"
11646 #:test-dir "xerial-core/src/test"
11647 #:phases
11648 (modify-phases %standard-phases
11649 (add-before 'build 'copy-resources
11650 (lambda _
11651 (copy-recursively "xerial-core/src/main/resources"
11652 "build/classes")
11653 #t)))))
11654 (native-inputs
11655 `(("junit" ,java-junit)
11656 ("hamcrest" ,java-hamcrest-core)))
11657 (home-page "https://github.com/xerial/xerial-java")
11658 (synopsis "Data management libraries for Java")
11659 (description "Xerial is a set of data management libraries for the Java
11660programming language. The ultimate goal of the Xerial project is to manage
11661everything as database, including class objects, text format data, data
11662streams, etc.")
11663 (license license:asl2.0)))
11664
11665(define-public java-byte-buddy-dep
11666 (package
11667 (name "java-byte-buddy-dep")
11668 (version "1.14.0")
11669 (source (origin
11670 (method git-fetch)
11671 (uri (git-reference
11672 (url "https://github.com/raphw/byte-buddy")
11673 (commit (string-append "byte-buddy-" version))))
11674 (file-name (git-file-name name version))
11675 (sha256
11676 (base32
11677 "03jmsnkjb9d3z9brqs8fc512hhs5b5iab3a5wbax9zi03dskgvh2"))))
11678 (build-system ant-build-system)
11679 (arguments
11680 `(#:jar-name "byte-buddy-dep.jar"
11681 #:source-dir "byte-buddy-dep/src/main/java"
11682 #:test-dir "byte-buddy-dep/src/test"
11683 #:tests? #f; would build java files that are incompatible with current jdk
11684 #:phases
11685 (modify-phases %standard-phases
11686 (add-before 'build 'remove-annotations
11687 (lambda _
11688 (with-directory-excursion "byte-buddy-dep/src/main/java/net/bytebuddy"
11689 (substitute* (find-files "." ".*.java")
11690 (("@EqualsAndHashCode.*") "")
11691 (("import lombok.EqualsAndHashCode;") "")
11692 (("@SuppressFBWarnings.*") "")
11693 (("import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;") ""))
11694 (substitute* '("description/type/TypeDescription.java"
11695 "dynamic/loading/ClassInjector.java")
11696 (("^ *value = .*") "")
11697 (("^ *justification = .*") ""))))))))
11698 (inputs
11699 (list java-asm-9 java-asm-commons-9 java-jsr305 java-native-access))
11700 (home-page "http://bytebuddy.net/")
11701 (synopsis "Runtime code generation for the Java virtual machine")
11702 (description "Byte Buddy is a code generation and manipulation library for
11703creating and modifying Java classes during the runtime of a Java application
11704and without the help of a compiler.")
11705 (license license:asl2.0)))
11706
11707(define-public java-powermock-reflect
11708 (package
11709 (name "java-powermock-reflect")
11710 (version "2.0.9")
11711 (source (origin
11712 (method git-fetch)
11713 (uri (git-reference
11714 (url "https://github.com/powermock/powermock")
11715 (commit (string-append "powermock-" version))))
11716 (file-name (git-file-name name version))
11717 (sha256
11718 (base32
11719 "03y8szi9iwxnv431z2mn2ivc1ak30vcvfvkyrwmfq7wq93bj2c5v"))
11720 (patches
11721 (search-patches "java-powermock-fix-java-files.patch"))))
11722 (build-system ant-build-system)
11723 (arguments
11724 `(#:jar-name "java-powermock-reflect.jar"
11725 #:source-dir "powermock-reflect/src/main/java"
11726 #:test-dir "powermock-reflect/src/test"))
11727 (inputs
11728 (list java-asm-9 java-objenesis))
11729 (native-inputs
11730 (list java-assertj java-cglib java-hamcrest-core java-junit))
11731 (home-page "https://github.com/powermock/powermock")
11732 (synopsis "Mock library extension framework")
11733 (description "PowerMock is a framework that extends other mock libraries
11734such as EasyMock with more powerful capabilities. PowerMock uses a custom
11735classloader and bytecode manipulation to enable mocking of static methods,
11736constructors, final classes and methods, private methods, removal of static
11737initializers and more. By using a custom classloader no changes need to be
11738done to the IDE or continuous integration servers which simplifies adoption.")
11739 (license license:asl2.0)))
11740
11741(define-public java-powermock-core
11742 (package
11743 (inherit java-powermock-reflect)
11744 (name "java-powermock-core")
11745 (arguments
11746 `(#:jar-name "java-powermock-core.jar"
11747 #:source-dir "powermock-core/src/main/java"
11748 #:test-dir "powermock-core/src/test"
11749 #:tests? #f; requires powermock-api
11750 #:jdk ,icedtea-8
11751 #:phases
11752 (modify-phases %standard-phases
11753 (add-before 'build 'copy-resources
11754 (lambda _
11755 (copy-recursively "powermock-core/src/main/resources"
11756 "build/classes")
11757 #t)))))
11758 (inputs
11759 (list java-asm-9
11760 java-byte-buddy-dep
11761 java-jboss-javassist
11762 java-powermock-reflect))
11763 (native-inputs
11764 (list java-assertj java-mockito-1 java-junit))))
11765
11766(define-public java-powermock-api-support
11767 (package
11768 (inherit java-powermock-reflect)
11769 (name "java-powermock-api-support")
11770 (build-system ant-build-system)
11771 (arguments
11772 `(#:jar-name "java-powermock-api-support.jar"
11773 #:jdk ,icedtea-8
11774 #:source-dir "powermock-api/powermock-api-support/src/main/java"
11775 #:tests? #f)); no tests
11776 (inputs
11777 (list java-powermock-core java-powermock-reflect))))
11778
11779(define-public java-powermock-modules-junit4-common
11780 (package
11781 (inherit java-powermock-reflect)
11782 (name "java-powermock-modules-junit4-common")
11783 (build-system ant-build-system)
11784 (arguments
11785 `(#:jar-name "java-powermock-modules-junit4-common.jar"
11786 #:jdk ,icedtea-8
11787 #:source-dir "powermock-modules/powermock-module-junit4-common/src/main/java"
11788 #:test-dir "powermock-modules/powermock-module-junit4-common/src/test"))
11789 (inputs
11790 (list java-cglib
11791 java-easymock
11792 java-hamcrest-core
11793 java-powermock-core
11794 java-powermock-reflect))))
11795
11796(define-public java-powermock-modules-junit4
11797 (package
11798 (inherit java-powermock-reflect)
11799 (name "java-powermock-modules-junit4")
11800 (build-system ant-build-system)
11801 (arguments
11802 `(#:jar-name "java-powermock-modules-junit4.jar"
11803 #:tests? #f; require easymock 4, which introduces a loop with testng
11804 #:source-dir "powermock-modules/powermock-module-junit4/src/main/java"
11805 #:test-dir "powermock-modules/powermock-module-junit4/src/test"
11806 #:phases
11807 (modify-phases %standard-phases
11808 (add-before 'build 'fix-junit-detection
11809 (lambda _
11810 ;; Our junit version is 4.12-SNAPSHOT
11811 (substitute* (find-files "powermock-modules/powermock-module-junit4"
11812 "PowerMockJUnit4MethodValidator.java")
11813 (("4.12") "4.12-SNAPSHOT"))
11814 #t)))))
11815 (inputs
11816 (list java-cglib
11817 java-powermock-core
11818 java-powermock-reflect
11819 java-powermock-modules-junit4-common))
11820 (native-inputs
11821 (list java-easymock
11822 java-hamcrest-core
11823 java-junit
11824 java-objenesis))))
11825
11826(define-public java-powermock-api-easymock
11827 (package
11828 (inherit java-powermock-reflect)
11829 (name "java-powermock-api-easymock")
11830 (build-system ant-build-system)
11831 (arguments
11832 `(#:jar-name "java-powermock-api-easymock.jar"
11833 #:jdk ,icedtea-8
11834 #:source-dir "powermock-api/powermock-api-easymock/src/main/java"
11835 #:tests? #f; no tests
11836 #:phases
11837 (modify-phases %standard-phases
11838 (add-before 'build 'fix-file
11839 (lambda _
11840 ;; FIXME: This looks wrong, but it fixes a build error.
11841 (with-directory-excursion "powermock-api/powermock-api-easymock"
11842 (substitute* "src/main/java/org/powermock/api/easymock/PowerMock.java"
11843 (("classLoader instanceof MockClassLoader") "false")
11844 (("\\(\\(MockClassLoader\\) classLoader\\).*;") ";")))
11845 #t)))))
11846 (inputs
11847 (list java-cglib
11848 java-easymock
11849 java-powermock-api-support
11850 java-powermock-core
11851 java-powermock-reflect))))
11852
11853(define-public java-jboss-jms-api-spec
11854 (package
11855 (name "java-jboss-jms-api-spec")
11856 (version "2.0")
11857 (source (origin
11858 (method url-fetch)
11859 (uri (string-append "https://github.com/jboss/jboss-jms-api_spec/"
11860 "archive/jboss-jms-api_" version
11861 "_spec-1.0.1.Final.tar.gz"))
11862 (sha256
11863 (base32
11864 "07bqblw9kq2i8q92bz70fvavq5xjfkaixl8xa0m0cypjgy82rb7m"))))
11865 (build-system ant-build-system)
11866 (arguments
11867 `(#:jar-name "java-jboss-jms-api_spec.jar"
11868 #:jdk ,icedtea-8
11869 #:source-dir "."
11870 #:tests? #f)); no tests
11871 (home-page "https://github.com/jboss/jboss-jms-api_spec")
11872 (synopsis "Java Message Service API specification")
11873 (description "Java Message Service (JMS) API is used to send messages
11874messages between two or more clients. It is a messaging standard that allows
11875application components to create, send, receive, and read messages.")
11876 ; either gpl2 only with GPL Classpath Exception, or cddl.
11877 (license (list license:gpl2 license:cddl1.0))))
11878
11879(define-public java-mail
11880 (package
11881 (name "java-mail")
11882 (version "1.6.0")
11883 (source (origin
11884 (method url-fetch)
11885 (uri (string-append "https://github.com/javaee/javamail/archive/"
11886 "JAVAMAIL-1_6_0.tar.gz"))
11887 (sha256
11888 (base32
11889 "1b4rg7fpj50ld90a71iz2m4gm3f5cnw18p3q3rbrrryjip46kx92"))))
11890 (build-system ant-build-system)
11891 (arguments
11892 `(#:jar-name "java-mail.jar"
11893 #:jdk ,icedtea-8
11894 #:source-dir "mail/src/main/java"
11895 #:test-dir "mail/src/test"
11896 #:test-exclude
11897 (list "**/CollectorFormatterTest.java"
11898 "**/CompactFormatterTest.java"
11899 "**/DurationFilterTest.java"
11900 "**/MailHandlerTest.java"
11901 "**/GetLocalAddressTest.java"
11902 ;; SSLHandshakeException: No appropriate protocol
11903 "**/WriteTimeoutSocketTest.java"
11904 ;; FIXME: both end with:
11905 ;; java.lang.ClassNotFoundException:
11906 ;; javax.mail.internet.MimeMultipartParseTest
11907 "**/MimeMultipartParseTest.java"
11908 "**/SearchTermSerializationTest.java")
11909 #:phases
11910 (modify-phases %standard-phases
11911 (add-before 'configure 'move-version.java
11912 (lambda _
11913 (copy-file "mail/src/main/resources/javax/mail/Version.java"
11914 "mail/src/main/java/javax/mail/Version.java")))
11915 (add-before 'build 'copy-resources
11916 (lambda _
11917 (copy-recursively "mail/src/main/resources/META-INF"
11918 "build/classes/META-INF"))))))
11919 (native-inputs
11920 (list java-junit java-hamcrest-core))
11921 (home-page "https://javaee.github.io/javamail/")
11922 (synopsis "Mail-related functionality in Java")
11923 (description "The JavaMail API provides a platform-independent and
11924protocol-independent framework to build mail and messaging applications.")
11925 ;; General Public License Version 2 only ("GPL") or the Common Development
11926 ;; and Distribution License("CDDL")
11927 (license (list license:cddl1.1
11928 license:gpl2)))); with classpath exception
11929
11930(define-public java-mapdb
11931 (package
11932 (name "java-mapdb")
11933 (version "1.0.9")
11934 (source (origin
11935 (method git-fetch)
11936 (uri (git-reference
11937 (url "https://github.com/jankotek/mapdb")
11938 (commit (string-append "mapdb-" version))))
11939 (file-name (git-file-name name version))
11940 (sha256
11941 (base32
11942 "1slb4h282jqvk16896lcvgm65pj3v6crcp2wvjdvad7nx7d2f1kv"))))
11943 (build-system ant-build-system)
11944 (arguments
11945 (list #:jar-name "mapdb.jar"
11946 #:source-dir "src/main/java"
11947 #:test-dir "src/test"
11948 #:test-exclude (list "**/ClosedThrowsExceptionTest.java"
11949 "**/ConcurrentMapInterfaceTest.java"
11950 "**/EngineTest.java"
11951 "**/Issue664Test.java"
11952 "**/MapInterfaceTest.java")
11953 #:phases #~(modify-phases %standard-phases
11954 (replace 'install (install-from-pom "pom.xml")))))
11955 (native-inputs (list java-junit))
11956 (home-page "https://mapdb.org/")
11957 (synopsis "Concurrent data structures")
11958 (description "MapDB provides concurrent maps, sets and queues backed by
11959disk storage or off-heap memory.")
11960 (license license:bsd-3)))
11961
11962(define-public java-mime4j-core
11963 (package
11964 (name "java-mime4j-core")
11965 (version "0.8.13")
11966 (source (origin
11967 (method url-fetch)
11968 (uri (string-append "mirror://apache/james/mime4j/" version
11969 "/james-mime4j-sources-" version ".zip"))
11970 (sha256
11971 (base32
11972 "0f1r0ywa1qdw2b227c93v3fksqp9bgll00bqw1md1894v3szm9ca"))))
11973 (build-system ant-build-system)
11974 (arguments
11975 `(#:tests? #f ;; has no tests
11976 #:source-dir "core/src/main/java"
11977 #:jar-name "apache-mime4j-core.jar"))
11978 (native-inputs
11979 (list java-commons-io-latest ;; requries >= 2.7
11980 java-junit
11981 unzip))
11982 (home-page "https://james.apache.org/mime4j/apache-mime4j-core/")
11983 (synopsis "Java stream based MIME message parser")
11984 (description "Apache James Mime4J provides a parser, MimeStreamParser, for
11985e-mail message streams in plain rfc822 and MIME format. The parser uses a
11986callback mechanism to report parsing events such as the start of an entity
11987header, the start of a body, etc. If you are familiar with the SAX XML parser
11988interface you should have no problem getting started with mime4j.")
11989 (license license:asl2.0)))
11990
11991(define-public java-jeromq
11992 (package
11993 (name "java-jeromq")
11994 (version "0.4.3")
11995 (source (origin
11996 (method git-fetch)
11997 (uri (git-reference
11998 (url "https://github.com/zeromq/jeromq")
11999 (commit (string-append "v" version))))
12000 (file-name (string-append name "-" version "-checkout"))
12001 (sha256
12002 (base32
12003 "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj"))
12004 (patches (search-patches "java-jeromq-fix-tests.patch"))))
12005 (build-system ant-build-system)
12006 (arguments
12007 `(#:jar-name "java-jeromq.jar"
12008 #:source-dir "src/main/java"
12009 #:jdk ,icedtea-8
12010 #:test-exclude
12011 (list
12012 "**/Abstract*.java"
12013 ;; Requires network
12014 "**/ZBeaconTest.java"
12015 ;; Failures
12016 "**/DealerSpecTest.java"
12017 "**/CustomDecoderTest.java"
12018 "**/CustomEncoderTest.java"
12019 "**/ConnectRidTest.java"
12020 "**/ReqSpecTest.java"
12021 "**/PushPullSpecTest.java"
12022 "**/PubSubHwmTest.java"
12023 "**/RouterSpecTest.java"
12024 "**/ProxyTest.java")))
12025 (inputs
12026 (list java-jnacl))
12027 (native-inputs
12028 `(("java-hamcrest-core" ,java-hamcrest-core)
12029 ("junit" ,java-junit)))
12030 (home-page "https://zeromq.org/bindings:java")
12031 (synopsis "Java binding for 0MQ")
12032 (description "Jeromq provides the java bindings for 0MQ.")
12033 (license license:mpl2.0)))
12034
12035(define-public java-kafka-clients
12036 (package
12037 (name "java-kafka-clients")
12038 (version "1.1.1")
12039 (source (origin
12040 (method url-fetch)
12041 (uri (string-append "mirror://apache/kafka/" version "/kafka-"
12042 version "-src.tgz"))
12043 (sha256
12044 (base32
12045 "1jn62q7z383nwhzv4ippsddf98sa1gnkszjjncj4ii3r8rzgw566"))))
12046 (build-system ant-build-system)
12047 (arguments
12048 `(#:jar-name "java-kafka-clients.jar"
12049 #:jdk ,icedtea-8
12050 #:source-dir "clients/src/main/java"
12051 #:test-dir "clients/src/test"
12052 #:test-exclude
12053 (list
12054 ;; This file does not contain a class
12055 "**/IntegrationTest.java"
12056 ;; Requires network
12057 "**/ClientUtilsTest.java"
12058 ;; This test fails on i686
12059 "**/SerializationTest.java"
12060 ;; "protocol is disabled or cipher suites are inappropriate"
12061 "**/SslTransportLayerTest.java"
12062 ;; End with errors that seem related to our powermock
12063 "**/KafkaProducerTest.java"
12064 "**/BufferPoolTest.java"
12065 ;; Undeterministic failure, seems to affect mostly ci
12066 "**/GarbageCollectedMemoryPoolTest.java")))
12067 (inputs
12068 (list java-slf4j-api java-lz4))
12069 (native-inputs
12070 (list java-bouncycastle
12071 java-cglib
12072 java-easymock
12073 java-hamcrest-all
12074 java-jboss-javassist
12075 java-junit
12076 java-objenesis
12077 java-powermock-api-easymock
12078 java-powermock-api-support
12079 java-powermock-core
12080 java-powermock-modules-junit4
12081 java-powermock-modules-junit4-common
12082 java-snappy))
12083 (home-page "https://kafka.apache.org")
12084 (synopsis "Distributed streaming platform")
12085 (description "Kafka is a distributed streaming platform, which means:
12086@itemize
12087@item it can publish and subscribe to streams of records;
12088@item it can store streams of records in a fault-tolerant way;
12089@item it can process streams of records as they occur.
12090@end itemize")
12091 ;; Either cddl or gpl2 only.
12092 (license (list license:cddl1.1; actually cddl1.1
12093 license:gpl2)))); with classpath exception
12094
12095(define-public java-jdom
12096 (package
12097 (name "java-jdom")
12098 (version "1.1.3")
12099 (source (origin
12100 (method url-fetch)
12101 (uri (string-append "http://jdom.org/dist/binary/archive/jdom-"
12102 version ".tar.gz"))
12103 (sha256
12104 (base32
12105 "07wdpm3jwwc9q38kmdw40fvbmv6jzjrkrf8m0zqs58f79a672wfl"))))
12106 (build-system ant-build-system)
12107 (arguments
12108 `(#:build-target "package"
12109 #:tests? #f; tests are run as part of the build process
12110 #:phases
12111 (modify-phases %standard-phases
12112 (replace 'install
12113 (install-jars "build")))))
12114 (home-page "http://jdom.org/")
12115 (synopsis "Access, manipulate, and output XML data")
12116 (description "Java-based solution for accessing, manipulating, and
12117outputting XML data from Java code.")
12118 (license license:bsd-4)))
12119
12120(define-public java-geronimo-xbean-reflect
12121 (package
12122 (name "java-geronimo-xbean-reflect")
12123 (version "4.5")
12124 (source (origin
12125 (method svn-fetch)
12126 (uri (svn-reference
12127 (url "https://svn.apache.org/repos/asf/geronimo/xbean/tags/xbean-4.5/")
12128 (revision 1807396)))
12129 (file-name (string-append name "-" version))
12130 (sha256
12131 (base32
12132 "0zjqmsad4xk0iar23hdyvx19nxczybd2bh0i35xrafli5cmh720k"))))
12133 (build-system ant-build-system)
12134 (arguments
12135 `(#:jar-name "geronimo-xbean-reflect.jar"
12136 #:source-dir "xbean-reflect/src/main/java"
12137 #:test-dir "xbean-reflect/src/test"
12138 #:jdk ,icedtea-8
12139 #:test-exclude
12140 (list "**/Abstract*.java" "**/AsmParameterNameLoaderTest.java"
12141 "**/ObjectRecipeTest.java" "**/ParameterNameLoaderTest.java"
12142 "**/RecipeHelperTest.java" "**/XbeanAsmParameterNameLoaderTest.java")
12143 #:phases
12144 (modify-phases %standard-phases
12145 (add-before 'build 'fix-source
12146 (lambda _
12147 (let ((dir "xbean-reflect/src/main/java/org/apache/xbean/recipe/"))
12148 ;; org.apache.xbean.asm6 is actually repackaged java-asm
12149 (substitute* (string-append dir "XbeanAsmParameterNameLoader.java")
12150 (("org.apache.xbean.asm5") "org.objectweb.asm"))
12151 #t)))
12152 (replace 'install (install-from-pom "xbean-reflect/pom.xml")))))
12153 (inputs
12154 `(("asm" ,java-asm)
12155 ("log4j" ,java-log4j-api)
12156 ("log4j-1.2" ,java-log4j-1.2-api)
12157 ("log4j-core" ,java-log4j-core)
12158 ("logging" ,java-commons-logging-minimal)))
12159 (propagated-inputs
12160 (list java-geronimo-parent-pom))
12161 (native-inputs
12162 `(("junit" ,java-junit)))
12163 (home-page "https://geronimo.apache.org/maven/xbean/3.6/xbean-reflect/")
12164 (synopsis "Dependency injection helper")
12165 (description "Xbean-reflect provides very flexible ways to create objects
12166and graphs of objects for dependency injection frameworks")
12167 (license license:asl2.0)))
12168
12169(define java-geronimo-genesis-2.1
12170 (package
12171 (name "java-geronimo-genesis")
12172 (version "2.1")
12173 (source (origin
12174 (method svn-fetch)
12175 (uri (svn-reference
12176 (url (string-append "https://svn.apache.org/repos/asf/"
12177 "geronimo/genesis/tags/genesis-"
12178 version))
12179 (revision 1807396)))
12180 (file-name (string-append name "-" version "-source"))
12181 (sha256
12182 (base32
12183 "1mky4zyl2xsqlgrkairaj5971byvhwk2z9bq8snsgvlr11ydc0zf"))))
12184 (build-system ant-build-system)
12185 (arguments
12186 `(#:tests? #f
12187 #:phases
12188 (modify-phases %standard-phases
12189 (delete 'configure)
12190 (delete 'build)
12191 (replace 'install
12192 (install-pom-file "pom.xml"))
12193 (add-after 'install 'install-enforcer-rules
12194 (install-pom-file "genesis-enforcer-rules/pom.xml"))
12195 (add-after 'install 'install-flava
12196 (install-pom-file "genesis-default-flava/pom.xml"))
12197 (add-after 'install 'install-packaging
12198 (install-pom-file "genesis-packaging/pom.xml"))
12199 (add-after 'install-flava 'install-flava-java4
12200 (install-pom-file "genesis-default-flava/genesis-java1.4-flava/pom.xml"))
12201 (add-after 'install-flava 'install-flava-java5
12202 (install-pom-file "genesis-default-flava/genesis-java5-flava/pom.xml"))
12203 (add-after 'install-flava 'install-flava-java6
12204 (install-pom-file "genesis-default-flava/genesis-java6-flava/pom.xml")))))
12205 (propagated-inputs
12206 `(("apache-parent-pom" ,apache-parent-pom-13)))
12207 (home-page "https://geronimo.apache.org")
12208 (synopsis "Collection of maven POM files for the Geronimo project")
12209 (description "Apache Geronimo is a server runtime. This package contains
12210only pom files used by other components in the Geronimo project.")
12211 (license license:asl2.0)))
12212
12213(define java-geronimo-parent-pom
12214 (package
12215 (inherit java-geronimo-xbean-reflect)
12216 (name "java-geronimo-parent-pom")
12217 (arguments
12218 `(#:tests? #f
12219 #:phases
12220 (modify-phases %standard-phases
12221 (delete 'configure)
12222 (delete 'build)
12223 (replace 'install
12224 (install-pom-file "pom.xml")))))
12225 (propagated-inputs
12226 `(("java-geronimo-genesis" ,java-geronimo-genesis-2.1)))))
12227
12228(define-public java-geronimo-xbean-bundleutils
12229 (package
12230 (inherit java-geronimo-xbean-reflect)
12231 (name "java-geronimo-xbean-bundleutils")
12232 (arguments
12233 `(#:jar-name "geronimo-xbean-bundleutils.jar"
12234 #:source-dir "xbean-bundleutils/src/main/java"
12235 #:test-dir "xbean-bundleutils/src/test"
12236 #:phases
12237 (modify-phases %standard-phases
12238 (add-before 'build 'fix-java
12239 (lambda _
12240 ;; We use a more recent version of osgi, so this file requires
12241 ;; more interface method implementations.
12242 (substitute* "xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java"
12243 (("import org.osgi.framework.ServiceRegistration;")
12244 "import org.osgi.framework.ServiceRegistration;
12245import org.osgi.framework.ServiceFactory;
12246import java.util.Collection;
12247import org.osgi.framework.ServiceObjects;")
12248 (("public Bundle getBundle\\(\\)")
12249 "@Override
12250public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
12251 throw new UnsupportedOperationException();
12252}
12253@Override
12254public <S> ServiceRegistration<S> registerService(Class<S> clazz,
12255 ServiceFactory<S> factory, Dictionary<String, ?> properties) {
12256 throw new UnsupportedOperationException();
12257}
12258public Bundle getBundle()"))
12259 #t)))))
12260 (inputs
12261 `(("java-slf4j" ,java-slf4j-api)
12262 ("java-asm" ,java-asm)
12263 ("java-osgi-framework" ,java-osgi-framework)
12264 ("java-eclipse-osgi" ,java-eclipse-osgi)
12265 ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)))))
12266
12267(define-public java-geronimo-xbean-asm-util
12268 (package
12269 (inherit java-geronimo-xbean-reflect)
12270 (name "java-geronimo-xbean-asm-util")
12271 (arguments
12272 `(#:jar-name "geronimo-xbean-asm-util.jar"
12273 #:source-dir "xbean-asm-util/src/main/java"
12274 #:tests? #f)); no tests
12275 (inputs
12276 (list java-asm))
12277 (native-inputs '())))
12278
12279(define-public java-geronimo-xbean-finder
12280 (package
12281 (inherit java-geronimo-xbean-reflect)
12282 (name "java-geronimo-xbean-finder")
12283 (arguments
12284 `(#:jar-name "geronimo-xbean-finder.jar"
12285 #:source-dir "xbean-finder/src/main/java"
12286 #:test-dir "xbean-finder/src/test"))
12287 (inputs
12288 (list java-slf4j-api
12289 java-asm
12290 java-geronimo-xbean-bundleutils
12291 java-geronimo-xbean-asm-util
12292 java-osgi-service-packageadmin
12293 java-osgi-framework))
12294 (native-inputs
12295 (list java-junit java-hamcrest-core))))
12296
12297(define-public java-gson
12298 (package
12299 (name "java-gson")
12300 (version "2.8.2")
12301 (source (origin
12302 (method url-fetch)
12303 (uri (string-append "https://github.com/google/gson/archive/"
12304 "gson-parent-" version ".tar.gz"))
12305 (sha256
12306 (base32
12307 "1j4qnp7v046q0k48c4kyf69sxaasx2h949d3cqwsm3kzxms3x0f9"))))
12308 (build-system ant-build-system)
12309 (arguments
12310 `(#:jar-name "gson.jar"
12311 #:source-dir "gson/src/main/java"
12312 #:test-dir "gson/src/test"))
12313 (native-inputs
12314 (list java-junit java-hamcrest-core))
12315 (home-page "https://github.com/google/gson")
12316 (synopsis "Java serialization/deserialization library from/to JSON")
12317 (description "Gson is a Java library that can be used to convert Java
12318Objects into their JSON representation. It can also be used to convert a JSON
12319string to an equivalent Java object. Gson can work with arbitrary Java objects
12320including pre-existing objects that you do not have source-code of.")
12321 (license license:asl2.0)))
12322
12323;; This requires a different Java version than 2.8.2 above
12324(define-public java-gson-2.8.6
12325 (package
12326 (inherit java-gson)
12327 (name "java-gson")
12328 (version "2.8.6")
12329 (source (origin
12330 (method git-fetch)
12331 (uri (git-reference
12332 (url "https://github.com/google/gson")
12333 (commit (string-append "gson-parent-" version))))
12334 (file-name (git-file-name name version))
12335 (sha256
12336 (base32
12337 "0kk5p3vichdb0ph1lzknrcpbklgnmq455mngmjpxvvj29p3rgpk3"))))
12338 (arguments
12339 `(#:jar-name "gson.jar"
12340 #:jdk ,openjdk11
12341 #:source-dir "gson/src/main/java"
12342 #:test-dir "gson/src/test"
12343 #:phases
12344 (modify-phases %standard-phases
12345 ;; avoid Maven dependency
12346 (add-before 'build 'fill-template
12347 (lambda _
12348 (with-directory-excursion "gson/src/main"
12349 (copy-file "java-templates/com/google/gson/internal/GsonBuildConfig.java"
12350 "java/com/google/gson/internal/GsonBuildConfig.java")
12351 (substitute* "java/com/google/gson/internal/GsonBuildConfig.java"
12352 (("\\$\\{project.version\\}") ,version))))))))))
12353
12354(define-public java-hawtjni
12355 (package
12356 (name "java-hawtjni")
12357 (version "1.15")
12358 (source (origin
12359 (method url-fetch)
12360 (uri (string-append "https://github.com/fusesource/hawtjni/archive/"
12361 "hawtjni-project-" version ".tar.gz"))
12362 (sha256
12363 (base32
12364 "1bqfd732rmh6svyx17fpw9175gc9gzkcbyps2yyrf50c3zzjas6g"))))
12365 (build-system ant-build-system)
12366 (arguments
12367 `(#:jar-name "hawtjni.jar"
12368 #:source-dir "hawtjni-generator/src/main/java:hawtjni-runtime/src/main/java"
12369 #:tests? #f; no tests
12370 #:phases
12371 (modify-phases %standard-phases
12372 (add-before 'build 'build-native
12373 (lambda* (#:key inputs #:allow-other-keys)
12374 (let ((include (string-append "-I" (assoc-ref inputs "jdk") "/include/linux")))
12375 (with-directory-excursion "hawtjni-generator/src/main/resources/"
12376 (invoke "gcc" "-c" "hawtjni.c" "-o" "hawtjni.o"
12377 "-fPIC" "-O2" include)
12378 (invoke "gcc" "-c" "hawtjni-callback.c" "-o" "hawtjni-callback.o"
12379 "-fPIC" "-O2" include)
12380 (invoke "gcc" "-o" "libhawtjni.so" "-shared"
12381 "hawtjni.o" "hawtjni-callback.o")))
12382 #t))
12383 (add-after 'install 'install-native
12384 (lambda* (#:key outputs #:allow-other-keys)
12385 (let* ((out (assoc-ref outputs "out"))
12386 (lib (string-append out "/lib"))
12387 (inc (string-append out "/include")))
12388 (with-directory-excursion "hawtjni-generator/src/main/resources/"
12389 (install-file "libhawtjni.so" lib)
12390 (install-file "hawtjni.h" inc)))
12391 #t))
12392 (add-before 'install 'install-parent
12393 (install-pom-file "pom.xml"))
12394 (replace 'install
12395 (install-from-pom "hawtjni-runtime/pom.xml")))))
12396 (inputs
12397 (list java-commons-cli java-asm java-geronimo-xbean-finder))
12398 (home-page "https://fusesource.github.io/hawtjni/")
12399 (synopsis "JNI code generator")
12400 (description "HawtJNI is a code generator that produces the JNI code needed
12401to implement Java native methods. It is based on the jnigen code generator
12402that is part of the SWT Tools project.")
12403 (license license:asl2.0)))
12404
12405(define-public java-jansi-native
12406 (package
12407 (name "java-jansi-native")
12408 (version "1.7")
12409 (source (origin
12410 (method url-fetch)
12411 (uri (string-append "https://github.com/fusesource/jansi-native/"
12412 "archive/jansi-native-" version ".tar.gz"))
12413 (sha256
12414 (base32
12415 "0j2ydlgxbzbgshqkwghbxxxnbnx1mmjgd6k5fw6xfvxw1z956yqf"))))
12416 (build-system ant-build-system)
12417 (arguments
12418 `(#:jar-name "jansi-native.jar"
12419 #:source-dir "src/main/java"
12420 #:tests? #f; no tests
12421 #:phases
12422 (modify-phases %standard-phases
12423 (add-before 'build 'build-native
12424 (lambda* (#:key inputs #:allow-other-keys)
12425 ;; there are more required files for windows in windows/
12426 (with-directory-excursion "src/main/native-package/src"
12427 (substitute* "jansi_ttyname.c"
12428 (("#include \"jansi_.*") ""))
12429 (invoke "gcc" "-c" "jansi_ttyname.c" "-o" "jansi_ttyname.o"
12430 (string-append "-I" (assoc-ref inputs "java-hawtjni")
12431 "/include")
12432 (string-append "-I" (assoc-ref inputs "jdk")
12433 "/include/linux")
12434 "-fPIC" "-O2")
12435 (invoke "gcc" "-o" "libjansi.so" "-shared" "jansi_ttyname.o"))))
12436 (add-before 'build 'install-native
12437 (lambda _
12438 (let ((dir (string-append "build/classes/META-INF/native/"
12439 ,(match (%current-system)
12440 ((or "i686-linux" "armhf-linux")
12441 "linux32")
12442 ((or "x86_64-linux" "aarch64-linux"
12443 "mips64el-linux")
12444 "linux64")
12445 (_ "unknown-kernel")))))
12446 (install-file "src/main/native-package/src/libjansi.so" dir))
12447 #t))
12448 (add-after 'install 'install-native
12449 (lambda* (#:key outputs #:allow-other-keys)
12450 (install-file "src/main/native-package/src/jansi.h"
12451 (string-append (assoc-ref outputs "out") "/include"))
12452 #t))
12453 (add-before 'install 'fix-pom
12454 (lambda _
12455 ;; pom contains variables to complete name, but we don't support that
12456 (substitute* "pom.xml"
12457 (("\\$\\{platform\\}") "native"))
12458 #t))
12459 (replace 'install
12460 (install-from-pom "pom.xml")))))
12461 (propagated-inputs
12462 (list java-hawtjni))
12463 (home-page "https://fusesource.github.io/jansi/")
12464 (synopsis "Native library for jansi")
12465 (description "This package provides the native library for jansi, a small
12466Java library that allows you to use ANSI escape sequences to format your
12467console output.")
12468 (license license:asl2.0)))
12469
12470(define-public java-jansi
12471 (package
12472 (name "java-jansi")
12473 (version "2.4.0")
12474 (source (origin
12475 (method git-fetch)
12476 (uri (git-reference
12477 (url "https://github.com/fusesource/jansi")
12478 (commit (string-append "jansi-" version))))
12479 (file-name (git-file-name name version))
12480 (sha256
12481 (base32
12482 "1s6fva06990798b5fyxqzr30zwyj1byq5wrm54j2larcydaryggf"))
12483 (modules '((guix build utils)))
12484 (snippet
12485 ;; contains pre-compiled libraries
12486 '(delete-file-recursively
12487 "src/main/resources/org/fusesource/jansi/internal"))))
12488 (build-system ant-build-system)
12489 (arguments
12490 `(#:jar-name "jansi.jar"
12491 #:source-dir "src/main/java"
12492 #:test-dir "src/test"
12493 #:tests? #f; require junit 3
12494 #:phases
12495 (modify-phases %standard-phases
12496 (add-before 'build 'build-native
12497 (lambda* (#:key inputs #:allow-other-keys)
12498 (with-directory-excursion "src/main/native"
12499 (for-each
12500 (lambda (cfile)
12501 (let ((cfile (basename cfile))
12502 (ofile (string-append (basename cfile ".c") ".o")))
12503 (invoke ,(cc-for-target) "-c" cfile "-o" ofile
12504 (string-append "-I" (assoc-ref inputs "jdk")
12505 "/include/linux")
12506 "-fPIC" "-O2")))
12507 (find-files "." "\\.c$"))
12508 (apply invoke ,(cc-for-target) "-o" "libjansi.so" "-shared"
12509 (find-files "." "\\.o$")))))
12510 (add-before 'build 'install-native
12511 (lambda _
12512 (let ((dir (string-append "build/classes/org/fusesource/"
12513 "jansi/internal/native/"
12514 ,(match (or (%current-target-system) (%current-system))
12515 ("i686-linux" "Linux/x86")
12516 ("x86_64-linux" "Linux/x86_64")
12517 ("armhf-linux" "Linux/armv7")
12518 ("aarch64-linux" "Linux/arm64")
12519 ("mips64el-linux" "Linux/mips64")
12520 (_ "unknown-kernel")))))
12521 (install-file "src/main/native/libjansi.so" dir))))
12522 (add-before 'build 'copy-resources
12523 (lambda _
12524 (copy-recursively "src/main/resources" "build/classes")))
12525 (replace 'install
12526 (install-from-pom "pom.xml")))))
12527 (home-page "https://fusesource.github.io/jansi/")
12528 (synopsis "Portable ANSI escape sequences")
12529 (description "Jansi is a Java library that allows you to use ANSI escape
12530sequences to format your console output which works on every platform.")
12531 (license license:asl2.0)))
12532
12533(define-public java-jansi-1
12534 (package
12535 (inherit java-jansi)
12536 (version "1.16")
12537 (source (origin
12538 (method git-fetch)
12539 (uri (git-reference
12540 (url "https://github.com/fusesource/jansi")
12541 (commit (string-append "jansi-project-" version))))
12542 (file-name (git-file-name "jansi" version))
12543 (sha256
12544 (base32
12545 "0ikk0x352gh30b42qn1jd89xwsjj0mavrc5kms7fss15bd8vsayx"))))
12546 (arguments
12547 `(#:jar-name "jansi.jar"
12548 #:source-dir "jansi/src/main/java"
12549 #:test-dir "jansi/src/test"
12550 #:phases
12551 (modify-phases %standard-phases
12552 (add-after 'check 'clear-term
12553 (lambda _
12554 (invoke "echo" "-e" "\\e[0m")))
12555 (add-before 'install 'install-parent
12556 (install-pom-file "pom.xml"))
12557 (add-before 'install 'fix-pom
12558 (lambda _
12559 ;; pom adds jansi native versions for different platforms, but we
12560 ;; only need one, so use native instead
12561 (substitute* "jansi/pom.xml"
12562 (("windows32") "native")
12563 (("windows64") "native")
12564 (("osx") "native")
12565 (("linux32") "native")
12566 (("linux64") "native")
12567 (("freebsd32") "native")
12568 (("freebsd64") "native"))
12569 #t))
12570 (replace 'install
12571 (install-from-pom "jansi/pom.xml")))))
12572 (propagated-inputs
12573 (list java-jansi-native))
12574 (native-inputs
12575 (list java-junit java-hamcrest-core))))
12576
12577(define-public java-jboss-el-api-spec
12578 (package
12579 (name "java-jboss-el-api-spec")
12580 (version "3.0")
12581 (source (origin
12582 (method url-fetch)
12583 (uri (string-append "https://github.com/jboss/jboss-el-api_spec/"
12584 "archive/jboss-el-api_" version
12585 "_spec-1.0.7.Final.tar.gz"))
12586 (sha256
12587 (base32
12588 "1j45ljxalwlibxl7g7iv952sjxkw275m8vyxxij8l6wdd5pf0pdh"))))
12589 (build-system ant-build-system)
12590 (arguments
12591 `(#:jar-name "java-jboss-el-api_spec.jar"
12592 #:phases
12593 (modify-phases %standard-phases
12594 ;; the origin of javax.el:javax.el-api is unknown, so we use this package
12595 ;; instead, which implements the same thing. We override the pom file
12596 ;; to "rename" the package so it can be found by maven.
12597 (add-before 'install 'override-pom
12598 (generate-pom.xml "pom.xml" "javax.el" "javax.el-api" "3.0"
12599 #:name "el-api"))
12600 (replace 'install
12601 (install-from-pom "pom.xml")))))
12602 (inputs
12603 (list java-junit))
12604 (home-page "https://github.com/jboss/jboss-el-api_spec")
12605 (synopsis "JSR-341 expression language 3.0 API")
12606 (description "This package contains an implementation of the JSR-341
12607specification for the expression language 3.0. It implements an expression
12608language inspired by ECMAScript and XPath. This language is used with
12609JavaServer Pages (JSP).")
12610 ;; Either GPL2 only or CDDL.
12611 (license (list license:gpl2 license:cddl1.1))))
12612
12613(define-public java-jboss-interceptors-api-spec
12614 (package
12615 (name "java-jboss-interceptors-api-spec")
12616 (version "1.2")
12617 (source (origin
12618 (method url-fetch)
12619 (uri (string-append "https://github.com/jboss/jboss-interceptors-api_spec/"
12620 "archive/jboss-interceptors-api_" version
12621 "_spec-1.0.0.Final.tar.gz"))
12622 (sha256
12623 (base32
12624 "0wv8x0jp9a5qxlrgkhb5jdk2gr6vi87b4j4kjb8ryxiy9gn8g51z"))))
12625 (build-system ant-build-system)
12626 (arguments
12627 `(#:jar-name "java-jboss-interceptors-api_spec.jar"
12628 #:jdk ,icedtea-8
12629 #:source-dir "."
12630 #:tests? #f; no tests
12631 #:phases
12632 (modify-phases %standard-phases
12633 ;; the origin of javax.interceptor:javax.interceptor-api is unknown,
12634 ;; so we use this package instead, which implements the same thing.
12635 ;; We override the pom file to "rename" the package so it can be found
12636 ;; by maven.
12637 (add-before 'install 'override-pom
12638 (generate-pom.xml "pom.xml" "javax.interceptor" "javax.interceptor-api"
12639 "3.0" #:name "interceptor-api"))
12640 (replace 'install
12641 (install-from-pom "pom.xml")))))
12642 (home-page "https://github.com/jboss/jboss-interceptors-api_spec")
12643 (synopsis "Interceptors 1.2 API classes from JSR 318")
12644 (description "Java-jboss-interceptors-api-spec implements the Interceptors
12645API. Interceptors are used to interpose on business method invocations and
12646specific events.")
12647 ;; Either GPL2 only or CDDL.
12648 (license (list license:gpl2 license:cddl1.1))))
12649
12650(define-public java-cdi-api
12651 (package
12652 (name "java-cdi-api")
12653 (version "2.0")
12654 (source (origin
12655 (method url-fetch)
12656 (uri (string-append "https://github.com/cdi-spec/cdi/archive/"
12657 version ".tar.gz"))
12658 (file-name (string-append name "-" version ".tar.gz"))
12659 (sha256
12660 (base32
12661 "1iv8b8bp07c5kmqic14jsr868vycjv4qv02lf3pkgp9z21mnfg5y"))))
12662 (build-system ant-build-system)
12663 (arguments
12664 `(#:source-dir "api/src/main/java"
12665 #:jar-name "java-cdi-api.jar"
12666 #:test-dir "api/src/test"
12667 #:jdk ,icedtea-8
12668 #:tests? #f; Tests fail because we don't have a CDI provider yet
12669 #:phases
12670 (modify-phases %standard-phases
12671 (replace 'install
12672 (install-from-pom "api/pom.xml")))))
12673 (propagated-inputs
12674 (list java-javax-inject java-jboss-el-api-spec
12675 java-jboss-interceptors-api-spec java-weld-parent-pom))
12676 (native-inputs
12677 (list java-testng java-hamcrest-core))
12678 (home-page "https://cdi-spec.org/")
12679 (synopsis "Contexts and Dependency Injection APIs")
12680 (description "Java-cdi-api contains the required APIs for Contexts and
12681Dependency Injection (CDI).")
12682 (license license:asl2.0)))
12683
12684(define-public java-joda-convert
12685 (package
12686 (name "java-joda-convert")
12687 (version "1.9.2")
12688 (source (origin
12689 (method url-fetch)
12690 (uri (string-append "https://github.com/JodaOrg/joda-convert/archive/v"
12691 version ".tar.gz"))
12692 (file-name (string-append name "-" version ".tar.gz"))
12693 (sha256
12694 (base32
12695 "0vp346xz7dh9br4q7xazhc7hvzf76a6hf95fki9bg67q5jr0kjh7"))))
12696 (build-system ant-build-system)
12697 (arguments
12698 `(#:jar-name (string-append ,name "-" ,version ".jar")
12699 #:source-dir "src/main/java"
12700 #:test-include (list "**/Test*.java")
12701 ;; Contains only interfaces and base classes (no test)
12702 #:test-exclude (list "**/test*/**.java")))
12703 (inputs
12704 (list java-guava))
12705 (native-inputs
12706 (list java-junit java-hamcrest-core))
12707 (home-page "https://www.joda.org/joda-convert/")
12708 (synopsis "Conversion between Objects and Strings")
12709 (description "Joda-Convert provides a small set of classes to aid
12710conversion between Objects and Strings. It is not intended to tackle the
12711wider problem of Object to Object transformation.")
12712 (license license:asl2.0)))
12713
12714(define-public java-joda-time
12715 (package
12716 (name "java-joda-time")
12717 (version "2.9.9")
12718 (source (origin
12719 (method url-fetch)
12720 (uri (string-append "https://github.com/JodaOrg/joda-time/archive/v"
12721 version ".tar.gz"))
12722 (file-name (string-append name "-" version ".tar.gz"))
12723 (sha256
12724 (base32
12725 "1i9x91mi7yg2pasl0k3912f1pg46n37sps6rdb0v1gs8hj9ppwc1"))))
12726 (build-system ant-build-system)
12727 (arguments
12728 `(#:jar-name "java-joda-time.jar"
12729 #:source-dir "src/main/java"
12730 #:test-include (list "**/Test*.java")
12731 ;; There is no runnable test in these files
12732 #:test-exclude (list "**/Test*Chronology.java" "**/Test*Field.java")
12733 #:phases
12734 (modify-phases %standard-phases
12735 (add-after 'build 'build-resources
12736 (lambda _
12737 (mkdir-p "build/classes/org/joda/time/tz/data")
12738 (mkdir-p "build/classes/org/joda/time/format")
12739 ;; This will produce the following exception:
12740 ;; java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap"
12741 ;; which is normal, because it doesn't exist yet. It still generates
12742 ;; the same file as in the binary one can find on maven.
12743 (invoke "java" "-cp"
12744 (string-append "build/classes:" (getenv "CLASSPATH"))
12745 "org.joda.time.tz.ZoneInfoCompiler"
12746 "-src" "src/main/java/org/joda/time/tz/src"
12747 "-dst" "build/classes/org/joda/time/tz/data"
12748 "africa" "antarctica" "asia" "australasia"
12749 "europe" "northamerica" "southamerica"
12750 "pacificnew" "etcetera" "backward" "systemv")
12751 (for-each (lambda (f)
12752 (copy-file f (string-append
12753 "build/classes/org/joda/time/format/"
12754 (basename f))))
12755 (find-files "src/main/java/org/joda/time/format" ".*.properties"))
12756 #t))
12757 (add-before 'install 'regenerate-jar
12758 (lambda _
12759 ;; We need to regenerate the jar file to add generated data.
12760 (delete-file "build/jar/java-joda-time.jar")
12761 (invoke "ant" "jar")))
12762 (add-before 'check 'copy-test-resources
12763 (lambda _
12764 (mkdir-p "build/test-classes/org/joda/time/tz/data")
12765 (copy-file "src/test/resources/tzdata/ZoneInfoMap"
12766 "build/test-classes/org/joda/time/tz/data/ZoneInfoMap")
12767 (copy-recursively "src/test/resources" "build/test-classes")
12768 #t)))))
12769 (inputs
12770 (list java-joda-convert))
12771 (native-inputs
12772 (list java-junit java-hamcrest-core tzdata))
12773 (home-page "https://www.joda.org/joda-time/")
12774 (synopsis "Replacement for the Java date and time classes")
12775 (description "Joda-Time is a replacement for the Java date and time
12776classes prior to Java SE 8.")
12777 (license license:asl2.0)))
12778
12779(define-public java-xerces
12780 (package
12781 (name "java-xerces")
12782 (version "2.12.2")
12783 (source
12784 (origin
12785 (method url-fetch)
12786 (uri (string-append "mirror://apache/xerces/j/source/"
12787 "Xerces-J-src." version ".tar.gz"))
12788 (sha256
12789 (base32 "1s2fnfx5flmhs3q30bxdsa6vs52m6vbnqd3m4cc5r4wfr3afplbd"))
12790 (patches (search-patches
12791 "java-xerces-xjavac_taskdef.patch"
12792 "java-xerces-build_dont_unzip.patch"
12793 "java-xerces-bootclasspath.patch"))))
12794 (build-system ant-build-system)
12795 (arguments
12796 `(#:tests? #f;; Test files are not present
12797 #:test-target "test"
12798 #:jdk ,icedtea-8
12799 #:phases
12800 (modify-phases %standard-phases
12801 (add-after 'unpack 'create-build.properties
12802 (lambda* (#:key inputs #:allow-other-keys)
12803 (let ((jaxp (assoc-ref inputs "java-jaxp"))
12804 (resolver (assoc-ref inputs "java-apache-xml-commons-resolver")))
12805 (with-output-to-file "build.properties"
12806 (lambda _
12807 (format #t
12808 "jar.jaxp = ~a/share/java/jaxp.jar~@
12809 jar.apis-ext = ~a/share/java/jaxp.jar~@
12810 jar.resolver = ~a/share/java/xml-resolver.jar~%"
12811 jaxp jaxp resolver)))
12812 ;; Make xerces use our version of jaxp in tests
12813 (substitute* "build.xml"
12814 (("xml-apis.jar")
12815 (string-append jaxp "/share/java/jaxp.jar"))
12816 (("\\$\\{tools.dir\\}/\\$\\{jar.apis\\}")
12817 "${jar.apis}")))
12818 #t))
12819 (replace 'install (install-jars "build")))))
12820 (inputs
12821 (list java-apache-xml-commons-resolver java-jaxp))
12822 (home-page "https://xerces.apache.org/xerces2-j/")
12823 (synopsis "Validating XML parser for Java with DOM level 3 support")
12824 (description "The Xerces2 Java parser is the reference implementation of
12825XNI, the Xerces Native Interface, and also a fully conforming XML Schema
12826processor.
12827
12828Xerces2-J supports the following standards and APIs:
12829
12830@itemize
12831@item eXtensible Markup Language (XML) 1.0 Second Edition Recommendation
12832@item Namespaces in XML Recommendation
12833@item Document Object Model (DOM) Level 2 Core, Events, and Traversal and
12834 Range Recommendations
12835@item Simple API for XML (SAX) 2.0.1 Core and Extension
12836@item Java APIs for XML Processing (JAXP) 1.2.01
12837@item XML Schema 1.0 Structures and Datatypes Recommendations
12838@item Experimental implementation of the Document Object Model (DOM) Level 3
12839 Core and Load/Save Working Drafts
12840@item Provides a partial implementation of the XML Inclusions (XInclude) W3C
12841 Candidate Recommendation
12842@end itemize
12843
12844Xerces is now able to parse documents written according to the XML 1.1
12845Candidate Recommendation, except that it does not yet provide an option to
12846enable normalization checking as described in section 2.13 of this
12847specification. It also handles namespaces according to the XML Namespaces 1.1
12848Candidate Recommendation, and will correctly serialize XML 1.1 documents if
12849the DOM level 3 load/save API's are in use.")
12850 (license license:asl2.0)))
12851
12852(define-public java-jakarta-regexp
12853 (package
12854 (name "java-jakarta-regexp")
12855 (version "1.5")
12856 (source
12857 (origin
12858 (method url-fetch)
12859 (uri (string-append
12860 "https://archive.apache.org/dist/jakarta/regexp/jakarta-regexp-"
12861 version ".tar.gz"))
12862 (sha256
12863 (base32
12864 "0zg9rmyif48dck0cv6ynpxv23mmcsx265am1fnnxss7brgw0ms3r"))))
12865 (build-system ant-build-system)
12866 (arguments
12867 `(#:test-target "test"
12868 #:phases
12869 (modify-phases %standard-phases
12870 (replace 'install
12871 (lambda* (#:key outputs #:allow-other-keys)
12872 (let* ((out (assoc-ref outputs "out"))
12873 (out-share (string-append out "/share/java")))
12874 (mkdir-p out-share)
12875 (for-each (lambda (name)
12876 (install-file name out-share))
12877 (find-files "build" "^jakarta-regexp-.*\\.jar$"))
12878 #t))))))
12879 (home-page "https://attic.apache.org/projects/jakarta-regexp.html")
12880 (synopsis "Regular expression parser generator for Java")
12881 (description "@code{jakarta-regexp} is an old regular expression parser
12882generator for Java.")
12883 (license license:asl2.0)))
12884
12885(define-public java-jline
12886 (package
12887 (name "java-jline")
12888 (version "1.0")
12889 (source (origin
12890 (method url-fetch)
12891 (uri (string-append "https://github.com/jline/jline1/archive/jline-"
12892 version ".tar.gz"))
12893 (sha256
12894 (base32
12895 "0bi3p6vrh7a6v0fbpb6rx9plpmx5zk3lr352xzdbz2jcxg499wir"))))
12896 (build-system ant-build-system)
12897 (arguments
12898 `(#:jar-name "jline.jar"
12899 #:source-dir "src/main/java"
12900 #:test-dir "src/test"
12901 #:phases
12902 (modify-phases %standard-phases
12903 (add-before 'build 'copy-resources
12904 (lambda _
12905 (copy-recursively "src/main/resources" "build/classes")
12906 #t)))))
12907 (native-inputs
12908 (list java-junit))
12909 (home-page "https://jline.github.io")
12910 (synopsis "Console input handling library")
12911 (description "JLine is a Java library for handling console input. It is
12912similar in functionality to BSD editline and GNU readline but with additional
12913features that bring it on par with the Z shell line editor.")
12914 (license license:bsd-3)))
12915
12916(define-public java-jline-2
12917 (package
12918 (inherit java-jline)
12919 (version "2.14.5")
12920 (source (origin
12921 (method url-fetch)
12922 (uri (string-append "https://github.com/jline/jline2/archive/jline-"
12923 version ".tar.gz"))
12924 (sha256
12925 (base32
12926 "1c6qa26mf0viw8hg4jnv72s7i1qb1gh1l8rrzcdvqhqhx82rkdlf"))))
12927 (arguments
12928 `(#:jdk ,icedtea-8
12929 ,@(package-arguments java-jline)))
12930 (inputs
12931 (list java-jansi-1 java-jansi-native))
12932 (native-inputs
12933 (list java-powermock-modules-junit4
12934 java-powermock-modules-junit4-common
12935 java-powermock-api-easymock
12936 java-powermock-api-support
12937 java-powermock-core
12938 java-powermock-reflect
12939 java-easymock
12940 java-jboss-javassist
12941 java-objenesis
12942 java-hamcrest-core
12943 java-cglib
12944 java-junit
12945 java-hawtjni))))
12946
12947(define-public java-jline-terminal
12948 (package
12949 (name "java-jline-terminal")
12950 (version "3.14.1")
12951 (source (origin
12952 (method git-fetch)
12953 (uri (git-reference
12954 (url "https://github.com/jline/jline3")
12955 (commit (string-append "jline-parent-" version))))
12956 (file-name (git-file-name name version))
12957 (sha256
12958 (base32
12959 "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr"))))
12960 (build-system ant-build-system)
12961 (arguments
12962 `(#:jar-name "jline-terminal.jar"
12963 #:jdk ,openjdk11
12964 #:tests? #f; TODO: tests fail on *.caps resource lookups
12965 #:source-dir "terminal/src/main/java"
12966 #:test-dir "terminal/src/test"
12967 #:phases
12968 (modify-phases %standard-phases
12969 (add-after 'unpack 'remove-build-file
12970 (lambda _
12971 ;; Conflicts with build directory generated by ant-build-system.
12972 (delete-file "build")))
12973 (add-after 'unpack 'patch-paths
12974 (lambda* (#:key inputs #:allow-other-keys)
12975 (substitute* "terminal/src/main/java/org/jline/utils/OSUtils.java"
12976 (("= \"infocmp\"")
12977 (string-append "= \"" (assoc-ref inputs "ncurses")
12978 "/bin/infocmp\""))
12979 (("= \"(s?tty)\"" _ cmd)
12980 (string-append "= \"" (assoc-ref inputs "coreutils")
12981 "/bin/" cmd "\"")))))
12982 ;; Resources are not added to the JAR by ant-build-system.
12983 (add-after 'build 'add-resources
12984 (lambda* (#:key jar-name source-dir #:allow-other-keys)
12985 (let ((build (string-append (getcwd) "/build")))
12986 (with-directory-excursion
12987 (string-append source-dir "/../resources")
12988 (apply invoke "jar" "-uvf"
12989 (string-append build "/jar/" jar-name)
12990 (find-files ".")))))))))
12991 (inputs
12992 (list ncurses)); infocmp
12993 (home-page "https://github.com/jline/jline3")
12994 (synopsis "Java JLine Terminal API and implementations")
12995 (description "JLine is a Java library for handling console input. It is
12996similar in functionality to BSD editline and GNU readline but with additional
12997features that bring it in par with ZSH line editor. People familiar with the
12998readline/editline capabilities for modern shells (such as bash and tcsh) will
12999find most of the command editing features of JLine to be familiar.
13000
13001This package includes the @var{Terminal} API and implementations.")
13002 (license license:bsd-3)))
13003
13004(define-public java-jline-reader
13005 (package
13006 (name "java-jline-reader")
13007 (version "3.14.1")
13008 (source (origin
13009 (method git-fetch)
13010 (uri (git-reference
13011 (url "https://github.com/jline/jline3")
13012 (commit (string-append "jline-parent-" version))))
13013 (file-name (git-file-name name version))
13014 (sha256
13015 (base32
13016 "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr"))))
13017 (build-system ant-build-system)
13018 (arguments
13019 `(#:jar-name "jline-reader.jar"
13020 #:jdk ,openjdk11
13021 #:source-dir "reader/src/main/java"
13022 #:test-dir "reader/src/test"
13023 #:phases
13024 (modify-phases %standard-phases
13025 (add-before 'build 'remove-build-file
13026 (lambda _
13027 ;; conflicts with build directory generated by ant-build-system
13028 (delete-file "build"))))))
13029 (native-inputs
13030 (list java-junit java-easymock))
13031 (inputs
13032 (list java-jline-terminal))
13033 (home-page "https://github.com/jline/jline3")
13034 (synopsis "Java JLine line reader")
13035 (description "JLine is a Java library for handling console input. It is
13036similar in functionality to BSD editline and GNU readline but with additional
13037features that bring it in par with ZSH line editor. People familiar with the
13038readline/editline capabilities for modern shells (such as bash and tcsh) will
13039find most of the command editing features of JLine to be familiar.
13040
13041This package includes the line reader.")
13042 (license license:bsd-3)))
13043
13044(define-public java-xmlunit
13045 (package
13046 (name "java-xmlunit")
13047 (version "2.5.1")
13048 (source (origin
13049 (method url-fetch)
13050 (uri (string-append "https://github.com/xmlunit/xmlunit/archive/v"
13051 version ".tar.gz"))
13052 (file-name (string-append name "-" version ".tar.gz"))
13053 (sha256
13054 (base32
13055 "035rivlnmwhfqj0fzviciv0bkh1h95ps1iwnh2kjcvdbk5nccm4z"))))
13056 (build-system ant-build-system)
13057 (arguments
13058 `(#:jar-name "java-xmlunit.jar"
13059 #:source-dir "xmlunit-core/src/main/java"
13060 #:test-dir "xmlunit-core/src/test"
13061 #:phases
13062 (modify-phases %standard-phases
13063 (add-before 'check 'copy-test-resources
13064 (lambda* (#:key inputs #:allow-other-keys)
13065 (copy-recursively (assoc-ref inputs "resources") "../test-resources")
13066 #t)))))
13067 (native-inputs
13068 `(("java-junit" ,java-junit)
13069 ("java-mockito-1" ,java-mockito-1)
13070 ("java-hamcrest-all" ,java-hamcrest-all)
13071 ("java-objenesis" ,java-objenesis)
13072 ("java-cglib" ,java-cglib)
13073 ("resources"
13074 ,(origin
13075 (method git-fetch)
13076 (uri (git-reference
13077 (url "https://github.com/xmlunit/test-resources")
13078 (commit "a590d2ae865c3e0455691d76ba8eefccc2215aec")))
13079 (file-name "java-xmlunit-test-resources")
13080 (sha256
13081 (base32
13082 "0r0glj37pg5l868yjz78gckr91cs8fysxxbp9p328dssssi91agr"))))))
13083 (home-page "https://www.xmlunit.org/")
13084 (synopsis "XML output testing")
13085 (description "XMLUnit provides you with the tools to verify the XML you
13086emit is the one you want to create. It provides helpers to validate against
13087an XML Schema, assert the values of XPath queries or compare XML documents
13088against expected outcomes.")
13089 (license license:asl2.0)))
13090
13091(define-public java-xmlunit-legacy
13092 (package
13093 (inherit java-xmlunit)
13094 (name "java-xmlunit-legacy")
13095 (arguments
13096 `(#:jar-name "java-xmlunit-legacy.jar"
13097 #:source-dir "xmlunit-legacy/src/main/java"
13098 #:test-dir "xmlunit-legacy/src/test"))
13099 (inputs
13100 (list java-xmlunit java-junit))
13101 (native-inputs
13102 `(("java-mockito-1" ,java-mockito-1)))))
13103
13104(define-public java-xmlunit-matchers
13105 (package
13106 (inherit java-xmlunit)
13107 (name "java-xmlunit-matchers")
13108 (arguments
13109 `(#:jar-name "java-xmlunit-matchers.jar"
13110 #:source-dir "xmlunit-matchers/src/main/java"
13111 #:test-dir "xmlunit-matchers/src/test"
13112 #:test-exclude
13113 ;; Cannot open xsd for http://www.xmlunit.org/test-support/Book.xsd
13114 (list "**/ValidationMatcherTest.java")
13115 #:phases
13116 (modify-phases %standard-phases
13117 (add-before 'build 'copy-test-class
13118 (lambda _
13119 (copy-file "xmlunit-core/src/test/java/org/xmlunit/TestResources.java"
13120 "xmlunit-matchers/src/test/java/org/xmlunit/TestResources.java")
13121 #t))
13122 (add-before 'build 'fix-test-resources-path
13123 (lambda _
13124 (substitute* (find-files "xmlunit-matchers/src/test" ".*.java")
13125 (("../test-resources") "test-resources"))
13126 #t))
13127 (add-before 'check 'copy-test-resources
13128 (lambda* (#:key inputs #:allow-other-keys)
13129 (copy-recursively (assoc-ref inputs "resources") "test-resources")
13130 #t)))))
13131 (inputs
13132 (list java-xmlunit java-junit))))
13133
13134(define-public java-openchart2
13135 (package
13136 (name "java-openchart2")
13137 (version "1.4.3")
13138 (source (origin
13139 (method url-fetch)
13140 (uri (string-append "http://download.approximatrix.com/openchart2/"
13141 "openchart2-" version ".source.zip"))
13142 (sha256
13143 (base32
13144 "1xq96zm5r02n1blja0072jmmsifmxc40lbyfbnmcnr6mw42frh4g"))))
13145 (build-system ant-build-system)
13146 (arguments
13147 `(#:test-target "test"
13148 #:phases
13149 (modify-phases %standard-phases
13150 (add-after 'unpack 'fix-junit-errors
13151 (lambda _
13152 (with-directory-excursion "unittest/src/com/approximatrix/charting/"
13153 (substitute* '("coordsystem/ticklocator/NumericXTickLocatorTest.java"
13154 "coordsystem/ticklocator/NumericYTickLocatorTest.java"
13155 "coordsystem/ticklocator/ObjectXTickLocatorTest.java"
13156 "model/DefaultChartDataModelConstraintsTest.java"
13157 "model/MultiScatterDataModelConstraintsTest.java"
13158 "model/threedimensional/DotPlotDataModelConstraintsTest.java")
13159 (("(assertEquals[^;]+);" before _)
13160 (string-append (string-drop-right before 2) ", 1E-6);"))))
13161 #t))
13162 (replace 'install (install-jars ".")))))
13163 (native-inputs
13164 (list unzip java-junit java-hamcrest-core))
13165 (home-page "https://approximatrix.com/products/openchart2/")
13166 (synopsis "Simple plotting for Java")
13167 (description "Openchart2 provides a simple, yet powerful, interface for
13168Java programmers to create two-dimensional charts and plots. The library
13169features an assortment of graph styles, including advanced scatter plots, bar
13170graphs, and pie charts.")
13171 (license license:lgpl2.1+)))
13172
13173(define-public java-commons-httpclient
13174 (package
13175 (name "java-commons-httpclient")
13176 (version "3.1")
13177 (source (origin
13178 (method url-fetch)
13179 (uri (string-append "mirror://apache/httpcomponents/"
13180 "commons-httpclient/source/commons-httpclient-"
13181 version "-src.tar.gz"))
13182 (sha256
13183 (base32
13184 "1wlpn3cfy3d4inxy6g7wxcsa8p7sshn6aldk9y4ia3lb879rd97r"))))
13185 (build-system ant-build-system)
13186 (arguments
13187 `(#:build-target "compile"
13188 #:test-target "test"
13189 #:tests? #f; requires junit-textui (junit 3)
13190 #:phases
13191 (modify-phases %standard-phases
13192 (add-before 'build 'fix-accent
13193 (lambda _
13194 (for-each (lambda (file)
13195 (with-fluids ((%default-port-encoding "ISO-8859-1"))
13196 (substitute* file
13197 (("\\* @author Ortwin .*") "* @author Ortwin Glueck\n"))))
13198 '("src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java"
13199 "src/examples/TrivialApp.java" "src/examples/ClientApp.java"
13200 "src/test/org/apache/commons/httpclient/TestHttps.java"
13201 "src/test/org/apache/commons/httpclient/TestURIUtil2.java"))
13202 #t))
13203 (replace 'install
13204 (lambda* (#:key outputs #:allow-other-keys)
13205 (invoke "ant" "dist"
13206 (string-append "-Ddist.home=" (assoc-ref outputs "out")
13207 "/share/java"))
13208 #t)))))
13209 (propagated-inputs
13210 `(("java-commons-logging" ,java-commons-logging-minimal)
13211 ("java-commons-codec" ,java-commons-codec)))
13212 (home-page "https://hc.apache.org")
13213 (synopsis "HTTP/1.1 compliant HTTP agent implementation")
13214 (description "This package contains an HTTP/1.1 compliant HTTP agent
13215implementation. It also provides reusable components for client-side
13216authentication, HTTP state management, and HTTP connection management.")
13217 (license license:asl2.0)))
13218
13219(define-public java-commons-vfs
13220 (package
13221 (name "java-commons-vfs")
13222 (version "2.2")
13223 (source (origin
13224 (method url-fetch)
13225 (uri (string-append "mirror://apache/commons/vfs/source/"
13226 "commons-vfs2-distribution-" version "-src.tar.gz"))
13227 (file-name (string-append name "-" version ".tar.gz"))
13228 (sha256
13229 (base32
13230 "1cnq1iaghbp4cslpnvwbp83i5v234x87irssqynhwpfgw7caf1s3"))
13231 (modules '((guix build utils)))
13232 (snippet
13233 '(begin
13234 (for-each delete-file
13235 (find-files "." "\\.jar$"))
13236 #t))))
13237 (build-system ant-build-system)
13238 (arguments
13239 `(#:jar-name "commons-vfs.jar"
13240 #:source-dir "commons-vfs2/src/main/java"
13241 #:test-dir "commons-vfs2/src/test"
13242 ; FIXME: tests depend on many things: apache sshd, hadoop, ftpserver, ...
13243 #:tests? #f
13244 #:phases
13245 (modify-phases %standard-phases
13246 (add-before 'build 'remove-hadoop-and-webdav
13247 ; Remove these files as they are not required and depend on difficult
13248 ; packages.
13249 (lambda _
13250 (for-each delete-file-recursively
13251 '("commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/webdav"
13252 "commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs"))
13253 #t)))))
13254 (inputs
13255 (list java-commons-collections4
13256 java-commons-compress
13257 java-commons-httpclient
13258 java-commons-logging-minimal
13259 java-commons-net
13260 java-jsch))
13261 (home-page "https://commons.apache.org/proper/commons-vfs/")
13262 (synopsis "Java file system library")
13263 (description "Commons VFS provides a single API for accessing various
13264different file systems. It presents a uniform view of the files from various
13265different sources, such as the files on local disk, on an HTTP server, or
13266inside a Zip archive.")
13267 (license license:asl2.0)))
13268
13269(define-public java-jakarta-oro
13270 (package
13271 (name "java-jakarta-oro")
13272 (version "2.0.8")
13273 (source (origin
13274 (method url-fetch)
13275 (uri (string-append "mirror://apache/jakarta/oro/"
13276 "jakarta-oro-" version ".tar.gz"))
13277 (sha256
13278 (base32
13279 "0rpmnsskiwmsy8r0sckz5n5dbvh3vkxx8hpm177c754r8xy3qksc"))
13280 (modules '((guix build utils)))
13281 (snippet
13282 `(begin
13283 (delete-file (string-append "jakarta-oro-" ,version ".jar"))
13284 #t))))
13285 (build-system ant-build-system)
13286 (arguments
13287 `(#:build-target "package"
13288 #:make-flags (list "-DDATE" "(no recorded date for reproducibility)")
13289 #:tests? #f; tests are run as part of the build process
13290 #:phases
13291 (modify-phases %standard-phases
13292 (replace 'install
13293 (install-jars ,(string-append "jakarta-oro-" version))))))
13294 (home-page "https://jakarta.apache.org/oro/")
13295 (synopsis "Text-processing for Java")
13296 (description "The Jakarta-ORO Java classes are a set of text-processing
13297Java classes that provide Perl5 compatible regular expressions, AWK-like
13298regular expressions, glob expressions, and utility classes for performing
13299substitutions, splits, filtering filenames, etc. This library is the successor
13300of the OROMatcher, AwkTools, PerlTools, and TextTools libraries originally
13301from ORO, Inc.")
13302 (license license:asl1.1)))
13303
13304(define-public java-native-access
13305 (package
13306 (name "java-native-access")
13307 (version "4.5.1")
13308 (source (origin
13309 (method url-fetch)
13310 (uri (string-append "https://github.com/java-native-access/jna/"
13311 "archive/" version ".tar.gz"))
13312 (file-name (string-append name "-" version ".tar.gz"))
13313 (sha256
13314 (base32
13315 "0zrpzkib6b905i018a9pqlzkqinphywr6y4jwv6mwp63jjqvqkd9"))
13316 (modules '((guix build utils)))
13317 (snippet
13318 `(begin
13319 (for-each delete-file (find-files "." ".*.jar"))
13320 (delete-file-recursively "native/libffi")
13321 (delete-file-recursively "dist")
13322 #t))))
13323 (build-system ant-build-system)
13324 (arguments
13325 `(#:tests? #f; FIXME: tests require reflections.jar
13326 #:test-target "test"
13327 #:make-flags (list "-Ddynlink.native=true")
13328 #:phases
13329 (modify-phases %standard-phases
13330 (add-before 'build 'fix-build.xml
13331 (lambda* (#:key inputs #:allow-other-keys)
13332 (substitute* "build.xml"
13333 ;; Since we removed the bundled ant.jar, give the correct path
13334 (("lib/ant.jar") (search-input-file inputs "/lib/ant.jar"))
13335 ;; We removed generated native libraries. We can only rebuild one
13336 ;; so don't fail if we can't find a native library for another architecture.
13337 (("zipfileset") "zipfileset erroronmissingarchive=\"false\""))
13338 ;; Copy test dependencies
13339 (copy-file (car (find-files (assoc-ref inputs "java-junit") "jar$"))
13340 "lib/junit.jar")
13341 (copy-file (car (find-files (assoc-ref inputs "java-hamcrest-core")
13342 "jar$"))
13343 "lib/hamcrest-core.jar")
13344 ;; FIXME: once reflections.jar is built, copy it to lib/test.
13345 #t))
13346 (add-before 'build 'build-native
13347 (lambda _
13348 (invoke "ant" "-Ddynlink.native=true" "native")
13349 #t))
13350 (replace 'install
13351 (install-jars "build")))))
13352 (inputs
13353 (list libffi libx11 libxt))
13354 (native-inputs
13355 (list gcc-7 java-junit java-hamcrest-core))
13356 (home-page "https://github.com/java-native-access/jna")
13357 (synopsis "Access to native shared libraries from Java")
13358 (description "JNA provides Java programs easy access to native shared
13359libraries without writing anything but Java code - no JNI or native code is
13360required. JNA allows you to call directly into native functions using natural
13361Java method invocation.")
13362 ;; Java Native Access project (JNA) is dual-licensed under 2
13363 ;; alternative Free licenses: LGPL 2.1 or later and Apache License 2.0.
13364 (license (list
13365 license:asl2.0
13366 license:lgpl2.1+))))
13367
13368(define-public java-native-access-platform
13369 (package
13370 (inherit java-native-access)
13371 (name "java-native-access-platform")
13372 (arguments
13373 `(#:test-target "test"
13374 #:tests? #f; require jna-test.jar
13375 #:phases
13376 (modify-phases %standard-phases
13377 (add-before 'build 'chdir
13378 (lambda _
13379 (chdir "contrib/platform")
13380 #t))
13381 (add-after 'chdir 'fix-ant
13382 (lambda* (#:key inputs #:allow-other-keys)
13383 (substitute* "nbproject/project.properties"
13384 (("../../build/jna.jar")
13385 (search-input-file inputs "/share/java/jna.jar"))
13386 (("../../lib/hamcrest-core-.*.jar")
13387 (car (find-files (assoc-ref inputs "java-hamcrest-core")
13388 "jar$")))
13389 (("../../lib/junit.jar")
13390 (car (find-files (assoc-ref inputs "java-junit")
13391 "jar$"))))
13392 #t))
13393 (replace 'install
13394 (install-jars "dist")))))
13395 (inputs
13396 (list java-native-access))
13397 (synopsis "Cross-platform mappings for jna")
13398 (description "java-native-access-platform has cross-platform mappings
13399and mappings for a number of commonly used platform functions, including a
13400large number of Win32 mappings as well as a set of utility classes that
13401simplify native access.")))
13402
13403(define-public java-jsch-agentproxy-core
13404 (package
13405 (name "java-jsch-agentproxy-core")
13406 (version "0.0.8")
13407 (source (origin
13408 (method url-fetch)
13409 (uri (string-append "https://github.com/ymnk/jsch-agent-proxy/archive/"
13410 version ".tar.gz"))
13411 (file-name (string-append name "-" version ".tar.gz"))
13412 (sha256
13413 (base32
13414 "02iqg6jbc1kxvfzqcg6wy9ygqxfm82bw5rf6vnswqy4y572niz4q"))))
13415 (build-system ant-build-system)
13416 (arguments
13417 `(#:jar-name "jsch-agentproxy-core.jar"
13418 #:source-dir "jsch-agent-proxy-core/src/main/java"
13419 #:tests? #f)); no tests
13420 (home-page "https://github.com/ymnk/jsch-agent-proxy")
13421 (synopsis "Core component of the proxy to ssh-agent and Pageant in Java")
13422 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13423and Pageant included Putty. It will be easily integrated into JSch, and users
13424will be allowed to use these programs for authentication.")
13425 (license license:bsd-3)))
13426
13427(define-public java-jsch-agentproxy-sshagent
13428 (package
13429 (inherit java-jsch-agentproxy-core)
13430 (name "java-jsch-agentproxy-sshagent")
13431 (arguments
13432 `(#:jar-name "jsch-agentproxy-sshagent.jar"
13433 #:source-dir "jsch-agent-proxy-sshagent/src/main/java"
13434 #:tests? #f)); no tests
13435 (inputs
13436 (list java-jsch-agentproxy-core))
13437 (synopsis "Proxy to ssh-agent")
13438 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13439and Pageant included in Putty. This component contains the code for a proxy to
13440ssh-agent.")))
13441
13442(define-public java-jsch-agentproxy-usocket-jna
13443 (package
13444 (inherit java-jsch-agentproxy-core)
13445 (name "java-jsch-agentproxy-usocket-jna")
13446 (arguments
13447 `(#:jar-name "jsch-agentproxy-usocket-jna.jar"
13448 #:source-dir "jsch-agent-proxy-usocket-jna/src/main/java"
13449 #:tests? #f)); no tests
13450 (inputs
13451 (list java-jsch-agentproxy-core java-native-access))
13452 (synopsis "USocketFactory implementation using JNA")
13453 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13454and Pageant included in Putty. This component contains an implementation of
13455USocketFactory using @dfn{JNA} (Java Native Access).")))
13456
13457(define-public java-jsch-agentproxy-pageant
13458 (package
13459 (inherit java-jsch-agentproxy-core)
13460 (name "java-jsch-agentproxy-pageant")
13461 (arguments
13462 `(#:jar-name "jsch-agentproxy-pageant.jar"
13463 #:source-dir "jsch-agent-proxy-pageant/src/main/java"
13464 #:tests? #f)); no tests
13465 (inputs
13466 (list java-jsch-agentproxy-core java-native-access
13467 java-native-access-platform))
13468 (synopsis "Proxy to pageant")
13469 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13470and Pageant included in Putty. This component contains the code for a proxy to
13471pageant.")))
13472
13473(define-public java-jsch-agentproxy-usocket-nc
13474 (package
13475 (inherit java-jsch-agentproxy-core)
13476 (name "java-jsch-agentproxy-usocket-nc")
13477 (arguments
13478 `(#:jar-name "jsch-agentproxy-usocket-nc.jar"
13479 #:source-dir "jsch-agent-proxy-usocket-nc/src/main/java"
13480 #:tests? #f)); no tests
13481 (inputs
13482 (list java-jsch-agentproxy-core))
13483 (synopsis "USocketFactory implementation using netcat")
13484 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13485and Pageant included in Putty. This component contains an implementation of
13486USocketFactory using netcat.")))
13487
13488(define-public java-jsch-agentproxy-connector-factory
13489 (package
13490 (inherit java-jsch-agentproxy-core)
13491 (name "java-jsch-agentproxy-connector-factory")
13492 (arguments
13493 `(#:jar-name "jsch-agentproxy-connector-factory.jar"
13494 #:source-dir "jsch-agent-proxy-connector-factory/src/main/java"
13495 #:tests? #f)); no tests
13496 (inputs
13497 (list java-jsch-agentproxy-core java-jsch-agentproxy-sshagent
13498 java-jsch-agentproxy-usocket-jna java-jsch-agentproxy-pageant
13499 java-jsch-agentproxy-usocket-nc))
13500 (synopsis "Connector factory for jsch agent proxy")
13501 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13502and Pageant included in Putty. This component contains a connector factory.")))
13503
13504(define-public java-jsch-agentproxy-jsch
13505 (package
13506 (inherit java-jsch-agentproxy-core)
13507 (name "java-jsch-agentproxy-jsch")
13508 (arguments
13509 `(#:jar-name "jsch-agentproxy-jsch.jar"
13510 #:source-dir "jsch-agent-proxy-jsch/src/main/java"
13511 #:tests? #f)); no tests
13512 (inputs
13513 (list java-jsch java-jsch-agentproxy-core))
13514 (synopsis "JSch integration library for agentproxy")
13515 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13516and Pageant included in Putty. This component contains a library to use
13517jsch-agent-proxy with JSch.")))
13518
13519(define-public java-apache-ivy
13520 (package
13521 (name "java-apache-ivy")
13522 (version "2.4.0")
13523 (source (origin
13524 (method url-fetch)
13525 (uri (string-append "mirror://apache/ant/ivy/" version
13526 "/apache-ivy-" version "-src.tar.gz"))
13527 (sha256
13528 (base32
13529 "1xkfn57g2m7l6y0xdq75x5rnrgk52m9jx2xah70g3ggl8750hbr0"))
13530 (patches
13531 (search-patches
13532 "java-apache-ivy-port-to-latest-bouncycastle.patch"))))
13533 (build-system ant-build-system)
13534 (arguments
13535 `(#:jar-name "ivy.jar"
13536 #:tests? #f
13537 #:phases
13538 (modify-phases %standard-phases
13539 (add-before 'build 'remove-example
13540 (lambda _
13541 (delete-file-recursively "src/example")
13542 #t))
13543 (add-before 'build 'copy-resources
13544 (lambda _
13545 (with-directory-excursion "src/java"
13546 (for-each (lambda (file)
13547 (install-file file (string-append "../../build/classes/" (dirname file))))
13548 (append
13549 (find-files "." ".*.css")
13550 (find-files "." ".*.ent")
13551 (find-files "." ".*.html")
13552 (find-files "." ".*.properties")
13553 (find-files "." ".*.xsd")
13554 (find-files "." ".*.xsl")
13555 (find-files "." ".*.xml"))))
13556 #t))
13557 (add-before 'build 'fix-vfs
13558 (lambda _
13559 (substitute*
13560 '("src/java/org/apache/ivy/plugins/repository/vfs/VfsRepository.java"
13561 "src/java/org/apache/ivy/plugins/repository/vfs/VfsResource.java")
13562 (("import org.apache.commons.vfs") "import org.apache.commons.vfs2"))
13563 #t))
13564 (add-before 'install 'copy-manifest
13565 (lambda _
13566 (install-file "META-INF/MANIFEST.MF" "build/classes/META-INF")
13567 #t))
13568 (add-before 'install 'repack
13569 (lambda _
13570 (invoke "jar" "-cmf" "build/classes/META-INF/MANIFEST.MF" "build/jar/ivy.jar"
13571 "-C" "build/classes" ".")))
13572 (add-after 'install 'install-bin
13573 (lambda* (#:key outputs #:allow-other-keys)
13574 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
13575 (ivy (string-append bin "/ivy"))
13576 (jar (string-append (assoc-ref outputs "out") "/share/java/ivy.jar")))
13577 (mkdir-p bin)
13578 (with-output-to-file ivy
13579 (lambda _
13580 (display (string-append
13581 "#!" (which "sh") "\n"
13582 "if [[ -z $CLASSPATH ]]; then\n"
13583 " cp=\"" (getenv "CLASSPATH") ":" jar "\"\n"
13584 "else\n"
13585 " cp=\"" (getenv "CLASSPATH") ":" jar ":$CLASSPATH\"\n"
13586 "fi\n"
13587 (which "java") " -cp $cp org.apache.ivy.Main $@\n"))))
13588 (chmod ivy #o755)
13589 #t))))))
13590 (inputs
13591 (list java-bouncycastle
13592 java-commons-cli
13593 java-commons-collections
13594 java-commons-httpclient
13595 java-commons-lang
13596 java-commons-vfs
13597 java-jakarta-oro
13598 java-jsch
13599 java-jsch-agentproxy-core
13600 java-jsch-agentproxy-connector-factory
13601 java-jsch-agentproxy-jsch
13602 java-junit))
13603 (home-page "https://ant.apache.org/ivy")
13604 (synopsis "Dependency manager for the Java programming language")
13605 (description "Ivy is a tool for managing (recording, tracking, resolving
13606and reporting) project dependencies. It is characterized by the following:
13607
13608@itemize
13609@item flexibility and configurability - Ivy is essentially process agnostic
13610 and is not tied to any methodology or structure. Instead it provides the
13611 necessary flexibility and configurability to be adapted to a broad range
13612 of dependency management and build processes.
13613@item tight integration with Apache Ant - while available as a standalone tool,
13614 Ivy works particularly well with Apache Ant providing a number of
13615 powerful Ant tasks ranging from dependency resolution to dependency
13616 reporting and publication.
13617@end itemize")
13618 (license license:asl2.0)))
13619
13620(define-public java-eclipse-sisu-inject
13621 (package
13622 (name "java-eclipse-sisu-inject")
13623 (version "0.3.5")
13624 (source (origin
13625 (method git-fetch)
13626 (uri (git-reference
13627 (url "https://github.com/eclipse/sisu.inject/")
13628 (commit (string-append "releases/" version))))
13629 (file-name (git-file-name name version))
13630 (sha256
13631 (base32
13632 "1yh434b8pi8cwmpk825fbvbnkkk2cwd4gxxjaygg8i9j0q3l9zp3"))))
13633 (build-system ant-build-system)
13634 (arguments
13635 `(#:jar-name "eclipse-sisu-inject.jar"
13636 #:source-dir "org.eclipse.sisu.inject/src"
13637 #:tests? #f; no tests
13638 #:phases
13639 (modify-phases %standard-phases
13640 (replace 'install
13641 (install-from-pom "org.eclipse.sisu.inject/pom.xml")))))
13642 (propagated-inputs
13643 (list java-guice java-sisu-inject-parent-pom))
13644 (inputs
13645 (list java-guice-servlet
13646 java-javax-inject
13647 java-javaee-servletapi
13648 java-junit
13649 java-slf4j-api
13650 java-jsr305
13651 java-jsr250
13652 java-cdi-api
13653 java-osgi-framework
13654 java-osgi-util-tracker
13655 java-testng))
13656 (home-page "https://www.eclipse.org/sisu/")
13657 (synopsis "Classpath scanning, auto-binding, and dynamic auto-wiring")
13658 (description "Sisu is a modular JSR330-based container that supports
13659classpath scanning, auto-binding, and dynamic auto-wiring. Sisu uses
13660Google-Guice to perform dependency injection and provide the core JSR330
13661support, but removes the need to write explicit bindings in Guice modules.
13662Integration with other containers via the Eclipse Extension Registry and the
13663OSGi Service Registry is a goal of this project.")
13664 (license license:epl1.0)))
13665
13666(define java-sisu-inject-parent-pom
13667 (package
13668 (inherit java-eclipse-sisu-inject)
13669 (name "java-sisu-inject-parent-pom")
13670 (arguments
13671 `(#:tests? #f
13672 #:phases
13673 (modify-phases %standard-phases
13674 (delete 'configure)
13675 (delete 'build)
13676 (replace 'install
13677 (install-pom-file "pom.xml")))))
13678 (propagated-inputs '())))
13679
13680(define-public java-eclipse-sisu-plexus
13681 (package
13682 (name "java-eclipse-sisu-plexus")
13683 (version "0.3.5")
13684 (source (origin
13685 (method git-fetch)
13686 (uri (git-reference
13687 (url "https://github.com/eclipse/sisu.plexus")
13688 (commit (string-append "releases/" version))))
13689 (file-name (git-file-name name version))
13690 (sha256
13691 (base32
13692 "0lm5h0dmh41ffcwd32qnk3a87d360am36yq7168ikkyqa8jxkx28"))
13693 (modules '((guix build utils)))
13694 (snippet
13695 '(begin
13696 (for-each delete-file (find-files "." ".*.jar"))
13697 (rename-file "org.eclipse.sisu.plexus.tests/src"
13698 "org.eclipse.sisu.plexus.tests/java")
13699 #t))))
13700 (build-system ant-build-system)
13701 (arguments
13702 `(#:jar-name "eclipse-sisu-plexus.jar"
13703 #:source-dir "org.eclipse.sisu.plexus/src"
13704 #:test-dir "org.eclipse.sisu.plexus.tests"
13705 #:test-exclude
13706 (list
13707 ;; This test fails probably because we can't generate the necessary
13708 ;; meta-inf files.
13709 "**/PlexusLoggingTest.*"
13710 ;; FIXME: This test fails because of some injection error
13711 "**/PlexusRequirementTest.*")
13712 #:jdk ,icedtea-8
13713 #:phases
13714 (modify-phases %standard-phases
13715 (add-before 'build 'copy-resources
13716 (lambda _
13717 (install-file "org.eclipse.sisu.plexus/META-INF/plexus/components.xml"
13718 "build/classes/META-INF/plexus")
13719 #t))
13720 (add-before 'check 'build-test-jar
13721 (lambda _
13722 (with-directory-excursion "org.eclipse.sisu.plexus.tests/resources/component-jar/src/main/"
13723 (mkdir "build")
13724 (with-directory-excursion "java"
13725 (apply invoke "javac" "-cp"
13726 (string-append (getenv "CLASSPATH")
13727 ":../../../../../build/classes")
13728 (find-files "." ".*.java"))
13729 (for-each (lambda (file) (install-file file (string-append "../build/" file)))
13730 (find-files "." ".*.jar")))
13731 (mkdir-p "build/META-INF/plexus")
13732 (copy-file "resources/META-INF/plexus/components.xml"
13733 "build/META-INF/plexus/components.xml")
13734 (with-directory-excursion "build"
13735 (invoke "jar" "cf" "../../../component-jar-0.1.jar" ".")))
13736 (with-directory-excursion "org.eclipse.sisu.plexus.tests/"
13737 (copy-recursively "META-INF" "../build/test-classes/META-INF")
13738 (substitute* "java/org/eclipse/sisu/plexus/DefaultPlexusContainerTest.java"
13739 (("resources/component-jar")
13740 "org.eclipse.sisu.plexus.tests/resources/component-jar")))
13741 #t))
13742 (replace 'install
13743 (install-from-pom "org.eclipse.sisu.plexus/pom.xml")))))
13744 (propagated-inputs
13745 (list java-jsr250
13746 java-plexus-classworlds
13747 java-plexus-utils
13748 java-plexus-component-annotations
13749 java-cdi-api
13750 java-eclipse-sisu-inject
13751 java-sisu-plexus-parent-pom))
13752 (inputs
13753 (list java-osgi-framework
13754 java-slf4j-api
13755 java-javax-inject
13756 java-guice
13757 java-guava
13758 java-aopalliance
13759 java-cglib))
13760 (native-inputs
13761 (list java-junit))
13762 (home-page "https://www.eclipse.org/sisu/")
13763 (synopsis "Plexus support for the sisu container")
13764 (description "Sisu is a modular JSR330-based container that supports
13765classpath scanning, auto-binding, and dynamic auto-wiring. This package
13766adds Plexus support to the Sisu-Inject container.")
13767 (license license:epl1.0)))
13768
13769(define java-sisu-plexus-parent-pom
13770 (package
13771 (inherit java-eclipse-sisu-plexus)
13772 (name "java-sisu-plexus-parent-pom")
13773 (arguments
13774 `(#:tests? #f
13775 #:phases
13776 (modify-phases %standard-phases
13777 (delete 'configure)
13778 (delete 'build)
13779 (replace 'install
13780 (install-pom-file "pom.xml")))))
13781 (propagated-inputs
13782 `(("java-sonatype-oss-parent-pom-9" ,java-sonatype-oss-parent-pom-9)))))
13783
13784(define-public java-commons-compiler
13785 (package
13786 (name "java-commons-compiler")
13787 (version "3.0.8")
13788 (source (origin
13789 (method git-fetch)
13790 (uri (git-reference
13791 (url "https://github.com/janino-compiler/janino")
13792 (commit "91aa95686d1e4ca3b16a984a03a38686572331b2")))
13793 (file-name (string-append name "-" version))
13794 (sha256
13795 (base32
13796 "04hfdl59sgh20qkxzgnibvs8f9hy6n7znxwpk611y5d89977y62r"))
13797 (modules '((guix build utils)))
13798 (snippet
13799 '(begin
13800 (for-each delete-file
13801 (find-files "." "\\.jar$"))
13802 #t))))
13803 (build-system ant-build-system)
13804 (arguments
13805 `(#:jar-name "commons-compiler.jar"
13806 #:source-dir "commons-compiler/src/main"
13807 #:tests? #f)); no tests
13808 (home-page "https://github.com/janino-compiler/janino")
13809 (synopsis "Java compiler")
13810 (description "Commons-compiler contains an API for janino, including the
13811@code{IExpressionEvaluator}, @code{IScriptEvaluator}, @code{IClassBodyEvaluator}
13812and @code{ISimpleCompiler} interfaces.")
13813 (license license:bsd-3)))
13814
13815(define-public java-janino
13816 (package
13817 (inherit java-commons-compiler)
13818 (name "java-janino")
13819 (arguments
13820 `(#:jar-name "janino.jar"
13821 #:source-dir "src/main/java"
13822 #:phases
13823 (modify-phases %standard-phases
13824 (add-before 'configure 'chdir
13825 (lambda _
13826 (chdir "janino")
13827 #t)))))
13828 (inputs
13829 (list java-commons-compiler))
13830 (native-inputs
13831 (list java-junit java-hamcrest-core))
13832 (description "Janino is a Java compiler. Janino can compile a set of
13833source files to a set of class files like @code{javac}, but also compile a
13834Java expression, block, class body or source file in memory, load the bytecode
13835and execute it directly in the same JVM. @code{janino} can also be used for
13836static code analysis or code manipulation.")))
13837
13838(define-public java-logback-core
13839 (package
13840 (name "java-logback-core")
13841 (version "1.2.3")
13842 (source (origin
13843 (method git-fetch)
13844 (uri (git-reference
13845 (url "https://github.com/qos-ch/logback/")
13846 (commit (string-append "v_" version))))
13847 (file-name (git-file-name name version))
13848 (sha256
13849 (base32
13850 "055jbfpg3l5qw7pw2snkdag0gjkb4vcxfg9110cqqyc40k2nd17z"))
13851 (modules '((guix build utils)))
13852 (snippet
13853 '(delete-file-recursively "logback-access/lib"))))
13854 (build-system ant-build-system)
13855 (arguments
13856 `(#:jar-name "logback.jar"
13857 #:source-dir "src/main/java"
13858 #:test-dir "src/test"
13859 #:test-exclude
13860 ;; These tests fail with Unable to set MockitoNamingPolicy on cglib generator
13861 ;; which creates FastClasses
13862 (list "**/AllCoreTest.*"
13863 "**/AutoFlushingObjectWriterTest.*"
13864 "**/PackageTest.*"
13865 "**/ResilientOutputStreamTest.*"
13866 ;; And we still don't want to run abstract classes
13867 "**/Abstract*.*")
13868 #:phases
13869 (modify-phases %standard-phases
13870 (add-before 'configure 'chdir
13871 (lambda _ (chdir "logback-core"))))))
13872 (inputs
13873 (list java-javax-mail
13874 java-javaee-servletapi
13875 java-commons-compiler
13876 java-janino))
13877 (native-inputs
13878 (list java-junit
13879 java-hamcrest-core
13880 java-mockito-1
13881 java-cglib
13882 java-objenesis
13883 java-joda-time))
13884 (home-page "https://logback.qos.ch")
13885 (synopsis "Logging for java")
13886 (description "Logback is intended as a successor to the popular log4j project.
13887This module lays the groundwork for the other two modules.")
13888 ;; Either epl1.0 or lgpl2.1
13889 (license (list license:epl1.0
13890 license:lgpl2.1))))
13891
13892(define-public java-logback-classic
13893 (package
13894 (inherit java-logback-core)
13895 (name "java-logback-classic")
13896 (arguments
13897 `(#:jar-name "logback-classic.jar"
13898 #:source-dir "src/main/java"
13899 #:test-dir "src/test"
13900 #:tests? #f; tests require more packages: h2, greenmail, hsql, subethamail, slf4j, log4j, felix
13901 #:jdk ,icedtea-8
13902 #:phases
13903 (modify-phases %standard-phases
13904 (add-before 'configure 'chdir
13905 (lambda _
13906 (chdir "logback-classic")
13907 #t))
13908 (replace 'build
13909 (lambda* (#:key inputs #:allow-other-keys)
13910 (mkdir-p "build/classes")
13911 (setenv "CLASSPATH"
13912 (string-join
13913 (apply append (map (lambda (input)
13914 (find-files (assoc-ref inputs input)
13915 ".*.jar"))
13916 '("java-logback-core" "java-slf4j-api"
13917 "java-commons-compiler" "java-javaee-servletapi"
13918 "groovy")))
13919 ":"))
13920 (apply invoke "groovyc" "-d" "build/classes" "-j"
13921 (find-files "src/main/" ".*\\.(groovy|java)$"))
13922 (invoke "ant" "jar")
13923 #t)))))
13924 (inputs
13925 (modify-inputs (package-inputs java-logback-core)
13926 (prepend java-logback-core java-slf4j-api)))
13927 (native-inputs
13928 (list groovy))
13929 (description "Logback is intended as a successor to the popular log4j project.
13930This module can be assimilated to a significantly improved version of log4j.
13931Moreover, @code{logback-classic} natively implements the slf4j API so that you
13932can readily switch back and forth between logback and other logging frameworks
13933such as log4j or @code{java.util.logging} (JUL).")))
13934
13935(define-public java-jgit
13936 (package
13937 (name "java-jgit")
13938 (version "4.7.0.201704051617-r")
13939 (source (origin
13940 (method url-fetch)
13941 (uri (string-append "https://repo1.maven.org/maven2/"
13942 "org/eclipse/jgit/org.eclipse.jgit/"
13943 version "/org.eclipse.jgit-"
13944 version "-sources.jar"))
13945 (sha256
13946 (base32
13947 "13ii4jn02ynzq6i7gsyi21k2i94jpc85wf6bcm31q4cyvzv0mk4k"))))
13948 (build-system ant-build-system)
13949 (arguments
13950 `(#:tests? #f ; There are no tests to run.
13951 #:jar-name "jgit.jar"
13952 ;; JGit must be built with a JDK supporting Java 8.
13953 #:jdk ,icedtea-8
13954 ;; Target our older default JDK.
13955 #:make-flags (list "-Dtarget=1.7")
13956 #:phases
13957 (modify-phases %standard-phases
13958 ;; The jar file generated by the default build.xml does not include
13959 ;; the text properties files, so we need to add them.
13960 (add-after 'build 'add-properties
13961 (lambda* (#:key jar-name #:allow-other-keys)
13962 (with-directory-excursion "src"
13963 (apply invoke "jar" "-uf"
13964 (string-append "../build/jar/" jar-name)
13965 (find-files "." "\\.properties$")))
13966 #t)))))
13967 (inputs
13968 (list java-classpathx-servletapi java-javaewah java-jsch
13969 java-slf4j-api))
13970 (home-page "https://eclipse.org/jgit/")
13971 (synopsis "Java library implementing the Git version control system")
13972 (description "JGit is a lightweight, pure Java library implementing the
13973Git version control system, providing repository access routines, support for
13974network protocols, and core version control algorithms.")
13975 (license license:edl1.0)))
13976
13977;; For axoloti.
13978(define-public java-jgit-4.2
13979 (package (inherit java-jgit)
13980 (version "4.2.0.201601211800-r")
13981 (source (origin
13982 (method url-fetch)
13983 (uri (string-append "https://repo1.maven.org/maven2/"
13984 "org/eclipse/jgit/org.eclipse.jgit/"
13985 version "/org.eclipse.jgit-"
13986 version "-sources.jar"))
13987 (sha256
13988 (base32
13989 "15gm537iivhnzlkjym4x3wn5jqdjdragsw9pdpzqqg21nrc817mm"))))
13990 (build-system ant-build-system)
13991 (arguments
13992 (substitute-keyword-arguments (package-arguments java-jgit)
13993 ((#:phases phases)
13994 `(modify-phases ,phases
13995 (add-after 'unpack 'use-latest-javaewah-API
13996 (lambda _
13997 (substitute* "src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java"
13998 (("wordinbits") "WORD_IN_BITS"))))))))
13999 (inputs
14000 (list java-javaewah java-jsch java-slf4j-api))))
14001
14002(define-public abcl
14003 (package
14004 (name "abcl")
14005 (version "1.9.3")
14006 (source
14007 (origin
14008 (method url-fetch)
14009 (uri (string-append "https://abcl.org/releases/"
14010 version "/abcl-src-" version ".tar.gz"))
14011 (sha256
14012 (base32
14013 "1zxjpwv98bq2yd5qg08sbkajj17m7b8xmzqhw296161s7lia215v"))
14014 (patches
14015 (search-patches
14016 "abcl-fix-build-xml.patch"))))
14017 (build-system ant-build-system)
14018 (native-inputs
14019 (list java-junit))
14020 (arguments
14021 `(#:build-target "abcl.jar"
14022 #:test-target "abcl.test"
14023 #:phases
14024 (modify-phases %standard-phases
14025 (replace 'install
14026 (lambda* (#:key outputs #:allow-other-keys)
14027 (let ((share (string-append (assoc-ref outputs "out")
14028 "/share/java/"))
14029 (bin (string-append (assoc-ref outputs "out")
14030 "/bin/")))
14031 (mkdir-p share)
14032 (install-file "dist/abcl.jar" share)
14033 (install-file "dist/abcl-contrib.jar" share)
14034 (mkdir-p bin)
14035 (with-output-to-file (string-append bin "abcl")
14036 (lambda _
14037 (let ((classpath (string-append
14038 share "abcl.jar"
14039 ":"
14040 share "abcl-contrib.jar")))
14041 (display (string-append
14042 "#!" (which "bash") "\n"
14043 "if [[ -z $CLASSPATH ]]; then\n"
14044 " cp=\"" classpath "\"\n"
14045 "else\n"
14046 " cp=\"" classpath ":$CLASSPATH\"\n"
14047 "fi\n"
14048 "exec " (which "java")
14049 " -cp \"$cp\" org.armedbear.lisp.Main \"$@\"\n")))))
14050 (chmod (string-append bin "abcl") #o755)
14051 #t))))))
14052 (home-page "https://abcl.org/")
14053 (synopsis "Common Lisp Implementation on the JVM")
14054 (description
14055 "@dfn{Armed Bear Common Lisp} (ABCL) is a full implementation of the Common
14056Lisp language featuring both an interpreter and a compiler, running in the
14057JVM. It supports JSR-223 (Java scripting API): it can be a scripting engine
14058in any Java application. Additionally, it can be used to implement (parts of)
14059the application using Java to Lisp integration APIs.")
14060 (native-search-paths
14061 (list (search-path-specification
14062 (variable "XDG_DATA_DIRS")
14063 (files '("share")))))
14064 (license (list license:gpl2+
14065 ;; named-readtables is released under 3 clause BSD
14066 license:bsd-3
14067 ;; jfli is released under CPL 1.0
14068 license:cpl1.0))))
14069
14070(define-public java-jsonp-api
14071 (package
14072 (name "java-jsonp-api")
14073 (version "1.1.6")
14074 (source (origin
14075 (method git-fetch)
14076 (uri (git-reference
14077 (url "https://github.com/eclipse-ee4j/jsonp")
14078 (commit (string-append "1.1-" version "-RELEASE"))))
14079 (file-name (git-file-name name version))
14080 (sha256
14081 (base32
14082 "0zrj03hkr3jdmqlb4ipjr37cqpp2q2814qpmxi7srlwpdqs0ibgc"))))
14083 (build-system ant-build-system)
14084 (arguments
14085 `(#:jar-name "jsonp-api.jar"
14086 #:tests? #f
14087 #:source-dir "api/src/main/java"
14088 #:test-dir "api/src/test"))
14089 (home-page "https://eclipse-ee4j.github.io/jsonp/")
14090 (synopsis "JSON Processing in Java")
14091 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
14092parse, generate, transform and query) JSON messages. It produces and
14093consumes JSON text in a streaming fashion (similar to StAX API for XML)
14094and allows building a Java object model for JSON text using API classes
14095(similar to DOM API for XML).")
14096 ;; either gpl2 only with classpath exception, or epl2.0.
14097 (license (list license:gpl2
14098 license:epl2.0))))
14099
14100(define-public java-jsonp-impl
14101 (package
14102 (inherit java-jsonp-api)
14103 (name "java-jsonp-impl")
14104 (arguments
14105 `(#:jar-name "jsonp-impl.jar"
14106 #:tests? #f
14107 #:source-dir "impl/src/main/java"
14108 #:test-dir "impl/src/test"
14109 #:phases
14110 (modify-phases %standard-phases
14111 (add-before 'build 'copy-resources
14112 (lambda _
14113 (copy-recursively
14114 "impl/src/main/resources/"
14115 "build/classes")
14116 #t)))))
14117 (propagated-inputs
14118 (list java-jsonp-api))
14119 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
14120parse, generate, transform and query) JSON messages. This package contains
14121a reference implementation of that API.")))
14122
14123(define-public java-jakarta-json
14124 (package
14125 (name "java-jakarta-json")
14126 (version "2.1.3")
14127 (source (origin
14128 (method git-fetch)
14129 (uri (git-reference
14130 (url "https://github.com/jakartaee/jsonp-api")
14131 (commit (string-append version "-RELEASE"))))
14132 (file-name (git-file-name name version))
14133 (sha256
14134 (base32
14135 "1q600harqfhlf763l75j4fx7ai7ybp7ga06aiky2a2hg8mhz0s5f"))))
14136 (build-system ant-build-system)
14137 (arguments
14138 `(#:jar-name "jakarta-json.jar"
14139 #:source-dir "api/src/main/java"
14140 #:tests? #f; no tests
14141 #:jdk ,openjdk11))
14142 (home-page "https://github.com/jakartaee/jsonp-api")
14143 (synopsis "Portable API for JSON handling in Java")
14144 (description "This project contains API and Compatible Implementation of
14145Jakarta JSON Processing specification. Jakarta JSON Processing provides
14146portable APIs to parse, generate, transform, and query JSON documents.")
14147 ;; with classpath exception
14148 (license license:epl2.0)))
14149
14150(define-public java-parsson
14151 (package
14152 (name "java-parsson")
14153 (version "1.1.5")
14154 (source (origin
14155 (method git-fetch)
14156 (uri (git-reference
14157 (url "https://github.com/eclipse-ee4j/parsson")
14158 (commit version)))
14159 (file-name (git-file-name name version))
14160 (sha256
14161 (base32
14162 "06vvr6qv1ihnk212gdxg4x0sd61lgxk7wf062s7gym5k2h7fms0p"))))
14163 (build-system ant-build-system)
14164 (arguments
14165 `(#:jar-name "parsson.jar"
14166 #:source-dir "impl/src/main/java"
14167 #:test-dir "impl/src/test"
14168 #:use-java-modules? #t
14169 #:jdk ,openjdk11
14170 #:phases
14171 (modify-phases %standard-phases
14172 (add-after 'unpack 'copy-resources
14173 (lambda _
14174 (copy-recursively "impl/src/main/resources"
14175 "build/classes"))))))
14176 (inputs
14177 (list java-jakarta-json))
14178 (native-inputs
14179 (list java-junit))
14180 (home-page "https://github.com/eclipse-ee4j/parsson")
14181 (synopsis "Implementation of Jakarta JSON API")
14182 (description "Eclipse Parsson is an implementation of the Jakarta JSON
14183Processing specification.")
14184 ;; with classpath exception
14185 (license license:epl2.0)))
14186
14187(define-public java-jakarta-activation-api
14188 (package
14189 (name "java-jakarta-activation-api")
14190 (version "2.1.4")
14191 (source (origin
14192 (method git-fetch)
14193 (uri (git-reference
14194 (url "https://github.com/jakartaee/jaf-api")
14195 (commit version)))
14196 (file-name (git-file-name name version))
14197 (sha256
14198 (base32
14199 "125bf475cb0mdyhn1lj3c8gbwngbd28x10vnknq86zrc1vq4m6gx"))))
14200 (build-system ant-build-system)
14201 (arguments
14202 `(#:jar-name "jakarta-activation-api.jar"
14203 #:source-dir "api/src/main/java"
14204 #:tests? #f ;; has no tests
14205 #:jdk ,openjdk11))
14206 (home-page "https://github.com/jakartaee/jaf-api")
14207 (synopsis "Collection of Java activation")
14208 (description "Jakarta Activation lets you take advantage of standard
14209services to: determine the type of arbitrary piece of data; encapsulate access
14210to it; discover the operations available on it; and instantiate the
14211appropriate bean to perform the operation(s).")
14212 (license license:bsd-3)))
14213
14214(define-public java-jakarta-annotations-api
14215 (package
14216 (name "java-jakarta-annotations-api")
14217 (version "2.1.1")
14218 (source (origin
14219 (method git-fetch)
14220 (uri (git-reference
14221 (url "https://github.com/jakartaee/common-annotations-api")
14222 (commit version)))
14223 (file-name (git-file-name name version))
14224 (sha256
14225 (base32
14226 "0xq2n2pijal5p75vl9dz10i6hhdmaxw5q8j3aza717xkpxxby9p6"))))
14227 (build-system ant-build-system)
14228 (arguments
14229 `(#:jar-name "jakarta-annotations-api.jar"
14230 #:source-dir "api/src/main/java"
14231 #:tests? #f; no tests
14232 #:jdk ,openjdk11))
14233 (home-page "https://github.com/jakartaee/common-annotations-api")
14234 (synopsis "Collection of Java annotations")
14235 (description "Jakarta Annotations defines a collection of annotations
14236representing common semantic concepts that enable a declarative style of
14237programming that applies across a variety of Java technologies.")
14238 ;; with classpath exception
14239 (license (list license:epl2.0
14240 license:gpl2))))
14241
14242(define-public java-xmp
14243 (package
14244 (name "java-xmp")
14245 (version "5.1.3")
14246 (source (origin
14247 (method url-fetch)
14248 (uri (string-append "http://download.macromedia.com/pub/developer"
14249 "/xmp/sdk/XMPCoreJava-" version ".zip"))
14250 (sha256
14251 (base32
14252 "14nai2mmsg7l5ya2y5mx4w4lr1az3sk2fjz6hiy4zdrsavgvl1g7"))))
14253 (build-system ant-build-system)
14254 (arguments
14255 `(#:build-target "build"
14256 #:tests? #f; no tests
14257 #:phases
14258 (modify-phases %standard-phases
14259 (add-after 'unpack 'chdir
14260 (lambda _
14261 (chdir "XMPCore")
14262 #t))
14263 (add-before 'build 'fix-timestamp
14264 (lambda _
14265 (substitute* "build.xml"
14266 (("\\$\\{BuildDate\\}") "1970 Jan 01 00:00:00-GMT"))
14267 #t))
14268 (replace 'install
14269 (install-jars "."))
14270 (add-after 'install 'install-doc
14271 (lambda* (#:key outputs #:allow-other-keys)
14272 (copy-recursively
14273 "docs"
14274 (string-append (assoc-ref outputs "out") "/share/doc/java-xmp"))
14275 #t)))))
14276 (native-inputs
14277 (list unzip))
14278 (home-page "https://www.adobe.com/devnet/xmp.html")
14279 (synopsis "Extensible Metadat Platform (XMP) support in Java")
14280 (description "Adobe's Extensible Metadata Platform (XMP) is a labeling
14281technology that allows you to embed data about a file, known as metadata,
14282into the file itself. The XMP Toolkit for Java is based on the C++ XMPCore
14283library and the API is similar.")
14284 (license license:bsd-3)))
14285
14286(define-public java-args4j
14287 (package
14288 (name "java-args4j")
14289 (version "2.33")
14290 (source (origin
14291 (method git-fetch)
14292 (uri (git-reference
14293 (url "https://github.com/kohsuke/args4j")
14294 (commit (string-append "args4j-site-" version))))
14295 (file-name (git-file-name name version))
14296 (sha256
14297 (base32
14298 "0w061fg65qrsm1a0lz0vyprsyidj31krjb459qi2lw0y78xza26s"))))
14299 (build-system ant-build-system)
14300 (arguments
14301 `(#:jar-name "args4j.jar"
14302 #:source-dir "args4j/src"
14303 #:test-dir "args4j/test"
14304 #:test-exclude
14305 (list "**/ExampleTest.*"
14306 "**/ExternalConfiguredTest.*" ; fails to find a file
14307 ;; We still don't want to run abstract classes
14308 "**/Abstract*.*")
14309 #:phases
14310 (modify-phases %standard-phases
14311 (add-before 'check 'fix-test-dir
14312 (lambda _
14313 (substitute* "build.xml"
14314 (("/java\">") "\">"))
14315 #t))
14316 (add-before 'build 'copy-resources
14317 (lambda _
14318 (let ((from-prefix "args4j/src/org/kohsuke/args4j/")
14319 (to-prefix "build/classes/org/kohsuke/args4j/"))
14320 (for-each (lambda (f)
14321 (install-file
14322 (string-append from-prefix f)
14323 (string-append to-prefix (dirname f))))
14324 (list "Messages.properties"
14325 "Messages_de.properties"
14326 "Messages_en.properties"
14327 "Messages_ru.properties"
14328 "spi/Messages.properties"
14329 "spi/Messages_de.properties"
14330 "spi/Messages_en.properties"
14331 "spi/Messages_ru.properties")))
14332 #t)))))
14333 (native-inputs
14334 (list java-junit))
14335 (home-page "https://args4j.kohsuke.org/")
14336 (synopsis "Command line parser library")
14337 (description "Args4j is a small Java class library that makes it easy to
14338parse command line options/arguments in your CUI application.")
14339 (license license:expat)))
14340
14341(define-public java-argparse4j
14342 (package
14343 (name "java-argparse4j")
14344 (version "0.9.0")
14345 (source (origin
14346 (method git-fetch)
14347 (uri (git-reference
14348 (url "https://github.com/argparse4j/argparse4j")
14349 (commit (string-append "argparse4j-" version))))
14350 (file-name (git-file-name name version))
14351 (sha256
14352 (base32
14353 "1i0j3zs1ln48n0g8a90vqbv6528mcswhzys6252yp0c8w1ai64fb"))))
14354 (build-system ant-build-system)
14355 (arguments
14356 (list #:jar-name "java-argparse4j.jar"
14357 #:source-dir "main/src/main/"
14358 #:test-dir "main/src/test/"
14359 #:jdk openjdk11
14360 #:phases #~(modify-phases %standard-phases
14361 (add-after 'unpack 'copy-resources
14362 (lambda _
14363 (copy-recursively "main/src/test/resources"
14364 "target/test-classes")
14365 (copy-recursively "main/src/main/resources"
14366 "build/classes")))
14367 (replace 'install
14368 (install-from-pom "pom.xml")))))
14369 (inputs (list java-junit))
14370 (home-page "https://argparse4j.github.io/")
14371 (synopsis "Java command-line argument parser library")
14372 (description "Argparse4j is a command line argument parser library for
14373Java based on Python's @code{argparse} module.")
14374 (license license:expat)))
14375
14376(define-public java-metadata-extractor
14377 (package
14378 (name "java-metadata-extractor")
14379 (version "2.19.0")
14380 (source (origin
14381 (method git-fetch)
14382 (uri (git-reference
14383 (url "https://github.com/drewnoakes/metadata-extractor")
14384 (commit version)))
14385 (file-name (git-file-name name version))
14386 (sha256
14387 (base32
14388 "1axnw47n06a116g8bml2l6rxx92grxp935gspyhz4pz868m7hrna"))))
14389 (build-system ant-build-system)
14390 (arguments
14391 `(#:jar-name "metadata-extractor.jar"
14392 #:source-dir "Source"
14393 #:test-dir "Tests"
14394 #:phases
14395 (modify-phases %standard-phases
14396 (add-before 'build 'fix-xmp-path
14397 (lambda _
14398 ;; This version of metadata-extractor depends on java-xmp 6, which
14399 ;; is non-free. These changes allow using java-xmp 5, which is
14400 ;; the last free-software version of java-xmp.
14401 (substitute* (find-files "." ".*.java")
14402 (("com.adobe.internal.xmp") "com.adobe.xmp"))
14403 (substitute* "Source/com/drew/metadata/xmp/XmpReader.java"
14404 (("\\.setXMPNodesToLimit.*") ";"))
14405 ;; Test failure, most likely because we use a different java-xmp
14406 ;; version.
14407 (delete-file "Tests/com/drew/metadata/xmp/XmpReaderTest.java")))
14408 (add-before 'check 'fix-test-dir
14409 (lambda _
14410 (substitute* "build.xml"
14411 (("/java\">") "\">"))
14412 #t)))))
14413 (propagated-inputs
14414 (list java-xmp))
14415 (native-inputs
14416 (list java-hamcrest-core java-junit))
14417 (home-page "https://github.com/drewnoakes/metadata-extractor")
14418 (synopsis "Extract metadata from image and video files")
14419 (description "Metadata-extractor is a straightforward Java library for
14420reading metadata from image files. It is able to read metadata in Exif,
14421IPTC, XMP, ICC and more formats.")
14422 (license license:asl2.0)))
14423
14424(define-public java-svg-salamander
14425 (package
14426 (name "java-svg-salamander")
14427 (version "1.1.2")
14428 (source (origin
14429 (method git-fetch)
14430 (uri (git-reference
14431 (url "https://github.com/blackears/svgSalamander")
14432 (commit (string-append "v" version))))
14433 (file-name (git-file-name name version))
14434 (sha256
14435 (base32
14436 "1zv3kjdkf6iqf02x6ln76254y634j2ji448y706a65lsbfjmmicf"))
14437 (modules '((guix build utils)))
14438 (snippet
14439 '(begin
14440 (for-each delete-file (find-files "." ".*.jar"))
14441 #t))
14442 (patches
14443 (search-patches "java-svg-salamander-Fix-non-det.patch"))))
14444 (build-system ant-build-system)
14445 (arguments
14446 `(#:tests? #f; no tests
14447 #:phases
14448 (modify-phases %standard-phases
14449 (add-after 'unpack 'chdir
14450 (lambda _
14451 (chdir "svg-core")
14452 #t))
14453 (add-before 'build 'copy-jars
14454 (lambda* (#:key inputs #:allow-other-keys)
14455 (copy-file (car (find-files (assoc-ref inputs "javacc") "\\.jar$"))
14456 "../libraries/javacc.jar")
14457 (copy-file (car (find-files (assoc-ref inputs "ant") "ant\\.jar$"))
14458 "../libraries/ant.jar")
14459 #t))
14460 (replace 'install
14461 (install-jars "dist")))))
14462 (native-inputs
14463 (list javacc))
14464 (home-page "https://github.com/blackears/svgSalamander")
14465 (synopsis "SVG engine for Java")
14466 (description "SVG Salamander is an SVG engine for Java that's designed
14467to be small, fast, and allow programmers to use it with a minimum of fuss.
14468It's in particular targeted for making it easy to integrate SVG into Java
14469games and making it much easier for artists to design 2D game content - from
14470rich interactive menus to charts and graphcs to complex animations.")
14471 (license license:bsd-2)))
14472
14473(define-public java-jboss-transaction-api-spec
14474 (package
14475 (name "java-jboss-transaction-api-spec")
14476 (version "1.2+1.1.1")
14477 (source (origin
14478 (method git-fetch)
14479 (uri (git-reference
14480 (url "https://github.com/jboss/jboss-transaction-api_spec")
14481 (commit "jboss-transaction-api_1.2_spec-1.1.1.Final")))
14482 (file-name (git-file-name name version))
14483 (sha256
14484 (base32
14485 "1xbfq5hvb86izflydxrqqv3k26c1ba2m0ap6m97shqrsdi9by4wy"))))
14486 (build-system ant-build-system)
14487 (arguments
14488 `(#:jar-name "java-jboss-transaction-api_spec.jar"
14489 #:source-dir "src/main/java"
14490 #:tests? #f)); no tests
14491 (inputs
14492 (list java-cdi-api java-jboss-interceptors-api-spec))
14493 (home-page "https://github.com/jboss/jboss-transaction-api_spec")
14494 (synopsis "Generic transaction management API in Java")
14495 (description "Java-jboss-transaction-api-spec implements the Transactions
14496API. A transaction is a unit of work containing one or more operations
14497involving one or more shared resources having ACID (Atomicity, Consistency,
14498Isolation and Durability) properties.")
14499 ;; either gpl2 only with classpath exception or cddl.
14500 (license (list license:gpl2 license:cddl1.0))))
14501
14502(define-public java-picocli
14503 (package
14504 (name "java-picocli")
14505 (version "4.3.2")
14506 (source (origin
14507 (method git-fetch)
14508 (uri (git-reference
14509 (url "https://github.com/remkop/picocli")
14510 (commit (string-append "v" version))))
14511 (file-name (git-file-name name version))
14512 (sha256
14513 (base32
14514 "1sxp6rxjfgjd98ly14b3d15dvxkm5wg4g46w12jyhmr0kmkaca3c"))))
14515 (build-system ant-build-system)
14516 (arguments
14517 `(#:jar-name "picocli.jar"
14518 #:source-dir "src/main/java"
14519 ;; Tests require missing dependencies (junitparams, system-rules)
14520 #:tests? #f))
14521 (home-page "https://picocli.info")
14522 (synopsis "REPL for the JVM")
14523 (description "Picocli is a framework for building command line applications
14524for the JVM. It supports colors, autocompletion, subcommands, and more. Written
14525in Java, usable from Groovy, Kotlin, Scala, etc.")
14526 (license license:asl2.0)))
14527
14528(define-public java-pj
14529 (package
14530 (name "java-pj")
14531 (version "20150107")
14532 (source (origin
14533 (method url-fetch)
14534 (uri (string-append "https://www.cs.rit.edu/~ark/pjsrc"
14535 version ".jar"))
14536 (sha256
14537 (base32
14538 "078xwaivl2qqjc07r0vk6kzpqlcb1bcar80p8r5qigh34hpr86d3"))
14539 (modules '((guix build utils)))
14540 (snippet
14541 '(for-each delete-file
14542 (find-files "." "\\.class$")))))
14543 (build-system ant-build-system)
14544 (arguments
14545 (list
14546 #:tests? #false ;there are none
14547 #:phases
14548 #~(modify-phases %standard-phases
14549 (add-after 'unpack 'chdir
14550 (lambda _ (chdir "src/pj")))
14551 (add-after 'chdir 'patch-source-directory
14552 (lambda _
14553 (substitute* "compile"
14554 (("SRCDIR1=/home/ark/public_html/pj/lib")
14555 (string-append "SRCDIR1=" (getcwd) "/lib")))))
14556 (replace 'build
14557 (lambda _
14558 (invoke "bash" "./compile" "linux")
14559 (with-directory-excursion "lib"
14560 (apply invoke "jar" "cf" (string-append "pj" #$version ".jar")
14561 (find-files "." "\\.class$")))))
14562 (replace 'install (install-jars ".")))))
14563 (home-page "https://www.cs.rit.edu/~ark/pj.shtml")
14564 (synopsis "Parallel programming in Java")
14565 (description "Parallel Java (PJ) is an API and middleware for parallel
14566programming in 100% Java on shared memory multiprocessor (SMP) parallel
14567computers, cluster parallel computers, and hybrid SMP cluster parallel
14568computers.")
14569 (license license:gpl3+)))
14570
14571(define-public java-jetbrains-annotations
14572 (package
14573 (name "java-jetbrains-annotations")
14574 (version "19.0.0")
14575 (source (origin
14576 (method git-fetch)
14577 (uri (git-reference
14578 (url "https://github.com/JetBrains/java-annotations")
14579 (commit version)))
14580 (file-name (git-file-name name version))
14581 (sha256
14582 (base32
14583 "0z6i1xs60cd5ffz23c49sq68wn5mphhs3xpar1n93ppama2ng80v"))))
14584 (build-system ant-build-system)
14585 (arguments
14586 `(#:jar-name "jetbrains-annotations.jar"
14587 #:source-dir "common/src/main/java:java8/src/main/java"
14588 #:tests? #f)); no tests
14589 (home-page "https://github.com/JetBrains/java-annotations")
14590 (synopsis "Annotations for Java and other JVM languages")
14591 (description "This package contains a set of Java annotations which can be
14592used in JVM-based languages. They serve as an additional documentation and
14593can be interpreted by IDEs and static analysis tools to improve code analysis.")
14594 (license license:expat)))
14595
14596(define-public java-javaparser
14597 (package
14598 (name "java-javaparser")
14599 (version "3.16.1")
14600 (source (origin
14601 (method git-fetch)
14602 (uri (git-reference
14603 (url "https://github.com/javaparser/javaparser")
14604 (commit (string-append "javaparser-parent-" version))))
14605 (file-name (git-file-name name version))
14606 (sha256
14607 (base32
14608 "1a4jk12ffa31fa0y8vda0739vpfj1206p0nha842b7bixbvwamv9"))
14609 (modules '((guix build utils)))
14610 (snippet
14611 '(begin
14612 (for-each delete-file
14613 (find-files "." "\\.jar$"))
14614 #t))))
14615 (build-system ant-build-system)
14616 (arguments
14617 `(#:tests? #f; tests require jbehave and junit5
14618 #:phases
14619 (modify-phases %standard-phases
14620 (add-before 'build 'fill-template
14621 (lambda _
14622 (with-directory-excursion "javaparser-core/src/main"
14623 (copy-file "java-templates/com/github/javaparser/JavaParserBuild.java"
14624 "java/com/github/javaparser/JavaParserBuild.java")
14625 (substitute* "java/com/github/javaparser/JavaParserBuild.java"
14626 (("\\$\\{project.version\\}") ,version)
14627 (("\\$\\{project.name\\}") "javaparser")
14628 (("\\$\\{project.build.finalName\\}") "javaparser")
14629 (("\\$\\{maven.version\\}") "fake")
14630 (("\\$\\{maven.build.version\\}") "fake")
14631 (("\\$\\{build.timestamp\\}") "0")
14632 (("\\$\\{java.vendor\\}") "Guix")
14633 (("\\$\\{java.vendor.url\\}") "https://gnu.org/software/guix")
14634 (("\\$\\{java.version\\}") "1.8")
14635 (("\\$\\{os.arch\\}") "any")
14636 (("\\$\\{os.name\\}") "Guix")
14637 (("\\$\\{os.version\\}") "not available")))
14638 #t))
14639 (add-before 'build 'generate-javacc
14640 (lambda _
14641 (with-directory-excursion "javaparser-core/src/main/java"
14642 (invoke "java" "javacc" "../javacc/java.jj"))
14643 #t))
14644 (add-before 'build 'copy-javacc-support
14645 (lambda _
14646 (with-directory-excursion "javaparser-core/src/main"
14647 (copy-recursively "javacc-support" "java"))
14648 #t))
14649 (replace 'build
14650 (lambda _
14651 (define (build name)
14652 (format #t "Building ~a~%" name)
14653 (delete-file-recursively "build/classes")
14654 (mkdir-p "build/classes")
14655 (apply invoke "javac"
14656 "-cp" (string-append (getenv "CLASSPATH") ":"
14657 (string-join (find-files "build/jar" ".")
14658 ":"))
14659 "-d" "build/classes"
14660 (find-files (string-append name "/src/main/java")
14661 ".*.java"))
14662 (invoke "jar" "-cf" (string-append "build/jar/" name ".jar")
14663 "-C" "build/classes" "."))
14664 (mkdir-p "build/classes")
14665 (mkdir-p "build/test-classes")
14666 (mkdir-p "build/jar")
14667 (build "javaparser-core")
14668 (build "javaparser-core-serialization")
14669 (build "javaparser-core-generators")
14670 (build "javaparser-core-metamodel-generator")
14671 (build "javaparser-symbol-solver-core")
14672 #t))
14673 (replace 'install
14674 (install-jars "build/jar")))))
14675 (inputs
14676 (list java-guava java-jboss-javassist java-jsonp-api))
14677 (native-inputs
14678 (list javacc))
14679 (home-page "https://javaparser.org/")
14680 (synopsis "Parser for Java")
14681 (description
14682 "This project contains a set of libraries implementing a Java 1.0 - Java
1468311 Parser with advanced analysis functionalities.")
14684 (license (list
14685 ;; either lgpl or asl
14686 license:lgpl3+
14687 license:asl2.0))))
14688
14689(define-public tla2tools
14690 ;; This package was originally based on the "v1.8.0" tag, but that merely
14691 ;; points to the moving master branch. That might be because the ‘latest
14692 ;; release’ at GitHub is currently 1.7.1. We'll see! For now, rather than
14693 ;; downgrade to 1.7.1 proper, use the commit that we originally dubbed 1.8.0.
14694 (let* ((release "1.7.1")
14695 (revision "0")
14696 (commit "6932e19083fc6df42473464857fc1280cb5aaecc"))
14697 (package
14698 (name "tla2tools")
14699 (version (git-version release revision commit))
14700 (source (origin
14701 (method git-fetch)
14702 (uri (git-reference
14703 (url "https://github.com/tlaplus/tlaplus")
14704 (commit commit)))
14705 (file-name (git-file-name name version))
14706 (sha256
14707 (base32
14708 "1hhx8gmn81k8qrkx4p7ppinmygxga9fqffd626wkvhjgg2ky8lhs"))
14709 (patches
14710 (search-patches "tla2tools-build-xml.patch"))
14711 (modules '((guix build utils)))
14712 (snippet
14713 '(begin
14714 ;; Remove packaged libraries (see 'replace-libs below)
14715 (for-each delete-file (find-files "." ".*.jar$"))))))
14716 (build-system ant-build-system)
14717 (arguments
14718 (let* ((tlatools "tlatools/org.lamport.tlatools/")
14719 (build-xml (string-append tlatools "customBuild.xml")))
14720 `(#:jdk ,openjdk11
14721 #:modules ((guix build ant-build-system)
14722 (guix build utils)
14723 (ice-9 match)
14724 (srfi srfi-26))
14725 #:make-flags '("-f" ,build-xml)
14726 #:phases
14727 (modify-phases %standard-phases
14728 ;; Replace packed libs with references to jars in store
14729 (add-after 'unpack 'replace-libs
14730 (lambda* (#:key inputs #:allow-other-keys)
14731 (define (input-jar input)
14732 (car (find-files (assoc-ref inputs input) "\\.jar$")))
14733 (for-each
14734 (match-lambda
14735 ((file . input)
14736 (symlink (input-jar input)
14737 (string-append ,tlatools "/lib/" file))))
14738 '(("gson/gson-2.8.6.jar" . "java-gson")
14739 ("javax.mail/mailapi-1.6.3.jar" . "java-javax-mail")
14740 ("jline/jline-terminal-3.14.1.jar" . "java-jline-terminal")
14741 ("jline/jline-reader-3.14.1.jar" . "java-jline-reader")
14742 ("lsp/org.eclipse.lsp4j.debug-0.10.0.jar" .
14743 "java-eclipse-lsp4j-debug")
14744 ("lsp/org.eclipse.lsp4j.jsonrpc-0.10.0.jar" .
14745 "java-eclipse-lsp4j-jsonrpc")
14746 ("lsp/org.eclipse.lsp4j.jsonrpc.debug-0.10.0.jar" .
14747 "java-eclipse-lsp4j-jsonrpc-debug")
14748 ("junit-4.12.jar" . "java-junit")
14749 ("easymock-3.3.1.jar" . "java-easymock")))
14750 ;; Retain a tiny subset of the original X-Git-*
14751 ;; manifest values just to aid in debugging.
14752 (substitute* ,build-xml
14753 (("\\$\\{git.tag\\}") (string-append "v" ,release)))))
14754 (add-before 'check 'prepare-tests
14755 (lambda _
14756 ;; The pcal tests write to .cfg files.
14757 (for-each (cut chmod <> #o644)
14758 (find-files (string-append ,tlatools
14759 "/test-model/pcal")
14760 "\\.cfg$"))))
14761 (replace 'install
14762 (lambda* (#:key inputs outputs #:allow-other-keys)
14763 (let* ((share (string-append (assoc-ref outputs "out") "/share/java"))
14764 (jar-name "tla2tools.jar"); set in project.properties
14765 (jar (string-append ,tlatools
14766 "/dist/" jar-name))
14767 (java-cp (string-append share "/" jar-name))
14768 (bin (string-append (assoc-ref outputs "out") "/bin"))
14769 (java (search-input-file inputs "/bin/java")))
14770 (install-file jar share)
14771 (mkdir-p bin)
14772 ;; Generate wrapper scripts for bin/, which invoke common
14773 ;; commands within tla2tools.jar. Users can still invoke
14774 ;; tla2tools.jar for the rest.
14775 (for-each
14776 (match-lambda
14777 ((wrapper . class)
14778 (let ((file (string-append bin "/" wrapper)))
14779 (begin
14780 (with-output-to-file file
14781 (lambda _
14782 (display
14783 (string-append
14784 "#!/bin/sh\n"
14785 java " -XX:+UseParallelGC " " -cp " java-cp " " class " \"$@\""))))
14786 (chmod file #o755)))))
14787 ;; bin/wrapper . java-class
14788 '(("pcal" . "pcal.trans")
14789 ("tlatex" . "tla2tex.TLA")
14790 ("tla2sany" . "tla2sany.SANY")
14791 ("tlc2" . "tlc2.TLC")
14792 ("tlc2-repl" . "tlc2.REPL"))))))))))
14793 (native-inputs
14794 (list java-junit java-easymock))
14795 (inputs
14796 (list java-javax-mail
14797 java-gson-2.8.6
14798 java-jline-terminal
14799 java-jline-reader
14800 java-eclipse-lsp4j-jsonrpc
14801 java-eclipse-lsp4j-jsonrpc-debug
14802 java-eclipse-lsp4j-debug))
14803 (home-page "https://lamport.azurewebsites.net/tla/tools.html")
14804 (synopsis "TLA+ tools (analyzer, TLC, TLATeX, PlusCal translator)")
14805 (description "TLA+ is a high-level language for modeling programs and
14806systems---especially concurrent and distributed ones. It's based on the idea
14807that the best way to describe things precisely is with simple
14808mathematics. TLA+ and its tools are useful for eliminating fundamental design
14809errors, which are hard to find and expensive to correct in code.
14810
14811The following TLA+ tools are available in this distribution:
14812
14813@itemize
14814@item The Syntactic Analyzer: A parser and syntax checker for
14815 TLA+ specifications;
14816@item TLC: A model checker and simulator for a subclass of \"executable\" TLA+
14817 specifications;
14818@item TLATeX: A program for typesetting TLA+ specifications;
14819@item Beta test versions of 1-3 for the TLA+2 language; and
14820@item The PlusCal translator.
14821@end itemize")
14822 (license license:expat))))
14823
14824;;;
14825;;; Avoid adding new packages to the end of this file. To reduce the chances
14826;;; of a merge conflict, place them above by existing packages with similar
14827;;; functionality or similar names.
14828;;;