projects/guix·blob beam-team · refs

16764 lines · 700.3 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 'disable-os-version-check
403 ;; allow build on linux major version change
404 (lambda _
405 (setenv "DISABLE_HOTSPOT_OS_VERSION_CHECK" "ok")))
406 (add-before 'check 'fix-test-framework
407 (lambda _
408 ;; Fix PATH in test environment
409 (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
410 (("PATH=/bin:/usr/bin")
411 (string-append "PATH=" (getenv "PATH"))))
412 (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
413 (("/usr/bin/env") (which "env")))
414 (substitute* "openjdk.src/hotspot/test/test_env.sh"
415 (("/bin/rm") (which "rm"))
416 (("/bin/cp") (which "cp"))
417 (("/bin/mv") (which "mv")))))
418 (add-before 'check 'fix-hotspot-tests
419 (lambda _
420 (with-directory-excursion "openjdk.src/hotspot/test/"
421 (substitute* "jprt.config"
422 (("PATH=\"\\$\\{path4sdk\\}\"")
423 (string-append "PATH=" (getenv "PATH")))
424 (("make=/usr/bin/make")
425 (string-append "make=" (which "make"))))
426 (substitute* '("runtime/6626217/Test6626217.sh"
427 "runtime/7110720/Test7110720.sh")
428 (("/bin/rm") (which "rm"))
429 (("/bin/cp") (which "cp"))
430 (("/bin/mv") (which "mv"))))))
431 (add-before 'check 'fix-jdk-tests
432 (lambda _
433 (with-directory-excursion "openjdk.src/jdk/test/"
434 (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
435 (("/bin/pwd") (which "pwd")))
436 (substitute* "com/sun/jdi/ShellScaffold.sh"
437 (("/bin/kill") (which "kill")))
438 (substitute* "start-Xvfb.sh"
439 ;;(("/usr/bin/X11/Xvfb") (which "Xvfb"))
440 (("/usr/bin/nohup") (which "nohup")))
441 (substitute* "javax/security/auth/Subject/doAs/Test.sh"
442 (("/bin/rm") (which "rm")))
443 (substitute* "tools/launcher/MultipleJRE.sh"
444 (("echo \"#!/bin/sh\"")
445 (string-append "echo \"#!" (which "rm") "\""))
446 (("/usr/bin/zip") (which "zip")))
447 (substitute* "com/sun/jdi/OnThrowTest.java"
448 (("#!/bin/sh") (string-append "#!" (which "sh"))))
449 (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
450 (("/usr/bin/uptime") (which "uptime")))
451 (substitute* "java/lang/ProcessBuilder/Basic.java"
452 (("/usr/bin/env") (which "env"))
453 (("/bin/false") (which "false"))
454 (("/bin/true") (which "true"))
455 (("/bin/cp") (which "cp"))
456 (("/bin/sh") (which "sh")))
457 (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
458 (("/bin/sh") (which "sh")))
459 (substitute* "java/lang/ProcessBuilder/Zombies.java"
460 (("/usr/bin/perl") (which "perl"))
461 (("/bin/ps") (which "ps"))
462 (("/bin/true") (which "true")))
463 (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
464 (("/usr/bin/tee") (which "tee")))
465 (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
466 (("/bin/true") (which "true")))
467 (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
468 (("/bin/cat") (which "cat")))
469 (substitute* "java/lang/Runtime/exec/ExitValue.java"
470 (("/bin/sh") (which "sh"))
471 (("/bin/true") (which "true"))
472 (("/bin/kill") (which "kill")))
473 (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
474 (("/usr/bin/echo") (which "echo")))
475 (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
476 (("/usr/bin/cat") (which "cat")))
477 (substitute* "java/lang/Runtime/exec/SleepyCat.java"
478 (("/bin/cat") (which "cat"))
479 (("/bin/sleep") (which "sleep"))
480 (("/bin/sh") (which "sh")))
481 (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
482 (("/bin/cat") (which "cat")))
483 (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
484 (("/bin/chmod") (which "chmod")))
485 (substitute* "java/util/zip/ZipFile/Assortment.java"
486 (("/bin/sh") (which "sh"))))))
487 (replace 'check
488 (lambda* (#:key tests? #:allow-other-keys)
489 ;; The "make check-*" targets always return zero, so we need to
490 ;; check for errors in the associated log files to determine
491 ;; whether any tests have failed.
492 (when tests?
493 (use-modules (ice-9 rdelim))
494 (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
495 (checker (lambda (port)
496 (let loop ()
497 (let ((line (read-line port)))
498 (cond
499 ((eof-object? line) #t)
500 ((regexp-exec error-pattern line)
501 (error "test failed"))
502 (else (loop)))))))
503 (run-test (lambda (test)
504 (invoke "make" test)
505 (call-with-input-file
506 (string-append "test/" test ".log")
507 checker))))
508 (run-test "check-hotspot")
509 (run-test "check-langtools")
510 (run-test "check-jdk")))))
511 (replace 'install
512 (lambda _
513 (copy-recursively "openjdk.build/docs"
514 (string-append #$output:doc
515 "/share/doc/icedtea"))
516 (copy-recursively "openjdk.build/j2re-image" #$output)
517 (copy-recursively "openjdk.build/j2sdk-image" #$output:jdk)))
518 (add-after 'install 'install-libjvm
519 ;; Some of the libraries in the lib/amd64 folder link to libjvm.so.
520 ;; But that shared object is located in the server/ folder, so it
521 ;; cannot be found. This phase creates a symbolic link in the
522 ;; lib/amd64 folder so that the other libraries can find it.
523 ;;
524 ;; See:
525 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
526 ;;
527 ;; FIXME: Find the bug in the build system, so that this symlink is
528 ;; not needed.
529 (lambda _
530 (let ((lib-path (string-append #$output "/lib/"
531 #$(system->icedtea-arch))))
532 (symlink (string-append lib-path "/server/libjvm.so")
533 (string-append lib-path "/libjvm.so")))))
534 ;; By default IcedTea only generates an empty keystore. In order to
535 ;; be able to use certificates in Java programs we need to generate a
536 ;; keystore from a set of certificates. For convenience we use the
537 ;; certificates from the nss-certs package.
538 (add-after 'install 'install-keystore
539 (lambda* (#:key inputs #:allow-other-keys)
540 (use-modules (ice-9 rdelim))
541 (let* ((keystore "cacerts")
542 (certs-dir (search-input-directory inputs
543 "etc/ssl/certs"))
544 (keytool (string-append #$output:jdk "/bin/keytool")))
545 (define (extract-cert file target)
546 (call-with-input-file file
547 (lambda (in)
548 (call-with-output-file target
549 (lambda (out)
550 (let loop ((line (read-line in 'concat))
551 (copying? #f))
552 (cond
553 ((eof-object? line) #t)
554 ((string-prefix? "-----BEGIN" line)
555 (display line out)
556 (loop (read-line in 'concat) #t))
557 ((string-prefix? "-----END" line)
558 (display line out)
559 #t)
560 (else
561 (when copying? (display line out))
562 (loop (read-line in 'concat) copying?)))))))))
563 (define (import-cert cert)
564 (format #t "Importing certificate ~a\n" (basename cert))
565 (let ((temp "tmpcert"))
566 (extract-cert cert temp)
567 (let ((port (open-pipe* OPEN_WRITE keytool
568 "-import"
569 "-alias" (basename cert)
570 "-keystore" keystore
571 "-storepass" "changeit"
572 "-file" temp)))
573 (display "yes\n" port)
574 (when (not (zero? (status:exit-val (close-pipe port))))
575 (format #t "failed to import ~a\n" cert)))
576 (delete-file temp)))
577
578 ;; This is necessary because the certificate directory contains
579 ;; files with non-ASCII characters in their names.
580 (setlocale LC_ALL "C.UTF-8")
581 (setenv "LC_ALL" "C.UTF-8")
582
583 (for-each import-cert (find-files certs-dir "\\.pem$"))
584 (mkdir-p (string-append #$output "/lib/security"))
585 (mkdir-p (string-append #$output:jdk "/jre/lib/security"))
586
587 ;; The cacerts files we are going to overwrite are chmod'ed as
588 ;; read-only (444) in icedtea-8 (which derives from this
589 ;; package). We have to change this so we can overwrite them.
590 (chmod (string-append #$output "/lib/security/" keystore)
591 #o644)
592 (chmod (string-append #$output:jdk
593 "/jre/lib/security/" keystore) #o644)
594
595 (install-file keystore
596 (string-append #$output "/lib/security"))
597 (install-file keystore
598 (string-append #$output:jdk
599 "/jre/lib/security"))))))))
600 (native-inputs
601 ;; XXX: Compiling with gcc-14 will encounter the following error:
602 ;; BUILD FAILED:
603 ;; /tmp/guix-build-icedtea-2.6.13.drv-0/icedtea-2.6.13/openjdk/langtools/
604 ;; make/build.xml:452: The following error occurred while executing this
605 ;; line:
606 ;; java.lang.AbstractMethodError: java.lang.Throwable.toString()Ljava/lang/String;
607 `(("gcc" ,gcc-13)
608 ("openjdk-src"
609 ,(drop "openjdk"
610 "0l34ikyf62hbzlf9032alzkkqvf7bpmckz4gvirvph755w7gka8l"))
611 ("corba-drop"
612 ,(drop "corba"
613 "050gv2jbg1pi6qkn8w18bwpbklfa5b0kymjvan9pncddbj8m84fz"))
614 ("jaxp-drop"
615 ,(drop "jaxp"
616 "1k6yldwnxfzdg5926r1nlfv8d1r1j7rlp2nkz6gqh05vgyamnfhl"))
617 ("jaxws-drop"
618 ,(drop "jaxws"
619 "110j7jlz47x2gg6f7653x12mssan5kvj9l9h1m1c8c92drfxbqyk"))
620 ("jdk-drop"
621 ,(drop "jdk"
622 "0d1mca38ksxvdskp9im3pp7fdijhj1n3lwq9w13r9s4v3qyskgdd"
623 (search-patches "jdk-currency-time-bomb.patch")))
624 ("langtools-drop"
625 ,(drop "langtools"
626 "0nq5236fzxn3p6x8cgncl56mzcmsj07q9gymysnws4c8byc6n0qj"))
627 ("hotspot-drop"
628 ,(origin
629 (method url-fetch)
630 (uri (string-append
631 "http://icedtea.classpath.org/downloads/drops"
632 "/icedtea7/" version "/hotspot.tar.bz2"))
633 (sha256
634 (base32
635 "17bdv39n4lh8l5737c96f3xgamx4y305m067p01cywgp7zaddqws"))
636 (patches (search-patches
637 "icedtea-7-hotspot-aarch64-use-c++98.patch"
638 "icedtea-7-hotspot-pointer-comparison.patch"))))
639 ("ant" ,ant-bootstrap)
640 ("attr" ,attr)
641 ("classpath" ,classpath-devel)
642 ("coreutils" ,coreutils)
643 ("diffutils" ,diffutils) ;for tests
644 ("ecj4-javac-wrapper" ,ecj4-javac-wrapper)
645 ("fastjar" ,fastjar) ;only for the configure phase; we actually use gjar
646 ("gawk" ,gawk)
647 ("grep" ,grep)
648 ("jamvm" ,jamvm-with-ecj4)
649 ("libtool" ,libtool)
650 ("pkg-config" ,pkg-config)
651 ("wget" ,wget)
652 ("which" ,which)
653 ("cpio" ,cpio)
654 ("zip" ,zip)
655 ("unzip" ,unzip)
656 ("libxslt" ,libxslt) ;for xsltproc
657 ("nss-certs" ,nss-certs)
658 ("perl" ,perl)
659 ("procps" ,procps))) ;for "free", even though I'm not sure we should use it
660 (inputs
661 (list alsa-lib
662 cups
663 fontconfig
664 freetype
665 giflib
666 gtk+-2
667 lcms
668 libjpeg-turbo
669 libpng
670 libx11
671 libxcomposite
672 libxi
673 libxinerama
674 libxrender
675 libxt
676 libxtst
677 mit-krb5
678 nss
679 pcsc-lite
680 zlib))
681 (home-page "https://icedtea.classpath.org")
682 (synopsis "Java development kit")
683 (description
684 "This package provides the Java development kit OpenJDK built with the
685IcedTea build harness.")
686
687 ;; 'configure' lists "mips" and "mipsel", but not "mips64el'.
688 (supported-systems (delete "mips64el-linux" %supported-systems))
689
690 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
691 ;; same license as both GNU Classpath and OpenJDK.
692 (license license:gpl2+))))
693
694(define-public icedtea-8
695 (let* ((version "3.19.0")
696 (drop (lambda* (name hash #:optional (patches '()))
697 (origin
698 (method url-fetch)
699 (uri (string-append
700 "http://icedtea.classpath.org/download/drops"
701 "/icedtea8/" version "/" name ".tar.xz"))
702 (sha256 (base32 hash))
703 (patches patches)))))
704 (package
705 (inherit icedtea-7)
706 (version "3.19.0")
707 (source (origin
708 (method url-fetch)
709 (uri (string-append
710 "http://icedtea.wildebeest.org/download/source/icedtea-"
711 version ".tar.xz"))
712 (sha256
713 (base32
714 "1cmms7cb2sav3ywc36ynqmybzx73sl279rm6j8i5nqrmp98ixmpf"))
715 (modules '((guix build utils)))
716 (snippet
717 '(substitute* '("configure"
718 "acinclude.m4")
719 ;; Do not embed build time
720 (("(DIST_ID=\"Custom build).*$" _ prefix)
721 (string-append prefix "\"\n"))
722 ;; Do not leak information about the build host
723 (("DIST_NAME=\"\\$build_os\"")
724 "DIST_NAME=\"guix\"")))))
725 (arguments
726 (substitute-keyword-arguments (package-arguments icedtea-7)
727 ((#:imported-modules modules %default-gnu-imported-modules)
728 (cons '(guix build ant-build-system) modules))
729 ((#:disallowed-references refs '())
730 (cons (gexp-input
731 (this-package-native-input "jdk")
732 "jdk")
733 refs))
734 ((#:modules modules %default-gnu-modules)
735 (append '(((guix build ant-build-system) #:prefix ant:)
736 (ice-9 match)
737 (ice-9 popen)
738 (srfi srfi-1)
739 (srfi srfi-19)
740 (srfi srfi-26))
741 modules))
742 ((#:configure-flags _ '())
743 #~(let ((jdk (assoc-ref %build-inputs "jdk")))
744 (list (string-append "CFLAGS=-fcommon"
745 " -Wno-error=implicit-function-declaration"
746 " -Wno-error=implicit-int"
747 " -Wno-error=incompatible-pointer-types"
748 " -Wno-error=int-conversion")
749 "CXXFLAGS=-fcommon"
750 "--enable-bootstrap"
751 "--enable-nss"
752 (string-append "--with-parallel-jobs="
753 (number->string (parallel-job-count)))
754 ;; Java Flight Recorder isn't supported on some architectures.
755 #$@(if (target-ppc32?)
756 #~("--enable-jfr=no")
757 #~())
758 "--disable-docs" ; This phase can take hours on slow machines.
759 "--disable-downloading"
760 "--disable-system-pcsc"
761 "--disable-system-sctp"
762 "--disable-tests" ;they are run in the check phase instead
763 "--with-openjdk-src-dir=./openjdk.src"
764 (string-append "--with-jdk-home=" jdk))))
765 ((#:phases phases '%standard-phases)
766 #~(modify-phases #$phases
767 (delete 'fix-x11-extension-include-path)
768 (delete 'patch-paths)
769 (delete 'set-additional-paths)
770 (delete 'patch-patches)
771 (delete 'patch-bitrot)
772 (delete 'use-classpath)
773 (replace 'build
774 (lambda* (#:key (make-flags '()) #:allow-other-keys)
775 ;; Prevent passing -j (parallel-job-count) to make, which
776 ;; is rejected by the build Makefiles; this does *not*
777 ;; disable parallel builds.
778 (apply invoke "make" make-flags)))
779 ;; Prevent the keytool from recording the current time when
780 ;; adding certificates at build time.
781 (add-after 'unpack 'patch-keystore
782 (lambda _
783 (substitute* "openjdk.src/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java"
784 (("date = new Date\\(\\);")
785 "\
786date = (System.getenv(\"SOURCE_DATE_EPOCH\") != null) ?\
787new Date(Long.parseLong(System.getenv(\"SOURCE_DATE_EPOCH\"))) :\
788new Date();"))))
789 (add-after 'unpack 'patch-jni-libs
790 ;; Hardcode dynamically loaded libraries.
791 (lambda _
792 (define (icedtea-or-openjdk? path)
793 (or (string-contains path "openjdk")
794 (string-contains path "icedtea")))
795
796 (let* ((library-path (remove icedtea-or-openjdk?
797 (search-path-as-string->list
798 (getenv "LIBRARY_PATH"))))
799 (find-library (lambda (name)
800 (or (search-path
801 library-path
802 (string-append "lib" name ".so"))
803 (string-append "lib" name ".so")))))
804 (for-each
805 (lambda (file)
806 (catch 'decoding-error
807 (lambda ()
808 (substitute* file
809 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
810 _ name version)
811 (string-append "\"" (find-library name) "\""))
812 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
813 (string-append "\"" (find-library name) "\""))))
814 (lambda _
815 ;; Those are safe to skip.
816 (format (current-error-port)
817 "warning: failed to substitute: ~a~%"
818 file))))
819 (find-files "openjdk.src/jdk/src/solaris/native"
820 "\\.c|\\.h")))))
821 (replace 'fix-openjdk
822 (lambda _
823 (substitute*
824 '("openjdk.src/jdk/src/solaris/native/java/net/PlainSocketImpl.c"
825 "openjdk.src/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c")
826 (("#include <sys/sysctl.h>")
827 "#include <linux/sysctl.h>"))))
828 (replace 'install
829 (lambda _
830 (copy-recursively "openjdk.build/docs"
831 (string-append #$output:doc
832 "/share/doc/icedtea"))
833 (copy-recursively "openjdk.build/images/j2re-image" #$output)
834 (copy-recursively "openjdk.build/images/j2sdk-image" #$output:jdk)
835 ;; Install the nss.cfg file to JRE to enable SSL/TLS
836 ;; support via NSS.
837 (copy-file (string-append #$output:jdk
838 "/jre/lib/security/nss.cfg")
839 (string-append #$output "/lib/security/nss.cfg"))))
840 (add-after 'install 'strip-jar-timestamps
841 (assoc-ref ant:%standard-phases 'strip-jar-timestamps))))))
842 (native-inputs
843 `(("jdk" ,icedtea-7 "jdk")
844 ("openjdk-src"
845 ,(drop "openjdk"
846 "1l3bzmd3s38scxpwamfhnwbv7vndgjq6hz3bl58437fgl9kgbl69"))
847 ("aarch32-drop"
848 ,(drop "aarch32"
849 "0k4dwpi3x3lj41rj32xyxbn76r7cb2g2whh44r1z4iwhw1xd2lpq"))
850 ("corba-drop"
851 ,(drop "corba"
852 "0xhh6gf5gh5c6vf1607xcy49wnp5prch2rim13x14wvsn817xf0r"))
853 ("jaxp-drop"
854 ,(drop "jaxp"
855 "043g335rgi5ipl8dp3q2cc3gcfhxk77ipxs43sv344z71bn8xmxr"))
856 ("jaxws-drop"
857 ,(drop "jaxws"
858 "1pc0pv4v2mn2mjc0vp19d94v2150xigyhxsmckqasy647zcm6w0r"))
859 ("jdk-drop"
860 ,(drop "jdk"
861 "1742lcm55l8zhi522x83v65ccr0rd6511q9rj7crw44x3ymdrhrv"
862 (search-patches "jdk-currency-time-bomb2.patch")))
863 ("langtools-drop"
864 ,(drop "langtools"
865 "08iz7p2xcddlphipf6gahyabr5cawlnydap12p1n4f0md069b50b"))
866 ("hotspot-drop"
867 ,(drop "hotspot"
868 "1ffaxfnb3yn1i7crivqigc1r1q0z6cp044i6nfring4z6c8pfhd2"))
869 ("nashorn-drop"
870 ,(drop "nashorn"
871 "15fn7cpm2i1npa88h57njxg0f8qkrqhrc30pb54d3hxlx5zyjl94"))
872 ("shenandoah-drop"
873 ,(drop "shenandoah"
874 "1jjzjjx1ykyhbc4llh8249dlr8j5g1ki6r7g9baj2mxyb9whc5nq"))
875 ,@(fold alist-delete (package-native-inputs icedtea-7)
876 '("openjdk-src" "corba-drop" "jaxp-drop" "jaxws-drop"
877 "jdk-drop" "langtools-drop" "hotspot-drop"
878 "classpath" "ecj4-javac-wrapper" "jamvm" "fastjar")))))))
879
880(define-public icedtea icedtea-8)
881
882(define-public openjdk9
883 (package
884 (name "openjdk")
885 (version "9.181")
886 (source (origin
887 (method hg-fetch)
888 (uri (hg-reference (url "https://hg.openjdk.org/jdk/jdk")
889 (changeset "jdk-9+181")))
890 (file-name (hg-file-name name version))
891 (modules '((guix build utils)))
892 (snippet '(for-each delete-file
893 (find-files "." ".*.(bin|exe|jar)$")))
894 (sha256
895 (base32
896 "1v92nzdqx07c35x945awzir4yk0fk22vky6fpp8mq9js930sxsz0"))
897 (patches
898 (search-patches "openjdk-9-pointer-comparison.patch"
899 "openjdk-9-classlist-reproducibility.patch"
900 "openjdk-currency-time-bomb.patch"
901 "openjdk-9-jar-reproducibility.patch"
902 "openjdk-9-module-reproducibility.patch"
903 "openjdk-9-module2-reproducibility.patch"
904 "openjdk-9-module3-reproducibility.patch"
905 "openjdk-9-idlj-reproducibility.patch"
906 "openjdk-9-setsignalhandler.patch"))))
907 (build-system gnu-build-system)
908 (outputs '("out" "jdk" "doc"))
909 (arguments
910 (list
911 #:imported-modules
912 (cons '(guix build ant-build-system)
913 %default-gnu-imported-modules)
914 #:modules
915 (append '((ice-9 match)
916 (ice-9 popen)
917 (srfi srfi-1)
918 (srfi srfi-26))
919 %default-gnu-modules)
920 #:tests? #f ; require jtreg
921 #:make-flags #~(list "all")
922 #:disallowed-references
923 (list (this-package-native-input "icedtea")
924 (gexp-input (this-package-native-input "icedtea") "jdk"))
925
926 #:phases
927 #~(modify-phases %standard-phases
928 #$@(if (target-aarch64?)
929 #~((add-after 'unpack 'patch-for-aarch64
930 (lambda _
931 (substitute* "hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp"
932 ;; This line is duplicated, so remove both occurrences,
933 ;; then add back one occurrence by substituting a
934 ;; comment that occurs once.
935 (("using MacroAssembler::call_VM_leaf_base;") "")
936 (("Interpreter specific version of call_VM_base")
937 "Interpreter specific version of call_VM_base
938 using MacroAssembler::call_VM_leaf_base;")))))
939 #~())
940 (add-after 'patch-source-shebangs 'fix-java-shebangs
941 (lambda _
942 ;; This file was "fixed" by patch-source-shebangs, but it requires
943 ;; this exact first line.
944 (substitute* "jdk/make/data/blacklistedcertsconverter/blacklisted.certs.pem"
945 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))))
946 (replace 'configure
947 (lambda* (#:key inputs #:allow-other-keys)
948 ;; TODO: unbundle libpng and lcms
949 (invoke "bash" "./configure"
950 ;; Add flags for compilation with gcc >= 10
951 (string-append "--with-extra-cflags=-fcommon"
952 " -fno-delete-null-pointer-checks"
953 " -fno-lifetime-dse"
954 ;; flags for compilation with gcc >= 14.
955 " -Wno-error=int-conversion")
956 (string-append "--with-freetype="
957 (assoc-ref inputs "freetype"))
958 "--disable-freetype-bundling"
959 "--disable-warnings-as-errors"
960 "--disable-hotspot-gtest"
961 "--with-giflib=system"
962 "--with-libjpeg=system"
963 (string-append "--prefix=" #$output))))
964 (add-before 'build 'write-source-revision-file
965 (lambda _
966 (with-output-to-file ".src-rev"
967 (lambda _
968 (display #$(package-version this-package))))))
969 (replace 'build
970 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
971 (apply invoke "make"
972 (format #f "JOBS=~a" (if parallel-build?
973 (parallel-job-count)
974 1))
975 make-flags)))
976 (add-after 'unpack 'patch-jni-libs
977 ;; Hardcode dynamically loaded libraries.
978 (lambda _
979 (define (icedtea-or-openjdk? path)
980 (or (string-contains path "openjdk")
981 (string-contains path "icedtea")))
982
983 (let* ((library-path (remove icedtea-or-openjdk?
984 (search-path-as-string->list
985 (getenv "LIBRARY_PATH"))))
986 (find-library (lambda (name)
987 (or (search-path
988 library-path
989 (string-append "lib" name ".so"))
990 (string-append "lib" name ".so")))))
991 (for-each
992 (lambda (file)
993 (catch 'decoding-error
994 (lambda ()
995 (substitute* file
996 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
997 _ name version)
998 (string-append "\"" (find-library name) "\""))
999 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
1000 (string-append "\"" (find-library name) "\""))))
1001 (lambda _
1002 ;; Those are safe to skip.
1003 (format (current-error-port)
1004 "warning: failed to substitute: ~a~%"
1005 file))))
1006 (find-files "."
1007 "\\.c$|\\.h$")))))
1008 ;; By default OpenJDK only generates an empty keystore. In order to
1009 ;; be able to use certificates in Java programs we need to generate a
1010 ;; keystore from a set of certificates. For convenience we use the
1011 ;; certificates from the nss-certs package.
1012 (add-after 'install 'install-keystore
1013 (lambda* (#:key inputs #:allow-other-keys)
1014 (use-modules (ice-9 rdelim))
1015 (let* ((keystore "cacerts")
1016 (certs-dir (search-input-directory inputs
1017 "etc/ssl/certs"))
1018 (keytool (string-append #$output:jdk "/bin/keytool")))
1019 (define (extract-cert file target)
1020 (call-with-input-file file
1021 (lambda (in)
1022 (call-with-output-file target
1023 (lambda (out)
1024 (let loop ((line (read-line in 'concat))
1025 (copying? #f))
1026 (cond
1027 ((eof-object? line) #t)
1028 ((string-prefix? "-----BEGIN" line)
1029 (display line out)
1030 (loop (read-line in 'concat) #t))
1031 ((string-prefix? "-----END" line)
1032 (display line out)
1033 #t)
1034 (else
1035 (when copying? (display line out))
1036 (loop (read-line in 'concat) copying?)))))))))
1037 (define (import-cert cert)
1038 (format #t "Importing certificate ~a\n" (basename cert))
1039 (let ((temp "tmpcert"))
1040 (extract-cert cert temp)
1041 (let ((port (open-pipe* OPEN_WRITE keytool
1042 "-import"
1043 "-alias" (basename cert)
1044 "-keystore" keystore
1045 "-storepass" "changeit"
1046 "-file" temp)))
1047 (display "yes\n" port)
1048 (when (not (zero? (status:exit-val (close-pipe port))))
1049 (format #t "failed to import ~a\n" cert)))
1050 (delete-file temp)))
1051
1052 ;; This is necessary because the certificate directory contains
1053 ;; files with non-ASCII characters in their names.
1054 (setlocale LC_ALL "C.UTF-8")
1055 (setenv "LC_ALL" "C.UTF-8")
1056
1057 (copy-file (string-append #$output
1058 "/lib/security/cacerts")
1059 keystore)
1060 (chmod keystore #o644)
1061 (for-each import-cert (find-files certs-dir "\\.pem$"))
1062 (mkdir-p (string-append #$output "/lib/security"))
1063 (mkdir-p (string-append #$output:jdk "/lib/security"))
1064
1065 ;; The cacerts files we are going to overwrite are chmod'ed as
1066 ;; read-only (444) in icedtea-8 (which derives from this
1067 ;; package). We have to change this so we can overwrite them.
1068 (chmod (string-append #$output
1069 "/lib/security/" keystore) #o644)
1070 (chmod (string-append #$output:jdk
1071 "/lib/security/" keystore) #o644)
1072
1073 (install-file keystore
1074 (string-append #$output
1075 "/lib/security"))
1076 (install-file keystore
1077 (string-append #$output:jdk
1078 "/lib/security")))))
1079 ;; Some of the libraries in the lib/ folder link to libjvm.so.
1080 ;; But that shared object is located in the server/ folder, so it
1081 ;; cannot be found. This phase creates a symbolic link in the
1082 ;; lib/ folder so that the other libraries can find it.
1083 ;;
1084 ;; See:
1085 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1086 ;;
1087 ;; FIXME: Find the bug in the build system, so that this symlink is
1088 ;; not needed.
1089 (add-after 'install 'install-libjvm
1090 (lambda* (#:key inputs #:allow-other-keys)
1091 (let* ((lib-out (string-append #$output "/lib"))
1092 (lib-jdk (string-append #$output:jdk "/lib")))
1093 (symlink (string-append lib-jdk "/server/libjvm.so")
1094 (string-append lib-jdk "/libjvm.so"))
1095 (symlink (string-append lib-out "/server/libjvm.so")
1096 (string-append lib-out "/libjvm.so")))))
1097 (replace 'install
1098 (lambda* (#:key outputs #:allow-other-keys)
1099 (let ((images (car (find-files "build" ".*-server-release"
1100 #:directories? #t))))
1101 (copy-recursively (string-append images "/images/jdk")
1102 #$output:jdk)
1103 (copy-recursively (string-append images "/images/jre") #$output)
1104 (copy-recursively (string-append images "/images/docs")
1105 #$output:doc))))
1106 (add-after 'install 'remove-extraneous-files
1107 (lambda* (#:key outputs #:allow-other-keys)
1108 ;; Remove the *.diz and src.zip files for space considerations.
1109 ;; The former are compressed debuginfo files not typically
1110 ;; shipped with Java distributions, while the later corresponds
1111 ;; to Java core API source files.
1112 (for-each delete-file
1113 (append-map (cut find-files <> "(^src\\.zip|\\.diz)$")
1114 (map (match-lambda
1115 ((name . dir)
1116 dir))
1117 outputs)))))
1118 (add-after 'remove-extraneous-files 'strip-zip-timestamps
1119 (lambda* (#:key outputs #:allow-other-keys)
1120 (for-each
1121 (lambda (zip)
1122 (let ((dir (mkdtemp "zip-contents.XXXXXX")))
1123 (with-directory-excursion dir
1124 ;; This is an exact copy of the implementation of invoke,
1125 ;; but this accepts exit code 1 as OK.
1126 (let ((code (system* "unzip" "--" zip)))
1127 ;; jmod files are zip files with an extra header in
1128 ;; front. unzip will warn about that -- but otherwise
1129 ;; work.
1130 (when (> (status:exit-val code) 1) ; 1 is just a warning
1131 (raise
1132 (condition
1133 (&invoke-error
1134 (program "unzip")
1135 (arguments (list "--" zip))
1136 (exit-status (status:exit-val code))
1137 (term-signal (status:term-sig code))
1138 (stop-signal (status:stop-sig code))))))))
1139 (delete-file zip)
1140 (for-each (lambda (file)
1141 (let ((s (lstat file)))
1142 (format #t "reset ~a~%" file)
1143 (utime file 1 1 0 0
1144 AT_SYMLINK_NOFOLLOW)))
1145 (find-files dir #:directories? #t))
1146 (with-directory-excursion dir
1147 (let ((files (cons "./META-INF/MANIFEST.MF"
1148 (append
1149 (find-files "./META-INF" ".*")
1150 ;; for jmod:
1151 (list "./classes/module-info.class")
1152 (find-files "." ".*")))))
1153 (apply invoke "zip" "--symlinks" "-0" "-X" zip files)
1154 (when (string-suffix? ".jmod" zip)
1155 (let ((new-zip (string-append zip "n"))
1156 (contents (call-with-input-file zip
1157 (@ (ice-9 binary-ports)
1158 get-bytevector-all))))
1159 (call-with-output-file new-zip
1160 (lambda (output-port)
1161 ((@ (ice-9 binary-ports) put-bytevector)
1162 output-port
1163 #vu8(#x4a #x4d #x01 #x00)) ; JM
1164 ((@ (ice-9 binary-ports) put-bytevector)
1165 output-port
1166 contents)))
1167 (rename-file new-zip zip)))))))
1168 (append (find-files (string-append #$output:doc "/api")
1169 "\\.zip$")
1170 (find-files #$output:jdk "\\.jmod$")
1171 (list (string-append #$output:jdk
1172 "/lib/jrt-fs.jar"))
1173 (find-files (string-append #$output:jdk "/demo")
1174 "\\.jar$"))))))))
1175 (inputs
1176 (list alsa-lib
1177 cups
1178 fontconfig
1179 freetype
1180 giflib
1181 gtk+
1182 lcms
1183 elfutils
1184 libjpeg-turbo
1185 libice
1186 libpng
1187 libx11
1188 libxcomposite
1189 libxi
1190 libxinerama
1191 libxrender
1192 libxt
1193 libxtst))
1194 (native-inputs
1195 (list icedtea-8
1196 `(,icedtea-8 "jdk")
1197 ;; XXX: The build system fails with newer versions of GNU Make.
1198 gnu-make-4.2
1199 nss-certs
1200 unzip
1201 which
1202 zip))
1203 (home-page "https://openjdk.org/projects/jdk9/")
1204 (synopsis "Java development kit")
1205 (description
1206 "This package provides the Java development kit OpenJDK.")
1207 (license license:gpl2+)))
1208
1209(define-public openjdk10
1210 (package
1211 (inherit openjdk9)
1212 (name "openjdk")
1213 (version "10.46")
1214 (source (origin
1215 (method hg-fetch)
1216 (uri (hg-reference (url "https://hg.openjdk.org/jdk/jdk")
1217 (changeset "jdk-10+46")))
1218 (file-name (hg-file-name name version))
1219 (modules '((guix build utils)))
1220 (snippet `(begin
1221 (for-each delete-file
1222 (find-files "." ".*.(bin|exe|jar)$"))))
1223 (sha256
1224 (base32
1225 "0i47ar8lxzjrkkiwbzybfxs473390h4jq9ahm3xqdvy5zpchxy3y"))
1226 (patches (search-patches
1227 "openjdk-10-char-reproducibility.patch"
1228 "openjdk-10-classlist-reproducibility.patch"
1229 "openjdk-10-corba-reproducibility.patch"
1230 "openjdk-10-idlj-reproducibility.patch"
1231 "openjdk-10-module-reproducibility.patch"
1232 "openjdk-10-module3-reproducibility.patch"
1233 "openjdk-10-module4-reproducibility.patch"
1234 "openjdk-10-jar-reproducibility.patch"
1235 "openjdk-10-jtask-reproducibility.patch"
1236 "openjdk-10-pointer-comparison.patch"
1237 "openjdk-10-setsignalhandler.patch"
1238 "openjdk-currency-time-bomb2.patch"))))
1239 (arguments
1240 (substitute-keyword-arguments (package-arguments openjdk9)
1241 ((#:phases phases '%standard-phases)
1242 #~(modify-phases #$phases
1243 #$@(if (target-aarch64?)
1244 #~((replace 'patch-for-aarch64
1245 (lambda _
1246 (substitute* "src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp"
1247 ;; This line is duplicated, so remove both occurrences,
1248 ;; then add back one occurrence by substituting a
1249 ;; comment that occurs once.
1250 (("using MacroAssembler::call_VM_leaf_base;") "")
1251 (("Interpreter specific version of call_VM_base")
1252 (string-append "Interpreter specific version of call_VM_base\n"
1253 " using MacroAssembler::call_VM_leaf_base;"))))))
1254 #~())
1255 (replace 'fix-java-shebangs
1256 (lambda _
1257 ;; This file was "fixed" by patch-source-shebangs, but it requires
1258 ;; this exact first line.
1259 (substitute* "make/data/blacklistedcertsconverter/blacklisted.certs.pem"
1260 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))))
1261 (add-after 'unpack 'remove-timestamping
1262 (lambda _
1263 (substitute* "./src/hotspot/share/runtime/vm_version.cpp"
1264 (("__DATE__") "")
1265 (("__TIME__") ""))))
1266 (replace 'configure
1267 (lambda* (#:key inputs #:allow-other-keys)
1268 (invoke "bash" "./configure"
1269 ;; Add flags for compilation with gcc >= 10
1270 (string-append "--with-extra-cflags=-fcommon"
1271 " -fno-delete-null-pointer-checks"
1272 " -fno-lifetime-dse"
1273 ;; flags for compilation with gcc >= 14.
1274 " -Wno-error=int-conversion")
1275 (string-append "--with-freetype="
1276 (assoc-ref inputs "freetype"))
1277 "--disable-freetype-bundling"
1278 "--disable-warnings-as-errors"
1279 "--disable-hotspot-gtest"
1280 "--with-giflib=system"
1281 "--with-libjpeg=system"
1282 "--with-native-debug-symbols=zipped"
1283 (string-append "--prefix=" #$output))))
1284 (add-after 'unpack 'disable-warnings-as-errors
1285 (lambda _
1286 ;; It looks like the "--disable-warnings-as-errors" option of
1287 ;; the 'configure' phase is not working.
1288 (substitute* "make/autoconf/generated-configure.sh"
1289 (("-Werror") ""))))
1290 #$@(if (target-x86-32?)
1291 ;; On i686 the C2 compiler sometimes crashes when importing
1292 ;; certificates.
1293 #~((add-before 'install-keystore 'disable-C2-compiler
1294 (lambda _ (setenv "_JAVA_OPTIONS" "-XX:TieredStopAtLevel=1"))))
1295 #~())))
1296 ((#:disallowed-references refs '())
1297 (cons* (this-package-native-input "openjdk")
1298 (gexp-input (this-package-native-input "openjdk") "jdk")
1299 refs))))
1300 (native-inputs
1301 (list gnu-make-4.2
1302 openjdk9
1303 `(,openjdk9 "jdk")
1304 nss-certs
1305 unzip
1306 which
1307 zip))))
1308
1309(define-public openjdk11
1310 (package
1311 (name "openjdk")
1312 (version "11.0.22")
1313 (source (origin
1314 (method url-fetch)
1315 (uri (string-append "https://openjdk-sources.osci.io/openjdk11/openjdk-"
1316 version "-ga.tar.xz"))
1317 (file-name (string-append name "-" version ".tar.xz"))
1318 (sha256
1319 (base32
1320 "18ca4syp9xlrqjgyjkb1sp9835riy6aym5xs81r8byrz6jlb2473"))
1321 (modules '((guix build utils)))
1322 (snippet
1323 '(for-each delete-file (find-files "." "\\.(bin|exe|jar)$")))
1324 (patches
1325 (search-patches "openjdk-10-module3-reproducibility.patch"
1326 "openjdk-10-module4-reproducibility.patch"
1327 "openjdk-10-char-reproducibility.patch"
1328 "openjdk-11-classlist-reproducibility.patch"
1329 "openjdk-10-jar-reproducibility.patch"
1330 "openjdk-10-jtask-reproducibility.patch"
1331 "openjdk-currency-time-bomb2.patch"))))
1332 (build-system gnu-build-system)
1333 (outputs '("out" "jdk" "doc"))
1334 (arguments
1335 (list
1336 ;; Prevent a java.util.ConcurrentModificationException.
1337 #:parallel-build? #f
1338 #:modules `((guix build gnu-build-system)
1339 (guix build utils)
1340 (ice-9 match)
1341 (ice-9 popen)
1342 (srfi srfi-1)
1343 (srfi srfi-26))
1344
1345 #:disallowed-references
1346 (list (this-package-native-input "openjdk")
1347 (gexp-input (this-package-native-input "openjdk")
1348 "jdk"))
1349
1350 #:tests? #f ; requires jtreg
1351 ;; TODO package jtreg
1352 #:configure-flags
1353 #~(list
1354 "--disable-hotspot-gtest" ;not currently running tests
1355 ;; Add flags for compilation with gcc >= 10.
1356 #$(string-append "--with-extra-cflags=-fcommon"
1357 " -fno-delete-null-pointer-checks"
1358 " -fno-lifetime-dse"
1359 ;; flags for compilation with gcc >= 14.
1360 " -Wno-error=int-conversion")
1361 ;; Otherwise, the '--enable-fast-install' causes an error.
1362 "--disable-option-checking"
1363 "--disable-warnings-as-errors"
1364 ;; Make validate-runpath pass (see:
1365 ;; http://issues.guix.info/issue/32894).
1366 "--with-native-debug-symbols=zipped"
1367 ;; Do not use the bundled libraries.
1368 "--with-giflib=system"
1369 "--with-lcms=system"
1370 "--with-libjpeg=system"
1371 "--with-libpng=system"
1372 "--with-version-pre="
1373 ;; Should be set by SOURCE_DATE_EPOCH handler, but isn't being
1374 ;; set; do it manually.
1375 "--with-hotspot-build-time=1970-01-01T00:00:01"
1376 "--enable-reproducible-build" ; to be sure
1377 ;; Allow the build system to locate the system freetype.
1378 (string-append "--with-freetype-include="
1379 #$(this-package-input "freetype") "/include")
1380 (string-append "--with-freetype-lib="
1381 #$(this-package-input "freetype") "/lib"))
1382 #:phases
1383 #~(modify-phases %standard-phases
1384 (add-after 'patch-source-shebangs 'fix-java-shebangs
1385 (lambda _
1386 ;; This file was "fixed" by patch-source-shebangs, but it requires
1387 ;; this exact first line.
1388 (substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
1389 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))
1390 (add-after 'unpack 'remove-timestamping
1391 (lambda _
1392 (substitute* "src/hotspot/share/runtime/abstract_vm_version.cpp"
1393 (("__DATE__") "")
1394 (("__TIME__") ""))))
1395 (add-after 'unpack 'patch-jni-libs
1396 ;; Hardcode dynamically loaded libraries.
1397 (lambda _
1398 (define (icedtea-or-openjdk? path)
1399 (or (string-contains path "openjdk")
1400 (string-contains path "icedtea")))
1401
1402 (let* ((library-path (remove icedtea-or-openjdk?
1403 (search-path-as-string->list
1404 (getenv "LIBRARY_PATH"))))
1405 (find-library (lambda (name)
1406 (or (search-path
1407 library-path
1408 (string-append "lib" name ".so"))
1409 (string-append "lib" name ".so")))))
1410 (for-each
1411 (lambda (file)
1412 (catch 'decoding-error
1413 (lambda ()
1414 (substitute* file
1415 (("VERSIONED_JNI_LIB_NAME\\(\"([^\"]*)\", \"([^\"]*)\"\\)"
1416 _ name version)
1417 (string-append "\"" (find-library name) "\""))
1418 (("JNI_LIB_NAME\\(\"([^\"]*)\"\\)" _ name)
1419 (string-append "\"" (find-library name) "\""))))
1420 (lambda _
1421 ;; Those are safe to skip.
1422 (format (current-error-port)
1423 "warning: failed to substitute: ~a~%"
1424 file))))
1425 (find-files "." "\\.c$|\\.h$")))))
1426 (add-before 'build 'write-source-revision-file
1427 (lambda _
1428 (with-output-to-file ".src-rev"
1429 (lambda _
1430 (display #$(package-version this-package))))))
1431 (replace 'build
1432 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
1433 (apply invoke "make" "all"
1434 (format #f "JOBS=~a" (if parallel-build?
1435 (parallel-job-count)
1436 1))
1437 make-flags)))
1438 ;; jdk 11 does not build jre by default any more; so explicitly build
1439 ;; it (see:
1440 ;; https://github.com/AdoptOpenJDK/openjdk-build/issues/356).
1441 (add-after 'build 'build-jre
1442 (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
1443 (apply invoke "make" "legacy-jre-image"
1444 (format #f "JOBS=~a" (if parallel-build?
1445 (parallel-job-count)
1446 1))
1447 make-flags)))
1448 (replace 'install
1449 (lambda _
1450 (let ((images (car (find-files "build" "-server-release"
1451 #:directories? #t))))
1452 (copy-recursively (string-append images "/images/jdk")
1453 #$output:jdk)
1454 (copy-recursively (string-append images "/images/jre")
1455 #$output)
1456 (copy-recursively (string-append images "/images/docs")
1457 #$output:doc))))
1458 ;; Some of the libraries in the lib/ folder link to libjvm.so.
1459 ;; But that shared object is located in the server/ folder, so it
1460 ;; cannot be found. This phase creates a symbolic link in the
1461 ;; lib/ folder so that the other libraries can find it.
1462 ;;
1463 ;; See:
1464 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1465 ;;
1466 ;; FIXME: Find the bug in the build system, so that this symlink is
1467 ;; not needed.
1468 (add-after 'install 'install-libjvm
1469 (lambda _
1470 (let ((lib-out (string-append #$output "/lib"))
1471 (lib-jdk (string-append #$output:jdk "/lib")))
1472 (symlink (string-append lib-jdk "/server/libjvm.so")
1473 (string-append lib-jdk "/libjvm.so"))
1474 (symlink (string-append lib-out "/server/libjvm.so")
1475 (string-append lib-out "/libjvm.so")))))
1476 (add-after 'install 'remove-extraneous-files
1477 (lambda* (#:key outputs #:allow-other-keys)
1478 ;; Remove the *.diz and src.zip files for space considerations.
1479 ;; The former are compressed debuginfo files not typically
1480 ;; shipped with Java distributions, while the later corresponds
1481 ;; to Java core API source files.
1482 (for-each delete-file
1483 (append-map (cut find-files <> "(^src\\.zip|\\.diz)$")
1484 (map (match-lambda
1485 ((name . dir)
1486 dir))
1487 outputs)))))
1488 (add-after 'remove-extraneous-files 'strip-archive-timestamps
1489 (lambda _
1490 (use-modules (ice-9 binary-ports)
1491 (rnrs bytevectors))
1492 (letrec ((repack-archive
1493 (lambda (archive)
1494 (let ((dir (mkdtemp "zip-contents.XXXXXX")))
1495 (with-directory-excursion dir
1496 (invoke "unzip" archive))
1497 (delete-file archive)
1498 (for-each (compose repack-archive canonicalize-path)
1499 (find-files dir "(ct\\.sym|\\.jar)$"))
1500 (let ((reset-file-timestamp
1501 (lambda (file)
1502 (let ((s (lstat file)))
1503 (unless (eq? (stat:type s) 'symlink)
1504 (format #t "reset ~a~%" file)
1505 (utime file 0 0 0 0))))))
1506 (for-each reset-file-timestamp
1507 (find-files dir #:directories? #t)))
1508 (with-directory-excursion dir
1509 (let ((files (find-files ".")))
1510 (apply invoke "zip" "-0" "-X" archive files)))))))
1511 (for-each repack-archive
1512 (find-files #$output:doc "\\.zip$"))
1513 (for-each repack-archive
1514 (find-files #$output:jdk "\\.(zip|jar)$"))
1515 (repack-archive (string-append #$output:jdk "/lib/ct.sym"))
1516 (let ((repack-jmod
1517 (lambda (file-name)
1518 (call-with-input-file file-name
1519 (lambda (file)
1520 (let ((header #vu8(#x4a #x4d #x01 #x00)))
1521 (if (equal? (get-bytevector-n
1522 file (bytevector-length header))
1523 header)
1524 (let* ((header-length (bytevector-length header))
1525 (temp-file (mkstemp!
1526 (string-copy
1527 "temp-file.XXXXXX")))
1528 (temp-filename (port-filename temp-file))
1529 (content-length
1530 (- (stat:size (stat file))
1531 header-length)))
1532 (sendfile temp-file file content-length header-length)
1533 (delete-file file-name)
1534 (close-port temp-file)
1535 (repack-archive (canonicalize-path temp-filename))
1536 (call-with-output-file file-name
1537 (lambda (file)
1538 (put-bytevector file header)
1539 (call-with-input-file temp-filename
1540 (lambda (temp-file)
1541 (sendfile
1542 file temp-file
1543 (stat:size (stat temp-file)) 0)))))))))))))
1544 (for-each repack-jmod
1545 (find-files #$output:jdk "\\.jmod$"))))))
1546 (add-after 'install 'remove-timestamp-from-api-summary
1547 (lambda _
1548 (substitute* (string-append #$output:doc
1549 "/api/overview-summary.html")
1550 (("Generated by javadoc \\(11-internal\\).*$")
1551 "Generated by javadoc (11-internal) -->\n")))))))
1552 (inputs
1553 (list alsa-lib
1554 cups
1555 fontconfig
1556 freetype
1557 giflib
1558 gtk+
1559 lcms
1560 libjpeg-turbo
1561 libpng
1562 libx11
1563 libxext
1564 libxrandr
1565 libxrender
1566 libxt
1567 libxtst))
1568 (native-inputs
1569 (list autoconf
1570 bash ; not bash-minimal, needs ulimit
1571 openjdk10
1572 `(,openjdk10 "jdk")
1573 gnu-make-4.2
1574 nss-certs
1575 pkg-config
1576 unzip
1577 which
1578 zip))
1579 (home-page "https://openjdk.org/projects/jdk/11/")
1580 (synopsis "Java development kit")
1581 (description
1582 "This package provides the Java development kit OpenJDK.")
1583 (license license:gpl2+)
1584 (properties
1585 ;; At least on a Blackbird powerpc64le machine, the build takes more than
1586 ;; the default 3600s of silent timeout.
1587 `((max-silent-time . ,(* 3600 2))))))
1588
1589(define-syntax make-openjdk
1590 ;; Return an OpenJDK package at VERSION with checksum HASH, using BOOTSTRAP,
1591 ;; the bootstrap package. One or more FIELD can be provided to further
1592 ;; refine the package definition; for convenience, the BASE, NAME and
1593 ;; VERSION are defined in their scope.
1594 (lambda (x)
1595 (syntax-case x ()
1596 ((_ bootstrap version* hash field ...)
1597 (with-syntax ((base (datum->syntax x 'base))
1598 (name (datum->syntax x 'name))
1599 (version (datum->syntax x 'version)))
1600 #'(let ((base (package
1601 (inherit bootstrap)
1602 (name "openjdk")
1603 (version version*)
1604 (source
1605 (origin
1606 (inherit (package-source bootstrap))
1607 (method git-fetch)
1608 (uri (git-reference
1609 (url (format
1610 #f "https://github.com/openjdk/jdk~au"
1611 (version-major version*)))
1612 (commit (string-append "jdk-" version*
1613 "-ga"))))
1614 (file-name (git-file-name name version))
1615 (sha256 (base32 hash))))
1616 (properties
1617 '((release-tag-prefix . "jdk-")
1618 (release-tag-suffix . "-ga")
1619 (release-tag-version-delimiter . ".")))
1620 (native-inputs
1621 (modify-inputs native-inputs
1622 (replace "openjdk" bootstrap)))
1623 (home-page (string-append
1624 "https://openjdk.java.net/projects/jdk/"
1625 (version-major version)))))
1626 (name "openjdk")
1627 (version version*))
1628 (package
1629 (inherit base)
1630 field
1631 ...)))))))
1632
1633(define-public openjdk12
1634 (make-openjdk
1635 openjdk11 "12.33" "0pi2gwib3j2imi4l623iaywrmvfh9rqzh82lj2gxqbrmg55swvjf"
1636 (source
1637 (origin
1638 (method url-fetch)
1639 (uri "http://hg.openjdk.java.net/jdk/jdk/archive/0276cba45aac.tar.bz2")
1640 (file-name (string-append name "-" version ".tar.bz2"))
1641 (sha256
1642 (base32
1643 "0pi2gwib3j2imi4l623iaywrmvfh9rqzh82lj2gxqbrmg55swvjf"))
1644 (modules '((guix build utils)))
1645 (snippet
1646 '(for-each delete-file (find-files "." "\\.(bin|exe|jar)$")))
1647 (patches (search-patches "openjdk-10-setsignalhandler.patch"))))
1648 (arguments
1649 (substitute-keyword-arguments (package-arguments openjdk11)
1650 ;; Re-enable parallel build.
1651 ((#:parallel-build? _ #t) #t)
1652 ((#:phases phases)
1653 #~(modify-phases #$phases
1654 #$@(if (target-aarch64?)
1655 #~((add-after 'unpack 'patch-for-aarch64
1656 (lambda _
1657 (substitute* "src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp"
1658 ;; This line is duplicated, so remove both occurrences,
1659 ;; then add back one occurrence by substituting a
1660 ;; comment that occurs once.
1661 (("using MacroAssembler::call_VM_leaf_base;") "")
1662 (("Interpreter specific version of call_VM_base")
1663 (string-append "Interpreter specific version of call_VM_base\n"
1664 " using MacroAssembler::call_VM_leaf_base;"))))))
1665 #~())
1666 (replace 'remove-timestamping
1667 (lambda _
1668 (substitute* "src/hotspot/share/runtime/vm_version.cpp"
1669 (("__DATE__") "")
1670 (("__TIME__") ""))))
1671 (replace 'fix-java-shebangs
1672 (lambda _
1673 ;; 'blocked' was renamed to 'blacklisted' in this version for
1674 ;; some reason.
1675 (substitute* "make/data/blacklistedcertsconverter/\
1676blacklisted.certs.pem"
1677 (("^#!.*")
1678 "#! java BlacklistedCertsConverter SHA-256\n"))))))))))
1679
1680(define-public openjdk13
1681 (make-openjdk openjdk12 "13.0.14"
1682 "1v92i5rhahqkjw8mz09c9qasnxqc67ygy0y266kdmm534z0da755"
1683 (source (origin
1684 (inherit (package-source base))
1685 (patches (search-patches "openjdk-13-classlist-reproducibility.patch"
1686 "openjdk-10-jtask-reproducibility.patch"))))
1687 (arguments
1688 (substitute-keyword-arguments (package-arguments openjdk12)
1689 ((#:phases phases)
1690 #~(modify-phases #$phases
1691 (replace 'remove-timestamping
1692 (lambda _
1693 (substitute*
1694 "src/hotspot/share/runtime/abstract_vm_version.cpp"
1695 (("__DATE__") "")
1696 (("__TIME__") ""))))))))))
1697
1698(define-public openjdk14
1699 (make-openjdk
1700 openjdk13 "14.0.2"
1701 "07k9bsbxwyf2z2n50z96nvhsdai916mxdxcr5lm44jz7f6xrwfq6"
1702 (source (origin
1703 (inherit (package-source base))
1704 (snippet ;override snippet
1705 '(begin
1706 ;; The m4 macro uses 'help' to search for builtins, which is
1707 ;; not available in bash-minimal
1708 (substitute* "make/autoconf/basics.m4"
1709 (("if help") "if command -v"))
1710 (for-each delete-file (find-files "." "\\.(bin|exe|jar)$"))))
1711 (patches (search-patches "openjdk-10-setsignalhandler.patch"
1712 "openjdk-10-jtask-reproducibility.patch"
1713 "openjdk-13-classlist-reproducibility.patch"))))))
1714
1715(define-public openjdk15
1716 (make-openjdk
1717 openjdk14 "15.0.10"
1718 "0hdllv348bws6m992bh73jik18x0sv0k2m9l817b3zb7q802sp7x"
1719 (source (origin
1720 (inherit (package-source base))
1721 (modules '())
1722 (snippet #f)
1723 (patches
1724 (search-patches "openjdk-15-jtask-reproducibility.patch"
1725 "openjdk-15-xcursor-no-dynamic.patch"))))
1726 (inputs
1727 (modify-inputs inputs
1728 (append libxcursor))) ;for our patch to work
1729 (arguments
1730 (substitute-keyword-arguments (package-arguments base)
1731 ((#:implicit-inputs? _ #t)
1732 ;; This is necessary to avoid include ordering errors when adding a
1733 ;; lower GCC to native-inputs to avoid errors like "error: 'fesetround'
1734 ;; was not declared in this scope; did you mean 'setreuid'?"
1735 #f)
1736 ((#:configure-flags flags '%standard-phases)
1737 #~(cons "--without-gtest" ;this replaces...
1738 (delete "--disable-hotspot-gtest" #$flags))))) ;... this
1739 (native-inputs
1740 (append (modify-inputs native-inputs
1741 (delete "make" ;remove old gnu-make-4.2
1742 "openjdk") ;to remove non-jdk output
1743 (append `(,openjdk14 "jdk")))
1744 ;; On powerpc64le at least, GCC 14 cannot be used otherwise JDK 15
1745 ;; fails to bootstrap JDK 16, with incomprehensible errors like:
1746 ;; src/java.base/share/classes/java/lang/reflect/Proxy.java:1311:
1747 ;; error: integer number too large.
1748 (modify-inputs (%final-inputs)
1749 (replace "gcc" gcc-11))))))
1750
1751(define-public openjdk16
1752 (make-openjdk
1753 openjdk15 "16.0.2"
1754 "0587px2qbz07g3xi4a3ya6m630p72dvkxcn0bj1813pxnwvcgigz"
1755 (source (origin
1756 (inherit (package-source base))
1757 (patches (search-patches "openjdk-15-xcursor-no-dynamic.patch"
1758 "openjdk-10-setsignalhandler.patch"))))))
1759
1760(define-public openjdk17
1761 (make-openjdk
1762 openjdk16 "17.0.10"
1763 "1bq1rqnipz6wdr05s20gm8nlpb3328ljxckzvc5ag0gf7fzlhn5f"
1764 (source (origin
1765 (inherit (package-source base))
1766 (patches (search-patches "openjdk-15-xcursor-no-dynamic.patch"))))
1767 (arguments
1768 (substitute-keyword-arguments (package-arguments base)
1769 ((#:implicit-inputs? _ #t) #t) ;restore default
1770 ((#:phases phases)
1771 #~(modify-phases #$phases
1772 (replace 'fix-java-shebangs
1773 (lambda _
1774 ;; 'blacklisted' was renamed back to 'blocked'.
1775 (substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
1776 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))
1777 (native-inputs
1778 ;; Resume using the implicit inputs, including the current GCC.
1779 (fold alist-delete (package-native-inputs base)
1780 (map first (%final-inputs))))))
1781
1782(define-public openjdk18
1783 (make-openjdk openjdk17 "18.0.2.1"
1784 "0zxanjzz4p3psqahlidh55vx1ldanq70c2ygk3gcfn9a94vnr9rg"))
1785
1786(define-public openjdk19
1787 (make-openjdk openjdk18 "19.0.2"
1788 "08kvx7n8qhhfl25pig966881j5h4x7y0pf4brq16x0283fc0f4d4"
1789 (arguments
1790 (substitute-keyword-arguments (package-arguments openjdk18)
1791 ((#:phases phases)
1792 #~(modify-phases #$phases
1793 (replace 'fix-java-shebangs
1794 (lambda _
1795 ;; Update file path.
1796 (substitute* "src/java.base/share/data/blockedcertsconverter/blocked.certs.pem"
1797 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))
1798 (add-before 'configure 'define-java-environment-variables
1799 (lambda* (#:key inputs #:allow-other-keys)
1800 ;; Fix for "valid range 1980-01-01T00:00:02Z to 2099-12-31T23:59:59Z".
1801 (setenv "SOURCE_DATE_EPOCH" "1234567890")))))))))
1802
1803(define-public openjdk20
1804 (make-openjdk openjdk19 "20.0.2"
1805 "1af1v2c3d8x4c6shzl6cv9qwq7a4hn5map5pjh9vjcky0hkzd489"))
1806
1807(define-public openjdk21
1808 (make-openjdk openjdk20 "21.0.2"
1809 "0d1g3wnzr5whjpq8gvxq0h7kd7lxd3xgc6bh3kg8vzz096asn0kj"
1810 (source (origin
1811 (inherit (package-source base))
1812 (patches (search-patches "openjdk-21-fix-rpath.patch"
1813 "openjdk-15-xcursor-no-dynamic.patch"))))
1814 (arguments
1815 (substitute-keyword-arguments (package-arguments base)
1816 ((#:phases phases)
1817 #~(modify-phases #$phases
1818 (replace 'fix-java-shebangs
1819 (lambda _
1820 ;; 'blacklisted' was renamed back to 'blocked'.
1821 (substitute* "src/java.base/share/data/blockedcertsconverter/blocked.certs.pem"
1822 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))))
1823
1824(define-public openjdk22
1825 (make-openjdk
1826 openjdk21 "22.0.2"
1827 "1nj414yj6v9qrlm48yv5llr4jmgj9g20v6zsd39xrdx4x4x4p3b6"
1828 (arguments
1829 (substitute-keyword-arguments (package-arguments base)
1830 ((#:phases phases)
1831 #~(modify-phases #$phases
1832 (add-after 'unpack 'do-not-disable-new-dtags
1833 (lambda _
1834 ;; Our validate-runpath phases checks for RUNPATH, not RPATH.
1835 (substitute* "make/autoconf/flags-cflags.m4"
1836 ((" -Wl,--disable-new-dtags") ""))))))))))
1837
1838(define-public openjdk23
1839 (make-openjdk
1840 openjdk22 "23.0.2"
1841 "0kxllznzhgqfn8b97krg2yp1ag41g4phmgqahrvzafd2bq6zclnf"
1842 (source (origin
1843 (inherit (package-source base))
1844 ;; The 'openjdk-21-fix-rpath.patch' no longer applies, and it
1845 ;; appears not needed anymore. The
1846 ;; 'openjdk-15-xcursor-no-dynamic.patch' doesn't apply anymore;
1847 ;; the fix should be pursued in libx11 (see:
1848 ;; https://issues.guix.gnu.org/54654)
1849 (patches '())))))
1850
1851(define-public openjdk24
1852 (make-openjdk
1853 openjdk23 "24.0.1"
1854 "0h6sbzbjyqg85iml41pswdh2z3d7h2hhb0sd5yll37r1mj5lsxmx"
1855 (arguments
1856 (substitute-keyword-arguments (package-arguments base)
1857 ((#:configure-flags flags #~(list))
1858 (if (target-x86-32?)
1859 #~(cons* "--enable-deprecated-ports=yes" #$flags)
1860 flags))))))
1861
1862(define-public openjdk25
1863 (make-openjdk
1864 openjdk24 "25.0.2"
1865 "03aa34lscr3qbdl6qz3gqyp0nzkqfj02362mzmpkiq3y2g5xdnrj"
1866 (arguments
1867 (substitute-keyword-arguments (package-arguments base)
1868 ((#:configure-flags flags #~(list))
1869 (if (target-x86-32?)
1870 ;; Full builds on 32-bit x86 architectures are not supported as of
1871 ;; this version. Best we can do is to build with the "zero" variant.
1872 #~(cons* "--with-jvm-variants=zero"
1873 "--disable-precompiled-headers"
1874 #$flags)
1875 flags))
1876 ((#:phases phases #~%standard-phases)
1877 (if (target-x86-32?)
1878 #~(modify-phases #$phases
1879 (replace 'install
1880 (lambda _
1881 (let ((images (car (find-files "build" "-zero-release"
1882 #:directories? #t))))
1883 (copy-recursively (string-append images "/images/jdk")
1884 #$output:jdk)
1885 (copy-recursively (string-append images "/images/jre")
1886 #$output)
1887 (copy-recursively (string-append images "/images/docs")
1888 #$output:doc))))
1889 (replace 'install-libjvm
1890 (lambda _
1891 (let ((lib-out (string-append #$output "/lib"))
1892 (lib-jdk (string-append #$output:jdk "/lib")))
1893 (symlink (string-append lib-jdk "/zero/libjvm.so")
1894 (string-append lib-jdk "/libjvm.so"))
1895 (symlink (string-append lib-out "/zero/libjvm.so")
1896 (string-append lib-out "/libjvm.so"))))))
1897 phases))))))
1898
1899;;; Convenience alias to point to the latest version of OpenJDK.
1900(define-public openjdk openjdk25)
1901
1902
1903;; This version of JBR is here in order to be able to build custom
1904;; IntelliJ plugins. Those usually need both jbr11 and jbr17 for
1905;; tests.
1906(define-public jbr11
1907 (package
1908 (inherit openjdk11)
1909 (name "jbr")
1910 (version "11_0_16-b2248")
1911 (source (origin
1912 (method git-fetch)
1913 (uri (git-reference
1914 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1915 (commit (string-append "jb" version))))
1916 (file-name (string-append name "-" version "-checkout"))
1917 (sha256
1918 (base32
1919 "1fnrdx0wb21ghm6jczjzk7b9fz9hbdzd62512xhwpzvca57v2z09"))))
1920 (arguments
1921 (substitute-keyword-arguments (package-arguments openjdk11)
1922 ((#:configure-flags configure-flags)
1923 #~(append #$configure-flags
1924 (list "--with-jvm-features=shenandoahgc"
1925 "--enable-cds=yes"
1926 "--with-vendor-name=JetBrains s.r.o"
1927 "--with-vendor-url=https://www.jetbrains.com/"
1928 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
1929 (synopsis "JetBrains Java Runtime")
1930 (description "This package provides a Java runtime environment for
1931and Java development kit. It supports enhanced class redefinition (DCEVM),
1932includes a number of improvements in font rendering, keyboards support,
1933windowing/focus subsystems, HiDPI, accessibility, and performance,
1934provides better desktop integration and bugfixes not yet present in
1935OpenJDK.")
1936 (home-page "https://www.jetbrains.com/")
1937 (license license:gpl2+)))
1938
1939(define-public jbr17
1940 (package
1941 (inherit openjdk17)
1942 (name "jbr")
1943 (version "17.0.11b1207.30")
1944 (source (origin
1945 (method git-fetch)
1946 (uri (git-reference
1947 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1948 (commit (string-append "jbr-release-" version))))
1949 (file-name (string-append name "-" version "-checkout"))
1950 (sha256
1951 (base32
1952 "5bbf5z8faf9sdkig2fwkj06hb7hs9s3bpzzvbqn2i75lbwqk3bln"))
1953 (patches (search-patches "jbr-17-xcursor-no-dynamic.patch"))))
1954 (arguments
1955 (substitute-keyword-arguments (package-arguments openjdk17)
1956 ((#:configure-flags configure-flags)
1957 #~(append #$configure-flags
1958 (list "--with-jvm-features=shenandoahgc"
1959 "--enable-cds=yes"
1960 "--with-vendor-name=JetBrains s.r.o"
1961 "--with-vendor-url=https://www.jetbrains.com/"
1962 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
1963 (synopsis "JetBrains Java Runtime")
1964 (description "This package provides a Java runtime environment for
1965and Java development kit. It supports enhanced class redefinition (DCEVM),
1966includes a number of improvements in font rendering, keyboards support,
1967windowing/focus subsystems, HiDPI, accessibility, and performance,
1968provides better desktop integration and bugfixes not yet present in
1969OpenJDK.")
1970 (home-page "https://www.jetbrains.com/")
1971 (license license:gpl2+)))
1972
1973(define-public jbr21
1974 (package
1975 (inherit openjdk21)
1976 (name "jbr")
1977 (version "21.0.3b509.11")
1978 (source (origin
1979 (method git-fetch)
1980 (uri (git-reference
1981 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1982 (commit (string-append "jbr-release-" version))))
1983 (file-name (string-append name "-" version "-checkout"))
1984 (sha256
1985 (base32
1986 "03xkghbp0b1czc2ags9n8ilprf9sy4bhsma0wf8xfapqn6d2sfyd"))
1987 (patches (search-patches "openjdk-21-fix-rpath.patch"
1988 "jbr-17-xcursor-no-dynamic.patch"))))
1989 (inputs
1990 `(("wayland" ,wayland)
1991 ("libxkbcommon" ,libxkbcommon) ; for wayland
1992 ,@(package-inputs openjdk21)))
1993 (arguments
1994 (substitute-keyword-arguments (package-arguments openjdk21)
1995 ((#:configure-flags configure-flags)
1996 #~(append #$configure-flags
1997 (list "--with-jvm-features=shenandoahgc"
1998 "--enable-cds=yes"
1999 "--with-vendor-name=JetBrains s.r.o"
2000 "--with-vendor-url=https://www.jetbrains.com/"
2001 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
2002 (synopsis "JetBrains Java Runtime")
2003 (description "This package provides a Java runtime environment for
2004and Java development kit. It supports enhanced class redefinition (DCEVM),
2005includes a number of improvements in font rendering, keyboards support,
2006windowing/focus subsystems, HiDPI, accessibility, and performance,
2007provides better desktop integration and bugfixes not yet present in
2008OpenJDK.")
2009 (home-page "https://www.jetbrains.com/")
2010 (license license:gpl2+)))
2011
2012(define-public jbr25
2013 (package
2014 (inherit openjdk25)
2015 (name "jbr")
2016 (version "25.0.2b329.72")
2017 (source (origin
2018 (method git-fetch)
2019 (uri (git-reference
2020 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
2021 (commit (string-append "jbr-release-" version))))
2022 (file-name (string-append name "-" version "-checkout"))
2023 (sha256
2024 (base32
2025 "1m7pbz2ypx4h7n6iqss8bgymg9hqn14lnis4a2w87mgy51p370ib"))
2026 (patches
2027 (search-patches "jbr-25-wayland-drag-icon.patch"
2028 "jbr-25-wayland-intra-jvm-dnd.patch"))))
2029 (inputs
2030 `(("wayland" ,wayland)
2031 ("libxkbcommon" ,libxkbcommon) ; for wayland
2032 ,@(package-inputs openjdk25)))
2033 (native-inputs
2034 (modify-inputs (package-native-inputs openjdk25)
2035 (append wayland-protocols)))
2036 (arguments
2037 (substitute-keyword-arguments (package-arguments openjdk25)
2038 ((#:configure-flags configure-flags)
2039 #~(append #$configure-flags
2040 (list "--disable-warnings-as-errors"
2041 "--disable-java-warnings-as-errors"
2042 "--with-jvm-features=shenandoahgc"
2043 "--enable-cds=yes"
2044 (string-append "--with-wayland-protocols="
2045 (assoc-ref %build-inputs "wayland-protocols")
2046 "/share/wayland-protocols")
2047 "--with-vendor-name=JetBrains s.r.o"
2048 "--with-vendor-url=https://www.jetbrains.com/"
2049 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))
2050 ((#:phases phases)
2051 #~(modify-phases #$phases
2052 ;; JBR adds a 'static-jdk-image' target to 'make all' that
2053 ;; statically links both the Wayland and X11 AWT backends,
2054 ;; causing duplicate symbol errors. Build only what we need.
2055 ;; See also their workaround BROKEN_STATIC_LIBS make variable.
2056 (replace 'build
2057 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
2058 (apply invoke "make" "product-images" "all-docs-images"
2059 (format #f "JOBS=~a" (if parallel-build?
2060 (parallel-job-count)
2061 1))
2062 make-flags)))))))
2063 (synopsis "JetBrains Java Runtime")
2064 (description "This package provides a Java runtime environment for
2065and Java development kit. It supports enhanced class redefinition (DCEVM),
2066includes a number of improvements in font rendering, keyboards support,
2067windowing/focus subsystems, Wayland, HiDPI, accessibility, and performance,
2068provides better desktop integration and bugfixes not yet present in
2069OpenJDK.")
2070 (home-page "https://www.jetbrains.com/")
2071 (license license:gpl2+)))
2072
2073
2074(define-public ant/java8
2075 (package
2076 (name "ant")
2077 (version "1.10.17")
2078 (source (origin
2079 (method url-fetch)
2080 (uri (string-append "mirror://apache/ant/source/apache-ant-"
2081 version "-src.tar.gz"))
2082 (sha256
2083 (base32
2084 "0p34pqknp2rbk5wk6zw8m6jfn7rkk7fyv3yvk9zhfxhhxrf0lfgh"))
2085 (modules '((guix build utils)))
2086 (snippet
2087 '(begin
2088 (for-each delete-file
2089 (find-files "lib/optional" "\\.jar$"))
2090 #t))))
2091 (build-system gnu-build-system)
2092 (arguments
2093 (list
2094 #:modules '((srfi srfi-1)
2095 (guix build gnu-build-system)
2096 (guix build utils))
2097 #:tests? #f ;no "check" target
2098 #:phases
2099 #~(modify-phases %standard-phases
2100 (add-after 'unpack 'remove-scripts
2101 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
2102 ;; wrappers.
2103 (lambda _
2104 (for-each delete-file
2105 (find-files "src/script"
2106 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))))
2107 (delete 'bootstrap)
2108 (delete 'configure)
2109 (replace 'build
2110 (lambda* (#:key inputs #:allow-other-keys)
2111 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
2112
2113 ;; Disable tests to avoid dependency on hamcrest-core, which needs
2114 ;; Ant to build. This is necessary in addition to disabling the
2115 ;; "check" phase, because the dependency on "test-jar" would always
2116 ;; result in the tests to be run.
2117 (substitute* "build.xml"
2118 (("depends=\"jars,test-jar") "depends=\"jars"))
2119 (invoke "bash" "bootstrap.sh"
2120 (string-append "-Ddist.dir=" #$output))))
2121 (add-after 'build 'strip-jar-timestamps ;based on ant-build-system
2122 (lambda _
2123 (define (repack-archive jar)
2124 (let* ((dir (mkdtemp "jar-contents.XXXXXX"))
2125 (manifest (string-append dir "/META-INF/MANIFESTS.MF")))
2126 (with-directory-excursion dir
2127 (invoke "unzip" jar))
2128 (delete-file jar)
2129 ;; XXX: copied from (gnu build install)
2130 (for-each (lambda (file)
2131 (let ((s (lstat file)))
2132 (unless (eq? (stat:type s) 'symlink)
2133 (utime file 0 0 0 0))))
2134 (find-files dir #:directories? #t))
2135 ;; It is important that the manifest appears first.
2136 (with-directory-excursion dir
2137 (let* ((files (find-files "." ".*" #:directories? #t))
2138 ;; To ensure that the reference scanner can
2139 ;; detect all store references in the jars
2140 ;; we disable compression with the "-0" option.
2141 (command (if (file-exists? manifest)
2142 `("zip" "-0" "-X" ,jar ,manifest
2143 ,@files)
2144 `("zip" "-0" "-X" ,jar ,@files))))
2145 (apply invoke command)))))
2146 (for-each repack-archive
2147 (find-files
2148 (string-append #$output "/lib")
2149 "\\.jar$"))))
2150 (delete 'install))))
2151 (native-inputs
2152 `(("jdk" ,icedtea-8 "jdk")
2153 ("zip" ,zip)
2154 ("unzip" ,unzip)))
2155 (home-page "https://ant.apache.org")
2156 (synopsis "Build tool for Java")
2157 (description
2158 "Ant is a platform-independent build tool for Java. It is similar to
2159make but is implemented using the Java language, requires the Java platform,
2160and is best suited to building Java projects. Ant uses XML to describe the
2161build process and its dependencies, whereas Make uses Makefile format.")
2162 (license license:asl2.0)))
2163
2164(define-public ant/java8-empty-etc
2165 (package
2166 (inherit ant/java8)
2167 (arguments
2168 (substitute-keyword-arguments (package-arguments ant/java8)
2169 ((#:phases phases)
2170 #~(modify-phases #$phases
2171 (add-after 'build 'add-empty-etc-directory
2172 (lambda* (#:key outputs #:allow-other-keys)
2173 (mkdir-p (string-append (assoc-ref outputs "out") "/etc"))))))))))
2174
2175(define-public ant-1.10.14
2176 (package
2177 (inherit ant/java8)
2178 (name "ant")
2179 (version "1.10.14")
2180 (source
2181 (origin
2182 (method url-fetch)
2183 (uri (string-append "mirror://apache/ant/source/apache-ant-"
2184 version "-src.tar.gz"))
2185 (sha256
2186 (base32 "0m0vcazy1634nra8mcs3hvvf49avnbxf8f5y1icn5syi8hgy6pws"))
2187 (modules '((guix build utils)))
2188 (snippet
2189 '(begin
2190 (for-each delete-file
2191 (find-files "lib/optional" "\\.jar$"))
2192 #t))))
2193 (arguments
2194 (substitute-keyword-arguments (package-arguments ant/java8)
2195 ((#:phases phases)
2196 #~(modify-phases #$phases
2197 (replace 'remove-scripts
2198 (lambda _
2199 (for-each delete-file
2200 (find-files "src/script" ".*\\.(bat|cmd)$"))))
2201 (add-after 'build 'install-distribution-files
2202 (lambda* (#:key outputs #:allow-other-keys)
2203 (let* ((out (assoc-ref outputs "out"))
2204 (bin-dir (string-append out "/bin"))
2205 (etc-dir (string-append out "/etc"))
2206 (checkstyle-dir (string-append etc-dir "/checkstyle")))
2207 (for-each
2208 (lambda (file)
2209 (copy-file (string-append "src/script/" file)
2210 (string-append bin-dir "/" file))
2211 (chmod (string-append bin-dir "/" file) #o755))
2212 '("antRun" "antRun.pl" "runant.pl" "runant.py"))
2213 (mkdir-p checkstyle-dir)
2214 (for-each
2215 (lambda (file)
2216 (copy-file (string-append "src/etc/" file)
2217 (string-append etc-dir "/" file)))
2218 '("junit-frames.xsl"
2219 "junit-noframes.xsl"
2220 "junit-frames-xalan1.xsl"
2221 "coverage-frames.xsl"
2222 "maudit-frames.xsl"
2223 "mmetrics-frames.xsl"
2224 "changelog.xsl"
2225 "jdepend.xsl"
2226 "jdepend-frames.xsl"
2227 "log.xsl"
2228 "tagdiff.xsl"))
2229 (for-each
2230 (lambda (file)
2231 (copy-file (string-append "src/etc/checkstyle/" file)
2232 (string-append checkstyle-dir "/" file)))
2233 '("checkstyle-frames-sortby-check.xsl"
2234 "checkstyle-frames.xsl"
2235 "checkstyle-text.xsl"
2236 "checkstyle-xdoc.xsl"))
2237 (copy-file "build/lib/ant-bootstrap.jar"
2238 (string-append etc-dir "/ant-bootstrap.jar")))))))))))
2239
2240;; The 1.9.x series is the last that can be built with GCJ. The 1.10.x series
2241;; requires Java 8.
2242(define-public ant
2243 (package (inherit ant/java8)
2244 (version "1.9.15")
2245 (source (origin
2246 (method url-fetch)
2247 (uri (string-append "mirror://apache/ant/source/apache-ant-"
2248 version "-src.tar.gz"))
2249 (sha256
2250 (base32
2251 "1xy30f1w5gaqk6g3f0vw7ygix4rb6032qkcw42y4z8wd9jihgygd"))))
2252 ;; XXX: we do this to avoid a rebuild. This mess will be cleaned up
2253 ;; later.
2254 (arguments
2255 (substitute-keyword-arguments
2256 `(#:modules ((srfi srfi-1)
2257 (guix build gnu-build-system)
2258 (guix build utils))
2259 #:tests? #f ; no "check" target
2260 #:phases
2261 (modify-phases %standard-phases
2262 (delete 'bootstrap)
2263 (delete 'configure)
2264 (add-before 'build 'define-java-environment-variables
2265 (lambda* (#:key inputs #:allow-other-keys)
2266 ;; First, set environment variables (eases debugging on -K).
2267 (setenv "JAVA_HOME" (assoc-ref inputs "jamvm"))
2268 (setenv "JAVACMD" (search-input-file inputs "/bin/jamvm"))
2269 (setenv "JAVAC" (search-input-file inputs "/bin/jikes"))
2270 (setenv "CLASSPATH" (search-input-file inputs "/lib/rt.jar"))))
2271 (replace 'build
2272 (lambda* (#:key inputs outputs #:allow-other-keys)
2273 ;; Ant complains if this file doesn't exist.
2274 (setenv "HOME" "/tmp")
2275 (with-output-to-file "/tmp/.ant.properties"
2276 (lambda _ (display "")))
2277
2278 ;; Use jikes instead of javac for <javac ...> tags in build.xml
2279 (setenv "ANT_OPTS" "-Dbuild.compiler=jikes")
2280
2281 ;; jikes produces lots of warnings, but they are not very
2282 ;; interesting, so we silence them.
2283 (setenv "$BOOTJAVAC_OPTS" "-nowarn")
2284
2285 ;; Without these JamVM options the build may freeze.
2286 (substitute* "bootstrap.sh"
2287 (("^\"\\$\\{JAVACMD\\}\" " m)
2288 ,@(if (string-prefix? "armhf" (or (%current-system)
2289 (%current-target-system)))
2290 `((string-append m "-Xnocompact "))
2291 `((string-append m "-Xnocompact -Xnoinlining ")))))
2292
2293 ;; Disable tests because we are bootstrapping and thus don't have
2294 ;; any of the dependencies required to build and run the tests.
2295 (substitute* "build.xml"
2296 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
2297 (invoke "bash" "bootstrap.sh"
2298 (string-append "-Ddist.dir="
2299 (assoc-ref outputs "out")))))
2300 (add-after 'build 'strip-jar-timestamps ;based on ant-build-system
2301 (lambda* (#:key outputs #:allow-other-keys)
2302 (define (repack-archive jar)
2303 (let* ((dir (mkdtemp "jar-contents.XXXXXX"))
2304 (manifest (string-append dir "/META-INF/MANIFESTS.MF")))
2305 (with-directory-excursion dir
2306 (invoke "unzip" jar))
2307 (delete-file jar)
2308 ;; XXX: copied from (gnu build install)
2309 (for-each (lambda (file)
2310 (let ((s (lstat file)))
2311 (unless (eq? (stat:type s) 'symlink)
2312 (utime file 0 0 0 0))))
2313 (find-files dir #:directories? #t))
2314 ;; It is important that the manifest appears first.
2315 (with-directory-excursion dir
2316 (let* ((files (find-files "." ".*" #:directories? #t))
2317 ;; To ensure that the reference scanner can
2318 ;; detect all store references in the jars
2319 ;; we disable compression with the "-0" option.
2320 (command (if (file-exists? manifest)
2321 `("zip" "-0" "-X" ,jar ,manifest
2322 ,@files)
2323 `("zip" "-0" "-X" ,jar ,@files))))
2324 (apply invoke command)))))
2325 (for-each repack-archive
2326 (find-files
2327 (string-append (assoc-ref %outputs "out") "/lib")
2328 "\\.jar$"))))
2329 (delete 'install)))
2330 ((#:phases phases)
2331 `(modify-phases ,phases
2332 (delete 'define-java-environment-variables)
2333 (add-after 'unpack 'remove-scripts
2334 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
2335 ;; wrappers.
2336 (lambda _
2337 (for-each delete-file
2338 (find-files "src/script"
2339 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))
2340 #t))
2341 (replace 'build
2342 (lambda* (#:key inputs outputs #:allow-other-keys)
2343 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
2344
2345 ;; Disable tests to avoid dependency on hamcrest-core, which needs
2346 ;; Ant to build. This is necessary in addition to disabling the
2347 ;; "check" phase, because the dependency on "test-jar" would always
2348 ;; result in the tests to be run.
2349 (substitute* "build.xml"
2350 (("depends=\"jars,test-jar") "depends=\"jars"))
2351 (invoke "bash" "bootstrap.sh"
2352 (string-append "-Ddist.dir="
2353 (assoc-ref outputs "out")))))))))
2354 (native-inputs
2355 `(("jdk" ,icedtea-7 "jdk")
2356 ("zip" ,zip)
2357 ("unzip" ,unzip)))))
2358
2359(define-public ant-apache-bcel
2360 (package
2361 (inherit ant/java8)
2362 (name "ant-apache-bcel")
2363 (arguments
2364 (substitute-keyword-arguments (package-arguments ant/java8)
2365 ((#:phases phases)
2366 #~(modify-phases #$phases
2367 (add-after 'unpack 'link-bcel
2368 (lambda* (#:key inputs #:allow-other-keys)
2369 (for-each (lambda (file)
2370 (symlink file
2371 (string-append "lib/optional/"
2372 (basename file))))
2373 (find-files (assoc-ref inputs "java-commons-bcel")
2374 "\\.jar$"))))
2375 (add-after 'build 'install
2376 (lambda _
2377 (let ((share (string-append #$output "/share/java"))
2378 (bin (string-append #$output "/bin"))
2379 (lib (string-append #$output "/lib")))
2380 (mkdir-p share)
2381 (install-file (string-append lib "/ant-apache-bcel.jar") share)
2382 (delete-file-recursively bin)
2383 (delete-file-recursively lib))))))))
2384 (inputs
2385 (modify-inputs (package-inputs ant/java8)
2386 (prepend java-commons-bcel)))))
2387
2388(define-public ant-junit
2389 (package
2390 (inherit ant/java8)
2391 (name "ant-junit")
2392 (arguments
2393 (substitute-keyword-arguments (package-arguments ant/java8)
2394 ((#:phases phases)
2395 #~(modify-phases #$phases
2396 (add-after 'unpack 'link-junit
2397 (lambda* (#:key inputs #:allow-other-keys)
2398 (for-each (lambda (file)
2399 (symlink file
2400 (string-append "lib/optional/"
2401 (basename file))))
2402 (find-files (assoc-ref inputs "java-junit")
2403 "\\.jar$"))))
2404 (add-after 'build 'install
2405 (lambda _
2406 (let ((share (string-append #$output "/share/java"))
2407 (bin (string-append #$output "/bin"))
2408 (lib (string-append #$output "/lib")))
2409 (mkdir-p share)
2410 (install-file (string-append lib "/ant-junit.jar") share)
2411 (delete-file-recursively bin)
2412 (delete-file-recursively lib))))))))
2413 (inputs
2414 (modify-inputs (package-inputs ant/java8)
2415 (prepend java-junit)))))
2416
2417(define-public libantlr3c
2418 (package
2419 (name "libantlr3c")
2420 (version "3.4")
2421 (source
2422 (origin
2423 (method url-fetch)
2424 (uri
2425 (string-append "https://www.antlr3.org/download/C/"
2426 name "-" version ".tar.gz"))
2427 (sha256
2428 (base32 "0lpbnb4dq4azmsvlhp6khq1gy42kyqyjv8gww74g5lm2y6blm4fa"))))
2429 (build-system gnu-build-system)
2430 (arguments
2431 (list #:configure-flags
2432 #~(list "--enable-debuginfo"
2433 "--disable-static"
2434 #$@(if (target-64bit?)
2435 #~("--enable-64bit")
2436 #~())
2437 #$@(if (target-riscv64?)
2438 #~("--disable-abiflags")
2439 #~()))))
2440 (synopsis "ANTLR C Library")
2441 (description "LIBANTLR3C provides run-time C libraries for ANTLR3 (ANother
2442Tool for Language Recognition v3).")
2443 (home-page "https://www.antlr3.org/")
2444 (license license:bsd-3)))
2445
2446(define-public drip
2447 ;; Last release is from 2014, with a few important commits afterwards.
2448 (let ((commit "a4bd00df0199e78243847f06cc04ecaea31f8f08"))
2449 (package
2450 (name "drip")
2451 (version (git-version "0.2.4" "1" commit))
2452 (source (origin
2453 (method git-fetch)
2454 (uri (git-reference
2455 (url "https://github.com/ninjudd/drip")
2456 (commit commit)))
2457 (file-name (git-file-name name version))
2458 (sha256
2459 (base32
2460 "0wzmjwfyldr3jn49517xd8yn7dgdk8h88qkga3kjyg1zc375ylg2"))))
2461 (build-system gnu-build-system)
2462 (native-inputs
2463 `(("jdk" ,icedtea "jdk")))
2464 (arguments
2465 (list #:tests? #f ; No tests.
2466 #:phases
2467 #~(modify-phases %standard-phases
2468 (delete 'configure)
2469 (add-before 'build 'relax-gcc-14-strictness
2470 (lambda _
2471 (substitute* "Makefile"
2472 ((" gcc(.*)$" all options)
2473 (string-append
2474 " gcc"
2475 " -Wno-error=incompatible-pointer-types"
2476 " -Wno-error=implicit-function-declaration"
2477 options)))))
2478 (add-before 'install 'fix-wrapper
2479 (lambda* (#:key inputs #:allow-other-keys)
2480 (let ((jps (search-input-file inputs "/bin/jps")))
2481 (substitute* "bin/drip"
2482 (("jps") jps)
2483 (("brew update && brew upgrade drip") "guix pull && guix install drip")
2484 ;; No need to make:
2485 (("\\(cd -- \"\\$drip_dir\" && make -s\\) \\|\\| exit 1") "")
2486 ;; No need to include source:
2487 (("\\[\\[ -r \\$drip_dir/src/org/flatland/drip/Main\\.java \\]\\]")
2488 "true")))))
2489 (replace 'install
2490 (lambda* (#:key outputs #:allow-other-keys)
2491 (let* ((bin (string-append #$output "/bin"))
2492 (share (string-append #$output "/share/drip")))
2493 (mkdir-p bin)
2494 (for-each
2495 (lambda (file)
2496 (install-file (string-append "bin/" file) bin))
2497 '("drip" "drip_daemon" "drip_proxy"))
2498 (install-file "drip.jar" share)
2499 (substitute* (string-append bin "/drip")
2500 (("drip_dir=\\$bin_dir/..")
2501 (string-append "drip_dir=" share)))))))))
2502 (home-page "https://github.com/ninjudd/drip")
2503 (synopsis "Faster Java Virtual Machine launching")
2504 (description "Drip is a launcher for the Java Virtual Machine that
2505provides much faster startup times than the @command{java} command. The @command{drip}
2506script is intended to be a drop-in replacement for the @command{java} command,
2507only faster.")
2508 (license license:epl1.0))))
2509
2510(define-public java-openjfx-build
2511 (package
2512 (name "java-openjfx-build")
2513 ;; This is a java-8 version
2514 (version "8.202")
2515 (source (origin
2516 (method hg-fetch)
2517 (uri (hg-reference
2518 (url "http://hg.openjdk.java.net/openjfx/8u-dev/rt")
2519 (changeset (string-append
2520 (string-join (string-split version #\.) "u")
2521 "-ga"))))
2522 (file-name (string-append name "-" version "-checkout"))
2523 (modules '((guix build utils)))
2524 (snippet
2525 '(begin
2526 ;; Delete included gradle jar
2527 (delete-file-recursively "gradle/wrapper")
2528 #t))
2529 (sha256
2530 (base32
2531 "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))
2532 (patches (search-patches "java-openjfx-build-jdk_version.patch"))))
2533 (build-system ant-build-system)
2534 (arguments
2535 `(#:jar-name "java-openjfx.jar"
2536 #:source-dir "buildSrc/src/main/java"
2537 #:test-dir "buildSrc/src/test"
2538 #:phases
2539 (modify-phases %standard-phases
2540 (add-before 'configure 'generate-jsl-parser
2541 (lambda _
2542 (invoke "antlr3" "-o"
2543 "buildSrc/src/main/java/com/sun/scenario/effect/compiler"
2544 "buildSrc/src/main/antlr/JSL.g"))))))
2545 (inputs
2546 (list antlr3 java-stringtemplate))
2547 (native-inputs
2548 (list java-junit java-hamcrest-core))
2549 (home-page "https://openjfx.io")
2550 (synopsis "Graphical application toolkit in Java")
2551 (description "OpenJFX is a client application platform for desktop,
2552mobile and embedded systems built on Java. Its goal is to produce a
2553modern, efficient, and fully featured toolkit for developing rich client
2554applications. This package contains base classes for the OpenJFX
2555distribution and helper classes for building other parts of the
2556distribution.")
2557 (license license:gpl2))) ;gpl2 only, with classpath exception
2558
2559(define-public java-openjfx-base
2560 (package (inherit java-openjfx-build)
2561 (name "java-openjfx-base")
2562 (arguments
2563 `(#:jar-name "java-openjfx-base.jar"
2564 #:source-dir "modules/base/src/main/java:modules/base/src/main/java8:modules/base/src/main/version-info"
2565 #:test-dir "modules/base/src/test"
2566 #:phases
2567 (modify-phases %standard-phases
2568 (add-before 'check 'remove-empty-file
2569 (lambda _
2570 (with-directory-excursion "modules/base/src/test/java"
2571 ;; These files are completely commented, but junit expects them to
2572 ;; contain a class, so tests fail.
2573 (delete-file
2574 "com/sun/javafx/property/adapter/PropertyDescriptorTest.java")
2575 (delete-file
2576 "com/sun/javafx/property/adapter/ReadOnlyPropertyDescriptorTest.java")
2577 (delete-file "javafx/beans/property/PropertiesTest.java")
2578 (delete-file
2579 "javafx/beans/property/adapter/ReadOnlyJavaBeanPropertyBuilder_General_Test.java")
2580 ;; This one fails
2581 (delete-file "com/sun/javafx/runtime/VersionInfoTest.java"))
2582 #t)))))
2583 (propagated-inputs
2584 (list java-openjfx-build))
2585 (description "OpenJFX is a client application platform for desktop,
2586mobile and embedded systems built on Java. Its goal is to produce a
2587modern, efficient, and fully featured toolkit for developing rich client
2588applications. This package contains base classes for the OpenJFX
2589distribution.")))
2590
2591(define-public java-openjfx-graphics
2592 (package (inherit java-openjfx-build)
2593 (name "java-openjfx-graphics")
2594 (arguments
2595 `(#:jar-name "java-openjfx-graphics.jar"
2596 #:source-dir "modules/graphics/src/main/java"
2597 #:tests? #f; require X
2598 #:test-dir "modules/graphics/src/test"
2599 #:phases
2600 (modify-phases %standard-phases
2601 (add-after 'unpack 'copy-missing-file
2602 (lambda* (#:key inputs #:allow-other-keys)
2603 (let ((target "modules/graphics/src/main/native-prism-sw/JNativeSurface.c"))
2604 (copy-file (assoc-ref inputs "JNativeSurface.c") target)
2605 ;; XXX: looks like the missing file we found isn't *quite*
2606 ;; compatible...
2607 (substitute* target
2608 (("case TYPE_INT_ARGB:") "")))))
2609 (add-after 'build 'build-native
2610 (lambda* (#:key inputs outputs #:allow-other-keys)
2611 (let ((jdk (assoc-ref inputs "jdk"))
2612 (class-file->class-name
2613 (lambda (class-file)
2614 (string-map (lambda (c)
2615 (if (char=? c #\/) #\. c))
2616 (string-drop-right class-file
2617 (string-length ".class"))))))
2618 (setenv "CPPFLAGS"
2619 (string-append "-DINLINE=inline "
2620 "-DLINUX "
2621 "-I" jdk "/include "
2622 "-I" jdk "/include/linux "
2623 "-I " (getcwd) "/build/classes/include "
2624 "-I " (getcwd) "/modules/graphics/src/main/native-prism-sw"))
2625
2626 ;; Instructions have been adapted from buildSrc/linux.gradle
2627 (with-directory-excursion "build/classes"
2628 ;; Build prism
2629 (mkdir-p "include")
2630
2631 ;; Generate headers for prism
2632 (apply invoke "javah" "-d" "include" "-cp" "."
2633 (map class-file->class-name
2634 (append (find-files "com/sun/prism/impl" "\\.class$")
2635 (find-files "com/sun/prism" "PresentableState.*\\.class$"))))
2636
2637 ;; ...then for prism_sw
2638 (apply invoke "javah" "-d" "include" "-cp" "."
2639 (map class-file->class-name
2640 (find-files "com/sun/pisces" "\\.class$")))
2641
2642 ;; ...and for prism_es2
2643 (apply invoke "javah" "-d" "include" "-cp" "."
2644 (map class-file->class-name
2645 (find-files "com/sun/prism/es2" "\\.class$")))))
2646
2647 (with-directory-excursion "netbeans/native-prism"
2648 (invoke "make" "CONF=Release"))
2649 (with-directory-excursion "netbeans/native-prism-sw"
2650 (invoke "make" "CONF=Release"))
2651 ;; TODO: This fails due to unknown EGL procedure names
2652 #;
2653 (with-directory-excursion "netbeans/native-prism-es2"
2654 (invoke "make" "CONF=Release"))
2655
2656 (let* ((out (assoc-ref outputs "out"))
2657 (dir ,(match (%current-system)
2658 ("i686-linux"
2659 "i386")
2660 ((or "armhf-linux" "aarch64-linux")
2661 "arm")
2662 ((or "x86_64-linux")
2663 "amd64")
2664 (_ "unknown")))
2665 (target (string-append out "/share/" dir "/")))
2666 (mkdir-p target)
2667 (for-each (lambda (file)
2668 (let ((new-name
2669 (string-append "lib"
2670 (string-map
2671 (lambda (c)
2672 (if (char=? c #\-) #\_ c))
2673 (string-drop (basename file)
2674 (string-length "libnative-"))))))
2675 (copy-file file
2676 (string-append target new-name))))
2677 (find-files "netbeans" "\\.so$"))))))))
2678 (propagated-inputs
2679 (list java-openjfx-base))
2680 (inputs
2681 (list java-swt))
2682 ;; XXX: for unknown reasons
2683 ;; modules/graphics/src/main/native-prism-sw/JNativeSurface.c is missing
2684 ;; in this revision.
2685 (native-inputs
2686 `(("JNativeSurface.c"
2687 ,(origin
2688 (method url-fetch)
2689 (uri "https://raw.githubusercontent.com/openjdk/jfx/8u20-b02\
2690/modules/graphics/src/main/native-prism-sw/JNativeSurface.c")
2691 (sha256
2692 (base32
2693 "1kp15wbnd6rn0nciczp5ibq0ikby2yysvx1gnz5fa05vl2mm8mbm"))))))
2694 (description "OpenJFX is a client application platform for desktop,
2695mobile and embedded systems built on Java. Its goal is to produce a
2696modern, efficient, and fully featured toolkit for developing rich client
2697applications. This package contains graphics-related classes for the
2698OpenJFX distribution.")))
2699
2700(define-public java-openjfx-media
2701 (package (inherit java-openjfx-build)
2702 (name "java-openjfx-media")
2703 (propagated-inputs
2704 `(("java-openjxf-graphics" ,java-openjfx-graphics)))
2705 (arguments
2706 `(#:jar-name "java-openjfx-media.jar"
2707 #:source-dir "modules/media/src/main/java"
2708 #:tests? #f)); no tests
2709 (description "OpenJFX is a client application platform for desktop,
2710mobile and embedded systems built on Java. Its goal is to produce a
2711modern, efficient, and fully featured toolkit for developing rich client
2712applications. This package contains media-related classes for the
2713OpenJFX distribution.")))
2714
2715(define-public java-openjfx-controls
2716 (package (inherit java-openjfx-build)
2717 (name "java-openjfx-controls")
2718 (propagated-inputs
2719 `(("java-openjxf-graphics" ,java-openjfx-graphics)))
2720 (arguments
2721 `(#:jar-name "java-openjfx-controls.jar"
2722 #:source-dir "modules/controls/src/main/java"
2723 #:test-dir "modules/controls/src/test"
2724 ;; TODO: tests require com.sun.javafx.pgstub,
2725 ;; javafx.collections.MockSetObserver, and
2726 ;; com.sun.javafx.binding.ExpressionHelperUtility
2727 #:tests? #false
2728 #:phases
2729 (modify-phases %standard-phases
2730 (add-after 'unpack 'copy-resources
2731 (lambda _
2732 (copy-recursively "modules/controls/src/test/resources"
2733 "build/test-classes")
2734 (copy-recursively "modules/controls/src/main/resources"
2735 "build/classes"))))))
2736 (description "OpenJFX is a client application platform for desktop,
2737mobile and embedded systems built on Java. Its goal is to produce a
2738modern, efficient, and fully featured toolkit for developing rich client
2739applications. This package contains UI control classes for the
2740OpenJFX distribution.")))
2741
2742(define-public javacc-4
2743 (package
2744 (name "javacc")
2745 (version "4.1")
2746 (source (origin
2747 (method git-fetch)
2748 (uri (git-reference
2749 (url "https://github.com/javacc/javacc")
2750 (commit "release_41")))
2751 (file-name (string-append "javacc-" version "-checkout"))
2752 (sha256
2753 (base32
2754 "07ysav7j8r1c6h8qxrgqk6lwdp74ly0ad1935lragxml0qqc3ka0"))
2755 (modules '((guix build utils)))
2756 ;; delete bundled jars
2757 (snippet '(begin (delete-file-recursively "lib") #t))))
2758 (build-system ant-build-system)
2759 ;; Tests fail with
2760 ;; /tmp/guix-build-javacc-4.1.drv-0/source/test/javacodeLA/build.xml:60:
2761 ;; JAVACODE failed
2762 (arguments
2763 `(#:tests? #f
2764 #:phases
2765 (modify-phases %standard-phases
2766 ;; Delete tests to avoid build failure (we don't run them anyway).
2767 (add-after 'unpack 'delete-tests
2768 (lambda _
2769 (for-each delete-file
2770 '("src/org/javacc/JavaCCTestCase.java"
2771 "src/org/javacc/parser/ExpansionTest.java"
2772 "src/org/javacc/parser/OptionsTest.java"
2773 "src/org/javacc/jjtree/JJTreeOptionsTest.java"))
2774 (for-each delete-file-recursively
2775 '("src/org/javacc/parser/test"
2776 "src/org/javacc/jjdoc/test"))
2777 #t))
2778 (replace 'install (install-jars "bin/lib")))))
2779 (home-page "https://javacc.org/")
2780 (synopsis "Java parser generator")
2781 (description "Java Compiler Compiler (JavaCC) is the most popular parser
2782generator for use with Java applications. A parser generator is a tool that
2783reads a grammar specification and converts it to a Java program that can
2784recognize matches to the grammar. In addition to the parser generator itself,
2785JavaCC provides other standard capabilities related to parser generation such
2786as tree building (via a tool called JJTree included with JavaCC), actions,
2787debugging, etc.")
2788 (license license:bsd-3)))
2789
2790;; javacc-3, as javacc-4 is not properly bootstrapped: is contains a javacc.jar
2791;; in the bootstrap/ directory.
2792(define-public javacc-3
2793 (package
2794 (inherit javacc-4)
2795 (version "3.2")
2796 (source (origin
2797 (method git-fetch)
2798 (uri (git-reference
2799 (url "https://github.com/javacc/javacc")
2800 (commit "release_32")))
2801 (file-name (string-append "javacc-" version "-checkout"))
2802 (sha256
2803 (base32
2804 "1pyf1xyh8gk83nxqn2v2mdws32l68ydznha41cxa4l2kkbq1v1g3"))))
2805 (arguments
2806 `(#:tests? #f
2807 #:phases
2808 (modify-phases %standard-phases
2809 (add-before 'build 'set-java-version
2810 (lambda _
2811 (for-each
2812 (lambda (file)
2813 (substitute* file
2814 (("debug=") "source=\"1.4\" debug=")))
2815 (find-files "." "build.xml"))
2816 #t))
2817 (replace 'install (install-jars "bin/lib")))))))
2818
2819(define-public javacc
2820 (package
2821 (inherit javacc-4)
2822 (version "7.0.4")
2823 (source
2824 (origin
2825 (method git-fetch)
2826 (uri (git-reference
2827 (url "https://github.com/javacc/javacc")
2828 (commit version)))
2829 (file-name (git-file-name "javacc" version))
2830 (sha256
2831 (base32 "18kkak3gda93gr25jrgy6q00g0jr8i24ri2wk4kybz1v234fxx9i"))
2832 (modules '((guix build utils)))
2833 ;; Delete bundled jars.
2834 (snippet '(begin (for-each delete-file-recursively
2835 '("bootstrap" "lib"))))))
2836 (arguments
2837 `(#:make-flags ; bootstrap from javacc-4
2838 ,#~(list (string-append "-Dbootstrap-jar="
2839 #$(this-package-native-input "javacc")
2840 "/share/java/javacc.jar"))
2841 #:test-target "test"
2842 #:phases
2843 (modify-phases %standard-phases
2844 (replace 'install (install-jars "target"))
2845 (add-after 'install 'install-bin
2846 (lambda* (#:key outputs inputs #:allow-other-keys)
2847 (let* ((out (assoc-ref outputs "out"))
2848 (dir (string-append out "/share/java"))
2849 (bin (string-append out "/bin"))
2850 (javacc (string-append bin "/javacc")))
2851 (mkdir-p bin)
2852 (with-output-to-file javacc
2853 (lambda _
2854 (display
2855 (string-append "#!/bin/sh\n"
2856 (assoc-ref inputs "icedtea") "/bin/java"
2857 " -cp " dir "/javacc.jar" " `basename $0`" " $*"))))
2858 (chmod javacc #o755)
2859 ;; symlink to different names to affect the first argument and
2860 ;; change the behavior of the jar file.
2861 (symlink javacc (string-append bin "/jjdoc"))
2862 (symlink javacc (string-append bin "/jjtree"))))))))
2863 (native-inputs
2864 (list javacc-4))
2865 (inputs (list icedtea-8))))
2866
2867(define-public java-ecj
2868 (package
2869 (name "java-ecj")
2870 (version "4.6.3")
2871 (source
2872 (origin
2873 (method url-fetch)
2874 (uri (string-append "http://archive.eclipse.org/eclipse/"
2875 "downloads/drops4/R-" version "-201703010400/"
2876 "ecjsrc-" version ".jar"))
2877 (sha256
2878 (base32
2879 "11cfgsdgznja1pvlxkjbqykxd7pcd5655vkm7s44xmahmap15gpl"))))
2880 (build-system ant-build-system)
2881 (arguments
2882 `(#:tests? #f ; none included
2883 #:build-target "build"
2884 #:phases
2885 (modify-phases %standard-phases
2886 (add-after 'unpack 'fix-build.xml
2887 (lambda _
2888 (substitute* "src/build.xml"
2889 (("^.*MANIFEST.*$")
2890 "")
2891 (("^.*properties.*$")
2892 "<include name=\"**/*.properties\"/>
2893 <include name=\"**/*.props\"/>"))))
2894 (add-before 'build 'chdir
2895 (lambda _ (chdir "src")))
2896 (replace 'install (install-jars ".")))))
2897 (home-page "https://eclipse.org")
2898 (synopsis "Eclipse Java development tools core batch compiler")
2899 (description "This package provides the Eclipse Java core batch compiler.")
2900 (license license:epl1.0)))
2901
2902(define-public java-cisd-base
2903 (let ((revision 38938)
2904 (base-version "14.12.0"))
2905 (package
2906 (name "java-cisd-base")
2907 (version (string-append base-version "-" (number->string revision)))
2908 (source (origin
2909 (method svn-fetch)
2910 (uri (svn-reference
2911 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2912 "base/tags/release/"
2913 (version-major+minor base-version)
2914 ".x/" base-version "/base/"))
2915 (revision revision)))
2916 (file-name (string-append "java-cisd-base-" version "-checkout"))
2917 (sha256
2918 (base32
2919 "1i5adyf7nzclb0wydgwa1az04qliid8035vpahaandmkmigbnxiy"))
2920 (modules '((guix build utils)))
2921 (snippet
2922 '(begin
2923 ;; Delete included gradle jar
2924 (delete-file-recursively "gradle/wrapper")
2925 ;; Delete pre-built native libraries
2926 (delete-file-recursively "libs")
2927 #t))))
2928 (build-system ant-build-system)
2929 (arguments
2930 `(#:make-flags '("-file" "build/build.xml")
2931 #:test-target "jar-test"
2932 #:jdk ,icedtea-8
2933 #:phases
2934 (modify-phases %standard-phases
2935 (add-after 'unpack 'unpack-build-resources
2936 (lambda* (#:key inputs #:allow-other-keys)
2937 (copy-recursively (assoc-ref inputs "build-resources")
2938 "../build_resources")
2939 #t))
2940 (add-after 'unpack-build-resources 'fix-dependencies
2941 (lambda* (#:key inputs #:allow-other-keys)
2942 (substitute* "build/build.xml"
2943 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
2944 (search-input-file inputs
2945 "/share/java/java-testng.jar"))
2946 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
2947 (search-input-file inputs
2948 (string-append
2949 "/share/java/commons-lang-"
2950 ,(package-version java-commons-lang)
2951 ".jar")))
2952 (("\\$\\{lib\\}/commons-io/commons-io.jar")
2953 (search-input-file inputs
2954 (string-append
2955 "/lib/m2/commons-io/commons-io/"
2956 ,(package-version java-commons-io)
2957 "/commons-io-"
2958 ,(package-version java-commons-io)
2959 ".jar")))
2960 ;; Remove dependency on svn
2961 (("<build-info.*") "")
2962 (("\\$\\{revision.number\\}")
2963 ,(number->string revision))
2964 (("\\$\\{version.number\\}") ,base-version))
2965 ;; Remove dependency on classycle
2966 (substitute* "../build_resources/ant/build-common.xml"
2967 (("<taskdef name=\"dependency-checker.*") "")
2968 (("classname=\"classycle.*") "")
2969 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
2970 #t))
2971 ;; A few tests fail because of the lack of a proper /etc/groups and
2972 ;; /etc/passwd file in the build container.
2973 (add-after 'unpack 'disable-broken-tests
2974 (lambda _
2975 (substitute* "sourceTest/java/ch/systemsx/cisd/base/AllTests.java"
2976 (("Unix.isOperational\\(\\)") "false"))
2977 #t))
2978 ;; These decorators are almost useless and pull in an unpackaged
2979 ;; dependency.
2980 (add-after 'unpack 'remove-useless-decorators
2981 (lambda _
2982 (substitute* "source/java/ch/systemsx/cisd/base/unix/Unix.java"
2983 (("@Private") "")
2984 (("import ch.rinn.restrictions.Private;") ""))
2985 (substitute* "sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java"
2986 (("@Friend.*") "")
2987 (("import ch.rinn.restrictions.Friend;") ""))
2988 #t))
2989 (add-before 'configure 'build-native-code
2990 (lambda* (#:key inputs #:allow-other-keys)
2991 (let ((jdk (assoc-ref inputs "jdk"))
2992 (dir ,(match (%current-system)
2993 ("i686-linux"
2994 "i386-Linux")
2995 ((or "armhf-linux" "aarch64-linux")
2996 "arm-Linux")
2997 ((or "x86_64-linux")
2998 "amd64-Linux")
2999 (_ "unknown-Linux"))))
3000 (with-directory-excursion "source/c"
3001 (invoke "gcc" "-shared" "-O3" "-fPIC" "unix.c"
3002 (string-append "-I" jdk "/include")
3003 (string-append "-I" jdk "/include/linux")
3004 "-o" "libunix.so")
3005 (invoke "gcc" "-shared" "-O3" "-fPIC"
3006 "-DMACHINE_BYTE_ORDER=1"
3007 "copyCommon.c"
3008 "copyByteChar.c"
3009 "copyByteDouble.c"
3010 "copyByteFloat.c"
3011 "copyByteInt.c"
3012 "copyByteLong.c"
3013 "copyByteShort.c"
3014 (string-append "-I" jdk "/include")
3015 (string-append "-I" jdk "/include/linux")
3016 "-o" "libnativedata.so"))
3017 (install-file "source/c/libunix.so"
3018 (string-append "libs/native/unix/" dir))
3019 (install-file "source/c/libnativedata.so"
3020 (string-append "libs/native/nativedata/" dir))
3021 #t)))
3022 ;; In the "check" phase we only build the test executable.
3023 (add-after 'check 'run-tests
3024 (lambda _
3025 (invoke "java" "-jar" "targets/dist/sis-base-test.jar")
3026 (delete-file "targets/dist/sis-base-test.jar")
3027 #t))
3028 (replace 'install (install-jars "targets/dist")))))
3029 (native-inputs
3030 `(("jdk" ,icedtea-8)
3031 ("java-commons-lang" ,java-commons-lang)
3032 ("java-commons-io" ,java-commons-io)
3033 ("java-testng" ,java-testng)
3034 ("build-resources"
3035 ,(origin
3036 (method svn-fetch)
3037 (uri (svn-reference
3038 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3039 "base/tags/release/"
3040 (version-major+minor base-version)
3041 ".x/" base-version
3042 "/build_resources/"))
3043 (revision revision)))
3044 (sha256
3045 (base32
3046 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
3047 (home-page "https://svnsis.ethz.ch")
3048 (synopsis "Utility classes for libraries from ETH Zurich")
3049 (description "This library supplies some utility classes needed for
3050libraries from the SIS division at ETH Zurich like jHDF5.")
3051 ;; The C sources are under a non-copyleft license, which looks like a
3052 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
3053 (license (list license:asl2.0
3054 (license:non-copyleft "file://source/c/COPYING"))))))
3055
3056(define-public java-cisd-args4j
3057 (let ((revision 39162)
3058 (base-version "9.11.2"))
3059 (package
3060 (name "java-cisd-args4j")
3061 (version (string-append base-version "-" (number->string revision)))
3062 (source (origin
3063 (method svn-fetch)
3064 (uri (svn-reference
3065 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3066 "args4j/tags/release/"
3067 (version-major+minor base-version)
3068 ".x/" base-version "/args4j/"))
3069 (revision revision)))
3070 (file-name (string-append "java-cisd-args4j-" version "-checkout"))
3071 (sha256
3072 (base32
3073 "0hhqznjaivq7ips7mkwas78z42s6djsm20rrs7g1zd59rcsakxn2"))))
3074 (build-system ant-build-system)
3075 (arguments
3076 `(#:make-flags '("-file" "build/build.xml")
3077 #:tests? #f ; there are no tests
3078 #:modules ((guix build ant-build-system)
3079 (guix build utils)
3080 (guix build java-utils)
3081 (sxml simple)
3082 (sxml transform)
3083 (sxml xpath))
3084 #:phases
3085 (modify-phases %standard-phases
3086 (add-after 'unpack 'unpack-build-resources
3087 (lambda* (#:key inputs #:allow-other-keys)
3088 (mkdir-p "../build_resources")
3089 (copy-recursively (assoc-ref inputs "build-resources")
3090 "../build_resources")
3091 (mkdir-p "../build_resources/lib")))
3092 (add-after 'unpack-build-resources 'fix-dependencies
3093 (lambda* (#:key inputs #:allow-other-keys)
3094 ;; FIXME: There should be a more convenient abstraction for
3095 ;; editing XML files.
3096 (with-directory-excursion "../build_resources/ant/"
3097 (chmod "build-common.xml" #o664)
3098 (call-with-output-file "build-common.xml.new"
3099 (lambda (port)
3100 (sxml->xml
3101 (pre-post-order
3102 (with-input-from-file "build-common.xml"
3103 (lambda _ (xml->sxml #:trim-whitespace? #t)))
3104 `(;; Remove dependency on classycle and custom ant tasks
3105 (taskdef . ,(lambda (tag . kids)
3106 (let ((name ((sxpath '(name *text*)) kids)))
3107 (if (or (member "build-info" name)
3108 (member "dependency-checker" name)
3109 (member "build-java-subprojects" name)
3110 (member "project-classpath" name))
3111 '() ; skip
3112 `(,tag ,@kids)))))
3113 (typedef . ,(lambda (tag . kids)
3114 (let ((name ((sxpath '(name *text*)) kids)))
3115 (if (member "recursive-jar" name)
3116 '() ; skip
3117 `(,tag ,@kids)))))
3118 (build-java-subprojects . ,(lambda _ '()))
3119 ;; Ignore everything else
3120 (*default* . ,(lambda (tag . kids) `(,tag ,@kids)))
3121 (*text* . ,(lambda (_ txt) txt))))
3122 port)))
3123 (rename-file "build-common.xml.new" "build-common.xml"))
3124 (substitute* "build/build.xml"
3125 (("\\$\\{lib\\}/cisd-base/cisd-base.jar")
3126 (search-input-file inputs "/share/java/sis-base.jar"))
3127 ;; Remove dependency on svn
3128 (("<build-info.*") "")
3129 (("\\$\\{revision.number\\}")
3130 ,(number->string revision))
3131 (("\\$\\{version.number\\}") ,base-version)
3132 ;; Don't use custom ant tasks.
3133 (("recursive-jar") "jar")
3134 (("<project-classpath.*") ""))))
3135 (replace 'install (install-jars "targets/dist")))))
3136 (inputs
3137 (list java-cisd-base))
3138 (native-inputs
3139 `(("ecj" ,java-ecj)
3140 ("build-resources"
3141 ,(origin
3142 (method svn-fetch)
3143 (uri (svn-reference
3144 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3145 "args4j/tags/release/"
3146 (version-major+minor base-version)
3147 ".x/" base-version
3148 "/build_resources/"))
3149 (revision revision)))
3150 (sha256
3151 (base32
3152 "056cam4k8pll7ass31sy6gwn8g8719njc41yf4l02b0342nilkyf"))
3153 (modules '((guix build utils)))
3154 ;; Delete bundled pre-built jars.
3155 (snippet
3156 '(begin (delete-file-recursively "lib/") #t))))))
3157 (home-page "https://svnsis.ethz.ch")
3158 (synopsis "Command line parser library")
3159 (description "This package provides a parser for command line arguments.")
3160 (license license:asl2.0))))
3161
3162(define-public java-cisd-jhdf5
3163 (let ((revision 39162)
3164 (base-version "14.12.6"))
3165 (package
3166 (name "java-cisd-jhdf5")
3167 (version (string-append base-version "-" (number->string revision)))
3168 (source (origin
3169 (method svn-fetch)
3170 (uri (svn-reference
3171 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3172 "jhdf5/tags/release/"
3173 (version-major+minor base-version)
3174 ".x/" base-version "/jhdf5/"))
3175 (revision revision)))
3176 (file-name (string-append "java-cisd-jhdf5-" version "-checkout"))
3177 (sha256
3178 (base32
3179 "13i17s2hn0q9drdqvp8csy7770p3hdbh9rp30ihln2ldkfawdmz0"))
3180 (modules '((guix build utils)))
3181 (snippet
3182 '(begin
3183 ;; Delete included gradle jar
3184 (delete-file-recursively "gradle/wrapper")
3185 ;; Delete pre-built native libraries
3186 (delete-file-recursively "libs")))))
3187 (build-system ant-build-system)
3188 (arguments
3189 `(#:make-flags '("-file" "build/build.xml")
3190 #:build-target "jar-all"
3191 #:test-target "jar-test"
3192 #:phases
3193 (modify-phases %standard-phases
3194 ;; FIXME: this build phase fails.
3195 (delete 'generate-jar-indices)
3196 ;; Don't erase results from the build phase when building tests.
3197 (add-after 'unpack 'separate-test-target-from-clean
3198 (lambda _
3199 (substitute* "build/build.xml"
3200 (("\"jar-test\" depends=\"clean, ")
3201 "\"jar-test\" depends=\""))))
3202 (add-after 'unpack 'unpack-build-resources
3203 (lambda* (#:key inputs #:allow-other-keys)
3204 (copy-recursively (assoc-ref inputs "build-resources")
3205 "../build_resources")
3206 (delete-file-recursively "../build_resources/lib/")
3207 (mkdir-p "../build_resources/lib")
3208 ;; Remove dependency on classycle
3209 (substitute* "../build_resources/ant/build-common.xml"
3210 (("<taskdef name=\"dependency-checker.*") "")
3211 (("classname=\"classycle.*") "")
3212 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
3213 ;; Remove dependency on svn
3214 (substitute* "build/build.xml"
3215 (("<build-info.*") "")
3216 (("\\$\\{revision.number\\}")
3217 ,(number->string revision))
3218 (("\\$\\{version.number\\}") ,base-version))))
3219 (add-after 'unpack-build-resources 'fix-dependencies
3220 (lambda* (#:key inputs #:allow-other-keys)
3221 (substitute* "../build_resources/ant/build-common.xml"
3222 (("../libraries/testng/testng-jdk15.jar")
3223 (search-input-file inputs
3224 "/share/java/java-testng.jar")))
3225 (substitute* "build/build.xml"
3226 (("\\$\\{lib\\}/sis-base/sis-base.jar")
3227 (search-input-file inputs
3228 "/share/java/sis-base.jar"))
3229 (("\\$\\{lib\\}/cisd-args4j/cisd-args4j.jar")
3230 (search-input-file inputs
3231 "/share/java/cisd-args4j.jar"))
3232 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
3233 (search-input-file inputs
3234 (string-append
3235 "/share/java/commons-lang-"
3236 ,(package-version java-commons-lang)
3237 ".jar")))
3238 (("\\$\\{lib\\}/commons-io/commons-io.jar")
3239 (search-input-file inputs
3240 (string-append
3241 "/lib/m2/commons-io/commons-io/"
3242 ,(package-version java-commons-io)
3243 "/commons-io-"
3244 ,(package-version java-commons-io)
3245 ".jar")))
3246 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
3247 (search-input-file inputs
3248 "/share/java/java-testng.jar"))
3249 (("\\$\\{lib\\}/junit4/junit.jar")
3250 (car (find-files (assoc-ref inputs "java-junit") "jar$")))
3251 (("\\$\\{lib\\}/jmock/hamcrest/hamcrest-core.jar")
3252 (car (find-files (assoc-ref inputs "java-hamcrest-core")
3253 "jar$"))))
3254 ;; Remove dependency on ch.rinn.restrictions
3255 (with-directory-excursion "source/java/ch/systemsx/cisd/hdf5/"
3256 (substitute* '("BitSetConversionUtils.java"
3257 "HDF5Utils.java")
3258 (("import ch.rinn.restrictions.Private;") "")
3259 (("@Private") "")))
3260 (with-directory-excursion "sourceTest/java/ch/systemsx/cisd/hdf5/"
3261 (substitute* '("BitSetConversionTest.java"
3262 "h5ar/HDF5ArchiverTest.java")
3263 (("import ch.rinn.restrictions.Friend;") "")
3264 (("@Friend.*") ""))
3265 ;; Remove leftovers from removing @Friend
3266 (substitute* "h5ar/HDF5ArchiverTest.java"
3267 (("\\{ HDF5Archiver.class, IdCache.class, LinkRecord.class \\}\\)")
3268 "")))))
3269 (add-before 'configure 'build-native-library
3270 (lambda* (#:key inputs #:allow-other-keys)
3271 (let ((jdk (assoc-ref inputs "jdk"))
3272 (hdf5 (assoc-ref inputs "hdf5"))
3273 (dir ,(match (%current-system)
3274 ("i686-linux"
3275 "i386-Linux")
3276 ((or "armhf-linux" "aarch64-linux")
3277 "arm-Linux")
3278 ((or "x86_64-linux")
3279 "amd64-Linux")
3280 (_ "unknown-Linux"))))
3281 (with-directory-excursion "source/c"
3282 (apply invoke `("gcc" "-shared" "-O3"
3283 "-fPIC"
3284 "-Wl,--exclude-libs,ALL"
3285 "-Wno-error=implicit-function-declaration"
3286 ,@(find-files "jhdf5" "\\.c$")
3287 ,@(find-files "hdf-java" "\\.c$")
3288 ,(string-append "-I" hdf5 "/include")
3289 ,(string-append "-I" jdk "/include")
3290 ,(string-append "-I" jdk "/include/linux")
3291 ,(string-append hdf5 "/lib/libhdf5.a")
3292 "-o" "libjhdf5.so" "-lz")))
3293 (install-file "source/c/libjhdf5.so"
3294 (string-append "libs/native/jhdf5/" dir)))))
3295 ;; In the "check" phase we only build the test executable.
3296 (add-after 'check 'run-tests
3297 (lambda _
3298 (invoke "java" "-jar" "targets/dist/sis-jhdf5-test.jar")
3299 (delete-file "targets/dist/sis-jhdf5-test.jar")))
3300 (replace 'install
3301 (install-jars "targets/dist")))))
3302 (inputs
3303 (list java-cisd-base
3304 java-cisd-args4j
3305 java-commons-lang
3306 java-commons-io
3307 hdf5-1.8
3308 zlib))
3309 (native-inputs
3310 `(("jdk" ,icedtea-8)
3311 ("java-testng" ,java-testng)
3312 ("java-junit" ,java-junit)
3313 ("java-jmock" ,java-jmock)
3314 ("java-hamcrest-core" ,java-hamcrest-core)
3315 ("build-resources"
3316 ,(origin
3317 (method svn-fetch)
3318 (uri (svn-reference
3319 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3320 "jhdf5/tags/release/"
3321 (version-major+minor base-version)
3322 ".x/" base-version
3323 "/build_resources/"))
3324 (revision revision)))
3325 (sha256
3326 (base32
3327 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
3328 (home-page "https://wiki-bsse.ethz.ch/display/JHDF5/")
3329 (synopsis "Java binding for HDF5")
3330 (description "JHDF5 is a high-level API in Java for reading and writing
3331HDF5 files, building on the libraries provided by the HDF Group.")
3332 ;; The C sources are under a non-copyleft license, which looks like a
3333 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
3334 (license (list license:asl2.0
3335 (license:non-copyleft "file://source/c/COPYING"))))))
3336
3337(define-public java-classpathx-servletapi
3338 (package
3339 (name "java-classpathx-servletapi")
3340 (version "3.0.1")
3341 (source (origin
3342 (method url-fetch)
3343 (uri (string-append "mirror://gnu/classpathx/servletapi/"
3344 "servletapi-" version ".tar.gz"))
3345 (sha256
3346 (base32
3347 "07d8h051siga2f33fra72hk12sbq1bxa4jifjg0qj0vfazjjff0x"))))
3348 (build-system ant-build-system)
3349 (arguments
3350 `(#:tests? #f ; there is no test target
3351 #:build-target "compile"
3352 #:make-flags
3353 ,#~(list "-Dbuild.compiler=javac1.8"
3354 (string-append "-Ddist=" #$output))
3355 #:phases
3356 (modify-phases %standard-phases
3357 (replace 'install
3358 (lambda* (#:key make-flags #:allow-other-keys)
3359 (apply invoke `("ant" "dist" ,@make-flags)))))))
3360 (home-page "https://www.gnu.org/software/classpathx/")
3361 (synopsis "Java servlet API implementation")
3362 (description "This is the GNU servlet API distribution, part of the
3363ClasspathX project. It provides implementations of version 3.0 of the servlet
3364API and version 2.1 of the Java ServerPages API.")
3365 (license license:gpl3+)))
3366
3367(define-public java-javaee-servletapi
3368 (package
3369 (name "java-javaee-servletapi")
3370 (version "3.1.0")
3371 (source (origin
3372 (method git-fetch)
3373 (uri (git-reference
3374 (url "https://github.com/javaee/servlet-spec")
3375 (commit version)))
3376 (file-name (git-file-name name version))
3377 (sha256
3378 (base32
3379 "0s03lj8w5an70lkqbjycgfrfk0kc07vbfav91jzk87gh3awf9ksl"))))
3380 (build-system ant-build-system)
3381 (arguments
3382 `(#:jar-name "javax-servletapi.jar"
3383 ;; no tests
3384 #:tests? #f
3385 #:source-dir "src/main/java"
3386 #:phases
3387 (modify-phases %standard-phases
3388 (add-before 'build 'copy-resources
3389 (lambda _
3390 (mkdir-p "build/classes/javax/servlet/http")
3391 (let ((from-prefix "src/main/java/javax/servlet/")
3392 (to-prefix "build/classes/javax/servlet/"))
3393 (for-each (lambda (f)
3394 (copy-file (string-append from-prefix f)
3395 (string-append to-prefix f)))
3396 (list "LocalStrings_ja.properties"
3397 "LocalStrings.properties"
3398 "LocalStrings_fr.properties"
3399 "http/LocalStrings_es.properties"
3400 "http/LocalStrings_ja.properties"
3401 "http/LocalStrings.properties"
3402 "http/LocalStrings_fr.properties")))
3403 #t)))))
3404 (native-inputs
3405 (list unzip))
3406 (home-page "https://javaee.github.io/servlet-spec/")
3407 (synopsis "Java servlet API")
3408 (description "Java Servlet is the foundation web specification in the
3409Java Enterprise Platform. Developers can build web applications using the
3410Servlet API to interact with the request/response workflow. This project
3411provides information on the continued development of the Java Servlet
3412specification.")
3413 ;; Main code is dual-licensed by Oracle under either GLP2 or CDDL 1.1.
3414 ;; Some files are licensed under ASL 2.0.
3415 (license (list license:asl2.0 license:gpl2 license:cddl1.1))))
3416
3417(define-public java-jsvg-1.6.1
3418 (package
3419 (name "java-jsvg")
3420 (version "1.6.1")
3421 (source
3422 (origin
3423 (method git-fetch)
3424 (uri (git-reference
3425 (url "https://github.com/weisJ/jsvg")
3426 (commit "v1.6.1-rc1")))
3427 (file-name (git-file-name name version))
3428 (sha256
3429 (base32 "0rcphd1596ps87q31qmksnh1nc4m1x1rrkn9amk3ggwy9l2pavsy"))
3430 (modules '((guix build utils)))
3431 (snippet
3432 ;; Remove @MustBeInvokedByOverriders annotations; not present
3433 ;; in java-jetbrains-annotations 19.0.0.
3434 ;; TODO: Update java-jetbrains-annotations to >= 20.0.0.
3435 '(begin
3436 (substitute* (find-files "." "\\.java$")
3437 (("import org\\.jetbrains\\.annotations\\.MustBeInvokedByOverriders;")
3438 "")
3439 (("@MustBeInvokedByOverriders") ""))
3440 #t))))
3441 (build-system ant-build-system)
3442 (arguments
3443 (list
3444 #:jdk openjdk17
3445 #:tests? #f
3446 ;; ant-build-system does not export a default-modules constant.
3447 #:modules '((guix build ant-build-system)
3448 (guix build java-utils)
3449 (guix build utils)
3450 (sxml simple))
3451 #:phases
3452 #~(modify-phases %standard-phases
3453 (replace 'build
3454 (lambda* (#:key inputs #:allow-other-keys)
3455 (let* ((src-dir "jsvg/src/main/java")
3456 (classes-dir "build/classes")
3457 (jar-file
3458 (string-append "build/jsvg-" #$version ".jar"))
3459 (annotations-cp
3460 (string-join
3461 (append
3462 (find-files (assoc-ref inputs
3463 "java-jetbrains-annotations")
3464 "\\.jar$")
3465 (find-files (assoc-ref inputs
3466 "java-error-prone-annotations")
3467 "\\.jar$"))
3468 ":")))
3469 (mkdir-p classes-dir)
3470 (apply invoke "javac"
3471 "--release" "11"
3472 "-cp" annotations-cp
3473 "-d" classes-dir
3474 (find-files src-dir "\\.java$"))
3475 (invoke "jar" "-cf" jar-file
3476 "-C" classes-dir "."))))
3477 (add-before 'build 'generate-pom
3478 (lambda _
3479 (call-with-output-file "pom.xml"
3480 (lambda (port)
3481 (sxml->xml
3482 `(*TOP*
3483 (*PI* xml "version=\"1.0\" encoding=\"UTF-8\"")
3484 (project
3485 (modelVersion "4.0.0")
3486 (groupId "com.github.weisj")
3487 (artifactId "jsvg")
3488 (version ,#$version)))
3489 port)))))
3490 (replace 'install
3491 (install-from-pom "pom.xml")))))
3492 (native-inputs
3493 (list java-jetbrains-annotations
3494 java-error-prone-annotations))
3495 (home-page "https://github.com/weisJ/jsvg")
3496 (synopsis "Java SVG rendering library")
3497 (description
3498 "JSVG is a Java library for rendering SVG images. It provides a
3499lightweight SVG parser and renderer using the Java2D API.")
3500 (license license:expat)))
3501
3502(define-public java-jtidy
3503 (package
3504 (name "java-jtidy")
3505 (version "8.0")
3506 (source
3507 (origin
3508 (method git-fetch)
3509 (uri (git-reference
3510 (url "https://github.com/jtidy/jtidy")
3511 (commit "r938")))
3512 (file-name (git-file-name name version))
3513 (sha256
3514 (base32 "1zksmvmrr10nzk5ya6sz0l8093yf3b08lkg76cn4fdv2jqm3cssp"))
3515 ;; Remove xerces:dom3-xml-apis dependency -- DOM Level 3 has been
3516 ;; part of the JDK since Java 5. install-from-pom calls
3517 ;; fix-pom-dependencies which throws no-such-input for
3518 ;; dependencies not in inputs and not test-scoped or optional.
3519 ;; A patch is used because programmatic removal does not work:
3520 ;;
3521 ;; - pre-post-order to filter the dependency from the parsed
3522 ;; SXML, then sxml->xml to write it back: xml->sxml expands
3523 ;; the default xmlns into long tag names like
3524 ;; http://maven.apache.org/POM/4.0.0:dependency, and
3525 ;; sxml->xml's check-name rejects symbols with more than
3526 ;; one colon ("Invalid QName").
3527 ;;
3528 ;; - fix-maven-xml from (guix build maven pom) strips those
3529 ;; namespace prefixes before sxml->xml, but it is not
3530 ;; exported.
3531 ;;
3532 ;; - fix-pom-dependencies #:excludes: the excludes parameter
3533 ;; only affects plugins (fix-plugins) and extensions
3534 ;; (fix-extensions), not dependencies -- fix-deps and
3535 ;; fix-dep do not check excludes.
3536 (patches
3537 (search-patches "java-jtidy-remove-xerces-dependency.patch"))))
3538 (build-system ant-build-system)
3539 (arguments
3540 (list
3541 #:jar-name "jtidy.jar"
3542 #:source-dir "src/main/java"
3543 #:test-dir "src/test"
3544 ;; Tests are disabled: upstream's pom.xml sets testFailureIgnore=true
3545 ;; because 140 of 216 .msg reference files have wrong expected message
3546 ;; counts -- the code changed but the test data was never updated.
3547 #:tests? #f
3548 #:phases
3549 #~(modify-phases %standard-phases
3550 (add-before 'build 'copy-resources
3551 (lambda _
3552 (copy-recursively "src/main/resources" "build/classes")))
3553 (replace 'install
3554 (install-from-pom "pom.xml")))))
3555 (inputs
3556 (list java-slf4j-api))
3557 (home-page "https://github.com/jtidy/jtidy")
3558 (synopsis "Java port of HTML Tidy, an HTML syntax checker and pretty printer")
3559 (description
3560 "JTidy is a Java port of HTML Tidy, a HTML syntax checker and pretty
3561printer. Like its non-Java cousin, JTidy can be used as a tool for cleaning
3562up malformed and faulty HTML. In addition, JTidy provides a DOM interface to
3563the document that is being processed, which effectively makes it a Java HTML
3564parser.")
3565 (license license:w3c)))
3566
3567(define-public java-swt
3568 (package
3569 (name "java-swt")
3570 (version "4.7.1a")
3571 (source
3572 ;; The types of many variables and procedures differ in the sources
3573 ;; dependent on whether the target architecture is a 32-bit system or a
3574 ;; 64-bit system. Instead of patching the sources on demand in a build
3575 ;; phase we download either the 32-bit archive (which mostly uses "int"
3576 ;; types) or the 64-bit archive (which mostly uses "long" types).
3577 (let ((hash32 "09q0cbh90d90q3a7dx9430kc4m6bijrkr4lajrmzzvi0jjdpq4v9")
3578 (hash64 "17k5hs75a87ssmc5xhwdfdm2gn4zba0r837l2455za01krnkaa2q")
3579 (file32 "x86")
3580 (file64 "x86_64"))
3581 (let-values (((hash file)
3582 (match (or (%current-target-system) (%current-system))
3583 ("x86_64-linux" (values hash64 file64))
3584 (_ (values hash32 file32)))))
3585 (origin
3586 (method url-fetch)
3587 (uri (string-append
3588 "https://archive.eclipse.org/eclipse/downloads/drops4/"
3589 "R-" version "-201710090410/swt-" version
3590 "-gtk-linux-" file ".zip"))
3591 (sha256 (base32 hash))))))
3592 (build-system ant-build-system)
3593 (arguments
3594 `(#:jar-name "swt.jar"
3595 #:jdk ,icedtea-8
3596 #:tests? #f ; no "check" target
3597 #:phases
3598 (modify-phases %standard-phases
3599 (replace 'unpack
3600 (lambda* (#:key source #:allow-other-keys)
3601 (mkdir "swt")
3602 (invoke "unzip" source "-d" "swt")
3603 (chdir "swt")
3604 (mkdir "src")
3605 (invoke "unzip" "src.zip" "-d" "src")))
3606 ;; The classpath contains invalid icecat jars. Since we don't need
3607 ;; anything other than the JDK on the classpath, we can simply unset
3608 ;; it.
3609 (add-after 'configure 'unset-classpath
3610 (lambda _ (unsetenv "CLASSPATH") #t))
3611 (add-before 'build 'build-native
3612 (lambda* (#:key inputs outputs #:allow-other-keys)
3613 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3614 ;; Build shared libraries. Users of SWT have to set the system
3615 ;; property swt.library.path to the "lib" directory of this
3616 ;; package output.
3617 (mkdir-p lib)
3618 (setenv "OUTPUT_DIR" lib)
3619 (setenv "CC" ,(cc-for-target))
3620 (with-directory-excursion "src"
3621 (invoke "bash" "build.sh")))))
3622 (add-after 'install 'install-native
3623 (lambda* (#:key outputs #:allow-other-keys)
3624 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3625 (for-each (lambda (file)
3626 (install-file file lib))
3627 (find-files "." "\\.so$"))
3628 #t))))))
3629 (inputs
3630 `(("gtk" ,gtk+-2)
3631 ("libxtst" ,libxtst)
3632 ("libxt" ,libxt)
3633 ("mesa" ,mesa)
3634 ("glu" ,glu)))
3635 (native-inputs
3636 (list pkg-config unzip))
3637 (home-page "https://www.eclipse.org/swt/")
3638 (synopsis "Widget toolkit for Java")
3639 (description
3640 "SWT is a widget toolkit for Java designed to provide efficient, portable
3641access to the user-interface facilities of the operating systems on which it
3642is implemented.")
3643 ;; SWT code is licensed under EPL1.0
3644 ;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
3645 ;; Cairo bindings contain code under MPL1.1
3646 ;; XULRunner 1.9 bindings contain code under MPL2.0
3647 (license (list
3648 license:epl1.0
3649 license:mpl1.1
3650 license:mpl2.0
3651 license:lgpl2.1+))))
3652
3653;; java-hamcrest-core uses qdox version 1.12. We package this version instead
3654;; of the latest release.
3655(define-public java-qdox-1.12
3656 (package
3657 (name "java-qdox")
3658 (version "1.12.1")
3659 (source (origin
3660 (method url-fetch)
3661 (uri (string-append "https://repo1.maven.org/maven2/"
3662 "com/thoughtworks/qdox/qdox/" version
3663 "/qdox-" version "-sources.jar"))
3664 (sha256
3665 (base32
3666 "0hlfbqq2avf5s26wxkksqmkdyk6zp9ggqn37c468m96mjv0n9xfl"))))
3667 (build-system ant-build-system)
3668 (arguments
3669 `(;; Tests require junit
3670 #:tests? #f
3671 #:jar-name "qdox.jar"
3672 #:phases
3673 (modify-phases %standard-phases
3674 (replace 'unpack
3675 (lambda* (#:key source #:allow-other-keys)
3676 (mkdir "src")
3677 (with-directory-excursion "src"
3678 (invoke "jar" "-xf" source))))
3679 ;; At this point we don't have junit, so we must remove the API
3680 ;; tests.
3681 (add-after 'unpack 'delete-tests
3682 (lambda _
3683 (delete-file-recursively "src/com/thoughtworks/qdox/junit")
3684 #t)))))
3685 (home-page "https://github.com/codehaus/qdox")
3686 (synopsis "Parse definitions from Java source files")
3687 (description
3688 "QDox is a high speed, small footprint parser for extracting
3689class/interface/method definitions from source files complete with JavaDoc
3690@code{@@tags}. It is designed to be used by active code generators or
3691documentation tools.")
3692 (license license:asl2.0)))
3693
3694(define-public java-qdox
3695 (package
3696 (name "java-qdox")
3697 ; Newer version exists, but this version is required by java-plexus-component-metadata
3698 (version "2.0-M2")
3699 (source (origin
3700 (method url-fetch)
3701 ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
3702 ;; Older releases at https://github.com/codehaus/qdox/
3703 ;; Note: The release at maven is pre-generated. The release at
3704 ;; github requires jflex.
3705 (uri (string-append "https://repo1.maven.org/maven2/"
3706 "com/thoughtworks/qdox/qdox/" version
3707 "/qdox-" version "-sources.jar"))
3708 (sha256
3709 (base32
3710 "10xxrcaicq6axszcr2jpygisa4ch4sinyx5q7kqqxv4lknrmxp5x"))))
3711 (build-system ant-build-system)
3712 (arguments
3713 `(#:jar-name "qdox.jar"
3714 #:tests? #f; no tests
3715 #:phases
3716 (modify-phases %standard-phases
3717 (add-before 'install 'create-pom
3718 (generate-pom.xml "pom.xml" "com.thoughtworks.qdox" "qdox" ,version
3719 #:name "QDox"))
3720 (replace 'install
3721 (install-from-pom "pom.xml")))))
3722 (home-page "https://github.com/codehaus/qdox")
3723 (synopsis "Parse definitions from Java source files")
3724 (description "QDox is a high speed, small footprint parser for extracting
3725class/interface/method definitions from source files complete with JavaDoc
3726@code{@@tags}. It is designed to be used by active code generators or
3727documentation tools.")
3728 (license license:asl2.0)))
3729
3730(define-public java-qdox-2-M9
3731 (package
3732 (inherit java-qdox)
3733 (version "2.0-M9"); required by plexus-java
3734 (source (origin
3735 (method url-fetch)
3736 ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
3737 ;; Older releases at https://github.com/codehaus/qdox/
3738 ;; Note: The release at maven is pre-generated. The release at
3739 ;; github requires jflex.
3740 (uri (string-append "https://repo1.maven.org/maven2/"
3741 "com/thoughtworks/qdox/qdox/" version
3742 "/qdox-" version "-sources.jar"))
3743 (sha256
3744 (base32
3745 "1s2jnmx2dkwnaha12lcj26aynywgwa8sslc47z82wx8xai13y4fg"))))
3746 (arguments
3747 (substitute-keyword-arguments (package-arguments java-qdox)
3748 ((#:phases phases)
3749 `(modify-phases ,phases
3750 (replace 'create-pom
3751 (generate-pom.xml "pom.xml" "com.thoughtworks.qdox" "qdox" ,version
3752 #:name "QDox"))))))))
3753
3754(define-public java-jarjar
3755 (package
3756 (name "java-jarjar")
3757 (version "1.4")
3758 (source (origin
3759 (method url-fetch)
3760 (uri (string-append
3761 "https://storage.googleapis.com/google-code-archive-downloads/v2/"
3762 "code.google.com/jarjar/jarjar-src-" version ".zip"))
3763 (sha256
3764 (base32
3765 "1v8irhni9cndcw1l1wxqgry013s2kpj0qqn57lj2ji28xjq8ndjl"))
3766 (modules '((guix build utils)))
3767 (snippet
3768 '(begin
3769 ;; Delete bundled thirds-party jar archives.
3770 (delete-file-recursively "lib")
3771 (delete-file "src/test/enumtest.jar")
3772 ;; the CLASSPATH needs this directory, create an empty one
3773 (mkdir-p "lib")
3774 #t))))
3775 (build-system ant-build-system)
3776 (arguments
3777 `(;; Tests require junit, which ultimately depends on this package.
3778 #:tests? #f
3779 #:build-target "jar"
3780 #:phases
3781 (modify-phases %standard-phases
3782 (add-before 'build 'do-not-use-bundled-asm
3783 (lambda* (#:key inputs #:allow-other-keys)
3784 (substitute* "build.xml"
3785 (("<path id=\"path.build\">")
3786 (string-append "<path id=\"path.build\"><fileset dir=\""
3787 (assoc-ref inputs "java-asm-bootstrap")
3788 "/lib/m2\" includes=\"**/*.jar\"/>"))
3789 (("<zipfileset src=\"lib/asm-4.0.jar\"/>") "")
3790 (("lib/asm-commons-4.0.jar")
3791 (car (find-files (assoc-ref inputs "java-asm-bootstrap")
3792 "asm-6.0.jar")))
3793 (("<include name=\"org/objectweb/asm/commons/Remap\\*\\.class\"/>")
3794 (string-append "<include name=\"org/objectweb/asm/"
3795 "commons/Remap*.class\"/>"
3796 "<include name=\"org/objectweb/asm/*.class\"/>"
3797 "<include name=\"org/objectweb/asm/"
3798 "signature/*.class\"/>"
3799 "<include name=\"org/objectweb/asm/"
3800 "commons/SignatureRemapper.class\"/>")))
3801 #t))
3802 (add-before 'build 'remove-maven-dependency
3803 (lambda _
3804 ;; We do not need to build jarjar as a maven plugin just yet, so
3805 ;; remove this file. Maven requires jarjar (but not that plugin),
3806 ;; so removing it improves the bootstrap.
3807 (delete-file "src/main/com/tonicsystems/jarjar/JarJarMojo.java")
3808 #t))
3809 (replace 'install
3810 (lambda* (#:key outputs #:allow-other-keys)
3811 (let ((target (string-append (assoc-ref outputs "out")
3812 "/share/java")))
3813 (install-file (string-append "dist/jarjar-" ,version ".jar")
3814 target))
3815 #t)))))
3816 (inputs
3817 (list java-asm-bootstrap))
3818 (native-inputs
3819 (list unzip))
3820 (home-page "https://code.google.com/archive/p/jarjar/")
3821 (synopsis "Repackage Java libraries")
3822 (description
3823 "Jar Jar Links is a utility that makes it easy to repackage Java
3824libraries and embed them into your own distribution. Jar Jar Links includes
3825an Ant task that extends the built-in @code{jar} task.")
3826 (license license:asl2.0)))
3827
3828(define-public java-hamcrest
3829 (package
3830 (name "java-hamcrest")
3831 (version "3.0")
3832 (source (origin
3833 (method git-fetch)
3834 (uri (git-reference
3835 (url "https://github.com/hamcrest/JavaHamcrest/")
3836 (commit (string-append "v" version))))
3837 (file-name (git-file-name name version))
3838 (sha256
3839 (base32
3840 "07cagv2ncs4y02fmwbll3r4rqpjf3zxs163ync24q3x9fplrxmly"))))
3841 (build-system ant-build-system)
3842 (arguments
3843 `(#:tests? #f ; Tests require junit
3844 #:source-dir "hamcrest/src/main"
3845 #:jar-name "hamcrest.jar"))
3846 (home-page "https://hamcrest.org/")
3847 (synopsis "Library of matchers for building test expressions")
3848 (description
3849 "This package provides a library of matcher objects (also known as
3850constraints or predicates) allowing @code{match} rules to be defined
3851declaratively, to be used in other frameworks. Typical scenarios include
3852testing frameworks, mocking libraries and UI validation rules.")
3853 (license license:bsd-3)))
3854
3855(define-public java-hamcrest-core
3856 (package
3857 (name "java-hamcrest-core")
3858 (version "1.3")
3859 (properties `((superseded . ,java-hamcrest)))
3860 (source (origin
3861 (method git-fetch)
3862 (uri (git-reference
3863 (url "https://github.com/hamcrest/JavaHamcrest/")
3864 (commit (string-append "hamcrest-java-" version))))
3865 (file-name (git-file-name name version))
3866 (sha256
3867 (base32
3868 "16fxxkrd31ahqvcaby30jgh3z1i0zxh51m24hxgz0z2agxj6bc63"))
3869 (modules '((guix build utils)))
3870 (snippet
3871 '(begin
3872 ;; Delete bundled thirds-party jar archives.
3873 (delete-file-recursively "lib")
3874 #t))))
3875 (build-system ant-build-system)
3876 (arguments
3877 `(#:tests? #f ; Tests require junit
3878 #:modules ((guix build ant-build-system)
3879 (guix build java-utils)
3880 (guix build utils)
3881 (srfi srfi-1))
3882 #:make-flags (list (string-append "-Dversion=" ,version))
3883 #:test-target "unit-test"
3884 #:build-target "core"
3885 #:phases
3886 (modify-phases %standard-phases
3887 ;; Disable unit tests, because they require junit, which requires
3888 ;; hamcrest-core. We also give a fixed value to the "Built-Date"
3889 ;; attribute from the manifest for reproducibility.
3890 (add-before 'configure 'patch-build.xml
3891 (lambda _
3892 (substitute* "build.xml"
3893 (("unit-test, ") "")
3894 (("\\$\\{build.timestamp\\}") "guix"))
3895 #t))
3896 ;; Java's "getMethods()" returns methods in an unpredictable order.
3897 ;; To make the output of the generated code deterministic we must
3898 ;; sort the array of methods.
3899 (add-after 'unpack 'make-method-order-deterministic
3900 (lambda _
3901 (substitute* "hamcrest-generator/src/main/java/org/hamcrest/generator/ReflectiveFactoryReader.java"
3902 (("import java\\.util\\.Iterator;" line)
3903 (string-append line "\n"
3904 "import java.util.Arrays; import java.util.Comparator;"))
3905 (("allMethods = cls\\.getMethods\\(\\);" line)
3906 (string-append "_" line
3907 "
3908private Method[] getSortedMethods() {
3909 Arrays.sort(_allMethods, new Comparator<Method>() {
3910 @Override
3911 public int compare(Method a, Method b) {
3912 return a.toString().compareTo(b.toString());
3913 }
3914 });
3915 return _allMethods;
3916}
3917
3918private Method[] allMethods = getSortedMethods();")))
3919 #t))
3920 (add-before 'build 'do-not-use-bundled-qdox
3921 (lambda* (#:key inputs #:allow-other-keys)
3922 (substitute* "build.xml"
3923 (("lib/generator/qdox-1.12.jar")
3924 (string-append (assoc-ref inputs "java-qdox-1.12")
3925 "/share/java/qdox.jar")))
3926 #t))
3927 ;; build.xml searches for .jar files in this directoy, which
3928 ;; we remove from the source archive.
3929 (add-before 'build 'create-dummy-directories
3930 (lambda _
3931 (mkdir-p "lib/integration")
3932 #t))
3933 (add-before 'build 'create-pom
3934 (lambda _
3935 (substitute* "pom/hamcrest-core.pom"
3936 (("@VERSION@") ,version))
3937 #t))
3938 (replace 'install
3939 (install-from-pom "pom/hamcrest-core.pom")))))
3940 (native-inputs
3941 `(("java-qdox-1.12" ,java-qdox-1.12)
3942 ("java-jarjar" ,java-jarjar)))
3943 (propagated-inputs
3944 (list java-hamcrest-parent-pom))
3945 (home-page "https://hamcrest.org/")
3946 (synopsis "Library of matchers for building test expressions")
3947 (description
3948 "This package provides a library of matcher objects (also known as
3949constraints or predicates) allowing @code{match} rules to be defined
3950declaratively, to be used in other frameworks. Typical scenarios include
3951testing frameworks, mocking libraries and UI validation rules.")
3952 (license license:bsd-2)))
3953
3954(define-public java-hamcrest-parent-pom
3955 (package
3956 (inherit java-hamcrest-core)
3957 (properties '((hidden? . #t)))
3958 (name "java-hamcrest-parent-pom")
3959 (propagated-inputs '())
3960 (native-inputs '())
3961 (arguments
3962 `(#:tests? #f
3963 #:phases
3964 (modify-phases %standard-phases
3965 (delete 'configure)
3966 (replace 'build
3967 (lambda _
3968 (substitute* "pom/hamcrest-parent.pom"
3969 (("@VERSION@") ,(package-version java-hamcrest-core)))
3970 #t))
3971 (replace 'install
3972 (install-pom-file "pom/hamcrest-parent.pom")))))))
3973
3974(define-public java-hamcrest-library
3975 (package
3976 (inherit java-hamcrest-core)
3977 (name "java-hamcrest-library")
3978 (properties `((superseded . ,java-hamcrest)))
3979 (arguments
3980 (substitute-keyword-arguments (package-arguments java-hamcrest-core)
3981 ((#:build-target _) "library")
3982 ((#:phases phases)
3983 `(modify-phases ,phases
3984 (add-after 'unpack 'patch-classpath-for-integration
3985 (lambda* (#:key inputs #:allow-other-keys)
3986 (substitute* "build.xml"
3987 (("build/hamcrest-core-\\$\\{version\\}\\.jar")
3988 (car (find-files (assoc-ref inputs "java-hamcrest-core")
3989 "jar$"))))
3990 #t))
3991 (replace 'create-pom
3992 (lambda _
3993 (substitute* "pom/hamcrest-library.pom"
3994 (("@VERSION@") ,(package-version java-hamcrest-core)))
3995 #t))
3996 (replace 'install
3997 (install-from-pom "pom/hamcrest-library.pom"))))))
3998 (propagated-inputs
3999 (list java-hamcrest-core java-hamcrest-parent-pom))))
4000
4001(define-public java-junit
4002 (package
4003 (name "java-junit")
4004 (version "4.12")
4005 (source (origin
4006 (method git-fetch)
4007 (uri (git-reference
4008 (url "https://github.com/junit-team/junit/")
4009 (commit (string-append "r" version))))
4010 (file-name (git-file-name name version))
4011 (sha256
4012 (base32
4013 "1j8avi91px1z8rjc89cfikwrvfifdmmsarwiyrcnr59ynvpz0v8h"))
4014 (modules '((guix build utils)))
4015 (snippet
4016 '(begin
4017 ;; Delete bundled jar archives.
4018 (delete-file-recursively "lib")
4019 #t))))
4020 (build-system ant-build-system)
4021 (arguments
4022 `(#:jar-name "junit.jar"
4023 #:source-dir "src/main/java"
4024 #:test-dir "src/test"
4025 #:test-exclude (list "**/SimpleTest.java" "**/StackTracesTest.java"
4026 "**/RuleChainTest.java" "**/TestWatchmanTest.java")
4027 #:phases
4028 (modify-phases %standard-phases
4029 (add-before 'check 'copy-test-resources
4030 (lambda _
4031 (copy-recursively "src/test/resources" "build/test-classes")
4032 #t))
4033 (replace 'install
4034 (install-from-pom "pom.xml")))))
4035 (propagated-inputs
4036 (list java-hamcrest-core))
4037 (native-inputs
4038 (list java-hamcrest-library))
4039 (home-page "https://junit.org/junit4/")
4040 (synopsis "Test framework for Java")
4041 (description
4042 "JUnit is a simple framework to write repeatable tests for Java projects.
4043JUnit provides assertions for testing expected results, test fixtures for
4044sharing common test data, and test runners for running tests.")
4045 (license license:epl1.0)))
4046
4047(define-public java-junit-4.13.2
4048 (package
4049 (inherit java-junit)
4050 (name "java-junit")
4051 (version "4.13.2")
4052 (source
4053 (origin
4054 (method git-fetch)
4055 (uri (git-reference
4056 (url "https://github.com/junit-team/junit/")
4057 (commit (string-append "r" version))))
4058 (file-name (git-file-name "java-junit" version))
4059 (sha256
4060 (base32 "1r7k4zzscc8019np3is3bzfigw8fxd6s3259cbhzzh02q6d5p9h3"))))))
4061
4062(define-public java-junitparams
4063 (package
4064 (name "java-junitparams")
4065 (version "1.1.1")
4066 (source (origin
4067 (method git-fetch)
4068 (uri (git-reference
4069 (url "https://github.com/Pragmatists/JUnitParams")
4070 (commit (string-append "JUnitParams-" version))))
4071 (file-name (git-file-name name version))
4072 (sha256
4073 (base32
4074 "0rb52xdfp99invyjrras3w0bf0a81cz30yd47rkkiyqcqj0y1q9b"))))
4075 (build-system ant-build-system)
4076 (arguments
4077 `(#:jar-name "junitparams.jar"
4078 #:source-dir "src/main/java"
4079 #:test-dir "src/test"
4080 #:test-exclude (list "**/SuperclassTest.java")))
4081 (inputs
4082 (list java-junit))
4083 (native-inputs
4084 (list java-junit java-hamcrest-core java-assertj))
4085 (home-page "https://github.com/Pragmatists/JUnitParams")
4086 (synopsis "Parameterised test support for JUnit")
4087 (description "The JUnitParams project adds a new runner to JUnit and
4088provides much easier and readable parametrised tests for JUnit.")
4089 (license license:asl2.0)))
4090
4091(define-public java-plexus-utils
4092 (package
4093 (name "java-plexus-utils")
4094 (version "3.3.0")
4095 (source (origin
4096 (method git-fetch)
4097 (uri (git-reference
4098 (url "https://github.com/codehaus-plexus/plexus-utils")
4099 (commit (string-append "plexus-utils-" version))))
4100 (file-name (git-file-name name version))
4101 (sha256
4102 (base32
4103 "0d0fq21rzjy0j55kcp8w9k1rbq9rwr0r7cc8239p9jbz54vihp0g"))))
4104 (build-system ant-build-system)
4105 ;; FIXME: The default build.xml does not include a target to install
4106 ;; javadoc files.
4107 (arguments
4108 `(#:jar-name "plexus-utils.jar"
4109 #:source-dir "src/main"
4110 #:phases
4111 (modify-phases %standard-phases
4112 (add-after 'unpack 'fix-reference-to-/bin-and-/usr
4113 (lambda _
4114 (substitute* "src/main/java/org/codehaus/plexus/util/\
4115cli/shell/BourneShell.java"
4116 (("/bin/sh") (which "sh"))
4117 (("/usr/") (getcwd)))
4118 #t))
4119 (add-after 'unpack 'fix-or-disable-broken-tests
4120 (lambda _
4121 (with-directory-excursion "src/test/java/org/codehaus/plexus/util"
4122 (substitute* '("cli/CommandlineTest.java"
4123 "cli/shell/BourneShellTest.java")
4124 (("/bin/sh") (which "sh"))
4125 (("/bin/echo") (which "echo")))
4126
4127 ;; This test depends on MavenProjectStub, but we don't have
4128 ;; a package for Maven.
4129 (delete-file "introspection/ReflectionValueExtractorTest.java")
4130
4131 ;; FIXME: The command line tests fail, maybe because they use
4132 ;; absolute paths.
4133 (delete-file "cli/CommandlineTest.java")
4134
4135 ;; These tests require openjdk jmh, which is not packaged yet
4136 (for-each delete-file (find-files "." "PerfTest.java$")))
4137 #t))
4138 (add-before 'build 'copy-resources
4139 (lambda _
4140 (copy-recursively "src/main/resources" "build/classes")
4141 #t))
4142 (replace 'install (install-from-pom "pom.xml")))))
4143 (native-inputs
4144 (list java-hamcrest-core java-junit))
4145 (propagated-inputs
4146 (list plexus-parent-pom-5.1))
4147 (home-page "https://codehaus-plexus.github.io/plexus-utils/")
4148 (synopsis "Common utilities for the Plexus framework")
4149 (description "This package provides various Java utility classes for the
4150Plexus framework to ease working with strings, files, command lines, XML and
4151more.")
4152 (license license:asl2.0)))
4153
4154(define-public java-plexus-utils-3.2.1
4155 (package
4156 (inherit java-plexus-utils)
4157 ;; plexus-build-api needs this version, later versions don't work
4158 (version "3.2.1")
4159 (source (origin
4160 (method git-fetch)
4161 (uri (git-reference
4162 (url "https://github.com/codehaus-plexus/plexus-utils")
4163 (commit (string-append "plexus-utils-" version))))
4164 (file-name (git-file-name "java-plexus-utils" version))
4165 (sha256
4166 (base32
4167 "1w169glixyk94jbczj8jzg897lsab46jihiaa3dhw0p06g35va8b"))))))
4168
4169(define-public java-plexus-interpolation
4170 (package
4171 (name "java-plexus-interpolation")
4172 (version "1.26")
4173 (source (origin
4174 (method git-fetch)
4175 (uri (git-reference
4176 (url "https://github.com/codehaus-plexus/plexus-interpolation")
4177 (commit (string-append "plexus-interpolation-" version))))
4178 (file-name (git-file-name name version))
4179 (sha256
4180 (base32
4181 "1rahjmhywf6d5m32qzlc9izawyvcd71abfm9k03f13rs2xmfxzlh"))))
4182 (build-system ant-build-system)
4183 (arguments
4184 `(#:jar-name "plexus-interpolation.jar"
4185 #:source-dir "src/main"
4186 #:phases
4187 (modify-phases %standard-phases
4188 (replace 'install (install-from-pom "pom.xml")))))
4189 (propagated-inputs
4190 `(("plexus-parent-pom-5.1" ,plexus-parent-pom-5.1)))
4191 (native-inputs
4192 (list java-junit java-hamcrest-core))
4193 (home-page "https://codehaus-plexus.github.io/plexus-interpolation/")
4194 (synopsis "Java components for interpolating ${} strings and the like")
4195 (description "Plexus interpolator is a modular, flexible interpolation
4196framework for the expression language style commonly seen in Maven, Plexus,
4197and other related projects.
4198
4199It has its foundation in the @code{org.codehaus.plexus.utils.interpolation}
4200package within @code{plexus-utils}, but has been separated in order to allow
4201these two libraries to vary independently of one another.")
4202 (license license:asl2.0)))
4203
4204(define-public java-plexus-classworlds
4205 (package
4206 (name "java-plexus-classworlds")
4207 (version "2.6.0")
4208 (source (origin
4209 (method git-fetch)
4210 (uri (git-reference
4211 (url "https://github.com/codehaus-plexus/plexus-classworlds")
4212 (commit (string-append "plexus-classworlds-" version))))
4213 (file-name (git-file-name name version))
4214 (sha256
4215 (base32
4216 "034k2hgvj1saalwbnzrbg4n0zgzwcpz1lhlb8q4kgglsp9pmm03s"))))
4217 (build-system ant-build-system)
4218 (arguments
4219 `(#:jar-name "plexus-classworlds.jar"
4220 #:source-dir "src/main"
4221 #:tests? #f;; FIXME: we need to generate some resources as in pom.xml
4222 #:phases
4223 (modify-phases %standard-phases
4224 (replace 'install (install-from-pom "pom.xml")))))
4225 (propagated-inputs
4226 `(("plexus-parent-pom-5.1" ,plexus-parent-pom-5.1)))
4227 (native-inputs
4228 (list java-junit))
4229 (home-page "https://codehaus-plexus.github.io/plexus-classworlds/")
4230 (synopsis "Java class loader framework")
4231 (description "Plexus classworlds replaces the native @code{ClassLoader}
4232mechanism of Java. It is especially useful for dynamic loading of application
4233components.")
4234 (license license:asl2.0)))
4235
4236(define-public java-plexus-container-default-bootstrap
4237 (package
4238 (name "java-plexus-container-default-bootstrap")
4239 (version "2.1.0")
4240 (source (origin
4241 (method git-fetch)
4242 (uri (git-reference
4243 (url "https://github.com/codehaus-plexus/plexus-containers")
4244 (commit (string-append "plexus-containers-" version))))
4245 (file-name (git-file-name name version))
4246 (sha256
4247 (base32
4248 "0r9yq67c1hvi1pz5wmx6x6hk5fmavp8a7yal3j5hkaad757firn1"))))
4249 (build-system ant-build-system)
4250 (arguments
4251 `(#:jar-name "container-default.jar"
4252 #:source-dir "plexus-container-default/src/main/java"
4253 #:test-dir "plexus-container-default/src/test"
4254 #:tests? #f; requires plexus-archiver, which depends on this package
4255 #:phases
4256 (modify-phases %standard-phases
4257 (add-before 'build 'fix-google-collections
4258 (lambda _
4259 ;; Google collections are now replaced with guava
4260 (substitute* "plexus-container-default/pom.xml"
4261 (("google-collections") "guava")
4262 (("com.google.collections") "com.google.guava"))
4263 #t))
4264 (add-before 'build 'copy-resources
4265 (lambda _
4266 (copy-recursively
4267 "plexus-container-default/src/main/resources/"
4268 "build/classes")
4269 #t))
4270 (replace 'install
4271 (install-from-pom "plexus-container-default/pom.xml")))))
4272 (propagated-inputs
4273 `(("java-plexus-worldclass" ,java-plexus-classworlds)
4274 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
4275 ("java-plexus-utils" ,java-plexus-utils)
4276 ("java-junit" ,java-junit)
4277 ("java-guava" ,java-guava)
4278 ("java-plexus-containers-parent-pom" ,java-plexus-containers-parent-pom)))
4279 (home-page "https://github.com/codehaus-plexus/plexus-containers")
4280 (synopsis "Inversion-of-control container")
4281 (description "Plexus-default-container is Plexus' inversion-of-control
4282(@dfn{IoC}) container. It is composed of its public API and its default
4283implementation.")
4284 (properties '((hidden? . #t))) ;for bootstrapping purposes only
4285 (license license:asl2.0)))
4286
4287(define java-plexus-containers-parent-pom
4288 (package
4289 (inherit java-plexus-container-default-bootstrap)
4290 (name "java-plexus-containers-parent-pom")
4291 (arguments
4292 `(#:tests? #f
4293 #:phases
4294 (modify-phases %standard-phases
4295 (delete 'configure)
4296 (delete 'build)
4297 (replace 'install
4298 (install-pom-file "pom.xml")))))
4299 (propagated-inputs
4300 `(("plexus-parent-pom" ,plexus-parent-pom-4.0)))))
4301
4302(define-public java-plexus-io
4303 (package
4304 (name "java-plexus-io")
4305 (version "3.2.0")
4306 (source (origin
4307 (method git-fetch)
4308 (uri (git-reference
4309 (url "https://github.com/codehaus-plexus/plexus-io")
4310 (commit (string-append "plexus-io-" version))))
4311 (file-name (git-file-name name version))
4312 (sha256
4313 (base32
4314 "1r3wqfpbxq8vp4p914i8p88r0994rmcjw02hz14n11cfb6gsyvlr"))))
4315 (build-system ant-build-system)
4316 (arguments
4317 `(#:jar-name "plexus-io.jar"
4318 #:source-dir "src/main/java"
4319 #:test-dir "src/test"
4320 #:phases
4321 (modify-phases %standard-phases
4322 (add-before 'build 'copy-resources
4323 (lambda _
4324 (mkdir-p "build/classes")
4325 (copy-recursively "src/main/resources" "build/classes")
4326 (mkdir-p "build/test-classes")
4327 (copy-recursively "src/test/resources" "build/test-classes")
4328 #t))
4329 (replace 'install (install-from-pom "pom.xml")))))
4330 (propagated-inputs
4331 (list java-plexus-utils java-commons-io plexus-parent-pom-5.1))
4332 (inputs
4333 (list java-jsr305))
4334 (native-inputs
4335 `(("junit" ,java-junit)
4336 ("hamcrest" ,java-hamcrest-core)
4337 ("guava" ,java-guava)
4338 ("classworlds" ,java-plexus-classworlds)
4339 ("xbean" ,java-geronimo-xbean-reflect)
4340 ("container-default" ,java-plexus-container-default-bootstrap)))
4341 (home-page "https://github.com/codehaus-plexus/plexus-io")
4342 (synopsis "I/O plexus components")
4343 (description "Plexus IO is a set of plexus components, which are designed
4344for use in I/O operations. This implementation using plexus components allows
4345reusing it in maven.")
4346 (license license:asl2.0)))
4347
4348(define-public java-plexus-archiver
4349 (package
4350 (name "java-plexus-archiver")
4351 (version "4.2.2")
4352 (source (origin
4353 (method url-fetch)
4354 (uri (string-append "https://github.com/codehaus-plexus/plexus-archiver"
4355 "/archive/plexus-archiver-" version ".tar.gz"))
4356 (sha256
4357 (base32
4358 "144n971r3lfrx3l12nf2scm80x4xdvgbkk4bjpa4vcvvdrll6qys"))))
4359 (build-system ant-build-system)
4360 (arguments
4361 `(#:jar-name "plexus-archiver.jar"
4362 #:source-dir "src/main/java"
4363 #:test-dir "src/test"
4364 #:test-exclude (list "**/Abstract*.java" "**/Base*.java")
4365 #:phases
4366 (modify-phases %standard-phases
4367 (add-before 'check 'remove-failing
4368 (lambda _
4369 ;; Requires an older version of plexus container
4370 (delete-file
4371 "src/test/java/org/codehaus/plexus/archiver/DuplicateFilesTest.java")
4372 #t))
4373 (add-before 'check 'fix-test-building
4374 (lambda _
4375 (substitute* "build.xml"
4376 (("srcdir=\"src/test\"") "srcdir=\"src/test/java\""))
4377 #t))
4378 (add-before 'build 'copy-resources
4379 (lambda _
4380 (mkdir-p "build/classes")
4381 (copy-recursively "src/main/resources" "build/classes")
4382 (mkdir-p "build/test-classes")
4383 (copy-recursively "src/test/resources" "build/test-classes")
4384 #t))
4385 (replace 'install (install-from-pom "pom.xml")))))
4386 (propagated-inputs
4387 (list java-plexus-utils java-plexus-io java-iq80-snappy
4388 java-commons-compress-1.21 plexus-parent-pom-6.1))
4389 (inputs
4390 `(("java-jsr305" ,java-jsr305)
4391 ("java-plexus-container-default"
4392 ,java-plexus-container-default-bootstrap)))
4393 (native-inputs
4394 `(("java-hamcrest-core" ,java-hamcrest-core)
4395 ("junit" ,java-junit)
4396 ("classworld" ,java-plexus-classworlds)
4397 ("xbean" ,java-geronimo-xbean-reflect)
4398 ("xz" ,java-xz)
4399 ("guava" ,java-guava)))
4400 (home-page "https://github.com/codehaus-plexus/plexus-archiver")
4401 (synopsis "Archiver component of the Plexus project")
4402 (description "Plexus-archiver contains a component to deal with project
4403archives (jar).")
4404 (license license:asl2.0)))
4405
4406(define-public java-plexus-container-default
4407 (package
4408 (inherit java-plexus-container-default-bootstrap)
4409 (name "java-plexus-container-default")
4410 (arguments
4411 `(#:jar-name "container-default.jar"
4412 #:source-dir "plexus-container-default/src/main/java"
4413 #:test-dir "plexus-container-default/src/test"
4414 #:test-exclude (list ;"**/*Test.java"
4415 "**/Abstract*.java"
4416 ;; Requires plexus-hierarchy
4417 "**/PlexusHierarchyTest.java"
4418 ;; Failures
4419 "**/ComponentRealmCompositionTest.java"
4420 "**/PlexusContainerTest.java")
4421 #:phases
4422 (modify-phases %standard-phases
4423 (add-before 'build 'fix-google-collections
4424 (lambda _
4425 ;; Google collections are now replaced with guava
4426 (substitute* "plexus-container-default/pom.xml"
4427 (("google-collections") "guava")
4428 (("com.google.collections") "com.google.guava"))
4429 #t))
4430 (add-before 'build 'copy-resources
4431 (lambda _
4432 (copy-recursively
4433 "plexus-container-default/src/main/resources/"
4434 "build/classes")
4435 #t))
4436 (add-before 'check 'fix-paths
4437 (lambda _
4438 (let ((dir "plexus-container-default/src/test/java/org/codehaus"))
4439 (substitute*
4440 (string-append
4441 dir "/plexus/component/composition/"
4442 "ComponentRealmCompositionTest.java")
4443 (("src/test") "plexus-container-default/src/test"))
4444 #t)))
4445 (replace 'install
4446 (install-from-pom "plexus-container-default/pom.xml")))))
4447 (inputs
4448 `(("worldclass" ,java-plexus-classworlds)
4449 ("xbean" ,java-geronimo-xbean-reflect)
4450 ("utils" ,java-plexus-utils)
4451 ("junit" ,java-junit)
4452 ("guava" ,java-guava)))
4453 (native-inputs
4454 `(("archiver" ,java-plexus-archiver)
4455 ("hamcrest" ,java-hamcrest-core)))
4456 (properties
4457 (alist-delete
4458 'hidden?
4459 (package-properties java-plexus-container-default-bootstrap)))))
4460
4461(define-public java-plexus-component-annotations
4462 (package
4463 (inherit java-plexus-container-default)
4464 (name "java-plexus-component-annotations")
4465 (arguments
4466 `(#:jar-name "plexus-component-annotations.jar"
4467 #:source-dir "plexus-component-annotations/src/main/java"
4468 #:tests? #f; no tests
4469 #:phases
4470 (modify-phases %standard-phases
4471 (replace 'install
4472 (install-from-pom "plexus-component-annotations/pom.xml")))))
4473 (propagated-inputs
4474 (list java-plexus-containers-parent-pom))
4475 (inputs '())
4476 (native-inputs '())
4477 (synopsis "Plexus descriptors generator")
4478 (description "This package is a Maven plugin to generate Plexus descriptors
4479from source tags and class annotations.")))
4480
4481(define-public java-plexus-component-metadata
4482 (package
4483 (inherit java-plexus-container-default)
4484 (name "java-plexus-component-metadata")
4485 (arguments
4486 `(#:jar-name "plexus-component-metadata.jar"
4487 #:source-dir "src/main/java"
4488 #:test-dir "src/test"
4489 #:jdk ,icedtea-8
4490 #:phases
4491 (modify-phases %standard-phases
4492 (add-before 'configure 'chdir
4493 (lambda _
4494 (chdir "plexus-component-metadata")
4495 #t))
4496 (add-before 'build 'copy-resources
4497 (lambda _
4498 (copy-recursively "src/main/resources"
4499 "build/classes/")
4500 #t))
4501 (add-before 'build 'fix-jdom
4502 (lambda _
4503 ;; The newer version of jdom now sets multiple features by default
4504 ;; that are not supported.
4505 ;; Skip these features
4506 (substitute* "src/main/java/org/codehaus/plexus/metadata/merge/MXParser.java"
4507 (("throw new XmlPullParserException\\(\"unsupporte feature \"\\+name\\);")
4508 "// skip"))))
4509 (add-before 'build 'reinstate-cli
4510 ;; The CLI was removed in 2.1.0, but we still need it to build some
4511 ;; maven dependencies, and some parts of maven itself. We can't use
4512 ;; the maven plugin for that yet.
4513 (lambda _
4514 (with-output-to-file "src/main/java/org/codehaus/plexus/metadata/PlexusMetadataGeneratorCli.java"
4515 (lambda _
4516 ;; Copied from a previous version of this package.
4517 (display "package org.codehaus.plexus.metadata;
4518
4519import java.io.File;
4520import java.util.Arrays;
4521import java.util.Collections;
4522
4523import org.apache.commons.cli.CommandLine;
4524import org.apache.commons.cli.OptionBuilder;
4525import org.apache.commons.cli.Options;
4526import org.codehaus.plexus.PlexusContainer;
4527import org.codehaus.plexus.tools.cli.AbstractCli;
4528
4529public class PlexusMetadataGeneratorCli
4530 extends AbstractCli
4531{
4532 public static final char SOURCE_DIRECTORY = 's';
4533 public static final char SOURCE_ENCODING = 'e';
4534 public static final char CLASSES_DIRECTORY = 'c';
4535 public static final char OUTPUT_FILE = 'o';
4536 public static final char DESCRIPTORS_DIRECTORY = 'm';
4537
4538 public static void main( String[] args )
4539 throws Exception
4540 {
4541 new PlexusMetadataGeneratorCli().execute( args );
4542 }
4543
4544 @Override
4545 public String getPomPropertiesPath()
4546 {
4547 return \"META-INF/maven/org.codehaus.plexus/plexus-metadata-generator/pom.properties\";
4548 }
4549
4550 @Override
4551 @SuppressWarnings(\"static-access\")
4552 public Options buildCliOptions( Options options )
4553 {
4554 options.addOption( OptionBuilder.withLongOpt( \"source\" ).hasArg().withDescription( \"Source directory.\" ).create( SOURCE_DIRECTORY ) );
4555 options.addOption( OptionBuilder.withLongOpt( \"encoding\" ).hasArg().withDescription( \"Source file encoding.\" ).create( SOURCE_ENCODING ) );
4556 options.addOption( OptionBuilder.withLongOpt( \"classes\" ).hasArg().withDescription( \"Classes directory.\" ).create( CLASSES_DIRECTORY ) );
4557 options.addOption( OptionBuilder.withLongOpt( \"output\" ).hasArg().withDescription( \"Output directory.\" ).create( OUTPUT_FILE ) );
4558 options.addOption( OptionBuilder.withLongOpt( \"descriptors\" ).hasArg().withDescription( \"Descriptors directory.\" ).create( DESCRIPTORS_DIRECTORY ) );
4559 return options;
4560 }
4561
4562 public void invokePlexusComponent( CommandLine cli, PlexusContainer plexus )
4563 throws Exception
4564 {
4565 MetadataGenerator metadataGenerator = plexus.lookup( MetadataGenerator.class );
4566
4567 MetadataGenerationRequest request = new MetadataGenerationRequest();
4568 request.classesDirectory = new File( cli.getOptionValue( CLASSES_DIRECTORY ) );
4569 request.classpath = Collections.emptyList();
4570 request.sourceDirectories = Arrays.asList( new String[]{ new File( cli.getOptionValue( SOURCE_DIRECTORY ) ).getAbsolutePath() } );
4571 request.sourceEncoding = cli.getOptionValue( SOURCE_ENCODING );
4572 request.useContextClassLoader = true;
4573 request.outputFile = new File( cli.getOptionValue( OUTPUT_FILE ) );
4574 request.componentDescriptorDirectory = new File( cli.getOptionValue( DESCRIPTORS_DIRECTORY ) );
4575
4576 metadataGenerator.generateDescriptor( request );
4577 }
4578}")))))
4579 (add-before 'check 'fix-test-location
4580 (lambda _
4581 (substitute* '("src/test/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriterTest.java"
4582 "src/test/java/org/codehaus/plexus/metadata/merge/ComponentsXmlMergerTest.java")
4583 (("target") "build")))))))
4584 (propagated-inputs
4585 `(("java-plexus-container-default" ,java-plexus-container-default)
4586 ("java-plexu-component-annotations" ,java-plexus-component-annotations)
4587 ("java-plexus-utils" ,java-plexus-utils)
4588 ("java-plexus-cli" ,java-plexus-cli)
4589 ("java-plexus-classworlds" ,java-plexus-classworlds)
4590 ("maven-plugin-api" ,maven-plugin-api)
4591 ("maven-plugin-annotations" ,maven-plugin-annotations)
4592 ("maven-core-bootstrap" ,maven-core-bootstrap)
4593 ("maven-model" ,maven-model)
4594 ("java-commons-cli" ,java-commons-cli)
4595 ("java-qdox" ,java-qdox)
4596 ("java-jdom2" ,java-jdom2)
4597 ("java-asm-8" ,java-asm-8)))
4598 (native-inputs
4599 (list java-junit java-guava java-geronimo-xbean-reflect))
4600 (synopsis "Inversion-of-control container for Maven")
4601 (description "The Plexus project provides a full software stack for creating
4602and executing software projects. Based on the Plexus container, the
4603applications can utilise component-oriented programming to build modular,
4604reusable components that can easily be assembled and reused. This package
4605provides the Maven plugin generating the component metadata.")))
4606
4607(define-public java-plexus-container-default-1.7
4608 (package
4609 (inherit java-plexus-container-default)
4610 (version "1.7.1")
4611 (source (origin
4612 (method git-fetch)
4613 (uri (git-reference
4614 (url "https://github.com/codehaus-plexus/plexus-containers")
4615 (commit (string-append "plexus-containers-" version))))
4616 (file-name (git-file-name "java-plexus-container-default" version))
4617 (sha256
4618 (base32
4619 "1316hrp5vqfv0aw7miq2fp0wwy833h66h502h29vnh5sxj27x228"))))))
4620
4621(define java-plexus-containers-parent-pom-1.7
4622 (package
4623 (inherit java-plexus-container-default-1.7)
4624 (name "java-plexus-containers-parent-pom")
4625 (arguments
4626 `(#:tests? #f
4627 #:phases
4628 (modify-phases %standard-phases
4629 (delete 'configure)
4630 (delete 'build)
4631 (replace 'install
4632 (install-pom-file "pom.xml")))))
4633 (propagated-inputs
4634 `(("plexus-parent-pom" ,plexus-parent-pom-4.0)))))
4635
4636(define-public java-plexus-component-annotations-1.7
4637 (package
4638 (inherit java-plexus-container-default-1.7)
4639 (name "java-plexus-component-annotations")
4640 (arguments
4641 `(#:jar-name "plexus-component-annotations.jar"
4642 #:source-dir "plexus-component-annotations/src/main/java"
4643 #:tests? #f; no tests
4644 #:phases
4645 (modify-phases %standard-phases
4646 (replace 'install
4647 (install-from-pom "plexus-component-annotations/pom.xml")))))
4648 (propagated-inputs
4649 `(("java-plexus-containers-parent-pom-1.7" ,java-plexus-containers-parent-pom-1.7)))
4650 (inputs '())
4651 (native-inputs '())
4652 (synopsis "Plexus descriptors generator")
4653 (description "This package is a Maven plugin to generate Plexus descriptors
4654from source tags and class annotations.")))
4655
4656(define-public java-plexus-component-metadata-1.7
4657 (package
4658 (inherit java-plexus-container-default-1.7)
4659 (name "java-plexus-component-metadata")
4660 (arguments
4661 `(#:jar-name "plexus-component-metadata.jar"
4662 #:source-dir "src/main/java"
4663 #:test-dir "src/test"
4664 #:phases
4665 (modify-phases %standard-phases
4666 (add-before 'configure 'chdir
4667 (lambda _
4668 (chdir "plexus-component-metadata")
4669 #t))
4670 (add-before 'build 'copy-resources
4671 (lambda _
4672 (copy-recursively "src/main/resources"
4673 "build/classes/")
4674 #t))
4675 (add-before 'build 'fix-jdom
4676 (lambda _
4677 ;; The newer version of jdom now sets multiple features by default
4678 ;; that are not supported.
4679 ;; Skip these features
4680 (substitute* "src/main/java/org/codehaus/plexus/metadata/merge/MXParser.java"
4681 (("throw new XmlPullParserException\\(\"unsupporte feature \"\\+name\\);")
4682 "// skip"))))
4683 (add-before 'check 'fix-test-location
4684 (lambda _
4685 (substitute* '("src/test/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriterTest.java"
4686 "src/test/java/org/codehaus/plexus/metadata/merge/ComponentsXmlMergerTest.java")
4687 (("target") "build")))))))
4688 (propagated-inputs
4689 (list java-plexus-container-default-1.7
4690 java-plexus-component-annotations-1.7
4691 java-plexus-utils
4692 java-plexus-cli
4693 java-plexus-cli
4694 java-plexus-classworlds
4695 maven-plugin-api
4696 maven-plugin-annotations
4697 maven-core-bootstrap
4698 maven-model
4699 java-commons-cli
4700 java-qdox
4701 java-jdom2
4702 java-asm-8))
4703 (native-inputs
4704 (list java-junit java-guava java-geronimo-xbean-reflect))
4705 (synopsis "Inversion-of-control container for Maven")
4706 (description "The Plexus project provides a full software stack for creating
4707and executing software projects. Based on the Plexus container, the
4708applications can utilise component-oriented programming to build modular,
4709reusable components that can easily be assembled and reused. This package
4710provides the Maven plugin generating the component metadata.")))
4711
4712(define-public java-plexus-cipher
4713 (package
4714 (name "java-plexus-cipher")
4715 (version "2.0")
4716 (source (origin
4717 (method git-fetch)
4718 (uri (git-reference
4719 (url "https://github.com/codehaus-plexus/plexus-cipher")
4720 (commit (string-append "plexus-cipher-" version))))
4721 (file-name (git-file-name name version))
4722 (sha256
4723 (base32
4724 "01fipdsm090n8j4207fl8kbxznkgkmkkgyazf53hm1nwn6na5aai"))))
4725 (build-system ant-build-system)
4726 (arguments
4727 `(#:jar-name "plexus-cipher.jar"
4728 #:source-dir "src/main/java"
4729 #:phases
4730 (modify-phases %standard-phases
4731 (add-before 'build 'generate-javax.inject.Named
4732 (lambda _
4733 (mkdir-p "build/classes/META-INF/sisu")
4734 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4735 (lambda _
4736 (display
4737 "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
4738 #t))
4739 (replace 'install (install-from-pom "pom.xml")))))
4740 (inputs
4741 `(("java-cdi-api" ,java-cdi-api)
4742 ("java-javax-inject" ,java-javax-inject)))
4743 (propagated-inputs
4744 `(("java-sonatype-spice-parent-pom" ,java-sonatype-spice-parent-pom-15)
4745 ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)))
4746 (native-inputs
4747 `(("java-junit" ,java-junit)))
4748 (home-page "https://github.com/sonatype/plexus-cipher")
4749 (synopsis "Encryption/decryption Component")
4750 (description "Plexus-cipher contains a component to deal with encryption
4751and decryption.")
4752 (license license:asl2.0)))
4753
4754(define-public java-plexus-cipher-1.7
4755 (package
4756 (inherit java-plexus-cipher)
4757 (version "1.7")
4758 (source (origin
4759 (method git-fetch)
4760 (uri (git-reference
4761 (url "https://github.com/codehaus-plexus/plexus-cipher")
4762 (commit (string-append "plexus-cipher-" version))))
4763 (file-name (git-file-name "java-plexus-cipher" version))
4764 (sha256
4765 (base32
4766 "0m638nzlxbmnbcj5cwdpgs326ab584yv0k803zlx37r6iqwvf6b0"))))
4767 (arguments
4768 `(#:jar-name "plexus-cipher.jar"
4769 #:source-dir "src/main/java"
4770 #:tests? #f; FIXME: requires sisu-inject-bean
4771 #:phases
4772 (modify-phases %standard-phases
4773 (add-before 'build 'copy-resources
4774 (lambda _
4775 (copy-recursively "src/main/resources" "build/classes")
4776 (mkdir-p "build/classes/META-INF/sisu")
4777 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4778 (lambda _
4779 (display "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
4780 #t))
4781 (add-before 'install 'fix-test-dependency
4782 (lambda _
4783 ;; sisu-inject-bean is only used for tests, but its scope is "provided".
4784 (substitute* "pom.xml"
4785 (("provided") "test"))
4786 #t))
4787 (replace 'install (install-from-pom "pom.xml")))))
4788 (propagated-inputs
4789 (list java-sonatype-spice-parent-pom-15))))
4790
4791(define-public java-plexus-java
4792 (package
4793 (name "java-plexus-java")
4794 (version "0.9.10")
4795 (source (origin
4796 (method git-fetch)
4797 (uri (git-reference
4798 (url "https://github.com/codehaus-plexus/plexus-languages")
4799 (commit (string-append "plexus-languages-" version))))
4800 (file-name (git-file-name name version))
4801 (sha256
4802 (base32
4803 "0vmvgq5hfxs90yyxgssfpwq78l7vwx1ljwpkk594mrdr8sm668b5"))
4804 (modules '((guix build utils)))
4805 (snippet
4806 `(begin
4807 (for-each delete-file (find-files "." ".*.jar$"))
4808 #t))))
4809 (build-system ant-build-system)
4810 (arguments
4811 `(#:jar-name "plexus-java.java"
4812 #:source-dir "plexus-java/src/main/java"
4813 #:test-dir "plexus-java/src/test"
4814 #:tests? #f; require mockito 2
4815 #:phases
4816 (modify-phases %standard-phases
4817 (add-after 'build 'generate-metadata
4818 (lambda _
4819 (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
4820 "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
4821 "--source" "plexus-java/src/main/java"
4822 "--output" "build/classes/META-INF/plexus/components.xml"
4823 "--classes" "build/classes"
4824 "--descriptors" "build/classes/META-INF")
4825 (invoke "ant" "jar")
4826 #t))
4827 (add-before 'install 'install-parent
4828 (install-pom-file "pom.xml"))
4829 (replace 'install
4830 (install-from-pom "plexus-java/pom.xml")))))
4831 (propagated-inputs
4832 (list java-asm java-qdox-2-M9 java-javax-inject
4833 plexus-parent-pom-4.0))
4834 (inputs
4835 (list java-plexus-component-annotations-1.7))
4836 (native-inputs
4837 (list java-plexus-component-metadata-1.7 java-junit))
4838 (home-page "https://codehaus-plexus.github.io/plexus-languages/plexus-java")
4839 (synopsis "Shared language features for Java")
4840 (description "This package contains shared language features of the Java
4841language, for the plexus project.")
4842 (license license:asl2.0)))
4843
4844(define-public java-plexus-compiler-api
4845 (package
4846 (name "java-plexus-compiler-api")
4847 (version "2.8.4")
4848 (source (origin
4849 (method git-fetch)
4850 (uri (git-reference
4851 (url "https://github.com/codehaus-plexus/plexus-compiler")
4852 (commit (string-append "plexus-compiler-" version))))
4853 (file-name (git-file-name name version))
4854 (sha256
4855 (base32
4856 "1nq1gnn3s6z1j29gmi1hqbklsmm8b1lmnafb0191914f95mn18gk"))))
4857 (build-system ant-build-system)
4858 (arguments
4859 `(#:jar-name "plexus-compiler-api.jar"
4860 #:source-dir "plexus-compiler-api/src/main/java"
4861 #:test-dir "plexus-compiler-api/src/test"
4862 #:phases
4863 (modify-phases %standard-phases
4864 (replace 'install
4865 (install-from-pom "plexus-compiler-api/pom.xml")))))
4866 (propagated-inputs
4867 `(("java-plexus-container-default" ,java-plexus-container-default)
4868 ("java-plexus-compiler-pom" ,java-plexus-compiler-pom)
4869 ("java-plexus-util" ,java-plexus-utils)))
4870 (native-inputs
4871 (list java-junit))
4872 (home-page "https://github.com/codehaus-plexus/plexus-compiler")
4873 (synopsis "Plexus Compilers component's API to manipulate compilers")
4874 (description "This package contains the API used by components to manipulate
4875compilers.")
4876 (license (list license:asl2.0
4877 license:expat))))
4878
4879(define java-plexus-compiler-pom
4880 (package
4881 (inherit java-plexus-compiler-api)
4882 (name "java-plexus-compiler-pom")
4883 (arguments
4884 `(#:tests? #f
4885 #:phases
4886 (modify-phases %standard-phases
4887 (delete 'configure)
4888 (delete 'build)
4889 (replace 'install
4890 (install-pom-file "pom.xml"))
4891 (add-after 'install 'install-compilers
4892 (install-pom-file "plexus-compilers/pom.xml")))))
4893 (propagated-inputs
4894 `(("plexus-components-parent-pom-4.0" ,plexus-components-parent-pom-4.0)))))
4895
4896(define plexus-components-parent-pom-4.0
4897 (package
4898 (name "plexus-components-parent-pom")
4899 (version "4.0")
4900 (source (origin
4901 (method git-fetch)
4902 (uri (git-reference
4903 (url "https://github.com/codehaus-plexus/plexus-components")
4904 (commit (string-append "plexus-components-" version))))
4905 (file-name (git-file-name name version))
4906 (sha256
4907 (base32
4908 "041bm8yv0m2i17mqg8zljib4ykpha7ijls2qfdwvkma4d39lhysi"))))
4909 (build-system ant-build-system)
4910 (arguments
4911 `(#:tests? #f
4912 #:phases
4913 (modify-phases %standard-phases
4914 (delete 'configure)
4915 (delete 'build)
4916 (replace 'install
4917 (install-pom-file "pom.xml")))))
4918 (propagated-inputs
4919 `(("plexus-parent-pom-4.0" ,plexus-parent-pom-4.0)))
4920 (home-page "https://codehaus-plexus.github.io/plexus-components")
4921 (synopsis "Plexus parent pom")
4922 (description "This package contains the Plexus components parent POM.")
4923 (license license:asl2.0)))
4924
4925(define-public java-plexus-compiler-manager
4926 (package
4927 (inherit java-plexus-compiler-api)
4928 (name "java-plexus-compiler-manager")
4929 (arguments
4930 `(#:jar-name "compiler-compiler-manager.java"
4931 #:source-dir "plexus-compiler-manager/src/main/java"
4932 #:test-dir "plexus-compiler-manager/src/test"
4933 #:tests? #f
4934 #:phases
4935 (modify-phases %standard-phases
4936 (add-after 'build 'generate-metadata
4937 (lambda _
4938 (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
4939 "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
4940 "--source" "plexus-compiler-manager/src/main/java"
4941 "--output" "build/classes/META-INF/plexus/components.xml"
4942 "--classes" "build/classes"
4943 "--descriptors" "build/classes/META-INF")
4944 (invoke "ant" "jar")
4945 #t))
4946 (add-after 'generate-metadata 'rebuild
4947 (lambda _
4948 (invoke "ant" "jar")
4949 #t))
4950 (replace 'install
4951 (install-from-pom "plexus-compiler-manager/pom.xml")))))
4952 (propagated-inputs
4953 (list java-plexus-compiler-api java-plexus-compiler-pom
4954 java-plexus-container-default-1.7))
4955 (native-inputs
4956 (list unzip java-plexus-component-metadata-1.7))
4957 (synopsis "Compiler management for Plexus Compiler component")
4958 (description "Plexus Compiler is a Plexus component to use different
4959compilers through a uniform API. This component chooses the compiler
4960implementation to use in a project.")))
4961
4962(define-public java-plexus-compiler-javac
4963 (package
4964 (inherit java-plexus-compiler-api)
4965 (name "java-plexus-compiler-javac")
4966 (arguments
4967 `(#:jar-name "plexus-compiler-javac.jar"
4968 #:source-dir "plexus-compilers/plexus-compiler-javac/src/main/java"
4969 #:jdk ,icedtea-8
4970 #:tests? #f; depends on compiler-test -> maven-core -> ... -> this package.
4971 #:test-dir "plexus-compilers/plexus-compiler-javac/src/test"
4972 #:modules ((guix build ant-build-system)
4973 (guix build utils)
4974 (guix build java-utils)
4975 (sxml simple))
4976 #:phases
4977 (modify-phases %standard-phases
4978 ;; We cannot use java-plexus-component-metadata to generate the metadata
4979 ;; because it ultimately depends on this package.
4980 ;; Create it manually instead
4981 (add-before 'build 'create-metadata
4982 (lambda _
4983 (let* ((dir "build/classes/META-INF/plexus")
4984 (file (string-append dir "/components.xml")))
4985 (mkdir-p dir)
4986 (with-output-to-file file
4987 (lambda _
4988 (sxml->xml
4989 `(component-set
4990 (components
4991 (component
4992 (role "org.codehaus.plexus.compiler.Compiler")
4993 (role-hint "javac")
4994 (implementation "org.codehaus.plexus.compiler.javac.JavacCompiler")
4995 (isolated-realm "false"))))))))
4996 #t))
4997 (replace 'install
4998 (install-from-pom "plexus-compilers/plexus-compiler-javac/pom.xml")))))
4999 (propagated-inputs
5000 (list java-plexus-compiler-api java-plexus-utils
5001 java-plexus-container-default))
5002 (synopsis "Javac Compiler support for Plexus Compiler component")
5003 (description "This package contains the Javac Compiler support for Plexus
5004Compiler component.")))
5005
5006(define plexus-components-pom-1.1.20
5007 (package
5008 (name "plexus-components-pom-1.1.20")
5009 (version "1.1.20")
5010 (source (origin
5011 (method git-fetch)
5012 (uri (git-reference
5013 (url "https://github.com/codehaus-plexus/plexus-components")
5014 (commit (string-append "plexus-components-" version))))
5015 (file-name (git-file-name name version))
5016 (sha256
5017 (base32
5018 "1q254k95m9icyfsvaw8c226midg8v6v436wvivhv7im825mnp5yb"))))
5019 (build-system ant-build-system)
5020 (arguments
5021 `(#:tests? #f
5022 #:phases
5023 (modify-phases %standard-phases
5024 (delete 'configure)
5025 (delete 'build)
5026 (replace 'install
5027 (install-pom-file "pom.xml")))))
5028 (propagated-inputs
5029 `(("plexus-parent-pom" ,plexus-parent-pom-3.1)))
5030 (home-page "https://github.com/codehaus-plexus/plexus-components")
5031 (synopsis "Maven parent pom for plexus packages")
5032 (description "This package contains the parent pom for plexus component
5033packages.")
5034 (license license:asl2.0)))
5035
5036(define-public java-plexus-digest
5037 (package
5038 (name "java-plexus-digest")
5039 (version "1.2")
5040 (source (origin
5041 (method git-fetch)
5042 (uri (git-reference
5043 (url "https://github.com/codehaus-plexus/plexus-digest")
5044 (commit "2a52ad1bda8297fa0e287163d2fa37245ec6a430")))
5045 (file-name (git-file-name name version))
5046 (sha256
5047 (base32
5048 "19w5wxsliz8r42niry68qa665kvjsb8081dazg9vgd3pca72w07x"))))
5049 (build-system ant-build-system)
5050 (arguments
5051 `(#:jar-name "plexus-digest.jar"
5052 #:source-dir "src/main/java"
5053 #:tests? #f
5054 #:phases
5055 (modify-phases %standard-phases
5056 (replace 'install
5057 (install-from-pom "pom.xml")))))
5058 (propagated-inputs
5059 (list java-plexus-utils plexus-components-pom-1.1.20))
5060 (native-inputs
5061 (list java-junit))
5062 (home-page "https://github.com/codehaus-plexus/plexus-digest")
5063 (synopsis "Hash function utilities for Java")
5064 (description "This package is a plexus component that contains hash
5065function utilities.")
5066 (license license:asl2.0)))
5067
5068(define-public java-plexus-sec-dispatcher
5069 (package
5070 (name "java-plexus-sec-dispatcher")
5071 (version "2.0")
5072 (source (origin
5073 (method git-fetch)
5074 (uri (git-reference
5075 (url "https://github.com/codehaus-plexus/plexus-sec-dispatcher")
5076 (commit (string-append "plexus-sec-dispatcher-" version))))
5077 (sha256
5078 (base32
5079 "0665zcyxkv2knydxgv2dn64zvy1dx9j9af12ds9s64qmzd1rk6pk"))
5080 (file-name (git-file-name name version))))
5081 (arguments
5082 `(#:jar-name "plexus-sec-dispatcher.jar"
5083 #:source-dir "src/main/java"
5084 #:phases
5085 (modify-phases %standard-phases
5086 (add-before 'build 'generate-models
5087 (lambda* (#:key inputs #:allow-other-keys)
5088 (define (modello-single-mode file version mode)
5089 (invoke "java"
5090 "org.codehaus.modello.ModelloCli"
5091 file mode "src/main/java" version
5092 "false" "true"))
5093 (let ((file "src/main/mdo/settings-security.mdo"))
5094 (modello-single-mode file "1.0.0" "java")
5095 (modello-single-mode file "1.0.0" "xpp3-reader")
5096 (modello-single-mode file "1.0.0" "xpp3-writer"))
5097 #t))
5098 (add-before 'build 'generate-javax.inject.Named
5099 (lambda _
5100 (mkdir-p "build/classes/META-INF/sisu")
5101 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
5102 (lambda _
5103 (display
5104 "org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher\n")))
5105 #t))
5106 (add-before 'check 'fix-paths
5107 (lambda _
5108 (copy-recursively "src/test/resources" "target")
5109 #t))
5110 (replace 'install (install-from-pom "pom.xml")))))
5111 (propagated-inputs
5112 (list java-plexus-utils java-plexus-cipher plexus-parent-pom-8))
5113 (native-inputs
5114 (list java-javax-inject
5115 java-modello-core
5116 ;; for modello
5117 java-plexus-container-default
5118 java-plexus-classworlds
5119 java-plexus-utils
5120 java-guava
5121 java-geronimo-xbean-reflect
5122 ;; modello plugins
5123 java-modello-plugins-java
5124 java-modello-plugins-xml
5125 java-modello-plugins-xpp3
5126 ;; for tests
5127 java-junit))
5128 (build-system ant-build-system)
5129 (home-page "https://github.com/sonatype/plexus-sec-dispatcher")
5130 (synopsis "Plexus Security Dispatcher Component")
5131 (description "This package is the Plexus Security Dispatcher Component.
5132This component decrypts a string passed to it.")
5133 (license license:asl2.0)))
5134
5135(define-public java-plexus-sec-dispatcher-1.4
5136 (package
5137 (inherit java-plexus-sec-dispatcher)
5138 (version "1.4")
5139 (source (origin
5140 (method git-fetch)
5141 (uri (git-reference
5142 (url "https://github.com/codehaus-plexus/plexus-sec-dispatcher")
5143 (commit (string-append "sec-dispatcher-" version))))
5144 (sha256
5145 (base32
5146 "1ng4yliy4cqpjr4fxxjbpwyk1wkch5f8vblm1kvwf328s4gibszs"))
5147 (file-name (git-file-name "java-plexus-sec-dispatcher" version))))
5148 (arguments
5149 (substitute-keyword-arguments (package-arguments java-plexus-sec-dispatcher)
5150 ((#:phases phases)
5151 `(modify-phases ,phases
5152 (delete 'generate-javax.inject.Named)
5153 (add-before 'build 'generate-components.xml
5154 (lambda _
5155 (mkdir-p "build/classes/META-INF/plexus")
5156 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
5157 (lambda _
5158 (display
5159 "<component-set>\n
5160 <components>\n
5161 <component>\n
5162 <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role>\n
5163 <role-hint>default</role-hint>\n
5164 <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation>\n
5165 <description></description>\n
5166 <requirements>\n
5167 <requirement>\n
5168 <role>org.sonatype.plexus.components.cipher.PlexusCipher</role>\n
5169 <field-name>_cipher</field-name>\n
5170 </requirement>\n
5171 <requirement>\n
5172 <role>org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor</role>\n
5173 <field-name>_decryptors</field-name>\n
5174 </requirement>\n
5175 </requirements>\n
5176 <configuration>\n
5177 <_configuration-file>~/.settings-security.xml</_configuration-file>\n
5178 </configuration>\n
5179 </component>\n
5180 </components>\n
5181</component-set>\n")))))))))
5182 (propagated-inputs
5183 (list java-plexus-utils java-plexus-cipher-1.7
5184 java-sonatype-spice-parent-pom-12))))
5185
5186(define-public java-plexus-cli
5187 (package
5188 (name "java-plexus-cli")
5189 (version "1.7")
5190 (source (origin
5191 (method git-fetch)
5192 (uri (git-reference
5193 (url "https://github.com/sonatype/plexus-cli")
5194 (commit "a776afa6bca84e5107bedb69440329cdb24ed645")))
5195 (file-name (string-append name "-" version))
5196 (sha256
5197 (base32
5198 "0xjrlay605rypv3zd7y24vlwf0039bil3n2cqw54r1ddpysq46vx"))))
5199 (build-system ant-build-system)
5200 (arguments
5201 `(#:jar-name "plexus-cli.jar"
5202 #:source-dir "src/main/java"
5203 #:jdk ,icedtea-8
5204 #:test-dir "src/test"))
5205 (inputs
5206 (list java-commons-cli java-plexus-container-default
5207 java-plexus-classworlds))
5208 (native-inputs
5209 (list java-plexus-utils java-junit java-guava))
5210 (home-page "https://codehaus-plexus.github.io/plexus-cli")
5211 (synopsis "CLI building library for plexus")
5212 (description "This package is a library to help creating CLI around
5213Plexus components.")
5214 (license license:asl2.0)))
5215
5216(define-public java-plexus-build-api
5217 (package
5218 (name "java-plexus-build-api")
5219 (version "0.0.7")
5220 (source (origin
5221 (method git-fetch)
5222 (uri (git-reference
5223 (url "https://github.com/codehaus-plexus/plexus-build-api")
5224 (commit (string-append "plexus-build-api-" version))))
5225 (file-name (git-file-name name version))
5226 (sha256
5227 (base32
5228 "1d5w6c58gkx30d51v7qwv1xrhc0ly76848gihmgshj19yf6yhca0"))))
5229 (build-system ant-build-system)
5230 (arguments
5231 `(#:jar-name "plexus-build-api.jar"
5232 #:source-dir "src/main/java"
5233 #:jdk ,icedtea-8
5234 #:tests? #f; FIXME: how to run the tests?
5235 #:phases
5236 (modify-phases %standard-phases
5237 (add-before 'build 'copy-resources
5238 (lambda _
5239 (copy-recursively "src/main/resources" "build/classes")
5240 (substitute* (find-files "build/classes")
5241 (("\\$\\{project.version\\}") ,version))
5242 #t))
5243 (add-before 'build 'generate-plexus-compontent
5244 (lambda _
5245 (mkdir-p "build/classes/META-INF/plexus")
5246 ;; This file is required for plexus to inject this package.
5247 ;; FIXME: how is it generated?
5248 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
5249 (lambda _
5250 (display
5251 "<component-set>\n
5252 <components>\n
5253 <component>\n
5254 <role>org.sonatype.plexus.build.incremental.BuildContext</role>\n
5255 <role-hint>default</role-hint>\n
5256 <implementation>org.sonatype.plexus.build.incremental.DefaultBuildContext</implementation>\n
5257 <description>Filesystem based non-incremental build context implementation\n
5258which behaves as if all files were just created.</description>\n
5259 </component>\n
5260 </components>\n
5261</component-set>\n")))
5262 #t))
5263 (replace 'install
5264 (install-from-pom "pom.xml")))))
5265 (inputs
5266 (list java-plexus-utils-3.2.1 java-plexus-container-default))
5267 (home-page "https://github.com/codehaus-plexus/plexus-build-api/")
5268 (synopsis "Base build API for maven")
5269 (description "This package contains the base build API for maven and
5270a default implementation of it. This API is about scanning files in a
5271project and determining what files need to be rebuilt.")
5272 (license license:asl2.0)))
5273
5274(define-public java-modello-core
5275 (package
5276 (name "java-modello-core")
5277 (version "1.11")
5278 (source (origin
5279 (method git-fetch)
5280 (uri (git-reference
5281 (url "https://github.com/codehaus-plexus/modello")
5282 (commit (string-append "modello-" version))))
5283 (file-name (git-file-name name version))
5284 (sha256
5285 (base32
5286 "18885sim7z9j3wy19i9083y9kc8l9xxl2px823a96q4rnqj5z8s2"))))
5287 (build-system ant-build-system)
5288 (arguments
5289 `(#:jar-name "modello-core.jar"
5290 #:source-dir "modello-core/src/main/java"
5291 #:test-dir "modello-core/src/test"
5292 #:main-class "org.codehaus.modello.ModelloCli"
5293 #:jdk ,icedtea-8
5294 #:phases
5295 (modify-phases %standard-phases
5296 (add-before 'build 'copy-resources
5297 (lambda _
5298 (mkdir-p "build/classes/META-INF/plexus")
5299 (copy-file "modello-core/src/main/resources/META-INF/plexus/components.xml"
5300 "build/classes/META-INF/plexus/components.xml")
5301 #t))
5302 (add-before 'check 'fix-tests
5303 (lambda _
5304 (with-directory-excursion "modello-core/src/test/java/org/codehaus"
5305 (substitute* '("modello/core/DefaultModelloCoreTest.java"
5306 "modello/core/io/ModelReaderTest.java")
5307 (("src/test") "modello-core/src/test")))
5308 #t)))))
5309 (propagated-inputs
5310 (list java-plexus-utils java-plexus-container-default
5311 java-plexus-build-api))
5312 (native-inputs
5313 (list java-junit java-plexus-classworlds java-geronimo-xbean-reflect
5314 java-guava))
5315 (home-page "https://codehaus-plexus.github.io/modello/")
5316 (synopsis "Framework for code generation from a simple model")
5317 (description "Modello is a framework for code generation from a simple model.
5318
5319Modello generates code from a simple model format: based on a plugin
5320architecture, various types of code and descriptors can be generated from the
5321single model, including Java POJOs, XML/JSON/YAML marshallers/unmarshallers,
5322XSD and documentation.")
5323 (license (list
5324 license:expat
5325 ;; Although this package uses only files licensed under expat,
5326 ;; other parts of the source are licensed under different
5327 ;; licenses. We include them to be inherited by other packages.
5328 license:asl2.0
5329 ;; Some files in modello-plugin-java are licensed under a
5330 ;; 5-clause BSD license.
5331 (license:non-copyleft
5332 (string-append "file:///modello-plugins/modello-plugin-java/"
5333 "src/main/java/org/codehaus/modello/plugin/"
5334 "java/javasource/JNaming.java"))))))
5335
5336(define-public java-modello-plugins-java
5337 (package
5338 (inherit java-modello-core)
5339 (name "java-modello-plugins-java")
5340 (arguments
5341 `(#:jar-name "modello-plugins-java.jar"
5342 #:source-dir "modello-plugins/modello-plugin-java/src/main/java"
5343 #:test-dir "modello-plugins/modello-plugin-java/src/test"
5344 #:jdk ,icedtea-8
5345 #:tests? #f; requires maven-model, which depends on this package
5346 #:phases
5347 (modify-phases %standard-phases
5348 (add-before 'build 'copy-resources
5349 (lambda _
5350 (mkdir-p "build/classes")
5351 (copy-recursively "modello-plugins/modello-plugin-java/src/main/resources"
5352 "build/classes")
5353 #t)))))
5354 (inputs
5355 (list java-modello-core))
5356 (synopsis "Modello Java Plugin")
5357 (description "Modello Java Plugin generates Java objects for the model.")))
5358
5359(define-public java-modello-plugins-xml
5360 (package
5361 (inherit java-modello-core)
5362 (name "java-modello-plugins-xml")
5363 (arguments
5364 `(#:jar-name "modello-plugins-xml.jar"
5365 #:source-dir "modello-plugins/modello-plugin-xml/src/main/java"
5366 #:test-dir "modello-plugins/modello-plugin-xml/src/test"
5367 #:jdk ,icedtea-8
5368 #:phases
5369 (modify-phases %standard-phases
5370 (add-before 'build 'copy-resources
5371 (lambda _
5372 (mkdir-p "build/classes")
5373 (copy-recursively
5374 "modello-plugins/modello-plugin-xml/src/main/resources"
5375 "build/classes")
5376 #t))
5377 (add-before 'check 'fix-paths
5378 (lambda _
5379 (with-directory-excursion "modello-plugins/modello-plugin-xml/src/test"
5380 (substitute*
5381 "java/org/codehaus/modello/plugins/xml/XmlModelloPluginTest.java"
5382 (("src/test") "modello-plugins/modello-plugin-xml/src/test")))
5383 #t)))))
5384 (propagated-inputs
5385 (list java-modello-core java-modello-plugins-java))
5386 (synopsis "Modello XML Plugin")
5387 (description "Modello XML Plugin contains shared code for every plugins
5388working on XML representation of the model.")))
5389
5390(define-public java-modello-test
5391 (package
5392 (inherit java-modello-core)
5393 (name "java-modello-test")
5394 (arguments
5395 `(#:jar-name "modello-test.jar"
5396 #:source-dir "modello-test/src/main/java"
5397 #:tests? #f; no tests
5398 #:jdk ,icedtea-8))
5399 (inputs
5400 (list java-plexus-utils java-plexus-compiler-api
5401 java-plexus-compiler-javac java-plexus-container-default))
5402 (synopsis "Modello test package")
5403 (description "The modello test package contains the basis to create
5404Modello generator unit-tests, including sample models and xml files to test
5405every feature for every plugin.")))
5406
5407(define-public java-modello-plugins-xpp3
5408 (package
5409 (inherit java-modello-core)
5410 (name "java-modello-plugins-xpp3")
5411 (arguments
5412 `(#:jar-name "modello-plugins-xpp3.jar"
5413 #:source-dir "modello-plugins/modello-plugin-xpp3/src/main/java"
5414 #:test-dir "modello-plugins/modello-plugin-xpp3/src/test"
5415 ;; One of the test dependencies is maven-model which depends on this package.
5416 #:tests? #f
5417 #:jdk ,icedtea-8
5418 #:phases
5419 (modify-phases %standard-phases
5420 (add-before 'build 'copy-resources
5421 (lambda _
5422 (mkdir-p "build/classes")
5423 (copy-recursively "modello-plugins/modello-plugin-xpp3/src/main/resources"
5424 "build/classes")
5425 #t)))))
5426 (propagated-inputs
5427 (list java-modello-core java-modello-plugins-java
5428 java-modello-plugins-xml))
5429 (native-inputs
5430 (modify-inputs native-inputs
5431 (prepend java-xmlunit java-modello-test)))
5432 (synopsis "Modello XPP3 Plugin")
5433 (description "The modello XPP3 plugin generates XML readers and writers based
5434on the XPP3 API (XML Pull Parser).")))
5435
5436(define-public java-ow-util-ant-tasks
5437 (package
5438 (name "java-ow-util-ant-tasks")
5439 (version "1.3.2")
5440 (source (origin
5441 (method url-fetch)
5442 (uri (string-append
5443 "mirror://debian/pool/main/o/ow-util-ant-tasks/"
5444 "ow-util-ant-tasks_" version ".orig.tar.gz"))
5445 (sha256
5446 (base32
5447 "1y5ln1g36aligwcadqksdj18i5ghqnxn523wjbzy2zyd7w58fgy5"))))
5448 (build-system ant-build-system)
5449 (arguments
5450 `(#:jar-name "ow-util-ant-tasks.jar"
5451 #:tests? #f; no tests
5452 #:phases
5453 (modify-phases %standard-phases
5454 (add-before 'build 'delete-cyclic-dependency
5455 (lambda _
5456 ;; This file depends on asm-3, which depends on this package
5457 (delete-file "src/org/objectweb/util/ant/DependencyAnalyzer.java")
5458 ;; This file depends on xalan
5459 (delete-file "src/org/objectweb/util/ant/Xalan2Liaison.java")))
5460 (add-before 'build 'fix-new-ant
5461 (lambda _
5462 (substitute* "src/org/objectweb/util/ant/MultipleCopy.java"
5463 ((", destFile.getAbsolutePath\\(\\)")
5464 ", new String[] { destFile.getAbsolutePath() }")))))))
5465 (home-page "https://packages.debian.org/source/stretch/ow-util-ant-tasks")
5466 (synopsis "Replacement for base ant tasks")
5467 (description "This library is used in the legacy build process of several
5468key frameworks developed by ObjectWeb, among them legacy versions of the
5469ObjectWeb ASM bytecode manipulation framework.")
5470 (license license:lgpl2.0+)))
5471
5472(define-public java-asm
5473 (package
5474 (name "java-asm")
5475 (version "6.0")
5476 (source (origin
5477 (method url-fetch)
5478 (uri (string-append "https://download.forge.ow2.org/asm/"
5479 "asm-" version ".tar.gz"))
5480 (sha256
5481 (base32
5482 "115l5pqblirdkmzi32dxx7gbcm4jy0s14y5wircr6h8jdr9aix00"))))
5483 (build-system ant-build-system)
5484 (arguments
5485 `(#:build-target "compile"
5486 ;; The tests require an old version of Janino, which no longer compiles
5487 ;; with the JDK7.
5488 #:tests? #f
5489 #:make-flags
5490 (list
5491 ;; We don't need these extra ant tasks, but the build system asks us to
5492 ;; provide a path anyway.
5493 "-Dobjectweb.ant.tasks.path=dummy-path"
5494 ;; The java-aqute.bndlib JAR file will be put onto the classpath and
5495 ;; used during the build automatically by ant-build-system, but
5496 ;; java-asm's build.xml fails unless we provide something here.
5497 "-Dbiz.aQute.bnd.path=dummy-path")
5498 #:phases
5499 (modify-phases %standard-phases
5500 (add-before 'build 'remove-bnd-dependency
5501 (lambda _
5502 ;; This file is the only one to require bnd, and is not needed
5503 ;; because we don't build a bundle.
5504 (delete-file "src/org/objectweb/asm/tools/ModuleInfoBndPlugin.java")
5505 #t))
5506 (add-before 'install 'build-jars
5507 (lambda* (#:key make-flags #:allow-other-keys)
5508 ;; We cannot use the "jar" target because it depends on a couple
5509 ;; of unpackaged, complicated tools.
5510 (mkdir "dist")
5511 (invoke "jar"
5512 "-cf" (string-append "dist/asm-" ,version ".jar")
5513 "-C" "output/build/tmp" ".")))
5514 (add-before 'install 'fix-pom
5515 (lambda _
5516 (substitute* (find-files "archive" "\\.pom$")
5517 (("@product.artifact@") ,version))
5518 #t))
5519 (add-before 'install 'install-parent
5520 (install-pom-file "archive/asm-parent.pom"))
5521 (replace 'install
5522 (install-from-pom "archive/asm.pom")))))
5523 (native-inputs
5524 (list java-junit))
5525 (propagated-inputs
5526 (list java-org-ow2-parent-pom-1.3))
5527 (home-page "https://asm.ow2.io/")
5528 (synopsis "Very small and fast Java bytecode manipulation framework")
5529 (description "ASM is an all purpose Java bytecode manipulation and
5530analysis framework. It can be used to modify existing classes or dynamically
5531generate classes, directly in binary form. The provided common
5532transformations and analysis algorithms allow easily assembling custom
5533complex transformations and code analysis tools.")
5534 (license license:bsd-3)))
5535
5536(define-public java-org-ow2-parent-pom-1.3
5537 (package
5538 (name "java-org-ow2-parent-pom")
5539 (version "1.3")
5540 (source (origin
5541 (method url-fetch)
5542 (uri "https://repo1.maven.org/maven2/org/ow2/ow2/1.3/ow2-1.3.pom")
5543 (sha256
5544 (base32
5545 "1yr8hfx8gffpppa4ii6cvrsq029a6x8hzy7nsavxhs60s9kmq8ai"))))
5546 (build-system ant-build-system)
5547 (arguments
5548 `(#:tests? #f
5549 #:phases
5550 (modify-phases %standard-phases
5551 (delete 'unpack)
5552 (delete 'build)
5553 (delete 'configure)
5554 (replace 'install
5555 ,#~(install-pom-file #$source)))))
5556 (home-page "https://ow2.org")
5557 (synopsis "Ow2.org parent pom")
5558 (description "This package contains the parent pom for projects from ow2.org,
5559including java-asm.")
5560 (properties '((hidden? . #t)))
5561 (license license:lgpl2.1+)))
5562
5563(define-public java-asm-bootstrap
5564 (package
5565 (inherit java-asm)
5566 (name "java-asm-bootstrap")
5567 (properties '((hidden? . #t)))
5568 (arguments
5569 (substitute-keyword-arguments (package-arguments java-asm)
5570 ((#:tests? _) #f)))
5571 (native-inputs `())))
5572
5573(define-public java-asm-3
5574 (package
5575 (inherit java-asm)
5576 (version "3.1")
5577 (source (origin
5578 (method git-fetch)
5579 (uri (git-reference
5580 (url "https://gitlab.ow2.org/asm/asm")
5581 (commit "ASM_3_1")))
5582 (file-name (git-file-name "java-asm" version))
5583 (sha256
5584 (base32
5585 "0xbyf2sl8j6mrvfpg2da0vjdp906rac62l66gkk82x5cn3vc30h4"))
5586 (modules '((guix build utils)))
5587 (snippet `(for-each delete-file (find-files "." "\\.jar$")))))
5588 (arguments
5589 `(#:build-target "jar"
5590 #:test-target "test"
5591 #:tests? #f; require legacy test software
5592 #:phases
5593 (modify-phases %standard-phases
5594 (replace 'install (install-jars "output/dist"))
5595 (delete 'generate-jar-indices))))
5596 (native-inputs (list java-ow-util-ant-tasks))))
5597
5598(define-public java-asm-8
5599 (package
5600 (inherit java-asm)
5601 (version "8.0.1")
5602 (source (origin
5603 (method git-fetch)
5604 (uri (git-reference
5605 (url "https://gitlab.ow2.org/asm/asm")
5606 (commit (string-append
5607 "ASM_" (string-join (string-split version #\.)
5608 "_")))))
5609 (file-name (git-file-name "java-asm" version))
5610 (sha256
5611 (base32
5612 "1s6j27zc1i76gh891w2g48b1c3abp9w8zp5j54yb1vm5h8djkd69"))))
5613 (arguments
5614 `(#:jar-name "asm8.jar"
5615 #:source-dir "asm/src/main/java"
5616 #:test-dir "asm/src/test"
5617 ;; tests depend on junit5
5618 #:tests? #f))
5619 (propagated-inputs '())
5620 (native-inputs '())))
5621
5622(define-public java-asm-tree-8
5623 (package
5624 (inherit java-asm-8)
5625 (name "java-asm-tree")
5626 (arguments
5627 `(#:jar-name "asm-tree.jar"
5628 #:source-dir "asm-tree/src/main/java"
5629 #:test-dir "asm-tree/src/test"
5630 ;; tests depend on junit5
5631 #:tests? #f))
5632 (inputs
5633 (list java-asm-8))))
5634
5635(define-public java-asm-analysis-8
5636 (package
5637 (inherit java-asm-8)
5638 (name "java-asm-analysis")
5639 (arguments
5640 `(#:jar-name "asm-analysis.jar"
5641 #:source-dir "asm-analysis/src/main/java"
5642 #:test-dir "asm-analysis/src/test"
5643 ;; tests depend on junit5
5644 #:tests? #f))
5645 (inputs
5646 (list java-asm-8 java-asm-tree-8))))
5647
5648(define-public java-asm-util-8
5649 (package
5650 (inherit java-asm-8)
5651 (name "java-asm-util")
5652 (arguments
5653 `(#:jar-name "asm-util8.jar"
5654 #:source-dir "asm-util/src/main/java"
5655 #:test-dir "asm-util/src/test"
5656 ;; tests depend on junit5
5657 #:tests? #f))
5658 (inputs
5659 (list java-asm-8 java-asm-analysis-8 java-asm-tree-8))))
5660
5661(define-public java-asm-commons-8
5662 (package
5663 (inherit java-asm-8)
5664 (name "java-asm-commons")
5665 (arguments
5666 (list #:jar-name "asm-commons8.jar"
5667 #:source-dir "asm-commons/src/main/java"
5668 #:test-dir "asm-commons/src/test"
5669 ;; tests depend on junit5
5670 #:tests? #f))
5671 (inputs (list java-asm-8 java-asm-analysis-8 java-asm-tree-8))))
5672
5673(define-public java-asm-9
5674 (package
5675 (inherit java-asm)
5676 (version "9.4")
5677 (source (origin
5678 (method git-fetch)
5679 (uri (git-reference
5680 (url "https://gitlab.ow2.org/asm/asm")
5681 (commit (string-append
5682 "ASM_" (string-join (string-split version #\.)
5683 "_")))))
5684 (file-name (git-file-name "java-asm" version))
5685 (sha256
5686 (base32
5687 "0c00m638skr5md1p6y1c2xn11kj5w6sjapyvwp9mh70rw095bwzk"))))
5688 (arguments
5689 `(#:jar-name "asm9.jar"
5690 #:source-dir "asm/src/main/java"
5691 #:test-dir "asm/src/test"
5692 ;; tests depend on junit5
5693 #:tests? #f))
5694 (propagated-inputs '())
5695 (native-inputs '())))
5696
5697(define-public java-asm-tree-9
5698 (package
5699 (inherit java-asm-9)
5700 (name "java-asm-tree")
5701 (arguments
5702 `(#:jar-name "asm-tree.jar"
5703 #:source-dir "asm-tree/src/main/java"
5704 #:test-dir "asm-tree/src/test"
5705 ;; tests depend on junit5
5706 #:tests? #f))
5707 (inputs
5708 (list java-asm-9))))
5709
5710(define-public java-asm-analysis-9
5711 (package
5712 (inherit java-asm-9)
5713 (name "java-asm-analysis")
5714 (arguments
5715 `(#:jar-name "asm-analysis.jar"
5716 #:source-dir "asm-analysis/src/main/java"
5717 #:test-dir "asm-analysis/src/test"
5718 ;; tests depend on junit5
5719 #:tests? #f))
5720 (inputs
5721 (list java-asm-9 java-asm-tree-9))))
5722
5723(define-public java-asm-util-9
5724 (package
5725 (inherit java-asm-9)
5726 (name "java-asm-util")
5727 (arguments
5728 `(#:jar-name "asm-util8.jar"
5729 #:source-dir "asm-util/src/main/java"
5730 #:test-dir "asm-util/src/test"
5731 ;; tests depend on junit5
5732 #:tests? #f))
5733 (inputs
5734 (list java-asm-9 java-asm-analysis-9 java-asm-tree-9))))
5735
5736(define-public java-asm-commons-9
5737 (package
5738 (inherit java-asm-9)
5739 (name "java-asm-commons")
5740 (arguments
5741 (list #:jar-name "asm-commons8.jar"
5742 #:source-dir "asm-commons/src/main/java"
5743 #:test-dir "asm-commons/src/test"
5744 ;; tests depend on junit5
5745 #:tests? #f))
5746 (inputs (list java-asm-9 java-asm-analysis-9 java-asm-tree-9))))
5747
5748(define-public java-asm-9.7.1
5749 (package
5750 (inherit java-asm-9)
5751 (name "java-asm")
5752 (version "9.7.1")
5753 (source
5754 (origin
5755 (method git-fetch)
5756 (uri (git-reference
5757 (url "https://gitlab.ow2.org/asm/asm.git")
5758 (commit "ASM_9_7_1")))
5759 (file-name (git-file-name "java-asm" version))
5760 (sha256
5761 (base32 "0q1i01al9mpggf3256iwmhx9yj9pg52v4vi1gdni2x9jcikq65lf"))))))
5762
5763(define-public java-asm-tree-9.7.1
5764 (package
5765 (inherit java-asm-tree-9)
5766 (name "java-asm-tree")
5767 (version (package-version java-asm-9.7.1))
5768 (source (package-source java-asm-9.7.1))
5769 (inputs
5770 (list java-asm-9.7.1))))
5771
5772(define-public java-asm-analysis-9.7.1
5773 (package
5774 (inherit java-asm-analysis-9)
5775 (name "java-asm-analysis")
5776 (version (package-version java-asm-9.7.1))
5777 (source (package-source java-asm-9.7.1))
5778 (inputs
5779 (list java-asm-9.7.1
5780 java-asm-tree-9.7.1))))
5781
5782(define-public java-asm-commons-9.7.1
5783 (package
5784 (inherit java-asm-commons-9)
5785 (name "java-asm-commons")
5786 (version (package-version java-asm-9.7.1))
5787 (source (package-source java-asm-9.7.1))
5788 (inputs
5789 (list java-asm-9.7.1
5790 java-asm-analysis-9.7.1
5791 java-asm-tree-9.7.1))))
5792
5793(define-public java-cglib
5794 (package
5795 (name "java-cglib")
5796 (version "3.3.0")
5797 (source
5798 (origin
5799 (method git-fetch)
5800 (uri (git-reference
5801 (url "https://github.com/cglib/cglib")
5802 (commit (string-append
5803 "RELEASE_"
5804 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
5805 version)))))
5806 (file-name (git-file-name name version))
5807 (sha256
5808 (base32 "1lnscamc6bnhh7jgij5garxagp3zn2jp4cbq0rsn4xr3l0cnd014"))))
5809 (build-system ant-build-system)
5810 (arguments
5811 `(;; FIXME: tests fail because junit runs
5812 ;; "net.sf.cglib.transform.AbstractTransformTest", which does not seem
5813 ;; to describe a test at all.
5814 #:tests? #f
5815 #:jar-name "cglib.jar"
5816 #:phases
5817 (modify-phases %standard-phases
5818 (add-after 'unpack 'chdir
5819 (lambda _ (chdir "cglib") #t)))))
5820 (native-inputs (list java-junit))
5821 (propagated-inputs (list java-asm-8))
5822 (home-page "https://github.com/cglib/cglib/")
5823 (synopsis "Java byte code generation library")
5824 (description "The byte code generation library CGLIB is a high level API
5825to generate and transform Java byte code.")
5826 (license license:asl2.0)))
5827
5828(define-public java-objenesis
5829 (package
5830 (name "java-objenesis")
5831 (version "3.3")
5832 (source (origin
5833 (method git-fetch)
5834 (uri (git-reference
5835 (url "https://github.com/easymock/objenesis")
5836 (commit version)))
5837 (file-name (git-file-name name version))
5838 (sha256
5839 (base32
5840 "1brlcn536p4s1v1f3vzxhr38lvyhc33wjrbj2x06kdrd8agy90cr"))))
5841 (build-system ant-build-system)
5842 (arguments
5843 `(#:tests? #f; require junit-5
5844 #:jar-name "objenesis.jar"
5845 #:source-dir "main/src/main/java"
5846 #:test-dir "main/src/test/"))
5847 (native-inputs
5848 (list java-junit java-hamcrest-core))
5849 (home-page "http://objenesis.org/")
5850 (synopsis "Bypass the constructor when creating an object")
5851 (description "Objenesis is a small Java library that serves one purpose:
5852to instantiate a new object of a particular class. It is common to see
5853restrictions in libraries stating that classes must require a default
5854constructor. Objenesis aims to overcome these restrictions by bypassing the
5855constructor on object instantiation.")
5856 (license license:asl2.0)))
5857
5858(define-public java-easymock
5859 (package
5860 (name "java-easymock")
5861 (version "3.4")
5862 (source (origin
5863 (method git-fetch)
5864 (uri (git-reference
5865 (url "https://github.com/easymock/easymock/")
5866 (commit (string-append "easymock-" version))))
5867 (file-name (git-file-name name version))
5868 (sha256
5869 (base32
5870 "02vybm8hc0i0n9sp2f2iiqn54zwqhq835f76wc6b2m7819z5a8dq"))))
5871 (build-system ant-build-system)
5872 (arguments
5873 `(#:jar-name "easymock.jar"
5874 #:source-dir "core/src/main"
5875 #:test-dir "core/src/test"
5876 #:phases
5877 (modify-phases %standard-phases
5878 ;; FIXME: Android support requires the following packages to be
5879 ;; available: com.google.dexmaker.stock.ProxyBuilder
5880 (add-after 'unpack 'delete-android-support
5881 (lambda _
5882 (with-directory-excursion "core/src/main/java/org/easymock/internal"
5883 (substitute* "MocksControl.java"
5884 (("AndroidSupport.isAndroid\\(\\)") "false")
5885 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
5886 (delete-file "AndroidClassProxyFactory.java"))
5887 #t))
5888 (add-after 'unpack 'delete-broken-tests
5889 (lambda _
5890 (with-directory-excursion "core/src/test/java/org/easymock"
5891 ;; This test depends on dexmaker.
5892 (delete-file "tests2/ClassExtensionHelperTest.java")
5893
5894 ;; This is not a test.
5895 (delete-file "tests/BaseEasyMockRunnerTest.java")
5896
5897 ;; This test should be executed with a different runner...
5898 (delete-file "tests2/EasyMockAnnotationsTest.java")
5899 ;; ...but deleting it means that we also have to delete these
5900 ;; dependent files.
5901 (delete-file "tests2/EasyMockRunnerTest.java")
5902 (delete-file "tests2/EasyMockRuleTest.java")
5903
5904 ;; This test fails because the file "easymock.properties" does
5905 ;; not exist.
5906 (delete-file "tests2/EasyMockPropertiesTest.java"))
5907 #t)))))
5908 (inputs
5909 (list java-cglib java-objenesis))
5910 (native-inputs
5911 (list java-junit java-hamcrest-core))
5912 (home-page "https://easymock.org/")
5913 (synopsis "Java library providing mock objects for unit tests")
5914 (description "EasyMock is a Java library that provides an easy way to use
5915mock objects in unit testing.")
5916 (license license:asl2.0)))
5917
5918(define-public java-easymock-3.2
5919 (package
5920 (inherit java-easymock)
5921 (name "java-easymock")
5922 (version "3.2")
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 "0cn6qqa261mhk9mwxrsz39lkkknfv2h7iprr5zw7wpz9p96dwgv4"))))
5932 (arguments
5933 (list #:jar-name "easymock.jar"
5934 #:source-dir "easymock/src/main"
5935 #:test-dir "easymock/src/test"
5936 #:phases
5937 #~(modify-phases %standard-phases
5938 (add-after 'unpack 'delete-android-support
5939 (lambda _
5940 (with-directory-excursion "easymock/src/main/java/org/easymock/internal"
5941 (substitute* "MocksControl.java"
5942 (("AndroidSupport.isAndroid\\(\\)") "false")
5943 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
5944 (delete-file "AndroidClassProxyFactory.java"))))
5945 (add-after 'unpack 'delete-broken-tests
5946 (lambda _
5947 (with-directory-excursion "easymock/src/test/java/org/easymock"
5948 ;; This test depends on dexmaker.
5949 (delete-file "tests2/ClassExtensionHelperTest.java")
5950 ;; This is not a test.
5951 (delete-file "tests/BaseEasyMockRunnerTest.java")
5952 ;; ...but deleting it means that we also have to delete these
5953 ;; dependent files.
5954 (delete-file "tests2/EasyMockRunnerTest.java")
5955 ;; This test fails because the file "easymock.properties" does
5956 ;; not exist.
5957 (delete-file "tests2/EasyMockPropertiesTest.java")))))))))
5958
5959(define-public java-easymock-class-extension
5960 (package
5961 (inherit java-easymock-3.2)
5962 (name "java-easymock-class-extension")
5963 (build-system ant-build-system)
5964 (arguments
5965 (list #:jar-name "easymock-class-extensions.jar"
5966 #:source-dir "easymock-classextension/src/main/java"
5967 #:test-dir "easymock-classextension/src/test"))
5968 (inputs (list java-asm-8
5969 java-easymock-3.2
5970 java-cglib
5971 java-objenesis))
5972 (native-inputs
5973 (list java-junit java-hamcrest-core))
5974 (home-page "https://easymock.org/")
5975 (synopsis "Easymock extension to mock classes")
5976 (description "This package provides an extension to earlier versions of
5977easymock that allows mocking classes.")
5978 (license license:asl2.0)))
5979
5980(define-public java-jmock-1
5981 (package
5982 (name "java-jmock")
5983 (version "1.2.0")
5984 (source (origin
5985 (method git-fetch)
5986 (uri (git-reference
5987 (url "https://github.com/jmock-developers/jmock-library")
5988 (commit version)))
5989 (file-name (git-file-name name version))
5990 (sha256
5991 (base32
5992 "0lkga995xd9b9mmzxmcd301hlw83p1h78nibh7djlx7wydscr85z"))))
5993 (build-system ant-build-system)
5994 (arguments
5995 `(#:build-target "jars"
5996 #:test-target "run.tests"
5997 #:phases
5998 (modify-phases %standard-phases
5999 (replace 'install (install-jars "build")))))
6000 (home-page "http://jmock.org/")
6001 (synopsis "Mock object library for test-driven development")
6002 (description "JMock is a library that supports test-driven development of
6003Java code with mock objects. Mock objects help you design and test the
6004interactions between the objects in your programs.
6005
6006The jMock library
6007
6008@itemize
6009@item makes it quick and easy to define mock objects
6010@item lets you precisely specify the interactions between
6011 your objects, reducing the brittleness of your tests
6012@item plugs into your favourite test framework
6013@item is easy to extend.
6014@end itemize\n")
6015 (license license:bsd-3)))
6016
6017(define-public java-jmock
6018 (package
6019 (inherit java-jmock-1)
6020 (name "java-jmock")
6021 (version "2.8.2")
6022 (source (origin
6023 (method git-fetch)
6024 (uri (git-reference
6025 (url "https://github.com/jmock-developers/jmock-library")
6026 (commit version)))
6027 (file-name (git-file-name name version))
6028 (sha256
6029 (base32
6030 "12b7l22g3nrjvf2dzcw3z03fpd2chrgp0d8xkvn8w55rwb57pax6"))))
6031 (inputs
6032 (list java-hamcrest-all java-bsh java-junit))
6033 (native-inputs
6034 `(("cglib" ,java-cglib)))
6035 (arguments
6036 `(#:jar-name "java-jmock.jar"
6037 #:source-dir "jmock/src/main/java"
6038 #:test-dir "jmock/src/test"))))
6039
6040(define-public java-jmock-junit4
6041 (package
6042 (inherit java-jmock)
6043 (name "java-jmock-junit4")
6044 (arguments
6045 `(#:jar-name "java-jmock-junit4.jar"
6046 #:source-dir "jmock-junit4/src/main/java"
6047 #:test-dir "jmock-junit4/src/test"))
6048 (inputs
6049 `(("java-hamcrest-all" ,java-hamcrest-all)
6050 ("java-bsh" ,java-bsh)
6051 ("java-jmock" ,java-jmock)
6052 ("java-jumit" ,java-junit)))))
6053
6054(define-public java-jmock-legacy
6055 (package
6056 (inherit java-jmock)
6057 (name "java-jmock-legacy")
6058 (arguments
6059 `(#:jar-name "java-jmock-legacy.jar"
6060 #:source-dir "jmock-legacy/src/main/java"
6061 #:test-dir "jmock-legacy/src/test"
6062 #:phases
6063 (modify-phases %standard-phases
6064 (add-before 'check 'copy-tests
6065 (lambda _
6066 ;; This file is a dependancy of some tests
6067 (let ((file "org/jmock/test/acceptance/PackageProtectedType.java"))
6068 (copy-file (string-append "jmock/src/test/java/" file)
6069 (string-append "jmock-legacy/src/test/java/" file))
6070 #t))))))
6071 (inputs
6072 (list java-hamcrest-all
6073 java-objenesis
6074 java-cglib
6075 java-jmock
6076 java-bsh
6077 java-junit))
6078 (native-inputs
6079 (list java-jmock-junit4))))
6080
6081(define-public java-hamcrest-all
6082 (package (inherit java-hamcrest-core)
6083 (name "java-hamcrest-all")
6084 (properties `((superseded . ,java-hamcrest)))
6085 (arguments
6086 `(#:jdk ,icedtea-8
6087 ,@(substitute-keyword-arguments (package-arguments java-hamcrest-core)
6088 ((#:build-target _) "bigjar")
6089 ((#:phases phases)
6090 `(modify-phases ,phases
6091 ;; Some build targets override the classpath, so we need to patch
6092 ;; the build.xml to ensure that required dependencies are on the
6093 ;; classpath.
6094 (add-after 'unpack 'patch-classpath-for-integration
6095 (lambda* (#:key inputs #:allow-other-keys)
6096 (substitute* "build.xml"
6097 ((" build/hamcrest-library-\\$\\{version\\}.jar" line)
6098 (string-join
6099 (cons line
6100 (append
6101 (find-files (assoc-ref inputs "java-junit") "\\.jar$")
6102 (find-files (assoc-ref inputs "java-jmock") "\\.jar$")
6103 (find-files (assoc-ref inputs "java-easymock") "\\.jar$")))
6104 ";"))
6105 (("build/hamcrest-core-\\$\\{version\\}\\.jar")
6106 (car (find-files (assoc-ref inputs "java-hamcrest-core")
6107 "jar$"))))
6108 #t))
6109 (replace 'install
6110 (lambda* (#:key outputs #:allow-other-keys)
6111 (let* ((target (string-append (assoc-ref outputs "out")
6112 "/share/java/"))
6113 (version-suffix
6114 ,(string-append
6115 "-" (package-version java-hamcrest-core) ".jar"))
6116 (install-without-version-suffix
6117 (lambda (jar)
6118 (copy-file jar
6119 (string-append target
6120 (basename jar version-suffix)
6121 ".jar")))))
6122 (mkdir-p target)
6123 (for-each
6124 install-without-version-suffix
6125 (find-files "build"
6126 (lambda (name _)
6127 (and (string-suffix? ".jar" name)
6128 (not (string-suffix? "-sources.jar" name)))))))
6129 #t)))))))
6130 (inputs
6131 (modify-inputs inputs
6132 (prepend java-junit
6133 java-jmock-1
6134 ;; This is necessary because of what seems to be a race condition.
6135 ;; This package would sometimes fail to build because hamcrest-core.jar
6136 ;; could not be found, even though it is built as part of this package.
6137 ;; Adding java-hamcrest-core appears to fix this problem. See
6138 ;; https://debbugs.gnu.org/31390 for more information.
6139 java-hamcrest-core
6140 java-easymock)))))
6141
6142(define-public java-jopt-simple
6143 (package
6144 (name "java-jopt-simple")
6145 (version "5.0.3")
6146 (source (origin
6147 (method url-fetch)
6148 (uri (string-append "https://repo1.maven.org/maven2/"
6149 "net/sf/jopt-simple/jopt-simple/"
6150 version "/jopt-simple-"
6151 version "-sources.jar"))
6152 (sha256
6153 (base32
6154 "1v8bzmwmw6qq20gm42xyay6vrd567dra4vqwhgjnqqjz1gs9f8qa"))))
6155 (build-system ant-build-system)
6156 (arguments
6157 `(#:tests? #f ; there are no tests
6158 #:jar-name "jopt-simple.jar"
6159 #:phases
6160 (modify-phases %standard-phases
6161 (add-before 'install 'create-pom
6162 (generate-pom.xml "pom.xml" "net.sf.jopt-simple" "jopt-simple" ,version))
6163 (replace 'install
6164 (install-from-pom "pom.xml")))))
6165 (home-page "https://jopt-simple.github.io/jopt-simple/")
6166 (synopsis "Java library for parsing command line options")
6167 (description "JOpt Simple is a Java library for parsing command line
6168options, such as those you might pass to an invocation of @code{javac}. In
6169the interest of striving for simplicity, as closely as possible JOpt Simple
6170attempts to honor the command line option syntaxes of POSIX @code{getopt} and
6171GNU @code{getopt_long}. It also aims to make option parser configuration and
6172retrieval of options and their arguments simple and expressive, without being
6173overly clever.")
6174 (license license:expat)))
6175
6176;; Required by jmh
6177(define-public java-jopt-simple-4
6178 (package
6179 (inherit java-jopt-simple)
6180 (version "4.6")
6181 (source (origin
6182 (method url-fetch)
6183 (uri (string-append "https://repo1.maven.org/maven2/"
6184 "net/sf/jopt-simple/jopt-simple/"
6185 version "/jopt-simple-"
6186 version "-sources.jar"))
6187 (sha256
6188 (base32
6189 "0ny82zczxkn201ld0b7rps0ifzjhfs8m1ncdmy1f50145ciszkpd"))))
6190 (arguments
6191 (substitute-keyword-arguments (package-arguments java-jopt-simple)
6192 ((#:phases phases)
6193 `(modify-phases ,phases
6194 (replace 'create-pom
6195 (generate-pom.xml "pom.xml" "net.sf.jopt-simple" "jopt-simple"
6196 ,version))))))))
6197
6198(define-public java-commons-math3
6199 (package
6200 (name "java-commons-math3")
6201 (version "3.6.1")
6202 (source (origin
6203 (method url-fetch)
6204 (uri (string-append "mirror://apache/commons/math/source/"
6205 "commons-math3-" version "-src.tar.gz"))
6206 (sha256
6207 (base32
6208 "19l6yp44qc5g7wg816nbn5z3zq3xxzwimvbm4a8pczgvpi4i85s6"))))
6209 (build-system ant-build-system)
6210 (arguments
6211 `(#:build-target "jar"
6212 #:test-target "test"
6213 #:make-flags
6214 ,#~(let ((hamcrest #$(this-package-native-input "java-hamcrest-core"))
6215 (junit #$(this-package-native-input "java-junit")))
6216 (list (string-append "-Djunit.jar="
6217 (car (find-files junit "jar$")))
6218 (string-append "-Dhamcrest.jar="
6219 (car (find-files hamcrest ".*.jar$")))))
6220 #:phases
6221 (modify-phases %standard-phases
6222 ;; We want to build the jar in the build phase and run the tests
6223 ;; later in a separate phase.
6224 (add-after 'unpack 'untangle-targets
6225 (lambda _
6226 (substitute* "build.xml"
6227 (("name=\"jar\" depends=\"test\"")
6228 "name=\"jar\" depends=\"compile\""))))
6229 ;; There is no install target.
6230 (replace 'install
6231 (install-from-pom "pom.xml")))))
6232 (native-inputs
6233 (list java-junit java-hamcrest-core))
6234 (home-page "https://commons.apache.org/math/")
6235 (synopsis "Apache Commons mathematics library")
6236 (description "Commons Math is a library of lightweight, self-contained
6237mathematics and statistics components addressing the most common problems not
6238available in the Java programming language or Commons Lang.")
6239 (license license:asl2.0)))
6240
6241(define-public java-jmh
6242 (package
6243 (name "java-jmh")
6244 (version "1.32")
6245 (source (origin
6246 (method git-fetch)
6247 (uri (git-reference
6248 (url "https://github.com/openjdk/jmh")
6249 (commit version)))
6250 (file-name (git-file-name name version))
6251 (sha256
6252 (base32
6253 "0i7fa7l3gdqkkgz5ddayp6m46dgbj9rqlz35xffrcbyiz3gpljy0"))))
6254 (build-system maven-build-system)
6255 (arguments
6256 `(#:exclude
6257 (("org.apache.maven.plugins" .
6258 ("maven-source-plugin" "maven-archetype-plugin" "maven-shade-plugin"
6259 "maven-site-plugin" "maven-javadoc-plugin" "maven-eclipse-plugin"))
6260 ("com.mycila.maven-license-plugin" . ("maven-license-plugin"))
6261 ("org.apache.maven.wagon" . ("wagon-ssh")))
6262 #:maven-plugins
6263 (("maven-enforcer-plugin" ,maven-enforcer-plugin)
6264 ,@(default-maven-plugins))
6265 #:phases
6266 (modify-phases %standard-phases
6267 (add-after 'unpack 'remove-unnecessary
6268 (lambda _
6269 ;; requires org.apache.maven.archetype:archetype-packaging.
6270 ;; Its subprojects also require groovy, kotlin and scala,
6271 ;; respectively.
6272 (delete-file-recursively "jmh-archetypes"))))))
6273 (propagated-inputs
6274 (list java-jopt-simple-4 java-commons-math3))
6275 (native-inputs
6276 (list java-junit java-hamcrest-core))
6277 (home-page "https://openjdk.java.net/projects/code-tools/jmh/")
6278 (synopsis "Benchmark harness for the JVM")
6279 (description "JMH is a Java harness for building, running, and analysing
6280nano/micro/milli/macro benchmarks written in Java and other languages
6281targeting the JVM.")
6282 ;; GPLv2 only
6283 (license license:gpl2)))
6284
6285(define-public java-commons-collections4
6286 (package
6287 (name "java-commons-collections4")
6288 (version "4.1")
6289 (source (origin
6290 (method url-fetch)
6291 (uri (string-append "mirror://apache/commons/collections/source/"
6292 "commons-collections4-" version "-src.tar.gz"))
6293 (sha256
6294 (base32
6295 "1krfhvggympq4avk7gh6qafzf6b9ip6r1m4lmacikyx04039m0wl"))))
6296 (build-system ant-build-system)
6297 (arguments
6298 `(#:test-target "test"
6299 #:make-flags
6300 ,#~(let ((hamcrest #$(this-package-native-input "java-hamcrest-core"))
6301 (junit #$(this-package-native-input "java-junit"))
6302 (easymock #$(this-package-native-input "java-easymock")))
6303 (list (string-append "-Djunit.jar="
6304 (car (find-files junit "jar$")))
6305 (string-append "-Dhamcrest.jar="
6306 (car (find-files hamcrest "jar$")))
6307 (string-append "-Deasymock.jar=" easymock
6308 "/share/java/easymock.jar")))
6309 #:phases
6310 (modify-phases %standard-phases
6311 (replace 'install
6312 (install-jars "target")))))
6313 (native-inputs
6314 (list java-junit java-hamcrest-core java-easymock))
6315 (home-page "https://commons.apache.org/collections/")
6316 (synopsis "Collections framework")
6317 (description "The Java Collections Framework is the recognised standard
6318for collection handling in Java. Commons-Collections seek to build upon the
6319JDK classes by providing new interfaces, implementations and utilities. There
6320are many features, including:
6321
6322@itemize
6323@item @code{Bag} interface for collections that have a number of copies of
6324 each object
6325@item @code{BidiMap} interface for maps that can be looked up from value to
6326 key as well and key to value
6327@item @code{MapIterator} interface to provide simple and quick iteration over
6328 maps
6329@item Transforming decorators that alter each object as it is added to the
6330 collection
6331@item Composite collections that make multiple collections look like one
6332@item Ordered maps and sets that retain the order elements are added in,
6333 including an LRU based map
6334@item Reference map that allows keys and/or values to be garbage collected
6335 under close control
6336@item Many comparator implementations
6337@item Many iterator implementations
6338@item Adapter classes from array and enumerations to collections
6339@item Utilities to test or create typical set-theory properties of collections
6340 such as union, intersection, and closure.
6341@end itemize\n")
6342 (license license:asl2.0)))
6343
6344(define-public java-commons-collections
6345 (package
6346 (inherit java-commons-collections4)
6347 (name "java-commons-collections")
6348 (version "3.2.2")
6349 (source (origin
6350 (method url-fetch)
6351 (uri (string-append "mirror://apache/commons/collections/source/"
6352 "commons-collections-" version "-src.tar.gz"))
6353 (sha256
6354 (base32
6355 "055r51a5lfc3z7rkxnxmnn1npvkvda7636hjpm4qk7cnfzz98387"))
6356 (patches
6357 (search-patches "java-commons-collections-fix-java8.patch"))))
6358 (arguments
6359 (substitute-keyword-arguments (package-arguments java-commons-collections4)
6360 ((#:phases phases)
6361 `(modify-phases ,phases
6362 ;; The manifest is required by the build procedure
6363 (add-before 'build 'add-manifest
6364 (lambda _
6365 (mkdir-p "build/conf")
6366 (call-with-output-file "build/conf/MANIFEST.MF"
6367 (lambda (file)
6368 (format file "Manifest-Version: 1.0\n")))
6369 #t))
6370 (replace 'install
6371 (install-jars "build"))))))))
6372
6373(define java-commons-collections-test-classes
6374 (package
6375 (inherit java-commons-collections)
6376 (arguments
6377 `(#:jar-name "commons-collections-test-classes.jar"
6378 #:source-dir "src/test"
6379 #:tests? #f))
6380 (inputs
6381 `(("collection" ,java-commons-collections)))))
6382
6383(define-public java-commons-beanutils
6384 (package
6385 (name "java-commons-beanutils")
6386 (version "1.9.3")
6387 (source (origin
6388 (method url-fetch)
6389 (uri (string-append "mirror://apache/commons/beanutils/source/"
6390 "commons-beanutils-" version "-src.tar.gz"))
6391 (sha256
6392 (base32
6393 "03cs0bq3sl1sdc7py9g3qnf8n9h473nrkvd3d251kaqv6a2ab7qk"))))
6394 (build-system ant-build-system)
6395 (arguments
6396 `(#:test-target "test"
6397 #:tests? #f
6398 #:phases
6399 (modify-phases %standard-phases
6400 (replace 'install
6401 (lambda* (#:key outputs #:allow-other-keys)
6402 (rename-file (string-append "dist/commons-beanutils-" ,version
6403 "-SNAPSHOT.jar")
6404 "commons-beanutils.jar")
6405 (install-file "commons-beanutils.jar"
6406 (string-append (assoc-ref outputs "out") "/share/java/"))
6407 #t)))))
6408 (inputs
6409 `(("logging" ,java-commons-logging-minimal)
6410 ("collections" ,java-commons-collections)))
6411 (native-inputs
6412 `(("junit" ,java-junit)
6413 ("collections-test" ,java-commons-collections-test-classes)))
6414 (home-page "https://commons.apache.org/beanutils/")
6415 (synopsis "Dynamically set or get properties in Java")
6416 (description "BeanUtils provides a simplified interface to reflection and
6417introspection to set or get dynamically determined properties through their
6418setter and getter method.")
6419 (license license:asl2.0)))
6420
6421(define-public java-commons-io
6422 (package
6423 (name "java-commons-io")
6424 (version "2.5")
6425 (source
6426 (origin
6427 (method url-fetch)
6428 (uri (string-append "mirror://apache/commons/io/source/"
6429 "commons-io-" version "-src.tar.gz"))
6430 (sha256
6431 (base32
6432 "0q5y41jrcjvx9hzs47x5kdhnasdy6rm4bzqd2jxl02w717m7a7v3"))))
6433 (build-system ant-build-system)
6434 (outputs '("out" "doc"))
6435 (arguments
6436 `(#:test-target "test"
6437 #:make-flags
6438 ,#~(list (string-append "-Djunit.jar="
6439 (car (find-files #$(this-package-native-input "java-junit")
6440 "jar$"))))
6441 #:phases
6442 (modify-phases %standard-phases
6443 (add-after 'build 'build-javadoc ant-build-javadoc)
6444 (replace 'install (install-from-pom "pom.xml"))
6445 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
6446 (native-inputs
6447 (list java-junit java-hamcrest-core))
6448 (propagated-inputs
6449 (list apache-commons-parent-pom-39))
6450 (home-page "https://commons.apache.org/io/")
6451 (synopsis "Common useful IO related classes")
6452 (description "Commons-IO contains utility classes, stream implementations,
6453file filters and endian classes.")
6454 (license license:asl2.0)))
6455
6456(define-public java-commons-io-latest
6457 (package
6458 (inherit java-commons-io)
6459 (version "2.21.0")
6460 (source
6461 (origin
6462 (method url-fetch)
6463 (uri (string-append "mirror://apache/commons/io/source/"
6464 "commons-io-" version "-src.tar.gz"))
6465 (sha256
6466 (base32
6467 "0rr6hb8mm7fd6nrr8f81mvdpfalq01k03l3mzrlxx7g7lda40mb3"))))
6468 (outputs '("out"))
6469 (arguments
6470 `(#:tests? #f ;; tests require too many not yet packaged packages
6471 #:source-dir "src/main/java"
6472 #:jar-name "commons-io.jar"
6473 #:phases
6474 (modify-phases %standard-phases
6475 (replace 'install (install-from-pom "pom.xml")))))
6476 (native-inputs
6477 (list))
6478 (propagated-inputs
6479 (list apache-commons-parent-pom-78))))
6480
6481(define-public java-commons-exec-1.1
6482 (package
6483 (name "java-commons-exec")
6484 (version "1.1")
6485 (source
6486 (origin
6487 (method url-fetch)
6488 (uri (string-append "mirror://apache/commons/exec/source/"
6489 "commons-exec-" version "-src.tar.gz"))
6490 (sha256
6491 (base32
6492 "025dk8xgj10lxwwwqp0hng2rn7fr4vcirxzydqzx9k4dim667alk"))))
6493 (build-system ant-build-system)
6494 (arguments
6495 `(#:test-target "test"
6496 #:make-flags
6497 ,#~(list (string-append "-Dmaven.junit.jar="
6498 (car (find-files #$(this-package-native-input "java-junit")
6499 "jar$"))))
6500 #:phases
6501 (modify-phases %standard-phases
6502 (add-before 'build 'delete-network-tests
6503 (lambda _
6504 (delete-file "src/test/java/org/apache/commons/exec/DefaultExecutorTest.java")
6505 (substitute* "src/test/java/org/apache/commons/exec/TestRunner.java"
6506 (("suite\\.addTestSuite\\(DefaultExecutorTest\\.class\\);") ""))
6507 #t))
6508 ;; The "build" phase automatically tests.
6509 (delete 'check)
6510 (replace 'install (install-jars "target")))))
6511 (native-inputs
6512 (list java-junit))
6513 (home-page "https://commons.apache.org/proper/commons-exec/")
6514 (synopsis "Common program execution related classes")
6515 (description "Commons-Exec simplifies executing external processes.")
6516 (license license:asl2.0)))
6517
6518(define-public java-commons-exec
6519 (package
6520 (inherit java-commons-exec-1.1)
6521 (version "1.3")
6522 (source
6523 (origin
6524 (method url-fetch)
6525 (uri (string-append "mirror://apache/commons/exec/source/"
6526 "commons-exec-" version "-src.tar.gz"))
6527 (sha256
6528 (base32
6529 "17yb4h6f8l49c5iyyvda4z2nmw0bxrx857nrwmsr7mmpb7x441yv"))))
6530 (arguments
6531 `(#:test-target "test"
6532 #:make-flags
6533 ,#~(list (string-append "-Dmaven.junit.jar="
6534 (car (find-files #$(this-package-native-input "java-junit")
6535 "jar$")))
6536 "-Dmaven.compiler.source=1.7"
6537 "-Dmaven.compiler.target=1.7")
6538 #:phases
6539 (modify-phases %standard-phases
6540 (add-before 'build 'delete-network-tests
6541 (lambda* (#:key inputs #:allow-other-keys)
6542 ;; This test hangs indefinitely.
6543 (delete-file "src/test/java/org/apache/commons/exec/issues/Exec60Test.java")
6544 (substitute* "src/test/java/org/apache/commons/exec/issues/Exec41Test.java"
6545 (("ping -c 10 127.0.0.1") "sleep 10"))
6546 (substitute* "src/test/java/org/apache/commons/exec/issues/Exec49Test.java"
6547 (("/bin/ls") "ls"))
6548 (call-with-output-file "src/test/scripts/ping.sh"
6549 (lambda (port)
6550 (format port "#!~a/bin/sh\nsleep $1\n"
6551 (assoc-ref inputs "bash"))))
6552 #t))
6553 ;; The "build" phase automatically tests.
6554 (delete 'check)
6555 (replace 'install (install-jars "target")))))
6556 (native-inputs
6557 (list java-junit java-hamcrest-core))))
6558
6559(define-public java-commons-lang
6560 (package
6561 (name "java-commons-lang")
6562 (version "2.6")
6563 (source
6564 (origin
6565 (method url-fetch)
6566 (uri (string-append "mirror://apache/commons/lang/source/"
6567 "commons-lang-" version "-src.tar.gz"))
6568 (sha256
6569 (base32 "1mxwagqadzx1b2al7i0z1v0r235aj2njdyijf02szq0vhmqrfiq5"))))
6570 (build-system ant-build-system)
6571 (outputs '("out" "doc"))
6572 (arguments
6573 `(#:test-target "test"
6574 #:test-exclude (list "**/Abstract*.java" "**/Random*.java")
6575 #:phases
6576 (modify-phases %standard-phases
6577 (add-after 'build 'build-javadoc ant-build-javadoc)
6578 (add-before 'check 'disable-failing-test
6579 (lambda _
6580 ;; Disable a failing test
6581 (substitute* "src/test/java/org/apache/commons/lang/\
6582time/FastDateFormatTest.java"
6583 (("public void testFormat\\(\\)")
6584 "public void disabled_testFormat()"))
6585 #t))
6586 (replace 'install (install-jars "target"))
6587 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
6588 (native-inputs
6589 (list java-junit))
6590 (home-page "https://commons.apache.org/lang/")
6591 (synopsis "Extension of the java.lang package")
6592 (description "The Commons Lang components contains a set of Java classes
6593that provide helper methods for standard Java classes, especially those found
6594in the @code{java.lang} package in the Sun JDK. The following classes are
6595included:
6596
6597@itemize
6598@item StringUtils - Helper for @code{java.lang.String}.
6599@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets
6600 of characters such as @code{[a-z]} and @code{[abcdez]}.
6601@item RandomStringUtils - Helper for creating randomised strings.
6602@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
6603@item NumberRange - A range of numbers with an upper and lower bound.
6604@item ObjectUtils - Helper for @code{java.lang.Object}.
6605@item SerializationUtils - Helper for serializing objects.
6606@item SystemUtils - Utility class defining the Java system properties.
6607@item NestedException package - A sub-package for the creation of nested
6608 exceptions.
6609@item Enum package - A sub-package for the creation of enumerated types.
6610@item Builder package - A sub-package for the creation of @code{equals},
6611 @code{hashCode}, @code{compareTo} and @code{toString} methods.
6612@end itemize\n")
6613 (license license:asl2.0)))
6614
6615(define-public java-commons-lang3
6616 (package
6617 (name "java-commons-lang3")
6618 (version "3.20.0")
6619 (source
6620 (origin
6621 (method url-fetch)
6622 (uri (string-append "mirror://apache/commons/lang/source/"
6623 "commons-lang3-" version "-src.tar.gz"))
6624 (sha256
6625 (base32 "05b2zfmw1y6bnzf7v32zkhix0c0sab82lmr3ilxciza0l5w6nwya"))))
6626 (build-system ant-build-system)
6627 (arguments
6628 `(#:jar-name "commons-lang3.jar"
6629 #:source-dir "src/main/java"
6630 #:tests? #f; require junit5
6631 #:phases
6632 (modify-phases %standard-phases
6633 (replace 'install (install-from-pom "pom.xml")))))
6634 (propagated-inputs
6635 (list apache-commons-parent-pom-92))
6636 (home-page "https://commons.apache.org/lang/")
6637 (synopsis "Extension of the java.lang package")
6638 (description "The Commons Lang components contains a set of Java classes
6639that provide helper methods for standard Java classes, especially those found
6640in the @code{java.lang} package. The following classes are included:
6641
6642@itemize
6643@item StringUtils - Helper for @code{java.lang.String}.
6644@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets of
6645 characters such as @code{[a-z]} and @code{[abcdez]}.
6646@item RandomStringUtils - Helper for creating randomised strings.
6647@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
6648@item NumberRange - A range of numbers with an upper and lower bound.
6649@item ObjectUtils - Helper for @code{java.lang.Object}.
6650@item SerializationUtils - Helper for serializing objects.
6651@item SystemUtils - Utility class defining the Java system properties.
6652@item NestedException package - A sub-package for the creation of nested
6653 exceptions.
6654@item Enum package - A sub-package for the creation of enumerated types.
6655@item Builder package - A sub-package for the creation of @code{equals},
6656 @code{hashCode}, @code{compareTo} and @code{toString} methods.
6657@end itemize\n")
6658 (license license:asl2.0)))
6659
6660(define-public java-commons-bsf
6661 (package
6662 (name "java-commons-bsf")
6663 (version "2.4.0")
6664 (source (origin
6665 (method url-fetch)
6666 (uri (string-append "mirror://apache/commons/bsf/source/bsf-src-"
6667 version ".tar.gz"))
6668 (sha256
6669 (base32
6670 "1sbamr8jl32p1jgf59nw0b2w9qivyg145954hm6ly54cfgsqrdas"))
6671 (modules '((guix build utils)))
6672 (snippet
6673 '(begin
6674 (for-each delete-file
6675 (find-files "." "\\.jar$"))
6676 #t))))
6677 (build-system ant-build-system)
6678 (arguments
6679 `(#:build-target "jar"
6680 #:tests? #f; No test file
6681 #:modules ((guix build ant-build-system)
6682 (guix build utils)
6683 (guix build java-utils)
6684 (sxml simple))
6685 #:phases
6686 (modify-phases %standard-phases
6687 (add-before 'build 'create-properties
6688 (lambda _
6689 ;; This file is missing from the distribution
6690 (call-with-output-file "build-properties.xml"
6691 (lambda (port)
6692 (sxml->xml
6693 `(project (@ (basedir ".") (name "build-properties") (default ""))
6694 (property (@ (name "project.name") (value "bsf")))
6695 (property (@ (name "source.level") (value "1.5")))
6696 (property (@ (name "build.lib") (value "build/jar")))
6697 (property (@ (name "src.dir") (value "src")))
6698 (property (@ (name "tests.dir") (value "src/org/apache/bsf/test")))
6699 (property (@ (name "build.tests") (value "build/test-classes")))
6700 (property (@ (name "build.dest") (value "build/classes"))))
6701 port)))
6702 #t))
6703 (replace 'install (install-jars "build")))))
6704 (native-inputs
6705 (list java-junit))
6706 (inputs
6707 (list java-commons-logging-minimal))
6708 (home-page "https://commons.apache.org/proper/commons-bsf")
6709 (synopsis "Bean Scripting Framework")
6710 (description "The Bean Scripting Framework (BSF) is a set of Java classes
6711which provides scripting language support within Java applications, and access
6712to Java objects and methods from scripting languages. BSF allows one to write
6713JSPs in languages other than Java while providing access to the Java class
6714library. In addition, BSF permits any Java application to be implemented in
6715part (or dynamically extended) by a language that is embedded within it. This
6716is achieved by providing an API that permits calling scripting language engines
6717from within Java, as well as an object registry that exposes Java objects to
6718these scripting language engines.")
6719 (properties '((upstream-name . "bsf")))
6720 (license license:asl2.0)))
6721
6722(define-public java-commons-jxpath
6723 (package
6724 (name "java-commons-jxpath")
6725 (version "1.3")
6726 (source (origin
6727 (method url-fetch)
6728 (uri (string-append "mirror://apache/commons/jxpath/source/"
6729 "commons-jxpath-" version "-src.tar.gz"))
6730 (sha256
6731 (base32
6732 "1rpgg31ayn9fwr4bfi2i1ij0npcg79ad2fv0w9hacvawsyc42cfs"))))
6733 (build-system ant-build-system)
6734 (arguments
6735 `(#:jar-name "commons-jxpath.jar"
6736 ;; tests require more dependencies, including mockrunner which depends on old software
6737 #:tests? #f
6738 #:source-dir "src/java"))
6739 (inputs
6740 `(("servlet" ,java-classpathx-servletapi)
6741 ("java-jdom" ,java-jdom)
6742 ("java-commons-beanutils" ,java-commons-beanutils)))
6743 (native-inputs
6744 (list java-junit))
6745 (home-page "https://commons.apache.org/jxpath/")
6746 (synopsis "Simple interpreter of an expression language called XPath")
6747 (description "The org.apache.commons.jxpath package defines a simple
6748interpreter of an expression language called XPath. JXPath applies XPath
6749expressions to graphs of objects of all kinds: JavaBeans, Maps, Servlet
6750contexts, DOM etc, including mixtures thereof.")
6751 (license license:asl2.0)))
6752
6753(define-public java-commons-pool
6754 (package
6755 (name "java-commons-pool")
6756 (version "2.6.2")
6757 (source (origin
6758 (method url-fetch)
6759 (uri (string-append "mirror://apache/commons/pool/source/"
6760 "commons-pool2-" version "-src.tar.gz"))
6761 (sha256
6762 (base32
6763 "1fi1hgqmq01bs6azbj3sfswxzadp2r8sjjfiq6ryilz1m50kvrv6"))))
6764 (arguments
6765 `(#:jar-name "common-pool.jar"
6766 #:source-dir "src/main/java"
6767 #:test-exclude
6768 (list "**/PerformanceTest.java")))
6769 (build-system ant-build-system)
6770 (inputs
6771 (list java-cglib))
6772 (native-inputs
6773 (list java-junit java-hamcrest-core java-asm java-objenesis))
6774 (home-page "https://commons.apache.org/proper/commons-pool/")
6775 (synopsis "Object-pooling API in Java")
6776 (description "The commons-pool package provides an object-pooling API
6777and a number of object pool implementations. This package defines a
6778handful of pooling interfaces and some base classes that may be useful when
6779creating new pool implementations.")
6780 (properties '((upstream-name . "commons-pool2")))
6781 (license license:asl2.0)))
6782
6783(define-public java-commons-dbcp
6784 (package
6785 (name "java-commons-dbcp")
6786 (version "2.6.0")
6787 (source (origin
6788 (method url-fetch)
6789 (uri (string-append "mirror://apache/commons/dbcp/source/"
6790 "commons-dbcp2-" version "-src.tar.gz"))
6791 (sha256
6792 (base32
6793 "0axbvcbnf2l70fc3ybrlp3siw2w4ka9mia2pnx4py8gz54cpw3rc"))))
6794 (arguments
6795 `(#:source-dir "src/main/java"
6796 #:jar-name "java-commons-dbcp.jar"
6797 #:tests? #f)); requires apache-geronimo
6798 (inputs
6799 `(("java-commons-pool" ,java-commons-pool)
6800 ("java-commons-logging" ,java-commons-logging-minimal)
6801 ("java-jboss-transaction-api-spec" ,java-jboss-transaction-api-spec)))
6802 (native-inputs
6803 (list java-junit))
6804 (build-system ant-build-system)
6805 (home-page "https://commons.apache.org/proper/commons-dbcp/")
6806 (synopsis "Database Connection Pool for Java")
6807 (description "Commons-dbcp allows you to share a pool of database
6808connections between users. Creating a new connection for each user can be
6809time consuming and even unfeasible when the number of simultaneous users is
6810very large. This package provides a way to share a poole of connections to
6811reduce that load.")
6812 (properties '((upstream-name . "commons-dbcp2")))
6813 (license license:asl2.0)))
6814
6815(define-public java-commons-jcs
6816 (package
6817 (name "java-commons-jcs")
6818 (version "3.1")
6819 (source (origin
6820 (method url-fetch)
6821 (uri (string-append "mirror://apache/commons/jcs/source/"
6822 "commons-jcs3-dist-" version "-src.tar.gz"))
6823 (sha256
6824 (base32
6825 "0y1lm1xnsj99bf7y9mkvbzqfy8dr7ac8zcbkpsjgzb9vhabfsbac"))))
6826 (build-system ant-build-system)
6827 (arguments
6828 `(#:jar-name "commons-jcs.jar"
6829 #:source-dir "commons-jcs-core/src/main/java"
6830 #:test-dir "commons-jcs-core/src/test"
6831 #:tests? #f; requires hsqldb
6832 #:phases
6833 (modify-phases %standard-phases
6834 (add-before 'build 'copy-resources
6835 (lambda _
6836 (copy-recursively "commons-jcs-core/src/main/resources"
6837 "build/classes"))))))
6838 (propagated-inputs
6839 (list java-classpathx-servletapi
6840 java-commons-dbcp
6841 java-httpcomponents-httpclient
6842 java-httpcomponents-httpcore
6843 java-log4j-api))
6844 (native-inputs
6845 (list java-junit))
6846 (home-page "https://commons.apache.org/proper/commons-jcs/")
6847 (synopsis "Distributed caching system in Java")
6848 (description "JCS is a distributed caching system written in Java. It
6849is intended to speed up applications by providing a means to manage cached
6850data of various dynamic natures. Like any caching system, JCS is most useful
6851for high read, low put applications. Latency times drop sharply and
6852bottlenecks move away from the database in an effectively cached system.")
6853 (properties '((upstream-name . "commons-jcs3-dist")))
6854 (license license:asl2.0)))
6855
6856(define-public java-jsr250
6857 (package
6858 (name "java-jsr250")
6859 (version "1.3")
6860 (source (origin
6861 (method git-fetch)
6862 (uri (git-reference
6863 (url "https://github.com/javaee/javax.annotation")
6864 (commit version)))
6865 (file-name (git-file-name name version))
6866 (sha256
6867 (base32
6868 "1g22a9d75g01s9yxgdig0ss7i30j4ysnnp08gn4krn0wly4lpqq0"))))
6869 (build-system ant-build-system)
6870 (arguments
6871 `(#:tests? #f ; no tests included
6872 #:jdk ,icedtea-8
6873 #:jar-name "jsr250.jar"
6874 #:phases
6875 (modify-phases %standard-phases
6876 (replace 'install
6877 (install-from-pom "pom.xml")))))
6878 (propagated-inputs (list java-jvnet-parent-pom-3))
6879 (home-page "https://jcp.org/en/jsr/detail?id=250")
6880 (synopsis "Security-related annotations")
6881 (description "This package provides annotations for security. It provides
6882packages in the @code{javax.annotation} and @code{javax.annotation.security}
6883namespaces.")
6884 ;; either cddl or gpl2 only, with classpath exception
6885 (license (list license:cddl1.0
6886 license:gpl2))))
6887
6888(define-public java-jsr305
6889 (package
6890 (name "java-jsr305")
6891 (version "3.0.1")
6892 (source (origin
6893 (method url-fetch)
6894 (uri (string-append "https://repo1.maven.org/maven2/"
6895 "com/google/code/findbugs/"
6896 "jsr305/" version "/jsr305-"
6897 version "-sources.jar"))
6898 (sha256
6899 (base32
6900 "1rh6jin9v7jqpq3kf1swl868l8i94r636n03pzpsmgr8v0lh9j2n"))))
6901 (build-system ant-build-system)
6902 (arguments
6903 `(#:tests? #f ; no tests included
6904 #:jar-name "jsr305.jar"
6905 #:phases
6906 (modify-phases %standard-phases
6907 (add-before 'install 'create-pom
6908 (generate-pom.xml "pom.xml" "com.google.code.findbugs" "jsr305" ,version))
6909 (replace 'install
6910 (install-from-pom "pom.xml")))))
6911 (home-page "https://findbugs.sourceforge.net/")
6912 (synopsis "Annotations for the static analyzer called findbugs")
6913 (description "This package provides annotations for the findbugs package.
6914It provides packages in the @code{javax.annotations} namespace.")
6915 (license license:asl2.0)))
6916
6917(define-public java-error-prone-annotations
6918 (package
6919 (name "java-error-prone-annotations")
6920 (version "2.18.0")
6921 (source (origin
6922 (method git-fetch)
6923 (uri (git-reference
6924 (url "https://github.com/google/error-prone")
6925 (commit (string-append "v" version))))
6926 (file-name (git-file-name "java-error-prone" version))
6927 (sha256
6928 (base32
6929 "19sqsz0b308rhadr3ff10azdbqjq37nvrn9c06224dwpxap0931f"))))
6930 (build-system ant-build-system)
6931 (arguments
6932 `(#:tests? #f; no tests
6933 #:jar-name (string-append ,name "-" ,version ".jar")
6934 #:source-dir "annotations/src/main/java"
6935 #:test-dir "annotations/src/altest"
6936 #:phases
6937 (modify-phases %standard-phases
6938 (replace 'install (install-from-pom "annotations/pom.xml")))))
6939 (propagated-inputs (list java-error-prone-parent-pom java-jsr305))
6940 (home-page "https://errorprone.info")
6941 (synopsis "Java static analyzer at compile-time")
6942 (description "Error Prone is a static analysis tool for Java that catches
6943common programming mistakes at compile-time. This package contains annotations
6944used by programmers to guide the static analysis.")
6945 (license license:asl2.0)))
6946
6947(define java-error-prone-parent-pom
6948 (package
6949 (inherit java-error-prone-annotations)
6950 (name "java-error-prone-parent-pom")
6951 (arguments
6952 `(#:tests? #f
6953 #:phases
6954 (modify-phases %standard-phases
6955 (delete 'configure)
6956 (delete 'build)
6957 (replace 'install
6958 (install-pom-file "pom.xml")))))
6959 (propagated-inputs '())))
6960
6961(define-public java-guava
6962 (package
6963 (name "java-guava")
6964 (version "31.1")
6965 (source (origin
6966 (method git-fetch)
6967 (uri (git-reference
6968 (url "https://github.com/google/guava/")
6969 (commit (string-append "v" version))))
6970 (file-name (git-file-name name version))
6971 (sha256
6972 (base32
6973 "0sv1w5cnids9ad3l7qhrh3dh1wdqwc946iinsxryafr25wg5z1lp"))
6974 (patches
6975 (search-patches "java-guava-remove-annotation-deps.patch"))))
6976 (build-system ant-build-system)
6977 (arguments
6978 `(#:tests? #f ; no tests included
6979 #:jar-name "guava.jar"
6980 #:source-dir "guava/src"
6981 #:phases
6982 (modify-phases %standard-phases
6983 (add-after 'unpack 'trim-sources
6984 (lambda _
6985 (with-directory-excursion "guava/src/com/google/common"
6986 ;; Remove annotations to avoid extra dependencies:
6987 ;; * "j2objc" annotations are used when converting Java to
6988 ;; Objective C;
6989 ;; * "IgnoreJRERequirement" is used for Android.
6990 ;; * "Nullable" is used to catch NPE at build time.
6991 (substitute* (find-files "." "\\.java$")
6992 (("import com.google.j2objc.*") "")
6993 (("import org.checkerframework.checker.*") "")
6994 (("@ReflectionSupport.*") "")
6995 (("@WeakOuter") "")
6996 (("@RetainedWith") "")
6997 (("@Weak") "")
6998 (("@J2ObjCIncompatible") "")
6999 (("@IgnoreJRERequirement") "")
7000 (("@Nullable") "")))))
7001 ;; This is required by guava, but this is just an empty stub
7002 (add-before 'install 'install-listenablefuture-stub
7003 (install-pom-file "futures/listenablefuture9999/pom.xml"))
7004 (replace 'install (install-from-pom "guava/pom.xml")))))
7005 (inputs
7006 (list java-error-prone-annotations java-jsr305))
7007 (propagated-inputs
7008 (list java-guava-futures-failureaccess java-guava-parent-pom))
7009 (home-page "https://github.com/google/guava")
7010 (synopsis "Google core libraries for Java")
7011 (description "Guava is a set of core libraries that includes new
7012collection types (such as multimap and multiset), immutable collections, a
7013graph library, functional types, an in-memory cache, and APIs/utilities for
7014concurrency, I/O, hashing, primitives, reflection, string processing, and much
7015more!")
7016 (license license:asl2.0)))
7017
7018(define-public java-guava-futures-failureaccess
7019 (package
7020 (inherit java-guava)
7021 (name "java-guava-futures-failureaccess")
7022 (arguments
7023 `(#:tests? #f; no tests
7024 #:jar-name "guava-futures-failureaccess.jar"
7025 #:source-dir "futures/failureaccess/src"
7026 #:phases
7027 (modify-phases %standard-phases
7028 (replace 'install
7029 (install-from-pom "futures/failureaccess/pom.xml")))))
7030 (propagated-inputs
7031 `(("java-sonatype-oss-parent-pom" ,java-sonatype-oss-parent-pom-7)))))
7032
7033(define java-guava-parent-pom
7034 (package
7035 (inherit java-guava)
7036 (name "java-guava-parent-pom")
7037 (arguments
7038 `(#:tests? #f
7039 #:phases
7040 (modify-phases %standard-phases
7041 (delete 'configure)
7042 (delete 'build)
7043 (replace 'install
7044 (install-pom-file "pom.xml")))))
7045 (propagated-inputs
7046 `(("java-sonatype-oss-parent-pom" ,java-sonatype-oss-parent-pom-7)))))
7047
7048;; The java-commons-logging package provides adapters to many different
7049;; logging frameworks. To avoid an excessive dependency graph we try to build
7050;; it with only a minimal set of adapters.
7051(define-public java-commons-logging-minimal
7052 (package
7053 (name "java-commons-logging-minimal")
7054 (version "1.2")
7055 (source (origin
7056 (method url-fetch)
7057 (uri (string-append "mirror://apache/commons/logging/source/"
7058 "commons-logging-" version "-src.tar.gz"))
7059 (sha256
7060 (base32
7061 "10bwcy5w8d7y39n0krlwhnp8ds3kj5zhmzj0zxnkw0qdlsjmsrj9"))))
7062 (build-system ant-build-system)
7063 (arguments
7064 `(#:tests? #f ; avoid dependency on logging frameworks
7065 #:jar-name "commons-logging-minimal.jar"
7066 #:phases
7067 (modify-phases %standard-phases
7068 (add-after 'unpack 'delete-adapters-and-tests
7069 (lambda _
7070 ;; Delete all adapters except for NoOpLog, SimpleLog, and
7071 ;; LogFactoryImpl. NoOpLog is required to build; LogFactoryImpl
7072 ;; is used by applications; SimpleLog is the only actually usable
7073 ;; implementation that does not depend on another logging
7074 ;; framework.
7075 (for-each
7076 (lambda (file)
7077 (delete-file (string-append
7078 "src/main/java/org/apache/commons/logging/impl/" file)))
7079 (list "Jdk13LumberjackLogger.java"
7080 "WeakHashtable.java"
7081 "Log4JLogger.java"
7082 "ServletContextCleaner.java"
7083 "Jdk14Logger.java"
7084 "AvalonLogger.java"
7085 "LogKitLogger.java"))
7086 (delete-file-recursively "src/test")
7087 #t)))))
7088 (home-page "https://commons.apache.org/logging/")
7089 (synopsis "Common API for logging implementations")
7090 (description "The Logging package is a thin bridge between different
7091logging implementations. A library that uses the commons-logging API can be
7092used with any logging implementation at runtime.")
7093 (properties '((upstream-name . "commons-logging")))
7094 (license license:asl2.0)))
7095
7096;; This is the last release of the 1.x series.
7097(define-public java-mockito-1
7098 (package
7099 (name "java-mockito")
7100 (version "1.10.19")
7101 (source (origin
7102 (method url-fetch)
7103 (uri (string-append "https://repo1.maven.org/maven2/"
7104 "org/mockito/mockito-core/" version
7105 "/mockito-core-" version "-sources.jar"))
7106 (sha256
7107 (base32
7108 "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc"))))
7109 (build-system ant-build-system)
7110 (arguments
7111 `(#:jar-name "mockito.jar"
7112 #:tests? #f ; no tests included
7113 ;; FIXME: patch-and-repack does not support jars, so we have to apply
7114 ;; patches in build phases.
7115 #:phases
7116 (modify-phases %standard-phases
7117 ;; Mockito was developed against a different version of hamcrest,
7118 ;; which does not require matcher implementations to provide an
7119 ;; implementation of the "describeMismatch" method. We add this
7120 ;; simple definition to pass the build with our version of hamcrest.
7121 (add-after 'unpack 'fix-hamcrest-build-error
7122 (lambda _
7123 (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java"
7124 (("public Matcher getActualMatcher\\(\\) .*" line)
7125 (string-append "
7126 public void describeMismatch(Object item, Description description) {
7127 actualMatcher.describeMismatch(item, description);
7128 }"
7129 line)))
7130 #t))
7131 ;; Mockito bundles cglib. We have a cglib package, so let's use
7132 ;; that instead.
7133 (add-after 'unpack 'use-system-libraries
7134 (lambda _
7135 (with-directory-excursion "src/org/mockito/internal/creation/cglib"
7136 (substitute* '("CGLIBHacker.java"
7137 "CglibMockMaker.java"
7138 "ClassImposterizer.java"
7139 "DelegatingMockitoMethodProxy.java"
7140 "MethodInterceptorFilter.java"
7141 "MockitoNamingPolicy.java"
7142 "SerializableMockitoMethodProxy.java"
7143 "SerializableNoOp.java")
7144 (("import org.mockito.cglib") "import net.sf.cglib")))
7145 #t)))))
7146 (inputs
7147 (list java-junit java-objenesis java-cglib java-hamcrest-core))
7148 (home-page "http://mockito.org")
7149 (synopsis "Mockito is a mock library for Java")
7150 (description "Mockito is a mocking library for Java which lets you write
7151tests with a clean and simple API. It generates mocks using reflection, and
7152it records all mock invocations, including methods arguments.")
7153 (license license:asl2.0)))
7154
7155(define-public java-httpcomponents-httpcore
7156 (package
7157 (name "java-httpcomponents-httpcore")
7158 (version "4.4.6")
7159 (source (origin
7160 (method url-fetch)
7161 (uri (string-append "mirror://apache/httpcomponents/httpcore/"
7162 "source/httpcomponents-core-"
7163 version "-src.tar.gz"))
7164 (sha256
7165 (base32
7166 "02bwcf38y4vgwq7kj2s6q7qrmma641r5lacivm16kgxvb2j6h1vy"))))
7167 (build-system ant-build-system)
7168 (arguments
7169 `(#:jar-name "httpcomponents-httpcore.jar"
7170 #:phases
7171 (modify-phases %standard-phases
7172 (add-after 'unpack 'chdir
7173 (lambda _ (chdir "httpcore") #t)))))
7174 (inputs
7175 (list java-commons-logging-minimal java-commons-lang3))
7176 (native-inputs
7177 (list java-junit java-mockito-1))
7178 (home-page "https://hc.apache.org/httpcomponents-core-4.4.x/index.html")
7179 (synopsis "Low level HTTP transport components")
7180 (description "HttpCore is a set of low level HTTP transport components
7181that can be used to build custom client and server side HTTP services with a
7182minimal footprint. HttpCore supports two I/O models: blocking I/O model based
7183on the classic Java I/O and non-blocking, event driven I/O model based on Java
7184NIO.
7185
7186This package provides the blocking I/O model library.")
7187 (license license:asl2.0)))
7188
7189(define-public java-httpcomponents-httpcore-nio
7190 (package (inherit java-httpcomponents-httpcore)
7191 (name "java-httpcomponents-httpcore-nio")
7192 (arguments
7193 `(#:jar-name "httpcomponents-httpcore-nio.jar"
7194 #:phases
7195 (modify-phases %standard-phases
7196 (add-after 'unpack 'chdir
7197 (lambda _ (chdir "httpcore-nio") #t)))))
7198 (inputs
7199 (modify-inputs inputs
7200 (prepend java-httpcomponents-httpcore java-hamcrest-core)))
7201 (description "HttpCore is a set of low level HTTP transport components
7202that can be used to build custom client and server side HTTP services with a
7203minimal footprint. HttpCore supports two I/O models: blocking I/O model based
7204on the classic Java I/O and non-blocking, event driven I/O model based on Java
7205NIO.
7206
7207This package provides the non-blocking I/O model library based on Java
7208NIO.")))
7209
7210(define-public java-httpcomponents-httpcore-ab
7211 (package (inherit java-httpcomponents-httpcore)
7212 (name "java-httpcomponents-httpcore-ab")
7213 (arguments
7214 `(#:jar-name "httpcomponents-httpcore-ab.jar"
7215 #:phases
7216 (modify-phases %standard-phases
7217 (add-after 'unpack 'chdir
7218 (lambda _ (chdir "httpcore-ab") #t)))))
7219 (inputs
7220 (modify-inputs inputs
7221 (prepend java-httpcomponents-httpcore java-commons-cli
7222 java-hamcrest-core)))
7223 (synopsis "Apache HttpCore benchmarking tool")
7224 (description "This package provides the HttpCore benchmarking tool. It is
7225an Apache AB clone based on HttpCore.")))
7226
7227(define-public java-httpcomponents-httpcore-osgi
7228 (package (inherit java-httpcomponents-httpcore)
7229 (name "java-httpcomponents-httpcore-osgi")
7230 (arguments
7231 `(#:jar-name "httpcomponents-httpcore-osgi.jar"
7232 #:phases
7233 (modify-phases %standard-phases
7234 (add-after 'unpack 'chdir
7235 (lambda _ (chdir "httpcore-osgi"))))))
7236 (inputs
7237 (modify-inputs inputs
7238 (prepend java-httpcomponents-httpcore
7239 java-httpcomponents-httpcore-nio
7240 java-hamcrest-core)))
7241 (native-inputs (list java-ops4j-pax-exam-core
7242 java-ops4j-pax-exam-core-junit
7243 java-ops4j-pax-exam-core-spi
7244 java-junit))
7245 (description "HttpCore is a set of low level HTTP transport components
7246that can be used to build custom client and server side HTTP services with a
7247minimal footprint. HttpCore supports two I/O models: blocking I/O model based
7248on the classic Java I/O and non-blocking, event driven I/O model based on Java
7249NIO.
7250
7251This package provides... some tests.")))
7252
7253(define-public java-httpcomponents-httpclient
7254 (package
7255 (name "java-httpcomponents-httpclient")
7256 (version "4.5.12")
7257 (source (origin
7258 (method url-fetch)
7259 (uri (string-append "mirror://apache/httpcomponents/httpclient/"
7260 "source/httpcomponents-client-"
7261 version "-src.tar.gz"))
7262 (sha256
7263 (base32
7264 "1va99m2zc2liv0v9vn72p5ja8yz4s5wq7zpahaai5nr966kvxzkb"))))
7265 (build-system ant-build-system)
7266 (arguments
7267 `(#:jar-name "httpcomponents-httpclient.jar"
7268 #:phases
7269 (modify-phases %standard-phases
7270 (add-after 'unpack 'chdir
7271 (lambda _ (chdir "httpclient") #t)))))
7272 (inputs
7273 (list java-commons-logging-minimal
7274 java-commons-codec
7275 java-hamcrest-core
7276 java-httpcomponents-httpcore
7277 java-mockito-1
7278 java-junit))
7279 (home-page "https://hc.apache.org/httpcomponents-client-ga/")
7280 (synopsis "HTTP client library for Java")
7281 (description "Although the @code{java.net} package provides basic
7282functionality for accessing resources via HTTP, it doesn't provide the full
7283flexibility or functionality needed by many applications. @code{HttpClient}
7284seeks to fill this void by providing an efficient, up-to-date, and
7285feature-rich package implementing the client side of the most recent HTTP
7286standards and recommendations.")
7287 (properties '((upstream-name . "httpcomponents-client")))
7288 (license license:asl2.0)))
7289
7290(define-public java-httpcomponents-httpclient-cache
7291 (package (inherit java-httpcomponents-httpclient)
7292 (name "java-httpcomponents-httpclient-cache")
7293 (arguments
7294 `(#:jar-name "httpcomponents-httpclient-cache.jar"
7295 #:source-dir "src/main/java"
7296 #:test-dir "src/test"
7297 #:tests? #f; tests are broken with current cglib.
7298 #:phases
7299 (modify-phases %standard-phases
7300 (add-after 'unpack 'delete-unused-impls
7301 (lambda _
7302 (for-each
7303 delete-file-recursively
7304 '("src/main/java/org/apache/http/impl/client/cache/ehcache/"
7305 "src/main/java/org/apache/http/impl/client/cache/memcached/"
7306 "src/test/java/org/apache/http/impl/client/cache/ehcache/"
7307 "src/test/java/org/apache/http/impl/client/cache/memcached/"))))
7308 (add-after 'unpack 'chdir
7309 (lambda _ (chdir "httpclient-cache"))))))
7310 (inputs
7311 (modify-inputs inputs
7312 (prepend java-httpcomponents-httpclient
7313 java-httpcomponents-httpmime
7314 java-hamcrest-core)))
7315 (description "This package provides an API for caching accessed HTTP
7316resources.")))
7317
7318(define-public java-httpcomponents-httpclient-osgi
7319 (package (inherit java-httpcomponents-httpclient)
7320 (name "java-httpcomponents-httpclient-osgi")
7321 (arguments
7322 `(#:jar-name "httpcomponents-httpclient-osgi.jar"
7323 #:tests? #f; tests are broken with current cglib.
7324 #:phases
7325 (modify-phases %standard-phases
7326 (add-after 'unpack 'chdir
7327 (lambda _ (chdir "httpclient-osgi") #t)))))
7328 (inputs
7329 (modify-inputs inputs
7330 (prepend java-httpcomponents-httpclient
7331 java-httpcomponents-httpclient-cache
7332 java-osgi-framework
7333 java-osgi-service-cm
7334 java-hamcrest-core)))))
7335
7336(define-public java-httpcomponents-httpmime
7337 (package (inherit java-httpcomponents-httpclient)
7338 (name "java-httpcomponents-httpmime")
7339 (arguments
7340 `(#:jar-name "httpcomponents-httpmime.jar"
7341 #:phases
7342 (modify-phases %standard-phases
7343 (add-after 'unpack 'chdir
7344 (lambda _ (chdir "httpmime") #t)))))
7345 (inputs
7346 (list java-httpcomponents-httpclient java-httpcomponents-httpcore
7347 java-junit java-hamcrest-core))))
7348
7349(define-public java-commons-net
7350 (package
7351 (name "java-commons-net")
7352 (version "3.6")
7353 (source (origin
7354 (method url-fetch)
7355 (uri (string-append "mirror://apache/commons/net/source/"
7356 "commons-net-" version "-src.tar.gz"))
7357 (sha256
7358 (base32
7359 "0n0cmnddk9qdqhjvka8pc6hd9mn2qi3166f1s6xk32h7rfy1adxr"))))
7360 (build-system ant-build-system)
7361 (arguments
7362 `(;; FIXME: MainTest.java tries to read "examples.properties" (which
7363 ;; should be "resources/examples/examples.properties"), but gets "null"
7364 ;; instead.
7365 #:tests? #f
7366 #:jar-name "commons-net.jar"))
7367 (native-inputs
7368 (list java-junit java-hamcrest-core))
7369 (home-page "https://commons.apache.org/net/")
7370 (synopsis "Client library for many basic Internet protocols")
7371 (description "The Apache Commons Net library implements the client side of
7372many basic Internet protocols. The purpose of the library is to provide
7373fundamental protocol access, not higher-level abstractions.")
7374 (license license:asl2.0)))
7375
7376(define-public java-jsch
7377 (package
7378 (name "java-jsch")
7379 (version "0.1.55")
7380 (source (origin
7381 (method url-fetch)
7382 (uri (string-append "mirror://sourceforge/jsch/jsch/"
7383 version "/jsch-" version ".zip"))
7384 (sha256
7385 (base32
7386 "1lxyjwvmwa723wcf3bqn816hkvc03vz4xhbsi7bvfhrz2rpgcfq6"))))
7387 (build-system ant-build-system)
7388 (arguments
7389 `(#:build-target "dist"
7390 #:tests? #f ; no tests included
7391 #:phases
7392 (modify-phases %standard-phases
7393 (replace 'install (install-jars "dist")))))
7394 (native-inputs
7395 (list unzip))
7396 (home-page "http://www.jcraft.com/jsch/")
7397 (synopsis "Pure Java implementation of SSH2")
7398 (description "JSch is a pure Java implementation of SSH2. JSch allows you
7399to connect to an SSH server and use port forwarding, X11 forwarding, file
7400transfer, etc., and you can integrate its functionality into your own Java
7401programs.")
7402 (license license:bsd-3)))
7403
7404(define-public java-jsch-0.1.72
7405 (package
7406 (name "java-jsch")
7407 (version "0.1.72")
7408 (source
7409 (origin
7410 (method git-fetch)
7411 (uri (git-reference
7412 (url "https://github.com/mwiede/jsch.git")
7413 (commit (string-append "jsch-" version))))
7414 (file-name (git-file-name name version))
7415 (sha256
7416 (base32 "1xx50fw9wxnkm9yg8v8scr2c7781506flv0ivalpw7bg27w8sm59"))))
7417 (build-system ant-build-system)
7418 (arguments
7419 (list
7420 #:jdk openjdk17
7421 #:tests? #f
7422 #:modules
7423 '((guix build utils)
7424 (guix build ant-build-system)
7425 (guix build java-utils))
7426 #:phases
7427 #~(modify-phases %standard-phases
7428 (replace 'build
7429 (lambda* (#:key inputs #:allow-other-keys)
7430 (define classes-dir (string-append (getcwd) "/build/classes"))
7431 (define generated-dir (string-append (getcwd) "/build/generated"))
7432 (define manifest-file (string-append (getcwd) "/build/manifest.mf"))
7433 (define jar-file (string-append (getcwd) "/build/jsch-" #$version ".jar"))
7434 (define jna
7435 (car (find-files (assoc-ref inputs "java-native-access")
7436 "jna-jpms.*\\.jar$")))
7437 (define jna-platform
7438 (car (find-files (assoc-ref inputs "java-native-access-platform")
7439 "jna-platform-jpms.*\\.jar$")))
7440 (define bcprov
7441 (car (find-files (assoc-ref inputs "java-bouncycastle")
7442 "bcprov.*\\.jar$")))
7443 (define junixsocket
7444 (car (find-files (assoc-ref inputs "java-junixsocket-common")
7445 "\\.jar$")))
7446 (define classpath
7447 (string-append jna ":" jna-platform ":" bcprov
7448 ":" junixsocket))
7449 (define (java-sources source-root)
7450 (filter (lambda (file)
7451 (and (string-suffix? ".java" file)
7452 (not (string-suffix? "module-info.java" file))))
7453 (find-files source-root "\\.java$")))
7454 (define (compile-release source-root release)
7455 (let ((sources (java-sources source-root))
7456 (target (string-append classes-dir "/META-INF/versions/"
7457 release)))
7458 (when (pair? sources)
7459 (mkdir-p target)
7460 (apply invoke "javac"
7461 (append
7462 (list "--release" release
7463 "-cp" (string-append classes-dir ":" classpath)
7464 "-d" target)
7465 sources)))))
7466 (mkdir-p classes-dir)
7467 (mkdir-p (string-append generated-dir "/com/jcraft/jsch"))
7468 (copy-file "src/main/java-templates/com/jcraft/jsch/Version.java"
7469 (string-append generated-dir
7470 "/com/jcraft/jsch/Version.java"))
7471 (substitute* (string-append generated-dir
7472 "/com/jcraft/jsch/Version.java")
7473 (("\\$\\{project.version\\}") #$version))
7474 (apply invoke "javac"
7475 (append
7476 (list "--release" "8"
7477 "-cp" classpath
7478 "-d" classes-dir)
7479 (java-sources "src/main/java")
7480 (list (string-append generated-dir
7481 "/com/jcraft/jsch/Version.java"))))
7482 (for-each
7483 (lambda (release)
7484 (compile-release (string-append "src/main/java" release)
7485 release))
7486 '("9" "11" "15" "16"))
7487 (call-with-output-file manifest-file
7488 (lambda (port)
7489 (display "Multi-Release: true\n" port)))
7490 (invoke "jar" "--create"
7491 "--file" jar-file
7492 "--manifest" manifest-file
7493 "-C" classes-dir ".")))
7494 (add-before 'install 'create-pom
7495 (generate-pom.xml "pom.xml" "com.jcraft"
7496 "jsch" #$version))
7497 (replace 'install
7498 (install-from-pom "pom.xml")))))
7499 (inputs
7500 (list java-bouncycastle-1.77
7501 java-junixsocket-common-2
7502 java-native-access-5.14.0
7503 java-native-access-platform-5.14.0))
7504 (native-inputs
7505 (list java-kohlschutter-compiler-annotations-1
7506 unzip))
7507 (home-page "https://github.com/mwiede/jsch")
7508 (synopsis "Pure Java implementation of SSH2")
7509 (description
7510 "JSch is a pure Java implementation of SSH2. This package builds the
75110.1.72 release from source with bouncycastle and junixsocket support.")
7512 (license license:bsd-3)))
7513
7514(define-public java-jzlib-1.1.3
7515 (package
7516 (name "java-jzlib")
7517 (version "1.1.3")
7518 (source (origin
7519 (method git-fetch)
7520 (uri (git-reference
7521 (url "https://github.com/ymnk/jzlib")
7522 (commit version)))
7523 (file-name (git-file-name name version))
7524 (sha256
7525 (base32
7526 "1wma04qlx65ybyf49dngqb5db1xc7sya0g98frj5chhr4qc7fjs8"))))
7527 (build-system ant-build-system)
7528 (arguments
7529 `(#:jar-name "jzlib.jar"
7530 #:source-dir "src/main/java"
7531 #:tests? #f ; no tests
7532 #:phases
7533 (modify-phases %standard-phases
7534 (replace 'install
7535 (install-from-pom "pom.xml")))))
7536 (home-page "http://www.jcraft.com/jzlib/")
7537 (synopsis "Pure Java implementation of zlib")
7538 (description "JZlib is a re-implementation of zlib in pure Java. It
7539provides @code{Deflater}, @code{Inflater}, and streaming classes for
7540compression and decompression compatible with the zlib format.")
7541 (license license:bsd-3)))
7542
7543(define-public java-commons-compress
7544 (package
7545 (name "java-commons-compress")
7546 (version "1.28.0")
7547 (source (origin
7548 (method url-fetch)
7549 (uri (string-append "mirror://apache/commons/compress/source/"
7550 "commons-compress-" version "-src.tar.gz"))
7551 (sha256
7552 (base32
7553 "0qkn70dfb1f9xihc34mbpbr5ag8qm4qq18hh3p4286r2ajj0z1sw"))))
7554 (build-system ant-build-system)
7555 (arguments
7556 `(#:jar-name "commons-compress.jar"
7557 #:source-dir "src/main/java"
7558 #:tests? #f; requires java-mockito-3
7559 #:phases
7560 (modify-phases %standard-phases
7561 (replace 'install (install-from-pom "pom.xml")))))
7562 (propagated-inputs
7563 (list java-commons-lang3
7564 java-commons-io-latest
7565 java-commons-codec
7566 java-asm-9
7567 java-brotli
7568 java-xz
7569 java-zstd
7570 apache-commons-parent-pom-85))
7571 (home-page "https://commons.apache.org/proper/commons-compress/")
7572 (synopsis "Java library for working with compressed files")
7573 (description "The Apache Commons Compress library defines an API for
7574working with compressed files such as ar, cpio, Unix dump, tar, zip, gzip, XZ,
7575Pack200, bzip2, 7z, arj, lzma, snappy, DEFLATE, lz4 and Z files.")
7576 (license license:asl2.0)))
7577
7578(define-public java-commons-compress-1.21
7579 (package
7580 (inherit java-commons-compress)
7581 (version "1.21")
7582 (source (origin
7583 (method url-fetch)
7584 (uri (string-append "mirror://apache/commons/compress/source/"
7585 "commons-compress-" version "-src.tar.gz"))
7586 (sha256
7587 (base32
7588 "1rkpb6xcyly1wnbx4q6iq6p5hrr0h1d0ppb5r07psc75cbmizjry"))))
7589 (propagated-inputs
7590 (list java-asm-3
7591 java-brotli
7592 java-osgi-core
7593 java-xz
7594 java-zstd
7595 apache-commons-parent-pom-52))))
7596
7597(define-public java-commons-csv
7598 (package
7599 (name "java-commons-csv")
7600 (version "1.4")
7601 (source (origin
7602 (method url-fetch)
7603 (uri (string-append "mirror://apache/commons/csv/source/"
7604 "commons-csv-" version "-src.tar.gz"))
7605 (sha256
7606 (base32
7607 "1l89m0fm2s3xx3v3iynvangymfg2vlyngaj6fgsi457nmsw7m7ij"))))
7608 (build-system ant-build-system)
7609 (arguments
7610 `(#:jar-name "commons-csv.jar"
7611 #:source-dir "src/main/java"
7612 #:tests? #f)); FIXME: requires java-h2
7613 (inputs
7614 `(("java-hamcrest-core" ,java-hamcrest-core)
7615 ("java-commons-io" ,java-commons-io)
7616 ("java-commons-lang3" ,java-commons-lang3)
7617 ("junit" ,java-junit)))
7618 (home-page "https://commons.apache.org/proper/commons-csv/")
7619 (synopsis "Read and write CSV documents")
7620 (description "Commons CSV reads and writes files in variations of the Comma
7621Separated Value (CSV) format. The most common CSV formats are predefined in the
7622CSVFormat class:
7623
7624@itemize
7625@item Microsoft Excel
7626@item Informix UNLOAD
7627@item Informix UNLOAD CSV
7628@item MySQL
7629@item RFC 4180
7630@item TDF
7631@end itemize
7632
7633Custom formats can be created using a fluent style API.")
7634 (license license:asl2.0)))
7635
7636(define-public java-jaxrs-api-2
7637 (package
7638 (name "java-jaxrs-api")
7639 (version "2.1.1")
7640 (source (origin
7641 (method git-fetch)
7642 (uri (git-reference
7643 (url "https://github.com/jakartaee/rest")
7644 (commit version)))
7645 (file-name (git-file-name name version))
7646 (sha256
7647 (base32
7648 "1sa490sag5r23hx84haddkbbyn4dlhav4m445k53y53jzs64cs4c"))))
7649 (build-system ant-build-system)
7650 (arguments
7651 (list
7652 #:tests? #f
7653 #:jdk openjdk9
7654 #:jar-name "javax.ws.rs-api.jar"
7655 #:source-dir "jaxrs-api/src/main/java"
7656 #:phases
7657 #~(modify-phases %standard-phases
7658 (add-before 'install 'create-pom
7659 (generate-pom.xml "pom.xml" "javax.ws.rs" "javax.ws.rs-api"
7660 #$version))
7661 (replace 'install (install-from-pom "pom.xml")))))
7662 (home-page "https://github.com/jax-rs")
7663 (synopsis "Java API for RESTful Web Services")
7664 (description "JAX-RS provides a standardized API for building RESTful
7665web services in Java.")
7666 (license license:cddl1.1)))
7667
7668(define-public java-osgi-annotation
7669 (package
7670 (name "java-osgi-annotation")
7671 (version "6.0.0")
7672 (source (origin
7673 (method url-fetch)
7674 (uri (string-append "https://repo1.maven.org/maven2/"
7675 "org/osgi/org.osgi.annotation/" version "/"
7676 "org.osgi.annotation-" version "-sources.jar"))
7677 (sha256
7678 (base32
7679 "1q718mb7gqg726rh6pc2hcisn8v50nv35abbir0jypmffhiii85w"))))
7680 (build-system ant-build-system)
7681 (arguments
7682 `(#:tests? #f ; no tests
7683 #:jar-name "osgi-annotation.jar"
7684 #:phases
7685 (modify-phases %standard-phases
7686 (add-before 'install 'create-pom
7687 (generate-pom.xml "pom.xml" "osgi" "osgi-annotation" ,version))
7688 (replace 'install (install-from-pom "pom.xml")))))
7689 (home-page "https://www.osgi.org")
7690 (synopsis "Annotation module of OSGi framework")
7691 (description
7692 "OSGi, for Open Services Gateway initiative framework, is a module system
7693and service platform for the Java programming language. This package contains
7694the OSGi annotation module, providing additional services to help dynamic
7695components.")
7696 (license license:asl2.0)))
7697
7698(define-public java-osgi-annotation-8.1.0
7699 ;; Upstream tags the monorepo as 8.0.0.1, but osgi.annotation/bnd.bnd sets
7700 ;; the annotation artifact's release/minor version to 8.1, yielding 8.1.0.
7701 (let ((tag "8.0.0.1"))
7702 (package
7703 (name "java-osgi-annotation")
7704 (version "8.1.0")
7705 (source (origin
7706 (method git-fetch)
7707 (uri (git-reference
7708 (url "https://github.com/osgi/osgi")
7709 (commit tag)))
7710 (modules '((guix build utils)))
7711 (snippet
7712 '(begin
7713 (for-each delete-file
7714 (find-files "." "\\.jar$"))
7715 #t))
7716 (file-name (git-file-name name version))
7717 (sha256
7718 (base32
7719 "0s0ig6prnkvjp9159087mf16ihbqc91qlwdi1l0n5afhh2z5cnn5"))))
7720 (build-system ant-build-system)
7721 (arguments
7722 (list
7723 #:tests? #f
7724 #:jar-name "osgi-annotation.jar"
7725 #:phases
7726 #~(modify-phases %standard-phases
7727 (add-after 'unpack 'prepare-source-layout
7728 (lambda _
7729 (mkdir-p "src")
7730 (for-each
7731 (lambda (directory)
7732 (invoke "cp" "-r" (string-append directory "/.") "src/"))
7733 '("org.osgi.annotation.bundle/src"
7734 "org.osgi.annotation.versioning/src"))))
7735 (add-before 'install 'create-pom
7736 (generate-pom.xml "pom.xml" "org.osgi" "osgi.annotation"
7737 #$version))
7738 (replace 'install (install-from-pom "pom.xml")))))
7739 (home-page "https://www.osgi.org")
7740 (synopsis "Annotations for use in compiling OSGi bundles")
7741 (description "OSGi, for Open Services Gateway initiative framework, is a
7742module system and service platform for the Java programming language. This
7743package contains the annotation classes used at compile time.")
7744 (license license:asl2.0))))
7745
7746(define-public java-osgi-core
7747 (package
7748 (name "java-osgi-core")
7749 (version "6.0.0")
7750 (source (origin
7751 (method url-fetch)
7752 (uri (string-append "https://repo1.maven.org/maven2/"
7753 "org/osgi/org.osgi.core/" version "/"
7754 "org.osgi.core-" version "-sources.jar"))
7755 (sha256
7756 (base32
7757 "19bpf5jx32jq9789gyhin35q5v7flmw0p9mk7wbgqpxqfmxyiabv"))))
7758 (build-system ant-build-system)
7759 (arguments
7760 `(#:tests? #f ; no tests
7761 #:jar-name "osgi-core.jar"
7762 #:phases
7763 (modify-phases %standard-phases
7764 (add-before 'install 'create-pom
7765 (generate-pom.xml "pom.xml" "org.osgi" "org.osgi.core" ,version))
7766 (replace 'install (install-from-pom "pom.xml")))))
7767 (inputs
7768 (list java-osgi-annotation))
7769 (home-page "https://www.osgi.org")
7770 (synopsis "Core module of OSGi framework")
7771 (description
7772 "OSGi, for Open Services Gateway initiative framework, is a module system
7773and service platform for the Java programming language. This package contains
7774the OSGi Core module.")
7775 (license license:asl2.0)))
7776
7777(define-public java-osgi-core-8.0.0
7778 ;; Upstream uses release-train tags for the monorepo; osgi.core/bnd.bnd
7779 ;; emits artifact version 8.0.0 from the r8-core-final checkout.
7780 (let ((tag "r8-core-final"))
7781 (package
7782 (name "java-osgi-core")
7783 (version "8.0.0")
7784 (source (origin
7785 (method git-fetch)
7786 (uri (git-reference
7787 (url "https://github.com/osgi/osgi")
7788 (commit tag)))
7789 (modules '((guix build utils)))
7790 (snippet
7791 '(begin
7792 (for-each delete-file
7793 (find-files "." "\\.jar$"))
7794 #t))
7795 (file-name (git-file-name name version))
7796 (sha256
7797 (base32
7798 "01z4c3jakzjdh4m0j71shppa1nfgaqgxwajnhyv56s1l1a9hxb6x"))))
7799 (build-system ant-build-system)
7800 (arguments
7801 (list
7802 #:tests? #f
7803 #:jar-name "osgi-core.jar"
7804 #:phases
7805 #~(modify-phases %standard-phases
7806 (add-after 'unpack 'prepare-source-layout
7807 (lambda _
7808 (mkdir-p "src")
7809 (for-each
7810 (lambda (directory)
7811 (invoke "cp" "-r" (string-append directory "/.") "src/"))
7812 '("org.osgi.dto/src"
7813 "org.osgi.framework/src"
7814 "org.osgi.resource/src"
7815 "org.osgi.service.condition/src"
7816 "org.osgi.service.condpermadmin/src"
7817 "org.osgi.service.log/src"
7818 "org.osgi.service.packageadmin/src"
7819 "org.osgi.service.permissionadmin/src"
7820 "org.osgi.service.resolver/src"
7821 "org.osgi.service.startlevel/src"
7822 "org.osgi.service.url/src"
7823 "org.osgi.util.tracker/src"))))
7824 (add-before 'install 'create-pom
7825 (generate-pom.xml "pom.xml" "org.osgi" "osgi.core" #$version))
7826 (replace 'install (install-from-pom "pom.xml")))))
7827 (inputs (list java-osgi-annotation-8.1.0))
7828 (home-page "https://www.osgi.org")
7829 (synopsis "Core module of OSGi framework")
7830 (description "OSGi, for Open Services Gateway initiative framework, is a
7831module system and service platform for the Java programming language. This
7832package contains the OSGi Core module.")
7833 (license license:asl2.0))))
7834
7835(define-public java-osgi-service-event
7836 (package
7837 (name "java-osgi-service-event")
7838 (version "1.3.1")
7839 (source (origin
7840 (method url-fetch)
7841 (uri (string-append "https://repo1.maven.org/maven2/"
7842 "org/osgi/org.osgi.service.event/"
7843 version "/org.osgi.service.event-"
7844 version "-sources.jar"))
7845 (sha256
7846 (base32
7847 "1nyhlgagwym75bycnjczwbnpymv2iw84zbhvvzk84g9q736i6qxm"))))
7848 (build-system ant-build-system)
7849 (arguments
7850 `(#:tests? #f ; no tests
7851 #:jar-name "osgi-service-event.jar"))
7852 (inputs
7853 (list java-osgi-annotation java-osgi-core))
7854 (home-page "https://www.osgi.org")
7855 (synopsis "OSGi service event module")
7856 (description
7857 "OSGi, for Open Services Gateway initiative framework, is a module system
7858and service platform for the Java programming language. This package contains
7859the OSGi @code{org.osgi.service.event} module.")
7860 (license license:asl2.0)))
7861
7862(define-public java-eclipse-osgi
7863 (package
7864 (name "java-eclipse-osgi")
7865 (version "3.11.3")
7866 (source (origin
7867 (method url-fetch)
7868 (uri (string-append "https://repo1.maven.org/maven2/"
7869 "org/eclipse/platform/org.eclipse.osgi/"
7870 version "/org.eclipse.osgi-"
7871 version "-sources.jar"))
7872 (sha256
7873 (base32
7874 "00cqc6lb29n0zv68b4l842vzkwawvbr7gshfdygsk8sicvcq2c7b"))))
7875 (build-system ant-build-system)
7876 (arguments
7877 `(#:tests? #f ; no tests included
7878 #:jar-name "eclipse-equinox-osgi.jar"))
7879 (inputs
7880 (list java-osgi-annotation))
7881 (home-page "https://www.eclipse.org/equinox/")
7882 (synopsis "Eclipse Equinox OSGi framework")
7883 (description "This package provides an implementation of the OSGi Core
7884specification.")
7885 (license license:epl1.0)))
7886
7887(define-public java-eclipse-equinox-common
7888 (package
7889 (name "java-eclipse-equinox-common")
7890 (version "3.10.200")
7891 (source (origin
7892 (method url-fetch)
7893 (uri (string-append "https://repo1.maven.org/maven2/"
7894 "org/eclipse/platform/org.eclipse.equinox.common/"
7895 version "/org.eclipse.equinox.common-"
7896 version "-sources.jar"))
7897 (sha256
7898 (base32
7899 "1yn8ij6xsljlf35sr2l7wvyvc0ss4n1rv0ry5zkgb49dj4hyrqrj"))))
7900 (build-system ant-build-system)
7901 (arguments
7902 `(#:tests? #f ; no tests included
7903 #:jar-name "eclipse-equinox-common.jar"))
7904 (inputs
7905 (list java-eclipse-osgi))
7906 (home-page "https://www.eclipse.org/equinox/")
7907 (synopsis "Common Eclipse runtime")
7908 (description "This package provides the common Eclipse runtime.")
7909 (license license:epl1.0)))
7910
7911(define-public java-eclipse-core-jobs
7912 (package
7913 (name "java-eclipse-core-jobs")
7914 (version "3.8.0")
7915 (source (origin
7916 (method url-fetch)
7917 (uri (string-append "https://repo1.maven.org/maven2/"
7918 "org/eclipse/platform/org.eclipse.core.jobs/"
7919 version "/org.eclipse.core.jobs-"
7920 version "-sources.jar"))
7921 (sha256
7922 (base32
7923 "0395b8lh0km8vhzjnchvs1rii1qz48hyvb2wqfaq4yhklbwihq4b"))))
7924 (build-system ant-build-system)
7925 (arguments
7926 `(#:tests? #f ; no tests included
7927 #:jar-name "eclipse-core-jobs.jar"))
7928 (inputs
7929 (list java-eclipse-equinox-common java-eclipse-osgi))
7930 (home-page "https://www.eclipse.org/equinox/")
7931 (synopsis "Eclipse jobs mechanism")
7932 (description "This package provides the Eclipse jobs mechanism.")
7933 (license license:epl1.0)))
7934
7935(define-public java-eclipse-equinox-registry
7936 (package
7937 (name "java-eclipse-equinox-registry")
7938 (version "3.6.100")
7939 (source (origin
7940 (method url-fetch)
7941 (uri (string-append "https://repo1.maven.org/maven2/"
7942 "org/eclipse/platform/org.eclipse.equinox.registry/"
7943 version "/org.eclipse.equinox.registry-"
7944 version "-sources.jar"))
7945 (sha256
7946 (base32
7947 "1i9sgymh2fy5vdgk5y7s3qvrlbgh4l93ddqi3v4zmca7hwrlhf9k"))))
7948 (build-system ant-build-system)
7949 (arguments
7950 `(#:tests? #f ; no tests included
7951 #:jar-name "eclipse-equinox-registry.jar"))
7952 (inputs
7953 (list java-eclipse-core-jobs java-eclipse-equinox-common
7954 java-eclipse-osgi))
7955 (home-page "https://www.eclipse.org/equinox/")
7956 (synopsis "Eclipse extension registry support")
7957 (description "This package provides support for the Eclipse extension
7958registry.")
7959 (license license:epl1.0)))
7960
7961(define-public java-eclipse-equinox-app
7962 (package
7963 (name "java-eclipse-equinox-app")
7964 (version "1.3.400")
7965 (source (origin
7966 (method url-fetch)
7967 (uri (string-append "https://repo1.maven.org/maven2/"
7968 "org/eclipse/platform/org.eclipse.equinox.app/"
7969 version "/org.eclipse.equinox.app-"
7970 version "-sources.jar"))
7971 (sha256
7972 (base32
7973 "0nhvbp93y203ar7y59gb0mz3w2d3jlqhr0c9hii9bcfpmr7imdab"))))
7974 (build-system ant-build-system)
7975 (arguments
7976 `(#:tests? #f ; no tests included
7977 #:jar-name "eclipse-equinox-app.jar"))
7978 (inputs
7979 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7980 java-eclipse-osgi java-osgi-service-event))
7981 (home-page "https://www.eclipse.org/equinox/")
7982 (synopsis "Equinox application container")
7983 (description "This package provides the Equinox application container for
7984Eclipse.")
7985 (license license:epl1.0)))
7986
7987(define-public java-eclipse-equinox-preferences
7988 (package
7989 (name "java-eclipse-equinox-preferences")
7990 (version "3.6.1")
7991 (source (origin
7992 (method url-fetch)
7993 (uri (string-append "https://repo1.maven.org/maven2/"
7994 "org/eclipse/platform/org.eclipse.equinox.preferences/"
7995 version "/org.eclipse.equinox.preferences-"
7996 version "-sources.jar"))
7997 (sha256
7998 (base32
7999 "0k7w6c141sqym4fy3af0qkwpy4pdh2vsjpjba6rp5fxyqa24v0a2"))))
8000 (build-system ant-build-system)
8001 (arguments
8002 `(#:tests? #f ; no tests included
8003 #:jar-name "eclipse-equinox-preferences.jar"))
8004 (inputs
8005 (list java-eclipse-equinox-common java-eclipse-equinox-registry
8006 java-eclipse-osgi))
8007 (home-page "https://www.eclipse.org/equinox/")
8008 (synopsis "Eclipse preferences mechanism")
8009 (description "This package provides the Eclipse preferences mechanism with
8010the module @code{org.eclipse.equinox.preferences}.")
8011 (license license:epl1.0)))
8012
8013(define-public java-eclipse-core-contenttype
8014 (package
8015 (name "java-eclipse-core-contenttype")
8016 (version "3.5.100")
8017 (source (origin
8018 (method url-fetch)
8019 (uri (string-append "https://repo1.maven.org/maven2/"
8020 "org/eclipse/platform/org.eclipse.core.contenttype/"
8021 version "/org.eclipse.core.contenttype-"
8022 version "-sources.jar"))
8023 (sha256
8024 (base32
8025 "1wcqcv7ijwv5rh748vz3x9pkmjl9w1r0k0026k56n8yjl4rrmspi"))))
8026 (build-system ant-build-system)
8027 (arguments
8028 `(#:tests? #f ; no tests included
8029 #:jar-name "eclipse-core-contenttype.jar"))
8030 (inputs
8031 (list java-eclipse-equinox-common java-eclipse-equinox-preferences
8032 java-eclipse-equinox-registry java-eclipse-osgi))
8033 (home-page "https://www.eclipse.org/")
8034 (synopsis "Eclipse content mechanism")
8035 (description "This package provides the Eclipse content mechanism in the
8036@code{org.eclipse.core.contenttype} module.")
8037 (license license:epl1.0)))
8038
8039(define-public java-eclipse-core-runtime
8040 (package
8041 (name "java-eclipse-core-runtime")
8042 (version "3.15.100")
8043 (source (origin
8044 (method url-fetch)
8045 (uri (string-append "https://repo1.maven.org/maven2/"
8046 "org/eclipse/platform/org.eclipse.core.runtime/"
8047 version "/org.eclipse.core.runtime-"
8048 version "-sources.jar"))
8049 (sha256
8050 (base32
8051 "0l8xayacsbjvz5hypx2fv47vpw2n4dspamcfb3hx30x9hj8vmg7r"))))
8052 (build-system ant-build-system)
8053 (arguments
8054 `(#:tests? #f ; no tests included
8055 #:jar-name "eclipse-core-runtime.jar"))
8056 (inputs
8057 (list java-eclipse-core-contenttype
8058 java-eclipse-core-jobs
8059 java-eclipse-equinox-app
8060 java-eclipse-equinox-common
8061 java-eclipse-equinox-registry
8062 java-eclipse-equinox-preferences
8063 java-eclipse-osgi))
8064 (home-page "https://www.eclipse.org/")
8065 (synopsis "Eclipse core runtime")
8066 (description "This package provides the Eclipse core runtime with the
8067module @code{org.eclipse.core.runtime}.")
8068 (license license:epl1.0)))
8069
8070(define-public java-eclipse-core-filesystem
8071 (package
8072 (name "java-eclipse-core-filesystem")
8073 (version "1.6.1")
8074 (source (origin
8075 (method url-fetch)
8076 (uri (string-append "https://repo1.maven.org/maven2/"
8077 "org/eclipse/platform/org.eclipse.core.filesystem/"
8078 version "/org.eclipse.core.filesystem-"
8079 version "-sources.jar"))
8080 (sha256
8081 (base32
8082 "0km1bhwjim4rfy3pkvjhvy31kgsyf2ncx0mlkmbf5n6g57pphdyj"))))
8083 (build-system ant-build-system)
8084 (arguments
8085 `(#:tests? #f ; no tests included
8086 #:jar-name "eclipse-core-filesystem.jar"))
8087 (inputs
8088 (list java-eclipse-equinox-common java-eclipse-equinox-registry
8089 java-eclipse-osgi))
8090 (home-page "https://www.eclipse.org/")
8091 (synopsis "Eclipse core file system")
8092 (description "This package provides the Eclipse core file system with the
8093module @code{org.eclipse.core.filesystem}.")
8094 (license license:epl1.0)))
8095
8096(define-public java-eclipse-core-expressions
8097 (package
8098 (name "java-eclipse-core-expressions")
8099 (version "3.5.100")
8100 (source (origin
8101 (method url-fetch)
8102 (uri (string-append "https://repo1.maven.org/maven2/"
8103 "org/eclipse/platform/org.eclipse.core.expressions/"
8104 version "/org.eclipse.core.expressions-"
8105 version "-sources.jar"))
8106 (sha256
8107 (base32
8108 "18bw2l875gmygvpagpgk9l24qzbdjia4ag12nw6fi8v8yaq4987f"))))
8109 (build-system ant-build-system)
8110 (arguments
8111 `(#:tests? #f ; no tests included
8112 #:jar-name "eclipse-core-expressions.jar"))
8113 (inputs
8114 (list java-eclipse-equinox-common java-eclipse-equinox-registry
8115 java-eclipse-equinox-preferences java-eclipse-core-runtime
8116 java-eclipse-osgi))
8117 (home-page "https://www.eclipse.org/")
8118 (synopsis "Eclipse core expression language")
8119 (description "This package provides the Eclipse core expression language
8120with the @code{org.eclipse.core.expressions} module.")
8121 (license license:epl1.0)))
8122
8123(define-public java-eclipse-core-variables
8124 (package
8125 (name "java-eclipse-core-variables")
8126 (version "3.3.0")
8127 (source (origin
8128 (method url-fetch)
8129 (uri (string-append "https://repo1.maven.org/maven2/"
8130 "org/eclipse/platform/org.eclipse.core.variables/"
8131 version "/org.eclipse.core.variables-"
8132 version "-sources.jar"))
8133 (sha256
8134 (base32
8135 "12dirh03zi4n5x5cj07vzrhkmnqy6h9q10h9j605pagmpmifyxmy"))))
8136 (build-system ant-build-system)
8137 (arguments
8138 `(#:tests? #f ; no tests included
8139 #:jar-name "eclipse-core-variables.jar"))
8140 (inputs
8141 (list java-eclipse-equinox-common java-eclipse-equinox-registry
8142 java-eclipse-equinox-preferences java-eclipse-core-runtime
8143 java-eclipse-osgi))
8144 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
8145 (synopsis "Eclipse core variables")
8146 (description "This package provides the Eclipse core variables module
8147@code{org.eclipse.core.variables}.")
8148 (license license:epl1.0)))
8149
8150(define-public java-eclipse-ant-core
8151 (package
8152 (name "java-eclipse-ant-core")
8153 (version "3.4.100")
8154 (source (origin
8155 (method url-fetch)
8156 (uri (string-append "https://repo1.maven.org/maven2/"
8157 "org/eclipse/platform/org.eclipse.ant.core/"
8158 version "/org.eclipse.ant.core-"
8159 version "-sources.jar"))
8160 (sha256
8161 (base32
8162 "11g3if794qjlk98mz9zch22rr56sd7z63vn4i7k2icr8cq5bfqg7"))))
8163 (build-system ant-build-system)
8164 (arguments
8165 `(#:tests? #f ; no tests included
8166 #:jar-name "eclipse-ant-core.jar"))
8167 (inputs
8168 (list java-eclipse-equinox-app
8169 java-eclipse-equinox-common
8170 java-eclipse-equinox-registry
8171 java-eclipse-equinox-preferences
8172 java-eclipse-core-contenttype
8173 java-eclipse-core-runtime
8174 java-eclipse-core-variables
8175 java-eclipse-osgi))
8176 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
8177 (synopsis "Ant build tool core libraries")
8178 (description "This package provides the ant build tool core libraries with
8179the module @code{org.eclipse.ant.core}.")
8180 (license license:epl1.0)))
8181
8182(define-public java-eclipse-core-resources
8183 (package
8184 (name "java-eclipse-core-resources")
8185 (version "3.13.200")
8186 (source (origin
8187 (method url-fetch)
8188 (uri (string-append "https://repo1.maven.org/maven2/"
8189 "org/eclipse/platform/org.eclipse.core.resources/"
8190 version "/org.eclipse.core.resources-"
8191 version "-sources.jar"))
8192 (sha256
8193 (base32
8194 "1sn3b6ky72hkvxcgf9b2jkpbdh3y8lbhi9xxwv1dsiddpkkq91hs"))))
8195 (build-system ant-build-system)
8196 (arguments
8197 `(#:tests? #f ; no tests included
8198 #:jar-name "eclipse-core-resources.jar"))
8199 (inputs
8200 (list java-eclipse-equinox-common
8201 java-eclipse-equinox-preferences
8202 java-eclipse-equinox-registry
8203 java-eclipse-core-contenttype
8204 java-eclipse-core-expressions
8205 java-eclipse-core-filesystem
8206 java-eclipse-core-jobs
8207 java-eclipse-core-runtime
8208 java-eclipse-ant-core
8209 java-eclipse-osgi))
8210 (home-page "https://www.eclipse.org/")
8211 (synopsis "Eclipse core resource management")
8212 (description "This package provides the Eclipse core resource management
8213module @code{org.eclipse.core.resources}.")
8214 (license license:epl1.0)))
8215
8216(define-public java-eclipse-compare-core
8217 (package
8218 (name "java-eclipse-compare-core")
8219 (version "3.6.0")
8220 (source (origin
8221 (method url-fetch)
8222 (uri (string-append "https://repo1.maven.org/maven2/"
8223 "org/eclipse/platform/org.eclipse.compare.core/"
8224 version "/org.eclipse.compare.core-"
8225 version "-sources.jar"))
8226 (sha256
8227 (base32
8228 "10g37r0pbiffyv2wk35c6g5lwzkdipkl0kkjp41v84dln46xm4dg"))))
8229 (build-system ant-build-system)
8230 (arguments
8231 `(#:tests? #f ; no tests included
8232 #:jar-name "eclipse-compare-core.jar"))
8233 (inputs
8234 (list java-eclipse-core-runtime java-eclipse-equinox-common
8235 java-eclipse-osgi java-icu4j))
8236 (home-page "https://www.eclipse.org/")
8237 (synopsis "Eclipse core compare support")
8238 (description "This package provides the Eclipse core compare support
8239module @code{org.eclipse.compare.core}.")
8240 (license license:epl1.0)))
8241
8242(define-public java-eclipse-team-core
8243 (package
8244 (name "java-eclipse-team-core")
8245 (version "3.8.0")
8246 (source (origin
8247 (method url-fetch)
8248 (uri (string-append "https://repo1.maven.org/maven2/"
8249 "org/eclipse/platform/org.eclipse.team.core/"
8250 version "/org.eclipse.team.core-"
8251 version "-sources.jar"))
8252 (sha256
8253 (base32
8254 "02j2jzqgb26zx2d5ahxmvijw6j4r0la90zl5c3i65x6z19ciyam7"))))
8255 (build-system ant-build-system)
8256 (arguments
8257 `(#:tests? #f ; no tests included
8258 #:jar-name "eclipse-team-core.jar"))
8259 (inputs
8260 (list java-eclipse-compare-core
8261 java-eclipse-core-contenttype
8262 java-eclipse-core-filesystem
8263 java-eclipse-core-jobs
8264 java-eclipse-core-resources
8265 java-eclipse-core-runtime
8266 java-eclipse-equinox-common
8267 java-eclipse-equinox-registry
8268 java-eclipse-equinox-preferences
8269 java-eclipse-osgi))
8270 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
8271 (synopsis "Eclipse team support core")
8272 (description "This package provides the Eclipse team support core module
8273@code{org.eclipse.team.core}.")
8274 (license license:epl1.0)))
8275
8276(define-public java-eclipse-core-commands
8277 (package
8278 (name "java-eclipse-core-commands")
8279 (version "3.8.1")
8280 (source (origin
8281 (method url-fetch)
8282 (uri (string-append "https://repo1.maven.org/maven2/"
8283 "org/eclipse/platform/org.eclipse.core.commands/"
8284 version "/org.eclipse.core.commands-"
8285 version "-sources.jar"))
8286 (sha256
8287 (base32
8288 "0yjn482qndcfrsq3jd6vnhcylp16420f5aqkrwr8spsprjigjcr9"))))
8289 (build-system ant-build-system)
8290 (arguments
8291 `(#:tests? #f ; no tests included
8292 #:jar-name "eclipse-core-commands.jar"))
8293 (inputs
8294 (list java-eclipse-equinox-common))
8295 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
8296 (synopsis "Eclipse core commands")
8297 (description "This package provides Eclipse core commands in the module
8298@code{org.eclipse.core.commands}.")
8299 (license license:epl1.0)))
8300
8301(define-public java-eclipse-text
8302 (package
8303 (name "java-eclipse-text")
8304 (version "3.6.0")
8305 (source (origin
8306 (method url-fetch)
8307 (uri (string-append "https://repo1.maven.org/maven2/"
8308 "org/eclipse/platform/org.eclipse.text/"
8309 version "/org.eclipse.text-"
8310 version "-sources.jar"))
8311 (sha256
8312 (base32
8313 "0scz70vzz5qs5caji9f5q01vkqnvip7dpri1q07l8wbbdcxn4cq1"))))
8314 (build-system ant-build-system)
8315 (arguments
8316 `(#:tests? #f ; no tests included
8317 #:jar-name "eclipse-text.jar"
8318 #:phases
8319 (modify-phases %standard-phases
8320 ;; When creating a new category we must make sure that the new list
8321 ;; matches List<Position>. By default it seems to be too generic
8322 ;; (ArrayList<Object>), so we specialize it to ArrayList<Position>.
8323 ;; Without this we get this error:
8324 ;;
8325 ;; [javac] .../src/org/eclipse/jface/text/AbstractDocument.java:376:
8326 ;; error: method put in interface Map<K,V> cannot be applied to given types;
8327 ;; [javac] fPositions.put(category, new ArrayList<>());
8328 ;; [javac] ^
8329 ;; [javac] required: String,List<Position>
8330 ;; [javac] found: String,ArrayList<Object>
8331 ;; [javac] reason: actual argument ArrayList<Object> cannot be converted
8332 ;; to List<Position> by method invocation conversion
8333 ;; [javac] where K,V are type-variables:
8334 ;; [javac] K extends Object declared in interface Map
8335 ;; [javac] V extends Object declared in interface Map
8336 ;;
8337 ;; I don't know if this is a good fix. I suspect it is not, but it
8338 ;; seems to work.
8339 (add-after 'unpack 'fix-compilation-error
8340 (lambda _
8341 (substitute* "src/org/eclipse/jface/text/AbstractDocument.java"
8342 (("Positions.put\\(category, new ArrayList<>\\(\\)\\);")
8343 "Positions.put(category, new ArrayList<Position>());"))
8344 #t)))))
8345 (inputs
8346 (list java-eclipse-equinox-common java-eclipse-core-commands
8347 java-icu4j))
8348 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
8349 (synopsis "Eclipse text library")
8350 (description "Platform Text is part of the Platform UI project and
8351provides the basic building blocks for text and text editors within Eclipse
8352and contributes the Eclipse default text editor.")
8353 (license license:epl1.0)))
8354
8355(define-public java-eclipse-jdt-core
8356 (package
8357 (name "java-eclipse-jdt-core")
8358 (version "3.16.0")
8359 (source (origin
8360 (method url-fetch)
8361 (uri (string-append "https://repo1.maven.org/maven2/"
8362 "org/eclipse/jdt/org.eclipse.jdt.core/"
8363 version "/org.eclipse.jdt.core-"
8364 version "-sources.jar"))
8365 (sha256
8366 (base32
8367 "1g560yr9v2kzv34gc2m3ifpgnj7krcdd6h4gd4z83pwqacwkfz0k"))))
8368 (build-system ant-build-system)
8369 (arguments
8370 `(#:tests? #f ; no tests included
8371 #:jar-name "eclipse-jdt-core.jar"
8372 #:phases
8373 (modify-phases %standard-phases
8374 (add-after 'unpack 'move-sources
8375 (lambda _
8376 (with-directory-excursion "src/jdtCompilerAdaptersrc/"
8377 (for-each (lambda (file)
8378 (install-file file (string-append "../" (dirname file))))
8379 (find-files "." ".*")))
8380 (delete-file-recursively "src/jdtCompilerAdaptersrc/")
8381 #t))
8382 (add-before 'build 'copy-resources
8383 (lambda _
8384 (with-directory-excursion "src"
8385 (for-each (lambda (file)
8386 (install-file file (string-append "../build/classes/" (dirname file))))
8387 (find-files "." ".*.(props|properties|rsc)")))
8388 #t)))))
8389 (inputs
8390 (list java-eclipse-core-contenttype
8391 java-eclipse-core-filesystem
8392 java-eclipse-core-jobs
8393 java-eclipse-core-resources
8394 java-eclipse-core-runtime
8395 java-eclipse-equinox-app
8396 java-eclipse-equinox-common
8397 java-eclipse-equinox-preferences
8398 java-eclipse-equinox-registry
8399 java-eclipse-osgi
8400 java-eclipse-text))
8401 (home-page "https://www.eclipse.org/jdt")
8402 (synopsis "Java development tools core libraries")
8403 (description "This package provides the core libraries of the Eclipse Java
8404development tools.")
8405 (license license:epl1.0)))
8406
8407(define-public java-eclipse-jdt-compiler-apt
8408 (package
8409 (name "java-eclipse-jdt-compiler-apt")
8410 (version "1.3.400")
8411 (source (origin
8412 (method url-fetch)
8413 (uri (string-append "https://repo1.maven.org/maven2/"
8414 "org/eclipse/jdt/org.eclipse.jdt.compiler.apt/"
8415 version "/org.eclipse.jdt.compiler.apt-"
8416 version "-sources.jar"))
8417 (sha256
8418 (base32
8419 "1s285k9p2ixdqrknb40jbbvw682n9a7l5lqpn583a8pvlzg2l6r8"))))
8420 (build-system ant-build-system)
8421 (arguments
8422 `(#:tests? #f ; no tests included
8423 #:jar-name "eclipse-jdt-compiler-apt.jar"
8424 #:jdk ,openjdk11))
8425 (inputs
8426 (list java-eclipse-jdt-core))
8427 (home-page "https://www.eclipse.org/jdt/apt/")
8428 (synopsis "Annotation processing tool")
8429 (description "APT stands for Annotation Processing Tool. APT provides a
8430means for generating files and compiling new Java classes based on annotations
8431found in your source code.")
8432 (license license:epl2.0)))
8433
8434(define-public java-eclipse-lsp4j-common
8435 (package
8436 (name "java-eclipse-lsp4j-common")
8437 (version "0.10.0")
8438 (source (origin
8439 (method git-fetch)
8440 (uri (git-reference
8441 (url "https://github.com/eclipse/lsp4j")
8442 (commit (string-append "v" version))))
8443 (file-name (git-file-name name version))
8444 (sha256
8445 (base32
8446 "17srrac0pkpybwwc21rzdvn762zzl9m80rlqihc9b4l55hkqpk98"))))
8447 (build-system ant-build-system)
8448 (home-page "https://eclipse.org/lsp4j/")
8449 (synopsis "LSP4J common package")
8450 (description "Eclipse LSP4J provides Java bindings for the Language
8451Server Protocol and the Debug Adapter Protocol. This package is a common
8452definition intended to be inherited by other packages.")
8453 (license license:epl2.0)))
8454
8455(define-public java-eclipse-lsp4j-debug
8456 (package
8457 (inherit java-eclipse-lsp4j-common)
8458 (name "java-eclipse-lsp4j-debug")
8459 (arguments
8460 `(#:jar-name "eclipse-lsp4j-debug.jar"
8461 #:jdk ,openjdk11
8462 #:tests? #f; tests fail with reflection errors
8463 #:source-dir "org.eclipse.lsp4j.debug/src/main/java"
8464 #:test-dir "org.eclipse.lsp4j.debug/src/test"
8465 #:phases
8466 (modify-phases %standard-phases
8467 (add-before 'build 'copy-xtend
8468 (lambda _
8469 (copy-recursively "org.eclipse.lsp4j.debug/src/main/xtend-gen"
8470 "org.eclipse.lsp4j.debug/src/main/java"))))))
8471 (native-inputs
8472 (list java-junit))
8473 (inputs
8474 `(("java-gson" ,java-gson-2.8.6)
8475 ("java-eclipse-lsp4j-generaor" ,java-eclipse-lsp4j-generator)
8476 ("java-eclipse-lsp4j-jsonrpc" ,java-eclipse-lsp4j-jsonrpc)
8477 ("java-eclipse-lsp4j-jsonrpc-debug" ,java-eclipse-lsp4j-jsonrpc-debug)
8478 ("java-eclipse-xtext-xbase-lib" ,java-eclipse-xtext-xbase-lib)))
8479 (synopsis "Eclipse LSP4J Java bindings for the Debug Server Protocol")
8480 (description "Eclipse LSP4J provides Java bindings for the Language
8481Server Protocol and the Debug Adapter Protocol. This package contains its
8482LSP4J Java bindings for the Debug Server Protocol.")))
8483
8484(define-public java-eclipse-lsp4j-generator
8485 (package
8486 (inherit java-eclipse-lsp4j-common)
8487 (name "java-eclipse-lsp4j-generator")
8488 (arguments
8489 `(#:jar-name "eclipse-lsp4j-generator.jar"
8490 #:jdk ,openjdk11
8491 #:tests? #f; no tests
8492 #:source-dir "org.eclipse.lsp4j.generator/src/main/java"))
8493 (inputs
8494 (list java-eclipse-lsp4j-jsonrpc))
8495 (synopsis "Eclipse LSP4J Generator")
8496 (description "Eclipse LSP4J provides Java bindings for the Language
8497Server Protocol and the Debug Adapter Protocol. This package contains its
8498LSP4J code generator for Language Server Protocol classes.")))
8499
8500(define-public java-eclipse-lsp4j-jsonrpc
8501 (package
8502 (inherit java-eclipse-lsp4j-common)
8503 (name "java-eclipse-lsp4j-jsonrpc")
8504 (arguments
8505 `(#:jar-name "eclipse-lsp4j-jsonrpc.jar"
8506 #:jdk ,openjdk11
8507 #:source-dir "org.eclipse.lsp4j.jsonrpc/src/main/java"
8508 #:test-dir "org.eclipse.lsp4j.jsonrpc/src/test"))
8509 (native-inputs
8510 (list java-junit))
8511 (inputs
8512 (list java-gson-2.8.6))
8513 (synopsis "Java JSON-RPC implementation")
8514 (description "Eclipse LSP4J provides Java bindings for the Language
8515Server Protocol and the Debug Adapter Protocol. This package contains its
8516JSON-RPC implementation.")))
8517
8518(define-public java-eclipse-lsp4j-jsonrpc-debug
8519 (package
8520 (inherit java-eclipse-lsp4j-common)
8521 (name "java-eclipse-lsp4j-jsonrpc-debug")
8522 (arguments
8523 `(#:jar-name "eclipse-lsp4j-jsonrpc-debug.jar"
8524 #:jdk ,openjdk11
8525 #:source-dir "org.eclipse.lsp4j.jsonrpc.debug/src/main/java"
8526 #:test-dir "org.eclipse.lsp4j.jsonrpc.debug/src/test"))
8527 (native-inputs
8528 (list java-junit))
8529 (inputs
8530 (list java-eclipse-lsp4j-jsonrpc java-gson-2.8.6))
8531 (synopsis "Java JSON-RPC implementation (debug protocol)")
8532 (description "Eclipse LSP4J provides Java bindings for the Language
8533Server Protocol and the Debug Adapter Protocol. This package contains its
8534JSON-RPC implementation's debug protocol.")))
8535
8536(define-public java-eclipse-xtext-xbase-lib
8537 (package
8538 (name "java-eclipse-xtext-xbase-lib")
8539 (version "2.25.0")
8540 (source (origin
8541 (method git-fetch)
8542 (uri (git-reference
8543 (url "https://github.com/eclipse/xtext-lib")
8544 (commit (string-append "v" version))))
8545 (file-name (git-file-name name version))
8546 (sha256
8547 (base32
8548 "13b9lf6lnsprkik665m1qcyyc8cs16k33xm7as4rjcfcpn4pln71"))))
8549 (build-system ant-build-system)
8550 (arguments
8551 `(#:jar-name "eclipse-xtext-xbase-lib.jar"
8552 #:jdk ,openjdk11
8553 #:tests? #f; TODO (maybe needs newer guava version?)
8554 #:source-dir "org.eclipse.xtext.xbase.lib/src"
8555 #:test-dir "org.eclipse.xtext.xbase.lib.tests/src"))
8556 (native-inputs
8557 (list java-junit))
8558 (inputs
8559 (list java-guava))
8560 (home-page "https://www.eclipse.org/Xtext/")
8561 (synopsis "Eclipse Xbase Runtime Library")
8562 (description "This package contains runtime libraries for Xbase languages
8563such as Xtend.")
8564 (license license:epl2.0)))
8565
8566(define-public java-javax-mail
8567 (package
8568 (name "java-javax-mail")
8569 (version "1.6.2")
8570 (source (origin
8571 (method url-fetch)
8572 (uri (string-append "https://repo1.maven.org/maven2/"
8573 "com/sun/mail/javax.mail/"
8574 version "/javax.mail-"
8575 version "-sources.jar"))
8576 (sha256
8577 (base32
8578 "15cryjf398x7sy42j5gzlj5cmc2nx05b175b4gclwxj6qg5ly0li"))))
8579 (build-system ant-build-system)
8580 (arguments
8581 `(#:tests? #f ; no tests
8582 #:jar-name "javax-mail.jar"))
8583 (home-page "https://javamail.java.net")
8584 (synopsis "Reference implementation of the JavaMail API")
8585 (description
8586 "This package provides versions of the JavaMail API implementation, IMAP,
8587SMTP, and POP3 service providers, some examples, and documentation for the
8588JavaMail API.")
8589 ;; GPLv2 only with "classpath exception".
8590 (license license:gpl2)))
8591
8592(define-public java-log4j-api
8593 (package
8594 (name "java-log4j-api")
8595 (version "2.17.1")
8596 (source (origin
8597 (method url-fetch)
8598 (uri (string-append "mirror://apache/logging/log4j/" version
8599 "/apache-log4j-" version "-src.tar.gz"))
8600 (sha256
8601 (base32
8602 "05xssljdgxfv8ql42db8ydjfsvvbdqmsgip75phybm259ydzbsd6"))))
8603 (build-system ant-build-system)
8604 (arguments
8605 `(#:tests? #f ; tests require unpackaged software
8606 #:jar-name "log4j-api.jar"
8607 #:make-flags
8608 ,#~(list (string-append "-Ddist.dir=" #$output "/share/java"))
8609 #:phases
8610 (modify-phases %standard-phases
8611 (add-after 'unpack 'enter-dir
8612 (lambda _ (chdir "log4j-api") #t))
8613 ;; FIXME: The tests require additional software that has not been
8614 ;; packaged yet, such as
8615 ;; * org.apache.maven
8616 ;; * org.apache.felix
8617 (add-after 'enter-dir 'delete-tests
8618 (lambda _ (delete-file-recursively "src/test") #t)))))
8619 (inputs
8620 (list java-osgi-core java-hamcrest-core java-junit))
8621 (properties '((cpe-name . "log4j")))
8622 (home-page "https://logging.apache.org/log4j/2.x/")
8623 (synopsis "API module of the Log4j logging framework for Java")
8624 (description
8625 "This package provides the API module of the Log4j logging framework for
8626Java.")
8627 (license license:asl2.0)))
8628
8629(define-public java-log4j-core
8630 (package
8631 (inherit java-log4j-api)
8632 (name "java-log4j-core")
8633 (inputs
8634 `(("java-osgi-core" ,java-osgi-core)
8635 ("java-hamcrest-core" ,java-hamcrest-core)
8636 ("java-log4j-api" ,java-log4j-api)
8637 ("java-mail" ,java-mail)
8638 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
8639 ("java-conversant-disruptor" ,java-conversant-disruptor)
8640 ("java-lmax-disruptor" ,java-lmax-disruptor)
8641 ("java-jctools-core" ,java-jctools-core-1)
8642 ("java-stax2-api" ,java-stax2-api)
8643 ("java-jansi" ,java-jansi)
8644 ("java-kafka" ,java-kafka-clients)
8645 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
8646 ("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
8647 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
8648 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
8649 ("java-fasterxml-jackson-dataformat-xml" ,java-fasterxml-jackson-dataformat-xml)
8650 ("java-fasterxml-jackson-dataformat-yaml" ,java-fasterxml-jackson-dataformat-yaml)
8651 ("java-commons-compress" ,java-commons-compress)
8652 ("java-commons-csv" ,java-commons-csv)
8653 ("java-jeromq" ,java-jeromq)
8654 ("java-junit" ,java-junit)))
8655 (native-inputs
8656 `(("hamcrest" ,java-hamcrest-all)
8657 ("java-commons-io" ,java-commons-io)
8658 ("java-commons-lang3" ,java-commons-lang3)
8659 ("slf4j" ,java-slf4j-api)))
8660 (arguments
8661 `(#:tests? #f ; tests require more dependencies
8662 #:test-dir "src/test"
8663 #:source-dir "src/main/java"
8664 #:jar-name "log4j-core.jar"
8665 #:jdk ,icedtea-8
8666 #:make-flags
8667 ,#~(list (string-append "-Ddist.dir=" #$output "/share/java"))
8668 #:phases
8669 (modify-phases %standard-phases
8670 (add-after 'unpack 'enter-dir
8671 (lambda _ (chdir "log4j-core") #t)))))
8672 (synopsis "Core component of the Log4j framework")
8673 (description "This package provides the core component of the Log4j
8674logging framework for Java.")))
8675
8676(define-public java-log4j-1.2-api
8677 (package
8678 (inherit java-log4j-api)
8679 (name "java-log4j-1.2-api")
8680 (arguments
8681 `(#:jar-name "java-log4j-1.2-api.jar"
8682 #:source-dir "log4j-1.2-api/src/main/java"
8683 #:jdk ,icedtea-8
8684 ;; Tests require maven-model (and other maven subprojects), which is a
8685 ;; cyclic dependency.
8686 #:tests? #f))
8687 (inputs
8688 `(("log4j-api" ,java-log4j-api)
8689 ("log4j-core" ,java-log4j-core)
8690 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
8691 ("osgi-core" ,java-osgi-core)
8692 ("eclipse-osgi" ,java-eclipse-osgi)
8693 ("java-lmax-disruptor" ,java-lmax-disruptor)))))
8694
8695(define-public java-commons-cli
8696 (package
8697 (name "java-commons-cli")
8698 (version "1.4")
8699 (source (origin
8700 (method url-fetch)
8701 (uri (string-append "mirror://apache/commons/cli/source/"
8702 "commons-cli-" version "-src.tar.gz"))
8703 (sha256
8704 (base32
8705 "05hgi2z01fqz374y719gl1dxzqvzci5af071zm7vxrjg9vczipm1"))))
8706 (build-system ant-build-system)
8707 ;; TODO: javadoc
8708 (arguments
8709 `(#:jar-name "commons-cli.jar"
8710 #:phases
8711 (modify-phases %standard-phases
8712 (replace 'install
8713 (install-from-pom "pom.xml")))))
8714 (native-inputs
8715 (list java-junit java-hamcrest-core))
8716 (home-page "https://commons.apache.org/cli/")
8717 (synopsis "Command line arguments and options parsing library")
8718 (description "The Apache Commons CLI library provides an API for parsing
8719command line options passed to programs. It is also able to print help
8720messages detailing the options available for a command line tool.
8721
8722Commons CLI supports different types of options:
8723
8724@itemize
8725@item POSIX like options (ie. tar -zxvf foo.tar.gz)
8726@item GNU like long options (ie. du --human-readable --max-depth=1)
8727@item Java like properties (ie. java -Djava.awt.headless=true Foo)
8728@item Short options with value attached (ie. gcc -O2 foo.c)
8729@item long options with single hyphen (ie. ant -projecthelp)
8730@end itemize
8731
8732This is a part of the Apache Commons Project.")
8733 (license license:asl2.0)))
8734
8735(define-public java-commons-text
8736 (package
8737 (name "java-commons-text")
8738 (version "1.15.0")
8739 (source (origin
8740 (method url-fetch)
8741 (uri (string-append "mirror://apache/commons/text/source/"
8742 "commons-text-" version "-src.tar.gz"))
8743 (sha256
8744 (base32
8745 "0k0y3pkgrzm84a0z1ifi4b9ydaglzm9pgvaw9phxdcwmcqxjbkc8"))))
8746 (build-system ant-build-system)
8747 (arguments
8748 (list #:jar-name "java-commons-text.jar"
8749 #:source-dir "src/main/java"
8750 #:test-dir "src/test"
8751 #:tests? #f ; Tests require JUnit5.
8752 #:phases
8753 #~(modify-phases %standard-phases
8754 (replace 'install
8755 (install-from-pom "pom.xml")))))
8756 (inputs
8757 (list java-commons-io))
8758 (propagated-inputs
8759 (list java-commons-lang3
8760 apache-commons-parent-pom-51))
8761 (home-page "https://commons.apache.org/text/")
8762 (synopsis "Library focused on algorithms working on strings")
8763 (description "Apache Commons Text is a library focused on algorithms
8764working on strings.
8765
8766This is a part of the Apache Commons Project.")
8767 (license license:asl2.0)))
8768
8769(define-public java-commons-codec
8770 (package
8771 (name "java-commons-codec")
8772 (version "1.15")
8773 (source (origin
8774 (method url-fetch)
8775 (uri (string-append "mirror://apache/commons/codec/source/"
8776 "commons-codec-" version "-src.tar.gz"))
8777 (sha256
8778 (base32
8779 "01z9qmg8fd8d7p7xxipwj1vi9bmvpgqyi29kldjz2x6vzwm171jj"))))
8780 (build-system ant-build-system)
8781 (arguments
8782 `(#:jar-name "java-commons-codec.jar"
8783 #:source-dir "src/main/java"
8784 #:test-dir "src/test"
8785 #:test-exclude (list "**/*AbstractTest.java")
8786 #:phases
8787 (modify-phases %standard-phases
8788 (add-before 'build 'copy-resources
8789 (lambda _
8790 (copy-recursively "src/main/resources"
8791 "build/classes")))
8792 (add-before 'check 'copy-test-resources
8793 (lambda _
8794 (copy-recursively "src/test/resources"
8795 "build/test-classes")))
8796 (add-before 'check 'skip-ravenous-test
8797 (lambda _
8798 ;; This test admits to being "memory hungry", but reliably fails
8799 ;; even on a machine that should have plenty (12 GiB). Skip it.
8800 (substitute*
8801 "src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java"
8802 (("\\bassertEnsureBufferSizeExpandsToMaxBufferSize.*;")
8803 "return;"))))
8804 (replace 'install (install-from-pom "pom.xml")))))
8805 (native-inputs
8806 (list java-commons-lang3 java-junit))
8807 (propagated-inputs
8808 (list apache-commons-parent-pom-52))
8809 (home-page "https://commons.apache.org/codec/")
8810 (synopsis "Common encoders and decoders such as Base64, Hex, Phonetic and URLs")
8811 (description "The codec package contains simple encoder and decoders for
8812various formats such as Base64 and Hexadecimal. In addition to these widely
8813used encoders and decoders, the codec package also maintains a collection of
8814phonetic encoding utilities.
8815
8816This is a part of the Apache Commons Project.")
8817 (license license:asl2.0)))
8818
8819(define-public java-commons-codec-1.17.1
8820 (package
8821 (inherit java-commons-codec)
8822 (version "1.17.1")
8823 (source (origin
8824 (method url-fetch)
8825 (uri (string-append "mirror://apache/commons/codec/source/"
8826 "commons-codec-" version "-src.tar.gz"))
8827 (sha256
8828 (base32
8829 "0f9f80azc13phkwa2fdkmpj5fkh85hf081fz5mmm6rqflmk83wp9"))))
8830 (arguments
8831 (substitute-keyword-arguments (package-arguments java-commons-codec)
8832 ;; Tests require JUnit 5 (org.junit.jupiter) which is not
8833 ;; yet available in Guix.
8834 ((#:tests? _ #t) #f)))))
8835
8836(define-public java-commons-daemon
8837 (package
8838 (name "java-commons-daemon")
8839 (version "1.1.0")
8840 (source (origin
8841 (method url-fetch)
8842 (uri (string-append "mirror://apache/commons/daemon/source/"
8843 "commons-daemon-" version "-src.tar.gz"))
8844 (sha256
8845 (base32
8846 "141gkhfzv5v3pdhic6y4ardq2dhsa3v36j8wmmhy6f8mac48fp7n"))))
8847 (build-system ant-build-system)
8848 (arguments
8849 `(#:test-target "test"
8850 #:phases
8851 (modify-phases %standard-phases
8852 (add-after 'build 'build-javadoc ant-build-javadoc)
8853 (replace 'install (install-jars "dist"))
8854 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
8855 (native-inputs
8856 (list java-junit))
8857 (home-page "https://commons.apache.org/daemon/")
8858 (synopsis "Library to launch Java applications as daemons")
8859 (description "The Daemon package from Apache Commons can be used to
8860implement Java applications which can be launched as daemons. For example the
8861program will be notified about a shutdown so that it can perform cleanup tasks
8862before its process of execution is destroyed by the operation system.
8863
8864This package contains the Java library. You will also need the actual binary
8865for your architecture which is provided by the jsvc package.
8866
8867This is a part of the Apache Commons Project.")
8868 (license license:asl2.0)))
8869
8870(define-public java-javaewah
8871 (package
8872 (name "java-javaewah")
8873 (version "1.1.6")
8874 (source (origin
8875 (method git-fetch)
8876 (uri (git-reference
8877 (url "https://github.com/lemire/javaewah/")
8878 (commit (string-append "JavaEWAH-" version))))
8879 (file-name (git-file-name name version))
8880 (sha256
8881 (base32
8882 "1m8qcb1py76v7avbjjrkvyy6fhr5dk2ywy73gbsxqry04gkm2nhw"))))
8883 (build-system ant-build-system)
8884 (arguments `(#:jar-name "javaewah.jar"))
8885 (inputs
8886 (list java-junit java-hamcrest-core))
8887 (home-page "https://github.com/lemire/javaewah")
8888 (synopsis "Compressed alternative to the Java @code{BitSet} class")
8889 (description "This is a word-aligned compressed variant of the Java
8890@code{Bitset} class. It provides both a 64-bit and a 32-bit RLE-like
8891compression scheme. It can be used to implement bitmap indexes.
8892
8893The goal of word-aligned compression is not to achieve the best compression,
8894but rather to improve query processing time. Hence, JavaEWAH tries to save CPU
8895cycles, maybe at the expense of storage. However, the EWAH scheme is always
8896more efficient storage-wise than an uncompressed bitmap (as implemented in the
8897@code{BitSet} class by Sun).")
8898 ;; GPL2.0 derivates are explicitly allowed.
8899 (license license:asl2.0)))
8900
8901(define-public java-javaewah-1.2.3
8902 (package
8903 (inherit java-javaewah)
8904 (version "1.2.3")
8905 (source (origin
8906 (method git-fetch)
8907 (uri (git-reference
8908 (url "https://github.com/lemire/javaewah/")
8909 (commit (string-append "JavaEWAH-" version))))
8910 (file-name (git-file-name "java-javaewah" version))
8911 (sha256
8912 (base32
8913 "0bl1702pkzr8c8ygprmdc47lrb3m4yn4097jf6liiin54d4km8j5"))))
8914 (arguments
8915 `(#:jar-name "javaewah.jar"
8916 #:phases
8917 (modify-phases %standard-phases
8918 (add-before 'check 'enable-assertions
8919 (lambda _
8920 ;; FuzzEWAHTest requires assertions enabled in the JVM.
8921 (substitute* "build.xml"
8922 (("haltonfailure=\"yes\">")
8923 "haltonfailure=\"yes\"><jvmarg value=\"-ea\" />"))))
8924 (add-after 'build 'add-osgi-manifest
8925 (lambda _
8926 ;; The Maven Central jar has OSGi manifest attributes set by
8927 ;; Maven Bundle Plugin. The NetBeans build uses
8928 ;; Bundle-SymbolicName as a fallback for OpenIDE-Module when
8929 ;; wrapping external libraries as modules.
8930 (call-with-output-file "osgi-manifest.mf"
8931 (lambda (port)
8932 (display (string-append
8933 "Bundle-ManifestVersion: 2\n"
8934 "Bundle-SymbolicName: com.googlecode.javaewah.JavaEWAH\n"
8935 "Bundle-Version: " ,version "\n"
8936 "Export-Package: com.googlecode.javaewah,"
8937 "com.googlecode.javaewah.datastructure,"
8938 "com.googlecode.javaewah.symmetric\n"
8939 "Import-Package: com.googlecode.javaewah,"
8940 "com.googlecode.javaewah.datastructure\n"
8941 "Multi-Release: true\n")
8942 port)))
8943 (invoke "jar" "ufm" "build/jar/javaewah.jar"
8944 "osgi-manifest.mf")))
8945 (replace 'install (install-from-pom "pom.xml")))))))
8946
8947(define-public java-slf4j-api
8948 (package
8949 (name "java-slf4j-api")
8950 (version "1.7.25")
8951 (source (origin
8952 (method git-fetch)
8953 (uri (git-reference
8954 (url "https://github.com/qos-ch/slf4j")
8955 (commit (string-append "v_" version))))
8956 (file-name (git-file-name name version))
8957 (sha256
8958 (base32
8959 "15n42zq3k1iyn752nwdcbs44hxns2rmxhglwjfr4np7lxx56apjl"))
8960 (modules '((guix build utils)))
8961 ;; Delete bundled jars.
8962 (snippet
8963 '(begin
8964 (for-each delete-file (find-files "." "\\.jar$"))
8965 #t))))
8966 (build-system ant-build-system)
8967 (arguments
8968 `(#:jar-name "slf4j-api.jar"
8969 #:source-dir "slf4j-api/src/main"
8970 #:test-dir "slf4j-api/src/test"
8971 #:phases
8972 (modify-phases %standard-phases
8973 (add-after 'build 'regenerate-jar
8974 (lambda _
8975 ;; pom.xml ignores these files in the jar creation process. If we don't,
8976 ;; we get the error "This code should have never made it into slf4j-api.jar"
8977 (delete-file-recursively "build/classes/org/slf4j/impl")
8978 (invoke "jar" "-cf" "build/jar/slf4j-api.jar" "-C"
8979 "build/classes" ".")
8980 ;; The NetBeans wrapper module has an empty jar target and
8981 ;; relies on Bundle-SymbolicName from the Maven Central jar.
8982 (call-with-output-file "osgi-manifest.mf"
8983 (lambda (port)
8984 (display (string-append
8985 "Bundle-ManifestVersion: 2\n"
8986 "Bundle-SymbolicName: slf4j.api\n"
8987 "Bundle-Version: " ,version "\n"
8988 "Export-Package: org.slf4j,org.slf4j.spi,"
8989 "org.slf4j.helpers,org.slf4j.event\n"
8990 "Import-Package: org.slf4j.impl\n")
8991 port)))
8992 (invoke "jar" "ufm" "build/jar/slf4j-api.jar"
8993 "osgi-manifest.mf")))
8994 (add-before 'check 'dont-test-abstract-classes
8995 (lambda _
8996 ;; abstract classes are not meant to be run with junit
8997 (substitute* "build.xml"
8998 (("<include name=\"\\*\\*/\\*Test.java\" />")
8999 (string-append "<include name=\"**/*Test.java\" />"
9000 "<exclude name=\"**/MultithreadedInitializationTest"
9001 ".java\" />")))
9002 #t))
9003 (replace 'install
9004 (install-from-pom "slf4j-api/pom.xml")))))
9005 (propagated-inputs
9006 (list java-slf4j-parent))
9007 (native-inputs
9008 (list java-junit java-hamcrest-core))
9009 (home-page "https://www.slf4j.org/")
9010 (synopsis "Simple logging facade for Java")
9011 (description "The Simple Logging Facade for Java (SLF4J) serves as a
9012simple facade or abstraction for various logging
9013frameworks (e.g. @code{java.util.logging}, @code{logback}, @code{log4j})
9014allowing the end user to plug in the desired logging framework at deployment
9015time.")
9016 (license license:expat)))
9017
9018(define java-slf4j-parent
9019 (package
9020 (inherit java-slf4j-api)
9021 (name "java-slf4j-parent")
9022 (native-inputs `())
9023 (propagated-inputs '())
9024 (arguments
9025 `(#:tests? #f
9026 #:phases
9027 (modify-phases %standard-phases
9028 (delete 'build)
9029 (delete 'configure)
9030 (replace 'install
9031 (install-pom-file "pom.xml")))))))
9032
9033(define-public java-slf4j-simple
9034 (package
9035 (name "java-slf4j-simple")
9036 (version "1.7.25")
9037 (source (package-source java-slf4j-api))
9038 (build-system ant-build-system)
9039 (arguments
9040 `(#:jar-name "slf4j-simple.jar"
9041 #:source-dir "slf4j-simple/src/main"
9042 #:test-dir "slf4j-simple/src/test"
9043 #:test-exclude (list "**/*SimpleLoggerMultithreadedInitializationTest.java")
9044 #:phases
9045 (modify-phases %standard-phases
9046 ;; The tests need some test classes from slf4j-api
9047 (add-before 'check 'build-slf4j-api-test-helpers
9048 (lambda _
9049 ;; Add current dir to CLASSPATH ...
9050 (setenv "CLASSPATH"
9051 (string-append (getcwd) ":" (getenv "CLASSPATH")))
9052 ;; ... and build test helper classes here:
9053 (apply invoke
9054 `("javac" "-d" "."
9055 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
9056 (replace 'install
9057 (install-from-pom "slf4j-simple/pom.xml")))))
9058 (propagated-inputs
9059 (list java-slf4j-api))
9060 (native-inputs
9061 (list java-junit java-hamcrest-core))
9062 (home-page "https://www.slf4j.org/")
9063 (synopsis "Simple implementation of simple logging facade for Java")
9064 (description "SLF4J binding for the Simple implementation, which outputs
9065all events to System.err. Only messages of level INFO and higher are
9066printed.")
9067 (license license:expat)))
9068
9069(define-public java-slf4j-nop
9070 (package
9071 (name "java-slf4j-nop")
9072 (version "1.7.25")
9073 (source (package-source java-slf4j-api))
9074 (build-system ant-build-system)
9075 (arguments
9076 `(#:jar-name "slf4j-nop.jar"
9077 #:source-dir "slf4j-nop/src/main"
9078 #:test-dir "slf4j-nop/src/test"
9079 #:phases (modify-phases %standard-phases
9080 ;; The tests need some test classes from slf4j-api
9081 (add-before 'check 'build-slf4j-api-test-helpers
9082 (lambda _
9083 ;; Add current dir to CLASSPATH ...
9084 (setenv "CLASSPATH"
9085 (string-append (getcwd) ":"
9086 (getenv "CLASSPATH")))
9087 ;; ... and build test helper classes here:
9088 (apply invoke
9089 `("javac" "-d" "."
9090 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
9091 (replace 'install
9092 (install-from-pom "slf4j-nop/pom.xml")))))
9093 (propagated-inputs (list java-slf4j-api))
9094 (native-inputs (list java-junit java-hamcrest-core))
9095 (home-page "https://www.slf4j.org/")
9096 (synopsis "SLF4J binding that silently discards all logging messages")
9097 (description "Binding/provider for NOP, an implementation that silently
9098discards all logging messages.")
9099 (license license:expat)))
9100
9101(define-public java-slf4j-jdk14
9102 (package
9103 (name "java-slf4j-jdk14")
9104 (version "1.7.25")
9105 (source (package-source java-slf4j-api))
9106 (build-system ant-build-system)
9107 (arguments
9108 `(#:jar-name "slf4j-jdk14.jar"
9109 #:source-dir "slf4j-jdk14/src/main"
9110 #:test-dir "slf4j-jdk14/src/test"
9111 #:test-exclude (list "**/*MultithreadedInitializationTest.java")
9112 #:phases
9113 (modify-phases %standard-phases
9114 (add-after 'build 'add-osgi-manifest
9115 (lambda _
9116 ;; The NetBeans wrapper module has an empty jar target and
9117 ;; relies on Bundle-SymbolicName from the Maven Central jar.
9118 (call-with-output-file "osgi-manifest.mf"
9119 (lambda (port)
9120 (display (string-append
9121 "Bundle-ManifestVersion: 2\n"
9122 "Bundle-SymbolicName: slf4j.jdk14\n"
9123 "Bundle-Version: " ,version "\n"
9124 "Export-Package: org.slf4j.impl\n"
9125 "Import-Package: org.slf4j,org.slf4j.spi,"
9126 "org.slf4j.helpers,org.slf4j.event\n")
9127 port)))
9128 (invoke "jar" "ufm" "build/jar/slf4j-jdk14.jar"
9129 "osgi-manifest.mf")))
9130 (add-before 'check 'build-slf4j-api-test-helpers
9131 (lambda _
9132 (setenv "CLASSPATH"
9133 (string-append (getcwd) ":" (getenv "CLASSPATH")))
9134 (apply invoke
9135 `("javac" "-d" "."
9136 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
9137 (replace 'install
9138 (install-from-pom "slf4j-jdk14/pom.xml")))))
9139 (propagated-inputs (list java-slf4j-api))
9140 (native-inputs (list java-junit java-hamcrest-core))
9141 (home-page "https://www.slf4j.org/")
9142 (synopsis "SLF4J binding for @code{java.util.logging}")
9143 (description "SLF4J binding for the JDK14 @code{java.util.logging}
9144framework.")
9145 (license license:expat)))
9146
9147(define-public antlr2
9148 (package
9149 (name "antlr2")
9150 (version "2.7.7")
9151 (source (origin
9152 (method url-fetch)
9153 (uri (string-append "https://www.antlr2.org/download/antlr-"
9154 version ".tar.gz"))
9155 (sha256
9156 (base32
9157 "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5"))
9158 (modules '((guix build utils)))
9159 (snippet
9160 '(begin
9161 (delete-file "antlr.jar")
9162 (substitute* "lib/cpp/antlr/CharScanner.hpp"
9163 (("#include <map>")
9164 (string-append
9165 "#include <map>\n"
9166 "#define EOF (-1)\n"
9167 "#include <strings.h>")))
9168 (substitute* "configure"
9169 (("/bin/sh") "sh"))
9170 #t))))
9171 (build-system gnu-build-system)
9172 (arguments
9173 `(#:tests? #f ; no test target
9174 #:imported-modules ((guix build ant-build-system)
9175 ,@%default-gnu-imported-modules)
9176 #:modules (((guix build ant-build-system) #:prefix ant:)
9177 (guix build gnu-build-system)
9178 (guix build utils))
9179 #:phases
9180 (modify-phases %standard-phases
9181 (add-after 'install 'strip-jar-timestamps
9182 (assoc-ref ant:%standard-phases 'strip-jar-timestamps))
9183 (add-before 'configure 'fix-timestamp
9184 (lambda _
9185 (substitute* "configure"
9186 (("^TIMESTAMP.*") "TIMESTAMP=19700101\n"))
9187 #t))
9188 (add-after 'configure 'fix-bin-ls
9189 (lambda _
9190 (substitute* (find-files "." "Makefile")
9191 (("/bin/ls") "ls"))
9192 #t)))))
9193 (native-inputs
9194 `(("which" ,which)
9195 ("zip" ,zip)
9196 ("java" ,icedtea "jdk")))
9197 (inputs
9198 `(("java" ,icedtea)))
9199 (home-page "https://www.antlr2.org")
9200 (synopsis "Framework for constructing recognizers, compilers, and translators")
9201 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
9202is a language tool that provides a framework for constructing recognizers,
9203compilers, and translators from grammatical descriptions containing Java, C#,
9204C++, or Python actions. ANTLR provides excellent support for tree construction,
9205tree walking, and translation.")
9206 (license license:public-domain)))
9207
9208(define-public java-stringtemplate-3
9209 (package
9210 (name "java-stringtemplate")
9211 (version "3.2.1")
9212 (source (origin
9213 (method url-fetch)
9214 (uri (string-append "https://github.com/antlr/website-st4/raw/"
9215 "gh-pages/download/stringtemplate-"
9216 version ".tar.gz"))
9217 (sha256
9218 (base32
9219 "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is"))))
9220 (build-system ant-build-system)
9221 (arguments
9222 `(#:jar-name (string-append ,name "-" ,version ".jar")
9223 #:test-dir "test"
9224 #:modules ((guix build ant-build-system)
9225 (guix build utils)
9226 (srfi srfi-1))
9227 #:phases
9228 (modify-phases %standard-phases
9229 (add-before 'check 'fix-tests
9230 (lambda _
9231 (substitute* "build.xml"
9232 (("\\$\\{test.home\\}/java")
9233 "${test.home}/org"))
9234 #t))
9235 (add-before 'build 'generate-grammar
9236 (lambda _
9237 (with-directory-excursion "src/org/antlr/stringtemplate/language/"
9238 (for-each (lambda (file)
9239 (format #t "~a\n" file)
9240 (invoke "antlr" file))
9241 '("template.g" "angle.bracket.template.g" "action.g"
9242 "eval.g" "group.g" "interface.g")))
9243 #t)))))
9244 (native-inputs
9245 `(("antlr" ,antlr2)
9246 ("java-junit" ,java-junit)))
9247 (home-page "https://www.stringtemplate.org")
9248 (synopsis "Template engine to generate formatted text output")
9249 (description "StringTemplate is a java template engine (with ports for C#,
9250Objective-C, JavaScript, Scala) for generating source code, web pages, emails,
9251or any other formatted text output. StringTemplate is particularly good at
9252code generators, multiple site skins, and internationalization / localization.
9253StringTemplate also powers ANTLR.")
9254 (license license:bsd-3)))
9255
9256;; antlr3 is partially written using antlr3 grammar files. It also depends on
9257;; ST4 (stringtemplate4), which is also partially written using antlr3 grammar
9258;; files and uses antlr3 at runtime. The latest version requires a recent version
9259;; of antlr3 at runtime.
9260;; Fortunately, ST4 4.0.6 can be built with an older antlr3, and we use antlr3.3.
9261;; This version of ST4 is sufficient for the latest antlr3.
9262;; We use ST4 4.0.6 to build a boostrap antlr3 (latest version), and build
9263;; the latest ST4 with it. Then we build our final antlr3 that will be linked
9264;; against the latest ST4.
9265;; antlr3.3 still depends on antlr3 to generate some files, so we use an
9266;; even older version, antlr3.1, to generate them. Fortunately antlr3.1 uses
9267;; only grammar files with the antlr2 syntax.
9268;; So we build antlr3.1 -> antlr3.3 -> ST4.0.6 -> antlr3-bootstrap -> ST4 -> antlr3.
9269
9270(define-public java-stringtemplate
9271 (package (inherit java-stringtemplate-3)
9272 (name "java-stringtemplate")
9273 (version "4.0.8")
9274 (source (origin
9275 (method url-fetch)
9276 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/"
9277 version ".tar.gz"))
9278 (file-name (string-append name "-" version ".tar.gz"))
9279 (sha256
9280 (base32
9281 "1pri8hqa95rfdkjy55icl5q1m09zwp5k67ib14abas39s4v3w087"))))
9282 (build-system ant-build-system)
9283 (arguments
9284 `(#:jar-name (string-append ,name "-" ,version ".jar")
9285 #:tests? #f ; FIXME: tests fail for unknown reasons
9286 #:test-dir "test"
9287 #:modules ((guix build ant-build-system)
9288 (guix build utils)
9289 (srfi srfi-1))
9290 #:phases
9291 (modify-phases %standard-phases
9292 (add-before 'check 'fix-test-target
9293 (lambda _
9294 (substitute* "build.xml"
9295 (("\\$\\{test.home\\}/java") "${test.home}/")
9296 (("\\*Test.java") "Test*.java"))
9297 #t))
9298 (add-before 'build 'generate-grammar
9299 (lambda _
9300 (with-directory-excursion "src/org/stringtemplate/v4/compiler/"
9301 (for-each (lambda (file)
9302 (format #t "~a\n" file)
9303 (invoke "antlr3" file))
9304 '("STParser.g" "Group.g" "CodeGenerator.g")))
9305 #t)))))
9306 (inputs
9307 `(("antlr3" ,antlr3-bootstrap)
9308 ("antlr2" ,antlr2)
9309 ("java-stringtemplate" ,java-stringtemplate-3)
9310 ("java-junit" ,java-junit)))))
9311
9312(define-public java-stringtemplate-4.0.6
9313 (package (inherit java-stringtemplate)
9314 (name "java-stringtemplate")
9315 (version "4.0.6")
9316 (source (origin
9317 (method url-fetch)
9318 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/ST-"
9319 version ".tar.gz"))
9320 (file-name (string-append name "-" version ".tar.gz"))
9321 (sha256
9322 (base32
9323 "0hjmh1ahdsh3w825i67mli9l4nncc4l6hdbf9ma91jvlj590sljp"))))
9324 (inputs
9325 `(("antlr3" ,antlr3-3.3)
9326 ("antlr2" ,antlr2)
9327 ("java-stringtemplate" ,java-stringtemplate-3)))))
9328
9329(define-public antlr3
9330 (package
9331 (name "antlr3")
9332 (version "3.5.2")
9333 (source (origin
9334 (method git-fetch)
9335 (uri (git-reference
9336 (url "https://github.com/antlr/antlr3")
9337 (commit version)))
9338 (file-name (git-file-name name version))
9339 (sha256
9340 (base32
9341 "0cafavrjmzqhklghrk8c2jqxkdwxgzskm20pbrfd3r41cn00dpnf"))))
9342 (build-system ant-build-system)
9343 (arguments
9344 `(#:jar-name (string-append ,name "-" ,version ".jar")
9345 #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3"
9346 #:tests? #f
9347 #:phases
9348 (modify-phases %standard-phases
9349 (add-after 'install 'bin-install
9350 (lambda* (#:key inputs outputs #:allow-other-keys)
9351 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
9352 (bin (string-append (assoc-ref outputs "out") "/bin")))
9353 (mkdir-p bin)
9354 (with-output-to-file (string-append bin "/antlr3")
9355 (lambda _
9356 (display
9357 (string-append "#!" (which "sh") "\n"
9358 "java -cp " jar "/" ,name "-" ,version ".jar:"
9359 (string-concatenate
9360 (find-files (assoc-ref inputs "stringtemplate")
9361 ".*\\.jar"))
9362 ":"
9363 (string-concatenate
9364 (find-files (assoc-ref inputs "stringtemplate4")
9365 ".*\\.jar"))
9366 ":"
9367 (string-concatenate
9368 (find-files (string-append
9369 (assoc-ref inputs "antlr")
9370 "/lib")
9371 ".*\\.jar"))
9372 " org.antlr.Tool $*"))))
9373 (chmod (string-append bin "/antlr3") #o755))
9374 #t))
9375 (add-before 'build 'generate-grammar
9376 (lambda _
9377 (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/")
9378 (for-each (lambda (file)
9379 (display file)
9380 (newline)
9381 (invoke "antlr3" file))
9382 '("ANTLR.g" "ANTLRTreePrinter.g" "ActionAnalysis.g"
9383 "AssignTokenTypesWalker.g"
9384 "ActionTranslator.g" "TreeToNFAConverter.g"
9385 "ANTLRv3.g" "ANTLRv3Tree.g" "LeftRecursiveRuleWalker.g"
9386 "CodeGenTreeWalker.g" "DefineGrammarItemsWalker.g"))
9387 (substitute* "ANTLRParser.java"
9388 (("public Object getTree") "public GrammarAST getTree"))
9389 (substitute* "ANTLRv3Parser.java"
9390 (("public Object getTree") "public CommonTree getTree"))
9391 (chdir "../../../../../java")
9392 (substitute* "org/antlr/tool/LeftRecursiveRuleAnalyzer.java"
9393 (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*;
9394import org.antlr.grammar.v3.ANTLRTreePrinter;"))
9395 (substitute* "org/antlr/tool/ErrorManager.java"
9396 (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") ""))
9397 (chdir "../../../..")
9398 #t))
9399 (add-before 'build 'fix-build-xml
9400 (lambda _
9401 (substitute* "build.xml"
9402 (("target name=\"compile\">")
9403 "target name=\"compile\">
9404<copy todir=\"${classes.dir}\">
9405<fileset dir=\"tool/src/main/resources\">
9406<include name=\"**/*.stg\"/>
9407<include name=\"**/*.st\"/>
9408<include name=\"**/*.sti\"/>
9409<include name=\"**/STLexer.tokens\"/>
9410</fileset>
9411</copy>"))
9412 #t)))))
9413 (native-inputs
9414 `(("antlr" ,antlr2)
9415 ("antlr3" ,antlr3-bootstrap)))
9416 (inputs
9417 `(("junit" ,java-junit)
9418 ("stringtemplate" ,java-stringtemplate-3)
9419 ("stringtemplate4" ,java-stringtemplate)))
9420 (propagated-inputs
9421 `(("stringtemplate" ,java-stringtemplate-3)
9422 ("antlr" ,antlr2)
9423 ("stringtemplate4" ,java-stringtemplate-4.0.6)))
9424 (home-page "https://www.antlr3.org")
9425 (synopsis "Framework for constructing recognizers, compilers, and translators")
9426 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
9427is a language tool that provides a framework for constructing recognizers,
9428compilers, and translators from grammatical descriptions containing Java, C#,
9429C++, or Python actions. ANTLR provides excellent support for tree construction,
9430tree walking, and translation.")
9431 (license license:bsd-3)))
9432
9433(define-public antlr3-bootstrap
9434 (package
9435 (inherit antlr3)
9436 (name "antlr3-bootstrap")
9437 (native-inputs
9438 `(("antlr" ,antlr2)
9439 ("antlr3" ,antlr3-3.3)))
9440 (inputs
9441 `(("junit" ,java-junit)))
9442 (properties '((hidden? . #t))))) ;for bootstrapping purposes only
9443
9444(define-public antlr3-3.3
9445 (package
9446 (inherit antlr3)
9447 (name "antlr3")
9448 (version "3.3")
9449 (source (origin
9450 (method url-fetch)
9451 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
9452 "gh-pages/download/antlr-"
9453 version ".tar.gz"))
9454 (sha256
9455 (base32
9456 "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m"))
9457 (patches
9458 (search-patches "antlr3-3_3-fix-java8-compilation.patch"))))
9459 (arguments
9460 `(#:jar-name (string-append ,name "-" ,version ".jar")
9461 #:source-dir (string-join '("tool/src/main/java"
9462 "runtime/Java/src/main/java"
9463 "tool/src/main/antlr2"
9464 "tool/src/main/antlr3")
9465 ":")
9466 #:tests? #f ; FIXME: tests seem to require maven plugin
9467 #:modules ((guix build ant-build-system)
9468 (guix build utils)
9469 (srfi srfi-1))
9470 #:phases
9471 (modify-phases %standard-phases
9472 (add-after 'install 'bin-install
9473 (lambda* (#:key inputs outputs #:allow-other-keys)
9474 (let* ((out (assoc-ref outputs "out"))
9475 (jar (string-append out "/share/java"))
9476 (bin (string-append out "/bin")))
9477 (mkdir-p bin)
9478 (with-output-to-file (string-append bin "/antlr3")
9479 (lambda _
9480 (display
9481 (string-append
9482 "#!" (which "sh") "\n"
9483 "java -cp " jar "/antlr3-3.3.jar:"
9484 (string-join
9485 (append (find-files (assoc-ref inputs "java-stringtemplate")
9486 ".*\\.jar$")
9487 (find-files (string-append (assoc-ref inputs "antlr")
9488 "/lib")
9489 ".*\\.jar$"))
9490 ":")
9491 " org.antlr.Tool $*"))))
9492 (chmod (string-append bin "/antlr3") #o755)
9493 #t)))
9494 (add-before 'build 'generate-grammar
9495 (lambda _
9496 (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java"
9497 (("import org.antlr.grammar.v2.\\*;")
9498 "import org.antlr.grammar.v2.*;\n
9499import org.antlr.grammar.v2.TreeToNFAConverter;\n
9500import org.antlr.grammar.v2.DefineGrammarItemsWalker;\n
9501import org.antlr.grammar.v2.ANTLRTreePrinter;"))
9502 (with-directory-excursion "tool/src/main/antlr2/org/antlr/grammar/v2/"
9503 (for-each (lambda (file)
9504 (format #t "~a\n" file)
9505 (invoke "antlr" file))
9506 '("antlr.g" "antlr.print.g" "assign.types.g"
9507 "buildnfa.g" "codegen.g" "define.g")))
9508 (with-directory-excursion "tool/src/main/antlr3/org/antlr/grammar/v3/"
9509 (for-each (lambda (file)
9510 (format #t "~a\n" file)
9511 (invoke "antlr3" file))
9512 '("ActionAnalysis.g" "ActionTranslator.g" "ANTLRv3.g"
9513 "ANTLRv3Tree.g")))
9514 #t))
9515 (add-before 'build 'fix-build-xml
9516 (lambda _
9517 (substitute* "build.xml"
9518 (("target name=\"compile\">")
9519 "target name=\"compile\">
9520<copy todir=\"${classes.dir}\">
9521<fileset dir=\"tool/src/main/resources\">
9522<include name=\"**/*.stg\"/>
9523<include name=\"**/*.st\"/>
9524<include name=\"**/*.sti\"/>
9525<include name=\"**/STLexer.tokens\"/>
9526</fileset>
9527</copy>"))
9528 #t)))))
9529 (native-inputs
9530 `(("antlr" ,antlr2)
9531 ("antlr3" ,antlr3-3.1)))
9532 (inputs
9533 `(("junit" ,java-junit)))
9534 (propagated-inputs
9535 `(("java-stringtemplate" ,java-stringtemplate-3)
9536 ("antlr" ,antlr2)))
9537 (properties (alist-delete 'hidden? (package-properties antlr3)))))
9538
9539(define-public antlr3-3.1
9540 (package
9541 (inherit antlr3)
9542 (version "3.1")
9543 (source (origin
9544 (method url-fetch)
9545 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
9546 "gh-pages/download/antlr-"
9547 version ".tar.gz"))
9548 (sha256
9549 (base32
9550 "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z"))
9551 (patches
9552 (search-patches "antlr3-3_1-fix-java8-compilation.patch"))))
9553 (arguments
9554 `(#:jar-name (string-append "antlr3-" ,version ".jar")
9555 #:source-dir "src:runtime/Java/src"
9556 #:tests? #f
9557 #:phases
9558 (modify-phases %standard-phases
9559 (add-after 'install 'bin-install
9560 (lambda* (#:key inputs outputs #:allow-other-keys)
9561 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
9562 (bin (string-append (assoc-ref outputs "out") "/bin")))
9563 (mkdir-p bin)
9564 (with-output-to-file (string-append bin "/antlr3")
9565 (lambda _
9566 (display
9567 (string-append "#!" (which "sh") "\n"
9568 "java -cp " jar "/antlr3-3.1.jar:"
9569 (string-concatenate
9570 (find-files (assoc-ref inputs "stringtemplate")
9571 ".*\\.jar"))
9572 ":"
9573 (string-concatenate
9574 (find-files (string-append
9575 (assoc-ref inputs "antlr")
9576 "/lib")
9577 ".*\\.jar"))
9578 " org.antlr.Tool $*"))))
9579 (chmod (string-append bin "/antlr3") #o755))
9580 #t))
9581 (add-before 'build 'generate-grammar
9582 (lambda _
9583 (let ((dir "src/org/antlr/tool/"))
9584 (for-each (lambda (file)
9585 (display file)
9586 (newline)
9587 (invoke "antlr" "-o" dir (string-append dir file)))
9588 '("antlr.g" "antlr.print.g" "assign.types.g"
9589 "buildnfa.g" "define.g")))
9590 (format #t "codegen.g\n")
9591 (invoke "antlr" "-o" "src/org/antlr/codegen"
9592 "src/org/antlr/codegen/codegen.g")
9593 #t))
9594 (add-before 'build 'fix-build-xml
9595 (lambda _
9596 (substitute* "build.xml"
9597 (("target name=\"compile\">")
9598 "target name=\"compile\">
9599<copy todir=\"${classes.dir}\">
9600<fileset dir=\"src\">
9601<include name=\"**/*.stg\"/>
9602<include name=\"**/*.st\"/>
9603<include name=\"**/*.sti\"/>
9604<include name=\"**/STLexer.tokens\"/>
9605</fileset>
9606</copy>"))
9607 #t)))))
9608 (native-inputs
9609 `(("antlr" ,antlr2)))
9610 (inputs
9611 `(("junit" ,java-junit)))
9612 (propagated-inputs
9613 `(("stringtemplate" ,java-stringtemplate-3)))))
9614
9615(define-public java-treelayout
9616 (package
9617 (name "java-treelayout")
9618 (version "1.0.3")
9619 (source (origin
9620 (method git-fetch)
9621 (uri (git-reference
9622 (url "https://github.com/abego/treelayout")
9623 (commit (string-append "v" version))))
9624 (file-name (git-file-name name version))
9625 (sha256
9626 (base32
9627 "18my8ql9b1y0n0zrvkih7xfhf3dpgfhyfifvkcfhmwcvw3divxak"))))
9628 (build-system ant-build-system)
9629 (arguments
9630 `(#:jar-name (string-append ,name "-" ,version ".jar")
9631 #:source-dir "org.abego.treelayout/src/main/java"
9632 #:test-dir "org.abego.treelayout/src/test"))
9633 (inputs
9634 (list java-junit))
9635 (native-inputs
9636 (list java-hamcrest-core))
9637 (home-page "https://treelayout.sourceforge.net")
9638 (synopsis "Tree Layout Algorithm in Java")
9639 (description "TreeLayout creates tree layouts for arbitrary trees. It is
9640not restricted to a specific output or format, but can be used for any kind of
9641two dimensional diagram. Examples are Swing based components, SVG files, etc.
9642This is possible because TreeLayout separates the layout of a tree from the
9643actual rendering.")
9644 (license license:bsd-3)))
9645
9646(define-public java-antlr4-runtime
9647 (package
9648 (name "java-antlr4-runtime")
9649 (version "4.10.1")
9650 (source (origin
9651 (method git-fetch)
9652 (uri (git-reference
9653 (url "https://github.com/antlr/antlr4")
9654 (commit version)))
9655 (file-name (git-file-name name version))
9656 (sha256
9657 (base32
9658 "0ldvd9jm4nrivaw7i7wh1q40q6xgzmzirsywiakbhg8sppagqlv7"))
9659 (patches
9660 (search-patches "java-antlr4-Add-standalone-generator.patch"))))
9661 (build-system ant-build-system)
9662 (arguments
9663 `(#:jar-name "java-antlr4-runtime.jar"
9664 #:source-dir "runtime/Java/src/org"
9665 #:tests? #f; tests depend on java-antlr4 itself
9666 #:phases
9667 (modify-phases %standard-phases
9668 (add-before 'build 'copy-resources
9669 (lambda _
9670 (copy-recursively "runtime/Java/src/main/dot"
9671 "build/classes")
9672 #t)))))
9673 (home-page "https://www.antlr.org")
9674 (synopsis "ANTLR runtime library")
9675 (description "This package contains the runtime library used with generated
9676sources by ANTLR.")
9677 (license license:bsd-3)))
9678
9679(define-public cpp-antlr4-runtime
9680 (package
9681 (inherit java-antlr4-runtime)
9682 (name "cpp-antlr4-runtime")
9683 (properties '((upstream-name . "antlr4-cpp-runtime")))
9684 (outputs '("out" "static"))
9685 (build-system cmake-build-system)
9686 (arguments
9687 (list
9688 ;; TODO: try to run the tests under
9689 ;; runtime-testsuite/test/org/antlr/v4/test/runtime/cpp with antlr4.
9690 #:phases
9691 #~(modify-phases %standard-phases
9692 (add-after 'unpack 'chdir
9693 (lambda _
9694 (chdir "runtime/Cpp")))
9695 (add-after 'chdir 'unbundle-googletest
9696 (lambda _
9697 (substitute* "runtime/CMakeLists.txt"
9698 (("^ FetchContent_MakeAvailable.*")
9699 "")
9700 (("gtest_main" all)
9701 (string-append "gtest " all)))))
9702 (add-after 'install 'move-static-library
9703 (lambda* (#:key outputs #:allow-other-keys)
9704 (let ((static (assoc-ref outputs "static"))
9705 (libantlr4-runtime.a (search-input-file
9706 outputs "lib/libantlr4-runtime.a")))
9707 (mkdir-p (string-append static "/lib"))
9708 (rename-file
9709 libantlr4-runtime.a
9710 (string-append static "/lib/"
9711 (basename libantlr4-runtime.a)))))))))
9712 (native-inputs (list googletest pkg-config))
9713 (inputs (list `(,util-linux "lib"))) ;libuuid
9714 (synopsis "ANTLR C++ runtime library")
9715 (description "This package contains the C++ runtime library used with C++
9716generated sources by ANTLR.")))
9717
9718(define-deprecated-package java-antlr4-runtime-cpp
9719 cpp-antlr4-runtime)
9720
9721(define-public python-antlr4-runtime
9722 (package
9723 (inherit java-antlr4-runtime)
9724 (name "python-antlr4-runtime")
9725 (properties '((upstream-name . "antlr4-python3-runtime")))
9726 (build-system pyproject-build-system)
9727 (arguments
9728 (list
9729 #:test-backend #~'custom
9730 #:test-flags #~'("tests/run.py" "--verbose")
9731 #:phases
9732 #~(modify-phases %standard-phases
9733 (add-after 'unpack 'chdir
9734 (lambda _
9735 (chdir "runtime/Python3")))
9736 ;; TODO: Remove when updating ANTLR4:
9737 ;; https://github.com/antlr/antlr4/pull/4593
9738 (add-after 'chdir 'fix-python-3.12-compatibility
9739 (lambda _
9740 (substitute* "tests/TestIntervalSet.py"
9741 (("assertEquals") "assertEqual"))))
9742 (add-after 'chdir 'regenerate-parsers
9743 (lambda _
9744 (invoke "antlr4" "-no-listener" "-Dlanguage=Python3"
9745 "src/antlr4/xpath/XPathLexer.g4")
9746 (invoke "antlr4" "-no-listener" "-Dlanguage=Python3"
9747 "tests/expr/Expr.g4"))))))
9748 (native-inputs (list antlr4 python-setuptools))
9749 (synopsis "ANTLR Python runtime library")
9750 (description "This package contains the Python runtime library used with
9751Python generated sources by ANTLR.")))
9752
9753(define-deprecated-package java-antlr4-runtime-python
9754 python-antlr4-runtime)
9755
9756(define-public antlr4
9757 (package
9758 (inherit java-antlr4-runtime)
9759 (name "antlr4")
9760 (arguments
9761 `(#:jar-name "antlr4.jar"
9762 #:source-dir "tool/src"
9763 #:test-dir "tool-testsuite/test:runtime-testsuite/test"
9764 #:test-include (list "**/Test*.java")
9765 #:test-exclude (list
9766 ;; These have no runnable methods and fail because
9767 ;; test-include above is too broad.
9768 "**/TestContext.java"
9769 "**/TestOutputReading.java"
9770 ;; no @Test methods
9771 "**/TestParserErrors.java"
9772 "**/TestSemPredEvalParser.java"
9773 "**/TestSets.java"
9774 "**/TestListeners.java"
9775 "**/TestParseTrees.java"
9776 "**/TestParserExec.java"
9777 "**/TestLexerErrors.java"
9778 "**/TestPerformance.java"
9779 "**/TestCompositeParsers.java"
9780 "**/TestLexerExec.java"
9781 "**/TestSemPredEvalLexer.java"
9782 "**/TestLeftRecursion.java"
9783 "**/TestFullContextParsing.java"
9784 "**/TestCompositeLexers.java"
9785 ;; Null pointer exception
9786 "**/TestCompositeGrammars.java")
9787 #:phases
9788 (modify-phases %standard-phases
9789 (add-before 'build 'fix-build.xml
9790 (lambda _
9791 ;; tests are not in a java subdirectory
9792 (substitute* "build.xml"
9793 (("\\$\\{test.home\\}/java") "${test.home}"))
9794 #t))
9795 ;; tests require to have a working antlr4 binary
9796 (delete 'check)
9797 (add-after 'install 'check
9798 (lambda _
9799 (invoke "ant" "compile-tests")
9800 (invoke "ant" "check" "-Dtest.home=runtime-testsuite/test")
9801 (invoke "ant" "check" "-Dtest.home=tool-testsuite/test")
9802 #t))
9803 (add-before 'check 'remove-unrelated-languages
9804 (lambda _
9805 ;; There are tests for other languages that ANTLR can generate, but
9806 ;; we don't have the infrastructure for that yet. Let's test Java
9807 ;; generation only.
9808 (for-each
9809 (lambda (language)
9810 (delete-file-recursively
9811 (string-append "runtime-testsuite/test/org/antlr/v4/test/runtime/"
9812 language)))
9813 '("cpp" "csharp" "go" "javascript" "php" "python" "python2"
9814 "python3" "swift"))
9815 #t))
9816 (add-before 'check 'generate-test-parsers
9817 (lambda* (#:key outputs #:allow-other-keys)
9818 (define (run-antlr dir filename package)
9819 (invoke "antlr4" "-lib" dir "-visitor" "-no-listener"
9820 "-package" package (string-append dir "/" filename)
9821 "-Xlog"))
9822 (setenv "PATH" (string-append (getenv "PATH") ":"
9823 (assoc-ref outputs "out") "/bin"))
9824 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
9825 "Java.g4" "org.antlr.v4.test.runtime.java.api")
9826 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
9827 "VisitorBasic.g4" "org.antlr.v4.test.runtime.java.api")
9828 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
9829 "VisitorCalc.g4" "org.antlr.v4.test.runtime.java.api")
9830 #t))
9831 (add-before 'check 'remove-graphemes
9832 (lambda _
9833 ;; When running antlr on grahemes.g4, we get a runtime exception:
9834 ;; set is empty. So delete the file that depends on it.
9835 (delete-file
9836 "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/perf/TimeLexerSpeed.java")
9837 #t))
9838 (add-after 'install 'bin-install
9839 (lambda* (#:key inputs outputs #:allow-other-keys)
9840 (let* ((output (assoc-ref outputs "out"))
9841 (bin (string-append output "/bin"))
9842 (bin/antlr4 (string-append bin "/antlr4")))
9843 (mkdir-p bin)
9844 (with-output-to-file bin/antlr4
9845 (lambda _
9846 (display
9847 (string-append
9848 "#!"
9849 (search-input-file inputs "bin/sh")
9850 "\n"
9851 (string-append (assoc-ref inputs "openjdk")
9852 "/bin/java")
9853 " -cp "
9854 (string-append output "/share/java/antlr4.jar")
9855 ":"
9856 (string-join
9857 (apply append
9858 (map (lambda (input)
9859 (find-files (assoc-ref inputs input)
9860 "\\.jar$"))
9861 '("antlr3" "java-stringtemplate"
9862 "java-antlr4-runtime" "java-treelayout"
9863 "java-jsonp-api" "java-icu4j")))
9864 ":")
9865 " org.antlr.v4.Tool $*\n"))))
9866 (chmod bin/antlr4 #o755))))
9867 (add-before 'build 'copy-resources
9868 (lambda _
9869 (copy-recursively "tool/resources/" "build/classes")
9870 #t))
9871 (add-before 'build 'generate-unicode
9872 (lambda _
9873 ;; First: build the generator
9874 (invoke "javac" "-cp" (getenv "CLASSPATH")
9875 "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java"
9876 "tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java")
9877 ;; Then use it
9878 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
9879 ":tool/src:runtime/Java")
9880 "org.antlr.v4.unicode.UnicodeRenderer"
9881 "tool/resources/org/antlr/v4/tool/templates"
9882 "unicodedata"
9883 "tool/src/org/antlr/v4/unicode/UnicodeData.java")
9884 ;; It seems there is a bug with our ST4
9885 (substitute* "tool/src/org/antlr/v4/unicode/UnicodeData.java"
9886 (("\\\\>") ">"))
9887 ;; Remove the additional file
9888 (delete-file "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java")
9889 #t))
9890 (add-before 'build 'generate-grammar
9891 (lambda* (#:key inputs #:allow-other-keys)
9892 (with-directory-excursion "tool/src/org/antlr/v4/parse"
9893 (for-each (lambda (file)
9894 (display file)
9895 (newline)
9896 (invoke "antlr3" file))
9897 '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g"
9898 "GrammarTreeVisitor.g" "ATNBuilder.g"
9899 "ActionSplitter.g" "LeftRecursiveRuleWalker.g")))
9900 (with-directory-excursion "tool/src/org/antlr/v4/codegen"
9901 (install-file "../parse/ANTLRParser.tokens" ".")
9902 (display "SourceGenTriggers.g\n")
9903 (invoke "antlr3" "SourceGenTriggers.g"))
9904 #t)))))
9905 (inputs
9906 (list antlr3
9907 java-antlr4-runtime
9908 java-icu4j
9909 java-jsonp-api
9910 java-stringtemplate
9911 java-treelayout
9912 openjdk))
9913 (native-inputs
9914 (list java-junit))
9915 (synopsis "Parser and lexer generator in Java")
9916 (description "ANTLR (ANother Tool for Language Recognition) is a powerful
9917parser generator for reading, processing, executing, or translating structured
9918text or binary files. It's widely used to build languages, tools, and
9919frameworks. From a grammar, ANTLR generates a parser that can build and walk
9920parse trees.")))
9921
9922(define-public java-antlr4-runtime-4.1
9923 (package
9924 (inherit java-antlr4-runtime)
9925 (version "4.1")
9926 (source (origin
9927 (method git-fetch)
9928 (uri (git-reference
9929 (url "https://github.com/antlr/antlr4")
9930 (commit version)))
9931 (file-name (git-file-name "antlr4" version))
9932 (sha256
9933 (base32
9934 "1i8hmx5an58cjyvhji0xgpvd6lq00z1k1mjys025q2wqc25wv4c1"))))
9935 (arguments
9936 (substitute-keyword-arguments (package-arguments java-antlr4-runtime)
9937 ((#:phases phases)
9938 `(modify-phases ,phases
9939 (add-before 'configure 'chmod
9940 (lambda _
9941 (chmod "build.xml" #o644)
9942 #t))))))
9943 (inputs
9944 (list java-treelayout))))
9945
9946(define-public antlr4-4.1
9947 (package
9948 (inherit antlr4)
9949 (version (package-version java-antlr4-runtime-4.1))
9950 (source (package-source java-antlr4-runtime-4.1))
9951 (arguments
9952 (substitute-keyword-arguments (package-arguments antlr4)
9953 ((#:test-dir _)
9954 "tool/test")
9955 ((#:test-exclude excludes)
9956 `(list "**/TestParseErrors.java"
9957 "**/TestTopologicalSort.java"
9958 ,@excludes))
9959 ((#:phases phases)
9960 `(modify-phases ,phases
9961 (delete 'generate-unicode)
9962 (replace 'check
9963 (lambda _
9964 (invoke "ant" "check")
9965 #t))
9966 (add-before 'configure 'chmod
9967 (lambda _
9968 (chmod "build.xml" #o644)
9969 #t))
9970 (delete 'remove-graphemes)
9971 (delete 'remove-unrelated-languages)
9972 (delete 'generate-test-parsers)))))
9973 (inputs
9974 (alist-replace
9975 "java-antlr4-runtime" (list java-antlr4-runtime-4.1)
9976 (package-inputs antlr4)))))
9977
9978(define-public java-tunnelvisionlabs-antlr4-runtime-annotations
9979 (package
9980 (inherit java-antlr4-runtime)
9981 (name "java-tunnelvisionlabs-antlr4-runtime-annotations")
9982 (version "4.7.4")
9983 (source (origin
9984 (method git-fetch)
9985 (uri (git-reference
9986 (url "https://github.com/tunnelvisionlabs/antlr4")
9987 (commit (string-append version "-opt"))))
9988 (file-name (git-file-name "java-tunnelvisionlabs-antlr4" version))
9989 (sha256
9990 (base32
9991 "1mf2lvvsszpialsk23ma83pwp50nd32lrbjpa847zlm5gmranbr8"))
9992 (patches
9993 (search-patches "java-antlr4-Add-standalone-generator.patch"
9994 "java-tunnelvisionlabs-antlr-code-too-large.patch"))))
9995 (arguments
9996 `(#:jar-name "java-antlr4-runtime-annotations.jar"
9997 #:source-dir "runtime/JavaAnnotations/src"
9998 #:tests? #f; no tests
9999 #:phases
10000 (modify-phases %standard-phases
10001 (add-after 'build 'copy-resources
10002 (lambda _
10003 (copy-recursively "runtime/JavaAnnotations/resources"
10004 "build/classes")
10005 #t))
10006 (add-after 'copy-resources 'rebuild-jar
10007 (lambda _
10008 (invoke "ant" "jar")
10009 #t)))))
10010 (inputs '())
10011 (native-inputs '())
10012 (synopsis "Annotations for ANTLR's runtime library")
10013 (description "This package contains annotations used during the build of
10014the runtime library of ANTLR.")))
10015
10016;; the runtime of this library requires a lexer that is generated by antlr4.
10017;; However, antlr4 itself requires this library at build and run-time. We
10018;; use [email protected], the closest version of antlr that doesn't need this
10019;; bootstrap process, to generate the lexer. The generated lexer is built
10020;; for the 4.1 runtime, which is slightly different from this runtime.
10021;; So, we build the runtime with antlr 4.1, with a broken xml lexer, that we
10022;; use to build antlr4. We then re-use this antlr4 to build the runtime, and
10023;; the proper, working, runtime to build antlr4 again.
10024(define-public java-tunnelvisionlabs-antlr4-runtime-bootstrap
10025 (package
10026 (inherit java-antlr4-runtime)
10027 (name "java-tunnelvisionlabs-antlr4-runtime")
10028 (version (package-version java-tunnelvisionlabs-antlr4-runtime-annotations))
10029 (source (package-source java-tunnelvisionlabs-antlr4-runtime-annotations))
10030 (arguments
10031 `(#:jar-name "java-antlr4-runtime.jar"
10032 #:source-dir "runtime/Java/src"
10033 #:tests? #f; tests require antlr4, but antlr4 depends on this package
10034 #:phases
10035 (modify-phases %standard-phases
10036 (add-before 'build 'generate-xpath-lexer
10037 (lambda _
10038 (invoke "antlr4" "-lib" "runtime/Java/src/org/antlr/v4/runtime/tree/xpath"
10039 "-visitor" "-no-listener"
10040 "-package" "org.antlr.v4.runtime.tree.xpath"
10041 "runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.g4")
10042 ;; Generated code is for an incompatible version of the runtime
10043 (substitute* "runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.java"
10044 (("LexerATNSimulator\\(this,_ATN,_decisionToDFA,_sharedContextCache\\)")
10045 "LexerATNSimulator(this,_ATN)"))
10046 #t))
10047 (add-before 'build 'copy-resources
10048 (lambda _
10049 (copy-recursively "runtime/Java/src/main/dot"
10050 "build/classes")
10051 #t)))))
10052 (native-inputs
10053 `(("antlr4" ,antlr4-4.1)
10054 ("java-tunnelvisionlabs-antlr4-runtime-annotations"
10055 ,java-tunnelvisionlabs-antlr4-runtime-annotations)))
10056 (properties '((hidden? . #t))))) ;for bootstrapping purposes only
10057
10058(define-public java-tunnelvisionlabs-antlr4-bootstrap
10059 (package
10060 (inherit antlr4)
10061 (name "java-tunnelvisionlabs-antlr4")
10062 (version (package-version java-tunnelvisionlabs-antlr4-runtime-annotations))
10063 (source (package-source java-tunnelvisionlabs-antlr4-runtime-annotations))
10064 (arguments
10065 (substitute-keyword-arguments (package-arguments antlr4)
10066 ((#:test-dir _)
10067 "tool/test:runtime-testsuite/src")
10068 ((#:phases phases)
10069 `(modify-phases ,phases
10070 (delete 'remove-unrelated-languages)
10071 (delete 'remove-graphemes)
10072 (delete 'generate-test-parsers)
10073 (delete 'check)))))
10074 (native-inputs '())
10075 (inputs
10076 `(("antlr3" ,antlr3)
10077 ("java-antlr4-runtime" ,java-tunnelvisionlabs-antlr4-runtime-bootstrap)
10078 ("java-tunnelvisionlabs-antlr4-runtime-annotations"
10079 ,java-tunnelvisionlabs-antlr4-runtime-annotations)
10080 ("java-icu4j" ,java-icu4j)
10081 ("java-jsonp-api" ,java-jsonp-api)
10082 ("java-stringtemplate" ,java-stringtemplate)
10083 ("java-treelayout" ,java-treelayout)
10084 ("openjdk" ,openjdk)))
10085 (properties '((hidden? . #t))))) ;for bootstrapping purposes only
10086
10087(define-public java-tunnelvisionlabs-antlr4-runtime
10088 (package
10089 (inherit java-tunnelvisionlabs-antlr4-runtime-bootstrap)
10090 (native-inputs
10091 (alist-replace
10092 "antlr4" (list java-tunnelvisionlabs-antlr4-bootstrap)
10093 (package-native-inputs
10094 java-tunnelvisionlabs-antlr4-runtime-bootstrap)))
10095 (properties
10096 (alist-delete
10097 'hidden?
10098 (package-properties java-tunnelvisionlabs-antlr4-runtime-bootstrap)))))
10099
10100(define-public java-tunnelvisionlabs-antlr4
10101 (package
10102 (inherit java-tunnelvisionlabs-antlr4-bootstrap)
10103 (inputs
10104 (alist-replace
10105 "java-antlr4-runtime" (list java-tunnelvisionlabs-antlr4-runtime)
10106 (package-inputs java-tunnelvisionlabs-antlr4-bootstrap)))
10107 (properties
10108 (alist-delete
10109 'hidden?
10110 (package-properties java-tunnelvisionlabs-antlr4-bootstrap)))))
10111
10112(define-public java-commons-cli-1.2
10113 ;; This is a bootstrap dependency for Maven2.
10114 (package
10115 (inherit java-commons-cli)
10116 (version "1.2")
10117 (source (origin
10118 (method url-fetch)
10119 (uri (string-append "mirror://apache/commons/cli/source/"
10120 "commons-cli-" version "-src.tar.gz"))
10121 (sha256
10122 (base32
10123 "0rvfgzgv2pc1m091dfj3ih9ddsjjppr1f1wf0qmc3bk6b1kwv2dm"))))
10124 (arguments
10125 `(#:jar-name "commons-cli.jar"
10126 #:phases
10127 (modify-phases %standard-phases
10128 (add-before 'check 'fix-build-xml
10129 (lambda* (#:key inputs #:allow-other-keys)
10130 (substitute* "build.xml"
10131 (("dir=\"\\$\\{test.home\\}/java\"")
10132 "dir=\"${test.home}\""))
10133 #t)))))
10134 (native-inputs
10135 (list java-junit))))
10136
10137(define-public java-microemulator-cldc
10138 (package
10139 (name "java-microemulator-cldc")
10140 (version "2.0.4")
10141 (source (origin
10142 (method url-fetch)
10143 (uri (string-append "https://github.com/barteo/microemu/archive/"
10144 "microemulator_"
10145 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
10146 version)
10147 ".tar.gz"))
10148 (file-name (string-append name "-" version ".tar.gz"))
10149 (sha256
10150 (base32
10151 "1x1apmz38gkppxnwnygwmi12j54v4p258v8ddzn6dldkk7vak1ll"))))
10152 (build-system ant-build-system)
10153 (arguments
10154 `(#:jar-name "microemulator-cldc.jar"
10155 #:source-dir "microemu-cldc/src/main/java"
10156 #:tests? #f)); Requires even older software
10157 (home-page "https://github.com/barteo/microemu")
10158 (synopsis "J2ME CLDC emulator")
10159 (description "Microemulator is a Java 2 Micro Edition (J2ME) CLDC/MIDP
10160Emulator. It demonstrates MIDlet based applications in web browser
10161applet and can be run as a standalone java application.")
10162 (license (list license:asl2.0
10163 ;; or altenatively:
10164 license:lgpl2.1+))))
10165
10166(define-public java-datanucleus-javax-persistence
10167 (package
10168 (name "java-datanucleus-javax-persistence")
10169 (version "2.2.0")
10170 (source (origin
10171 (method url-fetch)
10172 (uri (string-append "https://github.com/datanucleus/"
10173 "javax.persistence/archive/javax.persistence-"
10174 version "-release.tar.gz"))
10175 (sha256
10176 (base32
10177 "11jx0fjwgc2hhbqqgdd6m1pf2fplf9vslppygax0y1z5csnqjhpx"))))
10178 (build-system ant-build-system)
10179 (arguments
10180 `(#:jar-name "java-datanucleus-javax-persistence.jar"
10181 #:jdk ,icedtea-8
10182 #:source-dir "src/main/java"
10183 #:tests? #f)); no tests
10184 (home-page "https://github.com/datanucleus/javax.persistence")
10185 (synopsis "JPA API")
10186 (description "This package contains a clean definition of JPA API intended
10187for use with DataNucleus JPA since the JCP haven't provided an official JPA API
10188jar. See @url{http://java.net/projects/jpa-spec/downloads} for the specification
10189used to generate this API.")
10190 (license (list license:edl1.0 license:epl1.0))))
10191
10192(define-public java-osgi-cmpn
10193 (package
10194 (name "java-osgi-cmpn")
10195 (version "6.0.0")
10196 (source (origin
10197 (method url-fetch)
10198 (uri (string-append "https://repo1.maven.org/maven2/"
10199 "org/osgi/osgi.cmpn/" version "/osgi.cmpn-"
10200 version "-sources.jar"))
10201 (sha256
10202 (base32
10203 "1lmb6xyrmkqdhv1kayf0514rlwq6ypvs4m44ibrck3snp8241wys"))))
10204 (build-system ant-build-system)
10205 (arguments
10206 `(#:jar-name "osgi-cmpn.jar"
10207 #:tests? #f)); no tests
10208 (inputs
10209 `(("annotation" ,java-osgi-annotation)
10210 ("core" ,java-osgi-core)
10211 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
10212 ("microemulator" ,java-microemulator-cldc)
10213 ("servlet" ,java-classpathx-servletapi)))
10214 (home-page "https://www.osgi.org")
10215 (synopsis "Compendium specification module of OSGi framework")
10216 (description
10217 "OSGi, for Open Services Gateway initiative framework, is a module system
10218and service platform for the Java programming language. This package contains
10219the compendium specification module, providing interfaces and classes for use
10220in compiling bundles.")
10221 (license license:asl2.0)))
10222
10223(define-public java-osgi-cmpn-7.0.0
10224 ;; Upstream uses release-train tags for the monorepo; osgi.cmpn/bnd.bnd
10225 ;; emits artifact version 7.0.0 from the r7-cmpn-spec-final checkout.
10226 (let ((tag "r7-cmpn-spec-final"))
10227 (package
10228 (name "java-osgi-cmpn")
10229 (version "7.0.0")
10230 (source (origin
10231 (method git-fetch)
10232 (uri (git-reference
10233 (url "https://github.com/osgi/osgi")
10234 (commit tag)))
10235 (modules '((guix build utils)))
10236 (snippet
10237 '(begin
10238 (for-each delete-file
10239 (find-files "." "\\.jar$"))
10240 #t))
10241 (file-name (git-file-name name version))
10242 (sha256
10243 (base32
10244 "08i8d2y7awr09809qwnv7l5hzqi5di3sv21bvgrmhibm07hr4ml9"))))
10245 (build-system ant-build-system)
10246 (arguments
10247 (list
10248 #:tests? #f
10249 #:jdk openjdk9
10250 #:jar-name "osgi-cmpn.jar"
10251 #:phases
10252 #~(modify-phases %standard-phases
10253 (add-after 'unpack 'prepare-source-layout
10254 (lambda _
10255 (mkdir-p "src")
10256 (for-each
10257 (lambda (directory)
10258 (invoke "cp" "-r" (string-append directory "/.") "src/"))
10259 '("org.osgi.application/src"
10260 "org.osgi.namespace.contract/src"
10261 "org.osgi.namespace.extender/src"
10262 "org.osgi.namespace.implementation/src"
10263 "org.osgi.namespace.service/src"
10264 "org.osgi.namespace.unresolvable/src"
10265 "org.osgi.service.async/src"
10266 "org.osgi.service.application/src"
10267 "org.osgi.service.blueprint/src"
10268 "org.osgi.service.cm/src"
10269 "org.osgi.service.component/src"
10270 "org.osgi.service.component.annotations/src"
10271 "org.osgi.service.configurator/src"
10272 "org.osgi.service.coordinator/src"
10273 "org.osgi.service.deploymentadmin/src"
10274 "org.osgi.service.device/src"
10275 "org.osgi.service.dmt/src"
10276 "org.osgi.service.event/src"
10277 "org.osgi.service.http/src"
10278 "org.osgi.service.http.whiteboard/src"
10279 "org.osgi.service.io/src"
10280 "org.osgi.service.jaxrs/src"
10281 "org.osgi.service.jdbc/src"
10282 "org.osgi.service.jndi/src"
10283 "org.osgi.service.jpa/src"
10284 "org.osgi.service.log/src"
10285 "org.osgi.service.metatype/src"
10286 "org.osgi.service.metatype.annotations/src"
10287 "org.osgi.service.monitor/src"
10288 "org.osgi.service.prefs/src"
10289 "org.osgi.service.provisioning/src"
10290 "org.osgi.service.remoteserviceadmin/src"
10291 "org.osgi.service.repository/src"
10292 "org.osgi.service.rest/src"
10293 "org.osgi.service.serviceloader/src"
10294 "org.osgi.service.subsystem/src"
10295 "org.osgi.service.transaction.control/src"
10296 "org.osgi.service.upnp/src"
10297 "org.osgi.service.useradmin/src"
10298 "org.osgi.service.wireadmin/src"
10299 "org.osgi.util.converter/src"
10300 "org.osgi.util.function/src"
10301 "org.osgi.util.measurement/src"
10302 "org.osgi.util.position/src"
10303 "org.osgi.util.promise/src"
10304 "org.osgi.util.pushstream/src"
10305 "org.osgi.util.xml/src"))))
10306 (add-before 'install 'create-pom
10307 (generate-pom.xml "pom.xml" "org.osgi" "osgi.cmpn" #$version))
10308 (replace 'install (install-from-pom "pom.xml")))))
10309 (inputs
10310 (list java-osgi-annotation-8.1.0
10311 java-osgi-core-8.0.0
10312 java-classpathx-servletapi
10313 java-microemulator-cldc
10314 java-datanucleus-javax-persistence
10315 java-jaxrs-api-2))
10316 (home-page "https://www.osgi.org")
10317 (synopsis "Compendium specification module of OSGi framework")
10318 (description "OSGi, for Open Services Gateway initiative framework, is a
10319module system and service platform for the Java programming language. This
10320package contains the compendium specification module, providing interfaces
10321and classes for use in compiling bundles.")
10322 (license license:asl2.0))))
10323
10324(define-public java-felix-resolver-2
10325 (package
10326 (name "java-felix-resolver")
10327 (version "2.0.4")
10328 (source (origin
10329 (method git-fetch)
10330 (uri (git-reference
10331 (url "https://github.com/apache/felix-dev")
10332 (commit (string-append "org.apache.felix.resolver-"
10333 version))))
10334 (modules '((guix build utils)))
10335 (snippet
10336 '(begin
10337 (for-each delete-file
10338 (find-files "." "\\.jar$"))
10339 #t))
10340 (file-name (git-file-name name version))
10341 (sha256
10342 (base32
10343 "1lkwh6q58vm0inll8zaqizwfvw8d7kzaff0x6lwa17j9k91yllyf"))))
10344 (build-system ant-build-system)
10345 (arguments
10346 (list
10347 #:tests? #f
10348 #:jar-name "org.apache.felix.resolver.jar"
10349 #:source-dir "resolver/src/main/java"
10350 #:phases
10351 #~(modify-phases %standard-phases
10352 (add-before 'install 'create-pom
10353 (generate-pom.xml "pom.xml" "org.apache.felix"
10354 "org.apache.felix.resolver" #$version))
10355 (replace 'install (install-from-pom "pom.xml")))))
10356 (inputs (list java-osgi-annotation java-osgi-core))
10357 (home-page "https://felix.apache.org/")
10358 (synopsis "Apache Felix OSGi resolver")
10359 (description "Apache Felix Resolver implements the OSGi resolver
10360specification, providing dependency resolution for OSGi bundles.")
10361 (license license:asl2.0)))
10362
10363(define-public java-felix-framework-7
10364 (package
10365 (name "java-felix-framework")
10366 (version "7.0.5")
10367 (source (origin
10368 (method git-fetch)
10369 (uri (git-reference
10370 (url "https://github.com/apache/felix-dev")
10371 (commit (string-append "org.apache.felix.framework-"
10372 version))))
10373 (modules '((guix build utils)))
10374 (snippet
10375 '(begin
10376 (for-each delete-file
10377 (find-files "." "\\.jar$"))
10378 #t))
10379 (file-name (git-file-name name version))
10380 (sha256
10381 (base32
10382 "1w4kdy0m4md2j0nf3shn76v9vxvjqa9sxl4j06bk08yn9icnj72k"))))
10383 (build-system ant-build-system)
10384 (arguments
10385 (list
10386 #:tests? #f
10387 #:jar-name "org.apache.felix.framework.jar"
10388 #:source-dir "framework/src/main/java"
10389 #:phases
10390 #~(modify-phases %standard-phases
10391 (add-after 'unpack 'create-animal-sniffer-stub
10392 (lambda _
10393 ;; Felix uses this compile-time Maven annotation to suppress
10394 ;; JRE compatibility warnings. It has no runtime effect.
10395 (mkdir-p "framework/src/main/java/org/codehaus/mojo/animal_sniffer")
10396 (call-with-output-file
10397 "framework/src/main/java/org/codehaus/mojo/animal_sniffer/IgnoreJRERequirement.java"
10398 (lambda (port)
10399 (display (string-append
10400 "package org.codehaus.mojo.animal_sniffer;\n"
10401 "import java.lang.annotation.*;\n"
10402 "@Retention(RetentionPolicy.CLASS)\n"
10403 "@Target({ElementType.METHOD,"
10404 " ElementType.CONSTRUCTOR,"
10405 " ElementType.TYPE})\n"
10406 "public @interface IgnoreJRERequirement {}\n")
10407 port)))))
10408 (add-after 'build 'add-service-descriptor-and-resources
10409 (lambda _
10410 ;; Include the upstream service descriptors and resources that
10411 ;; Felix expects in the framework jar.
10412 (invoke "jar" "uf" "build/jar/org.apache.felix.framework.jar"
10413 "-C" "framework/src/main/resources" "META-INF/services")
10414 ;; Felix reads default.properties at startup to determine
10415 ;; system packages. The source file uses Maven's ${dollar}
10416 ;; placeholder, so replace it here.
10417 (substitute* "framework/src/main/resources/default.properties"
10418 (("\\$\\{dollar\\}") "$"))
10419 (invoke "jar" "uf" "build/jar/org.apache.felix.framework.jar"
10420 "-C" "framework/src/main/resources" "default.properties")
10421 ;; Compile accessor.src (a java.net.Accessor class used by
10422 ;; SecureAction to bypass access controls) and include the
10423 ;; compiled bytecode as accessor.bytes.
10424 (mkdir-p "build/accessor-src/java/net")
10425 (copy-file
10426 "framework/src/main/resources/org/apache/felix/framework/util/accessor.src"
10427 "build/accessor-src/java/net/Accessor.java")
10428 (mkdir-p "build/accessor-out")
10429 (invoke "javac"
10430 "-d" "build/accessor-out"
10431 "build/accessor-src/java/net/Accessor.java")
10432 (copy-file "build/accessor-out/java/net/Accessor.class"
10433 "build/accessor.bytes")
10434 (invoke "jar" "uf" "build/jar/org.apache.felix.framework.jar"
10435 "-C" "build"
10436 "accessor.bytes")))
10437 (add-after 'add-service-descriptor-and-resources
10438 'fix-accessor-path
10439 (lambda _
10440 ;; accessor.bytes must be at
10441 ;; org/apache/felix/framework/util/accessor.bytes
10442 (let ((jar "build/jar/org.apache.felix.framework.jar"))
10443 (mkdir-p "build/accessor-pkg/org/apache/felix/framework/util")
10444 (copy-file "build/accessor.bytes"
10445 "build/accessor-pkg/org/apache/felix/framework/util/accessor.bytes")
10446 (invoke "jar" "uf" jar
10447 "-C" "build/accessor-pkg"
10448 "org/apache/felix/framework/util/accessor.bytes"))))
10449 (add-before 'install 'create-pom
10450 (generate-pom.xml "pom.xml" "org.apache.felix"
10451 "org.apache.felix.framework" #$version))
10452 (replace 'install (install-from-pom "pom.xml")))))
10453 (inputs (list java-osgi-annotation-8.1.0
10454 java-osgi-core-8.0.0
10455 java-felix-resolver-2))
10456 (home-page "https://felix.apache.org/")
10457 (synopsis "Apache Felix OSGi framework")
10458 (description "Apache Felix is a community effort to implement the OSGi
10459Framework and Service platform.")
10460 (license license:asl2.0)))
10461
10462(define-public java-felix-main-7.0.5
10463 (package
10464 (name "java-felix-main")
10465 (version "7.0.5")
10466 (source (origin
10467 (method git-fetch)
10468 (uri (git-reference
10469 (url "https://github.com/apache/felix-dev")
10470 (commit (string-append "org.apache.felix.main-"
10471 version))))
10472 (modules '((guix build utils)))
10473 (snippet
10474 '(begin
10475 (for-each delete-file
10476 (find-files "." "\\.jar$"))
10477 #t))
10478 (file-name (git-file-name name version))
10479 (sha256
10480 (base32
10481 "04miqvr8lqng4a0n6zry8rary8hrcbrq41652adyz85znmcp1z59"))))
10482 (build-system ant-build-system)
10483 (arguments
10484 (list
10485 #:tests? #f
10486 #:jar-name "org.apache.felix.main.jar"
10487 #:source-dir "main/src/main/java"
10488 #:phases
10489 #~(modify-phases %standard-phases
10490 (add-after 'build 'create-uber-jar
10491 (lambda* (#:key inputs #:allow-other-keys)
10492 ;; org.apache.felix.main is an uber jar combining framework,
10493 ;; resolver, and osgi-core classes with Main and AutoProcessor.
10494 (let ((jar (canonicalize-path
10495 "build/jar/org.apache.felix.main.jar"))
10496 (work-dir (mkdtemp "/tmp/felix-merge-XXXXXX")))
10497 (with-directory-excursion work-dir
10498 (for-each
10499 (lambda (input-name)
10500 (for-each
10501 (lambda (dep-jar)
10502 (invoke "jar" "xf" dep-jar))
10503 (find-files (assoc-ref inputs input-name)
10504 "\\.jar$")))
10505 '("java-felix-framework"
10506 "java-felix-resolver"
10507 "java-osgi-core"))
10508 ;; Remove metadata that would conflict with the
10509 ;; main jar's own manifest.
10510 (when (file-exists? "META-INF/MANIFEST.MF")
10511 (delete-file "META-INF/MANIFEST.MF"))
10512 (when (file-exists? "META-INF/maven")
10513 (delete-file-recursively "META-INF/maven"))
10514 (invoke "jar" "uf" jar "-C" work-dir ".")))))
10515 (add-after 'create-uber-jar 'add-service-descriptor
10516 (lambda _
10517 (let ((jar "build/jar/org.apache.felix.main.jar"))
10518 (mkdir-p "META-INF/services")
10519 (call-with-output-file
10520 "META-INF/services/org.osgi.framework.launch.FrameworkFactory"
10521 (lambda (port)
10522 (display
10523 "org.apache.felix.framework.FrameworkFactory\n" port)))
10524 (invoke "jar" "uf" jar "-C" "." "META-INF/services"))))
10525 (add-before 'install 'create-pom
10526 (generate-pom.xml "pom.xml" "org.apache.felix"
10527 "org.apache.felix.main" #$version))
10528 (replace 'install (install-from-pom "pom.xml")))))
10529 (inputs (list java-felix-framework-7
10530 java-felix-resolver-2
10531 java-osgi-core-8.0.0))
10532 (home-page "https://felix.apache.org/")
10533 (synopsis "Apache Felix Main distribution jar")
10534 (description "Apache Felix Main is the standard distribution jar for
10535the Apache Felix OSGi framework. It bundles the framework, resolver, and
10536OSGi core classes into a single jar with a standalone launcher.")
10537 (license license:asl2.0)))
10538
10539(define-public java-osgi-service-component-annotations
10540 (package
10541 (name "java-osgi-service-component-annotations")
10542 (version "1.3.0")
10543 (source (origin
10544 (method url-fetch)
10545 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10546 "org.osgi.service.component.annotations/"
10547 version "/org.osgi.service.component.annotations-"
10548 version "-sources.jar"))
10549 (sha256
10550 (base32
10551 "15rq9cmp4fpn74q44m4j35qsqmjf5lx3hcrk6pzvbhc08igic2f0"))))
10552 (build-system ant-build-system)
10553 (arguments
10554 `(#:jar-name "osgi-service-component-annotations.jar"
10555 #:tests? #f)); no tests
10556 (inputs
10557 `(("annotation" ,java-osgi-annotation)))
10558 (home-page "https://www.osgi.org")
10559 (synopsis "Support annotations for osgi-service-component")
10560 (description
10561 "OSGi, for Open Services Gateway initiative framework, is a module system
10562and service platform for the Java programming language. This package contains
10563the support annotations for osgi-service-component.")
10564 (license license:asl2.0)))
10565
10566(define-public java-osgi-dto
10567 (package
10568 (name "java-osgi-dto")
10569 (version "1.0.0")
10570 (source (origin
10571 (method url-fetch)
10572 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10573 "org.osgi.dto/" version "/org.osgi.dto-"
10574 version "-sources.jar"))
10575 (sha256
10576 (base32
10577 "0f4bqjzadn0hwk6sd3h5gvbyfp3yci1s6r0v770cc15p0pg627yr"))))
10578 (build-system ant-build-system)
10579 (arguments
10580 `(#:jar-name "osgi-dto.jar"
10581 #:tests? #f)); no tests
10582 (inputs
10583 `(("annotation" ,java-osgi-annotation)))
10584 (home-page "https://www.osgi.org")
10585 (synopsis "Data Transfer Objects")
10586 (description
10587 "OSGi, for Open Services Gateway initiative framework, is a module system
10588and service platform for the Java programming language. This package contains
10589the Data Transfer Objects. It is easily serializable having only public fields
10590of primitive types and their wrapper classes, Strings, and DTOs. List, Set,
10591Map and array aggregates may also be used. The aggregates must only hold
10592objects of the listed types or aggregates.")
10593 (license license:asl2.0)))
10594
10595(define-public java-osgi-resource
10596 (package
10597 (name "java-osgi-resource")
10598 (version "1.0.0")
10599 (source (origin
10600 (method url-fetch)
10601 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10602 "org.osgi.resource/"
10603 version "/org.osgi.resource-"
10604 version "-sources.jar"))
10605 (sha256
10606 (base32
10607 "0hi0fsc5v99q22bd7lrkvpz1y0ds4w9arjldpwsrcpqvz2js7q2d"))))
10608 (build-system ant-build-system)
10609 (arguments
10610 `(#:jar-name "osgi-resource.jar"
10611 #:tests? #f)); no tests
10612 (inputs
10613 `(("annotation" ,java-osgi-annotation)
10614 ("dto" ,java-osgi-dto)))
10615 (home-page "https://www.osgi.org")
10616 (synopsis "OSGI Resource")
10617 (description
10618 "OSGi, for Open Services Gateway initiative framework, is a module system
10619and service platform for the Java programming language. This package contains
10620the definition of common types in osgi packages.")
10621 (license license:asl2.0)))
10622
10623(define-public java-osgi-namespace-contract
10624 (package
10625 (name "java-osgi-namespace-contract")
10626 (version "1.0.0")
10627 (source (origin
10628 (method url-fetch)
10629 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10630 "org.osgi.namespace.contract/"
10631 version "/org.osgi.namespace.contract-"
10632 version "-sources.jar"))
10633 (sha256
10634 (base32
10635 "1iz4f2i0fvqrlq90ki9nfzcfpvy2av434ri25bglywqssx8mmp36"))))
10636 (build-system ant-build-system)
10637 (inputs
10638 `(("resource" ,java-osgi-resource)
10639 ("annotation" ,java-osgi-annotation)))
10640 (arguments
10641 `(#:jar-name "osgi-namespace-contract.jar"
10642 #:tests? #f)); no tests
10643 (home-page "https://www.osgi.org")
10644 (synopsis "Contract Capability and Requirement Namespace")
10645 (description
10646 "OSGi, for Open Services Gateway initiative framework, is a module system
10647and service platform for the Java programming language. This package contains
10648the names for the attributes and directives for a namespace with contracts.")
10649 (license license:asl2.0)))
10650
10651(define-public java-osgi-namespace-extender
10652 (package
10653 (name "java-osgi-namespace-extender")
10654 (version "1.0.1")
10655 (source (origin
10656 (method url-fetch)
10657 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10658 "org.osgi.namespace.extender/"
10659 version "/org.osgi.namespace.extender-"
10660 version "-sources.jar"))
10661 (sha256
10662 (base32
10663 "0jgqiak2i05qv6j3gd33xlaifzzc0ylxxk376v2x0apfg3vvixmz"))))
10664 (build-system ant-build-system)
10665 (inputs
10666 `(("resource" ,java-osgi-resource)
10667 ("annotation" ,java-osgi-annotation)))
10668 (arguments
10669 `(#:jar-name "osgi-namespace-extendent.jar"
10670 #:tests? #f)); no tests
10671 (home-page "https://www.osgi.org")
10672 (synopsis "Extender Capability and Requirement Namespace")
10673 (description
10674 "OSGi, for Open Services Gateway initiative framework, is a module system
10675and service platform for the Java programming language. This package contains
10676the names for the attributes and directives for an extender namespace.")
10677 (license license:asl2.0)))
10678
10679(define-public java-osgi-namespace-service
10680 (package
10681 (name "java-osgi-namespace-service")
10682 (version "1.0.0")
10683 (source (origin
10684 (method url-fetch)
10685 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10686 "org.osgi.namespace.service/"
10687 version "/org.osgi.namespace.service-"
10688 version "-sources.jar"))
10689 (sha256
10690 (base32
10691 "0qmw8n2449nkmm56d1znz9zhazb6ya3vsimd5bf5jg23zzhgl8c8"))))
10692 (build-system ant-build-system)
10693 (inputs
10694 `(("resource" ,java-osgi-resource)
10695 ("annotation" ,java-osgi-annotation)))
10696 (arguments
10697 `(#:jar-name "osgi-namespace-service.jar"
10698 #:tests? #f)); no tests
10699 (home-page "https://www.osgi.org")
10700 (synopsis "Service Capability and Requirement Namespace")
10701 (description
10702 "OSGi, for Open Services Gateway initiative framework, is a module system
10703and service platform for the Java programming language. This package contains
10704the names for the attributes and directives for a service namespace.")
10705 (license license:asl2.0)))
10706
10707(define-public java-osgi-util-function
10708 (package
10709 (name "java-osgi-util-function")
10710 (version "1.0.0")
10711 (source (origin
10712 (method url-fetch)
10713 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10714 "org.osgi.util.function/"
10715 version "/org.osgi.util.function-"
10716 version "-sources.jar"))
10717 (sha256
10718 (base32
10719 "04l7j3hwmmj28w23m7paca0afzncs42j2mdr3liqq8kvp548sc6x"))))
10720 (build-system ant-build-system)
10721 (arguments
10722 `(#:jar-name "osgi-util-function.jar"
10723 #:tests? #f)); no tests
10724 (inputs
10725 `(("annotation" ,java-osgi-annotation)))
10726 (home-page "https://www.osgi.org")
10727 (synopsis "OSGI Util Function")
10728 (description
10729 "OSGi, for Open Services Gateway initiative framework, is a module system
10730and service platform for the Java programming language. This package contains
10731an interface for a function that accepts a single argument and produces a result.")
10732 (license license:asl2.0)))
10733
10734(define-public java-osgi-util-promise
10735 (package
10736 (name "java-osgi-util-promise")
10737 (version "1.0.0")
10738 (source (origin
10739 (method url-fetch)
10740 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10741 "org.osgi.util.promise/"
10742 version "/org.osgi.util.promise-"
10743 version "-sources.jar"))
10744 (sha256
10745 (base32
10746 "0y34dwiflg1c4ahvkswpf9z02xph2sr9fm04ia5493x3lshpw22c"))))
10747 (build-system ant-build-system)
10748 (arguments
10749 `(#:jar-name "osgi-util-promise.jar"
10750 #:tests? #f)); no tests
10751 (inputs
10752 `(("annotation" ,java-osgi-annotation)
10753 ("function" ,java-osgi-util-function)))
10754 (home-page "https://www.osgi.org")
10755 (synopsis "Promise of a value")
10756 (description
10757 "OSGi, for Open Services Gateway initiative framework, is a module system
10758and service platform for the Java programming language. This package contains
10759an interface and utilitary classes for promises. A Promise represents a future
10760value. It handles the interactions for asynchronous processing.")
10761 (license license:asl2.0)))
10762
10763(define-public java-osgi-service-metatype-annotations
10764 (package
10765 (name "java-osgi-service-metatype-annotations")
10766 (version "1.3.0")
10767 (source (origin
10768 (method url-fetch)
10769 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10770 "org.osgi.service.metatype.annotations/"
10771 version "/org.osgi.service.metatype.annotations-"
10772 version "-sources.jar"))
10773 (sha256
10774 (base32
10775 "12rwm3349wk80vm88rcdgs4435m4jxkpkj5mrx326skkz2c6hyw6"))))
10776 (build-system ant-build-system)
10777 (arguments
10778 `(#:jar-name "osgi-service-metatype-annotations.jar"
10779 #:tests? #f)); no tests
10780 (inputs
10781 `(("annotation" ,java-osgi-annotation)))
10782 (home-page "https://www.osgi.org")
10783 (synopsis "Support annotations for metatype")
10784 (description
10785 "OSGi, for Open Services Gateway initiative framework, is a module system
10786and service platform for the Java programming language. This package contains
10787the support annotations for metatype.")
10788 (license license:asl2.0)))
10789
10790(define-public java-osgi-service-repository
10791 (package
10792 (name "java-osgi-service-repository")
10793 (version "1.1.0")
10794 (source (origin
10795 (method url-fetch)
10796 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10797 "org.osgi.service.repository/"
10798 version "/org.osgi.service.repository-"
10799 version "-sources.jar"))
10800 (sha256
10801 (base32
10802 "1k41mhg7b58pd8nsghr2qwcjrxdnf1p9spsw9v11k4257g6rl06n"))))
10803 (build-system ant-build-system)
10804 (arguments
10805 `(#:jar-name "osgi-service-repository.jar"
10806 #:tests? #f)); no tests
10807 (inputs
10808 `(("annotation" ,java-osgi-annotation)
10809 ("promise" ,java-osgi-util-promise)
10810 ("resource" ,java-osgi-resource)))
10811 (home-page "https://www.osgi.org")
10812 (synopsis "OSGI service repository")
10813 (description
10814 "OSGi, for Open Services Gateway initiative framework, is a module system
10815and service platform for the Java programming language. This package contains
10816a repository service that contains resources.")
10817 (license license:asl2.0)))
10818
10819(define-public java-osgi-framework
10820 (package
10821 (name "java-osgi-framework")
10822 (version "1.8.0")
10823 (source (origin
10824 (method url-fetch)
10825 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10826 "org.osgi.framework/" version "/org.osgi.framework-"
10827 version "-sources.jar"))
10828 (sha256
10829 (base32
10830 "1lwp2zfad3rybcc6q9bwz8xsgkc92ypzy5p6x54387f1qj65m73s"))))
10831 (build-system ant-build-system)
10832 (arguments
10833 `(#:jar-name "osgi-framework.jar"
10834 #:tests? #f)); no tests
10835 (inputs
10836 `(("annotation" ,java-osgi-annotation)
10837 ("resource" ,java-osgi-resource)
10838 ("dto" ,java-osgi-dto)))
10839 (home-page "https://www.osgi.org")
10840 (synopsis "OSGi framework")
10841 (description
10842 "OSGi, for Open Services Gateway initiative framework, is a module system
10843and service platform for the Java programming language.")
10844 (license license:asl2.0)))
10845
10846(define-public java-osgi-service-log
10847 (package
10848 (name "java-osgi-service-log")
10849 (version "1.3.0")
10850 (source (origin
10851 (method url-fetch)
10852 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10853 "org.osgi.service.log/"
10854 version "/org.osgi.service.log-"
10855 version "-sources.jar"))
10856 (sha256
10857 (base32
10858 "1029j30dzcwializzca0j3fkhwwz08kmmsha5agw1iccscimj6r0"))))
10859 (build-system ant-build-system)
10860 (arguments
10861 `(#:jar-name "osgi-service-log.jar"
10862 #:tests? #f)); no tests
10863 (inputs
10864 (list java-osgi-framework))
10865 (home-page "https://www.osgi.org")
10866 (synopsis "Provides methods for bundles to write messages to the log")
10867 (description
10868 "OSGi, for Open Services Gateway initiative framework, is a module system
10869and service platform for the Java programming language. This package contains
10870the log service.")
10871 (license license:asl2.0)))
10872
10873(define-public java-osgi-service-jdbc
10874 (package
10875 (name "java-osgi-service-jdbc")
10876 (version "1.0.0")
10877 (source (origin
10878 (method url-fetch)
10879 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10880 "org.osgi.service.jdbc/"
10881 version "/org.osgi.service.jdbc-"
10882 version "-sources.jar"))
10883 (sha256
10884 (base32
10885 "11iln5v7bk469cgb9ddkrz9sa95b3733gqgaqw9xf5g6wq652yjz"))))
10886 (build-system ant-build-system)
10887 (arguments
10888 `(#:jar-name "osgi-service-jdbc.jar"
10889 #:tests? #f)); no tests
10890 (home-page "https://www.osgi.org")
10891 (synopsis "Factory for JDBC connection factories")
10892 (description
10893 "OSGi, for Open Services Gateway initiative framework, is a module system
10894and service platform for the Java programming language. This package contains
10895a factory for JDBC connection factories. There are 3 preferred connection
10896factories for getting JDBC connections:
10897
10898@itemize
10899@item @code{javax.sql.DataSource};
10900@item @code{javax.sql.ConnectionPoolDataSource};
10901@item @code{javax.sql.XADataSource}.
10902@end itemize")
10903 (license license:asl2.0)))
10904
10905(define-public java-osgi-service-resolver
10906 (package
10907 (name "java-osgi-service-resolver")
10908 (version "1.0.1")
10909 (source (origin
10910 (method url-fetch)
10911 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10912 "org.osgi.service.resolver/"
10913 version "/org.osgi.service.resolver-"
10914 version "-sources.jar"))
10915 (sha256
10916 (base32
10917 "1dzqn1ryfi2rq4zwsgp44bmj2wlfydjg1qbxw2b0z4xdjjy55vxd"))))
10918 (build-system ant-build-system)
10919 (arguments
10920 `(#:jar-name "osgi-service-resolver.jar"
10921 #:tests? #f)); no tests
10922 (inputs
10923 `(("annotation" ,java-osgi-annotation)
10924 ("resource" ,java-osgi-resource)))
10925 (home-page "https://www.osgi.org")
10926 (synopsis "OSGI Resolver service")
10927 (description
10928 "OSGi, for Open Services Gateway initiative framework, is a module system
10929and service platform for the Java programming language. This package contains
10930a resolver service that resolves the specified resources in the context supplied
10931by the caller.")
10932 (license license:asl2.0)))
10933
10934(define-public java-osgi-util-tracker
10935 (package
10936 (name "java-osgi-util-tracker")
10937 (version "1.5.1")
10938 (source (origin
10939 (method url-fetch)
10940 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10941 "org.osgi.util.tracker/"
10942 version "/org.osgi.util.tracker-"
10943 version "-sources.jar"))
10944 (sha256
10945 (base32
10946 "0c4fh9vxwzsx59r8dygda0gq2gx3z5vfhc3jsphlqwf5w0h403lz"))))
10947 (build-system ant-build-system)
10948 (arguments
10949 `(#:jar-name "osgi-util-tracker.jar"
10950 #:tests? #f)); no tests
10951 (inputs
10952 `(("framework" ,java-osgi-framework)
10953 ("annotation" ,java-osgi-annotation)))
10954 (home-page "https://www.osgi.org")
10955 (synopsis "Bundle tracking")
10956 (description
10957 "OSGi, for Open Services Gateway initiative framework, is a module system
10958and service platform for the Java programming language. This package contains
10959bundle tracking utility classes.")
10960 (license license:asl2.0)))
10961
10962(define-public java-osgi-service-cm
10963 (package
10964 (name "java-osgi-service-cm")
10965 (version "1.5.0")
10966 (source (origin
10967 (method url-fetch)
10968 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10969 "org.osgi.service.cm/"
10970 version "/org.osgi.service.cm-"
10971 version "-sources.jar"))
10972 (sha256
10973 (base32
10974 "1z8kap48y3xi0ggj8v6czglfnpnd94mmismgi2wbqhj1nl5fzbp6"))))
10975 (build-system ant-build-system)
10976 (arguments
10977 `(#:jar-name "osgi-service-cm.jar"
10978 #:tests? #f)); no tests
10979 (inputs
10980 `(("framework" ,java-osgi-framework)
10981 ("annotation" ,java-osgi-annotation)))
10982 (home-page "https://www.osgi.org")
10983 (synopsis "OSGI Configuration Management")
10984 (description
10985 "OSGi, for Open Services Gateway initiative framework, is a module system
10986and service platform for the Java programming language. This package contains
10987utility classes for the configuration of services.")
10988 (license license:asl2.0)))
10989
10990(define-public java-osgi-service-packageadmin
10991 (package
10992 (name "java-osgi-service-packageadmin")
10993 (version "1.2.0")
10994 (source (origin
10995 (method url-fetch)
10996 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10997 "org.osgi.service.packageadmin/"
10998 version "/org.osgi.service.packageadmin-"
10999 version "-sources.jar"))
11000 (sha256
11001 (base32
11002 "041mpxzi7g36wmcily6y4ccn3jx15akpdy8gmhyb7m98x7qfvn52"))))
11003 (build-system ant-build-system)
11004 (arguments
11005 `(#:jar-name "osgi-service-packageadmin.jar"
11006 #:tests? #f)); no tests
11007 (inputs
11008 `(("framework" ,java-osgi-framework)))
11009 (home-page "https://www.osgi.org")
11010 (synopsis "OSGI Package Administration")
11011 (description
11012 "OSGi, for Open Services Gateway initiative framework, is a module system
11013and service platform for the Java programming language. This package contains
11014the packageadmin service.")
11015 (license license:asl2.0)))
11016
11017(define-public java-ops4j-base-lang
11018 (package
11019 (name "java-ops4j-base-lang")
11020 (version "1.5.0")
11021 (source (origin
11022 (method url-fetch)
11023 (uri (string-append "https://github.com/ops4j/org.ops4j.base/"
11024 "archive/base-" version ".tar.gz"))
11025 (sha256
11026 (base32
11027 "18hl3lpchgpv8yh5rlk39l2gif5dlfgb8gxjmncf39pr2dprkniw"))))
11028 (build-system ant-build-system)
11029 (arguments
11030 `(#:jar-name "java-ops4j-base-lang.jar"
11031 #:source-dir "ops4j-base-lang/src/main/java"
11032 #:tests? #f; no tests
11033 #:phases
11034 (modify-phases %standard-phases
11035 (add-before 'build 'add-test-file
11036 (lambda _
11037 ;; That file is required by a test in ops4j-pax-exam-core-spi
11038 (mkdir-p "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang")
11039 (with-output-to-file "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang/pom.properties"
11040 (lambda _
11041 (display
11042 (string-append
11043 "version=" ,version "\n"
11044 "groupId=org.ops4j.base"
11045 "artifactId=ops4j-base-lang\n"))))
11046 #t)))))
11047 (home-page "https://ops4j1.jira.com/wiki/spaces/base/overview")
11048 (synopsis "Utility classes and extensions to be used in OPS4J projects")
11049 (description "OPS4J stands for Open Participation Software for Java. This
11050package contains utilities and extensions related to @code{java.lang}.")
11051 (license license:asl2.0)))
11052
11053(define-public java-ops4j-base-monitors
11054 (package
11055 (inherit java-ops4j-base-lang)
11056 (name "java-ops4j-base-monitors")
11057 (arguments
11058 `(#:jar-name "java-ops4j-base-monitors.jar"
11059 #:source-dir "ops4j-base-monitors/src/main/java"
11060 #:tests? #f)); no tests
11061 (inputs
11062 `(("lang" ,java-ops4j-base-lang)))
11063 (description "OPS4J stands for Open Participation Software for Java. This
11064package contains utilities and extensions related to monitoring.")))
11065
11066(define-public java-ops4j-base-io
11067 (package
11068 (inherit java-ops4j-base-lang)
11069 (name "java-ops4j-base-io")
11070 (arguments
11071 `(#:jar-name "java-ops4j-base-io.jar"
11072 #:source-dir "ops4j-base-io/src/main/java"
11073 #:test-dir "ops4j-base-io/src/test"
11074 #:test-exclude
11075 (list "**/ListerTest.java")))
11076 (inputs
11077 `(("lang" ,java-ops4j-base-monitors)
11078 ("lang" ,java-ops4j-base-lang)))
11079 (native-inputs
11080 `(("junit" ,java-junit)
11081 ("hamcrest" ,java-hamcrest-core)))
11082 (description "OPS4J stands for Open Participation Software for Java. This
11083package contains utilities and extensions related to handling streams and files.")))
11084
11085(define-public java-ops4j-base-util
11086 (package
11087 (inherit java-ops4j-base-lang)
11088 (name "java-ops4j-base-util")
11089 (arguments
11090 `(#:jar-name "java-ops4j-base-util.jar"
11091 #:source-dir "ops4j-base-util/src/main/java"
11092 #:test-dir "ops4j-base-util/src/test"))
11093 (inputs
11094 `(("lang" ,java-ops4j-base-lang)))
11095 (native-inputs
11096 `(("junit" ,java-junit)))
11097 (description "OPS4J stands for Open Participation Software for Java. This
11098package contains utilities and extensions related to environment, i18n and
11099mime types.")))
11100
11101(define-public java-ops4j-base-util-property
11102 (package
11103 (inherit java-ops4j-base-lang)
11104 (name "java-ops4j-base-util-property")
11105 (arguments
11106 `(#:jar-name "java-ops4j-base-util-property.jar"
11107 #:source-dir "ops4j-base-util-property/src/main/java"
11108 #:tests? #f)); no tests
11109 (inputs
11110 `(("lang" ,java-ops4j-base-lang)
11111 ("util" ,java-ops4j-base-util)))
11112 (description "OPS4J stands for Open Participation Software for Java. This
11113package contains utilities and extensions related to resolving properties from
11114different sources.")))
11115
11116(define-public java-ops4j-base-store
11117 (package
11118 (inherit java-ops4j-base-lang)
11119 (name "java-ops4j-base-store")
11120 (arguments
11121 `(#:jar-name "java-ops4j-base-store.jar"
11122 #:source-dir "ops4j-base-store/src/main/java"
11123 #:tests? #f)); no tests
11124 (inputs
11125 `(("lang" ,java-ops4j-base-lang)
11126 ("slf4j" ,java-slf4j-api)
11127 ("io" ,java-ops4j-base-io)))
11128 (description "OPS4J stands for Open Participation Software for Java. This
11129package contains utilities for storing and retrieving data from an
11130@code{InputStream}.")))
11131
11132(define-public java-ops4j-base-spi
11133 (package
11134 (inherit java-ops4j-base-lang)
11135 (name "java-ops4j-base-spi")
11136 (arguments
11137 `(#:jar-name "java-ops4j-base-spi.jar"
11138 #:source-dir "ops4j-base-spi/src/main/java"
11139 #:test-dir "ops4j-base-spi/src/test"))
11140 (native-inputs
11141 `(("junit" ,java-junit)
11142 ("hamcrest" ,java-hamcrest-core)))
11143 (description "OPS4J stands for Open Participation Software for Java. This
11144package contains utilities for obtaining services via the Java SE 6
11145@code{ServiceLoader}.")))
11146
11147(define-public java-aqute-bnd-annotation
11148 (package
11149 (name "java-aqute-bnd-annotation")
11150 (version "3.5.0")
11151 (source (origin
11152 (method url-fetch)
11153 (uri (string-append "https://github.com/bndtools/bnd/archive/"
11154 version ".REL.tar.gz"))
11155 (file-name (string-append name "-" version ".tar.gz"))
11156 (sha256
11157 (base32
11158 "1ggyiq0as0f6cz333a0dh98j72kmvv5pf2s47v9554yh905lfqdl"))))
11159 (build-system ant-build-system)
11160 (arguments
11161 `(#:jar-name "java-aqute-bnd-annotation.jar"
11162 #:source-dir "biz.aQute.bnd.annotation/src"
11163 #:tests? #f)); empty test dir
11164 (home-page "https://bnd.bndtools.org/")
11165 (synopsis "Tools for OSGi")
11166 (description "Bnd is a swiss army knife for OSGi, it creates manifest
11167headers based on analyzing the class code, it verifies the project settings,
11168it manages project dependencies, gives diffs jars, and much more.")
11169 (license license:asl2.0)))
11170
11171(define-public java-aqute-libg
11172 (package
11173 (inherit java-aqute-bnd-annotation)
11174 (name "java-aqute-libg")
11175 (arguments
11176 `(#:jar-name "java-aqute-libg.jar"
11177 ;; The build fails when source/target more recent than 1.7. This
11178 ;; is a known issue. See: https://github.com/bndtools/bnd/issues/1327
11179 ;;
11180 ;; It is closed as won't fix. There is no way to change the source
11181 ;; so that it works on 1.8, and still works on 1.6, the upstream
11182 ;; target. It work fine on 1.7, so we use 1.7.
11183 #:make-flags (list "-Dant.build.javac.source=1.7"
11184 "-Dant.build.javac.target=1.7")
11185 #:phases
11186 (modify-phases %standard-phases
11187 (add-before 'configure 'chdir
11188 ;; Change to aQute.libg directory, so that the relative
11189 ;; paths in the tests aren't broken.
11190 (lambda _
11191 (chdir "aQute.libg")
11192 #t))
11193 (add-before 'check 'create-test-directory
11194 ;; Copy the test directory to test/java, since that's where
11195 ;; ant-build-system's default project in build.xml expects to find
11196 ;; the test classes. Leave a copy in the original place to not
11197 ;; break paths in tests.
11198 (lambda _
11199 (mkdir "src/test")
11200 (copy-recursively "test" "src/test/java")
11201 #t)))))
11202 (inputs
11203 `(("slf4j" ,java-slf4j-api)
11204 ("osgi-annot" ,java-osgi-annotation)
11205 ("java-osgi-cmpn" ,java-osgi-cmpn)
11206 ("osgi" ,java-osgi-core)))
11207 (native-inputs
11208 `(("hamcrest" ,java-hamcrest-core)
11209 ("java-junit" ,java-junit)))))
11210
11211(define-public java-aqute-bndlib
11212 (package
11213 (inherit java-aqute-bnd-annotation)
11214 (name "java-aqute-bndlib")
11215 (arguments
11216 `(#:jar-name "java-bndlib.jar"
11217 #:source-dir "biz.aQute.bndlib/src"
11218 #:tests? #f)); no tests
11219 (inputs
11220 `(("slf4j" ,java-slf4j-api)
11221 ("osgi-annot" ,java-osgi-annotation)
11222 ("java-aqute-libg" ,java-aqute-libg)
11223 ("java-aqute-bnd-annotation" ,java-aqute-bnd-annotation)
11224 ("java-osgi-service-component-annotations" ,java-osgi-service-component-annotations)
11225 ("java-osgi-service-repository" ,java-osgi-service-repository)
11226 ("java-osgi-service-log" ,java-osgi-service-log)
11227 ("java-osgi-service-metatype-annotations" ,java-osgi-service-metatype-annotations)
11228 ("java-osgi-namespace-contract" ,java-osgi-namespace-contract)
11229 ("java-osgi-namespace-extender" ,java-osgi-namespace-extender)
11230 ("java-osgi-namespace-service" ,java-osgi-namespace-service)
11231 ("promise" ,java-osgi-util-promise)
11232 ("osgi" ,java-osgi-core)))))
11233
11234(define-public java-ops4j-pax-tinybundles
11235 (package
11236 (name "java-ops4j-pax-tinybundles")
11237 (version "2.1.1")
11238 (source (origin
11239 (method url-fetch)
11240 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.tinybundles/"
11241 "archive/tinybundles-" version ".tar.gz"))
11242 (sha256
11243 (base32
11244 "0y0gq3pvv0iir2b885lmlwnvr724vv7vklzhhr4fs27d7mdkj871"))))
11245 (arguments
11246 `(#:jar-name "java-ops4j-pax-tinybundles.jar"
11247 #:source-dir "src/main/java"
11248 #:test-exclude
11249 ;; Abstract base classes for other tests
11250 (list "**/BndTest.java" "**/CoreTest.java")
11251 #:phases
11252 (modify-phases %standard-phases
11253 (add-before 'check 'fix-version
11254 (lambda _
11255 ;; This test has a reference to an old version of bndlib we are not
11256 ;; packaging. It uses the version referenced in pom.xml. We replace
11257 ;; it with our own version.
11258 (substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
11259 (("[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*")
11260 ,(package-version java-aqute-bndlib)))
11261 #t)))))
11262 (inputs
11263 `(("lang" ,java-ops4j-base-lang)
11264 ("io" ,java-ops4j-base-io)
11265 ("store" ,java-ops4j-base-store)
11266 ("slf4j" ,java-slf4j-api)
11267 ("libg" ,java-aqute-libg)
11268 ("bndlib" ,java-aqute-bndlib)))
11269 (native-inputs
11270 `(("junit" ,java-junit)
11271 ("hamcrest" ,java-hamcrest-core)
11272 ("log4j" ,java-log4j-api)
11273 ("bndannotation" ,java-aqute-bnd-annotation)
11274 ("framework" ,java-osgi-framework)))
11275 (build-system ant-build-system)
11276 (home-page "https://ops4j1.jira.com/wiki/spaces/ops4j/pages/12060312/Tinybundles")
11277 (synopsis "Java APIs to create OSGi related artifacts")
11278 (description "Tinybundles is all about creating OSGi related artifacts like
11279Bundles, Fragments and Deployment Packages with Java Api. It is very convenient
11280to create such artifacts on-the-fly inside Tests (like in Pax Exam). On the
11281other hand, this library can be a foundation of real end user tools that need
11282to create those artifacts.")
11283 (license license:asl2.0)))
11284
11285(define-public java-ops4j-pax-exam-core
11286 (package
11287 (name "java-ops4j-pax-exam-core")
11288 (version "4.11.0")
11289 (source (origin
11290 (method url-fetch)
11291 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.exam2/"
11292 "archive/exam-reactor-" version ".tar.gz"))
11293 (sha256
11294 (base32
11295 "1b0f89gawxyl0pkqx9sicp6n58pirkzhjw41y749bwrkb6h99i26"))))
11296 (arguments
11297 (list #:jar-name "java-ops4j-pax-exam-core.jar"
11298 #:source-dir "core/pax-exam/src/main/java"
11299 #:test-dir "core/pax-exam/src/test"))
11300 (inputs
11301 (list java-slf4j-api
11302 java-ops4j-base-lang
11303 java-ops4j-base-io
11304 java-ops4j-base-util-property
11305 java-ops4j-base-store
11306 java-osgi-core))
11307 (native-inputs
11308 (list java-junit
11309 java-hamcrest-core))
11310 (build-system ant-build-system)
11311 (home-page "https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/overview")
11312 (synopsis "In-Container Testing for OSGi, Java EE and CDI")
11313 (description "Pax Exam creates OSGi bundles for testing purposes. It lets
11314the user take control of the OSGi framework, the test framework (e.g. JUnit) and
11315the system under test at the same time.")
11316 (license license:asl2.0)))
11317
11318(define-public java-ops4j-pax-exam-core-spi
11319 (package
11320 (inherit java-ops4j-pax-exam-core)
11321 (name "java-ops4j-pax-exam-core-spi")
11322 (arguments
11323 `(#:jar-name "java-ops4j-pax-exam-spi.jar"
11324 #:source-dir "src/main/java"
11325 #:test-exclude
11326 (list
11327 ;; Abstract base class, not a test
11328 "**/BaseStagedReactorTest.java"
11329 ;; Depends on org.mortbay.jetty.testwars:test-war-dump
11330 "**/WarBuilderTest.java")
11331 #:phases
11332 (modify-phases %standard-phases
11333 (add-before 'configure 'chdir
11334 (lambda _
11335 ;; Tests assume we are in this directory
11336 (chdir "core/pax-exam-spi")
11337 #t))
11338 (add-before 'check 'fix-tests
11339 (lambda _
11340 ;; One test checks that this file is present.
11341 (mkdir-p "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi")
11342 (with-output-to-file
11343 "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi/pom.properties"
11344 (lambda _
11345 (display
11346 (string-append "artifactId = pax-exam-spi\n"
11347 "version = " ,(package-version java-ops4j-pax-exam-core-spi)))))
11348 ;; Maven puts compilation results in the target directory, while we
11349 ;; put them in the build directory.
11350 (substitute* '("src/test/java/org/ops4j/pax/exam/spi/war/WarBuilderTest.java"
11351 "src/test/java/org/ops4j/pax/exam/spi/war/WarTestProbeBuilderTest.java"
11352 "src/test/java/org/ops4j/pax/exam/spi/war/ZipBuilderTest.java")
11353 (("target") "build"))
11354 ;; One test is expected to fail, but it doesn't throw the expected exception
11355 (substitute* "src/test/java/org/ops4j/pax/exam/spi/reactors/BaseStagedReactorTest.java"
11356 (("AssertionError") "IllegalArgumentException"))
11357 #t)))))
11358 (inputs
11359 `(("java-ops4j-pax-exam-core" ,java-ops4j-pax-exam-core)
11360 ("lang" ,java-ops4j-base-lang)
11361 ("monitors" ,java-ops4j-base-monitors)
11362 ("store" ,java-ops4j-base-store)
11363 ("io" ,java-ops4j-base-io)
11364 ("spi" ,java-ops4j-base-spi)
11365 ("osgi" ,java-osgi-core)
11366 ("slf4j" ,java-slf4j-api)
11367 ("tinybundles" ,java-ops4j-pax-tinybundles)))
11368 (native-inputs
11369 `(("mockito" ,java-mockito-1)
11370 ("junit" ,java-junit)
11371 ("hamcrest" ,java-hamcrest-core)
11372 ("cglib" ,java-cglib)
11373 ("objenesis" ,java-objenesis)))))
11374
11375(define-public java-ops4j-pax-exam-core-junit
11376 (package
11377 (inherit java-ops4j-pax-exam-core)
11378 (name "java-ops4j-pax-exam-core-junit")
11379 (arguments
11380 `(#:jar-name "ops4j-pax-exam-core-junit.jar"
11381 #:source-dir "drivers/pax-exam-junit4/src/main/java"
11382 #:tests? #f)); no tests
11383 (inputs
11384 `(("junit" ,java-junit)
11385 ("slf4j" ,java-slf4j-api)
11386 ("core" ,java-ops4j-pax-exam-core)
11387 ("spi" ,java-ops4j-pax-exam-core-spi)))
11388 (native-inputs '())))
11389
11390(define-public java-fasterxml-jackson-annotations
11391 (package
11392 (name "java-fasterxml-jackson-annotations")
11393 (version "2.9.4")
11394 (source (origin
11395 (method url-fetch)
11396 (uri (string-append "https://github.com/FasterXML/"
11397 "jackson-annotations/archive/"
11398 "jackson-annotations-" version ".tar.gz"))
11399 (sha256
11400 (base32
11401 "0mr95xd0da6a4g95zvrl1ryk5n5zv2rc696w3xnsr5hxk2gicfc4"))))
11402 (build-system ant-build-system)
11403 (arguments
11404 `(#:jar-name "jackson-annotations.jar"
11405 #:source-dir "src/main/java"
11406 #:test-dir "src/test"))
11407 (native-inputs
11408 `(("junit" ,java-junit)))
11409 (home-page "https://github.com/FasterXML/jackson-annotations")
11410 (synopsis "General purpose annotations for the Jackson Data Processor")
11411 (description "This package contains general purpose annotations for the
11412Jackson Data Processor, used on value and handler types. The only annotations
11413not included are ones that require dependency to the Databind package.")
11414 (license license:asl2.0)))
11415
11416(define-public java-fasterxml-jackson-core
11417 (package
11418 (name "java-fasterxml-jackson-core")
11419 (version "2.9.4")
11420 (source (origin
11421 (method url-fetch)
11422 (uri (string-append "https://github.com/FasterXML/"
11423 "jackson-core/archive/"
11424 "jackson-core-" version ".tar.gz"))
11425 (sha256
11426 (base32
11427 "159hsnk17jr1gyzkf01cxvsn45srnk37g949r7364qlsr527gjgd"))))
11428 (build-system ant-build-system)
11429 (arguments
11430 `(#:jar-name "jackson-core.jar"
11431 #:source-dir "src/main/java"
11432 #:test-dir "src/test"
11433 #:test-exclude
11434 (list
11435 ;; Expected failure. pom.xml excludes these
11436 "**/failing/**"
11437 ;; Base classes that have no constructor for junit
11438 "**/BaseTest.java"
11439 "**/ConcurrencyReadTest.java"
11440 "**/ManualCharAccessTest.java"
11441 "**/ManualCharAccessTest.java"
11442 "**/TrailingCommasTest.java"
11443 "**/AsyncMissingValuesInObjectTest.java"
11444 "**/AsyncMissingValuesInArrayTest.java")
11445 #:phases
11446 (modify-phases %standard-phases
11447 (add-before 'configure 'generate-PackageVersion.java
11448 (lambda _
11449 (let* ((out "src/main/java/com/fasterxml/jackson/core/json/PackageVersion.java")
11450 (in (string-append out ".in")))
11451 (copy-file in out)
11452 (substitute* out
11453 (("@package@") "com.fasterxml.jackson.core.json")
11454 (("@projectversion@") ,version)
11455 (("@projectgroupid@") "com.fasterxml.jackson.core")
11456 (("@projectartifactid@") "jackson-core")))
11457 #t))
11458 (add-before 'build 'copy-resources
11459 (lambda _
11460 (copy-recursively "src/main/resources"
11461 "build/classes")
11462 #t))
11463 (add-before 'check 'copy-test-resources
11464 (lambda _
11465 (copy-recursively "src/test/resources"
11466 "build/test-classes")
11467 #t)))))
11468 (native-inputs
11469 `(("junit" ,java-junit)
11470 ("hamcrest" ,java-hamcrest-core)))
11471 (home-page "https://github.com/FasterXML/jackson-core")
11472 (synopsis "Low-level streaming parser and generator abstractions")
11473 (description "This package contains core low-level incremental
11474(streaming) parser and generator abstractions used by the Jackson Data
11475Processor. It also includes the default implementation of handler types
11476(parser, generator) that handle JSON format.")
11477 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11478
11479(define-public java-fasterxml-jackson-databind
11480 (package
11481 (name "java-fasterxml-jackson-databind")
11482 (version "2.9.4")
11483 (source (origin
11484 (method url-fetch)
11485 (uri (string-append "https://github.com/FasterXML/"
11486 "jackson-databind/archive/"
11487 "jackson-databind-" version ".tar.gz"))
11488 (sha256
11489 (base32
11490 "1zd2cw4z6kdkbx8za96xh9pyicv2a2l7y0rkcx2fqd8hv6d47s08"))))
11491 (build-system ant-build-system)
11492 (arguments
11493 `(#:jar-name "jackson-databind.jar"
11494 #:source-dir "src/main/java"
11495 #:tests? #f; requires javax.measures for which I can't find a free implementation
11496 #:phases
11497 (modify-phases %standard-phases
11498 (add-before 'configure 'generate-PackageVersion.java
11499 (lambda _
11500 (let* ((out "src/main/java/com/fasterxml/jackson/databind/cfg/PackageVersion.java")
11501 (in (string-append out ".in")))
11502 (copy-file in out)
11503 (substitute* out
11504 (("@package@") "com.fasterxml.jackson.databind.cfg")
11505 (("@projectversion@") ,version)
11506 (("@projectgroupid@") "com.fasterxml.jackson.databind")
11507 (("@projectartifactid@") "jackson-databind")))
11508 #t))
11509 (add-before 'build 'copy-resources
11510 (lambda _
11511 (copy-recursively "src/main/resources" "build/classes")
11512 #t)))))
11513 (inputs
11514 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core))
11515 (home-page "https://github.com/FasterXML/jackson-databind")
11516 (synopsis "Data-binding functionality and tree-model for the Jackson Data Processor")
11517 (description "This package contains the general-purpose data-binding
11518functionality and tree-model for Jackson Data Processor. It builds on core
11519streaming parser/generator package, and uses Jackson Annotations for
11520configuration.")
11521 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11522
11523(define-public java-fasterxml-jackson-modules-base-jaxb
11524 (package
11525 (name "java-fasterxml-jackson-modules-base-jaxb")
11526 (version "2.9.4")
11527 (source (origin
11528 (method url-fetch)
11529 (uri (string-append "https://github.com/FasterXML/"
11530 "jackson-modules-base/archive/"
11531 "jackson-modules-base-" version ".tar.gz"))
11532 (sha256
11533 (base32
11534 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
11535 (build-system ant-build-system)
11536 (arguments
11537 `(#:jar-name "jackson-modules-base-jaxb.jar"
11538 #:source-dir "jaxb/src/main/java"
11539 #:test-dir "jaxb/src/test"
11540 #:test-exclude
11541 ;; Base class for tests
11542 (list "**/BaseJaxbTest.java")
11543 #:phases
11544 (modify-phases %standard-phases
11545 (add-before 'configure 'generate-PackageVersion.java
11546 (lambda _
11547 (let* ((out (string-append "jaxb/src/main/java/com/fasterxml/"
11548 "jackson/module/jaxb/PackageVersion.java"))
11549 (in (string-append out ".in")))
11550 (copy-file in out)
11551 (substitute* out
11552 (("@package@") "com.fasterxml.jackson.module.jaxb")
11553 (("@projectversion@") ,version)
11554 (("@projectgroupid@") "com.fasterxml.jackson.module.jaxb")
11555 (("@projectartifactid@") "jackson-module-jaxb")))
11556 #t))
11557 (add-before 'build 'copy-resources
11558 (lambda _
11559 (copy-recursively "jaxb/src/main/resources" "build/classes")
11560 #t)))))
11561 (inputs
11562 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core
11563 java-fasterxml-jackson-databind))
11564 (native-inputs
11565 (list java-junit))
11566 (home-page "https://github.com/FasterXML/jackson-modules-base")
11567 (synopsis "Jaxb annotations jackson module")
11568 (description "This package is the jaxb annotations module for jackson.")
11569 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11570
11571(define-public java-fasterxml-jackson-modules-base-mrbean
11572 (package
11573 (name "java-fasterxml-jackson-modules-base-mrbean")
11574 (version "2.9.4")
11575 (source (origin
11576 (method url-fetch)
11577 (uri (string-append "https://github.com/FasterXML/"
11578 "jackson-modules-base/archive/"
11579 "jackson-modules-base-" version ".tar.gz"))
11580 (sha256
11581 (base32
11582 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
11583 (build-system ant-build-system)
11584 (arguments
11585 `(#:jar-name "jackson-modules-base-mrbean.jar"
11586 #:source-dir "mrbean/src/main/java"
11587 #:test-dir "mrbean/src/test"
11588 #:test-exclude
11589 ;; Base class for tests
11590 (list "**/BaseTest.java")
11591 #:phases
11592 (modify-phases %standard-phases
11593 (add-before 'configure 'generate-PackageVersion.java
11594 (lambda _
11595 (let* ((out (string-append "mrbean/src/main/java/com/fasterxml/"
11596 "jackson/module/mrbean/PackageVersion.java"))
11597 (in (string-append out ".in")))
11598 (copy-file in out)
11599 (substitute* out
11600 (("@package@") "com.fasterxml.jackson.module.mrbean")
11601 (("@projectversion@") ,version)
11602 (("@projectgroupid@") "com.fasterxml.jackson.module.mrbean")
11603 (("@projectartifactid@") "jackson-module-mrbean")))
11604 #t)))))
11605 (inputs
11606 (list java-asm java-fasterxml-jackson-annotations
11607 java-fasterxml-jackson-core java-fasterxml-jackson-databind))
11608 (native-inputs
11609 (list java-junit))
11610 (home-page "https://github.com/FasterXML/jackson-modules-base")
11611 (synopsis "POJO type materialization for Java")
11612 (description "This package implements POJO type materialization.
11613Databinders can construct implementation classes for Java interfaces as part
11614of deserialization.")
11615 (license license:asl2.0)))
11616
11617(define-public java-snakeyaml
11618 (package
11619 (name "java-snakeyaml")
11620 (version "1.18")
11621 (source (origin
11622 (method url-fetch)
11623 (uri (string-append "https://bitbucket.org/asomov/snakeyaml/get/v"
11624 version ".tar.gz"))
11625 (file-name (string-append name "-" version ".tar.gz"))
11626 (sha256
11627 (base32
11628 "0474cqcv46zgv9bhms2vgawakq1vyj0hp3h3f1bfys46msia90bh"))))
11629 (build-system ant-build-system)
11630 (arguments
11631 `(#:jar-name "java-snakeyaml.jar"
11632 #:source-dir "src/main/java"
11633 ;; Tests require velocity, a cyclic dependency, and
11634 ;; java-spring-framework-context which is not packaged.
11635 #:tests? #f))
11636 (home-page "https://bitbucket.org/asomov/snakeyaml")
11637 (synopsis "YAML processor")
11638 (description "SnakeYAML is a YAML processor for the Java Virtual Machine.")
11639 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11640
11641(define-public java-fasterxml-jackson-dataformat-yaml
11642 (package
11643 (name "java-fasterxml-jackson-dataformat-yaml")
11644 (version "2.9.4")
11645 (source (origin
11646 (method url-fetch)
11647 (uri (string-append "https://github.com/FasterXML/"
11648 "jackson-dataformats-text/archive/"
11649 "jackson-dataformats-text-" version ".tar.gz"))
11650 (sha256
11651 (base32
11652 "1hikl06khaxbg439avf442qifcadap8w0lx13f0nnhp2vh3dkbz7"))))
11653 (build-system ant-build-system)
11654 (arguments
11655 `(#:jar-name "jackson-dataformat-yaml.jar"
11656 #:source-dir "yaml/src/main/java"
11657 #:test-dir "yaml/src/test"
11658 #:test-exclude (list "**/failing/**.java")
11659 #:phases
11660 (modify-phases %standard-phases
11661 (add-before 'configure 'generate-PackageVersion.java
11662 (lambda _
11663 (let* ((out "yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/PackageVersion.java")
11664 (in (string-append out ".in")))
11665 (copy-file in out)
11666 (substitute* out
11667 (("@package@") "com.fasterxml.jackson.dataformat.yaml")
11668 (("@projectversion@") ,version)
11669 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.yaml")
11670 (("@projectartifactid@") "jackson-dataformat-yaml")))
11671 #t)))))
11672 (inputs
11673 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core
11674 java-fasterxml-jackson-databind java-snakeyaml))
11675 (native-inputs
11676 `(("junit" ,java-junit)
11677 ("hamcrest" ,java-hamcrest-core)
11678 ("java-ops4j-pax-exam-core-spi" ,java-ops4j-pax-exam-core-spi)
11679 ("java-ops4j-pax-exam-core-junit" ,java-ops4j-pax-exam-core-junit)
11680 ("java-ops4j-pax-exam" ,java-ops4j-pax-exam-core)))
11681 (home-page "https://github.com/FasterXML/jackson-dataformats-text")
11682 (synopsis "Yaml backend for Jackson")
11683 (description "Dataformat backends are used to support format alternatives
11684to JSON, supported by default. This is done by sub-classing Jackson core
11685abstractions.")
11686 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11687
11688(define-public java-stax2-api
11689 (package
11690 (name "java-stax2-api")
11691 (version "4.0.0")
11692 (source (origin
11693 (method url-fetch)
11694 (uri (string-append "https://github.com/FasterXML/stax2-api/archive/"
11695 "stax2-api-" version ".tar.gz"))
11696 (sha256
11697 (base32
11698 "1amc1si0l0hyyw2sawmnzy4hkna3z6fp195y4nm5m9wb9ld5awkq"))))
11699 (build-system ant-build-system)
11700 (arguments
11701 `(#:jar-name "java-stax2-api.jar"
11702 #:source-dir "src/main/java"
11703 #:tests? #f)); no tests
11704 (home-page "https://github.com/FasterXML/stax2-api")
11705 (synopsis "Stax2 API")
11706 (description "Stax2 API is an extension to basic Stax 1.0 API that adds
11707significant new functionalities, such as full-featured bi-direction validation
11708interface and high-performance Typed Access API.")
11709 (license license:bsd-2)))
11710
11711(define-public java-woodstox-core
11712 (package
11713 (name "java-woodstox-core")
11714 (version "5.0.3")
11715 (source (origin
11716 (method git-fetch)
11717 (uri (git-reference
11718 (url "https://github.com/FasterXML/woodstox")
11719 (commit (string-append "woodstox-core-" version))))
11720 (file-name (git-file-name name version))
11721 (sha256
11722 (base32
11723 "0bfylk24a967hwxprxqbg6cdvm6n4ldcarp54yg980viwvjiglyp"))))
11724 (build-system ant-build-system)
11725 (arguments
11726 `(#:jar-name "woodstox.jar"
11727 #:test-exclude
11728 (list "**/Base*.java" "failing/**")
11729 #:phases
11730 (modify-phases %standard-phases
11731 (add-before 'build 'remove-msv-dep
11732 (lambda _
11733 ;; we don't need osgi, and it depends on msv
11734 (delete-file-recursively "src/main/java/com/ctc/wstx/osgi")
11735 ;; msv's latest release is from 2011 and we don't need it
11736 (delete-file-recursively "src/main/java/com/ctc/wstx/msv")
11737 (delete-file-recursively "src/test/java/wstxtest/osgi")
11738 (delete-file-recursively "src/test/java/wstxtest/msv")
11739 #t))
11740 (add-before 'build 'copy-resources
11741 (lambda _
11742 (copy-recursively "src/main/resources" "build/classes")
11743 #t)))))
11744 (inputs
11745 `(("stax2" ,java-stax2-api)))
11746 (native-inputs
11747 `(("junit" ,java-junit)))
11748 (home-page "https://github.com/FasterXML/woodstox")
11749 (synopsis "Stax XML API implementation")
11750 (description "Woodstox is a stax XML API implementation.")
11751 (license license:asl2.0)))
11752
11753(define-public java-fasterxml-jackson-dataformat-xml
11754 (package
11755 (name "java-fasterxml-jackson-dataformat-xml")
11756 (version "2.9.4")
11757 (source (origin
11758 (method git-fetch)
11759 (uri (git-reference
11760 (url "https://github.com/FasterXML/jackson-dataformat-xml")
11761 (commit (string-append "jackson-dataformat-xml-" version))))
11762 (file-name (git-file-name name version))
11763 (sha256
11764 (base32
11765 "0s1wl65mbs57c2hz2v8rnh8i04y5lpyyvnjz562j5j6b83vwwpfx"))))
11766 (build-system ant-build-system)
11767 (arguments
11768 `(#:jar-name "jackson-dataformat-xml.jar"
11769 #:source-dir "src/main/java"
11770 #:test-exclude
11771 (list "**/failing/**")
11772 #:phases
11773 (modify-phases %standard-phases
11774 (add-before 'configure 'generate-PackageVersion.java
11775 (lambda _
11776 (let* ((out "src/main/java/com/fasterxml/jackson/dataformat/xml/PackageVersion.java")
11777 (in (string-append out ".in")))
11778 (copy-file in out)
11779 (newline)
11780 (substitute* out
11781 (("@package@") "com.fasterxml.jackson.dataformat.xml")
11782 (("@projectversion@") ,version)
11783 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.xml")
11784 (("@projectartifactid@") "jackson-dataformat-xml")))
11785 #t))
11786 (add-before 'build 'copy-resources
11787 (lambda _
11788 (copy-recursively "src/main/resources" "build/classes")
11789 #t)))))
11790 (inputs
11791 `(("jackson-annotations" ,java-fasterxml-jackson-annotations)
11792 ("jackson-core" ,java-fasterxml-jackson-core)
11793 ("jackson-modules-base-jaxb" ,java-fasterxml-jackson-modules-base-jaxb)
11794 ("jackson-databind" ,java-fasterxml-jackson-databind)
11795 ("stax2-api" ,java-stax2-api)
11796 ("woodstox" ,java-woodstox-core)))
11797 (native-inputs
11798 `(("junit" ,java-junit)
11799 ("hamcrest" ,java-hamcrest-core)))
11800 (home-page "https://github.com/FasterXML/jackson-dataformat-xml")
11801 (synopsis "Read and write XML")
11802 (description "This package contains Jackson extension component for reading
11803and writing XML encoded data.
11804
11805Further, the goal is to emulate how JAXB data-binding works with \"Code-first\"
11806approach (that is, no support is added for \"Schema-first\" approach). Support
11807for JAXB annotations is provided by JAXB annotation module; this module
11808provides low-level abstractions (@code{JsonParser}, @code{JsonGenerator},
11809@code{JsonFactory}) as well as small number of higher level overrides needed to
11810make data-binding work.")
11811 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11812
11813(define-public java-hdrhistogram
11814 (package
11815 (name "java-hdrhistogram")
11816 (version "2.1.9")
11817 (source (origin
11818 (method git-fetch)
11819 (uri (git-reference
11820 (url "https://github.com/HdrHistogram/HdrHistogram")
11821 (commit (string-append "HdrHistogram-" version))))
11822 (file-name (git-file-name name version))
11823 (sha256
11824 (base32
11825 "1cw8aa1vk258k42xs6wpy72m4gbai540jq032qsa7c5586iawx2d"))))
11826 (build-system ant-build-system)
11827 (arguments
11828 `(#:jar-name "java-hdrhistogram.jar"
11829 #:source-dir "src/main/java"
11830 #:phases
11831 (modify-phases %standard-phases
11832 (add-after 'unpack 'make-files-writable
11833 (lambda _
11834 (for-each make-file-writable (find-files "."))
11835 #t))
11836 (add-before 'configure 'set-version
11837 (lambda _
11838 (let* ((version-java "src/main/java/org/HdrHistogram/Version.java")
11839 (template (string-append version-java ".template")))
11840 (copy-file template version-java)
11841 (substitute* version-java
11842 (("\\$VERSION\\$") ,version)
11843 (("\\$BUILD_TIME\\$") "0"))
11844 #t))))))
11845 (native-inputs
11846 `(("junit" ,java-junit)
11847 ("hamcrest" ,java-hamcrest-core)))
11848 (home-page "https://hdrhistogram.github.io/HdrHistogram")
11849 (synopsis "High dynamic range histogram")
11850 (description "Hdrhistogram creates histograms that support
11851recording and analyzing sampled data value counts across a configurable integer
11852value range with configurable value precision within the range. Value precision
11853is expressed as the number of significant digits in the value recording, and
11854provides control over value quantization behavior across the value range and
11855the subsequent value resolution at any given level.")
11856 (license license:public-domain)))
11857
11858(define-public java-cofoja
11859 (package
11860 (name "java-cofoja")
11861 (version "1.3")
11862 (source (origin
11863 (method git-fetch)
11864 (uri (git-reference
11865 (url "https://github.com/nhatminhle/cofoja")
11866 (commit (string-append "v" version))))
11867 (file-name (string-append "java-cofoja-" version "-checkout"))
11868 (sha256
11869 (base32
11870 "0p7sz8y5xgpi5rx1qwn6587fkd52qr3ha3ybh14gqcyxhikl525w"))))
11871 (build-system ant-build-system)
11872 (arguments
11873 `(#:build-target "dist"
11874 #:test-target "test"
11875 #:jdk ,icedtea-8
11876 #:make-flags
11877 (list "-Ddist.dir=dist")
11878 #:modules ((guix build ant-build-system)
11879 (guix build java-utils)
11880 (guix build utils)
11881 (srfi srfi-1)
11882 (ice-9 match))
11883 #:phases
11884 (modify-phases %standard-phases
11885 ;; The bulid system ignores the class path the ant-build-system sets
11886 ;; up and instead expects to find all dependencies in the "lib"
11887 ;; directory.
11888 (add-after 'unpack 'create-libdir
11889 (lambda* (#:key inputs #:allow-other-keys)
11890 (mkdir-p "lib")
11891 (for-each
11892 (lambda (file)
11893 (let ((target (string-append "lib/" (basename file))))
11894 (unless (file-exists? target)
11895 (symlink file target))))
11896 (append-map (match-lambda
11897 ((label . dir)
11898 (find-files dir "\\.jar$")))
11899 inputs))
11900 #t))
11901 (replace 'install (install-jars "dist")))))
11902 (inputs
11903 (list java-asm))
11904 (native-inputs
11905 (list java-junit))
11906 (home-page "https://github.com/nhatminhle/cofoja")
11907 (synopsis "Contracts for Java")
11908 (description "Contracts for Java, or Cofoja for short, is a contract
11909programming framework and test tool for Java, which uses annotation processing
11910and bytecode instrumentation to provide run-time checking. (In particular,
11911this is not a static analysis tool.)")
11912 (license license:lgpl3+)))
11913
11914(define-public java-aopalliance
11915 (package
11916 (name "java-aopalliance")
11917 (version "1.0")
11918 (source (origin
11919 (method git-fetch)
11920 ;; Note: this git repository is not official, but contains the
11921 ;; source code that is in the CVS repository. Downloading the
11922 ;; tarball from sourceforge is undeterministic, and the cvs download
11923 ;; fails.
11924 (uri (git-reference
11925 (url "https://github.com/hoverruan/aopalliance")
11926 (commit "0d7757ae204e5876f69431421fe9bc2a4f01e8a0")))
11927 (file-name (string-append name "-" version))
11928 (sha256
11929 (base32
11930 "0rsg2b0v3hxlq2yk1i3m2gw3xwq689j3cwx9wbxvqfpdcjbca0qr"))))
11931 (build-system ant-build-system)
11932 (arguments
11933 `(#:jar-name "java-aopalliance.jar"
11934 #:jdk ,icedtea-8
11935 #:tests? #f; no tests
11936 #:source-dir "aopalliance/src/main"
11937 #:phases
11938 (modify-phases %standard-phases
11939 (add-before 'install 'create-pom
11940 (generate-pom.xml "pom.xml" "aopalliance" "aopalliance" ,version))
11941 (replace 'install
11942 (install-from-pom "pom.xml")))))
11943 (home-page "https://aopalliance.sourceforge.net")
11944 (synopsis "Aspect-Oriented Programming")
11945 (description "The AOP Alliance project is a joint project between several
11946software engineering people who are interested in Aspect-Oriented Programming
11947(AOP) and Java.")
11948 (license license:public-domain)))
11949
11950(define-public java-javax-inject
11951 (package
11952 (name "java-javax-inject")
11953 (version "1")
11954 (source (origin
11955 (method git-fetch)
11956 (uri (git-reference
11957 (url "https://github.com/javax-inject/javax-inject")
11958 (commit version)))
11959 (file-name (git-file-name name version))
11960 (sha256
11961 (base32
11962 "1rspl0nkvk1jif6nccikw93xic6ljj2b6kpy2mffwi2mnvc13j7x"))))
11963 (build-system ant-build-system)
11964 (arguments
11965 `(#:jar-name "java-javax-inject.jar"
11966 #:tests? #f; no tests
11967 #:phases
11968 (modify-phases %standard-phases
11969 (replace 'install
11970 (install-from-pom "pom.xml")))))
11971 (home-page "https://github.com/javax-inject/javax-inject")
11972 (synopsis "JSR-330: Dependency Injection for Java")
11973 (description "This package specifies a means for obtaining objects in such
11974a way as to maximize reusability, testability and maintainability compared to
11975traditional approaches such as constructors, factories, and service locators
11976(e.g., JNDI). This process, known as dependency injection, is beneficial to
11977most nontrivial applications.
11978
11979Many types depend on other types. For example, a @var{Stopwatch} might depend
11980on a @var{TimeSource}. The types on which a type depends are known as its
11981dependencies. The process of finding an instance of a dependency to use at run
11982time is known as resolving the dependency. If no such instance can be found,
11983the dependency is said to be unsatisfied, and the application is broken.")
11984 (license license:asl2.0)))
11985
11986(define-public java-guice
11987 (package
11988 (name "java-guice")
11989 (version "4.1")
11990 (source (origin
11991 (method git-fetch)
11992 (uri (git-reference
11993 (url "https://github.com/google/guice")
11994 (commit version)))
11995 (file-name (git-file-name name version))
11996 (modules '((guix build utils)))
11997 (snippet
11998 `(begin
11999 (for-each delete-file (find-files "." ".*.jar")) #t))
12000 (sha256
12001 (base32
12002 "18im5hdfl4q1b9chww2s1ii60sn3ydyyar32a2sf2p2g8zlbdswq"))))
12003 (build-system ant-build-system)
12004 (arguments
12005 `(#:jar-name "java-guice.jar"
12006 #:jdk ,icedtea-8
12007 #:tests? #f; FIXME: tests are not in a java sub directory
12008 #:source-dir "core/src"
12009 #:phases
12010 (modify-phases %standard-phases
12011 (add-after 'unpack 'make-files-writable
12012 (lambda _
12013 (for-each make-file-writable (find-files "."))
12014 #t))
12015 (replace 'install
12016 (install-from-pom "core/pom.xml")))))
12017 (propagated-inputs
12018 (list java-aopalliance
12019 java-cglib
12020 java-guava
12021 java-javax-inject
12022 java-guice-parent-pom))
12023 (home-page "https://github.com/google/guice")
12024 (synopsis "Lightweight dependency injection framework")
12025 (description "Guice is a lightweight dependency injection framework for
12026Java 6 and above.")
12027 (license license:asl2.0)))
12028
12029(define-public java-guice-servlet
12030 (package
12031 (inherit java-guice)
12032 (name "java-guice-servlet")
12033 (arguments
12034 `(#:jar-name "guice-servlet.jar"
12035 #:source-dir "extensions/servlet/src/"
12036 #:jdk ,icedtea-8
12037 #:tests? #f ; FIXME: not in a java subdir
12038 #:phases
12039 (modify-phases %standard-phases
12040 (add-after 'unpack 'make-files-writable
12041 (lambda _
12042 (for-each make-file-writable (find-files "."))
12043 #t)))))
12044 (inputs
12045 `(("guice" ,java-guice)
12046 ("servlet" ,java-classpathx-servletapi)
12047 ,@(package-inputs java-guice)))))
12048
12049(define java-guice-parent-pom
12050 (package
12051 (inherit java-guice)
12052 (name "java-guice-parent-pom")
12053 (arguments
12054 `(#:tests? #f
12055 #:phases
12056 (modify-phases %standard-phases
12057 (delete 'configure)
12058 (delete 'build)
12059 (add-after 'install 'install-extensions
12060 (install-pom-file "extensions/pom.xml"))
12061 (replace 'install
12062 (install-pom-file "pom.xml")))))
12063 (propagated-inputs
12064 `(("java-google-parent-pom" ,java-google-parent-pom-5)))))
12065
12066(define java-google-parent-pom-5
12067 (package
12068 (name "java-google-parent-pom")
12069 (version "5")
12070 (source (origin
12071 (method git-fetch)
12072 (uri (git-reference
12073 (url "https://github.com/google/google-maven-parents")
12074 (commit (string-append "google-" version))))
12075 (file-name (git-file-name name version))
12076 (sha256
12077 (base32
12078 "0zb7hx24p8k8rfdvix2vsbfqn73jhrycdndvhf8j5gbii9wbqibv"))))
12079 (build-system ant-build-system)
12080 (arguments
12081 `(#:tests? #f
12082 #:phases
12083 (modify-phases %standard-phases
12084 (delete 'configure)
12085 (delete 'build)
12086 (replace 'install
12087 (install-pom-file "pom.xml")))))
12088 (home-page "https://github.com/google/google-maven-parents")
12089 (synopsis "Google parent pom")
12090 (description "This package contains the Maven parent POM for other Google
12091Java projects.")
12092 (license license:asl2.0)))
12093
12094(define-public java-assertj
12095 (package
12096 (name "java-assertj")
12097 (version "3.8.0")
12098 (source (origin
12099 (method git-fetch)
12100 (uri (git-reference
12101 (url "https://github.com/joel-costigliola/assertj-core")
12102 (commit (string-append "assertj-core-" version))))
12103 (file-name (git-file-name name version))
12104 (sha256
12105 (base32
12106 "1k35cg2in7pzk4pbdjryr0pll5lgk1r6ngrn0j8cdlgi7w8zh2d1"))))
12107 (build-system ant-build-system)
12108 (arguments
12109 `(#:jar-name "java-assertj.jar"
12110 #:jdk ,icedtea-8
12111 #:source-dir "src/main/java"
12112 #:tests? #f)); depends on tng-junit which depends on assertj
12113 (inputs
12114 `(("cglib" ,java-cglib)
12115 ("junit" ,java-junit)
12116 ("hamcrest" ,java-hamcrest-core)))
12117 (native-inputs
12118 `(("mockito" ,java-mockito-1)))
12119 (home-page "https://joel-costigliola.github.io/assertj/index.html")
12120 (synopsis "Fluent assertions for java")
12121 (description "AssertJ core is a Java library that provides a fluent
12122interface for writing assertions. Its main goal is to improve test code
12123readability and make maintenance of tests easier.")
12124 (license license:asl2.0)))
12125
12126(define-public java-jboss-javassist
12127 (package
12128 (name "java-jboss-javassist")
12129 (version "3.21.0")
12130 (source (origin
12131 (method git-fetch)
12132 (uri (git-reference
12133 (url "https://github.com/jboss-javassist/javassist")
12134 (commit
12135 (string-append "rel_"
12136 (string-map
12137 (lambda (x) (if (eq? x #\.) #\_ x)) version)
12138 "_ga"))))
12139 (file-name (git-file-name name version))
12140 (sha256
12141 (base32
12142 "0h3zlcyqiaq01fspm69h7vki67raw305w89p4ha8vlhpzw02qifm"))
12143 (modules '((guix build utils)))
12144 (snippet
12145 '(begin
12146 (delete-file "javassist.jar")))))
12147 (build-system ant-build-system)
12148 (arguments
12149 `(#:jar-name "java-jboss-javassist.jar"
12150 #:jdk ,icedtea-8
12151 #:source-dir "src/main"
12152 #:tests? #f; FIXME: requires junit-awtui and junit-swingui from junit3
12153 #:phases
12154 (modify-phases %standard-phases
12155 (add-after 'unpack 'make-files-writable
12156 (lambda _
12157 (for-each make-file-writable (find-files "."))
12158 #t)))))
12159 (native-inputs
12160 `(("junit" ,java-junit)))
12161 (home-page "https://github.com/jboss-javassist/javassist")
12162 (synopsis "Java bytecode engineering toolkit")
12163 (description "Javassist (JAVA programming ASSISTant) makes Java bytecode
12164manipulation simple. It is a class library for editing bytecodes in Java; it
12165enables Java programs to define a new class at runtime and to modify a class
12166file when the JVM loads it.")
12167 (license (list license:gpl2 license:cddl1.0)))); either gpl2 only or cddl.
12168
12169(define-public java-jcommander
12170 (package
12171 (name "java-jcommander")
12172 (version "1.71")
12173 (source (origin
12174 (method git-fetch)
12175 (uri (git-reference
12176 (url "https://github.com/cbeust/jcommander")
12177 (commit version)))
12178 (file-name (git-file-name name version))
12179 (sha256
12180 (base32
12181 "12vcpc19sd7jhvjgp7xz1qjanfix162xb3x2q5zah93rjklj1h57"))))
12182 (build-system ant-build-system)
12183 (arguments
12184 `(#:jar-name "java-jcommander.jar"
12185 #:jdk ,icedtea-8
12186 #:tests? #f; requires testng which depends on jcommander
12187 #:source-dir "src/main/java"))
12188 (home-page "https://jcommander.org")
12189 (synopsis "Command line parameters parser")
12190 (description "JCommander is a very small Java framework that makes it
12191trivial to parse command line parameters. Parameters are declared with
12192annotations.")
12193 (license license:asl2.0)))
12194
12195(define-public java-bsh
12196 (package
12197 (name "java-bsh")
12198 (version "2.1.1")
12199 (source (origin
12200 (method git-fetch)
12201 (uri (git-reference
12202 (url "https://github.com/beanshell/beanshell")
12203 (commit version)))
12204 (file-name (git-file-name name version))
12205 (sha256
12206 (base32
12207 "1a6y46yz2ba4mnlfv4bpd5pmzhgxrzk3s10xp05jz377nbp2izwg"))
12208 (modules '((guix build utils)))
12209 (snippet
12210 '(begin
12211 ;; Delete bundled third-party jar archives.
12212 (for-each delete-file (find-files "." ".*.jar$"))
12213 (for-each (lambda (file) (chmod file #o644))
12214 (find-files "." "."))
12215 #t))))
12216 (build-system ant-build-system)
12217 (arguments
12218 `(#:build-target "jarall"
12219 #:test-target "junit-tests-all"
12220 #:make-flags (list "-DDATE" "(no date for reproducibility)")
12221 #:phases
12222 (modify-phases %standard-phases
12223 (add-before 'check 'fix-test
12224 (lambda _
12225 (substitute* "tests/junitTests/src/bsh/Issue_55_Test.java"
12226 ((" BshScriptEngineFactory") " bsh.engine.BshScriptEngineFactory"))))
12227 (replace 'install
12228 (install-from-pom "pom.xml")))))
12229 (inputs
12230 (list java-classpathx-servletapi java-commons-bsf))
12231 (native-inputs
12232 (list java-junit javacc-3))
12233 (home-page "http://beanshell.org/")
12234 (synopsis "Lightweight Scripting for Java")
12235 (description "BeanShell is a small, free, embeddable Java source
12236interpreter with object scripting language features, written in Java.
12237BeanShell dynamically executes standard Java syntax and extends it with common
12238scripting conveniences such as loose types, commands, and method closures like
12239those in Perl and JavaScript.")
12240 (license license:asl2.0)))
12241
12242(define-public java-fest-util
12243 (package
12244 (name "java-fest-util")
12245 (version "1.2.5")
12246 (source (origin
12247 (method git-fetch)
12248 (uri (git-reference
12249 (url "https://github.com/alexruiz/fest-util/")
12250 (commit (string-append "fest-util-" version))))
12251 (file-name (git-file-name name version))
12252 (sha256
12253 (base32
12254 "02kgal7v85snyyvcsxvn4qphid455f4smh2wri1il8d9asw0djbz"))))
12255 (build-system ant-build-system)
12256 (arguments
12257 `(#:jar-name "java-fest-util.jar"
12258 #:source-dir "src/main/java"))
12259 (native-inputs
12260 `(("junit" ,java-junit)
12261 ("hamcrest" ,java-hamcrest-core)))
12262 (home-page "https://github.com/alexruiz/fest-util")
12263 (synopsis "FEST common utilities")
12264 (description "Common utilities used in all FEST module.")
12265 (license license:asl2.0)))
12266
12267(define-public java-fest-test
12268 (package
12269 (name "java-fest-test")
12270 (version "2.1.0")
12271 (source (origin
12272 (method git-fetch)
12273 (uri (git-reference
12274 (url "https://github.com/alexruiz/fest-test/")
12275 (commit (string-append "fest-test-" version))))
12276 (file-name (git-file-name name version))
12277 (sha256
12278 (base32
12279 "0mg1d2jfh7kbx2c40dchbjr6d8pv59snsyb13mfxsr7xk5n69qbn"))))
12280 (build-system ant-build-system)
12281 (arguments
12282 `(#:jar-name "java-fest-test.jar"
12283 #:source-dir "src/main/java"
12284 #:tests? #f)); no tests
12285 (inputs
12286 `(("junit" ,java-junit)))
12287 (home-page "https://github.com/alexruiz/fest-test")
12288 (synopsis "Common FEST testing infrastructure")
12289 (description "Fest-test contains the common FEST testing infrastructure.")
12290 (license license:asl2.0)))
12291
12292(define-public java-fest-assert
12293 (package
12294 (name "java-fest-assert")
12295 (version "2.0M10")
12296 (source (origin
12297 (method git-fetch)
12298 (uri (git-reference
12299 (url "https://github.com/alexruiz/fest-assert-2.x/")
12300 (commit (string-append "fest-assert-core-" version))))
12301 (file-name (git-file-name name version))
12302 (sha256
12303 (base32
12304 "1cp8zzyag3s85fz2w68sda9zzaal1y5f9wl8g72wkm12an40w6by"))))
12305 (build-system ant-build-system)
12306 (arguments
12307 `(#:jar-name "java-fest-assert.jar"
12308 #:source-dir "src/main/java"
12309 #:test-exclude
12310 (list
12311 "**/Abstract*.java"
12312 "**/*BaseTest.java"
12313 ;; Unable to set MockitoNamingPolicy on cglib generator which creates FastClasses
12314 "**/MessageFormatter_format_Test.java"
12315 "**/internal/*/*_assert*_Test.java")))
12316 (inputs
12317 (list java-fest-util))
12318 (native-inputs
12319 (list java-junit
12320 java-fest-test
12321 java-hamcrest-core
12322 java-mockito-1
12323 java-cglib
12324 java-objenesis))
12325 (home-page "https://github.com/alexruiz/fest-assert-2.x")
12326 (synopsis "FEST fluent assertions")
12327 (description "FEST-Assert provides a fluent interface for assertions.")
12328 (license license:asl2.0)))
12329
12330(define-public java-testng
12331 (package
12332 (name "java-testng")
12333 (version "6.14.3")
12334 (source (origin
12335 (method git-fetch)
12336 (uri (git-reference
12337 (url "https://github.com/cbeust/testng")
12338 (commit version)))
12339 (file-name (string-append name "-" version "-checkout"))
12340 (sha256
12341 (base32
12342 "0y6vq30i5g276kw0v2bhbvci22ijg7ax49ap2611yqlhbs4d6dqv"))))
12343 (build-system ant-build-system)
12344 (arguments
12345 (list
12346 #:jdk icedtea-8; java.util.function
12347 #:jar-name "java-testng.jar"
12348 #:source-dir "src/main/java"
12349 #:phases
12350 '(modify-phases %standard-phases
12351 (add-after 'unpack 'delete-failing-tests
12352 (lambda _
12353 ;; FIXME: I don't know why these tests fail
12354 (substitute* "src/test/resources/testng.xml"
12355 ;; expected:<[0]> but was:<[3]>
12356 (("<class name=\"test.configuration.github1625.TestRunnerIssue1625\"/>") "")
12357 ;; expected [3] but found [2]
12358 (("<class name=\"test.serviceloader.ServiceLoaderTest\" />") "")
12359 ;; This is a parallel test and we've observed that it fails
12360 ;; sometimes.
12361 (("<class name=\"test.dataprovider.DataProviderTest\"/>") ""))))
12362 ;; We don't have groovy
12363 (add-after 'unpack 'delete-groovy-tests
12364 (lambda _
12365 (delete-file-recursively "src/test/java/test/dependent/issue1648/")
12366 (substitute* "src/test/resources/testng.xml"
12367 (("<class name=\"test.dependent.issue1648.TestRunner\"/>") ""))))
12368 (add-before 'build 'copy-resources
12369 (lambda _
12370 (copy-recursively "src/main/resources" "build/classes")))
12371 (add-before 'check 'copy-test-resources
12372 (lambda _
12373 (copy-recursively "src/test/resources" "build/test-classes")))
12374 (replace 'check
12375 (lambda _
12376 (invoke "ant" "compile-tests")
12377 ;; we don't have groovy
12378 (substitute* "src/test/resources/testng.xml"
12379 (("<class name=\"test.groovy.GroovyTest\" />") ""))
12380 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
12381 ":build/classes"
12382 ":build/test-classes")
12383 "-Dtest.resources.dir=src/test/resources"
12384 "org.testng.TestNG" "src/test/resources/testng.xml"))))))
12385 (propagated-inputs
12386 (list java-junit
12387 java-jsr305
12388 java-bsh
12389 java-jcommander
12390 java-guice
12391 java-snakeyaml))
12392 (native-inputs
12393 (list java-guava
12394 java-javax-inject
12395 java-hamcrest-all
12396 java-assertj
12397 java-mockito-1
12398 java-cglib
12399 java-aopalliance))
12400 (home-page "https://testng.org")
12401 (synopsis "Testing framework")
12402 (description "TestNG is a testing framework inspired from JUnit and NUnit
12403but introducing some new functionalities that make it more powerful and easier
12404to use.")
12405 (license license:asl2.0)))
12406
12407(define-public java-jnacl
12408 (let ((commit "094e819afdd63ea81a499b3bcb42a271006bebd9")
12409 (revision "2"))
12410 (package
12411 (name "java-jnacl")
12412 (version (string-append "0.1.0-" revision "." (string-take commit 7)))
12413 (source (origin
12414 (method git-fetch)
12415 (uri (git-reference
12416 (url "https://github.com/neilalexander/jnacl")
12417 (commit commit)))
12418 (file-name (git-file-name name version))
12419 (sha256
12420 (base32
12421 "1d6g6xhn83byv5943n7935wwjsk0ibk0qdvqgr699qqgqqmwisbb"))))
12422 (build-system ant-build-system)
12423 (arguments
12424 `(#:jar-name "jnacl.jar"
12425 #:source-dir "src/main/java"
12426 #:jdk ,icedtea-8
12427 #:phases
12428 (modify-phases %standard-phases
12429 (add-before 'build 'fix-tests
12430 (lambda _
12431 (substitute* '("src/test/java/com/neilalexander/jnacl/NaClTest.java"
12432 "src/test/java/com/neilalexander/jnacl/NaclSecretBoxTest.java")
12433 (("assertions.Assertions") "assertions.api.Assertions"))
12434 #t))
12435 (replace 'check
12436 (lambda _
12437 (invoke "ant" "compile-tests")
12438 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
12439 ":build/classes"
12440 ":build/test-classes")
12441 "org.testng.TestNG" "-testclass"
12442 "build/test-classes/com/neilalexander/jnacl/NaclSecretBoxTest.class")
12443 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
12444 ":build/classes"
12445 ":build/test-classes")
12446 "org.testng.TestNG" "-testclass"
12447 "build/test-classes/com/neilalexander/jnacl/NaClTest.class"))))))
12448 (native-inputs
12449 (list java-testng java-fest-util java-fest-assert))
12450 (home-page "https://github.com/neilalexander/jnacl")
12451 (synopsis "Java implementation of NaCl")
12452 (description "Pure Java implementation of the NaCl: Networking and
12453Cryptography library.")
12454 (license license:bsd-2))))
12455
12456(define-public java-mvel2
12457 (package
12458 (name "java-mvel2")
12459 (version "2.3.1")
12460 (source (origin
12461 (method url-fetch)
12462 (uri (string-append "https://github.com/mvel/mvel/archive/mvel2-"
12463 version ".Final.tar.gz"))
12464 (sha256
12465 (base32
12466 "01ph5s9gm16l2qz58lg21w6fna7xmmrj7f9bzqr1jim7h9557d3z"))))
12467 (build-system ant-build-system)
12468 (arguments
12469 `(#:jar-name "mvel2.jar"
12470 #:source-dir "src/main/java"
12471 #:test-exclude
12472 (list "**/Abstract*.java"
12473 ;; Base class with no tests
12474 "**/MVELThreadTest.java")
12475 #:phases
12476 (modify-phases %standard-phases
12477 (add-after 'install 'install-bin
12478 (lambda* (#:key outputs #:allow-other-keys)
12479 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
12480 (mkdir-p bin)
12481 (with-output-to-file (string-append bin "/mvel2")
12482 (lambda _
12483 (display
12484 (string-append
12485 "#!" (which "bash") "\n"
12486 "if [ \"$#\" -ne \"2\" ]; then\n"
12487 "echo 'Usage: mvel2 <script> <out.dir>'\n"
12488 "exit\n"
12489 "fi\n"
12490 "java -Dout.dir=$2 -cp " (getenv "CLASSPATH")
12491 ":" (assoc-ref outputs "out") "/share/java/mvel2.jar"
12492 " org.mvel2.sh.Main $1"))))
12493 (chmod (string-append bin "/mvel2") #o755))
12494 #t)))))
12495 (native-inputs
12496 `(("junit" ,java-junit)
12497 ("hamcrest" ,java-hamcrest-core)))
12498 (home-page "https://github.com/mvel/mvel")
12499 (synopsis "MVFLEX Expression Language")
12500 (description "MVEL has largely been inspired by Java syntax, but has some
12501fundamental differences aimed at making it more efficient as an expression
12502language, such as operators that directly support collection, array and string
12503matching, as well as regular expressions. MVEL is used to evaluate expressions
12504written using Java syntax.
12505
12506In addition to the expression language, MVEL serves as a templating language for
12507configuration and string construction.")
12508 (license license:asl2.0)))
12509
12510(define-public java-commons-jexl-2
12511 (package
12512 (name "java-commons-jexl")
12513 (version "2.1.1")
12514 (source (origin
12515 (method url-fetch)
12516 (uri (string-append "mirror://apache/commons/jexl/source/"
12517 "commons-jexl-" version "-src.tar.gz"))
12518 (sha256
12519 (base32
12520 "1ai7632bwwaxglb0nbpblpr2jw5g20afrsaq372ipkphi3ncy1jz"))))
12521 (build-system ant-build-system)
12522 (arguments
12523 `(#:jar-name "commons-jexl-2.jar"
12524 #:jdk ,icedtea-8
12525 #:source-dir "src/main/java"
12526 #:phases
12527 (modify-phases %standard-phases
12528 (add-before 'check 'disable-broken-tests
12529 (lambda* (#:key inputs #:allow-other-keys)
12530 (with-directory-excursion "src/test/java/org/apache/commons/jexl2/"
12531 (substitute* "ArithmeticTest.java"
12532 (("asserter.assertExpression\\(\"3 / 0\"") "//")
12533 (("asserter.assertExpression\\(\"imanull") "//"))
12534 ;; This test fails with "ambiguous method invocation"
12535 (delete-file "CacheTest.java")
12536 ;; This test doesn't have access to the temp directory
12537 (substitute* "ClassCreatorTest.java"
12538 (("java.io.tmpdir") "user.dir"))
12539 ;; This test fails in trying to detect whether it can run.
12540 (substitute* "ClassCreator.java"
12541 (("boolean canRun =.*") "boolean canRun = false;\n"))
12542 ;; ...and these tests depend on it.
12543 (delete-file "scripting/JexlScriptEngineOptionalTest.java")
12544 (delete-file "scripting/JexlScriptEngineTest.java"))
12545 #t))
12546 (add-before 'build 'run-javacc
12547 (lambda _
12548 (with-directory-excursion "src/main/java/org/apache/commons/jexl2/parser/"
12549 (invoke "java" "jjtree" "Parser.jjt")
12550 (invoke "java" "javacc" "Parser.jj"))
12551 #t)))))
12552 (inputs
12553 (list java-commons-logging-minimal))
12554 (native-inputs
12555 (list java-junit java-hamcrest-core javacc-4))
12556 (home-page "https://commons.apache.org/proper/commons-jexl/")
12557 (synopsis "Java Expression Language")
12558 (description "JEXL is a library intended to facilitate the implementation
12559of dynamic and scripting features in applications and frameworks written in
12560Java. JEXL implements an Expression Language based on some extensions to the
12561JSTL Expression Language supporting most of the constructs seen in
12562shell-script or ECMAScript. Its goal is to expose scripting features usable
12563by technical operatives or consultants working with enterprise platforms.")
12564 (license license:asl2.0)))
12565
12566(define-public java-lz4
12567 (package
12568 (name "java-lz4")
12569 (version "1.4.0")
12570 (source (origin
12571 (method git-fetch)
12572 (uri (git-reference
12573 (url "https://github.com/lz4/lz4-java")
12574 (commit version)))
12575 (file-name (git-file-name name version))
12576 (sha256
12577 (base32
12578 "0ydjakhv3cz34mfvv14qrh2ksdxifgjwwagjy7r46qr3f68hnf6y"))))
12579 (build-system ant-build-system)
12580 (arguments
12581 `(#:jar-name "lz4.jar"
12582 #:jdk ,icedtea-8
12583 #:source-dir "src/java:src/java-unsafe"
12584 #:tests? #f; FIXME: requires more dependencies
12585 #:phases
12586 (modify-phases %standard-phases
12587 (add-after 'unpack 'make-files-writable
12588 (lambda _
12589 (for-each make-file-writable (find-files "."))
12590 #t))
12591 (add-before 'configure 'generate-source
12592 (lambda _
12593 (with-directory-excursion "src/build/source_templates"
12594 (invoke "mvel2" "../gen_sources.mvel" "../../java"))
12595 #t)))))
12596 (native-inputs
12597 `(("mvel" ,java-mvel2)))
12598 (home-page "https://jpountz.github.io/lz4-java")
12599 (synopsis "Compression algorithm")
12600 (description "LZ4 - Java is a Java port of the popular lz4 compression
12601algorithms and xxHash hashing algorithm.")
12602 (license license:asl2.0)))
12603
12604(define-public java-bouncycastle
12605 (package
12606 (name "java-bouncycastle")
12607 (version "1.67")
12608 (source (origin
12609 (method git-fetch)
12610 (uri (git-reference
12611 (url "http://git.bouncycastle.org/repositories/bc-java")
12612 ;(url "https://github.com/bcgit/bc-java")
12613 (commit (string-append "r1rv" (substring version 2 4)))))
12614 (file-name (git-file-name name version))
12615 (sha256
12616 (base32
12617 "1449q7fyh03s1q0bqljcrhgacwcyqmg2bbvb3z084avgapwsainz"))
12618 (modules '((guix build utils)))
12619 (snippet
12620 '(begin
12621 (for-each delete-file
12622 (find-files "." "\\.jar$"))
12623 #t))))
12624 (build-system ant-build-system)
12625 (arguments
12626 `(#:jdk ,icedtea-8
12627 #:tests? #f
12628 #:phases
12629 (modify-phases %standard-phases
12630 (replace 'build
12631 (lambda _
12632 (invoke "ant" "-f" "ant/jdk15+.xml" "build-provider")
12633 (invoke "ant" "-f" "ant/jdk15+.xml" "build")))
12634 ;; FIXME: the tests freeze.
12635 ;; (replace 'check
12636 ;; (lambda _
12637 ;; (invoke "ant" "-f" "ant/jdk15+.xml" "test")))
12638 (replace 'install
12639 (install-jars "build/artifacts/jdk1.5/jars")))))
12640 (inputs
12641 (list java-javax-mail))
12642 (native-inputs
12643 `(("unzip" ,unzip)
12644 ("junit" ,java-junit)
12645 ("java-native-access" ,java-native-access)
12646 ("java-native-access-platform" ,java-native-access-platform)))
12647 (home-page "https://www.bouncycastle.org")
12648 (synopsis "Cryptographic library")
12649 (description "Bouncy Castle is a cryptographic library for the Java
12650programming language.")
12651 (license license:expat)))
12652
12653(define-public java-jakarta-activation-1.2
12654 (package
12655 (name "java-jakarta-activation")
12656 (version "1.2.2")
12657 (source (origin
12658 (method git-fetch)
12659 (uri (git-reference
12660 (url "https://github.com/jakartaee/jaf-api")
12661 (commit version)))
12662 (file-name (git-file-name name version))
12663 (sha256
12664 (base32
12665 "13kkr0kj9wp45vpfackcbyycilzs5r3sj33px5pny1k4hq09cyar"))))
12666 (build-system ant-build-system)
12667 (arguments
12668 `(#:tests? #f
12669 #:jar-name "jakarta.activation.jar"
12670 #:jdk ,openjdk9
12671 #:source-dir "activation/src/main/java"
12672 #:phases
12673 (modify-phases %standard-phases
12674 ;; Install under javax.activation:activation coordinates
12675 ;; so consumers like javax.mail can find it. The source
12676 ;; pom uses com.sun.activation:jakarta.activation but that's
12677 ;; the new coordinate; most existing poms reference the
12678 ;; old javax.activation:activation.
12679 (add-before 'install 'create-pom
12680 (generate-pom.xml "pom.xml" "javax.activation"
12681 "activation" ,version))
12682 (replace 'install
12683 (install-from-pom "pom.xml")))))
12684 (home-page "https://jakarta.ee/specifications/activation/")
12685 (synopsis "Jakarta Activation API (javax.activation)")
12686 (description "Jakarta Activation provides the @code{javax.activation}
12687package, which was removed from the JDK in Java 11. This is the 1.2.x
12688transitional release that still uses the @code{javax.activation} namespace.")
12689 (license license:edl1.0)))
12690
12691(define-public java-bouncycastle-1.77
12692 (package
12693 (inherit java-bouncycastle)
12694 (version "1.77")
12695 (source (origin
12696 (method git-fetch)
12697 (uri (git-reference
12698 (url "https://github.com/bcgit/bc-java")
12699 (commit (string-append "r1rv" (substring version 2 4)))))
12700 (file-name (git-file-name "java-bouncycastle" version))
12701 (sha256
12702 (base32
12703 "1adxic0pgb7gv2yflw72np7zilj6rrhgjcj3xvnmidwp2pc887k1"))
12704 (modules '((guix build utils)))
12705 (snippet
12706 '(begin
12707 (for-each delete-file
12708 (find-files "." "\\.jar$"))
12709 #t))))
12710 (arguments
12711 `(#:jdk ,openjdk17
12712 #:tests? #f
12713 #:phases
12714 (modify-phases %standard-phases
12715 (replace 'build
12716 (lambda _
12717 (let ((suffix (string-append
12718 "-Drelease.suffix="
12719 ,(string-join (string-split version #\.) ""))))
12720 (mkdir-p "ant/docs")
12721 ;; Build individual targets. Can't use the 'build'
12722 ;; target because it includes 'build-test' which needs
12723 ;; the UnboundID LDAP SDK.
12724 (invoke "ant" "-f" "ant/jdk18+.xml" suffix
12725 "build-provider")
12726 ;; The remaining targets are only in bc+-build.xml.
12727 ;; Call it via ant's -f but pass properties that
12728 ;; jdk18+.xml normally sets.
12729 (let ((props (list suffix
12730 "-Dtarget.prefix=jdk18on"
12731 "-Djdk.name=jdk1.8"
12732 "-Dbc.javac.source=1.8"
12733 "-Dbc.javac.target=1.8"
12734 "-Dbuild.dir=build"
12735 "-Djavadoc.args=-breakiterator"
12736 (string-append "-Dsrc.dir="
12737 (getcwd) "/build/jdk1.8")
12738 (string-append "-Dartifacts.dir="
12739 (getcwd) "/build/artifacts/jdk1.8"))))
12740 (for-each
12741 (lambda (target)
12742 (apply invoke "ant" "-f" "ant/bc+-build.xml"
12743 (append props (list target))))
12744 '("build-util" "build-pkix" "build-pg" "build-mail"))))))
12745 (add-after 'build 'add-osgi-manifests
12746 (lambda _
12747 ;; The Maven Central jars have OSGi manifest attributes
12748 ;; from maven-bundle-plugin. Add them since we build
12749 ;; with ant.
12750 (for-each
12751 (lambda (name)
12752 (let ((jar (car (find-files "build/artifacts"
12753 (string-append name "-jdk18on.*\\.jar$")))))
12754 (call-with-output-file "osgi-manifest.mf"
12755 (lambda (port)
12756 (display (string-append
12757 "Bundle-ManifestVersion: 2\n"
12758 "Bundle-SymbolicName: " name "\n"
12759 "Bundle-Version: " ,version "\n")
12760 port)))
12761 (invoke "jar" "ufm" jar "osgi-manifest.mf")))
12762 '("bcprov" "bcutil" "bcpkix" "bcpg"))))
12763 (add-after 'add-osgi-manifests 'rename-jars
12764 (lambda _
12765 ;; Ant produces e.g. bcprov-jdk18on-177.jar but
12766 ;; install-from-pom expects bcprov-jdk18on-1.77.jar.
12767 (for-each
12768 (lambda (name)
12769 (let ((src (car (find-files "build/artifacts"
12770 (string-append name "-jdk18on-.*\\.jar$"))))
12771 (dest (string-append "build/artifacts/jdk1.8/jars/"
12772 name "-jdk18on-" ,version ".jar")))
12773 (unless (string=? src dest)
12774 (rename-file src dest))))
12775 '("bcprov" "bcutil" "bcpkix" "bcpg"))))
12776 (replace 'install
12777 (lambda* (#:key inputs outputs jar-name #:allow-other-keys)
12778 (for-each
12779 (lambda (name)
12780 (let ((pom-file (string-append name "-pom.xml"))
12781 (artifact (string-append name "-jdk18on")))
12782 ((generate-pom.xml pom-file "org.bouncycastle"
12783 artifact ,version))
12784 ((install-from-pom pom-file)
12785 #:inputs inputs #:outputs outputs
12786 #:jar-name (string-append artifact "-" ,version "\\.jar$"))))
12787 '("bcprov" "bcutil" "bcpkix" "bcpg")))))))
12788 (inputs
12789 (list java-jakarta-activation-1.2
12790 java-javax-mail))
12791 (description "Bouncy Castle is a cryptographic library for the Java
12792programming language. This is version 1.77 which has breaking API changes
12793compared to 1.67 (removed classes in ASN1, CMC, and other packages).")))
12794
12795(define-public java-eclipse-jdt-annotation-2
12796 (package
12797 (name "java-eclipse-jdt-annotation")
12798 (version "2.2.600")
12799 (source (origin
12800 (method url-fetch)
12801 (uri (string-append "https://repo1.maven.org/maven2/"
12802 "org/eclipse/jdt/org.eclipse.jdt.annotation/"
12803 version "/org.eclipse.jdt.annotation-"
12804 version "-sources.jar"))
12805 (sha256
12806 (base32
12807 "1jlq14ivhj32i7glfdmk068ya1spm4wfa9h8h2p326y0fkkzwyp9"))))
12808 (build-system ant-build-system)
12809 (arguments
12810 `(#:tests? #f
12811 #:jar-name "org.eclipse.jdt.annotation.jar"
12812 #:source-dir "."
12813 #:phases
12814 (modify-phases %standard-phases
12815 (add-before 'install 'create-pom
12816 (generate-pom.xml "pom.xml" "org.eclipse.jdt"
12817 "org.eclipse.jdt.annotation" ,version))
12818 (replace 'install (install-from-pom "pom.xml")))))
12819 (native-inputs (list unzip))
12820 (home-page "https://www.eclipse.org/jdt/")
12821 (synopsis "Eclipse JDT null analysis annotations")
12822 (description "This package provides the @code{@@NonNull}, @code{@@Nullable},
12823and @code{@@NonNullByDefault} annotations used by Eclipse JDT for null
12824analysis.")
12825 (license license:epl2.0)))
12826
12827(define-public java-kohlschutter-compiler-annotations-1
12828 (package
12829 (name "java-kohlschutter-compiler-annotations")
12830 (version "1.4.2")
12831 (source (origin
12832 (method url-fetch)
12833 (uri (string-append "https://repo1.maven.org/maven2/"
12834 "com/kohlschutter/compiler-annotations/"
12835 version "/compiler-annotations-"
12836 version "-sources.jar"))
12837 (sha256
12838 (base32
12839 "0fzmhr9binv1ah410955m95w6lwwidy9sw06yy5cjcrcjx7v0455"))))
12840 (build-system ant-build-system)
12841 (arguments
12842 `(#:tests? #f
12843 #:jar-name "compiler-annotations.jar"
12844 #:jdk ,openjdk9
12845 #:source-dir "."
12846 #:phases
12847 (modify-phases %standard-phases
12848 (add-before 'install 'create-pom
12849 (generate-pom.xml "pom.xml" "com.kohlschutter"
12850 "compiler-annotations" ,version))
12851 (replace 'install (install-from-pom "pom.xml")))))
12852 (inputs (list java-eclipse-jdt-annotation-2))
12853 (native-inputs (list unzip))
12854 (home-page "https://github.com/kohlschutter/compiler-annotations")
12855 (synopsis "Compile-time annotations for Java")
12856 (description "This package provides compile-time annotations such as
12857@code{@@SuppressFBWarnings} and @code{@@ExcludeFromCodeCoverageGeneratedReport}.")
12858 (license license:asl2.0)))
12859
12860(define junixsocket-source
12861 (origin
12862 (method git-fetch)
12863 (uri (git-reference
12864 (url "https://github.com/kohlschutter/junixsocket")
12865 (commit "junixsocket-parent-2.5.1")))
12866 (file-name (git-file-name "java-junixsocket" "2.5.1"))
12867 (sha256
12868 (base32
12869 "1zc84qbl2zsi9ch6b12crbiqlrkbrlw1z09kqlj04zrmck4k4pzn"))))
12870
12871(define-public java-junixsocket-common-2
12872 (package
12873 (name "java-junixsocket-common")
12874 (version "2.5.1")
12875 (source junixsocket-source)
12876 (build-system ant-build-system)
12877 (arguments
12878 `(#:jar-name "junixsocket-common.jar"
12879 #:source-dir "junixsocket-common/src/main/java"
12880 #:jdk ,openjdk9
12881 #:tests? #f
12882 #:phases
12883 (modify-phases %standard-phases
12884 (add-after 'unpack 'delete-module-info
12885 (lambda _
12886 ;; module-info.java requires modules not available in
12887 ;; our build (com.kohlschutter.annotations.compiletime,
12888 ;; org.eclipse.jdt.annotation). The classes compile
12889 ;; and work without JPMS metadata.
12890 (delete-file
12891 "junixsocket-common/src/main/java/module-info.java")))
12892 (replace 'install
12893 (install-from-pom "junixsocket-common/pom.xml")))))
12894 (inputs (list java-eclipse-jdt-annotation-2
12895 java-kohlschutter-compiler-annotations-1))
12896 (home-page "https://github.com/kohlschutter/junixsocket")
12897 (synopsis "Java library for Unix domain sockets")
12898 (description "junixsocket is a Java library for Unix domain sockets
12899(AF_UNIX) and other address/protocol families, providing a Java Socket API
12900compatible interface.")
12901 (license license:asl2.0)))
12902
12903(define-public java-junixsocket-native-common-2.5.1
12904 (package
12905 (name "java-junixsocket-native-common")
12906 (version "2.5.1")
12907 (source junixsocket-source)
12908 (build-system ant-build-system)
12909 (arguments
12910 (list
12911 #:tests? #f
12912 #:jdk openjdk9
12913 #:jar-name "junixsocket-native-common.jar"
12914 #:source-dir "junixsocket-native-common/src/main/java"
12915 #:phases
12916 #~(modify-phases %standard-phases
12917 (add-before 'build 'set-module-path
12918 (lambda* (#:key inputs #:allow-other-keys)
12919 ;; javac needs compiler-annotations on the module path
12920 ;; (not classpath) for JPMS 'requires static' resolution.
12921 (let ((mod-dir (assoc-ref inputs
12922 "java-kohlschutter-compiler-annotations")))
12923 (setenv "JDK_JAVAC_OPTIONS"
12924 (string-append "--module-path="
12925 (car (find-files mod-dir "\\.jar$")))))))
12926 (add-before 'build 'build-native
12927 (lambda* (#:key inputs #:allow-other-keys)
12928 (let ((jdk (assoc-ref inputs "jdk"))
12929 (c-dir "junixsocket-native/src/main/c"))
12930 ;; Fix GCC incompatibility: _Pragma inside expressions
12931 ;; is a Clang extension, not supported by GCC.
12932 (substitute* (string-append c-dir "/ckmacros.h")
12933 (("# define CK_IGNORE_CAST_BEGIN \\\\")
12934 "# define CK_IGNORE_CAST_BEGIN")
12935 (("# define CK_IGNORE_CAST_END \\\\")
12936 "# define CK_IGNORE_CAST_END")
12937 (("_Pragma\\(\"GCC diagnostic.*cast.*\"\\)") "")
12938 (("_Pragma\\(\"GCC diagnostic push\"\\)") "")
12939 (("_Pragma\\(\"GCC diagnostic pop\"\\)") ""))
12940 (let ((so-file (string-append
12941 "junixsocket-native-common/src/main/"
12942 "resources/lib/amd64-Linux-clang/jni/"
12943 "libjunixsocket-native-" #$version ".so")))
12944 (mkdir-p (dirname so-file))
12945 (apply invoke "gcc" "-shared" "-fPIC" "-O2"
12946 "-Wno-int-to-pointer-cast"
12947 "-Wno-pointer-to-int-cast"
12948 "-Wno-bad-function-cast"
12949 "-Wno-cast-function-type"
12950 "-Wno-stringop-overflow"
12951 (string-append "-I" c-dir)
12952 (string-append "-I" c-dir "/jni")
12953 (string-append "-I" jdk "/include")
12954 (string-append "-I" jdk "/include/linux")
12955 "-o" so-file
12956 (find-files c-dir "\\.c$"))))))
12957 (add-after 'build 'add-native-to-jar
12958 (lambda _
12959 (invoke "jar" "uf"
12960 "build/jar/junixsocket-native-common.jar"
12961 "-C" "junixsocket-native-common/src/main/resources"
12962 "lib")))
12963 ;; The source pom.xml lists pre-built native library
12964 ;; NARs for every platform. We build the native code
12965 ;; from source, so none of those dependencies apply.
12966 (add-before 'install 'create-pom
12967 (generate-pom.xml "pom.xml"
12968 "com.kohlschutter.junixsocket"
12969 "junixsocket-native-common" #$version))
12970 (replace 'install
12971 (install-from-pom "pom.xml")))))
12972 (native-inputs (list java-kohlschutter-compiler-annotations-1))
12973 (home-page "https://github.com/kohlschutter/junixsocket")
12974 (synopsis "Native JNI library for junixsocket")
12975 (description "This package provides the native JNI library for
12976junixsocket, built from source for Linux.")
12977 (license license:asl2.0)))
12978
12979(define-public java-lmax-disruptor
12980 (package
12981 (name "java-lmax-disruptor")
12982 (version "3.4.4")
12983 (source (origin
12984 (method git-fetch)
12985 (uri (git-reference
12986 (url "https://github.com/LMAX-Exchange/disruptor")
12987 (commit version)))
12988 (file-name (git-file-name name version))
12989 (sha256
12990 (base32
12991 "02c5kp3n8a73dq9ay7ar53s1k3x61z9yzc5ikqb03m6snr1wpfqn"))))
12992 (build-system ant-build-system)
12993 (arguments
12994 `(#:jar-name "java-lmax-disruptor.jar"
12995 #:jdk ,icedtea-8
12996 #:tests? #f)); tests hang
12997 (inputs
12998 `(("junit" ,java-junit)
12999 ("java-hdrhistogram" ,java-hdrhistogram)
13000 ("java-jmock" ,java-jmock)
13001 ("java-jmock-legacy" ,java-jmock-legacy)
13002 ("java-jmock-junit4" ,java-jmock-junit4)
13003 ("java-hamcrest-all" ,java-hamcrest-all)))
13004 (native-inputs
13005 `(("cglib" ,java-cglib)
13006 ("objenesis" ,java-objenesis)))
13007 (home-page "https://www.lmax.com/disruptor")
13008 (synopsis "High performance inter-thread communication")
13009 (description "LMAX Disruptor is a software pattern and software component
13010for high performance inter-thread communication that avoids the need for
13011message queues or resource locking.")
13012 (license license:asl2.0)))
13013
13014(define-public java-conversant-disruptor
13015 (package
13016 (name "java-conversant-disruptor")
13017 (version "1.2.19")
13018 (source (origin
13019 (method git-fetch)
13020 (uri (git-reference
13021 (url "https://github.com/conversant/disruptor")
13022 (commit version)))
13023 (file-name (git-file-name name version))
13024 (sha256
13025 (base32
13026 "0gx1dm7sfg7pa05cs4qby10gfcplai5b5lf1f7ik1a76dh3vhl0g"))))
13027 (build-system ant-build-system)
13028 (arguments
13029 `(#:jar-name "java-conversant-disruptor.jar"
13030 #:source-dir "src/main/java"
13031 #:phases
13032 (modify-phases %standard-phases
13033 (add-before 'build 'copy-resources
13034 (lambda _
13035 (copy-recursively "src/main/resources" "build/classes")))
13036 (add-before 'build 'remove-module
13037 (lambda _
13038 (delete-file "src/main/java/module-info.java"))))))
13039 (native-inputs
13040 (list java-junit))
13041 (home-page "https://github.com/conversant/disruptor")
13042 (synopsis "High performance intra-thread communication")
13043 (description "Conversant Disruptor is the highest performing intra-thread
13044transfer mechanism available in Java. Conversant Disruptor is an implementation
13045of this type of ring buffer that has almost no overhead and that exploits a
13046particularly simple design.")
13047 (license license:asl2.0)))
13048
13049(define-public java-jctools-core-1
13050 (package
13051 (name "java-jctools-core")
13052 (version "1.2.1")
13053 (source (origin
13054 (method git-fetch)
13055 (uri (git-reference
13056 (url "https://github.com/JCTools/JCTools")
13057 (commit (string-append "v" version))))
13058 (file-name (git-file-name name version))
13059 (sha256
13060 (base32
13061 "105my29nwd4djvdllmq8s3jdzbyplbkxzwmddxiiilb4yqr1pghb"))))
13062 (build-system ant-build-system)
13063 (arguments
13064 `(#:jar-name "java-jctools-core.jar"
13065 #:source-dir "jctools-core/src/main/java"
13066 #:test-dir "jctools-core/src/test"
13067 ;; The tests timeout on some architectures.
13068 #:tests? ,(not (or (target-aarch64?)
13069 (%current-target-system)))))
13070 (native-inputs
13071 (list java-junit java-hamcrest-all))
13072 (home-page "https://github.com/JCTools/JCTools")
13073 (synopsis "Concurrency tools for Java")
13074 (description "This library implements concurrent data structures that are
13075not natively available in Java.")
13076 (license license:asl2.0)))
13077
13078(define-public java-commons-bcel
13079 (package
13080 (name "java-commons-bcel")
13081 (version "6.1")
13082 (source (origin
13083 (method url-fetch)
13084 (uri (string-append "mirror://apache/commons/bcel/source/bcel-"
13085 version "-src.tar.gz"))
13086 (sha256
13087 (base32
13088 "0j3x1rxd673k07psclk8k13rqh0x0mf2yy5qiwkiw4z3afa568jy"))))
13089 (build-system ant-build-system)
13090 (arguments
13091 `(#:jar-name "bcel.jar"
13092 #:jdk ,icedtea-8
13093 #:source-dir "src/main/java"
13094 #:test-dir "src/test/java"
13095 ;; FIXME: Tests require the unpackaged jna.
13096 #:tests? #f))
13097 (home-page "https://commons.apache.org/proper/commons-bcel/")
13098 (synopsis "Byte code engineering library")
13099 (description "The Byte Code Engineering Library (Apache Commons BCEL) is
13100intended to give users a convenient way to analyze, create, and
13101manipulate (binary) Java class files. Classes are represented by objects
13102which contain all the symbolic information of the given class: methods, fields
13103and byte code instructions, in particular.
13104
13105Such objects can be read from an existing file, be transformed by a
13106program (e.g. a class loader at run-time) and written to a file again. An
13107even more interesting application is the creation of classes from scratch at
13108run-time. The @dfn{Byte Code Engineering Library} (BCEL) may be also useful
13109if you want to learn about the @dfn{Java Virtual Machine} (JVM) and the format
13110of Java @code{.class} files.")
13111 (properties '((upstream-name . "bcel")))
13112 (license license:asl2.0)))
13113
13114(define-public java-xerial-core
13115 (package
13116 (name "java-xerial-core")
13117 (version "2.1")
13118 (source (origin
13119 (method url-fetch)
13120 (uri (string-append "https://github.com/xerial/xerial-java/archive/"
13121 version ".tar.gz"))
13122 (file-name (string-append name "-" version ".tar.gz"))
13123 (sha256
13124 (base32
13125 "0d3g863i41bgalpa4xr3vm1h140l091n8iwgq5qvby5yivns9y8d"))))
13126 (build-system ant-build-system)
13127 (arguments
13128 `(#:jar-name "xerial-core.jar"
13129 #:source-dir "xerial-core/src/main/java"
13130 #:test-dir "xerial-core/src/test"
13131 #:phases
13132 (modify-phases %standard-phases
13133 (add-before 'build 'copy-resources
13134 (lambda _
13135 (copy-recursively "xerial-core/src/main/resources"
13136 "build/classes")
13137 #t)))))
13138 (native-inputs
13139 `(("junit" ,java-junit)
13140 ("hamcrest" ,java-hamcrest-core)))
13141 (home-page "https://github.com/xerial/xerial-java")
13142 (synopsis "Data management libraries for Java")
13143 (description "Xerial is a set of data management libraries for the Java
13144programming language. The ultimate goal of the Xerial project is to manage
13145everything as database, including class objects, text format data, data
13146streams, etc.")
13147 (license license:asl2.0)))
13148
13149(define-public java-byte-buddy-dep
13150 (package
13151 (name "java-byte-buddy-dep")
13152 (version "1.14.0")
13153 (source (origin
13154 (method git-fetch)
13155 (uri (git-reference
13156 (url "https://github.com/raphw/byte-buddy")
13157 (commit (string-append "byte-buddy-" version))))
13158 (file-name (git-file-name name version))
13159 (sha256
13160 (base32
13161 "03jmsnkjb9d3z9brqs8fc512hhs5b5iab3a5wbax9zi03dskgvh2"))))
13162 (build-system ant-build-system)
13163 (arguments
13164 `(#:jar-name "byte-buddy-dep.jar"
13165 #:source-dir "byte-buddy-dep/src/main/java"
13166 #:test-dir "byte-buddy-dep/src/test"
13167 #:tests? #f; would build java files that are incompatible with current jdk
13168 #:phases
13169 (modify-phases %standard-phases
13170 (add-before 'build 'remove-annotations
13171 (lambda _
13172 (with-directory-excursion "byte-buddy-dep/src/main/java/net/bytebuddy"
13173 (substitute* (find-files "." ".*.java")
13174 (("@EqualsAndHashCode.*") "")
13175 (("import lombok.EqualsAndHashCode;") "")
13176 (("@SuppressFBWarnings.*") "")
13177 (("import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;") ""))
13178 (substitute* '("description/type/TypeDescription.java"
13179 "dynamic/loading/ClassInjector.java")
13180 (("^ *value = .*") "")
13181 (("^ *justification = .*") ""))))))))
13182 (inputs
13183 (list java-asm-9 java-asm-commons-9 java-jsr305 java-native-access))
13184 (home-page "http://bytebuddy.net/")
13185 (synopsis "Runtime code generation for the Java virtual machine")
13186 (description "Byte Buddy is a code generation and manipulation library for
13187creating and modifying Java classes during the runtime of a Java application
13188and without the help of a compiler.")
13189 (license license:asl2.0)))
13190
13191(define-public java-powermock-reflect
13192 (package
13193 (name "java-powermock-reflect")
13194 (version "2.0.9")
13195 (source (origin
13196 (method git-fetch)
13197 (uri (git-reference
13198 (url "https://github.com/powermock/powermock")
13199 (commit (string-append "powermock-" version))))
13200 (file-name (git-file-name name version))
13201 (sha256
13202 (base32
13203 "03y8szi9iwxnv431z2mn2ivc1ak30vcvfvkyrwmfq7wq93bj2c5v"))
13204 (patches
13205 (search-patches "java-powermock-fix-java-files.patch"))))
13206 (build-system ant-build-system)
13207 (arguments
13208 `(#:jar-name "java-powermock-reflect.jar"
13209 #:source-dir "powermock-reflect/src/main/java"
13210 #:test-dir "powermock-reflect/src/test"))
13211 (inputs
13212 (list java-asm-9 java-objenesis))
13213 (native-inputs
13214 (list java-assertj java-cglib java-hamcrest-core java-junit))
13215 (home-page "https://github.com/powermock/powermock")
13216 (synopsis "Mock library extension framework")
13217 (description "PowerMock is a framework that extends other mock libraries
13218such as EasyMock with more powerful capabilities. PowerMock uses a custom
13219classloader and bytecode manipulation to enable mocking of static methods,
13220constructors, final classes and methods, private methods, removal of static
13221initializers and more. By using a custom classloader no changes need to be
13222done to the IDE or continuous integration servers which simplifies adoption.")
13223 (license license:asl2.0)))
13224
13225(define-public java-powermock-core
13226 (package
13227 (inherit java-powermock-reflect)
13228 (name "java-powermock-core")
13229 (arguments
13230 `(#:jar-name "java-powermock-core.jar"
13231 #:source-dir "powermock-core/src/main/java"
13232 #:test-dir "powermock-core/src/test"
13233 #:tests? #f; requires powermock-api
13234 #:jdk ,icedtea-8
13235 #:phases
13236 (modify-phases %standard-phases
13237 (add-before 'build 'copy-resources
13238 (lambda _
13239 (copy-recursively "powermock-core/src/main/resources"
13240 "build/classes")
13241 #t)))))
13242 (inputs
13243 (list java-asm-9
13244 java-byte-buddy-dep
13245 java-jboss-javassist
13246 java-powermock-reflect))
13247 (native-inputs
13248 (list java-assertj java-mockito-1 java-junit))))
13249
13250(define-public java-powermock-api-support
13251 (package
13252 (inherit java-powermock-reflect)
13253 (name "java-powermock-api-support")
13254 (build-system ant-build-system)
13255 (arguments
13256 `(#:jar-name "java-powermock-api-support.jar"
13257 #:jdk ,icedtea-8
13258 #:source-dir "powermock-api/powermock-api-support/src/main/java"
13259 #:tests? #f)); no tests
13260 (inputs
13261 (list java-powermock-core java-powermock-reflect))))
13262
13263(define-public java-powermock-modules-junit4-common
13264 (package
13265 (inherit java-powermock-reflect)
13266 (name "java-powermock-modules-junit4-common")
13267 (build-system ant-build-system)
13268 (arguments
13269 `(#:jar-name "java-powermock-modules-junit4-common.jar"
13270 #:jdk ,icedtea-8
13271 #:source-dir "powermock-modules/powermock-module-junit4-common/src/main/java"
13272 #:test-dir "powermock-modules/powermock-module-junit4-common/src/test"))
13273 (inputs
13274 (list java-cglib
13275 java-easymock
13276 java-hamcrest-core
13277 java-powermock-core
13278 java-powermock-reflect))))
13279
13280(define-public java-powermock-modules-junit4
13281 (package
13282 (inherit java-powermock-reflect)
13283 (name "java-powermock-modules-junit4")
13284 (build-system ant-build-system)
13285 (arguments
13286 `(#:jar-name "java-powermock-modules-junit4.jar"
13287 #:tests? #f; require easymock 4, which introduces a loop with testng
13288 #:source-dir "powermock-modules/powermock-module-junit4/src/main/java"
13289 #:test-dir "powermock-modules/powermock-module-junit4/src/test"
13290 #:phases
13291 (modify-phases %standard-phases
13292 (add-before 'build 'fix-junit-detection
13293 (lambda _
13294 ;; Our junit version is 4.12-SNAPSHOT
13295 (substitute* (find-files "powermock-modules/powermock-module-junit4"
13296 "PowerMockJUnit4MethodValidator.java")
13297 (("4.12") "4.12-SNAPSHOT"))
13298 #t)))))
13299 (inputs
13300 (list java-cglib
13301 java-powermock-core
13302 java-powermock-reflect
13303 java-powermock-modules-junit4-common))
13304 (native-inputs
13305 (list java-easymock
13306 java-hamcrest-core
13307 java-junit
13308 java-objenesis))))
13309
13310(define-public java-powermock-api-easymock
13311 (package
13312 (inherit java-powermock-reflect)
13313 (name "java-powermock-api-easymock")
13314 (build-system ant-build-system)
13315 (arguments
13316 `(#:jar-name "java-powermock-api-easymock.jar"
13317 #:jdk ,icedtea-8
13318 #:source-dir "powermock-api/powermock-api-easymock/src/main/java"
13319 #:tests? #f; no tests
13320 #:phases
13321 (modify-phases %standard-phases
13322 (add-before 'build 'fix-file
13323 (lambda _
13324 ;; FIXME: This looks wrong, but it fixes a build error.
13325 (with-directory-excursion "powermock-api/powermock-api-easymock"
13326 (substitute* "src/main/java/org/powermock/api/easymock/PowerMock.java"
13327 (("classLoader instanceof MockClassLoader") "false")
13328 (("\\(\\(MockClassLoader\\) classLoader\\).*;") ";")))
13329 #t)))))
13330 (inputs
13331 (list java-cglib
13332 java-easymock
13333 java-powermock-api-support
13334 java-powermock-core
13335 java-powermock-reflect))))
13336
13337(define-public java-jboss-jms-api-spec
13338 (package
13339 (name "java-jboss-jms-api-spec")
13340 (version "2.0")
13341 (source (origin
13342 (method url-fetch)
13343 (uri (string-append "https://github.com/jboss/jboss-jms-api_spec/"
13344 "archive/jboss-jms-api_" version
13345 "_spec-1.0.1.Final.tar.gz"))
13346 (sha256
13347 (base32
13348 "07bqblw9kq2i8q92bz70fvavq5xjfkaixl8xa0m0cypjgy82rb7m"))))
13349 (build-system ant-build-system)
13350 (arguments
13351 `(#:jar-name "java-jboss-jms-api_spec.jar"
13352 #:jdk ,icedtea-8
13353 #:source-dir "."
13354 #:tests? #f)); no tests
13355 (home-page "https://github.com/jboss/jboss-jms-api_spec")
13356 (synopsis "Java Message Service API specification")
13357 (description "Java Message Service (JMS) API is used to send messages
13358messages between two or more clients. It is a messaging standard that allows
13359application components to create, send, receive, and read messages.")
13360 ; either gpl2 only with GPL Classpath Exception, or cddl.
13361 (license (list license:gpl2 license:cddl1.0))))
13362
13363(define-public java-mail
13364 (package
13365 (name "java-mail")
13366 (version "1.6.0")
13367 (source (origin
13368 (method url-fetch)
13369 (uri (string-append "https://github.com/javaee/javamail/archive/"
13370 "JAVAMAIL-1_6_0.tar.gz"))
13371 (sha256
13372 (base32
13373 "1b4rg7fpj50ld90a71iz2m4gm3f5cnw18p3q3rbrrryjip46kx92"))))
13374 (build-system ant-build-system)
13375 (arguments
13376 `(#:jar-name "java-mail.jar"
13377 #:jdk ,icedtea-8
13378 #:source-dir "mail/src/main/java"
13379 #:test-dir "mail/src/test"
13380 #:test-exclude
13381 (list "**/CollectorFormatterTest.java"
13382 "**/CompactFormatterTest.java"
13383 "**/DurationFilterTest.java"
13384 "**/MailHandlerTest.java"
13385 "**/GetLocalAddressTest.java"
13386 ;; SSLHandshakeException: No appropriate protocol
13387 "**/WriteTimeoutSocketTest.java"
13388 ;; FIXME: both end with:
13389 ;; java.lang.ClassNotFoundException:
13390 ;; javax.mail.internet.MimeMultipartParseTest
13391 "**/MimeMultipartParseTest.java"
13392 "**/SearchTermSerializationTest.java")
13393 #:phases
13394 (modify-phases %standard-phases
13395 (add-before 'configure 'move-version.java
13396 (lambda _
13397 (copy-file "mail/src/main/resources/javax/mail/Version.java"
13398 "mail/src/main/java/javax/mail/Version.java")))
13399 (add-before 'build 'copy-resources
13400 (lambda _
13401 (copy-recursively "mail/src/main/resources/META-INF"
13402 "build/classes/META-INF"))))))
13403 (native-inputs
13404 (list java-junit java-hamcrest-core))
13405 (home-page "https://javaee.github.io/javamail/")
13406 (synopsis "Mail-related functionality in Java")
13407 (description "The JavaMail API provides a platform-independent and
13408protocol-independent framework to build mail and messaging applications.")
13409 ;; General Public License Version 2 only ("GPL") or the Common Development
13410 ;; and Distribution License("CDDL")
13411 (license (list license:cddl1.1
13412 license:gpl2)))); with classpath exception
13413
13414(define-public java-mapdb
13415 (package
13416 (name "java-mapdb")
13417 (version "1.0.9")
13418 (source (origin
13419 (method git-fetch)
13420 (uri (git-reference
13421 (url "https://github.com/jankotek/mapdb")
13422 (commit (string-append "mapdb-" version))))
13423 (file-name (git-file-name name version))
13424 (sha256
13425 (base32
13426 "1slb4h282jqvk16896lcvgm65pj3v6crcp2wvjdvad7nx7d2f1kv"))))
13427 (build-system ant-build-system)
13428 (arguments
13429 (list #:jar-name "mapdb.jar"
13430 #:source-dir "src/main/java"
13431 #:test-dir "src/test"
13432 #:test-exclude (list "**/ClosedThrowsExceptionTest.java"
13433 "**/ConcurrentMapInterfaceTest.java"
13434 "**/EngineTest.java"
13435 "**/Issue664Test.java"
13436 "**/MapInterfaceTest.java")
13437 #:phases #~(modify-phases %standard-phases
13438 (replace 'install (install-from-pom "pom.xml")))))
13439 (native-inputs (list java-junit))
13440 (home-page "https://mapdb.org/")
13441 (synopsis "Concurrent data structures")
13442 (description "MapDB provides concurrent maps, sets and queues backed by
13443disk storage or off-heap memory.")
13444 (license license:bsd-3)))
13445
13446(define-public java-mime4j-core
13447 (package
13448 (name "java-mime4j-core")
13449 (version "0.8.13")
13450 (source (origin
13451 (method url-fetch)
13452 (uri (string-append "mirror://apache/james/mime4j/" version
13453 "/james-mime4j-sources-" version ".zip"))
13454 (sha256
13455 (base32
13456 "0f1r0ywa1qdw2b227c93v3fksqp9bgll00bqw1md1894v3szm9ca"))))
13457 (build-system ant-build-system)
13458 (arguments
13459 `(#:tests? #f ;; has no tests
13460 #:source-dir "core/src/main/java"
13461 #:jar-name "apache-mime4j-core.jar"))
13462 (native-inputs
13463 (list java-commons-io-latest ;; requries >= 2.7
13464 java-junit
13465 unzip))
13466 (home-page "https://james.apache.org/mime4j/apache-mime4j-core/")
13467 (synopsis "Java stream based MIME message parser")
13468 (description "Apache James Mime4J provides a parser, MimeStreamParser, for
13469e-mail message streams in plain rfc822 and MIME format. The parser uses a
13470callback mechanism to report parsing events such as the start of an entity
13471header, the start of a body, etc. If you are familiar with the SAX XML parser
13472interface you should have no problem getting started with mime4j.")
13473 (license license:asl2.0)))
13474
13475(define-public java-jeromq
13476 (package
13477 (name "java-jeromq")
13478 (version "0.4.3")
13479 (source (origin
13480 (method git-fetch)
13481 (uri (git-reference
13482 (url "https://github.com/zeromq/jeromq")
13483 (commit (string-append "v" version))))
13484 (file-name (string-append name "-" version "-checkout"))
13485 (sha256
13486 (base32
13487 "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj"))
13488 (patches (search-patches "java-jeromq-fix-tests.patch"))))
13489 (build-system ant-build-system)
13490 (arguments
13491 `(#:jar-name "java-jeromq.jar"
13492 #:source-dir "src/main/java"
13493 #:jdk ,icedtea-8
13494 #:test-exclude
13495 (list
13496 "**/Abstract*.java"
13497 ;; Requires network
13498 "**/ZBeaconTest.java"
13499 ;; Failures
13500 "**/DealerSpecTest.java"
13501 "**/CustomDecoderTest.java"
13502 "**/CustomEncoderTest.java"
13503 "**/ConnectRidTest.java"
13504 "**/ReqSpecTest.java"
13505 "**/PushPullSpecTest.java"
13506 "**/PubSubHwmTest.java"
13507 "**/RouterSpecTest.java"
13508 "**/ProxyTest.java")))
13509 (inputs
13510 (list java-jnacl))
13511 (native-inputs
13512 `(("java-hamcrest-core" ,java-hamcrest-core)
13513 ("junit" ,java-junit)))
13514 (home-page "https://zeromq.org/bindings:java")
13515 (synopsis "Java binding for 0MQ")
13516 (description "Jeromq provides the java bindings for 0MQ.")
13517 (license license:mpl2.0)))
13518
13519(define-public java-kafka-clients
13520 (package
13521 (name "java-kafka-clients")
13522 (version "1.1.1")
13523 (source (origin
13524 (method url-fetch)
13525 (uri (string-append "mirror://apache/kafka/" version "/kafka-"
13526 version "-src.tgz"))
13527 (sha256
13528 (base32
13529 "1jn62q7z383nwhzv4ippsddf98sa1gnkszjjncj4ii3r8rzgw566"))))
13530 (build-system ant-build-system)
13531 (arguments
13532 `(#:jar-name "java-kafka-clients.jar"
13533 #:jdk ,icedtea-8
13534 #:source-dir "clients/src/main/java"
13535 #:test-dir "clients/src/test"
13536 #:test-exclude
13537 (list
13538 ;; This file does not contain a class
13539 "**/IntegrationTest.java"
13540 ;; Requires network
13541 "**/ClientUtilsTest.java"
13542 ;; This test fails on i686
13543 "**/SerializationTest.java"
13544 ;; "protocol is disabled or cipher suites are inappropriate"
13545 "**/SslTransportLayerTest.java"
13546 ;; End with errors that seem related to our powermock
13547 "**/KafkaProducerTest.java"
13548 "**/BufferPoolTest.java"
13549 ;; Undeterministic failure, seems to affect mostly ci
13550 "**/GarbageCollectedMemoryPoolTest.java")))
13551 (inputs
13552 (list java-slf4j-api java-lz4))
13553 (native-inputs
13554 (list java-bouncycastle
13555 java-cglib
13556 java-easymock
13557 java-hamcrest-all
13558 java-jboss-javassist
13559 java-junit
13560 java-objenesis
13561 java-powermock-api-easymock
13562 java-powermock-api-support
13563 java-powermock-core
13564 java-powermock-modules-junit4
13565 java-powermock-modules-junit4-common
13566 java-snappy))
13567 (home-page "https://kafka.apache.org")
13568 (synopsis "Distributed streaming platform")
13569 (description "Kafka is a distributed streaming platform, which means:
13570@itemize
13571@item it can publish and subscribe to streams of records;
13572@item it can store streams of records in a fault-tolerant way;
13573@item it can process streams of records as they occur.
13574@end itemize")
13575 ;; Either cddl or gpl2 only.
13576 (license (list license:cddl1.1; actually cddl1.1
13577 license:gpl2)))); with classpath exception
13578
13579(define-public java-jdom
13580 (package
13581 (name "java-jdom")
13582 (version "1.1.3")
13583 (source (origin
13584 (method url-fetch)
13585 (uri (string-append "http://jdom.org/dist/binary/archive/jdom-"
13586 version ".tar.gz"))
13587 (sha256
13588 (base32
13589 "07wdpm3jwwc9q38kmdw40fvbmv6jzjrkrf8m0zqs58f79a672wfl"))))
13590 (build-system ant-build-system)
13591 (arguments
13592 `(#:build-target "package"
13593 #:tests? #f; tests are run as part of the build process
13594 #:phases
13595 (modify-phases %standard-phases
13596 (replace 'install
13597 (install-jars "build")))))
13598 (home-page "http://jdom.org/")
13599 (synopsis "Access, manipulate, and output XML data")
13600 (description "Java-based solution for accessing, manipulating, and
13601outputting XML data from Java code.")
13602 (license license:bsd-4)))
13603
13604(define-public java-geronimo-xbean-reflect
13605 (package
13606 (name "java-geronimo-xbean-reflect")
13607 (version "4.5")
13608 (source (origin
13609 (method svn-fetch)
13610 (uri (svn-reference
13611 (url "https://svn.apache.org/repos/asf/geronimo/xbean/tags/xbean-4.5/")
13612 (revision 1807396)))
13613 (file-name (string-append name "-" version))
13614 (sha256
13615 (base32
13616 "0zjqmsad4xk0iar23hdyvx19nxczybd2bh0i35xrafli5cmh720k"))))
13617 (build-system ant-build-system)
13618 (arguments
13619 `(#:jar-name "geronimo-xbean-reflect.jar"
13620 #:source-dir "xbean-reflect/src/main/java"
13621 #:test-dir "xbean-reflect/src/test"
13622 #:jdk ,icedtea-8
13623 #:test-exclude
13624 (list "**/Abstract*.java" "**/AsmParameterNameLoaderTest.java"
13625 "**/ObjectRecipeTest.java" "**/ParameterNameLoaderTest.java"
13626 "**/RecipeHelperTest.java" "**/XbeanAsmParameterNameLoaderTest.java")
13627 #:phases
13628 (modify-phases %standard-phases
13629 (add-before 'build 'fix-source
13630 (lambda _
13631 (let ((dir "xbean-reflect/src/main/java/org/apache/xbean/recipe/"))
13632 ;; org.apache.xbean.asm6 is actually repackaged java-asm
13633 (substitute* (string-append dir "XbeanAsmParameterNameLoader.java")
13634 (("org.apache.xbean.asm5") "org.objectweb.asm"))
13635 #t)))
13636 (replace 'install (install-from-pom "xbean-reflect/pom.xml")))))
13637 (inputs
13638 `(("asm" ,java-asm)
13639 ("log4j" ,java-log4j-api)
13640 ("log4j-1.2" ,java-log4j-1.2-api)
13641 ("log4j-core" ,java-log4j-core)
13642 ("logging" ,java-commons-logging-minimal)))
13643 (propagated-inputs
13644 (list java-geronimo-parent-pom))
13645 (native-inputs
13646 `(("junit" ,java-junit)))
13647 (home-page "https://geronimo.apache.org/maven/xbean/3.6/xbean-reflect/")
13648 (synopsis "Dependency injection helper")
13649 (description "Xbean-reflect provides very flexible ways to create objects
13650and graphs of objects for dependency injection frameworks")
13651 (license license:asl2.0)))
13652
13653(define-public java-geronimo-genesis-2.1
13654 (package
13655 (name "java-geronimo-genesis")
13656 (version "2.1")
13657 (source (origin
13658 (method svn-fetch)
13659 (uri (svn-reference
13660 (url (string-append "https://svn.apache.org/repos/asf/"
13661 "geronimo/genesis/tags/genesis-"
13662 version))
13663 (revision 1807396)))
13664 (file-name (string-append name "-" version "-source"))
13665 (sha256
13666 (base32
13667 "1mky4zyl2xsqlgrkairaj5971byvhwk2z9bq8snsgvlr11ydc0zf"))))
13668 (build-system ant-build-system)
13669 (arguments
13670 `(#:tests? #f
13671 #:phases
13672 (modify-phases %standard-phases
13673 (delete 'configure)
13674 (delete 'build)
13675 (replace 'install
13676 (install-pom-file "pom.xml"))
13677 (add-after 'install 'install-enforcer-rules
13678 (install-pom-file "genesis-enforcer-rules/pom.xml"))
13679 (add-after 'install 'install-flava
13680 (install-pom-file "genesis-default-flava/pom.xml"))
13681 (add-after 'install 'install-packaging
13682 (install-pom-file "genesis-packaging/pom.xml"))
13683 (add-after 'install-flava 'install-flava-java4
13684 (install-pom-file "genesis-default-flava/genesis-java1.4-flava/pom.xml"))
13685 (add-after 'install-flava 'install-flava-java5
13686 (install-pom-file "genesis-default-flava/genesis-java5-flava/pom.xml"))
13687 (add-after 'install-flava 'install-flava-java6
13688 (install-pom-file "genesis-default-flava/genesis-java6-flava/pom.xml")))))
13689 (propagated-inputs
13690 `(("apache-parent-pom" ,apache-parent-pom-13)))
13691 (home-page "https://geronimo.apache.org")
13692 (synopsis "Collection of maven POM files for the Geronimo project")
13693 (description "Apache Geronimo is a server runtime. This package contains
13694only pom files used by other components in the Geronimo project.")
13695 (license license:asl2.0)))
13696
13697(define java-geronimo-parent-pom
13698 (package
13699 (inherit java-geronimo-xbean-reflect)
13700 (name "java-geronimo-parent-pom")
13701 (arguments
13702 `(#:tests? #f
13703 #:phases
13704 (modify-phases %standard-phases
13705 (delete 'configure)
13706 (delete 'build)
13707 (replace 'install
13708 (install-pom-file "pom.xml")))))
13709 (propagated-inputs
13710 `(("java-geronimo-genesis" ,java-geronimo-genesis-2.1)))))
13711
13712(define-public java-geronimo-xbean-bundleutils
13713 (package
13714 (inherit java-geronimo-xbean-reflect)
13715 (name "java-geronimo-xbean-bundleutils")
13716 (arguments
13717 `(#:jar-name "geronimo-xbean-bundleutils.jar"
13718 #:source-dir "xbean-bundleutils/src/main/java"
13719 #:test-dir "xbean-bundleutils/src/test"
13720 #:phases
13721 (modify-phases %standard-phases
13722 (add-before 'build 'fix-java
13723 (lambda _
13724 ;; We use a more recent version of osgi, so this file requires
13725 ;; more interface method implementations.
13726 (substitute* "xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java"
13727 (("import org.osgi.framework.ServiceRegistration;")
13728 "import org.osgi.framework.ServiceRegistration;
13729import org.osgi.framework.ServiceFactory;
13730import java.util.Collection;
13731import org.osgi.framework.ServiceObjects;")
13732 (("public Bundle getBundle\\(\\)")
13733 "@Override
13734public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
13735 throw new UnsupportedOperationException();
13736}
13737@Override
13738public <S> ServiceRegistration<S> registerService(Class<S> clazz,
13739 ServiceFactory<S> factory, Dictionary<String, ?> properties) {
13740 throw new UnsupportedOperationException();
13741}
13742public Bundle getBundle()"))
13743 #t)))))
13744 (inputs
13745 `(("java-slf4j" ,java-slf4j-api)
13746 ("java-asm" ,java-asm)
13747 ("java-osgi-framework" ,java-osgi-framework)
13748 ("java-eclipse-osgi" ,java-eclipse-osgi)
13749 ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)))))
13750
13751(define-public java-geronimo-xbean-asm-util
13752 (package
13753 (inherit java-geronimo-xbean-reflect)
13754 (name "java-geronimo-xbean-asm-util")
13755 (arguments
13756 `(#:jar-name "geronimo-xbean-asm-util.jar"
13757 #:source-dir "xbean-asm-util/src/main/java"
13758 #:tests? #f)); no tests
13759 (inputs
13760 (list java-asm))
13761 (native-inputs '())))
13762
13763(define-public java-geronimo-xbean-finder
13764 (package
13765 (inherit java-geronimo-xbean-reflect)
13766 (name "java-geronimo-xbean-finder")
13767 (arguments
13768 `(#:jar-name "geronimo-xbean-finder.jar"
13769 #:source-dir "xbean-finder/src/main/java"
13770 #:test-dir "xbean-finder/src/test"))
13771 (inputs
13772 (list java-slf4j-api
13773 java-asm
13774 java-geronimo-xbean-bundleutils
13775 java-geronimo-xbean-asm-util
13776 java-osgi-service-packageadmin
13777 java-osgi-framework))
13778 (native-inputs
13779 (list java-junit java-hamcrest-core))))
13780
13781(define-public java-simplevalidation-1.14.1
13782 (package
13783 (name "java-simplevalidation")
13784 (version "1.14.1")
13785 (source
13786 (origin
13787 (method git-fetch)
13788 (uri (git-reference
13789 (url "https://github.com/timboudreau/simplevalidation.git")
13790 (commit "7a9d6adbac685b34746aaa72b20a1e639b89c733")))
13791 (file-name (git-file-name "java-simplevalidation" version))
13792 (sha256
13793 (base32 "1l0h2a6brzh4qrkjjxpiijjspapd1s7wr9pqzzwgh6qisjgb176w"))
13794 (patches
13795 (search-patches "java-simplevalidation-1.14.1.patch"))
13796 (modules '((guix build utils)))
13797 (snippet
13798 '(begin
13799 (for-each delete-file (find-files "." "\\.jar$"))
13800 #t))))
13801 (build-system ant-build-system)
13802 (arguments
13803 (list
13804 #:jdk openjdk17
13805 #:tests? #f
13806 #:modules
13807 '((guix build utils)
13808 (guix build ant-build-system)
13809 (guix build java-utils)
13810 (srfi srfi-13))
13811 #:phases
13812 #~(modify-phases %standard-phases
13813 (replace 'build
13814 (lambda _
13815 (define build-root (getcwd))
13816 (define (normalize-path file)
13817 (if (string-prefix? "./" file)
13818 (substring file 2)
13819 file))
13820 (define (copy-resources source-root class-root)
13821 (with-directory-excursion source-root
13822 (for-each
13823 (lambda (file)
13824 (unless (string-suffix? ".java" file)
13825 (let* ((relative (normalize-path file))
13826 (destination
13827 (string-append class-root "/" relative)))
13828 (mkdir-p (dirname destination))
13829 (copy-file file destination))))
13830 (find-files "." ".*"))))
13831 (define (compile-tree source-root class-root classpath)
13832 (mkdir-p class-root)
13833 (copy-resources source-root class-root)
13834 (with-directory-excursion source-root
13835 (let ((sources (find-files "." "\\.java$")))
13836 (apply invoke "javac"
13837 (append
13838 (list "-d" class-root)
13839 (if classpath
13840 (list "-cp" classpath)
13841 '())
13842 sources)))))
13843 (let* ((nbstubs-classes (string-append build-root "/build/nbstubs"))
13844 (core-classes (string-append build-root "/build/core"))
13845 (swing-classes (string-append build-root "/build/swing"))
13846 (nbstubs-jar (string-append build-root
13847 "/build/nbstubs-1.14.1.jar"))
13848 (core-jar (string-append build-root
13849 "/build/simplevalidation-1.14.1.jar"))
13850 (swing-jar
13851 (string-append build-root
13852 "/build/simplevalidation-swing-1.14.1.jar"))
13853 (converter-services
13854 (string-append
13855 swing-classes
13856 "/META-INF/services/org.netbeans.validation.api.conversion.Converter")))
13857 (compile-tree "nbstubs/src" nbstubs-classes #f)
13858 (invoke "jar" "-cf" nbstubs-jar "-C" nbstubs-classes ".")
13859 (compile-tree "ValidationAPI/src" core-classes #f)
13860 (invoke "jar" "-cf" core-jar "-C" core-classes ".")
13861 (compile-tree "simplevalidation-swing/src/main/java"
13862 swing-classes
13863 (string-append core-classes ":" nbstubs-classes))
13864 (mkdir-p (dirname converter-services))
13865 (call-with-output-file converter-services
13866 (lambda (port)
13867 (for-each
13868 (lambda (line)
13869 (display line port)
13870 (newline port))
13871 '("org.netbeans.validation.api.conversion.swing.SelectedIndicesToButtonModelArrayConverter"
13872 "org.netbeans.validation.api.conversion.swing.SelectedIndicesToListSelectionModelConverter"
13873 "org.netbeans.validation.api.conversion.swing.StringToComboBoxModelConverter"
13874 "org.netbeans.validation.api.conversion.swing.StringToDocumentConverter"))))
13875 (invoke "jar" "-cf" swing-jar "-C" swing-classes ".")
13876 #t)))
13877 (replace 'install
13878 (lambda* (#:key inputs outputs #:allow-other-keys)
13879 ((install-pom-file "pom.xml")
13880 #:inputs inputs
13881 #:outputs outputs)
13882 ((install-from-pom "nbstubs/pom.xml")
13883 #:inputs inputs
13884 #:outputs outputs)
13885 ((install-from-pom "ValidationAPI/pom.xml")
13886 #:inputs inputs
13887 #:outputs outputs)
13888 ((install-from-pom "simplevalidation-swing/pom.xml")
13889 #:inputs inputs
13890 #:outputs outputs)
13891 #t)))))
13892 (home-page "https://github.com/timboudreau/simplevalidation/")
13893 (synopsis "Simple Validation libraries for Swing forms")
13894 (description
13895 "This package builds the Simple Validation core and Swing adapter
13896libraries from source.")
13897 (license license:asl2.0)))
13898
13899(define-public java-lucene-core-3.6.2
13900 (package
13901 (name "java-lucene-core")
13902 (version "3.6.2")
13903 (source
13904 (origin
13905 (method url-fetch)
13906 (uri (string-append "https://archive.apache.org/dist/lucene/solr/"
13907 version "/apache-solr-" version "-src.tgz"))
13908 (sha256
13909 (base32 "032dfpk7likiwb9pnlr518wwlyxn57i5wyp18mi32320vsprd4r0"))))
13910 (build-system ant-build-system)
13911 (arguments
13912 (list
13913 #:tests? #f
13914 #:phases
13915 #~(modify-phases %standard-phases
13916 (replace 'build
13917 (lambda _
13918 (let ((jar-file (string-append (getcwd) "/build/lucene-core-"
13919 #$version ".jar")))
13920 (mkdir-p "build")
13921 (with-directory-excursion "lucene/core"
13922 (mkdir-p "build/classes")
13923 (apply invoke "javac" "-d" "build/classes"
13924 (find-files "src/java" "\\.java$"))
13925 (invoke "jar" "-cf" jar-file "-C" "build/classes" "."))
13926 #t)))
13927 (replace 'install
13928 (install-jars "build")))))
13929 (home-page "https://lucene.apache.org/core/")
13930 (synopsis "Apache Lucene core library")
13931 (description
13932 "This package provides the Apache Lucene 3.6.2 core library, built
13933entirely from source.")
13934 (license license:asl2.0)))
13935
13936(define-public java-json-simple-1.1.1
13937 (package
13938 (name "java-json-simple")
13939 (version "1.1.1")
13940 (source
13941 (origin
13942 (method git-fetch)
13943 (uri (git-reference
13944 (url "https://github.com/fangyidong/json-simple.git")
13945 (commit "tag_release_1_1_1")))
13946 (file-name (git-file-name name version))
13947 (sha256
13948 (base32 "1c598dvms70fs6w3l1dc0z7lqq3hndd5250ciwqm8xk3zbx465kf"))))
13949 (build-system ant-build-system)
13950 (arguments
13951 (list
13952 #:tests? #f
13953 #:build-target "jar"
13954 #:phases
13955 #~(modify-phases %standard-phases
13956 (replace 'install
13957 (install-from-pom "pom.xml")))))
13958 (home-page "https://github.com/fangyidong/json-simple")
13959 (synopsis "Simple JSON toolkit for Java")
13960 (description
13961 "JSON.simple is a small JSON parser and encoder for Java.")
13962 (license license:asl2.0)))
13963
13964(define-public java-gson
13965 (package
13966 (name "java-gson")
13967 (version "2.8.2")
13968 (source (origin
13969 (method url-fetch)
13970 (uri (string-append "https://github.com/google/gson/archive/"
13971 "gson-parent-" version ".tar.gz"))
13972 (sha256
13973 (base32
13974 "1j4qnp7v046q0k48c4kyf69sxaasx2h949d3cqwsm3kzxms3x0f9"))))
13975 (build-system ant-build-system)
13976 (arguments
13977 `(#:jar-name "gson.jar"
13978 #:source-dir "gson/src/main/java"
13979 #:test-dir "gson/src/test"))
13980 (native-inputs
13981 (list java-junit java-hamcrest-core))
13982 (home-page "https://github.com/google/gson")
13983 (synopsis "Java serialization/deserialization library from/to JSON")
13984 (description "Gson is a Java library that can be used to convert Java
13985Objects into their JSON representation. It can also be used to convert a JSON
13986string to an equivalent Java object. Gson can work with arbitrary Java objects
13987including pre-existing objects that you do not have source-code of.")
13988 (license license:asl2.0)))
13989
13990;; This requires a different Java version than 2.8.2 above
13991(define-public java-gson-2.8.6
13992 (package
13993 (inherit java-gson)
13994 (name "java-gson")
13995 (version "2.8.6")
13996 (source (origin
13997 (method git-fetch)
13998 (uri (git-reference
13999 (url "https://github.com/google/gson")
14000 (commit (string-append "gson-parent-" version))))
14001 (file-name (git-file-name name version))
14002 (sha256
14003 (base32
14004 "0kk5p3vichdb0ph1lzknrcpbklgnmq455mngmjpxvvj29p3rgpk3"))))
14005 (arguments
14006 `(#:jar-name "gson.jar"
14007 #:jdk ,openjdk11
14008 #:source-dir "gson/src/main/java"
14009 #:test-dir "gson/src/test"
14010 #:phases
14011 (modify-phases %standard-phases
14012 ;; avoid Maven dependency
14013 (add-before 'build 'fill-template
14014 (lambda _
14015 (with-directory-excursion "gson/src/main"
14016 (copy-file "java-templates/com/google/gson/internal/GsonBuildConfig.java"
14017 "java/com/google/gson/internal/GsonBuildConfig.java")
14018 (substitute* "java/com/google/gson/internal/GsonBuildConfig.java"
14019 (("\\$\\{project.version\\}") ,version))))))))))
14020
14021(define-public java-hawtjni
14022 (package
14023 (name "java-hawtjni")
14024 (version "1.15")
14025 (source (origin
14026 (method url-fetch)
14027 (uri (string-append "https://github.com/fusesource/hawtjni/archive/"
14028 "hawtjni-project-" version ".tar.gz"))
14029 (sha256
14030 (base32
14031 "1bqfd732rmh6svyx17fpw9175gc9gzkcbyps2yyrf50c3zzjas6g"))))
14032 (build-system ant-build-system)
14033 (arguments
14034 `(#:jar-name "hawtjni.jar"
14035 #:source-dir "hawtjni-generator/src/main/java:hawtjni-runtime/src/main/java"
14036 #:tests? #f; no tests
14037 #:phases
14038 (modify-phases %standard-phases
14039 (add-before 'build 'build-native
14040 (lambda* (#:key inputs #:allow-other-keys)
14041 (let ((include (string-append "-I" (assoc-ref inputs "jdk") "/include/linux")))
14042 (with-directory-excursion "hawtjni-generator/src/main/resources/"
14043 (invoke "gcc" "-c" "hawtjni.c" "-o" "hawtjni.o"
14044 "-fPIC" "-O2" include)
14045 (invoke "gcc" "-c" "hawtjni-callback.c" "-o" "hawtjni-callback.o"
14046 "-fPIC" "-O2" include)
14047 (invoke "gcc" "-o" "libhawtjni.so" "-shared"
14048 "hawtjni.o" "hawtjni-callback.o")))
14049 #t))
14050 (add-after 'install 'install-native
14051 (lambda* (#:key outputs #:allow-other-keys)
14052 (let* ((out (assoc-ref outputs "out"))
14053 (lib (string-append out "/lib"))
14054 (inc (string-append out "/include")))
14055 (with-directory-excursion "hawtjni-generator/src/main/resources/"
14056 (install-file "libhawtjni.so" lib)
14057 (install-file "hawtjni.h" inc)))
14058 #t))
14059 (add-before 'install 'install-parent
14060 (install-pom-file "pom.xml"))
14061 (replace 'install
14062 (install-from-pom "hawtjni-runtime/pom.xml")))))
14063 (inputs
14064 (list java-commons-cli java-asm java-geronimo-xbean-finder))
14065 (home-page "https://fusesource.github.io/hawtjni/")
14066 (synopsis "JNI code generator")
14067 (description "HawtJNI is a code generator that produces the JNI code needed
14068to implement Java native methods. It is based on the jnigen code generator
14069that is part of the SWT Tools project.")
14070 (license license:asl2.0)))
14071
14072(define-public java-jansi-native
14073 (package
14074 (name "java-jansi-native")
14075 (version "1.7")
14076 (source (origin
14077 (method url-fetch)
14078 (uri (string-append "https://github.com/fusesource/jansi-native/"
14079 "archive/jansi-native-" version ".tar.gz"))
14080 (sha256
14081 (base32
14082 "0j2ydlgxbzbgshqkwghbxxxnbnx1mmjgd6k5fw6xfvxw1z956yqf"))))
14083 (build-system ant-build-system)
14084 (arguments
14085 `(#:jar-name "jansi-native.jar"
14086 #:source-dir "src/main/java"
14087 #:tests? #f; no tests
14088 #:phases
14089 (modify-phases %standard-phases
14090 (add-before 'build 'build-native
14091 (lambda* (#:key inputs #:allow-other-keys)
14092 ;; there are more required files for windows in windows/
14093 (with-directory-excursion "src/main/native-package/src"
14094 (substitute* "jansi_ttyname.c"
14095 (("#include \"jansi_.*") ""))
14096 (invoke "gcc" "-c" "jansi_ttyname.c" "-o" "jansi_ttyname.o"
14097 (string-append "-I" (assoc-ref inputs "java-hawtjni")
14098 "/include")
14099 (string-append "-I" (assoc-ref inputs "jdk")
14100 "/include/linux")
14101 "-fPIC" "-O2")
14102 (invoke "gcc" "-o" "libjansi.so" "-shared" "jansi_ttyname.o"))))
14103 (add-before 'build 'install-native
14104 (lambda _
14105 (let ((dir (string-append "build/classes/META-INF/native/"
14106 ,(match (%current-system)
14107 ((or "i686-linux" "armhf-linux")
14108 "linux32")
14109 ((or "x86_64-linux" "aarch64-linux"
14110 "mips64el-linux")
14111 "linux64")
14112 (_ "unknown-kernel")))))
14113 (install-file "src/main/native-package/src/libjansi.so" dir))
14114 #t))
14115 (add-after 'install 'install-native
14116 (lambda* (#:key outputs #:allow-other-keys)
14117 (install-file "src/main/native-package/src/jansi.h"
14118 (string-append (assoc-ref outputs "out") "/include"))
14119 #t))
14120 (add-before 'install 'fix-pom
14121 (lambda _
14122 ;; pom contains variables to complete name, but we don't support that
14123 (substitute* "pom.xml"
14124 (("\\$\\{platform\\}") "native"))
14125 #t))
14126 (replace 'install
14127 (install-from-pom "pom.xml")))))
14128 (propagated-inputs
14129 (list java-hawtjni))
14130 (home-page "https://fusesource.github.io/jansi/")
14131 (synopsis "Native library for jansi")
14132 (description "This package provides the native library for jansi, a small
14133Java library that allows you to use ANSI escape sequences to format your
14134console output.")
14135 (license license:asl2.0)))
14136
14137(define-public java-jansi
14138 (package
14139 (name "java-jansi")
14140 (version "2.4.0")
14141 (source (origin
14142 (method git-fetch)
14143 (uri (git-reference
14144 (url "https://github.com/fusesource/jansi")
14145 (commit (string-append "jansi-" version))))
14146 (file-name (git-file-name name version))
14147 (sha256
14148 (base32
14149 "1s6fva06990798b5fyxqzr30zwyj1byq5wrm54j2larcydaryggf"))
14150 (modules '((guix build utils)))
14151 (snippet
14152 ;; contains pre-compiled libraries
14153 '(delete-file-recursively
14154 "src/main/resources/org/fusesource/jansi/internal"))))
14155 (build-system ant-build-system)
14156 (arguments
14157 `(#:jar-name "jansi.jar"
14158 #:source-dir "src/main/java"
14159 #:test-dir "src/test"
14160 #:tests? #f; require junit 3
14161 #:phases
14162 (modify-phases %standard-phases
14163 (add-before 'build 'build-native
14164 (lambda* (#:key inputs #:allow-other-keys)
14165 (with-directory-excursion "src/main/native"
14166 (for-each
14167 (lambda (cfile)
14168 (let ((cfile (basename cfile))
14169 (ofile (string-append (basename cfile ".c") ".o")))
14170 (invoke ,(cc-for-target) "-c" cfile "-o" ofile
14171 (string-append "-I" (assoc-ref inputs "jdk")
14172 "/include/linux")
14173 "-fPIC" "-O2")))
14174 (find-files "." "\\.c$"))
14175 (apply invoke ,(cc-for-target) "-o" "libjansi.so" "-shared"
14176 (find-files "." "\\.o$")))))
14177 (add-before 'build 'install-native
14178 (lambda _
14179 (let ((dir (string-append "build/classes/org/fusesource/"
14180 "jansi/internal/native/"
14181 ,(match (or (%current-target-system) (%current-system))
14182 ("i686-linux" "Linux/x86")
14183 ("x86_64-linux" "Linux/x86_64")
14184 ("armhf-linux" "Linux/armv7")
14185 ("aarch64-linux" "Linux/arm64")
14186 ("mips64el-linux" "Linux/mips64")
14187 (_ "unknown-kernel")))))
14188 (install-file "src/main/native/libjansi.so" dir))))
14189 (add-before 'build 'copy-resources
14190 (lambda _
14191 (copy-recursively "src/main/resources" "build/classes")))
14192 (replace 'install
14193 (install-from-pom "pom.xml")))))
14194 (home-page "https://fusesource.github.io/jansi/")
14195 (synopsis "Portable ANSI escape sequences")
14196 (description "Jansi is a Java library that allows you to use ANSI escape
14197sequences to format your console output which works on every platform.")
14198 (license license:asl2.0)))
14199
14200(define-public java-jansi-1
14201 (package
14202 (inherit java-jansi)
14203 (version "1.16")
14204 (source (origin
14205 (method git-fetch)
14206 (uri (git-reference
14207 (url "https://github.com/fusesource/jansi")
14208 (commit (string-append "jansi-project-" version))))
14209 (file-name (git-file-name "jansi" version))
14210 (sha256
14211 (base32
14212 "0ikk0x352gh30b42qn1jd89xwsjj0mavrc5kms7fss15bd8vsayx"))))
14213 (arguments
14214 `(#:jar-name "jansi.jar"
14215 #:source-dir "jansi/src/main/java"
14216 #:test-dir "jansi/src/test"
14217 #:phases
14218 (modify-phases %standard-phases
14219 (add-after 'check 'clear-term
14220 (lambda _
14221 (invoke "echo" "-e" "\\e[0m")))
14222 (add-before 'install 'install-parent
14223 (install-pom-file "pom.xml"))
14224 (add-before 'install 'fix-pom
14225 (lambda _
14226 ;; pom adds jansi native versions for different platforms, but we
14227 ;; only need one, so use native instead
14228 (substitute* "jansi/pom.xml"
14229 (("windows32") "native")
14230 (("windows64") "native")
14231 (("osx") "native")
14232 (("linux32") "native")
14233 (("linux64") "native")
14234 (("freebsd32") "native")
14235 (("freebsd64") "native"))
14236 #t))
14237 (replace 'install
14238 (install-from-pom "jansi/pom.xml")))))
14239 (propagated-inputs
14240 (list java-jansi-native))
14241 (native-inputs
14242 (list java-junit java-hamcrest-core))))
14243
14244(define-public java-jboss-el-api-spec
14245 (package
14246 (name "java-jboss-el-api-spec")
14247 (version "3.0")
14248 (source (origin
14249 (method url-fetch)
14250 (uri (string-append "https://github.com/jboss/jboss-el-api_spec/"
14251 "archive/jboss-el-api_" version
14252 "_spec-1.0.7.Final.tar.gz"))
14253 (sha256
14254 (base32
14255 "1j45ljxalwlibxl7g7iv952sjxkw275m8vyxxij8l6wdd5pf0pdh"))))
14256 (build-system ant-build-system)
14257 (arguments
14258 `(#:jar-name "java-jboss-el-api_spec.jar"
14259 #:phases
14260 (modify-phases %standard-phases
14261 ;; the origin of javax.el:javax.el-api is unknown, so we use this package
14262 ;; instead, which implements the same thing. We override the pom file
14263 ;; to "rename" the package so it can be found by maven.
14264 (add-before 'install 'override-pom
14265 (generate-pom.xml "pom.xml" "javax.el" "javax.el-api" "3.0"
14266 #:name "el-api"))
14267 (replace 'install
14268 (install-from-pom "pom.xml")))))
14269 (inputs
14270 (list java-junit))
14271 (home-page "https://github.com/jboss/jboss-el-api_spec")
14272 (synopsis "JSR-341 expression language 3.0 API")
14273 (description "This package contains an implementation of the JSR-341
14274specification for the expression language 3.0. It implements an expression
14275language inspired by ECMAScript and XPath. This language is used with
14276JavaServer Pages (JSP).")
14277 ;; Either GPL2 only or CDDL.
14278 (license (list license:gpl2 license:cddl1.1))))
14279
14280(define-public java-jboss-interceptors-api-spec
14281 (package
14282 (name "java-jboss-interceptors-api-spec")
14283 (version "1.2")
14284 (source (origin
14285 (method url-fetch)
14286 (uri (string-append "https://github.com/jboss/jboss-interceptors-api_spec/"
14287 "archive/jboss-interceptors-api_" version
14288 "_spec-1.0.0.Final.tar.gz"))
14289 (sha256
14290 (base32
14291 "0wv8x0jp9a5qxlrgkhb5jdk2gr6vi87b4j4kjb8ryxiy9gn8g51z"))))
14292 (build-system ant-build-system)
14293 (arguments
14294 `(#:jar-name "java-jboss-interceptors-api_spec.jar"
14295 #:jdk ,icedtea-8
14296 #:source-dir "."
14297 #:tests? #f; no tests
14298 #:phases
14299 (modify-phases %standard-phases
14300 ;; the origin of javax.interceptor:javax.interceptor-api is unknown,
14301 ;; so we use this package instead, which implements the same thing.
14302 ;; We override the pom file to "rename" the package so it can be found
14303 ;; by maven.
14304 (add-before 'install 'override-pom
14305 (generate-pom.xml "pom.xml" "javax.interceptor" "javax.interceptor-api"
14306 "3.0" #:name "interceptor-api"))
14307 (replace 'install
14308 (install-from-pom "pom.xml")))))
14309 (home-page "https://github.com/jboss/jboss-interceptors-api_spec")
14310 (synopsis "Interceptors 1.2 API classes from JSR 318")
14311 (description "Java-jboss-interceptors-api-spec implements the Interceptors
14312API. Interceptors are used to interpose on business method invocations and
14313specific events.")
14314 ;; Either GPL2 only or CDDL.
14315 (license (list license:gpl2 license:cddl1.1))))
14316
14317(define-public java-cdi-api
14318 (package
14319 (name "java-cdi-api")
14320 (version "2.0")
14321 (source (origin
14322 (method url-fetch)
14323 (uri (string-append "https://github.com/cdi-spec/cdi/archive/"
14324 version ".tar.gz"))
14325 (file-name (string-append name "-" version ".tar.gz"))
14326 (sha256
14327 (base32
14328 "1iv8b8bp07c5kmqic14jsr868vycjv4qv02lf3pkgp9z21mnfg5y"))))
14329 (build-system ant-build-system)
14330 (arguments
14331 `(#:source-dir "api/src/main/java"
14332 #:jar-name "java-cdi-api.jar"
14333 #:test-dir "api/src/test"
14334 #:jdk ,icedtea-8
14335 #:tests? #f; Tests fail because we don't have a CDI provider yet
14336 #:phases
14337 (modify-phases %standard-phases
14338 (replace 'install
14339 (install-from-pom "api/pom.xml")))))
14340 (propagated-inputs
14341 (list java-javax-inject java-jboss-el-api-spec
14342 java-jboss-interceptors-api-spec java-weld-parent-pom))
14343 (native-inputs
14344 (list java-testng java-hamcrest-core))
14345 (home-page "https://cdi-spec.org/")
14346 (synopsis "Contexts and Dependency Injection APIs")
14347 (description "Java-cdi-api contains the required APIs for Contexts and
14348Dependency Injection (CDI).")
14349 (license license:asl2.0)))
14350
14351(define-public java-joda-convert
14352 (package
14353 (name "java-joda-convert")
14354 (version "1.9.2")
14355 (source (origin
14356 (method url-fetch)
14357 (uri (string-append "https://github.com/JodaOrg/joda-convert/archive/v"
14358 version ".tar.gz"))
14359 (file-name (string-append name "-" version ".tar.gz"))
14360 (sha256
14361 (base32
14362 "0vp346xz7dh9br4q7xazhc7hvzf76a6hf95fki9bg67q5jr0kjh7"))))
14363 (build-system ant-build-system)
14364 (arguments
14365 `(#:jar-name (string-append ,name "-" ,version ".jar")
14366 #:source-dir "src/main/java"
14367 #:test-include (list "**/Test*.java")
14368 ;; Contains only interfaces and base classes (no test)
14369 #:test-exclude (list "**/test*/**.java")))
14370 (inputs
14371 (list java-guava))
14372 (native-inputs
14373 (list java-junit java-hamcrest-core))
14374 (home-page "https://www.joda.org/joda-convert/")
14375 (synopsis "Conversion between Objects and Strings")
14376 (description "Joda-Convert provides a small set of classes to aid
14377conversion between Objects and Strings. It is not intended to tackle the
14378wider problem of Object to Object transformation.")
14379 (license license:asl2.0)))
14380
14381(define-public java-joda-time
14382 (package
14383 (name "java-joda-time")
14384 (version "2.9.9")
14385 (source (origin
14386 (method url-fetch)
14387 (uri (string-append "https://github.com/JodaOrg/joda-time/archive/v"
14388 version ".tar.gz"))
14389 (file-name (string-append name "-" version ".tar.gz"))
14390 (sha256
14391 (base32
14392 "1i9x91mi7yg2pasl0k3912f1pg46n37sps6rdb0v1gs8hj9ppwc1"))))
14393 (build-system ant-build-system)
14394 (arguments
14395 `(#:jar-name "java-joda-time.jar"
14396 #:source-dir "src/main/java"
14397 #:test-include (list "**/Test*.java")
14398 ;; There is no runnable test in these files
14399 #:test-exclude (list "**/Test*Chronology.java" "**/Test*Field.java")
14400 #:phases
14401 (modify-phases %standard-phases
14402 (add-after 'build 'build-resources
14403 (lambda _
14404 (mkdir-p "build/classes/org/joda/time/tz/data")
14405 (mkdir-p "build/classes/org/joda/time/format")
14406 ;; This will produce the following exception:
14407 ;; java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap"
14408 ;; which is normal, because it doesn't exist yet. It still generates
14409 ;; the same file as in the binary one can find on maven.
14410 (invoke "java" "-cp"
14411 (string-append "build/classes:" (getenv "CLASSPATH"))
14412 "org.joda.time.tz.ZoneInfoCompiler"
14413 "-src" "src/main/java/org/joda/time/tz/src"
14414 "-dst" "build/classes/org/joda/time/tz/data"
14415 "africa" "antarctica" "asia" "australasia"
14416 "europe" "northamerica" "southamerica"
14417 "pacificnew" "etcetera" "backward" "systemv")
14418 (for-each (lambda (f)
14419 (copy-file f (string-append
14420 "build/classes/org/joda/time/format/"
14421 (basename f))))
14422 (find-files "src/main/java/org/joda/time/format" ".*.properties"))
14423 #t))
14424 (add-before 'install 'regenerate-jar
14425 (lambda _
14426 ;; We need to regenerate the jar file to add generated data.
14427 (delete-file "build/jar/java-joda-time.jar")
14428 (invoke "ant" "jar")))
14429 (add-before 'check 'copy-test-resources
14430 (lambda _
14431 (mkdir-p "build/test-classes/org/joda/time/tz/data")
14432 (copy-file "src/test/resources/tzdata/ZoneInfoMap"
14433 "build/test-classes/org/joda/time/tz/data/ZoneInfoMap")
14434 (copy-recursively "src/test/resources" "build/test-classes")
14435 #t)))))
14436 (inputs
14437 (list java-joda-convert))
14438 (native-inputs
14439 (list java-junit java-hamcrest-core tzdata))
14440 (home-page "https://www.joda.org/joda-time/")
14441 (synopsis "Replacement for the Java date and time classes")
14442 (description "Joda-Time is a replacement for the Java date and time
14443classes prior to Java SE 8.")
14444 (license license:asl2.0)))
14445
14446(define-public java-xerces
14447 (package
14448 (name "java-xerces")
14449 (version "2.12.2")
14450 (source
14451 (origin
14452 (method url-fetch)
14453 (uri (string-append "mirror://apache/xerces/j/source/"
14454 "Xerces-J-src." version ".tar.gz"))
14455 (sha256
14456 (base32 "1s2fnfx5flmhs3q30bxdsa6vs52m6vbnqd3m4cc5r4wfr3afplbd"))
14457 (patches (search-patches
14458 "java-xerces-xjavac_taskdef.patch"
14459 "java-xerces-build_dont_unzip.patch"
14460 "java-xerces-bootclasspath.patch"))))
14461 (build-system ant-build-system)
14462 (arguments
14463 `(#:tests? #f;; Test files are not present
14464 #:test-target "test"
14465 #:jdk ,icedtea-8
14466 #:phases
14467 (modify-phases %standard-phases
14468 (add-after 'unpack 'create-build.properties
14469 (lambda* (#:key inputs #:allow-other-keys)
14470 (let ((jaxp (assoc-ref inputs "java-jaxp"))
14471 (resolver (assoc-ref inputs "java-apache-xml-commons-resolver")))
14472 (with-output-to-file "build.properties"
14473 (lambda _
14474 (format #t
14475 "jar.jaxp = ~a/share/java/jaxp.jar~@
14476 jar.apis-ext = ~a/share/java/jaxp.jar~@
14477 jar.resolver = ~a/share/java/xml-resolver.jar~%"
14478 jaxp jaxp resolver)))
14479 ;; Make xerces use our version of jaxp in tests
14480 (substitute* "build.xml"
14481 (("xml-apis.jar")
14482 (string-append jaxp "/share/java/jaxp.jar"))
14483 (("\\$\\{tools.dir\\}/\\$\\{jar.apis\\}")
14484 "${jar.apis}")))
14485 #t))
14486 (replace 'install (install-jars "build")))))
14487 (inputs
14488 (list java-apache-xml-commons-resolver java-jaxp))
14489 (home-page "https://xerces.apache.org/xerces2-j/")
14490 (synopsis "Validating XML parser for Java with DOM level 3 support")
14491 (description "The Xerces2 Java parser is the reference implementation of
14492XNI, the Xerces Native Interface, and also a fully conforming XML Schema
14493processor.
14494
14495Xerces2-J supports the following standards and APIs:
14496
14497@itemize
14498@item eXtensible Markup Language (XML) 1.0 Second Edition Recommendation
14499@item Namespaces in XML Recommendation
14500@item Document Object Model (DOM) Level 2 Core, Events, and Traversal and
14501 Range Recommendations
14502@item Simple API for XML (SAX) 2.0.1 Core and Extension
14503@item Java APIs for XML Processing (JAXP) 1.2.01
14504@item XML Schema 1.0 Structures and Datatypes Recommendations
14505@item Experimental implementation of the Document Object Model (DOM) Level 3
14506 Core and Load/Save Working Drafts
14507@item Provides a partial implementation of the XML Inclusions (XInclude) W3C
14508 Candidate Recommendation
14509@end itemize
14510
14511Xerces is now able to parse documents written according to the XML 1.1
14512Candidate Recommendation, except that it does not yet provide an option to
14513enable normalization checking as described in section 2.13 of this
14514specification. It also handles namespaces according to the XML Namespaces 1.1
14515Candidate Recommendation, and will correctly serialize XML 1.1 documents if
14516the DOM level 3 load/save API's are in use.")
14517 (license license:asl2.0)))
14518
14519(define-public java-jakarta-regexp
14520 (package
14521 (name "java-jakarta-regexp")
14522 (version "1.5")
14523 (source
14524 (origin
14525 (method url-fetch)
14526 (uri (string-append
14527 "https://archive.apache.org/dist/jakarta/regexp/jakarta-regexp-"
14528 version ".tar.gz"))
14529 (sha256
14530 (base32
14531 "0zg9rmyif48dck0cv6ynpxv23mmcsx265am1fnnxss7brgw0ms3r"))))
14532 (build-system ant-build-system)
14533 (arguments
14534 `(#:test-target "test"
14535 #:phases
14536 (modify-phases %standard-phases
14537 (replace 'install
14538 (lambda* (#:key outputs #:allow-other-keys)
14539 (let* ((out (assoc-ref outputs "out"))
14540 (out-share (string-append out "/share/java")))
14541 (mkdir-p out-share)
14542 (for-each (lambda (name)
14543 (install-file name out-share))
14544 (find-files "build" "^jakarta-regexp-.*\\.jar$"))
14545 #t))))))
14546 (home-page "https://attic.apache.org/projects/jakarta-regexp.html")
14547 (synopsis "Regular expression parser generator for Java")
14548 (description "@code{jakarta-regexp} is an old regular expression parser
14549generator for Java.")
14550 (license license:asl2.0)))
14551
14552(define-public java-jline
14553 (package
14554 (name "java-jline")
14555 (version "1.0")
14556 (source (origin
14557 (method url-fetch)
14558 (uri (string-append "https://github.com/jline/jline1/archive/jline-"
14559 version ".tar.gz"))
14560 (sha256
14561 (base32
14562 "0bi3p6vrh7a6v0fbpb6rx9plpmx5zk3lr352xzdbz2jcxg499wir"))))
14563 (build-system ant-build-system)
14564 (arguments
14565 `(#:jar-name "jline.jar"
14566 #:source-dir "src/main/java"
14567 #:test-dir "src/test"
14568 #:phases
14569 (modify-phases %standard-phases
14570 (add-before 'build 'copy-resources
14571 (lambda _
14572 (copy-recursively "src/main/resources" "build/classes")
14573 #t)))))
14574 (native-inputs
14575 (list java-junit))
14576 (home-page "https://jline.github.io")
14577 (synopsis "Console input handling library")
14578 (description "JLine is a Java library for handling console input. It is
14579similar in functionality to BSD editline and GNU readline but with additional
14580features that bring it on par with the Z shell line editor.")
14581 (license license:bsd-3)))
14582
14583(define-public java-jline-2
14584 (package
14585 (inherit java-jline)
14586 (version "2.14.5")
14587 (source (origin
14588 (method url-fetch)
14589 (uri (string-append "https://github.com/jline/jline2/archive/jline-"
14590 version ".tar.gz"))
14591 (sha256
14592 (base32
14593 "1c6qa26mf0viw8hg4jnv72s7i1qb1gh1l8rrzcdvqhqhx82rkdlf"))))
14594 (arguments
14595 `(#:jdk ,icedtea-8
14596 ,@(package-arguments java-jline)))
14597 (inputs
14598 (list java-jansi-1 java-jansi-native))
14599 (native-inputs
14600 (list java-powermock-modules-junit4
14601 java-powermock-modules-junit4-common
14602 java-powermock-api-easymock
14603 java-powermock-api-support
14604 java-powermock-core
14605 java-powermock-reflect
14606 java-easymock
14607 java-jboss-javassist
14608 java-objenesis
14609 java-hamcrest-core
14610 java-cglib
14611 java-junit
14612 java-hawtjni))))
14613
14614(define-public java-jline-terminal
14615 (package
14616 (name "java-jline-terminal")
14617 (version "3.14.1")
14618 (source (origin
14619 (method git-fetch)
14620 (uri (git-reference
14621 (url "https://github.com/jline/jline3")
14622 (commit (string-append "jline-parent-" version))))
14623 (file-name (git-file-name name version))
14624 (sha256
14625 (base32
14626 "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr"))))
14627 (build-system ant-build-system)
14628 (arguments
14629 `(#:jar-name "jline-terminal.jar"
14630 #:jdk ,openjdk11
14631 #:tests? #f; TODO: tests fail on *.caps resource lookups
14632 #:source-dir "terminal/src/main/java"
14633 #:test-dir "terminal/src/test"
14634 #:phases
14635 (modify-phases %standard-phases
14636 (add-after 'unpack 'remove-build-file
14637 (lambda _
14638 ;; Conflicts with build directory generated by ant-build-system.
14639 (delete-file "build")))
14640 (add-after 'unpack 'patch-paths
14641 (lambda* (#:key inputs #:allow-other-keys)
14642 (substitute* "terminal/src/main/java/org/jline/utils/OSUtils.java"
14643 (("= \"infocmp\"")
14644 (string-append "= \"" (assoc-ref inputs "ncurses")
14645 "/bin/infocmp\""))
14646 (("= \"(s?tty)\"" _ cmd)
14647 (string-append "= \"" (assoc-ref inputs "coreutils")
14648 "/bin/" cmd "\"")))))
14649 ;; Resources are not added to the JAR by ant-build-system.
14650 (add-after 'build 'add-resources
14651 (lambda* (#:key jar-name source-dir #:allow-other-keys)
14652 (let ((build (string-append (getcwd) "/build")))
14653 (with-directory-excursion
14654 (string-append source-dir "/../resources")
14655 (apply invoke "jar" "-uvf"
14656 (string-append build "/jar/" jar-name)
14657 (find-files ".")))))))))
14658 (inputs
14659 (list ncurses)); infocmp
14660 (home-page "https://github.com/jline/jline3")
14661 (synopsis "Java JLine Terminal API and implementations")
14662 (description "JLine is a Java library for handling console input. It is
14663similar in functionality to BSD editline and GNU readline but with additional
14664features that bring it in par with ZSH line editor. People familiar with the
14665readline/editline capabilities for modern shells (such as bash and tcsh) will
14666find most of the command editing features of JLine to be familiar.
14667
14668This package includes the @var{Terminal} API and implementations.")
14669 (license license:bsd-3)))
14670
14671(define-public java-jline-reader
14672 (package
14673 (name "java-jline-reader")
14674 (version "3.14.1")
14675 (source (origin
14676 (method git-fetch)
14677 (uri (git-reference
14678 (url "https://github.com/jline/jline3")
14679 (commit (string-append "jline-parent-" version))))
14680 (file-name (git-file-name name version))
14681 (sha256
14682 (base32
14683 "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr"))))
14684 (build-system ant-build-system)
14685 (arguments
14686 `(#:jar-name "jline-reader.jar"
14687 #:jdk ,openjdk11
14688 #:source-dir "reader/src/main/java"
14689 #:test-dir "reader/src/test"
14690 #:phases
14691 (modify-phases %standard-phases
14692 (add-before 'build 'remove-build-file
14693 (lambda _
14694 ;; conflicts with build directory generated by ant-build-system
14695 (delete-file "build"))))))
14696 (native-inputs
14697 (list java-junit java-easymock))
14698 (inputs
14699 (list java-jline-terminal))
14700 (home-page "https://github.com/jline/jline3")
14701 (synopsis "Java JLine line reader")
14702 (description "JLine is a Java library for handling console input. It is
14703similar in functionality to BSD editline and GNU readline but with additional
14704features that bring it in par with ZSH line editor. People familiar with the
14705readline/editline capabilities for modern shells (such as bash and tcsh) will
14706find most of the command editing features of JLine to be familiar.
14707
14708This package includes the line reader.")
14709 (license license:bsd-3)))
14710
14711(define-public java-xmlunit
14712 (package
14713 (name "java-xmlunit")
14714 (version "2.5.1")
14715 (source (origin
14716 (method url-fetch)
14717 (uri (string-append "https://github.com/xmlunit/xmlunit/archive/v"
14718 version ".tar.gz"))
14719 (file-name (string-append name "-" version ".tar.gz"))
14720 (sha256
14721 (base32
14722 "035rivlnmwhfqj0fzviciv0bkh1h95ps1iwnh2kjcvdbk5nccm4z"))))
14723 (build-system ant-build-system)
14724 (arguments
14725 `(#:jar-name "java-xmlunit.jar"
14726 #:source-dir "xmlunit-core/src/main/java"
14727 #:test-dir "xmlunit-core/src/test"
14728 #:phases
14729 (modify-phases %standard-phases
14730 (add-before 'check 'copy-test-resources
14731 (lambda* (#:key inputs #:allow-other-keys)
14732 (copy-recursively (assoc-ref inputs "resources") "../test-resources")
14733 #t)))))
14734 (native-inputs
14735 `(("java-junit" ,java-junit)
14736 ("java-mockito-1" ,java-mockito-1)
14737 ("java-hamcrest-all" ,java-hamcrest-all)
14738 ("java-objenesis" ,java-objenesis)
14739 ("java-cglib" ,java-cglib)
14740 ("resources"
14741 ,(origin
14742 (method git-fetch)
14743 (uri (git-reference
14744 (url "https://github.com/xmlunit/test-resources")
14745 (commit "a590d2ae865c3e0455691d76ba8eefccc2215aec")))
14746 (file-name "java-xmlunit-test-resources")
14747 (sha256
14748 (base32
14749 "0r0glj37pg5l868yjz78gckr91cs8fysxxbp9p328dssssi91agr"))))))
14750 (home-page "https://www.xmlunit.org/")
14751 (synopsis "XML output testing")
14752 (description "XMLUnit provides you with the tools to verify the XML you
14753emit is the one you want to create. It provides helpers to validate against
14754an XML Schema, assert the values of XPath queries or compare XML documents
14755against expected outcomes.")
14756 (license license:asl2.0)))
14757
14758(define-public java-xmlunit-legacy
14759 (package
14760 (inherit java-xmlunit)
14761 (name "java-xmlunit-legacy")
14762 (arguments
14763 `(#:jar-name "java-xmlunit-legacy.jar"
14764 #:source-dir "xmlunit-legacy/src/main/java"
14765 #:test-dir "xmlunit-legacy/src/test"))
14766 (inputs
14767 (list java-xmlunit java-junit))
14768 (native-inputs
14769 `(("java-mockito-1" ,java-mockito-1)))))
14770
14771(define-public java-xmlunit-matchers
14772 (package
14773 (inherit java-xmlunit)
14774 (name "java-xmlunit-matchers")
14775 (arguments
14776 `(#:jar-name "java-xmlunit-matchers.jar"
14777 #:source-dir "xmlunit-matchers/src/main/java"
14778 #:test-dir "xmlunit-matchers/src/test"
14779 #:test-exclude
14780 ;; Cannot open xsd for http://www.xmlunit.org/test-support/Book.xsd
14781 (list "**/ValidationMatcherTest.java")
14782 #:phases
14783 (modify-phases %standard-phases
14784 (add-before 'build 'copy-test-class
14785 (lambda _
14786 (copy-file "xmlunit-core/src/test/java/org/xmlunit/TestResources.java"
14787 "xmlunit-matchers/src/test/java/org/xmlunit/TestResources.java")
14788 #t))
14789 (add-before 'build 'fix-test-resources-path
14790 (lambda _
14791 (substitute* (find-files "xmlunit-matchers/src/test" ".*.java")
14792 (("../test-resources") "test-resources"))
14793 #t))
14794 (add-before 'check 'copy-test-resources
14795 (lambda* (#:key inputs #:allow-other-keys)
14796 (copy-recursively (assoc-ref inputs "resources") "test-resources")
14797 #t)))))
14798 (inputs
14799 (list java-xmlunit java-junit))))
14800
14801(define-public java-openchart2
14802 (package
14803 (name "java-openchart2")
14804 (version "1.4.3")
14805 (source (origin
14806 (method url-fetch)
14807 (uri (string-append "http://download.approximatrix.com/openchart2/"
14808 "openchart2-" version ".source.zip"))
14809 (sha256
14810 (base32
14811 "1xq96zm5r02n1blja0072jmmsifmxc40lbyfbnmcnr6mw42frh4g"))))
14812 (build-system ant-build-system)
14813 (arguments
14814 `(#:test-target "test"
14815 #:phases
14816 (modify-phases %standard-phases
14817 (add-after 'unpack 'fix-junit-errors
14818 (lambda _
14819 (with-directory-excursion "unittest/src/com/approximatrix/charting/"
14820 (substitute* '("coordsystem/ticklocator/NumericXTickLocatorTest.java"
14821 "coordsystem/ticklocator/NumericYTickLocatorTest.java"
14822 "coordsystem/ticklocator/ObjectXTickLocatorTest.java"
14823 "model/DefaultChartDataModelConstraintsTest.java"
14824 "model/MultiScatterDataModelConstraintsTest.java"
14825 "model/threedimensional/DotPlotDataModelConstraintsTest.java")
14826 (("(assertEquals[^;]+);" before _)
14827 (string-append (string-drop-right before 2) ", 1E-6);"))))
14828 #t))
14829 (replace 'install (install-jars ".")))))
14830 (native-inputs
14831 (list unzip java-junit java-hamcrest-core))
14832 (home-page "https://approximatrix.com/products/openchart2/")
14833 (synopsis "Simple plotting for Java")
14834 (description "Openchart2 provides a simple, yet powerful, interface for
14835Java programmers to create two-dimensional charts and plots. The library
14836features an assortment of graph styles, including advanced scatter plots, bar
14837graphs, and pie charts.")
14838 (license license:lgpl2.1+)))
14839
14840(define-public java-commons-httpclient
14841 (package
14842 (name "java-commons-httpclient")
14843 (version "3.1")
14844 (source (origin
14845 (method url-fetch)
14846 (uri (string-append "mirror://apache/httpcomponents/"
14847 "commons-httpclient/source/commons-httpclient-"
14848 version "-src.tar.gz"))
14849 (sha256
14850 (base32
14851 "1wlpn3cfy3d4inxy6g7wxcsa8p7sshn6aldk9y4ia3lb879rd97r"))))
14852 (build-system ant-build-system)
14853 (arguments
14854 `(#:build-target "compile"
14855 #:test-target "test"
14856 #:tests? #f; requires junit-textui (junit 3)
14857 #:phases
14858 (modify-phases %standard-phases
14859 (add-before 'build 'fix-accent
14860 (lambda _
14861 (for-each (lambda (file)
14862 (with-fluids ((%default-port-encoding "ISO-8859-1"))
14863 (substitute* file
14864 (("\\* @author Ortwin .*") "* @author Ortwin Glueck\n"))))
14865 '("src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java"
14866 "src/examples/TrivialApp.java" "src/examples/ClientApp.java"
14867 "src/test/org/apache/commons/httpclient/TestHttps.java"
14868 "src/test/org/apache/commons/httpclient/TestURIUtil2.java"))
14869 #t))
14870 (replace 'install
14871 (lambda* (#:key outputs #:allow-other-keys)
14872 (invoke "ant" "dist"
14873 (string-append "-Ddist.home=" (assoc-ref outputs "out")
14874 "/share/java"))
14875 #t)))))
14876 (propagated-inputs
14877 `(("java-commons-logging" ,java-commons-logging-minimal)
14878 ("java-commons-codec" ,java-commons-codec)))
14879 (home-page "https://hc.apache.org")
14880 (synopsis "HTTP/1.1 compliant HTTP agent implementation")
14881 (description "This package contains an HTTP/1.1 compliant HTTP agent
14882implementation. It also provides reusable components for client-side
14883authentication, HTTP state management, and HTTP connection management.")
14884 (license license:asl2.0)))
14885
14886(define-public java-commons-vfs
14887 (package
14888 (name "java-commons-vfs")
14889 (version "2.2")
14890 (source (origin
14891 (method url-fetch)
14892 (uri (string-append "mirror://apache/commons/vfs/source/"
14893 "commons-vfs2-distribution-" version "-src.tar.gz"))
14894 (file-name (string-append name "-" version ".tar.gz"))
14895 (sha256
14896 (base32
14897 "1cnq1iaghbp4cslpnvwbp83i5v234x87irssqynhwpfgw7caf1s3"))
14898 (modules '((guix build utils)))
14899 (snippet
14900 '(begin
14901 (for-each delete-file
14902 (find-files "." "\\.jar$"))
14903 #t))))
14904 (build-system ant-build-system)
14905 (arguments
14906 `(#:jar-name "commons-vfs.jar"
14907 #:source-dir "commons-vfs2/src/main/java"
14908 #:test-dir "commons-vfs2/src/test"
14909 ; FIXME: tests depend on many things: apache sshd, hadoop, ftpserver, ...
14910 #:tests? #f
14911 #:phases
14912 (modify-phases %standard-phases
14913 (add-before 'build 'remove-hadoop-and-webdav
14914 ; Remove these files as they are not required and depend on difficult
14915 ; packages.
14916 (lambda _
14917 (for-each delete-file-recursively
14918 '("commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/webdav"
14919 "commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs"))
14920 #t)))))
14921 (inputs
14922 (list java-commons-collections4
14923 java-commons-compress
14924 java-commons-httpclient
14925 java-commons-logging-minimal
14926 java-commons-net
14927 java-jsch))
14928 (home-page "https://commons.apache.org/proper/commons-vfs/")
14929 (synopsis "Java file system library")
14930 (description "Commons VFS provides a single API for accessing various
14931different file systems. It presents a uniform view of the files from various
14932different sources, such as the files on local disk, on an HTTP server, or
14933inside a Zip archive.")
14934 (license license:asl2.0)))
14935
14936(define-public java-jakarta-oro
14937 (package
14938 (name "java-jakarta-oro")
14939 (version "2.0.8")
14940 (source (origin
14941 (method url-fetch)
14942 (uri (string-append "mirror://apache/jakarta/oro/"
14943 "jakarta-oro-" version ".tar.gz"))
14944 (sha256
14945 (base32
14946 "0rpmnsskiwmsy8r0sckz5n5dbvh3vkxx8hpm177c754r8xy3qksc"))
14947 (modules '((guix build utils)))
14948 (snippet
14949 `(begin
14950 (delete-file (string-append "jakarta-oro-" ,version ".jar"))
14951 #t))))
14952 (build-system ant-build-system)
14953 (arguments
14954 `(#:build-target "package"
14955 #:make-flags (list "-DDATE" "(no recorded date for reproducibility)")
14956 #:tests? #f; tests are run as part of the build process
14957 #:phases
14958 (modify-phases %standard-phases
14959 (replace 'install
14960 (install-jars ,(string-append "jakarta-oro-" version))))))
14961 (home-page "https://jakarta.apache.org/oro/")
14962 (synopsis "Text-processing for Java")
14963 (description "The Jakarta-ORO Java classes are a set of text-processing
14964Java classes that provide Perl5 compatible regular expressions, AWK-like
14965regular expressions, glob expressions, and utility classes for performing
14966substitutions, splits, filtering filenames, etc. This library is the successor
14967of the OROMatcher, AwkTools, PerlTools, and TextTools libraries originally
14968from ORO, Inc.")
14969 (license license:asl1.1)))
14970
14971(define-public java-native-access
14972 (package
14973 (name "java-native-access")
14974 (version "4.5.1")
14975 (source (origin
14976 (method url-fetch)
14977 (uri (string-append "https://github.com/java-native-access/jna/"
14978 "archive/" version ".tar.gz"))
14979 (file-name (string-append name "-" version ".tar.gz"))
14980 (sha256
14981 (base32
14982 "0zrpzkib6b905i018a9pqlzkqinphywr6y4jwv6mwp63jjqvqkd9"))
14983 (modules '((guix build utils)))
14984 (snippet
14985 `(begin
14986 (for-each delete-file (find-files "." ".*.jar"))
14987 (delete-file-recursively "native/libffi")
14988 (delete-file-recursively "dist")
14989 #t))))
14990 (build-system ant-build-system)
14991 (arguments
14992 `(#:tests? #f; FIXME: tests require reflections.jar
14993 #:test-target "test"
14994 #:make-flags (list "-Ddynlink.native=true")
14995 #:phases
14996 (modify-phases %standard-phases
14997 (add-before 'build 'fix-build.xml
14998 (lambda* (#:key inputs #:allow-other-keys)
14999 (substitute* "build.xml"
15000 ;; Since we removed the bundled ant.jar, give the correct path
15001 (("lib/ant.jar") (search-input-file inputs "/lib/ant.jar"))
15002 ;; We removed generated native libraries. We can only rebuild one
15003 ;; so don't fail if we can't find a native library for another architecture.
15004 (("zipfileset") "zipfileset erroronmissingarchive=\"false\""))
15005 ;; Copy test dependencies
15006 (copy-file (car (find-files (assoc-ref inputs "java-junit") "jar$"))
15007 "lib/junit.jar")
15008 (copy-file (car (find-files (assoc-ref inputs "java-hamcrest-core")
15009 "jar$"))
15010 "lib/hamcrest-core.jar")
15011 ;; FIXME: once reflections.jar is built, copy it to lib/test.
15012 #t))
15013 (add-before 'build 'build-native
15014 (lambda _
15015 (invoke "ant" "-Ddynlink.native=true" "native")
15016 #t))
15017 (replace 'install
15018 (install-jars "build")))))
15019 (inputs
15020 (list libffi libx11 libxt))
15021 (native-inputs
15022 (list gcc-7 java-junit java-hamcrest-core))
15023 (home-page "https://github.com/java-native-access/jna")
15024 (synopsis "Access to native shared libraries from Java")
15025 (description "JNA provides Java programs easy access to native shared
15026libraries without writing anything but Java code - no JNI or native code is
15027required. JNA allows you to call directly into native functions using natural
15028Java method invocation.")
15029 ;; Java Native Access project (JNA) is dual-licensed under 2
15030 ;; alternative Free licenses: LGPL 2.1 or later and Apache License 2.0.
15031 (license (list
15032 license:asl2.0
15033 license:lgpl2.1+))))
15034
15035(define-public java-native-access-5.14.0
15036 (package
15037 (inherit java-native-access)
15038 (name "java-native-access")
15039 (version "5.14.0")
15040 (source
15041 (origin
15042 (method git-fetch)
15043 (uri (git-reference
15044 (url "https://github.com/java-native-access/jna.git")
15045 (commit version)))
15046 (file-name (git-file-name name version))
15047 (sha256
15048 (base32 "0blf6ka69c3zywa74fjh8gykhzn3vgbvlxzy3v9znncb2a97v6bb"))
15049 (modules '((guix build utils)))
15050 (snippet
15051 `(begin
15052 (for-each delete-file (find-files "." ".*.jar"))
15053 (delete-file-recursively "native/libffi")
15054 (delete-file-recursively "dist")))))
15055 (arguments
15056 `(#:tests? #f
15057 #:test-target "test"
15058 #:make-flags (list "-Ddynlink.native=true")
15059 #:phases
15060 (modify-phases %standard-phases
15061 (add-before 'build 'fix-build.xml
15062 (lambda* (#:key inputs #:allow-other-keys)
15063 (let ((ant-jar (search-input-file inputs "/lib/ant.jar"))
15064 (asm-jar (search-input-file inputs "/share/java/asm9.jar")))
15065 (substitute* "build.xml"
15066 (("lib/ant\\.jar") ant-jar)
15067 (("\\$lib/asm-8\\.0\\.1\\.jar") asm-jar)
15068 (("lib/asm-8\\.0\\.1\\.jar") asm-jar)
15069 (("<zipfileset") "<zipfileset erroronmissingarchive=\"false\""))
15070 (substitute* "build-ant-tools.xml"
15071 (("lib/ant\\.jar") ant-jar)
15072 (("lib/asm-8\\.0\\.1\\.jar") asm-jar)))
15073 (copy-file (car (find-files (assoc-ref inputs "java-junit") "jar$"))
15074 "lib/junit.jar")
15075 (copy-file (car (find-files (assoc-ref inputs "java-hamcrest-core")
15076 "jar$"))
15077 "lib/hamcrest-core.jar")))
15078 (add-before 'build 'build-native
15079 (lambda _
15080 (invoke "ant" "-Ddynlink.native=true" "native")))
15081 (add-before 'install 'create-pom
15082 (generate-pom.xml "pom.xml" "net.java.dev.jna"
15083 "jna-jpms" ,version))
15084 (add-before 'install 'keep-only-jna-jpms
15085 (lambda _
15086 ;; The build produces multiple jars. install-from-pom
15087 ;; expects exactly one. Remove all except jna-jpms.jar.
15088 (for-each delete-file
15089 (filter (lambda (f)
15090 (not (string-contains f "jna-jpms")))
15091 (find-files "build" "\\.jar$")))
15092 (for-each delete-file
15093 (find-files "lib" "\\.jar$"))))
15094 (replace 'install
15095 (install-from-pom "pom.xml")))))
15096 (native-inputs
15097 (modify-inputs (package-native-inputs java-native-access)
15098 (prepend java-asm-9)))))
15099
15100(define-public java-native-access-platform
15101 (package
15102 (inherit java-native-access)
15103 (name "java-native-access-platform")
15104 (arguments
15105 `(#:test-target "test"
15106 #:tests? #f; require jna-test.jar
15107 #:phases
15108 (modify-phases %standard-phases
15109 (add-before 'build 'chdir
15110 (lambda _
15111 (chdir "contrib/platform")
15112 #t))
15113 (add-after 'chdir 'fix-ant
15114 (lambda* (#:key inputs #:allow-other-keys)
15115 (substitute* "nbproject/project.properties"
15116 (("../../build/jna.jar")
15117 (search-input-file inputs "/share/java/jna.jar"))
15118 (("../../lib/hamcrest-core-.*.jar")
15119 (car (find-files (assoc-ref inputs "java-hamcrest-core")
15120 "jar$")))
15121 (("../../lib/junit.jar")
15122 (car (find-files (assoc-ref inputs "java-junit")
15123 "jar$"))))
15124 #t))
15125 (replace 'install
15126 (install-jars "dist")))))
15127 (inputs
15128 (list java-native-access))
15129 (synopsis "Cross-platform mappings for jna")
15130 (description "java-native-access-platform has cross-platform mappings
15131and mappings for a number of commonly used platform functions, including a
15132large number of Win32 mappings as well as a set of utility classes that
15133simplify native access.")))
15134
15135(define-public java-native-access-platform-5.14.0
15136 (package
15137 (inherit java-native-access-platform)
15138 (name "java-native-access-platform")
15139 (version (package-version java-native-access-5.14.0))
15140 (source (package-source java-native-access-5.14.0))
15141 (arguments
15142 `(#:build-target "jar"
15143 #:tests? #f
15144 #:modules ((guix build ant-build-system)
15145 (guix build utils)
15146 (guix build java-utils)
15147 (sxml simple))
15148 #:phases
15149 (modify-phases %standard-phases
15150 (add-before 'build 'chdir
15151 (lambda _
15152 (chdir "contrib/platform")
15153 #t))
15154 (add-after 'chdir 'fix-ant
15155 (lambda* (#:key inputs #:allow-other-keys)
15156 (let ((jna-jar (car (find-files (assoc-ref inputs "java-native-access")
15157 "jna-jpms.*\\.jar$")))
15158 (asm-jar (search-input-file inputs "/share/java/asm9.jar"))
15159 (ant-jar (search-input-file inputs "/lib/ant.jar")))
15160 (mkdir-p "../../build")
15161 (mkdir-p "../../lib")
15162 (copy-file jna-jar "../../build/jna.jar")
15163 (copy-file asm-jar "../../lib/asm-8.0.1.jar")
15164 (copy-file ant-jar "../../lib/ant.jar")
15165 (substitute* "build.xml"
15166 (("../../build/jna\\.jar") jna-jar)
15167 (("../../lib/asm-8\\.0\\.1\\.jar") asm-jar))
15168 (substitute* "../../build-ant-tools.xml"
15169 (("lib/ant\\.jar") ant-jar)
15170 (("lib/asm-8\\.0\\.1\\.jar") asm-jar))
15171 #t)))
15172 (add-before 'install 'create-pom
15173 (lambda _
15174 (call-with-output-file "pom.xml"
15175 (lambda (port)
15176 (sxml->xml
15177 `(*TOP*
15178 (*PI* xml "version=\"1.0\" encoding=\"UTF-8\"")
15179 (project
15180 (modelVersion "4.0.0")
15181 (groupId "net.java.dev.jna")
15182 (artifactId "jna-platform-jpms")
15183 (version ,,version)
15184 (dependencies
15185 (dependency
15186 (groupId "net.java.dev.jna")
15187 (artifactId "jna-jpms")
15188 (version ,,version)))))
15189 port)))))
15190 (add-before 'install 'keep-only-jna-platform-jpms
15191 (lambda _
15192 (for-each delete-file
15193 (filter (lambda (f)
15194 (not (string-contains f "jna-platform-jpms")))
15195 (append (find-files "build" "\\.jar$")
15196 (find-files "dist" "\\.jar$"))))))
15197 (replace 'install
15198 (install-from-pom "pom.xml")))))
15199 (native-inputs
15200 (modify-inputs (package-native-inputs java-native-access-platform)
15201 (prepend java-asm-9)))
15202 (inputs
15203 (list java-native-access-5.14.0))))
15204
15205(define-public java-jsch-agentproxy-core
15206 (package
15207 (name "java-jsch-agentproxy-core")
15208 (version "0.0.8")
15209 (source (origin
15210 (method url-fetch)
15211 (uri (string-append "https://github.com/ymnk/jsch-agent-proxy/archive/"
15212 version ".tar.gz"))
15213 (file-name (string-append name "-" version ".tar.gz"))
15214 (sha256
15215 (base32
15216 "02iqg6jbc1kxvfzqcg6wy9ygqxfm82bw5rf6vnswqy4y572niz4q"))))
15217 (build-system ant-build-system)
15218 (arguments
15219 `(#:jar-name "jsch-agentproxy-core.jar"
15220 #:source-dir "jsch-agent-proxy-core/src/main/java"
15221 #:tests? #f)); no tests
15222 (home-page "https://github.com/ymnk/jsch-agent-proxy")
15223 (synopsis "Core component of the proxy to ssh-agent and Pageant in Java")
15224 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15225and Pageant included Putty. It will be easily integrated into JSch, and users
15226will be allowed to use these programs for authentication.")
15227 (license license:bsd-3)))
15228
15229(define-public java-jsch-agentproxy-sshagent
15230 (package
15231 (inherit java-jsch-agentproxy-core)
15232 (name "java-jsch-agentproxy-sshagent")
15233 (arguments
15234 `(#:jar-name "jsch-agentproxy-sshagent.jar"
15235 #:source-dir "jsch-agent-proxy-sshagent/src/main/java"
15236 #:tests? #f)); no tests
15237 (inputs
15238 (list java-jsch-agentproxy-core))
15239 (synopsis "Proxy to ssh-agent")
15240 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15241and Pageant included in Putty. This component contains the code for a proxy to
15242ssh-agent.")))
15243
15244(define-public java-jsch-agentproxy-usocket-jna
15245 (package
15246 (inherit java-jsch-agentproxy-core)
15247 (name "java-jsch-agentproxy-usocket-jna")
15248 (arguments
15249 `(#:jar-name "jsch-agentproxy-usocket-jna.jar"
15250 #:source-dir "jsch-agent-proxy-usocket-jna/src/main/java"
15251 #:tests? #f)); no tests
15252 (inputs
15253 (list java-jsch-agentproxy-core java-native-access))
15254 (synopsis "USocketFactory implementation using JNA")
15255 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15256and Pageant included in Putty. This component contains an implementation of
15257USocketFactory using @dfn{JNA} (Java Native Access).")))
15258
15259(define-public java-jsch-agentproxy-pageant
15260 (package
15261 (inherit java-jsch-agentproxy-core)
15262 (name "java-jsch-agentproxy-pageant")
15263 (arguments
15264 `(#:jar-name "jsch-agentproxy-pageant.jar"
15265 #:source-dir "jsch-agent-proxy-pageant/src/main/java"
15266 #:tests? #f)); no tests
15267 (inputs
15268 (list java-jsch-agentproxy-core java-native-access
15269 java-native-access-platform))
15270 (synopsis "Proxy to pageant")
15271 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15272and Pageant included in Putty. This component contains the code for a proxy to
15273pageant.")))
15274
15275(define-public java-jsch-agentproxy-usocket-nc
15276 (package
15277 (inherit java-jsch-agentproxy-core)
15278 (name "java-jsch-agentproxy-usocket-nc")
15279 (arguments
15280 `(#:jar-name "jsch-agentproxy-usocket-nc.jar"
15281 #:source-dir "jsch-agent-proxy-usocket-nc/src/main/java"
15282 #:tests? #f)); no tests
15283 (inputs
15284 (list java-jsch-agentproxy-core))
15285 (synopsis "USocketFactory implementation using netcat")
15286 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15287and Pageant included in Putty. This component contains an implementation of
15288USocketFactory using netcat.")))
15289
15290(define-public java-jsch-agentproxy-connector-factory
15291 (package
15292 (inherit java-jsch-agentproxy-core)
15293 (name "java-jsch-agentproxy-connector-factory")
15294 (arguments
15295 `(#:jar-name "jsch-agentproxy-connector-factory.jar"
15296 #:source-dir "jsch-agent-proxy-connector-factory/src/main/java"
15297 #:tests? #f)); no tests
15298 (inputs
15299 (list java-jsch-agentproxy-core java-jsch-agentproxy-sshagent
15300 java-jsch-agentproxy-usocket-jna java-jsch-agentproxy-pageant
15301 java-jsch-agentproxy-usocket-nc))
15302 (synopsis "Connector factory for jsch agent proxy")
15303 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15304and Pageant included in Putty. This component contains a connector factory.")))
15305
15306(define-public java-jsch-agentproxy-jsch
15307 (package
15308 (inherit java-jsch-agentproxy-core)
15309 (name "java-jsch-agentproxy-jsch")
15310 (arguments
15311 `(#:jar-name "jsch-agentproxy-jsch.jar"
15312 #:source-dir "jsch-agent-proxy-jsch/src/main/java"
15313 #:tests? #f)); no tests
15314 (inputs
15315 (list java-jsch java-jsch-agentproxy-core))
15316 (synopsis "JSch integration library for agentproxy")
15317 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15318and Pageant included in Putty. This component contains a library to use
15319jsch-agent-proxy with JSch.")))
15320
15321(define-public java-apache-ivy
15322 (package
15323 (name "java-apache-ivy")
15324 (version "2.4.0")
15325 (source (origin
15326 (method url-fetch)
15327 (uri (string-append "mirror://apache/ant/ivy/" version
15328 "/apache-ivy-" version "-src.tar.gz"))
15329 (sha256
15330 (base32
15331 "1xkfn57g2m7l6y0xdq75x5rnrgk52m9jx2xah70g3ggl8750hbr0"))
15332 (patches
15333 (search-patches
15334 "java-apache-ivy-port-to-latest-bouncycastle.patch"))))
15335 (build-system ant-build-system)
15336 (arguments
15337 `(#:jar-name "ivy.jar"
15338 #:tests? #f
15339 #:phases
15340 (modify-phases %standard-phases
15341 (add-before 'build 'remove-example
15342 (lambda _
15343 (delete-file-recursively "src/example")
15344 #t))
15345 (add-before 'build 'copy-resources
15346 (lambda _
15347 (with-directory-excursion "src/java"
15348 (for-each (lambda (file)
15349 (install-file file (string-append "../../build/classes/" (dirname file))))
15350 (append
15351 (find-files "." ".*.css")
15352 (find-files "." ".*.ent")
15353 (find-files "." ".*.html")
15354 (find-files "." ".*.properties")
15355 (find-files "." ".*.xsd")
15356 (find-files "." ".*.xsl")
15357 (find-files "." ".*.xml"))))
15358 #t))
15359 (add-before 'build 'fix-vfs
15360 (lambda _
15361 (substitute*
15362 '("src/java/org/apache/ivy/plugins/repository/vfs/VfsRepository.java"
15363 "src/java/org/apache/ivy/plugins/repository/vfs/VfsResource.java")
15364 (("import org.apache.commons.vfs") "import org.apache.commons.vfs2"))
15365 #t))
15366 (add-before 'install 'copy-manifest
15367 (lambda _
15368 (install-file "META-INF/MANIFEST.MF" "build/classes/META-INF")
15369 #t))
15370 (add-before 'install 'repack
15371 (lambda _
15372 (invoke "jar" "-cmf" "build/classes/META-INF/MANIFEST.MF" "build/jar/ivy.jar"
15373 "-C" "build/classes" ".")))
15374 (add-after 'install 'install-bin
15375 (lambda* (#:key outputs #:allow-other-keys)
15376 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
15377 (ivy (string-append bin "/ivy"))
15378 (jar (string-append (assoc-ref outputs "out") "/share/java/ivy.jar")))
15379 (mkdir-p bin)
15380 (with-output-to-file ivy
15381 (lambda _
15382 (display (string-append
15383 "#!" (which "sh") "\n"
15384 "if [[ -z $CLASSPATH ]]; then\n"
15385 " cp=\"" (getenv "CLASSPATH") ":" jar "\"\n"
15386 "else\n"
15387 " cp=\"" (getenv "CLASSPATH") ":" jar ":$CLASSPATH\"\n"
15388 "fi\n"
15389 (which "java") " -cp $cp org.apache.ivy.Main $@\n"))))
15390 (chmod ivy #o755)
15391 #t))))))
15392 (inputs
15393 (list java-bouncycastle
15394 java-commons-cli
15395 java-commons-collections
15396 java-commons-httpclient
15397 java-commons-lang
15398 java-commons-vfs
15399 java-jakarta-oro
15400 java-jsch
15401 java-jsch-agentproxy-core
15402 java-jsch-agentproxy-connector-factory
15403 java-jsch-agentproxy-jsch
15404 java-junit))
15405 (home-page "https://ant.apache.org/ivy")
15406 (synopsis "Dependency manager for the Java programming language")
15407 (description "Ivy is a tool for managing (recording, tracking, resolving
15408and reporting) project dependencies. It is characterized by the following:
15409
15410@itemize
15411@item flexibility and configurability - Ivy is essentially process agnostic
15412 and is not tied to any methodology or structure. Instead it provides the
15413 necessary flexibility and configurability to be adapted to a broad range
15414 of dependency management and build processes.
15415@item tight integration with Apache Ant - while available as a standalone tool,
15416 Ivy works particularly well with Apache Ant providing a number of
15417 powerful Ant tasks ranging from dependency resolution to dependency
15418 reporting and publication.
15419@end itemize")
15420 (license license:asl2.0)))
15421
15422(define-public java-eclipse-sisu-inject
15423 (package
15424 (name "java-eclipse-sisu-inject")
15425 (version "0.3.5")
15426 (source (origin
15427 (method git-fetch)
15428 (uri (git-reference
15429 (url "https://github.com/eclipse/sisu.inject/")
15430 (commit (string-append "releases/" version))))
15431 (file-name (git-file-name name version))
15432 (sha256
15433 (base32
15434 "1yh434b8pi8cwmpk825fbvbnkkk2cwd4gxxjaygg8i9j0q3l9zp3"))))
15435 (build-system ant-build-system)
15436 (arguments
15437 `(#:jar-name "eclipse-sisu-inject.jar"
15438 #:source-dir "org.eclipse.sisu.inject/src"
15439 #:tests? #f; no tests
15440 #:phases
15441 (modify-phases %standard-phases
15442 (replace 'install
15443 (install-from-pom "org.eclipse.sisu.inject/pom.xml")))))
15444 (propagated-inputs
15445 (list java-guice java-sisu-inject-parent-pom))
15446 (inputs
15447 (list java-guice-servlet
15448 java-javax-inject
15449 java-javaee-servletapi
15450 java-junit
15451 java-slf4j-api
15452 java-jsr305
15453 java-jsr250
15454 java-cdi-api
15455 java-osgi-framework
15456 java-osgi-util-tracker
15457 java-testng))
15458 (home-page "https://www.eclipse.org/sisu/")
15459 (synopsis "Classpath scanning, auto-binding, and dynamic auto-wiring")
15460 (description "Sisu is a modular JSR330-based container that supports
15461classpath scanning, auto-binding, and dynamic auto-wiring. Sisu uses
15462Google-Guice to perform dependency injection and provide the core JSR330
15463support, but removes the need to write explicit bindings in Guice modules.
15464Integration with other containers via the Eclipse Extension Registry and the
15465OSGi Service Registry is a goal of this project.")
15466 (license license:epl1.0)))
15467
15468(define java-sisu-inject-parent-pom
15469 (package
15470 (inherit java-eclipse-sisu-inject)
15471 (name "java-sisu-inject-parent-pom")
15472 (arguments
15473 `(#:tests? #f
15474 #:phases
15475 (modify-phases %standard-phases
15476 (delete 'configure)
15477 (delete 'build)
15478 (replace 'install
15479 (install-pom-file "pom.xml")))))
15480 (propagated-inputs '())))
15481
15482(define-public java-eclipse-sisu-plexus
15483 (package
15484 (name "java-eclipse-sisu-plexus")
15485 (version "0.3.5")
15486 (source (origin
15487 (method git-fetch)
15488 (uri (git-reference
15489 (url "https://github.com/eclipse/sisu.plexus")
15490 (commit (string-append "releases/" version))))
15491 (file-name (git-file-name name version))
15492 (sha256
15493 (base32
15494 "0lm5h0dmh41ffcwd32qnk3a87d360am36yq7168ikkyqa8jxkx28"))
15495 (modules '((guix build utils)))
15496 (snippet
15497 '(begin
15498 (for-each delete-file (find-files "." ".*.jar"))
15499 (rename-file "org.eclipse.sisu.plexus.tests/src"
15500 "org.eclipse.sisu.plexus.tests/java")
15501 #t))))
15502 (build-system ant-build-system)
15503 (arguments
15504 `(#:jar-name "eclipse-sisu-plexus.jar"
15505 #:source-dir "org.eclipse.sisu.plexus/src"
15506 #:test-dir "org.eclipse.sisu.plexus.tests"
15507 #:test-exclude
15508 (list
15509 ;; This test fails probably because we can't generate the necessary
15510 ;; meta-inf files.
15511 "**/PlexusLoggingTest.*"
15512 ;; FIXME: This test fails because of some injection error
15513 "**/PlexusRequirementTest.*")
15514 #:jdk ,icedtea-8
15515 #:phases
15516 (modify-phases %standard-phases
15517 (add-before 'build 'copy-resources
15518 (lambda _
15519 (install-file "org.eclipse.sisu.plexus/META-INF/plexus/components.xml"
15520 "build/classes/META-INF/plexus")
15521 #t))
15522 (add-before 'check 'build-test-jar
15523 (lambda _
15524 (with-directory-excursion "org.eclipse.sisu.plexus.tests/resources/component-jar/src/main/"
15525 (mkdir "build")
15526 (with-directory-excursion "java"
15527 (apply invoke "javac" "-cp"
15528 (string-append (getenv "CLASSPATH")
15529 ":../../../../../build/classes")
15530 (find-files "." ".*.java"))
15531 (for-each (lambda (file) (install-file file (string-append "../build/" file)))
15532 (find-files "." ".*.jar")))
15533 (mkdir-p "build/META-INF/plexus")
15534 (copy-file "resources/META-INF/plexus/components.xml"
15535 "build/META-INF/plexus/components.xml")
15536 (with-directory-excursion "build"
15537 (invoke "jar" "cf" "../../../component-jar-0.1.jar" ".")))
15538 (with-directory-excursion "org.eclipse.sisu.plexus.tests/"
15539 (copy-recursively "META-INF" "../build/test-classes/META-INF")
15540 (substitute* "java/org/eclipse/sisu/plexus/DefaultPlexusContainerTest.java"
15541 (("resources/component-jar")
15542 "org.eclipse.sisu.plexus.tests/resources/component-jar")))
15543 #t))
15544 (replace 'install
15545 (install-from-pom "org.eclipse.sisu.plexus/pom.xml")))))
15546 (propagated-inputs
15547 (list java-jsr250
15548 java-plexus-classworlds
15549 java-plexus-utils
15550 java-plexus-component-annotations
15551 java-cdi-api
15552 java-eclipse-sisu-inject
15553 java-sisu-plexus-parent-pom))
15554 (inputs
15555 (list java-osgi-framework
15556 java-slf4j-api
15557 java-javax-inject
15558 java-guice
15559 java-guava
15560 java-aopalliance
15561 java-cglib))
15562 (native-inputs
15563 (list java-junit))
15564 (home-page "https://www.eclipse.org/sisu/")
15565 (synopsis "Plexus support for the sisu container")
15566 (description "Sisu is a modular JSR330-based container that supports
15567classpath scanning, auto-binding, and dynamic auto-wiring. This package
15568adds Plexus support to the Sisu-Inject container.")
15569 (license license:epl1.0)))
15570
15571(define java-sisu-plexus-parent-pom
15572 (package
15573 (inherit java-eclipse-sisu-plexus)
15574 (name "java-sisu-plexus-parent-pom")
15575 (arguments
15576 `(#:tests? #f
15577 #:phases
15578 (modify-phases %standard-phases
15579 (delete 'configure)
15580 (delete 'build)
15581 (replace 'install
15582 (install-pom-file "pom.xml")))))
15583 (propagated-inputs
15584 `(("java-sonatype-oss-parent-pom-9" ,java-sonatype-oss-parent-pom-9)))))
15585
15586(define-public java-commons-compiler
15587 (package
15588 (name "java-commons-compiler")
15589 (version "3.0.8")
15590 (source (origin
15591 (method git-fetch)
15592 (uri (git-reference
15593 (url "https://github.com/janino-compiler/janino")
15594 (commit "91aa95686d1e4ca3b16a984a03a38686572331b2")))
15595 (file-name (string-append name "-" version))
15596 (sha256
15597 (base32
15598 "04hfdl59sgh20qkxzgnibvs8f9hy6n7znxwpk611y5d89977y62r"))
15599 (modules '((guix build utils)))
15600 (snippet
15601 '(begin
15602 (for-each delete-file
15603 (find-files "." "\\.jar$"))
15604 #t))))
15605 (build-system ant-build-system)
15606 (arguments
15607 `(#:jar-name "commons-compiler.jar"
15608 #:source-dir "commons-compiler/src/main"
15609 #:tests? #f)); no tests
15610 (home-page "https://github.com/janino-compiler/janino")
15611 (synopsis "Java compiler")
15612 (description "Commons-compiler contains an API for janino, including the
15613@code{IExpressionEvaluator}, @code{IScriptEvaluator}, @code{IClassBodyEvaluator}
15614and @code{ISimpleCompiler} interfaces.")
15615 (license license:bsd-3)))
15616
15617(define-public java-janino
15618 (package
15619 (inherit java-commons-compiler)
15620 (name "java-janino")
15621 (arguments
15622 `(#:jar-name "janino.jar"
15623 #:source-dir "src/main/java"
15624 #:phases
15625 (modify-phases %standard-phases
15626 (add-before 'configure 'chdir
15627 (lambda _
15628 (chdir "janino")
15629 #t)))))
15630 (inputs
15631 (list java-commons-compiler))
15632 (native-inputs
15633 (list java-junit java-hamcrest-core))
15634 (description "Janino is a Java compiler. Janino can compile a set of
15635source files to a set of class files like @code{javac}, but also compile a
15636Java expression, block, class body or source file in memory, load the bytecode
15637and execute it directly in the same JVM. @code{janino} can also be used for
15638static code analysis or code manipulation.")))
15639
15640(define-public java-logback-core
15641 (package
15642 (name "java-logback-core")
15643 (version "1.2.3")
15644 (source (origin
15645 (method git-fetch)
15646 (uri (git-reference
15647 (url "https://github.com/qos-ch/logback/")
15648 (commit (string-append "v_" version))))
15649 (file-name (git-file-name name version))
15650 (sha256
15651 (base32
15652 "055jbfpg3l5qw7pw2snkdag0gjkb4vcxfg9110cqqyc40k2nd17z"))
15653 (modules '((guix build utils)))
15654 (snippet
15655 '(delete-file-recursively "logback-access/lib"))))
15656 (build-system ant-build-system)
15657 (arguments
15658 `(#:jar-name "logback.jar"
15659 #:source-dir "src/main/java"
15660 #:test-dir "src/test"
15661 #:test-exclude
15662 ;; These tests fail with Unable to set MockitoNamingPolicy on cglib generator
15663 ;; which creates FastClasses
15664 (list "**/AllCoreTest.*"
15665 "**/AutoFlushingObjectWriterTest.*"
15666 "**/PackageTest.*"
15667 "**/ResilientOutputStreamTest.*"
15668 ;; And we still don't want to run abstract classes
15669 "**/Abstract*.*")
15670 #:phases
15671 (modify-phases %standard-phases
15672 (add-before 'configure 'chdir
15673 (lambda _ (chdir "logback-core"))))))
15674 (inputs
15675 (list java-javax-mail
15676 java-javaee-servletapi
15677 java-commons-compiler
15678 java-janino))
15679 (native-inputs
15680 (list java-junit
15681 java-hamcrest-core
15682 java-mockito-1
15683 java-cglib
15684 java-objenesis
15685 java-joda-time))
15686 (home-page "https://logback.qos.ch")
15687 (synopsis "Logging for java")
15688 (description "Logback is intended as a successor to the popular log4j project.
15689This module lays the groundwork for the other two modules.")
15690 ;; Either epl1.0 or lgpl2.1
15691 (license (list license:epl1.0
15692 license:lgpl2.1))))
15693
15694(define-public java-logback-classic
15695 (package
15696 (inherit java-logback-core)
15697 (name "java-logback-classic")
15698 (arguments
15699 `(#:jar-name "logback-classic.jar"
15700 #:source-dir "src/main/java"
15701 #:test-dir "src/test"
15702 #:tests? #f; tests require more packages: h2, greenmail, hsql, subethamail, slf4j, log4j, felix
15703 #:jdk ,icedtea-8
15704 #:phases
15705 (modify-phases %standard-phases
15706 (add-before 'configure 'chdir
15707 (lambda _
15708 (chdir "logback-classic")
15709 #t))
15710 (replace 'build
15711 (lambda* (#:key inputs #:allow-other-keys)
15712 (mkdir-p "build/classes")
15713 (setenv "CLASSPATH"
15714 (string-join
15715 (apply append (map (lambda (input)
15716 (find-files (assoc-ref inputs input)
15717 ".*.jar"))
15718 '("java-logback-core" "java-slf4j-api"
15719 "java-commons-compiler" "java-javaee-servletapi"
15720 "groovy")))
15721 ":"))
15722 (apply invoke "groovyc" "-d" "build/classes" "-j"
15723 (find-files "src/main/" ".*\\.(groovy|java)$"))
15724 (invoke "ant" "jar")
15725 #t)))))
15726 (inputs
15727 (modify-inputs inputs
15728 (prepend java-logback-core java-slf4j-api)))
15729 (native-inputs
15730 (list groovy))
15731 (description "Logback is intended as a successor to the popular log4j project.
15732This module can be assimilated to a significantly improved version of log4j.
15733Moreover, @code{logback-classic} natively implements the slf4j API so that you
15734can readily switch back and forth between logback and other logging frameworks
15735such as log4j or @code{java.util.logging} (JUL).")))
15736
15737(define-public java-jgit
15738 (package
15739 (name "java-jgit")
15740 (version "4.7.0.201704051617-r")
15741 (source (origin
15742 (method url-fetch)
15743 (uri (string-append "https://repo1.maven.org/maven2/"
15744 "org/eclipse/jgit/org.eclipse.jgit/"
15745 version "/org.eclipse.jgit-"
15746 version "-sources.jar"))
15747 (sha256
15748 (base32
15749 "13ii4jn02ynzq6i7gsyi21k2i94jpc85wf6bcm31q4cyvzv0mk4k"))))
15750 (build-system ant-build-system)
15751 (arguments
15752 `(#:tests? #f ; There are no tests to run.
15753 #:jar-name "jgit.jar"
15754 ;; JGit must be built with a JDK supporting Java 8.
15755 #:jdk ,icedtea-8
15756 ;; Target our older default JDK.
15757 #:make-flags (list "-Dtarget=1.7")
15758 #:phases
15759 (modify-phases %standard-phases
15760 ;; The jar file generated by the default build.xml does not include
15761 ;; the text properties files, so we need to add them.
15762 (add-after 'build 'add-properties
15763 (lambda* (#:key jar-name #:allow-other-keys)
15764 (with-directory-excursion "src"
15765 (apply invoke "jar" "-uf"
15766 (string-append "../build/jar/" jar-name)
15767 (find-files "." "\\.properties$")))
15768 #t)))))
15769 (inputs
15770 (list java-classpathx-servletapi java-javaewah java-jsch
15771 java-slf4j-api))
15772 (home-page "https://eclipse.org/jgit/")
15773 (synopsis "Java library implementing the Git version control system")
15774 (description "JGit is a lightweight, pure Java library implementing the
15775Git version control system, providing repository access routines, support for
15776network protocols, and core version control algorithms.")
15777 (license license:edl1.0)))
15778
15779;; For axoloti.
15780(define-public java-jgit-4.2
15781 (package (inherit java-jgit)
15782 (version "4.2.0.201601211800-r")
15783 (source (origin
15784 (method url-fetch)
15785 (uri (string-append "https://repo1.maven.org/maven2/"
15786 "org/eclipse/jgit/org.eclipse.jgit/"
15787 version "/org.eclipse.jgit-"
15788 version "-sources.jar"))
15789 (sha256
15790 (base32
15791 "15gm537iivhnzlkjym4x3wn5jqdjdragsw9pdpzqqg21nrc817mm"))))
15792 (build-system ant-build-system)
15793 (arguments
15794 (substitute-keyword-arguments (package-arguments java-jgit)
15795 ((#:phases phases)
15796 `(modify-phases ,phases
15797 (add-after 'unpack 'use-latest-javaewah-API
15798 (lambda _
15799 (substitute* "src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java"
15800 (("wordinbits") "WORD_IN_BITS"))))))))
15801 (inputs
15802 (list java-javaewah java-jsch java-slf4j-api))))
15803
15804(define-public java-jgit-7
15805 (package
15806 (name "java-jgit")
15807 (version "7.0.0.202409031743-r")
15808 (source (origin
15809 (method url-fetch)
15810 (uri (string-append "https://repo1.maven.org/maven2/"
15811 "org/eclipse/jgit/org.eclipse.jgit/"
15812 version "/org.eclipse.jgit-"
15813 version "-sources.jar"))
15814 (sha256
15815 (base32
15816 "0hdl11cbb6zy39zw4jpg0ip00nikilw7dajrqky6d3l18khjby5k"))))
15817 (build-system ant-build-system)
15818 (arguments
15819 `(#:tests? #f ; sources jar has no tests
15820 #:jar-name "jgit.jar"
15821 #:jdk ,openjdk17
15822 #:modules ((guix build ant-build-system)
15823 (guix build utils)
15824 (guix build java-utils)
15825 (srfi srfi-1))
15826 #:phases
15827 (modify-phases %standard-phases
15828 (add-after 'build 'add-properties
15829 (lambda* (#:key jar-name #:allow-other-keys)
15830 (with-directory-excursion "src"
15831 (apply invoke "jar" "-uf"
15832 (string-append "../build/jar/" jar-name)
15833 (find-files "." "\\.properties$")))
15834 (let* ((pkgs (delete-duplicates
15835 (filter-map
15836 (lambda (f)
15837 (let* ((d (dirname f))
15838 (d (if (string-prefix? "./" d)
15839 (substring d 2)
15840 d)))
15841 (and (not (string-null? d))
15842 (not (string=? d "."))
15843 (string-map
15844 (lambda (c)
15845 (if (char=? c #\/) #\. c))
15846 d))))
15847 (with-directory-excursion "build/classes"
15848 (find-files "." "\\.class$")))))
15849 (export-pkg (string-join (sort pkgs string<?) ",")))
15850 ;; Write manifest with continuation lines for long values.
15851 ;; Manifest spec: max 72 bytes per line, continuation
15852 ;; lines start with a single space.
15853 (call-with-output-file "osgi-manifest.mf"
15854 (lambda (port)
15855 (for-each
15856 (lambda (line)
15857 (let loop ((s line))
15858 (if (<= (string-length s) 70)
15859 (begin (display s port) (newline port))
15860 (begin (display (substring s 0 70) port)
15861 (newline port)
15862 (loop (string-append
15863 " " (substring s 70)))))))
15864 (list
15865 "Bundle-ManifestVersion: 2"
15866 "Bundle-SymbolicName: org.eclipse.jgit"
15867 (string-append "Bundle-Version: " ,version)
15868 (string-append "Export-Package: " export-pkg)
15869 (string-append
15870 "Import-Package: com.googlecode.javaewah,"
15871 "javax.crypto,javax.management,javax.net.ssl,"
15872 "org.apache.commons.codec.digest,"
15873 "org.slf4j,org.xml.sax,org.xml.sax.helpers")))
15874 (newline port))))
15875 (invoke "jar" "ufm" (string-append "build/jar/" jar-name)
15876 "osgi-manifest.mf")))
15877 (replace 'install
15878 (install-from-pom
15879 "src/META-INF/maven/org.eclipse.jgit/org.eclipse.jgit/pom.xml")))))
15880 (inputs
15881 (list java-commons-codec java-javaewah-1.2.3 java-slf4j-api))
15882 (home-page "https://eclipse.org/jgit/")
15883 (synopsis "Java library implementing the Git version control system")
15884 (description "JGit is a lightweight, pure Java library implementing the
15885Git version control system, providing repository access routines, support for
15886network protocols, and core version control algorithms.")
15887 (license license:edl1.0)))
15888
15889(define-public java-jgit-ssh-jsch-7
15890 (package
15891 (name "java-jgit-ssh-jsch")
15892 (version "7.0.0.202409031743-r")
15893 (source (origin
15894 (method url-fetch)
15895 (uri (string-append "https://repo1.maven.org/maven2/"
15896 "org/eclipse/jgit/org.eclipse.jgit.ssh.jsch/"
15897 version "/org.eclipse.jgit.ssh.jsch-"
15898 version "-sources.jar"))
15899 (sha256
15900 (base32
15901 "1vb3zkd2iz6bpz2nq8xxi5d5jdb8hy8jq7gka2ck22azm9bb6p94"))))
15902 (build-system ant-build-system)
15903 (arguments
15904 `(#:tests? #f ; sources jar has no tests
15905 #:jar-name "jgit-ssh-jsch.jar"
15906 #:jdk ,openjdk17
15907 #:phases
15908 (modify-phases %standard-phases
15909 (add-after 'build 'add-osgi-manifest
15910 (lambda _
15911 ;; The NetBeans wrapper module has an empty jar target and
15912 ;; relies on Bundle-SymbolicName from the Maven Central jar.
15913 (call-with-output-file "osgi-manifest.mf"
15914 (lambda (port)
15915 (display (string-append
15916 "Bundle-ManifestVersion: 2\n"
15917 "Bundle-SymbolicName: org.eclipse.jgit.ssh.jsch\n"
15918 "Bundle-Version: " ,version "\n"
15919 "Export-Package: org.eclipse.jgit.transport.ssh"
15920 ".jsch\n"
15921 "Import-Package: com.jcraft.jsch,"
15922 "org.eclipse.jgit.errors,"
15923 "org.eclipse.jgit.internal,"
15924 "org.eclipse.jgit.internal.transport.ssh,"
15925 "org.eclipse.jgit.nls,"
15926 "org.eclipse.jgit.transport,"
15927 "org.eclipse.jgit.util,"
15928 "org.eclipse.jgit.util.io,"
15929 "org.slf4j\n")
15930 port)))
15931 (invoke "jar" "ufm" "build/jar/jgit-ssh-jsch.jar"
15932 "osgi-manifest.mf")))
15933 (replace 'install
15934 (install-from-pom
15935 "src/META-INF/maven/org.eclipse.jgit/org.eclipse.jgit.ssh.jsch/pom.xml")))))
15936 (inputs
15937 (list java-jgit-7 java-jsch-0.1.72 java-jzlib-1.1.3 java-slf4j-api))
15938 (home-page "https://eclipse.org/jgit/")
15939 (synopsis "SSH support for JGit using JSch")
15940 (description "This package provides SSH transport support for JGit
15941using the JSch library.")
15942 (license license:edl1.0)))
15943
15944(define-public java-jgit-gpg-bc-7
15945 (package
15946 (name "java-jgit-gpg-bc")
15947 (version "7.0.0.202409031743-r")
15948 (source (origin
15949 (method url-fetch)
15950 (uri (string-append "https://repo1.maven.org/maven2/"
15951 "org/eclipse/jgit/org.eclipse.jgit.gpg.bc/"
15952 version "/org.eclipse.jgit.gpg.bc-"
15953 version "-sources.jar"))
15954 (sha256
15955 (base32
15956 "1123x1i19h3a674mc44csdx7spn5qh6qk3klkfih4am9ak81w27n"))))
15957 (build-system ant-build-system)
15958 (arguments
15959 `(#:tests? #f
15960 #:jar-name "jgit-gpg-bc.jar"
15961 #:jdk ,openjdk17
15962 #:phases
15963 (modify-phases %standard-phases
15964 (add-after 'build 'add-osgi-manifest
15965 (lambda _
15966 (call-with-output-file "osgi-manifest.mf"
15967 (lambda (port)
15968 (display (string-append
15969 "Bundle-ManifestVersion: 2\n"
15970 "Bundle-SymbolicName: org.eclipse.jgit.gpg.bc\n"
15971 "Bundle-Version: " ,version "\n"
15972 "Export-Package: org.eclipse.jgit.gpg.bc.internal\n"
15973 "Import-Package: org.bouncycastle.asn1,"
15974 "org.bouncycastle.bcpg,"
15975 "org.bouncycastle.gpg,"
15976 "org.bouncycastle.gpg.keybox,"
15977 "org.bouncycastle.openpgp,"
15978 "org.bouncycastle.openpgp.operator,"
15979 "org.bouncycastle.openpgp.operator.jcajce,"
15980 "org.bouncycastle.util.encoders,"
15981 "org.eclipse.jgit.api.errors,"
15982 "org.eclipse.jgit.lib,"
15983 "org.eclipse.jgit.nls,"
15984 "org.eclipse.jgit.transport,"
15985 "org.eclipse.jgit.util,"
15986 "org.slf4j\n")
15987 port)))
15988 (invoke "jar" "ufm" "build/jar/jgit-gpg-bc.jar"
15989 "osgi-manifest.mf")))
15990 (replace 'install
15991 (install-from-pom
15992 "src/META-INF/maven/org.eclipse.jgit/org.eclipse.jgit.gpg.bc/pom.xml")))))
15993 (inputs
15994 (list java-bouncycastle-1.77 java-jgit-7 java-slf4j-api))
15995 (native-inputs (list unzip))
15996 (home-page "https://eclipse.org/jgit/")
15997 (synopsis "GPG support for JGit using Bouncy Castle")
15998 (description "This package provides GPG commit signing support for
15999JGit using the Bouncy Castle cryptographic library.")
16000 (license license:edl1.0)))
16001
16002(define-public java-jsonp-api
16003 (package
16004 (name "java-jsonp-api")
16005 (version "1.1.6")
16006 (source (origin
16007 (method git-fetch)
16008 (uri (git-reference
16009 (url "https://github.com/eclipse-ee4j/jsonp")
16010 (commit (string-append "1.1-" version "-RELEASE"))))
16011 (file-name (git-file-name name version))
16012 (sha256
16013 (base32
16014 "0zrj03hkr3jdmqlb4ipjr37cqpp2q2814qpmxi7srlwpdqs0ibgc"))))
16015 (build-system ant-build-system)
16016 (arguments
16017 `(#:jar-name "jsonp-api.jar"
16018 #:tests? #f
16019 #:source-dir "api/src/main/java"
16020 #:test-dir "api/src/test"))
16021 (home-page "https://eclipse-ee4j.github.io/jsonp/")
16022 (synopsis "JSON Processing in Java")
16023 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
16024parse, generate, transform and query) JSON messages. It produces and
16025consumes JSON text in a streaming fashion (similar to StAX API for XML)
16026and allows building a Java object model for JSON text using API classes
16027(similar to DOM API for XML).")
16028 ;; either gpl2 only with classpath exception, or epl2.0.
16029 (license (list license:gpl2
16030 license:epl2.0))))
16031
16032(define-public java-jsonp-impl
16033 (package
16034 (inherit java-jsonp-api)
16035 (name "java-jsonp-impl")
16036 (arguments
16037 `(#:jar-name "jsonp-impl.jar"
16038 #:tests? #f
16039 #:source-dir "impl/src/main/java"
16040 #:test-dir "impl/src/test"
16041 #:phases
16042 (modify-phases %standard-phases
16043 (add-before 'build 'copy-resources
16044 (lambda _
16045 (copy-recursively
16046 "impl/src/main/resources/"
16047 "build/classes")
16048 #t)))))
16049 (propagated-inputs
16050 (list java-jsonp-api))
16051 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
16052parse, generate, transform and query) JSON messages. This package contains
16053a reference implementation of that API.")))
16054
16055(define-public java-jakarta-json
16056 (package
16057 (name "java-jakarta-json")
16058 (version "2.1.3")
16059 (source (origin
16060 (method git-fetch)
16061 (uri (git-reference
16062 (url "https://github.com/jakartaee/jsonp-api")
16063 (commit (string-append version "-RELEASE"))))
16064 (file-name (git-file-name name version))
16065 (sha256
16066 (base32
16067 "1q600harqfhlf763l75j4fx7ai7ybp7ga06aiky2a2hg8mhz0s5f"))))
16068 (build-system ant-build-system)
16069 (arguments
16070 `(#:jar-name "jakarta-json.jar"
16071 #:source-dir "api/src/main/java"
16072 #:tests? #f; no tests
16073 #:jdk ,openjdk11))
16074 (home-page "https://github.com/jakartaee/jsonp-api")
16075 (synopsis "Portable API for JSON handling in Java")
16076 (description "This project contains API and Compatible Implementation of
16077Jakarta JSON Processing specification. Jakarta JSON Processing provides
16078portable APIs to parse, generate, transform, and query JSON documents.")
16079 ;; with classpath exception
16080 (license license:epl2.0)))
16081
16082(define-public java-parsson
16083 (package
16084 (name "java-parsson")
16085 (version "1.1.5")
16086 (source (origin
16087 (method git-fetch)
16088 (uri (git-reference
16089 (url "https://github.com/eclipse-ee4j/parsson")
16090 (commit version)))
16091 (file-name (git-file-name name version))
16092 (sha256
16093 (base32
16094 "06vvr6qv1ihnk212gdxg4x0sd61lgxk7wf062s7gym5k2h7fms0p"))))
16095 (build-system ant-build-system)
16096 (arguments
16097 `(#:jar-name "parsson.jar"
16098 #:source-dir "impl/src/main/java"
16099 #:test-dir "impl/src/test"
16100 #:use-java-modules? #t
16101 #:jdk ,openjdk11
16102 #:phases
16103 (modify-phases %standard-phases
16104 (add-after 'unpack 'copy-resources
16105 (lambda _
16106 (copy-recursively "impl/src/main/resources"
16107 "build/classes"))))))
16108 (inputs
16109 (list java-jakarta-json))
16110 (native-inputs
16111 (list java-junit))
16112 (home-page "https://github.com/eclipse-ee4j/parsson")
16113 (synopsis "Implementation of Jakarta JSON API")
16114 (description "Eclipse Parsson is an implementation of the Jakarta JSON
16115Processing specification.")
16116 ;; with classpath exception
16117 (license license:epl2.0)))
16118
16119(define-public java-jakarta-activation-api
16120 (package
16121 (name "java-jakarta-activation-api")
16122 (version "2.1.4")
16123 (source (origin
16124 (method git-fetch)
16125 (uri (git-reference
16126 (url "https://github.com/jakartaee/jaf-api")
16127 (commit version)))
16128 (file-name (git-file-name name version))
16129 (sha256
16130 (base32
16131 "125bf475cb0mdyhn1lj3c8gbwngbd28x10vnknq86zrc1vq4m6gx"))))
16132 (build-system ant-build-system)
16133 (arguments
16134 `(#:jar-name "jakarta-activation-api.jar"
16135 #:source-dir "api/src/main/java"
16136 #:tests? #f ;; has no tests
16137 #:jdk ,openjdk11))
16138 (home-page "https://github.com/jakartaee/jaf-api")
16139 (synopsis "Collection of Java activation")
16140 (description "Jakarta Activation lets you take advantage of standard
16141services to: determine the type of arbitrary piece of data; encapsulate access
16142to it; discover the operations available on it; and instantiate the
16143appropriate bean to perform the operation(s).")
16144 (license license:bsd-3)))
16145
16146(define-public java-jakarta-annotations-api
16147 (package
16148 (name "java-jakarta-annotations-api")
16149 (version "2.1.1")
16150 (source (origin
16151 (method git-fetch)
16152 (uri (git-reference
16153 (url "https://github.com/jakartaee/common-annotations-api")
16154 (commit version)))
16155 (file-name (git-file-name name version))
16156 (sha256
16157 (base32
16158 "0xq2n2pijal5p75vl9dz10i6hhdmaxw5q8j3aza717xkpxxby9p6"))))
16159 (build-system ant-build-system)
16160 (arguments
16161 `(#:jar-name "jakarta-annotations-api.jar"
16162 #:source-dir "api/src/main/java"
16163 #:tests? #f; no tests
16164 #:jdk ,openjdk11))
16165 (home-page "https://github.com/jakartaee/common-annotations-api")
16166 (synopsis "Collection of Java annotations")
16167 (description "Jakarta Annotations defines a collection of annotations
16168representing common semantic concepts that enable a declarative style of
16169programming that applies across a variety of Java technologies.")
16170 ;; with classpath exception
16171 (license (list license:epl2.0
16172 license:gpl2))))
16173
16174(define-public java-xmp
16175 (package
16176 (name "java-xmp")
16177 (version "5.1.3")
16178 (source (origin
16179 (method url-fetch)
16180 (uri (string-append "http://download.macromedia.com/pub/developer"
16181 "/xmp/sdk/XMPCoreJava-" version ".zip"))
16182 (sha256
16183 (base32
16184 "14nai2mmsg7l5ya2y5mx4w4lr1az3sk2fjz6hiy4zdrsavgvl1g7"))))
16185 (build-system ant-build-system)
16186 (arguments
16187 `(#:build-target "build"
16188 #:tests? #f; no tests
16189 #:phases
16190 (modify-phases %standard-phases
16191 (add-after 'unpack 'chdir
16192 (lambda _
16193 (chdir "XMPCore")
16194 #t))
16195 (add-before 'build 'fix-timestamp
16196 (lambda _
16197 (substitute* "build.xml"
16198 (("\\$\\{BuildDate\\}") "1970 Jan 01 00:00:00-GMT"))
16199 #t))
16200 (replace 'install
16201 (install-jars "."))
16202 (add-after 'install 'install-doc
16203 (lambda* (#:key outputs #:allow-other-keys)
16204 (copy-recursively
16205 "docs"
16206 (string-append (assoc-ref outputs "out") "/share/doc/java-xmp"))
16207 #t)))))
16208 (native-inputs
16209 (list unzip))
16210 (home-page "https://www.adobe.com/devnet/xmp.html")
16211 (synopsis "Extensible Metadat Platform (XMP) support in Java")
16212 (description "Adobe's Extensible Metadata Platform (XMP) is a labeling
16213technology that allows you to embed data about a file, known as metadata,
16214into the file itself. The XMP Toolkit for Java is based on the C++ XMPCore
16215library and the API is similar.")
16216 (license license:bsd-3)))
16217
16218(define-public java-args4j
16219 (package
16220 (name "java-args4j")
16221 (version "2.33")
16222 (source (origin
16223 (method git-fetch)
16224 (uri (git-reference
16225 (url "https://github.com/kohsuke/args4j")
16226 (commit (string-append "args4j-site-" version))))
16227 (file-name (git-file-name name version))
16228 (sha256
16229 (base32
16230 "0w061fg65qrsm1a0lz0vyprsyidj31krjb459qi2lw0y78xza26s"))))
16231 (build-system ant-build-system)
16232 (arguments
16233 `(#:jar-name "args4j.jar"
16234 #:source-dir "args4j/src"
16235 #:test-dir "args4j/test"
16236 #:test-exclude
16237 (list "**/ExampleTest.*"
16238 "**/ExternalConfiguredTest.*" ; fails to find a file
16239 ;; We still don't want to run abstract classes
16240 "**/Abstract*.*")
16241 #:phases
16242 (modify-phases %standard-phases
16243 (add-before 'check 'fix-test-dir
16244 (lambda _
16245 (substitute* "build.xml"
16246 (("/java\">") "\">"))
16247 #t))
16248 (add-before 'build 'copy-resources
16249 (lambda _
16250 (let ((from-prefix "args4j/src/org/kohsuke/args4j/")
16251 (to-prefix "build/classes/org/kohsuke/args4j/"))
16252 (for-each (lambda (f)
16253 (install-file
16254 (string-append from-prefix f)
16255 (string-append to-prefix (dirname f))))
16256 (list "Messages.properties"
16257 "Messages_de.properties"
16258 "Messages_en.properties"
16259 "Messages_ru.properties"
16260 "spi/Messages.properties"
16261 "spi/Messages_de.properties"
16262 "spi/Messages_en.properties"
16263 "spi/Messages_ru.properties")))
16264 #t)))))
16265 (native-inputs
16266 (list java-junit))
16267 (home-page "https://args4j.kohsuke.org/")
16268 (synopsis "Command line parser library")
16269 (description "Args4j is a small Java class library that makes it easy to
16270parse command line options/arguments in your CUI application.")
16271 (license license:expat)))
16272
16273(define-public java-argparse4j
16274 (package
16275 (name "java-argparse4j")
16276 (version "0.9.0")
16277 (source (origin
16278 (method git-fetch)
16279 (uri (git-reference
16280 (url "https://github.com/argparse4j/argparse4j")
16281 (commit (string-append "argparse4j-" version))))
16282 (file-name (git-file-name name version))
16283 (sha256
16284 (base32
16285 "1i0j3zs1ln48n0g8a90vqbv6528mcswhzys6252yp0c8w1ai64fb"))))
16286 (build-system ant-build-system)
16287 (arguments
16288 (list #:jar-name "java-argparse4j.jar"
16289 #:source-dir "main/src/main/"
16290 #:test-dir "main/src/test/"
16291 #:jdk openjdk11
16292 #:phases #~(modify-phases %standard-phases
16293 (add-after 'unpack 'copy-resources
16294 (lambda _
16295 (copy-recursively "main/src/test/resources"
16296 "target/test-classes")
16297 (copy-recursively "main/src/main/resources"
16298 "build/classes")))
16299 (replace 'install
16300 (install-from-pom "pom.xml")))))
16301 (inputs (list java-junit))
16302 (home-page "https://argparse4j.github.io/")
16303 (synopsis "Java command-line argument parser library")
16304 (description "Argparse4j is a command line argument parser library for
16305Java based on Python's @code{argparse} module.")
16306 (license license:expat)))
16307
16308(define-public java-metadata-extractor
16309 (package
16310 (name "java-metadata-extractor")
16311 (version "2.19.0")
16312 (source (origin
16313 (method git-fetch)
16314 (uri (git-reference
16315 (url "https://github.com/drewnoakes/metadata-extractor")
16316 (commit version)))
16317 (file-name (git-file-name name version))
16318 (sha256
16319 (base32
16320 "1axnw47n06a116g8bml2l6rxx92grxp935gspyhz4pz868m7hrna"))))
16321 (build-system ant-build-system)
16322 (arguments
16323 `(#:jar-name "metadata-extractor.jar"
16324 #:source-dir "Source"
16325 #:test-dir "Tests"
16326 #:phases
16327 (modify-phases %standard-phases
16328 (add-before 'build 'fix-xmp-path
16329 (lambda _
16330 ;; This version of metadata-extractor depends on java-xmp 6, which
16331 ;; is non-free. These changes allow using java-xmp 5, which is
16332 ;; the last free-software version of java-xmp.
16333 (substitute* (find-files "." ".*.java")
16334 (("com.adobe.internal.xmp") "com.adobe.xmp"))
16335 (substitute* "Source/com/drew/metadata/xmp/XmpReader.java"
16336 (("\\.setXMPNodesToLimit.*") ";"))
16337 ;; Test failure, most likely because we use a different java-xmp
16338 ;; version.
16339 (delete-file "Tests/com/drew/metadata/xmp/XmpReaderTest.java")))
16340 (add-before 'check 'fix-test-dir
16341 (lambda _
16342 (substitute* "build.xml"
16343 (("/java\">") "\">"))
16344 #t)))))
16345 (propagated-inputs
16346 (list java-xmp))
16347 (native-inputs
16348 (list java-hamcrest-core java-junit))
16349 (home-page "https://github.com/drewnoakes/metadata-extractor")
16350 (synopsis "Extract metadata from image and video files")
16351 (description "Metadata-extractor is a straightforward Java library for
16352reading metadata from image files. It is able to read metadata in Exif,
16353IPTC, XMP, ICC and more formats.")
16354 (license license:asl2.0)))
16355
16356(define-public java-svg-salamander
16357 (package
16358 (name "java-svg-salamander")
16359 (version "1.1.2")
16360 (source (origin
16361 (method git-fetch)
16362 (uri (git-reference
16363 (url "https://github.com/blackears/svgSalamander")
16364 (commit (string-append "v" version))))
16365 (file-name (git-file-name name version))
16366 (sha256
16367 (base32
16368 "1zv3kjdkf6iqf02x6ln76254y634j2ji448y706a65lsbfjmmicf"))
16369 (modules '((guix build utils)))
16370 (snippet
16371 '(begin
16372 (for-each delete-file (find-files "." ".*.jar"))
16373 #t))
16374 (patches
16375 (search-patches "java-svg-salamander-Fix-non-det.patch"))))
16376 (build-system ant-build-system)
16377 (arguments
16378 `(#:tests? #f; no tests
16379 #:phases
16380 (modify-phases %standard-phases
16381 (add-after 'unpack 'chdir
16382 (lambda _
16383 (chdir "svg-core")
16384 #t))
16385 (add-before 'build 'copy-jars
16386 (lambda* (#:key inputs #:allow-other-keys)
16387 (copy-file (car (find-files (assoc-ref inputs "javacc") "\\.jar$"))
16388 "../libraries/javacc.jar")
16389 (copy-file (car (find-files (assoc-ref inputs "ant") "ant\\.jar$"))
16390 "../libraries/ant.jar")
16391 #t))
16392 (replace 'install
16393 (install-jars "dist")))))
16394 (native-inputs
16395 (list javacc))
16396 (home-page "https://github.com/blackears/svgSalamander")
16397 (synopsis "SVG engine for Java")
16398 (description "SVG Salamander is an SVG engine for Java that's designed
16399to be small, fast, and allow programmers to use it with a minimum of fuss.
16400It's in particular targeted for making it easy to integrate SVG into Java
16401games and making it much easier for artists to design 2D game content - from
16402rich interactive menus to charts and graphcs to complex animations.")
16403 (license license:bsd-2)))
16404
16405(define-public java-jboss-transaction-api-spec
16406 (package
16407 (name "java-jboss-transaction-api-spec")
16408 (version "1.2+1.1.1")
16409 (source (origin
16410 (method git-fetch)
16411 (uri (git-reference
16412 (url "https://github.com/jboss/jboss-transaction-api_spec")
16413 (commit "jboss-transaction-api_1.2_spec-1.1.1.Final")))
16414 (file-name (git-file-name name version))
16415 (sha256
16416 (base32
16417 "1xbfq5hvb86izflydxrqqv3k26c1ba2m0ap6m97shqrsdi9by4wy"))))
16418 (build-system ant-build-system)
16419 (arguments
16420 `(#:jar-name "java-jboss-transaction-api_spec.jar"
16421 #:source-dir "src/main/java"
16422 #:tests? #f)); no tests
16423 (inputs
16424 (list java-cdi-api java-jboss-interceptors-api-spec))
16425 (home-page "https://github.com/jboss/jboss-transaction-api_spec")
16426 (synopsis "Generic transaction management API in Java")
16427 (description "Java-jboss-transaction-api-spec implements the Transactions
16428API. A transaction is a unit of work containing one or more operations
16429involving one or more shared resources having ACID (Atomicity, Consistency,
16430Isolation and Durability) properties.")
16431 ;; either gpl2 only with classpath exception or cddl.
16432 (license (list license:gpl2 license:cddl1.0))))
16433
16434(define-public java-picocli
16435 (package
16436 (name "java-picocli")
16437 (version "4.3.2")
16438 (source (origin
16439 (method git-fetch)
16440 (uri (git-reference
16441 (url "https://github.com/remkop/picocli")
16442 (commit (string-append "v" version))))
16443 (file-name (git-file-name name version))
16444 (sha256
16445 (base32
16446 "1sxp6rxjfgjd98ly14b3d15dvxkm5wg4g46w12jyhmr0kmkaca3c"))))
16447 (build-system ant-build-system)
16448 (arguments
16449 `(#:jar-name "picocli.jar"
16450 #:source-dir "src/main/java"
16451 ;; Tests require missing dependencies (junitparams, system-rules)
16452 #:tests? #f))
16453 (home-page "https://picocli.info")
16454 (synopsis "REPL for the JVM")
16455 (description "Picocli is a framework for building command line applications
16456for the JVM. It supports colors, autocompletion, subcommands, and more. Written
16457in Java, usable from Groovy, Kotlin, Scala, etc.")
16458 (license license:asl2.0)))
16459
16460(define-public java-pj
16461 (package
16462 (name "java-pj")
16463 (version "20150107")
16464 (source (origin
16465 (method url-fetch)
16466 (uri (string-append "https://www.cs.rit.edu/~ark/pjsrc"
16467 version ".jar"))
16468 (sha256
16469 (base32
16470 "078xwaivl2qqjc07r0vk6kzpqlcb1bcar80p8r5qigh34hpr86d3"))
16471 (modules '((guix build utils)))
16472 (snippet
16473 '(for-each delete-file
16474 (find-files "." "\\.class$")))))
16475 (build-system ant-build-system)
16476 (arguments
16477 (list
16478 #:tests? #false ;there are none
16479 #:phases
16480 #~(modify-phases %standard-phases
16481 (add-after 'unpack 'chdir
16482 (lambda _ (chdir "src/pj")))
16483 (add-after 'chdir 'patch-source-directory
16484 (lambda _
16485 (substitute* "compile"
16486 (("SRCDIR1=/home/ark/public_html/pj/lib")
16487 (string-append "SRCDIR1=" (getcwd) "/lib")))))
16488 (replace 'build
16489 (lambda _
16490 (invoke "bash" "./compile" "linux")
16491 (with-directory-excursion "lib"
16492 (apply invoke "jar" "cf" (string-append "pj" #$version ".jar")
16493 (find-files "." "\\.class$")))))
16494 (replace 'install (install-jars ".")))))
16495 (home-page "https://www.cs.rit.edu/~ark/pj.shtml")
16496 (synopsis "Parallel programming in Java")
16497 (description "Parallel Java (PJ) is an API and middleware for parallel
16498programming in 100% Java on shared memory multiprocessor (SMP) parallel
16499computers, cluster parallel computers, and hybrid SMP cluster parallel
16500computers.")
16501 (license license:gpl3+)))
16502
16503(define-public java-jetbrains-annotations
16504 (package
16505 (name "java-jetbrains-annotations")
16506 (version "19.0.0")
16507 (source (origin
16508 (method git-fetch)
16509 (uri (git-reference
16510 (url "https://github.com/JetBrains/java-annotations")
16511 (commit version)))
16512 (file-name (git-file-name name version))
16513 (sha256
16514 (base32
16515 "0z6i1xs60cd5ffz23c49sq68wn5mphhs3xpar1n93ppama2ng80v"))))
16516 (build-system ant-build-system)
16517 (arguments
16518 `(#:jar-name "jetbrains-annotations.jar"
16519 #:source-dir "common/src/main/java:java8/src/main/java"
16520 #:tests? #f)); no tests
16521 (home-page "https://github.com/JetBrains/java-annotations")
16522 (synopsis "Annotations for Java and other JVM languages")
16523 (description "This package contains a set of Java annotations which can be
16524used in JVM-based languages. They serve as an additional documentation and
16525can be interpreted by IDEs and static analysis tools to improve code analysis.")
16526 (license license:expat)))
16527
16528(define-public java-javaparser
16529 (package
16530 (name "java-javaparser")
16531 (version "3.16.1")
16532 (source (origin
16533 (method git-fetch)
16534 (uri (git-reference
16535 (url "https://github.com/javaparser/javaparser")
16536 (commit (string-append "javaparser-parent-" version))))
16537 (file-name (git-file-name name version))
16538 (sha256
16539 (base32
16540 "1a4jk12ffa31fa0y8vda0739vpfj1206p0nha842b7bixbvwamv9"))
16541 (modules '((guix build utils)))
16542 (snippet
16543 '(begin
16544 (for-each delete-file
16545 (find-files "." "\\.jar$"))
16546 #t))))
16547 (build-system ant-build-system)
16548 (arguments
16549 `(#:tests? #f; tests require jbehave and junit5
16550 #:phases
16551 (modify-phases %standard-phases
16552 (add-before 'build 'fill-template
16553 (lambda _
16554 (with-directory-excursion "javaparser-core/src/main"
16555 (copy-file "java-templates/com/github/javaparser/JavaParserBuild.java"
16556 "java/com/github/javaparser/JavaParserBuild.java")
16557 (substitute* "java/com/github/javaparser/JavaParserBuild.java"
16558 (("\\$\\{project.version\\}") ,version)
16559 (("\\$\\{project.name\\}") "javaparser")
16560 (("\\$\\{project.build.finalName\\}") "javaparser")
16561 (("\\$\\{maven.version\\}") "fake")
16562 (("\\$\\{maven.build.version\\}") "fake")
16563 (("\\$\\{build.timestamp\\}") "0")
16564 (("\\$\\{java.vendor\\}") "Guix")
16565 (("\\$\\{java.vendor.url\\}") "https://gnu.org/software/guix")
16566 (("\\$\\{java.version\\}") "1.8")
16567 (("\\$\\{os.arch\\}") "any")
16568 (("\\$\\{os.name\\}") "Guix")
16569 (("\\$\\{os.version\\}") "not available")))
16570 #t))
16571 (add-before 'build 'generate-javacc
16572 (lambda _
16573 (with-directory-excursion "javaparser-core/src/main/java"
16574 (invoke "java" "javacc" "../javacc/java.jj"))
16575 #t))
16576 (add-before 'build 'copy-javacc-support
16577 (lambda _
16578 (with-directory-excursion "javaparser-core/src/main"
16579 (copy-recursively "javacc-support" "java"))
16580 #t))
16581 (replace 'build
16582 (lambda _
16583 (define (build name)
16584 (format #t "Building ~a~%" name)
16585 (delete-file-recursively "build/classes")
16586 (mkdir-p "build/classes")
16587 (apply invoke "javac"
16588 "-cp" (string-append (getenv "CLASSPATH") ":"
16589 (string-join (find-files "build/jar" ".")
16590 ":"))
16591 "-d" "build/classes"
16592 (find-files (string-append name "/src/main/java")
16593 ".*.java"))
16594 (invoke "jar" "-cf" (string-append "build/jar/" name ".jar")
16595 "-C" "build/classes" "."))
16596 (mkdir-p "build/classes")
16597 (mkdir-p "build/test-classes")
16598 (mkdir-p "build/jar")
16599 (build "javaparser-core")
16600 (build "javaparser-core-serialization")
16601 (build "javaparser-core-generators")
16602 (build "javaparser-core-metamodel-generator")
16603 (build "javaparser-symbol-solver-core")
16604 #t))
16605 (replace 'install
16606 (install-jars "build/jar")))))
16607 (inputs
16608 (list java-guava java-jboss-javassist java-jsonp-api))
16609 (native-inputs
16610 (list javacc))
16611 (home-page "https://javaparser.org/")
16612 (synopsis "Parser for Java")
16613 (description
16614 "This project contains a set of libraries implementing a Java 1.0 - Java
1661511 Parser with advanced analysis functionalities.")
16616 (license (list
16617 ;; either lgpl or asl
16618 license:lgpl3+
16619 license:asl2.0))))
16620
16621(define-public tla2tools
16622 ;; This package was originally based on the "v1.8.0" tag, but that merely
16623 ;; points to the moving master branch. That might be because the ‘latest
16624 ;; release’ at GitHub is currently 1.7.1. We'll see! For now, rather than
16625 ;; downgrade to 1.7.1 proper, use the commit that we originally dubbed 1.8.0.
16626 (let* ((release "1.7.1")
16627 (revision "0")
16628 (commit "6932e19083fc6df42473464857fc1280cb5aaecc"))
16629 (package
16630 (name "tla2tools")
16631 (version (git-version release revision commit))
16632 (source (origin
16633 (method git-fetch)
16634 (uri (git-reference
16635 (url "https://github.com/tlaplus/tlaplus")
16636 (commit commit)))
16637 (file-name (git-file-name name version))
16638 (sha256
16639 (base32
16640 "1hhx8gmn81k8qrkx4p7ppinmygxga9fqffd626wkvhjgg2ky8lhs"))
16641 (patches
16642 (search-patches "tla2tools-build-xml.patch"))
16643 (modules '((guix build utils)))
16644 (snippet
16645 '(begin
16646 ;; Remove packaged libraries (see 'replace-libs below)
16647 (for-each delete-file (find-files "." ".*.jar$"))))))
16648 (build-system ant-build-system)
16649 (arguments
16650 (let* ((tlatools "tlatools/org.lamport.tlatools/")
16651 (build-xml (string-append tlatools "customBuild.xml")))
16652 `(#:jdk ,openjdk11
16653 #:modules ((guix build ant-build-system)
16654 (guix build utils)
16655 (ice-9 match)
16656 (srfi srfi-26))
16657 #:make-flags '("-f" ,build-xml)
16658 #:phases
16659 (modify-phases %standard-phases
16660 ;; Replace packed libs with references to jars in store
16661 (add-after 'unpack 'replace-libs
16662 (lambda* (#:key inputs #:allow-other-keys)
16663 (define (input-jar input)
16664 (car (find-files (assoc-ref inputs input) "\\.jar$")))
16665 (for-each
16666 (match-lambda
16667 ((file . input)
16668 (symlink (input-jar input)
16669 (string-append ,tlatools "/lib/" file))))
16670 '(("gson/gson-2.8.6.jar" . "java-gson")
16671 ("javax.mail/mailapi-1.6.3.jar" . "java-javax-mail")
16672 ("jline/jline-terminal-3.14.1.jar" . "java-jline-terminal")
16673 ("jline/jline-reader-3.14.1.jar" . "java-jline-reader")
16674 ("lsp/org.eclipse.lsp4j.debug-0.10.0.jar" .
16675 "java-eclipse-lsp4j-debug")
16676 ("lsp/org.eclipse.lsp4j.jsonrpc-0.10.0.jar" .
16677 "java-eclipse-lsp4j-jsonrpc")
16678 ("lsp/org.eclipse.lsp4j.jsonrpc.debug-0.10.0.jar" .
16679 "java-eclipse-lsp4j-jsonrpc-debug")
16680 ("junit-4.12.jar" . "java-junit")
16681 ("easymock-3.3.1.jar" . "java-easymock")))
16682 ;; Retain a tiny subset of the original X-Git-*
16683 ;; manifest values just to aid in debugging.
16684 (substitute* ,build-xml
16685 (("\\$\\{git.tag\\}") (string-append "v" ,release)))))
16686 (add-before 'check 'prepare-tests
16687 (lambda _
16688 ;; The pcal tests write to .cfg files.
16689 (for-each (cut chmod <> #o644)
16690 (find-files (string-append ,tlatools
16691 "/test-model/pcal")
16692 "\\.cfg$"))))
16693 (replace 'install
16694 (lambda* (#:key inputs outputs #:allow-other-keys)
16695 (let* ((share (string-append (assoc-ref outputs "out") "/share/java"))
16696 (jar-name "tla2tools.jar"); set in project.properties
16697 (jar (string-append ,tlatools
16698 "/dist/" jar-name))
16699 (java-cp (string-append share "/" jar-name))
16700 (bin (string-append (assoc-ref outputs "out") "/bin"))
16701 (java (search-input-file inputs "/bin/java")))
16702 (install-file jar share)
16703 (mkdir-p bin)
16704 ;; Generate wrapper scripts for bin/, which invoke common
16705 ;; commands within tla2tools.jar. Users can still invoke
16706 ;; tla2tools.jar for the rest.
16707 (for-each
16708 (match-lambda
16709 ((wrapper . class)
16710 (let ((file (string-append bin "/" wrapper)))
16711 (begin
16712 (with-output-to-file file
16713 (lambda _
16714 (display
16715 (string-append
16716 "#!/bin/sh\n"
16717 java " -XX:+UseParallelGC " " -cp " java-cp " " class " \"$@\""))))
16718 (chmod file #o755)))))
16719 ;; bin/wrapper . java-class
16720 '(("pcal" . "pcal.trans")
16721 ("tlatex" . "tla2tex.TLA")
16722 ("tla2sany" . "tla2sany.SANY")
16723 ("tlc2" . "tlc2.TLC")
16724 ("tlc2-repl" . "tlc2.REPL"))))))))))
16725 (native-inputs
16726 (list java-junit java-easymock))
16727 (inputs
16728 (list java-javax-mail
16729 java-gson-2.8.6
16730 java-jline-terminal
16731 java-jline-reader
16732 java-eclipse-lsp4j-jsonrpc
16733 java-eclipse-lsp4j-jsonrpc-debug
16734 java-eclipse-lsp4j-debug))
16735 (home-page "https://lamport.azurewebsites.net/tla/tools.html")
16736 (synopsis "TLA+ tools (analyzer, TLC, TLATeX, PlusCal translator)")
16737 (description "TLA+ is a high-level language for modeling programs and
16738systems---especially concurrent and distributed ones. It's based on the idea
16739that the best way to describe things precisely is with simple
16740mathematics. TLA+ and its tools are useful for eliminating fundamental design
16741errors, which are hard to find and expensive to correct in code.
16742
16743The following TLA+ tools are available in this distribution:
16744
16745@itemize
16746@item The Syntactic Analyzer: A parser and syntax checker for
16747 TLA+ specifications;
16748@item TLC: A model checker and simulator for a subclass of \"executable\" TLA+
16749 specifications;
16750@item TLATeX: A program for typesetting TLA+ specifications;
16751@item Beta test versions of 1-3 for the TLA+2 language; and
16752@item The PlusCal translator.
16753@end itemize")
16754 (license license:expat))))
16755
16756;; Deprecated at 2026-06-01
16757(define-deprecated/public-alias abcl
16758 (@ (gnu packages lisp) abcl))
16759
16760;;;
16761;;; Avoid adding new packages to the end of this file. To reduce the chances
16762;;; of a merge conflict, place them above by existing packages with similar
16763;;; functionality or similar names.
16764;;;