projects/guix·blob java-team · refs

17161 lines · 714.8 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-2026 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 (gnu packages attr)
46 #:use-module (gnu packages autotools)
47 #:use-module (gnu packages base)
48 #:use-module (gnu packages bash)
49 #:use-module (gnu packages check)
50 #:use-module (gnu packages compression)
51 #:use-module (gnu packages cpio)
52 #:use-module (gnu packages cups)
53 #:use-module (gnu packages elf)
54 #:use-module (gnu packages fontutils)
55 #:use-module (gnu packages freedesktop) ; wayland
56 #:use-module (gnu packages gawk)
57 #:use-module (gnu packages gcc)
58 #:use-module (gnu packages gettext)
59 #:use-module (gnu packages ghostscript) ;lcms
60 #:use-module (gnu packages gl)
61 #:use-module (gnu packages gnome)
62 #:use-module (gnu packages groovy)
63 #:use-module (gnu packages gtk)
64 #:use-module (gnu packages guile)
65 #:use-module (gnu packages icu4c)
66 #:use-module (gnu packages image)
67 #:use-module (gnu packages java-bootstrap)
68 #:use-module (gnu packages java-compression)
69 #:use-module (gnu packages java-xml)
70 #:use-module (gnu packages kerberos)
71 #:use-module (gnu packages libffi)
72 #:use-module (gnu packages linux) ;alsa
73 #:use-module (gnu packages maths)
74 #:use-module (gnu packages maven)
75 #:use-module (gnu packages maven-parent-pom)
76 #:use-module (gnu packages ncurses)
77 #:use-module (gnu packages nss)
78 #:use-module (gnu packages nss)
79 #:use-module (gnu packages onc-rpc)
80 #:use-module (gnu packages perl)
81 #:use-module (gnu packages pkg-config)
82 #:use-module (gnu packages popt)
83 #:use-module (gnu packages python-build)
84 #:use-module (gnu packages security-token)
85 #:use-module (gnu packages texinfo)
86 #:use-module (gnu packages web)
87 #:use-module (gnu packages wget)
88 #:use-module (gnu packages xdisorg)
89 #:use-module (gnu packages xml)
90 #:use-module (gnu packages xorg)
91 #:use-module (gnu packages)
92 #:use-module ((guix build utils) #:select (alist-replace))
93 #:use-module (guix build-system ant)
94 #:use-module (guix build-system cmake)
95 #:use-module (guix build-system gnu)
96 #:use-module (guix build-system maven)
97 #:use-module (guix build-system pyproject)
98 #:use-module (guix deprecation)
99 #:use-module (guix download)
100 #:use-module (guix gexp)
101 #:use-module (guix git-download)
102 #:use-module (guix hg-download)
103 #:use-module ((guix licenses) #:prefix license:)
104 #:use-module (guix packages)
105 #:use-module (guix svn-download)
106 #:use-module (guix utils)
107 #:use-module (ice-9 match)
108 #:use-module ((srfi srfi-1) #:select (first fold alist-delete))
109 #:use-module (srfi srfi-11))
110
111(define* (system->icedtea-arch #:optional (system (or (%current-target-system)
112 (%current-system))))
113 "Return the Icedtea architecture string, such as \"ppc64le\", of SYSTEM."
114 ;; See INSTALL_ARCH_DIR in the configure script of icedtea.
115 (match system
116 ("i686-linux" "i386")
117 ("x86_64-linux" "amd64")
118 ("armhf-linux" "arm")
119 ("powerpc-linux" "ppc")
120 ("powerpc64le-linux" "ppc64le")
121 (system
122 ;; Turn e.g. "aarch64-linux" into "aarch64".
123 (first (string-split system #\-)))))
124
125(define-public icedtea-7
126 (let* ((version "2.6.13")
127 (drop (lambda* (name hash #:optional (patches '()))
128 (origin
129 (method url-fetch)
130 (uri (string-append
131 "http://icedtea.classpath.org/download/drops"
132 "/icedtea7/" version "/" name ".tar.bz2"))
133 (sha256 (base32 hash))
134 (patches patches)))))
135 (package
136 (name "icedtea")
137 (version version)
138 (source (origin
139 (method url-fetch)
140 (uri (string-append
141 "http://icedtea.wildebeest.org/download/source/icedtea-"
142 version ".tar.xz"))
143 (sha256
144 (base32
145 "1w331rdqx1dcx2xb0fmjmrkdc71xqn20fxsgw8by4xhiblh88khh"))
146 (modules '((guix build utils)))
147 (snippet
148 '(substitute* "Makefile.in"
149 ;; do not leak information about the build host
150 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
151 "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
152 (build-system gnu-build-system)
153 (outputs '("out" ; Java Runtime Environment
154 "jdk" ; Java Development Kit
155 "doc")) ; all documentation
156 (arguments
157 (list
158 ;; There are many test failures. Some are known to fail upstream,
159 ;; others relate to not having an X server running at test time, yet
160 ;; others are a complete mystery to me.
161
162 ;; hotspot: passed: 241; failed: 45; error: 2
163 ;; langtools: passed: 1,934; failed: 26
164 ;; jdk: unknown
165 #:tests? #f
166 ;; The validate-runpath phase fails on internal libraries depending on
167 ;; libraries found under e.g. 'lib/amd64' on x86_64, and the build
168 ;; system blissfully ignores LDFLAGS; disable it.
169 #:validate-runpath? #f
170 #:modules '((guix build utils)
171 (guix build gnu-build-system)
172 (ice-9 match)
173 (ice-9 popen)
174 (srfi srfi-19)
175 (srfi srfi-26))
176 #:configure-flags
177 ;; TODO: package sctp and add to inputs
178 #~(list "--disable-system-sctp"
179 "--enable-system-pcsc"
180 "--enable-system-lcms"
181 "--enable-bootstrap"
182 "--enable-nss"
183 "--without-rhino"
184 (string-append "--with-parallel-jobs="
185 (number->string (parallel-job-count)))
186 "--disable-downloading"
187 "--disable-tests" ;they are run in the check phase instead
188 "--with-openjdk-src-dir=./openjdk.src"
189 (string-append
190 "--with-ecj=" (search-input-file %build-inputs "bin/javac"))
191 (string-append "--with-jdk-home="
192 #$(this-package-native-input "classpath"))
193 (string-append "--with-java="
194 (search-input-file %build-inputs "bin/jamvm"))
195 (string-append "--with-jar="
196 (search-input-file %build-inputs "/bin/gjar")))
197 #:phases
198 #~(modify-phases %standard-phases
199 (replace 'unpack
200 (lambda* (#:key source inputs #:allow-other-keys)
201 (let ((target (string-append "icedtea-"
202 #$(package-version this-package)))
203 (unpack (lambda* (name #:optional dir)
204 (let ((dir (or dir
205 (string-drop-right name 5))))
206 (mkdir dir)
207 (invoke "tar" "xvf"
208 (assoc-ref inputs name)
209 "-C" dir
210 "--strip-components=1")))))
211 (mkdir target)
212 (invoke "tar" "xvf" source
213 "-C" target "--strip-components=1")
214 (chdir target)
215 (unpack "openjdk-src" "openjdk.src")
216 (with-directory-excursion "openjdk.src"
217 (for-each unpack
218 (filter (cut string-suffix? "-drop" <>)
219 (map (match-lambda
220 ((name . _) name))
221 inputs)))))))
222 (add-after 'unpack 'use-classpath
223 (lambda* (#:key inputs #:allow-other-keys)
224 (let ((tools (search-input-file inputs
225 "share/classpath/tools.zip"))
226 (rt.jar (search-input-file inputs "lib/rt.jar")))
227 ;; GNU Classpath does not provide rt.jar, but jamvm provides
228 ;; Classpath's glibj.zip as rt.jar, so we just use that.
229 (substitute* "Makefile.in"
230 (("\\$\\(SYSTEM_JDK_DIR\\)/jre/lib/rt.jar") rt.jar))
231 ;; Make sure we can find all classes.
232 (setenv "CLASSPATH"
233 (string-append rt.jar ":" tools))
234 (setenv "JAVACFLAGS"
235 (string-append "-cp " rt.jar ":" tools)))))
236 (add-after 'unpack 'patch-bitrot
237 (lambda _
238 (substitute*
239 '("patches/boot/revert-6973616.patch"
240 "openjdk.src/jdk/make/common/shared/Defs-versions.gmk")
241 (("REQUIRED_FREETYPE_VERSION = 2.2.1")
242 "REQUIRED_FREETYPE_VERSION = 2.10.1"))
243 ;; As of attr 2.4.48 this header is no longer
244 ;; included. It is provided by the libc instead.
245 (substitute* '("configure"
246 "openjdk.src/jdk/src/solaris/native/sun/\
247nio/fs/LinuxNativeDispatcher.c")
248 (("attr/xattr.h") "sys/xattr.h"))))
249 (add-after 'unpack 'fix-openjdk
250 (lambda _
251 (with-directory-excursion "openjdk.src"
252 (substitute* "jdk/make/common/Defs-linux.gmk"
253 (("CFLAGS_COMMON = -fno-strict-aliasing" all)
254 (string-append all
255 " -fcommon"
256 " -Wno-error=implicit-function-declaration"
257 " -Wno-error=implicit-int"
258 " -Wno-error=incompatible-pointer-types"
259 " -Wno-error=int-conversion")))
260 (substitute*
261 '("jdk/src/solaris/native/java/net/PlainSocketImpl.c"
262 "jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c")
263 (("#include <sys/sysctl.h>")
264 "#include <linux/sysctl.h>"))
265
266 ;; XXX 'ldd' in glibc 2.35 segfaults upon reading
267 ;; openjdk.build-boot/lib/amd64/libnio.so (!).
268 ;; It is only used as a verification step, so ignore it; try
269 ;; removing this substitution for newer versions of glibc.
270 (substitute* "jdk/make/common/shared/Defs-linux.gmk"
271 (("\\$\\(LDD\\) \\$1 &&")
272 ""))
273
274 ;; It looks like the "h = 31 * h + c" line of the jsum()
275 ;; function gets miscompiled. After a few iterations of the
276 ;; loop the result of "31 * h" is always 0x8000000000000000.
277 ;; Disable optimizations of dump.cpp as a workaround.
278 (substitute* "hotspot/make/linux/makefiles/gcc.make"
279 (("OPT_CFLAGS/NOOPT.*" all)
280 (string-append all "\n"
281 "OPT_CFLAGS/dump.o += -O0"))))))
282 (add-after 'unpack 'fix-x11-extension-include-path
283 (lambda* (#:key inputs #:allow-other-keys)
284 (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
285 (((string-append "\\$\\(firstword \\$\\(wildcard "
286 "\\$\\(OPENWIN_HOME\\)"
287 "/include/X11/extensions\\).*$"))
288 (string-append #$(this-package-input "libxrender")
289 "/include/X11/extensions"
290 " -I" #$(this-package-input "libxtst")
291 "/include/X11/extensions"
292 " -I" #$(this-package-input "libxinerama")
293 "/include/X11/extensions"))
294 (("\\$\\(wildcard /usr/include/X11/extensions\\)\\)") ""))))
295 (add-after 'unpack 'patch-paths
296 (lambda* (#:key native-inputs inputs #:allow-other-keys)
297 ;; buildtree.make generates shell scripts, so we need to replace
298 ;; the generated shebang.
299 (with-directory-excursion "openjdk.src"
300 (substitute* "hotspot/make/linux/makefiles/buildtree.make"
301 (("/bin/sh") (which "bash")))
302
303 (let ((corebin (dirname (search-input-file
304 (or native-inputs inputs)
305 "bin/cp")))) ;coreutils
306 (substitute* '("jdk/make/common/shared/Defs-linux.gmk"
307 "corba/make/common/shared/Defs-linux.gmk")
308 (("UNIXCOMMAND_PATH = /bin")
309 (string-append "UNIXCOMMAND_PATH = " corebin))
310 (("USRBIN_PATH = /usr/bin")
311 (string-append "USRBIN_PATH = " corebin))
312 (("DEVTOOLS_PATH *= */usr/bin")
313 (string-append "DEVTOOLS_PATH = " corebin))
314 (("COMPILER_PATH *= */usr/bin")
315 (string-append "COMPILER_PATH = "
316 (dirname (search-input-file
317 (or native-inputs inputs)
318 "bin/gcc"))))
319 (("DEF_OBJCOPY *=.*objcopy")
320 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
321
322 ;; Fix path to alsa header.
323 (substitute* "jdk/make/common/shared/Sanity.gmk"
324 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
325 (string-append "ALSA_INCLUDE="
326 (search-input-file
327 inputs "include/alsa/version.h"))))
328
329 ;; Fix hard-coded utility paths.
330 (substitute* '("jdk/make/common/shared/Defs-utils.gmk"
331 "corba/make/common/shared/Defs-utils.gmk")
332 (("ECHO *=.*echo")
333 (string-append "ECHO = " (which "echo")))
334 (("^GREP *=.*grep")
335 (string-append "GREP = " (which "grep")))
336 (("EGREP *=.*egrep")
337 (string-append "EGREP = " (which "egrep")))
338 (("CPIO *=.*cpio")
339 (string-append "CPIO = " (which "cpio")))
340 (("READELF *=.*readelf")
341 (string-append "READELF = " (which "readelf")))
342 (("^ *AR *=.*ar")
343 (string-append "AR = " (which "ar")))
344 (("^ *TAR *=.*tar")
345 (string-append "TAR = " (which "tar")))
346 (("AS *=.*as")
347 (string-append "AS = " (which "as")))
348 (("LD *=.*ld")
349 (string-append "LD = " (which "ld")))
350 (("STRIP *=.*strip")
351 (string-append "STRIP = " (which "strip")))
352 (("NM *=.*nm")
353 (string-append "NM = " (which "nm")))
354 (("^SH *=.*sh")
355 (string-append "SH = " (which "bash")))
356 (("^FIND *=.*find")
357 (string-append "FIND = " (which "find")))
358 (("LDD *=.*ldd")
359 (string-append "LDD = " (which "ldd")))
360 (("NAWK *=.*(n|g)awk")
361 (string-append "NAWK = " (which "gawk")))
362 (("XARGS *=.*xargs")
363 (string-append "XARGS = " (which "xargs")))
364 (("UNZIP *=.*unzip")
365 (string-append "UNZIP = " (which "unzip")))
366 (("ZIPEXE *=.*zip")
367 (string-append "ZIPEXE = " (which "zip")))
368 (("SED *=.*sed")
369 (string-append "SED = " (which "sed"))))
370
371 ;; Some of these timestamps cause problems as they are more than
372 ;; 10 years ago, failing the build process.
373 (substitute* "jdk/src/share/classes/java/util/\
374CurrencyData.properties"
375 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
376 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
377 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
378 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY"))))))
379 (add-before 'configure 'set-additional-paths
380 (lambda* (#:key inputs #:allow-other-keys)
381 (setenv "CC" "gcc")
382 (setenv "CPATH"
383 (string-append #$(this-package-input "libxcomposite")
384 "/include/X11/extensions" ":"
385 #$(this-package-input "libxrender")
386 "/include/X11/extensions" ":"
387 #$(this-package-input "libxtst")
388 "/include/X11/extensions" ":"
389 #$(this-package-input "libxinerama")
390 "/include/X11/extensions" ":"
391 (or (getenv "CPATH") "")))
392 (setenv "ALT_OBJCOPY" (which "objcopy"))
393 (setenv "ALT_CUPS_HEADERS_PATH"
394 (string-append #$(this-package-input "cups")
395 "/include"))
396 (setenv "ALT_FREETYPE_HEADERS_PATH"
397 (string-append #$(this-package-input "freetype")
398 "/include"))
399 (setenv "ALT_FREETYPE_LIB_PATH"
400 (string-append #$(this-package-input "freetype")
401 "/lib"))))
402 (add-before 'build 'reduce-optimizations
403 (lambda _
404 ;; Needed for gcc-14
405 (setenv "EXTRA_CFLAGS" "-O1")))
406 (add-before 'build 'disable-os-version-check
407 ;; allow build on linux major version change
408 (lambda _
409 (setenv "DISABLE_HOTSPOT_OS_VERSION_CHECK" "ok")))
410 (add-before 'check 'fix-test-framework
411 (lambda _
412 ;; Fix PATH in test environment
413 (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
414 (("PATH=/bin:/usr/bin")
415 (string-append "PATH=" (getenv "PATH"))))
416 (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
417 (("/usr/bin/env") (which "env")))
418 (substitute* "openjdk.src/hotspot/test/test_env.sh"
419 (("/bin/rm") (which "rm"))
420 (("/bin/cp") (which "cp"))
421 (("/bin/mv") (which "mv")))))
422 (add-before 'check 'fix-hotspot-tests
423 (lambda _
424 (with-directory-excursion "openjdk.src/hotspot/test/"
425 (substitute* "jprt.config"
426 (("PATH=\"\\$\\{path4sdk\\}\"")
427 (string-append "PATH=" (getenv "PATH")))
428 (("make=/usr/bin/make")
429 (string-append "make=" (which "make"))))
430 (substitute* '("runtime/6626217/Test6626217.sh"
431 "runtime/7110720/Test7110720.sh")
432 (("/bin/rm") (which "rm"))
433 (("/bin/cp") (which "cp"))
434 (("/bin/mv") (which "mv"))))))
435 (add-before 'check 'fix-jdk-tests
436 (lambda _
437 (with-directory-excursion "openjdk.src/jdk/test/"
438 (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
439 (("/bin/pwd") (which "pwd")))
440 (substitute* "com/sun/jdi/ShellScaffold.sh"
441 (("/bin/kill") (which "kill")))
442 (substitute* "start-Xvfb.sh"
443 ;;(("/usr/bin/X11/Xvfb") (which "Xvfb"))
444 (("/usr/bin/nohup") (which "nohup")))
445 (substitute* "javax/security/auth/Subject/doAs/Test.sh"
446 (("/bin/rm") (which "rm")))
447 (substitute* "tools/launcher/MultipleJRE.sh"
448 (("echo \"#!/bin/sh\"")
449 (string-append "echo \"#!" (which "rm") "\""))
450 (("/usr/bin/zip") (which "zip")))
451 (substitute* "com/sun/jdi/OnThrowTest.java"
452 (("#!/bin/sh") (string-append "#!" (which "sh"))))
453 (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
454 (("/usr/bin/uptime") (which "uptime")))
455 (substitute* "java/lang/ProcessBuilder/Basic.java"
456 (("/usr/bin/env") (which "env"))
457 (("/bin/false") (which "false"))
458 (("/bin/true") (which "true"))
459 (("/bin/cp") (which "cp"))
460 (("/bin/sh") (which "sh")))
461 (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
462 (("/bin/sh") (which "sh")))
463 (substitute* "java/lang/ProcessBuilder/Zombies.java"
464 (("/usr/bin/perl") (which "perl"))
465 (("/bin/ps") (which "ps"))
466 (("/bin/true") (which "true")))
467 (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
468 (("/usr/bin/tee") (which "tee")))
469 (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
470 (("/bin/true") (which "true")))
471 (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
472 (("/bin/cat") (which "cat")))
473 (substitute* "java/lang/Runtime/exec/ExitValue.java"
474 (("/bin/sh") (which "sh"))
475 (("/bin/true") (which "true"))
476 (("/bin/kill") (which "kill")))
477 (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
478 (("/usr/bin/echo") (which "echo")))
479 (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
480 (("/usr/bin/cat") (which "cat")))
481 (substitute* "java/lang/Runtime/exec/SleepyCat.java"
482 (("/bin/cat") (which "cat"))
483 (("/bin/sleep") (which "sleep"))
484 (("/bin/sh") (which "sh")))
485 (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
486 (("/bin/cat") (which "cat")))
487 (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
488 (("/bin/chmod") (which "chmod")))
489 (substitute* "java/util/zip/ZipFile/Assortment.java"
490 (("/bin/sh") (which "sh"))))))
491 (replace 'check
492 (lambda* (#:key tests? #:allow-other-keys)
493 ;; The "make check-*" targets always return zero, so we need to
494 ;; check for errors in the associated log files to determine
495 ;; whether any tests have failed.
496 (when tests?
497 (use-modules (ice-9 rdelim))
498 (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
499 (checker (lambda (port)
500 (let loop ()
501 (let ((line (read-line port)))
502 (cond
503 ((eof-object? line) #t)
504 ((regexp-exec error-pattern line)
505 (error "test failed"))
506 (else (loop)))))))
507 (run-test (lambda (test)
508 (invoke "make" test)
509 (call-with-input-file
510 (string-append "test/" test ".log")
511 checker))))
512 (run-test "check-hotspot")
513 (run-test "check-langtools")
514 (run-test "check-jdk")))))
515 (replace 'install
516 (lambda _
517 (copy-recursively "openjdk.build/docs"
518 (string-append #$output:doc
519 "/share/doc/icedtea"))
520 (copy-recursively "openjdk.build/j2re-image" #$output)
521 (copy-recursively "openjdk.build/j2sdk-image" #$output:jdk)))
522 (add-after 'install 'install-libjvm
523 ;; Some of the libraries in the lib/amd64 folder link to libjvm.so.
524 ;; But that shared object is located in the server/ folder, so it
525 ;; cannot be found. This phase creates a symbolic link in the
526 ;; lib/amd64 folder so that the other libraries can find it.
527 ;;
528 ;; See:
529 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
530 ;;
531 ;; FIXME: Find the bug in the build system, so that this symlink is
532 ;; not needed.
533 (lambda _
534 (let ((lib-path (string-append #$output "/lib/"
535 #$(system->icedtea-arch))))
536 (symlink (string-append lib-path "/server/libjvm.so")
537 (string-append lib-path "/libjvm.so")))))
538 ;; By default IcedTea only generates an empty keystore. In order to
539 ;; be able to use certificates in Java programs we need to generate a
540 ;; keystore from a set of certificates. For convenience we use the
541 ;; certificates from the nss-certs package.
542 (add-after 'install 'install-keystore
543 (lambda* (#:key inputs #:allow-other-keys)
544 (use-modules (ice-9 rdelim))
545 (let* ((keystore "cacerts")
546 (certs-dir (search-input-directory inputs
547 "etc/ssl/certs"))
548 (keytool (string-append #$output:jdk "/bin/keytool")))
549 (define (extract-cert file target)
550 (call-with-input-file file
551 (lambda (in)
552 (call-with-output-file target
553 (lambda (out)
554 (let loop ((line (read-line in 'concat))
555 (copying? #f))
556 (cond
557 ((eof-object? line) #t)
558 ((string-prefix? "-----BEGIN" line)
559 (display line out)
560 (loop (read-line in 'concat) #t))
561 ((string-prefix? "-----END" line)
562 (display line out)
563 #t)
564 (else
565 (when copying? (display line out))
566 (loop (read-line in 'concat) copying?)))))))))
567 (define (import-cert cert)
568 (format #t "Importing certificate ~a\n" (basename cert))
569 (let ((temp "tmpcert"))
570 (extract-cert cert temp)
571 (let ((port (open-pipe* OPEN_WRITE keytool
572 "-import"
573 "-alias" (basename cert)
574 "-keystore" keystore
575 "-storepass" "changeit"
576 "-file" temp)))
577 (display "yes\n" port)
578 (when (not (zero? (status:exit-val (close-pipe port))))
579 (format #t "failed to import ~a\n" cert)))
580 (delete-file temp)))
581
582 ;; This is necessary because the certificate directory contains
583 ;; files with non-ASCII characters in their names.
584 (setlocale LC_ALL "C.UTF-8")
585 (setenv "LC_ALL" "C.UTF-8")
586
587 (for-each import-cert (find-files certs-dir "\\.pem$"))
588 (mkdir-p (string-append #$output "/lib/security"))
589 (mkdir-p (string-append #$output:jdk "/jre/lib/security"))
590
591 ;; The cacerts files we are going to overwrite are chmod'ed as
592 ;; read-only (444) in icedtea-8 (which derives from this
593 ;; package). We have to change this so we can overwrite them.
594 (chmod (string-append #$output "/lib/security/" keystore)
595 #o644)
596 (chmod (string-append #$output:jdk
597 "/jre/lib/security/" keystore) #o644)
598
599 (install-file keystore
600 (string-append #$output "/lib/security"))
601 (install-file keystore
602 (string-append #$output:jdk
603 "/jre/lib/security"))))))))
604 (native-inputs
605 `(("openjdk-src"
606 ,(drop "openjdk"
607 "0l34ikyf62hbzlf9032alzkkqvf7bpmckz4gvirvph755w7gka8l"))
608 ("corba-drop"
609 ,(drop "corba"
610 "050gv2jbg1pi6qkn8w18bwpbklfa5b0kymjvan9pncddbj8m84fz"))
611 ("jaxp-drop"
612 ,(drop "jaxp"
613 "1k6yldwnxfzdg5926r1nlfv8d1r1j7rlp2nkz6gqh05vgyamnfhl"))
614 ("jaxws-drop"
615 ,(drop "jaxws"
616 "110j7jlz47x2gg6f7653x12mssan5kvj9l9h1m1c8c92drfxbqyk"))
617 ("jdk-drop"
618 ,(drop "jdk"
619 "0d1mca38ksxvdskp9im3pp7fdijhj1n3lwq9w13r9s4v3qyskgdd"
620 (search-patches "jdk-currency-time-bomb.patch")))
621 ("langtools-drop"
622 ,(drop "langtools"
623 "0nq5236fzxn3p6x8cgncl56mzcmsj07q9gymysnws4c8byc6n0qj"))
624 ("hotspot-drop"
625 ,(origin
626 (method url-fetch)
627 (uri (string-append
628 "http://icedtea.classpath.org/downloads/drops"
629 "/icedtea7/" version "/hotspot.tar.bz2"))
630 (sha256
631 (base32
632 "17bdv39n4lh8l5737c96f3xgamx4y305m067p01cywgp7zaddqws"))
633 (patches (search-patches
634 "icedtea-7-hotspot-aarch64-use-c++98.patch"
635 "icedtea-7-hotspot-pointer-comparison.patch"))))
636 ("ant" ,ant-bootstrap)
637 ("attr" ,attr)
638 ("classpath" ,classpath-devel)
639 ("coreutils" ,coreutils)
640 ("diffutils" ,diffutils) ;for tests
641 ("ecj4-javac-wrapper" ,ecj4-javac-wrapper)
642 ("fastjar" ,fastjar) ;only for the configure phase; we actually use gjar
643 ("gawk" ,gawk)
644 ("grep" ,grep)
645 ("jamvm" ,jamvm-with-ecj4)
646 ("libtool" ,libtool)
647 ("pkg-config" ,pkg-config)
648 ("wget" ,wget)
649 ("which" ,which)
650 ("cpio" ,cpio)
651 ("zip" ,zip)
652 ("unzip" ,unzip)
653 ("libxslt" ,libxslt) ;for xsltproc
654 ("nss-certs" ,nss-certs)
655 ("perl" ,perl)
656 ("procps" ,procps))) ;for "free", even though I'm not sure we should use it
657 (inputs
658 (list alsa-lib
659 cups
660 fontconfig
661 freetype
662 giflib
663 gtk+-2
664 lcms
665 libjpeg-turbo
666 libpng
667 libx11
668 libxcomposite
669 libxi
670 libxinerama
671 libxrender
672 libxt
673 libxtst
674 mit-krb5
675 nss
676 pcsc-lite
677 zlib))
678 (home-page "https://icedtea.classpath.org")
679 (synopsis "Java development kit")
680 (description
681 "This package provides the Java development kit OpenJDK built with the
682IcedTea build harness.")
683
684 ;; 'configure' lists "mips" and "mipsel", but not "mips64el'.
685 (supported-systems (delete "mips64el-linux" %supported-systems))
686
687 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
688 ;; same license as both GNU Classpath and OpenJDK.
689 (license license:gpl2+))))
690
691(define-public icedtea-8
692 (let* ((version "3.19.0")
693 (drop (lambda* (name hash #:optional (patches '()))
694 (origin
695 (method url-fetch)
696 (uri (string-append
697 "http://icedtea.classpath.org/download/drops"
698 "/icedtea8/" version "/" name ".tar.xz"))
699 (sha256 (base32 hash))
700 (patches patches)))))
701 (package
702 (inherit icedtea-7)
703 (version "3.19.0")
704 (source (origin
705 (method url-fetch)
706 (uri (string-append
707 "http://icedtea.wildebeest.org/download/source/icedtea-"
708 version ".tar.xz"))
709 (sha256
710 (base32
711 "1cmms7cb2sav3ywc36ynqmybzx73sl279rm6j8i5nqrmp98ixmpf"))
712 (modules '((guix build utils)))
713 (snippet
714 '(substitute* '("configure"
715 "acinclude.m4")
716 ;; Do not embed build time
717 (("(DIST_ID=\"Custom build).*$" _ prefix)
718 (string-append prefix "\"\n"))
719 ;; Do not leak information about the build host
720 (("DIST_NAME=\"\\$build_os\"")
721 "DIST_NAME=\"guix\"")))))
722 (arguments
723 (substitute-keyword-arguments (package-arguments icedtea-7)
724 ((#:imported-modules modules %default-gnu-imported-modules)
725 (cons '(guix build ant-build-system) modules))
726 ((#:disallowed-references refs '())
727 (cons (gexp-input
728 (this-package-native-input "jdk")
729 "jdk")
730 refs))
731 ((#:modules modules %default-gnu-modules)
732 (append '(((guix build ant-build-system) #:prefix ant:)
733 (ice-9 match)
734 (ice-9 popen)
735 (srfi srfi-1)
736 (srfi srfi-19)
737 (srfi srfi-26))
738 modules))
739 ((#:configure-flags _ '())
740 #~(let ((jdk (assoc-ref %build-inputs "jdk")))
741 (list (string-append "CFLAGS=-fcommon"
742 " -Wno-error=implicit-function-declaration"
743 " -Wno-error=implicit-int"
744 " -Wno-error=incompatible-pointer-types"
745 " -Wno-error=int-conversion")
746 "CXXFLAGS=-fcommon"
747 "--enable-bootstrap"
748 "--enable-nss"
749 (string-append "--with-parallel-jobs="
750 (number->string (parallel-job-count)))
751 ;; Java Flight Recorder isn't supported on some architectures.
752 #$@(if (target-ppc32?)
753 #~("--enable-jfr=no")
754 #~())
755 "--disable-docs" ; This phase can take hours on slow machines.
756 "--disable-downloading"
757 "--disable-system-pcsc"
758 "--disable-system-sctp"
759 "--disable-tests" ;they are run in the check phase instead
760 "--with-openjdk-src-dir=./openjdk.src"
761 (string-append "--with-jdk-home=" jdk))))
762 ((#:phases phases '%standard-phases)
763 #~(modify-phases #$phases
764 (delete 'fix-x11-extension-include-path)
765 (delete 'patch-paths)
766 (delete 'set-additional-paths)
767 (delete 'patch-patches)
768 (delete 'patch-bitrot)
769 (delete 'use-classpath)
770 (delete 'reduce-optimizations)
771 (replace 'build
772 (lambda* (#:key (make-flags '()) #:allow-other-keys)
773 ;; Prevent passing -j (parallel-job-count) to make, which
774 ;; is rejected by the build Makefiles; this does *not*
775 ;; disable parallel builds.
776 (apply invoke "make" make-flags)))
777 ;; Prevent the keytool from recording the current time when
778 ;; adding certificates at build time.
779 (add-after 'unpack 'patch-keystore
780 (lambda _
781 (substitute* "openjdk.src/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java"
782 (("date = new Date\\(\\);")
783 "\
784date = (System.getenv(\"SOURCE_DATE_EPOCH\") != null) ?\
785new Date(Long.parseLong(System.getenv(\"SOURCE_DATE_EPOCH\"))) :\
786new Date();"))))
787 (add-after 'unpack 'patch-jni-libs
788 ;; Hardcode dynamically loaded libraries.
789 (lambda _
790 (define (icedtea-or-openjdk? path)
791 (or (string-contains path "openjdk")
792 (string-contains path "icedtea")))
793
794 (let* ((library-path (remove icedtea-or-openjdk?
795 (search-path-as-string->list
796 (getenv "LIBRARY_PATH"))))
797 (find-library (lambda (name)
798 (or (search-path
799 library-path
800 (string-append "lib" name ".so"))
801 (string-append "lib" name ".so")))))
802 (for-each
803 (lambda (file)
804 (catch 'decoding-error
805 (lambda ()
806 (substitute* file
807 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
808 _ name version)
809 (string-append "\"" (find-library name) "\""))
810 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
811 (string-append "\"" (find-library name) "\""))))
812 (lambda _
813 ;; Those are safe to skip.
814 (format (current-error-port)
815 "warning: failed to substitute: ~a~%"
816 file))))
817 (find-files "openjdk.src/jdk/src/solaris/native"
818 "\\.c|\\.h")))))
819 (replace 'fix-openjdk
820 (lambda _
821 (substitute*
822 '("openjdk.src/jdk/src/solaris/native/java/net/PlainSocketImpl.c"
823 "openjdk.src/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c")
824 (("#include <sys/sysctl.h>")
825 "#include <linux/sysctl.h>"))))
826 (replace 'install
827 (lambda _
828 (copy-recursively "openjdk.build/docs"
829 (string-append #$output:doc
830 "/share/doc/icedtea"))
831 (copy-recursively "openjdk.build/images/j2re-image" #$output)
832 (copy-recursively "openjdk.build/images/j2sdk-image" #$output:jdk)
833 ;; Install the nss.cfg file to JRE to enable SSL/TLS
834 ;; support via NSS.
835 (copy-file (string-append #$output:jdk
836 "/jre/lib/security/nss.cfg")
837 (string-append #$output "/lib/security/nss.cfg"))))
838 (add-after 'install 'strip-jar-timestamps
839 (assoc-ref ant:%standard-phases 'strip-jar-timestamps))))))
840 (native-inputs
841 `(("jdk" ,icedtea-7 "jdk")
842 ("openjdk-src"
843 ,(drop "openjdk"
844 "1l3bzmd3s38scxpwamfhnwbv7vndgjq6hz3bl58437fgl9kgbl69"))
845 ("aarch32-drop"
846 ,(drop "aarch32"
847 "0k4dwpi3x3lj41rj32xyxbn76r7cb2g2whh44r1z4iwhw1xd2lpq"))
848 ("corba-drop"
849 ,(drop "corba"
850 "0xhh6gf5gh5c6vf1607xcy49wnp5prch2rim13x14wvsn817xf0r"))
851 ("jaxp-drop"
852 ,(drop "jaxp"
853 "043g335rgi5ipl8dp3q2cc3gcfhxk77ipxs43sv344z71bn8xmxr"))
854 ("jaxws-drop"
855 ,(drop "jaxws"
856 "1pc0pv4v2mn2mjc0vp19d94v2150xigyhxsmckqasy647zcm6w0r"))
857 ("jdk-drop"
858 ,(drop "jdk"
859 "1742lcm55l8zhi522x83v65ccr0rd6511q9rj7crw44x3ymdrhrv"
860 (search-patches "jdk-currency-time-bomb2.patch")))
861 ("langtools-drop"
862 ,(drop "langtools"
863 "08iz7p2xcddlphipf6gahyabr5cawlnydap12p1n4f0md069b50b"))
864 ("hotspot-drop"
865 ,(drop "hotspot"
866 "1ffaxfnb3yn1i7crivqigc1r1q0z6cp044i6nfring4z6c8pfhd2"))
867 ("nashorn-drop"
868 ,(drop "nashorn"
869 "15fn7cpm2i1npa88h57njxg0f8qkrqhrc30pb54d3hxlx5zyjl94"))
870 ("shenandoah-drop"
871 ,(drop "shenandoah"
872 "1jjzjjx1ykyhbc4llh8249dlr8j5g1ki6r7g9baj2mxyb9whc5nq"))
873 ,@(fold alist-delete (package-native-inputs icedtea-7)
874 '("openjdk-src" "corba-drop" "jaxp-drop" "jaxws-drop"
875 "jdk-drop" "langtools-drop" "hotspot-drop"
876 "classpath" "ecj4-javac-wrapper" "jamvm" "fastjar")))))))
877
878(define-public icedtea icedtea-8)
879
880(define-public openjdk9
881 (package
882 (name "openjdk")
883 (version "9.181")
884 (source (origin
885 (method hg-fetch)
886 (uri (hg-reference (url "https://hg.openjdk.org/jdk/jdk")
887 (changeset "jdk-9+181")))
888 (file-name (hg-file-name name version))
889 (modules '((guix build utils)))
890 (snippet '(for-each delete-file
891 (find-files "." ".*.(bin|exe|jar)$")))
892 (sha256
893 (base32
894 "1v92nzdqx07c35x945awzir4yk0fk22vky6fpp8mq9js930sxsz0"))
895 (patches
896 (search-patches "openjdk-9-pointer-comparison.patch"
897 "openjdk-9-classlist-reproducibility.patch"
898 "openjdk-currency-time-bomb.patch"
899 "openjdk-9-jar-reproducibility.patch"
900 "openjdk-9-module-reproducibility.patch"
901 "openjdk-9-module2-reproducibility.patch"
902 "openjdk-9-module3-reproducibility.patch"
903 "openjdk-9-idlj-reproducibility.patch"
904 "openjdk-9-setsignalhandler.patch"))))
905 (build-system gnu-build-system)
906 (outputs '("out" "jdk" "doc"))
907 (arguments
908 (list
909 #:imported-modules
910 (cons '(guix build ant-build-system)
911 %default-gnu-imported-modules)
912 #:modules
913 (append '((ice-9 match)
914 (ice-9 popen)
915 (srfi srfi-1)
916 (srfi srfi-26))
917 %default-gnu-modules)
918 #:tests? #f ; require jtreg
919 #:make-flags #~(list "all")
920 #:disallowed-references
921 (list (this-package-native-input "icedtea")
922 (gexp-input (this-package-native-input "icedtea") "jdk"))
923
924 #:phases
925 #~(modify-phases %standard-phases
926 #$@(if (target-aarch64?)
927 #~((add-after 'unpack 'patch-for-aarch64
928 (lambda _
929 (substitute* "hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp"
930 ;; This line is duplicated, so remove both occurrences,
931 ;; then add back one occurrence by substituting a
932 ;; comment that occurs once.
933 (("using MacroAssembler::call_VM_leaf_base;") "")
934 (("Interpreter specific version of call_VM_base")
935 "Interpreter specific version of call_VM_base
936 using MacroAssembler::call_VM_leaf_base;")))))
937 #~())
938 (add-after 'patch-source-shebangs 'fix-java-shebangs
939 (lambda _
940 ;; This file was "fixed" by patch-source-shebangs, but it requires
941 ;; this exact first line.
942 (substitute* "jdk/make/data/blacklistedcertsconverter/blacklisted.certs.pem"
943 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))))
944 (replace 'configure
945 (lambda* (#:key inputs #:allow-other-keys)
946 ;; TODO: unbundle libpng and lcms
947 (invoke "bash" "./configure"
948 ;; Add flags for compilation with gcc >= 10
949 (string-append "--with-extra-cflags=-fcommon"
950 " -fno-delete-null-pointer-checks"
951 " -fno-lifetime-dse"
952 ;; flags for compilation with gcc >= 14.
953 " -Wno-error=int-conversion")
954 (string-append "--with-freetype="
955 (assoc-ref inputs "freetype"))
956 "--disable-freetype-bundling"
957 "--disable-warnings-as-errors"
958 "--disable-hotspot-gtest"
959 "--with-giflib=system"
960 "--with-libjpeg=system"
961 (string-append "--prefix=" #$output))))
962 (add-before 'build 'write-source-revision-file
963 (lambda _
964 (with-output-to-file ".src-rev"
965 (lambda _
966 (display #$(package-version this-package))))))
967 (replace 'build
968 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
969 (apply invoke "make"
970 (format #f "JOBS=~a" (if parallel-build?
971 (parallel-job-count)
972 1))
973 make-flags)))
974 (add-after 'unpack 'patch-jni-libs
975 ;; Hardcode dynamically loaded libraries.
976 (lambda _
977 (define (icedtea-or-openjdk? path)
978 (or (string-contains path "openjdk")
979 (string-contains path "icedtea")))
980
981 (let* ((library-path (remove icedtea-or-openjdk?
982 (search-path-as-string->list
983 (getenv "LIBRARY_PATH"))))
984 (find-library (lambda (name)
985 (or (search-path
986 library-path
987 (string-append "lib" name ".so"))
988 (string-append "lib" name ".so")))))
989 (for-each
990 (lambda (file)
991 (catch 'decoding-error
992 (lambda ()
993 (substitute* file
994 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
995 _ name version)
996 (string-append "\"" (find-library name) "\""))
997 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
998 (string-append "\"" (find-library name) "\""))))
999 (lambda _
1000 ;; Those are safe to skip.
1001 (format (current-error-port)
1002 "warning: failed to substitute: ~a~%"
1003 file))))
1004 (find-files "."
1005 "\\.c$|\\.h$")))))
1006 ;; By default OpenJDK only generates an empty keystore. In order to
1007 ;; be able to use certificates in Java programs we need to generate a
1008 ;; keystore from a set of certificates. For convenience we use the
1009 ;; certificates from the nss-certs package.
1010 (add-after 'install 'install-keystore
1011 (lambda* (#:key inputs #:allow-other-keys)
1012 (use-modules (ice-9 rdelim))
1013 (let* ((keystore "cacerts")
1014 (certs-dir (search-input-directory inputs
1015 "etc/ssl/certs"))
1016 (keytool (string-append #$output:jdk "/bin/keytool")))
1017 (define (extract-cert file target)
1018 (call-with-input-file file
1019 (lambda (in)
1020 (call-with-output-file target
1021 (lambda (out)
1022 (let loop ((line (read-line in 'concat))
1023 (copying? #f))
1024 (cond
1025 ((eof-object? line) #t)
1026 ((string-prefix? "-----BEGIN" line)
1027 (display line out)
1028 (loop (read-line in 'concat) #t))
1029 ((string-prefix? "-----END" line)
1030 (display line out)
1031 #t)
1032 (else
1033 (when copying? (display line out))
1034 (loop (read-line in 'concat) copying?)))))))))
1035 (define (import-cert cert)
1036 (format #t "Importing certificate ~a\n" (basename cert))
1037 (let ((temp "tmpcert"))
1038 (extract-cert cert temp)
1039 (let ((port (open-pipe* OPEN_WRITE keytool
1040 "-import"
1041 "-alias" (basename cert)
1042 "-keystore" keystore
1043 "-storepass" "changeit"
1044 "-file" temp)))
1045 (display "yes\n" port)
1046 (when (not (zero? (status:exit-val (close-pipe port))))
1047 (format #t "failed to import ~a\n" cert)))
1048 (delete-file temp)))
1049
1050 ;; This is necessary because the certificate directory contains
1051 ;; files with non-ASCII characters in their names.
1052 (setlocale LC_ALL "C.UTF-8")
1053 (setenv "LC_ALL" "C.UTF-8")
1054
1055 (copy-file (string-append #$output
1056 "/lib/security/cacerts")
1057 keystore)
1058 (chmod keystore #o644)
1059 (for-each import-cert (find-files certs-dir "\\.pem$"))
1060 (mkdir-p (string-append #$output "/lib/security"))
1061 (mkdir-p (string-append #$output:jdk "/lib/security"))
1062
1063 ;; The cacerts files we are going to overwrite are chmod'ed as
1064 ;; read-only (444) in icedtea-8 (which derives from this
1065 ;; package). We have to change this so we can overwrite them.
1066 (chmod (string-append #$output
1067 "/lib/security/" keystore) #o644)
1068 (chmod (string-append #$output:jdk
1069 "/lib/security/" keystore) #o644)
1070
1071 (install-file keystore
1072 (string-append #$output
1073 "/lib/security"))
1074 (install-file keystore
1075 (string-append #$output:jdk
1076 "/lib/security")))))
1077 ;; Some of the libraries in the lib/ folder link to libjvm.so.
1078 ;; But that shared object is located in the server/ folder, so it
1079 ;; cannot be found. This phase creates a symbolic link in the
1080 ;; lib/ folder so that the other libraries can find it.
1081 ;;
1082 ;; See:
1083 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1084 ;;
1085 ;; FIXME: Find the bug in the build system, so that this symlink is
1086 ;; not needed.
1087 (add-after 'install 'install-libjvm
1088 (lambda* (#:key inputs #:allow-other-keys)
1089 (let* ((lib-out (string-append #$output "/lib"))
1090 (lib-jdk (string-append #$output:jdk "/lib")))
1091 (symlink (string-append lib-jdk "/server/libjvm.so")
1092 (string-append lib-jdk "/libjvm.so"))
1093 (symlink (string-append lib-out "/server/libjvm.so")
1094 (string-append lib-out "/libjvm.so")))))
1095 (replace 'install
1096 (lambda* (#:key outputs #:allow-other-keys)
1097 (let ((images (car (find-files "build" ".*-server-release"
1098 #:directories? #t))))
1099 (copy-recursively (string-append images "/images/jdk")
1100 #$output:jdk)
1101 (copy-recursively (string-append images "/images/jre") #$output)
1102 (copy-recursively (string-append images "/images/docs")
1103 #$output:doc))))
1104 (add-after 'install 'remove-extraneous-files
1105 (lambda* (#:key outputs #:allow-other-keys)
1106 ;; Remove the *.diz and src.zip files for space considerations.
1107 ;; The former are compressed debuginfo files not typically
1108 ;; shipped with Java distributions, while the later corresponds
1109 ;; to Java core API source files.
1110 (for-each delete-file
1111 (append-map (cut find-files <> "(^src\\.zip|\\.diz)$")
1112 (map (match-lambda
1113 ((name . dir)
1114 dir))
1115 outputs)))))
1116 (add-after 'remove-extraneous-files 'strip-zip-timestamps
1117 (lambda* (#:key outputs #:allow-other-keys)
1118 (for-each
1119 (lambda (zip)
1120 (let ((dir (mkdtemp "zip-contents.XXXXXX")))
1121 (with-directory-excursion dir
1122 ;; This is an exact copy of the implementation of invoke,
1123 ;; but this accepts exit code 1 as OK.
1124 (let ((code (system* "unzip" "--" zip)))
1125 ;; jmod files are zip files with an extra header in
1126 ;; front. unzip will warn about that -- but otherwise
1127 ;; work.
1128 (when (> (status:exit-val code) 1) ; 1 is just a warning
1129 (raise
1130 (condition
1131 (&invoke-error
1132 (program "unzip")
1133 (arguments (list "--" zip))
1134 (exit-status (status:exit-val code))
1135 (term-signal (status:term-sig code))
1136 (stop-signal (status:stop-sig code))))))))
1137 (delete-file zip)
1138 (for-each (lambda (file)
1139 (let ((s (lstat file)))
1140 (format #t "reset ~a~%" file)
1141 (utime file 1 1 0 0
1142 AT_SYMLINK_NOFOLLOW)))
1143 (find-files dir #:directories? #t))
1144 (with-directory-excursion dir
1145 (let ((files (cons "./META-INF/MANIFEST.MF"
1146 (append
1147 (find-files "./META-INF" ".*")
1148 ;; for jmod:
1149 (list "./classes/module-info.class")
1150 (find-files "." ".*")))))
1151 (apply invoke "zip" "--symlinks" "-0" "-X" zip files)
1152 (when (string-suffix? ".jmod" zip)
1153 (let ((new-zip (string-append zip "n"))
1154 (contents (call-with-input-file zip
1155 (@ (ice-9 binary-ports)
1156 get-bytevector-all))))
1157 (call-with-output-file new-zip
1158 (lambda (output-port)
1159 ((@ (ice-9 binary-ports) put-bytevector)
1160 output-port
1161 #vu8(#x4a #x4d #x01 #x00)) ; JM
1162 ((@ (ice-9 binary-ports) put-bytevector)
1163 output-port
1164 contents)))
1165 (rename-file new-zip zip)))))))
1166 (append (find-files (string-append #$output:doc "/api")
1167 "\\.zip$")
1168 (find-files #$output:jdk "\\.jmod$")
1169 (list (string-append #$output:jdk
1170 "/lib/jrt-fs.jar"))
1171 (find-files (string-append #$output:jdk "/demo")
1172 "\\.jar$"))))))))
1173 (inputs
1174 (list alsa-lib
1175 cups
1176 fontconfig
1177 freetype
1178 giflib
1179 gtk+
1180 lcms
1181 elfutils
1182 libjpeg-turbo
1183 libice
1184 libpng
1185 libx11
1186 libxcomposite
1187 libxi
1188 libxinerama
1189 libxrender
1190 libxt
1191 libxtst))
1192 (native-inputs
1193 (list icedtea-8
1194 `(,icedtea-8 "jdk")
1195 ;; XXX: The build system fails with newer versions of GNU Make.
1196 gnu-make-4.2
1197 nss-certs
1198 unzip
1199 which
1200 zip))
1201 (home-page "https://openjdk.org/projects/jdk9/")
1202 (synopsis "Java development kit")
1203 (description
1204 "This package provides the Java development kit OpenJDK.")
1205 (license license:gpl2+)))
1206
1207(define-public openjdk10
1208 (package
1209 (inherit openjdk9)
1210 (name "openjdk")
1211 (version "10.46")
1212 (source (origin
1213 (method hg-fetch)
1214 (uri (hg-reference (url "https://hg.openjdk.org/jdk/jdk")
1215 (changeset "jdk-10+46")))
1216 (file-name (hg-file-name name version))
1217 (modules '((guix build utils)))
1218 (snippet `(begin
1219 (for-each delete-file
1220 (find-files "." ".*.(bin|exe|jar)$"))))
1221 (sha256
1222 (base32
1223 "0i47ar8lxzjrkkiwbzybfxs473390h4jq9ahm3xqdvy5zpchxy3y"))
1224 (patches (search-patches
1225 "openjdk-10-char-reproducibility.patch"
1226 "openjdk-10-classlist-reproducibility.patch"
1227 "openjdk-10-corba-reproducibility.patch"
1228 "openjdk-10-idlj-reproducibility.patch"
1229 "openjdk-10-module-reproducibility.patch"
1230 "openjdk-10-module3-reproducibility.patch"
1231 "openjdk-10-module4-reproducibility.patch"
1232 "openjdk-10-jar-reproducibility.patch"
1233 "openjdk-10-jtask-reproducibility.patch"
1234 "openjdk-10-pointer-comparison.patch"
1235 "openjdk-10-setsignalhandler.patch"
1236 "openjdk-currency-time-bomb2.patch"))))
1237 (arguments
1238 (substitute-keyword-arguments (package-arguments openjdk9)
1239 ((#:phases phases '%standard-phases)
1240 #~(modify-phases #$phases
1241 #$@(if (target-aarch64?)
1242 #~((replace 'patch-for-aarch64
1243 (lambda _
1244 (substitute* "src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp"
1245 ;; This line is duplicated, so remove both occurrences,
1246 ;; then add back one occurrence by substituting a
1247 ;; comment that occurs once.
1248 (("using MacroAssembler::call_VM_leaf_base;") "")
1249 (("Interpreter specific version of call_VM_base")
1250 (string-append "Interpreter specific version of call_VM_base\n"
1251 " using MacroAssembler::call_VM_leaf_base;"))))))
1252 #~())
1253 (replace 'fix-java-shebangs
1254 (lambda _
1255 ;; This file was "fixed" by patch-source-shebangs, but it requires
1256 ;; this exact first line.
1257 (substitute* "make/data/blacklistedcertsconverter/blacklisted.certs.pem"
1258 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))))
1259 (add-after 'unpack 'remove-timestamping
1260 (lambda _
1261 (substitute* "./src/hotspot/share/runtime/vm_version.cpp"
1262 (("__DATE__") "")
1263 (("__TIME__") ""))))
1264 (replace 'configure
1265 (lambda* (#:key inputs #:allow-other-keys)
1266 (invoke "bash" "./configure"
1267 ;; Add flags for compilation with gcc >= 10
1268 (string-append "--with-extra-cflags=-fcommon"
1269 " -fno-delete-null-pointer-checks"
1270 " -fno-lifetime-dse"
1271 ;; flags for compilation with gcc >= 14.
1272 " -Wno-error=int-conversion")
1273 (string-append "--with-freetype="
1274 (assoc-ref inputs "freetype"))
1275 "--disable-freetype-bundling"
1276 "--disable-warnings-as-errors"
1277 "--disable-hotspot-gtest"
1278 "--with-giflib=system"
1279 "--with-libjpeg=system"
1280 "--with-native-debug-symbols=zipped"
1281 (string-append "--prefix=" #$output))))
1282 (add-after 'unpack 'disable-warnings-as-errors
1283 (lambda _
1284 ;; It looks like the "--disable-warnings-as-errors" option of
1285 ;; the 'configure' phase is not working.
1286 (substitute* "make/autoconf/generated-configure.sh"
1287 (("-Werror") ""))))
1288 #$@(if (target-x86-32?)
1289 ;; On i686 the C2 compiler sometimes crashes when importing
1290 ;; certificates.
1291 #~((add-before 'install-keystore 'disable-C2-compiler
1292 (lambda _ (setenv "_JAVA_OPTIONS" "-XX:TieredStopAtLevel=1"))))
1293 #~())))
1294 ((#:disallowed-references refs '())
1295 (cons* (this-package-native-input "openjdk")
1296 (gexp-input (this-package-native-input "openjdk") "jdk")
1297 refs))))
1298 (native-inputs
1299 (list gnu-make-4.2
1300 openjdk9
1301 `(,openjdk9 "jdk")
1302 nss-certs
1303 unzip
1304 which
1305 zip))))
1306
1307(define-public openjdk11
1308 (package
1309 (name "openjdk")
1310 (version "11.0.22")
1311 (source (origin
1312 (method url-fetch)
1313 (uri (string-append "https://openjdk-sources.osci.io/openjdk11/openjdk-"
1314 version "-ga.tar.xz"))
1315 (file-name (string-append name "-" version ".tar.xz"))
1316 (sha256
1317 (base32
1318 "18ca4syp9xlrqjgyjkb1sp9835riy6aym5xs81r8byrz6jlb2473"))
1319 (modules '((guix build utils)))
1320 (snippet
1321 '(for-each delete-file (find-files "." "\\.(bin|exe|jar)$")))
1322 (patches
1323 (search-patches "openjdk-10-module3-reproducibility.patch"
1324 "openjdk-10-module4-reproducibility.patch"
1325 "openjdk-10-char-reproducibility.patch"
1326 "openjdk-11-classlist-reproducibility.patch"
1327 "openjdk-10-jar-reproducibility.patch"
1328 "openjdk-10-jtask-reproducibility.patch"
1329 "openjdk-currency-time-bomb2.patch"))))
1330 (build-system gnu-build-system)
1331 (outputs '("out" "jdk" "doc"))
1332 (arguments
1333 (list
1334 ;; Prevent a java.util.ConcurrentModificationException.
1335 #:parallel-build? #f
1336 #:modules `((guix build gnu-build-system)
1337 (guix build utils)
1338 (ice-9 match)
1339 (ice-9 popen)
1340 (srfi srfi-1)
1341 (srfi srfi-26))
1342
1343 #:disallowed-references
1344 (list (this-package-native-input "openjdk")
1345 (gexp-input (this-package-native-input "openjdk")
1346 "jdk"))
1347
1348 #:tests? #f ; requires jtreg
1349 ;; TODO package jtreg
1350 #:configure-flags
1351 #~(list
1352 "--disable-hotspot-gtest" ;not currently running tests
1353 ;; Add flags for compilation with gcc >= 10.
1354 #$(string-append "--with-extra-cflags=-fcommon"
1355 " -fno-delete-null-pointer-checks"
1356 " -fno-lifetime-dse"
1357 ;; flags for compilation with gcc >= 14.
1358 " -Wno-error=int-conversion")
1359 ;; Otherwise, the '--enable-fast-install' causes an error.
1360 "--disable-option-checking"
1361 "--disable-warnings-as-errors"
1362 ;; Make validate-runpath pass (see:
1363 ;; http://issues.guix.info/issue/32894).
1364 "--with-native-debug-symbols=zipped"
1365 ;; Do not use the bundled libraries.
1366 "--with-giflib=system"
1367 "--with-lcms=system"
1368 "--with-libjpeg=system"
1369 "--with-libpng=system"
1370 "--with-version-pre="
1371 ;; Should be set by SOURCE_DATE_EPOCH handler, but isn't being
1372 ;; set; do it manually.
1373 "--with-hotspot-build-time=1970-01-01T00:00:01"
1374 "--enable-reproducible-build" ; to be sure
1375 ;; Allow the build system to locate the system freetype.
1376 (string-append "--with-freetype-include="
1377 #$(this-package-input "freetype") "/include")
1378 (string-append "--with-freetype-lib="
1379 #$(this-package-input "freetype") "/lib"))
1380 #:phases
1381 #~(modify-phases %standard-phases
1382 (add-after 'patch-source-shebangs 'fix-java-shebangs
1383 (lambda _
1384 ;; This file was "fixed" by patch-source-shebangs, but it requires
1385 ;; this exact first line.
1386 (substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
1387 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))
1388 (add-after 'unpack 'remove-timestamping
1389 (lambda _
1390 (substitute* "src/hotspot/share/runtime/abstract_vm_version.cpp"
1391 (("__DATE__") "")
1392 (("__TIME__") ""))))
1393 (add-after 'unpack 'patch-jni-libs
1394 ;; Hardcode dynamically loaded libraries.
1395 (lambda _
1396 (define (icedtea-or-openjdk? path)
1397 (or (string-contains path "openjdk")
1398 (string-contains path "icedtea")))
1399
1400 (let* ((library-path (remove icedtea-or-openjdk?
1401 (search-path-as-string->list
1402 (getenv "LIBRARY_PATH"))))
1403 (find-library (lambda (name)
1404 (or (search-path
1405 library-path
1406 (string-append "lib" name ".so"))
1407 (string-append "lib" name ".so")))))
1408 (for-each
1409 (lambda (file)
1410 (catch 'decoding-error
1411 (lambda ()
1412 (substitute* file
1413 (("VERSIONED_JNI_LIB_NAME\\(\"([^\"]*)\", \"([^\"]*)\"\\)"
1414 _ name version)
1415 (string-append "\"" (find-library name) "\""))
1416 (("JNI_LIB_NAME\\(\"([^\"]*)\"\\)" _ name)
1417 (string-append "\"" (find-library name) "\""))))
1418 (lambda _
1419 ;; Those are safe to skip.
1420 (format (current-error-port)
1421 "warning: failed to substitute: ~a~%"
1422 file))))
1423 (find-files "." "\\.c$|\\.h$")))))
1424 (add-before 'build 'write-source-revision-file
1425 (lambda _
1426 (with-output-to-file ".src-rev"
1427 (lambda _
1428 (display #$(package-version this-package))))))
1429 (replace 'build
1430 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
1431 (apply invoke "make" "all"
1432 (format #f "JOBS=~a" (if parallel-build?
1433 (parallel-job-count)
1434 1))
1435 make-flags)))
1436 ;; jdk 11 does not build jre by default any more; so explicitly build
1437 ;; it (see:
1438 ;; https://github.com/AdoptOpenJDK/openjdk-build/issues/356).
1439 (add-after 'build 'build-jre
1440 (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
1441 (apply invoke "make" "legacy-jre-image"
1442 (format #f "JOBS=~a" (if parallel-build?
1443 (parallel-job-count)
1444 1))
1445 make-flags)))
1446 (replace 'install
1447 (lambda _
1448 (let ((images (car (find-files "build" "-server-release"
1449 #:directories? #t))))
1450 (copy-recursively (string-append images "/images/jdk")
1451 #$output:jdk)
1452 (copy-recursively (string-append images "/images/jre")
1453 #$output)
1454 (copy-recursively (string-append images "/images/docs")
1455 #$output:doc))))
1456 ;; Some of the libraries in the lib/ folder link to libjvm.so.
1457 ;; But that shared object is located in the server/ folder, so it
1458 ;; cannot be found. This phase creates a symbolic link in the
1459 ;; lib/ folder so that the other libraries can find it.
1460 ;;
1461 ;; See:
1462 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1463 ;;
1464 ;; FIXME: Find the bug in the build system, so that this symlink is
1465 ;; not needed.
1466 (add-after 'install 'install-libjvm
1467 (lambda _
1468 (let ((lib-out (string-append #$output "/lib"))
1469 (lib-jdk (string-append #$output:jdk "/lib")))
1470 (symlink (string-append lib-jdk "/server/libjvm.so")
1471 (string-append lib-jdk "/libjvm.so"))
1472 (symlink (string-append lib-out "/server/libjvm.so")
1473 (string-append lib-out "/libjvm.so")))))
1474 (add-after 'install 'remove-extraneous-files
1475 (lambda* (#:key outputs #:allow-other-keys)
1476 ;; Remove the *.diz and src.zip files for space considerations.
1477 ;; The former are compressed debuginfo files not typically
1478 ;; shipped with Java distributions, while the later corresponds
1479 ;; to Java core API source files.
1480 (for-each delete-file
1481 (append-map (cut find-files <> "(^src\\.zip|\\.diz)$")
1482 (map (match-lambda
1483 ((name . dir)
1484 dir))
1485 outputs)))))
1486 (add-after 'remove-extraneous-files 'strip-archive-timestamps
1487 (lambda _
1488 (use-modules (ice-9 binary-ports)
1489 (rnrs bytevectors))
1490 (letrec ((repack-archive
1491 (lambda (archive)
1492 (let ((dir (mkdtemp "zip-contents.XXXXXX")))
1493 (with-directory-excursion dir
1494 (invoke "unzip" archive))
1495 (delete-file archive)
1496 (for-each (compose repack-archive canonicalize-path)
1497 (find-files dir "(ct\\.sym|\\.jar)$"))
1498 (let ((reset-file-timestamp
1499 (lambda (file)
1500 (let ((s (lstat file)))
1501 (unless (eq? (stat:type s) 'symlink)
1502 (format #t "reset ~a~%" file)
1503 (utime file 0 0 0 0))))))
1504 (for-each reset-file-timestamp
1505 (find-files dir #:directories? #t)))
1506 (with-directory-excursion dir
1507 (let ((files (find-files ".")))
1508 (apply invoke "zip" "-0" "-X" archive files)))))))
1509 (for-each repack-archive
1510 (find-files #$output:doc "\\.zip$"))
1511 (for-each repack-archive
1512 (find-files #$output:jdk "\\.(zip|jar)$"))
1513 (repack-archive (string-append #$output:jdk "/lib/ct.sym"))
1514 (let ((repack-jmod
1515 (lambda (file-name)
1516 (call-with-input-file file-name
1517 (lambda (file)
1518 (let ((header #vu8(#x4a #x4d #x01 #x00)))
1519 (if (equal? (get-bytevector-n
1520 file (bytevector-length header))
1521 header)
1522 (let* ((header-length (bytevector-length header))
1523 (temp-file (mkstemp!
1524 (string-copy
1525 "temp-file.XXXXXX")))
1526 (temp-filename (port-filename temp-file))
1527 (content-length
1528 (- (stat:size (stat file))
1529 header-length)))
1530 (sendfile temp-file file content-length header-length)
1531 (delete-file file-name)
1532 (close-port temp-file)
1533 (repack-archive (canonicalize-path temp-filename))
1534 (call-with-output-file file-name
1535 (lambda (file)
1536 (put-bytevector file header)
1537 (call-with-input-file temp-filename
1538 (lambda (temp-file)
1539 (sendfile
1540 file temp-file
1541 (stat:size (stat temp-file)) 0)))))))))))))
1542 (for-each repack-jmod
1543 (find-files #$output:jdk "\\.jmod$"))))))
1544 (add-after 'install 'remove-timestamp-from-api-summary
1545 (lambda _
1546 (substitute* (string-append #$output:doc
1547 "/api/overview-summary.html")
1548 (("Generated by javadoc \\(11-internal\\).*$")
1549 "Generated by javadoc (11-internal) -->\n")))))))
1550 (inputs
1551 (list alsa-lib
1552 cups
1553 fontconfig
1554 freetype
1555 giflib
1556 gtk+
1557 lcms
1558 libjpeg-turbo
1559 libpng
1560 libx11
1561 libxext
1562 libxrandr
1563 libxrender
1564 libxt
1565 libxtst))
1566 (native-inputs
1567 (list autoconf
1568 bash ; not bash-minimal, needs ulimit
1569 openjdk10
1570 `(,openjdk10 "jdk")
1571 gnu-make-4.2
1572 nss-certs
1573 pkg-config
1574 unzip
1575 which
1576 zip))
1577 (home-page "https://openjdk.org/projects/jdk/11/")
1578 (synopsis "Java development kit")
1579 (description
1580 "This package provides the Java development kit OpenJDK.")
1581 (license license:gpl2+)
1582 (properties
1583 ;; At least on a Blackbird powerpc64le machine, the build takes more than
1584 ;; the default 3600s of silent timeout.
1585 `((max-silent-time . ,(* 3600 2))))))
1586
1587(define-syntax make-openjdk
1588 ;; Return an OpenJDK package at VERSION with checksum HASH, using BOOTSTRAP,
1589 ;; the bootstrap package. One or more FIELD can be provided to further
1590 ;; refine the package definition; for convenience, the BASE, NAME and
1591 ;; VERSION are defined in their scope.
1592 (lambda (x)
1593 (syntax-case x ()
1594 ((_ bootstrap version* hash field ...)
1595 (with-syntax ((base (datum->syntax x 'base))
1596 (name (datum->syntax x 'name))
1597 (version (datum->syntax x 'version)))
1598 #'(let ((base (package
1599 (inherit bootstrap)
1600 (name "openjdk")
1601 (version version*)
1602 (source
1603 (origin
1604 (inherit (package-source bootstrap))
1605 (method git-fetch)
1606 (uri (git-reference
1607 (url (format
1608 #f "https://github.com/openjdk/jdk~au"
1609 (version-major version*)))
1610 (commit (string-append "jdk-" version*
1611 "-ga"))))
1612 (file-name (git-file-name name version))
1613 (sha256 (base32 hash))))
1614 (properties
1615 '((release-tag-prefix . "jdk-")
1616 (release-tag-suffix . "-ga")
1617 (release-tag-version-delimiter . ".")))
1618 (native-inputs
1619 (modify-inputs native-inputs
1620 (replace "openjdk" bootstrap)))
1621 (home-page (string-append
1622 "https://openjdk.java.net/projects/jdk/"
1623 (version-major version)))))
1624 (name "openjdk")
1625 (version version*))
1626 (package
1627 (inherit base)
1628 field
1629 ...)))))))
1630
1631(define-public openjdk12
1632 (make-openjdk
1633 openjdk11 "12.33" "0pi2gwib3j2imi4l623iaywrmvfh9rqzh82lj2gxqbrmg55swvjf"
1634 (source
1635 (origin
1636 (method url-fetch)
1637 (uri "http://hg.openjdk.java.net/jdk/jdk/archive/0276cba45aac.tar.bz2")
1638 (file-name (string-append name "-" version ".tar.bz2"))
1639 (sha256
1640 (base32
1641 "0pi2gwib3j2imi4l623iaywrmvfh9rqzh82lj2gxqbrmg55swvjf"))
1642 (modules '((guix build utils)))
1643 (snippet
1644 '(for-each delete-file (find-files "." "\\.(bin|exe|jar)$")))
1645 (patches (search-patches "openjdk-10-setsignalhandler.patch"))))
1646 (arguments
1647 (substitute-keyword-arguments (package-arguments openjdk11)
1648 ;; Re-enable parallel build.
1649 ((#:parallel-build? _ #t) #t)
1650 ((#:phases phases)
1651 #~(modify-phases #$phases
1652 #$@(if (target-aarch64?)
1653 #~((add-after 'unpack 'patch-for-aarch64
1654 (lambda _
1655 (substitute* "src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp"
1656 ;; This line is duplicated, so remove both occurrences,
1657 ;; then add back one occurrence by substituting a
1658 ;; comment that occurs once.
1659 (("using MacroAssembler::call_VM_leaf_base;") "")
1660 (("Interpreter specific version of call_VM_base")
1661 (string-append "Interpreter specific version of call_VM_base\n"
1662 " using MacroAssembler::call_VM_leaf_base;"))))))
1663 #~())
1664 (replace 'remove-timestamping
1665 (lambda _
1666 (substitute* "src/hotspot/share/runtime/vm_version.cpp"
1667 (("__DATE__") "")
1668 (("__TIME__") ""))))
1669 (replace 'fix-java-shebangs
1670 (lambda _
1671 ;; 'blocked' was renamed to 'blacklisted' in this version for
1672 ;; some reason.
1673 (substitute* "make/data/blacklistedcertsconverter/\
1674blacklisted.certs.pem"
1675 (("^#!.*")
1676 "#! java BlacklistedCertsConverter SHA-256\n"))))))))))
1677
1678(define-public openjdk13
1679 (make-openjdk openjdk12 "13.0.14"
1680 "1v92i5rhahqkjw8mz09c9qasnxqc67ygy0y266kdmm534z0da755"
1681 (source (origin
1682 (inherit (package-source base))
1683 (patches (search-patches "openjdk-13-classlist-reproducibility.patch"
1684 "openjdk-10-jtask-reproducibility.patch"))))
1685 (arguments
1686 (substitute-keyword-arguments (package-arguments openjdk12)
1687 ((#:phases phases)
1688 #~(modify-phases #$phases
1689 (replace 'remove-timestamping
1690 (lambda _
1691 (substitute*
1692 "src/hotspot/share/runtime/abstract_vm_version.cpp"
1693 (("__DATE__") "")
1694 (("__TIME__") ""))))))))))
1695
1696(define-public openjdk14
1697 (make-openjdk
1698 openjdk13 "14.0.2"
1699 "07k9bsbxwyf2z2n50z96nvhsdai916mxdxcr5lm44jz7f6xrwfq6"
1700 (source (origin
1701 (inherit (package-source base))
1702 (snippet ;override snippet
1703 '(begin
1704 ;; The m4 macro uses 'help' to search for builtins, which is
1705 ;; not available in bash-minimal
1706 (substitute* "make/autoconf/basics.m4"
1707 (("if help") "if command -v"))
1708 (for-each delete-file (find-files "." "\\.(bin|exe|jar)$"))))
1709 (patches (search-patches "openjdk-10-setsignalhandler.patch"
1710 "openjdk-10-jtask-reproducibility.patch"
1711 "openjdk-13-classlist-reproducibility.patch"))))))
1712
1713(define-public openjdk15
1714 (make-openjdk
1715 openjdk14 "15.0.10"
1716 "0hdllv348bws6m992bh73jik18x0sv0k2m9l817b3zb7q802sp7x"
1717 (source (origin
1718 (inherit (package-source base))
1719 (modules '())
1720 (snippet #f)
1721 (patches
1722 (search-patches "openjdk-15-jtask-reproducibility.patch"
1723 "openjdk-15-xcursor-no-dynamic.patch"))))
1724 (inputs
1725 (modify-inputs inputs
1726 (append libxcursor))) ;for our patch to work
1727 (arguments
1728 (substitute-keyword-arguments (package-arguments base)
1729 ((#:implicit-inputs? _ #t)
1730 ;; This is necessary to avoid include ordering errors when adding a
1731 ;; lower GCC to native-inputs to avoid errors like "error: 'fesetround'
1732 ;; was not declared in this scope; did you mean 'setreuid'?"
1733 #f)
1734 ((#:configure-flags flags '%standard-phases)
1735 #~(cons "--without-gtest" ;this replaces...
1736 (delete "--disable-hotspot-gtest" #$flags))))) ;... this
1737 (native-inputs
1738 (append (modify-inputs native-inputs
1739 (delete "make" ;remove old gnu-make-4.2
1740 "openjdk") ;to remove non-jdk output
1741 (append `(,openjdk14 "jdk")))
1742 ;; On powerpc64le at least, GCC 14 cannot be used otherwise JDK 15
1743 ;; fails to bootstrap JDK 16, with incomprehensible errors like:
1744 ;; src/java.base/share/classes/java/lang/reflect/Proxy.java:1311:
1745 ;; error: integer number too large.
1746 (modify-inputs (%final-inputs)
1747 (replace "gcc" gcc-11))))))
1748
1749(define-public openjdk16
1750 (make-openjdk
1751 openjdk15 "16.0.2"
1752 "0587px2qbz07g3xi4a3ya6m630p72dvkxcn0bj1813pxnwvcgigz"
1753 (source (origin
1754 (inherit (package-source base))
1755 (patches (search-patches "openjdk-15-xcursor-no-dynamic.patch"
1756 "openjdk-10-setsignalhandler.patch"))))))
1757
1758(define-public openjdk17
1759 (make-openjdk
1760 openjdk16 "17.0.10"
1761 "1bq1rqnipz6wdr05s20gm8nlpb3328ljxckzvc5ag0gf7fzlhn5f"
1762 (source (origin
1763 (inherit (package-source base))
1764 (patches (search-patches "openjdk-15-xcursor-no-dynamic.patch"))))
1765 (arguments
1766 (substitute-keyword-arguments (package-arguments base)
1767 ((#:implicit-inputs? _ #t) #t) ;restore default
1768 ((#:phases phases)
1769 #~(modify-phases #$phases
1770 (replace 'fix-java-shebangs
1771 (lambda _
1772 ;; 'blacklisted' was renamed back to 'blocked'.
1773 (substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
1774 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))
1775 (native-inputs
1776 ;; Resume using the implicit inputs, including the current GCC.
1777 (fold alist-delete (package-native-inputs base)
1778 (map first (%final-inputs))))))
1779
1780(define-public openjdk18
1781 (make-openjdk openjdk17 "18.0.2.1"
1782 "0zxanjzz4p3psqahlidh55vx1ldanq70c2ygk3gcfn9a94vnr9rg"))
1783
1784(define-public openjdk19
1785 (make-openjdk openjdk18 "19.0.2"
1786 "08kvx7n8qhhfl25pig966881j5h4x7y0pf4brq16x0283fc0f4d4"
1787 (arguments
1788 (substitute-keyword-arguments (package-arguments openjdk18)
1789 ((#:phases phases)
1790 #~(modify-phases #$phases
1791 (replace 'fix-java-shebangs
1792 (lambda _
1793 ;; Update file path.
1794 (substitute* "src/java.base/share/data/blockedcertsconverter/blocked.certs.pem"
1795 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))
1796 (add-before 'configure 'define-java-environment-variables
1797 (lambda* (#:key inputs #:allow-other-keys)
1798 ;; Fix for "valid range 1980-01-01T00:00:02Z to 2099-12-31T23:59:59Z".
1799 (setenv "SOURCE_DATE_EPOCH" "1234567890")))))))))
1800
1801(define-public openjdk20
1802 (make-openjdk openjdk19 "20.0.2"
1803 "1af1v2c3d8x4c6shzl6cv9qwq7a4hn5map5pjh9vjcky0hkzd489"))
1804
1805(define-public openjdk21
1806 (make-openjdk openjdk20 "21.0.2"
1807 "0d1g3wnzr5whjpq8gvxq0h7kd7lxd3xgc6bh3kg8vzz096asn0kj"
1808 (source (origin
1809 (inherit (package-source base))
1810 (patches (search-patches "openjdk-21-fix-rpath.patch"
1811 "openjdk-15-xcursor-no-dynamic.patch"))))
1812 (arguments
1813 (substitute-keyword-arguments (package-arguments base)
1814 ((#:phases phases)
1815 #~(modify-phases #$phases
1816 (replace 'fix-java-shebangs
1817 (lambda _
1818 ;; 'blacklisted' was renamed back to 'blocked'.
1819 (substitute* "src/java.base/share/data/blockedcertsconverter/blocked.certs.pem"
1820 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))))
1821
1822(define-public openjdk22
1823 (make-openjdk
1824 openjdk21 "22.0.2"
1825 "1nj414yj6v9qrlm48yv5llr4jmgj9g20v6zsd39xrdx4x4x4p3b6"
1826 (arguments
1827 (substitute-keyword-arguments (package-arguments base)
1828 ((#:phases phases)
1829 #~(modify-phases #$phases
1830 (add-after 'unpack 'do-not-disable-new-dtags
1831 (lambda _
1832 ;; Our validate-runpath phases checks for RUNPATH, not RPATH.
1833 (substitute* "make/autoconf/flags-cflags.m4"
1834 ((" -Wl,--disable-new-dtags") ""))))))))))
1835
1836(define-public openjdk23
1837 (make-openjdk
1838 openjdk22 "23.0.2"
1839 "0kxllznzhgqfn8b97krg2yp1ag41g4phmgqahrvzafd2bq6zclnf"
1840 (source (origin
1841 (inherit (package-source base))
1842 ;; The 'openjdk-21-fix-rpath.patch' no longer applies, and it
1843 ;; appears not needed anymore. The
1844 ;; 'openjdk-15-xcursor-no-dynamic.patch' doesn't apply anymore;
1845 ;; the fix should be pursued in libx11 (see:
1846 ;; https://issues.guix.gnu.org/54654)
1847 (patches '())))))
1848
1849(define-public openjdk24
1850 (make-openjdk
1851 openjdk23 "24.0.1"
1852 "0h6sbzbjyqg85iml41pswdh2z3d7h2hhb0sd5yll37r1mj5lsxmx"
1853 (arguments
1854 (substitute-keyword-arguments (package-arguments base)
1855 ((#:configure-flags flags #~(list))
1856 (if (target-x86-32?)
1857 #~(cons* "--enable-deprecated-ports=yes" #$flags)
1858 flags))))))
1859
1860(define-public openjdk25
1861 (make-openjdk
1862 openjdk24 "25.0.2"
1863 "03aa34lscr3qbdl6qz3gqyp0nzkqfj02362mzmpkiq3y2g5xdnrj"
1864 (arguments
1865 (substitute-keyword-arguments (package-arguments base)
1866 ((#:configure-flags flags #~(list))
1867 (if (target-x86-32?)
1868 ;; Full builds on 32-bit x86 architectures are not supported as of
1869 ;; this version. Best we can do is to build with the "zero" variant.
1870 #~(cons* "--with-jvm-variants=zero"
1871 "--disable-precompiled-headers"
1872 #$flags)
1873 flags))
1874 ((#:phases phases #~%standard-phases)
1875 (if (target-x86-32?)
1876 #~(modify-phases #$phases
1877 (replace 'install
1878 (lambda _
1879 (let ((images (car (find-files "build" "-zero-release"
1880 #:directories? #t))))
1881 (copy-recursively (string-append images "/images/jdk")
1882 #$output:jdk)
1883 (copy-recursively (string-append images "/images/jre")
1884 #$output)
1885 (copy-recursively (string-append images "/images/docs")
1886 #$output:doc))))
1887 (replace 'install-libjvm
1888 (lambda _
1889 (let ((lib-out (string-append #$output "/lib"))
1890 (lib-jdk (string-append #$output:jdk "/lib")))
1891 (symlink (string-append lib-jdk "/zero/libjvm.so")
1892 (string-append lib-jdk "/libjvm.so"))
1893 (symlink (string-append lib-out "/zero/libjvm.so")
1894 (string-append lib-out "/libjvm.so"))))))
1895 phases))))))
1896
1897;;; Convenience alias to point to the latest version of OpenJDK.
1898(define-public openjdk openjdk25)
1899
1900
1901;; This version of JBR is here in order to be able to build custom
1902;; IntelliJ plugins. Those usually need both jbr11 and jbr17 for
1903;; tests.
1904(define-public jbr11
1905 (package
1906 (inherit openjdk11)
1907 (name "jbr")
1908 (version "11_0_16-b2248")
1909 (source (origin
1910 (method git-fetch)
1911 (uri (git-reference
1912 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1913 (commit (string-append "jb" version))))
1914 (file-name (string-append name "-" version "-checkout"))
1915 (sha256
1916 (base32
1917 "1fnrdx0wb21ghm6jczjzk7b9fz9hbdzd62512xhwpzvca57v2z09"))))
1918 (arguments
1919 (substitute-keyword-arguments (package-arguments openjdk11)
1920 ((#:configure-flags configure-flags)
1921 #~(append #$configure-flags
1922 (list "--with-jvm-features=shenandoahgc"
1923 "--enable-cds=yes"
1924 "--with-vendor-name=JetBrains s.r.o"
1925 "--with-vendor-url=https://www.jetbrains.com/"
1926 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
1927 (synopsis "JetBrains Java Runtime")
1928 (description "This package provides a Java runtime environment for
1929and Java development kit. It supports enhanced class redefinition (DCEVM),
1930includes a number of improvements in font rendering, keyboards support,
1931windowing/focus subsystems, HiDPI, accessibility, and performance,
1932provides better desktop integration and bugfixes not yet present in
1933OpenJDK.")
1934 (home-page "https://www.jetbrains.com/")
1935 (license license:gpl2+)))
1936
1937(define-public jbr17
1938 (package
1939 (inherit openjdk17)
1940 (name "jbr")
1941 (version "17.0.11b1207.30")
1942 (source (origin
1943 (method git-fetch)
1944 (uri (git-reference
1945 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1946 (commit (string-append "jbr-release-" version))))
1947 (file-name (string-append name "-" version "-checkout"))
1948 (sha256
1949 (base32
1950 "5bbf5z8faf9sdkig2fwkj06hb7hs9s3bpzzvbqn2i75lbwqk3bln"))
1951 (patches (search-patches "jbr-17-xcursor-no-dynamic.patch"))))
1952 (arguments
1953 (substitute-keyword-arguments (package-arguments openjdk17)
1954 ((#:configure-flags configure-flags)
1955 #~(append #$configure-flags
1956 (list "--with-jvm-features=shenandoahgc"
1957 "--enable-cds=yes"
1958 "--with-vendor-name=JetBrains s.r.o"
1959 "--with-vendor-url=https://www.jetbrains.com/"
1960 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
1961 (synopsis "JetBrains Java Runtime")
1962 (description "This package provides a Java runtime environment for
1963and Java development kit. It supports enhanced class redefinition (DCEVM),
1964includes a number of improvements in font rendering, keyboards support,
1965windowing/focus subsystems, HiDPI, accessibility, and performance,
1966provides better desktop integration and bugfixes not yet present in
1967OpenJDK.")
1968 (home-page "https://www.jetbrains.com/")
1969 (license license:gpl2+)))
1970
1971(define-public jbr21
1972 (package
1973 (inherit openjdk21)
1974 (name "jbr")
1975 (version "21.0.3b509.11")
1976 (source (origin
1977 (method git-fetch)
1978 (uri (git-reference
1979 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1980 (commit (string-append "jbr-release-" version))))
1981 (file-name (string-append name "-" version "-checkout"))
1982 (sha256
1983 (base32
1984 "03xkghbp0b1czc2ags9n8ilprf9sy4bhsma0wf8xfapqn6d2sfyd"))
1985 (patches (search-patches "openjdk-21-fix-rpath.patch"
1986 "jbr-17-xcursor-no-dynamic.patch"))))
1987 (inputs
1988 `(("wayland" ,wayland)
1989 ("libxkbcommon" ,libxkbcommon) ; for wayland
1990 ,@(package-inputs openjdk21)))
1991 (arguments
1992 (substitute-keyword-arguments (package-arguments openjdk21)
1993 ((#:configure-flags configure-flags)
1994 #~(append #$configure-flags
1995 (list "--with-jvm-features=shenandoahgc"
1996 "--enable-cds=yes"
1997 "--with-vendor-name=JetBrains s.r.o"
1998 "--with-vendor-url=https://www.jetbrains.com/"
1999 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
2000 (synopsis "JetBrains Java Runtime")
2001 (description "This package provides a Java runtime environment for
2002and Java development kit. It supports enhanced class redefinition (DCEVM),
2003includes a number of improvements in font rendering, keyboards support,
2004windowing/focus subsystems, HiDPI, accessibility, and performance,
2005provides better desktop integration and bugfixes not yet present in
2006OpenJDK.")
2007 (home-page "https://www.jetbrains.com/")
2008 (license license:gpl2+)))
2009
2010(define-public jbr25
2011 (package
2012 (inherit openjdk25)
2013 (name "jbr")
2014 (version "25.0.2b329.72")
2015 (source (origin
2016 (method git-fetch)
2017 (uri (git-reference
2018 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
2019 (commit (string-append "jbr-release-" version))))
2020 (file-name (string-append name "-" version "-checkout"))
2021 (sha256
2022 (base32
2023 "1m7pbz2ypx4h7n6iqss8bgymg9hqn14lnis4a2w87mgy51p370ib"))
2024 (patches
2025 (search-patches "jbr-25-wayland-drag-icon.patch"
2026 "jbr-25-wayland-intra-jvm-dnd.patch"))))
2027 (inputs
2028 `(("wayland" ,wayland)
2029 ("libxkbcommon" ,libxkbcommon) ; for wayland
2030 ,@(package-inputs openjdk25)))
2031 (native-inputs
2032 (modify-inputs (package-native-inputs openjdk25)
2033 (append wayland-protocols)))
2034 (arguments
2035 (substitute-keyword-arguments (package-arguments openjdk25)
2036 ((#:configure-flags configure-flags)
2037 #~(append #$configure-flags
2038 (list "--disable-warnings-as-errors"
2039 "--disable-java-warnings-as-errors"
2040 "--with-jvm-features=shenandoahgc"
2041 "--enable-cds=yes"
2042 (string-append "--with-wayland-protocols="
2043 (assoc-ref %build-inputs "wayland-protocols")
2044 "/share/wayland-protocols")
2045 "--with-vendor-name=JetBrains s.r.o"
2046 "--with-vendor-url=https://www.jetbrains.com/"
2047 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))
2048 ((#:phases phases)
2049 #~(modify-phases #$phases
2050 ;; JBR adds a 'static-jdk-image' target to 'make all' that
2051 ;; statically links both the Wayland and X11 AWT backends,
2052 ;; causing duplicate symbol errors. Build only what we need.
2053 ;; See also their workaround BROKEN_STATIC_LIBS make variable.
2054 (replace 'build
2055 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
2056 (apply invoke "make" "product-images" "all-docs-images"
2057 (format #f "JOBS=~a" (if parallel-build?
2058 (parallel-job-count)
2059 1))
2060 make-flags)))))))
2061 (synopsis "JetBrains Java Runtime")
2062 (description "This package provides a Java runtime environment for
2063and Java development kit. It supports enhanced class redefinition (DCEVM),
2064includes a number of improvements in font rendering, keyboards support,
2065windowing/focus subsystems, Wayland, HiDPI, accessibility, and performance,
2066provides better desktop integration and bugfixes not yet present in
2067OpenJDK.")
2068 (home-page "https://www.jetbrains.com/")
2069 (license license:gpl2+)))
2070
2071
2072(define-public ant
2073 (package
2074 (name "ant")
2075 (version "1.10.17")
2076 (source (origin
2077 (method url-fetch)
2078 (uri (string-append "mirror://apache/ant/source/apache-ant-"
2079 version "-src.tar.gz"))
2080 (sha256
2081 (base32
2082 "0p34pqknp2rbk5wk6zw8m6jfn7rkk7fyv3yvk9zhfxhhxrf0lfgh"))
2083 (modules '((guix build utils)))
2084 (snippet
2085 '(begin
2086 (for-each delete-file
2087 (find-files "lib/optional" "\\.jar$"))))))
2088 (build-system ant-build-system)
2089 (arguments
2090 (list
2091 #:ant ant/java7
2092 #:test-target "test"
2093 #:phases
2094 #~(modify-phases %standard-phases
2095 (add-after 'unpack 'remove-scripts
2096 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
2097 ;; wrappers.
2098 (lambda _
2099 (for-each delete-file
2100 (find-files "src/script"
2101 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))))
2102 (add-after 'unpack 'link-test-dependencies
2103 (lambda* (#:key inputs #:allow-other-keys)
2104 (for-each (lambda (file)
2105 (symlink file
2106 (string-append "lib/optional/"
2107 (basename file))))
2108 (append
2109 (find-files (assoc-ref inputs "java-hamcrest-core")
2110 "\\.jar$")
2111 (find-files (assoc-ref inputs "java-hamcrest-library")
2112 "\\.jar$")
2113 (find-files (assoc-ref inputs "java-junit")
2114 "\\.jar$")))))
2115 (add-before 'build 'fix-test-failures
2116 (lambda _
2117 ;; Failure because the directory does not exist
2118 (substitute* "src/etc/testcases/taskdefs/exec/exec-with-redirector.xml"
2119 (("/usr/bin") (getcwd)))
2120 ;; Failure because it cannot read root's name in the build
2121 ;; container
2122 (delete-file "src/tests/junit/org/apache/tools/ant/types/selectors/OwnedBySelectorTest.java")
2123 ;; Cause timestamp issue when trying to rollback time by a few
2124 ;; seconds.
2125 (for-each (lambda (file) (utime file 5000))
2126 (find-files "src/etc/testcases/taskdefs" "" #:directories? #t))))
2127 (delete 'bootstrap)
2128 (delete 'configure)
2129 (replace 'build
2130 (lambda* (#:key inputs #:allow-other-keys)
2131 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
2132 (invoke "bash" "bootstrap.sh"
2133 (string-append "-Ddist.dir=" #$output))))
2134 (add-after 'build 'fix-executables-paths
2135 (lambda* (#:key inputs #:allow-other-keys)
2136 (wrap-script (string-append #$output "/bin/ant")
2137 `("PATH" suffix
2138 (,(dirname (search-input-file inputs "/bin/sed"))
2139 ,(dirname (search-input-file inputs "/bin/uname"))
2140 ,(dirname (search-input-file inputs "/bin/which")))))
2141 (patch-shebang
2142 (string-append #$output "/bin/complete-ant-cmd.pl")
2143 (list (dirname (search-input-file inputs "/bin/perl"))))))
2144 (delete 'install))))
2145 (inputs
2146 (list coreutils-minimal
2147 guile-3.0/pinned
2148 java-hamcrest-core
2149 java-hamcrest-library
2150 java-junit
2151 perl
2152 sed
2153 which))
2154 (home-page "https://ant.apache.org")
2155 (synopsis "Build tool for Java")
2156 (description
2157 "Ant is a platform-independent build tool for Java. It is similar to
2158make but is implemented using the Java language, requires the Java platform,
2159and is best suited to building Java projects. Ant uses XML to describe the
2160build process and its dependencies, whereas Make uses Makefile format.")
2161 (license license:asl2.0)))
2162
2163;; Deprecated on <2026-04-02>.
2164(define-public ant/java8 ant)
2165
2166(define-public ant/java8-empty-etc
2167 (package
2168 (inherit ant)
2169 (arguments
2170 (substitute-keyword-arguments arguments
2171 ((#:phases phases)
2172 #~(modify-phases #$phases
2173 (add-after 'build 'add-empty-etc-directory
2174 (lambda* (#:key outputs #:allow-other-keys)
2175 (mkdir-p (string-append (assoc-ref outputs "out") "/etc"))))))))))
2176
2177(define-public ant-1.10.14
2178 (package
2179 (inherit ant)
2180 (name "ant")
2181 (version "1.10.14")
2182 (source
2183 (origin
2184 (method url-fetch)
2185 (uri (string-append "mirror://apache/ant/source/apache-ant-"
2186 version "-src.tar.gz"))
2187 (sha256
2188 (base32 "0m0vcazy1634nra8mcs3hvvf49avnbxf8f5y1icn5syi8hgy6pws"))
2189 (modules '((guix build utils)))
2190 (snippet
2191 '(begin
2192 (for-each delete-file
2193 (find-files "lib/optional" "\\.jar$"))
2194 #t))))
2195 (arguments
2196 (substitute-keyword-arguments arguments
2197 ((#:phases phases)
2198 #~(modify-phases #$phases
2199 (replace 'remove-scripts
2200 (lambda _
2201 (for-each delete-file
2202 (find-files "src/script" ".*\\.(bat|cmd)$"))))
2203 (add-after 'build 'install-distribution-files
2204 (lambda* (#:key outputs #:allow-other-keys)
2205 (let* ((out (assoc-ref outputs "out"))
2206 (bin-dir (string-append out "/bin"))
2207 (etc-dir (string-append out "/etc"))
2208 (checkstyle-dir (string-append etc-dir "/checkstyle")))
2209 (for-each
2210 (lambda (file)
2211 (copy-file (string-append "src/script/" file)
2212 (string-append bin-dir "/" file))
2213 (chmod (string-append bin-dir "/" file) #o755))
2214 '("antRun" "antRun.pl" "runant.pl" "runant.py"))
2215 (mkdir-p checkstyle-dir)
2216 (for-each
2217 (lambda (file)
2218 (copy-file (string-append "src/etc/" file)
2219 (string-append etc-dir "/" file)))
2220 '("junit-frames.xsl"
2221 "junit-noframes.xsl"
2222 "junit-frames-xalan1.xsl"
2223 "coverage-frames.xsl"
2224 "maudit-frames.xsl"
2225 "mmetrics-frames.xsl"
2226 "changelog.xsl"
2227 "jdepend.xsl"
2228 "jdepend-frames.xsl"
2229 "log.xsl"
2230 "tagdiff.xsl"))
2231 (for-each
2232 (lambda (file)
2233 (copy-file (string-append "src/etc/checkstyle/" file)
2234 (string-append checkstyle-dir "/" file)))
2235 '("checkstyle-frames-sortby-check.xsl"
2236 "checkstyle-frames.xsl"
2237 "checkstyle-text.xsl"
2238 "checkstyle-xdoc.xsl"))
2239 (copy-file "build/lib/ant-bootstrap.jar"
2240 (string-append etc-dir "/ant-bootstrap.jar")))))))))))
2241
2242;; The 1.9.x series is the last that can be built with GCJ. The 1.10.x series
2243;; requires Java 8.
2244(define-public ant/java7
2245 (package
2246 (name "ant")
2247 (version "1.9.15")
2248 (source (origin
2249 (method url-fetch)
2250 (uri (string-append "mirror://apache/ant/source/apache-ant-"
2251 version "-src.tar.gz"))
2252 (sha256
2253 (base32
2254 "1xy30f1w5gaqk6g3f0vw7ygix4rb6032qkcw42y4z8wd9jihgygd"))))
2255 (build-system gnu-build-system)
2256 (arguments
2257 `(#:modules ((srfi srfi-1)
2258 (guix build gnu-build-system)
2259 (guix build utils))
2260 #:tests? #f ; no "check" target
2261 #:phases
2262 (modify-phases %standard-phases
2263 (delete 'bootstrap)
2264 (delete 'configure)
2265 (add-after 'unpack 'remove-scripts
2266 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
2267 ;; wrappers.
2268 (lambda _
2269 (for-each delete-file
2270 (find-files "src/script"
2271 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))))
2272 (replace 'build
2273 (lambda* (#:key inputs outputs #:allow-other-keys)
2274 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
2275
2276 ;; Disable tests to avoid dependency on hamcrest-core, which needs
2277 ;; Ant to build. This is necessary in addition to disabling the
2278 ;; "check" phase, because the dependency on "test-jar" would always
2279 ;; result in the tests to be run.
2280 (substitute* "build.xml"
2281 (("depends=\"jars,test-jar") "depends=\"jars"))
2282 (invoke "bash" "bootstrap.sh"
2283 (string-append "-Ddist.dir="
2284 (assoc-ref outputs "out")))))
2285 (add-after 'build 'strip-jar-timestamps ;based on ant-build-system
2286 (lambda* (#:key outputs #:allow-other-keys)
2287 (define (repack-archive jar)
2288 (let* ((dir (mkdtemp "jar-contents.XXXXXX"))
2289 (manifest (string-append dir "/META-INF/MANIFESTS.MF")))
2290 (with-directory-excursion dir
2291 (invoke "unzip" jar))
2292 (delete-file jar)
2293 ;; XXX: copied from (gnu build install)
2294 (for-each (lambda (file)
2295 (let ((s (lstat file)))
2296 (unless (eq? (stat:type s) 'symlink)
2297 (utime file 0 0 0 0))))
2298 (find-files dir #:directories? #t))
2299 ;; It is important that the manifest appears first.
2300 (with-directory-excursion dir
2301 (let* ((files (find-files "." ".*" #:directories? #t))
2302 ;; To ensure that the reference scanner can
2303 ;; detect all store references in the jars
2304 ;; we disable compression with the "-0" option.
2305 (command (if (file-exists? manifest)
2306 `("zip" "-0" "-X" ,jar ,manifest
2307 ,@files)
2308 `("zip" "-0" "-X" ,jar ,@files))))
2309 (apply invoke command)))))
2310 (for-each repack-archive
2311 (find-files
2312 (string-append (assoc-ref %outputs "out") "/lib")
2313 "\\.jar$"))))
2314 (delete 'install))))
2315 (native-inputs
2316 `(("jdk" ,icedtea-7 "jdk")
2317 ("zip" ,zip)
2318 ("unzip" ,unzip)))
2319 (home-page "https://ant.apache.org")
2320 (synopsis "Build tool for Java")
2321 (description
2322 "Ant is a platform-independent build tool for Java. It is similar to
2323make but is implemented using the Java language, requires the Java platform,
2324and is best suited to building Java projects. Ant uses XML to describe the
2325build process and its dependencies, whereas Make uses Makefile format.")
2326 (license license:asl2.0)))
2327
2328(define-public ant-apache-bcel
2329 (package
2330 (inherit ant)
2331 (name "ant-apache-bcel")
2332 (arguments
2333 (substitute-keyword-arguments (package-arguments ant)
2334 ((#:phases phases)
2335 #~(modify-phases #$phases
2336 (add-after 'unpack 'link-bcel
2337 (lambda* (#:key inputs #:allow-other-keys)
2338 (for-each (lambda (file)
2339 (symlink file
2340 (string-append "lib/optional/"
2341 (basename file))))
2342 (find-files (assoc-ref inputs "java-commons-bcel")
2343 "\\.jar$"))))
2344 (add-after 'build 'install
2345 (lambda _
2346 (let ((share (string-append #$output "/share/java"))
2347 (bin (string-append #$output "/bin"))
2348 (lib (string-append #$output "/lib")))
2349 (mkdir-p share)
2350 (install-file (string-append lib "/ant-apache-bcel.jar") share)
2351 (delete-file-recursively bin)
2352 (delete-file-recursively lib))))))))
2353 (inputs
2354 (modify-inputs (package-inputs ant)
2355 (prepend java-commons-bcel)))))
2356
2357(define-deprecated-package ant-junit
2358 ant)
2359
2360(define-public libantlr3c
2361 (package
2362 (name "libantlr3c")
2363 (version "3.4")
2364 (source
2365 (origin
2366 (method url-fetch)
2367 (uri
2368 (string-append "https://www.antlr3.org/download/C/"
2369 name "-" version ".tar.gz"))
2370 (sha256
2371 (base32 "0lpbnb4dq4azmsvlhp6khq1gy42kyqyjv8gww74g5lm2y6blm4fa"))))
2372 (build-system gnu-build-system)
2373 (arguments
2374 (list #:configure-flags
2375 #~(list "--enable-debuginfo"
2376 "--disable-static"
2377 #$@(if (target-64bit?)
2378 #~("--enable-64bit")
2379 #~())
2380 #$@(if (target-riscv64?)
2381 #~("--disable-abiflags")
2382 #~()))))
2383 (synopsis "ANTLR C Library")
2384 (description "LIBANTLR3C provides run-time C libraries for ANTLR3 (ANother
2385Tool for Language Recognition v3).")
2386 (home-page "https://www.antlr3.org/")
2387 (license license:bsd-3)))
2388
2389(define-public drip
2390 ;; Last release is from 2014, with a few important commits afterwards.
2391 (let ((commit "a4bd00df0199e78243847f06cc04ecaea31f8f08"))
2392 (package
2393 (name "drip")
2394 (version (git-version "0.2.4" "1" commit))
2395 (source (origin
2396 (method git-fetch)
2397 (uri (git-reference
2398 (url "https://github.com/ninjudd/drip")
2399 (commit commit)))
2400 (file-name (git-file-name name version))
2401 (sha256
2402 (base32
2403 "0wzmjwfyldr3jn49517xd8yn7dgdk8h88qkga3kjyg1zc375ylg2"))))
2404 (build-system gnu-build-system)
2405 (native-inputs
2406 `(("jdk" ,icedtea "jdk")))
2407 (arguments
2408 (list #:tests? #f ; No tests.
2409 #:phases
2410 #~(modify-phases %standard-phases
2411 (delete 'configure)
2412 (add-before 'build 'relax-gcc-14-strictness
2413 (lambda _
2414 (substitute* "Makefile"
2415 ((" gcc(.*)$" all options)
2416 (string-append
2417 " gcc"
2418 " -Wno-error=incompatible-pointer-types"
2419 " -Wno-error=implicit-function-declaration"
2420 options)))))
2421 (add-before 'install 'fix-wrapper
2422 (lambda* (#:key inputs #:allow-other-keys)
2423 (let ((jps (search-input-file inputs "/bin/jps")))
2424 (substitute* "bin/drip"
2425 (("jps") jps)
2426 (("brew update && brew upgrade drip") "guix pull && guix install drip")
2427 ;; No need to make:
2428 (("\\(cd -- \"\\$drip_dir\" && make -s\\) \\|\\| exit 1") "")
2429 ;; No need to include source:
2430 (("\\[\\[ -r \\$drip_dir/src/org/flatland/drip/Main\\.java \\]\\]")
2431 "true")))))
2432 (replace 'install
2433 (lambda* (#:key outputs #:allow-other-keys)
2434 (let* ((bin (string-append #$output "/bin"))
2435 (share (string-append #$output "/share/drip")))
2436 (mkdir-p bin)
2437 (for-each
2438 (lambda (file)
2439 (install-file (string-append "bin/" file) bin))
2440 '("drip" "drip_daemon" "drip_proxy"))
2441 (install-file "drip.jar" share)
2442 (substitute* (string-append bin "/drip")
2443 (("drip_dir=\\$bin_dir/..")
2444 (string-append "drip_dir=" share)))))))))
2445 (home-page "https://github.com/ninjudd/drip")
2446 (synopsis "Faster Java Virtual Machine launching")
2447 (description "Drip is a launcher for the Java Virtual Machine that
2448provides much faster startup times than the @command{java} command. The @command{drip}
2449script is intended to be a drop-in replacement for the @command{java} command,
2450only faster.")
2451 (license license:epl1.0))))
2452
2453(define-public java-openjfx-build
2454 (package
2455 (name "java-openjfx-build")
2456 ;; This is a java-8 version
2457 (version "8.202")
2458 (source (origin
2459 (method hg-fetch)
2460 (uri (hg-reference
2461 (url "http://hg.openjdk.java.net/openjfx/8u-dev/rt")
2462 (changeset (string-append
2463 (string-join (string-split version #\.) "u")
2464 "-ga"))))
2465 (file-name (string-append name "-" version "-checkout"))
2466 (modules '((guix build utils)))
2467 (snippet
2468 '(begin
2469 ;; Delete included gradle jar
2470 (delete-file-recursively "gradle/wrapper")
2471 #t))
2472 (sha256
2473 (base32
2474 "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))
2475 (patches (search-patches "java-openjfx-build-jdk_version.patch"))))
2476 (build-system ant-build-system)
2477 (arguments
2478 `(#:jar-name "java-openjfx.jar"
2479 #:source-dir "buildSrc/src/main/java"
2480 #:test-dir "buildSrc/src/test"
2481 #:phases
2482 (modify-phases %standard-phases
2483 (add-before 'configure 'generate-jsl-parser
2484 (lambda _
2485 (invoke "antlr3" "-o"
2486 "buildSrc/src/main/java/com/sun/scenario/effect/compiler"
2487 "buildSrc/src/main/antlr/JSL.g"))))))
2488 (inputs
2489 (list antlr3 java-stringtemplate))
2490 (native-inputs
2491 (list java-junit java-hamcrest-core))
2492 (home-page "https://openjfx.io")
2493 (synopsis "Graphical application toolkit in Java")
2494 (description "OpenJFX is a client application platform for desktop,
2495mobile and embedded systems built on Java. Its goal is to produce a
2496modern, efficient, and fully featured toolkit for developing rich client
2497applications. This package contains base classes for the OpenJFX
2498distribution and helper classes for building other parts of the
2499distribution.")
2500 (license license:gpl2))) ;gpl2 only, with classpath exception
2501
2502(define-public java-openjfx-base
2503 (package (inherit java-openjfx-build)
2504 (name "java-openjfx-base")
2505 (arguments
2506 `(#:jar-name "java-openjfx-base.jar"
2507 #:source-dir "modules/base/src/main/java:modules/base/src/main/java8:modules/base/src/main/version-info"
2508 #:test-dir "modules/base/src/test"
2509 #:phases
2510 (modify-phases %standard-phases
2511 (add-before 'check 'remove-empty-file
2512 (lambda _
2513 (with-directory-excursion "modules/base/src/test/java"
2514 ;; These files are completely commented, but junit expects them to
2515 ;; contain a class, so tests fail.
2516 (delete-file
2517 "com/sun/javafx/property/adapter/PropertyDescriptorTest.java")
2518 (delete-file
2519 "com/sun/javafx/property/adapter/ReadOnlyPropertyDescriptorTest.java")
2520 (delete-file "javafx/beans/property/PropertiesTest.java")
2521 (delete-file
2522 "javafx/beans/property/adapter/ReadOnlyJavaBeanPropertyBuilder_General_Test.java")
2523 ;; This one fails
2524 (delete-file "com/sun/javafx/runtime/VersionInfoTest.java"))
2525 #t)))))
2526 (propagated-inputs
2527 (list java-openjfx-build))
2528 (description "OpenJFX is a client application platform for desktop,
2529mobile and embedded systems built on Java. Its goal is to produce a
2530modern, efficient, and fully featured toolkit for developing rich client
2531applications. This package contains base classes for the OpenJFX
2532distribution.")))
2533
2534(define-public java-openjfx-graphics
2535 (package (inherit java-openjfx-build)
2536 (name "java-openjfx-graphics")
2537 (arguments
2538 `(#:jar-name "java-openjfx-graphics.jar"
2539 #:source-dir "modules/graphics/src/main/java"
2540 #:tests? #f; require X
2541 #:test-dir "modules/graphics/src/test"
2542 #:phases
2543 (modify-phases %standard-phases
2544 (add-after 'unpack 'copy-missing-file
2545 (lambda* (#:key inputs #:allow-other-keys)
2546 (let ((target "modules/graphics/src/main/native-prism-sw/JNativeSurface.c"))
2547 (copy-file (assoc-ref inputs "JNativeSurface.c") target)
2548 ;; XXX: looks like the missing file we found isn't *quite*
2549 ;; compatible...
2550 (substitute* target
2551 (("case TYPE_INT_ARGB:") "")))))
2552 (add-after 'build 'build-native
2553 (lambda* (#:key inputs outputs #:allow-other-keys)
2554 (let ((jdk (assoc-ref inputs "jdk"))
2555 (class-file->class-name
2556 (lambda (class-file)
2557 (string-map (lambda (c)
2558 (if (char=? c #\/) #\. c))
2559 (string-drop-right class-file
2560 (string-length ".class"))))))
2561 (setenv "CPPFLAGS"
2562 (string-append "-DINLINE=inline "
2563 "-DLINUX "
2564 "-I" jdk "/include "
2565 "-I" jdk "/include/linux "
2566 "-I " (getcwd) "/build/classes/include "
2567 "-I " (getcwd) "/modules/graphics/src/main/native-prism-sw"))
2568
2569 ;; Instructions have been adapted from buildSrc/linux.gradle
2570 (with-directory-excursion "build/classes"
2571 ;; Build prism
2572 (mkdir-p "include")
2573
2574 ;; Generate headers for prism
2575 (apply invoke "javah" "-d" "include" "-cp" "."
2576 (map class-file->class-name
2577 (append (find-files "com/sun/prism/impl" "\\.class$")
2578 (find-files "com/sun/prism" "PresentableState.*\\.class$"))))
2579
2580 ;; ...then for prism_sw
2581 (apply invoke "javah" "-d" "include" "-cp" "."
2582 (map class-file->class-name
2583 (find-files "com/sun/pisces" "\\.class$")))
2584
2585 ;; ...and for prism_es2
2586 (apply invoke "javah" "-d" "include" "-cp" "."
2587 (map class-file->class-name
2588 (find-files "com/sun/prism/es2" "\\.class$")))))
2589
2590 (with-directory-excursion "netbeans/native-prism"
2591 (invoke "make" "CONF=Release"))
2592 (with-directory-excursion "netbeans/native-prism-sw"
2593 (invoke "make" "CONF=Release"))
2594 ;; TODO: This fails due to unknown EGL procedure names
2595 #;
2596 (with-directory-excursion "netbeans/native-prism-es2"
2597 (invoke "make" "CONF=Release"))
2598
2599 (let* ((out (assoc-ref outputs "out"))
2600 (dir ,(match (%current-system)
2601 ("i686-linux"
2602 "i386")
2603 ((or "armhf-linux" "aarch64-linux")
2604 "arm")
2605 ((or "x86_64-linux")
2606 "amd64")
2607 (_ "unknown")))
2608 (target (string-append out "/share/" dir "/")))
2609 (mkdir-p target)
2610 (for-each (lambda (file)
2611 (let ((new-name
2612 (string-append "lib"
2613 (string-map
2614 (lambda (c)
2615 (if (char=? c #\-) #\_ c))
2616 (string-drop (basename file)
2617 (string-length "libnative-"))))))
2618 (copy-file file
2619 (string-append target new-name))))
2620 (find-files "netbeans" "\\.so$"))))))))
2621 (propagated-inputs
2622 (list java-openjfx-base))
2623 (inputs
2624 (list java-swt))
2625 ;; XXX: for unknown reasons
2626 ;; modules/graphics/src/main/native-prism-sw/JNativeSurface.c is missing
2627 ;; in this revision.
2628 (native-inputs
2629 `(("JNativeSurface.c"
2630 ,(origin
2631 (method url-fetch)
2632 (uri "https://raw.githubusercontent.com/openjdk/jfx/8u20-b02\
2633/modules/graphics/src/main/native-prism-sw/JNativeSurface.c")
2634 (sha256
2635 (base32
2636 "1kp15wbnd6rn0nciczp5ibq0ikby2yysvx1gnz5fa05vl2mm8mbm"))))))
2637 (description "OpenJFX is a client application platform for desktop,
2638mobile and embedded systems built on Java. Its goal is to produce a
2639modern, efficient, and fully featured toolkit for developing rich client
2640applications. This package contains graphics-related classes for the
2641OpenJFX distribution.")))
2642
2643(define-public java-openjfx-media
2644 (package (inherit java-openjfx-build)
2645 (name "java-openjfx-media")
2646 (propagated-inputs
2647 `(("java-openjxf-graphics" ,java-openjfx-graphics)))
2648 (arguments
2649 `(#:jar-name "java-openjfx-media.jar"
2650 #:source-dir "modules/media/src/main/java"
2651 #:tests? #f)); no tests
2652 (description "OpenJFX is a client application platform for desktop,
2653mobile and embedded systems built on Java. Its goal is to produce a
2654modern, efficient, and fully featured toolkit for developing rich client
2655applications. This package contains media-related classes for the
2656OpenJFX distribution.")))
2657
2658(define-public java-openjfx-controls
2659 (package (inherit java-openjfx-build)
2660 (name "java-openjfx-controls")
2661 (propagated-inputs
2662 `(("java-openjxf-graphics" ,java-openjfx-graphics)))
2663 (arguments
2664 `(#:jar-name "java-openjfx-controls.jar"
2665 #:source-dir "modules/controls/src/main/java"
2666 #:test-dir "modules/controls/src/test"
2667 ;; TODO: tests require com.sun.javafx.pgstub,
2668 ;; javafx.collections.MockSetObserver, and
2669 ;; com.sun.javafx.binding.ExpressionHelperUtility
2670 #:tests? #false
2671 #:phases
2672 (modify-phases %standard-phases
2673 (add-after 'unpack 'copy-resources
2674 (lambda _
2675 (copy-recursively "modules/controls/src/test/resources"
2676 "build/test-classes")
2677 (copy-recursively "modules/controls/src/main/resources"
2678 "build/classes"))))))
2679 (description "OpenJFX is a client application platform for desktop,
2680mobile and embedded systems built on Java. Its goal is to produce a
2681modern, efficient, and fully featured toolkit for developing rich client
2682applications. This package contains UI control classes for the
2683OpenJFX distribution.")))
2684
2685(define-public javacc-4
2686 (package
2687 (name "javacc")
2688 (version "4.1")
2689 (source (origin
2690 (method git-fetch)
2691 (uri (git-reference
2692 (url "https://github.com/javacc/javacc")
2693 (commit "release_41")))
2694 (file-name (string-append "javacc-" version "-checkout"))
2695 (sha256
2696 (base32
2697 "07ysav7j8r1c6h8qxrgqk6lwdp74ly0ad1935lragxml0qqc3ka0"))
2698 (modules '((guix build utils)))
2699 ;; delete bundled jars
2700 (snippet '(begin (delete-file-recursively "lib") #t))))
2701 (build-system ant-build-system)
2702 ;; Tests fail with
2703 ;; /tmp/guix-build-javacc-4.1.drv-0/source/test/javacodeLA/build.xml:60:
2704 ;; JAVACODE failed
2705 (arguments
2706 `(#:tests? #f
2707 #:phases
2708 (modify-phases %standard-phases
2709 ;; Delete tests to avoid build failure (we don't run them anyway).
2710 (add-after 'unpack 'delete-tests
2711 (lambda _
2712 (for-each delete-file
2713 '("src/org/javacc/JavaCCTestCase.java"
2714 "src/org/javacc/parser/ExpansionTest.java"
2715 "src/org/javacc/parser/OptionsTest.java"
2716 "src/org/javacc/jjtree/JJTreeOptionsTest.java"))
2717 (for-each delete-file-recursively
2718 '("src/org/javacc/parser/test"
2719 "src/org/javacc/jjdoc/test"))
2720 #t))
2721 (replace 'install (install-jars "bin/lib")))))
2722 (home-page "https://javacc.org/")
2723 (synopsis "Java parser generator")
2724 (description "Java Compiler Compiler (JavaCC) is the most popular parser
2725generator for use with Java applications. A parser generator is a tool that
2726reads a grammar specification and converts it to a Java program that can
2727recognize matches to the grammar. In addition to the parser generator itself,
2728JavaCC provides other standard capabilities related to parser generation such
2729as tree building (via a tool called JJTree included with JavaCC), actions,
2730debugging, etc.")
2731 (license license:bsd-3)))
2732
2733;; javacc-3, as javacc-4 is not properly bootstrapped: is contains a javacc.jar
2734;; in the bootstrap/ directory.
2735(define-public javacc-3
2736 (package
2737 (inherit javacc-4)
2738 (version "3.2")
2739 (source (origin
2740 (method git-fetch)
2741 (uri (git-reference
2742 (url "https://github.com/javacc/javacc")
2743 (commit "release_32")))
2744 (file-name (string-append "javacc-" version "-checkout"))
2745 (sha256
2746 (base32
2747 "1pyf1xyh8gk83nxqn2v2mdws32l68ydznha41cxa4l2kkbq1v1g3"))))
2748 (arguments
2749 `(#:tests? #f
2750 #:phases
2751 (modify-phases %standard-phases
2752 (add-before 'build 'set-java-version
2753 (lambda _
2754 (for-each
2755 (lambda (file)
2756 (substitute* file
2757 (("debug=") "source=\"1.4\" debug=")))
2758 (find-files "." "build.xml"))
2759 #t))
2760 (replace 'install (install-jars "bin/lib")))))))
2761
2762(define-public javacc
2763 (package
2764 (inherit javacc-4)
2765 (version "7.0.4")
2766 (source
2767 (origin
2768 (method git-fetch)
2769 (uri (git-reference
2770 (url "https://github.com/javacc/javacc")
2771 (commit version)))
2772 (file-name (git-file-name "javacc" version))
2773 (sha256
2774 (base32 "18kkak3gda93gr25jrgy6q00g0jr8i24ri2wk4kybz1v234fxx9i"))
2775 (modules '((guix build utils)))
2776 ;; Delete bundled jars.
2777 (snippet '(begin (for-each delete-file-recursively
2778 '("bootstrap" "lib"))))))
2779 (arguments
2780 `(#:make-flags ; bootstrap from javacc-4
2781 ,#~(list (string-append "-Dbootstrap-jar="
2782 #$(this-package-native-input "javacc")
2783 "/share/java/javacc.jar"))
2784 #:test-target "test"
2785 #:phases
2786 (modify-phases %standard-phases
2787 (replace 'install (install-jars "target"))
2788 (add-after 'install 'install-bin
2789 (lambda* (#:key outputs inputs #:allow-other-keys)
2790 (let* ((out (assoc-ref outputs "out"))
2791 (dir (string-append out "/share/java"))
2792 (bin (string-append out "/bin"))
2793 (javacc (string-append bin "/javacc")))
2794 (mkdir-p bin)
2795 (with-output-to-file javacc
2796 (lambda _
2797 (display
2798 (string-append "#!/bin/sh\n"
2799 (assoc-ref inputs "icedtea") "/bin/java"
2800 " -cp " dir "/javacc.jar" " `basename $0`" " $*"))))
2801 (chmod javacc #o755)
2802 ;; symlink to different names to affect the first argument and
2803 ;; change the behavior of the jar file.
2804 (symlink javacc (string-append bin "/jjdoc"))
2805 (symlink javacc (string-append bin "/jjtree"))))))))
2806 (native-inputs
2807 (list javacc-4))
2808 (inputs (list icedtea-8))))
2809
2810(define-public java-ecj
2811 (package
2812 (name "java-ecj")
2813 (version "4.6.3")
2814 (source
2815 (origin
2816 (method url-fetch)
2817 (uri (string-append "http://archive.eclipse.org/eclipse/"
2818 "downloads/drops4/R-" version "-201703010400/"
2819 "ecjsrc-" version ".jar"))
2820 (sha256
2821 (base32
2822 "11cfgsdgznja1pvlxkjbqykxd7pcd5655vkm7s44xmahmap15gpl"))))
2823 (build-system ant-build-system)
2824 (arguments
2825 `(#:tests? #f ; none included
2826 #:build-target "build"
2827 #:phases
2828 (modify-phases %standard-phases
2829 (add-after 'unpack 'fix-build.xml
2830 (lambda _
2831 (substitute* "src/build.xml"
2832 (("^.*MANIFEST.*$")
2833 "")
2834 (("^.*properties.*$")
2835 "<include name=\"**/*.properties\"/>
2836 <include name=\"**/*.props\"/>"))))
2837 (add-before 'build 'chdir
2838 (lambda _ (chdir "src")))
2839 (replace 'install (install-jars ".")))))
2840 (home-page "https://eclipse.org")
2841 (synopsis "Eclipse Java development tools core batch compiler")
2842 (description "This package provides the Eclipse Java core batch compiler.")
2843 (license license:epl1.0)))
2844
2845(define-public java-cisd-base
2846 (let ((revision 38938)
2847 (base-version "14.12.0"))
2848 (package
2849 (name "java-cisd-base")
2850 (version (string-append base-version "-" (number->string revision)))
2851 (source (origin
2852 (method svn-fetch)
2853 (uri (svn-reference
2854 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2855 "base/tags/release/"
2856 (version-major+minor base-version)
2857 ".x/" base-version "/base/"))
2858 (revision revision)))
2859 (file-name (string-append "java-cisd-base-" version "-checkout"))
2860 (sha256
2861 (base32
2862 "1i5adyf7nzclb0wydgwa1az04qliid8035vpahaandmkmigbnxiy"))
2863 (modules '((guix build utils)))
2864 (snippet
2865 '(begin
2866 ;; Delete included gradle jar
2867 (delete-file-recursively "gradle/wrapper")
2868 ;; Delete pre-built native libraries
2869 (delete-file-recursively "libs")
2870 #t))))
2871 (build-system ant-build-system)
2872 (arguments
2873 `(#:make-flags '("-file" "build/build.xml")
2874 #:test-target "jar-test"
2875 #:jdk ,icedtea-8
2876 #:phases
2877 (modify-phases %standard-phases
2878 (add-after 'unpack 'unpack-build-resources
2879 (lambda* (#:key inputs #:allow-other-keys)
2880 (copy-recursively (assoc-ref inputs "build-resources")
2881 "../build_resources")
2882 #t))
2883 (add-after 'unpack-build-resources 'fix-dependencies
2884 (lambda* (#:key inputs #:allow-other-keys)
2885 (substitute* "build/build.xml"
2886 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
2887 (search-input-file inputs
2888 "/share/java/java-testng.jar"))
2889 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
2890 (search-input-file inputs
2891 (string-append
2892 "/share/java/commons-lang-"
2893 ,(package-version java-commons-lang)
2894 ".jar")))
2895 (("\\$\\{lib\\}/commons-io/commons-io.jar")
2896 (search-input-file inputs
2897 (string-append
2898 "/lib/m2/commons-io/commons-io/"
2899 ,(package-version java-commons-io)
2900 "/commons-io-"
2901 ,(package-version java-commons-io)
2902 ".jar")))
2903 ;; Remove dependency on svn
2904 (("<build-info.*") "")
2905 (("\\$\\{revision.number\\}")
2906 ,(number->string revision))
2907 (("\\$\\{version.number\\}") ,base-version))
2908 ;; Remove dependency on classycle
2909 (substitute* "../build_resources/ant/build-common.xml"
2910 (("<taskdef name=\"dependency-checker.*") "")
2911 (("classname=\"classycle.*") "")
2912 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
2913 #t))
2914 ;; A few tests fail because of the lack of a proper /etc/groups and
2915 ;; /etc/passwd file in the build container.
2916 (add-after 'unpack 'disable-broken-tests
2917 (lambda _
2918 (substitute* "sourceTest/java/ch/systemsx/cisd/base/AllTests.java"
2919 (("Unix.isOperational\\(\\)") "false"))
2920 #t))
2921 ;; These decorators are almost useless and pull in an unpackaged
2922 ;; dependency.
2923 (add-after 'unpack 'remove-useless-decorators
2924 (lambda _
2925 (substitute* "source/java/ch/systemsx/cisd/base/unix/Unix.java"
2926 (("@Private") "")
2927 (("import ch.rinn.restrictions.Private;") ""))
2928 (substitute* "sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java"
2929 (("@Friend.*") "")
2930 (("import ch.rinn.restrictions.Friend;") ""))
2931 #t))
2932 (add-before 'configure 'build-native-code
2933 (lambda* (#:key inputs #:allow-other-keys)
2934 (let ((jdk (assoc-ref inputs "jdk"))
2935 (dir ,(match (%current-system)
2936 ("i686-linux"
2937 "i386-Linux")
2938 ((or "armhf-linux" "aarch64-linux")
2939 "arm-Linux")
2940 ((or "x86_64-linux")
2941 "amd64-Linux")
2942 (_ "unknown-Linux"))))
2943 (with-directory-excursion "source/c"
2944 (invoke "gcc" "-shared" "-O3" "-fPIC" "unix.c"
2945 (string-append "-I" jdk "/include")
2946 (string-append "-I" jdk "/include/linux")
2947 "-o" "libunix.so")
2948 (invoke "gcc" "-shared" "-O3" "-fPIC"
2949 "-DMACHINE_BYTE_ORDER=1"
2950 "copyCommon.c"
2951 "copyByteChar.c"
2952 "copyByteDouble.c"
2953 "copyByteFloat.c"
2954 "copyByteInt.c"
2955 "copyByteLong.c"
2956 "copyByteShort.c"
2957 (string-append "-I" jdk "/include")
2958 (string-append "-I" jdk "/include/linux")
2959 "-o" "libnativedata.so"))
2960 (install-file "source/c/libunix.so"
2961 (string-append "libs/native/unix/" dir))
2962 (install-file "source/c/libnativedata.so"
2963 (string-append "libs/native/nativedata/" dir))
2964 #t)))
2965 ;; In the "check" phase we only build the test executable.
2966 (add-after 'check 'run-tests
2967 (lambda _
2968 (invoke "java" "-jar" "targets/dist/sis-base-test.jar")
2969 (delete-file "targets/dist/sis-base-test.jar")
2970 #t))
2971 (replace 'install (install-jars "targets/dist")))))
2972 (native-inputs
2973 `(("jdk" ,icedtea-8)
2974 ("java-commons-lang" ,java-commons-lang)
2975 ("java-commons-io" ,java-commons-io)
2976 ("java-testng" ,java-testng)
2977 ("build-resources"
2978 ,(origin
2979 (method svn-fetch)
2980 (uri (svn-reference
2981 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2982 "base/tags/release/"
2983 (version-major+minor base-version)
2984 ".x/" base-version
2985 "/build_resources/"))
2986 (revision revision)))
2987 (sha256
2988 (base32
2989 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
2990 (home-page "https://svnsis.ethz.ch")
2991 (synopsis "Utility classes for libraries from ETH Zurich")
2992 (description "This library supplies some utility classes needed for
2993libraries from the SIS division at ETH Zurich like jHDF5.")
2994 ;; The C sources are under a non-copyleft license, which looks like a
2995 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
2996 (license (list license:asl2.0
2997 (license:non-copyleft "file://source/c/COPYING"))))))
2998
2999(define-public java-cisd-args4j
3000 (let ((revision 39162)
3001 (base-version "9.11.2"))
3002 (package
3003 (name "java-cisd-args4j")
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 "args4j/tags/release/"
3010 (version-major+minor base-version)
3011 ".x/" base-version "/args4j/"))
3012 (revision revision)))
3013 (file-name (string-append "java-cisd-args4j-" version "-checkout"))
3014 (sha256
3015 (base32
3016 "0hhqznjaivq7ips7mkwas78z42s6djsm20rrs7g1zd59rcsakxn2"))))
3017 (build-system ant-build-system)
3018 (arguments
3019 `(#:make-flags '("-file" "build/build.xml")
3020 #:tests? #f ; there are no tests
3021 #:modules ((guix build ant-build-system)
3022 (guix build utils)
3023 (guix build java-utils)
3024 (sxml simple)
3025 (sxml transform)
3026 (sxml xpath))
3027 #:phases
3028 (modify-phases %standard-phases
3029 (add-after 'unpack 'unpack-build-resources
3030 (lambda* (#:key inputs #:allow-other-keys)
3031 (mkdir-p "../build_resources")
3032 (copy-recursively (assoc-ref inputs "build-resources")
3033 "../build_resources")
3034 (mkdir-p "../build_resources/lib")))
3035 (add-after 'unpack-build-resources 'fix-dependencies
3036 (lambda* (#:key inputs #:allow-other-keys)
3037 ;; FIXME: There should be a more convenient abstraction for
3038 ;; editing XML files.
3039 (with-directory-excursion "../build_resources/ant/"
3040 (chmod "build-common.xml" #o664)
3041 (call-with-output-file "build-common.xml.new"
3042 (lambda (port)
3043 (sxml->xml
3044 (pre-post-order
3045 (with-input-from-file "build-common.xml"
3046 (lambda _ (xml->sxml #:trim-whitespace? #t)))
3047 `(;; Remove dependency on classycle and custom ant tasks
3048 (taskdef . ,(lambda (tag . kids)
3049 (let ((name ((sxpath '(name *text*)) kids)))
3050 (if (or (member "build-info" name)
3051 (member "dependency-checker" name)
3052 (member "build-java-subprojects" name)
3053 (member "project-classpath" name))
3054 '() ; skip
3055 `(,tag ,@kids)))))
3056 (typedef . ,(lambda (tag . kids)
3057 (let ((name ((sxpath '(name *text*)) kids)))
3058 (if (member "recursive-jar" name)
3059 '() ; skip
3060 `(,tag ,@kids)))))
3061 (build-java-subprojects . ,(lambda _ '()))
3062 ;; Ignore everything else
3063 (*default* . ,(lambda (tag . kids) `(,tag ,@kids)))
3064 (*text* . ,(lambda (_ txt) txt))))
3065 port)))
3066 (rename-file "build-common.xml.new" "build-common.xml"))
3067 (substitute* "build/build.xml"
3068 (("\\$\\{lib\\}/cisd-base/cisd-base.jar")
3069 (search-input-file inputs "/share/java/sis-base.jar"))
3070 ;; Remove dependency on svn
3071 (("<build-info.*") "")
3072 (("\\$\\{revision.number\\}")
3073 ,(number->string revision))
3074 (("\\$\\{version.number\\}") ,base-version)
3075 ;; Don't use custom ant tasks.
3076 (("recursive-jar") "jar")
3077 (("<project-classpath.*") ""))))
3078 (replace 'install (install-jars "targets/dist")))))
3079 (inputs
3080 (list java-cisd-base))
3081 (native-inputs
3082 `(("ecj" ,java-ecj)
3083 ("build-resources"
3084 ,(origin
3085 (method svn-fetch)
3086 (uri (svn-reference
3087 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3088 "args4j/tags/release/"
3089 (version-major+minor base-version)
3090 ".x/" base-version
3091 "/build_resources/"))
3092 (revision revision)))
3093 (sha256
3094 (base32
3095 "056cam4k8pll7ass31sy6gwn8g8719njc41yf4l02b0342nilkyf"))
3096 (modules '((guix build utils)))
3097 ;; Delete bundled pre-built jars.
3098 (snippet
3099 '(begin (delete-file-recursively "lib/") #t))))))
3100 (home-page "https://svnsis.ethz.ch")
3101 (synopsis "Command line parser library")
3102 (description "This package provides a parser for command line arguments.")
3103 (license license:asl2.0))))
3104
3105(define-public java-cisd-jhdf5
3106 (let ((revision 39162)
3107 (base-version "14.12.6"))
3108 (package
3109 (name "java-cisd-jhdf5")
3110 (version (string-append base-version "-" (number->string revision)))
3111 (source (origin
3112 (method svn-fetch)
3113 (uri (svn-reference
3114 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3115 "jhdf5/tags/release/"
3116 (version-major+minor base-version)
3117 ".x/" base-version "/jhdf5/"))
3118 (revision revision)))
3119 (file-name (string-append "java-cisd-jhdf5-" version "-checkout"))
3120 (sha256
3121 (base32
3122 "13i17s2hn0q9drdqvp8csy7770p3hdbh9rp30ihln2ldkfawdmz0"))
3123 (modules '((guix build utils)))
3124 (snippet
3125 '(begin
3126 ;; Delete included gradle jar
3127 (delete-file-recursively "gradle/wrapper")
3128 ;; Delete pre-built native libraries
3129 (delete-file-recursively "libs")))))
3130 (build-system ant-build-system)
3131 (arguments
3132 `(#:make-flags '("-file" "build/build.xml")
3133 #:build-target "jar-all"
3134 #:test-target "jar-test"
3135 #:phases
3136 (modify-phases %standard-phases
3137 ;; FIXME: this build phase fails.
3138 (delete 'generate-jar-indices)
3139 ;; Don't erase results from the build phase when building tests.
3140 (add-after 'unpack 'separate-test-target-from-clean
3141 (lambda _
3142 (substitute* "build/build.xml"
3143 (("\"jar-test\" depends=\"clean, ")
3144 "\"jar-test\" depends=\""))))
3145 (add-after 'unpack 'unpack-build-resources
3146 (lambda* (#:key inputs #:allow-other-keys)
3147 (copy-recursively (assoc-ref inputs "build-resources")
3148 "../build_resources")
3149 (delete-file-recursively "../build_resources/lib/")
3150 (mkdir-p "../build_resources/lib")
3151 ;; Remove dependency on classycle
3152 (substitute* "../build_resources/ant/build-common.xml"
3153 (("<taskdef name=\"dependency-checker.*") "")
3154 (("classname=\"classycle.*") "")
3155 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
3156 ;; Remove dependency on svn
3157 (substitute* "build/build.xml"
3158 (("<build-info.*") "")
3159 (("\\$\\{revision.number\\}")
3160 ,(number->string revision))
3161 (("\\$\\{version.number\\}") ,base-version))))
3162 (add-after 'unpack-build-resources 'fix-dependencies
3163 (lambda* (#:key inputs #:allow-other-keys)
3164 (substitute* "../build_resources/ant/build-common.xml"
3165 (("../libraries/testng/testng-jdk15.jar")
3166 (search-input-file inputs
3167 "/share/java/java-testng.jar")))
3168 (substitute* "build/build.xml"
3169 (("\\$\\{lib\\}/sis-base/sis-base.jar")
3170 (search-input-file inputs
3171 "/share/java/sis-base.jar"))
3172 (("\\$\\{lib\\}/cisd-args4j/cisd-args4j.jar")
3173 (search-input-file inputs
3174 "/share/java/cisd-args4j.jar"))
3175 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
3176 (search-input-file inputs
3177 (string-append
3178 "/share/java/commons-lang-"
3179 ,(package-version java-commons-lang)
3180 ".jar")))
3181 (("\\$\\{lib\\}/commons-io/commons-io.jar")
3182 (search-input-file inputs
3183 (string-append
3184 "/lib/m2/commons-io/commons-io/"
3185 ,(package-version java-commons-io)
3186 "/commons-io-"
3187 ,(package-version java-commons-io)
3188 ".jar")))
3189 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
3190 (search-input-file inputs
3191 "/share/java/java-testng.jar"))
3192 (("\\$\\{lib\\}/junit4/junit.jar")
3193 (car (find-files (assoc-ref inputs "java-junit") "jar$")))
3194 (("\\$\\{lib\\}/jmock/hamcrest/hamcrest-core.jar")
3195 (car (find-files (assoc-ref inputs "java-hamcrest-core")
3196 "jar$"))))
3197 ;; Remove dependency on ch.rinn.restrictions
3198 (with-directory-excursion "source/java/ch/systemsx/cisd/hdf5/"
3199 (substitute* '("BitSetConversionUtils.java"
3200 "HDF5Utils.java")
3201 (("import ch.rinn.restrictions.Private;") "")
3202 (("@Private") "")))
3203 (with-directory-excursion "sourceTest/java/ch/systemsx/cisd/hdf5/"
3204 (substitute* '("BitSetConversionTest.java"
3205 "h5ar/HDF5ArchiverTest.java")
3206 (("import ch.rinn.restrictions.Friend;") "")
3207 (("@Friend.*") ""))
3208 ;; Remove leftovers from removing @Friend
3209 (substitute* "h5ar/HDF5ArchiverTest.java"
3210 (("\\{ HDF5Archiver.class, IdCache.class, LinkRecord.class \\}\\)")
3211 "")))))
3212 (add-before 'configure 'build-native-library
3213 (lambda* (#:key inputs #:allow-other-keys)
3214 (let ((jdk (assoc-ref inputs "jdk"))
3215 (hdf5 (assoc-ref inputs "hdf5"))
3216 (dir ,(match (%current-system)
3217 ("i686-linux"
3218 "i386-Linux")
3219 ((or "armhf-linux" "aarch64-linux")
3220 "arm-Linux")
3221 ((or "x86_64-linux")
3222 "amd64-Linux")
3223 (_ "unknown-Linux"))))
3224 (with-directory-excursion "source/c"
3225 (apply invoke `("gcc" "-shared" "-O3"
3226 "-fPIC"
3227 "-Wl,--exclude-libs,ALL"
3228 "-Wno-error=implicit-function-declaration"
3229 ,@(find-files "jhdf5" "\\.c$")
3230 ,@(find-files "hdf-java" "\\.c$")
3231 ,(string-append "-I" hdf5 "/include")
3232 ,(string-append "-I" jdk "/include")
3233 ,(string-append "-I" jdk "/include/linux")
3234 ,(string-append hdf5 "/lib/libhdf5.a")
3235 "-o" "libjhdf5.so" "-lz")))
3236 (install-file "source/c/libjhdf5.so"
3237 (string-append "libs/native/jhdf5/" dir)))))
3238 ;; In the "check" phase we only build the test executable.
3239 (add-after 'check 'run-tests
3240 (lambda _
3241 (invoke "java" "-jar" "targets/dist/sis-jhdf5-test.jar")
3242 (delete-file "targets/dist/sis-jhdf5-test.jar")))
3243 (replace 'install
3244 (install-jars "targets/dist")))))
3245 (inputs
3246 (list java-cisd-base
3247 java-cisd-args4j
3248 java-commons-lang
3249 java-commons-io
3250 hdf5-1.8
3251 zlib))
3252 (native-inputs
3253 `(("jdk" ,icedtea-8)
3254 ("java-testng" ,java-testng)
3255 ("java-junit" ,java-junit)
3256 ("java-jmock" ,java-jmock)
3257 ("java-hamcrest-core" ,java-hamcrest-core)
3258 ("build-resources"
3259 ,(origin
3260 (method svn-fetch)
3261 (uri (svn-reference
3262 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3263 "jhdf5/tags/release/"
3264 (version-major+minor base-version)
3265 ".x/" base-version
3266 "/build_resources/"))
3267 (revision revision)))
3268 (sha256
3269 (base32
3270 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
3271 (home-page "https://wiki-bsse.ethz.ch/display/JHDF5/")
3272 (synopsis "Java binding for HDF5")
3273 (description "JHDF5 is a high-level API in Java for reading and writing
3274HDF5 files, building on the libraries provided by the HDF Group.")
3275 ;; The C sources are under a non-copyleft license, which looks like a
3276 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
3277 (license (list license:asl2.0
3278 (license:non-copyleft "file://source/c/COPYING"))))))
3279
3280(define-public java-classpathx-servletapi
3281 (package
3282 (name "java-classpathx-servletapi")
3283 (version "3.0.1")
3284 (source (origin
3285 (method url-fetch)
3286 (uri (string-append "mirror://gnu/classpathx/servletapi/"
3287 "servletapi-" version ".tar.gz"))
3288 (sha256
3289 (base32
3290 "07d8h051siga2f33fra72hk12sbq1bxa4jifjg0qj0vfazjjff0x"))))
3291 (build-system ant-build-system)
3292 (arguments
3293 `(#:tests? #f ; there is no test target
3294 #:build-target "compile"
3295 #:make-flags
3296 ,#~(list "-Dbuild.compiler=javac1.8"
3297 (string-append "-Ddist=" #$output))
3298 #:phases
3299 (modify-phases %standard-phases
3300 (replace 'install
3301 (lambda* (#:key make-flags #:allow-other-keys)
3302 (apply invoke `("ant" "dist" ,@make-flags)))))))
3303 (home-page "https://www.gnu.org/software/classpathx/")
3304 (synopsis "Java servlet API implementation")
3305 (description "This is the GNU servlet API distribution, part of the
3306ClasspathX project. It provides implementations of version 3.0 of the servlet
3307API and version 2.1 of the Java ServerPages API.")
3308 (license license:gpl3+)))
3309
3310(define-public java-javaee-servletapi
3311 (package
3312 (name "java-javaee-servletapi")
3313 (version "3.1.0")
3314 (source (origin
3315 (method git-fetch)
3316 (uri (git-reference
3317 (url "https://github.com/javaee/servlet-spec")
3318 (commit version)))
3319 (file-name (git-file-name name version))
3320 (sha256
3321 (base32
3322 "0s03lj8w5an70lkqbjycgfrfk0kc07vbfav91jzk87gh3awf9ksl"))))
3323 (build-system ant-build-system)
3324 (arguments
3325 `(#:jar-name "javax-servletapi.jar"
3326 ;; no tests
3327 #:tests? #f
3328 #:source-dir "src/main/java"
3329 #:phases
3330 (modify-phases %standard-phases
3331 (add-before 'build 'copy-resources
3332 (lambda _
3333 (mkdir-p "build/classes/javax/servlet/http")
3334 (let ((from-prefix "src/main/java/javax/servlet/")
3335 (to-prefix "build/classes/javax/servlet/"))
3336 (for-each (lambda (f)
3337 (copy-file (string-append from-prefix f)
3338 (string-append to-prefix f)))
3339 (list "LocalStrings_ja.properties"
3340 "LocalStrings.properties"
3341 "LocalStrings_fr.properties"
3342 "http/LocalStrings_es.properties"
3343 "http/LocalStrings_ja.properties"
3344 "http/LocalStrings.properties"
3345 "http/LocalStrings_fr.properties")))
3346 #t)))))
3347 (native-inputs
3348 (list unzip))
3349 (home-page "https://javaee.github.io/servlet-spec/")
3350 (synopsis "Java servlet API")
3351 (description "Java Servlet is the foundation web specification in the
3352Java Enterprise Platform. Developers can build web applications using the
3353Servlet API to interact with the request/response workflow. This project
3354provides information on the continued development of the Java Servlet
3355specification.")
3356 ;; Main code is dual-licensed by Oracle under either GLP2 or CDDL 1.1.
3357 ;; Some files are licensed under ASL 2.0.
3358 (license (list license:asl2.0 license:gpl2 license:cddl1.1))))
3359
3360(define-public java-jsvg-1.6.1
3361 (package
3362 (name "java-jsvg")
3363 (version "1.6.1")
3364 (source
3365 (origin
3366 (method git-fetch)
3367 (uri (git-reference
3368 (url "https://github.com/weisJ/jsvg")
3369 (commit "v1.6.1-rc1")))
3370 (file-name (git-file-name name version))
3371 (sha256
3372 (base32 "0rcphd1596ps87q31qmksnh1nc4m1x1rrkn9amk3ggwy9l2pavsy"))
3373 (modules '((guix build utils)))
3374 (snippet
3375 ;; Remove @MustBeInvokedByOverriders annotations; not present
3376 ;; in java-jetbrains-annotations 19.0.0.
3377 ;; TODO: Update java-jetbrains-annotations to >= 20.0.0.
3378 '(begin
3379 (substitute* (find-files "." "\\.java$")
3380 (("import org\\.jetbrains\\.annotations\\.MustBeInvokedByOverriders;")
3381 "")
3382 (("@MustBeInvokedByOverriders") ""))
3383 #t))))
3384 (build-system ant-build-system)
3385 (arguments
3386 (list
3387 #:jdk openjdk17
3388 #:tests? #f
3389 ;; ant-build-system does not export a default-modules constant.
3390 #:modules '((guix build ant-build-system)
3391 (guix build java-utils)
3392 (guix build utils)
3393 (sxml simple))
3394 #:phases
3395 #~(modify-phases %standard-phases
3396 (replace 'build
3397 (lambda* (#:key inputs #:allow-other-keys)
3398 (let* ((src-dir "jsvg/src/main/java")
3399 (classes-dir "build/classes")
3400 (jar-file
3401 (string-append "build/jsvg-" #$version ".jar"))
3402 (annotations-cp
3403 (string-join
3404 (append
3405 (find-files (assoc-ref inputs
3406 "java-jetbrains-annotations")
3407 "\\.jar$")
3408 (find-files (assoc-ref inputs
3409 "java-error-prone-annotations")
3410 "\\.jar$"))
3411 ":")))
3412 (mkdir-p classes-dir)
3413 (apply invoke "javac"
3414 "--release" "11"
3415 "-cp" annotations-cp
3416 "-d" classes-dir
3417 (find-files src-dir "\\.java$"))
3418 (invoke "jar" "-cf" jar-file
3419 "-C" classes-dir "."))))
3420 (add-before 'build 'generate-pom
3421 (lambda _
3422 (call-with-output-file "pom.xml"
3423 (lambda (port)
3424 (sxml->xml
3425 `(*TOP*
3426 (*PI* xml "version=\"1.0\" encoding=\"UTF-8\"")
3427 (project
3428 (modelVersion "4.0.0")
3429 (groupId "com.github.weisj")
3430 (artifactId "jsvg")
3431 (version ,#$version)))
3432 port)))))
3433 (replace 'install
3434 (install-from-pom "pom.xml")))))
3435 (native-inputs
3436 (list java-jetbrains-annotations
3437 java-error-prone-annotations))
3438 (home-page "https://github.com/weisJ/jsvg")
3439 (synopsis "Java SVG rendering library")
3440 (description
3441 "JSVG is a Java library for rendering SVG images. It provides a
3442lightweight SVG parser and renderer using the Java2D API.")
3443 (license license:expat)))
3444
3445(define-public java-jtidy
3446 (package
3447 (name "java-jtidy")
3448 (version "8.0")
3449 (source
3450 (origin
3451 (method git-fetch)
3452 (uri (git-reference
3453 (url "https://github.com/jtidy/jtidy")
3454 (commit "r938")))
3455 (file-name (git-file-name name version))
3456 (sha256
3457 (base32 "1zksmvmrr10nzk5ya6sz0l8093yf3b08lkg76cn4fdv2jqm3cssp"))
3458 ;; Remove xerces:dom3-xml-apis dependency -- DOM Level 3 has been
3459 ;; part of the JDK since Java 5. install-from-pom calls
3460 ;; fix-pom-dependencies which throws no-such-input for
3461 ;; dependencies not in inputs and not test-scoped or optional.
3462 ;; A patch is used because programmatic removal does not work:
3463 ;;
3464 ;; - pre-post-order to filter the dependency from the parsed
3465 ;; SXML, then sxml->xml to write it back: xml->sxml expands
3466 ;; the default xmlns into long tag names like
3467 ;; http://maven.apache.org/POM/4.0.0:dependency, and
3468 ;; sxml->xml's check-name rejects symbols with more than
3469 ;; one colon ("Invalid QName").
3470 ;;
3471 ;; - fix-maven-xml from (guix build maven pom) strips those
3472 ;; namespace prefixes before sxml->xml, but it is not
3473 ;; exported.
3474 ;;
3475 ;; - fix-pom-dependencies #:excludes: the excludes parameter
3476 ;; only affects plugins (fix-plugins) and extensions
3477 ;; (fix-extensions), not dependencies -- fix-deps and
3478 ;; fix-dep do not check excludes.
3479 (patches
3480 (search-patches "java-jtidy-remove-xerces-dependency.patch"))))
3481 (build-system ant-build-system)
3482 (arguments
3483 (list
3484 #:jar-name "jtidy.jar"
3485 #:source-dir "src/main/java"
3486 #:test-dir "src/test"
3487 ;; Tests are disabled: upstream's pom.xml sets testFailureIgnore=true
3488 ;; because 140 of 216 .msg reference files have wrong expected message
3489 ;; counts -- the code changed but the test data was never updated.
3490 #:tests? #f
3491 #:phases
3492 #~(modify-phases %standard-phases
3493 (add-before 'build 'copy-resources
3494 (lambda _
3495 (copy-recursively "src/main/resources" "build/classes")))
3496 (replace 'install
3497 (install-from-pom "pom.xml")))))
3498 (inputs
3499 (list java-slf4j-api))
3500 (home-page "https://github.com/jtidy/jtidy")
3501 (synopsis "Java port of HTML Tidy, an HTML syntax checker and pretty printer")
3502 (description
3503 "JTidy is a Java port of HTML Tidy, a HTML syntax checker and pretty
3504printer. Like its non-Java cousin, JTidy can be used as a tool for cleaning
3505up malformed and faulty HTML. In addition, JTidy provides a DOM interface to
3506the document that is being processed, which effectively makes it a Java HTML
3507parser.")
3508 (license license:w3c)))
3509
3510(define-public java-swt
3511 (package
3512 (name "java-swt")
3513 (version "4.7.1a")
3514 (source
3515 ;; The types of many variables and procedures differ in the sources
3516 ;; dependent on whether the target architecture is a 32-bit system or a
3517 ;; 64-bit system. Instead of patching the sources on demand in a build
3518 ;; phase we download either the 32-bit archive (which mostly uses "int"
3519 ;; types) or the 64-bit archive (which mostly uses "long" types).
3520 (let ((hash32 "09q0cbh90d90q3a7dx9430kc4m6bijrkr4lajrmzzvi0jjdpq4v9")
3521 (hash64 "17k5hs75a87ssmc5xhwdfdm2gn4zba0r837l2455za01krnkaa2q")
3522 (file32 "x86")
3523 (file64 "x86_64"))
3524 (let-values (((hash file)
3525 (match (or (%current-target-system) (%current-system))
3526 ("x86_64-linux" (values hash64 file64))
3527 (_ (values hash32 file32)))))
3528 (origin
3529 (method url-fetch)
3530 (uri (string-append
3531 "https://archive.eclipse.org/eclipse/downloads/drops4/"
3532 "R-" version "-201710090410/swt-" version
3533 "-gtk-linux-" file ".zip"))
3534 (sha256 (base32 hash))))))
3535 (build-system ant-build-system)
3536 (arguments
3537 `(#:jar-name "swt.jar"
3538 #:jdk ,icedtea-8
3539 #:tests? #f ; no "check" target
3540 #:phases
3541 (modify-phases %standard-phases
3542 (replace 'unpack
3543 (lambda* (#:key source #:allow-other-keys)
3544 (mkdir "swt")
3545 (invoke "unzip" source "-d" "swt")
3546 (chdir "swt")
3547 (mkdir "src")
3548 (invoke "unzip" "src.zip" "-d" "src")))
3549 ;; The classpath contains invalid icecat jars. Since we don't need
3550 ;; anything other than the JDK on the classpath, we can simply unset
3551 ;; it.
3552 (add-after 'configure 'unset-classpath
3553 (lambda _ (unsetenv "CLASSPATH") #t))
3554 (add-before 'build 'build-native
3555 (lambda* (#:key inputs outputs #:allow-other-keys)
3556 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3557 ;; Build shared libraries. Users of SWT have to set the system
3558 ;; property swt.library.path to the "lib" directory of this
3559 ;; package output.
3560 (mkdir-p lib)
3561 (setenv "OUTPUT_DIR" lib)
3562 (setenv "CC" ,(cc-for-target))
3563 (with-directory-excursion "src"
3564 (invoke "bash" "build.sh")))))
3565 (add-after 'install 'install-native
3566 (lambda* (#:key outputs #:allow-other-keys)
3567 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3568 (for-each (lambda (file)
3569 (install-file file lib))
3570 (find-files "." "\\.so$"))
3571 #t))))))
3572 (inputs
3573 `(("gtk" ,gtk+-2)
3574 ("libxtst" ,libxtst)
3575 ("libxt" ,libxt)
3576 ("mesa" ,mesa)
3577 ("glu" ,glu)))
3578 (native-inputs
3579 (list pkg-config unzip))
3580 (home-page "https://www.eclipse.org/swt/")
3581 (synopsis "Widget toolkit for Java")
3582 (description
3583 "SWT is a widget toolkit for Java designed to provide efficient, portable
3584access to the user-interface facilities of the operating systems on which it
3585is implemented.")
3586 ;; SWT code is licensed under EPL1.0
3587 ;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
3588 ;; Cairo bindings contain code under MPL1.1
3589 ;; XULRunner 1.9 bindings contain code under MPL2.0
3590 (license (list
3591 license:epl1.0
3592 license:mpl1.1
3593 license:mpl2.0
3594 license:lgpl2.1+))))
3595
3596;; java-hamcrest-core uses qdox version 1.12. We package this version instead
3597;; of the latest release.
3598(define-public java-qdox-1.12
3599 (package
3600 (name "java-qdox")
3601 (version "1.12.1")
3602 (source (origin
3603 (method url-fetch)
3604 (uri (string-append "https://repo1.maven.org/maven2/"
3605 "com/thoughtworks/qdox/qdox/" version
3606 "/qdox-" version "-sources.jar"))
3607 (sha256
3608 (base32
3609 "0hlfbqq2avf5s26wxkksqmkdyk6zp9ggqn37c468m96mjv0n9xfl"))))
3610 (build-system ant-build-system)
3611 (arguments
3612 `(;; Tests require junit
3613 #:tests? #f
3614 #:jar-name "qdox.jar"
3615 ;; Explicitely use an ant version that includes the junit tasks, since
3616 ;; it is a dependency of junit.
3617 #:ant ,ant/java7
3618 #:phases
3619 (modify-phases %standard-phases
3620 (replace 'unpack
3621 (lambda* (#:key source #:allow-other-keys)
3622 (mkdir "src")
3623 (with-directory-excursion "src"
3624 (invoke "jar" "-xf" source))))
3625 ;; At this point we don't have junit, so we must remove the API
3626 ;; tests.
3627 (add-after 'unpack 'delete-tests
3628 (lambda _
3629 (delete-file-recursively "src/com/thoughtworks/qdox/junit")
3630 #t)))))
3631 (home-page "https://github.com/codehaus/qdox")
3632 (synopsis "Parse definitions from Java source files")
3633 (description
3634 "QDox is a high speed, small footprint parser for extracting
3635class/interface/method definitions from source files complete with JavaDoc
3636@code{@@tags}. It is designed to be used by active code generators or
3637documentation tools.")
3638 (license license:asl2.0)))
3639
3640(define-public java-qdox
3641 (package
3642 (name "java-qdox")
3643 ; Newer version exists, but this version is required by java-plexus-component-metadata
3644 (version "2.0-M2")
3645 (source (origin
3646 (method url-fetch)
3647 ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
3648 ;; Older releases at https://github.com/codehaus/qdox/
3649 ;; Note: The release at maven is pre-generated. The release at
3650 ;; github requires jflex.
3651 (uri (string-append "https://repo1.maven.org/maven2/"
3652 "com/thoughtworks/qdox/qdox/" version
3653 "/qdox-" version "-sources.jar"))
3654 (sha256
3655 (base32
3656 "10xxrcaicq6axszcr2jpygisa4ch4sinyx5q7kqqxv4lknrmxp5x"))))
3657 (build-system ant-build-system)
3658 (arguments
3659 `(#:jar-name "qdox.jar"
3660 #:tests? #f; no tests
3661 #:phases
3662 (modify-phases %standard-phases
3663 (add-before 'install 'create-pom
3664 (generate-pom.xml "pom.xml" "com.thoughtworks.qdox" "qdox" ,version
3665 #:name "QDox"))
3666 (replace 'install
3667 (install-from-pom "pom.xml")))))
3668 (home-page "https://github.com/codehaus/qdox")
3669 (synopsis "Parse definitions from Java source files")
3670 (description "QDox is a high speed, small footprint parser for extracting
3671class/interface/method definitions from source files complete with JavaDoc
3672@code{@@tags}. It is designed to be used by active code generators or
3673documentation tools.")
3674 (license license:asl2.0)))
3675
3676(define-public java-qdox-2-M9
3677 (package
3678 (inherit java-qdox)
3679 (version "2.0-M9"); required by plexus-java
3680 (source (origin
3681 (method url-fetch)
3682 ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
3683 ;; Older releases at https://github.com/codehaus/qdox/
3684 ;; Note: The release at maven is pre-generated. The release at
3685 ;; github requires jflex.
3686 (uri (string-append "https://repo1.maven.org/maven2/"
3687 "com/thoughtworks/qdox/qdox/" version
3688 "/qdox-" version "-sources.jar"))
3689 (sha256
3690 (base32
3691 "1s2jnmx2dkwnaha12lcj26aynywgwa8sslc47z82wx8xai13y4fg"))))
3692 (arguments
3693 (substitute-keyword-arguments (package-arguments java-qdox)
3694 ((#:phases phases)
3695 `(modify-phases ,phases
3696 (replace 'create-pom
3697 (generate-pom.xml "pom.xml" "com.thoughtworks.qdox" "qdox" ,version
3698 #:name "QDox"))))))))
3699
3700(define-public java-jarjar
3701 (package
3702 (name "java-jarjar")
3703 (version "1.4")
3704 (source (origin
3705 (method url-fetch)
3706 (uri (string-append
3707 "https://storage.googleapis.com/google-code-archive-downloads/v2/"
3708 "code.google.com/jarjar/jarjar-src-" version ".zip"))
3709 (sha256
3710 (base32
3711 "1v8irhni9cndcw1l1wxqgry013s2kpj0qqn57lj2ji28xjq8ndjl"))
3712 (modules '((guix build utils)))
3713 (snippet
3714 '(begin
3715 ;; Delete bundled thirds-party jar archives.
3716 (delete-file-recursively "lib")
3717 (delete-file "src/test/enumtest.jar")
3718 ;; the CLASSPATH needs this directory, create an empty one
3719 (mkdir-p "lib")
3720 #t))))
3721 (build-system ant-build-system)
3722 (arguments
3723 `(;; Tests require junit, which ultimately depends on this package.
3724 #:tests? #f
3725 #:build-target "jar"
3726 ;; Explicitely use an ant version that includes the junit tasks, since
3727 ;; it is a dependency of junit.
3728 #:ant ,ant/java7
3729 #:phases
3730 (modify-phases %standard-phases
3731 (add-before 'build 'do-not-use-bundled-asm
3732 (lambda* (#:key inputs #:allow-other-keys)
3733 (substitute* "build.xml"
3734 (("<path id=\"path.build\">")
3735 (string-append "<path id=\"path.build\"><fileset dir=\""
3736 (assoc-ref inputs "java-asm-bootstrap")
3737 "/lib/m2\" includes=\"**/*.jar\"/>"))
3738 (("<zipfileset src=\"lib/asm-4.0.jar\"/>") "")
3739 (("lib/asm-commons-4.0.jar")
3740 (car (find-files (assoc-ref inputs "java-asm-bootstrap")
3741 "asm-6.0.jar")))
3742 (("<include name=\"org/objectweb/asm/commons/Remap\\*\\.class\"/>")
3743 (string-append "<include name=\"org/objectweb/asm/"
3744 "commons/Remap*.class\"/>"
3745 "<include name=\"org/objectweb/asm/*.class\"/>"
3746 "<include name=\"org/objectweb/asm/"
3747 "signature/*.class\"/>"
3748 "<include name=\"org/objectweb/asm/"
3749 "commons/SignatureRemapper.class\"/>")))
3750 #t))
3751 (add-before 'build 'remove-maven-dependency
3752 (lambda _
3753 ;; We do not need to build jarjar as a maven plugin just yet, so
3754 ;; remove this file. Maven requires jarjar (but not that plugin),
3755 ;; so removing it improves the bootstrap.
3756 (delete-file "src/main/com/tonicsystems/jarjar/JarJarMojo.java")
3757 #t))
3758 (replace 'install
3759 (lambda* (#:key outputs #:allow-other-keys)
3760 (let ((target (string-append (assoc-ref outputs "out")
3761 "/share/java")))
3762 (install-file (string-append "dist/jarjar-" ,version ".jar")
3763 target))
3764 #t)))))
3765 (inputs
3766 (list java-asm-bootstrap))
3767 (native-inputs
3768 (list unzip))
3769 (home-page "https://code.google.com/archive/p/jarjar/")
3770 (synopsis "Repackage Java libraries")
3771 (description
3772 "Jar Jar Links is a utility that makes it easy to repackage Java
3773libraries and embed them into your own distribution. Jar Jar Links includes
3774an Ant task that extends the built-in @code{jar} task.")
3775 (license license:asl2.0)))
3776
3777(define-public java-hamcrest
3778 (package
3779 (name "java-hamcrest")
3780 (version "3.0")
3781 (source (origin
3782 (method git-fetch)
3783 (uri (git-reference
3784 (url "https://github.com/hamcrest/JavaHamcrest/")
3785 (commit (string-append "v" version))))
3786 (file-name (git-file-name name version))
3787 (sha256
3788 (base32
3789 "07cagv2ncs4y02fmwbll3r4rqpjf3zxs163ync24q3x9fplrxmly"))))
3790 (build-system ant-build-system)
3791 (arguments
3792 `(#:tests? #f ; Tests require junit
3793 #:source-dir "hamcrest/src/main"
3794 #:jar-name "hamcrest.jar"))
3795 (home-page "https://hamcrest.org/")
3796 (synopsis "Library of matchers for building test expressions")
3797 (description
3798 "This package provides a library of matcher objects (also known as
3799constraints or predicates) allowing @code{match} rules to be defined
3800declaratively, to be used in other frameworks. Typical scenarios include
3801testing frameworks, mocking libraries and UI validation rules.")
3802 (license license:bsd-3)))
3803
3804(define-public java-hamcrest-core
3805 (package
3806 (name "java-hamcrest-core")
3807 (version "1.3")
3808 (properties `((superseded . ,java-hamcrest)))
3809 (source (origin
3810 (method git-fetch)
3811 (uri (git-reference
3812 (url "https://github.com/hamcrest/JavaHamcrest/")
3813 (commit (string-append "hamcrest-java-" version))))
3814 (file-name (git-file-name name version))
3815 (sha256
3816 (base32
3817 "16fxxkrd31ahqvcaby30jgh3z1i0zxh51m24hxgz0z2agxj6bc63"))
3818 (modules '((guix build utils)))
3819 (snippet
3820 '(begin
3821 ;; Delete bundled thirds-party jar archives.
3822 (delete-file-recursively "lib")
3823 #t))))
3824 (build-system ant-build-system)
3825 (arguments
3826 `(#:tests? #f ; Tests require junit
3827 ;; Explicitely use an ant version that includes the junit tasks, since
3828 ;; it is a dependency of junit.
3829 #:ant ,ant/java7
3830 #:modules ((guix build ant-build-system)
3831 (guix build java-utils)
3832 (guix build utils)
3833 (srfi srfi-1))
3834 #:make-flags (list (string-append "-Dversion=" ,version))
3835 #:test-target "unit-test"
3836 #:build-target "core"
3837 #:phases
3838 (modify-phases %standard-phases
3839 ;; Disable unit tests, because they require junit, which requires
3840 ;; hamcrest-core. We also give a fixed value to the "Built-Date"
3841 ;; attribute from the manifest for reproducibility.
3842 (add-before 'configure 'patch-build.xml
3843 (lambda _
3844 (substitute* "build.xml"
3845 (("unit-test, ") "")
3846 (("\\$\\{build.timestamp\\}") "guix"))
3847 #t))
3848 ;; Java's "getMethods()" returns methods in an unpredictable order.
3849 ;; To make the output of the generated code deterministic we must
3850 ;; sort the array of methods.
3851 (add-after 'unpack 'make-method-order-deterministic
3852 (lambda _
3853 (substitute* "hamcrest-generator/src/main/java/org/hamcrest/generator/ReflectiveFactoryReader.java"
3854 (("import java\\.util\\.Iterator;" line)
3855 (string-append line "\n"
3856 "import java.util.Arrays; import java.util.Comparator;"))
3857 (("allMethods = cls\\.getMethods\\(\\);" line)
3858 (string-append "_" line
3859 "
3860private Method[] getSortedMethods() {
3861 Arrays.sort(_allMethods, new Comparator<Method>() {
3862 @Override
3863 public int compare(Method a, Method b) {
3864 return a.toString().compareTo(b.toString());
3865 }
3866 });
3867 return _allMethods;
3868}
3869
3870private Method[] allMethods = getSortedMethods();")))
3871 #t))
3872 (add-before 'build 'do-not-use-bundled-qdox
3873 (lambda* (#:key inputs #:allow-other-keys)
3874 (substitute* "build.xml"
3875 (("lib/generator/qdox-1.12.jar")
3876 (string-append (assoc-ref inputs "java-qdox-1.12")
3877 "/share/java/qdox.jar")))
3878 #t))
3879 ;; build.xml searches for .jar files in this directoy, which
3880 ;; we remove from the source archive.
3881 (add-before 'build 'create-dummy-directories
3882 (lambda _
3883 (mkdir-p "lib/integration")
3884 #t))
3885 (add-before 'build 'create-pom
3886 (lambda _
3887 (substitute* "pom/hamcrest-core.pom"
3888 (("@VERSION@") ,version))
3889 #t))
3890 (replace 'install
3891 (install-from-pom "pom/hamcrest-core.pom")))))
3892 (native-inputs
3893 `(("java-qdox-1.12" ,java-qdox-1.12)
3894 ("java-jarjar" ,java-jarjar)))
3895 (propagated-inputs
3896 (list java-hamcrest-parent-pom))
3897 (home-page "https://hamcrest.org/")
3898 (synopsis "Library of matchers for building test expressions")
3899 (description
3900 "This package provides a library of matcher objects (also known as
3901constraints or predicates) allowing @code{match} rules to be defined
3902declaratively, to be used in other frameworks. Typical scenarios include
3903testing frameworks, mocking libraries and UI validation rules.")
3904 (license license:bsd-2)))
3905
3906(define-public java-hamcrest-parent-pom
3907 (package
3908 (inherit java-hamcrest-core)
3909 (properties '((hidden? . #t)))
3910 (name "java-hamcrest-parent-pom")
3911 (propagated-inputs '())
3912 (native-inputs '())
3913 (arguments
3914 `(#:tests? #f
3915 ;; Explicitely use an ant version that includes the junit tasks, since
3916 ;; it is a dependency of junit.
3917 #:ant ,ant/java7
3918 #:phases
3919 (modify-phases %standard-phases
3920 (delete 'configure)
3921 (replace 'build
3922 (lambda _
3923 (substitute* "pom/hamcrest-parent.pom"
3924 (("@VERSION@") ,(package-version java-hamcrest-core)))
3925 #t))
3926 (replace 'install
3927 (install-pom-file "pom/hamcrest-parent.pom")))))))
3928
3929(define-public java-hamcrest-library
3930 (package
3931 (inherit java-hamcrest-core)
3932 (name "java-hamcrest-library")
3933 (properties `((superseded . ,java-hamcrest)))
3934 (arguments
3935 (substitute-keyword-arguments (package-arguments java-hamcrest-core)
3936 ((#:build-target _) "library")
3937 ((#:phases phases)
3938 `(modify-phases ,phases
3939 (add-after 'unpack 'patch-classpath-for-integration
3940 (lambda* (#:key inputs #:allow-other-keys)
3941 (substitute* "build.xml"
3942 (("build/hamcrest-core-\\$\\{version\\}\\.jar")
3943 (car (find-files (assoc-ref inputs "java-hamcrest-core")
3944 "jar$"))))
3945 #t))
3946 (replace 'create-pom
3947 (lambda _
3948 (substitute* "pom/hamcrest-library.pom"
3949 (("@VERSION@") ,(package-version java-hamcrest-core)))
3950 #t))
3951 (replace 'install
3952 (install-from-pom "pom/hamcrest-library.pom"))))))
3953 (propagated-inputs
3954 (list java-hamcrest-core java-hamcrest-parent-pom))))
3955
3956(define-public java-junit
3957 (package
3958 (name "java-junit")
3959 (version "4.13.2")
3960 (source (origin
3961 (method git-fetch)
3962 (uri (git-reference
3963 (url "https://github.com/junit-team/junit/")
3964 (commit (string-append "r" version))))
3965 (file-name (git-file-name name version))
3966 (sha256
3967 (base32
3968 "1r7k4zzscc8019np3is3bzfigw8fxd6s3259cbhzzh02q6d5p9h3"))
3969 (modules '((guix build utils)))
3970 (snippet
3971 '(begin
3972 ;; Delete bundled jar archives.
3973 (delete-file-recursively "lib")
3974 #t))))
3975 (build-system ant-build-system)
3976 (arguments
3977 `(#:jar-name "junit.jar"
3978 #:source-dir "src/main/java"
3979 #:test-dir "src/test"
3980 ;; Explicitely use an ant version that includes the junit tasks, so
3981 ;; we can run the tests.
3982 #:ant ,ant/java7
3983 #:test-exclude (list "**/SimpleTest.java" "**/StackTracesTest.java"
3984 "**/RuleChainTest.java" "**/TestWatchmanTest.java")
3985 #:phases
3986 (modify-phases %standard-phases
3987 (add-before 'check 'copy-test-resources
3988 (lambda _
3989 (copy-recursively "src/test/resources" "build/test-classes")
3990 #t))
3991 (replace 'install
3992 (install-from-pom "pom.xml")))))
3993 (propagated-inputs
3994 (list java-hamcrest-core))
3995 (native-inputs
3996 (list java-hamcrest-library))
3997 (home-page "https://junit.org/junit4/")
3998 (synopsis "Test framework for Java")
3999 (description
4000 "JUnit is a simple framework to write repeatable tests for Java projects.
4001JUnit provides assertions for testing expected results, test fixtures for
4002sharing common test data, and test runners for running tests.")
4003 (license license:epl1.0)))
4004
4005(define-public java-junit-4.13.2
4006 (package
4007 (inherit java-junit)
4008 (name "java-junit")
4009 (version "4.13.2")
4010 (source
4011 (origin
4012 (method git-fetch)
4013 (uri (git-reference
4014 (url "https://github.com/junit-team/junit/")
4015 (commit (string-append "r" version))))
4016 (file-name (git-file-name "java-junit" version))
4017 (sha256
4018 (base32 "1r7k4zzscc8019np3is3bzfigw8fxd6s3259cbhzzh02q6d5p9h3"))))
4019 (propagated-inputs
4020 (list java-hamcrest))))
4021
4022(define-public java-junitparams
4023 (package
4024 (name "java-junitparams")
4025 (version "1.1.1")
4026 (source (origin
4027 (method git-fetch)
4028 (uri (git-reference
4029 (url "https://github.com/Pragmatists/JUnitParams")
4030 (commit (string-append "JUnitParams-" version))))
4031 (file-name (git-file-name name version))
4032 (sha256
4033 (base32
4034 "0rb52xdfp99invyjrras3w0bf0a81cz30yd47rkkiyqcqj0y1q9b"))))
4035 (build-system ant-build-system)
4036 (arguments
4037 `(#:jar-name "junitparams.jar"
4038 #:source-dir "src/main/java"
4039 #:test-dir "src/test"
4040 #:test-exclude (list
4041 ;; Abstract class: no tests
4042 "**/SuperclassTest.java"
4043 ;; Incompatible tests with junit 4.13.2
4044 "**/BeforeAfterClassTest.java"
4045 "**/FilterableTest.java"
4046 "**/RulesTest.java")))
4047 (inputs
4048 (list java-junit))
4049 (native-inputs
4050 (list java-junit java-hamcrest-core java-assertj))
4051 (home-page "https://github.com/Pragmatists/JUnitParams")
4052 (synopsis "Parameterised test support for JUnit")
4053 (description "The JUnitParams project adds a new runner to JUnit and
4054provides much easier and readable parametrised tests for JUnit.")
4055 (license license:asl2.0)))
4056
4057(define-public java-plexus-utils
4058 (package
4059 (name "java-plexus-utils")
4060 (version "3.3.0")
4061 (source (origin
4062 (method git-fetch)
4063 (uri (git-reference
4064 (url "https://github.com/codehaus-plexus/plexus-utils")
4065 (commit (string-append "plexus-utils-" version))))
4066 (file-name (git-file-name name version))
4067 (sha256
4068 (base32
4069 "0d0fq21rzjy0j55kcp8w9k1rbq9rwr0r7cc8239p9jbz54vihp0g"))))
4070 (build-system ant-build-system)
4071 ;; FIXME: The default build.xml does not include a target to install
4072 ;; javadoc files.
4073 (arguments
4074 `(#:jar-name "plexus-utils.jar"
4075 #:source-dir "src/main"
4076 #:phases
4077 (modify-phases %standard-phases
4078 (add-after 'unpack 'fix-reference-to-/bin-and-/usr
4079 (lambda _
4080 (substitute* "src/main/java/org/codehaus/plexus/util/\
4081cli/shell/BourneShell.java"
4082 (("/bin/sh") (which "sh"))
4083 (("/usr/") (getcwd)))
4084 #t))
4085 (add-after 'unpack 'fix-or-disable-broken-tests
4086 (lambda _
4087 (with-directory-excursion "src/test/java/org/codehaus/plexus/util"
4088 (substitute* '("cli/CommandlineTest.java"
4089 "cli/shell/BourneShellTest.java")
4090 (("/bin/sh") (which "sh"))
4091 (("/bin/echo") (which "echo")))
4092
4093 ;; This test depends on MavenProjectStub, but we don't have
4094 ;; a package for Maven.
4095 (delete-file "introspection/ReflectionValueExtractorTest.java")
4096
4097 ;; FIXME: The command line tests fail, maybe because they use
4098 ;; absolute paths.
4099 (delete-file "cli/CommandlineTest.java")
4100
4101 ;; These tests require openjdk jmh, which is not packaged yet
4102 (for-each delete-file (find-files "." "PerfTest.java$")))
4103 #t))
4104 (add-before 'build 'copy-resources
4105 (lambda _
4106 (copy-recursively "src/main/resources" "build/classes")
4107 #t))
4108 (replace 'install (install-from-pom "pom.xml")))))
4109 (native-inputs
4110 (list java-hamcrest-core java-junit))
4111 (propagated-inputs
4112 (list plexus-parent-pom-5.1))
4113 (home-page "https://codehaus-plexus.github.io/plexus-utils/")
4114 (synopsis "Common utilities for the Plexus framework")
4115 (description "This package provides various Java utility classes for the
4116Plexus framework to ease working with strings, files, command lines, XML and
4117more.")
4118 (license license:asl2.0)))
4119
4120(define-public java-plexus-utils-3.2.1
4121 (package
4122 (inherit java-plexus-utils)
4123 ;; plexus-build-api needs this version, later versions don't work
4124 (version "3.2.1")
4125 (source (origin
4126 (method git-fetch)
4127 (uri (git-reference
4128 (url "https://github.com/codehaus-plexus/plexus-utils")
4129 (commit (string-append "plexus-utils-" version))))
4130 (file-name (git-file-name "java-plexus-utils" version))
4131 (sha256
4132 (base32
4133 "1w169glixyk94jbczj8jzg897lsab46jihiaa3dhw0p06g35va8b"))))))
4134
4135(define-public java-plexus-interpolation
4136 (package
4137 (name "java-plexus-interpolation")
4138 (version "1.26")
4139 (source (origin
4140 (method git-fetch)
4141 (uri (git-reference
4142 (url "https://github.com/codehaus-plexus/plexus-interpolation")
4143 (commit (string-append "plexus-interpolation-" version))))
4144 (file-name (git-file-name name version))
4145 (sha256
4146 (base32
4147 "1rahjmhywf6d5m32qzlc9izawyvcd71abfm9k03f13rs2xmfxzlh"))))
4148 (build-system ant-build-system)
4149 (arguments
4150 `(#:jar-name "plexus-interpolation.jar"
4151 #:source-dir "src/main"
4152 #:phases
4153 (modify-phases %standard-phases
4154 (replace 'install (install-from-pom "pom.xml")))))
4155 (propagated-inputs
4156 `(("plexus-parent-pom-5.1" ,plexus-parent-pom-5.1)))
4157 (native-inputs
4158 (list java-junit java-hamcrest-core))
4159 (home-page "https://codehaus-plexus.github.io/plexus-interpolation/")
4160 (synopsis "Java components for interpolating ${} strings and the like")
4161 (description "Plexus interpolator is a modular, flexible interpolation
4162framework for the expression language style commonly seen in Maven, Plexus,
4163and other related projects.
4164
4165It has its foundation in the @code{org.codehaus.plexus.utils.interpolation}
4166package within @code{plexus-utils}, but has been separated in order to allow
4167these two libraries to vary independently of one another.")
4168 (license license:asl2.0)))
4169
4170(define-public java-plexus-classworlds
4171 (package
4172 (name "java-plexus-classworlds")
4173 (version "2.6.0")
4174 (source (origin
4175 (method git-fetch)
4176 (uri (git-reference
4177 (url "https://github.com/codehaus-plexus/plexus-classworlds")
4178 (commit (string-append "plexus-classworlds-" version))))
4179 (file-name (git-file-name name version))
4180 (sha256
4181 (base32
4182 "034k2hgvj1saalwbnzrbg4n0zgzwcpz1lhlb8q4kgglsp9pmm03s"))))
4183 (build-system ant-build-system)
4184 (arguments
4185 `(#:jar-name "plexus-classworlds.jar"
4186 #:source-dir "src/main"
4187 #:tests? #f;; FIXME: we need to generate some resources as in pom.xml
4188 #:phases
4189 (modify-phases %standard-phases
4190 (replace 'install (install-from-pom "pom.xml")))))
4191 (propagated-inputs
4192 `(("plexus-parent-pom-5.1" ,plexus-parent-pom-5.1)))
4193 (native-inputs
4194 (list java-junit))
4195 (home-page "https://codehaus-plexus.github.io/plexus-classworlds/")
4196 (synopsis "Java class loader framework")
4197 (description "Plexus classworlds replaces the native @code{ClassLoader}
4198mechanism of Java. It is especially useful for dynamic loading of application
4199components.")
4200 (license license:asl2.0)))
4201
4202(define-public java-plexus-container-default-bootstrap
4203 (package
4204 (name "java-plexus-container-default-bootstrap")
4205 (version "2.1.0")
4206 (source (origin
4207 (method git-fetch)
4208 (uri (git-reference
4209 (url "https://github.com/codehaus-plexus/plexus-containers")
4210 (commit (string-append "plexus-containers-" version))))
4211 (file-name (git-file-name name version))
4212 (sha256
4213 (base32
4214 "0r9yq67c1hvi1pz5wmx6x6hk5fmavp8a7yal3j5hkaad757firn1"))))
4215 (build-system ant-build-system)
4216 (arguments
4217 `(#:jar-name "container-default.jar"
4218 #:source-dir "plexus-container-default/src/main/java"
4219 #:test-dir "plexus-container-default/src/test"
4220 #:tests? #f; requires plexus-archiver, which depends on this package
4221 #:phases
4222 (modify-phases %standard-phases
4223 (add-before 'build 'fix-google-collections
4224 (lambda _
4225 ;; Google collections are now replaced with guava
4226 (substitute* "plexus-container-default/pom.xml"
4227 (("google-collections") "guava")
4228 (("com.google.collections") "com.google.guava"))
4229 #t))
4230 (add-before 'build 'copy-resources
4231 (lambda _
4232 (copy-recursively
4233 "plexus-container-default/src/main/resources/"
4234 "build/classes")
4235 #t))
4236 (replace 'install
4237 (install-from-pom "plexus-container-default/pom.xml")))))
4238 (propagated-inputs
4239 `(("java-plexus-worldclass" ,java-plexus-classworlds)
4240 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
4241 ("java-plexus-utils" ,java-plexus-utils)
4242 ("java-junit" ,java-junit)
4243 ("java-guava" ,java-guava)
4244 ("java-plexus-containers-parent-pom" ,java-plexus-containers-parent-pom)))
4245 (home-page "https://github.com/codehaus-plexus/plexus-containers")
4246 (synopsis "Inversion-of-control container")
4247 (description "Plexus-default-container is Plexus' inversion-of-control
4248(@dfn{IoC}) container. It is composed of its public API and its default
4249implementation.")
4250 (properties '((hidden? . #t))) ;for bootstrapping purposes only
4251 (license license:asl2.0)))
4252
4253(define java-plexus-containers-parent-pom
4254 (package
4255 (inherit java-plexus-container-default-bootstrap)
4256 (name "java-plexus-containers-parent-pom")
4257 (arguments
4258 `(#:tests? #f
4259 #:phases
4260 (modify-phases %standard-phases
4261 (delete 'configure)
4262 (delete 'build)
4263 (replace 'install
4264 (install-pom-file "pom.xml")))))
4265 (propagated-inputs
4266 `(("plexus-parent-pom" ,plexus-parent-pom-4.0)))))
4267
4268(define-public java-plexus-io
4269 (package
4270 (name "java-plexus-io")
4271 (version "3.2.0")
4272 (source (origin
4273 (method git-fetch)
4274 (uri (git-reference
4275 (url "https://github.com/codehaus-plexus/plexus-io")
4276 (commit (string-append "plexus-io-" version))))
4277 (file-name (git-file-name name version))
4278 (sha256
4279 (base32
4280 "1r3wqfpbxq8vp4p914i8p88r0994rmcjw02hz14n11cfb6gsyvlr"))))
4281 (build-system ant-build-system)
4282 (arguments
4283 `(#:jar-name "plexus-io.jar"
4284 #:source-dir "src/main/java"
4285 #:test-dir "src/test"
4286 #:phases
4287 (modify-phases %standard-phases
4288 (add-before 'build 'copy-resources
4289 (lambda _
4290 (mkdir-p "build/classes")
4291 (copy-recursively "src/main/resources" "build/classes")
4292 (mkdir-p "build/test-classes")
4293 (copy-recursively "src/test/resources" "build/test-classes")
4294 #t))
4295 (replace 'install (install-from-pom "pom.xml")))))
4296 (propagated-inputs
4297 (list java-plexus-utils java-commons-io plexus-parent-pom-5.1))
4298 (inputs
4299 (list java-jsr305))
4300 (native-inputs
4301 `(("junit" ,java-junit)
4302 ("hamcrest" ,java-hamcrest-core)
4303 ("guava" ,java-guava)
4304 ("classworlds" ,java-plexus-classworlds)
4305 ("xbean" ,java-geronimo-xbean-reflect)
4306 ("container-default" ,java-plexus-container-default-bootstrap)))
4307 (home-page "https://github.com/codehaus-plexus/plexus-io")
4308 (synopsis "I/O plexus components")
4309 (description "Plexus IO is a set of plexus components, which are designed
4310for use in I/O operations. This implementation using plexus components allows
4311reusing it in maven.")
4312 (license license:asl2.0)))
4313
4314(define-public java-plexus-archiver
4315 (package
4316 (name "java-plexus-archiver")
4317 (version "4.2.2")
4318 (source (origin
4319 (method url-fetch)
4320 (uri (string-append "https://github.com/codehaus-plexus/plexus-archiver"
4321 "/archive/plexus-archiver-" version ".tar.gz"))
4322 (sha256
4323 (base32
4324 "144n971r3lfrx3l12nf2scm80x4xdvgbkk4bjpa4vcvvdrll6qys"))))
4325 (build-system ant-build-system)
4326 (arguments
4327 `(#:jar-name "plexus-archiver.jar"
4328 #:source-dir "src/main/java"
4329 #:test-dir "src/test"
4330 #:test-exclude (list "**/Abstract*.java" "**/Base*.java")
4331 #:phases
4332 (modify-phases %standard-phases
4333 (add-before 'check 'remove-failing
4334 (lambda _
4335 ;; Requires an older version of plexus container
4336 (delete-file
4337 "src/test/java/org/codehaus/plexus/archiver/DuplicateFilesTest.java")
4338 #t))
4339 (add-before 'check 'fix-test-building
4340 (lambda _
4341 (substitute* "build.xml"
4342 (("srcdir=\"src/test\"") "srcdir=\"src/test/java\""))
4343 #t))
4344 (add-before 'build 'copy-resources
4345 (lambda _
4346 (mkdir-p "build/classes")
4347 (copy-recursively "src/main/resources" "build/classes")
4348 (mkdir-p "build/test-classes")
4349 (copy-recursively "src/test/resources" "build/test-classes")
4350 #t))
4351 (replace 'install (install-from-pom "pom.xml")))))
4352 (propagated-inputs
4353 (list java-plexus-utils java-plexus-io java-iq80-snappy
4354 java-commons-compress-1.21 plexus-parent-pom-6.1))
4355 (inputs
4356 `(("java-jsr305" ,java-jsr305)
4357 ("java-plexus-container-default"
4358 ,java-plexus-container-default-bootstrap)))
4359 (native-inputs
4360 `(("java-hamcrest-core" ,java-hamcrest-core)
4361 ("junit" ,java-junit)
4362 ("classworld" ,java-plexus-classworlds)
4363 ("xbean" ,java-geronimo-xbean-reflect)
4364 ("xz" ,java-xz)
4365 ("guava" ,java-guava)))
4366 (home-page "https://github.com/codehaus-plexus/plexus-archiver")
4367 (synopsis "Archiver component of the Plexus project")
4368 (description "Plexus-archiver contains a component to deal with project
4369archives (jar).")
4370 (license license:asl2.0)))
4371
4372(define-public java-plexus-container-default
4373 (package
4374 (inherit java-plexus-container-default-bootstrap)
4375 (name "java-plexus-container-default")
4376 (arguments
4377 `(#:jar-name "container-default.jar"
4378 #:source-dir "plexus-container-default/src/main/java"
4379 #:test-dir "plexus-container-default/src/test"
4380 #:test-exclude (list ;"**/*Test.java"
4381 "**/Abstract*.java"
4382 ;; Requires plexus-hierarchy
4383 "**/PlexusHierarchyTest.java"
4384 ;; Failures
4385 "**/ComponentRealmCompositionTest.java"
4386 "**/PlexusContainerTest.java")
4387 #:phases
4388 (modify-phases %standard-phases
4389 (add-before 'build 'fix-google-collections
4390 (lambda _
4391 ;; Google collections are now replaced with guava
4392 (substitute* "plexus-container-default/pom.xml"
4393 (("google-collections") "guava")
4394 (("com.google.collections") "com.google.guava"))
4395 #t))
4396 (add-before 'build 'copy-resources
4397 (lambda _
4398 (copy-recursively
4399 "plexus-container-default/src/main/resources/"
4400 "build/classes")
4401 #t))
4402 (add-before 'check 'fix-paths
4403 (lambda _
4404 (let ((dir "plexus-container-default/src/test/java/org/codehaus"))
4405 (substitute*
4406 (string-append
4407 dir "/plexus/component/composition/"
4408 "ComponentRealmCompositionTest.java")
4409 (("src/test") "plexus-container-default/src/test"))
4410 #t)))
4411 (replace 'install
4412 (install-from-pom "plexus-container-default/pom.xml")))))
4413 (inputs
4414 `(("worldclass" ,java-plexus-classworlds)
4415 ("xbean" ,java-geronimo-xbean-reflect)
4416 ("utils" ,java-plexus-utils)
4417 ("junit" ,java-junit)
4418 ("guava" ,java-guava)))
4419 (native-inputs
4420 `(("archiver" ,java-plexus-archiver)
4421 ("hamcrest" ,java-hamcrest-core)))
4422 (properties
4423 (alist-delete
4424 'hidden?
4425 (package-properties java-plexus-container-default-bootstrap)))))
4426
4427(define-public java-plexus-component-annotations
4428 (package
4429 (inherit java-plexus-container-default)
4430 (name "java-plexus-component-annotations")
4431 (arguments
4432 `(#:jar-name "plexus-component-annotations.jar"
4433 #:source-dir "plexus-component-annotations/src/main/java"
4434 #:tests? #f; no tests
4435 #:phases
4436 (modify-phases %standard-phases
4437 (replace 'install
4438 (install-from-pom "plexus-component-annotations/pom.xml")))))
4439 (propagated-inputs
4440 (list java-plexus-containers-parent-pom))
4441 (inputs '())
4442 (native-inputs '())
4443 (synopsis "Plexus descriptors generator")
4444 (description "This package is a Maven plugin to generate Plexus descriptors
4445from source tags and class annotations.")))
4446
4447(define-public java-plexus-component-metadata
4448 (package
4449 (inherit java-plexus-container-default)
4450 (name "java-plexus-component-metadata")
4451 (arguments
4452 `(#:jar-name "plexus-component-metadata.jar"
4453 #:source-dir "src/main/java"
4454 #:test-dir "src/test"
4455 #:jdk ,icedtea-8
4456 #:phases
4457 (modify-phases %standard-phases
4458 (add-before 'configure 'chdir
4459 (lambda _
4460 (chdir "plexus-component-metadata")
4461 #t))
4462 (add-before 'build 'copy-resources
4463 (lambda _
4464 (copy-recursively "src/main/resources"
4465 "build/classes/")
4466 #t))
4467 (add-before 'build 'fix-jdom
4468 (lambda _
4469 ;; The newer version of jdom now sets multiple features by default
4470 ;; that are not supported.
4471 ;; Skip these features
4472 (substitute* "src/main/java/org/codehaus/plexus/metadata/merge/MXParser.java"
4473 (("throw new XmlPullParserException\\(\"unsupporte feature \"\\+name\\);")
4474 "// skip"))))
4475 (add-before 'build 'reinstate-cli
4476 ;; The CLI was removed in 2.1.0, but we still need it to build some
4477 ;; maven dependencies, and some parts of maven itself. We can't use
4478 ;; the maven plugin for that yet.
4479 (lambda _
4480 (with-output-to-file "src/main/java/org/codehaus/plexus/metadata/PlexusMetadataGeneratorCli.java"
4481 (lambda _
4482 ;; Copied from a previous version of this package.
4483 (display "package org.codehaus.plexus.metadata;
4484
4485import java.io.File;
4486import java.util.Arrays;
4487import java.util.Collections;
4488
4489import org.apache.commons.cli.CommandLine;
4490import org.apache.commons.cli.OptionBuilder;
4491import org.apache.commons.cli.Options;
4492import org.codehaus.plexus.PlexusContainer;
4493import org.codehaus.plexus.tools.cli.AbstractCli;
4494
4495public class PlexusMetadataGeneratorCli
4496 extends AbstractCli
4497{
4498 public static final char SOURCE_DIRECTORY = 's';
4499 public static final char SOURCE_ENCODING = 'e';
4500 public static final char CLASSES_DIRECTORY = 'c';
4501 public static final char OUTPUT_FILE = 'o';
4502 public static final char DESCRIPTORS_DIRECTORY = 'm';
4503
4504 public static void main( String[] args )
4505 throws Exception
4506 {
4507 new PlexusMetadataGeneratorCli().execute( args );
4508 }
4509
4510 @Override
4511 public String getPomPropertiesPath()
4512 {
4513 return \"META-INF/maven/org.codehaus.plexus/plexus-metadata-generator/pom.properties\";
4514 }
4515
4516 @Override
4517 @SuppressWarnings(\"static-access\")
4518 public Options buildCliOptions( Options options )
4519 {
4520 options.addOption( OptionBuilder.withLongOpt( \"source\" ).hasArg().withDescription( \"Source directory.\" ).create( SOURCE_DIRECTORY ) );
4521 options.addOption( OptionBuilder.withLongOpt( \"encoding\" ).hasArg().withDescription( \"Source file encoding.\" ).create( SOURCE_ENCODING ) );
4522 options.addOption( OptionBuilder.withLongOpt( \"classes\" ).hasArg().withDescription( \"Classes directory.\" ).create( CLASSES_DIRECTORY ) );
4523 options.addOption( OptionBuilder.withLongOpt( \"output\" ).hasArg().withDescription( \"Output directory.\" ).create( OUTPUT_FILE ) );
4524 options.addOption( OptionBuilder.withLongOpt( \"descriptors\" ).hasArg().withDescription( \"Descriptors directory.\" ).create( DESCRIPTORS_DIRECTORY ) );
4525 return options;
4526 }
4527
4528 public void invokePlexusComponent( CommandLine cli, PlexusContainer plexus )
4529 throws Exception
4530 {
4531 MetadataGenerator metadataGenerator = plexus.lookup( MetadataGenerator.class );
4532
4533 MetadataGenerationRequest request = new MetadataGenerationRequest();
4534 request.classesDirectory = new File( cli.getOptionValue( CLASSES_DIRECTORY ) );
4535 request.classpath = Collections.emptyList();
4536 request.sourceDirectories = Arrays.asList( new String[]{ new File( cli.getOptionValue( SOURCE_DIRECTORY ) ).getAbsolutePath() } );
4537 request.sourceEncoding = cli.getOptionValue( SOURCE_ENCODING );
4538 request.useContextClassLoader = true;
4539 request.outputFile = new File( cli.getOptionValue( OUTPUT_FILE ) );
4540 request.componentDescriptorDirectory = new File( cli.getOptionValue( DESCRIPTORS_DIRECTORY ) );
4541
4542 metadataGenerator.generateDescriptor( request );
4543 }
4544}")))))
4545 (add-before 'check 'fix-test-location
4546 (lambda _
4547 (substitute* '("src/test/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriterTest.java"
4548 "src/test/java/org/codehaus/plexus/metadata/merge/ComponentsXmlMergerTest.java")
4549 (("target") "build")))))))
4550 (propagated-inputs
4551 `(("java-plexus-container-default" ,java-plexus-container-default)
4552 ("java-plexu-component-annotations" ,java-plexus-component-annotations)
4553 ("java-plexus-utils" ,java-plexus-utils)
4554 ("java-plexus-cli" ,java-plexus-cli)
4555 ("java-plexus-classworlds" ,java-plexus-classworlds)
4556 ("maven-plugin-api" ,maven-plugin-api)
4557 ("maven-plugin-annotations" ,maven-plugin-annotations)
4558 ("maven-core-bootstrap" ,maven-core-bootstrap)
4559 ("maven-model" ,maven-model)
4560 ("java-commons-cli" ,java-commons-cli)
4561 ("java-qdox" ,java-qdox)
4562 ("java-jdom2" ,java-jdom2)
4563 ("java-asm-8" ,java-asm-8)))
4564 (native-inputs
4565 (list java-junit java-guava java-geronimo-xbean-reflect))
4566 (synopsis "Inversion-of-control container for Maven")
4567 (description "The Plexus project provides a full software stack for creating
4568and executing software projects. Based on the Plexus container, the
4569applications can utilise component-oriented programming to build modular,
4570reusable components that can easily be assembled and reused. This package
4571provides the Maven plugin generating the component metadata.")))
4572
4573(define-public java-plexus-container-default-1.7
4574 (package
4575 (inherit java-plexus-container-default)
4576 (version "1.7.1")
4577 (source (origin
4578 (method git-fetch)
4579 (uri (git-reference
4580 (url "https://github.com/codehaus-plexus/plexus-containers")
4581 (commit (string-append "plexus-containers-" version))))
4582 (file-name (git-file-name "java-plexus-container-default" version))
4583 (sha256
4584 (base32
4585 "1316hrp5vqfv0aw7miq2fp0wwy833h66h502h29vnh5sxj27x228"))))))
4586
4587(define java-plexus-containers-parent-pom-1.7
4588 (package
4589 (inherit java-plexus-container-default-1.7)
4590 (name "java-plexus-containers-parent-pom")
4591 (arguments
4592 `(#:tests? #f
4593 #:phases
4594 (modify-phases %standard-phases
4595 (delete 'configure)
4596 (delete 'build)
4597 (replace 'install
4598 (install-pom-file "pom.xml")))))
4599 (propagated-inputs
4600 `(("plexus-parent-pom" ,plexus-parent-pom-4.0)))))
4601
4602(define-public java-plexus-component-annotations-1.7
4603 (package
4604 (inherit java-plexus-container-default-1.7)
4605 (name "java-plexus-component-annotations")
4606 (arguments
4607 `(#:jar-name "plexus-component-annotations.jar"
4608 #:source-dir "plexus-component-annotations/src/main/java"
4609 #:tests? #f; no tests
4610 #:phases
4611 (modify-phases %standard-phases
4612 (replace 'install
4613 (install-from-pom "plexus-component-annotations/pom.xml")))))
4614 (propagated-inputs
4615 `(("java-plexus-containers-parent-pom-1.7" ,java-plexus-containers-parent-pom-1.7)))
4616 (inputs '())
4617 (native-inputs '())
4618 (synopsis "Plexus descriptors generator")
4619 (description "This package is a Maven plugin to generate Plexus descriptors
4620from source tags and class annotations.")))
4621
4622(define-public java-plexus-component-metadata-1.7
4623 (package
4624 (inherit java-plexus-container-default-1.7)
4625 (name "java-plexus-component-metadata")
4626 (arguments
4627 `(#:jar-name "plexus-component-metadata.jar"
4628 #:source-dir "src/main/java"
4629 #:test-dir "src/test"
4630 #:phases
4631 (modify-phases %standard-phases
4632 (add-before 'configure 'chdir
4633 (lambda _
4634 (chdir "plexus-component-metadata")
4635 #t))
4636 (add-before 'build 'copy-resources
4637 (lambda _
4638 (copy-recursively "src/main/resources"
4639 "build/classes/")
4640 #t))
4641 (add-before 'build 'fix-jdom
4642 (lambda _
4643 ;; The newer version of jdom now sets multiple features by default
4644 ;; that are not supported.
4645 ;; Skip these features
4646 (substitute* "src/main/java/org/codehaus/plexus/metadata/merge/MXParser.java"
4647 (("throw new XmlPullParserException\\(\"unsupporte feature \"\\+name\\);")
4648 "// skip"))))
4649 (add-before 'check 'fix-test-location
4650 (lambda _
4651 (substitute* '("src/test/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriterTest.java"
4652 "src/test/java/org/codehaus/plexus/metadata/merge/ComponentsXmlMergerTest.java")
4653 (("target") "build")))))))
4654 (propagated-inputs
4655 (list java-plexus-container-default-1.7
4656 java-plexus-component-annotations-1.7
4657 java-plexus-utils
4658 java-plexus-cli
4659 java-plexus-cli
4660 java-plexus-classworlds
4661 maven-plugin-api
4662 maven-plugin-annotations
4663 maven-core-bootstrap
4664 maven-model
4665 java-commons-cli
4666 java-qdox
4667 java-jdom2
4668 java-asm-8))
4669 (native-inputs
4670 (list java-junit java-guava java-geronimo-xbean-reflect))
4671 (synopsis "Inversion-of-control container for Maven")
4672 (description "The Plexus project provides a full software stack for creating
4673and executing software projects. Based on the Plexus container, the
4674applications can utilise component-oriented programming to build modular,
4675reusable components that can easily be assembled and reused. This package
4676provides the Maven plugin generating the component metadata.")))
4677
4678(define-public java-plexus-cipher
4679 (package
4680 (name "java-plexus-cipher")
4681 (version "2.0")
4682 (source (origin
4683 (method git-fetch)
4684 (uri (git-reference
4685 (url "https://github.com/codehaus-plexus/plexus-cipher")
4686 (commit (string-append "plexus-cipher-" version))))
4687 (file-name (git-file-name name version))
4688 (sha256
4689 (base32
4690 "01fipdsm090n8j4207fl8kbxznkgkmkkgyazf53hm1nwn6na5aai"))))
4691 (build-system ant-build-system)
4692 (arguments
4693 `(#:jar-name "plexus-cipher.jar"
4694 #:source-dir "src/main/java"
4695 #:phases
4696 (modify-phases %standard-phases
4697 (add-before 'build 'generate-javax.inject.Named
4698 (lambda _
4699 (mkdir-p "build/classes/META-INF/sisu")
4700 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4701 (lambda _
4702 (display
4703 "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
4704 #t))
4705 (replace 'install (install-from-pom "pom.xml")))))
4706 (inputs
4707 `(("java-cdi-api" ,java-cdi-api)
4708 ("java-javax-inject" ,java-javax-inject)))
4709 (propagated-inputs
4710 `(("java-sonatype-spice-parent-pom" ,java-sonatype-spice-parent-pom-15)
4711 ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)))
4712 (native-inputs
4713 `(("java-junit" ,java-junit)))
4714 (home-page "https://github.com/sonatype/plexus-cipher")
4715 (synopsis "Encryption/decryption Component")
4716 (description "Plexus-cipher contains a component to deal with encryption
4717and decryption.")
4718 (license license:asl2.0)))
4719
4720(define-public java-plexus-cipher-1.7
4721 (package
4722 (inherit java-plexus-cipher)
4723 (version "1.7")
4724 (source (origin
4725 (method git-fetch)
4726 (uri (git-reference
4727 (url "https://github.com/codehaus-plexus/plexus-cipher")
4728 (commit (string-append "plexus-cipher-" version))))
4729 (file-name (git-file-name "java-plexus-cipher" version))
4730 (sha256
4731 (base32
4732 "0m638nzlxbmnbcj5cwdpgs326ab584yv0k803zlx37r6iqwvf6b0"))))
4733 (arguments
4734 `(#:jar-name "plexus-cipher.jar"
4735 #:source-dir "src/main/java"
4736 #:tests? #f; FIXME: requires sisu-inject-bean
4737 #:phases
4738 (modify-phases %standard-phases
4739 (add-before 'build 'copy-resources
4740 (lambda _
4741 (copy-recursively "src/main/resources" "build/classes")
4742 (mkdir-p "build/classes/META-INF/sisu")
4743 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4744 (lambda _
4745 (display "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
4746 #t))
4747 (add-before 'install 'fix-test-dependency
4748 (lambda _
4749 ;; sisu-inject-bean is only used for tests, but its scope is "provided".
4750 (substitute* "pom.xml"
4751 (("provided") "test"))
4752 #t))
4753 (replace 'install (install-from-pom "pom.xml")))))
4754 (propagated-inputs
4755 (list java-sonatype-spice-parent-pom-15))))
4756
4757(define-public java-plexus-java
4758 (package
4759 (name "java-plexus-java")
4760 (version "0.9.10")
4761 (source (origin
4762 (method git-fetch)
4763 (uri (git-reference
4764 (url "https://github.com/codehaus-plexus/plexus-languages")
4765 (commit (string-append "plexus-languages-" version))))
4766 (file-name (git-file-name name version))
4767 (sha256
4768 (base32
4769 "0vmvgq5hfxs90yyxgssfpwq78l7vwx1ljwpkk594mrdr8sm668b5"))
4770 (modules '((guix build utils)))
4771 (snippet
4772 `(begin
4773 (for-each delete-file (find-files "." ".*.jar$"))
4774 #t))))
4775 (build-system ant-build-system)
4776 (arguments
4777 `(#:jar-name "plexus-java.java"
4778 #:source-dir "plexus-java/src/main/java"
4779 #:test-dir "plexus-java/src/test"
4780 #:tests? #f; require mockito 2
4781 #:phases
4782 (modify-phases %standard-phases
4783 (add-after 'build 'generate-metadata
4784 (lambda _
4785 (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
4786 "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
4787 "--source" "plexus-java/src/main/java"
4788 "--output" "build/classes/META-INF/plexus/components.xml"
4789 "--classes" "build/classes"
4790 "--descriptors" "build/classes/META-INF")
4791 (invoke "ant" "jar")
4792 #t))
4793 (add-before 'install 'install-parent
4794 (install-pom-file "pom.xml"))
4795 (replace 'install
4796 (install-from-pom "plexus-java/pom.xml")))))
4797 (propagated-inputs
4798 (list java-asm java-qdox-2-M9 java-javax-inject
4799 plexus-parent-pom-4.0))
4800 (inputs
4801 (list java-plexus-component-annotations-1.7))
4802 (native-inputs
4803 (list java-plexus-component-metadata-1.7 java-junit))
4804 (home-page "https://codehaus-plexus.github.io/plexus-languages/plexus-java")
4805 (synopsis "Shared language features for Java")
4806 (description "This package contains shared language features of the Java
4807language, for the plexus project.")
4808 (license license:asl2.0)))
4809
4810(define-public java-plexus-compiler-api
4811 (package
4812 (name "java-plexus-compiler-api")
4813 (version "2.8.4")
4814 (source (origin
4815 (method git-fetch)
4816 (uri (git-reference
4817 (url "https://github.com/codehaus-plexus/plexus-compiler")
4818 (commit (string-append "plexus-compiler-" version))))
4819 (file-name (git-file-name name version))
4820 (sha256
4821 (base32
4822 "1nq1gnn3s6z1j29gmi1hqbklsmm8b1lmnafb0191914f95mn18gk"))))
4823 (build-system ant-build-system)
4824 (arguments
4825 `(#:jar-name "plexus-compiler-api.jar"
4826 #:source-dir "plexus-compiler-api/src/main/java"
4827 #:test-dir "plexus-compiler-api/src/test"
4828 #:phases
4829 (modify-phases %standard-phases
4830 (replace 'install
4831 (install-from-pom "plexus-compiler-api/pom.xml")))))
4832 (propagated-inputs
4833 `(("java-plexus-container-default" ,java-plexus-container-default)
4834 ("java-plexus-compiler-pom" ,java-plexus-compiler-pom)
4835 ("java-plexus-util" ,java-plexus-utils)))
4836 (native-inputs
4837 (list java-junit))
4838 (home-page "https://github.com/codehaus-plexus/plexus-compiler")
4839 (synopsis "Plexus Compilers component's API to manipulate compilers")
4840 (description "This package contains the API used by components to manipulate
4841compilers.")
4842 (license (list license:asl2.0
4843 license:expat))))
4844
4845(define java-plexus-compiler-pom
4846 (package
4847 (inherit java-plexus-compiler-api)
4848 (name "java-plexus-compiler-pom")
4849 (arguments
4850 `(#:tests? #f
4851 #:phases
4852 (modify-phases %standard-phases
4853 (delete 'configure)
4854 (delete 'build)
4855 (replace 'install
4856 (install-pom-file "pom.xml"))
4857 (add-after 'install 'install-compilers
4858 (install-pom-file "plexus-compilers/pom.xml")))))
4859 (propagated-inputs
4860 `(("plexus-components-parent-pom-4.0" ,plexus-components-parent-pom-4.0)))))
4861
4862(define plexus-components-parent-pom-4.0
4863 (package
4864 (name "plexus-components-parent-pom")
4865 (version "4.0")
4866 (source (origin
4867 (method git-fetch)
4868 (uri (git-reference
4869 (url "https://github.com/codehaus-plexus/plexus-components")
4870 (commit (string-append "plexus-components-" version))))
4871 (file-name (git-file-name name version))
4872 (sha256
4873 (base32
4874 "041bm8yv0m2i17mqg8zljib4ykpha7ijls2qfdwvkma4d39lhysi"))))
4875 (build-system ant-build-system)
4876 (arguments
4877 `(#:tests? #f
4878 #:phases
4879 (modify-phases %standard-phases
4880 (delete 'configure)
4881 (delete 'build)
4882 (replace 'install
4883 (install-pom-file "pom.xml")))))
4884 (propagated-inputs
4885 `(("plexus-parent-pom-4.0" ,plexus-parent-pom-4.0)))
4886 (home-page "https://codehaus-plexus.github.io/plexus-components")
4887 (synopsis "Plexus parent pom")
4888 (description "This package contains the Plexus components parent POM.")
4889 (license license:asl2.0)))
4890
4891(define-public java-plexus-compiler-manager
4892 (package
4893 (inherit java-plexus-compiler-api)
4894 (name "java-plexus-compiler-manager")
4895 (arguments
4896 `(#:jar-name "compiler-compiler-manager.java"
4897 #:source-dir "plexus-compiler-manager/src/main/java"
4898 #:test-dir "plexus-compiler-manager/src/test"
4899 #:tests? #f
4900 #:phases
4901 (modify-phases %standard-phases
4902 (add-after 'build 'generate-metadata
4903 (lambda _
4904 (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
4905 "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
4906 "--source" "plexus-compiler-manager/src/main/java"
4907 "--output" "build/classes/META-INF/plexus/components.xml"
4908 "--classes" "build/classes"
4909 "--descriptors" "build/classes/META-INF")
4910 (invoke "ant" "jar")
4911 #t))
4912 (add-after 'generate-metadata 'rebuild
4913 (lambda _
4914 (invoke "ant" "jar")
4915 #t))
4916 (replace 'install
4917 (install-from-pom "plexus-compiler-manager/pom.xml")))))
4918 (propagated-inputs
4919 (list java-plexus-compiler-api java-plexus-compiler-pom
4920 java-plexus-container-default-1.7))
4921 (native-inputs
4922 (list unzip java-plexus-component-metadata-1.7))
4923 (synopsis "Compiler management for Plexus Compiler component")
4924 (description "Plexus Compiler is a Plexus component to use different
4925compilers through a uniform API. This component chooses the compiler
4926implementation to use in a project.")))
4927
4928(define-public java-plexus-compiler-javac
4929 (package
4930 (inherit java-plexus-compiler-api)
4931 (name "java-plexus-compiler-javac")
4932 (arguments
4933 `(#:jar-name "plexus-compiler-javac.jar"
4934 #:source-dir "plexus-compilers/plexus-compiler-javac/src/main/java"
4935 #:jdk ,icedtea-8
4936 #:tests? #f; depends on compiler-test -> maven-core -> ... -> this package.
4937 #:test-dir "plexus-compilers/plexus-compiler-javac/src/test"
4938 #:modules ((guix build ant-build-system)
4939 (guix build utils)
4940 (guix build java-utils)
4941 (sxml simple))
4942 #:phases
4943 (modify-phases %standard-phases
4944 ;; We cannot use java-plexus-component-metadata to generate the metadata
4945 ;; because it ultimately depends on this package.
4946 ;; Create it manually instead
4947 (add-before 'build 'create-metadata
4948 (lambda _
4949 (let* ((dir "build/classes/META-INF/plexus")
4950 (file (string-append dir "/components.xml")))
4951 (mkdir-p dir)
4952 (with-output-to-file file
4953 (lambda _
4954 (sxml->xml
4955 `(component-set
4956 (components
4957 (component
4958 (role "org.codehaus.plexus.compiler.Compiler")
4959 (role-hint "javac")
4960 (implementation "org.codehaus.plexus.compiler.javac.JavacCompiler")
4961 (isolated-realm "false"))))))))
4962 #t))
4963 (replace 'install
4964 (install-from-pom "plexus-compilers/plexus-compiler-javac/pom.xml")))))
4965 (propagated-inputs
4966 (list java-plexus-compiler-api java-plexus-utils
4967 java-plexus-container-default))
4968 (synopsis "Javac Compiler support for Plexus Compiler component")
4969 (description "This package contains the Javac Compiler support for Plexus
4970Compiler component.")))
4971
4972(define plexus-components-pom-1.1.20
4973 (package
4974 (name "plexus-components-pom-1.1.20")
4975 (version "1.1.20")
4976 (source (origin
4977 (method git-fetch)
4978 (uri (git-reference
4979 (url "https://github.com/codehaus-plexus/plexus-components")
4980 (commit (string-append "plexus-components-" version))))
4981 (file-name (git-file-name name version))
4982 (sha256
4983 (base32
4984 "1q254k95m9icyfsvaw8c226midg8v6v436wvivhv7im825mnp5yb"))))
4985 (build-system ant-build-system)
4986 (arguments
4987 `(#:tests? #f
4988 #:phases
4989 (modify-phases %standard-phases
4990 (delete 'configure)
4991 (delete 'build)
4992 (replace 'install
4993 (install-pom-file "pom.xml")))))
4994 (propagated-inputs
4995 `(("plexus-parent-pom" ,plexus-parent-pom-3.1)))
4996 (home-page "https://github.com/codehaus-plexus/plexus-components")
4997 (synopsis "Maven parent pom for plexus packages")
4998 (description "This package contains the parent pom for plexus component
4999packages.")
5000 (license license:asl2.0)))
5001
5002(define-public java-plexus-digest
5003 (package
5004 (name "java-plexus-digest")
5005 (version "1.2")
5006 (source (origin
5007 (method git-fetch)
5008 (uri (git-reference
5009 (url "https://github.com/codehaus-plexus/plexus-digest")
5010 (commit "2a52ad1bda8297fa0e287163d2fa37245ec6a430")))
5011 (file-name (git-file-name name version))
5012 (sha256
5013 (base32
5014 "19w5wxsliz8r42niry68qa665kvjsb8081dazg9vgd3pca72w07x"))))
5015 (build-system ant-build-system)
5016 (arguments
5017 `(#:jar-name "plexus-digest.jar"
5018 #:source-dir "src/main/java"
5019 #:tests? #f
5020 #:phases
5021 (modify-phases %standard-phases
5022 (replace 'install
5023 (install-from-pom "pom.xml")))))
5024 (propagated-inputs
5025 (list java-plexus-utils plexus-components-pom-1.1.20))
5026 (native-inputs
5027 (list java-junit))
5028 (home-page "https://github.com/codehaus-plexus/plexus-digest")
5029 (synopsis "Hash function utilities for Java")
5030 (description "This package is a plexus component that contains hash
5031function utilities.")
5032 (license license:asl2.0)))
5033
5034(define-public java-plexus-sec-dispatcher
5035 (package
5036 (name "java-plexus-sec-dispatcher")
5037 (version "2.0")
5038 (source (origin
5039 (method git-fetch)
5040 (uri (git-reference
5041 (url "https://github.com/codehaus-plexus/plexus-sec-dispatcher")
5042 (commit (string-append "plexus-sec-dispatcher-" version))))
5043 (sha256
5044 (base32
5045 "0665zcyxkv2knydxgv2dn64zvy1dx9j9af12ds9s64qmzd1rk6pk"))
5046 (file-name (git-file-name name version))))
5047 (arguments
5048 `(#:jar-name "plexus-sec-dispatcher.jar"
5049 #:source-dir "src/main/java"
5050 #:phases
5051 (modify-phases %standard-phases
5052 (add-before 'build 'generate-models
5053 (lambda* (#:key inputs #:allow-other-keys)
5054 (define (modello-single-mode file version mode)
5055 (invoke "java"
5056 "org.codehaus.modello.ModelloCli"
5057 file mode "src/main/java" version
5058 "false" "true"))
5059 (let ((file "src/main/mdo/settings-security.mdo"))
5060 (modello-single-mode file "1.0.0" "java")
5061 (modello-single-mode file "1.0.0" "xpp3-reader")
5062 (modello-single-mode file "1.0.0" "xpp3-writer"))
5063 #t))
5064 (add-before 'build 'generate-javax.inject.Named
5065 (lambda _
5066 (mkdir-p "build/classes/META-INF/sisu")
5067 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
5068 (lambda _
5069 (display
5070 "org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher\n")))
5071 #t))
5072 (add-before 'check 'fix-paths
5073 (lambda _
5074 (copy-recursively "src/test/resources" "target")
5075 #t))
5076 (replace 'install (install-from-pom "pom.xml")))))
5077 (propagated-inputs
5078 (list java-plexus-utils java-plexus-cipher plexus-parent-pom-8))
5079 (native-inputs
5080 (list java-javax-inject
5081 java-modello-core
5082 ;; for modello
5083 java-plexus-container-default
5084 java-plexus-classworlds
5085 java-plexus-utils
5086 java-guava
5087 java-geronimo-xbean-reflect
5088 ;; modello plugins
5089 java-modello-plugins-java
5090 java-modello-plugins-xml
5091 java-modello-plugins-xpp3
5092 ;; for tests
5093 java-junit))
5094 (build-system ant-build-system)
5095 (home-page "https://github.com/sonatype/plexus-sec-dispatcher")
5096 (synopsis "Plexus Security Dispatcher Component")
5097 (description "This package is the Plexus Security Dispatcher Component.
5098This component decrypts a string passed to it.")
5099 (license license:asl2.0)))
5100
5101(define-public java-plexus-sec-dispatcher-1.4
5102 (package
5103 (inherit java-plexus-sec-dispatcher)
5104 (version "1.4")
5105 (source (origin
5106 (method git-fetch)
5107 (uri (git-reference
5108 (url "https://github.com/codehaus-plexus/plexus-sec-dispatcher")
5109 (commit (string-append "sec-dispatcher-" version))))
5110 (sha256
5111 (base32
5112 "1ng4yliy4cqpjr4fxxjbpwyk1wkch5f8vblm1kvwf328s4gibszs"))
5113 (file-name (git-file-name "java-plexus-sec-dispatcher" version))))
5114 (arguments
5115 (substitute-keyword-arguments (package-arguments java-plexus-sec-dispatcher)
5116 ((#:phases phases)
5117 `(modify-phases ,phases
5118 (delete 'generate-javax.inject.Named)
5119 (add-before 'build 'generate-components.xml
5120 (lambda _
5121 (mkdir-p "build/classes/META-INF/plexus")
5122 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
5123 (lambda _
5124 (display
5125 "<component-set>\n
5126 <components>\n
5127 <component>\n
5128 <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role>\n
5129 <role-hint>default</role-hint>\n
5130 <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation>\n
5131 <description></description>\n
5132 <requirements>\n
5133 <requirement>\n
5134 <role>org.sonatype.plexus.components.cipher.PlexusCipher</role>\n
5135 <field-name>_cipher</field-name>\n
5136 </requirement>\n
5137 <requirement>\n
5138 <role>org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor</role>\n
5139 <field-name>_decryptors</field-name>\n
5140 </requirement>\n
5141 </requirements>\n
5142 <configuration>\n
5143 <_configuration-file>~/.settings-security.xml</_configuration-file>\n
5144 </configuration>\n
5145 </component>\n
5146 </components>\n
5147</component-set>\n")))))))))
5148 (propagated-inputs
5149 (list java-plexus-utils java-plexus-cipher-1.7
5150 java-sonatype-spice-parent-pom-12))))
5151
5152(define-public java-plexus-cli
5153 (package
5154 (name "java-plexus-cli")
5155 (version "1.7")
5156 (source (origin
5157 (method git-fetch)
5158 (uri (git-reference
5159 (url "https://github.com/sonatype/plexus-cli")
5160 (commit "a776afa6bca84e5107bedb69440329cdb24ed645")))
5161 (file-name (string-append name "-" version))
5162 (sha256
5163 (base32
5164 "0xjrlay605rypv3zd7y24vlwf0039bil3n2cqw54r1ddpysq46vx"))))
5165 (build-system ant-build-system)
5166 (arguments
5167 `(#:jar-name "plexus-cli.jar"
5168 #:source-dir "src/main/java"
5169 #:jdk ,icedtea-8
5170 #:test-dir "src/test"))
5171 (inputs
5172 (list java-commons-cli java-plexus-container-default
5173 java-plexus-classworlds))
5174 (native-inputs
5175 (list java-plexus-utils java-junit java-guava))
5176 (home-page "https://codehaus-plexus.github.io/plexus-cli")
5177 (synopsis "CLI building library for plexus")
5178 (description "This package is a library to help creating CLI around
5179Plexus components.")
5180 (license license:asl2.0)))
5181
5182(define-public java-plexus-build-api
5183 (package
5184 (name "java-plexus-build-api")
5185 (version "0.0.7")
5186 (source (origin
5187 (method git-fetch)
5188 (uri (git-reference
5189 (url "https://github.com/codehaus-plexus/plexus-build-api")
5190 (commit (string-append "plexus-build-api-" version))))
5191 (file-name (git-file-name name version))
5192 (sha256
5193 (base32
5194 "1d5w6c58gkx30d51v7qwv1xrhc0ly76848gihmgshj19yf6yhca0"))))
5195 (build-system ant-build-system)
5196 (arguments
5197 `(#:jar-name "plexus-build-api.jar"
5198 #:source-dir "src/main/java"
5199 #:jdk ,icedtea-8
5200 #:tests? #f; FIXME: how to run the tests?
5201 #:phases
5202 (modify-phases %standard-phases
5203 (add-before 'build 'copy-resources
5204 (lambda _
5205 (copy-recursively "src/main/resources" "build/classes")
5206 (substitute* (find-files "build/classes")
5207 (("\\$\\{project.version\\}") ,version))
5208 #t))
5209 (add-before 'build 'generate-plexus-compontent
5210 (lambda _
5211 (mkdir-p "build/classes/META-INF/plexus")
5212 ;; This file is required for plexus to inject this package.
5213 ;; FIXME: how is it generated?
5214 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
5215 (lambda _
5216 (display
5217 "<component-set>\n
5218 <components>\n
5219 <component>\n
5220 <role>org.sonatype.plexus.build.incremental.BuildContext</role>\n
5221 <role-hint>default</role-hint>\n
5222 <implementation>org.sonatype.plexus.build.incremental.DefaultBuildContext</implementation>\n
5223 <description>Filesystem based non-incremental build context implementation\n
5224which behaves as if all files were just created.</description>\n
5225 </component>\n
5226 </components>\n
5227</component-set>\n")))
5228 #t))
5229 (replace 'install
5230 (install-from-pom "pom.xml")))))
5231 (inputs
5232 (list java-plexus-utils-3.2.1 java-plexus-container-default))
5233 (home-page "https://github.com/codehaus-plexus/plexus-build-api/")
5234 (synopsis "Base build API for maven")
5235 (description "This package contains the base build API for maven and
5236a default implementation of it. This API is about scanning files in a
5237project and determining what files need to be rebuilt.")
5238 (license license:asl2.0)))
5239
5240(define-public java-modello-core
5241 (package
5242 (name "java-modello-core")
5243 (version "1.11")
5244 (source (origin
5245 (method git-fetch)
5246 (uri (git-reference
5247 (url "https://github.com/codehaus-plexus/modello")
5248 (commit (string-append "modello-" version))))
5249 (file-name (git-file-name name version))
5250 (sha256
5251 (base32
5252 "18885sim7z9j3wy19i9083y9kc8l9xxl2px823a96q4rnqj5z8s2"))))
5253 (build-system ant-build-system)
5254 (arguments
5255 `(#:jar-name "modello-core.jar"
5256 #:source-dir "modello-core/src/main/java"
5257 #:test-dir "modello-core/src/test"
5258 #:main-class "org.codehaus.modello.ModelloCli"
5259 #:jdk ,icedtea-8
5260 #:phases
5261 (modify-phases %standard-phases
5262 (add-before 'build 'copy-resources
5263 (lambda _
5264 (mkdir-p "build/classes/META-INF/plexus")
5265 (copy-file "modello-core/src/main/resources/META-INF/plexus/components.xml"
5266 "build/classes/META-INF/plexus/components.xml")
5267 #t))
5268 (add-before 'check 'fix-tests
5269 (lambda _
5270 (with-directory-excursion "modello-core/src/test/java/org/codehaus"
5271 (substitute* '("modello/core/DefaultModelloCoreTest.java"
5272 "modello/core/io/ModelReaderTest.java")
5273 (("src/test") "modello-core/src/test")))
5274 #t)))))
5275 (propagated-inputs
5276 (list java-plexus-utils java-plexus-container-default
5277 java-plexus-build-api))
5278 (native-inputs
5279 (list java-junit java-plexus-classworlds java-geronimo-xbean-reflect
5280 java-guava))
5281 (home-page "https://codehaus-plexus.github.io/modello/")
5282 (synopsis "Framework for code generation from a simple model")
5283 (description "Modello is a framework for code generation from a simple model.
5284
5285Modello generates code from a simple model format: based on a plugin
5286architecture, various types of code and descriptors can be generated from the
5287single model, including Java POJOs, XML/JSON/YAML marshallers/unmarshallers,
5288XSD and documentation.")
5289 (license (list
5290 license:expat
5291 ;; Although this package uses only files licensed under expat,
5292 ;; other parts of the source are licensed under different
5293 ;; licenses. We include them to be inherited by other packages.
5294 license:asl2.0
5295 ;; Some files in modello-plugin-java are licensed under a
5296 ;; 5-clause BSD license.
5297 (license:non-copyleft
5298 (string-append "file:///modello-plugins/modello-plugin-java/"
5299 "src/main/java/org/codehaus/modello/plugin/"
5300 "java/javasource/JNaming.java"))))))
5301
5302(define-public java-modello-plugins-java
5303 (package
5304 (inherit java-modello-core)
5305 (name "java-modello-plugins-java")
5306 (arguments
5307 `(#:jar-name "modello-plugins-java.jar"
5308 #:source-dir "modello-plugins/modello-plugin-java/src/main/java"
5309 #:test-dir "modello-plugins/modello-plugin-java/src/test"
5310 #:jdk ,icedtea-8
5311 #:tests? #f; requires maven-model, which depends on this package
5312 #:phases
5313 (modify-phases %standard-phases
5314 (add-before 'build 'copy-resources
5315 (lambda _
5316 (mkdir-p "build/classes")
5317 (copy-recursively "modello-plugins/modello-plugin-java/src/main/resources"
5318 "build/classes")
5319 #t)))))
5320 (inputs
5321 (list java-modello-core))
5322 (synopsis "Modello Java Plugin")
5323 (description "Modello Java Plugin generates Java objects for the model.")))
5324
5325(define-public java-modello-plugins-xml
5326 (package
5327 (inherit java-modello-core)
5328 (name "java-modello-plugins-xml")
5329 (arguments
5330 `(#:jar-name "modello-plugins-xml.jar"
5331 #:source-dir "modello-plugins/modello-plugin-xml/src/main/java"
5332 #:test-dir "modello-plugins/modello-plugin-xml/src/test"
5333 #:jdk ,icedtea-8
5334 #:phases
5335 (modify-phases %standard-phases
5336 (add-before 'build 'copy-resources
5337 (lambda _
5338 (mkdir-p "build/classes")
5339 (copy-recursively
5340 "modello-plugins/modello-plugin-xml/src/main/resources"
5341 "build/classes")
5342 #t))
5343 (add-before 'check 'fix-paths
5344 (lambda _
5345 (with-directory-excursion "modello-plugins/modello-plugin-xml/src/test"
5346 (substitute*
5347 "java/org/codehaus/modello/plugins/xml/XmlModelloPluginTest.java"
5348 (("src/test") "modello-plugins/modello-plugin-xml/src/test")))
5349 #t)))))
5350 (propagated-inputs
5351 (list java-modello-core java-modello-plugins-java))
5352 (synopsis "Modello XML Plugin")
5353 (description "Modello XML Plugin contains shared code for every plugins
5354working on XML representation of the model.")))
5355
5356(define-public java-modello-test
5357 (package
5358 (inherit java-modello-core)
5359 (name "java-modello-test")
5360 (arguments
5361 `(#:jar-name "modello-test.jar"
5362 #:source-dir "modello-test/src/main/java"
5363 #:tests? #f; no tests
5364 #:jdk ,icedtea-8))
5365 (inputs
5366 (list java-plexus-utils java-plexus-compiler-api
5367 java-plexus-compiler-javac java-plexus-container-default))
5368 (synopsis "Modello test package")
5369 (description "The modello test package contains the basis to create
5370Modello generator unit-tests, including sample models and xml files to test
5371every feature for every plugin.")))
5372
5373(define-public java-modello-plugins-xpp3
5374 (package
5375 (inherit java-modello-core)
5376 (name "java-modello-plugins-xpp3")
5377 (arguments
5378 `(#:jar-name "modello-plugins-xpp3.jar"
5379 #:source-dir "modello-plugins/modello-plugin-xpp3/src/main/java"
5380 #:test-dir "modello-plugins/modello-plugin-xpp3/src/test"
5381 ;; One of the test dependencies is maven-model which depends on this package.
5382 #:tests? #f
5383 #:jdk ,icedtea-8
5384 #:phases
5385 (modify-phases %standard-phases
5386 (add-before 'build 'copy-resources
5387 (lambda _
5388 (mkdir-p "build/classes")
5389 (copy-recursively "modello-plugins/modello-plugin-xpp3/src/main/resources"
5390 "build/classes")
5391 #t)))))
5392 (propagated-inputs
5393 (list java-modello-core java-modello-plugins-java
5394 java-modello-plugins-xml))
5395 (native-inputs
5396 (modify-inputs native-inputs
5397 (prepend java-xmlunit java-modello-test)))
5398 (synopsis "Modello XPP3 Plugin")
5399 (description "The modello XPP3 plugin generates XML readers and writers based
5400on the XPP3 API (XML Pull Parser).")))
5401
5402(define-public java-ow-util-ant-tasks
5403 (package
5404 (name "java-ow-util-ant-tasks")
5405 (version "1.3.2")
5406 (source (origin
5407 (method url-fetch)
5408 (uri (string-append
5409 "mirror://debian/pool/main/o/ow-util-ant-tasks/"
5410 "ow-util-ant-tasks_" version ".orig.tar.gz"))
5411 (sha256
5412 (base32
5413 "1y5ln1g36aligwcadqksdj18i5ghqnxn523wjbzy2zyd7w58fgy5"))))
5414 (build-system ant-build-system)
5415 (arguments
5416 `(#:jar-name "ow-util-ant-tasks.jar"
5417 #:tests? #f; no tests
5418 #:phases
5419 (modify-phases %standard-phases
5420 (add-before 'build 'delete-cyclic-dependency
5421 (lambda _
5422 ;; This file depends on asm-3, which depends on this package
5423 (delete-file "src/org/objectweb/util/ant/DependencyAnalyzer.java")
5424 ;; This file depends on xalan
5425 (delete-file "src/org/objectweb/util/ant/Xalan2Liaison.java")))
5426 (add-before 'build 'fix-new-ant
5427 (lambda _
5428 (substitute* "src/org/objectweb/util/ant/MultipleCopy.java"
5429 ((", destFile.getAbsolutePath\\(\\)")
5430 ", new String[] { destFile.getAbsolutePath() }")))))))
5431 (home-page "https://packages.debian.org/source/stretch/ow-util-ant-tasks")
5432 (synopsis "Replacement for base ant tasks")
5433 (description "This library is used in the legacy build process of several
5434key frameworks developed by ObjectWeb, among them legacy versions of the
5435ObjectWeb ASM bytecode manipulation framework.")
5436 (license license:lgpl2.0+)))
5437
5438(define-public java-asm
5439 (package
5440 (name "java-asm")
5441 (version "6.0")
5442 (source (origin
5443 (method url-fetch)
5444 (uri (string-append "https://download.forge.ow2.org/asm/"
5445 "asm-" version ".tar.gz"))
5446 (sha256
5447 (base32
5448 "115l5pqblirdkmzi32dxx7gbcm4jy0s14y5wircr6h8jdr9aix00"))))
5449 (build-system ant-build-system)
5450 (arguments
5451 `(#:build-target "compile"
5452 ;; The tests require an old version of Janino, which no longer compiles
5453 ;; with the JDK7.
5454 #:tests? #f
5455 #:make-flags
5456 (list
5457 ;; We don't need these extra ant tasks, but the build system asks us to
5458 ;; provide a path anyway.
5459 "-Dobjectweb.ant.tasks.path=dummy-path"
5460 ;; The java-aqute.bndlib JAR file will be put onto the classpath and
5461 ;; used during the build automatically by ant-build-system, but
5462 ;; java-asm's build.xml fails unless we provide something here.
5463 "-Dbiz.aQute.bnd.path=dummy-path")
5464 #:phases
5465 (modify-phases %standard-phases
5466 (add-before 'build 'remove-bnd-dependency
5467 (lambda _
5468 ;; This file is the only one to require bnd, and is not needed
5469 ;; because we don't build a bundle.
5470 (delete-file "src/org/objectweb/asm/tools/ModuleInfoBndPlugin.java")
5471 #t))
5472 (add-before 'install 'build-jars
5473 (lambda* (#:key make-flags #:allow-other-keys)
5474 ;; We cannot use the "jar" target because it depends on a couple
5475 ;; of unpackaged, complicated tools.
5476 (mkdir "dist")
5477 (invoke "jar"
5478 "-cf" (string-append "dist/asm-" ,version ".jar")
5479 "-C" "output/build/tmp" ".")))
5480 (add-before 'install 'fix-pom
5481 (lambda _
5482 (substitute* (find-files "archive" "\\.pom$")
5483 (("@product.artifact@") ,version))
5484 #t))
5485 (add-before 'install 'install-parent
5486 (install-pom-file "archive/asm-parent.pom"))
5487 (replace 'install
5488 (install-from-pom "archive/asm.pom")))))
5489 (native-inputs
5490 (list java-junit))
5491 (propagated-inputs
5492 (list java-org-ow2-parent-pom-1.3))
5493 (home-page "https://asm.ow2.io/")
5494 (synopsis "Very small and fast Java bytecode manipulation framework")
5495 (description "ASM is an all purpose Java bytecode manipulation and
5496analysis framework. It can be used to modify existing classes or dynamically
5497generate classes, directly in binary form. The provided common
5498transformations and analysis algorithms allow easily assembling custom
5499complex transformations and code analysis tools.")
5500 (license license:bsd-3)))
5501
5502(define-public java-org-ow2-parent-pom-1.3
5503 (package
5504 (name "java-org-ow2-parent-pom")
5505 (version "1.3")
5506 (source (origin
5507 (method url-fetch)
5508 (uri "https://repo1.maven.org/maven2/org/ow2/ow2/1.3/ow2-1.3.pom")
5509 (sha256
5510 (base32
5511 "1yr8hfx8gffpppa4ii6cvrsq029a6x8hzy7nsavxhs60s9kmq8ai"))))
5512 (build-system ant-build-system)
5513 (arguments
5514 `(#:tests? #f
5515 ;; Explicitely use an ant version that includes the junit tasks, since
5516 ;; it is a dependency of junit.
5517 #:ant ,ant/java7
5518 #:phases
5519 (modify-phases %standard-phases
5520 (delete 'unpack)
5521 (delete 'build)
5522 (delete 'configure)
5523 (replace 'install
5524 ,#~(install-pom-file #$source)))))
5525 (home-page "https://ow2.org")
5526 (synopsis "Ow2.org parent pom")
5527 (description "This package contains the parent pom for projects from ow2.org,
5528including java-asm.")
5529 (properties '((hidden? . #t)))
5530 (license license:lgpl2.1+)))
5531
5532(define-public java-asm-bootstrap
5533 (package
5534 (inherit java-asm)
5535 (name "java-asm-bootstrap")
5536 (properties '((hidden? . #t)))
5537 (arguments
5538 (substitute-keyword-arguments (package-arguments java-asm)
5539 ;; Explicitely use an ant version that includes the junit tasks, since
5540 ;; it is a dependency of junit.
5541 ((#:ant _ ant/java7) ant/java7)
5542 ((#:tests? _) #f)))
5543 (native-inputs `())))
5544
5545(define-public java-asm-3
5546 (package
5547 (inherit java-asm)
5548 (version "3.1")
5549 (source (origin
5550 (method git-fetch)
5551 (uri (git-reference
5552 (url "https://gitlab.ow2.org/asm/asm")
5553 (commit "ASM_3_1")))
5554 (file-name (git-file-name "java-asm" version))
5555 (sha256
5556 (base32
5557 "0xbyf2sl8j6mrvfpg2da0vjdp906rac62l66gkk82x5cn3vc30h4"))
5558 (modules '((guix build utils)))
5559 (snippet `(for-each delete-file (find-files "." "\\.jar$")))))
5560 (arguments
5561 `(#:build-target "jar"
5562 #:test-target "test"
5563 #:tests? #f; require legacy test software
5564 #:phases
5565 (modify-phases %standard-phases
5566 (replace 'install (install-jars "output/dist"))
5567 (delete 'generate-jar-indices))))
5568 (native-inputs (list java-ow-util-ant-tasks))))
5569
5570(define-public java-asm-8
5571 (package
5572 (inherit java-asm)
5573 (version "8.0.1")
5574 (source (origin
5575 (method git-fetch)
5576 (uri (git-reference
5577 (url "https://gitlab.ow2.org/asm/asm")
5578 (commit (string-append
5579 "ASM_" (string-join (string-split version #\.)
5580 "_")))))
5581 (file-name (git-file-name "java-asm" version))
5582 (sha256
5583 (base32
5584 "1s6j27zc1i76gh891w2g48b1c3abp9w8zp5j54yb1vm5h8djkd69"))))
5585 (arguments
5586 `(#:jar-name "asm8.jar"
5587 #:source-dir "asm/src/main/java"
5588 #:test-dir "asm/src/test"
5589 ;; tests depend on junit5
5590 #:tests? #f))
5591 (propagated-inputs '())
5592 (native-inputs '())))
5593
5594(define-public java-asm-tree-8
5595 (package
5596 (inherit java-asm-8)
5597 (name "java-asm-tree")
5598 (arguments
5599 `(#:jar-name "asm-tree.jar"
5600 #:source-dir "asm-tree/src/main/java"
5601 #:test-dir "asm-tree/src/test"
5602 ;; tests depend on junit5
5603 #:tests? #f))
5604 (inputs
5605 (list java-asm-8))))
5606
5607(define-public java-asm-analysis-8
5608 (package
5609 (inherit java-asm-8)
5610 (name "java-asm-analysis")
5611 (arguments
5612 `(#:jar-name "asm-analysis.jar"
5613 #:source-dir "asm-analysis/src/main/java"
5614 #:test-dir "asm-analysis/src/test"
5615 ;; tests depend on junit5
5616 #:tests? #f))
5617 (inputs
5618 (list java-asm-8 java-asm-tree-8))))
5619
5620(define-public java-asm-util-8
5621 (package
5622 (inherit java-asm-8)
5623 (name "java-asm-util")
5624 (arguments
5625 `(#:jar-name "asm-util8.jar"
5626 #:source-dir "asm-util/src/main/java"
5627 #:test-dir "asm-util/src/test"
5628 ;; tests depend on junit5
5629 #:tests? #f))
5630 (inputs
5631 (list java-asm-8 java-asm-analysis-8 java-asm-tree-8))))
5632
5633(define-public java-asm-commons-8
5634 (package
5635 (inherit java-asm-8)
5636 (name "java-asm-commons")
5637 (arguments
5638 (list #:jar-name "asm-commons8.jar"
5639 #:source-dir "asm-commons/src/main/java"
5640 #:test-dir "asm-commons/src/test"
5641 ;; tests depend on junit5
5642 #:tests? #f))
5643 (inputs (list java-asm-8 java-asm-analysis-8 java-asm-tree-8))))
5644
5645(define (generate-asm-pom package)
5646 "Return a build phase generating the pom.xml of org.ow2.asm:asm at the
5647version of PACKAGE."
5648 #~(generate-pom.xml "pom.xml" "org.ow2.asm" "asm"
5649 #$(package-version package)))
5650
5651(define-public java-asm-9
5652 (package
5653 (inherit java-asm)
5654 (version "9.4")
5655 (source (origin
5656 (method git-fetch)
5657 (uri (git-reference
5658 (url "https://gitlab.ow2.org/asm/asm")
5659 (commit "ASM_9_4")))
5660 (file-name (git-file-name "java-asm" version))
5661 (sha256
5662 (base32
5663 "0c00m638skr5md1p6y1c2xn11kj5w6sjapyvwp9mh70rw095bwzk"))))
5664 (arguments
5665 (list #:jar-name "asm9.jar"
5666 #:source-dir "asm/src/main/java"
5667 #:test-dir "asm/src/test"
5668 ;; tests depend on junit5
5669 #:tests? #f
5670 #:phases
5671 #~(modify-phases %standard-phases
5672 (add-before 'install 'generate-pom.xml
5673 #$(generate-asm-pom this-package))
5674 (replace 'install
5675 (install-from-pom "pom.xml")))))
5676 (propagated-inputs '())
5677 (native-inputs '())))
5678
5679(define-public java-asm-tree-9
5680 (package
5681 (inherit java-asm-9)
5682 (name "java-asm-tree")
5683 (arguments
5684 `(#:jar-name "asm-tree.jar"
5685 #:source-dir "asm-tree/src/main/java"
5686 #:test-dir "asm-tree/src/test"
5687 ;; tests depend on junit5
5688 #:tests? #f))
5689 (inputs
5690 (list java-asm-9))))
5691
5692(define-public java-asm-analysis-9
5693 (package
5694 (inherit java-asm-9)
5695 (name "java-asm-analysis")
5696 (arguments
5697 `(#:jar-name "asm-analysis.jar"
5698 #:source-dir "asm-analysis/src/main/java"
5699 #:test-dir "asm-analysis/src/test"
5700 ;; tests depend on junit5
5701 #:tests? #f))
5702 (inputs
5703 (list java-asm-9 java-asm-tree-9))))
5704
5705(define-public java-asm-util-9
5706 (package
5707 (inherit java-asm-9)
5708 (name "java-asm-util")
5709 (arguments
5710 `(#:jar-name "asm-util8.jar"
5711 #:source-dir "asm-util/src/main/java"
5712 #:test-dir "asm-util/src/test"
5713 ;; tests depend on junit5
5714 #:tests? #f))
5715 (inputs
5716 (list java-asm-9 java-asm-analysis-9 java-asm-tree-9))))
5717
5718(define-public java-asm-commons-9
5719 (package
5720 (inherit java-asm-9)
5721 (name "java-asm-commons")
5722 (arguments
5723 (list #:jar-name "asm-commons8.jar"
5724 #:source-dir "asm-commons/src/main/java"
5725 #:test-dir "asm-commons/src/test"
5726 ;; tests depend on junit5
5727 #:tests? #f))
5728 (inputs (list java-asm-9 java-asm-analysis-9 java-asm-tree-9))))
5729
5730(define-public java-asm-9.7.1
5731 (package
5732 (inherit java-asm-9)
5733 (name "java-asm")
5734 (version "9.7.1")
5735 (source
5736 (origin
5737 (method git-fetch)
5738 (uri (git-reference
5739 (url "https://gitlab.ow2.org/asm/asm.git")
5740 (commit "ASM_9_7_1")))
5741 (file-name (git-file-name "java-asm" version))
5742 (sha256
5743 (base32 "0q1i01al9mpggf3256iwmhx9yj9pg52v4vi1gdni2x9jcikq65lf"))))))
5744
5745(define-public java-asm-tree-9.7.1
5746 (package
5747 (inherit java-asm-tree-9)
5748 (name "java-asm-tree")
5749 (version (package-version java-asm-9.7.1))
5750 (source (package-source java-asm-9.7.1))
5751 (inputs
5752 (list java-asm-9.7.1))))
5753
5754(define-public java-asm-analysis-9.7.1
5755 (package
5756 (inherit java-asm-analysis-9)
5757 (name "java-asm-analysis")
5758 (version (package-version java-asm-9.7.1))
5759 (source (package-source java-asm-9.7.1))
5760 (inputs
5761 (list java-asm-9.7.1
5762 java-asm-tree-9.7.1))))
5763
5764(define-public java-asm-commons-9.7.1
5765 (package
5766 (inherit java-asm-commons-9)
5767 (name "java-asm-commons")
5768 (version (package-version java-asm-9.7.1))
5769 (source (package-source java-asm-9.7.1))
5770 (inputs
5771 (list java-asm-9.7.1
5772 java-asm-analysis-9.7.1
5773 java-asm-tree-9.7.1))))
5774
5775(define-public java-asm-9.10
5776 (package
5777 (inherit java-asm-9)
5778 (name "java-asm")
5779 (version "9.10.1")
5780 (source
5781 (origin
5782 (method git-fetch)
5783 (uri (git-reference
5784 (url "https://gitlab.ow2.org/asm/asm.git")
5785 (commit "ASM_9_10_1")))
5786 (file-name (git-file-name "java-asm" version))
5787 (sha256
5788 (base32 "0rshbybb6piw2s9lp8qmsnz3qvd69ks83fn2ci5kams8cmyyma4a"))))
5789 (arguments
5790 (substitute-keyword-arguments (package-arguments java-asm-9)
5791 ((#:phases phases)
5792 #~(modify-phases #$phases
5793 (replace 'generate-pom.xml
5794 #$(generate-asm-pom this-package))))
5795 ((#:jdk _ #f) openjdk11)
5796 ((#:make-flags _ #f)
5797 ;; Compile with openjdk11 (for the 'Deprecated.forRemoval' API) but
5798 ;; emit Java 8 byte code so the jars stay usable by icedtea-8 builds.
5799 #~(list "-Dant.build.javac.source=8"
5800 "-Dant.build.javac.target=8"))))))
5801
5802(define-public java-asm-tree-9.10
5803 (package
5804 (inherit java-asm-tree-9)
5805 (name "java-asm-tree")
5806 (version (package-version java-asm-9.10))
5807 (source (package-source java-asm-9.10))
5808 (arguments
5809 (list #:jar-name "asm-tree.jar"
5810 #:source-dir "asm-tree/src/main/java"
5811 #:test-dir "asm-tree/src/test"
5812 #:tests? #f
5813 #:jdk openjdk11
5814 #:make-flags #~(list "-Dant.build.javac.source=8"
5815 "-Dant.build.javac.target=8")))
5816 (inputs
5817 (list java-asm-9.10))))
5818
5819(define-public java-asm-analysis-9.10
5820 (package
5821 (inherit java-asm-analysis-9)
5822 (name "java-asm-analysis")
5823 (version (package-version java-asm-9.10))
5824 (source (package-source java-asm-9.10))
5825 (arguments
5826 (list #:jar-name "asm-analysis.jar"
5827 #:source-dir "asm-analysis/src/main/java"
5828 #:test-dir "asm-analysis/src/test"
5829 #:tests? #f
5830 #:jdk openjdk11
5831 #:make-flags #~(list "-Dant.build.javac.source=8"
5832 "-Dant.build.javac.target=8")))
5833 (inputs
5834 (list java-asm-9.10
5835 java-asm-tree-9.10))))
5836
5837(define-public java-asm-commons-9.10
5838 (package
5839 (inherit java-asm-commons-9)
5840 (name "java-asm-commons")
5841 (version (package-version java-asm-9.10))
5842 (source (package-source java-asm-9.10))
5843 (arguments
5844 (substitute-keyword-arguments (package-arguments java-asm-commons-9)
5845 ((#:jdk _ #f) openjdk11)
5846 ((#:make-flags _ #f)
5847 #~(list "-Dant.build.javac.source=8"
5848 "-Dant.build.javac.target=8"))))
5849 (inputs
5850 (list java-asm-9.10
5851 java-asm-analysis-9.10
5852 java-asm-tree-9.10))))
5853
5854(define-public java-cglib
5855 (package
5856 (name "java-cglib")
5857 (version "3.3.0")
5858 (source
5859 (origin
5860 (method git-fetch)
5861 (uri (git-reference
5862 (url "https://github.com/cglib/cglib")
5863 (commit (string-append
5864 "RELEASE_"
5865 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
5866 version)))))
5867 (file-name (git-file-name name version))
5868 (sha256
5869 (base32 "1lnscamc6bnhh7jgij5garxagp3zn2jp4cbq0rsn4xr3l0cnd014"))))
5870 (build-system ant-build-system)
5871 (arguments
5872 `(;; FIXME: tests fail because junit runs
5873 ;; "net.sf.cglib.transform.AbstractTransformTest", which does not seem
5874 ;; to describe a test at all.
5875 #:tests? #f
5876 #:jar-name "cglib.jar"
5877 #:phases
5878 (modify-phases %standard-phases
5879 (add-after 'unpack 'chdir
5880 (lambda _ (chdir "cglib") #t)))))
5881 (native-inputs (list java-junit))
5882 (propagated-inputs (list java-asm-8))
5883 (home-page "https://github.com/cglib/cglib/")
5884 (synopsis "Java byte code generation library")
5885 (description "The byte code generation library CGLIB is a high level API
5886to generate and transform Java byte code.")
5887 (license license:asl2.0)))
5888
5889(define-public java-objenesis
5890 (package
5891 (name "java-objenesis")
5892 (version "3.3")
5893 (source (origin
5894 (method git-fetch)
5895 (uri (git-reference
5896 (url "https://github.com/easymock/objenesis")
5897 (commit version)))
5898 (file-name (git-file-name name version))
5899 (sha256
5900 (base32
5901 "1brlcn536p4s1v1f3vzxhr38lvyhc33wjrbj2x06kdrd8agy90cr"))))
5902 (build-system ant-build-system)
5903 (arguments
5904 `(#:tests? #f; require junit-5
5905 #:jar-name "objenesis.jar"
5906 #:source-dir "main/src/main/java"
5907 #:test-dir "main/src/test/"))
5908 (native-inputs
5909 (list java-junit java-hamcrest-core))
5910 (home-page "http://objenesis.org/")
5911 (synopsis "Bypass the constructor when creating an object")
5912 (description "Objenesis is a small Java library that serves one purpose:
5913to instantiate a new object of a particular class. It is common to see
5914restrictions in libraries stating that classes must require a default
5915constructor. Objenesis aims to overcome these restrictions by bypassing the
5916constructor on object instantiation.")
5917 (license license:asl2.0)))
5918
5919(define-public java-easymock
5920 (package
5921 (name "java-easymock")
5922 (version "3.4")
5923 (source (origin
5924 (method git-fetch)
5925 (uri (git-reference
5926 (url "https://github.com/easymock/easymock/")
5927 (commit (string-append "easymock-" version))))
5928 (file-name (git-file-name name version))
5929 (sha256
5930 (base32
5931 "02vybm8hc0i0n9sp2f2iiqn54zwqhq835f76wc6b2m7819z5a8dq"))))
5932 (build-system ant-build-system)
5933 (arguments
5934 `(#:jar-name "easymock.jar"
5935 #:source-dir "core/src/main"
5936 #:test-dir "core/src/test"
5937 #:phases
5938 (modify-phases %standard-phases
5939 ;; FIXME: Android support requires the following packages to be
5940 ;; available: com.google.dexmaker.stock.ProxyBuilder
5941 (add-after 'unpack 'delete-android-support
5942 (lambda _
5943 (with-directory-excursion "core/src/main/java/org/easymock/internal"
5944 (substitute* "MocksControl.java"
5945 (("AndroidSupport.isAndroid\\(\\)") "false")
5946 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
5947 (delete-file "AndroidClassProxyFactory.java"))
5948 #t))
5949 (add-after 'unpack 'delete-broken-tests
5950 (lambda _
5951 (with-directory-excursion "core/src/test/java/org/easymock"
5952 ;; This test depends on dexmaker.
5953 (delete-file "tests2/ClassExtensionHelperTest.java")
5954
5955 ;; This is not a test.
5956 (delete-file "tests/BaseEasyMockRunnerTest.java")
5957
5958 ;; This test should be executed with a different runner...
5959 (delete-file "tests2/EasyMockAnnotationsTest.java")
5960 ;; ...but deleting it means that we also have to delete these
5961 ;; dependent files.
5962 (delete-file "tests2/EasyMockRunnerTest.java")
5963 (delete-file "tests2/EasyMockRuleTest.java")
5964
5965 ;; This test fails because the file "easymock.properties" does
5966 ;; not exist.
5967 (delete-file "tests2/EasyMockPropertiesTest.java"))
5968 #t)))))
5969 (inputs
5970 (list java-cglib java-objenesis))
5971 (native-inputs
5972 (list java-junit java-hamcrest-core))
5973 (home-page "https://easymock.org/")
5974 (synopsis "Java library providing mock objects for unit tests")
5975 (description "EasyMock is a Java library that provides an easy way to use
5976mock objects in unit testing.")
5977 (license license:asl2.0)))
5978
5979(define-public java-easymock-3.2
5980 (package
5981 (inherit java-easymock)
5982 (name "java-easymock")
5983 (version "3.2")
5984 (source (origin
5985 (method git-fetch)
5986 (uri (git-reference
5987 (url "https://github.com/easymock/easymock/")
5988 (commit (string-append "easymock-" version))))
5989 (file-name (git-file-name name version))
5990 (sha256
5991 (base32
5992 "0cn6qqa261mhk9mwxrsz39lkkknfv2h7iprr5zw7wpz9p96dwgv4"))))
5993 (arguments
5994 (list #:jar-name "easymock.jar"
5995 #:source-dir "easymock/src/main"
5996 #:test-dir "easymock/src/test"
5997 #:phases
5998 #~(modify-phases %standard-phases
5999 (add-after 'unpack 'delete-android-support
6000 (lambda _
6001 (with-directory-excursion "easymock/src/main/java/org/easymock/internal"
6002 (substitute* "MocksControl.java"
6003 (("AndroidSupport.isAndroid\\(\\)") "false")
6004 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
6005 (delete-file "AndroidClassProxyFactory.java"))))
6006 (add-after 'unpack 'delete-broken-tests
6007 (lambda _
6008 (with-directory-excursion "easymock/src/test/java/org/easymock"
6009 ;; This test depends on dexmaker.
6010 (delete-file "tests2/ClassExtensionHelperTest.java")
6011 ;; This is not a test.
6012 (delete-file "tests/BaseEasyMockRunnerTest.java")
6013 ;; ...but deleting it means that we also have to delete these
6014 ;; dependent files.
6015 (delete-file "tests2/EasyMockRunnerTest.java")
6016 ;; This test fails because the file "easymock.properties" does
6017 ;; not exist.
6018 (delete-file "tests2/EasyMockPropertiesTest.java")))))))))
6019
6020(define-public java-easymock-class-extension
6021 (package
6022 (inherit java-easymock-3.2)
6023 (name "java-easymock-class-extension")
6024 (build-system ant-build-system)
6025 (arguments
6026 (list #:jar-name "easymock-class-extensions.jar"
6027 #:source-dir "easymock-classextension/src/main/java"
6028 #:test-dir "easymock-classextension/src/test"))
6029 (inputs (list java-asm-8
6030 java-easymock-3.2
6031 java-cglib
6032 java-objenesis))
6033 (native-inputs
6034 (list java-junit java-hamcrest-core))
6035 (home-page "https://easymock.org/")
6036 (synopsis "Easymock extension to mock classes")
6037 (description "This package provides an extension to earlier versions of
6038easymock that allows mocking classes.")
6039 (license license:asl2.0)))
6040
6041(define-public java-jmock-1
6042 (package
6043 (name "java-jmock")
6044 (version "1.2.0")
6045 (source (origin
6046 (method git-fetch)
6047 (uri (git-reference
6048 (url "https://github.com/jmock-developers/jmock-library")
6049 (commit version)))
6050 (file-name (git-file-name name version))
6051 (sha256
6052 (base32
6053 "0lkga995xd9b9mmzxmcd301hlw83p1h78nibh7djlx7wydscr85z"))))
6054 (build-system ant-build-system)
6055 (arguments
6056 `(#:build-target "jars"
6057 #:test-target "run.tests"
6058 #:phases
6059 (modify-phases %standard-phases
6060 (replace 'install (install-jars "build")))))
6061 (home-page "http://jmock.org/")
6062 (synopsis "Mock object library for test-driven development")
6063 (description "JMock is a library that supports test-driven development of
6064Java code with mock objects. Mock objects help you design and test the
6065interactions between the objects in your programs.
6066
6067The jMock library
6068
6069@itemize
6070@item makes it quick and easy to define mock objects
6071@item lets you precisely specify the interactions between
6072 your objects, reducing the brittleness of your tests
6073@item plugs into your favourite test framework
6074@item is easy to extend.
6075@end itemize\n")
6076 (license license:bsd-3)))
6077
6078(define-public java-jmock
6079 (package
6080 (inherit java-jmock-1)
6081 (name "java-jmock")
6082 (version "2.8.2")
6083 (source (origin
6084 (method git-fetch)
6085 (uri (git-reference
6086 (url "https://github.com/jmock-developers/jmock-library")
6087 (commit version)))
6088 (file-name (git-file-name name version))
6089 (sha256
6090 (base32
6091 "12b7l22g3nrjvf2dzcw3z03fpd2chrgp0d8xkvn8w55rwb57pax6"))))
6092 (inputs
6093 (list java-hamcrest-all java-bsh java-junit))
6094 (native-inputs
6095 `(("cglib" ,java-cglib)))
6096 (arguments
6097 `(#:jar-name "java-jmock.jar"
6098 #:source-dir "jmock/src/main/java"
6099 #:test-dir "jmock/src/test"))))
6100
6101(define-public java-jmock-junit4
6102 (package
6103 (inherit java-jmock)
6104 (name "java-jmock-junit4")
6105 (arguments
6106 `(#:jar-name "java-jmock-junit4.jar"
6107 #:source-dir "jmock-junit4/src/main/java"
6108 #:test-dir "jmock-junit4/src/test"))
6109 (inputs
6110 `(("java-hamcrest-all" ,java-hamcrest-all)
6111 ("java-bsh" ,java-bsh)
6112 ("java-jmock" ,java-jmock)
6113 ("java-jumit" ,java-junit)))))
6114
6115(define-public java-jmock-legacy
6116 (package
6117 (inherit java-jmock)
6118 (name "java-jmock-legacy")
6119 (arguments
6120 `(#:jar-name "java-jmock-legacy.jar"
6121 #:source-dir "jmock-legacy/src/main/java"
6122 #:test-dir "jmock-legacy/src/test"
6123 #:phases
6124 (modify-phases %standard-phases
6125 (add-before 'check 'copy-tests
6126 (lambda _
6127 ;; This file is a dependancy of some tests
6128 (let ((file "org/jmock/test/acceptance/PackageProtectedType.java"))
6129 (copy-file (string-append "jmock/src/test/java/" file)
6130 (string-append "jmock-legacy/src/test/java/" file))
6131 #t))))))
6132 (inputs
6133 (list java-hamcrest-all
6134 java-objenesis
6135 java-cglib
6136 java-jmock
6137 java-bsh
6138 java-junit))
6139 (native-inputs
6140 (list java-jmock-junit4))))
6141
6142(define-public java-hamcrest-all
6143 (package (inherit java-hamcrest-core)
6144 (name "java-hamcrest-all")
6145 (properties `((superseded . ,java-hamcrest)))
6146 (arguments
6147 `(#:jdk ,icedtea-8
6148 ,@(substitute-keyword-arguments (package-arguments java-hamcrest-core)
6149 ((#:build-target _) "bigjar")
6150 ((#:phases phases)
6151 `(modify-phases ,phases
6152 ;; Some build targets override the classpath, so we need to patch
6153 ;; the build.xml to ensure that required dependencies are on the
6154 ;; classpath.
6155 (add-after 'unpack 'patch-classpath-for-integration
6156 (lambda* (#:key inputs #:allow-other-keys)
6157 (substitute* "build.xml"
6158 ((" build/hamcrest-library-\\$\\{version\\}.jar" line)
6159 (string-join
6160 (cons line
6161 (append
6162 (find-files (assoc-ref inputs "java-junit") "\\.jar$")
6163 (find-files (assoc-ref inputs "java-jmock") "\\.jar$")
6164 (find-files (assoc-ref inputs "java-easymock") "\\.jar$")))
6165 ";"))
6166 (("build/hamcrest-core-\\$\\{version\\}\\.jar")
6167 (car (find-files (assoc-ref inputs "java-hamcrest-core")
6168 "jar$"))))
6169 #t))
6170 (replace 'install
6171 (lambda* (#:key outputs #:allow-other-keys)
6172 (let* ((target (string-append (assoc-ref outputs "out")
6173 "/share/java/"))
6174 (version-suffix
6175 ,(string-append
6176 "-" (package-version java-hamcrest-core) ".jar"))
6177 (install-without-version-suffix
6178 (lambda (jar)
6179 (copy-file jar
6180 (string-append target
6181 (basename jar version-suffix)
6182 ".jar")))))
6183 (mkdir-p target)
6184 (for-each
6185 install-without-version-suffix
6186 (find-files "build"
6187 (lambda (name _)
6188 (and (string-suffix? ".jar" name)
6189 (not (string-suffix? "-sources.jar" name)))))))
6190 #t)))))))
6191 (inputs
6192 (modify-inputs inputs
6193 (prepend java-junit
6194 java-jmock-1
6195 ;; This is necessary because of what seems to be a race condition.
6196 ;; This package would sometimes fail to build because hamcrest-core.jar
6197 ;; could not be found, even though it is built as part of this package.
6198 ;; Adding java-hamcrest-core appears to fix this problem. See
6199 ;; https://debbugs.gnu.org/31390 for more information.
6200 java-hamcrest-core
6201 java-easymock)))))
6202
6203(define-public java-jopt-simple
6204 (package
6205 (name "java-jopt-simple")
6206 (version "5.0.3")
6207 (source (origin
6208 (method url-fetch)
6209 (uri (string-append "https://repo1.maven.org/maven2/"
6210 "net/sf/jopt-simple/jopt-simple/"
6211 version "/jopt-simple-"
6212 version "-sources.jar"))
6213 (sha256
6214 (base32
6215 "1v8bzmwmw6qq20gm42xyay6vrd567dra4vqwhgjnqqjz1gs9f8qa"))))
6216 (build-system ant-build-system)
6217 (arguments
6218 `(#:tests? #f ; there are no tests
6219 #:jar-name "jopt-simple.jar"
6220 #:phases
6221 (modify-phases %standard-phases
6222 (add-before 'build 'copy-resources
6223 ;; The message bundles (ExceptionMessages.properties,
6224 ;; HelpFormatterMessages.properties) live next to the sources and
6225 ;; are loaded at run time.
6226 (lambda _
6227 (let ((classes-dir (string-append (getcwd) "/build/classes")))
6228 (with-directory-excursion "src"
6229 (for-each
6230 (lambda (resource)
6231 (install-file resource
6232 (string-append classes-dir "/"
6233 (dirname resource))))
6234 (find-files "." "\\.properties$"))))))
6235 (add-before 'install 'create-pom
6236 (generate-pom.xml "pom.xml" "net.sf.jopt-simple" "jopt-simple" ,version))
6237 (replace 'install
6238 (install-from-pom "pom.xml")))))
6239 (home-page "https://jopt-simple.github.io/jopt-simple/")
6240 (synopsis "Java library for parsing command line options")
6241 (description "JOpt Simple is a Java library for parsing command line
6242options, such as those you might pass to an invocation of @code{javac}. In
6243the interest of striving for simplicity, as closely as possible JOpt Simple
6244attempts to honor the command line option syntaxes of POSIX @code{getopt} and
6245GNU @code{getopt_long}. It also aims to make option parser configuration and
6246retrieval of options and their arguments simple and expressive, without being
6247overly clever.")
6248 (license license:expat)))
6249
6250;; Required by jmh
6251(define-public java-jopt-simple-4
6252 (package
6253 (inherit java-jopt-simple)
6254 (version "4.6")
6255 (source (origin
6256 (method url-fetch)
6257 (uri (string-append "https://repo1.maven.org/maven2/"
6258 "net/sf/jopt-simple/jopt-simple/"
6259 version "/jopt-simple-"
6260 version "-sources.jar"))
6261 (sha256
6262 (base32
6263 "0ny82zczxkn201ld0b7rps0ifzjhfs8m1ncdmy1f50145ciszkpd"))))
6264 (arguments
6265 (substitute-keyword-arguments (package-arguments java-jopt-simple)
6266 ((#:phases phases)
6267 `(modify-phases ,phases
6268 (replace 'create-pom
6269 (generate-pom.xml "pom.xml" "net.sf.jopt-simple" "jopt-simple"
6270 ,version))))))))
6271
6272(define-public java-commons-math3
6273 (package
6274 (name "java-commons-math3")
6275 (version "3.6.1")
6276 (source (origin
6277 (method url-fetch)
6278 (uri (string-append "mirror://apache/commons/math/source/"
6279 "commons-math3-" version "-src.tar.gz"))
6280 (sha256
6281 (base32
6282 "19l6yp44qc5g7wg816nbn5z3zq3xxzwimvbm4a8pczgvpi4i85s6"))))
6283 (build-system ant-build-system)
6284 (arguments
6285 `(#:build-target "jar"
6286 #:test-target "test"
6287 #:make-flags
6288 ,#~(let ((hamcrest #$(this-package-native-input "java-hamcrest-core"))
6289 (junit #$(this-package-native-input "java-junit")))
6290 (list (string-append "-Djunit.jar="
6291 (car (find-files junit "jar$")))
6292 (string-append "-Dhamcrest.jar="
6293 (car (find-files hamcrest ".*.jar$")))))
6294 #:phases
6295 (modify-phases %standard-phases
6296 ;; We want to build the jar in the build phase and run the tests
6297 ;; later in a separate phase.
6298 (add-after 'unpack 'untangle-targets
6299 (lambda _
6300 (substitute* "build.xml"
6301 (("name=\"jar\" depends=\"test\"")
6302 "name=\"jar\" depends=\"compile\""))))
6303 ;; There is no install target.
6304 (replace 'install
6305 (install-from-pom "pom.xml")))))
6306 (native-inputs
6307 (list java-junit java-hamcrest-core))
6308 (home-page "https://commons.apache.org/math/")
6309 (synopsis "Apache Commons mathematics library")
6310 (description "Commons Math is a library of lightweight, self-contained
6311mathematics and statistics components addressing the most common problems not
6312available in the Java programming language or Commons Lang.")
6313 (license license:asl2.0)))
6314
6315(define-public java-jmh
6316 (package
6317 (name "java-jmh")
6318 (version "1.37")
6319 (source (origin
6320 (method git-fetch)
6321 (uri (git-reference
6322 (url "https://github.com/openjdk/jmh")
6323 (commit version)))
6324 (file-name (git-file-name name version))
6325 (sha256
6326 (base32
6327 "06hfgnzqh1qg736s8ibznn6wljyjqg6yw1y14g8b0vrr5ivdm0ws"))))
6328 (build-system maven-build-system)
6329 (arguments
6330 `(#:exclude
6331 (("org.apache.maven.plugins" .
6332 ("maven-source-plugin" "maven-archetype-plugin" "maven-shade-plugin"
6333 "maven-site-plugin" "maven-javadoc-plugin" "maven-eclipse-plugin"
6334 ;; Only checks the Maven version, which is fixed by the build
6335 ;; system.
6336 "maven-enforcer-plugin"))
6337 ("com.mycila.maven-license-plugin" . ("maven-license-plugin"))
6338 ("org.apache.maven.wagon" . ("wagon-ssh")))
6339 #:phases
6340 (modify-phases %standard-phases
6341 (add-after 'unpack 'remove-unnecessary
6342 (lambda _
6343 ;; requires org.apache.maven.archetype:archetype-packaging.
6344 ;; Its subprojects also require groovy, kotlin and scala,
6345 ;; respectively.
6346 (delete-file-recursively "jmh-archetypes")
6347 ;; jmh-core-benchmarks depends on net.java.dev.jna:jna, whereas
6348 ;; java-native-access is installed as net.java.dev.jna:jna-jpms.
6349 ;; It is only JMH's own self-benchmark module and is not needed
6350 ;; to build or use the library.
6351 (delete-file-recursively "jmh-core-benchmarks"))))))
6352 (propagated-inputs
6353 (list java-jopt-simple
6354 java-commons-math3))
6355 (native-inputs
6356 (list java-junit
6357 java-hamcrest-core))
6358 (home-page "https://openjdk.java.net/projects/code-tools/jmh/")
6359 (synopsis "Benchmark harness for the JVM")
6360 (description "JMH is a Java harness for building, running, and analysing
6361nano/micro/milli/macro benchmarks written in Java and other languages
6362targeting the JVM.")
6363 ;; GPLv2 only
6364 (license license:gpl2)))
6365
6366(define-public java-commons-collections4
6367 (package
6368 (name "java-commons-collections4")
6369 (version "4.1")
6370 (source (origin
6371 (method url-fetch)
6372 (uri (string-append "mirror://apache/commons/collections/source/"
6373 "commons-collections4-" version "-src.tar.gz"))
6374 (sha256
6375 (base32
6376 "1krfhvggympq4avk7gh6qafzf6b9ip6r1m4lmacikyx04039m0wl"))))
6377 (build-system ant-build-system)
6378 (arguments
6379 `(#:test-target "test"
6380 #:make-flags
6381 ,#~(let ((hamcrest #$(this-package-native-input "java-hamcrest-core"))
6382 (junit #$(this-package-native-input "java-junit"))
6383 (easymock #$(this-package-native-input "java-easymock")))
6384 (list (string-append "-Djunit.jar="
6385 (car (find-files junit "jar$")))
6386 (string-append "-Dhamcrest.jar="
6387 (car (find-files hamcrest "jar$")))
6388 (string-append "-Deasymock.jar=" easymock
6389 "/share/java/easymock.jar")))
6390 #:phases
6391 (modify-phases %standard-phases
6392 (replace 'install
6393 (install-jars "target")))))
6394 (native-inputs
6395 (list java-junit java-hamcrest-core java-easymock))
6396 (home-page "https://commons.apache.org/collections/")
6397 (synopsis "Collections framework")
6398 (description "The Java Collections Framework is the recognised standard
6399for collection handling in Java. Commons-Collections seek to build upon the
6400JDK classes by providing new interfaces, implementations and utilities. There
6401are many features, including:
6402
6403@itemize
6404@item @code{Bag} interface for collections that have a number of copies of
6405 each object
6406@item @code{BidiMap} interface for maps that can be looked up from value to
6407 key as well and key to value
6408@item @code{MapIterator} interface to provide simple and quick iteration over
6409 maps
6410@item Transforming decorators that alter each object as it is added to the
6411 collection
6412@item Composite collections that make multiple collections look like one
6413@item Ordered maps and sets that retain the order elements are added in,
6414 including an LRU based map
6415@item Reference map that allows keys and/or values to be garbage collected
6416 under close control
6417@item Many comparator implementations
6418@item Many iterator implementations
6419@item Adapter classes from array and enumerations to collections
6420@item Utilities to test or create typical set-theory properties of collections
6421 such as union, intersection, and closure.
6422@end itemize\n")
6423 (license license:asl2.0)))
6424
6425(define-public java-commons-collections
6426 (package
6427 (inherit java-commons-collections4)
6428 (name "java-commons-collections")
6429 (version "3.2.2")
6430 (source (origin
6431 (method url-fetch)
6432 (uri (string-append "mirror://apache/commons/collections/source/"
6433 "commons-collections-" version "-src.tar.gz"))
6434 (sha256
6435 (base32
6436 "055r51a5lfc3z7rkxnxmnn1npvkvda7636hjpm4qk7cnfzz98387"))
6437 (patches
6438 (search-patches "java-commons-collections-fix-java8.patch"))))
6439 (arguments
6440 (substitute-keyword-arguments (package-arguments java-commons-collections4)
6441 ((#:phases phases)
6442 `(modify-phases ,phases
6443 ;; The manifest is required by the build procedure
6444 (add-before 'build 'add-manifest
6445 (lambda _
6446 (mkdir-p "build/conf")
6447 (call-with-output-file "build/conf/MANIFEST.MF"
6448 (lambda (file)
6449 (format file "Manifest-Version: 1.0\n")))
6450 #t))
6451 (replace 'install
6452 (install-jars "build"))))))))
6453
6454(define java-commons-collections-test-classes
6455 (package
6456 (inherit java-commons-collections)
6457 (arguments
6458 `(#:jar-name "commons-collections-test-classes.jar"
6459 #:source-dir "src/test"
6460 #:tests? #f))
6461 (inputs
6462 `(("collection" ,java-commons-collections)))))
6463
6464(define-public java-commons-beanutils
6465 (package
6466 (name "java-commons-beanutils")
6467 (version "1.9.3")
6468 (source (origin
6469 (method url-fetch)
6470 (uri (string-append "mirror://apache/commons/beanutils/source/"
6471 "commons-beanutils-" version "-src.tar.gz"))
6472 (sha256
6473 (base32
6474 "03cs0bq3sl1sdc7py9g3qnf8n9h473nrkvd3d251kaqv6a2ab7qk"))))
6475 (build-system ant-build-system)
6476 (arguments
6477 `(#:test-target "test"
6478 #:tests? #f
6479 #:phases
6480 (modify-phases %standard-phases
6481 (replace 'install
6482 (lambda* (#:key outputs #:allow-other-keys)
6483 (rename-file (string-append "dist/commons-beanutils-" ,version
6484 "-SNAPSHOT.jar")
6485 "commons-beanutils.jar")
6486 (install-file "commons-beanutils.jar"
6487 (string-append (assoc-ref outputs "out") "/share/java/"))
6488 #t)))))
6489 (inputs
6490 `(("logging" ,java-commons-logging-minimal)
6491 ("collections" ,java-commons-collections)))
6492 (native-inputs
6493 `(("junit" ,java-junit)
6494 ("collections-test" ,java-commons-collections-test-classes)))
6495 (home-page "https://commons.apache.org/beanutils/")
6496 (synopsis "Dynamically set or get properties in Java")
6497 (description "BeanUtils provides a simplified interface to reflection and
6498introspection to set or get dynamically determined properties through their
6499setter and getter method.")
6500 (license license:asl2.0)))
6501
6502(define-public java-commons-io
6503 (package
6504 (name "java-commons-io")
6505 (version "2.5")
6506 (source
6507 (origin
6508 (method url-fetch)
6509 (uri (string-append "mirror://apache/commons/io/source/"
6510 "commons-io-" version "-src.tar.gz"))
6511 (sha256
6512 (base32
6513 "0q5y41jrcjvx9hzs47x5kdhnasdy6rm4bzqd2jxl02w717m7a7v3"))))
6514 (build-system ant-build-system)
6515 (outputs '("out" "doc"))
6516 (arguments
6517 `(#:test-target "test"
6518 #:make-flags
6519 ,#~(list (string-append "-Djunit.jar="
6520 (car (find-files #$(this-package-native-input "java-junit")
6521 "jar$"))))
6522 #:phases
6523 (modify-phases %standard-phases
6524 (add-after 'build 'build-javadoc ant-build-javadoc)
6525 (replace 'install (install-from-pom "pom.xml"))
6526 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
6527 (native-inputs
6528 (list java-junit java-hamcrest-core))
6529 (propagated-inputs
6530 (list apache-commons-parent-pom-39))
6531 (home-page "https://commons.apache.org/io/")
6532 (synopsis "Common useful IO related classes")
6533 (description "Commons-IO contains utility classes, stream implementations,
6534file filters and endian classes.")
6535 (license license:asl2.0)))
6536
6537(define-public java-commons-io-latest
6538 (package
6539 (inherit java-commons-io)
6540 (version "2.21.0")
6541 (source
6542 (origin
6543 (method url-fetch)
6544 (uri (string-append "mirror://apache/commons/io/source/"
6545 "commons-io-" version "-src.tar.gz"))
6546 (sha256
6547 (base32
6548 "0rr6hb8mm7fd6nrr8f81mvdpfalq01k03l3mzrlxx7g7lda40mb3"))))
6549 (outputs '("out"))
6550 (arguments
6551 `(#:tests? #f ;; tests require too many not yet packaged packages
6552 #:source-dir "src/main/java"
6553 #:jar-name "commons-io.jar"
6554 #:phases
6555 (modify-phases %standard-phases
6556 (replace 'install (install-from-pom "pom.xml")))))
6557 (native-inputs
6558 (list))
6559 (propagated-inputs
6560 (list apache-commons-parent-pom-78))))
6561
6562(define-public java-commons-exec-1.1
6563 (package
6564 (name "java-commons-exec")
6565 (version "1.1")
6566 (source
6567 (origin
6568 (method url-fetch)
6569 (uri (string-append "mirror://apache/commons/exec/source/"
6570 "commons-exec-" version "-src.tar.gz"))
6571 (sha256
6572 (base32
6573 "025dk8xgj10lxwwwqp0hng2rn7fr4vcirxzydqzx9k4dim667alk"))))
6574 (build-system ant-build-system)
6575 (arguments
6576 `(#:test-target "test"
6577 #:make-flags
6578 ,#~(list (string-append "-Dmaven.junit.jar="
6579 (car (find-files #$(this-package-native-input "java-junit")
6580 "jar$"))))
6581 #:phases
6582 (modify-phases %standard-phases
6583 (add-before 'build 'delete-network-tests
6584 (lambda _
6585 (delete-file "src/test/java/org/apache/commons/exec/DefaultExecutorTest.java")
6586 (substitute* "src/test/java/org/apache/commons/exec/TestRunner.java"
6587 (("suite\\.addTestSuite\\(DefaultExecutorTest\\.class\\);") ""))
6588 #t))
6589 ;; The "build" phase automatically tests.
6590 (delete 'check)
6591 (replace 'install (install-jars "target")))))
6592 (native-inputs
6593 (list java-junit))
6594 (home-page "https://commons.apache.org/proper/commons-exec/")
6595 (synopsis "Common program execution related classes")
6596 (description "Commons-Exec simplifies executing external processes.")
6597 (license license:asl2.0)))
6598
6599(define-public java-commons-exec
6600 (package
6601 (inherit java-commons-exec-1.1)
6602 (version "1.3")
6603 (source
6604 (origin
6605 (method url-fetch)
6606 (uri (string-append "mirror://apache/commons/exec/source/"
6607 "commons-exec-" version "-src.tar.gz"))
6608 (sha256
6609 (base32
6610 "17yb4h6f8l49c5iyyvda4z2nmw0bxrx857nrwmsr7mmpb7x441yv"))))
6611 (arguments
6612 `(#:test-target "test"
6613 #:make-flags
6614 ,#~(list (string-append "-Dmaven.junit.jar="
6615 (car (find-files #$(this-package-native-input "java-junit")
6616 "jar$")))
6617 "-Dmaven.compiler.source=1.7"
6618 "-Dmaven.compiler.target=1.7")
6619 #:phases
6620 (modify-phases %standard-phases
6621 (add-before 'build 'delete-network-tests
6622 (lambda* (#:key inputs #:allow-other-keys)
6623 ;; This test hangs indefinitely.
6624 (delete-file "src/test/java/org/apache/commons/exec/issues/Exec60Test.java")
6625 (substitute* "src/test/java/org/apache/commons/exec/issues/Exec41Test.java"
6626 (("ping -c 10 127.0.0.1") "sleep 10"))
6627 (substitute* "src/test/java/org/apache/commons/exec/issues/Exec49Test.java"
6628 (("/bin/ls") "ls"))
6629 (call-with-output-file "src/test/scripts/ping.sh"
6630 (lambda (port)
6631 (format port "#!~a/bin/sh\nsleep $1\n"
6632 (assoc-ref inputs "bash"))))
6633 #t))
6634 ;; The "build" phase automatically tests.
6635 (delete 'check)
6636 (replace 'install (install-jars "target")))))
6637 (native-inputs
6638 (list java-junit java-hamcrest-core))))
6639
6640(define-public java-commons-lang
6641 (package
6642 (name "java-commons-lang")
6643 (version "2.6")
6644 (source
6645 (origin
6646 (method url-fetch)
6647 (uri (string-append "mirror://apache/commons/lang/source/"
6648 "commons-lang-" version "-src.tar.gz"))
6649 (sha256
6650 (base32 "1mxwagqadzx1b2al7i0z1v0r235aj2njdyijf02szq0vhmqrfiq5"))))
6651 (build-system ant-build-system)
6652 (outputs '("out" "doc"))
6653 (arguments
6654 `(#:test-target "test"
6655 #:test-exclude (list "**/Abstract*.java" "**/Random*.java")
6656 #:phases
6657 (modify-phases %standard-phases
6658 (add-after 'build 'build-javadoc ant-build-javadoc)
6659 (add-before 'check 'disable-failing-test
6660 (lambda _
6661 ;; Disable a failing test
6662 (substitute* "src/test/java/org/apache/commons/lang/\
6663time/FastDateFormatTest.java"
6664 (("public void testFormat\\(\\)")
6665 "public void disabled_testFormat()"))
6666 #t))
6667 (replace 'install (install-jars "target"))
6668 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
6669 (native-inputs
6670 (list java-junit))
6671 (home-page "https://commons.apache.org/lang/")
6672 (synopsis "Extension of the java.lang package")
6673 (description "The Commons Lang components contains a set of Java classes
6674that provide helper methods for standard Java classes, especially those found
6675in the @code{java.lang} package in the Sun JDK. The following classes are
6676included:
6677
6678@itemize
6679@item StringUtils - Helper for @code{java.lang.String}.
6680@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets
6681 of characters such as @code{[a-z]} and @code{[abcdez]}.
6682@item RandomStringUtils - Helper for creating randomised strings.
6683@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
6684@item NumberRange - A range of numbers with an upper and lower bound.
6685@item ObjectUtils - Helper for @code{java.lang.Object}.
6686@item SerializationUtils - Helper for serializing objects.
6687@item SystemUtils - Utility class defining the Java system properties.
6688@item NestedException package - A sub-package for the creation of nested
6689 exceptions.
6690@item Enum package - A sub-package for the creation of enumerated types.
6691@item Builder package - A sub-package for the creation of @code{equals},
6692 @code{hashCode}, @code{compareTo} and @code{toString} methods.
6693@end itemize\n")
6694 (license license:asl2.0)))
6695
6696(define-public java-commons-lang3
6697 (package
6698 (name "java-commons-lang3")
6699 (version "3.20.0")
6700 (source
6701 (origin
6702 (method url-fetch)
6703 (uri (string-append "mirror://apache/commons/lang/source/"
6704 "commons-lang3-" version "-src.tar.gz"))
6705 (sha256
6706 (base32 "05b2zfmw1y6bnzf7v32zkhix0c0sab82lmr3ilxciza0l5w6nwya"))))
6707 (build-system ant-build-system)
6708 (arguments
6709 `(#:jar-name "commons-lang3.jar"
6710 #:source-dir "src/main/java"
6711 #:tests? #f; require junit5
6712 #:phases
6713 (modify-phases %standard-phases
6714 (replace 'install (install-from-pom "pom.xml")))))
6715 (propagated-inputs
6716 (list apache-commons-parent-pom-92))
6717 (home-page "https://commons.apache.org/lang/")
6718 (synopsis "Extension of the java.lang package")
6719 (description "The Commons Lang components contains a set of Java classes
6720that provide helper methods for standard Java classes, especially those found
6721in the @code{java.lang} package. The following classes are included:
6722
6723@itemize
6724@item StringUtils - Helper for @code{java.lang.String}.
6725@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets of
6726 characters such as @code{[a-z]} and @code{[abcdez]}.
6727@item RandomStringUtils - Helper for creating randomised strings.
6728@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
6729@item NumberRange - A range of numbers with an upper and lower bound.
6730@item ObjectUtils - Helper for @code{java.lang.Object}.
6731@item SerializationUtils - Helper for serializing objects.
6732@item SystemUtils - Utility class defining the Java system properties.
6733@item NestedException package - A sub-package for the creation of nested
6734 exceptions.
6735@item Enum package - A sub-package for the creation of enumerated types.
6736@item Builder package - A sub-package for the creation of @code{equals},
6737 @code{hashCode}, @code{compareTo} and @code{toString} methods.
6738@end itemize\n")
6739 (license license:asl2.0)))
6740
6741(define-public java-commons-bsf
6742 (package
6743 (name "java-commons-bsf")
6744 (version "2.4.0")
6745 (source (origin
6746 (method url-fetch)
6747 (uri (string-append "mirror://apache/commons/bsf/source/bsf-src-"
6748 version ".tar.gz"))
6749 (sha256
6750 (base32
6751 "1sbamr8jl32p1jgf59nw0b2w9qivyg145954hm6ly54cfgsqrdas"))
6752 (modules '((guix build utils)))
6753 (snippet
6754 '(begin
6755 (for-each delete-file
6756 (find-files "." "\\.jar$"))
6757 #t))))
6758 (build-system ant-build-system)
6759 (arguments
6760 `(#:build-target "jar"
6761 #:tests? #f; No test file
6762 #:modules ((guix build ant-build-system)
6763 (guix build utils)
6764 (guix build java-utils)
6765 (sxml simple))
6766 #:phases
6767 (modify-phases %standard-phases
6768 (add-before 'build 'create-properties
6769 (lambda _
6770 ;; This file is missing from the distribution
6771 (call-with-output-file "build-properties.xml"
6772 (lambda (port)
6773 (sxml->xml
6774 `(project (@ (basedir ".") (name "build-properties") (default ""))
6775 (property (@ (name "project.name") (value "bsf")))
6776 (property (@ (name "source.level") (value "1.5")))
6777 (property (@ (name "build.lib") (value "build/jar")))
6778 (property (@ (name "src.dir") (value "src")))
6779 (property (@ (name "tests.dir") (value "src/org/apache/bsf/test")))
6780 (property (@ (name "build.tests") (value "build/test-classes")))
6781 (property (@ (name "build.dest") (value "build/classes"))))
6782 port)))
6783 #t))
6784 (replace 'install (install-jars "build")))))
6785 (native-inputs
6786 (list java-junit))
6787 (inputs
6788 (list java-commons-logging-minimal))
6789 (home-page "https://commons.apache.org/proper/commons-bsf")
6790 (synopsis "Bean Scripting Framework")
6791 (description "The Bean Scripting Framework (BSF) is a set of Java classes
6792which provides scripting language support within Java applications, and access
6793to Java objects and methods from scripting languages. BSF allows one to write
6794JSPs in languages other than Java while providing access to the Java class
6795library. In addition, BSF permits any Java application to be implemented in
6796part (or dynamically extended) by a language that is embedded within it. This
6797is achieved by providing an API that permits calling scripting language engines
6798from within Java, as well as an object registry that exposes Java objects to
6799these scripting language engines.")
6800 (properties '((upstream-name . "bsf")))
6801 (license license:asl2.0)))
6802
6803(define-public java-commons-jxpath
6804 (package
6805 (name "java-commons-jxpath")
6806 (version "1.3")
6807 (source (origin
6808 (method url-fetch)
6809 (uri (string-append "mirror://apache/commons/jxpath/source/"
6810 "commons-jxpath-" version "-src.tar.gz"))
6811 (sha256
6812 (base32
6813 "1rpgg31ayn9fwr4bfi2i1ij0npcg79ad2fv0w9hacvawsyc42cfs"))))
6814 (build-system ant-build-system)
6815 (arguments
6816 `(#:jar-name "commons-jxpath.jar"
6817 ;; tests require more dependencies, including mockrunner which depends on old software
6818 #:tests? #f
6819 #:source-dir "src/java"))
6820 (inputs
6821 `(("servlet" ,java-classpathx-servletapi)
6822 ("java-jdom" ,java-jdom)
6823 ("java-commons-beanutils" ,java-commons-beanutils)))
6824 (native-inputs
6825 (list java-junit))
6826 (home-page "https://commons.apache.org/jxpath/")
6827 (synopsis "Simple interpreter of an expression language called XPath")
6828 (description "The org.apache.commons.jxpath package defines a simple
6829interpreter of an expression language called XPath. JXPath applies XPath
6830expressions to graphs of objects of all kinds: JavaBeans, Maps, Servlet
6831contexts, DOM etc, including mixtures thereof.")
6832 (license license:asl2.0)))
6833
6834(define-public java-commons-pool
6835 (package
6836 (name "java-commons-pool")
6837 (version "2.6.2")
6838 (source (origin
6839 (method url-fetch)
6840 (uri (string-append "mirror://apache/commons/pool/source/"
6841 "commons-pool2-" version "-src.tar.gz"))
6842 (sha256
6843 (base32
6844 "1fi1hgqmq01bs6azbj3sfswxzadp2r8sjjfiq6ryilz1m50kvrv6"))))
6845 (arguments
6846 `(#:jar-name "common-pool.jar"
6847 #:source-dir "src/main/java"
6848 #:test-exclude
6849 (list "**/PerformanceTest.java")))
6850 (build-system ant-build-system)
6851 (inputs
6852 (list java-cglib))
6853 (native-inputs
6854 (list java-junit java-hamcrest-core java-asm java-objenesis))
6855 (home-page "https://commons.apache.org/proper/commons-pool/")
6856 (synopsis "Object-pooling API in Java")
6857 (description "The commons-pool package provides an object-pooling API
6858and a number of object pool implementations. This package defines a
6859handful of pooling interfaces and some base classes that may be useful when
6860creating new pool implementations.")
6861 (properties '((upstream-name . "commons-pool2")))
6862 (license license:asl2.0)))
6863
6864(define-public java-commons-dbcp
6865 (package
6866 (name "java-commons-dbcp")
6867 (version "2.6.0")
6868 (source (origin
6869 (method url-fetch)
6870 (uri (string-append "mirror://apache/commons/dbcp/source/"
6871 "commons-dbcp2-" version "-src.tar.gz"))
6872 (sha256
6873 (base32
6874 "0axbvcbnf2l70fc3ybrlp3siw2w4ka9mia2pnx4py8gz54cpw3rc"))))
6875 (arguments
6876 `(#:source-dir "src/main/java"
6877 #:jar-name "java-commons-dbcp.jar"
6878 #:tests? #f)); requires apache-geronimo
6879 (inputs
6880 `(("java-commons-pool" ,java-commons-pool)
6881 ("java-commons-logging" ,java-commons-logging-minimal)
6882 ("java-jboss-transaction-api-spec" ,java-jboss-transaction-api-spec)))
6883 (native-inputs
6884 (list java-junit))
6885 (build-system ant-build-system)
6886 (home-page "https://commons.apache.org/proper/commons-dbcp/")
6887 (synopsis "Database Connection Pool for Java")
6888 (description "Commons-dbcp allows you to share a pool of database
6889connections between users. Creating a new connection for each user can be
6890time consuming and even unfeasible when the number of simultaneous users is
6891very large. This package provides a way to share a poole of connections to
6892reduce that load.")
6893 (properties '((upstream-name . "commons-dbcp2")))
6894 (license license:asl2.0)))
6895
6896(define-public java-commons-jcs
6897 (package
6898 (name "java-commons-jcs")
6899 (version "3.1")
6900 (source (origin
6901 (method url-fetch)
6902 (uri (string-append "mirror://apache/commons/jcs/source/"
6903 "commons-jcs3-dist-" version "-src.tar.gz"))
6904 (sha256
6905 (base32
6906 "0y1lm1xnsj99bf7y9mkvbzqfy8dr7ac8zcbkpsjgzb9vhabfsbac"))))
6907 (build-system ant-build-system)
6908 (arguments
6909 `(#:jar-name "commons-jcs.jar"
6910 #:source-dir "commons-jcs-core/src/main/java"
6911 #:test-dir "commons-jcs-core/src/test"
6912 #:tests? #f; requires hsqldb
6913 #:phases
6914 (modify-phases %standard-phases
6915 (add-before 'build 'copy-resources
6916 (lambda _
6917 (copy-recursively "commons-jcs-core/src/main/resources"
6918 "build/classes"))))))
6919 (propagated-inputs
6920 (list java-classpathx-servletapi
6921 java-commons-dbcp
6922 java-httpcomponents-httpclient
6923 java-httpcomponents-httpcore
6924 java-log4j-api))
6925 (native-inputs
6926 (list java-junit))
6927 (home-page "https://commons.apache.org/proper/commons-jcs/")
6928 (synopsis "Distributed caching system in Java")
6929 (description "JCS is a distributed caching system written in Java. It
6930is intended to speed up applications by providing a means to manage cached
6931data of various dynamic natures. Like any caching system, JCS is most useful
6932for high read, low put applications. Latency times drop sharply and
6933bottlenecks move away from the database in an effectively cached system.")
6934 (properties '((upstream-name . "commons-jcs3-dist")))
6935 (license license:asl2.0)))
6936
6937(define-public java-jsr250
6938 (package
6939 (name "java-jsr250")
6940 (version "1.3")
6941 (source (origin
6942 (method git-fetch)
6943 (uri (git-reference
6944 (url "https://github.com/javaee/javax.annotation")
6945 (commit version)))
6946 (file-name (git-file-name name version))
6947 (sha256
6948 (base32
6949 "1g22a9d75g01s9yxgdig0ss7i30j4ysnnp08gn4krn0wly4lpqq0"))))
6950 (build-system ant-build-system)
6951 (arguments
6952 `(#:tests? #f ; no tests included
6953 #:jdk ,icedtea-8
6954 #:jar-name "jsr250.jar"
6955 #:phases
6956 (modify-phases %standard-phases
6957 (replace 'install
6958 (install-from-pom "pom.xml")))))
6959 (propagated-inputs (list java-jvnet-parent-pom-3))
6960 (home-page "https://jcp.org/en/jsr/detail?id=250")
6961 (synopsis "Security-related annotations")
6962 (description "This package provides annotations for security. It provides
6963packages in the @code{javax.annotation} and @code{javax.annotation.security}
6964namespaces.")
6965 ;; either cddl or gpl2 only, with classpath exception
6966 (license (list license:cddl1.0
6967 license:gpl2))))
6968
6969(define-public java-jsr305
6970 (package
6971 (name "java-jsr305")
6972 (version "3.0.1")
6973 (source (origin
6974 (method url-fetch)
6975 (uri (string-append "https://repo1.maven.org/maven2/"
6976 "com/google/code/findbugs/"
6977 "jsr305/" version "/jsr305-"
6978 version "-sources.jar"))
6979 (sha256
6980 (base32
6981 "1rh6jin9v7jqpq3kf1swl868l8i94r636n03pzpsmgr8v0lh9j2n"))))
6982 (build-system ant-build-system)
6983 (arguments
6984 `(#:tests? #f ; no tests included
6985 #:jar-name "jsr305.jar"
6986 #:phases
6987 (modify-phases %standard-phases
6988 (add-before 'install 'create-pom
6989 (generate-pom.xml "pom.xml" "com.google.code.findbugs" "jsr305" ,version))
6990 (replace 'install
6991 (install-from-pom "pom.xml")))))
6992 (home-page "https://findbugs.sourceforge.net/")
6993 (synopsis "Annotations for the static analyzer called findbugs")
6994 (description "This package provides annotations for the findbugs package.
6995It provides packages in the @code{javax.annotations} namespace.")
6996 (license license:asl2.0)))
6997
6998(define-public java-findbugs-annotations
6999 (package
7000 (name "java-findbugs-annotations")
7001 (version "3.0.1")
7002 (source (origin
7003 (method git-fetch)
7004 (uri (git-reference
7005 (url "https://github.com/findbugsproject/findbugs")
7006 (commit version)))
7007 (file-name (git-file-name name version))
7008 (sha256
7009 (base32
7010 "0zdf5hqj2g1ivxia8kw4g6gk98x6dsn4hfx8rl478150905kbq4y"))
7011 (modules '((guix build utils)))
7012 ;; Delete bundled jars.
7013 (snippet
7014 '(for-each delete-file (find-files "." "\\.jar$")))))
7015 (build-system ant-build-system)
7016 (arguments
7017 (list
7018 #:tests? #f ; no tests for the annotations
7019 #:jar-name "findbugs-annotations.jar"
7020 #:source-dir "annotations-src"
7021 #:phases
7022 #~(modify-phases %standard-phases
7023 ;; Pick only the namespace for the annotation classes.
7024 (add-after 'unpack 'select-annotation-sources
7025 (lambda _
7026 (let ((dir "annotations-src/edu/umd/cs/findbugs"))
7027 (mkdir-p dir)
7028 (copy-recursively
7029 "findbugs/src/java/edu/umd/cs/findbugs/annotations"
7030 (string-append dir "/annotations"))
7031 ;; The Confidence and Priority enums refer to this class,
7032 ;; which only defines constants.
7033 (install-file
7034 "findbugs/src/java/edu/umd/cs/findbugs/Priorities.java" dir)
7035 ;; Remove dependency to the BugRanker class.
7036 (substitute* (find-files dir "\\.java$")
7037 (("import edu.umd.cs.findbugs.BugRanker;") "")
7038 (("BugRanker.VISIBLE_RANK_MAX") "20"))
7039 #t)))
7040 (add-before 'install 'create-pom
7041 (generate-pom.xml "pom.xml" "com.google.code.findbugs" "annotations"
7042 #$version))
7043 (replace 'install
7044 (install-from-pom "pom.xml")))))
7045 (propagated-inputs (list java-jsr305))
7046 (home-page "https://findbugs.sourceforge.net/")
7047 (synopsis "Annotations for the FindBugs static analysis tool")
7048 (description "FindBugs is a static analysis tool that looks for bugs in
7049Java programs. This package provides the annotations from the
7050@code{edu.umd.cs.findbugs.annotations} namespace, most notably
7051@code{@@SuppressFBWarnings}, which suppresses individual FindBugs warnings on a
7052class or method, as well as annotations such as @code{@@CheckForNull} and
7053@code{@@Nullable}. Only the annotation classes are built, not the FindBugs
7054analysis engine itself.")
7055 (license license:lgpl2.1+)))
7056
7057(define-public java-error-prone-annotations
7058 (package
7059 (name "java-error-prone-annotations")
7060 (version "2.50.0")
7061 (source (origin
7062 (method git-fetch)
7063 (uri (git-reference
7064 (url "https://github.com/google/error-prone")
7065 (commit (string-append "v" version))))
7066 (file-name (git-file-name "java-error-prone" version))
7067 (sha256
7068 (base32
7069 "0bsk701n5qbnx5dcjxvq9fvs1nakw27nxxwcvkbgdjyhchjmb6fi"))))
7070 (build-system ant-build-system)
7071 (arguments
7072 `(#:tests? #f; no tests
7073 #:jdk ,openjdk11
7074 #:jar-name (string-append ,name "-" ,version ".jar")
7075 #:source-dir "annotations/src/main/java"
7076 #:test-dir "annotations/src/altest"
7077 #:make-flags (list "-Dant.build.javac.source=1.8"
7078 "-Dant.build.javac.target=1.8")
7079 #:phases
7080 (modify-phases %standard-phases
7081 ;; Compile the module descriptor while keeping compatibility with
7082 ;; java 1.8.
7083 (add-before 'build 'module-info
7084 (lambda _
7085 (let ((classes-dir (string-append (getcwd) "/build/classes"))
7086 (source-dir "annotations/src/main/java"))
7087 (mkdir-p classes-dir)
7088 (invoke "javac" "--release" "9" "-implicit:none"
7089 "-sourcepath" source-dir "-d" classes-dir
7090 (string-append source-dir "/module-info.java"))
7091 (delete-file (string-append source-dir "/module-info.java")))))
7092 (replace 'install (install-from-pom "annotations/pom.xml")))))
7093 (propagated-inputs (list java-error-prone-parent-pom))
7094 (home-page "https://errorprone.info")
7095 (synopsis "Java static analyzer at compile-time")
7096 (description "Error Prone is a static analysis tool for Java that catches
7097common programming mistakes at compile-time. This package contains annotations
7098used by programmers to guide the static analysis.")
7099 (license license:asl2.0)))
7100
7101(define java-error-prone-parent-pom
7102 (package
7103 (inherit java-error-prone-annotations)
7104 (name "java-error-prone-parent-pom")
7105 (arguments
7106 `(#:tests? #f
7107 #:phases
7108 (modify-phases %standard-phases
7109 (delete 'configure)
7110 (delete 'build)
7111 (replace 'install
7112 (install-pom-file "pom.xml")))))
7113 (propagated-inputs '())))
7114
7115(define-public java-guava
7116 (package
7117 (name "java-guava")
7118 (version "31.1")
7119 (source (origin
7120 (method git-fetch)
7121 (uri (git-reference
7122 (url "https://github.com/google/guava/")
7123 (commit (string-append "v" version))))
7124 (file-name (git-file-name name version))
7125 (sha256
7126 (base32
7127 "0sv1w5cnids9ad3l7qhrh3dh1wdqwc946iinsxryafr25wg5z1lp"))
7128 (patches
7129 (search-patches "java-guava-remove-annotation-deps.patch"))))
7130 (build-system ant-build-system)
7131 (arguments
7132 `(#:tests? #f ; no tests included
7133 #:jar-name "guava.jar"
7134 #:source-dir "guava/src"
7135 #:phases
7136 (modify-phases %standard-phases
7137 (add-after 'unpack 'trim-sources
7138 (lambda _
7139 (with-directory-excursion "guava/src/com/google/common"
7140 ;; Remove annotations to avoid extra dependencies:
7141 ;; * "j2objc" annotations are used when converting Java to
7142 ;; Objective C;
7143 ;; * "IgnoreJRERequirement" is used for Android.
7144 ;; * "Nullable" is used to catch NPE at build time.
7145 (substitute* (find-files "." "\\.java$")
7146 (("import com.google.j2objc.*") "")
7147 (("import org.checkerframework.checker.*") "")
7148 (("@ReflectionSupport.*") "")
7149 (("@WeakOuter") "")
7150 (("@RetainedWith") "")
7151 (("@Weak") "")
7152 (("@J2ObjCIncompatible") "")
7153 (("@IgnoreJRERequirement") "")
7154 (("@Nullable") "")))))
7155 ;; This is required by guava, but this is just an empty stub
7156 (add-before 'install 'install-listenablefuture-stub
7157 (install-pom-file "futures/listenablefuture9999/pom.xml"))
7158 (replace 'install (install-from-pom "guava/pom.xml")))))
7159 (inputs
7160 (list java-error-prone-annotations java-jsr305))
7161 (propagated-inputs
7162 (list java-guava-futures-failureaccess java-guava-parent-pom))
7163 (home-page "https://github.com/google/guava")
7164 (synopsis "Google core libraries for Java")
7165 (description "Guava is a set of core libraries that includes new
7166collection types (such as multimap and multiset), immutable collections, a
7167graph library, functional types, an in-memory cache, and APIs/utilities for
7168concurrency, I/O, hashing, primitives, reflection, string processing, and much
7169more!")
7170 (license license:asl2.0)))
7171
7172(define-public java-guava-futures-failureaccess
7173 (package
7174 (inherit java-guava)
7175 (name "java-guava-futures-failureaccess")
7176 (arguments
7177 `(#:tests? #f; no tests
7178 #:jar-name "guava-futures-failureaccess.jar"
7179 #:source-dir "futures/failureaccess/src"
7180 #:phases
7181 (modify-phases %standard-phases
7182 (replace 'install
7183 (install-from-pom "futures/failureaccess/pom.xml")))))
7184 (propagated-inputs
7185 `(("java-sonatype-oss-parent-pom" ,java-sonatype-oss-parent-pom-7)))))
7186
7187(define java-guava-parent-pom
7188 (package
7189 (inherit java-guava)
7190 (name "java-guava-parent-pom")
7191 (arguments
7192 `(#:tests? #f
7193 #:phases
7194 (modify-phases %standard-phases
7195 (delete 'configure)
7196 (delete 'build)
7197 (replace 'install
7198 (install-pom-file "pom.xml")))))
7199 (propagated-inputs
7200 `(("java-sonatype-oss-parent-pom" ,java-sonatype-oss-parent-pom-7)))))
7201
7202;; The java-commons-logging package provides adapters to many different
7203;; logging frameworks. To avoid an excessive dependency graph we try to build
7204;; it with only a minimal set of adapters.
7205(define-public java-commons-logging-minimal
7206 (package
7207 (name "java-commons-logging-minimal")
7208 (version "1.2")
7209 (source (origin
7210 (method url-fetch)
7211 (uri (string-append "mirror://apache/commons/logging/source/"
7212 "commons-logging-" version "-src.tar.gz"))
7213 (sha256
7214 (base32
7215 "10bwcy5w8d7y39n0krlwhnp8ds3kj5zhmzj0zxnkw0qdlsjmsrj9"))))
7216 (build-system ant-build-system)
7217 (arguments
7218 `(#:tests? #f ; avoid dependency on logging frameworks
7219 #:jar-name "commons-logging-minimal.jar"
7220 #:phases
7221 (modify-phases %standard-phases
7222 (add-after 'unpack 'delete-adapters-and-tests
7223 (lambda _
7224 ;; Delete all adapters except for NoOpLog, SimpleLog, and
7225 ;; LogFactoryImpl. NoOpLog is required to build; LogFactoryImpl
7226 ;; is used by applications; SimpleLog is the only actually usable
7227 ;; implementation that does not depend on another logging
7228 ;; framework.
7229 (for-each
7230 (lambda (file)
7231 (delete-file (string-append
7232 "src/main/java/org/apache/commons/logging/impl/" file)))
7233 (list "Jdk13LumberjackLogger.java"
7234 "WeakHashtable.java"
7235 "Log4JLogger.java"
7236 "ServletContextCleaner.java"
7237 "Jdk14Logger.java"
7238 "AvalonLogger.java"
7239 "LogKitLogger.java"))
7240 (delete-file-recursively "src/test")
7241 #t))
7242
7243 (replace 'install
7244 (install-from-pom "pom.xml")))))
7245 (home-page "https://commons.apache.org/logging/")
7246 (synopsis "Common API for logging implementations")
7247 (description "The Logging package is a thin bridge between different
7248logging implementations. A library that uses the commons-logging API can be
7249used with any logging implementation at runtime.")
7250 (properties '((upstream-name . "commons-logging")))
7251 (license license:asl2.0)))
7252
7253;; This is the last release of the 1.x series.
7254(define-public java-mockito-1
7255 (package
7256 (name "java-mockito")
7257 (version "1.10.19")
7258 (source (origin
7259 (method url-fetch)
7260 (uri (string-append "https://repo1.maven.org/maven2/"
7261 "org/mockito/mockito-core/" version
7262 "/mockito-core-" version "-sources.jar"))
7263 (sha256
7264 (base32
7265 "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc"))))
7266 (build-system ant-build-system)
7267 (arguments
7268 `(#:jar-name "mockito.jar"
7269 #:tests? #f ; no tests included
7270 ;; FIXME: patch-and-repack does not support jars, so we have to apply
7271 ;; patches in build phases.
7272 #:phases
7273 (modify-phases %standard-phases
7274 ;; Mockito was developed against a different version of hamcrest,
7275 ;; which does not require matcher implementations to provide an
7276 ;; implementation of the "describeMismatch" method. We add this
7277 ;; simple definition to pass the build with our version of hamcrest.
7278 (add-after 'unpack 'fix-hamcrest-build-error
7279 (lambda _
7280 (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java"
7281 (("public Matcher getActualMatcher\\(\\) .*" line)
7282 (string-append "
7283 public void describeMismatch(Object item, Description description) {
7284 actualMatcher.describeMismatch(item, description);
7285 }"
7286 line)))
7287 #t))
7288 ;; Mockito bundles cglib. We have a cglib package, so let's use
7289 ;; that instead.
7290 (add-after 'unpack 'use-system-libraries
7291 (lambda _
7292 (with-directory-excursion "src/org/mockito/internal/creation/cglib"
7293 (substitute* '("CGLIBHacker.java"
7294 "CglibMockMaker.java"
7295 "ClassImposterizer.java"
7296 "DelegatingMockitoMethodProxy.java"
7297 "MethodInterceptorFilter.java"
7298 "MockitoNamingPolicy.java"
7299 "SerializableMockitoMethodProxy.java"
7300 "SerializableNoOp.java")
7301 (("import org.mockito.cglib") "import net.sf.cglib")))
7302 #t)))))
7303 (inputs
7304 (list java-junit java-objenesis java-cglib java-hamcrest-core))
7305 (home-page "http://mockito.org")
7306 (synopsis "Mockito is a mock library for Java")
7307 (description "Mockito is a mocking library for Java which lets you write
7308tests with a clean and simple API. It generates mocks using reflection, and
7309it records all mock invocations, including methods arguments.")
7310 (license license:asl2.0)))
7311
7312(define-public java-opentest4j
7313 (package
7314 (name "java-opentest4j")
7315 (version "1.3.0")
7316 (source (origin
7317 (method git-fetch)
7318 (uri (git-reference
7319 (url "https://github.com/ota4j-team/opentest4j")
7320 (commit (string-append "r" version))))
7321 (file-name (git-file-name name version))
7322 (sha256
7323 (base32
7324 "1z7krrl8j7l2v3c1qadbl7bydigbh4gqv9gqm7xcizq2iq2hgav5"))))
7325 (build-system ant-build-system)
7326 (arguments
7327 (list
7328 #:jar-name "opentest4j.jar"
7329 #:source-dir "src/main/java"
7330 #:test-include (list "**/*Tests.java")
7331 ;; Tests use local variable type inference ('var'), which requires
7332 ;; Java 10 or later.
7333 #:jdk openjdk11
7334 #:phases
7335 #~(modify-phases %standard-phases
7336 (add-before 'build 'set-release
7337 (lambda _
7338 ;; Only the tests require JDK 10+. Target Java 8 for the
7339 ;; main classes so that the jar stays usable by packages built
7340 ;; with the default JDK.
7341 (substitute* "build.xml"
7342 (("(<javac )([^>]+srcdir=\"src/main/java\"[^>]+/?>)"
7343 _ prefix suffix)
7344 (string-append prefix "release=\"8\" " suffix))))))))
7345 (home-page "https://github.com/ota4j-team/opentest4j")
7346 (native-inputs
7347 (list java-junit-4.13.2))
7348 (synopsis "Java assertion library")
7349 (description "This package provides a common set of exceptions that
7350testing libraries and frameworks for the JVM can use to report test failures.")
7351 (license license:asl2.0)))
7352
7353(define-public java-mockito-4
7354 (package
7355 (inherit java-mockito-1)
7356 (version "4.11.0")
7357 (source (origin
7358 (method url-fetch)
7359 (uri (string-append "https://repo1.maven.org/maven2/"
7360 "org/mockito/mockito-core/" version
7361 "/mockito-core-" version "-sources.jar"))
7362 (sha256
7363 (base32
7364 "1gvqghx4xlgk1snl01csdj3wlrwl2zg9acasiwsqgcff5jgisx1l"))))
7365 (arguments
7366 (list #:tests? #f ; no tests included
7367 #:jar-name "mockito.jar"
7368 #:phases
7369 #~(modify-phases %standard-phases
7370 (add-after 'unpack 'reference-unshaded-asm
7371 (lambda _
7372 (substitute* (find-files "src" "\\.java$")
7373 (("net\\.bytebuddy\\.jar\\.asm") "org.objectweb.asm")))))))
7374 (inputs '())
7375 (propagated-inputs
7376 (list java-byte-buddy-agent
7377 java-byte-buddy-dep
7378 java-objenesis
7379 java-junit
7380 java-opentest4j))))
7381
7382(define-public java-httpcomponents-httpcore
7383 (package
7384 (name "java-httpcomponents-httpcore")
7385 (version "4.4.6")
7386 (source (origin
7387 (method url-fetch)
7388 (uri (string-append "mirror://apache/httpcomponents/httpcore/"
7389 "source/httpcomponents-core-"
7390 version "-src.tar.gz"))
7391 (sha256
7392 (base32
7393 "02bwcf38y4vgwq7kj2s6q7qrmma641r5lacivm16kgxvb2j6h1vy"))))
7394 (build-system ant-build-system)
7395 (arguments
7396 `(#:jar-name "httpcomponents-httpcore.jar"
7397 #:phases
7398 (modify-phases %standard-phases
7399 (add-after 'unpack 'chdir
7400 (lambda _ (chdir "httpcore") #t))
7401 (replace 'install
7402 (install-from-pom "pom.xml")))))
7403 (inputs
7404 (list java-commons-logging-minimal java-commons-lang3))
7405 (native-inputs
7406 (list java-junit java-mockito-1))
7407 (home-page "https://hc.apache.org/httpcomponents-core-4.4.x/index.html")
7408 (synopsis "Low level HTTP transport components")
7409 (description "HttpCore is a set of low level HTTP transport components
7410that can be used to build custom client and server side HTTP services with a
7411minimal footprint. HttpCore supports two I/O models: blocking I/O model based
7412on the classic Java I/O and non-blocking, event driven I/O model based on Java
7413NIO.
7414
7415This package provides the blocking I/O model library.")
7416 (license license:asl2.0)))
7417
7418(define-public java-httpcomponents-httpcore-nio
7419 (package (inherit java-httpcomponents-httpcore)
7420 (name "java-httpcomponents-httpcore-nio")
7421 (arguments
7422 `(#:jar-name "httpcomponents-httpcore-nio.jar"
7423 #:phases
7424 (modify-phases %standard-phases
7425 (add-after 'unpack 'chdir
7426 (lambda _ (chdir "httpcore-nio") #t)))))
7427 (inputs
7428 (modify-inputs inputs
7429 (prepend java-httpcomponents-httpcore java-hamcrest-core)))
7430 (description "HttpCore is a set of low level HTTP transport components
7431that can be used to build custom client and server side HTTP services with a
7432minimal footprint. HttpCore supports two I/O models: blocking I/O model based
7433on the classic Java I/O and non-blocking, event driven I/O model based on Java
7434NIO.
7435
7436This package provides the non-blocking I/O model library based on Java
7437NIO.")))
7438
7439(define-public java-httpcomponents-httpcore-ab
7440 (package (inherit java-httpcomponents-httpcore)
7441 (name "java-httpcomponents-httpcore-ab")
7442 (arguments
7443 `(#:jar-name "httpcomponents-httpcore-ab.jar"
7444 #:phases
7445 (modify-phases %standard-phases
7446 (add-after 'unpack 'chdir
7447 (lambda _ (chdir "httpcore-ab") #t)))))
7448 (inputs
7449 (modify-inputs inputs
7450 (prepend java-httpcomponents-httpcore java-commons-cli
7451 java-hamcrest-core)))
7452 (synopsis "Apache HttpCore benchmarking tool")
7453 (description "This package provides the HttpCore benchmarking tool. It is
7454an Apache AB clone based on HttpCore.")))
7455
7456(define-public java-httpcomponents-httpcore-osgi
7457 (package (inherit java-httpcomponents-httpcore)
7458 (name "java-httpcomponents-httpcore-osgi")
7459 (arguments
7460 `(#:jar-name "httpcomponents-httpcore-osgi.jar"
7461 #:phases
7462 (modify-phases %standard-phases
7463 (add-after 'unpack 'chdir
7464 (lambda _ (chdir "httpcore-osgi"))))))
7465 (inputs
7466 (modify-inputs inputs
7467 (prepend java-httpcomponents-httpcore
7468 java-httpcomponents-httpcore-nio
7469 java-hamcrest-core)))
7470 (native-inputs (list java-ops4j-pax-exam-core
7471 java-ops4j-pax-exam-core-junit
7472 java-ops4j-pax-exam-core-spi
7473 java-junit))
7474 (description "HttpCore is a set of low level HTTP transport components
7475that can be used to build custom client and server side HTTP services with a
7476minimal footprint. HttpCore supports two I/O models: blocking I/O model based
7477on the classic Java I/O and non-blocking, event driven I/O model based on Java
7478NIO.
7479
7480This package provides... some tests.")))
7481
7482(define-public java-httpcomponents-httpclient
7483 (package
7484 (name "java-httpcomponents-httpclient")
7485 (version "4.5.12")
7486 (source (origin
7487 (method url-fetch)
7488 (uri (string-append "mirror://apache/httpcomponents/httpclient/"
7489 "source/httpcomponents-client-"
7490 version "-src.tar.gz"))
7491 (sha256
7492 (base32
7493 "1va99m2zc2liv0v9vn72p5ja8yz4s5wq7zpahaai5nr966kvxzkb"))))
7494 (build-system ant-build-system)
7495 (arguments
7496 `(#:jar-name "httpcomponents-httpclient.jar"
7497 #:phases
7498 (modify-phases %standard-phases
7499 (add-after 'unpack 'chdir
7500 (lambda _ (chdir "httpclient") #t))
7501
7502 (replace 'install
7503 (install-from-pom "pom.xml")))))
7504 (inputs
7505 (list java-commons-logging-minimal
7506 java-commons-codec
7507 java-hamcrest-core
7508 java-httpcomponents-httpcore
7509 java-mockito-1
7510 java-junit))
7511 (home-page "https://hc.apache.org/httpcomponents-client-ga/")
7512 (synopsis "HTTP client library for Java")
7513 (description "Although the @code{java.net} package provides basic
7514functionality for accessing resources via HTTP, it doesn't provide the full
7515flexibility or functionality needed by many applications. @code{HttpClient}
7516seeks to fill this void by providing an efficient, up-to-date, and
7517feature-rich package implementing the client side of the most recent HTTP
7518standards and recommendations.")
7519 (properties '((upstream-name . "httpcomponents-client")))
7520 (license license:asl2.0)))
7521
7522(define-public java-httpcomponents-httpclient-cache
7523 (package (inherit java-httpcomponents-httpclient)
7524 (name "java-httpcomponents-httpclient-cache")
7525 (arguments
7526 `(#:jar-name "httpcomponents-httpclient-cache.jar"
7527 #:source-dir "src/main/java"
7528 #:test-dir "src/test"
7529 #:tests? #f; tests are broken with current cglib.
7530 #:phases
7531 (modify-phases %standard-phases
7532 (add-after 'unpack 'delete-unused-impls
7533 (lambda _
7534 (for-each
7535 delete-file-recursively
7536 '("src/main/java/org/apache/http/impl/client/cache/ehcache/"
7537 "src/main/java/org/apache/http/impl/client/cache/memcached/"
7538 "src/test/java/org/apache/http/impl/client/cache/ehcache/"
7539 "src/test/java/org/apache/http/impl/client/cache/memcached/"))))
7540 (add-after 'unpack 'chdir
7541 (lambda _ (chdir "httpclient-cache"))))))
7542 (inputs
7543 (modify-inputs inputs
7544 (prepend java-httpcomponents-httpclient
7545 java-httpcomponents-httpmime
7546 java-hamcrest-core)))
7547 (description "This package provides an API for caching accessed HTTP
7548resources.")))
7549
7550(define-public java-httpcomponents-httpclient-osgi
7551 (package (inherit java-httpcomponents-httpclient)
7552 (name "java-httpcomponents-httpclient-osgi")
7553 (arguments
7554 `(#:jar-name "httpcomponents-httpclient-osgi.jar"
7555 #:tests? #f; tests are broken with current cglib.
7556 #:phases
7557 (modify-phases %standard-phases
7558 (add-after 'unpack 'chdir
7559 (lambda _ (chdir "httpclient-osgi") #t)))))
7560 (inputs
7561 (modify-inputs inputs
7562 (prepend java-httpcomponents-httpclient
7563 java-httpcomponents-httpclient-cache
7564 java-osgi-framework
7565 java-osgi-service-cm
7566 java-hamcrest-core)))))
7567
7568(define-public java-httpcomponents-httpmime
7569 (package (inherit java-httpcomponents-httpclient)
7570 (name "java-httpcomponents-httpmime")
7571 (arguments
7572 `(#:jar-name "httpcomponents-httpmime.jar"
7573 #:phases
7574 (modify-phases %standard-phases
7575 (add-after 'unpack 'chdir
7576 (lambda _ (chdir "httpmime") #t))
7577 (replace 'install
7578 (install-from-pom "pom.xml")))))
7579 (inputs
7580 (list java-httpcomponents-httpclient java-httpcomponents-httpcore
7581 java-junit java-hamcrest-core))))
7582
7583(define-public java-commons-net
7584 (package
7585 (name "java-commons-net")
7586 (version "3.6")
7587 (source (origin
7588 (method url-fetch)
7589 (uri (string-append "mirror://apache/commons/net/source/"
7590 "commons-net-" version "-src.tar.gz"))
7591 (sha256
7592 (base32
7593 "0n0cmnddk9qdqhjvka8pc6hd9mn2qi3166f1s6xk32h7rfy1adxr"))))
7594 (build-system ant-build-system)
7595 (arguments
7596 `(;; FIXME: MainTest.java tries to read "examples.properties" (which
7597 ;; should be "resources/examples/examples.properties"), but gets "null"
7598 ;; instead.
7599 #:tests? #f
7600 #:jar-name "commons-net.jar"))
7601 (native-inputs
7602 (list java-junit java-hamcrest-core))
7603 (home-page "https://commons.apache.org/net/")
7604 (synopsis "Client library for many basic Internet protocols")
7605 (description "The Apache Commons Net library implements the client side of
7606many basic Internet protocols. The purpose of the library is to provide
7607fundamental protocol access, not higher-level abstractions.")
7608 (license license:asl2.0)))
7609
7610(define-public java-jsch
7611 (package
7612 (name "java-jsch")
7613 (version "0.1.55")
7614 (source (origin
7615 (method url-fetch)
7616 (uri (string-append "mirror://sourceforge/jsch/jsch/"
7617 version "/jsch-" version ".zip"))
7618 (sha256
7619 (base32
7620 "1lxyjwvmwa723wcf3bqn816hkvc03vz4xhbsi7bvfhrz2rpgcfq6"))))
7621 (build-system ant-build-system)
7622 (arguments
7623 `(#:build-target "dist"
7624 #:tests? #f ; no tests included
7625 #:phases
7626 (modify-phases %standard-phases
7627 (replace 'install (install-jars "dist")))))
7628 (native-inputs
7629 (list unzip))
7630 (home-page "http://www.jcraft.com/jsch/")
7631 (synopsis "Pure Java implementation of SSH2")
7632 (description "JSch is a pure Java implementation of SSH2. JSch allows you
7633to connect to an SSH server and use port forwarding, X11 forwarding, file
7634transfer, etc., and you can integrate its functionality into your own Java
7635programs.")
7636 (license license:bsd-3)))
7637
7638(define-public java-jsch-0.1.72
7639 (package
7640 (name "java-jsch")
7641 (version "0.1.72")
7642 (source
7643 (origin
7644 (method git-fetch)
7645 (uri (git-reference
7646 (url "https://github.com/mwiede/jsch.git")
7647 (commit (string-append "jsch-" version))))
7648 (file-name (git-file-name name version))
7649 (sha256
7650 (base32 "1xx50fw9wxnkm9yg8v8scr2c7781506flv0ivalpw7bg27w8sm59"))))
7651 (build-system ant-build-system)
7652 (arguments
7653 (list
7654 #:jdk openjdk17
7655 #:tests? #f
7656 #:modules
7657 '((guix build utils)
7658 (guix build ant-build-system)
7659 (guix build java-utils))
7660 #:phases
7661 #~(modify-phases %standard-phases
7662 (replace 'build
7663 (lambda* (#:key inputs #:allow-other-keys)
7664 (define classes-dir (string-append (getcwd) "/build/classes"))
7665 (define generated-dir (string-append (getcwd) "/build/generated"))
7666 (define manifest-file (string-append (getcwd) "/build/manifest.mf"))
7667 (define jar-file (string-append (getcwd) "/build/jsch-" #$version ".jar"))
7668 (define jna
7669 (car (find-files (assoc-ref inputs "java-native-access")
7670 "jna-jpms.*\\.jar$")))
7671 (define jna-platform
7672 (car (find-files (assoc-ref inputs "java-native-access-platform")
7673 "jna-platform-jpms.*\\.jar$")))
7674 (define bcprov
7675 (car (find-files (assoc-ref inputs "java-bouncycastle")
7676 "bcprov.*\\.jar$")))
7677 (define junixsocket
7678 (car (find-files (assoc-ref inputs "java-junixsocket-common")
7679 "\\.jar$")))
7680 (define classpath
7681 (string-append jna ":" jna-platform ":" bcprov
7682 ":" junixsocket))
7683 (define (java-sources source-root)
7684 (filter (lambda (file)
7685 (and (string-suffix? ".java" file)
7686 (not (string-suffix? "module-info.java" file))))
7687 (find-files source-root "\\.java$")))
7688 (define (compile-release source-root release)
7689 (let ((sources (java-sources source-root))
7690 (target (string-append classes-dir "/META-INF/versions/"
7691 release)))
7692 (when (pair? sources)
7693 (mkdir-p target)
7694 (apply invoke "javac"
7695 (append
7696 (list "--release" release
7697 "-cp" (string-append classes-dir ":" classpath)
7698 "-d" target)
7699 sources)))))
7700 (mkdir-p classes-dir)
7701 (mkdir-p (string-append generated-dir "/com/jcraft/jsch"))
7702 (copy-file "src/main/java-templates/com/jcraft/jsch/Version.java"
7703 (string-append generated-dir
7704 "/com/jcraft/jsch/Version.java"))
7705 (substitute* (string-append generated-dir
7706 "/com/jcraft/jsch/Version.java")
7707 (("\\$\\{project.version\\}") #$version))
7708 (apply invoke "javac"
7709 (append
7710 (list "--release" "8"
7711 "-cp" classpath
7712 "-d" classes-dir)
7713 (java-sources "src/main/java")
7714 (list (string-append generated-dir
7715 "/com/jcraft/jsch/Version.java"))))
7716 (for-each
7717 (lambda (release)
7718 (compile-release (string-append "src/main/java" release)
7719 release))
7720 '("9" "11" "15" "16"))
7721 (call-with-output-file manifest-file
7722 (lambda (port)
7723 (display "Multi-Release: true\n" port)))
7724 (invoke "jar" "--create"
7725 "--file" jar-file
7726 "--manifest" manifest-file
7727 "-C" classes-dir ".")))
7728 (add-before 'install 'create-pom
7729 (generate-pom.xml "pom.xml" "com.jcraft"
7730 "jsch" #$version))
7731 (replace 'install
7732 (install-from-pom "pom.xml")))))
7733 (inputs
7734 (list java-bouncycastle-1.77
7735 java-junixsocket-common-2
7736 java-native-access-5.14.0
7737 java-native-access-platform-5.14.0))
7738 (native-inputs
7739 (list java-kohlschutter-compiler-annotations-1
7740 unzip))
7741 (home-page "https://github.com/mwiede/jsch")
7742 (synopsis "Pure Java implementation of SSH2")
7743 (description
7744 "JSch is a pure Java implementation of SSH2. This package builds the
77450.1.72 release from source with bouncycastle and junixsocket support.")
7746 (license license:bsd-3)))
7747
7748(define-public java-jzlib-1.1.3
7749 (package
7750 (name "java-jzlib")
7751 (version "1.1.3")
7752 (source (origin
7753 (method git-fetch)
7754 (uri (git-reference
7755 (url "https://github.com/ymnk/jzlib")
7756 (commit version)))
7757 (file-name (git-file-name name version))
7758 (sha256
7759 (base32
7760 "1wma04qlx65ybyf49dngqb5db1xc7sya0g98frj5chhr4qc7fjs8"))))
7761 (build-system ant-build-system)
7762 (arguments
7763 `(#:jar-name "jzlib.jar"
7764 #:source-dir "src/main/java"
7765 #:tests? #f ; no tests
7766 #:phases
7767 (modify-phases %standard-phases
7768 (replace 'install
7769 (install-from-pom "pom.xml")))))
7770 (home-page "http://www.jcraft.com/jzlib/")
7771 (synopsis "Pure Java implementation of zlib")
7772 (description "JZlib is a re-implementation of zlib in pure Java. It
7773provides @code{Deflater}, @code{Inflater}, and streaming classes for
7774compression and decompression compatible with the zlib format.")
7775 (license license:bsd-3)))
7776
7777(define-public java-commons-compress
7778 (package
7779 (name "java-commons-compress")
7780 (version "1.28.0")
7781 (source (origin
7782 (method url-fetch)
7783 (uri (string-append "mirror://apache/commons/compress/source/"
7784 "commons-compress-" version "-src.tar.gz"))
7785 (sha256
7786 (base32
7787 "0qkn70dfb1f9xihc34mbpbr5ag8qm4qq18hh3p4286r2ajj0z1sw"))))
7788 (build-system ant-build-system)
7789 (arguments
7790 `(#:jar-name "commons-compress.jar"
7791 #:source-dir "src/main/java"
7792 #:tests? #f; requires java-mockito-3
7793 #:phases
7794 (modify-phases %standard-phases
7795 (replace 'install (install-from-pom "pom.xml")))))
7796 (propagated-inputs
7797 (list java-commons-lang3
7798 java-commons-io-latest
7799 java-commons-codec
7800 java-asm-9
7801 java-brotli
7802 java-xz
7803 java-zstd
7804 apache-commons-parent-pom-85))
7805 (home-page "https://commons.apache.org/proper/commons-compress/")
7806 (synopsis "Java library for working with compressed files")
7807 (description "The Apache Commons Compress library defines an API for
7808working with compressed files such as ar, cpio, Unix dump, tar, zip, gzip, XZ,
7809Pack200, bzip2, 7z, arj, lzma, snappy, DEFLATE, lz4 and Z files.")
7810 (license license:asl2.0)))
7811
7812(define-public java-commons-compress-1.21
7813 (package
7814 (inherit java-commons-compress)
7815 (version "1.21")
7816 (source (origin
7817 (method url-fetch)
7818 (uri (string-append "mirror://apache/commons/compress/source/"
7819 "commons-compress-" version "-src.tar.gz"))
7820 (sha256
7821 (base32
7822 "1rkpb6xcyly1wnbx4q6iq6p5hrr0h1d0ppb5r07psc75cbmizjry"))))
7823 (propagated-inputs
7824 (list java-asm-3
7825 java-brotli
7826 java-osgi-core
7827 java-xz
7828 java-zstd
7829 apache-commons-parent-pom-52))))
7830
7831(define-public java-commons-csv
7832 (package
7833 (name "java-commons-csv")
7834 (version "1.4")
7835 (source (origin
7836 (method url-fetch)
7837 (uri (string-append "mirror://apache/commons/csv/source/"
7838 "commons-csv-" version "-src.tar.gz"))
7839 (sha256
7840 (base32
7841 "1l89m0fm2s3xx3v3iynvangymfg2vlyngaj6fgsi457nmsw7m7ij"))))
7842 (build-system ant-build-system)
7843 (arguments
7844 `(#:jar-name "commons-csv.jar"
7845 #:source-dir "src/main/java"
7846 #:tests? #f)); FIXME: requires java-h2
7847 (inputs
7848 `(("java-hamcrest-core" ,java-hamcrest-core)
7849 ("java-commons-io" ,java-commons-io)
7850 ("java-commons-lang3" ,java-commons-lang3)
7851 ("junit" ,java-junit)))
7852 (home-page "https://commons.apache.org/proper/commons-csv/")
7853 (synopsis "Read and write CSV documents")
7854 (description "Commons CSV reads and writes files in variations of the Comma
7855Separated Value (CSV) format. The most common CSV formats are predefined in the
7856CSVFormat class:
7857
7858@itemize
7859@item Microsoft Excel
7860@item Informix UNLOAD
7861@item Informix UNLOAD CSV
7862@item MySQL
7863@item RFC 4180
7864@item TDF
7865@end itemize
7866
7867Custom formats can be created using a fluent style API.")
7868 (license license:asl2.0)))
7869
7870(define-public java-jaxrs-api-2
7871 (package
7872 (name "java-jaxrs-api")
7873 (version "2.1.1")
7874 (source (origin
7875 (method git-fetch)
7876 (uri (git-reference
7877 (url "https://github.com/jakartaee/rest")
7878 (commit version)))
7879 (file-name (git-file-name name version))
7880 (sha256
7881 (base32
7882 "1sa490sag5r23hx84haddkbbyn4dlhav4m445k53y53jzs64cs4c"))))
7883 (build-system ant-build-system)
7884 (arguments
7885 (list
7886 #:tests? #f
7887 #:jdk openjdk9
7888 #:jar-name "javax.ws.rs-api.jar"
7889 #:source-dir "jaxrs-api/src/main/java"
7890 #:phases
7891 #~(modify-phases %standard-phases
7892 (add-before 'install 'create-pom
7893 (generate-pom.xml "pom.xml" "javax.ws.rs" "javax.ws.rs-api"
7894 #$version))
7895 (replace 'install (install-from-pom "pom.xml")))))
7896 (home-page "https://github.com/jax-rs")
7897 (synopsis "Java API for RESTful Web Services")
7898 (description "JAX-RS provides a standardized API for building RESTful
7899web services in Java.")
7900 (license license:cddl1.1)))
7901
7902(define-public java-osgi-annotation
7903 (package
7904 (name "java-osgi-annotation")
7905 (version "6.0.0")
7906 (source (origin
7907 (method url-fetch)
7908 (uri (string-append "https://repo1.maven.org/maven2/"
7909 "org/osgi/org.osgi.annotation/" version "/"
7910 "org.osgi.annotation-" version "-sources.jar"))
7911 (sha256
7912 (base32
7913 "1q718mb7gqg726rh6pc2hcisn8v50nv35abbir0jypmffhiii85w"))))
7914 (build-system ant-build-system)
7915 (arguments
7916 `(#:tests? #f ; no tests
7917 #:jar-name "osgi-annotation.jar"
7918 #:phases
7919 (modify-phases %standard-phases
7920 (add-before 'install 'create-pom
7921 (generate-pom.xml "pom.xml" "osgi" "osgi-annotation" ,version))
7922 (replace 'install (install-from-pom "pom.xml")))))
7923 (home-page "https://www.osgi.org")
7924 (synopsis "Annotation module of OSGi framework")
7925 (description
7926 "OSGi, for Open Services Gateway initiative framework, is a module system
7927and service platform for the Java programming language. This package contains
7928the OSGi annotation module, providing additional services to help dynamic
7929components.")
7930 (license license:asl2.0)))
7931
7932(define-public java-osgi-annotation-8.1.0
7933 ;; Upstream tags the monorepo as 8.0.0.1, but osgi.annotation/bnd.bnd sets
7934 ;; the annotation artifact's release/minor version to 8.1, yielding 8.1.0.
7935 (let ((tag "8.0.0.1"))
7936 (package
7937 (name "java-osgi-annotation")
7938 (version "8.1.0")
7939 (source (origin
7940 (method git-fetch)
7941 (uri (git-reference
7942 (url "https://github.com/osgi/osgi")
7943 (commit tag)))
7944 (modules '((guix build utils)))
7945 (snippet
7946 '(begin
7947 (for-each delete-file
7948 (find-files "." "\\.jar$"))
7949 #t))
7950 (file-name (git-file-name name version))
7951 (sha256
7952 (base32
7953 "0s0ig6prnkvjp9159087mf16ihbqc91qlwdi1l0n5afhh2z5cnn5"))))
7954 (build-system ant-build-system)
7955 (arguments
7956 (list
7957 #:tests? #f
7958 #:jar-name "osgi-annotation.jar"
7959 #:phases
7960 #~(modify-phases %standard-phases
7961 (add-after 'unpack 'prepare-source-layout
7962 (lambda _
7963 (mkdir-p "src")
7964 (for-each
7965 (lambda (directory)
7966 (invoke "cp" "-r" (string-append directory "/.") "src/"))
7967 '("org.osgi.annotation.bundle/src"
7968 "org.osgi.annotation.versioning/src"))))
7969 (add-before 'install 'create-pom
7970 (generate-pom.xml "pom.xml" "org.osgi" "osgi.annotation"
7971 #$version))
7972 (replace 'install (install-from-pom "pom.xml")))))
7973 (home-page "https://www.osgi.org")
7974 (synopsis "Annotations for use in compiling OSGi bundles")
7975 (description "OSGi, for Open Services Gateway initiative framework, is a
7976module system and service platform for the Java programming language. This
7977package contains the annotation classes used at compile time.")
7978 (license license:asl2.0))))
7979
7980(define-public java-osgi-core
7981 (package
7982 (name "java-osgi-core")
7983 (version "6.0.0")
7984 (source (origin
7985 (method url-fetch)
7986 (uri (string-append "https://repo1.maven.org/maven2/"
7987 "org/osgi/org.osgi.core/" version "/"
7988 "org.osgi.core-" version "-sources.jar"))
7989 (sha256
7990 (base32
7991 "19bpf5jx32jq9789gyhin35q5v7flmw0p9mk7wbgqpxqfmxyiabv"))))
7992 (build-system ant-build-system)
7993 (arguments
7994 `(#:tests? #f ; no tests
7995 #:jar-name "osgi-core.jar"
7996 #:phases
7997 (modify-phases %standard-phases
7998 (add-before 'install 'create-pom
7999 (generate-pom.xml "pom.xml" "org.osgi" "org.osgi.core" ,version))
8000 (replace 'install (install-from-pom "pom.xml")))))
8001 (inputs
8002 (list java-osgi-annotation))
8003 (home-page "https://www.osgi.org")
8004 (synopsis "Core module of OSGi framework")
8005 (description
8006 "OSGi, for Open Services Gateway initiative framework, is a module system
8007and service platform for the Java programming language. This package contains
8008the OSGi Core module.")
8009 (license license:asl2.0)))
8010
8011(define-public java-osgi-core-8.0.0
8012 ;; Upstream uses release-train tags for the monorepo; osgi.core/bnd.bnd
8013 ;; emits artifact version 8.0.0 from the r8-core-final checkout.
8014 (let ((tag "r8-core-final"))
8015 (package
8016 (name "java-osgi-core")
8017 (version "8.0.0")
8018 (source (origin
8019 (method git-fetch)
8020 (uri (git-reference
8021 (url "https://github.com/osgi/osgi")
8022 (commit tag)))
8023 (modules '((guix build utils)))
8024 (snippet
8025 '(begin
8026 (for-each delete-file
8027 (find-files "." "\\.jar$"))
8028 #t))
8029 (file-name (git-file-name name version))
8030 (sha256
8031 (base32
8032 "01z4c3jakzjdh4m0j71shppa1nfgaqgxwajnhyv56s1l1a9hxb6x"))))
8033 (build-system ant-build-system)
8034 (arguments
8035 (list
8036 #:tests? #f
8037 #:jar-name "osgi-core.jar"
8038 #:phases
8039 #~(modify-phases %standard-phases
8040 (add-after 'unpack 'prepare-source-layout
8041 (lambda _
8042 (mkdir-p "src")
8043 (for-each
8044 (lambda (directory)
8045 (invoke "cp" "-r" (string-append directory "/.") "src/"))
8046 '("org.osgi.dto/src"
8047 "org.osgi.framework/src"
8048 "org.osgi.resource/src"
8049 "org.osgi.service.condition/src"
8050 "org.osgi.service.condpermadmin/src"
8051 "org.osgi.service.log/src"
8052 "org.osgi.service.packageadmin/src"
8053 "org.osgi.service.permissionadmin/src"
8054 "org.osgi.service.resolver/src"
8055 "org.osgi.service.startlevel/src"
8056 "org.osgi.service.url/src"
8057 "org.osgi.util.tracker/src"))))
8058 (add-before 'install 'create-pom
8059 (generate-pom.xml "pom.xml" "org.osgi" "osgi.core" #$version))
8060 (replace 'install (install-from-pom "pom.xml")))))
8061 (inputs (list java-osgi-annotation-8.1.0))
8062 (home-page "https://www.osgi.org")
8063 (synopsis "Core module of OSGi framework")
8064 (description "OSGi, for Open Services Gateway initiative framework, is a
8065module system and service platform for the Java programming language. This
8066package contains the OSGi Core module.")
8067 (license license:asl2.0))))
8068
8069(define-public java-osgi-service-event
8070 (package
8071 (name "java-osgi-service-event")
8072 (version "1.3.1")
8073 (source (origin
8074 (method url-fetch)
8075 (uri (string-append "https://repo1.maven.org/maven2/"
8076 "org/osgi/org.osgi.service.event/"
8077 version "/org.osgi.service.event-"
8078 version "-sources.jar"))
8079 (sha256
8080 (base32
8081 "1nyhlgagwym75bycnjczwbnpymv2iw84zbhvvzk84g9q736i6qxm"))))
8082 (build-system ant-build-system)
8083 (arguments
8084 `(#:tests? #f ; no tests
8085 #:jar-name "osgi-service-event.jar"))
8086 (inputs
8087 (list java-osgi-annotation java-osgi-core))
8088 (home-page "https://www.osgi.org")
8089 (synopsis "OSGi service event module")
8090 (description
8091 "OSGi, for Open Services Gateway initiative framework, is a module system
8092and service platform for the Java programming language. This package contains
8093the OSGi @code{org.osgi.service.event} module.")
8094 (license license:asl2.0)))
8095
8096(define-public java-eclipse-osgi
8097 (package
8098 (name "java-eclipse-osgi")
8099 (version "3.11.3")
8100 (source (origin
8101 (method url-fetch)
8102 (uri (string-append "https://repo1.maven.org/maven2/"
8103 "org/eclipse/platform/org.eclipse.osgi/"
8104 version "/org.eclipse.osgi-"
8105 version "-sources.jar"))
8106 (sha256
8107 (base32
8108 "00cqc6lb29n0zv68b4l842vzkwawvbr7gshfdygsk8sicvcq2c7b"))))
8109 (build-system ant-build-system)
8110 (arguments
8111 `(#:tests? #f ; no tests included
8112 #:jar-name "eclipse-equinox-osgi.jar"))
8113 (inputs
8114 (list java-osgi-annotation))
8115 (home-page "https://www.eclipse.org/equinox/")
8116 (synopsis "Eclipse Equinox OSGi framework")
8117 (description "This package provides an implementation of the OSGi Core
8118specification.")
8119 (license license:epl1.0)))
8120
8121(define-public java-eclipse-equinox-common
8122 (package
8123 (name "java-eclipse-equinox-common")
8124 (version "3.10.200")
8125 (source (origin
8126 (method url-fetch)
8127 (uri (string-append "https://repo1.maven.org/maven2/"
8128 "org/eclipse/platform/org.eclipse.equinox.common/"
8129 version "/org.eclipse.equinox.common-"
8130 version "-sources.jar"))
8131 (sha256
8132 (base32
8133 "1yn8ij6xsljlf35sr2l7wvyvc0ss4n1rv0ry5zkgb49dj4hyrqrj"))))
8134 (build-system ant-build-system)
8135 (arguments
8136 `(#:tests? #f ; no tests included
8137 #:jar-name "eclipse-equinox-common.jar"))
8138 (inputs
8139 (list java-eclipse-osgi))
8140 (home-page "https://www.eclipse.org/equinox/")
8141 (synopsis "Common Eclipse runtime")
8142 (description "This package provides the common Eclipse runtime.")
8143 (license license:epl1.0)))
8144
8145(define-public java-eclipse-core-jobs
8146 (package
8147 (name "java-eclipse-core-jobs")
8148 (version "3.8.0")
8149 (source (origin
8150 (method url-fetch)
8151 (uri (string-append "https://repo1.maven.org/maven2/"
8152 "org/eclipse/platform/org.eclipse.core.jobs/"
8153 version "/org.eclipse.core.jobs-"
8154 version "-sources.jar"))
8155 (sha256
8156 (base32
8157 "0395b8lh0km8vhzjnchvs1rii1qz48hyvb2wqfaq4yhklbwihq4b"))))
8158 (build-system ant-build-system)
8159 (arguments
8160 `(#:tests? #f ; no tests included
8161 #:jar-name "eclipse-core-jobs.jar"))
8162 (inputs
8163 (list java-eclipse-equinox-common java-eclipse-osgi))
8164 (home-page "https://www.eclipse.org/equinox/")
8165 (synopsis "Eclipse jobs mechanism")
8166 (description "This package provides the Eclipse jobs mechanism.")
8167 (license license:epl1.0)))
8168
8169(define-public java-eclipse-equinox-registry
8170 (package
8171 (name "java-eclipse-equinox-registry")
8172 (version "3.6.100")
8173 (source (origin
8174 (method url-fetch)
8175 (uri (string-append "https://repo1.maven.org/maven2/"
8176 "org/eclipse/platform/org.eclipse.equinox.registry/"
8177 version "/org.eclipse.equinox.registry-"
8178 version "-sources.jar"))
8179 (sha256
8180 (base32
8181 "1i9sgymh2fy5vdgk5y7s3qvrlbgh4l93ddqi3v4zmca7hwrlhf9k"))))
8182 (build-system ant-build-system)
8183 (arguments
8184 `(#:tests? #f ; no tests included
8185 #:jar-name "eclipse-equinox-registry.jar"))
8186 (inputs
8187 (list java-eclipse-core-jobs java-eclipse-equinox-common
8188 java-eclipse-osgi))
8189 (home-page "https://www.eclipse.org/equinox/")
8190 (synopsis "Eclipse extension registry support")
8191 (description "This package provides support for the Eclipse extension
8192registry.")
8193 (license license:epl1.0)))
8194
8195(define-public java-eclipse-equinox-app
8196 (package
8197 (name "java-eclipse-equinox-app")
8198 (version "1.3.400")
8199 (source (origin
8200 (method url-fetch)
8201 (uri (string-append "https://repo1.maven.org/maven2/"
8202 "org/eclipse/platform/org.eclipse.equinox.app/"
8203 version "/org.eclipse.equinox.app-"
8204 version "-sources.jar"))
8205 (sha256
8206 (base32
8207 "0nhvbp93y203ar7y59gb0mz3w2d3jlqhr0c9hii9bcfpmr7imdab"))))
8208 (build-system ant-build-system)
8209 (arguments
8210 `(#:tests? #f ; no tests included
8211 #:jar-name "eclipse-equinox-app.jar"))
8212 (inputs
8213 (list java-eclipse-equinox-common java-eclipse-equinox-registry
8214 java-eclipse-osgi java-osgi-service-event))
8215 (home-page "https://www.eclipse.org/equinox/")
8216 (synopsis "Equinox application container")
8217 (description "This package provides the Equinox application container for
8218Eclipse.")
8219 (license license:epl1.0)))
8220
8221(define-public java-eclipse-equinox-preferences
8222 (package
8223 (name "java-eclipse-equinox-preferences")
8224 (version "3.6.1")
8225 (source (origin
8226 (method url-fetch)
8227 (uri (string-append "https://repo1.maven.org/maven2/"
8228 "org/eclipse/platform/org.eclipse.equinox.preferences/"
8229 version "/org.eclipse.equinox.preferences-"
8230 version "-sources.jar"))
8231 (sha256
8232 (base32
8233 "0k7w6c141sqym4fy3af0qkwpy4pdh2vsjpjba6rp5fxyqa24v0a2"))))
8234 (build-system ant-build-system)
8235 (arguments
8236 `(#:tests? #f ; no tests included
8237 #:jar-name "eclipse-equinox-preferences.jar"))
8238 (inputs
8239 (list java-eclipse-equinox-common java-eclipse-equinox-registry
8240 java-eclipse-osgi))
8241 (home-page "https://www.eclipse.org/equinox/")
8242 (synopsis "Eclipse preferences mechanism")
8243 (description "This package provides the Eclipse preferences mechanism with
8244the module @code{org.eclipse.equinox.preferences}.")
8245 (license license:epl1.0)))
8246
8247(define-public java-eclipse-core-contenttype
8248 (package
8249 (name "java-eclipse-core-contenttype")
8250 (version "3.5.100")
8251 (source (origin
8252 (method url-fetch)
8253 (uri (string-append "https://repo1.maven.org/maven2/"
8254 "org/eclipse/platform/org.eclipse.core.contenttype/"
8255 version "/org.eclipse.core.contenttype-"
8256 version "-sources.jar"))
8257 (sha256
8258 (base32
8259 "1wcqcv7ijwv5rh748vz3x9pkmjl9w1r0k0026k56n8yjl4rrmspi"))))
8260 (build-system ant-build-system)
8261 (arguments
8262 `(#:tests? #f ; no tests included
8263 #:jar-name "eclipse-core-contenttype.jar"))
8264 (inputs
8265 (list java-eclipse-equinox-common java-eclipse-equinox-preferences
8266 java-eclipse-equinox-registry java-eclipse-osgi))
8267 (home-page "https://www.eclipse.org/")
8268 (synopsis "Eclipse content mechanism")
8269 (description "This package provides the Eclipse content mechanism in the
8270@code{org.eclipse.core.contenttype} module.")
8271 (license license:epl1.0)))
8272
8273(define-public java-eclipse-core-runtime
8274 (package
8275 (name "java-eclipse-core-runtime")
8276 (version "3.15.100")
8277 (source (origin
8278 (method url-fetch)
8279 (uri (string-append "https://repo1.maven.org/maven2/"
8280 "org/eclipse/platform/org.eclipse.core.runtime/"
8281 version "/org.eclipse.core.runtime-"
8282 version "-sources.jar"))
8283 (sha256
8284 (base32
8285 "0l8xayacsbjvz5hypx2fv47vpw2n4dspamcfb3hx30x9hj8vmg7r"))))
8286 (build-system ant-build-system)
8287 (arguments
8288 `(#:tests? #f ; no tests included
8289 #:jar-name "eclipse-core-runtime.jar"))
8290 (inputs
8291 (list java-eclipse-core-contenttype
8292 java-eclipse-core-jobs
8293 java-eclipse-equinox-app
8294 java-eclipse-equinox-common
8295 java-eclipse-equinox-registry
8296 java-eclipse-equinox-preferences
8297 java-eclipse-osgi))
8298 (home-page "https://www.eclipse.org/")
8299 (synopsis "Eclipse core runtime")
8300 (description "This package provides the Eclipse core runtime with the
8301module @code{org.eclipse.core.runtime}.")
8302 (license license:epl1.0)))
8303
8304(define-public java-eclipse-core-filesystem
8305 (package
8306 (name "java-eclipse-core-filesystem")
8307 (version "1.6.1")
8308 (source (origin
8309 (method url-fetch)
8310 (uri (string-append "https://repo1.maven.org/maven2/"
8311 "org/eclipse/platform/org.eclipse.core.filesystem/"
8312 version "/org.eclipse.core.filesystem-"
8313 version "-sources.jar"))
8314 (sha256
8315 (base32
8316 "0km1bhwjim4rfy3pkvjhvy31kgsyf2ncx0mlkmbf5n6g57pphdyj"))))
8317 (build-system ant-build-system)
8318 (arguments
8319 `(#:tests? #f ; no tests included
8320 #:jar-name "eclipse-core-filesystem.jar"))
8321 (inputs
8322 (list java-eclipse-equinox-common java-eclipse-equinox-registry
8323 java-eclipse-osgi))
8324 (home-page "https://www.eclipse.org/")
8325 (synopsis "Eclipse core file system")
8326 (description "This package provides the Eclipse core file system with the
8327module @code{org.eclipse.core.filesystem}.")
8328 (license license:epl1.0)))
8329
8330(define-public java-eclipse-core-expressions
8331 (package
8332 (name "java-eclipse-core-expressions")
8333 (version "3.5.100")
8334 (source (origin
8335 (method url-fetch)
8336 (uri (string-append "https://repo1.maven.org/maven2/"
8337 "org/eclipse/platform/org.eclipse.core.expressions/"
8338 version "/org.eclipse.core.expressions-"
8339 version "-sources.jar"))
8340 (sha256
8341 (base32
8342 "18bw2l875gmygvpagpgk9l24qzbdjia4ag12nw6fi8v8yaq4987f"))))
8343 (build-system ant-build-system)
8344 (arguments
8345 `(#:tests? #f ; no tests included
8346 #:jar-name "eclipse-core-expressions.jar"))
8347 (inputs
8348 (list java-eclipse-equinox-common java-eclipse-equinox-registry
8349 java-eclipse-equinox-preferences java-eclipse-core-runtime
8350 java-eclipse-osgi))
8351 (home-page "https://www.eclipse.org/")
8352 (synopsis "Eclipse core expression language")
8353 (description "This package provides the Eclipse core expression language
8354with the @code{org.eclipse.core.expressions} module.")
8355 (license license:epl1.0)))
8356
8357(define-public java-eclipse-core-variables
8358 (package
8359 (name "java-eclipse-core-variables")
8360 (version "3.3.0")
8361 (source (origin
8362 (method url-fetch)
8363 (uri (string-append "https://repo1.maven.org/maven2/"
8364 "org/eclipse/platform/org.eclipse.core.variables/"
8365 version "/org.eclipse.core.variables-"
8366 version "-sources.jar"))
8367 (sha256
8368 (base32
8369 "12dirh03zi4n5x5cj07vzrhkmnqy6h9q10h9j605pagmpmifyxmy"))))
8370 (build-system ant-build-system)
8371 (arguments
8372 `(#:tests? #f ; no tests included
8373 #:jar-name "eclipse-core-variables.jar"))
8374 (inputs
8375 (list java-eclipse-equinox-common java-eclipse-equinox-registry
8376 java-eclipse-equinox-preferences java-eclipse-core-runtime
8377 java-eclipse-osgi))
8378 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
8379 (synopsis "Eclipse core variables")
8380 (description "This package provides the Eclipse core variables module
8381@code{org.eclipse.core.variables}.")
8382 (license license:epl1.0)))
8383
8384(define-public java-eclipse-ant-core
8385 (package
8386 (name "java-eclipse-ant-core")
8387 (version "3.4.100")
8388 (source (origin
8389 (method url-fetch)
8390 (uri (string-append "https://repo1.maven.org/maven2/"
8391 "org/eclipse/platform/org.eclipse.ant.core/"
8392 version "/org.eclipse.ant.core-"
8393 version "-sources.jar"))
8394 (sha256
8395 (base32
8396 "11g3if794qjlk98mz9zch22rr56sd7z63vn4i7k2icr8cq5bfqg7"))))
8397 (build-system ant-build-system)
8398 (arguments
8399 `(#:tests? #f ; no tests included
8400 #:jar-name "eclipse-ant-core.jar"))
8401 (inputs
8402 (list java-eclipse-equinox-app
8403 java-eclipse-equinox-common
8404 java-eclipse-equinox-registry
8405 java-eclipse-equinox-preferences
8406 java-eclipse-core-contenttype
8407 java-eclipse-core-runtime
8408 java-eclipse-core-variables
8409 java-eclipse-osgi))
8410 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
8411 (synopsis "Ant build tool core libraries")
8412 (description "This package provides the ant build tool core libraries with
8413the module @code{org.eclipse.ant.core}.")
8414 (license license:epl1.0)))
8415
8416(define-public java-eclipse-core-resources
8417 (package
8418 (name "java-eclipse-core-resources")
8419 (version "3.13.200")
8420 (source (origin
8421 (method url-fetch)
8422 (uri (string-append "https://repo1.maven.org/maven2/"
8423 "org/eclipse/platform/org.eclipse.core.resources/"
8424 version "/org.eclipse.core.resources-"
8425 version "-sources.jar"))
8426 (sha256
8427 (base32
8428 "1sn3b6ky72hkvxcgf9b2jkpbdh3y8lbhi9xxwv1dsiddpkkq91hs"))))
8429 (build-system ant-build-system)
8430 (arguments
8431 `(#:tests? #f ; no tests included
8432 #:jar-name "eclipse-core-resources.jar"))
8433 (inputs
8434 (list java-eclipse-equinox-common
8435 java-eclipse-equinox-preferences
8436 java-eclipse-equinox-registry
8437 java-eclipse-core-contenttype
8438 java-eclipse-core-expressions
8439 java-eclipse-core-filesystem
8440 java-eclipse-core-jobs
8441 java-eclipse-core-runtime
8442 java-eclipse-ant-core
8443 java-eclipse-osgi))
8444 (home-page "https://www.eclipse.org/")
8445 (synopsis "Eclipse core resource management")
8446 (description "This package provides the Eclipse core resource management
8447module @code{org.eclipse.core.resources}.")
8448 (license license:epl1.0)))
8449
8450(define-public java-eclipse-compare-core
8451 (package
8452 (name "java-eclipse-compare-core")
8453 (version "3.6.0")
8454 (source (origin
8455 (method url-fetch)
8456 (uri (string-append "https://repo1.maven.org/maven2/"
8457 "org/eclipse/platform/org.eclipse.compare.core/"
8458 version "/org.eclipse.compare.core-"
8459 version "-sources.jar"))
8460 (sha256
8461 (base32
8462 "10g37r0pbiffyv2wk35c6g5lwzkdipkl0kkjp41v84dln46xm4dg"))))
8463 (build-system ant-build-system)
8464 (arguments
8465 `(#:tests? #f ; no tests included
8466 #:jar-name "eclipse-compare-core.jar"))
8467 (inputs
8468 (list java-eclipse-core-runtime java-eclipse-equinox-common
8469 java-eclipse-osgi java-icu4j))
8470 (home-page "https://www.eclipse.org/")
8471 (synopsis "Eclipse core compare support")
8472 (description "This package provides the Eclipse core compare support
8473module @code{org.eclipse.compare.core}.")
8474 (license license:epl1.0)))
8475
8476(define-public java-eclipse-team-core
8477 (package
8478 (name "java-eclipse-team-core")
8479 (version "3.8.0")
8480 (source (origin
8481 (method url-fetch)
8482 (uri (string-append "https://repo1.maven.org/maven2/"
8483 "org/eclipse/platform/org.eclipse.team.core/"
8484 version "/org.eclipse.team.core-"
8485 version "-sources.jar"))
8486 (sha256
8487 (base32
8488 "02j2jzqgb26zx2d5ahxmvijw6j4r0la90zl5c3i65x6z19ciyam7"))))
8489 (build-system ant-build-system)
8490 (arguments
8491 `(#:tests? #f ; no tests included
8492 #:jar-name "eclipse-team-core.jar"))
8493 (inputs
8494 (list java-eclipse-compare-core
8495 java-eclipse-core-contenttype
8496 java-eclipse-core-filesystem
8497 java-eclipse-core-jobs
8498 java-eclipse-core-resources
8499 java-eclipse-core-runtime
8500 java-eclipse-equinox-common
8501 java-eclipse-equinox-registry
8502 java-eclipse-equinox-preferences
8503 java-eclipse-osgi))
8504 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
8505 (synopsis "Eclipse team support core")
8506 (description "This package provides the Eclipse team support core module
8507@code{org.eclipse.team.core}.")
8508 (license license:epl1.0)))
8509
8510(define-public java-eclipse-core-commands
8511 (package
8512 (name "java-eclipse-core-commands")
8513 (version "3.8.1")
8514 (source (origin
8515 (method url-fetch)
8516 (uri (string-append "https://repo1.maven.org/maven2/"
8517 "org/eclipse/platform/org.eclipse.core.commands/"
8518 version "/org.eclipse.core.commands-"
8519 version "-sources.jar"))
8520 (sha256
8521 (base32
8522 "0yjn482qndcfrsq3jd6vnhcylp16420f5aqkrwr8spsprjigjcr9"))))
8523 (build-system ant-build-system)
8524 (arguments
8525 `(#:tests? #f ; no tests included
8526 #:jar-name "eclipse-core-commands.jar"))
8527 (inputs
8528 (list java-eclipse-equinox-common))
8529 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
8530 (synopsis "Eclipse core commands")
8531 (description "This package provides Eclipse core commands in the module
8532@code{org.eclipse.core.commands}.")
8533 (license license:epl1.0)))
8534
8535(define-public java-eclipse-text
8536 (package
8537 (name "java-eclipse-text")
8538 (version "3.6.0")
8539 (source (origin
8540 (method url-fetch)
8541 (uri (string-append "https://repo1.maven.org/maven2/"
8542 "org/eclipse/platform/org.eclipse.text/"
8543 version "/org.eclipse.text-"
8544 version "-sources.jar"))
8545 (sha256
8546 (base32
8547 "0scz70vzz5qs5caji9f5q01vkqnvip7dpri1q07l8wbbdcxn4cq1"))))
8548 (build-system ant-build-system)
8549 (arguments
8550 `(#:tests? #f ; no tests included
8551 #:jar-name "eclipse-text.jar"
8552 #:phases
8553 (modify-phases %standard-phases
8554 ;; When creating a new category we must make sure that the new list
8555 ;; matches List<Position>. By default it seems to be too generic
8556 ;; (ArrayList<Object>), so we specialize it to ArrayList<Position>.
8557 ;; Without this we get this error:
8558 ;;
8559 ;; [javac] .../src/org/eclipse/jface/text/AbstractDocument.java:376:
8560 ;; error: method put in interface Map<K,V> cannot be applied to given types;
8561 ;; [javac] fPositions.put(category, new ArrayList<>());
8562 ;; [javac] ^
8563 ;; [javac] required: String,List<Position>
8564 ;; [javac] found: String,ArrayList<Object>
8565 ;; [javac] reason: actual argument ArrayList<Object> cannot be converted
8566 ;; to List<Position> by method invocation conversion
8567 ;; [javac] where K,V are type-variables:
8568 ;; [javac] K extends Object declared in interface Map
8569 ;; [javac] V extends Object declared in interface Map
8570 ;;
8571 ;; I don't know if this is a good fix. I suspect it is not, but it
8572 ;; seems to work.
8573 (add-after 'unpack 'fix-compilation-error
8574 (lambda _
8575 (substitute* "src/org/eclipse/jface/text/AbstractDocument.java"
8576 (("Positions.put\\(category, new ArrayList<>\\(\\)\\);")
8577 "Positions.put(category, new ArrayList<Position>());"))
8578 #t)))))
8579 (inputs
8580 (list java-eclipse-equinox-common java-eclipse-core-commands
8581 java-icu4j))
8582 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
8583 (synopsis "Eclipse text library")
8584 (description "Platform Text is part of the Platform UI project and
8585provides the basic building blocks for text and text editors within Eclipse
8586and contributes the Eclipse default text editor.")
8587 (license license:epl1.0)))
8588
8589(define-public java-eclipse-jdt-core
8590 (package
8591 (name "java-eclipse-jdt-core")
8592 (version "3.16.0")
8593 (source (origin
8594 (method url-fetch)
8595 (uri (string-append "https://repo1.maven.org/maven2/"
8596 "org/eclipse/jdt/org.eclipse.jdt.core/"
8597 version "/org.eclipse.jdt.core-"
8598 version "-sources.jar"))
8599 (sha256
8600 (base32
8601 "1g560yr9v2kzv34gc2m3ifpgnj7krcdd6h4gd4z83pwqacwkfz0k"))))
8602 (build-system ant-build-system)
8603 (arguments
8604 `(#:tests? #f ; no tests included
8605 #:jar-name "eclipse-jdt-core.jar"
8606 #:phases
8607 (modify-phases %standard-phases
8608 (add-after 'unpack 'move-sources
8609 (lambda _
8610 (with-directory-excursion "src/jdtCompilerAdaptersrc/"
8611 (for-each (lambda (file)
8612 (install-file file (string-append "../" (dirname file))))
8613 (find-files "." ".*")))
8614 (delete-file-recursively "src/jdtCompilerAdaptersrc/")
8615 #t))
8616 (add-before 'build 'copy-resources
8617 (lambda _
8618 (with-directory-excursion "src"
8619 (for-each (lambda (file)
8620 (install-file file (string-append "../build/classes/" (dirname file))))
8621 (find-files "." ".*.(props|properties|rsc)")))
8622 #t)))))
8623 (inputs
8624 (list java-eclipse-core-contenttype
8625 java-eclipse-core-filesystem
8626 java-eclipse-core-jobs
8627 java-eclipse-core-resources
8628 java-eclipse-core-runtime
8629 java-eclipse-equinox-app
8630 java-eclipse-equinox-common
8631 java-eclipse-equinox-preferences
8632 java-eclipse-equinox-registry
8633 java-eclipse-osgi
8634 java-eclipse-text))
8635 (home-page "https://www.eclipse.org/jdt")
8636 (synopsis "Java development tools core libraries")
8637 (description "This package provides the core libraries of the Eclipse Java
8638development tools.")
8639 (license license:epl1.0)))
8640
8641(define-public java-eclipse-jdt-compiler-apt
8642 (package
8643 (name "java-eclipse-jdt-compiler-apt")
8644 (version "1.3.400")
8645 (source (origin
8646 (method url-fetch)
8647 (uri (string-append "https://repo1.maven.org/maven2/"
8648 "org/eclipse/jdt/org.eclipse.jdt.compiler.apt/"
8649 version "/org.eclipse.jdt.compiler.apt-"
8650 version "-sources.jar"))
8651 (sha256
8652 (base32
8653 "1s285k9p2ixdqrknb40jbbvw682n9a7l5lqpn583a8pvlzg2l6r8"))))
8654 (build-system ant-build-system)
8655 (arguments
8656 `(#:tests? #f ; no tests included
8657 #:jar-name "eclipse-jdt-compiler-apt.jar"
8658 #:jdk ,openjdk11))
8659 (inputs
8660 (list java-eclipse-jdt-core))
8661 (home-page "https://www.eclipse.org/jdt/apt/")
8662 (synopsis "Annotation processing tool")
8663 (description "APT stands for Annotation Processing Tool. APT provides a
8664means for generating files and compiling new Java classes based on annotations
8665found in your source code.")
8666 (license license:epl2.0)))
8667
8668(define-public java-eclipse-lsp4j-common
8669 (package
8670 (name "java-eclipse-lsp4j-common")
8671 (version "0.10.0")
8672 (source (origin
8673 (method git-fetch)
8674 (uri (git-reference
8675 (url "https://github.com/eclipse/lsp4j")
8676 (commit (string-append "v" version))))
8677 (file-name (git-file-name name version))
8678 (sha256
8679 (base32
8680 "17srrac0pkpybwwc21rzdvn762zzl9m80rlqihc9b4l55hkqpk98"))))
8681 (build-system ant-build-system)
8682 (home-page "https://eclipse.org/lsp4j/")
8683 (synopsis "LSP4J common package")
8684 (description "Eclipse LSP4J provides Java bindings for the Language
8685Server Protocol and the Debug Adapter Protocol. This package is a common
8686definition intended to be inherited by other packages.")
8687 (license license:epl2.0)))
8688
8689(define-public java-eclipse-lsp4j-debug
8690 (package
8691 (inherit java-eclipse-lsp4j-common)
8692 (name "java-eclipse-lsp4j-debug")
8693 (arguments
8694 `(#:jar-name "eclipse-lsp4j-debug.jar"
8695 #:jdk ,openjdk11
8696 #:tests? #f; tests fail with reflection errors
8697 #:source-dir "org.eclipse.lsp4j.debug/src/main/java"
8698 #:test-dir "org.eclipse.lsp4j.debug/src/test"
8699 #:phases
8700 (modify-phases %standard-phases
8701 (add-before 'build 'copy-xtend
8702 (lambda _
8703 (copy-recursively "org.eclipse.lsp4j.debug/src/main/xtend-gen"
8704 "org.eclipse.lsp4j.debug/src/main/java"))))))
8705 (native-inputs
8706 (list java-junit))
8707 (inputs
8708 `(("java-gson" ,java-gson-latest)
8709 ("java-eclipse-lsp4j-generaor" ,java-eclipse-lsp4j-generator)
8710 ("java-eclipse-lsp4j-jsonrpc" ,java-eclipse-lsp4j-jsonrpc)
8711 ("java-eclipse-lsp4j-jsonrpc-debug" ,java-eclipse-lsp4j-jsonrpc-debug)
8712 ("java-eclipse-xtext-xbase-lib" ,java-eclipse-xtext-xbase-lib)))
8713 (synopsis "Eclipse LSP4J Java bindings for the Debug Server Protocol")
8714 (description "Eclipse LSP4J provides Java bindings for the Language
8715Server Protocol and the Debug Adapter Protocol. This package contains its
8716LSP4J Java bindings for the Debug Server Protocol.")))
8717
8718(define-public java-eclipse-lsp4j-generator
8719 (package
8720 (inherit java-eclipse-lsp4j-common)
8721 (name "java-eclipse-lsp4j-generator")
8722 (arguments
8723 `(#:jar-name "eclipse-lsp4j-generator.jar"
8724 #:jdk ,openjdk11
8725 #:tests? #f; no tests
8726 #:source-dir "org.eclipse.lsp4j.generator/src/main/java"))
8727 (inputs
8728 (list java-eclipse-lsp4j-jsonrpc))
8729 (synopsis "Eclipse LSP4J Generator")
8730 (description "Eclipse LSP4J provides Java bindings for the Language
8731Server Protocol and the Debug Adapter Protocol. This package contains its
8732LSP4J code generator for Language Server Protocol classes.")))
8733
8734(define-public java-eclipse-lsp4j-jsonrpc
8735 (package
8736 (inherit java-eclipse-lsp4j-common)
8737 (name "java-eclipse-lsp4j-jsonrpc")
8738 (arguments
8739 `(#:jar-name "eclipse-lsp4j-jsonrpc.jar"
8740 #:jdk ,openjdk11
8741 #:source-dir "org.eclipse.lsp4j.jsonrpc/src/main/java"
8742 #:test-dir "org.eclipse.lsp4j.jsonrpc/src/test"
8743 #:phases
8744 (modify-phases %standard-phases
8745 (add-after 'unpack 'delete-failing-tests
8746 ;; The testMalformedJson* tests expect the exact error messages
8747 ;; of an older gson. Removing IntegrationTest.java also drops
8748 ;; the other tests it contains.
8749 (lambda _
8750 (delete-file
8751 (string-append
8752 "org.eclipse.lsp4j.jsonrpc/src/test/java/org/"
8753 "eclipse/lsp4j/jsonrpc/test/IntegrationTest.java")))))))
8754 (native-inputs
8755 (list java-junit))
8756 (inputs
8757 (list java-gson-latest))
8758 (synopsis "Java JSON-RPC implementation")
8759 (description "Eclipse LSP4J provides Java bindings for the Language
8760Server Protocol and the Debug Adapter Protocol. This package contains its
8761JSON-RPC implementation.")))
8762
8763(define-public java-eclipse-lsp4j-jsonrpc-debug
8764 (package
8765 (inherit java-eclipse-lsp4j-common)
8766 (name "java-eclipse-lsp4j-jsonrpc-debug")
8767 (arguments
8768 `(#:jar-name "eclipse-lsp4j-jsonrpc-debug.jar"
8769 #:jdk ,openjdk11
8770 #:source-dir "org.eclipse.lsp4j.jsonrpc.debug/src/main/java"
8771 #:test-dir "org.eclipse.lsp4j.jsonrpc.debug/src/test"))
8772 (native-inputs
8773 (list java-junit))
8774 (inputs
8775 (list java-eclipse-lsp4j-jsonrpc java-gson-latest))
8776 (synopsis "Java JSON-RPC implementation (debug protocol)")
8777 (description "Eclipse LSP4J provides Java bindings for the Language
8778Server Protocol and the Debug Adapter Protocol. This package contains its
8779JSON-RPC implementation's debug protocol.")))
8780
8781(define-public java-eclipse-xtext-xbase-lib
8782 (package
8783 (name "java-eclipse-xtext-xbase-lib")
8784 (version "2.25.0")
8785 (source (origin
8786 (method git-fetch)
8787 (uri (git-reference
8788 (url "https://github.com/eclipse/xtext-lib")
8789 (commit (string-append "v" version))))
8790 (file-name (git-file-name name version))
8791 (sha256
8792 (base32
8793 "13b9lf6lnsprkik665m1qcyyc8cs16k33xm7as4rjcfcpn4pln71"))))
8794 (build-system ant-build-system)
8795 (arguments
8796 `(#:jar-name "eclipse-xtext-xbase-lib.jar"
8797 #:jdk ,openjdk11
8798 #:tests? #f; TODO (maybe needs newer guava version?)
8799 #:source-dir "org.eclipse.xtext.xbase.lib/src"
8800 #:test-dir "org.eclipse.xtext.xbase.lib.tests/src"))
8801 (native-inputs
8802 (list java-junit))
8803 (inputs
8804 (list java-guava))
8805 (home-page "https://www.eclipse.org/Xtext/")
8806 (synopsis "Eclipse Xbase Runtime Library")
8807 (description "This package contains runtime libraries for Xbase languages
8808such as Xtend.")
8809 (license license:epl2.0)))
8810
8811(define-public java-javax-mail
8812 (package
8813 (name "java-javax-mail")
8814 (version "1.6.2")
8815 (source (origin
8816 (method url-fetch)
8817 (uri (string-append "https://repo1.maven.org/maven2/"
8818 "com/sun/mail/javax.mail/"
8819 version "/javax.mail-"
8820 version "-sources.jar"))
8821 (sha256
8822 (base32
8823 "15cryjf398x7sy42j5gzlj5cmc2nx05b175b4gclwxj6qg5ly0li"))))
8824 (build-system ant-build-system)
8825 (arguments
8826 `(#:tests? #f ; no tests
8827 #:jar-name "javax-mail.jar"))
8828 (home-page "https://javamail.java.net")
8829 (synopsis "Reference implementation of the JavaMail API")
8830 (description
8831 "This package provides versions of the JavaMail API implementation, IMAP,
8832SMTP, and POP3 service providers, some examples, and documentation for the
8833JavaMail API.")
8834 ;; GPLv2 only with "classpath exception".
8835 (license license:gpl2)))
8836
8837(define-public java-log4j-api
8838 (package
8839 (name "java-log4j-api")
8840 (version "2.17.1")
8841 (source (origin
8842 (method url-fetch)
8843 (uri (string-append "mirror://apache/logging/log4j/" version
8844 "/apache-log4j-" version "-src.tar.gz"))
8845 (sha256
8846 (base32
8847 "05xssljdgxfv8ql42db8ydjfsvvbdqmsgip75phybm259ydzbsd6"))))
8848 (build-system ant-build-system)
8849 (arguments
8850 `(#:tests? #f ; tests require unpackaged software
8851 #:jar-name "log4j-api.jar"
8852 #:make-flags
8853 ,#~(list (string-append "-Ddist.dir=" #$output "/share/java"))
8854 #:phases
8855 (modify-phases %standard-phases
8856 (add-after 'unpack 'enter-dir
8857 (lambda _ (chdir "log4j-api") #t))
8858 ;; FIXME: The tests require additional software that has not been
8859 ;; packaged yet, such as
8860 ;; * org.apache.maven
8861 ;; * org.apache.felix
8862 (add-after 'enter-dir 'delete-tests
8863 (lambda _ (delete-file-recursively "src/test") #t)))))
8864 (inputs
8865 (list java-osgi-core java-hamcrest-core java-junit))
8866 (properties '((cpe-name . "log4j")))
8867 (home-page "https://logging.apache.org/log4j/2.x/")
8868 (synopsis "API module of the Log4j logging framework for Java")
8869 (description
8870 "This package provides the API module of the Log4j logging framework for
8871Java.")
8872 (license license:asl2.0)))
8873
8874(define-public java-log4j-core
8875 (package
8876 (inherit java-log4j-api)
8877 (name "java-log4j-core")
8878 (inputs
8879 `(("java-osgi-core" ,java-osgi-core)
8880 ("java-hamcrest-core" ,java-hamcrest-core)
8881 ("java-log4j-api" ,java-log4j-api)
8882 ("java-mail" ,java-mail)
8883 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
8884 ("java-conversant-disruptor" ,java-conversant-disruptor)
8885 ("java-lmax-disruptor" ,java-lmax-disruptor)
8886 ("java-jctools-core" ,java-jctools-core-1)
8887 ("java-stax2-api" ,java-stax2-api)
8888 ("java-jansi" ,java-jansi)
8889 ("java-kafka" ,java-kafka-clients)
8890 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
8891 ("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
8892 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
8893 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
8894 ("java-fasterxml-jackson-dataformat-xml" ,java-fasterxml-jackson-dataformat-xml)
8895 ("java-fasterxml-jackson-dataformat-yaml" ,java-fasterxml-jackson-dataformat-yaml)
8896 ("java-commons-compress" ,java-commons-compress)
8897 ("java-commons-csv" ,java-commons-csv)
8898 ("java-jeromq" ,java-jeromq)
8899 ("java-junit" ,java-junit)))
8900 (native-inputs
8901 `(("hamcrest" ,java-hamcrest-all)
8902 ("java-commons-io" ,java-commons-io)
8903 ("java-commons-lang3" ,java-commons-lang3)
8904 ("slf4j" ,java-slf4j-api)))
8905 (arguments
8906 `(#:tests? #f ; tests require more dependencies
8907 #:test-dir "src/test"
8908 #:source-dir "src/main/java"
8909 #:jar-name "log4j-core.jar"
8910 #:jdk ,icedtea-8
8911 #:make-flags
8912 ,#~(list (string-append "-Ddist.dir=" #$output "/share/java"))
8913 #:phases
8914 (modify-phases %standard-phases
8915 (add-after 'unpack 'enter-dir
8916 (lambda _ (chdir "log4j-core") #t)))))
8917 (synopsis "Core component of the Log4j framework")
8918 (description "This package provides the core component of the Log4j
8919logging framework for Java.")))
8920
8921(define-public java-log4j-1.2-api
8922 (package
8923 (inherit java-log4j-api)
8924 (name "java-log4j-1.2-api")
8925 (arguments
8926 `(#:jar-name "java-log4j-1.2-api.jar"
8927 #:source-dir "log4j-1.2-api/src/main/java"
8928 #:jdk ,icedtea-8
8929 ;; Tests require maven-model (and other maven subprojects), which is a
8930 ;; cyclic dependency.
8931 #:tests? #f))
8932 (inputs
8933 `(("log4j-api" ,java-log4j-api)
8934 ("log4j-core" ,java-log4j-core)
8935 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
8936 ("osgi-core" ,java-osgi-core)
8937 ("eclipse-osgi" ,java-eclipse-osgi)
8938 ("java-lmax-disruptor" ,java-lmax-disruptor)))))
8939
8940(define-public java-commons-cli
8941 (package
8942 (name "java-commons-cli")
8943 (version "1.4")
8944 (source (origin
8945 (method url-fetch)
8946 (uri (string-append "mirror://apache/commons/cli/source/"
8947 "commons-cli-" version "-src.tar.gz"))
8948 (sha256
8949 (base32
8950 "05hgi2z01fqz374y719gl1dxzqvzci5af071zm7vxrjg9vczipm1"))))
8951 (build-system ant-build-system)
8952 ;; TODO: javadoc
8953 (arguments
8954 `(#:jar-name "commons-cli.jar"
8955 #:phases
8956 (modify-phases %standard-phases
8957 (replace 'install
8958 (install-from-pom "pom.xml")))))
8959 (native-inputs
8960 (list java-junit java-hamcrest-core))
8961 (home-page "https://commons.apache.org/cli/")
8962 (synopsis "Command line arguments and options parsing library")
8963 (description "The Apache Commons CLI library provides an API for parsing
8964command line options passed to programs. It is also able to print help
8965messages detailing the options available for a command line tool.
8966
8967Commons CLI supports different types of options:
8968
8969@itemize
8970@item POSIX like options (ie. tar -zxvf foo.tar.gz)
8971@item GNU like long options (ie. du --human-readable --max-depth=1)
8972@item Java like properties (ie. java -Djava.awt.headless=true Foo)
8973@item Short options with value attached (ie. gcc -O2 foo.c)
8974@item long options with single hyphen (ie. ant -projecthelp)
8975@end itemize
8976
8977This is a part of the Apache Commons Project.")
8978 (license license:asl2.0)))
8979
8980(define-public java-commons-text
8981 (package
8982 (name "java-commons-text")
8983 (version "1.15.0")
8984 (source (origin
8985 (method url-fetch)
8986 (uri (string-append "mirror://apache/commons/text/source/"
8987 "commons-text-" version "-src.tar.gz"))
8988 (sha256
8989 (base32
8990 "0k0y3pkgrzm84a0z1ifi4b9ydaglzm9pgvaw9phxdcwmcqxjbkc8"))))
8991 (build-system ant-build-system)
8992 (arguments
8993 (list #:jar-name "java-commons-text.jar"
8994 #:source-dir "src/main/java"
8995 #:test-dir "src/test"
8996 #:tests? #f ; Tests require JUnit5.
8997 #:phases
8998 #~(modify-phases %standard-phases
8999 (replace 'install
9000 (install-from-pom "pom.xml")))))
9001 (inputs
9002 (list java-commons-io))
9003 (propagated-inputs
9004 (list java-commons-lang3
9005 apache-commons-parent-pom-51))
9006 (home-page "https://commons.apache.org/text/")
9007 (synopsis "Library focused on algorithms working on strings")
9008 (description "Apache Commons Text is a library focused on algorithms
9009working on strings.
9010
9011This is a part of the Apache Commons Project.")
9012 (license license:asl2.0)))
9013
9014(define-public java-commons-codec
9015 (package
9016 (name "java-commons-codec")
9017 (version "1.15")
9018 (source (origin
9019 (method url-fetch)
9020 (uri (string-append "mirror://apache/commons/codec/source/"
9021 "commons-codec-" version "-src.tar.gz"))
9022 (sha256
9023 (base32
9024 "01z9qmg8fd8d7p7xxipwj1vi9bmvpgqyi29kldjz2x6vzwm171jj"))))
9025 (build-system ant-build-system)
9026 (arguments
9027 `(#:jar-name "java-commons-codec.jar"
9028 #:source-dir "src/main/java"
9029 #:test-dir "src/test"
9030 #:test-exclude (list "**/*AbstractTest.java")
9031 #:phases
9032 (modify-phases %standard-phases
9033 (add-before 'build 'copy-resources
9034 (lambda _
9035 (copy-recursively "src/main/resources"
9036 "build/classes")))
9037 (add-before 'check 'copy-test-resources
9038 (lambda _
9039 (copy-recursively "src/test/resources"
9040 "build/test-classes")))
9041 (add-before 'check 'skip-ravenous-test
9042 (lambda _
9043 ;; This test admits to being "memory hungry", but reliably fails
9044 ;; even on a machine that should have plenty (12 GiB). Skip it.
9045 (substitute*
9046 "src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java"
9047 (("\\bassertEnsureBufferSizeExpandsToMaxBufferSize.*;")
9048 "return;"))))
9049 (replace 'install (install-from-pom "pom.xml")))))
9050 (native-inputs
9051 (list java-commons-lang3 java-junit))
9052 (propagated-inputs
9053 (list apache-commons-parent-pom-52))
9054 (home-page "https://commons.apache.org/codec/")
9055 (synopsis "Common encoders and decoders such as Base64, Hex, Phonetic and URLs")
9056 (description "The codec package contains simple encoder and decoders for
9057various formats such as Base64 and Hexadecimal. In addition to these widely
9058used encoders and decoders, the codec package also maintains a collection of
9059phonetic encoding utilities.
9060
9061This is a part of the Apache Commons Project.")
9062 (license license:asl2.0)))
9063
9064(define-public java-commons-codec-1.17.1
9065 (package
9066 (inherit java-commons-codec)
9067 (version "1.17.1")
9068 (source (origin
9069 (method url-fetch)
9070 (uri (string-append "mirror://apache/commons/codec/source/"
9071 "commons-codec-" version "-src.tar.gz"))
9072 (sha256
9073 (base32
9074 "0f9f80azc13phkwa2fdkmpj5fkh85hf081fz5mmm6rqflmk83wp9"))))
9075 (arguments
9076 (substitute-keyword-arguments (package-arguments java-commons-codec)
9077 ;; Tests require JUnit 5 (org.junit.jupiter) which is not
9078 ;; yet available in Guix.
9079 ((#:tests? _ #t) #f)))))
9080
9081(define-public java-commons-daemon
9082 (package
9083 (name "java-commons-daemon")
9084 (version "1.1.0")
9085 (source (origin
9086 (method url-fetch)
9087 (uri (string-append "mirror://apache/commons/daemon/source/"
9088 "commons-daemon-" version "-src.tar.gz"))
9089 (sha256
9090 (base32
9091 "141gkhfzv5v3pdhic6y4ardq2dhsa3v36j8wmmhy6f8mac48fp7n"))))
9092 (build-system ant-build-system)
9093 (arguments
9094 `(#:test-target "test"
9095 #:phases
9096 (modify-phases %standard-phases
9097 (add-after 'build 'build-javadoc ant-build-javadoc)
9098 (replace 'install (install-jars "dist"))
9099 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
9100 (native-inputs
9101 (list java-junit))
9102 (home-page "https://commons.apache.org/daemon/")
9103 (synopsis "Library to launch Java applications as daemons")
9104 (description "The Daemon package from Apache Commons can be used to
9105implement Java applications which can be launched as daemons. For example the
9106program will be notified about a shutdown so that it can perform cleanup tasks
9107before its process of execution is destroyed by the operation system.
9108
9109This package contains the Java library. You will also need the actual binary
9110for your architecture which is provided by the jsvc package.
9111
9112This is a part of the Apache Commons Project.")
9113 (license license:asl2.0)))
9114
9115(define-public java-javaewah
9116 (package
9117 (name "java-javaewah")
9118 (version "1.1.6")
9119 (source (origin
9120 (method git-fetch)
9121 (uri (git-reference
9122 (url "https://github.com/lemire/javaewah/")
9123 (commit (string-append "JavaEWAH-" version))))
9124 (file-name (git-file-name name version))
9125 (sha256
9126 (base32
9127 "1m8qcb1py76v7avbjjrkvyy6fhr5dk2ywy73gbsxqry04gkm2nhw"))))
9128 (build-system ant-build-system)
9129 (arguments `(#:jar-name "javaewah.jar"))
9130 (inputs
9131 (list java-junit java-hamcrest-core))
9132 (home-page "https://github.com/lemire/javaewah")
9133 (synopsis "Compressed alternative to the Java @code{BitSet} class")
9134 (description "This is a word-aligned compressed variant of the Java
9135@code{Bitset} class. It provides both a 64-bit and a 32-bit RLE-like
9136compression scheme. It can be used to implement bitmap indexes.
9137
9138The goal of word-aligned compression is not to achieve the best compression,
9139but rather to improve query processing time. Hence, JavaEWAH tries to save CPU
9140cycles, maybe at the expense of storage. However, the EWAH scheme is always
9141more efficient storage-wise than an uncompressed bitmap (as implemented in the
9142@code{BitSet} class by Sun).")
9143 ;; GPL2.0 derivates are explicitly allowed.
9144 (license license:asl2.0)))
9145
9146(define-public java-javaewah-1.2.3
9147 (package
9148 (inherit java-javaewah)
9149 (version "1.2.3")
9150 (source (origin
9151 (method git-fetch)
9152 (uri (git-reference
9153 (url "https://github.com/lemire/javaewah/")
9154 (commit (string-append "JavaEWAH-" version))))
9155 (file-name (git-file-name "java-javaewah" version))
9156 (sha256
9157 (base32
9158 "0bl1702pkzr8c8ygprmdc47lrb3m4yn4097jf6liiin54d4km8j5"))))
9159 (arguments
9160 `(#:jar-name "javaewah.jar"
9161 #:phases
9162 (modify-phases %standard-phases
9163 (add-before 'check 'enable-assertions
9164 (lambda _
9165 ;; FuzzEWAHTest requires assertions enabled in the JVM.
9166 (substitute* "build.xml"
9167 (("haltonfailure=\"yes\">")
9168 "haltonfailure=\"yes\"><jvmarg value=\"-ea\" />"))))
9169 (add-after 'build 'add-osgi-manifest
9170 (lambda _
9171 ;; The Maven Central jar has OSGi manifest attributes set by
9172 ;; Maven Bundle Plugin. The NetBeans build uses
9173 ;; Bundle-SymbolicName as a fallback for OpenIDE-Module when
9174 ;; wrapping external libraries as modules.
9175 (call-with-output-file "osgi-manifest.mf"
9176 (lambda (port)
9177 (display (string-append
9178 "Bundle-ManifestVersion: 2\n"
9179 "Bundle-SymbolicName: com.googlecode.javaewah.JavaEWAH\n"
9180 "Bundle-Version: " ,version "\n"
9181 "Export-Package: com.googlecode.javaewah,"
9182 "com.googlecode.javaewah.datastructure,"
9183 "com.googlecode.javaewah.symmetric\n"
9184 "Import-Package: com.googlecode.javaewah,"
9185 "com.googlecode.javaewah.datastructure\n"
9186 "Multi-Release: true\n")
9187 port)))
9188 (invoke "jar" "ufm" "build/jar/javaewah.jar"
9189 "osgi-manifest.mf")))
9190 (replace 'install (install-from-pom "pom.xml")))))))
9191
9192(define-public java-slf4j-api
9193 (package
9194 (name "java-slf4j-api")
9195 (version "1.7.25")
9196 (source (origin
9197 (method git-fetch)
9198 (uri (git-reference
9199 (url "https://github.com/qos-ch/slf4j")
9200 (commit (string-append "v_" version))))
9201 (file-name (git-file-name name version))
9202 (sha256
9203 (base32
9204 "15n42zq3k1iyn752nwdcbs44hxns2rmxhglwjfr4np7lxx56apjl"))
9205 (modules '((guix build utils)))
9206 ;; Delete bundled jars.
9207 (snippet
9208 '(begin
9209 (for-each delete-file (find-files "." "\\.jar$"))
9210 #t))))
9211 (build-system ant-build-system)
9212 (arguments
9213 `(#:jar-name "slf4j-api.jar"
9214 #:source-dir "slf4j-api/src/main"
9215 #:test-dir "slf4j-api/src/test"
9216 #:phases
9217 (modify-phases %standard-phases
9218 (add-after 'build 'regenerate-jar
9219 (lambda _
9220 ;; pom.xml ignores these files in the jar creation process. If we don't,
9221 ;; we get the error "This code should have never made it into slf4j-api.jar"
9222 (delete-file-recursively "build/classes/org/slf4j/impl")
9223 (invoke "jar" "-cf" "build/jar/slf4j-api.jar" "-C"
9224 "build/classes" ".")
9225 ;; The NetBeans wrapper module has an empty jar target and
9226 ;; relies on Bundle-SymbolicName from the Maven Central jar.
9227 (call-with-output-file "osgi-manifest.mf"
9228 (lambda (port)
9229 (display (string-append
9230 "Bundle-ManifestVersion: 2\n"
9231 "Bundle-SymbolicName: slf4j.api\n"
9232 "Bundle-Version: " ,version "\n"
9233 "Export-Package: org.slf4j,org.slf4j.spi,"
9234 "org.slf4j.helpers,org.slf4j.event\n"
9235 "Import-Package: org.slf4j.impl\n")
9236 port)))
9237 (invoke "jar" "ufm" "build/jar/slf4j-api.jar"
9238 "osgi-manifest.mf")))
9239 (add-before 'check 'dont-test-abstract-classes
9240 (lambda _
9241 ;; abstract classes are not meant to be run with junit
9242 (substitute* "build.xml"
9243 (("<include name=\"\\*\\*/\\*Test.java\" />")
9244 (string-append "<include name=\"**/*Test.java\" />"
9245 "<exclude name=\"**/MultithreadedInitializationTest"
9246 ".java\" />")))
9247 #t))
9248 (replace 'install
9249 (install-from-pom "slf4j-api/pom.xml")))))
9250 (propagated-inputs
9251 (list java-slf4j-parent))
9252 (native-inputs
9253 (list java-junit java-hamcrest-core))
9254 (home-page "https://www.slf4j.org/")
9255 (synopsis "Simple logging facade for Java")
9256 (description "The Simple Logging Facade for Java (SLF4J) serves as a
9257simple facade or abstraction for various logging
9258frameworks (e.g. @code{java.util.logging}, @code{logback}, @code{log4j})
9259allowing the end user to plug in the desired logging framework at deployment
9260time.")
9261 (license license:expat)))
9262
9263(define java-slf4j-parent
9264 (package
9265 (inherit java-slf4j-api)
9266 (name "java-slf4j-parent")
9267 (native-inputs `())
9268 (propagated-inputs '())
9269 (arguments
9270 `(#:tests? #f
9271 #:phases
9272 (modify-phases %standard-phases
9273 (delete 'build)
9274 (delete 'configure)
9275 (replace 'install
9276 (install-pom-file "pom.xml")))))))
9277
9278(define-public java-slf4j-simple
9279 (package
9280 (name "java-slf4j-simple")
9281 (version "1.7.25")
9282 (source (package-source java-slf4j-api))
9283 (build-system ant-build-system)
9284 (arguments
9285 `(#:jar-name "slf4j-simple.jar"
9286 #:source-dir "slf4j-simple/src/main"
9287 #:test-dir "slf4j-simple/src/test"
9288 #:test-exclude (list "**/*SimpleLoggerMultithreadedInitializationTest.java")
9289 #:phases
9290 (modify-phases %standard-phases
9291 ;; The tests need some test classes from slf4j-api
9292 (add-before 'check 'build-slf4j-api-test-helpers
9293 (lambda _
9294 ;; Add current dir to CLASSPATH ...
9295 (setenv "CLASSPATH"
9296 (string-append (getcwd) ":" (getenv "CLASSPATH")))
9297 ;; ... and build test helper classes here:
9298 (apply invoke
9299 `("javac" "-d" "."
9300 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
9301 (replace 'install
9302 (install-from-pom "slf4j-simple/pom.xml")))))
9303 (propagated-inputs
9304 (list java-slf4j-api))
9305 (native-inputs
9306 (list java-junit java-hamcrest-core))
9307 (home-page "https://www.slf4j.org/")
9308 (synopsis "Simple implementation of simple logging facade for Java")
9309 (description "SLF4J binding for the Simple implementation, which outputs
9310all events to System.err. Only messages of level INFO and higher are
9311printed.")
9312 (license license:expat)))
9313
9314(define-public java-slf4j-nop
9315 (package
9316 (name "java-slf4j-nop")
9317 (version "1.7.25")
9318 (source (package-source java-slf4j-api))
9319 (build-system ant-build-system)
9320 (arguments
9321 `(#:jar-name "slf4j-nop.jar"
9322 #:source-dir "slf4j-nop/src/main"
9323 #:test-dir "slf4j-nop/src/test"
9324 #:phases (modify-phases %standard-phases
9325 ;; The tests need some test classes from slf4j-api
9326 (add-before 'check 'build-slf4j-api-test-helpers
9327 (lambda _
9328 ;; Add current dir to CLASSPATH ...
9329 (setenv "CLASSPATH"
9330 (string-append (getcwd) ":"
9331 (getenv "CLASSPATH")))
9332 ;; ... and build test helper classes here:
9333 (apply invoke
9334 `("javac" "-d" "."
9335 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
9336 (replace 'install
9337 (install-from-pom "slf4j-nop/pom.xml")))))
9338 (propagated-inputs (list java-slf4j-api))
9339 (native-inputs (list java-junit java-hamcrest-core))
9340 (home-page "https://www.slf4j.org/")
9341 (synopsis "SLF4J binding that silently discards all logging messages")
9342 (description "Binding/provider for NOP, an implementation that silently
9343discards all logging messages.")
9344 (license license:expat)))
9345
9346(define-public java-slf4j-jdk14
9347 (package
9348 (name "java-slf4j-jdk14")
9349 (version "1.7.25")
9350 (source (package-source java-slf4j-api))
9351 (build-system ant-build-system)
9352 (arguments
9353 `(#:jar-name "slf4j-jdk14.jar"
9354 #:source-dir "slf4j-jdk14/src/main"
9355 #:test-dir "slf4j-jdk14/src/test"
9356 #:test-exclude (list "**/*MultithreadedInitializationTest.java")
9357 #:phases
9358 (modify-phases %standard-phases
9359 (add-after 'build 'add-osgi-manifest
9360 (lambda _
9361 ;; The NetBeans wrapper module has an empty jar target and
9362 ;; relies on Bundle-SymbolicName from the Maven Central jar.
9363 (call-with-output-file "osgi-manifest.mf"
9364 (lambda (port)
9365 (display (string-append
9366 "Bundle-ManifestVersion: 2\n"
9367 "Bundle-SymbolicName: slf4j.jdk14\n"
9368 "Bundle-Version: " ,version "\n"
9369 "Export-Package: org.slf4j.impl\n"
9370 "Import-Package: org.slf4j,org.slf4j.spi,"
9371 "org.slf4j.helpers,org.slf4j.event\n")
9372 port)))
9373 (invoke "jar" "ufm" "build/jar/slf4j-jdk14.jar"
9374 "osgi-manifest.mf")))
9375 (add-before 'check 'build-slf4j-api-test-helpers
9376 (lambda _
9377 (setenv "CLASSPATH"
9378 (string-append (getcwd) ":" (getenv "CLASSPATH")))
9379 (apply invoke
9380 `("javac" "-d" "."
9381 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
9382 (replace 'install
9383 (install-from-pom "slf4j-jdk14/pom.xml")))))
9384 (propagated-inputs (list java-slf4j-api))
9385 (native-inputs (list java-junit java-hamcrest-core))
9386 (home-page "https://www.slf4j.org/")
9387 (synopsis "SLF4J binding for @code{java.util.logging}")
9388 (description "SLF4J binding for the JDK14 @code{java.util.logging}
9389framework.")
9390 (license license:expat)))
9391
9392(define-public java-jcl-over-slf4j
9393 (package
9394 (name "java-jcl-over-slf4j")
9395 (version "1.7.36")
9396 (source (origin
9397 (method git-fetch)
9398 (uri (git-reference
9399 (url "https://github.com/qos-ch/slf4j")
9400 (commit (string-append "v_" version))))
9401 (file-name (git-file-name name version))
9402 (sha256
9403 (base32
9404 "05kdsrvacvgdsqj812jhar813asgl2i2xlvh4i4p4i5cxg17bkq3"))
9405 (modules '((guix build utils)))
9406 ;; Delete bundled jars.
9407 (snippet
9408 '(for-each delete-file (find-files "." "\\.jar$")))))
9409 (build-system ant-build-system)
9410 (arguments
9411 `(#:jar-name "jcl-over-slf4j.jar"
9412 #:source-dir "jcl-over-slf4j/src/main/java"
9413 #:test-dir "jcl-over-slf4j/src/test"
9414 #:phases
9415 (modify-phases %standard-phases
9416 (add-before 'build 'add-resources
9417 (lambda _
9418 ;; The default ant build does not include resources in the jar,
9419 ;; but the JCL LogFactory service provider is required for
9420 ;; commons-logging to discover the SLF4J implementation. Stage
9421 ;; the resources into the classes directory before the build
9422 ;; phase so that "build/jar/jcl-over-slf4j.jar" includes them.
9423 (copy-recursively
9424 "jcl-over-slf4j/src/main/resources/META-INF/services"
9425 "build/classes/META-INF/services")))
9426 (replace 'install
9427 (install-from-pom "jcl-over-slf4j/pom.xml")))))
9428 (propagated-inputs (list java-slf4j-api))
9429 (native-inputs (list java-junit java-hamcrest-core java-slf4j-jdk14))
9430 (home-page "https://www.slf4j.org/")
9431 (synopsis "Apache Commons Logging implemented over SLF4J")
9432 (description "This package provides a drop-in replacement for Apache
9433Commons Logging (JCL) version 1.2. It redirects all calls made to the
9434@code{commons-logging} API to SLF4J, allowing the user to plug in the desired
9435SLF4J binding at deployment time.")
9436 (license license:asl2.0)))
9437
9438(define-public antlr2
9439 (package
9440 (name "antlr2")
9441 (version "2.7.7")
9442 (source (origin
9443 (method url-fetch)
9444 (uri (string-append "https://www.antlr2.org/download/antlr-"
9445 version ".tar.gz"))
9446 (sha256
9447 (base32
9448 "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5"))
9449 (modules '((guix build utils)))
9450 (snippet
9451 '(begin
9452 (delete-file "antlr.jar")
9453 (substitute* "lib/cpp/antlr/CharScanner.hpp"
9454 (("#include <map>")
9455 (string-append
9456 "#include <map>\n"
9457 "#define EOF (-1)\n"
9458 "#include <strings.h>")))
9459 (substitute* "configure"
9460 (("/bin/sh") "sh"))
9461 #t))))
9462 (build-system gnu-build-system)
9463 (arguments
9464 `(#:tests? #f ; no test target
9465 #:imported-modules ((guix build ant-build-system)
9466 ,@%default-gnu-imported-modules)
9467 #:modules (((guix build ant-build-system) #:prefix ant:)
9468 (guix build gnu-build-system)
9469 (guix build utils))
9470 #:phases
9471 (modify-phases %standard-phases
9472 (add-after 'install 'strip-jar-timestamps
9473 (assoc-ref ant:%standard-phases 'strip-jar-timestamps))
9474 (add-before 'configure 'fix-timestamp
9475 (lambda _
9476 (substitute* "configure"
9477 (("^TIMESTAMP.*") "TIMESTAMP=19700101\n"))
9478 #t))
9479 (add-after 'configure 'fix-bin-ls
9480 (lambda _
9481 (substitute* (find-files "." "Makefile")
9482 (("/bin/ls") "ls"))
9483 #t)))))
9484 (native-inputs
9485 `(("which" ,which)
9486 ("zip" ,zip)
9487 ("java" ,icedtea "jdk")))
9488 (inputs
9489 `(("java" ,icedtea)))
9490 (home-page "https://www.antlr2.org")
9491 (synopsis "Framework for constructing recognizers, compilers, and translators")
9492 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
9493is a language tool that provides a framework for constructing recognizers,
9494compilers, and translators from grammatical descriptions containing Java, C#,
9495C++, or Python actions. ANTLR provides excellent support for tree construction,
9496tree walking, and translation.")
9497 (license license:public-domain)))
9498
9499(define-public java-stringtemplate-3
9500 (package
9501 (name "java-stringtemplate")
9502 (version "3.2.1")
9503 (source (origin
9504 (method url-fetch)
9505 (uri (string-append "https://github.com/antlr/website-st4/raw/"
9506 "gh-pages/download/stringtemplate-"
9507 version ".tar.gz"))
9508 (sha256
9509 (base32
9510 "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is"))))
9511 (build-system ant-build-system)
9512 (arguments
9513 `(#:jar-name (string-append ,name "-" ,version ".jar")
9514 #:test-dir "test"
9515 #:modules ((guix build ant-build-system)
9516 (guix build utils)
9517 (srfi srfi-1))
9518 #:phases
9519 (modify-phases %standard-phases
9520 (add-before 'check 'fix-tests
9521 (lambda _
9522 (substitute* "build.xml"
9523 (("\\$\\{test.home\\}/java")
9524 "${test.home}/org"))
9525 #t))
9526 (add-before 'build 'generate-grammar
9527 (lambda _
9528 (with-directory-excursion "src/org/antlr/stringtemplate/language/"
9529 (for-each (lambda (file)
9530 (format #t "~a\n" file)
9531 (invoke "antlr" file))
9532 '("template.g" "angle.bracket.template.g" "action.g"
9533 "eval.g" "group.g" "interface.g")))
9534 #t)))))
9535 (native-inputs
9536 `(("antlr" ,antlr2)
9537 ("java-junit" ,java-junit)))
9538 (home-page "https://www.stringtemplate.org")
9539 (synopsis "Template engine to generate formatted text output")
9540 (description "StringTemplate is a java template engine (with ports for C#,
9541Objective-C, JavaScript, Scala) for generating source code, web pages, emails,
9542or any other formatted text output. StringTemplate is particularly good at
9543code generators, multiple site skins, and internationalization / localization.
9544StringTemplate also powers ANTLR.")
9545 (license license:bsd-3)))
9546
9547;; antlr3 is partially written using antlr3 grammar files. It also depends on
9548;; ST4 (stringtemplate4), which is also partially written using antlr3 grammar
9549;; files and uses antlr3 at runtime. The latest version requires a recent version
9550;; of antlr3 at runtime.
9551;; Fortunately, ST4 4.0.6 can be built with an older antlr3, and we use antlr3.3.
9552;; This version of ST4 is sufficient for the latest antlr3.
9553;; We use ST4 4.0.6 to build a boostrap antlr3 (latest version), and build
9554;; the latest ST4 with it. Then we build our final antlr3 that will be linked
9555;; against the latest ST4.
9556;; antlr3.3 still depends on antlr3 to generate some files, so we use an
9557;; even older version, antlr3.1, to generate them. Fortunately antlr3.1 uses
9558;; only grammar files with the antlr2 syntax.
9559;; So we build antlr3.1 -> antlr3.3 -> ST4.0.6 -> antlr3-bootstrap -> ST4 -> antlr3.
9560
9561(define-public java-stringtemplate
9562 (package (inherit java-stringtemplate-3)
9563 (name "java-stringtemplate")
9564 (version "4.0.8")
9565 (source (origin
9566 (method url-fetch)
9567 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/"
9568 version ".tar.gz"))
9569 (file-name (string-append name "-" version ".tar.gz"))
9570 (sha256
9571 (base32
9572 "1pri8hqa95rfdkjy55icl5q1m09zwp5k67ib14abas39s4v3w087"))))
9573 (build-system ant-build-system)
9574 (arguments
9575 `(#:jar-name (string-append ,name "-" ,version ".jar")
9576 #:tests? #f ; FIXME: tests fail for unknown reasons
9577 #:test-dir "test"
9578 #:modules ((guix build ant-build-system)
9579 (guix build utils)
9580 (srfi srfi-1))
9581 #:phases
9582 (modify-phases %standard-phases
9583 (add-before 'check 'fix-test-target
9584 (lambda _
9585 (substitute* "build.xml"
9586 (("\\$\\{test.home\\}/java") "${test.home}/")
9587 (("\\*Test.java") "Test*.java"))
9588 #t))
9589 (add-before 'build 'generate-grammar
9590 (lambda _
9591 (with-directory-excursion "src/org/stringtemplate/v4/compiler/"
9592 (for-each (lambda (file)
9593 (format #t "~a\n" file)
9594 (invoke "antlr3" file))
9595 '("STParser.g" "Group.g" "CodeGenerator.g")))
9596 #t)))))
9597 (inputs
9598 `(("antlr3" ,antlr3-bootstrap)
9599 ("antlr2" ,antlr2)
9600 ("java-stringtemplate" ,java-stringtemplate-3)
9601 ("java-junit" ,java-junit)))))
9602
9603(define-public java-stringtemplate-4.0.6
9604 (package (inherit java-stringtemplate)
9605 (name "java-stringtemplate")
9606 (version "4.0.6")
9607 (source (origin
9608 (method url-fetch)
9609 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/ST-"
9610 version ".tar.gz"))
9611 (file-name (string-append name "-" version ".tar.gz"))
9612 (sha256
9613 (base32
9614 "0hjmh1ahdsh3w825i67mli9l4nncc4l6hdbf9ma91jvlj590sljp"))))
9615 (inputs
9616 `(("antlr3" ,antlr3-3.3)
9617 ("antlr2" ,antlr2)
9618 ("java-stringtemplate" ,java-stringtemplate-3)))))
9619
9620(define-public antlr3
9621 (package
9622 (name "antlr3")
9623 (version "3.5.2")
9624 (source (origin
9625 (method git-fetch)
9626 (uri (git-reference
9627 (url "https://github.com/antlr/antlr3")
9628 (commit version)))
9629 (file-name (git-file-name name version))
9630 (sha256
9631 (base32
9632 "0cafavrjmzqhklghrk8c2jqxkdwxgzskm20pbrfd3r41cn00dpnf"))))
9633 (build-system ant-build-system)
9634 (arguments
9635 `(#:jar-name (string-append ,name "-" ,version ".jar")
9636 #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3"
9637 #:tests? #f
9638 #:phases
9639 (modify-phases %standard-phases
9640 (add-after 'install 'bin-install
9641 (lambda* (#:key inputs outputs #:allow-other-keys)
9642 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
9643 (bin (string-append (assoc-ref outputs "out") "/bin")))
9644 (mkdir-p bin)
9645 (with-output-to-file (string-append bin "/antlr3")
9646 (lambda _
9647 (display
9648 (string-append "#!" (which "sh") "\n"
9649 "java -cp " jar "/" ,name "-" ,version ".jar:"
9650 (string-concatenate
9651 (find-files (assoc-ref inputs "stringtemplate")
9652 ".*\\.jar"))
9653 ":"
9654 (string-concatenate
9655 (find-files (assoc-ref inputs "stringtemplate4")
9656 ".*\\.jar"))
9657 ":"
9658 (string-concatenate
9659 (find-files (string-append
9660 (assoc-ref inputs "antlr")
9661 "/lib")
9662 ".*\\.jar"))
9663 " org.antlr.Tool $*"))))
9664 (chmod (string-append bin "/antlr3") #o755))
9665 #t))
9666 (add-before 'build 'generate-grammar
9667 (lambda _
9668 (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/")
9669 (for-each (lambda (file)
9670 (display file)
9671 (newline)
9672 (invoke "antlr3" file))
9673 '("ANTLR.g" "ANTLRTreePrinter.g" "ActionAnalysis.g"
9674 "AssignTokenTypesWalker.g"
9675 "ActionTranslator.g" "TreeToNFAConverter.g"
9676 "ANTLRv3.g" "ANTLRv3Tree.g" "LeftRecursiveRuleWalker.g"
9677 "CodeGenTreeWalker.g" "DefineGrammarItemsWalker.g"))
9678 (substitute* "ANTLRParser.java"
9679 (("public Object getTree") "public GrammarAST getTree"))
9680 (substitute* "ANTLRv3Parser.java"
9681 (("public Object getTree") "public CommonTree getTree"))
9682 (chdir "../../../../../java")
9683 (substitute* "org/antlr/tool/LeftRecursiveRuleAnalyzer.java"
9684 (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*;
9685import org.antlr.grammar.v3.ANTLRTreePrinter;"))
9686 (substitute* "org/antlr/tool/ErrorManager.java"
9687 (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") ""))
9688 (chdir "../../../..")
9689 #t))
9690 (add-before 'build 'fix-build-xml
9691 (lambda _
9692 (substitute* "build.xml"
9693 (("target name=\"compile\">")
9694 "target name=\"compile\">
9695<copy todir=\"${classes.dir}\">
9696<fileset dir=\"tool/src/main/resources\">
9697<include name=\"**/*.stg\"/>
9698<include name=\"**/*.st\"/>
9699<include name=\"**/*.sti\"/>
9700<include name=\"**/STLexer.tokens\"/>
9701</fileset>
9702</copy>"))
9703 #t)))))
9704 (native-inputs
9705 `(("antlr" ,antlr2)
9706 ("antlr3" ,antlr3-bootstrap)))
9707 (inputs
9708 `(("junit" ,java-junit)
9709 ("stringtemplate" ,java-stringtemplate-3)
9710 ("stringtemplate4" ,java-stringtemplate)))
9711 (propagated-inputs
9712 `(("stringtemplate" ,java-stringtemplate-3)
9713 ("antlr" ,antlr2)
9714 ("stringtemplate4" ,java-stringtemplate-4.0.6)))
9715 (home-page "https://www.antlr3.org")
9716 (synopsis "Framework for constructing recognizers, compilers, and translators")
9717 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
9718is a language tool that provides a framework for constructing recognizers,
9719compilers, and translators from grammatical descriptions containing Java, C#,
9720C++, or Python actions. ANTLR provides excellent support for tree construction,
9721tree walking, and translation.")
9722 (license license:bsd-3)))
9723
9724(define-public antlr3-bootstrap
9725 (package
9726 (inherit antlr3)
9727 (name "antlr3-bootstrap")
9728 (native-inputs
9729 `(("antlr" ,antlr2)
9730 ("antlr3" ,antlr3-3.3)))
9731 (inputs
9732 `(("junit" ,java-junit)))
9733 (properties '((hidden? . #t))))) ;for bootstrapping purposes only
9734
9735(define-public antlr3-3.3
9736 (package
9737 (inherit antlr3)
9738 (name "antlr3")
9739 (version "3.3")
9740 (source (origin
9741 (method url-fetch)
9742 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
9743 "gh-pages/download/antlr-"
9744 version ".tar.gz"))
9745 (sha256
9746 (base32
9747 "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m"))
9748 (patches
9749 (search-patches "antlr3-3_3-fix-java8-compilation.patch"))))
9750 (arguments
9751 `(#:jar-name (string-append ,name "-" ,version ".jar")
9752 #:source-dir (string-join '("tool/src/main/java"
9753 "runtime/Java/src/main/java"
9754 "tool/src/main/antlr2"
9755 "tool/src/main/antlr3")
9756 ":")
9757 #:tests? #f ; FIXME: tests seem to require maven plugin
9758 #:modules ((guix build ant-build-system)
9759 (guix build utils)
9760 (srfi srfi-1))
9761 #:phases
9762 (modify-phases %standard-phases
9763 (add-after 'install 'bin-install
9764 (lambda* (#:key inputs outputs #:allow-other-keys)
9765 (let* ((out (assoc-ref outputs "out"))
9766 (jar (string-append out "/share/java"))
9767 (bin (string-append out "/bin")))
9768 (mkdir-p bin)
9769 (with-output-to-file (string-append bin "/antlr3")
9770 (lambda _
9771 (display
9772 (string-append
9773 "#!" (which "sh") "\n"
9774 "java -cp " jar "/antlr3-3.3.jar:"
9775 (string-join
9776 (append (find-files (assoc-ref inputs "java-stringtemplate")
9777 ".*\\.jar$")
9778 (find-files (string-append (assoc-ref inputs "antlr")
9779 "/lib")
9780 ".*\\.jar$"))
9781 ":")
9782 " org.antlr.Tool $*"))))
9783 (chmod (string-append bin "/antlr3") #o755)
9784 #t)))
9785 (add-before 'build 'generate-grammar
9786 (lambda _
9787 (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java"
9788 (("import org.antlr.grammar.v2.\\*;")
9789 "import org.antlr.grammar.v2.*;\n
9790import org.antlr.grammar.v2.TreeToNFAConverter;\n
9791import org.antlr.grammar.v2.DefineGrammarItemsWalker;\n
9792import org.antlr.grammar.v2.ANTLRTreePrinter;"))
9793 (with-directory-excursion "tool/src/main/antlr2/org/antlr/grammar/v2/"
9794 (for-each (lambda (file)
9795 (format #t "~a\n" file)
9796 (invoke "antlr" file))
9797 '("antlr.g" "antlr.print.g" "assign.types.g"
9798 "buildnfa.g" "codegen.g" "define.g")))
9799 (with-directory-excursion "tool/src/main/antlr3/org/antlr/grammar/v3/"
9800 (for-each (lambda (file)
9801 (format #t "~a\n" file)
9802 (invoke "antlr3" file))
9803 '("ActionAnalysis.g" "ActionTranslator.g" "ANTLRv3.g"
9804 "ANTLRv3Tree.g")))
9805 #t))
9806 (add-before 'build 'fix-build-xml
9807 (lambda _
9808 (substitute* "build.xml"
9809 (("target name=\"compile\">")
9810 "target name=\"compile\">
9811<copy todir=\"${classes.dir}\">
9812<fileset dir=\"tool/src/main/resources\">
9813<include name=\"**/*.stg\"/>
9814<include name=\"**/*.st\"/>
9815<include name=\"**/*.sti\"/>
9816<include name=\"**/STLexer.tokens\"/>
9817</fileset>
9818</copy>"))
9819 #t)))))
9820 (native-inputs
9821 `(("antlr" ,antlr2)
9822 ("antlr3" ,antlr3-3.1)))
9823 (inputs
9824 `(("junit" ,java-junit)))
9825 (propagated-inputs
9826 `(("java-stringtemplate" ,java-stringtemplate-3)
9827 ("antlr" ,antlr2)))
9828 (properties (alist-delete 'hidden? (package-properties antlr3)))))
9829
9830(define-public antlr3-3.1
9831 (package
9832 (inherit antlr3)
9833 (version "3.1")
9834 (source (origin
9835 (method url-fetch)
9836 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
9837 "gh-pages/download/antlr-"
9838 version ".tar.gz"))
9839 (sha256
9840 (base32
9841 "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z"))
9842 (patches
9843 (search-patches "antlr3-3_1-fix-java8-compilation.patch"))))
9844 (arguments
9845 `(#:jar-name (string-append "antlr3-" ,version ".jar")
9846 #:source-dir "src:runtime/Java/src"
9847 #:tests? #f
9848 #:phases
9849 (modify-phases %standard-phases
9850 (add-after 'install 'bin-install
9851 (lambda* (#:key inputs outputs #:allow-other-keys)
9852 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
9853 (bin (string-append (assoc-ref outputs "out") "/bin")))
9854 (mkdir-p bin)
9855 (with-output-to-file (string-append bin "/antlr3")
9856 (lambda _
9857 (display
9858 (string-append "#!" (which "sh") "\n"
9859 "java -cp " jar "/antlr3-3.1.jar:"
9860 (string-concatenate
9861 (find-files (assoc-ref inputs "stringtemplate")
9862 ".*\\.jar"))
9863 ":"
9864 (string-concatenate
9865 (find-files (string-append
9866 (assoc-ref inputs "antlr")
9867 "/lib")
9868 ".*\\.jar"))
9869 " org.antlr.Tool $*"))))
9870 (chmod (string-append bin "/antlr3") #o755))
9871 #t))
9872 (add-before 'build 'generate-grammar
9873 (lambda _
9874 (let ((dir "src/org/antlr/tool/"))
9875 (for-each (lambda (file)
9876 (display file)
9877 (newline)
9878 (invoke "antlr" "-o" dir (string-append dir file)))
9879 '("antlr.g" "antlr.print.g" "assign.types.g"
9880 "buildnfa.g" "define.g")))
9881 (format #t "codegen.g\n")
9882 (invoke "antlr" "-o" "src/org/antlr/codegen"
9883 "src/org/antlr/codegen/codegen.g")
9884 #t))
9885 (add-before 'build 'fix-build-xml
9886 (lambda _
9887 (substitute* "build.xml"
9888 (("target name=\"compile\">")
9889 "target name=\"compile\">
9890<copy todir=\"${classes.dir}\">
9891<fileset dir=\"src\">
9892<include name=\"**/*.stg\"/>
9893<include name=\"**/*.st\"/>
9894<include name=\"**/*.sti\"/>
9895<include name=\"**/STLexer.tokens\"/>
9896</fileset>
9897</copy>"))
9898 #t)))))
9899 (native-inputs
9900 `(("antlr" ,antlr2)))
9901 (inputs
9902 `(("junit" ,java-junit)))
9903 (propagated-inputs
9904 `(("stringtemplate" ,java-stringtemplate-3)))))
9905
9906(define-public java-treelayout
9907 (package
9908 (name "java-treelayout")
9909 (version "1.0.3")
9910 (source (origin
9911 (method git-fetch)
9912 (uri (git-reference
9913 (url "https://github.com/abego/treelayout")
9914 (commit (string-append "v" version))))
9915 (file-name (git-file-name name version))
9916 (sha256
9917 (base32
9918 "18my8ql9b1y0n0zrvkih7xfhf3dpgfhyfifvkcfhmwcvw3divxak"))))
9919 (build-system ant-build-system)
9920 (arguments
9921 `(#:jar-name (string-append ,name "-" ,version ".jar")
9922 #:source-dir "org.abego.treelayout/src/main/java"
9923 #:test-dir "org.abego.treelayout/src/test"))
9924 (inputs
9925 (list java-junit))
9926 (native-inputs
9927 (list java-hamcrest-core))
9928 (home-page "https://treelayout.sourceforge.net")
9929 (synopsis "Tree Layout Algorithm in Java")
9930 (description "TreeLayout creates tree layouts for arbitrary trees. It is
9931not restricted to a specific output or format, but can be used for any kind of
9932two dimensional diagram. Examples are Swing based components, SVG files, etc.
9933This is possible because TreeLayout separates the layout of a tree from the
9934actual rendering.")
9935 (license license:bsd-3)))
9936
9937(define-public java-antlr4-runtime
9938 (package
9939 (name "java-antlr4-runtime")
9940 (version "4.10.1")
9941 (source (origin
9942 (method git-fetch)
9943 (uri (git-reference
9944 (url "https://github.com/antlr/antlr4")
9945 (commit version)))
9946 (file-name (git-file-name name version))
9947 (sha256
9948 (base32
9949 "0ldvd9jm4nrivaw7i7wh1q40q6xgzmzirsywiakbhg8sppagqlv7"))
9950 (patches
9951 (search-patches "java-antlr4-Add-standalone-generator.patch"))))
9952 (build-system ant-build-system)
9953 (arguments
9954 `(#:jar-name "java-antlr4-runtime.jar"
9955 #:source-dir "runtime/Java/src/org"
9956 #:tests? #f; tests depend on java-antlr4 itself
9957 #:phases
9958 (modify-phases %standard-phases
9959 (add-before 'build 'copy-resources
9960 (lambda _
9961 (copy-recursively "runtime/Java/src/main/dot"
9962 "build/classes")
9963 #t)))))
9964 (home-page "https://www.antlr.org")
9965 (synopsis "ANTLR runtime library")
9966 (description "This package contains the runtime library used with generated
9967sources by ANTLR.")
9968 (license license:bsd-3)))
9969
9970(define-public cpp-antlr4-runtime
9971 (package
9972 (inherit java-antlr4-runtime)
9973 (name "cpp-antlr4-runtime")
9974 (properties '((upstream-name . "antlr4-cpp-runtime")))
9975 (outputs '("out" "static"))
9976 (build-system cmake-build-system)
9977 (arguments
9978 (list
9979 ;; TODO: try to run the tests under
9980 ;; runtime-testsuite/test/org/antlr/v4/test/runtime/cpp with antlr4.
9981 #:phases
9982 #~(modify-phases %standard-phases
9983 (add-after 'unpack 'chdir
9984 (lambda _
9985 (chdir "runtime/Cpp")))
9986 (add-after 'chdir 'unbundle-googletest
9987 (lambda _
9988 (substitute* "runtime/CMakeLists.txt"
9989 (("^ FetchContent_MakeAvailable.*")
9990 "")
9991 (("gtest_main" all)
9992 (string-append "gtest " all)))))
9993 (add-after 'install 'move-static-library
9994 (lambda* (#:key outputs #:allow-other-keys)
9995 (let ((static (assoc-ref outputs "static"))
9996 (libantlr4-runtime.a (search-input-file
9997 outputs "lib/libantlr4-runtime.a")))
9998 (mkdir-p (string-append static "/lib"))
9999 (rename-file
10000 libantlr4-runtime.a
10001 (string-append static "/lib/"
10002 (basename libantlr4-runtime.a)))))))))
10003 (native-inputs (list googletest pkg-config))
10004 (inputs (list `(,util-linux "lib"))) ;libuuid
10005 (synopsis "ANTLR C++ runtime library")
10006 (description "This package contains the C++ runtime library used with C++
10007generated sources by ANTLR.")))
10008
10009(define-deprecated-package java-antlr4-runtime-cpp
10010 cpp-antlr4-runtime)
10011
10012(define-public python-antlr4-runtime
10013 (package
10014 (inherit java-antlr4-runtime)
10015 (name "python-antlr4-runtime")
10016 (properties '((upstream-name . "antlr4-python3-runtime")))
10017 (build-system pyproject-build-system)
10018 (arguments
10019 (list
10020 #:test-backend #~'custom
10021 #:test-flags #~'("tests/run.py" "--verbose")
10022 #:phases
10023 #~(modify-phases %standard-phases
10024 (add-after 'unpack 'chdir
10025 (lambda _
10026 (chdir "runtime/Python3")))
10027 ;; TODO: Remove when updating ANTLR4:
10028 ;; https://github.com/antlr/antlr4/pull/4593
10029 (add-after 'chdir 'fix-python-3.12-compatibility
10030 (lambda _
10031 (substitute* "tests/TestIntervalSet.py"
10032 (("assertEquals") "assertEqual"))))
10033 (add-after 'chdir 'regenerate-parsers
10034 (lambda _
10035 (invoke "antlr4" "-no-listener" "-Dlanguage=Python3"
10036 "src/antlr4/xpath/XPathLexer.g4")
10037 (invoke "antlr4" "-no-listener" "-Dlanguage=Python3"
10038 "tests/expr/Expr.g4"))))))
10039 (native-inputs (list antlr4 python-setuptools))
10040 (synopsis "ANTLR Python runtime library")
10041 (description "This package contains the Python runtime library used with
10042Python generated sources by ANTLR.")))
10043
10044(define-deprecated-package java-antlr4-runtime-python
10045 python-antlr4-runtime)
10046
10047(define-public antlr4
10048 (package
10049 (inherit java-antlr4-runtime)
10050 (name "antlr4")
10051 (arguments
10052 `(#:jar-name "antlr4.jar"
10053 #:source-dir "tool/src"
10054 #:test-dir "tool-testsuite/test:runtime-testsuite/test"
10055 #:test-include (list "**/Test*.java")
10056 #:test-exclude (list
10057 ;; These have no runnable methods and fail because
10058 ;; test-include above is too broad.
10059 "**/TestContext.java"
10060 "**/TestOutputReading.java"
10061 ;; no @Test methods
10062 "**/TestParserErrors.java"
10063 "**/TestSemPredEvalParser.java"
10064 "**/TestSets.java"
10065 "**/TestListeners.java"
10066 "**/TestParseTrees.java"
10067 "**/TestParserExec.java"
10068 "**/TestLexerErrors.java"
10069 "**/TestPerformance.java"
10070 "**/TestCompositeParsers.java"
10071 "**/TestLexerExec.java"
10072 "**/TestSemPredEvalLexer.java"
10073 "**/TestLeftRecursion.java"
10074 "**/TestFullContextParsing.java"
10075 "**/TestCompositeLexers.java"
10076 ;; Null pointer exception
10077 "**/TestCompositeGrammars.java")
10078 #:phases
10079 (modify-phases %standard-phases
10080 (add-before 'build 'fix-build.xml
10081 (lambda _
10082 ;; tests are not in a java subdirectory
10083 (substitute* "build.xml"
10084 (("\\$\\{test.home\\}/java") "${test.home}"))
10085 #t))
10086 ;; tests require to have a working antlr4 binary
10087 (delete 'check)
10088 (add-after 'install 'check
10089 (lambda _
10090 (invoke "ant" "compile-tests")
10091 (invoke "ant" "check" "-Dtest.home=runtime-testsuite/test")
10092 (invoke "ant" "check" "-Dtest.home=tool-testsuite/test")
10093 #t))
10094 (add-before 'check 'remove-unrelated-languages
10095 (lambda _
10096 ;; There are tests for other languages that ANTLR can generate, but
10097 ;; we don't have the infrastructure for that yet. Let's test Java
10098 ;; generation only.
10099 (for-each
10100 (lambda (language)
10101 (delete-file-recursively
10102 (string-append "runtime-testsuite/test/org/antlr/v4/test/runtime/"
10103 language)))
10104 '("cpp" "csharp" "go" "javascript" "php" "python" "python2"
10105 "python3" "swift"))
10106 #t))
10107 (add-before 'check 'generate-test-parsers
10108 (lambda* (#:key outputs #:allow-other-keys)
10109 (define (run-antlr dir filename package)
10110 (invoke "antlr4" "-lib" dir "-visitor" "-no-listener"
10111 "-package" package (string-append dir "/" filename)
10112 "-Xlog"))
10113 (setenv "PATH" (string-append (getenv "PATH") ":"
10114 (assoc-ref outputs "out") "/bin"))
10115 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
10116 "Java.g4" "org.antlr.v4.test.runtime.java.api")
10117 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
10118 "VisitorBasic.g4" "org.antlr.v4.test.runtime.java.api")
10119 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
10120 "VisitorCalc.g4" "org.antlr.v4.test.runtime.java.api")
10121 #t))
10122 (add-before 'check 'remove-graphemes
10123 (lambda _
10124 ;; When running antlr on grahemes.g4, we get a runtime exception:
10125 ;; set is empty. So delete the file that depends on it.
10126 (delete-file
10127 "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/perf/TimeLexerSpeed.java")
10128 #t))
10129 (add-after 'install 'bin-install
10130 (lambda* (#:key inputs outputs #:allow-other-keys)
10131 (let* ((output (assoc-ref outputs "out"))
10132 (bin (string-append output "/bin"))
10133 (bin/antlr4 (string-append bin "/antlr4")))
10134 (mkdir-p bin)
10135 (with-output-to-file bin/antlr4
10136 (lambda _
10137 (display
10138 (string-append
10139 "#!"
10140 (search-input-file inputs "bin/sh")
10141 "\n"
10142 (string-append (assoc-ref inputs "openjdk")
10143 "/bin/java")
10144 " -cp "
10145 (string-append output "/share/java/antlr4.jar")
10146 ":"
10147 (string-join
10148 (apply append
10149 (map (lambda (input)
10150 (find-files (assoc-ref inputs input)
10151 "\\.jar$"))
10152 '("antlr3" "java-stringtemplate"
10153 "java-antlr4-runtime" "java-treelayout"
10154 "java-jsonp-api" "java-icu4j")))
10155 ":")
10156 " org.antlr.v4.Tool $*\n"))))
10157 (chmod bin/antlr4 #o755))))
10158 (add-before 'build 'copy-resources
10159 (lambda _
10160 (copy-recursively "tool/resources/" "build/classes")
10161 #t))
10162 (add-before 'build 'generate-unicode
10163 (lambda _
10164 ;; First: build the generator
10165 (invoke "javac" "-cp" (getenv "CLASSPATH")
10166 "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java"
10167 "tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java")
10168 ;; Then use it
10169 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
10170 ":tool/src:runtime/Java")
10171 "org.antlr.v4.unicode.UnicodeRenderer"
10172 "tool/resources/org/antlr/v4/tool/templates"
10173 "unicodedata"
10174 "tool/src/org/antlr/v4/unicode/UnicodeData.java")
10175 ;; It seems there is a bug with our ST4
10176 (substitute* "tool/src/org/antlr/v4/unicode/UnicodeData.java"
10177 (("\\\\>") ">"))
10178 ;; Remove the additional file
10179 (delete-file "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java")
10180 #t))
10181 (add-before 'build 'generate-grammar
10182 (lambda* (#:key inputs #:allow-other-keys)
10183 (with-directory-excursion "tool/src/org/antlr/v4/parse"
10184 (for-each (lambda (file)
10185 (display file)
10186 (newline)
10187 (invoke "antlr3" file))
10188 '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g"
10189 "GrammarTreeVisitor.g" "ATNBuilder.g"
10190 "ActionSplitter.g" "LeftRecursiveRuleWalker.g")))
10191 (with-directory-excursion "tool/src/org/antlr/v4/codegen"
10192 (install-file "../parse/ANTLRParser.tokens" ".")
10193 (display "SourceGenTriggers.g\n")
10194 (invoke "antlr3" "SourceGenTriggers.g"))
10195 #t)))))
10196 (inputs
10197 (list antlr3
10198 java-antlr4-runtime
10199 java-icu4j
10200 java-jsonp-api
10201 java-stringtemplate
10202 java-treelayout
10203 openjdk))
10204 (native-inputs
10205 (list java-junit))
10206 (synopsis "Parser and lexer generator in Java")
10207 (description "ANTLR (ANother Tool for Language Recognition) is a powerful
10208parser generator for reading, processing, executing, or translating structured
10209text or binary files. It's widely used to build languages, tools, and
10210frameworks. From a grammar, ANTLR generates a parser that can build and walk
10211parse trees.")))
10212
10213(define-public java-antlr4-runtime-4.1
10214 (package
10215 (inherit java-antlr4-runtime)
10216 (version "4.1")
10217 (source (origin
10218 (method git-fetch)
10219 (uri (git-reference
10220 (url "https://github.com/antlr/antlr4")
10221 (commit version)))
10222 (file-name (git-file-name "antlr4" version))
10223 (sha256
10224 (base32
10225 "1i8hmx5an58cjyvhji0xgpvd6lq00z1k1mjys025q2wqc25wv4c1"))))
10226 (arguments
10227 (substitute-keyword-arguments (package-arguments java-antlr4-runtime)
10228 ((#:phases phases)
10229 `(modify-phases ,phases
10230 (add-before 'configure 'chmod
10231 (lambda _
10232 (chmod "build.xml" #o644)
10233 #t))))))
10234 (inputs
10235 (list java-treelayout))))
10236
10237(define-public antlr4-4.1
10238 (package
10239 (inherit antlr4)
10240 (version (package-version java-antlr4-runtime-4.1))
10241 (source (package-source java-antlr4-runtime-4.1))
10242 (arguments
10243 (substitute-keyword-arguments (package-arguments antlr4)
10244 ((#:test-dir _)
10245 "tool/test")
10246 ((#:test-exclude excludes)
10247 `(list "**/TestParseErrors.java"
10248 "**/TestTopologicalSort.java"
10249 ,@excludes))
10250 ((#:phases phases)
10251 `(modify-phases ,phases
10252 (delete 'generate-unicode)
10253 (replace 'check
10254 (lambda _
10255 (invoke "ant" "check")
10256 #t))
10257 (add-before 'configure 'chmod
10258 (lambda _
10259 (chmod "build.xml" #o644)
10260 #t))
10261 (delete 'remove-graphemes)
10262 (delete 'remove-unrelated-languages)
10263 (delete 'generate-test-parsers)))))
10264 (inputs
10265 (alist-replace
10266 "java-antlr4-runtime" (list java-antlr4-runtime-4.1)
10267 (package-inputs antlr4)))))
10268
10269(define-public java-tunnelvisionlabs-antlr4-runtime-annotations
10270 (package
10271 (inherit java-antlr4-runtime)
10272 (name "java-tunnelvisionlabs-antlr4-runtime-annotations")
10273 (version "4.7.4")
10274 (source (origin
10275 (method git-fetch)
10276 (uri (git-reference
10277 (url "https://github.com/tunnelvisionlabs/antlr4")
10278 (commit (string-append version "-opt"))))
10279 (file-name (git-file-name "java-tunnelvisionlabs-antlr4" version))
10280 (sha256
10281 (base32
10282 "1mf2lvvsszpialsk23ma83pwp50nd32lrbjpa847zlm5gmranbr8"))
10283 (patches
10284 (search-patches "java-antlr4-Add-standalone-generator.patch"
10285 "java-tunnelvisionlabs-antlr-code-too-large.patch"))))
10286 (arguments
10287 `(#:jar-name "java-antlr4-runtime-annotations.jar"
10288 #:source-dir "runtime/JavaAnnotations/src"
10289 #:tests? #f; no tests
10290 #:phases
10291 (modify-phases %standard-phases
10292 (add-after 'build 'copy-resources
10293 (lambda _
10294 (copy-recursively "runtime/JavaAnnotations/resources"
10295 "build/classes")
10296 #t))
10297 (add-after 'copy-resources 'rebuild-jar
10298 (lambda _
10299 (invoke "ant" "jar")
10300 #t)))))
10301 (inputs '())
10302 (native-inputs '())
10303 (synopsis "Annotations for ANTLR's runtime library")
10304 (description "This package contains annotations used during the build of
10305the runtime library of ANTLR.")))
10306
10307;; the runtime of this library requires a lexer that is generated by antlr4.
10308;; However, antlr4 itself requires this library at build and run-time. We
10309;; use [email protected], the closest version of antlr that doesn't need this
10310;; bootstrap process, to generate the lexer. The generated lexer is built
10311;; for the 4.1 runtime, which is slightly different from this runtime.
10312;; So, we build the runtime with antlr 4.1, with a broken xml lexer, that we
10313;; use to build antlr4. We then re-use this antlr4 to build the runtime, and
10314;; the proper, working, runtime to build antlr4 again.
10315(define-public java-tunnelvisionlabs-antlr4-runtime-bootstrap
10316 (package
10317 (inherit java-antlr4-runtime)
10318 (name "java-tunnelvisionlabs-antlr4-runtime")
10319 (version (package-version java-tunnelvisionlabs-antlr4-runtime-annotations))
10320 (source (package-source java-tunnelvisionlabs-antlr4-runtime-annotations))
10321 (arguments
10322 `(#:jar-name "java-antlr4-runtime.jar"
10323 #:source-dir "runtime/Java/src"
10324 #:tests? #f; tests require antlr4, but antlr4 depends on this package
10325 #:phases
10326 (modify-phases %standard-phases
10327 (add-before 'build 'generate-xpath-lexer
10328 (lambda _
10329 (invoke "antlr4" "-lib" "runtime/Java/src/org/antlr/v4/runtime/tree/xpath"
10330 "-visitor" "-no-listener"
10331 "-package" "org.antlr.v4.runtime.tree.xpath"
10332 "runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.g4")
10333 ;; Generated code is for an incompatible version of the runtime
10334 (substitute* "runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.java"
10335 (("LexerATNSimulator\\(this,_ATN,_decisionToDFA,_sharedContextCache\\)")
10336 "LexerATNSimulator(this,_ATN)"))
10337 #t))
10338 (add-before 'build 'copy-resources
10339 (lambda _
10340 (copy-recursively "runtime/Java/src/main/dot"
10341 "build/classes")
10342 #t)))))
10343 (native-inputs
10344 `(("antlr4" ,antlr4-4.1)
10345 ("java-tunnelvisionlabs-antlr4-runtime-annotations"
10346 ,java-tunnelvisionlabs-antlr4-runtime-annotations)))
10347 (properties '((hidden? . #t))))) ;for bootstrapping purposes only
10348
10349(define-public java-tunnelvisionlabs-antlr4-bootstrap
10350 (package
10351 (inherit antlr4)
10352 (name "java-tunnelvisionlabs-antlr4")
10353 (version (package-version java-tunnelvisionlabs-antlr4-runtime-annotations))
10354 (source (package-source java-tunnelvisionlabs-antlr4-runtime-annotations))
10355 (arguments
10356 (substitute-keyword-arguments (package-arguments antlr4)
10357 ((#:test-dir _)
10358 "tool/test:runtime-testsuite/src")
10359 ((#:phases phases)
10360 `(modify-phases ,phases
10361 (delete 'remove-unrelated-languages)
10362 (delete 'remove-graphemes)
10363 (delete 'generate-test-parsers)
10364 (delete 'check)))))
10365 (native-inputs '())
10366 (inputs
10367 `(("antlr3" ,antlr3)
10368 ("java-antlr4-runtime" ,java-tunnelvisionlabs-antlr4-runtime-bootstrap)
10369 ("java-tunnelvisionlabs-antlr4-runtime-annotations"
10370 ,java-tunnelvisionlabs-antlr4-runtime-annotations)
10371 ("java-icu4j" ,java-icu4j)
10372 ("java-jsonp-api" ,java-jsonp-api)
10373 ("java-stringtemplate" ,java-stringtemplate)
10374 ("java-treelayout" ,java-treelayout)
10375 ("openjdk" ,openjdk)))
10376 (properties '((hidden? . #t))))) ;for bootstrapping purposes only
10377
10378(define-public java-tunnelvisionlabs-antlr4-runtime
10379 (package
10380 (inherit java-tunnelvisionlabs-antlr4-runtime-bootstrap)
10381 (native-inputs
10382 (alist-replace
10383 "antlr4" (list java-tunnelvisionlabs-antlr4-bootstrap)
10384 (package-native-inputs
10385 java-tunnelvisionlabs-antlr4-runtime-bootstrap)))
10386 (properties
10387 (alist-delete
10388 'hidden?
10389 (package-properties java-tunnelvisionlabs-antlr4-runtime-bootstrap)))))
10390
10391(define-public java-tunnelvisionlabs-antlr4
10392 (package
10393 (inherit java-tunnelvisionlabs-antlr4-bootstrap)
10394 (inputs
10395 (alist-replace
10396 "java-antlr4-runtime" (list java-tunnelvisionlabs-antlr4-runtime)
10397 (package-inputs java-tunnelvisionlabs-antlr4-bootstrap)))
10398 (properties
10399 (alist-delete
10400 'hidden?
10401 (package-properties java-tunnelvisionlabs-antlr4-bootstrap)))))
10402
10403(define-public java-commons-cli-1.2
10404 ;; This is a bootstrap dependency for Maven2.
10405 (package
10406 (inherit java-commons-cli)
10407 (version "1.2")
10408 (source (origin
10409 (method url-fetch)
10410 (uri (string-append "mirror://apache/commons/cli/source/"
10411 "commons-cli-" version "-src.tar.gz"))
10412 (sha256
10413 (base32
10414 "0rvfgzgv2pc1m091dfj3ih9ddsjjppr1f1wf0qmc3bk6b1kwv2dm"))))
10415 (arguments
10416 `(#:jar-name "commons-cli.jar"
10417 #:phases
10418 (modify-phases %standard-phases
10419 (add-before 'check 'fix-build-xml
10420 (lambda* (#:key inputs #:allow-other-keys)
10421 (substitute* "build.xml"
10422 (("dir=\"\\$\\{test.home\\}/java\"")
10423 "dir=\"${test.home}\""))
10424 #t)))))
10425 (native-inputs
10426 (list java-junit))))
10427
10428(define-public java-microemulator-cldc
10429 (package
10430 (name "java-microemulator-cldc")
10431 (version "2.0.4")
10432 (source (origin
10433 (method url-fetch)
10434 (uri (string-append "https://github.com/barteo/microemu/archive/"
10435 "microemulator_"
10436 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
10437 version)
10438 ".tar.gz"))
10439 (file-name (string-append name "-" version ".tar.gz"))
10440 (sha256
10441 (base32
10442 "1x1apmz38gkppxnwnygwmi12j54v4p258v8ddzn6dldkk7vak1ll"))))
10443 (build-system ant-build-system)
10444 (arguments
10445 `(#:jar-name "microemulator-cldc.jar"
10446 #:source-dir "microemu-cldc/src/main/java"
10447 #:tests? #f)); Requires even older software
10448 (home-page "https://github.com/barteo/microemu")
10449 (synopsis "J2ME CLDC emulator")
10450 (description "Microemulator is a Java 2 Micro Edition (J2ME) CLDC/MIDP
10451Emulator. It demonstrates MIDlet based applications in web browser
10452applet and can be run as a standalone java application.")
10453 (license (list license:asl2.0
10454 ;; or altenatively:
10455 license:lgpl2.1+))))
10456
10457(define-public java-datanucleus-javax-persistence
10458 (package
10459 (name "java-datanucleus-javax-persistence")
10460 (version "2.2.0")
10461 (source (origin
10462 (method url-fetch)
10463 (uri (string-append "https://github.com/datanucleus/"
10464 "javax.persistence/archive/javax.persistence-"
10465 version "-release.tar.gz"))
10466 (sha256
10467 (base32
10468 "11jx0fjwgc2hhbqqgdd6m1pf2fplf9vslppygax0y1z5csnqjhpx"))))
10469 (build-system ant-build-system)
10470 (arguments
10471 `(#:jar-name "java-datanucleus-javax-persistence.jar"
10472 #:jdk ,icedtea-8
10473 #:source-dir "src/main/java"
10474 #:tests? #f)); no tests
10475 (home-page "https://github.com/datanucleus/javax.persistence")
10476 (synopsis "JPA API")
10477 (description "This package contains a clean definition of JPA API intended
10478for use with DataNucleus JPA since the JCP haven't provided an official JPA API
10479jar. See @url{http://java.net/projects/jpa-spec/downloads} for the specification
10480used to generate this API.")
10481 (license (list license:edl1.0 license:epl1.0))))
10482
10483(define-public java-osgi-cmpn
10484 (package
10485 (name "java-osgi-cmpn")
10486 (version "6.0.0")
10487 (source (origin
10488 (method url-fetch)
10489 (uri (string-append "https://repo1.maven.org/maven2/"
10490 "org/osgi/osgi.cmpn/" version "/osgi.cmpn-"
10491 version "-sources.jar"))
10492 (sha256
10493 (base32
10494 "1lmb6xyrmkqdhv1kayf0514rlwq6ypvs4m44ibrck3snp8241wys"))))
10495 (build-system ant-build-system)
10496 (arguments
10497 `(#:jar-name "osgi-cmpn.jar"
10498 #:tests? #f)); no tests
10499 (inputs
10500 `(("annotation" ,java-osgi-annotation)
10501 ("core" ,java-osgi-core)
10502 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
10503 ("microemulator" ,java-microemulator-cldc)
10504 ("servlet" ,java-classpathx-servletapi)))
10505 (home-page "https://www.osgi.org")
10506 (synopsis "Compendium specification module of OSGi framework")
10507 (description
10508 "OSGi, for Open Services Gateway initiative framework, is a module system
10509and service platform for the Java programming language. This package contains
10510the compendium specification module, providing interfaces and classes for use
10511in compiling bundles.")
10512 (license license:asl2.0)))
10513
10514(define-public java-osgi-cmpn-7.0.0
10515 ;; Upstream uses release-train tags for the monorepo; osgi.cmpn/bnd.bnd
10516 ;; emits artifact version 7.0.0 from the r7-cmpn-spec-final checkout.
10517 (let ((tag "r7-cmpn-spec-final"))
10518 (package
10519 (name "java-osgi-cmpn")
10520 (version "7.0.0")
10521 (source (origin
10522 (method git-fetch)
10523 (uri (git-reference
10524 (url "https://github.com/osgi/osgi")
10525 (commit tag)))
10526 (modules '((guix build utils)))
10527 (snippet
10528 '(begin
10529 (for-each delete-file
10530 (find-files "." "\\.jar$"))
10531 #t))
10532 (file-name (git-file-name name version))
10533 (sha256
10534 (base32
10535 "08i8d2y7awr09809qwnv7l5hzqi5di3sv21bvgrmhibm07hr4ml9"))))
10536 (build-system ant-build-system)
10537 (arguments
10538 (list
10539 #:tests? #f
10540 #:jdk openjdk9
10541 #:jar-name "osgi-cmpn.jar"
10542 #:phases
10543 #~(modify-phases %standard-phases
10544 (add-after 'unpack 'prepare-source-layout
10545 (lambda _
10546 (mkdir-p "src")
10547 (for-each
10548 (lambda (directory)
10549 (invoke "cp" "-r" (string-append directory "/.") "src/"))
10550 '("org.osgi.application/src"
10551 "org.osgi.namespace.contract/src"
10552 "org.osgi.namespace.extender/src"
10553 "org.osgi.namespace.implementation/src"
10554 "org.osgi.namespace.service/src"
10555 "org.osgi.namespace.unresolvable/src"
10556 "org.osgi.service.async/src"
10557 "org.osgi.service.application/src"
10558 "org.osgi.service.blueprint/src"
10559 "org.osgi.service.cm/src"
10560 "org.osgi.service.component/src"
10561 "org.osgi.service.component.annotations/src"
10562 "org.osgi.service.configurator/src"
10563 "org.osgi.service.coordinator/src"
10564 "org.osgi.service.deploymentadmin/src"
10565 "org.osgi.service.device/src"
10566 "org.osgi.service.dmt/src"
10567 "org.osgi.service.event/src"
10568 "org.osgi.service.http/src"
10569 "org.osgi.service.http.whiteboard/src"
10570 "org.osgi.service.io/src"
10571 "org.osgi.service.jaxrs/src"
10572 "org.osgi.service.jdbc/src"
10573 "org.osgi.service.jndi/src"
10574 "org.osgi.service.jpa/src"
10575 "org.osgi.service.log/src"
10576 "org.osgi.service.metatype/src"
10577 "org.osgi.service.metatype.annotations/src"
10578 "org.osgi.service.monitor/src"
10579 "org.osgi.service.prefs/src"
10580 "org.osgi.service.provisioning/src"
10581 "org.osgi.service.remoteserviceadmin/src"
10582 "org.osgi.service.repository/src"
10583 "org.osgi.service.rest/src"
10584 "org.osgi.service.serviceloader/src"
10585 "org.osgi.service.subsystem/src"
10586 "org.osgi.service.transaction.control/src"
10587 "org.osgi.service.upnp/src"
10588 "org.osgi.service.useradmin/src"
10589 "org.osgi.service.wireadmin/src"
10590 "org.osgi.util.converter/src"
10591 "org.osgi.util.function/src"
10592 "org.osgi.util.measurement/src"
10593 "org.osgi.util.position/src"
10594 "org.osgi.util.promise/src"
10595 "org.osgi.util.pushstream/src"
10596 "org.osgi.util.xml/src"))))
10597 (add-before 'install 'create-pom
10598 (generate-pom.xml "pom.xml" "org.osgi" "osgi.cmpn" #$version))
10599 (replace 'install (install-from-pom "pom.xml")))))
10600 (inputs
10601 (list java-osgi-annotation-8.1.0
10602 java-osgi-core-8.0.0
10603 java-classpathx-servletapi
10604 java-microemulator-cldc
10605 java-datanucleus-javax-persistence
10606 java-jaxrs-api-2))
10607 (home-page "https://www.osgi.org")
10608 (synopsis "Compendium specification module of OSGi framework")
10609 (description "OSGi, for Open Services Gateway initiative framework, is a
10610module system and service platform for the Java programming language. This
10611package contains the compendium specification module, providing interfaces
10612and classes for use in compiling bundles.")
10613 (license license:asl2.0))))
10614
10615(define-public java-felix-resolver-2
10616 (package
10617 (name "java-felix-resolver")
10618 (version "2.0.4")
10619 (source (origin
10620 (method git-fetch)
10621 (uri (git-reference
10622 (url "https://github.com/apache/felix-dev")
10623 (commit (string-append "org.apache.felix.resolver-"
10624 version))))
10625 (modules '((guix build utils)))
10626 (snippet
10627 '(begin
10628 (for-each delete-file
10629 (find-files "." "\\.jar$"))
10630 #t))
10631 (file-name (git-file-name name version))
10632 (sha256
10633 (base32
10634 "1lkwh6q58vm0inll8zaqizwfvw8d7kzaff0x6lwa17j9k91yllyf"))))
10635 (build-system ant-build-system)
10636 (arguments
10637 (list
10638 #:tests? #f
10639 #:jar-name "org.apache.felix.resolver.jar"
10640 #:source-dir "resolver/src/main/java"
10641 #:phases
10642 #~(modify-phases %standard-phases
10643 (add-before 'install 'create-pom
10644 (generate-pom.xml "pom.xml" "org.apache.felix"
10645 "org.apache.felix.resolver" #$version))
10646 (replace 'install (install-from-pom "pom.xml")))))
10647 (inputs (list java-osgi-annotation java-osgi-core))
10648 (home-page "https://felix.apache.org/")
10649 (synopsis "Apache Felix OSGi resolver")
10650 (description "Apache Felix Resolver implements the OSGi resolver
10651specification, providing dependency resolution for OSGi bundles.")
10652 (license license:asl2.0)))
10653
10654(define-public java-felix-framework-7
10655 (package
10656 (name "java-felix-framework")
10657 (version "7.0.5")
10658 (source (origin
10659 (method git-fetch)
10660 (uri (git-reference
10661 (url "https://github.com/apache/felix-dev")
10662 (commit (string-append "org.apache.felix.framework-"
10663 version))))
10664 (modules '((guix build utils)))
10665 (snippet
10666 '(begin
10667 (for-each delete-file
10668 (find-files "." "\\.jar$"))
10669 #t))
10670 (file-name (git-file-name name version))
10671 (sha256
10672 (base32
10673 "1w4kdy0m4md2j0nf3shn76v9vxvjqa9sxl4j06bk08yn9icnj72k"))))
10674 (build-system ant-build-system)
10675 (arguments
10676 (list
10677 #:tests? #f
10678 #:jar-name "org.apache.felix.framework.jar"
10679 #:source-dir "framework/src/main/java"
10680 #:phases
10681 #~(modify-phases %standard-phases
10682 (add-after 'unpack 'create-animal-sniffer-stub
10683 (lambda _
10684 ;; Felix uses this compile-time Maven annotation to suppress
10685 ;; JRE compatibility warnings. It has no runtime effect.
10686 (mkdir-p "framework/src/main/java/org/codehaus/mojo/animal_sniffer")
10687 (call-with-output-file
10688 "framework/src/main/java/org/codehaus/mojo/animal_sniffer/IgnoreJRERequirement.java"
10689 (lambda (port)
10690 (display (string-append
10691 "package org.codehaus.mojo.animal_sniffer;\n"
10692 "import java.lang.annotation.*;\n"
10693 "@Retention(RetentionPolicy.CLASS)\n"
10694 "@Target({ElementType.METHOD,"
10695 " ElementType.CONSTRUCTOR,"
10696 " ElementType.TYPE})\n"
10697 "public @interface IgnoreJRERequirement {}\n")
10698 port)))))
10699 (add-after 'build 'add-service-descriptor-and-resources
10700 (lambda _
10701 ;; Include the upstream service descriptors and resources that
10702 ;; Felix expects in the framework jar.
10703 (invoke "jar" "uf" "build/jar/org.apache.felix.framework.jar"
10704 "-C" "framework/src/main/resources" "META-INF/services")
10705 ;; Felix reads default.properties at startup to determine
10706 ;; system packages. The source file uses Maven's ${dollar}
10707 ;; placeholder, so replace it here.
10708 (substitute* "framework/src/main/resources/default.properties"
10709 (("\\$\\{dollar\\}") "$"))
10710 (invoke "jar" "uf" "build/jar/org.apache.felix.framework.jar"
10711 "-C" "framework/src/main/resources" "default.properties")
10712 ;; Compile accessor.src (a java.net.Accessor class used by
10713 ;; SecureAction to bypass access controls) and include the
10714 ;; compiled bytecode as accessor.bytes.
10715 (mkdir-p "build/accessor-src/java/net")
10716 (copy-file
10717 "framework/src/main/resources/org/apache/felix/framework/util/accessor.src"
10718 "build/accessor-src/java/net/Accessor.java")
10719 (mkdir-p "build/accessor-out")
10720 (invoke "javac"
10721 "-d" "build/accessor-out"
10722 "build/accessor-src/java/net/Accessor.java")
10723 (copy-file "build/accessor-out/java/net/Accessor.class"
10724 "build/accessor.bytes")
10725 (invoke "jar" "uf" "build/jar/org.apache.felix.framework.jar"
10726 "-C" "build"
10727 "accessor.bytes")))
10728 (add-after 'add-service-descriptor-and-resources
10729 'fix-accessor-path
10730 (lambda _
10731 ;; accessor.bytes must be at
10732 ;; org/apache/felix/framework/util/accessor.bytes
10733 (let ((jar "build/jar/org.apache.felix.framework.jar"))
10734 (mkdir-p "build/accessor-pkg/org/apache/felix/framework/util")
10735 (copy-file "build/accessor.bytes"
10736 "build/accessor-pkg/org/apache/felix/framework/util/accessor.bytes")
10737 (invoke "jar" "uf" jar
10738 "-C" "build/accessor-pkg"
10739 "org/apache/felix/framework/util/accessor.bytes"))))
10740 (add-before 'install 'create-pom
10741 (generate-pom.xml "pom.xml" "org.apache.felix"
10742 "org.apache.felix.framework" #$version))
10743 (replace 'install (install-from-pom "pom.xml")))))
10744 (inputs (list java-osgi-annotation-8.1.0
10745 java-osgi-core-8.0.0
10746 java-felix-resolver-2))
10747 (home-page "https://felix.apache.org/")
10748 (synopsis "Apache Felix OSGi framework")
10749 (description "Apache Felix is a community effort to implement the OSGi
10750Framework and Service platform.")
10751 (license license:asl2.0)))
10752
10753(define-public java-felix-main-7.0.5
10754 (package
10755 (name "java-felix-main")
10756 (version "7.0.5")
10757 (source (origin
10758 (method git-fetch)
10759 (uri (git-reference
10760 (url "https://github.com/apache/felix-dev")
10761 (commit (string-append "org.apache.felix.main-"
10762 version))))
10763 (modules '((guix build utils)))
10764 (snippet
10765 '(begin
10766 (for-each delete-file
10767 (find-files "." "\\.jar$"))
10768 #t))
10769 (file-name (git-file-name name version))
10770 (sha256
10771 (base32
10772 "04miqvr8lqng4a0n6zry8rary8hrcbrq41652adyz85znmcp1z59"))))
10773 (build-system ant-build-system)
10774 (arguments
10775 (list
10776 #:tests? #f
10777 #:jar-name "org.apache.felix.main.jar"
10778 #:source-dir "main/src/main/java"
10779 #:phases
10780 #~(modify-phases %standard-phases
10781 (add-after 'build 'create-uber-jar
10782 (lambda* (#:key inputs #:allow-other-keys)
10783 ;; org.apache.felix.main is an uber jar combining framework,
10784 ;; resolver, and osgi-core classes with Main and AutoProcessor.
10785 (let ((jar (canonicalize-path
10786 "build/jar/org.apache.felix.main.jar"))
10787 (work-dir (mkdtemp "/tmp/felix-merge-XXXXXX")))
10788 (with-directory-excursion work-dir
10789 (for-each
10790 (lambda (input-name)
10791 (for-each
10792 (lambda (dep-jar)
10793 (invoke "jar" "xf" dep-jar))
10794 (find-files (assoc-ref inputs input-name)
10795 "\\.jar$")))
10796 '("java-felix-framework"
10797 "java-felix-resolver"
10798 "java-osgi-core"))
10799 ;; Remove metadata that would conflict with the
10800 ;; main jar's own manifest.
10801 (when (file-exists? "META-INF/MANIFEST.MF")
10802 (delete-file "META-INF/MANIFEST.MF"))
10803 (when (file-exists? "META-INF/maven")
10804 (delete-file-recursively "META-INF/maven"))
10805 (invoke "jar" "uf" jar "-C" work-dir ".")))))
10806 (add-after 'create-uber-jar 'add-service-descriptor
10807 (lambda _
10808 (let ((jar "build/jar/org.apache.felix.main.jar"))
10809 (mkdir-p "META-INF/services")
10810 (call-with-output-file
10811 "META-INF/services/org.osgi.framework.launch.FrameworkFactory"
10812 (lambda (port)
10813 (display
10814 "org.apache.felix.framework.FrameworkFactory\n" port)))
10815 (invoke "jar" "uf" jar "-C" "." "META-INF/services"))))
10816 (add-before 'install 'create-pom
10817 (generate-pom.xml "pom.xml" "org.apache.felix"
10818 "org.apache.felix.main" #$version))
10819 (replace 'install (install-from-pom "pom.xml")))))
10820 (inputs (list java-felix-framework-7
10821 java-felix-resolver-2
10822 java-osgi-core-8.0.0))
10823 (home-page "https://felix.apache.org/")
10824 (synopsis "Apache Felix Main distribution jar")
10825 (description "Apache Felix Main is the standard distribution jar for
10826the Apache Felix OSGi framework. It bundles the framework, resolver, and
10827OSGi core classes into a single jar with a standalone launcher.")
10828 (license license:asl2.0)))
10829
10830(define-public java-osgi-service-component-annotations
10831 (package
10832 (name "java-osgi-service-component-annotations")
10833 (version "1.3.0")
10834 (source (origin
10835 (method url-fetch)
10836 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10837 "org.osgi.service.component.annotations/"
10838 version "/org.osgi.service.component.annotations-"
10839 version "-sources.jar"))
10840 (sha256
10841 (base32
10842 "15rq9cmp4fpn74q44m4j35qsqmjf5lx3hcrk6pzvbhc08igic2f0"))))
10843 (build-system ant-build-system)
10844 (arguments
10845 `(#:jar-name "osgi-service-component-annotations.jar"
10846 #:tests? #f)); no tests
10847 (inputs
10848 `(("annotation" ,java-osgi-annotation)))
10849 (home-page "https://www.osgi.org")
10850 (synopsis "Support annotations for osgi-service-component")
10851 (description
10852 "OSGi, for Open Services Gateway initiative framework, is a module system
10853and service platform for the Java programming language. This package contains
10854the support annotations for osgi-service-component.")
10855 (license license:asl2.0)))
10856
10857(define-public java-osgi-dto
10858 (package
10859 (name "java-osgi-dto")
10860 (version "1.0.0")
10861 (source (origin
10862 (method url-fetch)
10863 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10864 "org.osgi.dto/" version "/org.osgi.dto-"
10865 version "-sources.jar"))
10866 (sha256
10867 (base32
10868 "0f4bqjzadn0hwk6sd3h5gvbyfp3yci1s6r0v770cc15p0pg627yr"))))
10869 (build-system ant-build-system)
10870 (arguments
10871 `(#:jar-name "osgi-dto.jar"
10872 #:tests? #f)); no tests
10873 (inputs
10874 `(("annotation" ,java-osgi-annotation)))
10875 (home-page "https://www.osgi.org")
10876 (synopsis "Data Transfer Objects")
10877 (description
10878 "OSGi, for Open Services Gateway initiative framework, is a module system
10879and service platform for the Java programming language. This package contains
10880the Data Transfer Objects. It is easily serializable having only public fields
10881of primitive types and their wrapper classes, Strings, and DTOs. List, Set,
10882Map and array aggregates may also be used. The aggregates must only hold
10883objects of the listed types or aggregates.")
10884 (license license:asl2.0)))
10885
10886(define-public java-osgi-resource
10887 (package
10888 (name "java-osgi-resource")
10889 (version "1.0.0")
10890 (source (origin
10891 (method url-fetch)
10892 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10893 "org.osgi.resource/"
10894 version "/org.osgi.resource-"
10895 version "-sources.jar"))
10896 (sha256
10897 (base32
10898 "0hi0fsc5v99q22bd7lrkvpz1y0ds4w9arjldpwsrcpqvz2js7q2d"))))
10899 (build-system ant-build-system)
10900 (arguments
10901 `(#:jar-name "osgi-resource.jar"
10902 #:tests? #f)); no tests
10903 (inputs
10904 `(("annotation" ,java-osgi-annotation)
10905 ("dto" ,java-osgi-dto)))
10906 (home-page "https://www.osgi.org")
10907 (synopsis "OSGI Resource")
10908 (description
10909 "OSGi, for Open Services Gateway initiative framework, is a module system
10910and service platform for the Java programming language. This package contains
10911the definition of common types in osgi packages.")
10912 (license license:asl2.0)))
10913
10914(define-public java-osgi-namespace-contract
10915 (package
10916 (name "java-osgi-namespace-contract")
10917 (version "1.0.0")
10918 (source (origin
10919 (method url-fetch)
10920 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10921 "org.osgi.namespace.contract/"
10922 version "/org.osgi.namespace.contract-"
10923 version "-sources.jar"))
10924 (sha256
10925 (base32
10926 "1iz4f2i0fvqrlq90ki9nfzcfpvy2av434ri25bglywqssx8mmp36"))))
10927 (build-system ant-build-system)
10928 (inputs
10929 `(("resource" ,java-osgi-resource)
10930 ("annotation" ,java-osgi-annotation)))
10931 (arguments
10932 `(#:jar-name "osgi-namespace-contract.jar"
10933 #:tests? #f)); no tests
10934 (home-page "https://www.osgi.org")
10935 (synopsis "Contract Capability and Requirement Namespace")
10936 (description
10937 "OSGi, for Open Services Gateway initiative framework, is a module system
10938and service platform for the Java programming language. This package contains
10939the names for the attributes and directives for a namespace with contracts.")
10940 (license license:asl2.0)))
10941
10942(define-public java-osgi-namespace-extender
10943 (package
10944 (name "java-osgi-namespace-extender")
10945 (version "1.0.1")
10946 (source (origin
10947 (method url-fetch)
10948 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10949 "org.osgi.namespace.extender/"
10950 version "/org.osgi.namespace.extender-"
10951 version "-sources.jar"))
10952 (sha256
10953 (base32
10954 "0jgqiak2i05qv6j3gd33xlaifzzc0ylxxk376v2x0apfg3vvixmz"))))
10955 (build-system ant-build-system)
10956 (inputs
10957 `(("resource" ,java-osgi-resource)
10958 ("annotation" ,java-osgi-annotation)))
10959 (arguments
10960 `(#:jar-name "osgi-namespace-extendent.jar"
10961 #:tests? #f)); no tests
10962 (home-page "https://www.osgi.org")
10963 (synopsis "Extender Capability and Requirement Namespace")
10964 (description
10965 "OSGi, for Open Services Gateway initiative framework, is a module system
10966and service platform for the Java programming language. This package contains
10967the names for the attributes and directives for an extender namespace.")
10968 (license license:asl2.0)))
10969
10970(define-public java-osgi-namespace-service
10971 (package
10972 (name "java-osgi-namespace-service")
10973 (version "1.0.0")
10974 (source (origin
10975 (method url-fetch)
10976 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10977 "org.osgi.namespace.service/"
10978 version "/org.osgi.namespace.service-"
10979 version "-sources.jar"))
10980 (sha256
10981 (base32
10982 "0qmw8n2449nkmm56d1znz9zhazb6ya3vsimd5bf5jg23zzhgl8c8"))))
10983 (build-system ant-build-system)
10984 (inputs
10985 `(("resource" ,java-osgi-resource)
10986 ("annotation" ,java-osgi-annotation)))
10987 (arguments
10988 `(#:jar-name "osgi-namespace-service.jar"
10989 #:tests? #f)); no tests
10990 (home-page "https://www.osgi.org")
10991 (synopsis "Service Capability and Requirement Namespace")
10992 (description
10993 "OSGi, for Open Services Gateway initiative framework, is a module system
10994and service platform for the Java programming language. This package contains
10995the names for the attributes and directives for a service namespace.")
10996 (license license:asl2.0)))
10997
10998(define-public java-osgi-util-function
10999 (package
11000 (name "java-osgi-util-function")
11001 (version "1.0.0")
11002 (source (origin
11003 (method url-fetch)
11004 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
11005 "org.osgi.util.function/"
11006 version "/org.osgi.util.function-"
11007 version "-sources.jar"))
11008 (sha256
11009 (base32
11010 "04l7j3hwmmj28w23m7paca0afzncs42j2mdr3liqq8kvp548sc6x"))))
11011 (build-system ant-build-system)
11012 (arguments
11013 `(#:jar-name "osgi-util-function.jar"
11014 #:tests? #f)); no tests
11015 (inputs
11016 `(("annotation" ,java-osgi-annotation)))
11017 (home-page "https://www.osgi.org")
11018 (synopsis "OSGI Util Function")
11019 (description
11020 "OSGi, for Open Services Gateway initiative framework, is a module system
11021and service platform for the Java programming language. This package contains
11022an interface for a function that accepts a single argument and produces a result.")
11023 (license license:asl2.0)))
11024
11025(define-public java-osgi-util-promise
11026 (package
11027 (name "java-osgi-util-promise")
11028 (version "1.0.0")
11029 (source (origin
11030 (method url-fetch)
11031 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
11032 "org.osgi.util.promise/"
11033 version "/org.osgi.util.promise-"
11034 version "-sources.jar"))
11035 (sha256
11036 (base32
11037 "0y34dwiflg1c4ahvkswpf9z02xph2sr9fm04ia5493x3lshpw22c"))))
11038 (build-system ant-build-system)
11039 (arguments
11040 `(#:jar-name "osgi-util-promise.jar"
11041 #:tests? #f)); no tests
11042 (inputs
11043 `(("annotation" ,java-osgi-annotation)
11044 ("function" ,java-osgi-util-function)))
11045 (home-page "https://www.osgi.org")
11046 (synopsis "Promise of a value")
11047 (description
11048 "OSGi, for Open Services Gateway initiative framework, is a module system
11049and service platform for the Java programming language. This package contains
11050an interface and utilitary classes for promises. A Promise represents a future
11051value. It handles the interactions for asynchronous processing.")
11052 (license license:asl2.0)))
11053
11054(define-public java-osgi-service-metatype-annotations
11055 (package
11056 (name "java-osgi-service-metatype-annotations")
11057 (version "1.3.0")
11058 (source (origin
11059 (method url-fetch)
11060 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
11061 "org.osgi.service.metatype.annotations/"
11062 version "/org.osgi.service.metatype.annotations-"
11063 version "-sources.jar"))
11064 (sha256
11065 (base32
11066 "12rwm3349wk80vm88rcdgs4435m4jxkpkj5mrx326skkz2c6hyw6"))))
11067 (build-system ant-build-system)
11068 (arguments
11069 `(#:jar-name "osgi-service-metatype-annotations.jar"
11070 #:tests? #f)); no tests
11071 (inputs
11072 `(("annotation" ,java-osgi-annotation)))
11073 (home-page "https://www.osgi.org")
11074 (synopsis "Support annotations for metatype")
11075 (description
11076 "OSGi, for Open Services Gateway initiative framework, is a module system
11077and service platform for the Java programming language. This package contains
11078the support annotations for metatype.")
11079 (license license:asl2.0)))
11080
11081(define-public java-osgi-service-repository
11082 (package
11083 (name "java-osgi-service-repository")
11084 (version "1.1.0")
11085 (source (origin
11086 (method url-fetch)
11087 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
11088 "org.osgi.service.repository/"
11089 version "/org.osgi.service.repository-"
11090 version "-sources.jar"))
11091 (sha256
11092 (base32
11093 "1k41mhg7b58pd8nsghr2qwcjrxdnf1p9spsw9v11k4257g6rl06n"))))
11094 (build-system ant-build-system)
11095 (arguments
11096 `(#:jar-name "osgi-service-repository.jar"
11097 #:tests? #f)); no tests
11098 (inputs
11099 `(("annotation" ,java-osgi-annotation)
11100 ("promise" ,java-osgi-util-promise)
11101 ("resource" ,java-osgi-resource)))
11102 (home-page "https://www.osgi.org")
11103 (synopsis "OSGI service repository")
11104 (description
11105 "OSGi, for Open Services Gateway initiative framework, is a module system
11106and service platform for the Java programming language. This package contains
11107a repository service that contains resources.")
11108 (license license:asl2.0)))
11109
11110(define-public java-osgi-framework
11111 (package
11112 (name "java-osgi-framework")
11113 (version "1.8.0")
11114 (source (origin
11115 (method url-fetch)
11116 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
11117 "org.osgi.framework/" version "/org.osgi.framework-"
11118 version "-sources.jar"))
11119 (sha256
11120 (base32
11121 "1lwp2zfad3rybcc6q9bwz8xsgkc92ypzy5p6x54387f1qj65m73s"))))
11122 (build-system ant-build-system)
11123 (arguments
11124 `(#:jar-name "osgi-framework.jar"
11125 #:tests? #f)); no tests
11126 (inputs
11127 `(("annotation" ,java-osgi-annotation)
11128 ("resource" ,java-osgi-resource)
11129 ("dto" ,java-osgi-dto)))
11130 (home-page "https://www.osgi.org")
11131 (synopsis "OSGi framework")
11132 (description
11133 "OSGi, for Open Services Gateway initiative framework, is a module system
11134and service platform for the Java programming language.")
11135 (license license:asl2.0)))
11136
11137(define-public java-osgi-service-log
11138 (package
11139 (name "java-osgi-service-log")
11140 (version "1.3.0")
11141 (source (origin
11142 (method url-fetch)
11143 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
11144 "org.osgi.service.log/"
11145 version "/org.osgi.service.log-"
11146 version "-sources.jar"))
11147 (sha256
11148 (base32
11149 "1029j30dzcwializzca0j3fkhwwz08kmmsha5agw1iccscimj6r0"))))
11150 (build-system ant-build-system)
11151 (arguments
11152 `(#:jar-name "osgi-service-log.jar"
11153 #:tests? #f)); no tests
11154 (inputs
11155 (list java-osgi-framework))
11156 (home-page "https://www.osgi.org")
11157 (synopsis "Provides methods for bundles to write messages to the log")
11158 (description
11159 "OSGi, for Open Services Gateway initiative framework, is a module system
11160and service platform for the Java programming language. This package contains
11161the log service.")
11162 (license license:asl2.0)))
11163
11164(define-public java-osgi-service-jdbc
11165 (package
11166 (name "java-osgi-service-jdbc")
11167 (version "1.0.0")
11168 (source (origin
11169 (method url-fetch)
11170 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
11171 "org.osgi.service.jdbc/"
11172 version "/org.osgi.service.jdbc-"
11173 version "-sources.jar"))
11174 (sha256
11175 (base32
11176 "11iln5v7bk469cgb9ddkrz9sa95b3733gqgaqw9xf5g6wq652yjz"))))
11177 (build-system ant-build-system)
11178 (arguments
11179 `(#:jar-name "osgi-service-jdbc.jar"
11180 #:tests? #f)); no tests
11181 (home-page "https://www.osgi.org")
11182 (synopsis "Factory for JDBC connection factories")
11183 (description
11184 "OSGi, for Open Services Gateway initiative framework, is a module system
11185and service platform for the Java programming language. This package contains
11186a factory for JDBC connection factories. There are 3 preferred connection
11187factories for getting JDBC connections:
11188
11189@itemize
11190@item @code{javax.sql.DataSource};
11191@item @code{javax.sql.ConnectionPoolDataSource};
11192@item @code{javax.sql.XADataSource}.
11193@end itemize")
11194 (license license:asl2.0)))
11195
11196(define-public java-osgi-service-resolver
11197 (package
11198 (name "java-osgi-service-resolver")
11199 (version "1.0.1")
11200 (source (origin
11201 (method url-fetch)
11202 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
11203 "org.osgi.service.resolver/"
11204 version "/org.osgi.service.resolver-"
11205 version "-sources.jar"))
11206 (sha256
11207 (base32
11208 "1dzqn1ryfi2rq4zwsgp44bmj2wlfydjg1qbxw2b0z4xdjjy55vxd"))))
11209 (build-system ant-build-system)
11210 (arguments
11211 `(#:jar-name "osgi-service-resolver.jar"
11212 #:tests? #f)); no tests
11213 (inputs
11214 `(("annotation" ,java-osgi-annotation)
11215 ("resource" ,java-osgi-resource)))
11216 (home-page "https://www.osgi.org")
11217 (synopsis "OSGI Resolver service")
11218 (description
11219 "OSGi, for Open Services Gateway initiative framework, is a module system
11220and service platform for the Java programming language. This package contains
11221a resolver service that resolves the specified resources in the context supplied
11222by the caller.")
11223 (license license:asl2.0)))
11224
11225(define-public java-osgi-util-tracker
11226 (package
11227 (name "java-osgi-util-tracker")
11228 (version "1.5.1")
11229 (source (origin
11230 (method url-fetch)
11231 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
11232 "org.osgi.util.tracker/"
11233 version "/org.osgi.util.tracker-"
11234 version "-sources.jar"))
11235 (sha256
11236 (base32
11237 "0c4fh9vxwzsx59r8dygda0gq2gx3z5vfhc3jsphlqwf5w0h403lz"))))
11238 (build-system ant-build-system)
11239 (arguments
11240 `(#:jar-name "osgi-util-tracker.jar"
11241 #:tests? #f)); no tests
11242 (inputs
11243 `(("framework" ,java-osgi-framework)
11244 ("annotation" ,java-osgi-annotation)))
11245 (home-page "https://www.osgi.org")
11246 (synopsis "Bundle tracking")
11247 (description
11248 "OSGi, for Open Services Gateway initiative framework, is a module system
11249and service platform for the Java programming language. This package contains
11250bundle tracking utility classes.")
11251 (license license:asl2.0)))
11252
11253(define-public java-osgi-service-cm
11254 (package
11255 (name "java-osgi-service-cm")
11256 (version "1.5.0")
11257 (source (origin
11258 (method url-fetch)
11259 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
11260 "org.osgi.service.cm/"
11261 version "/org.osgi.service.cm-"
11262 version "-sources.jar"))
11263 (sha256
11264 (base32
11265 "1z8kap48y3xi0ggj8v6czglfnpnd94mmismgi2wbqhj1nl5fzbp6"))))
11266 (build-system ant-build-system)
11267 (arguments
11268 `(#:jar-name "osgi-service-cm.jar"
11269 #:tests? #f)); no tests
11270 (inputs
11271 `(("framework" ,java-osgi-framework)
11272 ("annotation" ,java-osgi-annotation)))
11273 (home-page "https://www.osgi.org")
11274 (synopsis "OSGI Configuration Management")
11275 (description
11276 "OSGi, for Open Services Gateway initiative framework, is a module system
11277and service platform for the Java programming language. This package contains
11278utility classes for the configuration of services.")
11279 (license license:asl2.0)))
11280
11281(define-public java-osgi-service-packageadmin
11282 (package
11283 (name "java-osgi-service-packageadmin")
11284 (version "1.2.0")
11285 (source (origin
11286 (method url-fetch)
11287 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
11288 "org.osgi.service.packageadmin/"
11289 version "/org.osgi.service.packageadmin-"
11290 version "-sources.jar"))
11291 (sha256
11292 (base32
11293 "041mpxzi7g36wmcily6y4ccn3jx15akpdy8gmhyb7m98x7qfvn52"))))
11294 (build-system ant-build-system)
11295 (arguments
11296 `(#:jar-name "osgi-service-packageadmin.jar"
11297 #:tests? #f)); no tests
11298 (inputs
11299 `(("framework" ,java-osgi-framework)))
11300 (home-page "https://www.osgi.org")
11301 (synopsis "OSGI Package Administration")
11302 (description
11303 "OSGi, for Open Services Gateway initiative framework, is a module system
11304and service platform for the Java programming language. This package contains
11305the packageadmin service.")
11306 (license license:asl2.0)))
11307
11308(define-public java-ops4j-base-lang
11309 (package
11310 (name "java-ops4j-base-lang")
11311 (version "1.5.0")
11312 (source (origin
11313 (method url-fetch)
11314 (uri (string-append "https://github.com/ops4j/org.ops4j.base/"
11315 "archive/base-" version ".tar.gz"))
11316 (sha256
11317 (base32
11318 "18hl3lpchgpv8yh5rlk39l2gif5dlfgb8gxjmncf39pr2dprkniw"))))
11319 (build-system ant-build-system)
11320 (arguments
11321 `(#:jar-name "java-ops4j-base-lang.jar"
11322 #:source-dir "ops4j-base-lang/src/main/java"
11323 #:tests? #f; no tests
11324 #:phases
11325 (modify-phases %standard-phases
11326 (add-before 'build 'add-test-file
11327 (lambda _
11328 ;; That file is required by a test in ops4j-pax-exam-core-spi
11329 (mkdir-p "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang")
11330 (with-output-to-file "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang/pom.properties"
11331 (lambda _
11332 (display
11333 (string-append
11334 "version=" ,version "\n"
11335 "groupId=org.ops4j.base"
11336 "artifactId=ops4j-base-lang\n"))))
11337 #t)))))
11338 (home-page "https://ops4j1.jira.com/wiki/spaces/base/overview")
11339 (synopsis "Utility classes and extensions to be used in OPS4J projects")
11340 (description "OPS4J stands for Open Participation Software for Java. This
11341package contains utilities and extensions related to @code{java.lang}.")
11342 (license license:asl2.0)))
11343
11344(define-public java-ops4j-base-monitors
11345 (package
11346 (inherit java-ops4j-base-lang)
11347 (name "java-ops4j-base-monitors")
11348 (arguments
11349 `(#:jar-name "java-ops4j-base-monitors.jar"
11350 #:source-dir "ops4j-base-monitors/src/main/java"
11351 #:tests? #f)); no tests
11352 (inputs
11353 `(("lang" ,java-ops4j-base-lang)))
11354 (description "OPS4J stands for Open Participation Software for Java. This
11355package contains utilities and extensions related to monitoring.")))
11356
11357(define-public java-ops4j-base-io
11358 (package
11359 (inherit java-ops4j-base-lang)
11360 (name "java-ops4j-base-io")
11361 (arguments
11362 `(#:jar-name "java-ops4j-base-io.jar"
11363 #:source-dir "ops4j-base-io/src/main/java"
11364 #:test-dir "ops4j-base-io/src/test"
11365 #:test-exclude
11366 (list "**/ListerTest.java")))
11367 (inputs
11368 `(("lang" ,java-ops4j-base-monitors)
11369 ("lang" ,java-ops4j-base-lang)))
11370 (native-inputs
11371 `(("junit" ,java-junit)
11372 ("hamcrest" ,java-hamcrest-core)))
11373 (description "OPS4J stands for Open Participation Software for Java. This
11374package contains utilities and extensions related to handling streams and files.")))
11375
11376(define-public java-ops4j-base-util
11377 (package
11378 (inherit java-ops4j-base-lang)
11379 (name "java-ops4j-base-util")
11380 (arguments
11381 `(#:jar-name "java-ops4j-base-util.jar"
11382 #:source-dir "ops4j-base-util/src/main/java"
11383 #:test-dir "ops4j-base-util/src/test"))
11384 (inputs
11385 `(("lang" ,java-ops4j-base-lang)))
11386 (native-inputs
11387 `(("junit" ,java-junit)))
11388 (description "OPS4J stands for Open Participation Software for Java. This
11389package contains utilities and extensions related to environment, i18n and
11390mime types.")))
11391
11392(define-public java-ops4j-base-util-property
11393 (package
11394 (inherit java-ops4j-base-lang)
11395 (name "java-ops4j-base-util-property")
11396 (arguments
11397 `(#:jar-name "java-ops4j-base-util-property.jar"
11398 #:source-dir "ops4j-base-util-property/src/main/java"
11399 #:tests? #f)); no tests
11400 (inputs
11401 `(("lang" ,java-ops4j-base-lang)
11402 ("util" ,java-ops4j-base-util)))
11403 (description "OPS4J stands for Open Participation Software for Java. This
11404package contains utilities and extensions related to resolving properties from
11405different sources.")))
11406
11407(define-public java-ops4j-base-store
11408 (package
11409 (inherit java-ops4j-base-lang)
11410 (name "java-ops4j-base-store")
11411 (arguments
11412 `(#:jar-name "java-ops4j-base-store.jar"
11413 #:source-dir "ops4j-base-store/src/main/java"
11414 #:tests? #f)); no tests
11415 (inputs
11416 `(("lang" ,java-ops4j-base-lang)
11417 ("slf4j" ,java-slf4j-api)
11418 ("io" ,java-ops4j-base-io)))
11419 (description "OPS4J stands for Open Participation Software for Java. This
11420package contains utilities for storing and retrieving data from an
11421@code{InputStream}.")))
11422
11423(define-public java-ops4j-base-spi
11424 (package
11425 (inherit java-ops4j-base-lang)
11426 (name "java-ops4j-base-spi")
11427 (arguments
11428 `(#:jar-name "java-ops4j-base-spi.jar"
11429 #:source-dir "ops4j-base-spi/src/main/java"
11430 #:test-dir "ops4j-base-spi/src/test"))
11431 (native-inputs
11432 `(("junit" ,java-junit)
11433 ("hamcrest" ,java-hamcrest-core)))
11434 (description "OPS4J stands for Open Participation Software for Java. This
11435package contains utilities for obtaining services via the Java SE 6
11436@code{ServiceLoader}.")))
11437
11438(define-public java-aqute-bnd-annotation
11439 (package
11440 (name "java-aqute-bnd-annotation")
11441 (version "3.5.0")
11442 (source (origin
11443 (method url-fetch)
11444 (uri (string-append "https://github.com/bndtools/bnd/archive/"
11445 version ".REL.tar.gz"))
11446 (file-name (string-append name "-" version ".tar.gz"))
11447 (sha256
11448 (base32
11449 "1ggyiq0as0f6cz333a0dh98j72kmvv5pf2s47v9554yh905lfqdl"))))
11450 (build-system ant-build-system)
11451 (arguments
11452 `(#:jar-name "java-aqute-bnd-annotation.jar"
11453 #:source-dir "biz.aQute.bnd.annotation/src"
11454 #:tests? #f)); empty test dir
11455 (home-page "https://bnd.bndtools.org/")
11456 (synopsis "Tools for OSGi")
11457 (description "Bnd is a swiss army knife for OSGi, it creates manifest
11458headers based on analyzing the class code, it verifies the project settings,
11459it manages project dependencies, gives diffs jars, and much more.")
11460 (license license:asl2.0)))
11461
11462(define-public java-aqute-libg
11463 (package
11464 (inherit java-aqute-bnd-annotation)
11465 (name "java-aqute-libg")
11466 (arguments
11467 `(#:jar-name "java-aqute-libg.jar"
11468 ;; The build fails when source/target more recent than 1.7. This
11469 ;; is a known issue. See: https://github.com/bndtools/bnd/issues/1327
11470 ;;
11471 ;; It is closed as won't fix. There is no way to change the source
11472 ;; so that it works on 1.8, and still works on 1.6, the upstream
11473 ;; target. It work fine on 1.7, so we use 1.7.
11474 #:make-flags (list "-Dant.build.javac.source=1.7"
11475 "-Dant.build.javac.target=1.7")
11476 #:phases
11477 (modify-phases %standard-phases
11478 (add-before 'configure 'chdir
11479 ;; Change to aQute.libg directory, so that the relative
11480 ;; paths in the tests aren't broken.
11481 (lambda _
11482 (chdir "aQute.libg")
11483 #t))
11484 (add-before 'check 'create-test-directory
11485 ;; Copy the test directory to test/java, since that's where
11486 ;; ant-build-system's default project in build.xml expects to find
11487 ;; the test classes. Leave a copy in the original place to not
11488 ;; break paths in tests.
11489 (lambda _
11490 (mkdir "src/test")
11491 (copy-recursively "test" "src/test/java")
11492 #t)))))
11493 (inputs
11494 `(("slf4j" ,java-slf4j-api)
11495 ("osgi-annot" ,java-osgi-annotation)
11496 ("java-osgi-cmpn" ,java-osgi-cmpn)
11497 ("osgi" ,java-osgi-core)))
11498 (native-inputs
11499 `(("hamcrest" ,java-hamcrest-core)
11500 ("java-junit" ,java-junit)))))
11501
11502(define-public java-aqute-bndlib
11503 (package
11504 (inherit java-aqute-bnd-annotation)
11505 (name "java-aqute-bndlib")
11506 (arguments
11507 `(#:jar-name "java-bndlib.jar"
11508 #:source-dir "biz.aQute.bndlib/src"
11509 #:tests? #f)); no tests
11510 (inputs
11511 `(("slf4j" ,java-slf4j-api)
11512 ("osgi-annot" ,java-osgi-annotation)
11513 ("java-aqute-libg" ,java-aqute-libg)
11514 ("java-aqute-bnd-annotation" ,java-aqute-bnd-annotation)
11515 ("java-osgi-service-component-annotations" ,java-osgi-service-component-annotations)
11516 ("java-osgi-service-repository" ,java-osgi-service-repository)
11517 ("java-osgi-service-log" ,java-osgi-service-log)
11518 ("java-osgi-service-metatype-annotations" ,java-osgi-service-metatype-annotations)
11519 ("java-osgi-namespace-contract" ,java-osgi-namespace-contract)
11520 ("java-osgi-namespace-extender" ,java-osgi-namespace-extender)
11521 ("java-osgi-namespace-service" ,java-osgi-namespace-service)
11522 ("promise" ,java-osgi-util-promise)
11523 ("osgi" ,java-osgi-core)))))
11524
11525(define-public java-ops4j-pax-tinybundles
11526 (package
11527 (name "java-ops4j-pax-tinybundles")
11528 (version "2.1.1")
11529 (source (origin
11530 (method url-fetch)
11531 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.tinybundles/"
11532 "archive/tinybundles-" version ".tar.gz"))
11533 (sha256
11534 (base32
11535 "0y0gq3pvv0iir2b885lmlwnvr724vv7vklzhhr4fs27d7mdkj871"))))
11536 (arguments
11537 `(#:jar-name "java-ops4j-pax-tinybundles.jar"
11538 #:source-dir "src/main/java"
11539 #:test-exclude
11540 ;; Abstract base classes for other tests
11541 (list "**/BndTest.java" "**/CoreTest.java")
11542 #:phases
11543 (modify-phases %standard-phases
11544 (add-before 'check 'fix-version
11545 (lambda _
11546 ;; This test has a reference to an old version of bndlib we are not
11547 ;; packaging. It uses the version referenced in pom.xml. We replace
11548 ;; it with our own version.
11549 (substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
11550 (("[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*")
11551 ,(package-version java-aqute-bndlib)))
11552 #t)))))
11553 (inputs
11554 `(("lang" ,java-ops4j-base-lang)
11555 ("io" ,java-ops4j-base-io)
11556 ("store" ,java-ops4j-base-store)
11557 ("slf4j" ,java-slf4j-api)
11558 ("libg" ,java-aqute-libg)
11559 ("bndlib" ,java-aqute-bndlib)))
11560 (native-inputs
11561 `(("junit" ,java-junit)
11562 ("hamcrest" ,java-hamcrest-core)
11563 ("log4j" ,java-log4j-api)
11564 ("bndannotation" ,java-aqute-bnd-annotation)
11565 ("framework" ,java-osgi-framework)))
11566 (build-system ant-build-system)
11567 (home-page "https://ops4j1.jira.com/wiki/spaces/ops4j/pages/12060312/Tinybundles")
11568 (synopsis "Java APIs to create OSGi related artifacts")
11569 (description "Tinybundles is all about creating OSGi related artifacts like
11570Bundles, Fragments and Deployment Packages with Java Api. It is very convenient
11571to create such artifacts on-the-fly inside Tests (like in Pax Exam). On the
11572other hand, this library can be a foundation of real end user tools that need
11573to create those artifacts.")
11574 (license license:asl2.0)))
11575
11576(define-public java-ops4j-pax-exam-core
11577 (package
11578 (name "java-ops4j-pax-exam-core")
11579 (version "4.11.0")
11580 (source (origin
11581 (method url-fetch)
11582 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.exam2/"
11583 "archive/exam-reactor-" version ".tar.gz"))
11584 (sha256
11585 (base32
11586 "1b0f89gawxyl0pkqx9sicp6n58pirkzhjw41y749bwrkb6h99i26"))))
11587 (arguments
11588 (list #:jar-name "java-ops4j-pax-exam-core.jar"
11589 #:source-dir "core/pax-exam/src/main/java"
11590 #:test-dir "core/pax-exam/src/test"))
11591 (inputs
11592 (list java-slf4j-api
11593 java-ops4j-base-lang
11594 java-ops4j-base-io
11595 java-ops4j-base-util-property
11596 java-ops4j-base-store
11597 java-osgi-core))
11598 (native-inputs
11599 (list java-junit
11600 java-hamcrest-core))
11601 (build-system ant-build-system)
11602 (home-page "https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/overview")
11603 (synopsis "In-Container Testing for OSGi, Java EE and CDI")
11604 (description "Pax Exam creates OSGi bundles for testing purposes. It lets
11605the user take control of the OSGi framework, the test framework (e.g. JUnit) and
11606the system under test at the same time.")
11607 (license license:asl2.0)))
11608
11609(define-public java-ops4j-pax-exam-core-spi
11610 (package
11611 (inherit java-ops4j-pax-exam-core)
11612 (name "java-ops4j-pax-exam-core-spi")
11613 (arguments
11614 `(#:jar-name "java-ops4j-pax-exam-spi.jar"
11615 #:source-dir "src/main/java"
11616 #:test-exclude
11617 (list
11618 ;; Abstract base class, not a test
11619 "**/BaseStagedReactorTest.java"
11620 ;; Depends on org.mortbay.jetty.testwars:test-war-dump
11621 "**/WarBuilderTest.java")
11622 #:phases
11623 (modify-phases %standard-phases
11624 (add-before 'configure 'chdir
11625 (lambda _
11626 ;; Tests assume we are in this directory
11627 (chdir "core/pax-exam-spi")
11628 #t))
11629 (add-before 'check 'fix-tests
11630 (lambda _
11631 ;; One test checks that this file is present.
11632 (mkdir-p "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi")
11633 (with-output-to-file
11634 "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi/pom.properties"
11635 (lambda _
11636 (display
11637 (string-append "artifactId = pax-exam-spi\n"
11638 "version = " ,(package-version java-ops4j-pax-exam-core-spi)))))
11639 ;; Maven puts compilation results in the target directory, while we
11640 ;; put them in the build directory.
11641 (substitute* '("src/test/java/org/ops4j/pax/exam/spi/war/WarBuilderTest.java"
11642 "src/test/java/org/ops4j/pax/exam/spi/war/WarTestProbeBuilderTest.java"
11643 "src/test/java/org/ops4j/pax/exam/spi/war/ZipBuilderTest.java")
11644 (("target") "build"))
11645 ;; One test is expected to fail, but it doesn't throw the expected exception
11646 (substitute* "src/test/java/org/ops4j/pax/exam/spi/reactors/BaseStagedReactorTest.java"
11647 (("AssertionError") "IllegalArgumentException"))
11648 #t)))))
11649 (inputs
11650 `(("java-ops4j-pax-exam-core" ,java-ops4j-pax-exam-core)
11651 ("lang" ,java-ops4j-base-lang)
11652 ("monitors" ,java-ops4j-base-monitors)
11653 ("store" ,java-ops4j-base-store)
11654 ("io" ,java-ops4j-base-io)
11655 ("spi" ,java-ops4j-base-spi)
11656 ("osgi" ,java-osgi-core)
11657 ("slf4j" ,java-slf4j-api)
11658 ("tinybundles" ,java-ops4j-pax-tinybundles)))
11659 (native-inputs
11660 `(("mockito" ,java-mockito-1)
11661 ("junit" ,java-junit)
11662 ("hamcrest" ,java-hamcrest-core)
11663 ("cglib" ,java-cglib)
11664 ("objenesis" ,java-objenesis)))))
11665
11666(define-public java-ops4j-pax-exam-core-junit
11667 (package
11668 (inherit java-ops4j-pax-exam-core)
11669 (name "java-ops4j-pax-exam-core-junit")
11670 (arguments
11671 `(#:jar-name "ops4j-pax-exam-core-junit.jar"
11672 #:source-dir "drivers/pax-exam-junit4/src/main/java"
11673 #:tests? #f)); no tests
11674 (inputs
11675 `(("junit" ,java-junit)
11676 ("slf4j" ,java-slf4j-api)
11677 ("core" ,java-ops4j-pax-exam-core)
11678 ("spi" ,java-ops4j-pax-exam-core-spi)))
11679 (native-inputs '())))
11680
11681(define-public java-fasterxml-jackson-annotations
11682 (package
11683 (name "java-fasterxml-jackson-annotations")
11684 (version "2.9.4")
11685 (source (origin
11686 (method url-fetch)
11687 (uri (string-append "https://github.com/FasterXML/"
11688 "jackson-annotations/archive/"
11689 "jackson-annotations-" version ".tar.gz"))
11690 (sha256
11691 (base32
11692 "0mr95xd0da6a4g95zvrl1ryk5n5zv2rc696w3xnsr5hxk2gicfc4"))))
11693 (build-system ant-build-system)
11694 (arguments
11695 `(#:jar-name "jackson-annotations.jar"
11696 #:source-dir "src/main/java"
11697 #:test-dir "src/test"))
11698 (native-inputs
11699 `(("junit" ,java-junit)))
11700 (home-page "https://github.com/FasterXML/jackson-annotations")
11701 (synopsis "General purpose annotations for the Jackson Data Processor")
11702 (description "This package contains general purpose annotations for the
11703Jackson Data Processor, used on value and handler types. The only annotations
11704not included are ones that require dependency to the Databind package.")
11705 (license license:asl2.0)))
11706
11707(define-public java-fasterxml-jackson-core
11708 (package
11709 (name "java-fasterxml-jackson-core")
11710 (version "2.9.4")
11711 (source (origin
11712 (method url-fetch)
11713 (uri (string-append "https://github.com/FasterXML/"
11714 "jackson-core/archive/"
11715 "jackson-core-" version ".tar.gz"))
11716 (sha256
11717 (base32
11718 "159hsnk17jr1gyzkf01cxvsn45srnk37g949r7364qlsr527gjgd"))))
11719 (build-system ant-build-system)
11720 (arguments
11721 `(#:jar-name "jackson-core.jar"
11722 #:source-dir "src/main/java"
11723 #:test-dir "src/test"
11724 #:test-exclude
11725 (list
11726 ;; Expected failure. pom.xml excludes these
11727 "**/failing/**"
11728 ;; Base classes that have no constructor for junit
11729 "**/BaseTest.java"
11730 "**/ConcurrencyReadTest.java"
11731 "**/ManualCharAccessTest.java"
11732 "**/ManualCharAccessTest.java"
11733 "**/TrailingCommasTest.java"
11734 "**/AsyncMissingValuesInObjectTest.java"
11735 "**/AsyncMissingValuesInArrayTest.java")
11736 #:phases
11737 (modify-phases %standard-phases
11738 (add-before 'configure 'generate-PackageVersion.java
11739 (lambda _
11740 (let* ((out "src/main/java/com/fasterxml/jackson/core/json/PackageVersion.java")
11741 (in (string-append out ".in")))
11742 (copy-file in out)
11743 (substitute* out
11744 (("@package@") "com.fasterxml.jackson.core.json")
11745 (("@projectversion@") ,version)
11746 (("@projectgroupid@") "com.fasterxml.jackson.core")
11747 (("@projectartifactid@") "jackson-core")))
11748 #t))
11749 (add-before 'build 'copy-resources
11750 (lambda _
11751 (copy-recursively "src/main/resources"
11752 "build/classes")
11753 #t))
11754 (add-before 'check 'copy-test-resources
11755 (lambda _
11756 (copy-recursively "src/test/resources"
11757 "build/test-classes")
11758 #t)))))
11759 (native-inputs
11760 `(("junit" ,java-junit)
11761 ("hamcrest" ,java-hamcrest-core)))
11762 (home-page "https://github.com/FasterXML/jackson-core")
11763 (synopsis "Low-level streaming parser and generator abstractions")
11764 (description "This package contains core low-level incremental
11765(streaming) parser and generator abstractions used by the Jackson Data
11766Processor. It also includes the default implementation of handler types
11767(parser, generator) that handle JSON format.")
11768 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11769
11770(define-public java-fasterxml-jackson-databind
11771 (package
11772 (name "java-fasterxml-jackson-databind")
11773 (version "2.9.4")
11774 (source (origin
11775 (method url-fetch)
11776 (uri (string-append "https://github.com/FasterXML/"
11777 "jackson-databind/archive/"
11778 "jackson-databind-" version ".tar.gz"))
11779 (sha256
11780 (base32
11781 "1zd2cw4z6kdkbx8za96xh9pyicv2a2l7y0rkcx2fqd8hv6d47s08"))))
11782 (build-system ant-build-system)
11783 (arguments
11784 `(#:jar-name "jackson-databind.jar"
11785 #:source-dir "src/main/java"
11786 #:tests? #f; requires javax.measures for which I can't find a free implementation
11787 #:phases
11788 (modify-phases %standard-phases
11789 (add-before 'configure 'generate-PackageVersion.java
11790 (lambda _
11791 (let* ((out "src/main/java/com/fasterxml/jackson/databind/cfg/PackageVersion.java")
11792 (in (string-append out ".in")))
11793 (copy-file in out)
11794 (substitute* out
11795 (("@package@") "com.fasterxml.jackson.databind.cfg")
11796 (("@projectversion@") ,version)
11797 (("@projectgroupid@") "com.fasterxml.jackson.databind")
11798 (("@projectartifactid@") "jackson-databind")))
11799 #t))
11800 (add-before 'build 'copy-resources
11801 (lambda _
11802 (copy-recursively "src/main/resources" "build/classes")
11803 #t)))))
11804 (inputs
11805 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core))
11806 (home-page "https://github.com/FasterXML/jackson-databind")
11807 (synopsis "Data-binding functionality and tree-model for the Jackson Data Processor")
11808 (description "This package contains the general-purpose data-binding
11809functionality and tree-model for Jackson Data Processor. It builds on core
11810streaming parser/generator package, and uses Jackson Annotations for
11811configuration.")
11812 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11813
11814(define-public java-fasterxml-jackson-modules-base-jaxb
11815 (package
11816 (name "java-fasterxml-jackson-modules-base-jaxb")
11817 (version "2.9.4")
11818 (source (origin
11819 (method url-fetch)
11820 (uri (string-append "https://github.com/FasterXML/"
11821 "jackson-modules-base/archive/"
11822 "jackson-modules-base-" version ".tar.gz"))
11823 (sha256
11824 (base32
11825 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
11826 (build-system ant-build-system)
11827 (arguments
11828 `(#:jar-name "jackson-modules-base-jaxb.jar"
11829 #:source-dir "jaxb/src/main/java"
11830 #:test-dir "jaxb/src/test"
11831 #:test-exclude
11832 ;; Base class for tests
11833 (list "**/BaseJaxbTest.java")
11834 #:phases
11835 (modify-phases %standard-phases
11836 (add-before 'configure 'generate-PackageVersion.java
11837 (lambda _
11838 (let* ((out (string-append "jaxb/src/main/java/com/fasterxml/"
11839 "jackson/module/jaxb/PackageVersion.java"))
11840 (in (string-append out ".in")))
11841 (copy-file in out)
11842 (substitute* out
11843 (("@package@") "com.fasterxml.jackson.module.jaxb")
11844 (("@projectversion@") ,version)
11845 (("@projectgroupid@") "com.fasterxml.jackson.module.jaxb")
11846 (("@projectartifactid@") "jackson-module-jaxb")))
11847 #t))
11848 (add-before 'build 'copy-resources
11849 (lambda _
11850 (copy-recursively "jaxb/src/main/resources" "build/classes")
11851 #t)))))
11852 (inputs
11853 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core
11854 java-fasterxml-jackson-databind))
11855 (native-inputs
11856 (list java-junit))
11857 (home-page "https://github.com/FasterXML/jackson-modules-base")
11858 (synopsis "Jaxb annotations jackson module")
11859 (description "This package is the jaxb annotations module for jackson.")
11860 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11861
11862(define-public java-fasterxml-jackson-modules-base-mrbean
11863 (package
11864 (name "java-fasterxml-jackson-modules-base-mrbean")
11865 (version "2.9.4")
11866 (source (origin
11867 (method url-fetch)
11868 (uri (string-append "https://github.com/FasterXML/"
11869 "jackson-modules-base/archive/"
11870 "jackson-modules-base-" version ".tar.gz"))
11871 (sha256
11872 (base32
11873 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
11874 (build-system ant-build-system)
11875 (arguments
11876 `(#:jar-name "jackson-modules-base-mrbean.jar"
11877 #:source-dir "mrbean/src/main/java"
11878 #:test-dir "mrbean/src/test"
11879 #:test-exclude
11880 ;; Base class for tests
11881 (list "**/BaseTest.java")
11882 #:phases
11883 (modify-phases %standard-phases
11884 (add-before 'configure 'generate-PackageVersion.java
11885 (lambda _
11886 (let* ((out (string-append "mrbean/src/main/java/com/fasterxml/"
11887 "jackson/module/mrbean/PackageVersion.java"))
11888 (in (string-append out ".in")))
11889 (copy-file in out)
11890 (substitute* out
11891 (("@package@") "com.fasterxml.jackson.module.mrbean")
11892 (("@projectversion@") ,version)
11893 (("@projectgroupid@") "com.fasterxml.jackson.module.mrbean")
11894 (("@projectartifactid@") "jackson-module-mrbean")))
11895 #t)))))
11896 (inputs
11897 (list java-asm java-fasterxml-jackson-annotations
11898 java-fasterxml-jackson-core java-fasterxml-jackson-databind))
11899 (native-inputs
11900 (list java-junit))
11901 (home-page "https://github.com/FasterXML/jackson-modules-base")
11902 (synopsis "POJO type materialization for Java")
11903 (description "This package implements POJO type materialization.
11904Databinders can construct implementation classes for Java interfaces as part
11905of deserialization.")
11906 (license license:asl2.0)))
11907
11908(define-public java-snakeyaml
11909 (package
11910 (name "java-snakeyaml")
11911 (version "1.18")
11912 (source (origin
11913 (method url-fetch)
11914 (uri (string-append "https://bitbucket.org/asomov/snakeyaml/get/v"
11915 version ".tar.gz"))
11916 (file-name (string-append name "-" version ".tar.gz"))
11917 (sha256
11918 (base32
11919 "0474cqcv46zgv9bhms2vgawakq1vyj0hp3h3f1bfys46msia90bh"))))
11920 (build-system ant-build-system)
11921 (arguments
11922 `(#:jar-name "java-snakeyaml.jar"
11923 #:source-dir "src/main/java"
11924 ;; Tests require velocity, a cyclic dependency, and
11925 ;; java-spring-framework-context which is not packaged.
11926 #:tests? #f))
11927 (home-page "https://bitbucket.org/asomov/snakeyaml")
11928 (synopsis "YAML processor")
11929 (description "SnakeYAML is a YAML processor for the Java Virtual Machine.")
11930 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11931
11932(define-public java-fasterxml-jackson-dataformat-yaml
11933 (package
11934 (name "java-fasterxml-jackson-dataformat-yaml")
11935 (version "2.9.4")
11936 (source (origin
11937 (method url-fetch)
11938 (uri (string-append "https://github.com/FasterXML/"
11939 "jackson-dataformats-text/archive/"
11940 "jackson-dataformats-text-" version ".tar.gz"))
11941 (sha256
11942 (base32
11943 "1hikl06khaxbg439avf442qifcadap8w0lx13f0nnhp2vh3dkbz7"))))
11944 (build-system ant-build-system)
11945 (arguments
11946 `(#:jar-name "jackson-dataformat-yaml.jar"
11947 #:source-dir "yaml/src/main/java"
11948 #:test-dir "yaml/src/test"
11949 #:test-exclude (list "**/failing/**.java")
11950 #:phases
11951 (modify-phases %standard-phases
11952 (add-before 'configure 'generate-PackageVersion.java
11953 (lambda _
11954 (let* ((out "yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/PackageVersion.java")
11955 (in (string-append out ".in")))
11956 (copy-file in out)
11957 (substitute* out
11958 (("@package@") "com.fasterxml.jackson.dataformat.yaml")
11959 (("@projectversion@") ,version)
11960 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.yaml")
11961 (("@projectartifactid@") "jackson-dataformat-yaml")))
11962 #t)))))
11963 (inputs
11964 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core
11965 java-fasterxml-jackson-databind java-snakeyaml))
11966 (native-inputs
11967 `(("junit" ,java-junit)
11968 ("hamcrest" ,java-hamcrest-core)
11969 ("java-ops4j-pax-exam-core-spi" ,java-ops4j-pax-exam-core-spi)
11970 ("java-ops4j-pax-exam-core-junit" ,java-ops4j-pax-exam-core-junit)
11971 ("java-ops4j-pax-exam" ,java-ops4j-pax-exam-core)))
11972 (home-page "https://github.com/FasterXML/jackson-dataformats-text")
11973 (synopsis "Yaml backend for Jackson")
11974 (description "Dataformat backends are used to support format alternatives
11975to JSON, supported by default. This is done by sub-classing Jackson core
11976abstractions.")
11977 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11978
11979(define-public java-stax2-api
11980 (package
11981 (name "java-stax2-api")
11982 (version "4.0.0")
11983 (source (origin
11984 (method url-fetch)
11985 (uri (string-append "https://github.com/FasterXML/stax2-api/archive/"
11986 "stax2-api-" version ".tar.gz"))
11987 (sha256
11988 (base32
11989 "1amc1si0l0hyyw2sawmnzy4hkna3z6fp195y4nm5m9wb9ld5awkq"))))
11990 (build-system ant-build-system)
11991 (arguments
11992 `(#:jar-name "java-stax2-api.jar"
11993 #:source-dir "src/main/java"
11994 #:tests? #f)); no tests
11995 (home-page "https://github.com/FasterXML/stax2-api")
11996 (synopsis "Stax2 API")
11997 (description "Stax2 API is an extension to basic Stax 1.0 API that adds
11998significant new functionalities, such as full-featured bi-direction validation
11999interface and high-performance Typed Access API.")
12000 (license license:bsd-2)))
12001
12002(define-public java-woodstox-core
12003 (package
12004 (name "java-woodstox-core")
12005 (version "5.0.3")
12006 (source (origin
12007 (method git-fetch)
12008 (uri (git-reference
12009 (url "https://github.com/FasterXML/woodstox")
12010 (commit (string-append "woodstox-core-" version))))
12011 (file-name (git-file-name name version))
12012 (sha256
12013 (base32
12014 "0bfylk24a967hwxprxqbg6cdvm6n4ldcarp54yg980viwvjiglyp"))))
12015 (build-system ant-build-system)
12016 (arguments
12017 `(#:jar-name "woodstox.jar"
12018 #:test-exclude
12019 (list "**/Base*.java" "failing/**")
12020 #:phases
12021 (modify-phases %standard-phases
12022 (add-before 'build 'remove-msv-dep
12023 (lambda _
12024 ;; we don't need osgi, and it depends on msv
12025 (delete-file-recursively "src/main/java/com/ctc/wstx/osgi")
12026 ;; msv's latest release is from 2011 and we don't need it
12027 (delete-file-recursively "src/main/java/com/ctc/wstx/msv")
12028 (delete-file-recursively "src/test/java/wstxtest/osgi")
12029 (delete-file-recursively "src/test/java/wstxtest/msv")
12030 #t))
12031 (add-before 'build 'copy-resources
12032 (lambda _
12033 (copy-recursively "src/main/resources" "build/classes")
12034 #t)))))
12035 (inputs
12036 `(("stax2" ,java-stax2-api)))
12037 (native-inputs
12038 `(("junit" ,java-junit)))
12039 (home-page "https://github.com/FasterXML/woodstox")
12040 (synopsis "Stax XML API implementation")
12041 (description "Woodstox is a stax XML API implementation.")
12042 (license license:asl2.0)))
12043
12044(define-public java-fasterxml-jackson-dataformat-xml
12045 (package
12046 (name "java-fasterxml-jackson-dataformat-xml")
12047 (version "2.9.4")
12048 (source (origin
12049 (method git-fetch)
12050 (uri (git-reference
12051 (url "https://github.com/FasterXML/jackson-dataformat-xml")
12052 (commit (string-append "jackson-dataformat-xml-" version))))
12053 (file-name (git-file-name name version))
12054 (sha256
12055 (base32
12056 "0s1wl65mbs57c2hz2v8rnh8i04y5lpyyvnjz562j5j6b83vwwpfx"))))
12057 (build-system ant-build-system)
12058 (arguments
12059 `(#:jar-name "jackson-dataformat-xml.jar"
12060 #:source-dir "src/main/java"
12061 #:test-exclude
12062 (list "**/failing/**")
12063 #:phases
12064 (modify-phases %standard-phases
12065 (add-before 'configure 'generate-PackageVersion.java
12066 (lambda _
12067 (let* ((out "src/main/java/com/fasterxml/jackson/dataformat/xml/PackageVersion.java")
12068 (in (string-append out ".in")))
12069 (copy-file in out)
12070 (newline)
12071 (substitute* out
12072 (("@package@") "com.fasterxml.jackson.dataformat.xml")
12073 (("@projectversion@") ,version)
12074 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.xml")
12075 (("@projectartifactid@") "jackson-dataformat-xml")))
12076 #t))
12077 (add-before 'build 'copy-resources
12078 (lambda _
12079 (copy-recursively "src/main/resources" "build/classes")
12080 #t)))))
12081 (inputs
12082 `(("jackson-annotations" ,java-fasterxml-jackson-annotations)
12083 ("jackson-core" ,java-fasterxml-jackson-core)
12084 ("jackson-modules-base-jaxb" ,java-fasterxml-jackson-modules-base-jaxb)
12085 ("jackson-databind" ,java-fasterxml-jackson-databind)
12086 ("stax2-api" ,java-stax2-api)
12087 ("woodstox" ,java-woodstox-core)))
12088 (native-inputs
12089 `(("junit" ,java-junit)
12090 ("hamcrest" ,java-hamcrest-core)))
12091 (home-page "https://github.com/FasterXML/jackson-dataformat-xml")
12092 (synopsis "Read and write XML")
12093 (description "This package contains Jackson extension component for reading
12094and writing XML encoded data.
12095
12096Further, the goal is to emulate how JAXB data-binding works with \"Code-first\"
12097approach (that is, no support is added for \"Schema-first\" approach). Support
12098for JAXB annotations is provided by JAXB annotation module; this module
12099provides low-level abstractions (@code{JsonParser}, @code{JsonGenerator},
12100@code{JsonFactory}) as well as small number of higher level overrides needed to
12101make data-binding work.")
12102 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
12103
12104(define-public java-hdrhistogram
12105 (package
12106 (name "java-hdrhistogram")
12107 (version "2.1.9")
12108 (source (origin
12109 (method git-fetch)
12110 (uri (git-reference
12111 (url "https://github.com/HdrHistogram/HdrHistogram")
12112 (commit (string-append "HdrHistogram-" version))))
12113 (file-name (git-file-name name version))
12114 (sha256
12115 (base32
12116 "1cw8aa1vk258k42xs6wpy72m4gbai540jq032qsa7c5586iawx2d"))))
12117 (build-system ant-build-system)
12118 (arguments
12119 `(#:jar-name "java-hdrhistogram.jar"
12120 #:source-dir "src/main/java"
12121 #:phases
12122 (modify-phases %standard-phases
12123 (add-after 'unpack 'make-files-writable
12124 (lambda _
12125 (for-each make-file-writable (find-files "."))
12126 #t))
12127 (add-before 'configure 'set-version
12128 (lambda _
12129 (let* ((version-java "src/main/java/org/HdrHistogram/Version.java")
12130 (template (string-append version-java ".template")))
12131 (copy-file template version-java)
12132 (substitute* version-java
12133 (("\\$VERSION\\$") ,version)
12134 (("\\$BUILD_TIME\\$") "0"))
12135 #t))))))
12136 (native-inputs
12137 `(("junit" ,java-junit)
12138 ("hamcrest" ,java-hamcrest-core)))
12139 (home-page "https://hdrhistogram.github.io/HdrHistogram")
12140 (synopsis "High dynamic range histogram")
12141 (description "Hdrhistogram creates histograms that support
12142recording and analyzing sampled data value counts across a configurable integer
12143value range with configurable value precision within the range. Value precision
12144is expressed as the number of significant digits in the value recording, and
12145provides control over value quantization behavior across the value range and
12146the subsequent value resolution at any given level.")
12147 (license license:public-domain)))
12148
12149(define-public java-cofoja
12150 (package
12151 (name "java-cofoja")
12152 (version "1.3")
12153 (source (origin
12154 (method git-fetch)
12155 (uri (git-reference
12156 (url "https://github.com/nhatminhle/cofoja")
12157 (commit (string-append "v" version))))
12158 (file-name (string-append "java-cofoja-" version "-checkout"))
12159 (sha256
12160 (base32
12161 "0p7sz8y5xgpi5rx1qwn6587fkd52qr3ha3ybh14gqcyxhikl525w"))))
12162 (build-system ant-build-system)
12163 (arguments
12164 `(#:build-target "dist"
12165 #:test-target "test"
12166 #:jdk ,icedtea-8
12167 #:make-flags
12168 (list "-Ddist.dir=dist")
12169 #:modules ((guix build ant-build-system)
12170 (guix build java-utils)
12171 (guix build utils)
12172 (srfi srfi-1)
12173 (ice-9 match))
12174 #:phases
12175 (modify-phases %standard-phases
12176 ;; The bulid system ignores the class path the ant-build-system sets
12177 ;; up and instead expects to find all dependencies in the "lib"
12178 ;; directory.
12179 (add-after 'unpack 'create-libdir
12180 (lambda* (#:key inputs #:allow-other-keys)
12181 (mkdir-p "lib")
12182 (for-each
12183 (lambda (file)
12184 (let ((target (string-append "lib/" (basename file))))
12185 (unless (file-exists? target)
12186 (symlink file target))))
12187 (append-map (match-lambda
12188 ((label . dir)
12189 (find-files dir "\\.jar$")))
12190 inputs))
12191 #t))
12192 (replace 'install (install-jars "dist")))))
12193 (inputs
12194 (list java-asm))
12195 (native-inputs
12196 (list java-junit))
12197 (home-page "https://github.com/nhatminhle/cofoja")
12198 (synopsis "Contracts for Java")
12199 (description "Contracts for Java, or Cofoja for short, is a contract
12200programming framework and test tool for Java, which uses annotation processing
12201and bytecode instrumentation to provide run-time checking. (In particular,
12202this is not a static analysis tool.)")
12203 (license license:lgpl3+)))
12204
12205(define-public java-aopalliance
12206 (package
12207 (name "java-aopalliance")
12208 (version "1.0")
12209 (source (origin
12210 (method git-fetch)
12211 ;; Note: this git repository is not official, but contains the
12212 ;; source code that is in the CVS repository. Downloading the
12213 ;; tarball from sourceforge is undeterministic, and the cvs download
12214 ;; fails.
12215 (uri (git-reference
12216 (url "https://github.com/hoverruan/aopalliance")
12217 (commit "0d7757ae204e5876f69431421fe9bc2a4f01e8a0")))
12218 (file-name (string-append name "-" version))
12219 (sha256
12220 (base32
12221 "0rsg2b0v3hxlq2yk1i3m2gw3xwq689j3cwx9wbxvqfpdcjbca0qr"))))
12222 (build-system ant-build-system)
12223 (arguments
12224 `(#:jar-name "java-aopalliance.jar"
12225 #:jdk ,icedtea-8
12226 #:tests? #f; no tests
12227 #:source-dir "aopalliance/src/main"
12228 #:phases
12229 (modify-phases %standard-phases
12230 (add-before 'install 'create-pom
12231 (generate-pom.xml "pom.xml" "aopalliance" "aopalliance" ,version))
12232 (replace 'install
12233 (install-from-pom "pom.xml")))))
12234 (home-page "https://aopalliance.sourceforge.net")
12235 (synopsis "Aspect-Oriented Programming")
12236 (description "The AOP Alliance project is a joint project between several
12237software engineering people who are interested in Aspect-Oriented Programming
12238(AOP) and Java.")
12239 (license license:public-domain)))
12240
12241(define-public java-javax-inject
12242 (package
12243 (name "java-javax-inject")
12244 (version "1")
12245 (source (origin
12246 (method git-fetch)
12247 (uri (git-reference
12248 (url "https://github.com/javax-inject/javax-inject")
12249 (commit version)))
12250 (file-name (git-file-name name version))
12251 (sha256
12252 (base32
12253 "1rspl0nkvk1jif6nccikw93xic6ljj2b6kpy2mffwi2mnvc13j7x"))))
12254 (build-system ant-build-system)
12255 (arguments
12256 `(#:jar-name "java-javax-inject.jar"
12257 #:tests? #f; no tests
12258 #:phases
12259 (modify-phases %standard-phases
12260 (replace 'install
12261 (install-from-pom "pom.xml")))))
12262 (home-page "https://github.com/javax-inject/javax-inject")
12263 (synopsis "JSR-330: Dependency Injection for Java")
12264 (description "This package specifies a means for obtaining objects in such
12265a way as to maximize reusability, testability and maintainability compared to
12266traditional approaches such as constructors, factories, and service locators
12267(e.g., JNDI). This process, known as dependency injection, is beneficial to
12268most nontrivial applications.
12269
12270Many types depend on other types. For example, a @var{Stopwatch} might depend
12271on a @var{TimeSource}. The types on which a type depends are known as its
12272dependencies. The process of finding an instance of a dependency to use at run
12273time is known as resolving the dependency. If no such instance can be found,
12274the dependency is said to be unsatisfied, and the application is broken.")
12275 (license license:asl2.0)))
12276
12277(define-public java-guice
12278 (package
12279 (name "java-guice")
12280 (version "4.1")
12281 (source (origin
12282 (method git-fetch)
12283 (uri (git-reference
12284 (url "https://github.com/google/guice")
12285 (commit version)))
12286 (file-name (git-file-name name version))
12287 (modules '((guix build utils)))
12288 (snippet
12289 `(begin
12290 (for-each delete-file (find-files "." ".*.jar")) #t))
12291 (sha256
12292 (base32
12293 "18im5hdfl4q1b9chww2s1ii60sn3ydyyar32a2sf2p2g8zlbdswq"))))
12294 (build-system ant-build-system)
12295 (arguments
12296 `(#:jar-name "java-guice.jar"
12297 #:jdk ,icedtea-8
12298 #:tests? #f; FIXME: tests are not in a java sub directory
12299 #:source-dir "core/src"
12300 #:phases
12301 (modify-phases %standard-phases
12302 (add-after 'unpack 'make-files-writable
12303 (lambda _
12304 (for-each make-file-writable (find-files "."))
12305 #t))
12306 (replace 'install
12307 (install-from-pom "core/pom.xml")))))
12308 (propagated-inputs
12309 (list java-aopalliance
12310 java-cglib
12311 java-guava
12312 java-javax-inject
12313 java-guice-parent-pom))
12314 (home-page "https://github.com/google/guice")
12315 (synopsis "Lightweight dependency injection framework")
12316 (description "Guice is a lightweight dependency injection framework for
12317Java 6 and above.")
12318 (license license:asl2.0)))
12319
12320(define-public java-guice-servlet
12321 (package
12322 (inherit java-guice)
12323 (name "java-guice-servlet")
12324 (arguments
12325 `(#:jar-name "guice-servlet.jar"
12326 #:source-dir "extensions/servlet/src/"
12327 #:jdk ,icedtea-8
12328 #:tests? #f ; FIXME: not in a java subdir
12329 #:phases
12330 (modify-phases %standard-phases
12331 (add-after 'unpack 'make-files-writable
12332 (lambda _
12333 (for-each make-file-writable (find-files "."))
12334 #t)))))
12335 (inputs
12336 `(("guice" ,java-guice)
12337 ("servlet" ,java-classpathx-servletapi)
12338 ,@(package-inputs java-guice)))))
12339
12340(define java-guice-parent-pom
12341 (package
12342 (inherit java-guice)
12343 (name "java-guice-parent-pom")
12344 (arguments
12345 `(#:tests? #f
12346 #:phases
12347 (modify-phases %standard-phases
12348 (delete 'configure)
12349 (delete 'build)
12350 (add-after 'install 'install-extensions
12351 (install-pom-file "extensions/pom.xml"))
12352 (replace 'install
12353 (install-pom-file "pom.xml")))))
12354 (propagated-inputs
12355 `(("java-google-parent-pom" ,java-google-parent-pom-5)))))
12356
12357(define java-google-parent-pom-5
12358 (package
12359 (name "java-google-parent-pom")
12360 (version "5")
12361 (source (origin
12362 (method git-fetch)
12363 (uri (git-reference
12364 (url "https://github.com/google/google-maven-parents")
12365 (commit (string-append "google-" version))))
12366 (file-name (git-file-name name version))
12367 (sha256
12368 (base32
12369 "0zb7hx24p8k8rfdvix2vsbfqn73jhrycdndvhf8j5gbii9wbqibv"))))
12370 (build-system ant-build-system)
12371 (arguments
12372 `(#:tests? #f
12373 #:phases
12374 (modify-phases %standard-phases
12375 (delete 'configure)
12376 (delete 'build)
12377 (replace 'install
12378 (install-pom-file "pom.xml")))))
12379 (home-page "https://github.com/google/google-maven-parents")
12380 (synopsis "Google parent pom")
12381 (description "This package contains the Maven parent POM for other Google
12382Java projects.")
12383 (license license:asl2.0)))
12384
12385(define java-guice-parent-pom-5
12386 (package
12387 (inherit java-guice)
12388 (name "java-guice-parent-pom")
12389 (version "5.1.0")
12390 (source (origin
12391 (method git-fetch)
12392 (uri (git-reference
12393 (url "https://github.com/google/guice")
12394 (commit version)))
12395 (file-name (git-file-name name version))
12396 (sha256
12397 (base32
12398 "05w8g9lmj8623b6f6c2xyriyhf44vwvqg0i1dszhrsnhk5f1jv71"))))
12399 (arguments
12400 `(#:tests? #f
12401 #:phases
12402 (modify-phases %standard-phases
12403 (delete 'configure)
12404 (delete 'build)
12405 (add-after 'install 'install-extensions
12406 (install-pom-file "extensions/pom.xml"))
12407 (replace 'install
12408 (install-pom-file "pom.xml")))))
12409 (propagated-inputs
12410 (list java-google-parent-pom-5))))
12411
12412(define-public java-guice-5
12413 (package
12414 (inherit java-guice-parent-pom-5)
12415 (name "java-guice")
12416 (arguments
12417 `(#:jar-name "java-guice.jar"
12418 #:tests? #f ; FIXME: tests are not in a java sub directory
12419 #:source-dir "core/src"
12420 #:phases
12421 (modify-phases %standard-phases
12422 (replace 'install
12423 (install-from-pom "core/pom.xml")))))
12424 (inputs
12425 (list java-jsr305
12426 java-error-prone-annotations))
12427 (propagated-inputs
12428 (list java-aopalliance
12429 java-asm-9
12430 java-guava
12431 java-javax-inject
12432 java-guice-parent-pom-5))))
12433
12434(define-public java-assertj
12435 (package
12436 (name "java-assertj")
12437 (version "3.8.0")
12438 (source (origin
12439 (method git-fetch)
12440 (uri (git-reference
12441 (url "https://github.com/joel-costigliola/assertj-core")
12442 (commit (string-append "assertj-core-" version))))
12443 (file-name (git-file-name name version))
12444 (sha256
12445 (base32
12446 "1k35cg2in7pzk4pbdjryr0pll5lgk1r6ngrn0j8cdlgi7w8zh2d1"))))
12447 (build-system ant-build-system)
12448 (arguments
12449 `(#:jar-name "java-assertj.jar"
12450 #:jdk ,icedtea-8
12451 #:source-dir "src/main/java"
12452 #:tests? #f)); depends on tng-junit which depends on assertj
12453 (inputs
12454 `(("cglib" ,java-cglib)
12455 ("junit" ,java-junit)
12456 ("hamcrest" ,java-hamcrest-core)))
12457 (native-inputs
12458 `(("mockito" ,java-mockito-1)))
12459 (home-page "https://joel-costigliola.github.io/assertj/index.html")
12460 (synopsis "Fluent assertions for java")
12461 (description "AssertJ core is a Java library that provides a fluent
12462interface for writing assertions. Its main goal is to improve test code
12463readability and make maintenance of tests easier.")
12464 (license license:asl2.0)))
12465
12466(define-public java-jboss-javassist
12467 (package
12468 (name "java-jboss-javassist")
12469 (version "3.21.0")
12470 (source (origin
12471 (method git-fetch)
12472 (uri (git-reference
12473 (url "https://github.com/jboss-javassist/javassist")
12474 (commit
12475 (string-append "rel_"
12476 (string-map
12477 (lambda (x) (if (eq? x #\.) #\_ x)) version)
12478 "_ga"))))
12479 (file-name (git-file-name name version))
12480 (sha256
12481 (base32
12482 "0h3zlcyqiaq01fspm69h7vki67raw305w89p4ha8vlhpzw02qifm"))
12483 (modules '((guix build utils)))
12484 (snippet
12485 '(begin
12486 (delete-file "javassist.jar")))))
12487 (build-system ant-build-system)
12488 (arguments
12489 `(#:jar-name "java-jboss-javassist.jar"
12490 #:jdk ,icedtea-8
12491 #:source-dir "src/main"
12492 #:tests? #f; FIXME: requires junit-awtui and junit-swingui from junit3
12493 #:phases
12494 (modify-phases %standard-phases
12495 (add-after 'unpack 'make-files-writable
12496 (lambda _
12497 (for-each make-file-writable (find-files "."))
12498 #t)))))
12499 (native-inputs
12500 `(("junit" ,java-junit)))
12501 (home-page "https://github.com/jboss-javassist/javassist")
12502 (synopsis "Java bytecode engineering toolkit")
12503 (description "Javassist (JAVA programming ASSISTant) makes Java bytecode
12504manipulation simple. It is a class library for editing bytecodes in Java; it
12505enables Java programs to define a new class at runtime and to modify a class
12506file when the JVM loads it.")
12507 (license (list license:gpl2 license:cddl1.0)))); either gpl2 only or cddl.
12508
12509(define-public java-jcommander
12510 (package
12511 (name "java-jcommander")
12512 (version "1.71")
12513 (source (origin
12514 (method git-fetch)
12515 (uri (git-reference
12516 (url "https://github.com/cbeust/jcommander")
12517 (commit version)))
12518 (file-name (git-file-name name version))
12519 (sha256
12520 (base32
12521 "12vcpc19sd7jhvjgp7xz1qjanfix162xb3x2q5zah93rjklj1h57"))))
12522 (build-system ant-build-system)
12523 (arguments
12524 `(#:jar-name "java-jcommander.jar"
12525 #:jdk ,icedtea-8
12526 #:tests? #f; requires testng which depends on jcommander
12527 #:source-dir "src/main/java"))
12528 (home-page "https://jcommander.org")
12529 (synopsis "Command line parameters parser")
12530 (description "JCommander is a very small Java framework that makes it
12531trivial to parse command line parameters. Parameters are declared with
12532annotations.")
12533 (license license:asl2.0)))
12534
12535(define-public java-bsh
12536 (package
12537 (name "java-bsh")
12538 (version "2.1.1")
12539 (source (origin
12540 (method git-fetch)
12541 (uri (git-reference
12542 (url "https://github.com/beanshell/beanshell")
12543 (commit version)))
12544 (file-name (git-file-name name version))
12545 (sha256
12546 (base32
12547 "1a6y46yz2ba4mnlfv4bpd5pmzhgxrzk3s10xp05jz377nbp2izwg"))
12548 (modules '((guix build utils)))
12549 (snippet
12550 '(begin
12551 ;; Delete bundled third-party jar archives.
12552 (for-each delete-file (find-files "." ".*.jar$"))
12553 (for-each (lambda (file) (chmod file #o644))
12554 (find-files "." "."))
12555 #t))))
12556 (build-system ant-build-system)
12557 (arguments
12558 `(#:build-target "jarall"
12559 #:test-target "junit-tests-all"
12560 #:make-flags (list "-DDATE" "(no date for reproducibility)")
12561 #:phases
12562 (modify-phases %standard-phases
12563 (add-before 'check 'fix-test
12564 (lambda _
12565 (substitute* "tests/junitTests/src/bsh/Issue_55_Test.java"
12566 ((" BshScriptEngineFactory") " bsh.engine.BshScriptEngineFactory"))))
12567 (replace 'install
12568 (install-from-pom "pom.xml")))))
12569 (inputs
12570 (list java-classpathx-servletapi java-commons-bsf))
12571 (native-inputs
12572 (list java-junit javacc-3))
12573 (home-page "http://beanshell.org/")
12574 (synopsis "Lightweight Scripting for Java")
12575 (description "BeanShell is a small, free, embeddable Java source
12576interpreter with object scripting language features, written in Java.
12577BeanShell dynamically executes standard Java syntax and extends it with common
12578scripting conveniences such as loose types, commands, and method closures like
12579those in Perl and JavaScript.")
12580 (license license:asl2.0)))
12581
12582(define-public java-fest-util
12583 (package
12584 (name "java-fest-util")
12585 (version "1.2.5")
12586 (source (origin
12587 (method git-fetch)
12588 (uri (git-reference
12589 (url "https://github.com/alexruiz/fest-util/")
12590 (commit (string-append "fest-util-" version))))
12591 (file-name (git-file-name name version))
12592 (sha256
12593 (base32
12594 "02kgal7v85snyyvcsxvn4qphid455f4smh2wri1il8d9asw0djbz"))))
12595 (build-system ant-build-system)
12596 (arguments
12597 `(#:jar-name "java-fest-util.jar"
12598 #:source-dir "src/main/java"))
12599 (native-inputs
12600 `(("junit" ,java-junit)
12601 ("hamcrest" ,java-hamcrest-core)))
12602 (home-page "https://github.com/alexruiz/fest-util")
12603 (synopsis "FEST common utilities")
12604 (description "Common utilities used in all FEST module.")
12605 (license license:asl2.0)))
12606
12607(define-public java-fest-test
12608 (package
12609 (name "java-fest-test")
12610 (version "2.1.0")
12611 (source (origin
12612 (method git-fetch)
12613 (uri (git-reference
12614 (url "https://github.com/alexruiz/fest-test/")
12615 (commit (string-append "fest-test-" version))))
12616 (file-name (git-file-name name version))
12617 (sha256
12618 (base32
12619 "0mg1d2jfh7kbx2c40dchbjr6d8pv59snsyb13mfxsr7xk5n69qbn"))))
12620 (build-system ant-build-system)
12621 (arguments
12622 `(#:jar-name "java-fest-test.jar"
12623 #:source-dir "src/main/java"
12624 #:tests? #f)); no tests
12625 (inputs
12626 `(("junit" ,java-junit)))
12627 (home-page "https://github.com/alexruiz/fest-test")
12628 (synopsis "Common FEST testing infrastructure")
12629 (description "Fest-test contains the common FEST testing infrastructure.")
12630 (license license:asl2.0)))
12631
12632(define-public java-fest-assert
12633 (package
12634 (name "java-fest-assert")
12635 (version "2.0M10")
12636 (source (origin
12637 (method git-fetch)
12638 (uri (git-reference
12639 (url "https://github.com/alexruiz/fest-assert-2.x/")
12640 (commit (string-append "fest-assert-core-" version))))
12641 (file-name (git-file-name name version))
12642 (sha256
12643 (base32
12644 "1cp8zzyag3s85fz2w68sda9zzaal1y5f9wl8g72wkm12an40w6by"))))
12645 (build-system ant-build-system)
12646 (arguments
12647 `(#:jar-name "java-fest-assert.jar"
12648 #:source-dir "src/main/java"
12649 #:test-exclude
12650 (list
12651 "**/Abstract*.java"
12652 "**/*BaseTest.java"
12653 ;; Unable to set MockitoNamingPolicy on cglib generator which creates FastClasses
12654 "**/MessageFormatter_format_Test.java"
12655 "**/internal/*/*_assert*_Test.java")))
12656 (inputs
12657 (list java-fest-util))
12658 (native-inputs
12659 (list java-junit
12660 java-fest-test
12661 java-hamcrest-core
12662 java-mockito-1
12663 java-cglib
12664 java-objenesis))
12665 (home-page "https://github.com/alexruiz/fest-assert-2.x")
12666 (synopsis "FEST fluent assertions")
12667 (description "FEST-Assert provides a fluent interface for assertions.")
12668 (license license:asl2.0)))
12669
12670(define-public java-testng
12671 (package
12672 (name "java-testng")
12673 (version "6.14.3")
12674 (source (origin
12675 (method git-fetch)
12676 (uri (git-reference
12677 (url "https://github.com/cbeust/testng")
12678 (commit version)))
12679 (file-name (string-append name "-" version "-checkout"))
12680 (sha256
12681 (base32
12682 "0y6vq30i5g276kw0v2bhbvci22ijg7ax49ap2611yqlhbs4d6dqv"))))
12683 (build-system ant-build-system)
12684 (arguments
12685 (list
12686 #:jdk icedtea-8; java.util.function
12687 #:jar-name "java-testng.jar"
12688 #:source-dir "src/main/java"
12689 #:phases
12690 '(modify-phases %standard-phases
12691 (add-after 'unpack 'delete-failing-tests
12692 (lambda _
12693 ;; FIXME: I don't know why these tests fail
12694 (substitute* "src/test/resources/testng.xml"
12695 ;; expected:<[0]> but was:<[3]>
12696 (("<class name=\"test.configuration.github1625.TestRunnerIssue1625\"/>") "")
12697 ;; expected [3] but found [2]
12698 (("<class name=\"test.serviceloader.ServiceLoaderTest\" />") "")
12699 ;; This is a parallel test and we've observed that it fails
12700 ;; sometimes.
12701 (("<class name=\"test.dataprovider.DataProviderTest\"/>") "")
12702 ;; Another flaky parallel test: testParallelMode() fails
12703 ;; intermittently on assertions about which before/after
12704 ;; groups methods were run. This also drops
12705 ;; testInSequentialMode().
12706 (("<class name=\"test.beforegroups.BeforeGroupsTest\"/>") ""))))
12707 ;; We don't have groovy
12708 (add-after 'unpack 'delete-groovy-tests
12709 (lambda _
12710 (delete-file-recursively "src/test/java/test/dependent/issue1648/")
12711 (substitute* "src/test/resources/testng.xml"
12712 (("<class name=\"test.dependent.issue1648.TestRunner\"/>") ""))))
12713 (add-before 'build 'copy-resources
12714 (lambda _
12715 (copy-recursively "src/main/resources" "build/classes")))
12716 (add-before 'check 'copy-test-resources
12717 (lambda _
12718 (copy-recursively "src/test/resources" "build/test-classes")))
12719 (replace 'check
12720 (lambda _
12721 (invoke "ant" "compile-tests")
12722 ;; we don't have groovy
12723 (substitute* "src/test/resources/testng.xml"
12724 (("<class name=\"test.groovy.GroovyTest\" />") ""))
12725 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
12726 ":build/classes"
12727 ":build/test-classes")
12728 "-Dtest.resources.dir=src/test/resources"
12729 "org.testng.TestNG" "src/test/resources/testng.xml"))))))
12730 (propagated-inputs
12731 (list java-junit
12732 java-jsr305
12733 java-bsh
12734 java-jcommander
12735 java-guice
12736 java-snakeyaml))
12737 (native-inputs
12738 (list java-guava
12739 java-javax-inject
12740 java-hamcrest-all
12741 java-assertj
12742 java-mockito-1
12743 java-cglib
12744 java-aopalliance))
12745 (home-page "https://testng.org")
12746 (synopsis "Testing framework")
12747 (description "TestNG is a testing framework inspired from JUnit and NUnit
12748but introducing some new functionalities that make it more powerful and easier
12749to use.")
12750 (license license:asl2.0)))
12751
12752(define-public java-jnacl
12753 (let ((commit "094e819afdd63ea81a499b3bcb42a271006bebd9")
12754 (revision "2"))
12755 (package
12756 (name "java-jnacl")
12757 (version (string-append "0.1.0-" revision "." (string-take commit 7)))
12758 (source (origin
12759 (method git-fetch)
12760 (uri (git-reference
12761 (url "https://github.com/neilalexander/jnacl")
12762 (commit commit)))
12763 (file-name (git-file-name name version))
12764 (sha256
12765 (base32
12766 "1d6g6xhn83byv5943n7935wwjsk0ibk0qdvqgr699qqgqqmwisbb"))))
12767 (build-system ant-build-system)
12768 (arguments
12769 `(#:jar-name "jnacl.jar"
12770 #:source-dir "src/main/java"
12771 #:jdk ,icedtea-8
12772 #:phases
12773 (modify-phases %standard-phases
12774 (add-before 'build 'fix-tests
12775 (lambda _
12776 (substitute* '("src/test/java/com/neilalexander/jnacl/NaClTest.java"
12777 "src/test/java/com/neilalexander/jnacl/NaclSecretBoxTest.java")
12778 (("assertions.Assertions") "assertions.api.Assertions"))
12779 #t))
12780 (replace 'check
12781 (lambda _
12782 (invoke "ant" "compile-tests")
12783 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
12784 ":build/classes"
12785 ":build/test-classes")
12786 "org.testng.TestNG" "-testclass"
12787 "build/test-classes/com/neilalexander/jnacl/NaclSecretBoxTest.class")
12788 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
12789 ":build/classes"
12790 ":build/test-classes")
12791 "org.testng.TestNG" "-testclass"
12792 "build/test-classes/com/neilalexander/jnacl/NaClTest.class"))))))
12793 (native-inputs
12794 (list java-testng java-fest-util java-fest-assert))
12795 (home-page "https://github.com/neilalexander/jnacl")
12796 (synopsis "Java implementation of NaCl")
12797 (description "Pure Java implementation of the NaCl: Networking and
12798Cryptography library.")
12799 (license license:bsd-2))))
12800
12801(define-public java-mvel2
12802 (package
12803 (name "java-mvel2")
12804 (version "2.3.1")
12805 (source (origin
12806 (method url-fetch)
12807 (uri (string-append "https://github.com/mvel/mvel/archive/mvel2-"
12808 version ".Final.tar.gz"))
12809 (sha256
12810 (base32
12811 "01ph5s9gm16l2qz58lg21w6fna7xmmrj7f9bzqr1jim7h9557d3z"))))
12812 (build-system ant-build-system)
12813 (arguments
12814 `(#:jar-name "mvel2.jar"
12815 #:source-dir "src/main/java"
12816 #:test-exclude
12817 (list "**/Abstract*.java"
12818 ;; Base class with no tests
12819 "**/MVELThreadTest.java")
12820 #:phases
12821 (modify-phases %standard-phases
12822 (add-after 'install 'install-bin
12823 (lambda* (#:key outputs #:allow-other-keys)
12824 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
12825 (mkdir-p bin)
12826 (with-output-to-file (string-append bin "/mvel2")
12827 (lambda _
12828 (display
12829 (string-append
12830 "#!" (which "bash") "\n"
12831 "if [ \"$#\" -ne \"2\" ]; then\n"
12832 "echo 'Usage: mvel2 <script> <out.dir>'\n"
12833 "exit\n"
12834 "fi\n"
12835 "java -Dout.dir=$2 -cp " (getenv "CLASSPATH")
12836 ":" (assoc-ref outputs "out") "/share/java/mvel2.jar"
12837 " org.mvel2.sh.Main $1"))))
12838 (chmod (string-append bin "/mvel2") #o755))
12839 #t)))))
12840 (native-inputs
12841 `(("junit" ,java-junit)
12842 ("hamcrest" ,java-hamcrest-core)))
12843 (home-page "https://github.com/mvel/mvel")
12844 (synopsis "MVFLEX Expression Language")
12845 (description "MVEL has largely been inspired by Java syntax, but has some
12846fundamental differences aimed at making it more efficient as an expression
12847language, such as operators that directly support collection, array and string
12848matching, as well as regular expressions. MVEL is used to evaluate expressions
12849written using Java syntax.
12850
12851In addition to the expression language, MVEL serves as a templating language for
12852configuration and string construction.")
12853 (license license:asl2.0)))
12854
12855(define-public java-commons-jexl-2
12856 (package
12857 (name "java-commons-jexl")
12858 (version "2.1.1")
12859 (source (origin
12860 (method url-fetch)
12861 (uri (string-append "mirror://apache/commons/jexl/source/"
12862 "commons-jexl-" version "-src.tar.gz"))
12863 (sha256
12864 (base32
12865 "1ai7632bwwaxglb0nbpblpr2jw5g20afrsaq372ipkphi3ncy1jz"))))
12866 (build-system ant-build-system)
12867 (arguments
12868 `(#:jar-name "commons-jexl-2.jar"
12869 #:jdk ,icedtea-8
12870 #:source-dir "src/main/java"
12871 #:phases
12872 (modify-phases %standard-phases
12873 (add-before 'check 'disable-broken-tests
12874 (lambda* (#:key inputs #:allow-other-keys)
12875 (with-directory-excursion "src/test/java/org/apache/commons/jexl2/"
12876 (substitute* "ArithmeticTest.java"
12877 (("asserter.assertExpression\\(\"3 / 0\"") "//")
12878 (("asserter.assertExpression\\(\"imanull") "//"))
12879 ;; This test fails with "ambiguous method invocation"
12880 (delete-file "CacheTest.java")
12881 ;; This test doesn't have access to the temp directory
12882 (substitute* "ClassCreatorTest.java"
12883 (("java.io.tmpdir") "user.dir"))
12884 ;; This test fails in trying to detect whether it can run.
12885 (substitute* "ClassCreator.java"
12886 (("boolean canRun =.*") "boolean canRun = false;\n"))
12887 ;; ...and these tests depend on it.
12888 (delete-file "scripting/JexlScriptEngineOptionalTest.java")
12889 (delete-file "scripting/JexlScriptEngineTest.java"))
12890 #t))
12891 (add-before 'build 'run-javacc
12892 (lambda _
12893 (with-directory-excursion "src/main/java/org/apache/commons/jexl2/parser/"
12894 (invoke "java" "jjtree" "Parser.jjt")
12895 (invoke "java" "javacc" "Parser.jj"))
12896 #t)))))
12897 (inputs
12898 (list java-commons-logging-minimal))
12899 (native-inputs
12900 (list java-junit java-hamcrest-core javacc-4))
12901 (home-page "https://commons.apache.org/proper/commons-jexl/")
12902 (synopsis "Java Expression Language")
12903 (description "JEXL is a library intended to facilitate the implementation
12904of dynamic and scripting features in applications and frameworks written in
12905Java. JEXL implements an Expression Language based on some extensions to the
12906JSTL Expression Language supporting most of the constructs seen in
12907shell-script or ECMAScript. Its goal is to expose scripting features usable
12908by technical operatives or consultants working with enterprise platforms.")
12909 (license license:asl2.0)))
12910
12911(define-public java-lz4
12912 (package
12913 (name "java-lz4")
12914 (version "1.4.0")
12915 (source (origin
12916 (method git-fetch)
12917 (uri (git-reference
12918 (url "https://github.com/lz4/lz4-java")
12919 (commit version)))
12920 (file-name (git-file-name name version))
12921 (sha256
12922 (base32
12923 "0ydjakhv3cz34mfvv14qrh2ksdxifgjwwagjy7r46qr3f68hnf6y"))))
12924 (build-system ant-build-system)
12925 (arguments
12926 `(#:jar-name "lz4.jar"
12927 #:jdk ,icedtea-8
12928 #:source-dir "src/java:src/java-unsafe"
12929 #:tests? #f; FIXME: requires more dependencies
12930 #:phases
12931 (modify-phases %standard-phases
12932 (add-after 'unpack 'make-files-writable
12933 (lambda _
12934 (for-each make-file-writable (find-files "."))
12935 #t))
12936 (add-before 'configure 'generate-source
12937 (lambda _
12938 (with-directory-excursion "src/build/source_templates"
12939 (invoke "mvel2" "../gen_sources.mvel" "../../java"))
12940 #t)))))
12941 (native-inputs
12942 `(("mvel" ,java-mvel2)))
12943 (home-page "https://jpountz.github.io/lz4-java")
12944 (synopsis "Compression algorithm")
12945 (description "LZ4 - Java is a Java port of the popular lz4 compression
12946algorithms and xxHash hashing algorithm.")
12947 (license license:asl2.0)))
12948
12949(define-public java-bouncycastle
12950 (package
12951 (name "java-bouncycastle")
12952 (version "1.67")
12953 (source (origin
12954 (method git-fetch)
12955 (uri (git-reference
12956 (url "http://git.bouncycastle.org/repositories/bc-java")
12957 ;(url "https://github.com/bcgit/bc-java")
12958 (commit (string-append "r1rv" (substring version 2 4)))))
12959 (file-name (git-file-name name version))
12960 (sha256
12961 (base32
12962 "1449q7fyh03s1q0bqljcrhgacwcyqmg2bbvb3z084avgapwsainz"))
12963 (modules '((guix build utils)))
12964 (snippet
12965 '(begin
12966 (for-each delete-file
12967 (find-files "." "\\.jar$"))
12968 #t))))
12969 (build-system ant-build-system)
12970 (arguments
12971 `(#:jdk ,icedtea-8
12972 #:tests? #f
12973 #:phases
12974 (modify-phases %standard-phases
12975 (replace 'build
12976 (lambda _
12977 (invoke "ant" "-f" "ant/jdk15+.xml" "build-provider")
12978 (invoke "ant" "-f" "ant/jdk15+.xml" "build")))
12979 ;; FIXME: the tests freeze.
12980 ;; (replace 'check
12981 ;; (lambda _
12982 ;; (invoke "ant" "-f" "ant/jdk15+.xml" "test")))
12983 (replace 'install
12984 (install-jars "build/artifacts/jdk1.5/jars")))))
12985 (inputs
12986 (list java-javax-mail))
12987 (native-inputs
12988 `(("unzip" ,unzip)
12989 ("junit" ,java-junit)
12990 ("java-native-access" ,java-native-access)
12991 ("java-native-access-platform" ,java-native-access-platform)))
12992 (home-page "https://www.bouncycastle.org")
12993 (synopsis "Cryptographic library")
12994 (description "Bouncy Castle is a cryptographic library for the Java
12995programming language.")
12996 (license license:expat)))
12997
12998(define-public java-jakarta-activation-1.2
12999 (package
13000 (name "java-jakarta-activation")
13001 (version "1.2.2")
13002 (source (origin
13003 (method git-fetch)
13004 (uri (git-reference
13005 (url "https://github.com/jakartaee/jaf-api")
13006 (commit version)))
13007 (file-name (git-file-name name version))
13008 (sha256
13009 (base32
13010 "13kkr0kj9wp45vpfackcbyycilzs5r3sj33px5pny1k4hq09cyar"))))
13011 (build-system ant-build-system)
13012 (arguments
13013 `(#:tests? #f
13014 #:jar-name "jakarta.activation.jar"
13015 #:jdk ,openjdk9
13016 #:source-dir "activation/src/main/java"
13017 #:phases
13018 (modify-phases %standard-phases
13019 ;; Install under javax.activation:activation coordinates
13020 ;; so consumers like javax.mail can find it. The source
13021 ;; pom uses com.sun.activation:jakarta.activation but that's
13022 ;; the new coordinate; most existing poms reference the
13023 ;; old javax.activation:activation.
13024 (add-before 'install 'create-pom
13025 (generate-pom.xml "pom.xml" "javax.activation"
13026 "activation" ,version))
13027 (replace 'install
13028 (install-from-pom "pom.xml")))))
13029 (home-page "https://jakarta.ee/specifications/activation/")
13030 (synopsis "Jakarta Activation API (javax.activation)")
13031 (description "Jakarta Activation provides the @code{javax.activation}
13032package, which was removed from the JDK in Java 11. This is the 1.2.x
13033transitional release that still uses the @code{javax.activation} namespace.")
13034 (license license:edl1.0)))
13035
13036(define-public java-bouncycastle-1.77
13037 (package
13038 (inherit java-bouncycastle)
13039 (version "1.77")
13040 (source (origin
13041 (method git-fetch)
13042 (uri (git-reference
13043 (url "https://github.com/bcgit/bc-java")
13044 (commit (string-append "r1rv" (substring version 2 4)))))
13045 (file-name (git-file-name "java-bouncycastle" version))
13046 (sha256
13047 (base32
13048 "1adxic0pgb7gv2yflw72np7zilj6rrhgjcj3xvnmidwp2pc887k1"))
13049 (modules '((guix build utils)))
13050 (snippet
13051 '(begin
13052 (for-each delete-file
13053 (find-files "." "\\.jar$"))
13054 #t))))
13055 (arguments
13056 `(#:jdk ,openjdk17
13057 #:tests? #f
13058 #:phases
13059 (modify-phases %standard-phases
13060 (replace 'build
13061 (lambda _
13062 (let ((suffix (string-append
13063 "-Drelease.suffix="
13064 ,(string-join (string-split version #\.) ""))))
13065 (mkdir-p "ant/docs")
13066 ;; Build individual targets. Can't use the 'build'
13067 ;; target because it includes 'build-test' which needs
13068 ;; the UnboundID LDAP SDK.
13069 (invoke "ant" "-f" "ant/jdk18+.xml" suffix
13070 "build-provider")
13071 ;; The remaining targets are only in bc+-build.xml.
13072 ;; Call it via ant's -f but pass properties that
13073 ;; jdk18+.xml normally sets.
13074 (let ((props (list suffix
13075 "-Dtarget.prefix=jdk18on"
13076 "-Djdk.name=jdk1.8"
13077 "-Dbc.javac.source=1.8"
13078 "-Dbc.javac.target=1.8"
13079 "-Dbuild.dir=build"
13080 "-Djavadoc.args=-breakiterator"
13081 (string-append "-Dsrc.dir="
13082 (getcwd) "/build/jdk1.8")
13083 (string-append "-Dartifacts.dir="
13084 (getcwd) "/build/artifacts/jdk1.8"))))
13085 (for-each
13086 (lambda (target)
13087 (apply invoke "ant" "-f" "ant/bc+-build.xml"
13088 (append props (list target))))
13089 '("build-util" "build-pkix" "build-pg" "build-mail"))))))
13090 (add-after 'build 'add-osgi-manifests
13091 (lambda _
13092 ;; The Maven Central jars have OSGi manifest attributes
13093 ;; from maven-bundle-plugin. Add them since we build
13094 ;; with ant.
13095 (for-each
13096 (lambda (name)
13097 (let ((jar (car (find-files "build/artifacts"
13098 (string-append name "-jdk18on.*\\.jar$")))))
13099 (call-with-output-file "osgi-manifest.mf"
13100 (lambda (port)
13101 (display (string-append
13102 "Bundle-ManifestVersion: 2\n"
13103 "Bundle-SymbolicName: " name "\n"
13104 "Bundle-Version: " ,version "\n")
13105 port)))
13106 (invoke "jar" "ufm" jar "osgi-manifest.mf")))
13107 '("bcprov" "bcutil" "bcpkix" "bcpg"))))
13108 (add-after 'add-osgi-manifests 'rename-jars
13109 (lambda _
13110 ;; Ant produces e.g. bcprov-jdk18on-177.jar but
13111 ;; install-from-pom expects bcprov-jdk18on-1.77.jar.
13112 (for-each
13113 (lambda (name)
13114 (let ((src (car (find-files "build/artifacts"
13115 (string-append name "-jdk18on-.*\\.jar$"))))
13116 (dest (string-append "build/artifacts/jdk1.8/jars/"
13117 name "-jdk18on-" ,version ".jar")))
13118 (unless (string=? src dest)
13119 (rename-file src dest))))
13120 '("bcprov" "bcutil" "bcpkix" "bcpg"))))
13121 (replace 'install
13122 (lambda* (#:key inputs outputs jar-name #:allow-other-keys)
13123 (for-each
13124 (lambda (name)
13125 (let ((pom-file (string-append name "-pom.xml"))
13126 (artifact (string-append name "-jdk18on")))
13127 ((generate-pom.xml pom-file "org.bouncycastle"
13128 artifact ,version))
13129 ((install-from-pom pom-file)
13130 #:inputs inputs #:outputs outputs
13131 #:jar-name (string-append artifact "-" ,version "\\.jar$"))))
13132 '("bcprov" "bcutil" "bcpkix" "bcpg")))))))
13133 (inputs
13134 (list java-jakarta-activation-1.2
13135 java-javax-mail))
13136 (description "Bouncy Castle is a cryptographic library for the Java
13137programming language. This is version 1.77 which has breaking API changes
13138compared to 1.67 (removed classes in ASN1, CMC, and other packages).")))
13139
13140(define-public java-eclipse-jdt-annotation-2
13141 (package
13142 (name "java-eclipse-jdt-annotation")
13143 (version "2.2.600")
13144 (source (origin
13145 (method url-fetch)
13146 (uri (string-append "https://repo1.maven.org/maven2/"
13147 "org/eclipse/jdt/org.eclipse.jdt.annotation/"
13148 version "/org.eclipse.jdt.annotation-"
13149 version "-sources.jar"))
13150 (sha256
13151 (base32
13152 "1jlq14ivhj32i7glfdmk068ya1spm4wfa9h8h2p326y0fkkzwyp9"))))
13153 (build-system ant-build-system)
13154 (arguments
13155 `(#:tests? #f
13156 #:jar-name "org.eclipse.jdt.annotation.jar"
13157 #:source-dir "."
13158 #:phases
13159 (modify-phases %standard-phases
13160 (add-before 'install 'create-pom
13161 (generate-pom.xml "pom.xml" "org.eclipse.jdt"
13162 "org.eclipse.jdt.annotation" ,version))
13163 (replace 'install (install-from-pom "pom.xml")))))
13164 (native-inputs (list unzip))
13165 (home-page "https://www.eclipse.org/jdt/")
13166 (synopsis "Eclipse JDT null analysis annotations")
13167 (description "This package provides the @code{@@NonNull}, @code{@@Nullable},
13168and @code{@@NonNullByDefault} annotations used by Eclipse JDT for null
13169analysis.")
13170 (license license:epl2.0)))
13171
13172(define-public java-kohlschutter-compiler-annotations-1
13173 (package
13174 (name "java-kohlschutter-compiler-annotations")
13175 (version "1.4.2")
13176 (source (origin
13177 (method url-fetch)
13178 (uri (string-append "https://repo1.maven.org/maven2/"
13179 "com/kohlschutter/compiler-annotations/"
13180 version "/compiler-annotations-"
13181 version "-sources.jar"))
13182 (sha256
13183 (base32
13184 "0fzmhr9binv1ah410955m95w6lwwidy9sw06yy5cjcrcjx7v0455"))))
13185 (build-system ant-build-system)
13186 (arguments
13187 `(#:tests? #f
13188 #:jar-name "compiler-annotations.jar"
13189 #:jdk ,openjdk9
13190 #:source-dir "."
13191 #:phases
13192 (modify-phases %standard-phases
13193 (add-before 'install 'create-pom
13194 (generate-pom.xml "pom.xml" "com.kohlschutter"
13195 "compiler-annotations" ,version))
13196 (replace 'install (install-from-pom "pom.xml")))))
13197 (inputs (list java-eclipse-jdt-annotation-2))
13198 (native-inputs (list unzip))
13199 (home-page "https://github.com/kohlschutter/compiler-annotations")
13200 (synopsis "Compile-time annotations for Java")
13201 (description "This package provides compile-time annotations such as
13202@code{@@SuppressFBWarnings} and @code{@@ExcludeFromCodeCoverageGeneratedReport}.")
13203 (license license:asl2.0)))
13204
13205(define junixsocket-source
13206 (origin
13207 (method git-fetch)
13208 (uri (git-reference
13209 (url "https://github.com/kohlschutter/junixsocket")
13210 (commit "junixsocket-parent-2.5.1")))
13211 (file-name (git-file-name "java-junixsocket" "2.5.1"))
13212 (sha256
13213 (base32
13214 "1zc84qbl2zsi9ch6b12crbiqlrkbrlw1z09kqlj04zrmck4k4pzn"))))
13215
13216(define-public java-junixsocket-common-2
13217 (package
13218 (name "java-junixsocket-common")
13219 (version "2.5.1")
13220 (source junixsocket-source)
13221 (build-system ant-build-system)
13222 (arguments
13223 `(#:jar-name "junixsocket-common.jar"
13224 #:source-dir "junixsocket-common/src/main/java"
13225 #:jdk ,openjdk9
13226 #:tests? #f
13227 #:phases
13228 (modify-phases %standard-phases
13229 (add-after 'unpack 'delete-module-info
13230 (lambda _
13231 ;; module-info.java requires modules not available in
13232 ;; our build (com.kohlschutter.annotations.compiletime,
13233 ;; org.eclipse.jdt.annotation). The classes compile
13234 ;; and work without JPMS metadata.
13235 (delete-file
13236 "junixsocket-common/src/main/java/module-info.java")))
13237 (replace 'install
13238 (install-from-pom "junixsocket-common/pom.xml")))))
13239 (inputs (list java-eclipse-jdt-annotation-2
13240 java-kohlschutter-compiler-annotations-1))
13241 (home-page "https://github.com/kohlschutter/junixsocket")
13242 (synopsis "Java library for Unix domain sockets")
13243 (description "junixsocket is a Java library for Unix domain sockets
13244(AF_UNIX) and other address/protocol families, providing a Java Socket API
13245compatible interface.")
13246 (license license:asl2.0)))
13247
13248(define-public java-junixsocket-native-common-2.5.1
13249 (package
13250 (name "java-junixsocket-native-common")
13251 (version "2.5.1")
13252 (source junixsocket-source)
13253 (build-system ant-build-system)
13254 (arguments
13255 (list
13256 #:tests? #f
13257 #:jdk openjdk9
13258 #:jar-name "junixsocket-native-common.jar"
13259 #:source-dir "junixsocket-native-common/src/main/java"
13260 #:phases
13261 #~(modify-phases %standard-phases
13262 (add-before 'build 'set-module-path
13263 (lambda* (#:key inputs #:allow-other-keys)
13264 ;; javac needs compiler-annotations on the module path
13265 ;; (not classpath) for JPMS 'requires static' resolution.
13266 (let ((mod-dir (assoc-ref inputs
13267 "java-kohlschutter-compiler-annotations")))
13268 (setenv "JDK_JAVAC_OPTIONS"
13269 (string-append "--module-path="
13270 (car (find-files mod-dir "\\.jar$")))))))
13271 (add-before 'build 'build-native
13272 (lambda* (#:key inputs #:allow-other-keys)
13273 (let ((jdk (assoc-ref inputs "jdk"))
13274 (c-dir "junixsocket-native/src/main/c"))
13275 ;; Fix GCC incompatibility: _Pragma inside expressions
13276 ;; is a Clang extension, not supported by GCC.
13277 (substitute* (string-append c-dir "/ckmacros.h")
13278 (("# define CK_IGNORE_CAST_BEGIN \\\\")
13279 "# define CK_IGNORE_CAST_BEGIN")
13280 (("# define CK_IGNORE_CAST_END \\\\")
13281 "# define CK_IGNORE_CAST_END")
13282 (("_Pragma\\(\"GCC diagnostic.*cast.*\"\\)") "")
13283 (("_Pragma\\(\"GCC diagnostic push\"\\)") "")
13284 (("_Pragma\\(\"GCC diagnostic pop\"\\)") ""))
13285 (let ((so-file (string-append
13286 "junixsocket-native-common/src/main/"
13287 "resources/lib/amd64-Linux-clang/jni/"
13288 "libjunixsocket-native-" #$version ".so")))
13289 (mkdir-p (dirname so-file))
13290 (apply invoke "gcc" "-shared" "-fPIC" "-O2"
13291 "-Wno-int-to-pointer-cast"
13292 "-Wno-pointer-to-int-cast"
13293 "-Wno-bad-function-cast"
13294 "-Wno-cast-function-type"
13295 "-Wno-stringop-overflow"
13296 (string-append "-I" c-dir)
13297 (string-append "-I" c-dir "/jni")
13298 (string-append "-I" jdk "/include")
13299 (string-append "-I" jdk "/include/linux")
13300 "-o" so-file
13301 (find-files c-dir "\\.c$"))))))
13302 (add-after 'build 'add-native-to-jar
13303 (lambda _
13304 (invoke "jar" "uf"
13305 "build/jar/junixsocket-native-common.jar"
13306 "-C" "junixsocket-native-common/src/main/resources"
13307 "lib")))
13308 ;; The source pom.xml lists pre-built native library
13309 ;; NARs for every platform. We build the native code
13310 ;; from source, so none of those dependencies apply.
13311 (add-before 'install 'create-pom
13312 (generate-pom.xml "pom.xml"
13313 "com.kohlschutter.junixsocket"
13314 "junixsocket-native-common" #$version))
13315 (replace 'install
13316 (install-from-pom "pom.xml")))))
13317 (native-inputs (list java-kohlschutter-compiler-annotations-1))
13318 (home-page "https://github.com/kohlschutter/junixsocket")
13319 (synopsis "Native JNI library for junixsocket")
13320 (description "This package provides the native JNI library for
13321junixsocket, built from source for Linux.")
13322 (license license:asl2.0)))
13323
13324(define-public java-lmax-disruptor
13325 (package
13326 (name "java-lmax-disruptor")
13327 (version "3.4.4")
13328 (source (origin
13329 (method git-fetch)
13330 (uri (git-reference
13331 (url "https://github.com/LMAX-Exchange/disruptor")
13332 (commit version)))
13333 (file-name (git-file-name name version))
13334 (sha256
13335 (base32
13336 "02c5kp3n8a73dq9ay7ar53s1k3x61z9yzc5ikqb03m6snr1wpfqn"))))
13337 (build-system ant-build-system)
13338 (arguments
13339 `(#:jar-name "java-lmax-disruptor.jar"
13340 #:jdk ,icedtea-8
13341 #:tests? #f)); tests hang
13342 (inputs
13343 `(("junit" ,java-junit)
13344 ("java-hdrhistogram" ,java-hdrhistogram)
13345 ("java-jmock" ,java-jmock)
13346 ("java-jmock-legacy" ,java-jmock-legacy)
13347 ("java-jmock-junit4" ,java-jmock-junit4)
13348 ("java-hamcrest-all" ,java-hamcrest-all)))
13349 (native-inputs
13350 `(("cglib" ,java-cglib)
13351 ("objenesis" ,java-objenesis)))
13352 (home-page "https://www.lmax.com/disruptor")
13353 (synopsis "High performance inter-thread communication")
13354 (description "LMAX Disruptor is a software pattern and software component
13355for high performance inter-thread communication that avoids the need for
13356message queues or resource locking.")
13357 (license license:asl2.0)))
13358
13359(define-public java-conversant-disruptor
13360 (package
13361 (name "java-conversant-disruptor")
13362 (version "1.2.19")
13363 (source (origin
13364 (method git-fetch)
13365 (uri (git-reference
13366 (url "https://github.com/conversant/disruptor")
13367 (commit version)))
13368 (file-name (git-file-name name version))
13369 (sha256
13370 (base32
13371 "0gx1dm7sfg7pa05cs4qby10gfcplai5b5lf1f7ik1a76dh3vhl0g"))))
13372 (build-system ant-build-system)
13373 (arguments
13374 `(#:jar-name "java-conversant-disruptor.jar"
13375 #:source-dir "src/main/java"
13376 #:phases
13377 (modify-phases %standard-phases
13378 (add-before 'build 'copy-resources
13379 (lambda _
13380 (copy-recursively "src/main/resources" "build/classes")))
13381 (add-before 'build 'remove-module
13382 (lambda _
13383 (delete-file "src/main/java/module-info.java"))))))
13384 (native-inputs
13385 (list java-junit))
13386 (home-page "https://github.com/conversant/disruptor")
13387 (synopsis "High performance intra-thread communication")
13388 (description "Conversant Disruptor is the highest performing intra-thread
13389transfer mechanism available in Java. Conversant Disruptor is an implementation
13390of this type of ring buffer that has almost no overhead and that exploits a
13391particularly simple design.")
13392 (license license:asl2.0)))
13393
13394(define-public java-jctools-core-1
13395 (package
13396 (name "java-jctools-core")
13397 (version "1.2.1")
13398 (source (origin
13399 (method git-fetch)
13400 (uri (git-reference
13401 (url "https://github.com/JCTools/JCTools")
13402 (commit (string-append "v" version))))
13403 (file-name (git-file-name name version))
13404 (sha256
13405 (base32
13406 "105my29nwd4djvdllmq8s3jdzbyplbkxzwmddxiiilb4yqr1pghb"))))
13407 (build-system ant-build-system)
13408 (arguments
13409 `(#:jar-name "java-jctools-core.jar"
13410 #:source-dir "jctools-core/src/main/java"
13411 #:test-dir "jctools-core/src/test"
13412 ;; The tests timeout on some architectures.
13413 #:tests? ,(not (or (target-aarch64?)
13414 (%current-target-system)))))
13415 (native-inputs
13416 (list java-junit java-hamcrest-all))
13417 (home-page "https://github.com/JCTools/JCTools")
13418 (synopsis "Concurrency tools for Java")
13419 (description "This library implements concurrent data structures that are
13420not natively available in Java.")
13421 (license license:asl2.0)))
13422
13423(define-public java-commons-bcel
13424 (package
13425 (name "java-commons-bcel")
13426 (version "6.1")
13427 (source (origin
13428 (method url-fetch)
13429 (uri (string-append "mirror://apache/commons/bcel/source/bcel-"
13430 version "-src.tar.gz"))
13431 (sha256
13432 (base32
13433 "0j3x1rxd673k07psclk8k13rqh0x0mf2yy5qiwkiw4z3afa568jy"))))
13434 (build-system ant-build-system)
13435 (arguments
13436 `(#:jar-name "bcel.jar"
13437 #:jdk ,icedtea-8
13438 #:source-dir "src/main/java"
13439 #:test-dir "src/test/java"
13440 ;; FIXME: Tests require the unpackaged jna.
13441 #:tests? #f))
13442 (home-page "https://commons.apache.org/proper/commons-bcel/")
13443 (synopsis "Byte code engineering library")
13444 (description "The Byte Code Engineering Library (Apache Commons BCEL) is
13445intended to give users a convenient way to analyze, create, and
13446manipulate (binary) Java class files. Classes are represented by objects
13447which contain all the symbolic information of the given class: methods, fields
13448and byte code instructions, in particular.
13449
13450Such objects can be read from an existing file, be transformed by a
13451program (e.g. a class loader at run-time) and written to a file again. An
13452even more interesting application is the creation of classes from scratch at
13453run-time. The @dfn{Byte Code Engineering Library} (BCEL) may be also useful
13454if you want to learn about the @dfn{Java Virtual Machine} (JVM) and the format
13455of Java @code{.class} files.")
13456 (properties '((upstream-name . "bcel")))
13457 (license license:asl2.0)))
13458
13459(define-public java-xerial-core
13460 (package
13461 (name "java-xerial-core")
13462 (version "2.1")
13463 (source (origin
13464 (method url-fetch)
13465 (uri (string-append "https://github.com/xerial/xerial-java/archive/"
13466 version ".tar.gz"))
13467 (file-name (string-append name "-" version ".tar.gz"))
13468 (sha256
13469 (base32
13470 "0d3g863i41bgalpa4xr3vm1h140l091n8iwgq5qvby5yivns9y8d"))))
13471 (build-system ant-build-system)
13472 (arguments
13473 `(#:jar-name "xerial-core.jar"
13474 #:source-dir "xerial-core/src/main/java"
13475 #:test-dir "xerial-core/src/test"
13476 #:phases
13477 (modify-phases %standard-phases
13478 (add-before 'build 'copy-resources
13479 (lambda _
13480 (copy-recursively "xerial-core/src/main/resources"
13481 "build/classes")
13482 #t)))))
13483 (native-inputs
13484 `(("junit" ,java-junit)
13485 ("hamcrest" ,java-hamcrest-core)))
13486 (home-page "https://github.com/xerial/xerial-java")
13487 (synopsis "Data management libraries for Java")
13488 (description "Xerial is a set of data management libraries for the Java
13489programming language. The ultimate goal of the Xerial project is to manage
13490everything as database, including class objects, text format data, data
13491streams, etc.")
13492 (license license:asl2.0)))
13493
13494(define-public java-asm-jdk-bridge
13495 (package
13496 (name "java-asm-jdk-bridge")
13497 (version "0.0.13")
13498 (source (origin
13499 (method git-fetch)
13500 (uri (git-reference
13501 (url "https://github.com/raphw/asm-jdk-bridge")
13502 (commit (string-append "asm-jdk-bridge-parent-" version))))
13503 (file-name (git-file-name name version))
13504 (sha256
13505 (base32
13506 "1f9x94drnjdr1k6wr49g9vn0prx5s5a4qfx91rx19w136cmx92yc"))))
13507 (build-system ant-build-system)
13508 (arguments
13509 (list #:jar-name "asm-jdk-bridge.jar"
13510 #:tests? #f ; tests require JUnit 5
13511 #:source-dir "asm-jdk-bridge/src/main/java"))
13512 (inputs (list java-asm-9.10))
13513 (home-page "https://github.com/raphw/asm-jdk-bridge")
13514 (synopsis "Bridge between the ASM API and the OpenJDK Class File API")
13515 (description
13516 "This package implements adapters to translate between ASM visitors and
13517the OpenJDK Class File API. It allows plugging the OpenJDK reader and writer
13518into existing ASM-based code with little change: an instance of ASM's
13519@code{ClassReader} or @code{ClassWriter} can be replaced with
13520@code{JdkClassReader} or @code{JdkClassWriter}, which use the Class File API
13521internally while exposing APIs equal to ASM.")
13522 (license license:asl2.0)))
13523
13524(define-public java-byte-buddy-dep
13525 (package
13526 (name "java-byte-buddy-dep")
13527 (version "1.18.14")
13528 (source (origin
13529 (method git-fetch)
13530 (uri (git-reference
13531 (url "https://github.com/raphw/byte-buddy")
13532 (commit (string-append "byte-buddy-" version))))
13533 (file-name (git-file-name name version))
13534 (sha256
13535 (base32
13536 "0s4dj0vdpz9dzm4kk89bkzbywy2c7dkf5bapk4f39yc0c31qcqrr"))))
13537 (build-system ant-build-system)
13538 (arguments
13539 (list #:jar-name "byte-buddy-dep.jar"
13540 #:tests? #f ; tests are incompatible with current jdk
13541 #:source-dir "byte-buddy-dep/src/main/java"
13542 #:test-dir "byte-buddy-dep/src/test"))
13543 (propagated-inputs
13544 (list java-asm-9.10
13545 java-asm-commons-9.10
13546 java-asm-jdk-bridge
13547 java-native-access))
13548 (native-inputs
13549 (list java-findbugs-annotations))
13550 (home-page "http://bytebuddy.net/")
13551 (synopsis "Runtime code generation for the Java virtual machine")
13552 (description "Byte Buddy is a code generation and manipulation library for
13553creating and modifying Java classes during the runtime of a Java application
13554and without the help of a compiler.")
13555 (license license:asl2.0)))
13556
13557(define-public java-byte-buddy-agent
13558 (package
13559 (inherit java-byte-buddy-dep)
13560 (name "java-byte-buddy-agent")
13561 (arguments
13562 (list #:jar-name "byte-buddy-agent.jar"
13563 #:tests? #f; tests require attaching to a running JVM
13564 #:source-dir "byte-buddy-agent/src/main/java"
13565 #:test-dir "byte-buddy-agent/src/test"))
13566 (propagated-inputs
13567 (list java-native-access
13568 java-native-access-platform))
13569 (native-inputs
13570 (list java-findbugs-annotations))
13571 (synopsis "Attach Byte Buddy agents to a running Java virtual machine")
13572 (description "The Byte Buddy agent allows the attachment of a Java agent to
13573the current or to a remote Java virtual machine. It enables Byte Buddy to
13574redefine and retransform classes that are already loaded, making it possible to
13575manipulate the bytecode of a running application.")))
13576
13577(define-public java-powermock-reflect
13578 (package
13579 (name "java-powermock-reflect")
13580 (version "2.0.9")
13581 (source (origin
13582 (method git-fetch)
13583 (uri (git-reference
13584 (url "https://github.com/powermock/powermock")
13585 (commit (string-append "powermock-" version))))
13586 (file-name (git-file-name name version))
13587 (sha256
13588 (base32
13589 "03y8szi9iwxnv431z2mn2ivc1ak30vcvfvkyrwmfq7wq93bj2c5v"))
13590 (patches
13591 (search-patches "java-powermock-fix-java-files.patch"))))
13592 (build-system ant-build-system)
13593 (arguments
13594 `(#:jar-name "java-powermock-reflect.jar"
13595 #:source-dir "powermock-reflect/src/main/java"
13596 #:test-dir "powermock-reflect/src/test"))
13597 (inputs
13598 (list java-asm-9 java-objenesis))
13599 (native-inputs
13600 (list java-assertj java-cglib java-hamcrest-core java-junit))
13601 (home-page "https://github.com/powermock/powermock")
13602 (synopsis "Mock library extension framework")
13603 (description "PowerMock is a framework that extends other mock libraries
13604such as EasyMock with more powerful capabilities. PowerMock uses a custom
13605classloader and bytecode manipulation to enable mocking of static methods,
13606constructors, final classes and methods, private methods, removal of static
13607initializers and more. By using a custom classloader no changes need to be
13608done to the IDE or continuous integration servers which simplifies adoption.")
13609 (license license:asl2.0)))
13610
13611(define-public java-powermock-core
13612 (package
13613 (inherit java-powermock-reflect)
13614 (name "java-powermock-core")
13615 (arguments
13616 `(#:jar-name "java-powermock-core.jar"
13617 #:source-dir "powermock-core/src/main/java"
13618 #:test-dir "powermock-core/src/test"
13619 #:tests? #f; requires powermock-api
13620 #:jdk ,icedtea-8
13621 #:phases
13622 (modify-phases %standard-phases
13623 (add-before 'build 'copy-resources
13624 (lambda _
13625 (copy-recursively "powermock-core/src/main/resources"
13626 "build/classes")
13627 #t)))))
13628 (inputs
13629 (list java-asm-9
13630 java-byte-buddy-dep
13631 java-jboss-javassist
13632 java-powermock-reflect))
13633 (native-inputs
13634 (list java-assertj java-mockito-1 java-junit))))
13635
13636(define-public java-powermock-api-support
13637 (package
13638 (inherit java-powermock-reflect)
13639 (name "java-powermock-api-support")
13640 (build-system ant-build-system)
13641 (arguments
13642 `(#:jar-name "java-powermock-api-support.jar"
13643 #:jdk ,icedtea-8
13644 #:source-dir "powermock-api/powermock-api-support/src/main/java"
13645 #:tests? #f)); no tests
13646 (inputs
13647 (list java-powermock-core java-powermock-reflect))))
13648
13649(define-public java-powermock-modules-junit4-common
13650 (package
13651 (inherit java-powermock-reflect)
13652 (name "java-powermock-modules-junit4-common")
13653 (build-system ant-build-system)
13654 (arguments
13655 `(#:jar-name "java-powermock-modules-junit4-common.jar"
13656 #:jdk ,icedtea-8
13657 #:source-dir "powermock-modules/powermock-module-junit4-common/src/main/java"
13658 #:test-dir "powermock-modules/powermock-module-junit4-common/src/test"))
13659 (inputs
13660 (list java-cglib
13661 java-easymock
13662 java-hamcrest-core
13663 java-powermock-core
13664 java-powermock-reflect))))
13665
13666(define-public java-powermock-modules-junit4
13667 (package
13668 (inherit java-powermock-reflect)
13669 (name "java-powermock-modules-junit4")
13670 (build-system ant-build-system)
13671 (arguments
13672 `(#:jar-name "java-powermock-modules-junit4.jar"
13673 #:tests? #f; require easymock 4, which introduces a loop with testng
13674 #:source-dir "powermock-modules/powermock-module-junit4/src/main/java"
13675 #:test-dir "powermock-modules/powermock-module-junit4/src/test"
13676 #:phases
13677 (modify-phases %standard-phases
13678 (add-before 'build 'fix-junit-detection
13679 (lambda _
13680 ;; Our junit version is 4.12-SNAPSHOT
13681 (substitute* (find-files "powermock-modules/powermock-module-junit4"
13682 "PowerMockJUnit4MethodValidator.java")
13683 (("4.12") "4.12-SNAPSHOT"))
13684 #t)))))
13685 (inputs
13686 (list java-cglib
13687 java-powermock-core
13688 java-powermock-reflect
13689 java-powermock-modules-junit4-common))
13690 (native-inputs
13691 (list java-easymock
13692 java-hamcrest-core
13693 java-junit
13694 java-objenesis))))
13695
13696(define-public java-powermock-api-easymock
13697 (package
13698 (inherit java-powermock-reflect)
13699 (name "java-powermock-api-easymock")
13700 (build-system ant-build-system)
13701 (arguments
13702 `(#:jar-name "java-powermock-api-easymock.jar"
13703 #:jdk ,icedtea-8
13704 #:source-dir "powermock-api/powermock-api-easymock/src/main/java"
13705 #:tests? #f; no tests
13706 #:phases
13707 (modify-phases %standard-phases
13708 (add-before 'build 'fix-file
13709 (lambda _
13710 ;; FIXME: This looks wrong, but it fixes a build error.
13711 (with-directory-excursion "powermock-api/powermock-api-easymock"
13712 (substitute* "src/main/java/org/powermock/api/easymock/PowerMock.java"
13713 (("classLoader instanceof MockClassLoader") "false")
13714 (("\\(\\(MockClassLoader\\) classLoader\\).*;") ";")))
13715 #t)))))
13716 (inputs
13717 (list java-cglib
13718 java-easymock
13719 java-powermock-api-support
13720 java-powermock-core
13721 java-powermock-reflect))))
13722
13723(define-public java-jboss-jms-api-spec
13724 (package
13725 (name "java-jboss-jms-api-spec")
13726 (version "2.0")
13727 (source (origin
13728 (method url-fetch)
13729 (uri (string-append "https://github.com/jboss/jboss-jms-api_spec/"
13730 "archive/jboss-jms-api_" version
13731 "_spec-1.0.1.Final.tar.gz"))
13732 (sha256
13733 (base32
13734 "07bqblw9kq2i8q92bz70fvavq5xjfkaixl8xa0m0cypjgy82rb7m"))))
13735 (build-system ant-build-system)
13736 (arguments
13737 `(#:jar-name "java-jboss-jms-api_spec.jar"
13738 #:jdk ,icedtea-8
13739 #:source-dir "."
13740 #:tests? #f)); no tests
13741 (home-page "https://github.com/jboss/jboss-jms-api_spec")
13742 (synopsis "Java Message Service API specification")
13743 (description "Java Message Service (JMS) API is used to send messages
13744messages between two or more clients. It is a messaging standard that allows
13745application components to create, send, receive, and read messages.")
13746 ; either gpl2 only with GPL Classpath Exception, or cddl.
13747 (license (list license:gpl2 license:cddl1.0))))
13748
13749(define-public java-mail
13750 (package
13751 (name "java-mail")
13752 (version "1.6.0")
13753 (source (origin
13754 (method url-fetch)
13755 (uri (string-append "https://github.com/javaee/javamail/archive/"
13756 "JAVAMAIL-1_6_0.tar.gz"))
13757 (sha256
13758 (base32
13759 "1b4rg7fpj50ld90a71iz2m4gm3f5cnw18p3q3rbrrryjip46kx92"))))
13760 (build-system ant-build-system)
13761 (arguments
13762 `(#:jar-name "java-mail.jar"
13763 #:jdk ,icedtea-8
13764 #:source-dir "mail/src/main/java"
13765 #:test-dir "mail/src/test"
13766 #:test-exclude
13767 (list "**/CollectorFormatterTest.java"
13768 "**/CompactFormatterTest.java"
13769 "**/DurationFilterTest.java"
13770 "**/MailHandlerTest.java"
13771 "**/GetLocalAddressTest.java"
13772 ;; SSLHandshakeException: No appropriate protocol
13773 "**/WriteTimeoutSocketTest.java"
13774 ;; FIXME: both end with:
13775 ;; java.lang.ClassNotFoundException:
13776 ;; javax.mail.internet.MimeMultipartParseTest
13777 "**/MimeMultipartParseTest.java"
13778 "**/SearchTermSerializationTest.java")
13779 #:phases
13780 (modify-phases %standard-phases
13781 (add-before 'configure 'move-version.java
13782 (lambda _
13783 (copy-file "mail/src/main/resources/javax/mail/Version.java"
13784 "mail/src/main/java/javax/mail/Version.java")))
13785 (add-before 'build 'copy-resources
13786 (lambda _
13787 (copy-recursively "mail/src/main/resources/META-INF"
13788 "build/classes/META-INF"))))))
13789 (native-inputs
13790 (list java-junit java-hamcrest-core))
13791 (home-page "https://javaee.github.io/javamail/")
13792 (synopsis "Mail-related functionality in Java")
13793 (description "The JavaMail API provides a platform-independent and
13794protocol-independent framework to build mail and messaging applications.")
13795 ;; General Public License Version 2 only ("GPL") or the Common Development
13796 ;; and Distribution License("CDDL")
13797 (license (list license:cddl1.1
13798 license:gpl2)))); with classpath exception
13799
13800(define-public java-mapdb
13801 (package
13802 (name "java-mapdb")
13803 (version "1.0.9")
13804 (source (origin
13805 (method git-fetch)
13806 (uri (git-reference
13807 (url "https://github.com/jankotek/mapdb")
13808 (commit (string-append "mapdb-" version))))
13809 (file-name (git-file-name name version))
13810 (sha256
13811 (base32
13812 "1slb4h282jqvk16896lcvgm65pj3v6crcp2wvjdvad7nx7d2f1kv"))))
13813 (build-system ant-build-system)
13814 (arguments
13815 (list #:jar-name "mapdb.jar"
13816 #:source-dir "src/main/java"
13817 #:test-dir "src/test"
13818 #:test-exclude (list "**/ClosedThrowsExceptionTest.java"
13819 "**/ConcurrentMapInterfaceTest.java"
13820 "**/EngineTest.java"
13821 "**/Issue664Test.java"
13822 "**/MapInterfaceTest.java")
13823 #:phases #~(modify-phases %standard-phases
13824 (replace 'install (install-from-pom "pom.xml")))))
13825 (native-inputs (list java-junit))
13826 (home-page "https://mapdb.org/")
13827 (synopsis "Concurrent data structures")
13828 (description "MapDB provides concurrent maps, sets and queues backed by
13829disk storage or off-heap memory.")
13830 (license license:bsd-3)))
13831
13832(define-public java-mime4j-core
13833 (package
13834 (name "java-mime4j-core")
13835 (version "0.8.13")
13836 (source (origin
13837 (method url-fetch)
13838 (uri (string-append "mirror://apache/james/mime4j/" version
13839 "/james-mime4j-sources-" version ".zip"))
13840 (sha256
13841 (base32
13842 "0f1r0ywa1qdw2b227c93v3fksqp9bgll00bqw1md1894v3szm9ca"))))
13843 (build-system ant-build-system)
13844 (arguments
13845 `(#:tests? #f ;; has no tests
13846 #:source-dir "core/src/main/java"
13847 #:jar-name "apache-mime4j-core.jar"))
13848 (native-inputs
13849 (list java-commons-io-latest ;; requries >= 2.7
13850 java-junit
13851 unzip))
13852 (home-page "https://james.apache.org/mime4j/apache-mime4j-core/")
13853 (synopsis "Java stream based MIME message parser")
13854 (description "Apache James Mime4J provides a parser, MimeStreamParser, for
13855e-mail message streams in plain rfc822 and MIME format. The parser uses a
13856callback mechanism to report parsing events such as the start of an entity
13857header, the start of a body, etc. If you are familiar with the SAX XML parser
13858interface you should have no problem getting started with mime4j.")
13859 (license license:asl2.0)))
13860
13861(define-public java-jeromq
13862 (package
13863 (name "java-jeromq")
13864 (version "0.4.3")
13865 (source (origin
13866 (method git-fetch)
13867 (uri (git-reference
13868 (url "https://github.com/zeromq/jeromq")
13869 (commit (string-append "v" version))))
13870 (file-name (string-append name "-" version "-checkout"))
13871 (sha256
13872 (base32
13873 "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj"))
13874 (patches (search-patches "java-jeromq-fix-tests.patch"))))
13875 (build-system ant-build-system)
13876 (arguments
13877 `(#:jar-name "java-jeromq.jar"
13878 #:source-dir "src/main/java"
13879 #:jdk ,icedtea-8
13880 #:test-exclude
13881 (list
13882 "**/Abstract*.java"
13883 ;; Requires network
13884 "**/ZBeaconTest.java"
13885 ;; Failures
13886 "**/DealerSpecTest.java"
13887 "**/CustomDecoderTest.java"
13888 "**/CustomEncoderTest.java"
13889 "**/ConnectRidTest.java"
13890 "**/ReqSpecTest.java"
13891 "**/PushPullSpecTest.java"
13892 "**/PubSubHwmTest.java"
13893 "**/RouterSpecTest.java"
13894 "**/ProxyTest.java")))
13895 (inputs
13896 (list java-jnacl))
13897 (native-inputs
13898 `(("java-hamcrest-core" ,java-hamcrest-core)
13899 ("junit" ,java-junit)))
13900 (home-page "https://zeromq.org/bindings:java")
13901 (synopsis "Java binding for 0MQ")
13902 (description "Jeromq provides the java bindings for 0MQ.")
13903 (license license:mpl2.0)))
13904
13905(define-public java-kafka-clients
13906 (package
13907 (name "java-kafka-clients")
13908 (version "1.1.1")
13909 (source (origin
13910 (method url-fetch)
13911 (uri (string-append "mirror://apache/kafka/" version "/kafka-"
13912 version "-src.tgz"))
13913 (sha256
13914 (base32
13915 "1jn62q7z383nwhzv4ippsddf98sa1gnkszjjncj4ii3r8rzgw566"))))
13916 (build-system ant-build-system)
13917 (arguments
13918 `(#:jar-name "java-kafka-clients.jar"
13919 #:jdk ,icedtea-8
13920 #:source-dir "clients/src/main/java"
13921 #:test-dir "clients/src/test"
13922 #:test-exclude
13923 (list
13924 ;; This file does not contain a class
13925 "**/IntegrationTest.java"
13926 ;; Requires network
13927 "**/ClientUtilsTest.java"
13928 ;; This test fails on i686
13929 "**/SerializationTest.java"
13930 ;; "protocol is disabled or cipher suites are inappropriate"
13931 "**/SslTransportLayerTest.java"
13932 ;; End with errors that seem related to our powermock
13933 "**/KafkaProducerTest.java"
13934 "**/BufferPoolTest.java"
13935 ;; Undeterministic failure, seems to affect mostly ci
13936 "**/GarbageCollectedMemoryPoolTest.java")))
13937 (inputs
13938 (list java-slf4j-api java-lz4))
13939 (native-inputs
13940 (list java-bouncycastle
13941 java-cglib
13942 java-easymock
13943 java-hamcrest-all
13944 java-jboss-javassist
13945 java-junit
13946 java-objenesis
13947 java-powermock-api-easymock
13948 java-powermock-api-support
13949 java-powermock-core
13950 java-powermock-modules-junit4
13951 java-powermock-modules-junit4-common
13952 java-snappy))
13953 (home-page "https://kafka.apache.org")
13954 (synopsis "Distributed streaming platform")
13955 (description "Kafka is a distributed streaming platform, which means:
13956@itemize
13957@item it can publish and subscribe to streams of records;
13958@item it can store streams of records in a fault-tolerant way;
13959@item it can process streams of records as they occur.
13960@end itemize")
13961 ;; Either cddl or gpl2 only.
13962 (license (list license:cddl1.1; actually cddl1.1
13963 license:gpl2)))); with classpath exception
13964
13965(define-public java-jdom
13966 (package
13967 (name "java-jdom")
13968 (version "1.1.3")
13969 (source (origin
13970 (method url-fetch)
13971 (uri (string-append "http://jdom.org/dist/binary/archive/jdom-"
13972 version ".tar.gz"))
13973 (sha256
13974 (base32
13975 "07wdpm3jwwc9q38kmdw40fvbmv6jzjrkrf8m0zqs58f79a672wfl"))))
13976 (build-system ant-build-system)
13977 (arguments
13978 `(#:build-target "package"
13979 #:tests? #f; tests are run as part of the build process
13980 #:phases
13981 (modify-phases %standard-phases
13982 (replace 'install
13983 (install-jars "build")))))
13984 (home-page "http://jdom.org/")
13985 (synopsis "Access, manipulate, and output XML data")
13986 (description "Java-based solution for accessing, manipulating, and
13987outputting XML data from Java code.")
13988 (license license:bsd-4)))
13989
13990(define-public java-geronimo-xbean-reflect
13991 (package
13992 (name "java-geronimo-xbean-reflect")
13993 (version "4.5")
13994 (source (origin
13995 (method svn-fetch)
13996 (uri (svn-reference
13997 (url "https://svn.apache.org/repos/asf/geronimo/xbean/tags/xbean-4.5/")
13998 (revision 1807396)))
13999 (file-name (string-append name "-" version))
14000 (sha256
14001 (base32
14002 "0zjqmsad4xk0iar23hdyvx19nxczybd2bh0i35xrafli5cmh720k"))))
14003 (build-system ant-build-system)
14004 (arguments
14005 `(#:jar-name "geronimo-xbean-reflect.jar"
14006 #:source-dir "xbean-reflect/src/main/java"
14007 #:test-dir "xbean-reflect/src/test"
14008 #:jdk ,icedtea-8
14009 #:test-exclude
14010 (list "**/Abstract*.java" "**/AsmParameterNameLoaderTest.java"
14011 "**/ObjectRecipeTest.java" "**/ParameterNameLoaderTest.java"
14012 "**/RecipeHelperTest.java" "**/XbeanAsmParameterNameLoaderTest.java")
14013 #:phases
14014 (modify-phases %standard-phases
14015 (add-before 'build 'fix-source
14016 (lambda _
14017 (let ((dir "xbean-reflect/src/main/java/org/apache/xbean/recipe/"))
14018 ;; org.apache.xbean.asm6 is actually repackaged java-asm
14019 (substitute* (string-append dir "XbeanAsmParameterNameLoader.java")
14020 (("org.apache.xbean.asm5") "org.objectweb.asm"))
14021 #t)))
14022 (replace 'install (install-from-pom "xbean-reflect/pom.xml")))))
14023 (inputs
14024 `(("asm" ,java-asm)
14025 ("log4j" ,java-log4j-api)
14026 ("log4j-1.2" ,java-log4j-1.2-api)
14027 ("log4j-core" ,java-log4j-core)
14028 ("logging" ,java-commons-logging-minimal)))
14029 (propagated-inputs
14030 (list java-geronimo-parent-pom))
14031 (native-inputs
14032 `(("junit" ,java-junit)))
14033 (home-page "https://geronimo.apache.org/maven/xbean/3.6/xbean-reflect/")
14034 (synopsis "Dependency injection helper")
14035 (description "Xbean-reflect provides very flexible ways to create objects
14036and graphs of objects for dependency injection frameworks")
14037 (license license:asl2.0)))
14038
14039(define-public java-geronimo-genesis-2.1
14040 (package
14041 (name "java-geronimo-genesis")
14042 (version "2.1")
14043 (source (origin
14044 (method svn-fetch)
14045 (uri (svn-reference
14046 (url (string-append "https://svn.apache.org/repos/asf/"
14047 "geronimo/genesis/tags/genesis-"
14048 version))
14049 (revision 1807396)))
14050 (file-name (string-append name "-" version "-source"))
14051 (sha256
14052 (base32
14053 "1mky4zyl2xsqlgrkairaj5971byvhwk2z9bq8snsgvlr11ydc0zf"))))
14054 (build-system ant-build-system)
14055 (arguments
14056 `(#:tests? #f
14057 #:phases
14058 (modify-phases %standard-phases
14059 (delete 'configure)
14060 (delete 'build)
14061 (replace 'install
14062 (install-pom-file "pom.xml"))
14063 (add-after 'install 'install-enforcer-rules
14064 (install-pom-file "genesis-enforcer-rules/pom.xml"))
14065 (add-after 'install 'install-flava
14066 (install-pom-file "genesis-default-flava/pom.xml"))
14067 (add-after 'install 'install-packaging
14068 (install-pom-file "genesis-packaging/pom.xml"))
14069 (add-after 'install-flava 'install-flava-java4
14070 (install-pom-file "genesis-default-flava/genesis-java1.4-flava/pom.xml"))
14071 (add-after 'install-flava 'install-flava-java5
14072 (install-pom-file "genesis-default-flava/genesis-java5-flava/pom.xml"))
14073 (add-after 'install-flava 'install-flava-java6
14074 (install-pom-file "genesis-default-flava/genesis-java6-flava/pom.xml")))))
14075 (propagated-inputs
14076 `(("apache-parent-pom" ,apache-parent-pom-13)))
14077 (home-page "https://geronimo.apache.org")
14078 (synopsis "Collection of maven POM files for the Geronimo project")
14079 (description "Apache Geronimo is a server runtime. This package contains
14080only pom files used by other components in the Geronimo project.")
14081 (license license:asl2.0)))
14082
14083(define java-geronimo-parent-pom
14084 (package
14085 (inherit java-geronimo-xbean-reflect)
14086 (name "java-geronimo-parent-pom")
14087 (arguments
14088 `(#:tests? #f
14089 #:phases
14090 (modify-phases %standard-phases
14091 (delete 'configure)
14092 (delete 'build)
14093 (replace 'install
14094 (install-pom-file "pom.xml")))))
14095 (propagated-inputs
14096 `(("java-geronimo-genesis" ,java-geronimo-genesis-2.1)))))
14097
14098(define-public java-geronimo-xbean-bundleutils
14099 (package
14100 (inherit java-geronimo-xbean-reflect)
14101 (name "java-geronimo-xbean-bundleutils")
14102 (arguments
14103 `(#:jar-name "geronimo-xbean-bundleutils.jar"
14104 #:source-dir "xbean-bundleutils/src/main/java"
14105 #:test-dir "xbean-bundleutils/src/test"
14106 #:phases
14107 (modify-phases %standard-phases
14108 (add-before 'build 'fix-java
14109 (lambda _
14110 ;; We use a more recent version of osgi, so this file requires
14111 ;; more interface method implementations.
14112 (substitute* "xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java"
14113 (("import org.osgi.framework.ServiceRegistration;")
14114 "import org.osgi.framework.ServiceRegistration;
14115import org.osgi.framework.ServiceFactory;
14116import java.util.Collection;
14117import org.osgi.framework.ServiceObjects;")
14118 (("public Bundle getBundle\\(\\)")
14119 "@Override
14120public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
14121 throw new UnsupportedOperationException();
14122}
14123@Override
14124public <S> ServiceRegistration<S> registerService(Class<S> clazz,
14125 ServiceFactory<S> factory, Dictionary<String, ?> properties) {
14126 throw new UnsupportedOperationException();
14127}
14128public Bundle getBundle()"))
14129 #t)))))
14130 (inputs
14131 `(("java-slf4j" ,java-slf4j-api)
14132 ("java-asm" ,java-asm)
14133 ("java-osgi-framework" ,java-osgi-framework)
14134 ("java-eclipse-osgi" ,java-eclipse-osgi)
14135 ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)))))
14136
14137(define-public java-geronimo-xbean-asm-util
14138 (package
14139 (inherit java-geronimo-xbean-reflect)
14140 (name "java-geronimo-xbean-asm-util")
14141 (arguments
14142 `(#:jar-name "geronimo-xbean-asm-util.jar"
14143 #:source-dir "xbean-asm-util/src/main/java"
14144 #:tests? #f)); no tests
14145 (inputs
14146 (list java-asm))
14147 (native-inputs '())))
14148
14149(define-public java-geronimo-xbean-finder
14150 (package
14151 (inherit java-geronimo-xbean-reflect)
14152 (name "java-geronimo-xbean-finder")
14153 (arguments
14154 `(#:jar-name "geronimo-xbean-finder.jar"
14155 #:source-dir "xbean-finder/src/main/java"
14156 #:test-dir "xbean-finder/src/test"))
14157 (inputs
14158 (list java-slf4j-api
14159 java-asm
14160 java-geronimo-xbean-bundleutils
14161 java-geronimo-xbean-asm-util
14162 java-osgi-service-packageadmin
14163 java-osgi-framework))
14164 (native-inputs
14165 (list java-junit java-hamcrest-core))))
14166
14167(define-public java-simplevalidation-1.14.1
14168 (package
14169 (name "java-simplevalidation")
14170 (version "1.14.1")
14171 (source
14172 (origin
14173 (method git-fetch)
14174 (uri (git-reference
14175 (url "https://github.com/timboudreau/simplevalidation.git")
14176 (commit "7a9d6adbac685b34746aaa72b20a1e639b89c733")))
14177 (file-name (git-file-name "java-simplevalidation" version))
14178 (sha256
14179 (base32 "1l0h2a6brzh4qrkjjxpiijjspapd1s7wr9pqzzwgh6qisjgb176w"))
14180 (patches
14181 (search-patches "java-simplevalidation-1.14.1.patch"))
14182 (modules '((guix build utils)))
14183 (snippet
14184 '(begin
14185 (for-each delete-file (find-files "." "\\.jar$"))
14186 #t))))
14187 (build-system ant-build-system)
14188 (arguments
14189 (list
14190 #:jdk openjdk17
14191 #:tests? #f
14192 #:modules
14193 '((guix build utils)
14194 (guix build ant-build-system)
14195 (guix build java-utils)
14196 (srfi srfi-13))
14197 #:phases
14198 #~(modify-phases %standard-phases
14199 (replace 'build
14200 (lambda _
14201 (define build-root (getcwd))
14202 (define (normalize-path file)
14203 (if (string-prefix? "./" file)
14204 (substring file 2)
14205 file))
14206 (define (copy-resources source-root class-root)
14207 (with-directory-excursion source-root
14208 (for-each
14209 (lambda (file)
14210 (unless (string-suffix? ".java" file)
14211 (let* ((relative (normalize-path file))
14212 (destination
14213 (string-append class-root "/" relative)))
14214 (mkdir-p (dirname destination))
14215 (copy-file file destination))))
14216 (find-files "." ".*"))))
14217 (define (compile-tree source-root class-root classpath)
14218 (mkdir-p class-root)
14219 (copy-resources source-root class-root)
14220 (with-directory-excursion source-root
14221 (let ((sources (find-files "." "\\.java$")))
14222 (apply invoke "javac"
14223 (append
14224 (list "-d" class-root)
14225 (if classpath
14226 (list "-cp" classpath)
14227 '())
14228 sources)))))
14229 (let* ((nbstubs-classes (string-append build-root "/build/nbstubs"))
14230 (core-classes (string-append build-root "/build/core"))
14231 (swing-classes (string-append build-root "/build/swing"))
14232 (nbstubs-jar (string-append build-root
14233 "/build/nbstubs-1.14.1.jar"))
14234 (core-jar (string-append build-root
14235 "/build/simplevalidation-1.14.1.jar"))
14236 (swing-jar
14237 (string-append build-root
14238 "/build/simplevalidation-swing-1.14.1.jar"))
14239 (converter-services
14240 (string-append
14241 swing-classes
14242 "/META-INF/services/org.netbeans.validation.api.conversion.Converter")))
14243 (compile-tree "nbstubs/src" nbstubs-classes #f)
14244 (invoke "jar" "-cf" nbstubs-jar "-C" nbstubs-classes ".")
14245 (compile-tree "ValidationAPI/src" core-classes #f)
14246 (invoke "jar" "-cf" core-jar "-C" core-classes ".")
14247 (compile-tree "simplevalidation-swing/src/main/java"
14248 swing-classes
14249 (string-append core-classes ":" nbstubs-classes))
14250 (mkdir-p (dirname converter-services))
14251 (call-with-output-file converter-services
14252 (lambda (port)
14253 (for-each
14254 (lambda (line)
14255 (display line port)
14256 (newline port))
14257 '("org.netbeans.validation.api.conversion.swing.SelectedIndicesToButtonModelArrayConverter"
14258 "org.netbeans.validation.api.conversion.swing.SelectedIndicesToListSelectionModelConverter"
14259 "org.netbeans.validation.api.conversion.swing.StringToComboBoxModelConverter"
14260 "org.netbeans.validation.api.conversion.swing.StringToDocumentConverter"))))
14261 (invoke "jar" "-cf" swing-jar "-C" swing-classes ".")
14262 #t)))
14263 (replace 'install
14264 (lambda* (#:key inputs outputs #:allow-other-keys)
14265 ((install-pom-file "pom.xml")
14266 #:inputs inputs
14267 #:outputs outputs)
14268 ((install-from-pom "nbstubs/pom.xml")
14269 #:inputs inputs
14270 #:outputs outputs)
14271 ((install-from-pom "ValidationAPI/pom.xml")
14272 #:inputs inputs
14273 #:outputs outputs)
14274 ((install-from-pom "simplevalidation-swing/pom.xml")
14275 #:inputs inputs
14276 #:outputs outputs)
14277 #t)))))
14278 (home-page "https://github.com/timboudreau/simplevalidation/")
14279 (synopsis "Simple Validation libraries for Swing forms")
14280 (description
14281 "This package builds the Simple Validation core and Swing adapter
14282libraries from source.")
14283 (license license:asl2.0)))
14284
14285(define-public java-lucene-core-3.6.2
14286 (package
14287 (name "java-lucene-core")
14288 (version "3.6.2")
14289 (source
14290 (origin
14291 (method url-fetch)
14292 (uri (string-append "https://archive.apache.org/dist/lucene/solr/"
14293 version "/apache-solr-" version "-src.tgz"))
14294 (sha256
14295 (base32 "032dfpk7likiwb9pnlr518wwlyxn57i5wyp18mi32320vsprd4r0"))))
14296 (build-system ant-build-system)
14297 (arguments
14298 (list
14299 #:tests? #f
14300 #:phases
14301 #~(modify-phases %standard-phases
14302 (replace 'build
14303 (lambda _
14304 (let ((jar-file (string-append (getcwd) "/build/lucene-core-"
14305 #$version ".jar")))
14306 (mkdir-p "build")
14307 (with-directory-excursion "lucene/core"
14308 (mkdir-p "build/classes")
14309 (apply invoke "javac" "-d" "build/classes"
14310 (find-files "src/java" "\\.java$"))
14311 (invoke "jar" "-cf" jar-file "-C" "build/classes" "."))
14312 #t)))
14313 (replace 'install
14314 (install-jars "build")))))
14315 (home-page "https://lucene.apache.org/core/")
14316 (synopsis "Apache Lucene core library")
14317 (description
14318 "This package provides the Apache Lucene 3.6.2 core library, built
14319entirely from source.")
14320 (license license:asl2.0)))
14321
14322(define-public java-json-simple-1.1.1
14323 (package
14324 (name "java-json-simple")
14325 (version "1.1.1")
14326 (source
14327 (origin
14328 (method git-fetch)
14329 (uri (git-reference
14330 (url "https://github.com/fangyidong/json-simple.git")
14331 (commit "tag_release_1_1_1")))
14332 (file-name (git-file-name name version))
14333 (sha256
14334 (base32 "1c598dvms70fs6w3l1dc0z7lqq3hndd5250ciwqm8xk3zbx465kf"))))
14335 (build-system ant-build-system)
14336 (arguments
14337 (list
14338 #:tests? #f
14339 #:build-target "jar"
14340 #:phases
14341 #~(modify-phases %standard-phases
14342 (replace 'install
14343 (install-from-pom "pom.xml")))))
14344 (home-page "https://github.com/fangyidong/json-simple")
14345 (synopsis "Simple JSON toolkit for Java")
14346 (description
14347 "JSON.simple is a small JSON parser and encoder for Java.")
14348 (license license:asl2.0)))
14349
14350(define-public java-gson
14351 (package
14352 (name "java-gson")
14353 (version "2.8.2")
14354 (source (origin
14355 (method url-fetch)
14356 (uri (string-append "https://github.com/google/gson/archive/"
14357 "gson-parent-" version ".tar.gz"))
14358 (sha256
14359 (base32
14360 "1j4qnp7v046q0k48c4kyf69sxaasx2h949d3cqwsm3kzxms3x0f9"))))
14361 (build-system ant-build-system)
14362 (arguments
14363 `(#:jar-name "gson.jar"
14364 #:source-dir "gson/src/main/java"
14365 #:test-dir "gson/src/test"
14366 #:phases
14367 (modify-phases %standard-phases
14368 (replace 'install
14369 (install-from-pom "gson/pom.xml")))))
14370 (native-inputs
14371 (list java-junit java-hamcrest-core))
14372 (home-page "https://github.com/google/gson")
14373 (synopsis "Java serialization/deserialization library from/to JSON")
14374 (description "Gson is a Java library that can be used to convert Java
14375Objects into their JSON representation. It can also be used to convert a JSON
14376string to an equivalent Java object. Gson can work with arbitrary Java objects
14377including pre-existing objects that you do not have source-code of.")
14378 (license license:asl2.0)))
14379
14380;; Unlike java-gson above, this requires openjdk11.
14381(define-public java-gson-latest
14382 (package
14383 (inherit java-gson)
14384 (name "java-gson")
14385 (version "2.14.0")
14386 (source (origin
14387 (method git-fetch)
14388 (uri (git-reference
14389 (url "https://github.com/google/gson")
14390 (commit (string-append "gson-parent-" version))))
14391 (file-name (git-file-name name version))
14392 (sha256
14393 (base32
14394 "19xbgfh3i6j3vbjnrap057gnrgnc5gf41vgmwqg920cq95cvimab"))))
14395 (arguments
14396 `(#:jar-name "gson.jar"
14397 #:jdk ,openjdk11
14398 #:use-java-modules? #t
14399 #:source-dir "gson/src/main/java"
14400 #:tests? #f ;need Junit 5
14401 #:phases
14402 (modify-phases %standard-phases
14403 ;; avoid Maven dependency
14404 (add-before 'build 'fill-template
14405 (lambda _
14406 (with-directory-excursion "gson/src/main"
14407 (copy-file "java-templates/com/google/gson/internal/GsonBuildConfig.java"
14408 "java/com/google/gson/internal/GsonBuildConfig.java")
14409 (substitute* "java/com/google/gson/internal/GsonBuildConfig.java"
14410 (("\\$\\{project.version\\}") ,version)))))
14411 (replace 'install
14412 (install-from-pom "gson/pom.xml")))))
14413 (propagated-inputs
14414 (list java-error-prone-annotations))))
14415
14416(define-public java-hawtjni
14417 (package
14418 (name "java-hawtjni")
14419 (version "1.15")
14420 (source (origin
14421 (method url-fetch)
14422 (uri (string-append "https://github.com/fusesource/hawtjni/archive/"
14423 "hawtjni-project-" version ".tar.gz"))
14424 (sha256
14425 (base32
14426 "1bqfd732rmh6svyx17fpw9175gc9gzkcbyps2yyrf50c3zzjas6g"))))
14427 (build-system ant-build-system)
14428 (arguments
14429 `(#:jar-name "hawtjni.jar"
14430 #:source-dir "hawtjni-generator/src/main/java:hawtjni-runtime/src/main/java"
14431 #:tests? #f; no tests
14432 #:phases
14433 (modify-phases %standard-phases
14434 (add-before 'build 'build-native
14435 (lambda* (#:key inputs #:allow-other-keys)
14436 (let ((include (string-append "-I" (assoc-ref inputs "jdk") "/include/linux")))
14437 (with-directory-excursion "hawtjni-generator/src/main/resources/"
14438 (invoke "gcc" "-c" "hawtjni.c" "-o" "hawtjni.o"
14439 "-fPIC" "-O2" include)
14440 (invoke "gcc" "-c" "hawtjni-callback.c" "-o" "hawtjni-callback.o"
14441 "-fPIC" "-O2" include)
14442 (invoke "gcc" "-o" "libhawtjni.so" "-shared"
14443 "hawtjni.o" "hawtjni-callback.o")))
14444 #t))
14445 (add-after 'install 'install-native
14446 (lambda* (#:key outputs #:allow-other-keys)
14447 (let* ((out (assoc-ref outputs "out"))
14448 (lib (string-append out "/lib"))
14449 (inc (string-append out "/include")))
14450 (with-directory-excursion "hawtjni-generator/src/main/resources/"
14451 (install-file "libhawtjni.so" lib)
14452 (install-file "hawtjni.h" inc)))
14453 #t))
14454 (add-before 'install 'install-parent
14455 (install-pom-file "pom.xml"))
14456 (replace 'install
14457 (install-from-pom "hawtjni-runtime/pom.xml")))))
14458 (inputs
14459 (list java-commons-cli java-asm java-geronimo-xbean-finder))
14460 (home-page "https://fusesource.github.io/hawtjni/")
14461 (synopsis "JNI code generator")
14462 (description "HawtJNI is a code generator that produces the JNI code needed
14463to implement Java native methods. It is based on the jnigen code generator
14464that is part of the SWT Tools project.")
14465 (license license:asl2.0)))
14466
14467(define-public java-jansi-native
14468 (package
14469 (name "java-jansi-native")
14470 (version "1.7")
14471 (source (origin
14472 (method url-fetch)
14473 (uri (string-append "https://github.com/fusesource/jansi-native/"
14474 "archive/jansi-native-" version ".tar.gz"))
14475 (sha256
14476 (base32
14477 "0j2ydlgxbzbgshqkwghbxxxnbnx1mmjgd6k5fw6xfvxw1z956yqf"))))
14478 (build-system ant-build-system)
14479 (arguments
14480 `(#:jar-name "jansi-native.jar"
14481 #:source-dir "src/main/java"
14482 #:tests? #f; no tests
14483 #:phases
14484 (modify-phases %standard-phases
14485 (add-before 'build 'build-native
14486 (lambda* (#:key inputs #:allow-other-keys)
14487 ;; there are more required files for windows in windows/
14488 (with-directory-excursion "src/main/native-package/src"
14489 (substitute* "jansi_ttyname.c"
14490 (("#include \"jansi_.*") ""))
14491 (invoke "gcc" "-c" "jansi_ttyname.c" "-o" "jansi_ttyname.o"
14492 (string-append "-I" (assoc-ref inputs "java-hawtjni")
14493 "/include")
14494 (string-append "-I" (assoc-ref inputs "jdk")
14495 "/include/linux")
14496 "-fPIC" "-O2")
14497 (invoke "gcc" "-o" "libjansi.so" "-shared" "jansi_ttyname.o"))))
14498 (add-before 'build 'install-native
14499 (lambda _
14500 (let ((dir (string-append "build/classes/META-INF/native/"
14501 ,(match (%current-system)
14502 ((or "i686-linux" "armhf-linux")
14503 "linux32")
14504 ((or "x86_64-linux" "aarch64-linux"
14505 "mips64el-linux")
14506 "linux64")
14507 (_ "unknown-kernel")))))
14508 (install-file "src/main/native-package/src/libjansi.so" dir))
14509 #t))
14510 (add-after 'install 'install-native
14511 (lambda* (#:key outputs #:allow-other-keys)
14512 (install-file "src/main/native-package/src/jansi.h"
14513 (string-append (assoc-ref outputs "out") "/include"))
14514 #t))
14515 (add-before 'install 'fix-pom
14516 (lambda _
14517 ;; pom contains variables to complete name, but we don't support that
14518 (substitute* "pom.xml"
14519 (("\\$\\{platform\\}") "native"))
14520 #t))
14521 (replace 'install
14522 (install-from-pom "pom.xml")))))
14523 (propagated-inputs
14524 (list java-hawtjni))
14525 (home-page "https://fusesource.github.io/jansi/")
14526 (synopsis "Native library for jansi")
14527 (description "This package provides the native library for jansi, a small
14528Java library that allows you to use ANSI escape sequences to format your
14529console output.")
14530 (license license:asl2.0)))
14531
14532(define-public java-jansi
14533 (package
14534 (name "java-jansi")
14535 (version "2.4.0")
14536 (source (origin
14537 (method git-fetch)
14538 (uri (git-reference
14539 (url "https://github.com/fusesource/jansi")
14540 (commit (string-append "jansi-" version))))
14541 (file-name (git-file-name name version))
14542 (sha256
14543 (base32
14544 "1s6fva06990798b5fyxqzr30zwyj1byq5wrm54j2larcydaryggf"))
14545 (modules '((guix build utils)))
14546 (snippet
14547 ;; contains pre-compiled libraries
14548 '(delete-file-recursively
14549 "src/main/resources/org/fusesource/jansi/internal"))))
14550 (build-system ant-build-system)
14551 (arguments
14552 `(#:jar-name "jansi.jar"
14553 #:source-dir "src/main/java"
14554 #:test-dir "src/test"
14555 #:tests? #f; require junit 3
14556 #:phases
14557 (modify-phases %standard-phases
14558 (add-before 'build 'build-native
14559 (lambda* (#:key inputs #:allow-other-keys)
14560 (with-directory-excursion "src/main/native"
14561 (for-each
14562 (lambda (cfile)
14563 (let ((cfile (basename cfile))
14564 (ofile (string-append (basename cfile ".c") ".o")))
14565 (invoke ,(cc-for-target) "-c" cfile "-o" ofile
14566 (string-append "-I" (assoc-ref inputs "jdk")
14567 "/include/linux")
14568 "-fPIC" "-O2")))
14569 (find-files "." "\\.c$"))
14570 (apply invoke ,(cc-for-target) "-o" "libjansi.so" "-shared"
14571 (find-files "." "\\.o$")))))
14572 (add-before 'build 'install-native
14573 (lambda _
14574 (let ((dir (string-append "build/classes/org/fusesource/"
14575 "jansi/internal/native/"
14576 ,(match (or (%current-target-system) (%current-system))
14577 ("i686-linux" "Linux/x86")
14578 ("x86_64-linux" "Linux/x86_64")
14579 ("armhf-linux" "Linux/armv7")
14580 ("aarch64-linux" "Linux/arm64")
14581 ("mips64el-linux" "Linux/mips64")
14582 (_ "unknown-kernel")))))
14583 (install-file "src/main/native/libjansi.so" dir))))
14584 (add-before 'build 'copy-resources
14585 (lambda _
14586 (copy-recursively "src/main/resources" "build/classes")))
14587 (replace 'install
14588 (install-from-pom "pom.xml")))))
14589 (home-page "https://fusesource.github.io/jansi/")
14590 (synopsis "Portable ANSI escape sequences")
14591 (description "Jansi is a Java library that allows you to use ANSI escape
14592sequences to format your console output which works on every platform.")
14593 (license license:asl2.0)))
14594
14595(define-public java-jansi-1
14596 (package
14597 (inherit java-jansi)
14598 (version "1.16")
14599 (source (origin
14600 (method git-fetch)
14601 (uri (git-reference
14602 (url "https://github.com/fusesource/jansi")
14603 (commit (string-append "jansi-project-" version))))
14604 (file-name (git-file-name "jansi" version))
14605 (sha256
14606 (base32
14607 "0ikk0x352gh30b42qn1jd89xwsjj0mavrc5kms7fss15bd8vsayx"))))
14608 (arguments
14609 `(#:jar-name "jansi.jar"
14610 #:source-dir "jansi/src/main/java"
14611 #:test-dir "jansi/src/test"
14612 #:phases
14613 (modify-phases %standard-phases
14614 (add-after 'check 'clear-term
14615 (lambda _
14616 (invoke "echo" "-e" "\\e[0m")))
14617 (add-before 'install 'install-parent
14618 (install-pom-file "pom.xml"))
14619 (add-before 'install 'fix-pom
14620 (lambda _
14621 ;; pom adds jansi native versions for different platforms, but we
14622 ;; only need one, so use native instead
14623 (substitute* "jansi/pom.xml"
14624 (("windows32") "native")
14625 (("windows64") "native")
14626 (("osx") "native")
14627 (("linux32") "native")
14628 (("linux64") "native")
14629 (("freebsd32") "native")
14630 (("freebsd64") "native"))
14631 #t))
14632 (replace 'install
14633 (install-from-pom "jansi/pom.xml")))))
14634 (propagated-inputs
14635 (list java-jansi-native))
14636 (native-inputs
14637 (list java-junit java-hamcrest-core))))
14638
14639(define-public java-jboss-el-api-spec
14640 (package
14641 (name "java-jboss-el-api-spec")
14642 (version "3.0")
14643 (source (origin
14644 (method url-fetch)
14645 (uri (string-append "https://github.com/jboss/jboss-el-api_spec/"
14646 "archive/jboss-el-api_" version
14647 "_spec-1.0.7.Final.tar.gz"))
14648 (sha256
14649 (base32
14650 "1j45ljxalwlibxl7g7iv952sjxkw275m8vyxxij8l6wdd5pf0pdh"))))
14651 (build-system ant-build-system)
14652 (arguments
14653 `(#:jar-name "java-jboss-el-api_spec.jar"
14654 #:phases
14655 (modify-phases %standard-phases
14656 ;; the origin of javax.el:javax.el-api is unknown, so we use this package
14657 ;; instead, which implements the same thing. We override the pom file
14658 ;; to "rename" the package so it can be found by maven.
14659 (add-before 'install 'override-pom
14660 (generate-pom.xml "pom.xml" "javax.el" "javax.el-api" "3.0"
14661 #:name "el-api"))
14662 (replace 'install
14663 (install-from-pom "pom.xml")))))
14664 (inputs
14665 (list java-junit))
14666 (home-page "https://github.com/jboss/jboss-el-api_spec")
14667 (synopsis "JSR-341 expression language 3.0 API")
14668 (description "This package contains an implementation of the JSR-341
14669specification for the expression language 3.0. It implements an expression
14670language inspired by ECMAScript and XPath. This language is used with
14671JavaServer Pages (JSP).")
14672 ;; Either GPL2 only or CDDL.
14673 (license (list license:gpl2 license:cddl1.1))))
14674
14675(define-public java-jboss-interceptors-api-spec
14676 (package
14677 (name "java-jboss-interceptors-api-spec")
14678 (version "1.2")
14679 (source (origin
14680 (method url-fetch)
14681 (uri (string-append "https://github.com/jboss/jboss-interceptors-api_spec/"
14682 "archive/jboss-interceptors-api_" version
14683 "_spec-1.0.0.Final.tar.gz"))
14684 (sha256
14685 (base32
14686 "0wv8x0jp9a5qxlrgkhb5jdk2gr6vi87b4j4kjb8ryxiy9gn8g51z"))))
14687 (build-system ant-build-system)
14688 (arguments
14689 `(#:jar-name "java-jboss-interceptors-api_spec.jar"
14690 #:jdk ,icedtea-8
14691 #:source-dir "."
14692 #:tests? #f; no tests
14693 #:phases
14694 (modify-phases %standard-phases
14695 ;; the origin of javax.interceptor:javax.interceptor-api is unknown,
14696 ;; so we use this package instead, which implements the same thing.
14697 ;; We override the pom file to "rename" the package so it can be found
14698 ;; by maven.
14699 (add-before 'install 'override-pom
14700 (generate-pom.xml "pom.xml" "javax.interceptor" "javax.interceptor-api"
14701 "3.0" #:name "interceptor-api"))
14702 (replace 'install
14703 (install-from-pom "pom.xml")))))
14704 (home-page "https://github.com/jboss/jboss-interceptors-api_spec")
14705 (synopsis "Interceptors 1.2 API classes from JSR 318")
14706 (description "Java-jboss-interceptors-api-spec implements the Interceptors
14707API. Interceptors are used to interpose on business method invocations and
14708specific events.")
14709 ;; Either GPL2 only or CDDL.
14710 (license (list license:gpl2 license:cddl1.1))))
14711
14712(define-public java-cdi-api
14713 (package
14714 (name "java-cdi-api")
14715 (version "2.0")
14716 (source (origin
14717 (method url-fetch)
14718 (uri (string-append "https://github.com/cdi-spec/cdi/archive/"
14719 version ".tar.gz"))
14720 (file-name (string-append name "-" version ".tar.gz"))
14721 (sha256
14722 (base32
14723 "1iv8b8bp07c5kmqic14jsr868vycjv4qv02lf3pkgp9z21mnfg5y"))))
14724 (build-system ant-build-system)
14725 (arguments
14726 `(#:source-dir "api/src/main/java"
14727 #:jar-name "java-cdi-api.jar"
14728 #:test-dir "api/src/test"
14729 #:jdk ,icedtea-8
14730 #:tests? #f; Tests fail because we don't have a CDI provider yet
14731 #:phases
14732 (modify-phases %standard-phases
14733 (replace 'install
14734 (install-from-pom "api/pom.xml")))))
14735 (propagated-inputs
14736 (list java-javax-inject java-jboss-el-api-spec
14737 java-jboss-interceptors-api-spec java-weld-parent-pom))
14738 (native-inputs
14739 (list java-testng java-hamcrest-core))
14740 (home-page "https://cdi-spec.org/")
14741 (synopsis "Contexts and Dependency Injection APIs")
14742 (description "Java-cdi-api contains the required APIs for Contexts and
14743Dependency Injection (CDI).")
14744 (license license:asl2.0)))
14745
14746(define-public java-joda-convert
14747 (package
14748 (name "java-joda-convert")
14749 (version "1.9.2")
14750 (source (origin
14751 (method url-fetch)
14752 (uri (string-append "https://github.com/JodaOrg/joda-convert/archive/v"
14753 version ".tar.gz"))
14754 (file-name (string-append name "-" version ".tar.gz"))
14755 (sha256
14756 (base32
14757 "0vp346xz7dh9br4q7xazhc7hvzf76a6hf95fki9bg67q5jr0kjh7"))))
14758 (build-system ant-build-system)
14759 (arguments
14760 `(#:jar-name (string-append ,name "-" ,version ".jar")
14761 #:source-dir "src/main/java"
14762 #:test-include (list "**/Test*.java")
14763 ;; Contains only interfaces and base classes (no test)
14764 #:test-exclude (list "**/test*/**.java")))
14765 (inputs
14766 (list java-guava))
14767 (native-inputs
14768 (list java-junit java-hamcrest-core))
14769 (home-page "https://www.joda.org/joda-convert/")
14770 (synopsis "Conversion between Objects and Strings")
14771 (description "Joda-Convert provides a small set of classes to aid
14772conversion between Objects and Strings. It is not intended to tackle the
14773wider problem of Object to Object transformation.")
14774 (license license:asl2.0)))
14775
14776(define-public java-joda-time
14777 (package
14778 (name "java-joda-time")
14779 (version "2.9.9")
14780 (source (origin
14781 (method url-fetch)
14782 (uri (string-append "https://github.com/JodaOrg/joda-time/archive/v"
14783 version ".tar.gz"))
14784 (file-name (string-append name "-" version ".tar.gz"))
14785 (sha256
14786 (base32
14787 "1i9x91mi7yg2pasl0k3912f1pg46n37sps6rdb0v1gs8hj9ppwc1"))))
14788 (build-system ant-build-system)
14789 (arguments
14790 `(#:jar-name "java-joda-time.jar"
14791 #:source-dir "src/main/java"
14792 #:test-include (list "**/Test*.java")
14793 ;; There is no runnable test in these files
14794 #:test-exclude (list "**/Test*Chronology.java" "**/Test*Field.java")
14795 #:phases
14796 (modify-phases %standard-phases
14797 (add-after 'build 'build-resources
14798 (lambda _
14799 (mkdir-p "build/classes/org/joda/time/tz/data")
14800 (mkdir-p "build/classes/org/joda/time/format")
14801 ;; This will produce the following exception:
14802 ;; java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap"
14803 ;; which is normal, because it doesn't exist yet. It still generates
14804 ;; the same file as in the binary one can find on maven.
14805 (invoke "java" "-cp"
14806 (string-append "build/classes:" (getenv "CLASSPATH"))
14807 "org.joda.time.tz.ZoneInfoCompiler"
14808 "-src" "src/main/java/org/joda/time/tz/src"
14809 "-dst" "build/classes/org/joda/time/tz/data"
14810 "africa" "antarctica" "asia" "australasia"
14811 "europe" "northamerica" "southamerica"
14812 "pacificnew" "etcetera" "backward" "systemv")
14813 (for-each (lambda (f)
14814 (copy-file f (string-append
14815 "build/classes/org/joda/time/format/"
14816 (basename f))))
14817 (find-files "src/main/java/org/joda/time/format" ".*.properties"))
14818 #t))
14819 (add-before 'install 'regenerate-jar
14820 (lambda _
14821 ;; We need to regenerate the jar file to add generated data.
14822 (delete-file "build/jar/java-joda-time.jar")
14823 (invoke "ant" "jar")))
14824 (add-before 'check 'copy-test-resources
14825 (lambda _
14826 (mkdir-p "build/test-classes/org/joda/time/tz/data")
14827 (copy-file "src/test/resources/tzdata/ZoneInfoMap"
14828 "build/test-classes/org/joda/time/tz/data/ZoneInfoMap")
14829 (copy-recursively "src/test/resources" "build/test-classes")
14830 #t)))))
14831 (inputs
14832 (list java-joda-convert))
14833 (native-inputs
14834 (list java-junit java-hamcrest-core tzdata))
14835 (home-page "https://www.joda.org/joda-time/")
14836 (synopsis "Replacement for the Java date and time classes")
14837 (description "Joda-Time is a replacement for the Java date and time
14838classes prior to Java SE 8.")
14839 (license license:asl2.0)))
14840
14841(define-public java-xerces
14842 (package
14843 (name "java-xerces")
14844 (version "2.12.2")
14845 (source
14846 (origin
14847 (method url-fetch)
14848 (uri (string-append "mirror://apache/xerces/j/source/"
14849 "Xerces-J-src." version ".tar.gz"))
14850 (sha256
14851 (base32 "1s2fnfx5flmhs3q30bxdsa6vs52m6vbnqd3m4cc5r4wfr3afplbd"))
14852 (patches (search-patches
14853 "java-xerces-xjavac_taskdef.patch"
14854 "java-xerces-build_dont_unzip.patch"
14855 "java-xerces-bootclasspath.patch"))))
14856 (build-system ant-build-system)
14857 (arguments
14858 `(#:tests? #f;; Test files are not present
14859 #:test-target "test"
14860 #:jdk ,icedtea-8
14861 #:phases
14862 (modify-phases %standard-phases
14863 (add-after 'unpack 'create-build.properties
14864 (lambda* (#:key inputs #:allow-other-keys)
14865 (let ((jaxp (assoc-ref inputs "java-jaxp"))
14866 (resolver (assoc-ref inputs "java-apache-xml-commons-resolver")))
14867 (with-output-to-file "build.properties"
14868 (lambda _
14869 (format #t
14870 "jar.jaxp = ~a/share/java/jaxp.jar~@
14871 jar.apis-ext = ~a/share/java/jaxp.jar~@
14872 jar.resolver = ~a/share/java/xml-resolver.jar~%"
14873 jaxp jaxp resolver)))
14874 ;; Make xerces use our version of jaxp in tests
14875 (substitute* "build.xml"
14876 (("xml-apis.jar")
14877 (string-append jaxp "/share/java/jaxp.jar"))
14878 (("\\$\\{tools.dir\\}/\\$\\{jar.apis\\}")
14879 "${jar.apis}")))
14880 #t))
14881 (replace 'install (install-jars "build")))))
14882 (inputs
14883 (list java-apache-xml-commons-resolver java-jaxp))
14884 (home-page "https://xerces.apache.org/xerces2-j/")
14885 (synopsis "Validating XML parser for Java with DOM level 3 support")
14886 (description "The Xerces2 Java parser is the reference implementation of
14887XNI, the Xerces Native Interface, and also a fully conforming XML Schema
14888processor.
14889
14890Xerces2-J supports the following standards and APIs:
14891
14892@itemize
14893@item eXtensible Markup Language (XML) 1.0 Second Edition Recommendation
14894@item Namespaces in XML Recommendation
14895@item Document Object Model (DOM) Level 2 Core, Events, and Traversal and
14896 Range Recommendations
14897@item Simple API for XML (SAX) 2.0.1 Core and Extension
14898@item Java APIs for XML Processing (JAXP) 1.2.01
14899@item XML Schema 1.0 Structures and Datatypes Recommendations
14900@item Experimental implementation of the Document Object Model (DOM) Level 3
14901 Core and Load/Save Working Drafts
14902@item Provides a partial implementation of the XML Inclusions (XInclude) W3C
14903 Candidate Recommendation
14904@end itemize
14905
14906Xerces is now able to parse documents written according to the XML 1.1
14907Candidate Recommendation, except that it does not yet provide an option to
14908enable normalization checking as described in section 2.13 of this
14909specification. It also handles namespaces according to the XML Namespaces 1.1
14910Candidate Recommendation, and will correctly serialize XML 1.1 documents if
14911the DOM level 3 load/save API's are in use.")
14912 (license license:asl2.0)))
14913
14914(define-public java-jakarta-regexp
14915 (package
14916 (name "java-jakarta-regexp")
14917 (version "1.5")
14918 (source
14919 (origin
14920 (method url-fetch)
14921 (uri (string-append
14922 "https://archive.apache.org/dist/jakarta/regexp/jakarta-regexp-"
14923 version ".tar.gz"))
14924 (sha256
14925 (base32
14926 "0zg9rmyif48dck0cv6ynpxv23mmcsx265am1fnnxss7brgw0ms3r"))))
14927 (build-system ant-build-system)
14928 (arguments
14929 `(#:test-target "test"
14930 #:phases
14931 (modify-phases %standard-phases
14932 (replace 'install
14933 (lambda* (#:key outputs #:allow-other-keys)
14934 (let* ((out (assoc-ref outputs "out"))
14935 (out-share (string-append out "/share/java")))
14936 (mkdir-p out-share)
14937 (for-each (lambda (name)
14938 (install-file name out-share))
14939 (find-files "build" "^jakarta-regexp-.*\\.jar$"))
14940 #t))))))
14941 (home-page "https://attic.apache.org/projects/jakarta-regexp.html")
14942 (synopsis "Regular expression parser generator for Java")
14943 (description "@code{jakarta-regexp} is an old regular expression parser
14944generator for Java.")
14945 (license license:asl2.0)))
14946
14947(define-public java-jline
14948 (package
14949 (name "java-jline")
14950 (version "1.0")
14951 (source (origin
14952 (method url-fetch)
14953 (uri (string-append "https://github.com/jline/jline1/archive/jline-"
14954 version ".tar.gz"))
14955 (sha256
14956 (base32
14957 "0bi3p6vrh7a6v0fbpb6rx9plpmx5zk3lr352xzdbz2jcxg499wir"))))
14958 (build-system ant-build-system)
14959 (arguments
14960 `(#:jar-name "jline.jar"
14961 #:source-dir "src/main/java"
14962 #:test-dir "src/test"
14963 #:phases
14964 (modify-phases %standard-phases
14965 (add-before 'build 'copy-resources
14966 (lambda _
14967 (copy-recursively "src/main/resources" "build/classes")
14968 #t)))))
14969 (native-inputs
14970 (list java-junit))
14971 (home-page "https://jline.github.io")
14972 (synopsis "Console input handling library")
14973 (description "JLine is a Java library for handling console input. It is
14974similar in functionality to BSD editline and GNU readline but with additional
14975features that bring it on par with the Z shell line editor.")
14976 (license license:bsd-3)))
14977
14978(define-public java-jline-2
14979 (package
14980 (inherit java-jline)
14981 (version "2.14.5")
14982 (source (origin
14983 (method url-fetch)
14984 (uri (string-append "https://github.com/jline/jline2/archive/jline-"
14985 version ".tar.gz"))
14986 (sha256
14987 (base32
14988 "1c6qa26mf0viw8hg4jnv72s7i1qb1gh1l8rrzcdvqhqhx82rkdlf"))))
14989 (arguments
14990 `(#:jdk ,icedtea-8
14991 ,@(package-arguments java-jline)))
14992 (inputs
14993 (list java-jansi-1 java-jansi-native))
14994 (native-inputs
14995 (list java-powermock-modules-junit4
14996 java-powermock-modules-junit4-common
14997 java-powermock-api-easymock
14998 java-powermock-api-support
14999 java-powermock-core
15000 java-powermock-reflect
15001 java-easymock
15002 java-jboss-javassist
15003 java-objenesis
15004 java-hamcrest-core
15005 java-cglib
15006 java-junit
15007 java-hawtjni))))
15008
15009(define-public java-jline-terminal
15010 (package
15011 (name "java-jline-terminal")
15012 (version "3.14.1")
15013 (source (origin
15014 (method git-fetch)
15015 (uri (git-reference
15016 (url "https://github.com/jline/jline3")
15017 (commit (string-append "jline-parent-" version))))
15018 (file-name (git-file-name name version))
15019 (sha256
15020 (base32
15021 "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr"))))
15022 (build-system ant-build-system)
15023 (arguments
15024 `(#:jar-name "jline-terminal.jar"
15025 #:jdk ,openjdk11
15026 #:tests? #f; TODO: tests fail on *.caps resource lookups
15027 #:source-dir "terminal/src/main/java"
15028 #:test-dir "terminal/src/test"
15029 #:phases
15030 (modify-phases %standard-phases
15031 (add-after 'unpack 'remove-build-file
15032 (lambda _
15033 ;; Conflicts with build directory generated by ant-build-system.
15034 (delete-file "build")))
15035 (add-after 'unpack 'patch-paths
15036 (lambda* (#:key inputs #:allow-other-keys)
15037 (substitute* "terminal/src/main/java/org/jline/utils/OSUtils.java"
15038 (("= \"infocmp\"")
15039 (string-append "= \"" (assoc-ref inputs "ncurses")
15040 "/bin/infocmp\""))
15041 (("= \"(s?tty)\"" _ cmd)
15042 (string-append "= \"" (assoc-ref inputs "coreutils")
15043 "/bin/" cmd "\"")))))
15044 ;; Resources are not added to the JAR by ant-build-system.
15045 (add-after 'build 'add-resources
15046 (lambda* (#:key jar-name source-dir #:allow-other-keys)
15047 (let ((build (string-append (getcwd) "/build")))
15048 (with-directory-excursion
15049 (string-append source-dir "/../resources")
15050 (apply invoke "jar" "-uvf"
15051 (string-append build "/jar/" jar-name)
15052 (find-files ".")))))))))
15053 (inputs
15054 (list ncurses)); infocmp
15055 (home-page "https://github.com/jline/jline3")
15056 (synopsis "Java JLine Terminal API and implementations")
15057 (description "JLine is a Java library for handling console input. It is
15058similar in functionality to BSD editline and GNU readline but with additional
15059features that bring it in par with ZSH line editor. People familiar with the
15060readline/editline capabilities for modern shells (such as bash and tcsh) will
15061find most of the command editing features of JLine to be familiar.
15062
15063This package includes the @var{Terminal} API and implementations.")
15064 (license license:bsd-3)))
15065
15066(define-public java-jline-reader
15067 (package
15068 (name "java-jline-reader")
15069 (version "3.14.1")
15070 (source (origin
15071 (method git-fetch)
15072 (uri (git-reference
15073 (url "https://github.com/jline/jline3")
15074 (commit (string-append "jline-parent-" version))))
15075 (file-name (git-file-name name version))
15076 (sha256
15077 (base32
15078 "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr"))))
15079 (build-system ant-build-system)
15080 (arguments
15081 `(#:jar-name "jline-reader.jar"
15082 #:jdk ,openjdk11
15083 #:source-dir "reader/src/main/java"
15084 #:test-dir "reader/src/test"
15085 #:phases
15086 (modify-phases %standard-phases
15087 (add-before 'build 'remove-build-file
15088 (lambda _
15089 ;; conflicts with build directory generated by ant-build-system
15090 (delete-file "build"))))))
15091 (native-inputs
15092 (list java-junit java-easymock))
15093 (inputs
15094 (list java-jline-terminal))
15095 (home-page "https://github.com/jline/jline3")
15096 (synopsis "Java JLine line reader")
15097 (description "JLine is a Java library for handling console input. It is
15098similar in functionality to BSD editline and GNU readline but with additional
15099features that bring it in par with ZSH line editor. People familiar with the
15100readline/editline capabilities for modern shells (such as bash and tcsh) will
15101find most of the command editing features of JLine to be familiar.
15102
15103This package includes the line reader.")
15104 (license license:bsd-3)))
15105
15106(define-public java-xmlunit
15107 (package
15108 (name "java-xmlunit")
15109 (version "2.5.1")
15110 (source (origin
15111 (method url-fetch)
15112 (uri (string-append "https://github.com/xmlunit/xmlunit/archive/v"
15113 version ".tar.gz"))
15114 (file-name (string-append name "-" version ".tar.gz"))
15115 (sha256
15116 (base32
15117 "035rivlnmwhfqj0fzviciv0bkh1h95ps1iwnh2kjcvdbk5nccm4z"))))
15118 (build-system ant-build-system)
15119 (arguments
15120 `(#:jar-name "java-xmlunit.jar"
15121 #:source-dir "xmlunit-core/src/main/java"
15122 #:test-dir "xmlunit-core/src/test"
15123 #:phases
15124 (modify-phases %standard-phases
15125 (add-before 'check 'copy-test-resources
15126 (lambda* (#:key inputs #:allow-other-keys)
15127 (copy-recursively (assoc-ref inputs "resources") "../test-resources")
15128 #t)))))
15129 (native-inputs
15130 `(("java-junit" ,java-junit)
15131 ("java-mockito-1" ,java-mockito-1)
15132 ("java-hamcrest-all" ,java-hamcrest-all)
15133 ("java-objenesis" ,java-objenesis)
15134 ("java-cglib" ,java-cglib)
15135 ("resources"
15136 ,(origin
15137 (method git-fetch)
15138 (uri (git-reference
15139 (url "https://github.com/xmlunit/test-resources")
15140 (commit "a590d2ae865c3e0455691d76ba8eefccc2215aec")))
15141 (file-name "java-xmlunit-test-resources")
15142 (sha256
15143 (base32
15144 "0r0glj37pg5l868yjz78gckr91cs8fysxxbp9p328dssssi91agr"))))))
15145 (home-page "https://www.xmlunit.org/")
15146 (synopsis "XML output testing")
15147 (description "XMLUnit provides you with the tools to verify the XML you
15148emit is the one you want to create. It provides helpers to validate against
15149an XML Schema, assert the values of XPath queries or compare XML documents
15150against expected outcomes.")
15151 (license license:asl2.0)))
15152
15153(define-public java-xmlunit-legacy
15154 (package
15155 (inherit java-xmlunit)
15156 (name "java-xmlunit-legacy")
15157 (arguments
15158 `(#:jar-name "java-xmlunit-legacy.jar"
15159 #:source-dir "xmlunit-legacy/src/main/java"
15160 #:test-dir "xmlunit-legacy/src/test"))
15161 (inputs
15162 (list java-xmlunit java-junit))
15163 (native-inputs
15164 `(("java-mockito-1" ,java-mockito-1)))))
15165
15166(define-public java-xmlunit-matchers
15167 (package
15168 (inherit java-xmlunit)
15169 (name "java-xmlunit-matchers")
15170 (arguments
15171 `(#:jar-name "java-xmlunit-matchers.jar"
15172 #:source-dir "xmlunit-matchers/src/main/java"
15173 #:test-dir "xmlunit-matchers/src/test"
15174 #:test-exclude
15175 ;; Cannot open xsd for http://www.xmlunit.org/test-support/Book.xsd
15176 (list "**/ValidationMatcherTest.java")
15177 #:phases
15178 (modify-phases %standard-phases
15179 (add-before 'build 'copy-test-class
15180 (lambda _
15181 (copy-file "xmlunit-core/src/test/java/org/xmlunit/TestResources.java"
15182 "xmlunit-matchers/src/test/java/org/xmlunit/TestResources.java")
15183 #t))
15184 (add-before 'build 'fix-test-resources-path
15185 (lambda _
15186 (substitute* (find-files "xmlunit-matchers/src/test" ".*.java")
15187 (("../test-resources") "test-resources"))
15188 #t))
15189 (add-before 'check 'copy-test-resources
15190 (lambda* (#:key inputs #:allow-other-keys)
15191 (copy-recursively (assoc-ref inputs "resources") "test-resources")
15192 #t)))))
15193 (inputs
15194 (list java-xmlunit java-junit))))
15195
15196(define-public java-openchart2
15197 (package
15198 (name "java-openchart2")
15199 (version "1.4.3")
15200 (source (origin
15201 (method url-fetch)
15202 (uri (string-append "http://download.approximatrix.com/openchart2/"
15203 "openchart2-" version ".source.zip"))
15204 (sha256
15205 (base32
15206 "1xq96zm5r02n1blja0072jmmsifmxc40lbyfbnmcnr6mw42frh4g"))))
15207 (build-system ant-build-system)
15208 (arguments
15209 `(#:test-target "test"
15210 #:phases
15211 (modify-phases %standard-phases
15212 (add-after 'unpack 'fix-junit-errors
15213 (lambda _
15214 (with-directory-excursion "unittest/src/com/approximatrix/charting/"
15215 (substitute* '("coordsystem/ticklocator/NumericXTickLocatorTest.java"
15216 "coordsystem/ticklocator/NumericYTickLocatorTest.java"
15217 "coordsystem/ticklocator/ObjectXTickLocatorTest.java"
15218 "model/DefaultChartDataModelConstraintsTest.java"
15219 "model/MultiScatterDataModelConstraintsTest.java"
15220 "model/threedimensional/DotPlotDataModelConstraintsTest.java")
15221 (("(assertEquals[^;]+);" before _)
15222 (string-append (string-drop-right before 2) ", 1E-6);"))))
15223 #t))
15224 (replace 'install (install-jars ".")))))
15225 (native-inputs
15226 (list unzip java-junit java-hamcrest-core))
15227 (home-page "https://approximatrix.com/products/openchart2/")
15228 (synopsis "Simple plotting for Java")
15229 (description "Openchart2 provides a simple, yet powerful, interface for
15230Java programmers to create two-dimensional charts and plots. The library
15231features an assortment of graph styles, including advanced scatter plots, bar
15232graphs, and pie charts.")
15233 (license license:lgpl2.1+)))
15234
15235(define-public java-commons-httpclient
15236 (package
15237 (name "java-commons-httpclient")
15238 (version "3.1")
15239 (source (origin
15240 (method url-fetch)
15241 (uri (string-append "mirror://apache/httpcomponents/"
15242 "commons-httpclient/source/commons-httpclient-"
15243 version "-src.tar.gz"))
15244 (sha256
15245 (base32
15246 "1wlpn3cfy3d4inxy6g7wxcsa8p7sshn6aldk9y4ia3lb879rd97r"))))
15247 (build-system ant-build-system)
15248 (arguments
15249 `(#:build-target "compile"
15250 #:test-target "test"
15251 #:tests? #f; requires junit-textui (junit 3)
15252 #:phases
15253 (modify-phases %standard-phases
15254 (add-before 'build 'fix-accent
15255 (lambda _
15256 (for-each (lambda (file)
15257 (with-fluids ((%default-port-encoding "ISO-8859-1"))
15258 (substitute* file
15259 (("\\* @author Ortwin .*") "* @author Ortwin Glueck\n"))))
15260 '("src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java"
15261 "src/examples/TrivialApp.java" "src/examples/ClientApp.java"
15262 "src/test/org/apache/commons/httpclient/TestHttps.java"
15263 "src/test/org/apache/commons/httpclient/TestURIUtil2.java"))
15264 #t))
15265 (replace 'install
15266 (lambda* (#:key outputs #:allow-other-keys)
15267 (invoke "ant" "dist"
15268 (string-append "-Ddist.home=" (assoc-ref outputs "out")
15269 "/share/java"))
15270 #t)))))
15271 (propagated-inputs
15272 `(("java-commons-logging" ,java-commons-logging-minimal)
15273 ("java-commons-codec" ,java-commons-codec)))
15274 (home-page "https://hc.apache.org")
15275 (synopsis "HTTP/1.1 compliant HTTP agent implementation")
15276 (description "This package contains an HTTP/1.1 compliant HTTP agent
15277implementation. It also provides reusable components for client-side
15278authentication, HTTP state management, and HTTP connection management.")
15279 (license license:asl2.0)))
15280
15281(define-public java-commons-vfs
15282 (package
15283 (name "java-commons-vfs")
15284 (version "2.2")
15285 (source (origin
15286 (method url-fetch)
15287 (uri (string-append "mirror://apache/commons/vfs/source/"
15288 "commons-vfs2-distribution-" version "-src.tar.gz"))
15289 (file-name (string-append name "-" version ".tar.gz"))
15290 (sha256
15291 (base32
15292 "1cnq1iaghbp4cslpnvwbp83i5v234x87irssqynhwpfgw7caf1s3"))
15293 (modules '((guix build utils)))
15294 (snippet
15295 '(begin
15296 (for-each delete-file
15297 (find-files "." "\\.jar$"))
15298 #t))))
15299 (build-system ant-build-system)
15300 (arguments
15301 `(#:jar-name "commons-vfs.jar"
15302 #:source-dir "commons-vfs2/src/main/java"
15303 #:test-dir "commons-vfs2/src/test"
15304 ; FIXME: tests depend on many things: apache sshd, hadoop, ftpserver, ...
15305 #:tests? #f
15306 #:phases
15307 (modify-phases %standard-phases
15308 (add-before 'build 'remove-hadoop-and-webdav
15309 ; Remove these files as they are not required and depend on difficult
15310 ; packages.
15311 (lambda _
15312 (for-each delete-file-recursively
15313 '("commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/webdav"
15314 "commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs"))
15315 #t)))))
15316 (inputs
15317 (list java-commons-collections4
15318 java-commons-compress
15319 java-commons-httpclient
15320 java-commons-logging-minimal
15321 java-commons-net
15322 java-jsch))
15323 (home-page "https://commons.apache.org/proper/commons-vfs/")
15324 (synopsis "Java file system library")
15325 (description "Commons VFS provides a single API for accessing various
15326different file systems. It presents a uniform view of the files from various
15327different sources, such as the files on local disk, on an HTTP server, or
15328inside a Zip archive.")
15329 (license license:asl2.0)))
15330
15331(define-public java-jakarta-oro
15332 (package
15333 (name "java-jakarta-oro")
15334 (version "2.0.8")
15335 (source (origin
15336 (method url-fetch)
15337 (uri (string-append "mirror://apache/jakarta/oro/"
15338 "jakarta-oro-" version ".tar.gz"))
15339 (sha256
15340 (base32
15341 "0rpmnsskiwmsy8r0sckz5n5dbvh3vkxx8hpm177c754r8xy3qksc"))
15342 (modules '((guix build utils)))
15343 (snippet
15344 `(begin
15345 (delete-file (string-append "jakarta-oro-" ,version ".jar"))
15346 #t))))
15347 (build-system ant-build-system)
15348 (arguments
15349 `(#:build-target "package"
15350 #:make-flags (list "-DDATE" "(no recorded date for reproducibility)")
15351 #:tests? #f; tests are run as part of the build process
15352 #:phases
15353 (modify-phases %standard-phases
15354 (replace 'install
15355 (install-jars ,(string-append "jakarta-oro-" version))))))
15356 (home-page "https://jakarta.apache.org/oro/")
15357 (synopsis "Text-processing for Java")
15358 (description "The Jakarta-ORO Java classes are a set of text-processing
15359Java classes that provide Perl5 compatible regular expressions, AWK-like
15360regular expressions, glob expressions, and utility classes for performing
15361substitutions, splits, filtering filenames, etc. This library is the successor
15362of the OROMatcher, AwkTools, PerlTools, and TextTools libraries originally
15363from ORO, Inc.")
15364 (license license:asl1.1)))
15365
15366(define-public java-native-access
15367 (package
15368 (name "java-native-access")
15369 (version "4.5.1")
15370 (source (origin
15371 (method url-fetch)
15372 (uri (string-append "https://github.com/java-native-access/jna/"
15373 "archive/" version ".tar.gz"))
15374 (file-name (string-append name "-" version ".tar.gz"))
15375 (sha256
15376 (base32
15377 "0zrpzkib6b905i018a9pqlzkqinphywr6y4jwv6mwp63jjqvqkd9"))
15378 (modules '((guix build utils)))
15379 (snippet
15380 `(begin
15381 (for-each delete-file (find-files "." ".*.jar"))
15382 (delete-file-recursively "native/libffi")
15383 (delete-file-recursively "dist")
15384 #t))))
15385 (build-system ant-build-system)
15386 (arguments
15387 `(#:tests? #f; FIXME: tests require reflections.jar
15388 #:test-target "test"
15389 #:make-flags (list "-Ddynlink.native=true")
15390 #:phases
15391 (modify-phases %standard-phases
15392 (add-before 'build 'fix-build.xml
15393 (lambda* (#:key inputs #:allow-other-keys)
15394 (substitute* "build.xml"
15395 ;; Since we removed the bundled ant.jar, give the correct path
15396 (("lib/ant.jar") (search-input-file inputs "/lib/ant.jar"))
15397 ;; We removed generated native libraries. We can only rebuild one
15398 ;; so don't fail if we can't find a native library for another architecture.
15399 (("zipfileset") "zipfileset erroronmissingarchive=\"false\""))
15400 ;; Copy test dependencies
15401 (copy-file (car (find-files (assoc-ref inputs "java-junit") "jar$"))
15402 "lib/junit.jar")
15403 (copy-file (car (find-files (assoc-ref inputs "java-hamcrest-core")
15404 "jar$"))
15405 "lib/hamcrest-core.jar")
15406 ;; FIXME: once reflections.jar is built, copy it to lib/test.
15407 #t))
15408 (add-before 'build 'build-native
15409 (lambda _
15410 (invoke "ant" "-Ddynlink.native=true" "native")
15411 #t))
15412 (replace 'install
15413 (install-jars "build")))))
15414 (inputs
15415 (list libffi libx11 libxt))
15416 (native-inputs
15417 (list gcc-7 java-junit java-hamcrest-core))
15418 (home-page "https://github.com/java-native-access/jna")
15419 (synopsis "Access to native shared libraries from Java")
15420 (description "JNA provides Java programs easy access to native shared
15421libraries without writing anything but Java code - no JNI or native code is
15422required. JNA allows you to call directly into native functions using natural
15423Java method invocation.")
15424 ;; Java Native Access project (JNA) is dual-licensed under 2
15425 ;; alternative Free licenses: LGPL 2.1 or later and Apache License 2.0.
15426 (license (list
15427 license:asl2.0
15428 license:lgpl2.1+))))
15429
15430(define-public java-native-access-5.14.0
15431 (package
15432 (inherit java-native-access)
15433 (name "java-native-access")
15434 (version "5.14.0")
15435 (source
15436 (origin
15437 (method git-fetch)
15438 (uri (git-reference
15439 (url "https://github.com/java-native-access/jna.git")
15440 (commit version)))
15441 (file-name (git-file-name name version))
15442 (sha256
15443 (base32 "0blf6ka69c3zywa74fjh8gykhzn3vgbvlxzy3v9znncb2a97v6bb"))
15444 (modules '((guix build utils)))
15445 (snippet
15446 `(begin
15447 (for-each delete-file (find-files "." ".*.jar"))
15448 (delete-file-recursively "native/libffi")
15449 (delete-file-recursively "dist")))))
15450 (arguments
15451 `(#:tests? #f
15452 #:test-target "test"
15453 #:make-flags (list "-Ddynlink.native=true")
15454 #:phases
15455 (modify-phases %standard-phases
15456 (add-before 'build 'fix-build.xml
15457 (lambda* (#:key inputs #:allow-other-keys)
15458 (let ((ant-jar (search-input-file inputs "/lib/ant.jar"))
15459 (asm-jar (car (find-files (assoc-ref inputs "java-asm")
15460 "asm.*\\.jar$"))))
15461 (substitute* "build.xml"
15462 (("lib/ant\\.jar") ant-jar)
15463 (("\\$lib/asm-8\\.0\\.1\\.jar") asm-jar)
15464 (("lib/asm-8\\.0\\.1\\.jar") asm-jar)
15465 (("<zipfileset") "<zipfileset erroronmissingarchive=\"false\""))
15466 (substitute* "build-ant-tools.xml"
15467 (("lib/ant\\.jar") ant-jar)
15468 (("lib/asm-8\\.0\\.1\\.jar") asm-jar)))
15469 (copy-file (car (find-files (assoc-ref inputs "java-junit") "jar$"))
15470 "lib/junit.jar")
15471 (copy-file (car (find-files (assoc-ref inputs "java-hamcrest-core")
15472 "jar$"))
15473 "lib/hamcrest-core.jar")))
15474 (add-before 'build 'build-native
15475 (lambda _
15476 (invoke "ant" "-Ddynlink.native=true" "native")))
15477 (add-before 'install 'create-pom
15478 (generate-pom.xml "pom.xml" "net.java.dev.jna"
15479 "jna-jpms" ,version))
15480 (add-before 'install 'keep-only-jna-jpms
15481 (lambda _
15482 ;; The build produces multiple jars. install-from-pom
15483 ;; expects exactly one. Remove all except jna-jpms.jar.
15484 (for-each delete-file
15485 (filter (lambda (f)
15486 (not (string-contains f "jna-jpms")))
15487 (find-files "build" "\\.jar$")))
15488 (for-each delete-file
15489 (find-files "lib" "\\.jar$"))))
15490 (replace 'install
15491 (install-from-pom "pom.xml")))))
15492 (native-inputs
15493 (modify-inputs (package-native-inputs java-native-access)
15494 (prepend java-asm-9)))))
15495
15496(define-public java-native-access-platform
15497 (package
15498 (inherit java-native-access)
15499 (name "java-native-access-platform")
15500 (arguments
15501 `(#:test-target "test"
15502 #:tests? #f; require jna-test.jar
15503 #:phases
15504 (modify-phases %standard-phases
15505 (add-before 'build 'chdir
15506 (lambda _
15507 (chdir "contrib/platform")
15508 #t))
15509 (add-after 'chdir 'fix-ant
15510 (lambda* (#:key inputs #:allow-other-keys)
15511 (substitute* "nbproject/project.properties"
15512 (("../../build/jna.jar")
15513 (search-input-file inputs "/share/java/jna.jar"))
15514 (("../../lib/hamcrest-core-.*.jar")
15515 (car (find-files (assoc-ref inputs "java-hamcrest-core")
15516 "jar$")))
15517 (("../../lib/junit.jar")
15518 (car (find-files (assoc-ref inputs "java-junit")
15519 "jar$"))))
15520 #t))
15521 (replace 'install
15522 (install-jars "dist")))))
15523 (inputs
15524 (list java-native-access))
15525 (synopsis "Cross-platform mappings for jna")
15526 (description "java-native-access-platform has cross-platform mappings
15527and mappings for a number of commonly used platform functions, including a
15528large number of Win32 mappings as well as a set of utility classes that
15529simplify native access.")))
15530
15531(define-public java-native-access-platform-5.14.0
15532 (package
15533 (inherit java-native-access-platform)
15534 (name "java-native-access-platform")
15535 (version (package-version java-native-access-5.14.0))
15536 (source (package-source java-native-access-5.14.0))
15537 (arguments
15538 `(#:build-target "jar"
15539 #:tests? #f
15540 #:modules ((guix build ant-build-system)
15541 (guix build utils)
15542 (guix build java-utils)
15543 (sxml simple))
15544 #:phases
15545 (modify-phases %standard-phases
15546 (add-before 'build 'chdir
15547 (lambda _
15548 (chdir "contrib/platform")
15549 #t))
15550 (add-after 'chdir 'fix-ant
15551 (lambda* (#:key inputs #:allow-other-keys)
15552 (let ((jna-jar (car (find-files (assoc-ref inputs "java-native-access")
15553 "jna-jpms.*\\.jar$")))
15554 (asm-jar (car (find-files (assoc-ref inputs "java-asm")
15555 "asm.*\\.jar$")))
15556 (ant-jar (search-input-file inputs "/lib/ant.jar")))
15557 (mkdir-p "../../build")
15558 (mkdir-p "../../lib")
15559 (copy-file jna-jar "../../build/jna.jar")
15560 (copy-file asm-jar "../../lib/asm-8.0.1.jar")
15561 (copy-file ant-jar "../../lib/ant.jar")
15562 (substitute* "build.xml"
15563 (("../../build/jna\\.jar") jna-jar)
15564 (("../../lib/asm-8\\.0\\.1\\.jar") asm-jar))
15565 (substitute* "../../build-ant-tools.xml"
15566 (("lib/ant\\.jar") ant-jar)
15567 (("lib/asm-8\\.0\\.1\\.jar") asm-jar))
15568 #t)))
15569 (add-before 'install 'create-pom
15570 (lambda _
15571 (call-with-output-file "pom.xml"
15572 (lambda (port)
15573 (sxml->xml
15574 `(*TOP*
15575 (*PI* xml "version=\"1.0\" encoding=\"UTF-8\"")
15576 (project
15577 (modelVersion "4.0.0")
15578 (groupId "net.java.dev.jna")
15579 (artifactId "jna-platform-jpms")
15580 (version ,,version)
15581 (dependencies
15582 (dependency
15583 (groupId "net.java.dev.jna")
15584 (artifactId "jna-jpms")
15585 (version ,,version)))))
15586 port)))))
15587 (add-before 'install 'keep-only-jna-platform-jpms
15588 (lambda _
15589 (for-each delete-file
15590 (filter (lambda (f)
15591 (not (string-contains f "jna-platform-jpms")))
15592 (append (find-files "build" "\\.jar$")
15593 (find-files "dist" "\\.jar$"))))))
15594 (replace 'install
15595 (install-from-pom "pom.xml")))))
15596 (native-inputs
15597 (modify-inputs (package-native-inputs java-native-access-platform)
15598 (prepend java-asm-9)))
15599 (inputs
15600 (list java-native-access-5.14.0))))
15601
15602(define-public java-jsch-agentproxy-core
15603 (package
15604 (name "java-jsch-agentproxy-core")
15605 (version "0.0.8")
15606 (source (origin
15607 (method url-fetch)
15608 (uri (string-append "https://github.com/ymnk/jsch-agent-proxy/archive/"
15609 version ".tar.gz"))
15610 (file-name (string-append name "-" version ".tar.gz"))
15611 (sha256
15612 (base32
15613 "02iqg6jbc1kxvfzqcg6wy9ygqxfm82bw5rf6vnswqy4y572niz4q"))))
15614 (build-system ant-build-system)
15615 (arguments
15616 `(#:jar-name "jsch-agentproxy-core.jar"
15617 #:source-dir "jsch-agent-proxy-core/src/main/java"
15618 #:tests? #f)); no tests
15619 (home-page "https://github.com/ymnk/jsch-agent-proxy")
15620 (synopsis "Core component of the proxy to ssh-agent and Pageant in Java")
15621 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15622and Pageant included Putty. It will be easily integrated into JSch, and users
15623will be allowed to use these programs for authentication.")
15624 (license license:bsd-3)))
15625
15626(define-public java-jsch-agentproxy-sshagent
15627 (package
15628 (inherit java-jsch-agentproxy-core)
15629 (name "java-jsch-agentproxy-sshagent")
15630 (arguments
15631 `(#:jar-name "jsch-agentproxy-sshagent.jar"
15632 #:source-dir "jsch-agent-proxy-sshagent/src/main/java"
15633 #:tests? #f)); no tests
15634 (inputs
15635 (list java-jsch-agentproxy-core))
15636 (synopsis "Proxy to ssh-agent")
15637 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15638and Pageant included in Putty. This component contains the code for a proxy to
15639ssh-agent.")))
15640
15641(define-public java-jsch-agentproxy-usocket-jna
15642 (package
15643 (inherit java-jsch-agentproxy-core)
15644 (name "java-jsch-agentproxy-usocket-jna")
15645 (arguments
15646 `(#:jar-name "jsch-agentproxy-usocket-jna.jar"
15647 #:source-dir "jsch-agent-proxy-usocket-jna/src/main/java"
15648 #:tests? #f)); no tests
15649 (inputs
15650 (list java-jsch-agentproxy-core java-native-access))
15651 (synopsis "USocketFactory implementation using JNA")
15652 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15653and Pageant included in Putty. This component contains an implementation of
15654USocketFactory using @dfn{JNA} (Java Native Access).")))
15655
15656(define-public java-jsch-agentproxy-pageant
15657 (package
15658 (inherit java-jsch-agentproxy-core)
15659 (name "java-jsch-agentproxy-pageant")
15660 (arguments
15661 `(#:jar-name "jsch-agentproxy-pageant.jar"
15662 #:source-dir "jsch-agent-proxy-pageant/src/main/java"
15663 #:tests? #f)); no tests
15664 (inputs
15665 (list java-jsch-agentproxy-core java-native-access
15666 java-native-access-platform))
15667 (synopsis "Proxy to pageant")
15668 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15669and Pageant included in Putty. This component contains the code for a proxy to
15670pageant.")))
15671
15672(define-public java-jsch-agentproxy-usocket-nc
15673 (package
15674 (inherit java-jsch-agentproxy-core)
15675 (name "java-jsch-agentproxy-usocket-nc")
15676 (arguments
15677 `(#:jar-name "jsch-agentproxy-usocket-nc.jar"
15678 #:source-dir "jsch-agent-proxy-usocket-nc/src/main/java"
15679 #:tests? #f)); no tests
15680 (inputs
15681 (list java-jsch-agentproxy-core))
15682 (synopsis "USocketFactory implementation using netcat")
15683 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15684and Pageant included in Putty. This component contains an implementation of
15685USocketFactory using netcat.")))
15686
15687(define-public java-jsch-agentproxy-connector-factory
15688 (package
15689 (inherit java-jsch-agentproxy-core)
15690 (name "java-jsch-agentproxy-connector-factory")
15691 (arguments
15692 `(#:jar-name "jsch-agentproxy-connector-factory.jar"
15693 #:source-dir "jsch-agent-proxy-connector-factory/src/main/java"
15694 #:tests? #f)); no tests
15695 (inputs
15696 (list java-jsch-agentproxy-core java-jsch-agentproxy-sshagent
15697 java-jsch-agentproxy-usocket-jna java-jsch-agentproxy-pageant
15698 java-jsch-agentproxy-usocket-nc))
15699 (synopsis "Connector factory for jsch agent proxy")
15700 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15701and Pageant included in Putty. This component contains a connector factory.")))
15702
15703(define-public java-jsch-agentproxy-jsch
15704 (package
15705 (inherit java-jsch-agentproxy-core)
15706 (name "java-jsch-agentproxy-jsch")
15707 (arguments
15708 `(#:jar-name "jsch-agentproxy-jsch.jar"
15709 #:source-dir "jsch-agent-proxy-jsch/src/main/java"
15710 #:tests? #f)); no tests
15711 (inputs
15712 (list java-jsch java-jsch-agentproxy-core))
15713 (synopsis "JSch integration library for agentproxy")
15714 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15715and Pageant included in Putty. This component contains a library to use
15716jsch-agent-proxy with JSch.")))
15717
15718(define-public java-apache-ivy
15719 (package
15720 (name "java-apache-ivy")
15721 (version "2.4.0")
15722 (source (origin
15723 (method url-fetch)
15724 (uri (string-append "mirror://apache/ant/ivy/" version
15725 "/apache-ivy-" version "-src.tar.gz"))
15726 (sha256
15727 (base32
15728 "1xkfn57g2m7l6y0xdq75x5rnrgk52m9jx2xah70g3ggl8750hbr0"))
15729 (patches
15730 (search-patches
15731 "java-apache-ivy-port-to-latest-bouncycastle.patch"))))
15732 (build-system ant-build-system)
15733 (arguments
15734 `(#:jar-name "ivy.jar"
15735 #:tests? #f
15736 #:phases
15737 (modify-phases %standard-phases
15738 (add-before 'build 'remove-example
15739 (lambda _
15740 (delete-file-recursively "src/example")
15741 #t))
15742 (add-before 'build 'copy-resources
15743 (lambda _
15744 (with-directory-excursion "src/java"
15745 (for-each (lambda (file)
15746 (install-file file (string-append "../../build/classes/" (dirname file))))
15747 (append
15748 (find-files "." ".*.css")
15749 (find-files "." ".*.ent")
15750 (find-files "." ".*.html")
15751 (find-files "." ".*.properties")
15752 (find-files "." ".*.xsd")
15753 (find-files "." ".*.xsl")
15754 (find-files "." ".*.xml"))))
15755 #t))
15756 (add-before 'build 'fix-vfs
15757 (lambda _
15758 (substitute*
15759 '("src/java/org/apache/ivy/plugins/repository/vfs/VfsRepository.java"
15760 "src/java/org/apache/ivy/plugins/repository/vfs/VfsResource.java")
15761 (("import org.apache.commons.vfs") "import org.apache.commons.vfs2"))
15762 #t))
15763 (add-before 'install 'copy-manifest
15764 (lambda _
15765 (install-file "META-INF/MANIFEST.MF" "build/classes/META-INF")
15766 #t))
15767 (add-before 'install 'repack
15768 (lambda _
15769 (invoke "jar" "-cmf" "build/classes/META-INF/MANIFEST.MF" "build/jar/ivy.jar"
15770 "-C" "build/classes" ".")))
15771 (add-after 'install 'install-bin
15772 (lambda* (#:key outputs #:allow-other-keys)
15773 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
15774 (ivy (string-append bin "/ivy"))
15775 (jar (string-append (assoc-ref outputs "out") "/share/java/ivy.jar")))
15776 (mkdir-p bin)
15777 (with-output-to-file ivy
15778 (lambda _
15779 (display (string-append
15780 "#!" (which "sh") "\n"
15781 "if [[ -z $CLASSPATH ]]; then\n"
15782 " cp=\"" (getenv "CLASSPATH") ":" jar "\"\n"
15783 "else\n"
15784 " cp=\"" (getenv "CLASSPATH") ":" jar ":$CLASSPATH\"\n"
15785 "fi\n"
15786 (which "java") " -cp $cp org.apache.ivy.Main $@\n"))))
15787 (chmod ivy #o755)
15788 #t))))))
15789 (inputs
15790 (list java-bouncycastle
15791 java-commons-cli
15792 java-commons-collections
15793 java-commons-httpclient
15794 java-commons-lang
15795 java-commons-vfs
15796 java-jakarta-oro
15797 java-jsch
15798 java-jsch-agentproxy-core
15799 java-jsch-agentproxy-connector-factory
15800 java-jsch-agentproxy-jsch
15801 java-junit))
15802 (home-page "https://ant.apache.org/ivy")
15803 (synopsis "Dependency manager for the Java programming language")
15804 (description "Ivy is a tool for managing (recording, tracking, resolving
15805and reporting) project dependencies. It is characterized by the following:
15806
15807@itemize
15808@item flexibility and configurability - Ivy is essentially process agnostic
15809 and is not tied to any methodology or structure. Instead it provides the
15810 necessary flexibility and configurability to be adapted to a broad range
15811 of dependency management and build processes.
15812@item tight integration with Apache Ant - while available as a standalone tool,
15813 Ivy works particularly well with Apache Ant providing a number of
15814 powerful Ant tasks ranging from dependency resolution to dependency
15815 reporting and publication.
15816@end itemize")
15817 (license license:asl2.0)))
15818
15819(define-public java-eclipse-sisu-inject
15820 (package
15821 (name "java-eclipse-sisu-inject")
15822 (version "0.3.5")
15823 (source (origin
15824 (method git-fetch)
15825 (uri (git-reference
15826 (url "https://github.com/eclipse/sisu.inject/")
15827 (commit (string-append "releases/" version))))
15828 (file-name (git-file-name name version))
15829 (sha256
15830 (base32
15831 "1yh434b8pi8cwmpk825fbvbnkkk2cwd4gxxjaygg8i9j0q3l9zp3"))))
15832 (build-system ant-build-system)
15833 (arguments
15834 `(#:jar-name "eclipse-sisu-inject.jar"
15835 #:source-dir "org.eclipse.sisu.inject/src"
15836 #:tests? #f; no tests
15837 #:phases
15838 (modify-phases %standard-phases
15839 (replace 'install
15840 (install-from-pom "org.eclipse.sisu.inject/pom.xml")))))
15841 (propagated-inputs
15842 (list java-guice java-sisu-inject-parent-pom))
15843 (inputs
15844 (list java-guice-servlet
15845 java-javax-inject
15846 java-javaee-servletapi
15847 java-junit
15848 java-slf4j-api
15849 java-jsr305
15850 java-jsr250
15851 java-cdi-api
15852 java-osgi-framework
15853 java-osgi-util-tracker
15854 java-testng))
15855 (home-page "https://www.eclipse.org/sisu/")
15856 (synopsis "Classpath scanning, auto-binding, and dynamic auto-wiring")
15857 (description "Sisu is a modular JSR330-based container that supports
15858classpath scanning, auto-binding, and dynamic auto-wiring. Sisu uses
15859Google-Guice to perform dependency injection and provide the core JSR330
15860support, but removes the need to write explicit bindings in Guice modules.
15861Integration with other containers via the Eclipse Extension Registry and the
15862OSGi Service Registry is a goal of this project.")
15863 (license license:epl1.0)))
15864
15865(define java-sisu-inject-parent-pom
15866 (package
15867 (inherit java-eclipse-sisu-inject)
15868 (name "java-sisu-inject-parent-pom")
15869 (arguments
15870 `(#:tests? #f
15871 #:phases
15872 (modify-phases %standard-phases
15873 (delete 'configure)
15874 (delete 'build)
15875 (replace 'install
15876 (install-pom-file "pom.xml")))))
15877 (propagated-inputs '())))
15878
15879(define-public java-eclipse-sisu-plexus
15880 (package
15881 (name "java-eclipse-sisu-plexus")
15882 (version "0.3.5")
15883 (source (origin
15884 (method git-fetch)
15885 (uri (git-reference
15886 (url "https://github.com/eclipse/sisu.plexus")
15887 (commit (string-append "releases/" version))))
15888 (file-name (git-file-name name version))
15889 (sha256
15890 (base32
15891 "0lm5h0dmh41ffcwd32qnk3a87d360am36yq7168ikkyqa8jxkx28"))
15892 (modules '((guix build utils)))
15893 (snippet
15894 '(begin
15895 (for-each delete-file (find-files "." ".*.jar"))
15896 (rename-file "org.eclipse.sisu.plexus.tests/src"
15897 "org.eclipse.sisu.plexus.tests/java")
15898 #t))))
15899 (build-system ant-build-system)
15900 (arguments
15901 `(#:jar-name "eclipse-sisu-plexus.jar"
15902 #:source-dir "org.eclipse.sisu.plexus/src"
15903 #:test-dir "org.eclipse.sisu.plexus.tests"
15904 #:test-exclude
15905 (list
15906 ;; This test fails probably because we can't generate the necessary
15907 ;; meta-inf files.
15908 "**/PlexusLoggingTest.*"
15909 ;; FIXME: This test fails because of some injection error
15910 "**/PlexusRequirementTest.*")
15911 #:jdk ,icedtea-8
15912 #:phases
15913 (modify-phases %standard-phases
15914 (add-before 'build 'copy-resources
15915 (lambda _
15916 (install-file "org.eclipse.sisu.plexus/META-INF/plexus/components.xml"
15917 "build/classes/META-INF/plexus")
15918 #t))
15919 (add-before 'check 'build-test-jar
15920 (lambda _
15921 (with-directory-excursion "org.eclipse.sisu.plexus.tests/resources/component-jar/src/main/"
15922 (mkdir "build")
15923 (with-directory-excursion "java"
15924 (apply invoke "javac" "-cp"
15925 (string-append (getenv "CLASSPATH")
15926 ":../../../../../build/classes")
15927 (find-files "." ".*.java"))
15928 (for-each (lambda (file) (install-file file (string-append "../build/" file)))
15929 (find-files "." ".*.jar")))
15930 (mkdir-p "build/META-INF/plexus")
15931 (copy-file "resources/META-INF/plexus/components.xml"
15932 "build/META-INF/plexus/components.xml")
15933 (with-directory-excursion "build"
15934 (invoke "jar" "cf" "../../../component-jar-0.1.jar" ".")))
15935 (with-directory-excursion "org.eclipse.sisu.plexus.tests/"
15936 (copy-recursively "META-INF" "../build/test-classes/META-INF")
15937 (substitute* "java/org/eclipse/sisu/plexus/DefaultPlexusContainerTest.java"
15938 (("resources/component-jar")
15939 "org.eclipse.sisu.plexus.tests/resources/component-jar")))
15940 #t))
15941 (replace 'install
15942 (install-from-pom "org.eclipse.sisu.plexus/pom.xml")))))
15943 (propagated-inputs
15944 (list java-jsr250
15945 java-plexus-classworlds
15946 java-plexus-utils
15947 java-plexus-component-annotations
15948 java-cdi-api
15949 java-eclipse-sisu-inject
15950 java-sisu-plexus-parent-pom))
15951 (inputs
15952 (list java-osgi-framework
15953 java-slf4j-api
15954 java-javax-inject
15955 java-guice
15956 java-guava
15957 java-aopalliance
15958 java-cglib))
15959 (native-inputs
15960 (list java-junit))
15961 (home-page "https://www.eclipse.org/sisu/")
15962 (synopsis "Plexus support for the sisu container")
15963 (description "Sisu is a modular JSR330-based container that supports
15964classpath scanning, auto-binding, and dynamic auto-wiring. This package
15965adds Plexus support to the Sisu-Inject container.")
15966 (license license:epl1.0)))
15967
15968(define java-sisu-plexus-parent-pom
15969 (package
15970 (inherit java-eclipse-sisu-plexus)
15971 (name "java-sisu-plexus-parent-pom")
15972 (arguments
15973 `(#:tests? #f
15974 #:phases
15975 (modify-phases %standard-phases
15976 (delete 'configure)
15977 (delete 'build)
15978 (replace 'install
15979 (install-pom-file "pom.xml")))))
15980 (propagated-inputs
15981 `(("java-sonatype-oss-parent-pom-9" ,java-sonatype-oss-parent-pom-9)))))
15982
15983(define-public java-commons-compiler
15984 (package
15985 (name "java-commons-compiler")
15986 (version "3.0.8")
15987 (source (origin
15988 (method git-fetch)
15989 (uri (git-reference
15990 (url "https://github.com/janino-compiler/janino")
15991 (commit "91aa95686d1e4ca3b16a984a03a38686572331b2")))
15992 (file-name (string-append name "-" version))
15993 (sha256
15994 (base32
15995 "04hfdl59sgh20qkxzgnibvs8f9hy6n7znxwpk611y5d89977y62r"))
15996 (modules '((guix build utils)))
15997 (snippet
15998 '(begin
15999 (for-each delete-file
16000 (find-files "." "\\.jar$"))
16001 #t))))
16002 (build-system ant-build-system)
16003 (arguments
16004 `(#:jar-name "commons-compiler.jar"
16005 #:source-dir "commons-compiler/src/main"
16006 #:tests? #f)); no tests
16007 (home-page "https://github.com/janino-compiler/janino")
16008 (synopsis "Java compiler")
16009 (description "Commons-compiler contains an API for janino, including the
16010@code{IExpressionEvaluator}, @code{IScriptEvaluator}, @code{IClassBodyEvaluator}
16011and @code{ISimpleCompiler} interfaces.")
16012 (license license:bsd-3)))
16013
16014(define-public java-janino
16015 (package
16016 (inherit java-commons-compiler)
16017 (name "java-janino")
16018 (arguments
16019 `(#:jar-name "janino.jar"
16020 #:source-dir "src/main/java"
16021 #:phases
16022 (modify-phases %standard-phases
16023 (add-before 'configure 'chdir
16024 (lambda _
16025 (chdir "janino")
16026 #t)))))
16027 (inputs
16028 (list java-commons-compiler))
16029 (native-inputs
16030 (list java-junit java-hamcrest-core))
16031 (description "Janino is a Java compiler. Janino can compile a set of
16032source files to a set of class files like @code{javac}, but also compile a
16033Java expression, block, class body or source file in memory, load the bytecode
16034and execute it directly in the same JVM. @code{janino} can also be used for
16035static code analysis or code manipulation.")))
16036
16037(define-public java-logback-core
16038 (package
16039 (name "java-logback-core")
16040 (version "1.2.3")
16041 (source (origin
16042 (method git-fetch)
16043 (uri (git-reference
16044 (url "https://github.com/qos-ch/logback/")
16045 (commit (string-append "v_" version))))
16046 (file-name (git-file-name name version))
16047 (sha256
16048 (base32
16049 "055jbfpg3l5qw7pw2snkdag0gjkb4vcxfg9110cqqyc40k2nd17z"))
16050 (modules '((guix build utils)))
16051 (snippet
16052 '(delete-file-recursively "logback-access/lib"))))
16053 (build-system ant-build-system)
16054 (arguments
16055 `(#:jar-name "logback.jar"
16056 #:source-dir "src/main/java"
16057 #:test-dir "src/test"
16058 #:test-exclude
16059 ;; These tests fail with Unable to set MockitoNamingPolicy on cglib generator
16060 ;; which creates FastClasses
16061 (list "**/AllCoreTest.*"
16062 "**/AutoFlushingObjectWriterTest.*"
16063 "**/PackageTest.*"
16064 "**/ResilientOutputStreamTest.*"
16065 ;; And we still don't want to run abstract classes
16066 "**/Abstract*.*")
16067 #:phases
16068 (modify-phases %standard-phases
16069 (add-before 'configure 'chdir
16070 (lambda _ (chdir "logback-core"))))))
16071 (inputs
16072 (list java-javax-mail
16073 java-javaee-servletapi
16074 java-commons-compiler
16075 java-janino))
16076 (native-inputs
16077 (list java-junit
16078 java-hamcrest-core
16079 java-mockito-1
16080 java-cglib
16081 java-objenesis
16082 java-joda-time))
16083 (home-page "https://logback.qos.ch")
16084 (synopsis "Logging for java")
16085 (description "Logback is intended as a successor to the popular log4j project.
16086This module lays the groundwork for the other two modules.")
16087 ;; Either epl1.0 or lgpl2.1
16088 (license (list license:epl1.0
16089 license:lgpl2.1))))
16090
16091(define-public java-logback-classic
16092 (package
16093 (inherit java-logback-core)
16094 (name "java-logback-classic")
16095 (arguments
16096 `(#:jar-name "logback-classic.jar"
16097 #:source-dir "src/main/java"
16098 #:test-dir "src/test"
16099 #:tests? #f; tests require more packages: h2, greenmail, hsql, subethamail, slf4j, log4j, felix
16100 #:jdk ,icedtea-8
16101 #:phases
16102 (modify-phases %standard-phases
16103 (add-before 'configure 'chdir
16104 (lambda _
16105 (chdir "logback-classic")
16106 #t))
16107 (replace 'build
16108 (lambda* (#:key inputs #:allow-other-keys)
16109 (mkdir-p "build/classes")
16110 (setenv "CLASSPATH"
16111 (string-join
16112 (apply append (map (lambda (input)
16113 (find-files (assoc-ref inputs input)
16114 ".*.jar"))
16115 '("java-logback-core" "java-slf4j-api"
16116 "java-commons-compiler" "java-javaee-servletapi"
16117 "groovy")))
16118 ":"))
16119 (apply invoke "groovyc" "-d" "build/classes" "-j"
16120 (find-files "src/main/" ".*\\.(groovy|java)$"))
16121 (invoke "ant" "jar")
16122 #t)))))
16123 (inputs
16124 (modify-inputs inputs
16125 (prepend java-logback-core java-slf4j-api)))
16126 (native-inputs
16127 (list groovy))
16128 (description "Logback is intended as a successor to the popular log4j project.
16129This module can be assimilated to a significantly improved version of log4j.
16130Moreover, @code{logback-classic} natively implements the slf4j API so that you
16131can readily switch back and forth between logback and other logging frameworks
16132such as log4j or @code{java.util.logging} (JUL).")))
16133
16134(define-public java-jgit
16135 (package
16136 (name "java-jgit")
16137 (version "4.7.0.201704051617-r")
16138 (source (origin
16139 (method url-fetch)
16140 (uri (string-append "https://repo1.maven.org/maven2/"
16141 "org/eclipse/jgit/org.eclipse.jgit/"
16142 version "/org.eclipse.jgit-"
16143 version "-sources.jar"))
16144 (sha256
16145 (base32
16146 "13ii4jn02ynzq6i7gsyi21k2i94jpc85wf6bcm31q4cyvzv0mk4k"))))
16147 (build-system ant-build-system)
16148 (arguments
16149 `(#:tests? #f ; There are no tests to run.
16150 #:jar-name "jgit.jar"
16151 ;; JGit must be built with a JDK supporting Java 8.
16152 #:jdk ,icedtea-8
16153 ;; Target our older default JDK.
16154 #:make-flags (list "-Dtarget=1.7")
16155 #:phases
16156 (modify-phases %standard-phases
16157 ;; The jar file generated by the default build.xml does not include
16158 ;; the text properties files, so we need to add them.
16159 (add-after 'build 'add-properties
16160 (lambda* (#:key jar-name #:allow-other-keys)
16161 (with-directory-excursion "src"
16162 (apply invoke "jar" "-uf"
16163 (string-append "../build/jar/" jar-name)
16164 (find-files "." "\\.properties$")))
16165 #t)))))
16166 (inputs
16167 (list java-classpathx-servletapi java-javaewah java-jsch
16168 java-slf4j-api))
16169 (home-page "https://eclipse.org/jgit/")
16170 (synopsis "Java library implementing the Git version control system")
16171 (description "JGit is a lightweight, pure Java library implementing the
16172Git version control system, providing repository access routines, support for
16173network protocols, and core version control algorithms.")
16174 (license license:edl1.0)))
16175
16176;; For axoloti.
16177(define-public java-jgit-4.2
16178 (package (inherit java-jgit)
16179 (version "4.2.0.201601211800-r")
16180 (source (origin
16181 (method url-fetch)
16182 (uri (string-append "https://repo1.maven.org/maven2/"
16183 "org/eclipse/jgit/org.eclipse.jgit/"
16184 version "/org.eclipse.jgit-"
16185 version "-sources.jar"))
16186 (sha256
16187 (base32
16188 "15gm537iivhnzlkjym4x3wn5jqdjdragsw9pdpzqqg21nrc817mm"))))
16189 (build-system ant-build-system)
16190 (arguments
16191 (substitute-keyword-arguments (package-arguments java-jgit)
16192 ((#:phases phases)
16193 `(modify-phases ,phases
16194 (add-after 'unpack 'use-latest-javaewah-API
16195 (lambda _
16196 (substitute* "src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java"
16197 (("wordinbits") "WORD_IN_BITS"))))))))
16198 (inputs
16199 (list java-javaewah java-jsch java-slf4j-api))))
16200
16201(define-public java-jgit-7
16202 (package
16203 (name "java-jgit")
16204 (version "7.0.0.202409031743-r")
16205 (source (origin
16206 (method url-fetch)
16207 (uri (string-append "https://repo1.maven.org/maven2/"
16208 "org/eclipse/jgit/org.eclipse.jgit/"
16209 version "/org.eclipse.jgit-"
16210 version "-sources.jar"))
16211 (sha256
16212 (base32
16213 "0hdl11cbb6zy39zw4jpg0ip00nikilw7dajrqky6d3l18khjby5k"))))
16214 (build-system ant-build-system)
16215 (arguments
16216 `(#:tests? #f ; sources jar has no tests
16217 #:jar-name "jgit.jar"
16218 #:jdk ,openjdk17
16219 #:modules ((guix build ant-build-system)
16220 (guix build utils)
16221 (guix build java-utils)
16222 (srfi srfi-1))
16223 #:phases
16224 (modify-phases %standard-phases
16225 (add-after 'build 'add-properties
16226 (lambda* (#:key jar-name #:allow-other-keys)
16227 (with-directory-excursion "src"
16228 (apply invoke "jar" "-uf"
16229 (string-append "../build/jar/" jar-name)
16230 (find-files "." "\\.properties$")))
16231 (let* ((pkgs (delete-duplicates
16232 (filter-map
16233 (lambda (f)
16234 (let* ((d (dirname f))
16235 (d (if (string-prefix? "./" d)
16236 (substring d 2)
16237 d)))
16238 (and (not (string-null? d))
16239 (not (string=? d "."))
16240 (string-map
16241 (lambda (c)
16242 (if (char=? c #\/) #\. c))
16243 d))))
16244 (with-directory-excursion "build/classes"
16245 (find-files "." "\\.class$")))))
16246 (export-pkg (string-join (sort pkgs string<?) ",")))
16247 ;; Write manifest with continuation lines for long values.
16248 ;; Manifest spec: max 72 bytes per line, continuation
16249 ;; lines start with a single space.
16250 (call-with-output-file "osgi-manifest.mf"
16251 (lambda (port)
16252 (for-each
16253 (lambda (line)
16254 (let loop ((s line))
16255 (if (<= (string-length s) 70)
16256 (begin (display s port) (newline port))
16257 (begin (display (substring s 0 70) port)
16258 (newline port)
16259 (loop (string-append
16260 " " (substring s 70)))))))
16261 (list
16262 "Bundle-ManifestVersion: 2"
16263 "Bundle-SymbolicName: org.eclipse.jgit"
16264 (string-append "Bundle-Version: " ,version)
16265 (string-append "Export-Package: " export-pkg)
16266 (string-append
16267 "Import-Package: com.googlecode.javaewah,"
16268 "javax.crypto,javax.management,javax.net.ssl,"
16269 "org.apache.commons.codec.digest,"
16270 "org.slf4j,org.xml.sax,org.xml.sax.helpers")))
16271 (newline port))))
16272 (invoke "jar" "ufm" (string-append "build/jar/" jar-name)
16273 "osgi-manifest.mf")))
16274 (replace 'install
16275 (install-from-pom
16276 "src/META-INF/maven/org.eclipse.jgit/org.eclipse.jgit/pom.xml")))))
16277 (inputs
16278 (list java-commons-codec java-javaewah-1.2.3 java-slf4j-api))
16279 (home-page "https://eclipse.org/jgit/")
16280 (synopsis "Java library implementing the Git version control system")
16281 (description "JGit is a lightweight, pure Java library implementing the
16282Git version control system, providing repository access routines, support for
16283network protocols, and core version control algorithms.")
16284 (license license:edl1.0)))
16285
16286(define-public java-jgit-ssh-jsch-7
16287 (package
16288 (name "java-jgit-ssh-jsch")
16289 (version "7.0.0.202409031743-r")
16290 (source (origin
16291 (method url-fetch)
16292 (uri (string-append "https://repo1.maven.org/maven2/"
16293 "org/eclipse/jgit/org.eclipse.jgit.ssh.jsch/"
16294 version "/org.eclipse.jgit.ssh.jsch-"
16295 version "-sources.jar"))
16296 (sha256
16297 (base32
16298 "1vb3zkd2iz6bpz2nq8xxi5d5jdb8hy8jq7gka2ck22azm9bb6p94"))))
16299 (build-system ant-build-system)
16300 (arguments
16301 `(#:tests? #f ; sources jar has no tests
16302 #:jar-name "jgit-ssh-jsch.jar"
16303 #:jdk ,openjdk17
16304 #:phases
16305 (modify-phases %standard-phases
16306 (add-after 'build 'add-osgi-manifest
16307 (lambda _
16308 ;; The NetBeans wrapper module has an empty jar target and
16309 ;; relies on Bundle-SymbolicName from the Maven Central jar.
16310 (call-with-output-file "osgi-manifest.mf"
16311 (lambda (port)
16312 (display (string-append
16313 "Bundle-ManifestVersion: 2\n"
16314 "Bundle-SymbolicName: org.eclipse.jgit.ssh.jsch\n"
16315 "Bundle-Version: " ,version "\n"
16316 "Export-Package: org.eclipse.jgit.transport.ssh"
16317 ".jsch\n"
16318 "Import-Package: com.jcraft.jsch,"
16319 "org.eclipse.jgit.errors,"
16320 "org.eclipse.jgit.internal,"
16321 "org.eclipse.jgit.internal.transport.ssh,"
16322 "org.eclipse.jgit.nls,"
16323 "org.eclipse.jgit.transport,"
16324 "org.eclipse.jgit.util,"
16325 "org.eclipse.jgit.util.io,"
16326 "org.slf4j\n")
16327 port)))
16328 (invoke "jar" "ufm" "build/jar/jgit-ssh-jsch.jar"
16329 "osgi-manifest.mf")))
16330 (replace 'install
16331 (install-from-pom
16332 "src/META-INF/maven/org.eclipse.jgit/org.eclipse.jgit.ssh.jsch/pom.xml")))))
16333 (inputs
16334 (list java-jgit-7 java-jsch-0.1.72 java-jzlib-1.1.3 java-slf4j-api))
16335 (home-page "https://eclipse.org/jgit/")
16336 (synopsis "SSH support for JGit using JSch")
16337 (description "This package provides SSH transport support for JGit
16338using the JSch library.")
16339 (license license:edl1.0)))
16340
16341(define-public java-jgit-gpg-bc-7
16342 (package
16343 (name "java-jgit-gpg-bc")
16344 (version "7.0.0.202409031743-r")
16345 (source (origin
16346 (method url-fetch)
16347 (uri (string-append "https://repo1.maven.org/maven2/"
16348 "org/eclipse/jgit/org.eclipse.jgit.gpg.bc/"
16349 version "/org.eclipse.jgit.gpg.bc-"
16350 version "-sources.jar"))
16351 (sha256
16352 (base32
16353 "1123x1i19h3a674mc44csdx7spn5qh6qk3klkfih4am9ak81w27n"))))
16354 (build-system ant-build-system)
16355 (arguments
16356 `(#:tests? #f
16357 #:jar-name "jgit-gpg-bc.jar"
16358 #:jdk ,openjdk17
16359 #:phases
16360 (modify-phases %standard-phases
16361 (add-after 'build 'add-osgi-manifest
16362 (lambda _
16363 (call-with-output-file "osgi-manifest.mf"
16364 (lambda (port)
16365 (display (string-append
16366 "Bundle-ManifestVersion: 2\n"
16367 "Bundle-SymbolicName: org.eclipse.jgit.gpg.bc\n"
16368 "Bundle-Version: " ,version "\n"
16369 "Export-Package: org.eclipse.jgit.gpg.bc.internal\n"
16370 "Import-Package: org.bouncycastle.asn1,"
16371 "org.bouncycastle.bcpg,"
16372 "org.bouncycastle.gpg,"
16373 "org.bouncycastle.gpg.keybox,"
16374 "org.bouncycastle.openpgp,"
16375 "org.bouncycastle.openpgp.operator,"
16376 "org.bouncycastle.openpgp.operator.jcajce,"
16377 "org.bouncycastle.util.encoders,"
16378 "org.eclipse.jgit.api.errors,"
16379 "org.eclipse.jgit.lib,"
16380 "org.eclipse.jgit.nls,"
16381 "org.eclipse.jgit.transport,"
16382 "org.eclipse.jgit.util,"
16383 "org.slf4j\n")
16384 port)))
16385 (invoke "jar" "ufm" "build/jar/jgit-gpg-bc.jar"
16386 "osgi-manifest.mf")))
16387 (replace 'install
16388 (install-from-pom
16389 "src/META-INF/maven/org.eclipse.jgit/org.eclipse.jgit.gpg.bc/pom.xml")))))
16390 (inputs
16391 (list java-bouncycastle-1.77 java-jgit-7 java-slf4j-api))
16392 (native-inputs (list unzip))
16393 (home-page "https://eclipse.org/jgit/")
16394 (synopsis "GPG support for JGit using Bouncy Castle")
16395 (description "This package provides GPG commit signing support for
16396JGit using the Bouncy Castle cryptographic library.")
16397 (license license:edl1.0)))
16398
16399(define-public java-jsonp-api
16400 (package
16401 (name "java-jsonp-api")
16402 (version "1.1.6")
16403 (source (origin
16404 (method git-fetch)
16405 (uri (git-reference
16406 (url "https://github.com/eclipse-ee4j/jsonp")
16407 (commit (string-append "1.1-" version "-RELEASE"))))
16408 (file-name (git-file-name name version))
16409 (sha256
16410 (base32
16411 "0zrj03hkr3jdmqlb4ipjr37cqpp2q2814qpmxi7srlwpdqs0ibgc"))))
16412 (build-system ant-build-system)
16413 (arguments
16414 `(#:jar-name "jsonp-api.jar"
16415 #:tests? #f
16416 #:source-dir "api/src/main/java"
16417 #:test-dir "api/src/test"))
16418 (home-page "https://eclipse-ee4j.github.io/jsonp/")
16419 (synopsis "JSON Processing in Java")
16420 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
16421parse, generate, transform and query) JSON messages. It produces and
16422consumes JSON text in a streaming fashion (similar to StAX API for XML)
16423and allows building a Java object model for JSON text using API classes
16424(similar to DOM API for XML).")
16425 ;; either gpl2 only with classpath exception, or epl2.0.
16426 (license (list license:gpl2
16427 license:epl2.0))))
16428
16429(define-public java-jsonp-impl
16430 (package
16431 (inherit java-jsonp-api)
16432 (name "java-jsonp-impl")
16433 (arguments
16434 `(#:jar-name "jsonp-impl.jar"
16435 #:tests? #f
16436 #:source-dir "impl/src/main/java"
16437 #:test-dir "impl/src/test"
16438 #:phases
16439 (modify-phases %standard-phases
16440 (add-before 'build 'copy-resources
16441 (lambda _
16442 (copy-recursively
16443 "impl/src/main/resources/"
16444 "build/classes")
16445 #t)))))
16446 (propagated-inputs
16447 (list java-jsonp-api))
16448 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
16449parse, generate, transform and query) JSON messages. This package contains
16450a reference implementation of that API.")))
16451
16452(define-public java-jakarta-json
16453 (package
16454 (name "java-jakarta-json")
16455 (version "2.1.3")
16456 (source (origin
16457 (method git-fetch)
16458 (uri (git-reference
16459 (url "https://github.com/jakartaee/jsonp-api")
16460 (commit (string-append version "-RELEASE"))))
16461 (file-name (git-file-name name version))
16462 (sha256
16463 (base32
16464 "1q600harqfhlf763l75j4fx7ai7ybp7ga06aiky2a2hg8mhz0s5f"))))
16465 (build-system ant-build-system)
16466 (arguments
16467 `(#:jar-name "jakarta-json.jar"
16468 #:source-dir "api/src/main/java"
16469 #:tests? #f; no tests
16470 #:jdk ,openjdk11))
16471 (home-page "https://github.com/jakartaee/jsonp-api")
16472 (synopsis "Portable API for JSON handling in Java")
16473 (description "This project contains API and Compatible Implementation of
16474Jakarta JSON Processing specification. Jakarta JSON Processing provides
16475portable APIs to parse, generate, transform, and query JSON documents.")
16476 ;; with classpath exception
16477 (license license:epl2.0)))
16478
16479(define-public java-parsson
16480 (package
16481 (name "java-parsson")
16482 (version "1.1.5")
16483 (source (origin
16484 (method git-fetch)
16485 (uri (git-reference
16486 (url "https://github.com/eclipse-ee4j/parsson")
16487 (commit version)))
16488 (file-name (git-file-name name version))
16489 (sha256
16490 (base32
16491 "06vvr6qv1ihnk212gdxg4x0sd61lgxk7wf062s7gym5k2h7fms0p"))))
16492 (build-system ant-build-system)
16493 (arguments
16494 `(#:jar-name "parsson.jar"
16495 #:source-dir "impl/src/main/java"
16496 #:test-dir "impl/src/test"
16497 #:use-java-modules? #t
16498 #:jdk ,openjdk11
16499 #:phases
16500 (modify-phases %standard-phases
16501 (add-after 'unpack 'copy-resources
16502 (lambda _
16503 (copy-recursively "impl/src/main/resources"
16504 "build/classes"))))))
16505 (inputs
16506 (list java-jakarta-json))
16507 (native-inputs
16508 (list java-junit))
16509 (home-page "https://github.com/eclipse-ee4j/parsson")
16510 (synopsis "Implementation of Jakarta JSON API")
16511 (description "Eclipse Parsson is an implementation of the Jakarta JSON
16512Processing specification.")
16513 ;; with classpath exception
16514 (license license:epl2.0)))
16515
16516(define-public java-jakarta-activation-api
16517 (package
16518 (name "java-jakarta-activation-api")
16519 (version "2.1.4")
16520 (source (origin
16521 (method git-fetch)
16522 (uri (git-reference
16523 (url "https://github.com/jakartaee/jaf-api")
16524 (commit version)))
16525 (file-name (git-file-name name version))
16526 (sha256
16527 (base32
16528 "125bf475cb0mdyhn1lj3c8gbwngbd28x10vnknq86zrc1vq4m6gx"))))
16529 (build-system ant-build-system)
16530 (arguments
16531 `(#:jar-name "jakarta-activation-api.jar"
16532 #:source-dir "api/src/main/java"
16533 #:tests? #f ;; has no tests
16534 #:jdk ,openjdk11))
16535 (home-page "https://github.com/jakartaee/jaf-api")
16536 (synopsis "Collection of Java activation")
16537 (description "Jakarta Activation lets you take advantage of standard
16538services to: determine the type of arbitrary piece of data; encapsulate access
16539to it; discover the operations available on it; and instantiate the
16540appropriate bean to perform the operation(s).")
16541 (license license:bsd-3)))
16542
16543(define-public java-jakarta-annotations-api
16544 (package
16545 (name "java-jakarta-annotations-api")
16546 (version "2.1.1")
16547 (source (origin
16548 (method git-fetch)
16549 (uri (git-reference
16550 (url "https://github.com/jakartaee/common-annotations-api")
16551 (commit version)))
16552 (file-name (git-file-name name version))
16553 (sha256
16554 (base32
16555 "0xq2n2pijal5p75vl9dz10i6hhdmaxw5q8j3aza717xkpxxby9p6"))))
16556 (build-system ant-build-system)
16557 (arguments
16558 `(#:jar-name "jakarta-annotations-api.jar"
16559 #:source-dir "api/src/main/java"
16560 #:tests? #f; no tests
16561 #:jdk ,openjdk11))
16562 (home-page "https://github.com/jakartaee/common-annotations-api")
16563 (synopsis "Collection of Java annotations")
16564 (description "Jakarta Annotations defines a collection of annotations
16565representing common semantic concepts that enable a declarative style of
16566programming that applies across a variety of Java technologies.")
16567 ;; with classpath exception
16568 (license (list license:epl2.0
16569 license:gpl2))))
16570
16571(define-public java-xmp
16572 (package
16573 (name "java-xmp")
16574 (version "5.1.3")
16575 (source (origin
16576 (method url-fetch)
16577 (uri (string-append "http://download.macromedia.com/pub/developer"
16578 "/xmp/sdk/XMPCoreJava-" version ".zip"))
16579 (sha256
16580 (base32
16581 "14nai2mmsg7l5ya2y5mx4w4lr1az3sk2fjz6hiy4zdrsavgvl1g7"))))
16582 (build-system ant-build-system)
16583 (arguments
16584 `(#:build-target "build"
16585 #:tests? #f; no tests
16586 #:phases
16587 (modify-phases %standard-phases
16588 (add-after 'unpack 'chdir
16589 (lambda _
16590 (chdir "XMPCore")
16591 #t))
16592 (add-before 'build 'fix-timestamp
16593 (lambda _
16594 (substitute* "build.xml"
16595 (("\\$\\{BuildDate\\}") "1970 Jan 01 00:00:00-GMT"))
16596 #t))
16597 (replace 'install
16598 (install-jars "."))
16599 (add-after 'install 'install-doc
16600 (lambda* (#:key outputs #:allow-other-keys)
16601 (copy-recursively
16602 "docs"
16603 (string-append (assoc-ref outputs "out") "/share/doc/java-xmp"))
16604 #t)))))
16605 (native-inputs
16606 (list unzip))
16607 (home-page "https://www.adobe.com/devnet/xmp.html")
16608 (synopsis "Extensible Metadat Platform (XMP) support in Java")
16609 (description "Adobe's Extensible Metadata Platform (XMP) is a labeling
16610technology that allows you to embed data about a file, known as metadata,
16611into the file itself. The XMP Toolkit for Java is based on the C++ XMPCore
16612library and the API is similar.")
16613 (license license:bsd-3)))
16614
16615(define-public java-args4j
16616 (package
16617 (name "java-args4j")
16618 (version "2.33")
16619 (source (origin
16620 (method git-fetch)
16621 (uri (git-reference
16622 (url "https://github.com/kohsuke/args4j")
16623 (commit (string-append "args4j-site-" version))))
16624 (file-name (git-file-name name version))
16625 (sha256
16626 (base32
16627 "0w061fg65qrsm1a0lz0vyprsyidj31krjb459qi2lw0y78xza26s"))))
16628 (build-system ant-build-system)
16629 (arguments
16630 `(#:jar-name "args4j.jar"
16631 #:source-dir "args4j/src"
16632 #:test-dir "args4j/test"
16633 #:test-exclude
16634 (list "**/ExampleTest.*"
16635 "**/ExternalConfiguredTest.*" ; fails to find a file
16636 ;; We still don't want to run abstract classes
16637 "**/Abstract*.*")
16638 #:phases
16639 (modify-phases %standard-phases
16640 (add-before 'check 'fix-test-dir
16641 (lambda _
16642 (substitute* "build.xml"
16643 (("/java\">") "\">"))
16644 #t))
16645 (add-before 'build 'copy-resources
16646 (lambda _
16647 (let ((from-prefix "args4j/src/org/kohsuke/args4j/")
16648 (to-prefix "build/classes/org/kohsuke/args4j/"))
16649 (for-each (lambda (f)
16650 (install-file
16651 (string-append from-prefix f)
16652 (string-append to-prefix (dirname f))))
16653 (list "Messages.properties"
16654 "Messages_de.properties"
16655 "Messages_en.properties"
16656 "Messages_ru.properties"
16657 "spi/Messages.properties"
16658 "spi/Messages_de.properties"
16659 "spi/Messages_en.properties"
16660 "spi/Messages_ru.properties")))
16661 #t)))))
16662 (native-inputs
16663 (list java-junit))
16664 (home-page "https://args4j.kohsuke.org/")
16665 (synopsis "Command line parser library")
16666 (description "Args4j is a small Java class library that makes it easy to
16667parse command line options/arguments in your CUI application.")
16668 (license license:expat)))
16669
16670(define-public java-argparse4j
16671 (package
16672 (name "java-argparse4j")
16673 (version "0.9.0")
16674 (source (origin
16675 (method git-fetch)
16676 (uri (git-reference
16677 (url "https://github.com/argparse4j/argparse4j")
16678 (commit (string-append "argparse4j-" version))))
16679 (file-name (git-file-name name version))
16680 (sha256
16681 (base32
16682 "1i0j3zs1ln48n0g8a90vqbv6528mcswhzys6252yp0c8w1ai64fb"))))
16683 (build-system ant-build-system)
16684 (arguments
16685 (list #:jar-name "java-argparse4j.jar"
16686 #:source-dir "main/src/main/"
16687 #:test-dir "main/src/test/"
16688 #:jdk openjdk11
16689 #:phases #~(modify-phases %standard-phases
16690 (add-after 'unpack 'copy-resources
16691 (lambda _
16692 (copy-recursively "main/src/test/resources"
16693 "target/test-classes")
16694 (copy-recursively "main/src/main/resources"
16695 "build/classes")))
16696 (replace 'install
16697 (install-from-pom "pom.xml")))))
16698 (inputs (list java-junit))
16699 (home-page "https://argparse4j.github.io/")
16700 (synopsis "Java command-line argument parser library")
16701 (description "Argparse4j is a command line argument parser library for
16702Java based on Python's @code{argparse} module.")
16703 (license license:expat)))
16704
16705(define-public java-metadata-extractor
16706 (package
16707 (name "java-metadata-extractor")
16708 (version "2.19.0")
16709 (source (origin
16710 (method git-fetch)
16711 (uri (git-reference
16712 (url "https://github.com/drewnoakes/metadata-extractor")
16713 (commit version)))
16714 (file-name (git-file-name name version))
16715 (sha256
16716 (base32
16717 "1axnw47n06a116g8bml2l6rxx92grxp935gspyhz4pz868m7hrna"))))
16718 (build-system ant-build-system)
16719 (arguments
16720 `(#:jar-name "metadata-extractor.jar"
16721 #:source-dir "Source"
16722 #:test-dir "Tests"
16723 #:phases
16724 (modify-phases %standard-phases
16725 (add-before 'build 'fix-xmp-path
16726 (lambda _
16727 ;; This version of metadata-extractor depends on java-xmp 6, which
16728 ;; is non-free. These changes allow using java-xmp 5, which is
16729 ;; the last free-software version of java-xmp.
16730 (substitute* (find-files "." ".*.java")
16731 (("com.adobe.internal.xmp") "com.adobe.xmp"))
16732 (substitute* "Source/com/drew/metadata/xmp/XmpReader.java"
16733 (("\\.setXMPNodesToLimit.*") ";"))
16734 ;; Test failure, most likely because we use a different java-xmp
16735 ;; version.
16736 (delete-file "Tests/com/drew/metadata/xmp/XmpReaderTest.java")))
16737 (add-before 'check 'fix-test-dir
16738 (lambda _
16739 (substitute* "build.xml"
16740 (("/java\">") "\">"))
16741 #t)))))
16742 (propagated-inputs
16743 (list java-xmp))
16744 (native-inputs
16745 (list java-hamcrest-core java-junit))
16746 (home-page "https://github.com/drewnoakes/metadata-extractor")
16747 (synopsis "Extract metadata from image and video files")
16748 (description "Metadata-extractor is a straightforward Java library for
16749reading metadata from image files. It is able to read metadata in Exif,
16750IPTC, XMP, ICC and more formats.")
16751 (license license:asl2.0)))
16752
16753(define-public java-svg-salamander
16754 (package
16755 (name "java-svg-salamander")
16756 (version "1.1.2")
16757 (source (origin
16758 (method git-fetch)
16759 (uri (git-reference
16760 (url "https://github.com/blackears/svgSalamander")
16761 (commit (string-append "v" version))))
16762 (file-name (git-file-name name version))
16763 (sha256
16764 (base32
16765 "1zv3kjdkf6iqf02x6ln76254y634j2ji448y706a65lsbfjmmicf"))
16766 (modules '((guix build utils)))
16767 (snippet
16768 '(begin
16769 (for-each delete-file (find-files "." ".*.jar"))
16770 #t))
16771 (patches
16772 (search-patches "java-svg-salamander-Fix-non-det.patch"))))
16773 (build-system ant-build-system)
16774 (arguments
16775 `(#:tests? #f; no tests
16776 #:phases
16777 (modify-phases %standard-phases
16778 (add-after 'unpack 'chdir
16779 (lambda _
16780 (chdir "svg-core")
16781 #t))
16782 (add-before 'build 'copy-jars
16783 (lambda* (#:key inputs #:allow-other-keys)
16784 (copy-file (car (find-files (assoc-ref inputs "javacc") "\\.jar$"))
16785 "../libraries/javacc.jar")
16786 (copy-file (car (find-files (assoc-ref inputs "ant") "ant\\.jar$"))
16787 "../libraries/ant.jar")
16788 #t))
16789 (replace 'install
16790 (install-jars "dist")))))
16791 (native-inputs
16792 (list javacc))
16793 (home-page "https://github.com/blackears/svgSalamander")
16794 (synopsis "SVG engine for Java")
16795 (description "SVG Salamander is an SVG engine for Java that's designed
16796to be small, fast, and allow programmers to use it with a minimum of fuss.
16797It's in particular targeted for making it easy to integrate SVG into Java
16798games and making it much easier for artists to design 2D game content - from
16799rich interactive menus to charts and graphcs to complex animations.")
16800 (license license:bsd-2)))
16801
16802(define-public java-jboss-transaction-api-spec
16803 (package
16804 (name "java-jboss-transaction-api-spec")
16805 (version "1.2+1.1.1")
16806 (source (origin
16807 (method git-fetch)
16808 (uri (git-reference
16809 (url "https://github.com/jboss/jboss-transaction-api_spec")
16810 (commit "jboss-transaction-api_1.2_spec-1.1.1.Final")))
16811 (file-name (git-file-name name version))
16812 (sha256
16813 (base32
16814 "1xbfq5hvb86izflydxrqqv3k26c1ba2m0ap6m97shqrsdi9by4wy"))))
16815 (build-system ant-build-system)
16816 (arguments
16817 `(#:jar-name "java-jboss-transaction-api_spec.jar"
16818 #:source-dir "src/main/java"
16819 #:tests? #f)); no tests
16820 (inputs
16821 (list java-cdi-api java-jboss-interceptors-api-spec))
16822 (home-page "https://github.com/jboss/jboss-transaction-api_spec")
16823 (synopsis "Generic transaction management API in Java")
16824 (description "Java-jboss-transaction-api-spec implements the Transactions
16825API. A transaction is a unit of work containing one or more operations
16826involving one or more shared resources having ACID (Atomicity, Consistency,
16827Isolation and Durability) properties.")
16828 ;; either gpl2 only with classpath exception or cddl.
16829 (license (list license:gpl2 license:cddl1.0))))
16830
16831(define-public java-picocli
16832 (package
16833 (name "java-picocli")
16834 (version "4.3.2")
16835 (source (origin
16836 (method git-fetch)
16837 (uri (git-reference
16838 (url "https://github.com/remkop/picocli")
16839 (commit (string-append "v" version))))
16840 (file-name (git-file-name name version))
16841 (sha256
16842 (base32
16843 "1sxp6rxjfgjd98ly14b3d15dvxkm5wg4g46w12jyhmr0kmkaca3c"))))
16844 (build-system ant-build-system)
16845 (arguments
16846 `(#:jar-name "picocli.jar"
16847 #:source-dir "src/main/java"
16848 ;; Tests require missing dependencies (junitparams, system-rules)
16849 #:tests? #f))
16850 (home-page "https://picocli.info")
16851 (synopsis "REPL for the JVM")
16852 (description "Picocli is a framework for building command line applications
16853for the JVM. It supports colors, autocompletion, subcommands, and more. Written
16854in Java, usable from Groovy, Kotlin, Scala, etc.")
16855 (license license:asl2.0)))
16856
16857(define-public java-pj
16858 (package
16859 (name "java-pj")
16860 (version "20150107")
16861 (source (origin
16862 (method url-fetch)
16863 (uri (string-append "https://www.cs.rit.edu/~ark/pjsrc"
16864 version ".jar"))
16865 (sha256
16866 (base32
16867 "078xwaivl2qqjc07r0vk6kzpqlcb1bcar80p8r5qigh34hpr86d3"))
16868 (modules '((guix build utils)))
16869 (snippet
16870 '(for-each delete-file
16871 (find-files "." "\\.class$")))))
16872 (build-system ant-build-system)
16873 (arguments
16874 (list
16875 #:tests? #false ;there are none
16876 #:phases
16877 #~(modify-phases %standard-phases
16878 (add-after 'unpack 'chdir
16879 (lambda _ (chdir "src/pj")))
16880 (add-after 'chdir 'patch-source-directory
16881 (lambda _
16882 (substitute* "compile"
16883 (("SRCDIR1=/home/ark/public_html/pj/lib")
16884 (string-append "SRCDIR1=" (getcwd) "/lib")))))
16885 (replace 'build
16886 (lambda _
16887 (invoke "bash" "./compile" "linux")
16888 (with-directory-excursion "lib"
16889 (apply invoke "jar" "cf" (string-append "pj" #$version ".jar")
16890 (find-files "." "\\.class$")))))
16891 (replace 'install (install-jars ".")))))
16892 (home-page "https://www.cs.rit.edu/~ark/pj.shtml")
16893 (synopsis "Parallel programming in Java")
16894 (description "Parallel Java (PJ) is an API and middleware for parallel
16895programming in 100% Java on shared memory multiprocessor (SMP) parallel
16896computers, cluster parallel computers, and hybrid SMP cluster parallel
16897computers.")
16898 (license license:gpl3+)))
16899
16900(define-public java-jetbrains-annotations
16901 (package
16902 (name "java-jetbrains-annotations")
16903 (version "19.0.0")
16904 (source (origin
16905 (method git-fetch)
16906 (uri (git-reference
16907 (url "https://github.com/JetBrains/java-annotations")
16908 (commit version)))
16909 (file-name (git-file-name name version))
16910 (sha256
16911 (base32
16912 "0z6i1xs60cd5ffz23c49sq68wn5mphhs3xpar1n93ppama2ng80v"))))
16913 (build-system ant-build-system)
16914 (arguments
16915 `(#:jar-name "jetbrains-annotations.jar"
16916 #:source-dir "common/src/main/java:java8/src/main/java"
16917 #:tests? #f)); no tests
16918 (home-page "https://github.com/JetBrains/java-annotations")
16919 (synopsis "Annotations for Java and other JVM languages")
16920 (description "This package contains a set of Java annotations which can be
16921used in JVM-based languages. They serve as an additional documentation and
16922can be interpreted by IDEs and static analysis tools to improve code analysis.")
16923 (license license:expat)))
16924
16925(define-public java-javaparser
16926 (package
16927 (name "java-javaparser")
16928 (version "3.16.1")
16929 (source (origin
16930 (method git-fetch)
16931 (uri (git-reference
16932 (url "https://github.com/javaparser/javaparser")
16933 (commit (string-append "javaparser-parent-" version))))
16934 (file-name (git-file-name name version))
16935 (sha256
16936 (base32
16937 "1a4jk12ffa31fa0y8vda0739vpfj1206p0nha842b7bixbvwamv9"))
16938 (modules '((guix build utils)))
16939 (snippet
16940 '(begin
16941 (for-each delete-file
16942 (find-files "." "\\.jar$"))
16943 #t))))
16944 (build-system ant-build-system)
16945 (arguments
16946 `(#:tests? #f; tests require jbehave and junit5
16947 #:phases
16948 (modify-phases %standard-phases
16949 (add-before 'build 'fill-template
16950 (lambda _
16951 (with-directory-excursion "javaparser-core/src/main"
16952 (copy-file "java-templates/com/github/javaparser/JavaParserBuild.java"
16953 "java/com/github/javaparser/JavaParserBuild.java")
16954 (substitute* "java/com/github/javaparser/JavaParserBuild.java"
16955 (("\\$\\{project.version\\}") ,version)
16956 (("\\$\\{project.name\\}") "javaparser")
16957 (("\\$\\{project.build.finalName\\}") "javaparser")
16958 (("\\$\\{maven.version\\}") "fake")
16959 (("\\$\\{maven.build.version\\}") "fake")
16960 (("\\$\\{build.timestamp\\}") "0")
16961 (("\\$\\{java.vendor\\}") "Guix")
16962 (("\\$\\{java.vendor.url\\}") "https://gnu.org/software/guix")
16963 (("\\$\\{java.version\\}") "1.8")
16964 (("\\$\\{os.arch\\}") "any")
16965 (("\\$\\{os.name\\}") "Guix")
16966 (("\\$\\{os.version\\}") "not available")))
16967 #t))
16968 (add-before 'build 'generate-javacc
16969 (lambda _
16970 (with-directory-excursion "javaparser-core/src/main/java"
16971 (invoke "java" "javacc" "../javacc/java.jj"))
16972 #t))
16973 (add-before 'build 'copy-javacc-support
16974 (lambda _
16975 (with-directory-excursion "javaparser-core/src/main"
16976 (copy-recursively "javacc-support" "java"))
16977 #t))
16978 (replace 'build
16979 (lambda _
16980 (define (build name)
16981 (format #t "Building ~a~%" name)
16982 (delete-file-recursively "build/classes")
16983 (mkdir-p "build/classes")
16984 (apply invoke "javac"
16985 "-cp" (string-append (getenv "CLASSPATH") ":"
16986 (string-join (find-files "build/jar" ".")
16987 ":"))
16988 "-d" "build/classes"
16989 (find-files (string-append name "/src/main/java")
16990 ".*.java"))
16991 (invoke "jar" "-cf" (string-append "build/jar/" name ".jar")
16992 "-C" "build/classes" "."))
16993 (mkdir-p "build/classes")
16994 (mkdir-p "build/test-classes")
16995 (mkdir-p "build/jar")
16996 (build "javaparser-core")
16997 (build "javaparser-core-serialization")
16998 (build "javaparser-core-generators")
16999 (build "javaparser-core-metamodel-generator")
17000 (build "javaparser-symbol-solver-core")
17001 #t))
17002 (replace 'install
17003 (install-jars "build/jar")))))
17004 (inputs
17005 (list java-guava java-jboss-javassist java-jsonp-api))
17006 (native-inputs
17007 (list javacc))
17008 (home-page "https://javaparser.org/")
17009 (synopsis "Parser for Java")
17010 (description
17011 "This project contains a set of libraries implementing a Java 1.0 - Java
1701211 Parser with advanced analysis functionalities.")
17013 (license (list
17014 ;; either lgpl or asl
17015 license:lgpl3+
17016 license:asl2.0))))
17017
17018(define-public tla2tools
17019 ;; This package was originally based on the "v1.8.0" tag, but that merely
17020 ;; points to the moving master branch. That might be because the ‘latest
17021 ;; release’ at GitHub is currently 1.7.1. We'll see! For now, rather than
17022 ;; downgrade to 1.7.1 proper, use the commit that we originally dubbed 1.8.0.
17023 (let* ((release "1.7.1")
17024 (revision "0")
17025 (commit "6932e19083fc6df42473464857fc1280cb5aaecc"))
17026 (package
17027 (name "tla2tools")
17028 (version (git-version release revision commit))
17029 (source (origin
17030 (method git-fetch)
17031 (uri (git-reference
17032 (url "https://github.com/tlaplus/tlaplus")
17033 (commit commit)))
17034 (file-name (git-file-name name version))
17035 (sha256
17036 (base32
17037 "1hhx8gmn81k8qrkx4p7ppinmygxga9fqffd626wkvhjgg2ky8lhs"))
17038 (patches
17039 (search-patches "tla2tools-build-xml.patch"))
17040 (modules '((guix build utils)))
17041 (snippet
17042 '(begin
17043 ;; Remove packaged libraries (see 'replace-libs below)
17044 (for-each delete-file (find-files "." ".*.jar$"))))))
17045 (build-system ant-build-system)
17046 (arguments
17047 (let* ((tlatools "tlatools/org.lamport.tlatools/")
17048 (build-xml (string-append tlatools "customBuild.xml")))
17049 `(#:jdk ,openjdk11
17050 #:modules ((guix build ant-build-system)
17051 (guix build utils)
17052 (ice-9 match)
17053 (srfi srfi-26))
17054 #:make-flags '("-f" ,build-xml)
17055 #:phases
17056 (modify-phases %standard-phases
17057 ;; Replace packed libs with references to jars in store
17058 (add-after 'unpack 'replace-libs
17059 (lambda* (#:key inputs #:allow-other-keys)
17060 (define (input-jar input)
17061 (car (find-files (assoc-ref inputs input) "\\.jar$")))
17062 (for-each
17063 (match-lambda
17064 ((file . input)
17065 (symlink (input-jar input)
17066 (string-append ,tlatools "/lib/" file))))
17067 '(("gson/gson-2.8.6.jar" . "java-gson")
17068 ("javax.mail/mailapi-1.6.3.jar" . "java-javax-mail")
17069 ("jline/jline-terminal-3.14.1.jar" . "java-jline-terminal")
17070 ("jline/jline-reader-3.14.1.jar" . "java-jline-reader")
17071 ("lsp/org.eclipse.lsp4j.debug-0.10.0.jar" .
17072 "java-eclipse-lsp4j-debug")
17073 ("lsp/org.eclipse.lsp4j.jsonrpc-0.10.0.jar" .
17074 "java-eclipse-lsp4j-jsonrpc")
17075 ("lsp/org.eclipse.lsp4j.jsonrpc.debug-0.10.0.jar" .
17076 "java-eclipse-lsp4j-jsonrpc-debug")
17077 ("junit-4.12.jar" . "java-junit")
17078 ("easymock-3.3.1.jar" . "java-easymock")))
17079 ;; Retain a tiny subset of the original X-Git-*
17080 ;; manifest values just to aid in debugging.
17081 (substitute* ,build-xml
17082 (("\\$\\{git.tag\\}") (string-append "v" ,release)))))
17083 (add-before 'check 'prepare-tests
17084 (lambda _
17085 ;; The pcal tests write to .cfg files.
17086 (for-each (cut chmod <> #o644)
17087 (find-files (string-append ,tlatools
17088 "/test-model/pcal")
17089 "\\.cfg$"))))
17090 (replace 'install
17091 (lambda* (#:key inputs outputs #:allow-other-keys)
17092 (let* ((share (string-append (assoc-ref outputs "out") "/share/java"))
17093 (jar-name "tla2tools.jar"); set in project.properties
17094 (jar (string-append ,tlatools
17095 "/dist/" jar-name))
17096 (java-cp (string-append share "/" jar-name))
17097 (bin (string-append (assoc-ref outputs "out") "/bin"))
17098 (java (search-input-file inputs "/bin/java")))
17099 (install-file jar share)
17100 (mkdir-p bin)
17101 ;; Generate wrapper scripts for bin/, which invoke common
17102 ;; commands within tla2tools.jar. Users can still invoke
17103 ;; tla2tools.jar for the rest.
17104 (for-each
17105 (match-lambda
17106 ((wrapper . class)
17107 (let ((file (string-append bin "/" wrapper)))
17108 (begin
17109 (with-output-to-file file
17110 (lambda _
17111 (display
17112 (string-append
17113 "#!/bin/sh\n"
17114 java " -XX:+UseParallelGC " " -cp " java-cp " " class " \"$@\""))))
17115 (chmod file #o755)))))
17116 ;; bin/wrapper . java-class
17117 '(("pcal" . "pcal.trans")
17118 ("tlatex" . "tla2tex.TLA")
17119 ("tla2sany" . "tla2sany.SANY")
17120 ("tlc2" . "tlc2.TLC")
17121 ("tlc2-repl" . "tlc2.REPL"))))))))))
17122 (native-inputs
17123 (list java-junit java-easymock))
17124 (inputs
17125 (list java-javax-mail
17126 java-gson-latest
17127 java-jline-terminal
17128 java-jline-reader
17129 java-eclipse-lsp4j-jsonrpc
17130 java-eclipse-lsp4j-jsonrpc-debug
17131 java-eclipse-lsp4j-debug))
17132 (home-page "https://lamport.azurewebsites.net/tla/tools.html")
17133 (synopsis "TLA+ tools (analyzer, TLC, TLATeX, PlusCal translator)")
17134 (description "TLA+ is a high-level language for modeling programs and
17135systems---especially concurrent and distributed ones. It's based on the idea
17136that the best way to describe things precisely is with simple
17137mathematics. TLA+ and its tools are useful for eliminating fundamental design
17138errors, which are hard to find and expensive to correct in code.
17139
17140The following TLA+ tools are available in this distribution:
17141
17142@itemize
17143@item The Syntactic Analyzer: A parser and syntax checker for
17144 TLA+ specifications;
17145@item TLC: A model checker and simulator for a subclass of \"executable\" TLA+
17146 specifications;
17147@item TLATeX: A program for typesetting TLA+ specifications;
17148@item Beta test versions of 1-3 for the TLA+2 language; and
17149@item The PlusCal translator.
17150@end itemize")
17151 (license license:expat))))
17152
17153;; Deprecated at 2026-06-01
17154(define-deprecated/public-alias abcl
17155 (@ (gnu packages lisp) abcl))
17156
17157;;;
17158;;; Avoid adding new packages to the end of this file. To reduce the chances
17159;;; of a merge conflict, place them above by existing packages with similar
17160;;; functionality or similar names.
17161;;;