projects/guix·blob audio-team · refs

16827 lines · 702.9 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015-2024 Ricardo Wurmus <[email protected]>
3;;; Copyright © 2016 Leo Famulari <[email protected]>
4;;; Copyright © 2016, 2017 Roel Janssen <[email protected]>
5;;; Copyright © 2017, 2019, 2021 Carlo Zancanaro <[email protected]>
6;;; Copyright © 2017-2022 Julien Lepiller <[email protected]>
7;;; Copyright © 2017 Thomas Danckaert <[email protected]>
8;;; Copyright © 2016, 2017, 2018 Alex Vong <[email protected]>
9;;; Copyright © 2017, 2019, 2021 Tobias Geerinckx-Rice <[email protected]>
10;;; Copyright © 2018, 2019 Gábor Boskovits <[email protected]>
11;;; Copyright © 2018 Chris Marusich <[email protected]>
12;;; Copyright © 2018-2024 Efraim Flashner <[email protected]>
13;;; Copyright © 2019, 2020, 2021 Björn Höfling <[email protected]>
14;;; Copyright © 2020, 2025 Janneke Nieuwenhuizen <[email protected]>
15;;; Copyright © 2020 Raghav Gururajan <[email protected]>
16;;; Copyright © 2020, 2022, 2025-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 ((guix licenses) #:prefix license:)
46 #:use-module (guix packages)
47 #:use-module (guix download)
48 #:use-module (guix hg-download)
49 #:use-module (guix git-download)
50 #:use-module (guix svn-download)
51 #:use-module ((guix build utils) #:select (alist-replace))
52 #:use-module (guix utils)
53 #:use-module (guix gexp)
54 #:use-module (guix build-system ant)
55 #:use-module (guix build-system cmake)
56 #:use-module (guix build-system gnu)
57 #:use-module (guix build-system maven)
58 #:use-module (guix build-system pyproject)
59 #:use-module (gnu packages)
60 #:use-module (gnu packages attr)
61 #:use-module (gnu packages autotools)
62 #:use-module (gnu packages base)
63 #:use-module (gnu packages bash)
64 #:use-module (gnu packages nss)
65 #:use-module (gnu packages check)
66 #:use-module (gnu packages cpio)
67 #:use-module (gnu packages cups)
68 #:use-module (gnu packages compression)
69 #:use-module (gnu packages elf)
70 #:use-module (gnu packages fontutils)
71 #:use-module (gnu packages freedesktop) ; wayland
72 #:use-module (gnu packages gawk)
73 #:use-module (gnu packages gcc)
74 #:use-module (gnu packages gettext)
75 #:use-module (gnu packages gl)
76 #:use-module (gnu packages ghostscript) ;lcms
77 #:use-module (gnu packages gnome)
78 #:use-module (gnu packages groovy)
79 #:use-module (gnu packages gtk)
80 #:use-module (gnu packages guile)
81 #:use-module (gnu packages icu4c)
82 #:use-module (gnu packages image)
83 #:use-module (gnu packages java-bootstrap)
84 #:use-module (gnu packages java-compression)
85 #:use-module (gnu packages java-xml)
86 #:use-module (gnu packages libffi)
87 #:use-module (gnu packages linux) ;alsa
88 #:use-module (gnu packages maths)
89 #:use-module (gnu packages maven)
90 #:use-module (gnu packages maven-parent-pom)
91 #:use-module (gnu packages ncurses)
92 #:use-module (gnu packages nss)
93 #:use-module (gnu packages onc-rpc)
94 #:use-module (gnu packages web)
95 #:use-module (gnu packages wget)
96 #:use-module (gnu packages pkg-config)
97 #:use-module (gnu packages perl)
98 #:use-module (gnu packages popt)
99 #:use-module (gnu packages python-build)
100 #:use-module (gnu packages kerberos)
101 #:use-module (gnu packages security-token)
102 #:use-module (gnu packages xml)
103 #:use-module (gnu packages xdisorg)
104 #:use-module (gnu packages xorg)
105 #:use-module (gnu packages texinfo)
106 #:use-module ((srfi srfi-1) #:select (first fold alist-delete))
107 #:use-module (srfi srfi-11)
108 #:use-module (ice-9 match))
109
110(define* (system->icedtea-arch #:optional (system (or (%current-target-system)
111 (%current-system))))
112 "Return the Icedtea architecture string, such as \"ppc64le\", of SYSTEM."
113 ;; See INSTALL_ARCH_DIR in the configure script of icedtea.
114 (match system
115 ("i686-linux" "i386")
116 ("x86_64-linux" "amd64")
117 ("armhf-linux" "arm")
118 ("powerpc-linux" "ppc")
119 ("powerpc64le-linux" "ppc64le")
120 (system
121 ;; Turn e.g. "aarch64-linux" into "aarch64".
122 (first (string-split system #\-)))))
123
124(define-public icedtea-7
125 (let* ((version "2.6.13")
126 (drop (lambda* (name hash #:optional (patches '()))
127 (origin
128 (method url-fetch)
129 (uri (string-append
130 "http://icedtea.classpath.org/download/drops"
131 "/icedtea7/" version "/" name ".tar.bz2"))
132 (sha256 (base32 hash))
133 (patches patches)))))
134 (package
135 (name "icedtea")
136 (version version)
137 (source (origin
138 (method url-fetch)
139 (uri (string-append
140 "http://icedtea.wildebeest.org/download/source/icedtea-"
141 version ".tar.xz"))
142 (sha256
143 (base32
144 "1w331rdqx1dcx2xb0fmjmrkdc71xqn20fxsgw8by4xhiblh88khh"))
145 (modules '((guix build utils)))
146 (snippet
147 '(substitute* "Makefile.in"
148 ;; do not leak information about the build host
149 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
150 "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
151 (build-system gnu-build-system)
152 (outputs '("out" ; Java Runtime Environment
153 "jdk" ; Java Development Kit
154 "doc")) ; all documentation
155 (arguments
156 (list
157 ;; There are many test failures. Some are known to fail upstream,
158 ;; others relate to not having an X server running at test time, yet
159 ;; others are a complete mystery to me.
160
161 ;; hotspot: passed: 241; failed: 45; error: 2
162 ;; langtools: passed: 1,934; failed: 26
163 ;; jdk: unknown
164 #:tests? #f
165 ;; The validate-runpath phase fails on internal libraries depending on
166 ;; libraries found under e.g. 'lib/amd64' on x86_64, and the build
167 ;; system blissfully ignores LDFLAGS; disable it.
168 #:validate-runpath? #f
169 #:modules '((guix build utils)
170 (guix build gnu-build-system)
171 (ice-9 match)
172 (ice-9 popen)
173 (srfi srfi-19)
174 (srfi srfi-26))
175 #:configure-flags
176 ;; TODO: package sctp and add to inputs
177 #~(list "--disable-system-sctp"
178 "--enable-system-pcsc"
179 "--enable-system-lcms"
180 "--enable-bootstrap"
181 "--enable-nss"
182 "--without-rhino"
183 (string-append "--with-parallel-jobs="
184 (number->string (parallel-job-count)))
185 "--disable-downloading"
186 "--disable-tests" ;they are run in the check phase instead
187 "--with-openjdk-src-dir=./openjdk.src"
188 (string-append
189 "--with-ecj=" (search-input-file %build-inputs "bin/javac"))
190 (string-append "--with-jdk-home="
191 #$(this-package-native-input "classpath"))
192 (string-append "--with-java="
193 (search-input-file %build-inputs "bin/jamvm"))
194 (string-append "--with-jar="
195 (search-input-file %build-inputs "/bin/gjar")))
196 #:phases
197 #~(modify-phases %standard-phases
198 (replace 'unpack
199 (lambda* (#:key source inputs #:allow-other-keys)
200 (let ((target (string-append "icedtea-"
201 #$(package-version this-package)))
202 (unpack (lambda* (name #:optional dir)
203 (let ((dir (or dir
204 (string-drop-right name 5))))
205 (mkdir dir)
206 (invoke "tar" "xvf"
207 (assoc-ref inputs name)
208 "-C" dir
209 "--strip-components=1")))))
210 (mkdir target)
211 (invoke "tar" "xvf" source
212 "-C" target "--strip-components=1")
213 (chdir target)
214 (unpack "openjdk-src" "openjdk.src")
215 (with-directory-excursion "openjdk.src"
216 (for-each unpack
217 (filter (cut string-suffix? "-drop" <>)
218 (map (match-lambda
219 ((name . _) name))
220 inputs)))))))
221 (add-after 'unpack 'use-classpath
222 (lambda* (#:key inputs #:allow-other-keys)
223 (let ((tools (search-input-file inputs
224 "share/classpath/tools.zip"))
225 (rt.jar (search-input-file inputs "lib/rt.jar")))
226 ;; GNU Classpath does not provide rt.jar, but jamvm provides
227 ;; Classpath's glibj.zip as rt.jar, so we just use that.
228 (substitute* "Makefile.in"
229 (("\\$\\(SYSTEM_JDK_DIR\\)/jre/lib/rt.jar") rt.jar))
230 ;; Make sure we can find all classes.
231 (setenv "CLASSPATH"
232 (string-append rt.jar ":" tools))
233 (setenv "JAVACFLAGS"
234 (string-append "-cp " rt.jar ":" tools)))))
235 (add-after 'unpack 'patch-bitrot
236 (lambda _
237 (substitute*
238 '("patches/boot/revert-6973616.patch"
239 "openjdk.src/jdk/make/common/shared/Defs-versions.gmk")
240 (("REQUIRED_FREETYPE_VERSION = 2.2.1")
241 "REQUIRED_FREETYPE_VERSION = 2.10.1"))
242 ;; As of attr 2.4.48 this header is no longer
243 ;; included. It is provided by the libc instead.
244 (substitute* '("configure"
245 "openjdk.src/jdk/src/solaris/native/sun/\
246nio/fs/LinuxNativeDispatcher.c")
247 (("attr/xattr.h") "sys/xattr.h"))))
248 (add-after 'unpack 'fix-openjdk
249 (lambda _
250 (with-directory-excursion "openjdk.src"
251 (substitute* "jdk/make/common/Defs-linux.gmk"
252 (("CFLAGS_COMMON = -fno-strict-aliasing" all)
253 (string-append all
254 " -fcommon"
255 " -Wno-error=implicit-function-declaration"
256 " -Wno-error=implicit-int"
257 " -Wno-error=incompatible-pointer-types"
258 " -Wno-error=int-conversion")))
259 (substitute*
260 '("jdk/src/solaris/native/java/net/PlainSocketImpl.c"
261 "jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c")
262 (("#include <sys/sysctl.h>")
263 "#include <linux/sysctl.h>"))
264
265 ;; XXX 'ldd' in glibc 2.35 segfaults upon reading
266 ;; openjdk.build-boot/lib/amd64/libnio.so (!).
267 ;; It is only used as a verification step, so ignore it; try
268 ;; removing this substitution for newer versions of glibc.
269 (substitute* "jdk/make/common/shared/Defs-linux.gmk"
270 (("\\$\\(LDD\\) \\$1 &&")
271 ""))
272
273 ;; It looks like the "h = 31 * h + c" line of the jsum()
274 ;; function gets miscompiled. After a few iterations of the
275 ;; loop the result of "31 * h" is always 0x8000000000000000.
276 ;; Disable optimizations of dump.cpp as a workaround.
277 (substitute* "hotspot/make/linux/makefiles/gcc.make"
278 (("OPT_CFLAGS/NOOPT.*" all)
279 (string-append all "\n"
280 "OPT_CFLAGS/dump.o += -O0"))))))
281 (add-after 'unpack 'fix-x11-extension-include-path
282 (lambda* (#:key inputs #:allow-other-keys)
283 (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
284 (((string-append "\\$\\(firstword \\$\\(wildcard "
285 "\\$\\(OPENWIN_HOME\\)"
286 "/include/X11/extensions\\).*$"))
287 (string-append #$(this-package-input "libxrender")
288 "/include/X11/extensions"
289 " -I" #$(this-package-input "libxtst")
290 "/include/X11/extensions"
291 " -I" #$(this-package-input "libxinerama")
292 "/include/X11/extensions"))
293 (("\\$\\(wildcard /usr/include/X11/extensions\\)\\)") ""))))
294 (add-after 'unpack 'patch-paths
295 (lambda* (#:key native-inputs inputs #:allow-other-keys)
296 ;; buildtree.make generates shell scripts, so we need to replace
297 ;; the generated shebang.
298 (with-directory-excursion "openjdk.src"
299 (substitute* "hotspot/make/linux/makefiles/buildtree.make"
300 (("/bin/sh") (which "bash")))
301
302 (let ((corebin (dirname (search-input-file
303 (or native-inputs inputs)
304 "bin/cp")))) ;coreutils
305 (substitute* '("jdk/make/common/shared/Defs-linux.gmk"
306 "corba/make/common/shared/Defs-linux.gmk")
307 (("UNIXCOMMAND_PATH = /bin")
308 (string-append "UNIXCOMMAND_PATH = " corebin))
309 (("USRBIN_PATH = /usr/bin")
310 (string-append "USRBIN_PATH = " corebin))
311 (("DEVTOOLS_PATH *= */usr/bin")
312 (string-append "DEVTOOLS_PATH = " corebin))
313 (("COMPILER_PATH *= */usr/bin")
314 (string-append "COMPILER_PATH = "
315 (dirname (search-input-file
316 (or native-inputs inputs)
317 "bin/gcc"))))
318 (("DEF_OBJCOPY *=.*objcopy")
319 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
320
321 ;; Fix path to alsa header.
322 (substitute* "jdk/make/common/shared/Sanity.gmk"
323 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
324 (string-append "ALSA_INCLUDE="
325 (search-input-file
326 inputs "include/alsa/version.h"))))
327
328 ;; Fix hard-coded utility paths.
329 (substitute* '("jdk/make/common/shared/Defs-utils.gmk"
330 "corba/make/common/shared/Defs-utils.gmk")
331 (("ECHO *=.*echo")
332 (string-append "ECHO = " (which "echo")))
333 (("^GREP *=.*grep")
334 (string-append "GREP = " (which "grep")))
335 (("EGREP *=.*egrep")
336 (string-append "EGREP = " (which "egrep")))
337 (("CPIO *=.*cpio")
338 (string-append "CPIO = " (which "cpio")))
339 (("READELF *=.*readelf")
340 (string-append "READELF = " (which "readelf")))
341 (("^ *AR *=.*ar")
342 (string-append "AR = " (which "ar")))
343 (("^ *TAR *=.*tar")
344 (string-append "TAR = " (which "tar")))
345 (("AS *=.*as")
346 (string-append "AS = " (which "as")))
347 (("LD *=.*ld")
348 (string-append "LD = " (which "ld")))
349 (("STRIP *=.*strip")
350 (string-append "STRIP = " (which "strip")))
351 (("NM *=.*nm")
352 (string-append "NM = " (which "nm")))
353 (("^SH *=.*sh")
354 (string-append "SH = " (which "bash")))
355 (("^FIND *=.*find")
356 (string-append "FIND = " (which "find")))
357 (("LDD *=.*ldd")
358 (string-append "LDD = " (which "ldd")))
359 (("NAWK *=.*(n|g)awk")
360 (string-append "NAWK = " (which "gawk")))
361 (("XARGS *=.*xargs")
362 (string-append "XARGS = " (which "xargs")))
363 (("UNZIP *=.*unzip")
364 (string-append "UNZIP = " (which "unzip")))
365 (("ZIPEXE *=.*zip")
366 (string-append "ZIPEXE = " (which "zip")))
367 (("SED *=.*sed")
368 (string-append "SED = " (which "sed"))))
369
370 ;; Some of these timestamps cause problems as they are more than
371 ;; 10 years ago, failing the build process.
372 (substitute* "jdk/src/share/classes/java/util/\
373CurrencyData.properties"
374 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
375 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
376 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
377 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY"))))))
378 (add-before 'configure 'set-additional-paths
379 (lambda* (#:key inputs #:allow-other-keys)
380 (setenv "CC" "gcc")
381 (setenv "CPATH"
382 (string-append #$(this-package-input "libxcomposite")
383 "/include/X11/extensions" ":"
384 #$(this-package-input "libxrender")
385 "/include/X11/extensions" ":"
386 #$(this-package-input "libxtst")
387 "/include/X11/extensions" ":"
388 #$(this-package-input "libxinerama")
389 "/include/X11/extensions" ":"
390 (or (getenv "CPATH") "")))
391 (setenv "ALT_OBJCOPY" (which "objcopy"))
392 (setenv "ALT_CUPS_HEADERS_PATH"
393 (string-append #$(this-package-input "cups")
394 "/include"))
395 (setenv "ALT_FREETYPE_HEADERS_PATH"
396 (string-append #$(this-package-input "freetype")
397 "/include"))
398 (setenv "ALT_FREETYPE_LIB_PATH"
399 (string-append #$(this-package-input "freetype")
400 "/lib"))))
401 (add-before 'build 'disable-os-version-check
402 ;; allow build on linux major version change
403 (lambda _
404 (setenv "DISABLE_HOTSPOT_OS_VERSION_CHECK" "ok")))
405 (add-before 'check 'fix-test-framework
406 (lambda _
407 ;; Fix PATH in test environment
408 (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
409 (("PATH=/bin:/usr/bin")
410 (string-append "PATH=" (getenv "PATH"))))
411 (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
412 (("/usr/bin/env") (which "env")))
413 (substitute* "openjdk.src/hotspot/test/test_env.sh"
414 (("/bin/rm") (which "rm"))
415 (("/bin/cp") (which "cp"))
416 (("/bin/mv") (which "mv")))))
417 (add-before 'check 'fix-hotspot-tests
418 (lambda _
419 (with-directory-excursion "openjdk.src/hotspot/test/"
420 (substitute* "jprt.config"
421 (("PATH=\"\\$\\{path4sdk\\}\"")
422 (string-append "PATH=" (getenv "PATH")))
423 (("make=/usr/bin/make")
424 (string-append "make=" (which "make"))))
425 (substitute* '("runtime/6626217/Test6626217.sh"
426 "runtime/7110720/Test7110720.sh")
427 (("/bin/rm") (which "rm"))
428 (("/bin/cp") (which "cp"))
429 (("/bin/mv") (which "mv"))))))
430 (add-before 'check 'fix-jdk-tests
431 (lambda _
432 (with-directory-excursion "openjdk.src/jdk/test/"
433 (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
434 (("/bin/pwd") (which "pwd")))
435 (substitute* "com/sun/jdi/ShellScaffold.sh"
436 (("/bin/kill") (which "kill")))
437 (substitute* "start-Xvfb.sh"
438 ;;(("/usr/bin/X11/Xvfb") (which "Xvfb"))
439 (("/usr/bin/nohup") (which "nohup")))
440 (substitute* "javax/security/auth/Subject/doAs/Test.sh"
441 (("/bin/rm") (which "rm")))
442 (substitute* "tools/launcher/MultipleJRE.sh"
443 (("echo \"#!/bin/sh\"")
444 (string-append "echo \"#!" (which "rm") "\""))
445 (("/usr/bin/zip") (which "zip")))
446 (substitute* "com/sun/jdi/OnThrowTest.java"
447 (("#!/bin/sh") (string-append "#!" (which "sh"))))
448 (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
449 (("/usr/bin/uptime") (which "uptime")))
450 (substitute* "java/lang/ProcessBuilder/Basic.java"
451 (("/usr/bin/env") (which "env"))
452 (("/bin/false") (which "false"))
453 (("/bin/true") (which "true"))
454 (("/bin/cp") (which "cp"))
455 (("/bin/sh") (which "sh")))
456 (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
457 (("/bin/sh") (which "sh")))
458 (substitute* "java/lang/ProcessBuilder/Zombies.java"
459 (("/usr/bin/perl") (which "perl"))
460 (("/bin/ps") (which "ps"))
461 (("/bin/true") (which "true")))
462 (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
463 (("/usr/bin/tee") (which "tee")))
464 (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
465 (("/bin/true") (which "true")))
466 (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
467 (("/bin/cat") (which "cat")))
468 (substitute* "java/lang/Runtime/exec/ExitValue.java"
469 (("/bin/sh") (which "sh"))
470 (("/bin/true") (which "true"))
471 (("/bin/kill") (which "kill")))
472 (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
473 (("/usr/bin/echo") (which "echo")))
474 (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
475 (("/usr/bin/cat") (which "cat")))
476 (substitute* "java/lang/Runtime/exec/SleepyCat.java"
477 (("/bin/cat") (which "cat"))
478 (("/bin/sleep") (which "sleep"))
479 (("/bin/sh") (which "sh")))
480 (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
481 (("/bin/cat") (which "cat")))
482 (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
483 (("/bin/chmod") (which "chmod")))
484 (substitute* "java/util/zip/ZipFile/Assortment.java"
485 (("/bin/sh") (which "sh"))))))
486 (replace 'check
487 (lambda* (#:key tests? #:allow-other-keys)
488 ;; The "make check-*" targets always return zero, so we need to
489 ;; check for errors in the associated log files to determine
490 ;; whether any tests have failed.
491 (when tests?
492 (use-modules (ice-9 rdelim))
493 (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
494 (checker (lambda (port)
495 (let loop ()
496 (let ((line (read-line port)))
497 (cond
498 ((eof-object? line) #t)
499 ((regexp-exec error-pattern line)
500 (error "test failed"))
501 (else (loop)))))))
502 (run-test (lambda (test)
503 (invoke "make" test)
504 (call-with-input-file
505 (string-append "test/" test ".log")
506 checker))))
507 (run-test "check-hotspot")
508 (run-test "check-langtools")
509 (run-test "check-jdk")))))
510 (replace 'install
511 (lambda _
512 (copy-recursively "openjdk.build/docs"
513 (string-append #$output:doc
514 "/share/doc/icedtea"))
515 (copy-recursively "openjdk.build/j2re-image" #$output)
516 (copy-recursively "openjdk.build/j2sdk-image" #$output:jdk)))
517 (add-after 'install 'install-libjvm
518 ;; Some of the libraries in the lib/amd64 folder link to libjvm.so.
519 ;; But that shared object is located in the server/ folder, so it
520 ;; cannot be found. This phase creates a symbolic link in the
521 ;; lib/amd64 folder so that the other libraries can find it.
522 ;;
523 ;; See:
524 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
525 ;;
526 ;; FIXME: Find the bug in the build system, so that this symlink is
527 ;; not needed.
528 (lambda _
529 (let ((lib-path (string-append #$output "/lib/"
530 #$(system->icedtea-arch))))
531 (symlink (string-append lib-path "/server/libjvm.so")
532 (string-append lib-path "/libjvm.so")))))
533 ;; By default IcedTea only generates an empty keystore. In order to
534 ;; be able to use certificates in Java programs we need to generate a
535 ;; keystore from a set of certificates. For convenience we use the
536 ;; certificates from the nss-certs package.
537 (add-after 'install 'install-keystore
538 (lambda* (#:key inputs #:allow-other-keys)
539 (use-modules (ice-9 rdelim))
540 (let* ((keystore "cacerts")
541 (certs-dir (search-input-directory inputs
542 "etc/ssl/certs"))
543 (keytool (string-append #$output:jdk "/bin/keytool")))
544 (define (extract-cert file target)
545 (call-with-input-file file
546 (lambda (in)
547 (call-with-output-file target
548 (lambda (out)
549 (let loop ((line (read-line in 'concat))
550 (copying? #f))
551 (cond
552 ((eof-object? line) #t)
553 ((string-prefix? "-----BEGIN" line)
554 (display line out)
555 (loop (read-line in 'concat) #t))
556 ((string-prefix? "-----END" line)
557 (display line out)
558 #t)
559 (else
560 (when copying? (display line out))
561 (loop (read-line in 'concat) copying?)))))))))
562 (define (import-cert cert)
563 (format #t "Importing certificate ~a\n" (basename cert))
564 (let ((temp "tmpcert"))
565 (extract-cert cert temp)
566 (let ((port (open-pipe* OPEN_WRITE keytool
567 "-import"
568 "-alias" (basename cert)
569 "-keystore" keystore
570 "-storepass" "changeit"
571 "-file" temp)))
572 (display "yes\n" port)
573 (when (not (zero? (status:exit-val (close-pipe port))))
574 (format #t "failed to import ~a\n" cert)))
575 (delete-file temp)))
576
577 ;; This is necessary because the certificate directory contains
578 ;; files with non-ASCII characters in their names.
579 (setlocale LC_ALL "C.UTF-8")
580 (setenv "LC_ALL" "C.UTF-8")
581
582 (for-each import-cert (find-files certs-dir "\\.pem$"))
583 (mkdir-p (string-append #$output "/lib/security"))
584 (mkdir-p (string-append #$output:jdk "/jre/lib/security"))
585
586 ;; The cacerts files we are going to overwrite are chmod'ed as
587 ;; read-only (444) in icedtea-8 (which derives from this
588 ;; package). We have to change this so we can overwrite them.
589 (chmod (string-append #$output "/lib/security/" keystore)
590 #o644)
591 (chmod (string-append #$output:jdk
592 "/jre/lib/security/" keystore) #o644)
593
594 (install-file keystore
595 (string-append #$output "/lib/security"))
596 (install-file keystore
597 (string-append #$output:jdk
598 "/jre/lib/security"))))))))
599 (native-inputs
600 ;; XXX: Compiling with gcc-14 will encounter the following error:
601 ;; BUILD FAILED:
602 ;; /tmp/guix-build-icedtea-2.6.13.drv-0/icedtea-2.6.13/openjdk/langtools/
603 ;; make/build.xml:452: The following error occurred while executing this
604 ;; line:
605 ;; java.lang.AbstractMethodError: java.lang.Throwable.toString()Ljava/lang/String;
606 `(("gcc" ,gcc-13)
607 ("openjdk-src"
608 ,(drop "openjdk"
609 "0l34ikyf62hbzlf9032alzkkqvf7bpmckz4gvirvph755w7gka8l"))
610 ("corba-drop"
611 ,(drop "corba"
612 "050gv2jbg1pi6qkn8w18bwpbklfa5b0kymjvan9pncddbj8m84fz"))
613 ("jaxp-drop"
614 ,(drop "jaxp"
615 "1k6yldwnxfzdg5926r1nlfv8d1r1j7rlp2nkz6gqh05vgyamnfhl"))
616 ("jaxws-drop"
617 ,(drop "jaxws"
618 "110j7jlz47x2gg6f7653x12mssan5kvj9l9h1m1c8c92drfxbqyk"))
619 ("jdk-drop"
620 ,(drop "jdk"
621 "0d1mca38ksxvdskp9im3pp7fdijhj1n3lwq9w13r9s4v3qyskgdd"
622 (search-patches "jdk-currency-time-bomb.patch")))
623 ("langtools-drop"
624 ,(drop "langtools"
625 "0nq5236fzxn3p6x8cgncl56mzcmsj07q9gymysnws4c8byc6n0qj"))
626 ("hotspot-drop"
627 ,(origin
628 (method url-fetch)
629 (uri (string-append
630 "http://icedtea.classpath.org/downloads/drops"
631 "/icedtea7/" version "/hotspot.tar.bz2"))
632 (sha256
633 (base32
634 "17bdv39n4lh8l5737c96f3xgamx4y305m067p01cywgp7zaddqws"))
635 (patches (search-patches
636 "icedtea-7-hotspot-aarch64-use-c++98.patch"
637 "icedtea-7-hotspot-pointer-comparison.patch"))))
638 ("ant" ,ant-bootstrap)
639 ("attr" ,attr)
640 ("classpath" ,classpath-devel)
641 ("coreutils" ,coreutils)
642 ("diffutils" ,diffutils) ;for tests
643 ("ecj4-javac-wrapper" ,ecj4-javac-wrapper)
644 ("fastjar" ,fastjar) ;only for the configure phase; we actually use gjar
645 ("gawk" ,gawk)
646 ("grep" ,grep)
647 ("jamvm" ,jamvm-with-ecj4)
648 ("libtool" ,libtool)
649 ("pkg-config" ,pkg-config)
650 ("wget" ,wget)
651 ("which" ,which)
652 ("cpio" ,cpio)
653 ("zip" ,zip)
654 ("unzip" ,unzip)
655 ("libxslt" ,libxslt) ;for xsltproc
656 ("nss-certs" ,nss-certs)
657 ("perl" ,perl)
658 ("procps" ,procps))) ;for "free", even though I'm not sure we should use it
659 (inputs
660 (list alsa-lib
661 cups
662 fontconfig
663 freetype
664 giflib
665 gtk+-2
666 lcms
667 libjpeg-turbo
668 libpng
669 libx11
670 libxcomposite
671 libxi
672 libxinerama
673 libxrender
674 libxt
675 libxtst
676 mit-krb5
677 nss
678 pcsc-lite
679 zlib))
680 (home-page "https://icedtea.classpath.org")
681 (synopsis "Java development kit")
682 (description
683 "This package provides the Java development kit OpenJDK built with the
684IcedTea build harness.")
685
686 ;; 'configure' lists "mips" and "mipsel", but not "mips64el'.
687 (supported-systems (delete "mips64el-linux" %supported-systems))
688
689 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
690 ;; same license as both GNU Classpath and OpenJDK.
691 (license license:gpl2+))))
692
693(define-public icedtea-8
694 (let* ((version "3.19.0")
695 (drop (lambda* (name hash #:optional (patches '()))
696 (origin
697 (method url-fetch)
698 (uri (string-append
699 "http://icedtea.classpath.org/download/drops"
700 "/icedtea8/" version "/" name ".tar.xz"))
701 (sha256 (base32 hash))
702 (patches patches)))))
703 (package
704 (inherit icedtea-7)
705 (version "3.19.0")
706 (source (origin
707 (method url-fetch)
708 (uri (string-append
709 "http://icedtea.wildebeest.org/download/source/icedtea-"
710 version ".tar.xz"))
711 (sha256
712 (base32
713 "1cmms7cb2sav3ywc36ynqmybzx73sl279rm6j8i5nqrmp98ixmpf"))
714 (modules '((guix build utils)))
715 (snippet
716 '(substitute* '("configure"
717 "acinclude.m4")
718 ;; Do not embed build time
719 (("(DIST_ID=\"Custom build).*$" _ prefix)
720 (string-append prefix "\"\n"))
721 ;; Do not leak information about the build host
722 (("DIST_NAME=\"\\$build_os\"")
723 "DIST_NAME=\"guix\"")))))
724 (arguments
725 (substitute-keyword-arguments (package-arguments icedtea-7)
726 ((#:imported-modules modules %default-gnu-imported-modules)
727 (cons '(guix build ant-build-system) modules))
728 ((#:disallowed-references refs '())
729 (cons (gexp-input
730 (this-package-native-input "jdk")
731 "jdk")
732 refs))
733 ((#:modules modules %default-gnu-modules)
734 (append '(((guix build ant-build-system) #:prefix ant:)
735 (ice-9 match)
736 (ice-9 popen)
737 (srfi srfi-1)
738 (srfi srfi-19)
739 (srfi srfi-26))
740 modules))
741 ((#:configure-flags _ '())
742 #~(let ((jdk (assoc-ref %build-inputs "jdk")))
743 (list (string-append "CFLAGS=-fcommon"
744 " -Wno-error=implicit-function-declaration"
745 " -Wno-error=implicit-int"
746 " -Wno-error=incompatible-pointer-types"
747 " -Wno-error=int-conversion")
748 "CXXFLAGS=-fcommon"
749 "--enable-bootstrap"
750 "--enable-nss"
751 (string-append "--with-parallel-jobs="
752 (number->string (parallel-job-count)))
753 ;; Java Flight Recorder isn't supported on some architectures.
754 #$@(if (target-ppc32?)
755 #~("--enable-jfr=no")
756 #~())
757 "--disable-docs" ; This phase can take hours on slow machines.
758 "--disable-downloading"
759 "--disable-system-pcsc"
760 "--disable-system-sctp"
761 "--disable-tests" ;they are run in the check phase instead
762 "--with-openjdk-src-dir=./openjdk.src"
763 (string-append "--with-jdk-home=" jdk))))
764 ((#:phases phases '%standard-phases)
765 #~(modify-phases #$phases
766 (delete 'fix-x11-extension-include-path)
767 (delete 'patch-paths)
768 (delete 'set-additional-paths)
769 (delete 'patch-patches)
770 (delete 'patch-bitrot)
771 (delete 'use-classpath)
772 (replace 'build
773 (lambda* (#:key (make-flags '()) #:allow-other-keys)
774 ;; Prevent passing -j (parallel-job-count) to make, which
775 ;; is rejected by the build Makefiles; this does *not*
776 ;; disable parallel builds.
777 (apply invoke "make" make-flags)))
778 ;; Prevent the keytool from recording the current time when
779 ;; adding certificates at build time.
780 (add-after 'unpack 'patch-keystore
781 (lambda _
782 (substitute* "openjdk.src/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java"
783 (("date = new Date\\(\\);")
784 "\
785date = (System.getenv(\"SOURCE_DATE_EPOCH\") != null) ?\
786new Date(Long.parseLong(System.getenv(\"SOURCE_DATE_EPOCH\"))) :\
787new Date();"))))
788 (add-after 'unpack 'patch-jni-libs
789 ;; Hardcode dynamically loaded libraries.
790 (lambda _
791 (define (icedtea-or-openjdk? path)
792 (or (string-contains path "openjdk")
793 (string-contains path "icedtea")))
794
795 (let* ((library-path (remove icedtea-or-openjdk?
796 (search-path-as-string->list
797 (getenv "LIBRARY_PATH"))))
798 (find-library (lambda (name)
799 (or (search-path
800 library-path
801 (string-append "lib" name ".so"))
802 (string-append "lib" name ".so")))))
803 (for-each
804 (lambda (file)
805 (catch 'decoding-error
806 (lambda ()
807 (substitute* file
808 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
809 _ name version)
810 (string-append "\"" (find-library name) "\""))
811 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
812 (string-append "\"" (find-library name) "\""))))
813 (lambda _
814 ;; Those are safe to skip.
815 (format (current-error-port)
816 "warning: failed to substitute: ~a~%"
817 file))))
818 (find-files "openjdk.src/jdk/src/solaris/native"
819 "\\.c|\\.h")))))
820 (replace 'fix-openjdk
821 (lambda _
822 (substitute*
823 '("openjdk.src/jdk/src/solaris/native/java/net/PlainSocketImpl.c"
824 "openjdk.src/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c")
825 (("#include <sys/sysctl.h>")
826 "#include <linux/sysctl.h>"))))
827 (replace 'install
828 (lambda _
829 (copy-recursively "openjdk.build/docs"
830 (string-append #$output:doc
831 "/share/doc/icedtea"))
832 (copy-recursively "openjdk.build/images/j2re-image" #$output)
833 (copy-recursively "openjdk.build/images/j2sdk-image" #$output:jdk)
834 ;; Install the nss.cfg file to JRE to enable SSL/TLS
835 ;; support via NSS.
836 (copy-file (string-append #$output:jdk
837 "/jre/lib/security/nss.cfg")
838 (string-append #$output "/lib/security/nss.cfg"))))
839 (add-after 'install 'strip-jar-timestamps
840 (assoc-ref ant:%standard-phases 'strip-jar-timestamps))))))
841 (native-inputs
842 `(("jdk" ,icedtea-7 "jdk")
843 ("openjdk-src"
844 ,(drop "openjdk"
845 "1l3bzmd3s38scxpwamfhnwbv7vndgjq6hz3bl58437fgl9kgbl69"))
846 ("aarch32-drop"
847 ,(drop "aarch32"
848 "0k4dwpi3x3lj41rj32xyxbn76r7cb2g2whh44r1z4iwhw1xd2lpq"))
849 ("corba-drop"
850 ,(drop "corba"
851 "0xhh6gf5gh5c6vf1607xcy49wnp5prch2rim13x14wvsn817xf0r"))
852 ("jaxp-drop"
853 ,(drop "jaxp"
854 "043g335rgi5ipl8dp3q2cc3gcfhxk77ipxs43sv344z71bn8xmxr"))
855 ("jaxws-drop"
856 ,(drop "jaxws"
857 "1pc0pv4v2mn2mjc0vp19d94v2150xigyhxsmckqasy647zcm6w0r"))
858 ("jdk-drop"
859 ,(drop "jdk"
860 "1742lcm55l8zhi522x83v65ccr0rd6511q9rj7crw44x3ymdrhrv"
861 (search-patches "jdk-currency-time-bomb2.patch")))
862 ("langtools-drop"
863 ,(drop "langtools"
864 "08iz7p2xcddlphipf6gahyabr5cawlnydap12p1n4f0md069b50b"))
865 ("hotspot-drop"
866 ,(drop "hotspot"
867 "1ffaxfnb3yn1i7crivqigc1r1q0z6cp044i6nfring4z6c8pfhd2"))
868 ("nashorn-drop"
869 ,(drop "nashorn"
870 "15fn7cpm2i1npa88h57njxg0f8qkrqhrc30pb54d3hxlx5zyjl94"))
871 ("shenandoah-drop"
872 ,(drop "shenandoah"
873 "1jjzjjx1ykyhbc4llh8249dlr8j5g1ki6r7g9baj2mxyb9whc5nq"))
874 ,@(fold alist-delete (package-native-inputs icedtea-7)
875 '("openjdk-src" "corba-drop" "jaxp-drop" "jaxws-drop"
876 "jdk-drop" "langtools-drop" "hotspot-drop"
877 "classpath" "ecj4-javac-wrapper" "jamvm" "fastjar")))))))
878
879(define-public icedtea icedtea-8)
880
881(define-public openjdk9
882 (package
883 (name "openjdk")
884 (version "9.181")
885 (source (origin
886 (method hg-fetch)
887 (uri (hg-reference (url "https://hg.openjdk.org/jdk/jdk")
888 (changeset "jdk-9+181")))
889 (file-name (hg-file-name name version))
890 (modules '((guix build utils)))
891 (snippet '(for-each delete-file
892 (find-files "." ".*.(bin|exe|jar)$")))
893 (sha256
894 (base32
895 "1v92nzdqx07c35x945awzir4yk0fk22vky6fpp8mq9js930sxsz0"))
896 (patches
897 (search-patches "openjdk-9-pointer-comparison.patch"
898 "openjdk-9-classlist-reproducibility.patch"
899 "openjdk-currency-time-bomb.patch"
900 "openjdk-9-jar-reproducibility.patch"
901 "openjdk-9-module-reproducibility.patch"
902 "openjdk-9-module2-reproducibility.patch"
903 "openjdk-9-module3-reproducibility.patch"
904 "openjdk-9-idlj-reproducibility.patch"
905 "openjdk-9-setsignalhandler.patch"))))
906 (build-system gnu-build-system)
907 (outputs '("out" "jdk" "doc"))
908 (arguments
909 (list
910 #:imported-modules
911 (cons '(guix build ant-build-system)
912 %default-gnu-imported-modules)
913 #:modules
914 (append '((ice-9 match)
915 (ice-9 popen)
916 (srfi srfi-1)
917 (srfi srfi-26))
918 %default-gnu-modules)
919 #:tests? #f ; require jtreg
920 #:make-flags #~(list "all")
921 #:disallowed-references
922 (list (this-package-native-input "icedtea")
923 (gexp-input (this-package-native-input "icedtea") "jdk"))
924
925 #:phases
926 #~(modify-phases %standard-phases
927 #$@(if (target-aarch64?)
928 #~((add-after 'unpack 'patch-for-aarch64
929 (lambda _
930 (substitute* "hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp"
931 ;; This line is duplicated, so remove both occurrences,
932 ;; then add back one occurrence by substituting a
933 ;; comment that occurs once.
934 (("using MacroAssembler::call_VM_leaf_base;") "")
935 (("Interpreter specific version of call_VM_base")
936 "Interpreter specific version of call_VM_base
937 using MacroAssembler::call_VM_leaf_base;")))))
938 #~())
939 (add-after 'patch-source-shebangs 'fix-java-shebangs
940 (lambda _
941 ;; This file was "fixed" by patch-source-shebangs, but it requires
942 ;; this exact first line.
943 (substitute* "jdk/make/data/blacklistedcertsconverter/blacklisted.certs.pem"
944 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))))
945 (replace 'configure
946 (lambda* (#:key inputs #:allow-other-keys)
947 ;; TODO: unbundle libpng and lcms
948 (invoke "bash" "./configure"
949 ;; Add flags for compilation with gcc >= 10
950 (string-append "--with-extra-cflags=-fcommon"
951 " -fno-delete-null-pointer-checks"
952 " -fno-lifetime-dse"
953 ;; flags for compilation with gcc >= 14.
954 " -Wno-error=int-conversion")
955 (string-append "--with-freetype="
956 (assoc-ref inputs "freetype"))
957 "--disable-freetype-bundling"
958 "--disable-warnings-as-errors"
959 "--disable-hotspot-gtest"
960 "--with-giflib=system"
961 "--with-libjpeg=system"
962 (string-append "--prefix=" #$output))))
963 (add-before 'build 'write-source-revision-file
964 (lambda _
965 (with-output-to-file ".src-rev"
966 (lambda _
967 (display #$(package-version this-package))))))
968 (replace 'build
969 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
970 (apply invoke "make"
971 (format #f "JOBS=~a" (if parallel-build?
972 (parallel-job-count)
973 1))
974 make-flags)))
975 (add-after 'unpack 'patch-jni-libs
976 ;; Hardcode dynamically loaded libraries.
977 (lambda _
978 (define (icedtea-or-openjdk? path)
979 (or (string-contains path "openjdk")
980 (string-contains path "icedtea")))
981
982 (let* ((library-path (remove icedtea-or-openjdk?
983 (search-path-as-string->list
984 (getenv "LIBRARY_PATH"))))
985 (find-library (lambda (name)
986 (or (search-path
987 library-path
988 (string-append "lib" name ".so"))
989 (string-append "lib" name ".so")))))
990 (for-each
991 (lambda (file)
992 (catch 'decoding-error
993 (lambda ()
994 (substitute* file
995 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
996 _ name version)
997 (string-append "\"" (find-library name) "\""))
998 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
999 (string-append "\"" (find-library name) "\""))))
1000 (lambda _
1001 ;; Those are safe to skip.
1002 (format (current-error-port)
1003 "warning: failed to substitute: ~a~%"
1004 file))))
1005 (find-files "."
1006 "\\.c$|\\.h$")))))
1007 ;; By default OpenJDK only generates an empty keystore. In order to
1008 ;; be able to use certificates in Java programs we need to generate a
1009 ;; keystore from a set of certificates. For convenience we use the
1010 ;; certificates from the nss-certs package.
1011 (add-after 'install 'install-keystore
1012 (lambda* (#:key inputs #:allow-other-keys)
1013 (use-modules (ice-9 rdelim))
1014 (let* ((keystore "cacerts")
1015 (certs-dir (search-input-directory inputs
1016 "etc/ssl/certs"))
1017 (keytool (string-append #$output:jdk "/bin/keytool")))
1018 (define (extract-cert file target)
1019 (call-with-input-file file
1020 (lambda (in)
1021 (call-with-output-file target
1022 (lambda (out)
1023 (let loop ((line (read-line in 'concat))
1024 (copying? #f))
1025 (cond
1026 ((eof-object? line) #t)
1027 ((string-prefix? "-----BEGIN" line)
1028 (display line out)
1029 (loop (read-line in 'concat) #t))
1030 ((string-prefix? "-----END" line)
1031 (display line out)
1032 #t)
1033 (else
1034 (when copying? (display line out))
1035 (loop (read-line in 'concat) copying?)))))))))
1036 (define (import-cert cert)
1037 (format #t "Importing certificate ~a\n" (basename cert))
1038 (let ((temp "tmpcert"))
1039 (extract-cert cert temp)
1040 (let ((port (open-pipe* OPEN_WRITE keytool
1041 "-import"
1042 "-alias" (basename cert)
1043 "-keystore" keystore
1044 "-storepass" "changeit"
1045 "-file" temp)))
1046 (display "yes\n" port)
1047 (when (not (zero? (status:exit-val (close-pipe port))))
1048 (format #t "failed to import ~a\n" cert)))
1049 (delete-file temp)))
1050
1051 ;; This is necessary because the certificate directory contains
1052 ;; files with non-ASCII characters in their names.
1053 (setlocale LC_ALL "C.UTF-8")
1054 (setenv "LC_ALL" "C.UTF-8")
1055
1056 (copy-file (string-append #$output
1057 "/lib/security/cacerts")
1058 keystore)
1059 (chmod keystore #o644)
1060 (for-each import-cert (find-files certs-dir "\\.pem$"))
1061 (mkdir-p (string-append #$output "/lib/security"))
1062 (mkdir-p (string-append #$output:jdk "/lib/security"))
1063
1064 ;; The cacerts files we are going to overwrite are chmod'ed as
1065 ;; read-only (444) in icedtea-8 (which derives from this
1066 ;; package). We have to change this so we can overwrite them.
1067 (chmod (string-append #$output
1068 "/lib/security/" keystore) #o644)
1069 (chmod (string-append #$output:jdk
1070 "/lib/security/" keystore) #o644)
1071
1072 (install-file keystore
1073 (string-append #$output
1074 "/lib/security"))
1075 (install-file keystore
1076 (string-append #$output:jdk
1077 "/lib/security")))))
1078 ;; Some of the libraries in the lib/ folder link to libjvm.so.
1079 ;; But that shared object is located in the server/ folder, so it
1080 ;; cannot be found. This phase creates a symbolic link in the
1081 ;; lib/ folder so that the other libraries can find it.
1082 ;;
1083 ;; See:
1084 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1085 ;;
1086 ;; FIXME: Find the bug in the build system, so that this symlink is
1087 ;; not needed.
1088 (add-after 'install 'install-libjvm
1089 (lambda* (#:key inputs #:allow-other-keys)
1090 (let* ((lib-out (string-append #$output "/lib"))
1091 (lib-jdk (string-append #$output:jdk "/lib")))
1092 (symlink (string-append lib-jdk "/server/libjvm.so")
1093 (string-append lib-jdk "/libjvm.so"))
1094 (symlink (string-append lib-out "/server/libjvm.so")
1095 (string-append lib-out "/libjvm.so")))))
1096 (replace 'install
1097 (lambda* (#:key outputs #:allow-other-keys)
1098 (let ((images (car (find-files "build" ".*-server-release"
1099 #:directories? #t))))
1100 (copy-recursively (string-append images "/images/jdk")
1101 #$output:jdk)
1102 (copy-recursively (string-append images "/images/jre") #$output)
1103 (copy-recursively (string-append images "/images/docs")
1104 #$output:doc))))
1105 (add-after 'install 'remove-extraneous-files
1106 (lambda* (#:key outputs #:allow-other-keys)
1107 ;; Remove the *.diz and src.zip files for space considerations.
1108 ;; The former are compressed debuginfo files not typically
1109 ;; shipped with Java distributions, while the later corresponds
1110 ;; to Java core API source files.
1111 (for-each delete-file
1112 (append-map (cut find-files <> "(^src\\.zip|\\.diz)$")
1113 (map (match-lambda
1114 ((name . dir)
1115 dir))
1116 outputs)))))
1117 (add-after 'remove-extraneous-files 'strip-zip-timestamps
1118 (lambda* (#:key outputs #:allow-other-keys)
1119 (for-each
1120 (lambda (zip)
1121 (let ((dir (mkdtemp "zip-contents.XXXXXX")))
1122 (with-directory-excursion dir
1123 ;; This is an exact copy of the implementation of invoke,
1124 ;; but this accepts exit code 1 as OK.
1125 (let ((code (system* "unzip" "--" zip)))
1126 ;; jmod files are zip files with an extra header in
1127 ;; front. unzip will warn about that -- but otherwise
1128 ;; work.
1129 (when (> (status:exit-val code) 1) ; 1 is just a warning
1130 (raise
1131 (condition
1132 (&invoke-error
1133 (program "unzip")
1134 (arguments (list "--" zip))
1135 (exit-status (status:exit-val code))
1136 (term-signal (status:term-sig code))
1137 (stop-signal (status:stop-sig code))))))))
1138 (delete-file zip)
1139 (for-each (lambda (file)
1140 (let ((s (lstat file)))
1141 (format #t "reset ~a~%" file)
1142 (utime file 1 1 0 0
1143 AT_SYMLINK_NOFOLLOW)))
1144 (find-files dir #:directories? #t))
1145 (with-directory-excursion dir
1146 (let ((files (cons "./META-INF/MANIFEST.MF"
1147 (append
1148 (find-files "./META-INF" ".*")
1149 ;; for jmod:
1150 (list "./classes/module-info.class")
1151 (find-files "." ".*")))))
1152 (apply invoke "zip" "--symlinks" "-0" "-X" zip files)
1153 (when (string-suffix? ".jmod" zip)
1154 (let ((new-zip (string-append zip "n"))
1155 (contents (call-with-input-file zip
1156 (@ (ice-9 binary-ports)
1157 get-bytevector-all))))
1158 (call-with-output-file new-zip
1159 (lambda (output-port)
1160 ((@ (ice-9 binary-ports) put-bytevector)
1161 output-port
1162 #vu8(#x4a #x4d #x01 #x00)) ; JM
1163 ((@ (ice-9 binary-ports) put-bytevector)
1164 output-port
1165 contents)))
1166 (rename-file new-zip zip)))))))
1167 (append (find-files (string-append #$output:doc "/api")
1168 "\\.zip$")
1169 (find-files #$output:jdk "\\.jmod$")
1170 (list (string-append #$output:jdk
1171 "/lib/jrt-fs.jar"))
1172 (find-files (string-append #$output:jdk "/demo")
1173 "\\.jar$"))))))))
1174 (inputs
1175 (list alsa-lib
1176 cups
1177 fontconfig
1178 freetype
1179 giflib
1180 gtk+
1181 lcms
1182 elfutils
1183 libjpeg-turbo
1184 libice
1185 libpng
1186 libx11
1187 libxcomposite
1188 libxi
1189 libxinerama
1190 libxrender
1191 libxt
1192 libxtst))
1193 (native-inputs
1194 (list icedtea-8
1195 `(,icedtea-8 "jdk")
1196 ;; XXX: The build system fails with newer versions of GNU Make.
1197 gnu-make-4.2
1198 nss-certs
1199 unzip
1200 which
1201 zip))
1202 (home-page "https://openjdk.org/projects/jdk9/")
1203 (synopsis "Java development kit")
1204 (description
1205 "This package provides the Java development kit OpenJDK.")
1206 (license license:gpl2+)))
1207
1208(define-public openjdk10
1209 (package
1210 (inherit openjdk9)
1211 (name "openjdk")
1212 (version "10.46")
1213 (source (origin
1214 (method hg-fetch)
1215 (uri (hg-reference (url "https://hg.openjdk.org/jdk/jdk")
1216 (changeset "jdk-10+46")))
1217 (file-name (hg-file-name name version))
1218 (modules '((guix build utils)))
1219 (snippet `(begin
1220 (for-each delete-file
1221 (find-files "." ".*.(bin|exe|jar)$"))))
1222 (sha256
1223 (base32
1224 "0i47ar8lxzjrkkiwbzybfxs473390h4jq9ahm3xqdvy5zpchxy3y"))
1225 (patches (search-patches
1226 "openjdk-10-char-reproducibility.patch"
1227 "openjdk-10-classlist-reproducibility.patch"
1228 "openjdk-10-corba-reproducibility.patch"
1229 "openjdk-10-idlj-reproducibility.patch"
1230 "openjdk-10-module-reproducibility.patch"
1231 "openjdk-10-module3-reproducibility.patch"
1232 "openjdk-10-module4-reproducibility.patch"
1233 "openjdk-10-jar-reproducibility.patch"
1234 "openjdk-10-jtask-reproducibility.patch"
1235 "openjdk-10-pointer-comparison.patch"
1236 "openjdk-10-setsignalhandler.patch"
1237 "openjdk-currency-time-bomb2.patch"))))
1238 (arguments
1239 (substitute-keyword-arguments (package-arguments openjdk9)
1240 ((#:phases phases '%standard-phases)
1241 #~(modify-phases #$phases
1242 #$@(if (target-aarch64?)
1243 #~((replace 'patch-for-aarch64
1244 (lambda _
1245 (substitute* "src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp"
1246 ;; This line is duplicated, so remove both occurrences,
1247 ;; then add back one occurrence by substituting a
1248 ;; comment that occurs once.
1249 (("using MacroAssembler::call_VM_leaf_base;") "")
1250 (("Interpreter specific version of call_VM_base")
1251 (string-append "Interpreter specific version of call_VM_base\n"
1252 " using MacroAssembler::call_VM_leaf_base;"))))))
1253 #~())
1254 (replace 'fix-java-shebangs
1255 (lambda _
1256 ;; This file was "fixed" by patch-source-shebangs, but it requires
1257 ;; this exact first line.
1258 (substitute* "make/data/blacklistedcertsconverter/blacklisted.certs.pem"
1259 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))))
1260 (add-after 'unpack 'remove-timestamping
1261 (lambda _
1262 (substitute* "./src/hotspot/share/runtime/vm_version.cpp"
1263 (("__DATE__") "")
1264 (("__TIME__") ""))))
1265 (replace 'configure
1266 (lambda* (#:key inputs #:allow-other-keys)
1267 (invoke "bash" "./configure"
1268 ;; Add flags for compilation with gcc >= 10
1269 (string-append "--with-extra-cflags=-fcommon"
1270 " -fno-delete-null-pointer-checks"
1271 " -fno-lifetime-dse"
1272 ;; flags for compilation with gcc >= 14.
1273 " -Wno-error=int-conversion")
1274 (string-append "--with-freetype="
1275 (assoc-ref inputs "freetype"))
1276 "--disable-freetype-bundling"
1277 "--disable-warnings-as-errors"
1278 "--disable-hotspot-gtest"
1279 "--with-giflib=system"
1280 "--with-libjpeg=system"
1281 "--with-native-debug-symbols=zipped"
1282 (string-append "--prefix=" #$output))))
1283 (add-after 'unpack 'disable-warnings-as-errors
1284 (lambda _
1285 ;; It looks like the "--disable-warnings-as-errors" option of
1286 ;; the 'configure' phase is not working.
1287 (substitute* "make/autoconf/generated-configure.sh"
1288 (("-Werror") ""))))
1289 #$@(if (target-x86-32?)
1290 ;; On i686 the C2 compiler sometimes crashes when importing
1291 ;; certificates.
1292 #~((add-before 'install-keystore 'disable-C2-compiler
1293 (lambda _ (setenv "_JAVA_OPTIONS" "-XX:TieredStopAtLevel=1"))))
1294 #~())))
1295 ((#:disallowed-references refs '())
1296 (cons* (this-package-native-input "openjdk")
1297 (gexp-input (this-package-native-input "openjdk") "jdk")
1298 refs))))
1299 (native-inputs
1300 (list gnu-make-4.2
1301 openjdk9
1302 `(,openjdk9 "jdk")
1303 nss-certs
1304 unzip
1305 which
1306 zip))))
1307
1308(define-public openjdk11
1309 (package
1310 (name "openjdk")
1311 (version "11.0.22")
1312 (source (origin
1313 (method url-fetch)
1314 (uri (string-append "https://openjdk-sources.osci.io/openjdk11/openjdk-"
1315 version "-ga.tar.xz"))
1316 (file-name (string-append name "-" version ".tar.xz"))
1317 (sha256
1318 (base32
1319 "18ca4syp9xlrqjgyjkb1sp9835riy6aym5xs81r8byrz6jlb2473"))
1320 (modules '((guix build utils)))
1321 (snippet
1322 '(for-each delete-file (find-files "." "\\.(bin|exe|jar)$")))
1323 (patches
1324 (search-patches "openjdk-10-module3-reproducibility.patch"
1325 "openjdk-10-module4-reproducibility.patch"
1326 "openjdk-10-char-reproducibility.patch"
1327 "openjdk-11-classlist-reproducibility.patch"
1328 "openjdk-10-jar-reproducibility.patch"
1329 "openjdk-10-jtask-reproducibility.patch"
1330 "openjdk-currency-time-bomb2.patch"))))
1331 (build-system gnu-build-system)
1332 (outputs '("out" "jdk" "doc"))
1333 (arguments
1334 (list
1335 ;; Prevent a java.util.ConcurrentModificationException.
1336 #:parallel-build? #f
1337 #:modules `((guix build gnu-build-system)
1338 (guix build utils)
1339 (ice-9 match)
1340 (ice-9 popen)
1341 (srfi srfi-1)
1342 (srfi srfi-26))
1343
1344 #:disallowed-references
1345 (list (this-package-native-input "openjdk")
1346 (gexp-input (this-package-native-input "openjdk")
1347 "jdk"))
1348
1349 #:tests? #f ; requires jtreg
1350 ;; TODO package jtreg
1351 #:configure-flags
1352 #~(list
1353 "--disable-hotspot-gtest" ;not currently running tests
1354 ;; Add flags for compilation with gcc >= 10.
1355 #$(string-append "--with-extra-cflags=-fcommon"
1356 " -fno-delete-null-pointer-checks"
1357 " -fno-lifetime-dse"
1358 ;; flags for compilation with gcc >= 14.
1359 " -Wno-error=int-conversion")
1360 ;; Otherwise, the '--enable-fast-install' causes an error.
1361 "--disable-option-checking"
1362 "--disable-warnings-as-errors"
1363 ;; Make validate-runpath pass (see:
1364 ;; http://issues.guix.info/issue/32894).
1365 "--with-native-debug-symbols=zipped"
1366 ;; Do not use the bundled libraries.
1367 "--with-giflib=system"
1368 "--with-lcms=system"
1369 "--with-libjpeg=system"
1370 "--with-libpng=system"
1371 "--with-version-pre="
1372 ;; Should be set by SOURCE_DATE_EPOCH handler, but isn't being
1373 ;; set; do it manually.
1374 "--with-hotspot-build-time=1970-01-01T00:00:01"
1375 "--enable-reproducible-build" ; to be sure
1376 ;; Allow the build system to locate the system freetype.
1377 (string-append "--with-freetype-include="
1378 #$(this-package-input "freetype") "/include")
1379 (string-append "--with-freetype-lib="
1380 #$(this-package-input "freetype") "/lib"))
1381 #:phases
1382 #~(modify-phases %standard-phases
1383 (add-after 'patch-source-shebangs 'fix-java-shebangs
1384 (lambda _
1385 ;; This file was "fixed" by patch-source-shebangs, but it requires
1386 ;; this exact first line.
1387 (substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
1388 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))
1389 (add-after 'unpack 'remove-timestamping
1390 (lambda _
1391 (substitute* "src/hotspot/share/runtime/abstract_vm_version.cpp"
1392 (("__DATE__") "")
1393 (("__TIME__") ""))))
1394 (add-after 'unpack 'patch-jni-libs
1395 ;; Hardcode dynamically loaded libraries.
1396 (lambda _
1397 (define (icedtea-or-openjdk? path)
1398 (or (string-contains path "openjdk")
1399 (string-contains path "icedtea")))
1400
1401 (let* ((library-path (remove icedtea-or-openjdk?
1402 (search-path-as-string->list
1403 (getenv "LIBRARY_PATH"))))
1404 (find-library (lambda (name)
1405 (or (search-path
1406 library-path
1407 (string-append "lib" name ".so"))
1408 (string-append "lib" name ".so")))))
1409 (for-each
1410 (lambda (file)
1411 (catch 'decoding-error
1412 (lambda ()
1413 (substitute* file
1414 (("VERSIONED_JNI_LIB_NAME\\(\"([^\"]*)\", \"([^\"]*)\"\\)"
1415 _ name version)
1416 (string-append "\"" (find-library name) "\""))
1417 (("JNI_LIB_NAME\\(\"([^\"]*)\"\\)" _ name)
1418 (string-append "\"" (find-library name) "\""))))
1419 (lambda _
1420 ;; Those are safe to skip.
1421 (format (current-error-port)
1422 "warning: failed to substitute: ~a~%"
1423 file))))
1424 (find-files "." "\\.c$|\\.h$")))))
1425 (add-before 'build 'write-source-revision-file
1426 (lambda _
1427 (with-output-to-file ".src-rev"
1428 (lambda _
1429 (display #$(package-version this-package))))))
1430 (replace 'build
1431 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
1432 (apply invoke "make" "all"
1433 (format #f "JOBS=~a" (if parallel-build?
1434 (parallel-job-count)
1435 1))
1436 make-flags)))
1437 ;; jdk 11 does not build jre by default any more; so explicitly build
1438 ;; it (see:
1439 ;; https://github.com/AdoptOpenJDK/openjdk-build/issues/356).
1440 (add-after 'build 'build-jre
1441 (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
1442 (apply invoke "make" "legacy-jre-image"
1443 (format #f "JOBS=~a" (if parallel-build?
1444 (parallel-job-count)
1445 1))
1446 make-flags)))
1447 (replace 'install
1448 (lambda _
1449 (let ((images (car (find-files "build" "-server-release"
1450 #:directories? #t))))
1451 (copy-recursively (string-append images "/images/jdk")
1452 #$output:jdk)
1453 (copy-recursively (string-append images "/images/jre")
1454 #$output)
1455 (copy-recursively (string-append images "/images/docs")
1456 #$output:doc))))
1457 ;; Some of the libraries in the lib/ folder link to libjvm.so.
1458 ;; But that shared object is located in the server/ folder, so it
1459 ;; cannot be found. This phase creates a symbolic link in the
1460 ;; lib/ folder so that the other libraries can find it.
1461 ;;
1462 ;; See:
1463 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1464 ;;
1465 ;; FIXME: Find the bug in the build system, so that this symlink is
1466 ;; not needed.
1467 (add-after 'install 'install-libjvm
1468 (lambda _
1469 (let ((lib-out (string-append #$output "/lib"))
1470 (lib-jdk (string-append #$output:jdk "/lib")))
1471 (symlink (string-append lib-jdk "/server/libjvm.so")
1472 (string-append lib-jdk "/libjvm.so"))
1473 (symlink (string-append lib-out "/server/libjvm.so")
1474 (string-append lib-out "/libjvm.so")))))
1475 (add-after 'install 'remove-extraneous-files
1476 (lambda* (#:key outputs #:allow-other-keys)
1477 ;; Remove the *.diz and src.zip files for space considerations.
1478 ;; The former are compressed debuginfo files not typically
1479 ;; shipped with Java distributions, while the later corresponds
1480 ;; to Java core API source files.
1481 (for-each delete-file
1482 (append-map (cut find-files <> "(^src\\.zip|\\.diz)$")
1483 (map (match-lambda
1484 ((name . dir)
1485 dir))
1486 outputs)))))
1487 (add-after 'remove-extraneous-files 'strip-archive-timestamps
1488 (lambda _
1489 (use-modules (ice-9 binary-ports)
1490 (rnrs bytevectors))
1491 (letrec ((repack-archive
1492 (lambda (archive)
1493 (let ((dir (mkdtemp "zip-contents.XXXXXX")))
1494 (with-directory-excursion dir
1495 (invoke "unzip" archive))
1496 (delete-file archive)
1497 (for-each (compose repack-archive canonicalize-path)
1498 (find-files dir "(ct\\.sym|\\.jar)$"))
1499 (let ((reset-file-timestamp
1500 (lambda (file)
1501 (let ((s (lstat file)))
1502 (unless (eq? (stat:type s) 'symlink)
1503 (format #t "reset ~a~%" file)
1504 (utime file 0 0 0 0))))))
1505 (for-each reset-file-timestamp
1506 (find-files dir #:directories? #t)))
1507 (with-directory-excursion dir
1508 (let ((files (find-files ".")))
1509 (apply invoke "zip" "-0" "-X" archive files)))))))
1510 (for-each repack-archive
1511 (find-files #$output:doc "\\.zip$"))
1512 (for-each repack-archive
1513 (find-files #$output:jdk "\\.(zip|jar)$"))
1514 (repack-archive (string-append #$output:jdk "/lib/ct.sym"))
1515 (let ((repack-jmod
1516 (lambda (file-name)
1517 (call-with-input-file file-name
1518 (lambda (file)
1519 (let ((header #vu8(#x4a #x4d #x01 #x00)))
1520 (if (equal? (get-bytevector-n
1521 file (bytevector-length header))
1522 header)
1523 (let* ((header-length (bytevector-length header))
1524 (temp-file (mkstemp!
1525 (string-copy
1526 "temp-file.XXXXXX")))
1527 (temp-filename (port-filename temp-file))
1528 (content-length
1529 (- (stat:size (stat file))
1530 header-length)))
1531 (sendfile temp-file file content-length header-length)
1532 (delete-file file-name)
1533 (close-port temp-file)
1534 (repack-archive (canonicalize-path temp-filename))
1535 (call-with-output-file file-name
1536 (lambda (file)
1537 (put-bytevector file header)
1538 (call-with-input-file temp-filename
1539 (lambda (temp-file)
1540 (sendfile
1541 file temp-file
1542 (stat:size (stat temp-file)) 0)))))))))))))
1543 (for-each repack-jmod
1544 (find-files #$output:jdk "\\.jmod$"))))))
1545 (add-after 'install 'remove-timestamp-from-api-summary
1546 (lambda _
1547 (substitute* (string-append #$output:doc
1548 "/api/overview-summary.html")
1549 (("Generated by javadoc \\(11-internal\\).*$")
1550 "Generated by javadoc (11-internal) -->\n")))))))
1551 (inputs
1552 (list alsa-lib
1553 cups
1554 fontconfig
1555 freetype
1556 giflib
1557 gtk+
1558 lcms
1559 libjpeg-turbo
1560 libpng
1561 libx11
1562 libxext
1563 libxrandr
1564 libxrender
1565 libxt
1566 libxtst))
1567 (native-inputs
1568 (list autoconf
1569 bash ; not bash-minimal, needs ulimit
1570 openjdk10
1571 `(,openjdk10 "jdk")
1572 gnu-make-4.2
1573 nss-certs
1574 pkg-config
1575 unzip
1576 which
1577 zip))
1578 (home-page "https://openjdk.org/projects/jdk/11/")
1579 (synopsis "Java development kit")
1580 (description
1581 "This package provides the Java development kit OpenJDK.")
1582 (license license:gpl2+)
1583 (properties
1584 ;; At least on a Blackbird powerpc64le machine, the build takes more than
1585 ;; the default 3600s of silent timeout.
1586 `((max-silent-time . ,(* 3600 2))))))
1587
1588(define-syntax make-openjdk
1589 ;; Return an OpenJDK package at VERSION with checksum HASH, using BOOTSTRAP,
1590 ;; the bootstrap package. One or more FIELD can be provided to further
1591 ;; refine the package definition; for convenience, the BASE, NAME and
1592 ;; VERSION are defined in their scope.
1593 (lambda (x)
1594 (syntax-case x ()
1595 ((_ bootstrap version* hash field ...)
1596 (with-syntax ((base (datum->syntax x 'base))
1597 (name (datum->syntax x 'name))
1598 (version (datum->syntax x 'version)))
1599 #'(let ((base (package
1600 (inherit bootstrap)
1601 (name "openjdk")
1602 (version version*)
1603 (source
1604 (origin
1605 (inherit (package-source bootstrap))
1606 (method git-fetch)
1607 (uri (git-reference
1608 (url (format
1609 #f "https://github.com/openjdk/jdk~au"
1610 (version-major version*)))
1611 (commit (string-append "jdk-" version*
1612 "-ga"))))
1613 (file-name (git-file-name name version))
1614 (sha256 (base32 hash))))
1615 (properties
1616 '((release-tag-prefix . "jdk-")
1617 (release-tag-suffix . "-ga")
1618 (release-tag-version-delimiter . ".")))
1619 (native-inputs
1620 (modify-inputs native-inputs
1621 (replace "openjdk" bootstrap)))
1622 (home-page (string-append
1623 "https://openjdk.java.net/projects/jdk/"
1624 (version-major version)))))
1625 (name "openjdk")
1626 (version version*))
1627 (package
1628 (inherit base)
1629 field
1630 ...)))))))
1631
1632(define-public openjdk12
1633 (make-openjdk
1634 openjdk11 "12.33" "0pi2gwib3j2imi4l623iaywrmvfh9rqzh82lj2gxqbrmg55swvjf"
1635 (source
1636 (origin
1637 (method url-fetch)
1638 (uri "http://hg.openjdk.java.net/jdk/jdk/archive/0276cba45aac.tar.bz2")
1639 (file-name (string-append name "-" version ".tar.bz2"))
1640 (sha256
1641 (base32
1642 "0pi2gwib3j2imi4l623iaywrmvfh9rqzh82lj2gxqbrmg55swvjf"))
1643 (modules '((guix build utils)))
1644 (snippet
1645 '(for-each delete-file (find-files "." "\\.(bin|exe|jar)$")))
1646 (patches (search-patches "openjdk-10-setsignalhandler.patch"))))
1647 (arguments
1648 (substitute-keyword-arguments (package-arguments openjdk11)
1649 ;; Re-enable parallel build.
1650 ((#:parallel-build? _ #t) #t)
1651 ((#:phases phases)
1652 #~(modify-phases #$phases
1653 #$@(if (target-aarch64?)
1654 #~((add-after 'unpack 'patch-for-aarch64
1655 (lambda _
1656 (substitute* "src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp"
1657 ;; This line is duplicated, so remove both occurrences,
1658 ;; then add back one occurrence by substituting a
1659 ;; comment that occurs once.
1660 (("using MacroAssembler::call_VM_leaf_base;") "")
1661 (("Interpreter specific version of call_VM_base")
1662 (string-append "Interpreter specific version of call_VM_base\n"
1663 " using MacroAssembler::call_VM_leaf_base;"))))))
1664 #~())
1665 (replace 'remove-timestamping
1666 (lambda _
1667 (substitute* "src/hotspot/share/runtime/vm_version.cpp"
1668 (("__DATE__") "")
1669 (("__TIME__") ""))))
1670 (replace 'fix-java-shebangs
1671 (lambda _
1672 ;; 'blocked' was renamed to 'blacklisted' in this version for
1673 ;; some reason.
1674 (substitute* "make/data/blacklistedcertsconverter/\
1675blacklisted.certs.pem"
1676 (("^#!.*")
1677 "#! java BlacklistedCertsConverter SHA-256\n"))))))))))
1678
1679(define-public openjdk13
1680 (make-openjdk openjdk12 "13.0.14"
1681 "1v92i5rhahqkjw8mz09c9qasnxqc67ygy0y266kdmm534z0da755"
1682 (source (origin
1683 (inherit (package-source base))
1684 (patches (search-patches "openjdk-13-classlist-reproducibility.patch"
1685 "openjdk-10-jtask-reproducibility.patch"))))
1686 (arguments
1687 (substitute-keyword-arguments (package-arguments openjdk12)
1688 ((#:phases phases)
1689 #~(modify-phases #$phases
1690 (replace 'remove-timestamping
1691 (lambda _
1692 (substitute*
1693 "src/hotspot/share/runtime/abstract_vm_version.cpp"
1694 (("__DATE__") "")
1695 (("__TIME__") ""))))))))))
1696
1697(define-public openjdk14
1698 (make-openjdk
1699 openjdk13 "14.0.2"
1700 "07k9bsbxwyf2z2n50z96nvhsdai916mxdxcr5lm44jz7f6xrwfq6"
1701 (source (origin
1702 (inherit (package-source base))
1703 (snippet ;override snippet
1704 '(begin
1705 ;; The m4 macro uses 'help' to search for builtins, which is
1706 ;; not available in bash-minimal
1707 (substitute* "make/autoconf/basics.m4"
1708 (("if help") "if command -v"))
1709 (for-each delete-file (find-files "." "\\.(bin|exe|jar)$"))))
1710 (patches (search-patches "openjdk-10-setsignalhandler.patch"
1711 "openjdk-10-jtask-reproducibility.patch"
1712 "openjdk-13-classlist-reproducibility.patch"))))))
1713
1714(define-public openjdk15
1715 (make-openjdk
1716 openjdk14 "15.0.10"
1717 "0hdllv348bws6m992bh73jik18x0sv0k2m9l817b3zb7q802sp7x"
1718 (source (origin
1719 (inherit (package-source base))
1720 (modules '())
1721 (snippet #f)
1722 (patches
1723 (search-patches "openjdk-15-jtask-reproducibility.patch"
1724 "openjdk-15-xcursor-no-dynamic.patch"))))
1725 (inputs
1726 (modify-inputs inputs
1727 (append libxcursor))) ;for our patch to work
1728 (arguments
1729 (substitute-keyword-arguments (package-arguments base)
1730 ((#:implicit-inputs? _ #t)
1731 ;; This is necessary to avoid include ordering errors when adding a
1732 ;; lower GCC to native-inputs to avoid errors like "error: 'fesetround'
1733 ;; was not declared in this scope; did you mean 'setreuid'?"
1734 #f)
1735 ((#:configure-flags flags '%standard-phases)
1736 #~(cons "--without-gtest" ;this replaces...
1737 (delete "--disable-hotspot-gtest" #$flags))))) ;... this
1738 (native-inputs
1739 (append (modify-inputs native-inputs
1740 (delete "make" ;remove old gnu-make-4.2
1741 "openjdk") ;to remove non-jdk output
1742 (append `(,openjdk14 "jdk")))
1743 ;; On powerpc64le at least, GCC 14 cannot be used otherwise JDK 15
1744 ;; fails to bootstrap JDK 16, with incomprehensible errors like:
1745 ;; src/java.base/share/classes/java/lang/reflect/Proxy.java:1311:
1746 ;; error: integer number too large.
1747 (modify-inputs (%final-inputs)
1748 (replace "gcc" gcc-11))))))
1749
1750(define-public openjdk16
1751 (make-openjdk
1752 openjdk15 "16.0.2"
1753 "0587px2qbz07g3xi4a3ya6m630p72dvkxcn0bj1813pxnwvcgigz"
1754 (source (origin
1755 (inherit (package-source base))
1756 (patches (search-patches "openjdk-15-xcursor-no-dynamic.patch"
1757 "openjdk-10-setsignalhandler.patch"))))))
1758
1759(define-public openjdk17
1760 (make-openjdk
1761 openjdk16 "17.0.10"
1762 "1bq1rqnipz6wdr05s20gm8nlpb3328ljxckzvc5ag0gf7fzlhn5f"
1763 (source (origin
1764 (inherit (package-source base))
1765 (patches (search-patches "openjdk-15-xcursor-no-dynamic.patch"))))
1766 (arguments
1767 (substitute-keyword-arguments (package-arguments base)
1768 ((#:implicit-inputs? _ #t) #t) ;restore default
1769 ((#:phases phases)
1770 #~(modify-phases #$phases
1771 (replace 'fix-java-shebangs
1772 (lambda _
1773 ;; 'blacklisted' was renamed back to 'blocked'.
1774 (substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
1775 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))
1776 (native-inputs
1777 ;; Resume using the implicit inputs, including the current GCC.
1778 (fold alist-delete (package-native-inputs base)
1779 (map first (%final-inputs))))))
1780
1781(define-public openjdk18
1782 (make-openjdk openjdk17 "18.0.2.1"
1783 "0zxanjzz4p3psqahlidh55vx1ldanq70c2ygk3gcfn9a94vnr9rg"))
1784
1785(define-public openjdk19
1786 (make-openjdk openjdk18 "19.0.2"
1787 "08kvx7n8qhhfl25pig966881j5h4x7y0pf4brq16x0283fc0f4d4"
1788 (arguments
1789 (substitute-keyword-arguments (package-arguments openjdk18)
1790 ((#:phases phases)
1791 #~(modify-phases #$phases
1792 (replace 'fix-java-shebangs
1793 (lambda _
1794 ;; Update file path.
1795 (substitute* "src/java.base/share/data/blockedcertsconverter/blocked.certs.pem"
1796 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))
1797 (add-before 'configure 'define-java-environment-variables
1798 (lambda* (#:key inputs #:allow-other-keys)
1799 ;; Fix for "valid range 1980-01-01T00:00:02Z to 2099-12-31T23:59:59Z".
1800 (setenv "SOURCE_DATE_EPOCH" "1234567890")))))))))
1801
1802(define-public openjdk20
1803 (make-openjdk openjdk19 "20.0.2"
1804 "1af1v2c3d8x4c6shzl6cv9qwq7a4hn5map5pjh9vjcky0hkzd489"))
1805
1806(define-public openjdk21
1807 (make-openjdk openjdk20 "21.0.2"
1808 "0d1g3wnzr5whjpq8gvxq0h7kd7lxd3xgc6bh3kg8vzz096asn0kj"
1809 (source (origin
1810 (inherit (package-source base))
1811 (patches (search-patches "openjdk-21-fix-rpath.patch"
1812 "openjdk-15-xcursor-no-dynamic.patch"))))
1813 (arguments
1814 (substitute-keyword-arguments (package-arguments base)
1815 ((#:phases phases)
1816 #~(modify-phases #$phases
1817 (replace 'fix-java-shebangs
1818 (lambda _
1819 ;; 'blacklisted' was renamed back to 'blocked'.
1820 (substitute* "src/java.base/share/data/blockedcertsconverter/blocked.certs.pem"
1821 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))))
1822
1823(define-public openjdk22
1824 (make-openjdk
1825 openjdk21 "22.0.2"
1826 "1nj414yj6v9qrlm48yv5llr4jmgj9g20v6zsd39xrdx4x4x4p3b6"
1827 (arguments
1828 (substitute-keyword-arguments (package-arguments base)
1829 ((#:phases phases)
1830 #~(modify-phases #$phases
1831 (add-after 'unpack 'do-not-disable-new-dtags
1832 (lambda _
1833 ;; Our validate-runpath phases checks for RUNPATH, not RPATH.
1834 (substitute* "make/autoconf/flags-cflags.m4"
1835 ((" -Wl,--disable-new-dtags") ""))))))))))
1836
1837(define-public openjdk23
1838 (make-openjdk
1839 openjdk22 "23.0.2"
1840 "0kxllznzhgqfn8b97krg2yp1ag41g4phmgqahrvzafd2bq6zclnf"
1841 (source (origin
1842 (inherit (package-source base))
1843 ;; The 'openjdk-21-fix-rpath.patch' no longer applies, and it
1844 ;; appears not needed anymore. The
1845 ;; 'openjdk-15-xcursor-no-dynamic.patch' doesn't apply anymore;
1846 ;; the fix should be pursued in libx11 (see:
1847 ;; https://issues.guix.gnu.org/54654)
1848 (patches '())))))
1849
1850(define-public openjdk24
1851 (make-openjdk
1852 openjdk23 "24.0.1"
1853 "0h6sbzbjyqg85iml41pswdh2z3d7h2hhb0sd5yll37r1mj5lsxmx"
1854 (arguments
1855 (substitute-keyword-arguments (package-arguments base)
1856 ((#:configure-flags flags #~(list))
1857 (if (target-x86-32?)
1858 #~(cons* "--enable-deprecated-ports=yes" #$flags)
1859 flags))))))
1860
1861(define-public openjdk25
1862 (make-openjdk
1863 openjdk24 "25.0.2"
1864 "03aa34lscr3qbdl6qz3gqyp0nzkqfj02362mzmpkiq3y2g5xdnrj"
1865 (arguments
1866 (substitute-keyword-arguments (package-arguments base)
1867 ((#:configure-flags flags #~(list))
1868 (if (target-x86-32?)
1869 ;; Full builds on 32-bit x86 architectures are not supported as of
1870 ;; this version. Best we can do is to build with the "zero" variant.
1871 #~(cons* "--with-jvm-variants=zero"
1872 "--disable-precompiled-headers"
1873 #$flags)
1874 flags))
1875 ((#:phases phases #~%standard-phases)
1876 (if (target-x86-32?)
1877 #~(modify-phases #$phases
1878 (replace 'install
1879 (lambda _
1880 (let ((images (car (find-files "build" "-zero-release"
1881 #:directories? #t))))
1882 (copy-recursively (string-append images "/images/jdk")
1883 #$output:jdk)
1884 (copy-recursively (string-append images "/images/jre")
1885 #$output)
1886 (copy-recursively (string-append images "/images/docs")
1887 #$output:doc))))
1888 (replace 'install-libjvm
1889 (lambda _
1890 (let ((lib-out (string-append #$output "/lib"))
1891 (lib-jdk (string-append #$output:jdk "/lib")))
1892 (symlink (string-append lib-jdk "/zero/libjvm.so")
1893 (string-append lib-jdk "/libjvm.so"))
1894 (symlink (string-append lib-out "/zero/libjvm.so")
1895 (string-append lib-out "/libjvm.so"))))))
1896 phases))))))
1897
1898;;; Convenience alias to point to the latest version of OpenJDK.
1899(define-public openjdk openjdk25)
1900
1901
1902;; This version of JBR is here in order to be able to build custom
1903;; IntelliJ plugins. Those usually need both jbr11 and jbr17 for
1904;; tests.
1905(define-public jbr11
1906 (package
1907 (inherit openjdk11)
1908 (name "jbr")
1909 (version "11_0_16-b2248")
1910 (source (origin
1911 (method git-fetch)
1912 (uri (git-reference
1913 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1914 (commit (string-append "jb" version))))
1915 (file-name (string-append name "-" version "-checkout"))
1916 (sha256
1917 (base32
1918 "1fnrdx0wb21ghm6jczjzk7b9fz9hbdzd62512xhwpzvca57v2z09"))))
1919 (arguments
1920 (substitute-keyword-arguments (package-arguments openjdk11)
1921 ((#:configure-flags configure-flags)
1922 #~(append #$configure-flags
1923 (list "--with-jvm-features=shenandoahgc"
1924 "--enable-cds=yes"
1925 "--with-vendor-name=JetBrains s.r.o"
1926 "--with-vendor-url=https://www.jetbrains.com/"
1927 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
1928 (synopsis "JetBrains Java Runtime")
1929 (description "This package provides a Java runtime environment for
1930and Java development kit. It supports enhanced class redefinition (DCEVM),
1931includes a number of improvements in font rendering, keyboards support,
1932windowing/focus subsystems, HiDPI, accessibility, and performance,
1933provides better desktop integration and bugfixes not yet present in
1934OpenJDK.")
1935 (home-page "https://www.jetbrains.com/")
1936 (license license:gpl2+)))
1937
1938(define-public jbr17
1939 (package
1940 (inherit openjdk17)
1941 (name "jbr")
1942 (version "17.0.11b1207.30")
1943 (source (origin
1944 (method git-fetch)
1945 (uri (git-reference
1946 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1947 (commit (string-append "jbr-release-" version))))
1948 (file-name (string-append name "-" version "-checkout"))
1949 (sha256
1950 (base32
1951 "5bbf5z8faf9sdkig2fwkj06hb7hs9s3bpzzvbqn2i75lbwqk3bln"))
1952 (patches (search-patches "jbr-17-xcursor-no-dynamic.patch"))))
1953 (arguments
1954 (substitute-keyword-arguments (package-arguments openjdk17)
1955 ((#:configure-flags configure-flags)
1956 #~(append #$configure-flags
1957 (list "--with-jvm-features=shenandoahgc"
1958 "--enable-cds=yes"
1959 "--with-vendor-name=JetBrains s.r.o"
1960 "--with-vendor-url=https://www.jetbrains.com/"
1961 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
1962 (synopsis "JetBrains Java Runtime")
1963 (description "This package provides a Java runtime environment for
1964and Java development kit. It supports enhanced class redefinition (DCEVM),
1965includes a number of improvements in font rendering, keyboards support,
1966windowing/focus subsystems, HiDPI, accessibility, and performance,
1967provides better desktop integration and bugfixes not yet present in
1968OpenJDK.")
1969 (home-page "https://www.jetbrains.com/")
1970 (license license:gpl2+)))
1971
1972(define-public jbr21
1973 (package
1974 (inherit openjdk21)
1975 (name "jbr")
1976 (version "21.0.3b509.11")
1977 (source (origin
1978 (method git-fetch)
1979 (uri (git-reference
1980 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1981 (commit (string-append "jbr-release-" version))))
1982 (file-name (string-append name "-" version "-checkout"))
1983 (sha256
1984 (base32
1985 "03xkghbp0b1czc2ags9n8ilprf9sy4bhsma0wf8xfapqn6d2sfyd"))
1986 (patches (search-patches "openjdk-21-fix-rpath.patch"
1987 "jbr-17-xcursor-no-dynamic.patch"))))
1988 (inputs
1989 `(("wayland" ,wayland)
1990 ("libxkbcommon" ,libxkbcommon) ; for wayland
1991 ,@(package-inputs openjdk21)))
1992 (arguments
1993 (substitute-keyword-arguments (package-arguments openjdk21)
1994 ((#:configure-flags configure-flags)
1995 #~(append #$configure-flags
1996 (list "--with-jvm-features=shenandoahgc"
1997 "--enable-cds=yes"
1998 "--with-vendor-name=JetBrains s.r.o"
1999 "--with-vendor-url=https://www.jetbrains.com/"
2000 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
2001 (synopsis "JetBrains Java Runtime")
2002 (description "This package provides a Java runtime environment for
2003and Java development kit. It supports enhanced class redefinition (DCEVM),
2004includes a number of improvements in font rendering, keyboards support,
2005windowing/focus subsystems, HiDPI, accessibility, and performance,
2006provides better desktop integration and bugfixes not yet present in
2007OpenJDK.")
2008 (home-page "https://www.jetbrains.com/")
2009 (license license:gpl2+)))
2010
2011(define-public jbr25
2012 (package
2013 (inherit openjdk25)
2014 (name "jbr")
2015 (version "25.0.2b329.72")
2016 (source (origin
2017 (method git-fetch)
2018 (uri (git-reference
2019 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
2020 (commit (string-append "jbr-release-" version))))
2021 (file-name (string-append name "-" version "-checkout"))
2022 (sha256
2023 (base32
2024 "1m7pbz2ypx4h7n6iqss8bgymg9hqn14lnis4a2w87mgy51p370ib"))
2025 (patches
2026 (search-patches "jbr-25-wayland-drag-icon.patch"
2027 "jbr-25-wayland-intra-jvm-dnd.patch"))))
2028 (inputs
2029 `(("wayland" ,wayland)
2030 ("libxkbcommon" ,libxkbcommon) ; for wayland
2031 ,@(package-inputs openjdk25)))
2032 (native-inputs
2033 (modify-inputs (package-native-inputs openjdk25)
2034 (append wayland-protocols)))
2035 (arguments
2036 (substitute-keyword-arguments (package-arguments openjdk25)
2037 ((#:configure-flags configure-flags)
2038 #~(append #$configure-flags
2039 (list "--disable-warnings-as-errors"
2040 "--disable-java-warnings-as-errors"
2041 "--with-jvm-features=shenandoahgc"
2042 "--enable-cds=yes"
2043 (string-append "--with-wayland-protocols="
2044 (assoc-ref %build-inputs "wayland-protocols")
2045 "/share/wayland-protocols")
2046 "--with-vendor-name=JetBrains s.r.o"
2047 "--with-vendor-url=https://www.jetbrains.com/"
2048 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))
2049 ((#:phases phases)
2050 #~(modify-phases #$phases
2051 ;; JBR adds a 'static-jdk-image' target to 'make all' that
2052 ;; statically links both the Wayland and X11 AWT backends,
2053 ;; causing duplicate symbol errors. Build only what we need.
2054 ;; See also their workaround BROKEN_STATIC_LIBS make variable.
2055 (replace 'build
2056 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
2057 (apply invoke "make" "product-images" "all-docs-images"
2058 (format #f "JOBS=~a" (if parallel-build?
2059 (parallel-job-count)
2060 1))
2061 make-flags)))))))
2062 (synopsis "JetBrains Java Runtime")
2063 (description "This package provides a Java runtime environment for
2064and Java development kit. It supports enhanced class redefinition (DCEVM),
2065includes a number of improvements in font rendering, keyboards support,
2066windowing/focus subsystems, Wayland, HiDPI, accessibility, and performance,
2067provides better desktop integration and bugfixes not yet present in
2068OpenJDK.")
2069 (home-page "https://www.jetbrains.com/")
2070 (license license:gpl2+)))
2071
2072
2073(define-public ant/java8
2074 (package
2075 (name "ant")
2076 (version "1.10.17")
2077 (source (origin
2078 (method url-fetch)
2079 (uri (string-append "mirror://apache/ant/source/apache-ant-"
2080 version "-src.tar.gz"))
2081 (sha256
2082 (base32
2083 "0p34pqknp2rbk5wk6zw8m6jfn7rkk7fyv3yvk9zhfxhhxrf0lfgh"))
2084 (modules '((guix build utils)))
2085 (snippet
2086 '(begin
2087 (for-each delete-file
2088 (find-files "lib/optional" "\\.jar$"))
2089 #t))))
2090 (build-system gnu-build-system)
2091 (arguments
2092 (list
2093 #:modules '((srfi srfi-1)
2094 (guix build gnu-build-system)
2095 (guix build utils))
2096 #:tests? #f ;no "check" target
2097 #:phases
2098 #~(modify-phases %standard-phases
2099 (add-after 'unpack 'remove-scripts
2100 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
2101 ;; wrappers.
2102 (lambda _
2103 (for-each delete-file
2104 (find-files "src/script"
2105 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))))
2106 (delete 'bootstrap)
2107 (delete 'configure)
2108 (replace 'build
2109 (lambda* (#:key inputs #:allow-other-keys)
2110 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
2111
2112 ;; Disable tests to avoid dependency on hamcrest-core, which needs
2113 ;; Ant to build. This is necessary in addition to disabling the
2114 ;; "check" phase, because the dependency on "test-jar" would always
2115 ;; result in the tests to be run.
2116 (substitute* "build.xml"
2117 (("depends=\"jars,test-jar") "depends=\"jars"))
2118 (invoke "bash" "bootstrap.sh"
2119 (string-append "-Ddist.dir=" #$output))))
2120 (add-after 'build 'strip-jar-timestamps ;based on ant-build-system
2121 (lambda _
2122 (define (repack-archive jar)
2123 (let* ((dir (mkdtemp "jar-contents.XXXXXX"))
2124 (manifest (string-append dir "/META-INF/MANIFESTS.MF")))
2125 (with-directory-excursion dir
2126 (invoke "unzip" jar))
2127 (delete-file jar)
2128 ;; XXX: copied from (gnu build install)
2129 (for-each (lambda (file)
2130 (let ((s (lstat file)))
2131 (unless (eq? (stat:type s) 'symlink)
2132 (utime file 0 0 0 0))))
2133 (find-files dir #:directories? #t))
2134 ;; It is important that the manifest appears first.
2135 (with-directory-excursion dir
2136 (let* ((files (find-files "." ".*" #:directories? #t))
2137 ;; To ensure that the reference scanner can
2138 ;; detect all store references in the jars
2139 ;; we disable compression with the "-0" option.
2140 (command (if (file-exists? manifest)
2141 `("zip" "-0" "-X" ,jar ,manifest
2142 ,@files)
2143 `("zip" "-0" "-X" ,jar ,@files))))
2144 (apply invoke command)))))
2145 (for-each repack-archive
2146 (find-files
2147 (string-append #$output "/lib")
2148 "\\.jar$"))))
2149 (delete 'install))))
2150 (native-inputs
2151 `(("jdk" ,icedtea-8 "jdk")
2152 ("zip" ,zip)
2153 ("unzip" ,unzip)))
2154 (home-page "https://ant.apache.org")
2155 (synopsis "Build tool for Java")
2156 (description
2157 "Ant is a platform-independent build tool for Java. It is similar to
2158make but is implemented using the Java language, requires the Java platform,
2159and is best suited to building Java projects. Ant uses XML to describe the
2160build process and its dependencies, whereas Make uses Makefile format.")
2161 (license license:asl2.0)))
2162
2163(define-public ant/java8-empty-etc
2164 (package
2165 (inherit ant/java8)
2166 (arguments
2167 (substitute-keyword-arguments (package-arguments ant/java8)
2168 ((#:phases phases)
2169 #~(modify-phases #$phases
2170 (add-after 'build 'add-empty-etc-directory
2171 (lambda* (#:key outputs #:allow-other-keys)
2172 (mkdir-p (string-append (assoc-ref outputs "out") "/etc"))))))))))
2173
2174(define-public ant-1.10.14
2175 (package
2176 (inherit ant/java8)
2177 (name "ant")
2178 (version "1.10.14")
2179 (source
2180 (origin
2181 (method url-fetch)
2182 (uri (string-append "mirror://apache/ant/source/apache-ant-"
2183 version "-src.tar.gz"))
2184 (sha256
2185 (base32 "0m0vcazy1634nra8mcs3hvvf49avnbxf8f5y1icn5syi8hgy6pws"))
2186 (modules '((guix build utils)))
2187 (snippet
2188 '(begin
2189 (for-each delete-file
2190 (find-files "lib/optional" "\\.jar$"))
2191 #t))))
2192 (arguments
2193 (substitute-keyword-arguments (package-arguments ant/java8)
2194 ((#:phases phases)
2195 #~(modify-phases #$phases
2196 (replace 'remove-scripts
2197 (lambda _
2198 (for-each delete-file
2199 (find-files "src/script" ".*\\.(bat|cmd)$"))))
2200 (add-after 'build 'install-distribution-files
2201 (lambda* (#:key outputs #:allow-other-keys)
2202 (let* ((out (assoc-ref outputs "out"))
2203 (bin-dir (string-append out "/bin"))
2204 (etc-dir (string-append out "/etc"))
2205 (checkstyle-dir (string-append etc-dir "/checkstyle")))
2206 (for-each
2207 (lambda (file)
2208 (copy-file (string-append "src/script/" file)
2209 (string-append bin-dir "/" file))
2210 (chmod (string-append bin-dir "/" file) #o755))
2211 '("antRun" "antRun.pl" "runant.pl" "runant.py"))
2212 (mkdir-p checkstyle-dir)
2213 (for-each
2214 (lambda (file)
2215 (copy-file (string-append "src/etc/" file)
2216 (string-append etc-dir "/" file)))
2217 '("junit-frames.xsl"
2218 "junit-noframes.xsl"
2219 "junit-frames-xalan1.xsl"
2220 "coverage-frames.xsl"
2221 "maudit-frames.xsl"
2222 "mmetrics-frames.xsl"
2223 "changelog.xsl"
2224 "jdepend.xsl"
2225 "jdepend-frames.xsl"
2226 "log.xsl"
2227 "tagdiff.xsl"))
2228 (for-each
2229 (lambda (file)
2230 (copy-file (string-append "src/etc/checkstyle/" file)
2231 (string-append checkstyle-dir "/" file)))
2232 '("checkstyle-frames-sortby-check.xsl"
2233 "checkstyle-frames.xsl"
2234 "checkstyle-text.xsl"
2235 "checkstyle-xdoc.xsl"))
2236 (copy-file "build/lib/ant-bootstrap.jar"
2237 (string-append etc-dir "/ant-bootstrap.jar")))))))))))
2238
2239;; The 1.9.x series is the last that can be built with GCJ. The 1.10.x series
2240;; requires Java 8.
2241(define-public ant
2242 (package (inherit ant/java8)
2243 (version "1.9.15")
2244 (source (origin
2245 (method url-fetch)
2246 (uri (string-append "mirror://apache/ant/source/apache-ant-"
2247 version "-src.tar.gz"))
2248 (sha256
2249 (base32
2250 "1xy30f1w5gaqk6g3f0vw7ygix4rb6032qkcw42y4z8wd9jihgygd"))))
2251 ;; XXX: we do this to avoid a rebuild. This mess will be cleaned up
2252 ;; later.
2253 (arguments
2254 (substitute-keyword-arguments
2255 `(#:modules ((srfi srfi-1)
2256 (guix build gnu-build-system)
2257 (guix build utils))
2258 #:tests? #f ; no "check" target
2259 #:phases
2260 (modify-phases %standard-phases
2261 (delete 'bootstrap)
2262 (delete 'configure)
2263 (add-before 'build 'define-java-environment-variables
2264 (lambda* (#:key inputs #:allow-other-keys)
2265 ;; First, set environment variables (eases debugging on -K).
2266 (setenv "JAVA_HOME" (assoc-ref inputs "jamvm"))
2267 (setenv "JAVACMD" (search-input-file inputs "/bin/jamvm"))
2268 (setenv "JAVAC" (search-input-file inputs "/bin/jikes"))
2269 (setenv "CLASSPATH" (search-input-file inputs "/lib/rt.jar"))))
2270 (replace 'build
2271 (lambda* (#:key inputs outputs #:allow-other-keys)
2272 ;; Ant complains if this file doesn't exist.
2273 (setenv "HOME" "/tmp")
2274 (with-output-to-file "/tmp/.ant.properties"
2275 (lambda _ (display "")))
2276
2277 ;; Use jikes instead of javac for <javac ...> tags in build.xml
2278 (setenv "ANT_OPTS" "-Dbuild.compiler=jikes")
2279
2280 ;; jikes produces lots of warnings, but they are not very
2281 ;; interesting, so we silence them.
2282 (setenv "$BOOTJAVAC_OPTS" "-nowarn")
2283
2284 ;; Without these JamVM options the build may freeze.
2285 (substitute* "bootstrap.sh"
2286 (("^\"\\$\\{JAVACMD\\}\" " m)
2287 ,@(if (string-prefix? "armhf" (or (%current-system)
2288 (%current-target-system)))
2289 `((string-append m "-Xnocompact "))
2290 `((string-append m "-Xnocompact -Xnoinlining ")))))
2291
2292 ;; Disable tests because we are bootstrapping and thus don't have
2293 ;; any of the dependencies required to build and run the tests.
2294 (substitute* "build.xml"
2295 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
2296 (invoke "bash" "bootstrap.sh"
2297 (string-append "-Ddist.dir="
2298 (assoc-ref outputs "out")))))
2299 (add-after 'build 'strip-jar-timestamps ;based on ant-build-system
2300 (lambda* (#:key outputs #:allow-other-keys)
2301 (define (repack-archive jar)
2302 (let* ((dir (mkdtemp "jar-contents.XXXXXX"))
2303 (manifest (string-append dir "/META-INF/MANIFESTS.MF")))
2304 (with-directory-excursion dir
2305 (invoke "unzip" jar))
2306 (delete-file jar)
2307 ;; XXX: copied from (gnu build install)
2308 (for-each (lambda (file)
2309 (let ((s (lstat file)))
2310 (unless (eq? (stat:type s) 'symlink)
2311 (utime file 0 0 0 0))))
2312 (find-files dir #:directories? #t))
2313 ;; It is important that the manifest appears first.
2314 (with-directory-excursion dir
2315 (let* ((files (find-files "." ".*" #:directories? #t))
2316 ;; To ensure that the reference scanner can
2317 ;; detect all store references in the jars
2318 ;; we disable compression with the "-0" option.
2319 (command (if (file-exists? manifest)
2320 `("zip" "-0" "-X" ,jar ,manifest
2321 ,@files)
2322 `("zip" "-0" "-X" ,jar ,@files))))
2323 (apply invoke command)))))
2324 (for-each repack-archive
2325 (find-files
2326 (string-append (assoc-ref %outputs "out") "/lib")
2327 "\\.jar$"))))
2328 (delete 'install)))
2329 ((#:phases phases)
2330 `(modify-phases ,phases
2331 (delete 'define-java-environment-variables)
2332 (add-after 'unpack 'remove-scripts
2333 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
2334 ;; wrappers.
2335 (lambda _
2336 (for-each delete-file
2337 (find-files "src/script"
2338 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))
2339 #t))
2340 (replace 'build
2341 (lambda* (#:key inputs outputs #:allow-other-keys)
2342 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
2343
2344 ;; Disable tests to avoid dependency on hamcrest-core, which needs
2345 ;; Ant to build. This is necessary in addition to disabling the
2346 ;; "check" phase, because the dependency on "test-jar" would always
2347 ;; result in the tests to be run.
2348 (substitute* "build.xml"
2349 (("depends=\"jars,test-jar") "depends=\"jars"))
2350 (invoke "bash" "bootstrap.sh"
2351 (string-append "-Ddist.dir="
2352 (assoc-ref outputs "out")))))))))
2353 (native-inputs
2354 `(("jdk" ,icedtea-7 "jdk")
2355 ("zip" ,zip)
2356 ("unzip" ,unzip)))))
2357
2358(define-public ant-apache-bcel
2359 (package
2360 (inherit ant/java8)
2361 (name "ant-apache-bcel")
2362 (arguments
2363 (substitute-keyword-arguments (package-arguments ant/java8)
2364 ((#:phases phases)
2365 #~(modify-phases #$phases
2366 (add-after 'unpack 'link-bcel
2367 (lambda* (#:key inputs #:allow-other-keys)
2368 (for-each (lambda (file)
2369 (symlink file
2370 (string-append "lib/optional/"
2371 (basename file))))
2372 (find-files (assoc-ref inputs "java-commons-bcel")
2373 "\\.jar$"))))
2374 (add-after 'build 'install
2375 (lambda _
2376 (let ((share (string-append #$output "/share/java"))
2377 (bin (string-append #$output "/bin"))
2378 (lib (string-append #$output "/lib")))
2379 (mkdir-p share)
2380 (install-file (string-append lib "/ant-apache-bcel.jar") share)
2381 (delete-file-recursively bin)
2382 (delete-file-recursively lib))))))))
2383 (inputs
2384 (modify-inputs (package-inputs ant/java8)
2385 (prepend java-commons-bcel)))))
2386
2387(define-public ant-junit
2388 (package
2389 (inherit ant/java8)
2390 (name "ant-junit")
2391 (arguments
2392 (substitute-keyword-arguments (package-arguments ant/java8)
2393 ((#:phases phases)
2394 #~(modify-phases #$phases
2395 (add-after 'unpack 'link-junit
2396 (lambda* (#:key inputs #:allow-other-keys)
2397 (for-each (lambda (file)
2398 (symlink file
2399 (string-append "lib/optional/"
2400 (basename file))))
2401 (find-files (assoc-ref inputs "java-junit")
2402 "\\.jar$"))))
2403 (add-after 'build 'install
2404 (lambda _
2405 (let ((share (string-append #$output "/share/java"))
2406 (bin (string-append #$output "/bin"))
2407 (lib (string-append #$output "/lib")))
2408 (mkdir-p share)
2409 (install-file (string-append lib "/ant-junit.jar") share)
2410 (delete-file-recursively bin)
2411 (delete-file-recursively lib))))))))
2412 (inputs
2413 (modify-inputs (package-inputs ant/java8)
2414 (prepend java-junit)))))
2415
2416(define-public libantlr3c
2417 (package
2418 (name "libantlr3c")
2419 (version "3.4")
2420 (source
2421 (origin
2422 (method url-fetch)
2423 (uri
2424 (string-append "https://www.antlr3.org/download/C/"
2425 name "-" version ".tar.gz"))
2426 (sha256
2427 (base32 "0lpbnb4dq4azmsvlhp6khq1gy42kyqyjv8gww74g5lm2y6blm4fa"))))
2428 (build-system gnu-build-system)
2429 (arguments
2430 (list #:configure-flags
2431 #~(list "--enable-debuginfo"
2432 "--disable-static"
2433 #$@(if (target-64bit?)
2434 #~("--enable-64bit")
2435 #~())
2436 #$@(if (target-riscv64?)
2437 #~("--disable-abiflags")
2438 #~()))))
2439 (synopsis "ANTLR C Library")
2440 (description "LIBANTLR3C provides run-time C libraries for ANTLR3 (ANother
2441Tool for Language Recognition v3).")
2442 (home-page "https://www.antlr3.org/")
2443 (license license:bsd-3)))
2444
2445(define-public drip
2446 ;; Last release is from 2014, with a few important commits afterwards.
2447 (let ((commit "a4bd00df0199e78243847f06cc04ecaea31f8f08"))
2448 (package
2449 (name "drip")
2450 (version (git-version "0.2.4" "1" commit))
2451 (source (origin
2452 (method git-fetch)
2453 (uri (git-reference
2454 (url "https://github.com/ninjudd/drip")
2455 (commit commit)))
2456 (file-name (git-file-name name version))
2457 (sha256
2458 (base32
2459 "0wzmjwfyldr3jn49517xd8yn7dgdk8h88qkga3kjyg1zc375ylg2"))))
2460 (build-system gnu-build-system)
2461 (native-inputs
2462 `(("jdk" ,icedtea "jdk")))
2463 (arguments
2464 (list #:tests? #f ; No tests.
2465 #:phases
2466 #~(modify-phases %standard-phases
2467 (delete 'configure)
2468 (add-before 'build 'relax-gcc-14-strictness
2469 (lambda _
2470 (substitute* "Makefile"
2471 ((" gcc(.*)$" all options)
2472 (string-append
2473 " gcc"
2474 " -Wno-error=incompatible-pointer-types"
2475 " -Wno-error=implicit-function-declaration"
2476 options)))))
2477 (add-before 'install 'fix-wrapper
2478 (lambda* (#:key inputs #:allow-other-keys)
2479 (let ((jps (search-input-file inputs "/bin/jps")))
2480 (substitute* "bin/drip"
2481 (("jps") jps)
2482 (("brew update && brew upgrade drip") "guix pull && guix install drip")
2483 ;; No need to make:
2484 (("\\(cd -- \"\\$drip_dir\" && make -s\\) \\|\\| exit 1") "")
2485 ;; No need to include source:
2486 (("\\[\\[ -r \\$drip_dir/src/org/flatland/drip/Main\\.java \\]\\]")
2487 "true")))))
2488 (replace 'install
2489 (lambda* (#:key outputs #:allow-other-keys)
2490 (let* ((bin (string-append #$output "/bin"))
2491 (share (string-append #$output "/share/drip")))
2492 (mkdir-p bin)
2493 (for-each
2494 (lambda (file)
2495 (install-file (string-append "bin/" file) bin))
2496 '("drip" "drip_daemon" "drip_proxy"))
2497 (install-file "drip.jar" share)
2498 (substitute* (string-append bin "/drip")
2499 (("drip_dir=\\$bin_dir/..")
2500 (string-append "drip_dir=" share)))))))))
2501 (home-page "https://github.com/ninjudd/drip")
2502 (synopsis "Faster Java Virtual Machine launching")
2503 (description "Drip is a launcher for the Java Virtual Machine that
2504provides much faster startup times than the @command{java} command. The @command{drip}
2505script is intended to be a drop-in replacement for the @command{java} command,
2506only faster.")
2507 (license license:epl1.0))))
2508
2509(define-public java-openjfx-build
2510 (package
2511 (name "java-openjfx-build")
2512 ;; This is a java-8 version
2513 (version "8.202")
2514 (source (origin
2515 (method hg-fetch)
2516 (uri (hg-reference
2517 (url "http://hg.openjdk.java.net/openjfx/8u-dev/rt")
2518 (changeset (string-append
2519 (string-join (string-split version #\.) "u")
2520 "-ga"))))
2521 (file-name (string-append name "-" version "-checkout"))
2522 (modules '((guix build utils)))
2523 (snippet
2524 '(begin
2525 ;; Delete included gradle jar
2526 (delete-file-recursively "gradle/wrapper")
2527 #t))
2528 (sha256
2529 (base32
2530 "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))
2531 (patches (search-patches "java-openjfx-build-jdk_version.patch"))))
2532 (build-system ant-build-system)
2533 (arguments
2534 `(#:jar-name "java-openjfx.jar"
2535 #:source-dir "buildSrc/src/main/java"
2536 #:test-dir "buildSrc/src/test"
2537 #:phases
2538 (modify-phases %standard-phases
2539 (add-before 'configure 'generate-jsl-parser
2540 (lambda _
2541 (invoke "antlr3" "-o"
2542 "buildSrc/src/main/java/com/sun/scenario/effect/compiler"
2543 "buildSrc/src/main/antlr/JSL.g"))))))
2544 (inputs
2545 (list antlr3 java-stringtemplate))
2546 (native-inputs
2547 (list java-junit java-hamcrest-core))
2548 (home-page "https://openjfx.io")
2549 (synopsis "Graphical application toolkit in Java")
2550 (description "OpenJFX is a client application platform for desktop,
2551mobile and embedded systems built on Java. Its goal is to produce a
2552modern, efficient, and fully featured toolkit for developing rich client
2553applications. This package contains base classes for the OpenJFX
2554distribution and helper classes for building other parts of the
2555distribution.")
2556 (license license:gpl2))) ;gpl2 only, with classpath exception
2557
2558(define-public java-openjfx-base
2559 (package (inherit java-openjfx-build)
2560 (name "java-openjfx-base")
2561 (arguments
2562 `(#:jar-name "java-openjfx-base.jar"
2563 #:source-dir "modules/base/src/main/java:modules/base/src/main/java8:modules/base/src/main/version-info"
2564 #:test-dir "modules/base/src/test"
2565 #:phases
2566 (modify-phases %standard-phases
2567 (add-before 'check 'remove-empty-file
2568 (lambda _
2569 (with-directory-excursion "modules/base/src/test/java"
2570 ;; These files are completely commented, but junit expects them to
2571 ;; contain a class, so tests fail.
2572 (delete-file
2573 "com/sun/javafx/property/adapter/PropertyDescriptorTest.java")
2574 (delete-file
2575 "com/sun/javafx/property/adapter/ReadOnlyPropertyDescriptorTest.java")
2576 (delete-file "javafx/beans/property/PropertiesTest.java")
2577 (delete-file
2578 "javafx/beans/property/adapter/ReadOnlyJavaBeanPropertyBuilder_General_Test.java")
2579 ;; This one fails
2580 (delete-file "com/sun/javafx/runtime/VersionInfoTest.java"))
2581 #t)))))
2582 (propagated-inputs
2583 (list java-openjfx-build))
2584 (description "OpenJFX is a client application platform for desktop,
2585mobile and embedded systems built on Java. Its goal is to produce a
2586modern, efficient, and fully featured toolkit for developing rich client
2587applications. This package contains base classes for the OpenJFX
2588distribution.")))
2589
2590(define-public java-openjfx-graphics
2591 (package (inherit java-openjfx-build)
2592 (name "java-openjfx-graphics")
2593 (arguments
2594 `(#:jar-name "java-openjfx-graphics.jar"
2595 #:source-dir "modules/graphics/src/main/java"
2596 #:tests? #f; require X
2597 #:test-dir "modules/graphics/src/test"
2598 #:phases
2599 (modify-phases %standard-phases
2600 (add-after 'unpack 'copy-missing-file
2601 (lambda* (#:key inputs #:allow-other-keys)
2602 (let ((target "modules/graphics/src/main/native-prism-sw/JNativeSurface.c"))
2603 (copy-file (assoc-ref inputs "JNativeSurface.c") target)
2604 ;; XXX: looks like the missing file we found isn't *quite*
2605 ;; compatible...
2606 (substitute* target
2607 (("case TYPE_INT_ARGB:") "")))))
2608 (add-after 'build 'build-native
2609 (lambda* (#:key inputs outputs #:allow-other-keys)
2610 (let ((jdk (assoc-ref inputs "jdk"))
2611 (class-file->class-name
2612 (lambda (class-file)
2613 (string-map (lambda (c)
2614 (if (char=? c #\/) #\. c))
2615 (string-drop-right class-file
2616 (string-length ".class"))))))
2617 (setenv "CPPFLAGS"
2618 (string-append "-DINLINE=inline "
2619 "-DLINUX "
2620 "-I" jdk "/include "
2621 "-I" jdk "/include/linux "
2622 "-I " (getcwd) "/build/classes/include "
2623 "-I " (getcwd) "/modules/graphics/src/main/native-prism-sw"))
2624
2625 ;; Instructions have been adapted from buildSrc/linux.gradle
2626 (with-directory-excursion "build/classes"
2627 ;; Build prism
2628 (mkdir-p "include")
2629
2630 ;; Generate headers for prism
2631 (apply invoke "javah" "-d" "include" "-cp" "."
2632 (map class-file->class-name
2633 (append (find-files "com/sun/prism/impl" "\\.class$")
2634 (find-files "com/sun/prism" "PresentableState.*\\.class$"))))
2635
2636 ;; ...then for prism_sw
2637 (apply invoke "javah" "-d" "include" "-cp" "."
2638 (map class-file->class-name
2639 (find-files "com/sun/pisces" "\\.class$")))
2640
2641 ;; ...and for prism_es2
2642 (apply invoke "javah" "-d" "include" "-cp" "."
2643 (map class-file->class-name
2644 (find-files "com/sun/prism/es2" "\\.class$")))))
2645
2646 (with-directory-excursion "netbeans/native-prism"
2647 (invoke "make" "CONF=Release"))
2648 (with-directory-excursion "netbeans/native-prism-sw"
2649 (invoke "make" "CONF=Release"))
2650 ;; TODO: This fails due to unknown EGL procedure names
2651 #;
2652 (with-directory-excursion "netbeans/native-prism-es2"
2653 (invoke "make" "CONF=Release"))
2654
2655 (let* ((out (assoc-ref outputs "out"))
2656 (dir ,(match (%current-system)
2657 ("i686-linux"
2658 "i386")
2659 ((or "armhf-linux" "aarch64-linux")
2660 "arm")
2661 ((or "x86_64-linux")
2662 "amd64")
2663 (_ "unknown")))
2664 (target (string-append out "/share/" dir "/")))
2665 (mkdir-p target)
2666 (for-each (lambda (file)
2667 (let ((new-name
2668 (string-append "lib"
2669 (string-map
2670 (lambda (c)
2671 (if (char=? c #\-) #\_ c))
2672 (string-drop (basename file)
2673 (string-length "libnative-"))))))
2674 (copy-file file
2675 (string-append target new-name))))
2676 (find-files "netbeans" "\\.so$"))))))))
2677 (propagated-inputs
2678 (list java-openjfx-base))
2679 (inputs
2680 (list java-swt))
2681 ;; XXX: for unknown reasons
2682 ;; modules/graphics/src/main/native-prism-sw/JNativeSurface.c is missing
2683 ;; in this revision.
2684 (native-inputs
2685 `(("JNativeSurface.c"
2686 ,(origin
2687 (method url-fetch)
2688 (uri "https://raw.githubusercontent.com/openjdk/jfx/8u20-b02\
2689/modules/graphics/src/main/native-prism-sw/JNativeSurface.c")
2690 (sha256
2691 (base32
2692 "1kp15wbnd6rn0nciczp5ibq0ikby2yysvx1gnz5fa05vl2mm8mbm"))))))
2693 (description "OpenJFX is a client application platform for desktop,
2694mobile and embedded systems built on Java. Its goal is to produce a
2695modern, efficient, and fully featured toolkit for developing rich client
2696applications. This package contains graphics-related classes for the
2697OpenJFX distribution.")))
2698
2699(define-public java-openjfx-media
2700 (package (inherit java-openjfx-build)
2701 (name "java-openjfx-media")
2702 (propagated-inputs
2703 `(("java-openjxf-graphics" ,java-openjfx-graphics)))
2704 (arguments
2705 `(#:jar-name "java-openjfx-media.jar"
2706 #:source-dir "modules/media/src/main/java"
2707 #:tests? #f)); no tests
2708 (description "OpenJFX is a client application platform for desktop,
2709mobile and embedded systems built on Java. Its goal is to produce a
2710modern, efficient, and fully featured toolkit for developing rich client
2711applications. This package contains media-related classes for the
2712OpenJFX distribution.")))
2713
2714(define-public java-openjfx-controls
2715 (package (inherit java-openjfx-build)
2716 (name "java-openjfx-controls")
2717 (propagated-inputs
2718 `(("java-openjxf-graphics" ,java-openjfx-graphics)))
2719 (arguments
2720 `(#:jar-name "java-openjfx-controls.jar"
2721 #:source-dir "modules/controls/src/main/java"
2722 #:test-dir "modules/controls/src/test"
2723 ;; TODO: tests require com.sun.javafx.pgstub,
2724 ;; javafx.collections.MockSetObserver, and
2725 ;; com.sun.javafx.binding.ExpressionHelperUtility
2726 #:tests? #false
2727 #:phases
2728 (modify-phases %standard-phases
2729 (add-after 'unpack 'copy-resources
2730 (lambda _
2731 (copy-recursively "modules/controls/src/test/resources"
2732 "build/test-classes")
2733 (copy-recursively "modules/controls/src/main/resources"
2734 "build/classes"))))))
2735 (description "OpenJFX is a client application platform for desktop,
2736mobile and embedded systems built on Java. Its goal is to produce a
2737modern, efficient, and fully featured toolkit for developing rich client
2738applications. This package contains UI control classes for the
2739OpenJFX distribution.")))
2740
2741(define-public javacc-4
2742 (package
2743 (name "javacc")
2744 (version "4.1")
2745 (source (origin
2746 (method git-fetch)
2747 (uri (git-reference
2748 (url "https://github.com/javacc/javacc")
2749 (commit "release_41")))
2750 (file-name (string-append "javacc-" version "-checkout"))
2751 (sha256
2752 (base32
2753 "07ysav7j8r1c6h8qxrgqk6lwdp74ly0ad1935lragxml0qqc3ka0"))
2754 (modules '((guix build utils)))
2755 ;; delete bundled jars
2756 (snippet '(begin (delete-file-recursively "lib") #t))))
2757 (build-system ant-build-system)
2758 ;; Tests fail with
2759 ;; /tmp/guix-build-javacc-4.1.drv-0/source/test/javacodeLA/build.xml:60:
2760 ;; JAVACODE failed
2761 (arguments
2762 `(#:tests? #f
2763 #:phases
2764 (modify-phases %standard-phases
2765 ;; Delete tests to avoid build failure (we don't run them anyway).
2766 (add-after 'unpack 'delete-tests
2767 (lambda _
2768 (for-each delete-file
2769 '("src/org/javacc/JavaCCTestCase.java"
2770 "src/org/javacc/parser/ExpansionTest.java"
2771 "src/org/javacc/parser/OptionsTest.java"
2772 "src/org/javacc/jjtree/JJTreeOptionsTest.java"))
2773 (for-each delete-file-recursively
2774 '("src/org/javacc/parser/test"
2775 "src/org/javacc/jjdoc/test"))
2776 #t))
2777 (replace 'install (install-jars "bin/lib")))))
2778 (home-page "https://javacc.org/")
2779 (synopsis "Java parser generator")
2780 (description "Java Compiler Compiler (JavaCC) is the most popular parser
2781generator for use with Java applications. A parser generator is a tool that
2782reads a grammar specification and converts it to a Java program that can
2783recognize matches to the grammar. In addition to the parser generator itself,
2784JavaCC provides other standard capabilities related to parser generation such
2785as tree building (via a tool called JJTree included with JavaCC), actions,
2786debugging, etc.")
2787 (license license:bsd-3)))
2788
2789;; javacc-3, as javacc-4 is not properly bootstrapped: is contains a javacc.jar
2790;; in the bootstrap/ directory.
2791(define-public javacc-3
2792 (package
2793 (inherit javacc-4)
2794 (version "3.2")
2795 (source (origin
2796 (method git-fetch)
2797 (uri (git-reference
2798 (url "https://github.com/javacc/javacc")
2799 (commit "release_32")))
2800 (file-name (string-append "javacc-" version "-checkout"))
2801 (sha256
2802 (base32
2803 "1pyf1xyh8gk83nxqn2v2mdws32l68ydznha41cxa4l2kkbq1v1g3"))))
2804 (arguments
2805 `(#:tests? #f
2806 #:phases
2807 (modify-phases %standard-phases
2808 (add-before 'build 'set-java-version
2809 (lambda _
2810 (for-each
2811 (lambda (file)
2812 (substitute* file
2813 (("debug=") "source=\"1.4\" debug=")))
2814 (find-files "." "build.xml"))
2815 #t))
2816 (replace 'install (install-jars "bin/lib")))))))
2817
2818(define-public javacc
2819 (package
2820 (inherit javacc-4)
2821 (version "7.0.4")
2822 (source
2823 (origin
2824 (method git-fetch)
2825 (uri (git-reference
2826 (url "https://github.com/javacc/javacc")
2827 (commit version)))
2828 (file-name (git-file-name "javacc" version))
2829 (sha256
2830 (base32 "18kkak3gda93gr25jrgy6q00g0jr8i24ri2wk4kybz1v234fxx9i"))
2831 (modules '((guix build utils)))
2832 ;; Delete bundled jars.
2833 (snippet '(begin (for-each delete-file-recursively
2834 '("bootstrap" "lib"))))))
2835 (arguments
2836 `(#:make-flags ; bootstrap from javacc-4
2837 ,#~(list (string-append "-Dbootstrap-jar="
2838 #$(this-package-native-input "javacc")
2839 "/share/java/javacc.jar"))
2840 #:test-target "test"
2841 #:phases
2842 (modify-phases %standard-phases
2843 (replace 'install (install-jars "target"))
2844 (add-after 'install 'install-bin
2845 (lambda* (#:key outputs inputs #:allow-other-keys)
2846 (let* ((out (assoc-ref outputs "out"))
2847 (dir (string-append out "/share/java"))
2848 (bin (string-append out "/bin"))
2849 (javacc (string-append bin "/javacc")))
2850 (mkdir-p bin)
2851 (with-output-to-file javacc
2852 (lambda _
2853 (display
2854 (string-append "#!/bin/sh\n"
2855 (assoc-ref inputs "icedtea") "/bin/java"
2856 " -cp " dir "/javacc.jar" " `basename $0`" " $*"))))
2857 (chmod javacc #o755)
2858 ;; symlink to different names to affect the first argument and
2859 ;; change the behavior of the jar file.
2860 (symlink javacc (string-append bin "/jjdoc"))
2861 (symlink javacc (string-append bin "/jjtree"))))))))
2862 (native-inputs
2863 (list javacc-4))
2864 (inputs (list icedtea-8))))
2865
2866(define-public java-ecj
2867 (package
2868 (name "java-ecj")
2869 (version "4.6.3")
2870 (source
2871 (origin
2872 (method url-fetch)
2873 (uri (string-append "http://archive.eclipse.org/eclipse/"
2874 "downloads/drops4/R-" version "-201703010400/"
2875 "ecjsrc-" version ".jar"))
2876 (sha256
2877 (base32
2878 "11cfgsdgznja1pvlxkjbqykxd7pcd5655vkm7s44xmahmap15gpl"))))
2879 (build-system ant-build-system)
2880 (arguments
2881 `(#:tests? #f ; none included
2882 #:build-target "build"
2883 #:phases
2884 (modify-phases %standard-phases
2885 (add-after 'unpack 'fix-build.xml
2886 (lambda _
2887 (substitute* "src/build.xml"
2888 (("^.*MANIFEST.*$")
2889 "")
2890 (("^.*properties.*$")
2891 "<include name=\"**/*.properties\"/>
2892 <include name=\"**/*.props\"/>"))))
2893 (add-before 'build 'chdir
2894 (lambda _ (chdir "src")))
2895 (replace 'install (install-jars ".")))))
2896 (home-page "https://eclipse.org")
2897 (synopsis "Eclipse Java development tools core batch compiler")
2898 (description "This package provides the Eclipse Java core batch compiler.")
2899 (license license:epl1.0)))
2900
2901(define-public java-cisd-base
2902 (let ((revision 38938)
2903 (base-version "14.12.0"))
2904 (package
2905 (name "java-cisd-base")
2906 (version (string-append base-version "-" (number->string revision)))
2907 (source (origin
2908 (method svn-fetch)
2909 (uri (svn-reference
2910 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2911 "base/tags/release/"
2912 (version-major+minor base-version)
2913 ".x/" base-version "/base/"))
2914 (revision revision)))
2915 (file-name (string-append "java-cisd-base-" version "-checkout"))
2916 (sha256
2917 (base32
2918 "1i5adyf7nzclb0wydgwa1az04qliid8035vpahaandmkmigbnxiy"))
2919 (modules '((guix build utils)))
2920 (snippet
2921 '(begin
2922 ;; Delete included gradle jar
2923 (delete-file-recursively "gradle/wrapper")
2924 ;; Delete pre-built native libraries
2925 (delete-file-recursively "libs")
2926 #t))))
2927 (build-system ant-build-system)
2928 (arguments
2929 `(#:make-flags '("-file" "build/build.xml")
2930 #:test-target "jar-test"
2931 #:jdk ,icedtea-8
2932 #:phases
2933 (modify-phases %standard-phases
2934 (add-after 'unpack 'unpack-build-resources
2935 (lambda* (#:key inputs #:allow-other-keys)
2936 (copy-recursively (assoc-ref inputs "build-resources")
2937 "../build_resources")
2938 #t))
2939 (add-after 'unpack-build-resources 'fix-dependencies
2940 (lambda* (#:key inputs #:allow-other-keys)
2941 (substitute* "build/build.xml"
2942 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
2943 (search-input-file inputs
2944 "/share/java/java-testng.jar"))
2945 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
2946 (search-input-file inputs
2947 (string-append
2948 "/share/java/commons-lang-"
2949 ,(package-version java-commons-lang)
2950 ".jar")))
2951 (("\\$\\{lib\\}/commons-io/commons-io.jar")
2952 (search-input-file inputs
2953 (string-append
2954 "/lib/m2/commons-io/commons-io/"
2955 ,(package-version java-commons-io)
2956 "/commons-io-"
2957 ,(package-version java-commons-io)
2958 ".jar")))
2959 ;; Remove dependency on svn
2960 (("<build-info.*") "")
2961 (("\\$\\{revision.number\\}")
2962 ,(number->string revision))
2963 (("\\$\\{version.number\\}") ,base-version))
2964 ;; Remove dependency on classycle
2965 (substitute* "../build_resources/ant/build-common.xml"
2966 (("<taskdef name=\"dependency-checker.*") "")
2967 (("classname=\"classycle.*") "")
2968 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
2969 #t))
2970 ;; A few tests fail because of the lack of a proper /etc/groups and
2971 ;; /etc/passwd file in the build container.
2972 (add-after 'unpack 'disable-broken-tests
2973 (lambda _
2974 (substitute* "sourceTest/java/ch/systemsx/cisd/base/AllTests.java"
2975 (("Unix.isOperational\\(\\)") "false"))
2976 #t))
2977 ;; These decorators are almost useless and pull in an unpackaged
2978 ;; dependency.
2979 (add-after 'unpack 'remove-useless-decorators
2980 (lambda _
2981 (substitute* "source/java/ch/systemsx/cisd/base/unix/Unix.java"
2982 (("@Private") "")
2983 (("import ch.rinn.restrictions.Private;") ""))
2984 (substitute* "sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java"
2985 (("@Friend.*") "")
2986 (("import ch.rinn.restrictions.Friend;") ""))
2987 #t))
2988 (add-before 'configure 'build-native-code
2989 (lambda* (#:key inputs #:allow-other-keys)
2990 (let ((jdk (assoc-ref inputs "jdk"))
2991 (dir ,(match (%current-system)
2992 ("i686-linux"
2993 "i386-Linux")
2994 ((or "armhf-linux" "aarch64-linux")
2995 "arm-Linux")
2996 ((or "x86_64-linux")
2997 "amd64-Linux")
2998 (_ "unknown-Linux"))))
2999 (with-directory-excursion "source/c"
3000 (invoke "gcc" "-shared" "-O3" "-fPIC" "unix.c"
3001 (string-append "-I" jdk "/include")
3002 (string-append "-I" jdk "/include/linux")
3003 "-o" "libunix.so")
3004 (invoke "gcc" "-shared" "-O3" "-fPIC"
3005 "-DMACHINE_BYTE_ORDER=1"
3006 "copyCommon.c"
3007 "copyByteChar.c"
3008 "copyByteDouble.c"
3009 "copyByteFloat.c"
3010 "copyByteInt.c"
3011 "copyByteLong.c"
3012 "copyByteShort.c"
3013 (string-append "-I" jdk "/include")
3014 (string-append "-I" jdk "/include/linux")
3015 "-o" "libnativedata.so"))
3016 (install-file "source/c/libunix.so"
3017 (string-append "libs/native/unix/" dir))
3018 (install-file "source/c/libnativedata.so"
3019 (string-append "libs/native/nativedata/" dir))
3020 #t)))
3021 ;; In the "check" phase we only build the test executable.
3022 (add-after 'check 'run-tests
3023 (lambda _
3024 (invoke "java" "-jar" "targets/dist/sis-base-test.jar")
3025 (delete-file "targets/dist/sis-base-test.jar")
3026 #t))
3027 (replace 'install (install-jars "targets/dist")))))
3028 (native-inputs
3029 `(("jdk" ,icedtea-8)
3030 ("java-commons-lang" ,java-commons-lang)
3031 ("java-commons-io" ,java-commons-io)
3032 ("java-testng" ,java-testng)
3033 ("build-resources"
3034 ,(origin
3035 (method svn-fetch)
3036 (uri (svn-reference
3037 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3038 "base/tags/release/"
3039 (version-major+minor base-version)
3040 ".x/" base-version
3041 "/build_resources/"))
3042 (revision revision)))
3043 (sha256
3044 (base32
3045 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
3046 (home-page "https://svnsis.ethz.ch")
3047 (synopsis "Utility classes for libraries from ETH Zurich")
3048 (description "This library supplies some utility classes needed for
3049libraries from the SIS division at ETH Zurich like jHDF5.")
3050 ;; The C sources are under a non-copyleft license, which looks like a
3051 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
3052 (license (list license:asl2.0
3053 (license:non-copyleft "file://source/c/COPYING"))))))
3054
3055(define-public java-cisd-args4j
3056 (let ((revision 39162)
3057 (base-version "9.11.2"))
3058 (package
3059 (name "java-cisd-args4j")
3060 (version (string-append base-version "-" (number->string revision)))
3061 (source (origin
3062 (method svn-fetch)
3063 (uri (svn-reference
3064 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3065 "args4j/tags/release/"
3066 (version-major+minor base-version)
3067 ".x/" base-version "/args4j/"))
3068 (revision revision)))
3069 (file-name (string-append "java-cisd-args4j-" version "-checkout"))
3070 (sha256
3071 (base32
3072 "0hhqznjaivq7ips7mkwas78z42s6djsm20rrs7g1zd59rcsakxn2"))))
3073 (build-system ant-build-system)
3074 (arguments
3075 `(#:make-flags '("-file" "build/build.xml")
3076 #:tests? #f ; there are no tests
3077 #:modules ((guix build ant-build-system)
3078 (guix build utils)
3079 (guix build java-utils)
3080 (sxml simple)
3081 (sxml transform)
3082 (sxml xpath))
3083 #:phases
3084 (modify-phases %standard-phases
3085 (add-after 'unpack 'unpack-build-resources
3086 (lambda* (#:key inputs #:allow-other-keys)
3087 (mkdir-p "../build_resources")
3088 (copy-recursively (assoc-ref inputs "build-resources")
3089 "../build_resources")
3090 (mkdir-p "../build_resources/lib")))
3091 (add-after 'unpack-build-resources 'fix-dependencies
3092 (lambda* (#:key inputs #:allow-other-keys)
3093 ;; FIXME: There should be a more convenient abstraction for
3094 ;; editing XML files.
3095 (with-directory-excursion "../build_resources/ant/"
3096 (chmod "build-common.xml" #o664)
3097 (call-with-output-file "build-common.xml.new"
3098 (lambda (port)
3099 (sxml->xml
3100 (pre-post-order
3101 (with-input-from-file "build-common.xml"
3102 (lambda _ (xml->sxml #:trim-whitespace? #t)))
3103 `(;; Remove dependency on classycle and custom ant tasks
3104 (taskdef . ,(lambda (tag . kids)
3105 (let ((name ((sxpath '(name *text*)) kids)))
3106 (if (or (member "build-info" name)
3107 (member "dependency-checker" name)
3108 (member "build-java-subprojects" name)
3109 (member "project-classpath" name))
3110 '() ; skip
3111 `(,tag ,@kids)))))
3112 (typedef . ,(lambda (tag . kids)
3113 (let ((name ((sxpath '(name *text*)) kids)))
3114 (if (member "recursive-jar" name)
3115 '() ; skip
3116 `(,tag ,@kids)))))
3117 (build-java-subprojects . ,(lambda _ '()))
3118 ;; Ignore everything else
3119 (*default* . ,(lambda (tag . kids) `(,tag ,@kids)))
3120 (*text* . ,(lambda (_ txt) txt))))
3121 port)))
3122 (rename-file "build-common.xml.new" "build-common.xml"))
3123 (substitute* "build/build.xml"
3124 (("\\$\\{lib\\}/cisd-base/cisd-base.jar")
3125 (search-input-file inputs "/share/java/sis-base.jar"))
3126 ;; Remove dependency on svn
3127 (("<build-info.*") "")
3128 (("\\$\\{revision.number\\}")
3129 ,(number->string revision))
3130 (("\\$\\{version.number\\}") ,base-version)
3131 ;; Don't use custom ant tasks.
3132 (("recursive-jar") "jar")
3133 (("<project-classpath.*") ""))))
3134 (replace 'install (install-jars "targets/dist")))))
3135 (inputs
3136 (list java-cisd-base))
3137 (native-inputs
3138 `(("ecj" ,java-ecj)
3139 ("build-resources"
3140 ,(origin
3141 (method svn-fetch)
3142 (uri (svn-reference
3143 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3144 "args4j/tags/release/"
3145 (version-major+minor base-version)
3146 ".x/" base-version
3147 "/build_resources/"))
3148 (revision revision)))
3149 (sha256
3150 (base32
3151 "056cam4k8pll7ass31sy6gwn8g8719njc41yf4l02b0342nilkyf"))
3152 (modules '((guix build utils)))
3153 ;; Delete bundled pre-built jars.
3154 (snippet
3155 '(begin (delete-file-recursively "lib/") #t))))))
3156 (home-page "https://svnsis.ethz.ch")
3157 (synopsis "Command line parser library")
3158 (description "This package provides a parser for command line arguments.")
3159 (license license:asl2.0))))
3160
3161(define-public java-cisd-jhdf5
3162 (let ((revision 39162)
3163 (base-version "14.12.6"))
3164 (package
3165 (name "java-cisd-jhdf5")
3166 (version (string-append base-version "-" (number->string revision)))
3167 (source (origin
3168 (method svn-fetch)
3169 (uri (svn-reference
3170 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3171 "jhdf5/tags/release/"
3172 (version-major+minor base-version)
3173 ".x/" base-version "/jhdf5/"))
3174 (revision revision)))
3175 (file-name (string-append "java-cisd-jhdf5-" version "-checkout"))
3176 (sha256
3177 (base32
3178 "13i17s2hn0q9drdqvp8csy7770p3hdbh9rp30ihln2ldkfawdmz0"))
3179 (modules '((guix build utils)))
3180 (snippet
3181 '(begin
3182 ;; Delete included gradle jar
3183 (delete-file-recursively "gradle/wrapper")
3184 ;; Delete pre-built native libraries
3185 (delete-file-recursively "libs")))))
3186 (build-system ant-build-system)
3187 (arguments
3188 `(#:make-flags '("-file" "build/build.xml")
3189 #:build-target "jar-all"
3190 #:test-target "jar-test"
3191 #:phases
3192 (modify-phases %standard-phases
3193 ;; FIXME: this build phase fails.
3194 (delete 'generate-jar-indices)
3195 ;; Don't erase results from the build phase when building tests.
3196 (add-after 'unpack 'separate-test-target-from-clean
3197 (lambda _
3198 (substitute* "build/build.xml"
3199 (("\"jar-test\" depends=\"clean, ")
3200 "\"jar-test\" depends=\""))))
3201 (add-after 'unpack 'unpack-build-resources
3202 (lambda* (#:key inputs #:allow-other-keys)
3203 (copy-recursively (assoc-ref inputs "build-resources")
3204 "../build_resources")
3205 (delete-file-recursively "../build_resources/lib/")
3206 (mkdir-p "../build_resources/lib")
3207 ;; Remove dependency on classycle
3208 (substitute* "../build_resources/ant/build-common.xml"
3209 (("<taskdef name=\"dependency-checker.*") "")
3210 (("classname=\"classycle.*") "")
3211 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
3212 ;; Remove dependency on svn
3213 (substitute* "build/build.xml"
3214 (("<build-info.*") "")
3215 (("\\$\\{revision.number\\}")
3216 ,(number->string revision))
3217 (("\\$\\{version.number\\}") ,base-version))))
3218 (add-after 'unpack-build-resources 'fix-dependencies
3219 (lambda* (#:key inputs #:allow-other-keys)
3220 (substitute* "../build_resources/ant/build-common.xml"
3221 (("../libraries/testng/testng-jdk15.jar")
3222 (search-input-file inputs
3223 "/share/java/java-testng.jar")))
3224 (substitute* "build/build.xml"
3225 (("\\$\\{lib\\}/sis-base/sis-base.jar")
3226 (search-input-file inputs
3227 "/share/java/sis-base.jar"))
3228 (("\\$\\{lib\\}/cisd-args4j/cisd-args4j.jar")
3229 (search-input-file inputs
3230 "/share/java/cisd-args4j.jar"))
3231 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
3232 (search-input-file inputs
3233 (string-append
3234 "/share/java/commons-lang-"
3235 ,(package-version java-commons-lang)
3236 ".jar")))
3237 (("\\$\\{lib\\}/commons-io/commons-io.jar")
3238 (search-input-file inputs
3239 (string-append
3240 "/lib/m2/commons-io/commons-io/"
3241 ,(package-version java-commons-io)
3242 "/commons-io-"
3243 ,(package-version java-commons-io)
3244 ".jar")))
3245 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
3246 (search-input-file inputs
3247 "/share/java/java-testng.jar"))
3248 (("\\$\\{lib\\}/junit4/junit.jar")
3249 (car (find-files (assoc-ref inputs "java-junit") "jar$")))
3250 (("\\$\\{lib\\}/jmock/hamcrest/hamcrest-core.jar")
3251 (car (find-files (assoc-ref inputs "java-hamcrest-core")
3252 "jar$"))))
3253 ;; Remove dependency on ch.rinn.restrictions
3254 (with-directory-excursion "source/java/ch/systemsx/cisd/hdf5/"
3255 (substitute* '("BitSetConversionUtils.java"
3256 "HDF5Utils.java")
3257 (("import ch.rinn.restrictions.Private;") "")
3258 (("@Private") "")))
3259 (with-directory-excursion "sourceTest/java/ch/systemsx/cisd/hdf5/"
3260 (substitute* '("BitSetConversionTest.java"
3261 "h5ar/HDF5ArchiverTest.java")
3262 (("import ch.rinn.restrictions.Friend;") "")
3263 (("@Friend.*") ""))
3264 ;; Remove leftovers from removing @Friend
3265 (substitute* "h5ar/HDF5ArchiverTest.java"
3266 (("\\{ HDF5Archiver.class, IdCache.class, LinkRecord.class \\}\\)")
3267 "")))))
3268 (add-before 'configure 'build-native-library
3269 (lambda* (#:key inputs #:allow-other-keys)
3270 (let ((jdk (assoc-ref inputs "jdk"))
3271 (hdf5 (assoc-ref inputs "hdf5"))
3272 (dir ,(match (%current-system)
3273 ("i686-linux"
3274 "i386-Linux")
3275 ((or "armhf-linux" "aarch64-linux")
3276 "arm-Linux")
3277 ((or "x86_64-linux")
3278 "amd64-Linux")
3279 (_ "unknown-Linux"))))
3280 (with-directory-excursion "source/c"
3281 (apply invoke `("gcc" "-shared" "-O3"
3282 "-fPIC"
3283 "-Wl,--exclude-libs,ALL"
3284 "-Wno-error=implicit-function-declaration"
3285 ,@(find-files "jhdf5" "\\.c$")
3286 ,@(find-files "hdf-java" "\\.c$")
3287 ,(string-append "-I" hdf5 "/include")
3288 ,(string-append "-I" jdk "/include")
3289 ,(string-append "-I" jdk "/include/linux")
3290 ,(string-append hdf5 "/lib/libhdf5.a")
3291 "-o" "libjhdf5.so" "-lz")))
3292 (install-file "source/c/libjhdf5.so"
3293 (string-append "libs/native/jhdf5/" dir)))))
3294 ;; In the "check" phase we only build the test executable.
3295 (add-after 'check 'run-tests
3296 (lambda _
3297 (invoke "java" "-jar" "targets/dist/sis-jhdf5-test.jar")
3298 (delete-file "targets/dist/sis-jhdf5-test.jar")))
3299 (replace 'install
3300 (install-jars "targets/dist")))))
3301 (inputs
3302 (list java-cisd-base
3303 java-cisd-args4j
3304 java-commons-lang
3305 java-commons-io
3306 hdf5-1.8
3307 zlib))
3308 (native-inputs
3309 `(("jdk" ,icedtea-8)
3310 ("java-testng" ,java-testng)
3311 ("java-junit" ,java-junit)
3312 ("java-jmock" ,java-jmock)
3313 ("java-hamcrest-core" ,java-hamcrest-core)
3314 ("build-resources"
3315 ,(origin
3316 (method svn-fetch)
3317 (uri (svn-reference
3318 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3319 "jhdf5/tags/release/"
3320 (version-major+minor base-version)
3321 ".x/" base-version
3322 "/build_resources/"))
3323 (revision revision)))
3324 (sha256
3325 (base32
3326 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
3327 (home-page "https://wiki-bsse.ethz.ch/display/JHDF5/")
3328 (synopsis "Java binding for HDF5")
3329 (description "JHDF5 is a high-level API in Java for reading and writing
3330HDF5 files, building on the libraries provided by the HDF Group.")
3331 ;; The C sources are under a non-copyleft license, which looks like a
3332 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
3333 (license (list license:asl2.0
3334 (license:non-copyleft "file://source/c/COPYING"))))))
3335
3336(define-public java-classpathx-servletapi
3337 (package
3338 (name "java-classpathx-servletapi")
3339 (version "3.0.1")
3340 (source (origin
3341 (method url-fetch)
3342 (uri (string-append "mirror://gnu/classpathx/servletapi/"
3343 "servletapi-" version ".tar.gz"))
3344 (sha256
3345 (base32
3346 "07d8h051siga2f33fra72hk12sbq1bxa4jifjg0qj0vfazjjff0x"))))
3347 (build-system ant-build-system)
3348 (arguments
3349 `(#:tests? #f ; there is no test target
3350 #:build-target "compile"
3351 #:make-flags
3352 ,#~(list "-Dbuild.compiler=javac1.8"
3353 (string-append "-Ddist=" #$output))
3354 #:phases
3355 (modify-phases %standard-phases
3356 (replace 'install
3357 (lambda* (#:key make-flags #:allow-other-keys)
3358 (apply invoke `("ant" "dist" ,@make-flags)))))))
3359 (home-page "https://www.gnu.org/software/classpathx/")
3360 (synopsis "Java servlet API implementation")
3361 (description "This is the GNU servlet API distribution, part of the
3362ClasspathX project. It provides implementations of version 3.0 of the servlet
3363API and version 2.1 of the Java ServerPages API.")
3364 (license license:gpl3+)))
3365
3366(define-public java-javaee-servletapi
3367 (package
3368 (name "java-javaee-servletapi")
3369 (version "3.1.0")
3370 (source (origin
3371 (method git-fetch)
3372 (uri (git-reference
3373 (url "https://github.com/javaee/servlet-spec")
3374 (commit version)))
3375 (file-name (git-file-name name version))
3376 (sha256
3377 (base32
3378 "0s03lj8w5an70lkqbjycgfrfk0kc07vbfav91jzk87gh3awf9ksl"))))
3379 (build-system ant-build-system)
3380 (arguments
3381 `(#:jar-name "javax-servletapi.jar"
3382 ;; no tests
3383 #:tests? #f
3384 #:source-dir "src/main/java"
3385 #:phases
3386 (modify-phases %standard-phases
3387 (add-before 'build 'copy-resources
3388 (lambda _
3389 (mkdir-p "build/classes/javax/servlet/http")
3390 (let ((from-prefix "src/main/java/javax/servlet/")
3391 (to-prefix "build/classes/javax/servlet/"))
3392 (for-each (lambda (f)
3393 (copy-file (string-append from-prefix f)
3394 (string-append to-prefix f)))
3395 (list "LocalStrings_ja.properties"
3396 "LocalStrings.properties"
3397 "LocalStrings_fr.properties"
3398 "http/LocalStrings_es.properties"
3399 "http/LocalStrings_ja.properties"
3400 "http/LocalStrings.properties"
3401 "http/LocalStrings_fr.properties")))
3402 #t)))))
3403 (native-inputs
3404 (list unzip))
3405 (home-page "https://javaee.github.io/servlet-spec/")
3406 (synopsis "Java servlet API")
3407 (description "Java Servlet is the foundation web specification in the
3408Java Enterprise Platform. Developers can build web applications using the
3409Servlet API to interact with the request/response workflow. This project
3410provides information on the continued development of the Java Servlet
3411specification.")
3412 ;; Main code is dual-licensed by Oracle under either GLP2 or CDDL 1.1.
3413 ;; Some files are licensed under ASL 2.0.
3414 (license (list license:asl2.0 license:gpl2 license:cddl1.1))))
3415
3416(define-public java-jsvg-1.6.1
3417 (package
3418 (name "java-jsvg")
3419 (version "1.6.1")
3420 (source
3421 (origin
3422 (method git-fetch)
3423 (uri (git-reference
3424 (url "https://github.com/weisJ/jsvg")
3425 (commit "v1.6.1-rc1")))
3426 (file-name (git-file-name name version))
3427 (sha256
3428 (base32 "0rcphd1596ps87q31qmksnh1nc4m1x1rrkn9amk3ggwy9l2pavsy"))
3429 (modules '((guix build utils)))
3430 (snippet
3431 ;; Remove @MustBeInvokedByOverriders annotations; not present
3432 ;; in java-jetbrains-annotations 19.0.0.
3433 ;; TODO: Update java-jetbrains-annotations to >= 20.0.0.
3434 '(begin
3435 (substitute* (find-files "." "\\.java$")
3436 (("import org\\.jetbrains\\.annotations\\.MustBeInvokedByOverriders;")
3437 "")
3438 (("@MustBeInvokedByOverriders") ""))
3439 #t))))
3440 (build-system ant-build-system)
3441 (arguments
3442 (list
3443 #:jdk openjdk17
3444 #:tests? #f
3445 ;; ant-build-system does not export a default-modules constant.
3446 #:modules '((guix build ant-build-system)
3447 (guix build java-utils)
3448 (guix build utils)
3449 (sxml simple))
3450 #:phases
3451 #~(modify-phases %standard-phases
3452 (replace 'build
3453 (lambda* (#:key inputs #:allow-other-keys)
3454 (let* ((src-dir "jsvg/src/main/java")
3455 (classes-dir "build/classes")
3456 (jar-file
3457 (string-append "build/jsvg-" #$version ".jar"))
3458 (annotations-cp
3459 (string-join
3460 (append
3461 (find-files (assoc-ref inputs
3462 "java-jetbrains-annotations")
3463 "\\.jar$")
3464 (find-files (assoc-ref inputs
3465 "java-error-prone-annotations")
3466 "\\.jar$"))
3467 ":")))
3468 (mkdir-p classes-dir)
3469 (apply invoke "javac"
3470 "--release" "11"
3471 "-cp" annotations-cp
3472 "-d" classes-dir
3473 (find-files src-dir "\\.java$"))
3474 (invoke "jar" "-cf" jar-file
3475 "-C" classes-dir "."))))
3476 (add-before 'build 'generate-pom
3477 (lambda _
3478 (call-with-output-file "pom.xml"
3479 (lambda (port)
3480 (sxml->xml
3481 `(*TOP*
3482 (*PI* xml "version=\"1.0\" encoding=\"UTF-8\"")
3483 (project
3484 (modelVersion "4.0.0")
3485 (groupId "com.github.weisj")
3486 (artifactId "jsvg")
3487 (version ,#$version)))
3488 port)))))
3489 (replace 'install
3490 (install-from-pom "pom.xml")))))
3491 (native-inputs
3492 (list java-jetbrains-annotations
3493 java-error-prone-annotations))
3494 (home-page "https://github.com/weisJ/jsvg")
3495 (synopsis "Java SVG rendering library")
3496 (description
3497 "JSVG is a Java library for rendering SVG images. It provides a
3498lightweight SVG parser and renderer using the Java2D API.")
3499 (license license:expat)))
3500
3501(define-public java-jtidy
3502 (package
3503 (name "java-jtidy")
3504 (version "8.0")
3505 (source
3506 (origin
3507 (method git-fetch)
3508 (uri (git-reference
3509 (url "https://github.com/jtidy/jtidy")
3510 (commit "r938")))
3511 (file-name (git-file-name name version))
3512 (sha256
3513 (base32 "1zksmvmrr10nzk5ya6sz0l8093yf3b08lkg76cn4fdv2jqm3cssp"))
3514 ;; Remove xerces:dom3-xml-apis dependency -- DOM Level 3 has been
3515 ;; part of the JDK since Java 5. install-from-pom calls
3516 ;; fix-pom-dependencies which throws no-such-input for
3517 ;; dependencies not in inputs and not test-scoped or optional.
3518 ;; A patch is used because programmatic removal does not work:
3519 ;;
3520 ;; - pre-post-order to filter the dependency from the parsed
3521 ;; SXML, then sxml->xml to write it back: xml->sxml expands
3522 ;; the default xmlns into long tag names like
3523 ;; http://maven.apache.org/POM/4.0.0:dependency, and
3524 ;; sxml->xml's check-name rejects symbols with more than
3525 ;; one colon ("Invalid QName").
3526 ;;
3527 ;; - fix-maven-xml from (guix build maven pom) strips those
3528 ;; namespace prefixes before sxml->xml, but it is not
3529 ;; exported.
3530 ;;
3531 ;; - fix-pom-dependencies #:excludes: the excludes parameter
3532 ;; only affects plugins (fix-plugins) and extensions
3533 ;; (fix-extensions), not dependencies -- fix-deps and
3534 ;; fix-dep do not check excludes.
3535 (patches
3536 (search-patches "java-jtidy-remove-xerces-dependency.patch"))))
3537 (build-system ant-build-system)
3538 (arguments
3539 (list
3540 #:jar-name "jtidy.jar"
3541 #:source-dir "src/main/java"
3542 #:test-dir "src/test"
3543 ;; Tests are disabled: upstream's pom.xml sets testFailureIgnore=true
3544 ;; because 140 of 216 .msg reference files have wrong expected message
3545 ;; counts -- the code changed but the test data was never updated.
3546 #:tests? #f
3547 #:phases
3548 #~(modify-phases %standard-phases
3549 (add-before 'build 'copy-resources
3550 (lambda _
3551 (copy-recursively "src/main/resources" "build/classes")))
3552 (replace 'install
3553 (install-from-pom "pom.xml")))))
3554 (inputs
3555 (list java-slf4j-api))
3556 (home-page "https://github.com/jtidy/jtidy")
3557 (synopsis "Java port of HTML Tidy, an HTML syntax checker and pretty printer")
3558 (description
3559 "JTidy is a Java port of HTML Tidy, a HTML syntax checker and pretty
3560printer. Like its non-Java cousin, JTidy can be used as a tool for cleaning
3561up malformed and faulty HTML. In addition, JTidy provides a DOM interface to
3562the document that is being processed, which effectively makes it a Java HTML
3563parser.")
3564 (license license:w3c)))
3565
3566(define-public java-swt
3567 (package
3568 (name "java-swt")
3569 (version "4.7.1a")
3570 (source
3571 ;; The types of many variables and procedures differ in the sources
3572 ;; dependent on whether the target architecture is a 32-bit system or a
3573 ;; 64-bit system. Instead of patching the sources on demand in a build
3574 ;; phase we download either the 32-bit archive (which mostly uses "int"
3575 ;; types) or the 64-bit archive (which mostly uses "long" types).
3576 (let ((hash32 "09q0cbh90d90q3a7dx9430kc4m6bijrkr4lajrmzzvi0jjdpq4v9")
3577 (hash64 "17k5hs75a87ssmc5xhwdfdm2gn4zba0r837l2455za01krnkaa2q")
3578 (file32 "x86")
3579 (file64 "x86_64"))
3580 (let-values (((hash file)
3581 (match (or (%current-target-system) (%current-system))
3582 ("x86_64-linux" (values hash64 file64))
3583 (_ (values hash32 file32)))))
3584 (origin
3585 (method url-fetch)
3586 (uri (string-append
3587 "https://archive.eclipse.org/eclipse/downloads/drops4/"
3588 "R-" version "-201710090410/swt-" version
3589 "-gtk-linux-" file ".zip"))
3590 (sha256 (base32 hash))))))
3591 (build-system ant-build-system)
3592 (arguments
3593 `(#:jar-name "swt.jar"
3594 #:jdk ,icedtea-8
3595 #:tests? #f ; no "check" target
3596 #:phases
3597 (modify-phases %standard-phases
3598 (replace 'unpack
3599 (lambda* (#:key source #:allow-other-keys)
3600 (mkdir "swt")
3601 (invoke "unzip" source "-d" "swt")
3602 (chdir "swt")
3603 (mkdir "src")
3604 (invoke "unzip" "src.zip" "-d" "src")))
3605 ;; The classpath contains invalid icecat jars. Since we don't need
3606 ;; anything other than the JDK on the classpath, we can simply unset
3607 ;; it.
3608 (add-after 'configure 'unset-classpath
3609 (lambda _ (unsetenv "CLASSPATH") #t))
3610 (add-before 'build 'build-native
3611 (lambda* (#:key inputs outputs #:allow-other-keys)
3612 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3613 ;; Build shared libraries. Users of SWT have to set the system
3614 ;; property swt.library.path to the "lib" directory of this
3615 ;; package output.
3616 (mkdir-p lib)
3617 (setenv "OUTPUT_DIR" lib)
3618 (setenv "CC" ,(cc-for-target))
3619 (with-directory-excursion "src"
3620 (invoke "bash" "build.sh")))))
3621 (add-after 'install 'install-native
3622 (lambda* (#:key outputs #:allow-other-keys)
3623 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3624 (for-each (lambda (file)
3625 (install-file file lib))
3626 (find-files "." "\\.so$"))
3627 #t))))))
3628 (inputs
3629 `(("gtk" ,gtk+-2)
3630 ("libxtst" ,libxtst)
3631 ("libxt" ,libxt)
3632 ("mesa" ,mesa)
3633 ("glu" ,glu)))
3634 (native-inputs
3635 (list pkg-config unzip))
3636 (home-page "https://www.eclipse.org/swt/")
3637 (synopsis "Widget toolkit for Java")
3638 (description
3639 "SWT is a widget toolkit for Java designed to provide efficient, portable
3640access to the user-interface facilities of the operating systems on which it
3641is implemented.")
3642 ;; SWT code is licensed under EPL1.0
3643 ;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
3644 ;; Cairo bindings contain code under MPL1.1
3645 ;; XULRunner 1.9 bindings contain code under MPL2.0
3646 (license (list
3647 license:epl1.0
3648 license:mpl1.1
3649 license:mpl2.0
3650 license:lgpl2.1+))))
3651
3652;; java-hamcrest-core uses qdox version 1.12. We package this version instead
3653;; of the latest release.
3654(define-public java-qdox-1.12
3655 (package
3656 (name "java-qdox")
3657 (version "1.12.1")
3658 (source (origin
3659 (method url-fetch)
3660 (uri (string-append "https://repo1.maven.org/maven2/"
3661 "com/thoughtworks/qdox/qdox/" version
3662 "/qdox-" version "-sources.jar"))
3663 (sha256
3664 (base32
3665 "0hlfbqq2avf5s26wxkksqmkdyk6zp9ggqn37c468m96mjv0n9xfl"))))
3666 (build-system ant-build-system)
3667 (arguments
3668 `(;; Tests require junit
3669 #:tests? #f
3670 #:jar-name "qdox.jar"
3671 #:phases
3672 (modify-phases %standard-phases
3673 (replace 'unpack
3674 (lambda* (#:key source #:allow-other-keys)
3675 (mkdir "src")
3676 (with-directory-excursion "src"
3677 (invoke "jar" "-xf" source))))
3678 ;; At this point we don't have junit, so we must remove the API
3679 ;; tests.
3680 (add-after 'unpack 'delete-tests
3681 (lambda _
3682 (delete-file-recursively "src/com/thoughtworks/qdox/junit")
3683 #t)))))
3684 (home-page "https://github.com/codehaus/qdox")
3685 (synopsis "Parse definitions from Java source files")
3686 (description
3687 "QDox is a high speed, small footprint parser for extracting
3688class/interface/method definitions from source files complete with JavaDoc
3689@code{@@tags}. It is designed to be used by active code generators or
3690documentation tools.")
3691 (license license:asl2.0)))
3692
3693(define-public java-qdox
3694 (package
3695 (name "java-qdox")
3696 ; Newer version exists, but this version is required by java-plexus-component-metadata
3697 (version "2.0-M2")
3698 (source (origin
3699 (method url-fetch)
3700 ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
3701 ;; Older releases at https://github.com/codehaus/qdox/
3702 ;; Note: The release at maven is pre-generated. The release at
3703 ;; github requires jflex.
3704 (uri (string-append "https://repo1.maven.org/maven2/"
3705 "com/thoughtworks/qdox/qdox/" version
3706 "/qdox-" version "-sources.jar"))
3707 (sha256
3708 (base32
3709 "10xxrcaicq6axszcr2jpygisa4ch4sinyx5q7kqqxv4lknrmxp5x"))))
3710 (build-system ant-build-system)
3711 (arguments
3712 `(#:jar-name "qdox.jar"
3713 #:tests? #f; no tests
3714 #:phases
3715 (modify-phases %standard-phases
3716 (add-before 'install 'create-pom
3717 (generate-pom.xml "pom.xml" "com.thoughtworks.qdox" "qdox" ,version
3718 #:name "QDox"))
3719 (replace 'install
3720 (install-from-pom "pom.xml")))))
3721 (home-page "https://github.com/codehaus/qdox")
3722 (synopsis "Parse definitions from Java source files")
3723 (description "QDox is a high speed, small footprint parser for extracting
3724class/interface/method definitions from source files complete with JavaDoc
3725@code{@@tags}. It is designed to be used by active code generators or
3726documentation tools.")
3727 (license license:asl2.0)))
3728
3729(define-public java-qdox-2-M9
3730 (package
3731 (inherit java-qdox)
3732 (version "2.0-M9"); required by plexus-java
3733 (source (origin
3734 (method url-fetch)
3735 ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
3736 ;; Older releases at https://github.com/codehaus/qdox/
3737 ;; Note: The release at maven is pre-generated. The release at
3738 ;; github requires jflex.
3739 (uri (string-append "https://repo1.maven.org/maven2/"
3740 "com/thoughtworks/qdox/qdox/" version
3741 "/qdox-" version "-sources.jar"))
3742 (sha256
3743 (base32
3744 "1s2jnmx2dkwnaha12lcj26aynywgwa8sslc47z82wx8xai13y4fg"))))
3745 (arguments
3746 (substitute-keyword-arguments (package-arguments java-qdox)
3747 ((#:phases phases)
3748 `(modify-phases ,phases
3749 (replace 'create-pom
3750 (generate-pom.xml "pom.xml" "com.thoughtworks.qdox" "qdox" ,version
3751 #:name "QDox"))))))))
3752
3753(define-public java-jarjar
3754 (package
3755 (name "java-jarjar")
3756 (version "1.4")
3757 (source (origin
3758 (method url-fetch)
3759 (uri (string-append
3760 "https://storage.googleapis.com/google-code-archive-downloads/v2/"
3761 "code.google.com/jarjar/jarjar-src-" version ".zip"))
3762 (sha256
3763 (base32
3764 "1v8irhni9cndcw1l1wxqgry013s2kpj0qqn57lj2ji28xjq8ndjl"))
3765 (modules '((guix build utils)))
3766 (snippet
3767 '(begin
3768 ;; Delete bundled thirds-party jar archives.
3769 (delete-file-recursively "lib")
3770 (delete-file "src/test/enumtest.jar")
3771 ;; the CLASSPATH needs this directory, create an empty one
3772 (mkdir-p "lib")
3773 #t))))
3774 (build-system ant-build-system)
3775 (arguments
3776 `(;; Tests require junit, which ultimately depends on this package.
3777 #:tests? #f
3778 #:build-target "jar"
3779 #:phases
3780 (modify-phases %standard-phases
3781 (add-before 'build 'do-not-use-bundled-asm
3782 (lambda* (#:key inputs #:allow-other-keys)
3783 (substitute* "build.xml"
3784 (("<path id=\"path.build\">")
3785 (string-append "<path id=\"path.build\"><fileset dir=\""
3786 (assoc-ref inputs "java-asm-bootstrap")
3787 "/lib/m2\" includes=\"**/*.jar\"/>"))
3788 (("<zipfileset src=\"lib/asm-4.0.jar\"/>") "")
3789 (("lib/asm-commons-4.0.jar")
3790 (car (find-files (assoc-ref inputs "java-asm-bootstrap")
3791 "asm-6.0.jar")))
3792 (("<include name=\"org/objectweb/asm/commons/Remap\\*\\.class\"/>")
3793 (string-append "<include name=\"org/objectweb/asm/"
3794 "commons/Remap*.class\"/>"
3795 "<include name=\"org/objectweb/asm/*.class\"/>"
3796 "<include name=\"org/objectweb/asm/"
3797 "signature/*.class\"/>"
3798 "<include name=\"org/objectweb/asm/"
3799 "commons/SignatureRemapper.class\"/>")))
3800 #t))
3801 (add-before 'build 'remove-maven-dependency
3802 (lambda _
3803 ;; We do not need to build jarjar as a maven plugin just yet, so
3804 ;; remove this file. Maven requires jarjar (but not that plugin),
3805 ;; so removing it improves the bootstrap.
3806 (delete-file "src/main/com/tonicsystems/jarjar/JarJarMojo.java")
3807 #t))
3808 (replace 'install
3809 (lambda* (#:key outputs #:allow-other-keys)
3810 (let ((target (string-append (assoc-ref outputs "out")
3811 "/share/java")))
3812 (install-file (string-append "dist/jarjar-" ,version ".jar")
3813 target))
3814 #t)))))
3815 (inputs
3816 (list java-asm-bootstrap))
3817 (native-inputs
3818 (list unzip))
3819 (home-page "https://code.google.com/archive/p/jarjar/")
3820 (synopsis "Repackage Java libraries")
3821 (description
3822 "Jar Jar Links is a utility that makes it easy to repackage Java
3823libraries and embed them into your own distribution. Jar Jar Links includes
3824an Ant task that extends the built-in @code{jar} task.")
3825 (license license:asl2.0)))
3826
3827(define-public java-hamcrest
3828 (package
3829 (name "java-hamcrest")
3830 (version "3.0")
3831 (source (origin
3832 (method git-fetch)
3833 (uri (git-reference
3834 (url "https://github.com/hamcrest/JavaHamcrest/")
3835 (commit (string-append "v" version))))
3836 (file-name (git-file-name name version))
3837 (sha256
3838 (base32
3839 "07cagv2ncs4y02fmwbll3r4rqpjf3zxs163ync24q3x9fplrxmly"))))
3840 (build-system ant-build-system)
3841 (arguments
3842 `(#:tests? #f ; Tests require junit
3843 #:source-dir "hamcrest/src/main"
3844 #:jar-name "hamcrest.jar"))
3845 (home-page "https://hamcrest.org/")
3846 (synopsis "Library of matchers for building test expressions")
3847 (description
3848 "This package provides a library of matcher objects (also known as
3849constraints or predicates) allowing @code{match} rules to be defined
3850declaratively, to be used in other frameworks. Typical scenarios include
3851testing frameworks, mocking libraries and UI validation rules.")
3852 (license license:bsd-3)))
3853
3854(define-public java-hamcrest-core
3855 (package
3856 (name "java-hamcrest-core")
3857 (version "1.3")
3858 (properties `((superseded . ,java-hamcrest)))
3859 (source (origin
3860 (method git-fetch)
3861 (uri (git-reference
3862 (url "https://github.com/hamcrest/JavaHamcrest/")
3863 (commit (string-append "hamcrest-java-" version))))
3864 (file-name (git-file-name name version))
3865 (sha256
3866 (base32
3867 "16fxxkrd31ahqvcaby30jgh3z1i0zxh51m24hxgz0z2agxj6bc63"))
3868 (modules '((guix build utils)))
3869 (snippet
3870 '(begin
3871 ;; Delete bundled thirds-party jar archives.
3872 (delete-file-recursively "lib")
3873 #t))))
3874 (build-system ant-build-system)
3875 (arguments
3876 `(#:tests? #f ; Tests require junit
3877 #:modules ((guix build ant-build-system)
3878 (guix build java-utils)
3879 (guix build utils)
3880 (srfi srfi-1))
3881 #:make-flags (list (string-append "-Dversion=" ,version))
3882 #:test-target "unit-test"
3883 #:build-target "core"
3884 #:phases
3885 (modify-phases %standard-phases
3886 ;; Disable unit tests, because they require junit, which requires
3887 ;; hamcrest-core. We also give a fixed value to the "Built-Date"
3888 ;; attribute from the manifest for reproducibility.
3889 (add-before 'configure 'patch-build.xml
3890 (lambda _
3891 (substitute* "build.xml"
3892 (("unit-test, ") "")
3893 (("\\$\\{build.timestamp\\}") "guix"))
3894 #t))
3895 ;; Java's "getMethods()" returns methods in an unpredictable order.
3896 ;; To make the output of the generated code deterministic we must
3897 ;; sort the array of methods.
3898 (add-after 'unpack 'make-method-order-deterministic
3899 (lambda _
3900 (substitute* "hamcrest-generator/src/main/java/org/hamcrest/generator/ReflectiveFactoryReader.java"
3901 (("import java\\.util\\.Iterator;" line)
3902 (string-append line "\n"
3903 "import java.util.Arrays; import java.util.Comparator;"))
3904 (("allMethods = cls\\.getMethods\\(\\);" line)
3905 (string-append "_" line
3906 "
3907private Method[] getSortedMethods() {
3908 Arrays.sort(_allMethods, new Comparator<Method>() {
3909 @Override
3910 public int compare(Method a, Method b) {
3911 return a.toString().compareTo(b.toString());
3912 }
3913 });
3914 return _allMethods;
3915}
3916
3917private Method[] allMethods = getSortedMethods();")))
3918 #t))
3919 (add-before 'build 'do-not-use-bundled-qdox
3920 (lambda* (#:key inputs #:allow-other-keys)
3921 (substitute* "build.xml"
3922 (("lib/generator/qdox-1.12.jar")
3923 (string-append (assoc-ref inputs "java-qdox-1.12")
3924 "/share/java/qdox.jar")))
3925 #t))
3926 ;; build.xml searches for .jar files in this directoy, which
3927 ;; we remove from the source archive.
3928 (add-before 'build 'create-dummy-directories
3929 (lambda _
3930 (mkdir-p "lib/integration")
3931 #t))
3932 (add-before 'build 'create-pom
3933 (lambda _
3934 (substitute* "pom/hamcrest-core.pom"
3935 (("@VERSION@") ,version))
3936 #t))
3937 (replace 'install
3938 (install-from-pom "pom/hamcrest-core.pom")))))
3939 (native-inputs
3940 `(("java-qdox-1.12" ,java-qdox-1.12)
3941 ("java-jarjar" ,java-jarjar)))
3942 (propagated-inputs
3943 (list java-hamcrest-parent-pom))
3944 (home-page "https://hamcrest.org/")
3945 (synopsis "Library of matchers for building test expressions")
3946 (description
3947 "This package provides a library of matcher objects (also known as
3948constraints or predicates) allowing @code{match} rules to be defined
3949declaratively, to be used in other frameworks. Typical scenarios include
3950testing frameworks, mocking libraries and UI validation rules.")
3951 (license license:bsd-2)))
3952
3953(define-public java-hamcrest-parent-pom
3954 (package
3955 (inherit java-hamcrest-core)
3956 (properties '((hidden? . #t)))
3957 (name "java-hamcrest-parent-pom")
3958 (propagated-inputs '())
3959 (native-inputs '())
3960 (arguments
3961 `(#:tests? #f
3962 #:phases
3963 (modify-phases %standard-phases
3964 (delete 'configure)
3965 (replace 'build
3966 (lambda _
3967 (substitute* "pom/hamcrest-parent.pom"
3968 (("@VERSION@") ,(package-version java-hamcrest-core)))
3969 #t))
3970 (replace 'install
3971 (install-pom-file "pom/hamcrest-parent.pom")))))))
3972
3973(define-public java-hamcrest-library
3974 (package
3975 (inherit java-hamcrest-core)
3976 (name "java-hamcrest-library")
3977 (properties `((superseded . ,java-hamcrest)))
3978 (arguments
3979 (substitute-keyword-arguments (package-arguments java-hamcrest-core)
3980 ((#:build-target _) "library")
3981 ((#:phases phases)
3982 `(modify-phases ,phases
3983 (add-after 'unpack 'patch-classpath-for-integration
3984 (lambda* (#:key inputs #:allow-other-keys)
3985 (substitute* "build.xml"
3986 (("build/hamcrest-core-\\$\\{version\\}\\.jar")
3987 (car (find-files (assoc-ref inputs "java-hamcrest-core")
3988 "jar$"))))
3989 #t))
3990 (replace 'create-pom
3991 (lambda _
3992 (substitute* "pom/hamcrest-library.pom"
3993 (("@VERSION@") ,(package-version java-hamcrest-core)))
3994 #t))
3995 (replace 'install
3996 (install-from-pom "pom/hamcrest-library.pom"))))))
3997 (propagated-inputs
3998 (list java-hamcrest-core java-hamcrest-parent-pom))))
3999
4000(define-public java-junit
4001 (package
4002 (name "java-junit")
4003 (version "4.12")
4004 (source (origin
4005 (method git-fetch)
4006 (uri (git-reference
4007 (url "https://github.com/junit-team/junit/")
4008 (commit (string-append "r" version))))
4009 (file-name (git-file-name name version))
4010 (sha256
4011 (base32
4012 "1j8avi91px1z8rjc89cfikwrvfifdmmsarwiyrcnr59ynvpz0v8h"))
4013 (modules '((guix build utils)))
4014 (snippet
4015 '(begin
4016 ;; Delete bundled jar archives.
4017 (delete-file-recursively "lib")
4018 #t))))
4019 (build-system ant-build-system)
4020 (arguments
4021 `(#:jar-name "junit.jar"
4022 #:source-dir "src/main/java"
4023 #:test-dir "src/test"
4024 #:test-exclude (list "**/SimpleTest.java" "**/StackTracesTest.java"
4025 "**/RuleChainTest.java" "**/TestWatchmanTest.java")
4026 #:phases
4027 (modify-phases %standard-phases
4028 (add-before 'check 'copy-test-resources
4029 (lambda _
4030 (copy-recursively "src/test/resources" "build/test-classes")
4031 #t))
4032 (replace 'install
4033 (install-from-pom "pom.xml")))))
4034 (propagated-inputs
4035 (list java-hamcrest-core))
4036 (native-inputs
4037 (list java-hamcrest-library))
4038 (home-page "https://junit.org/junit4/")
4039 (synopsis "Test framework for Java")
4040 (description
4041 "JUnit is a simple framework to write repeatable tests for Java projects.
4042JUnit provides assertions for testing expected results, test fixtures for
4043sharing common test data, and test runners for running tests.")
4044 (license license:epl1.0)))
4045
4046(define-public java-junit-4.13.2
4047 (package
4048 (inherit java-junit)
4049 (name "java-junit")
4050 (version "4.13.2")
4051 (source
4052 (origin
4053 (method git-fetch)
4054 (uri (git-reference
4055 (url "https://github.com/junit-team/junit/")
4056 (commit (string-append "r" version))))
4057 (file-name (git-file-name "java-junit" version))
4058 (sha256
4059 (base32 "1r7k4zzscc8019np3is3bzfigw8fxd6s3259cbhzzh02q6d5p9h3"))))))
4060
4061(define-public java-junitparams
4062 (package
4063 (name "java-junitparams")
4064 (version "1.1.1")
4065 (source (origin
4066 (method git-fetch)
4067 (uri (git-reference
4068 (url "https://github.com/Pragmatists/JUnitParams")
4069 (commit (string-append "JUnitParams-" version))))
4070 (file-name (git-file-name name version))
4071 (sha256
4072 (base32
4073 "0rb52xdfp99invyjrras3w0bf0a81cz30yd47rkkiyqcqj0y1q9b"))))
4074 (build-system ant-build-system)
4075 (arguments
4076 `(#:jar-name "junitparams.jar"
4077 #:source-dir "src/main/java"
4078 #:test-dir "src/test"
4079 #:test-exclude (list "**/SuperclassTest.java")))
4080 (inputs
4081 (list java-junit))
4082 (native-inputs
4083 (list java-junit java-hamcrest-core java-assertj))
4084 (home-page "https://github.com/Pragmatists/JUnitParams")
4085 (synopsis "Parameterised test support for JUnit")
4086 (description "The JUnitParams project adds a new runner to JUnit and
4087provides much easier and readable parametrised tests for JUnit.")
4088 (license license:asl2.0)))
4089
4090(define-public java-plexus-utils
4091 (package
4092 (name "java-plexus-utils")
4093 (version "3.3.0")
4094 (source (origin
4095 (method git-fetch)
4096 (uri (git-reference
4097 (url "https://github.com/codehaus-plexus/plexus-utils")
4098 (commit (string-append "plexus-utils-" version))))
4099 (file-name (git-file-name name version))
4100 (sha256
4101 (base32
4102 "0d0fq21rzjy0j55kcp8w9k1rbq9rwr0r7cc8239p9jbz54vihp0g"))))
4103 (build-system ant-build-system)
4104 ;; FIXME: The default build.xml does not include a target to install
4105 ;; javadoc files.
4106 (arguments
4107 `(#:jar-name "plexus-utils.jar"
4108 #:source-dir "src/main"
4109 #:phases
4110 (modify-phases %standard-phases
4111 (add-after 'unpack 'fix-reference-to-/bin-and-/usr
4112 (lambda _
4113 (substitute* "src/main/java/org/codehaus/plexus/util/\
4114cli/shell/BourneShell.java"
4115 (("/bin/sh") (which "sh"))
4116 (("/usr/") (getcwd)))
4117 #t))
4118 (add-after 'unpack 'fix-or-disable-broken-tests
4119 (lambda _
4120 (with-directory-excursion "src/test/java/org/codehaus/plexus/util"
4121 (substitute* '("cli/CommandlineTest.java"
4122 "cli/shell/BourneShellTest.java")
4123 (("/bin/sh") (which "sh"))
4124 (("/bin/echo") (which "echo")))
4125
4126 ;; This test depends on MavenProjectStub, but we don't have
4127 ;; a package for Maven.
4128 (delete-file "introspection/ReflectionValueExtractorTest.java")
4129
4130 ;; FIXME: The command line tests fail, maybe because they use
4131 ;; absolute paths.
4132 (delete-file "cli/CommandlineTest.java")
4133
4134 ;; These tests require openjdk jmh, which is not packaged yet
4135 (for-each delete-file (find-files "." "PerfTest.java$")))
4136 #t))
4137 (add-before 'build 'copy-resources
4138 (lambda _
4139 (copy-recursively "src/main/resources" "build/classes")
4140 #t))
4141 (replace 'install (install-from-pom "pom.xml")))))
4142 (native-inputs
4143 (list java-hamcrest-core java-junit))
4144 (propagated-inputs
4145 (list plexus-parent-pom-5.1))
4146 (home-page "https://codehaus-plexus.github.io/plexus-utils/")
4147 (synopsis "Common utilities for the Plexus framework")
4148 (description "This package provides various Java utility classes for the
4149Plexus framework to ease working with strings, files, command lines, XML and
4150more.")
4151 (license license:asl2.0)))
4152
4153(define-public java-plexus-utils-3.2.1
4154 (package
4155 (inherit java-plexus-utils)
4156 ;; plexus-build-api needs this version, later versions don't work
4157 (version "3.2.1")
4158 (source (origin
4159 (method git-fetch)
4160 (uri (git-reference
4161 (url "https://github.com/codehaus-plexus/plexus-utils")
4162 (commit (string-append "plexus-utils-" version))))
4163 (file-name (git-file-name "java-plexus-utils" version))
4164 (sha256
4165 (base32
4166 "1w169glixyk94jbczj8jzg897lsab46jihiaa3dhw0p06g35va8b"))))))
4167
4168(define-public java-plexus-interpolation
4169 (package
4170 (name "java-plexus-interpolation")
4171 (version "1.26")
4172 (source (origin
4173 (method git-fetch)
4174 (uri (git-reference
4175 (url "https://github.com/codehaus-plexus/plexus-interpolation")
4176 (commit (string-append "plexus-interpolation-" version))))
4177 (file-name (git-file-name name version))
4178 (sha256
4179 (base32
4180 "1rahjmhywf6d5m32qzlc9izawyvcd71abfm9k03f13rs2xmfxzlh"))))
4181 (build-system ant-build-system)
4182 (arguments
4183 `(#:jar-name "plexus-interpolation.jar"
4184 #:source-dir "src/main"
4185 #:phases
4186 (modify-phases %standard-phases
4187 (replace 'install (install-from-pom "pom.xml")))))
4188 (propagated-inputs
4189 `(("plexus-parent-pom-5.1" ,plexus-parent-pom-5.1)))
4190 (native-inputs
4191 (list java-junit java-hamcrest-core))
4192 (home-page "https://codehaus-plexus.github.io/plexus-interpolation/")
4193 (synopsis "Java components for interpolating ${} strings and the like")
4194 (description "Plexus interpolator is a modular, flexible interpolation
4195framework for the expression language style commonly seen in Maven, Plexus,
4196and other related projects.
4197
4198It has its foundation in the @code{org.codehaus.plexus.utils.interpolation}
4199package within @code{plexus-utils}, but has been separated in order to allow
4200these two libraries to vary independently of one another.")
4201 (license license:asl2.0)))
4202
4203(define-public java-plexus-classworlds
4204 (package
4205 (name "java-plexus-classworlds")
4206 (version "2.6.0")
4207 (source (origin
4208 (method git-fetch)
4209 (uri (git-reference
4210 (url "https://github.com/codehaus-plexus/plexus-classworlds")
4211 (commit (string-append "plexus-classworlds-" version))))
4212 (file-name (git-file-name name version))
4213 (sha256
4214 (base32
4215 "034k2hgvj1saalwbnzrbg4n0zgzwcpz1lhlb8q4kgglsp9pmm03s"))))
4216 (build-system ant-build-system)
4217 (arguments
4218 `(#:jar-name "plexus-classworlds.jar"
4219 #:source-dir "src/main"
4220 #:tests? #f;; FIXME: we need to generate some resources as in pom.xml
4221 #:phases
4222 (modify-phases %standard-phases
4223 (replace 'install (install-from-pom "pom.xml")))))
4224 (propagated-inputs
4225 `(("plexus-parent-pom-5.1" ,plexus-parent-pom-5.1)))
4226 (native-inputs
4227 (list java-junit))
4228 (home-page "https://codehaus-plexus.github.io/plexus-classworlds/")
4229 (synopsis "Java class loader framework")
4230 (description "Plexus classworlds replaces the native @code{ClassLoader}
4231mechanism of Java. It is especially useful for dynamic loading of application
4232components.")
4233 (license license:asl2.0)))
4234
4235(define-public java-plexus-container-default-bootstrap
4236 (package
4237 (name "java-plexus-container-default-bootstrap")
4238 (version "2.1.0")
4239 (source (origin
4240 (method git-fetch)
4241 (uri (git-reference
4242 (url "https://github.com/codehaus-plexus/plexus-containers")
4243 (commit (string-append "plexus-containers-" version))))
4244 (file-name (git-file-name name version))
4245 (sha256
4246 (base32
4247 "0r9yq67c1hvi1pz5wmx6x6hk5fmavp8a7yal3j5hkaad757firn1"))))
4248 (build-system ant-build-system)
4249 (arguments
4250 `(#:jar-name "container-default.jar"
4251 #:source-dir "plexus-container-default/src/main/java"
4252 #:test-dir "plexus-container-default/src/test"
4253 #:tests? #f; requires plexus-archiver, which depends on this package
4254 #:phases
4255 (modify-phases %standard-phases
4256 (add-before 'build 'fix-google-collections
4257 (lambda _
4258 ;; Google collections are now replaced with guava
4259 (substitute* "plexus-container-default/pom.xml"
4260 (("google-collections") "guava")
4261 (("com.google.collections") "com.google.guava"))
4262 #t))
4263 (add-before 'build 'copy-resources
4264 (lambda _
4265 (copy-recursively
4266 "plexus-container-default/src/main/resources/"
4267 "build/classes")
4268 #t))
4269 (replace 'install
4270 (install-from-pom "plexus-container-default/pom.xml")))))
4271 (propagated-inputs
4272 `(("java-plexus-worldclass" ,java-plexus-classworlds)
4273 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
4274 ("java-plexus-utils" ,java-plexus-utils)
4275 ("java-junit" ,java-junit)
4276 ("java-guava" ,java-guava)
4277 ("java-plexus-containers-parent-pom" ,java-plexus-containers-parent-pom)))
4278 (home-page "https://github.com/codehaus-plexus/plexus-containers")
4279 (synopsis "Inversion-of-control container")
4280 (description "Plexus-default-container is Plexus' inversion-of-control
4281(@dfn{IoC}) container. It is composed of its public API and its default
4282implementation.")
4283 (properties '((hidden? . #t))) ;for bootstrapping purposes only
4284 (license license:asl2.0)))
4285
4286(define java-plexus-containers-parent-pom
4287 (package
4288 (inherit java-plexus-container-default-bootstrap)
4289 (name "java-plexus-containers-parent-pom")
4290 (arguments
4291 `(#:tests? #f
4292 #:phases
4293 (modify-phases %standard-phases
4294 (delete 'configure)
4295 (delete 'build)
4296 (replace 'install
4297 (install-pom-file "pom.xml")))))
4298 (propagated-inputs
4299 `(("plexus-parent-pom" ,plexus-parent-pom-4.0)))))
4300
4301(define-public java-plexus-io
4302 (package
4303 (name "java-plexus-io")
4304 (version "3.2.0")
4305 (source (origin
4306 (method git-fetch)
4307 (uri (git-reference
4308 (url "https://github.com/codehaus-plexus/plexus-io")
4309 (commit (string-append "plexus-io-" version))))
4310 (file-name (git-file-name name version))
4311 (sha256
4312 (base32
4313 "1r3wqfpbxq8vp4p914i8p88r0994rmcjw02hz14n11cfb6gsyvlr"))))
4314 (build-system ant-build-system)
4315 (arguments
4316 `(#:jar-name "plexus-io.jar"
4317 #:source-dir "src/main/java"
4318 #:test-dir "src/test"
4319 #:phases
4320 (modify-phases %standard-phases
4321 (add-before 'build 'copy-resources
4322 (lambda _
4323 (mkdir-p "build/classes")
4324 (copy-recursively "src/main/resources" "build/classes")
4325 (mkdir-p "build/test-classes")
4326 (copy-recursively "src/test/resources" "build/test-classes")
4327 #t))
4328 (replace 'install (install-from-pom "pom.xml")))))
4329 (propagated-inputs
4330 (list java-plexus-utils java-commons-io plexus-parent-pom-5.1))
4331 (inputs
4332 (list java-jsr305))
4333 (native-inputs
4334 `(("junit" ,java-junit)
4335 ("hamcrest" ,java-hamcrest-core)
4336 ("guava" ,java-guava)
4337 ("classworlds" ,java-plexus-classworlds)
4338 ("xbean" ,java-geronimo-xbean-reflect)
4339 ("container-default" ,java-plexus-container-default-bootstrap)))
4340 (home-page "https://github.com/codehaus-plexus/plexus-io")
4341 (synopsis "I/O plexus components")
4342 (description "Plexus IO is a set of plexus components, which are designed
4343for use in I/O operations. This implementation using plexus components allows
4344reusing it in maven.")
4345 (license license:asl2.0)))
4346
4347(define-public java-plexus-archiver
4348 (package
4349 (name "java-plexus-archiver")
4350 (version "4.2.2")
4351 (source (origin
4352 (method url-fetch)
4353 (uri (string-append "https://github.com/codehaus-plexus/plexus-archiver"
4354 "/archive/plexus-archiver-" version ".tar.gz"))
4355 (sha256
4356 (base32
4357 "144n971r3lfrx3l12nf2scm80x4xdvgbkk4bjpa4vcvvdrll6qys"))))
4358 (build-system ant-build-system)
4359 (arguments
4360 `(#:jar-name "plexus-archiver.jar"
4361 #:source-dir "src/main/java"
4362 #:test-dir "src/test"
4363 #:test-exclude (list "**/Abstract*.java" "**/Base*.java")
4364 #:phases
4365 (modify-phases %standard-phases
4366 (add-before 'check 'remove-failing
4367 (lambda _
4368 ;; Requires an older version of plexus container
4369 (delete-file
4370 "src/test/java/org/codehaus/plexus/archiver/DuplicateFilesTest.java")
4371 #t))
4372 (add-before 'check 'fix-test-building
4373 (lambda _
4374 (substitute* "build.xml"
4375 (("srcdir=\"src/test\"") "srcdir=\"src/test/java\""))
4376 #t))
4377 (add-before 'build 'copy-resources
4378 (lambda _
4379 (mkdir-p "build/classes")
4380 (copy-recursively "src/main/resources" "build/classes")
4381 (mkdir-p "build/test-classes")
4382 (copy-recursively "src/test/resources" "build/test-classes")
4383 #t))
4384 (replace 'install (install-from-pom "pom.xml")))))
4385 (propagated-inputs
4386 (list java-plexus-utils java-plexus-io java-iq80-snappy
4387 java-commons-compress-1.21 plexus-parent-pom-6.1))
4388 (inputs
4389 `(("java-jsr305" ,java-jsr305)
4390 ("java-plexus-container-default"
4391 ,java-plexus-container-default-bootstrap)))
4392 (native-inputs
4393 `(("java-hamcrest-core" ,java-hamcrest-core)
4394 ("junit" ,java-junit)
4395 ("classworld" ,java-plexus-classworlds)
4396 ("xbean" ,java-geronimo-xbean-reflect)
4397 ("xz" ,java-xz)
4398 ("guava" ,java-guava)))
4399 (home-page "https://github.com/codehaus-plexus/plexus-archiver")
4400 (synopsis "Archiver component of the Plexus project")
4401 (description "Plexus-archiver contains a component to deal with project
4402archives (jar).")
4403 (license license:asl2.0)))
4404
4405(define-public java-plexus-container-default
4406 (package
4407 (inherit java-plexus-container-default-bootstrap)
4408 (name "java-plexus-container-default")
4409 (arguments
4410 `(#:jar-name "container-default.jar"
4411 #:source-dir "plexus-container-default/src/main/java"
4412 #:test-dir "plexus-container-default/src/test"
4413 #:test-exclude (list ;"**/*Test.java"
4414 "**/Abstract*.java"
4415 ;; Requires plexus-hierarchy
4416 "**/PlexusHierarchyTest.java"
4417 ;; Failures
4418 "**/ComponentRealmCompositionTest.java"
4419 "**/PlexusContainerTest.java")
4420 #:phases
4421 (modify-phases %standard-phases
4422 (add-before 'build 'fix-google-collections
4423 (lambda _
4424 ;; Google collections are now replaced with guava
4425 (substitute* "plexus-container-default/pom.xml"
4426 (("google-collections") "guava")
4427 (("com.google.collections") "com.google.guava"))
4428 #t))
4429 (add-before 'build 'copy-resources
4430 (lambda _
4431 (copy-recursively
4432 "plexus-container-default/src/main/resources/"
4433 "build/classes")
4434 #t))
4435 (add-before 'check 'fix-paths
4436 (lambda _
4437 (let ((dir "plexus-container-default/src/test/java/org/codehaus"))
4438 (substitute*
4439 (string-append
4440 dir "/plexus/component/composition/"
4441 "ComponentRealmCompositionTest.java")
4442 (("src/test") "plexus-container-default/src/test"))
4443 #t)))
4444 (replace 'install
4445 (install-from-pom "plexus-container-default/pom.xml")))))
4446 (inputs
4447 `(("worldclass" ,java-plexus-classworlds)
4448 ("xbean" ,java-geronimo-xbean-reflect)
4449 ("utils" ,java-plexus-utils)
4450 ("junit" ,java-junit)
4451 ("guava" ,java-guava)))
4452 (native-inputs
4453 `(("archiver" ,java-plexus-archiver)
4454 ("hamcrest" ,java-hamcrest-core)))
4455 (properties
4456 (alist-delete
4457 'hidden?
4458 (package-properties java-plexus-container-default-bootstrap)))))
4459
4460(define-public java-plexus-component-annotations
4461 (package
4462 (inherit java-plexus-container-default)
4463 (name "java-plexus-component-annotations")
4464 (arguments
4465 `(#:jar-name "plexus-component-annotations.jar"
4466 #:source-dir "plexus-component-annotations/src/main/java"
4467 #:tests? #f; no tests
4468 #:phases
4469 (modify-phases %standard-phases
4470 (replace 'install
4471 (install-from-pom "plexus-component-annotations/pom.xml")))))
4472 (propagated-inputs
4473 (list java-plexus-containers-parent-pom))
4474 (inputs '())
4475 (native-inputs '())
4476 (synopsis "Plexus descriptors generator")
4477 (description "This package is a Maven plugin to generate Plexus descriptors
4478from source tags and class annotations.")))
4479
4480(define-public java-plexus-component-metadata
4481 (package
4482 (inherit java-plexus-container-default)
4483 (name "java-plexus-component-metadata")
4484 (arguments
4485 `(#:jar-name "plexus-component-metadata.jar"
4486 #:source-dir "src/main/java"
4487 #:test-dir "src/test"
4488 #:jdk ,icedtea-8
4489 #:phases
4490 (modify-phases %standard-phases
4491 (add-before 'configure 'chdir
4492 (lambda _
4493 (chdir "plexus-component-metadata")
4494 #t))
4495 (add-before 'build 'copy-resources
4496 (lambda _
4497 (copy-recursively "src/main/resources"
4498 "build/classes/")
4499 #t))
4500 (add-before 'build 'fix-jdom
4501 (lambda _
4502 ;; The newer version of jdom now sets multiple features by default
4503 ;; that are not supported.
4504 ;; Skip these features
4505 (substitute* "src/main/java/org/codehaus/plexus/metadata/merge/MXParser.java"
4506 (("throw new XmlPullParserException\\(\"unsupporte feature \"\\+name\\);")
4507 "// skip"))))
4508 (add-before 'build 'reinstate-cli
4509 ;; The CLI was removed in 2.1.0, but we still need it to build some
4510 ;; maven dependencies, and some parts of maven itself. We can't use
4511 ;; the maven plugin for that yet.
4512 (lambda _
4513 (with-output-to-file "src/main/java/org/codehaus/plexus/metadata/PlexusMetadataGeneratorCli.java"
4514 (lambda _
4515 ;; Copied from a previous version of this package.
4516 (display "package org.codehaus.plexus.metadata;
4517
4518import java.io.File;
4519import java.util.Arrays;
4520import java.util.Collections;
4521
4522import org.apache.commons.cli.CommandLine;
4523import org.apache.commons.cli.OptionBuilder;
4524import org.apache.commons.cli.Options;
4525import org.codehaus.plexus.PlexusContainer;
4526import org.codehaus.plexus.tools.cli.AbstractCli;
4527
4528public class PlexusMetadataGeneratorCli
4529 extends AbstractCli
4530{
4531 public static final char SOURCE_DIRECTORY = 's';
4532 public static final char SOURCE_ENCODING = 'e';
4533 public static final char CLASSES_DIRECTORY = 'c';
4534 public static final char OUTPUT_FILE = 'o';
4535 public static final char DESCRIPTORS_DIRECTORY = 'm';
4536
4537 public static void main( String[] args )
4538 throws Exception
4539 {
4540 new PlexusMetadataGeneratorCli().execute( args );
4541 }
4542
4543 @Override
4544 public String getPomPropertiesPath()
4545 {
4546 return \"META-INF/maven/org.codehaus.plexus/plexus-metadata-generator/pom.properties\";
4547 }
4548
4549 @Override
4550 @SuppressWarnings(\"static-access\")
4551 public Options buildCliOptions( Options options )
4552 {
4553 options.addOption( OptionBuilder.withLongOpt( \"source\" ).hasArg().withDescription( \"Source directory.\" ).create( SOURCE_DIRECTORY ) );
4554 options.addOption( OptionBuilder.withLongOpt( \"encoding\" ).hasArg().withDescription( \"Source file encoding.\" ).create( SOURCE_ENCODING ) );
4555 options.addOption( OptionBuilder.withLongOpt( \"classes\" ).hasArg().withDescription( \"Classes directory.\" ).create( CLASSES_DIRECTORY ) );
4556 options.addOption( OptionBuilder.withLongOpt( \"output\" ).hasArg().withDescription( \"Output directory.\" ).create( OUTPUT_FILE ) );
4557 options.addOption( OptionBuilder.withLongOpt( \"descriptors\" ).hasArg().withDescription( \"Descriptors directory.\" ).create( DESCRIPTORS_DIRECTORY ) );
4558 return options;
4559 }
4560
4561 public void invokePlexusComponent( CommandLine cli, PlexusContainer plexus )
4562 throws Exception
4563 {
4564 MetadataGenerator metadataGenerator = plexus.lookup( MetadataGenerator.class );
4565
4566 MetadataGenerationRequest request = new MetadataGenerationRequest();
4567 request.classesDirectory = new File( cli.getOptionValue( CLASSES_DIRECTORY ) );
4568 request.classpath = Collections.emptyList();
4569 request.sourceDirectories = Arrays.asList( new String[]{ new File( cli.getOptionValue( SOURCE_DIRECTORY ) ).getAbsolutePath() } );
4570 request.sourceEncoding = cli.getOptionValue( SOURCE_ENCODING );
4571 request.useContextClassLoader = true;
4572 request.outputFile = new File( cli.getOptionValue( OUTPUT_FILE ) );
4573 request.componentDescriptorDirectory = new File( cli.getOptionValue( DESCRIPTORS_DIRECTORY ) );
4574
4575 metadataGenerator.generateDescriptor( request );
4576 }
4577}")))))
4578 (add-before 'check 'fix-test-location
4579 (lambda _
4580 (substitute* '("src/test/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriterTest.java"
4581 "src/test/java/org/codehaus/plexus/metadata/merge/ComponentsXmlMergerTest.java")
4582 (("target") "build")))))))
4583 (propagated-inputs
4584 `(("java-plexus-container-default" ,java-plexus-container-default)
4585 ("java-plexu-component-annotations" ,java-plexus-component-annotations)
4586 ("java-plexus-utils" ,java-plexus-utils)
4587 ("java-plexus-cli" ,java-plexus-cli)
4588 ("java-plexus-classworlds" ,java-plexus-classworlds)
4589 ("maven-plugin-api" ,maven-plugin-api)
4590 ("maven-plugin-annotations" ,maven-plugin-annotations)
4591 ("maven-core-bootstrap" ,maven-core-bootstrap)
4592 ("maven-model" ,maven-model)
4593 ("java-commons-cli" ,java-commons-cli)
4594 ("java-qdox" ,java-qdox)
4595 ("java-jdom2" ,java-jdom2)
4596 ("java-asm-8" ,java-asm-8)))
4597 (native-inputs
4598 (list java-junit java-guava java-geronimo-xbean-reflect))
4599 (synopsis "Inversion-of-control container for Maven")
4600 (description "The Plexus project provides a full software stack for creating
4601and executing software projects. Based on the Plexus container, the
4602applications can utilise component-oriented programming to build modular,
4603reusable components that can easily be assembled and reused. This package
4604provides the Maven plugin generating the component metadata.")))
4605
4606(define-public java-plexus-container-default-1.7
4607 (package
4608 (inherit java-plexus-container-default)
4609 (version "1.7.1")
4610 (source (origin
4611 (method git-fetch)
4612 (uri (git-reference
4613 (url "https://github.com/codehaus-plexus/plexus-containers")
4614 (commit (string-append "plexus-containers-" version))))
4615 (file-name (git-file-name "java-plexus-container-default" version))
4616 (sha256
4617 (base32
4618 "1316hrp5vqfv0aw7miq2fp0wwy833h66h502h29vnh5sxj27x228"))))))
4619
4620(define java-plexus-containers-parent-pom-1.7
4621 (package
4622 (inherit java-plexus-container-default-1.7)
4623 (name "java-plexus-containers-parent-pom")
4624 (arguments
4625 `(#:tests? #f
4626 #:phases
4627 (modify-phases %standard-phases
4628 (delete 'configure)
4629 (delete 'build)
4630 (replace 'install
4631 (install-pom-file "pom.xml")))))
4632 (propagated-inputs
4633 `(("plexus-parent-pom" ,plexus-parent-pom-4.0)))))
4634
4635(define-public java-plexus-component-annotations-1.7
4636 (package
4637 (inherit java-plexus-container-default-1.7)
4638 (name "java-plexus-component-annotations")
4639 (arguments
4640 `(#:jar-name "plexus-component-annotations.jar"
4641 #:source-dir "plexus-component-annotations/src/main/java"
4642 #:tests? #f; no tests
4643 #:phases
4644 (modify-phases %standard-phases
4645 (replace 'install
4646 (install-from-pom "plexus-component-annotations/pom.xml")))))
4647 (propagated-inputs
4648 `(("java-plexus-containers-parent-pom-1.7" ,java-plexus-containers-parent-pom-1.7)))
4649 (inputs '())
4650 (native-inputs '())
4651 (synopsis "Plexus descriptors generator")
4652 (description "This package is a Maven plugin to generate Plexus descriptors
4653from source tags and class annotations.")))
4654
4655(define-public java-plexus-component-metadata-1.7
4656 (package
4657 (inherit java-plexus-container-default-1.7)
4658 (name "java-plexus-component-metadata")
4659 (arguments
4660 `(#:jar-name "plexus-component-metadata.jar"
4661 #:source-dir "src/main/java"
4662 #:test-dir "src/test"
4663 #:phases
4664 (modify-phases %standard-phases
4665 (add-before 'configure 'chdir
4666 (lambda _
4667 (chdir "plexus-component-metadata")
4668 #t))
4669 (add-before 'build 'copy-resources
4670 (lambda _
4671 (copy-recursively "src/main/resources"
4672 "build/classes/")
4673 #t))
4674 (add-before 'build 'fix-jdom
4675 (lambda _
4676 ;; The newer version of jdom now sets multiple features by default
4677 ;; that are not supported.
4678 ;; Skip these features
4679 (substitute* "src/main/java/org/codehaus/plexus/metadata/merge/MXParser.java"
4680 (("throw new XmlPullParserException\\(\"unsupporte feature \"\\+name\\);")
4681 "// skip"))))
4682 (add-before 'check 'fix-test-location
4683 (lambda _
4684 (substitute* '("src/test/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriterTest.java"
4685 "src/test/java/org/codehaus/plexus/metadata/merge/ComponentsXmlMergerTest.java")
4686 (("target") "build")))))))
4687 (propagated-inputs
4688 (list java-plexus-container-default-1.7
4689 java-plexus-component-annotations-1.7
4690 java-plexus-utils
4691 java-plexus-cli
4692 java-plexus-cli
4693 java-plexus-classworlds
4694 maven-plugin-api
4695 maven-plugin-annotations
4696 maven-core-bootstrap
4697 maven-model
4698 java-commons-cli
4699 java-qdox
4700 java-jdom2
4701 java-asm-8))
4702 (native-inputs
4703 (list java-junit java-guava java-geronimo-xbean-reflect))
4704 (synopsis "Inversion-of-control container for Maven")
4705 (description "The Plexus project provides a full software stack for creating
4706and executing software projects. Based on the Plexus container, the
4707applications can utilise component-oriented programming to build modular,
4708reusable components that can easily be assembled and reused. This package
4709provides the Maven plugin generating the component metadata.")))
4710
4711(define-public java-plexus-cipher
4712 (package
4713 (name "java-plexus-cipher")
4714 (version "2.0")
4715 (source (origin
4716 (method git-fetch)
4717 (uri (git-reference
4718 (url "https://github.com/codehaus-plexus/plexus-cipher")
4719 (commit (string-append "plexus-cipher-" version))))
4720 (file-name (git-file-name name version))
4721 (sha256
4722 (base32
4723 "01fipdsm090n8j4207fl8kbxznkgkmkkgyazf53hm1nwn6na5aai"))))
4724 (build-system ant-build-system)
4725 (arguments
4726 `(#:jar-name "plexus-cipher.jar"
4727 #:source-dir "src/main/java"
4728 #:phases
4729 (modify-phases %standard-phases
4730 (add-before 'build 'generate-javax.inject.Named
4731 (lambda _
4732 (mkdir-p "build/classes/META-INF/sisu")
4733 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4734 (lambda _
4735 (display
4736 "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
4737 #t))
4738 (replace 'install (install-from-pom "pom.xml")))))
4739 (inputs
4740 `(("java-cdi-api" ,java-cdi-api)
4741 ("java-javax-inject" ,java-javax-inject)))
4742 (propagated-inputs
4743 `(("java-sonatype-spice-parent-pom" ,java-sonatype-spice-parent-pom-15)
4744 ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)))
4745 (native-inputs
4746 `(("java-junit" ,java-junit)))
4747 (home-page "https://github.com/sonatype/plexus-cipher")
4748 (synopsis "Encryption/decryption Component")
4749 (description "Plexus-cipher contains a component to deal with encryption
4750and decryption.")
4751 (license license:asl2.0)))
4752
4753(define-public java-plexus-cipher-1.7
4754 (package
4755 (inherit java-plexus-cipher)
4756 (version "1.7")
4757 (source (origin
4758 (method git-fetch)
4759 (uri (git-reference
4760 (url "https://github.com/codehaus-plexus/plexus-cipher")
4761 (commit (string-append "plexus-cipher-" version))))
4762 (file-name (git-file-name "java-plexus-cipher" version))
4763 (sha256
4764 (base32
4765 "0m638nzlxbmnbcj5cwdpgs326ab584yv0k803zlx37r6iqwvf6b0"))))
4766 (arguments
4767 `(#:jar-name "plexus-cipher.jar"
4768 #:source-dir "src/main/java"
4769 #:tests? #f; FIXME: requires sisu-inject-bean
4770 #:phases
4771 (modify-phases %standard-phases
4772 (add-before 'build 'copy-resources
4773 (lambda _
4774 (copy-recursively "src/main/resources" "build/classes")
4775 (mkdir-p "build/classes/META-INF/sisu")
4776 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4777 (lambda _
4778 (display "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
4779 #t))
4780 (add-before 'install 'fix-test-dependency
4781 (lambda _
4782 ;; sisu-inject-bean is only used for tests, but its scope is "provided".
4783 (substitute* "pom.xml"
4784 (("provided") "test"))
4785 #t))
4786 (replace 'install (install-from-pom "pom.xml")))))
4787 (propagated-inputs
4788 (list java-sonatype-spice-parent-pom-15))))
4789
4790(define-public java-plexus-java
4791 (package
4792 (name "java-plexus-java")
4793 (version "0.9.10")
4794 (source (origin
4795 (method git-fetch)
4796 (uri (git-reference
4797 (url "https://github.com/codehaus-plexus/plexus-languages")
4798 (commit (string-append "plexus-languages-" version))))
4799 (file-name (git-file-name name version))
4800 (sha256
4801 (base32
4802 "0vmvgq5hfxs90yyxgssfpwq78l7vwx1ljwpkk594mrdr8sm668b5"))
4803 (modules '((guix build utils)))
4804 (snippet
4805 `(begin
4806 (for-each delete-file (find-files "." ".*.jar$"))
4807 #t))))
4808 (build-system ant-build-system)
4809 (arguments
4810 `(#:jar-name "plexus-java.java"
4811 #:source-dir "plexus-java/src/main/java"
4812 #:test-dir "plexus-java/src/test"
4813 #:tests? #f; require mockito 2
4814 #:phases
4815 (modify-phases %standard-phases
4816 (add-after 'build 'generate-metadata
4817 (lambda _
4818 (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
4819 "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
4820 "--source" "plexus-java/src/main/java"
4821 "--output" "build/classes/META-INF/plexus/components.xml"
4822 "--classes" "build/classes"
4823 "--descriptors" "build/classes/META-INF")
4824 (invoke "ant" "jar")
4825 #t))
4826 (add-before 'install 'install-parent
4827 (install-pom-file "pom.xml"))
4828 (replace 'install
4829 (install-from-pom "plexus-java/pom.xml")))))
4830 (propagated-inputs
4831 (list java-asm java-qdox-2-M9 java-javax-inject
4832 plexus-parent-pom-4.0))
4833 (inputs
4834 (list java-plexus-component-annotations-1.7))
4835 (native-inputs
4836 (list java-plexus-component-metadata-1.7 java-junit))
4837 (home-page "https://codehaus-plexus.github.io/plexus-languages/plexus-java")
4838 (synopsis "Shared language features for Java")
4839 (description "This package contains shared language features of the Java
4840language, for the plexus project.")
4841 (license license:asl2.0)))
4842
4843(define-public java-plexus-compiler-api
4844 (package
4845 (name "java-plexus-compiler-api")
4846 (version "2.8.4")
4847 (source (origin
4848 (method git-fetch)
4849 (uri (git-reference
4850 (url "https://github.com/codehaus-plexus/plexus-compiler")
4851 (commit (string-append "plexus-compiler-" version))))
4852 (file-name (git-file-name name version))
4853 (sha256
4854 (base32
4855 "1nq1gnn3s6z1j29gmi1hqbklsmm8b1lmnafb0191914f95mn18gk"))))
4856 (build-system ant-build-system)
4857 (arguments
4858 `(#:jar-name "plexus-compiler-api.jar"
4859 #:source-dir "plexus-compiler-api/src/main/java"
4860 #:test-dir "plexus-compiler-api/src/test"
4861 #:phases
4862 (modify-phases %standard-phases
4863 (replace 'install
4864 (install-from-pom "plexus-compiler-api/pom.xml")))))
4865 (propagated-inputs
4866 `(("java-plexus-container-default" ,java-plexus-container-default)
4867 ("java-plexus-compiler-pom" ,java-plexus-compiler-pom)
4868 ("java-plexus-util" ,java-plexus-utils)))
4869 (native-inputs
4870 (list java-junit))
4871 (home-page "https://github.com/codehaus-plexus/plexus-compiler")
4872 (synopsis "Plexus Compilers component's API to manipulate compilers")
4873 (description "This package contains the API used by components to manipulate
4874compilers.")
4875 (license (list license:asl2.0
4876 license:expat))))
4877
4878(define java-plexus-compiler-pom
4879 (package
4880 (inherit java-plexus-compiler-api)
4881 (name "java-plexus-compiler-pom")
4882 (arguments
4883 `(#:tests? #f
4884 #:phases
4885 (modify-phases %standard-phases
4886 (delete 'configure)
4887 (delete 'build)
4888 (replace 'install
4889 (install-pom-file "pom.xml"))
4890 (add-after 'install 'install-compilers
4891 (install-pom-file "plexus-compilers/pom.xml")))))
4892 (propagated-inputs
4893 `(("plexus-components-parent-pom-4.0" ,plexus-components-parent-pom-4.0)))))
4894
4895(define plexus-components-parent-pom-4.0
4896 (package
4897 (name "plexus-components-parent-pom")
4898 (version "4.0")
4899 (source (origin
4900 (method git-fetch)
4901 (uri (git-reference
4902 (url "https://github.com/codehaus-plexus/plexus-components")
4903 (commit (string-append "plexus-components-" version))))
4904 (file-name (git-file-name name version))
4905 (sha256
4906 (base32
4907 "041bm8yv0m2i17mqg8zljib4ykpha7ijls2qfdwvkma4d39lhysi"))))
4908 (build-system ant-build-system)
4909 (arguments
4910 `(#:tests? #f
4911 #:phases
4912 (modify-phases %standard-phases
4913 (delete 'configure)
4914 (delete 'build)
4915 (replace 'install
4916 (install-pom-file "pom.xml")))))
4917 (propagated-inputs
4918 `(("plexus-parent-pom-4.0" ,plexus-parent-pom-4.0)))
4919 (home-page "https://codehaus-plexus.github.io/plexus-components")
4920 (synopsis "Plexus parent pom")
4921 (description "This package contains the Plexus components parent POM.")
4922 (license license:asl2.0)))
4923
4924(define-public java-plexus-compiler-manager
4925 (package
4926 (inherit java-plexus-compiler-api)
4927 (name "java-plexus-compiler-manager")
4928 (arguments
4929 `(#:jar-name "compiler-compiler-manager.java"
4930 #:source-dir "plexus-compiler-manager/src/main/java"
4931 #:test-dir "plexus-compiler-manager/src/test"
4932 #:tests? #f
4933 #:phases
4934 (modify-phases %standard-phases
4935 (add-after 'build 'generate-metadata
4936 (lambda _
4937 (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
4938 "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
4939 "--source" "plexus-compiler-manager/src/main/java"
4940 "--output" "build/classes/META-INF/plexus/components.xml"
4941 "--classes" "build/classes"
4942 "--descriptors" "build/classes/META-INF")
4943 (invoke "ant" "jar")
4944 #t))
4945 (add-after 'generate-metadata 'rebuild
4946 (lambda _
4947 (invoke "ant" "jar")
4948 #t))
4949 (replace 'install
4950 (install-from-pom "plexus-compiler-manager/pom.xml")))))
4951 (propagated-inputs
4952 (list java-plexus-compiler-api java-plexus-compiler-pom
4953 java-plexus-container-default-1.7))
4954 (native-inputs
4955 (list unzip java-plexus-component-metadata-1.7))
4956 (synopsis "Compiler management for Plexus Compiler component")
4957 (description "Plexus Compiler is a Plexus component to use different
4958compilers through a uniform API. This component chooses the compiler
4959implementation to use in a project.")))
4960
4961(define-public java-plexus-compiler-javac
4962 (package
4963 (inherit java-plexus-compiler-api)
4964 (name "java-plexus-compiler-javac")
4965 (arguments
4966 `(#:jar-name "plexus-compiler-javac.jar"
4967 #:source-dir "plexus-compilers/plexus-compiler-javac/src/main/java"
4968 #:jdk ,icedtea-8
4969 #:tests? #f; depends on compiler-test -> maven-core -> ... -> this package.
4970 #:test-dir "plexus-compilers/plexus-compiler-javac/src/test"
4971 #:modules ((guix build ant-build-system)
4972 (guix build utils)
4973 (guix build java-utils)
4974 (sxml simple))
4975 #:phases
4976 (modify-phases %standard-phases
4977 ;; We cannot use java-plexus-component-metadata to generate the metadata
4978 ;; because it ultimately depends on this package.
4979 ;; Create it manually instead
4980 (add-before 'build 'create-metadata
4981 (lambda _
4982 (let* ((dir "build/classes/META-INF/plexus")
4983 (file (string-append dir "/components.xml")))
4984 (mkdir-p dir)
4985 (with-output-to-file file
4986 (lambda _
4987 (sxml->xml
4988 `(component-set
4989 (components
4990 (component
4991 (role "org.codehaus.plexus.compiler.Compiler")
4992 (role-hint "javac")
4993 (implementation "org.codehaus.plexus.compiler.javac.JavacCompiler")
4994 (isolated-realm "false"))))))))
4995 #t))
4996 (replace 'install
4997 (install-from-pom "plexus-compilers/plexus-compiler-javac/pom.xml")))))
4998 (propagated-inputs
4999 (list java-plexus-compiler-api java-plexus-utils
5000 java-plexus-container-default))
5001 (synopsis "Javac Compiler support for Plexus Compiler component")
5002 (description "This package contains the Javac Compiler support for Plexus
5003Compiler component.")))
5004
5005(define plexus-components-pom-1.1.20
5006 (package
5007 (name "plexus-components-pom-1.1.20")
5008 (version "1.1.20")
5009 (source (origin
5010 (method git-fetch)
5011 (uri (git-reference
5012 (url "https://github.com/codehaus-plexus/plexus-components")
5013 (commit (string-append "plexus-components-" version))))
5014 (file-name (git-file-name name version))
5015 (sha256
5016 (base32
5017 "1q254k95m9icyfsvaw8c226midg8v6v436wvivhv7im825mnp5yb"))))
5018 (build-system ant-build-system)
5019 (arguments
5020 `(#:tests? #f
5021 #:phases
5022 (modify-phases %standard-phases
5023 (delete 'configure)
5024 (delete 'build)
5025 (replace 'install
5026 (install-pom-file "pom.xml")))))
5027 (propagated-inputs
5028 `(("plexus-parent-pom" ,plexus-parent-pom-3.1)))
5029 (home-page "https://github.com/codehaus-plexus/plexus-components")
5030 (synopsis "Maven parent pom for plexus packages")
5031 (description "This package contains the parent pom for plexus component
5032packages.")
5033 (license license:asl2.0)))
5034
5035(define-public java-plexus-digest
5036 (package
5037 (name "java-plexus-digest")
5038 (version "1.2")
5039 (source (origin
5040 (method git-fetch)
5041 (uri (git-reference
5042 (url "https://github.com/codehaus-plexus/plexus-digest")
5043 (commit "2a52ad1bda8297fa0e287163d2fa37245ec6a430")))
5044 (file-name (git-file-name name version))
5045 (sha256
5046 (base32
5047 "19w5wxsliz8r42niry68qa665kvjsb8081dazg9vgd3pca72w07x"))))
5048 (build-system ant-build-system)
5049 (arguments
5050 `(#:jar-name "plexus-digest.jar"
5051 #:source-dir "src/main/java"
5052 #:tests? #f
5053 #:phases
5054 (modify-phases %standard-phases
5055 (replace 'install
5056 (install-from-pom "pom.xml")))))
5057 (propagated-inputs
5058 (list java-plexus-utils plexus-components-pom-1.1.20))
5059 (native-inputs
5060 (list java-junit))
5061 (home-page "https://github.com/codehaus-plexus/plexus-digest")
5062 (synopsis "Hash function utilities for Java")
5063 (description "This package is a plexus component that contains hash
5064function utilities.")
5065 (license license:asl2.0)))
5066
5067(define-public java-plexus-sec-dispatcher
5068 (package
5069 (name "java-plexus-sec-dispatcher")
5070 (version "2.0")
5071 (source (origin
5072 (method git-fetch)
5073 (uri (git-reference
5074 (url "https://github.com/codehaus-plexus/plexus-sec-dispatcher")
5075 (commit (string-append "plexus-sec-dispatcher-" version))))
5076 (sha256
5077 (base32
5078 "0665zcyxkv2knydxgv2dn64zvy1dx9j9af12ds9s64qmzd1rk6pk"))
5079 (file-name (git-file-name name version))))
5080 (arguments
5081 `(#:jar-name "plexus-sec-dispatcher.jar"
5082 #:source-dir "src/main/java"
5083 #:phases
5084 (modify-phases %standard-phases
5085 (add-before 'build 'generate-models
5086 (lambda* (#:key inputs #:allow-other-keys)
5087 (define (modello-single-mode file version mode)
5088 (invoke "java"
5089 "org.codehaus.modello.ModelloCli"
5090 file mode "src/main/java" version
5091 "false" "true"))
5092 (let ((file "src/main/mdo/settings-security.mdo"))
5093 (modello-single-mode file "1.0.0" "java")
5094 (modello-single-mode file "1.0.0" "xpp3-reader")
5095 (modello-single-mode file "1.0.0" "xpp3-writer"))
5096 #t))
5097 (add-before 'build 'generate-javax.inject.Named
5098 (lambda _
5099 (mkdir-p "build/classes/META-INF/sisu")
5100 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
5101 (lambda _
5102 (display
5103 "org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher\n")))
5104 #t))
5105 (add-before 'check 'fix-paths
5106 (lambda _
5107 (copy-recursively "src/test/resources" "target")
5108 #t))
5109 (replace 'install (install-from-pom "pom.xml")))))
5110 (propagated-inputs
5111 (list java-plexus-utils java-plexus-cipher plexus-parent-pom-8))
5112 (native-inputs
5113 (list java-javax-inject
5114 java-modello-core
5115 ;; for modello
5116 java-plexus-container-default
5117 java-plexus-classworlds
5118 java-plexus-utils
5119 java-guava
5120 java-geronimo-xbean-reflect
5121 ;; modello plugins
5122 java-modello-plugins-java
5123 java-modello-plugins-xml
5124 java-modello-plugins-xpp3
5125 ;; for tests
5126 java-junit))
5127 (build-system ant-build-system)
5128 (home-page "https://github.com/sonatype/plexus-sec-dispatcher")
5129 (synopsis "Plexus Security Dispatcher Component")
5130 (description "This package is the Plexus Security Dispatcher Component.
5131This component decrypts a string passed to it.")
5132 (license license:asl2.0)))
5133
5134(define-public java-plexus-sec-dispatcher-1.4
5135 (package
5136 (inherit java-plexus-sec-dispatcher)
5137 (version "1.4")
5138 (source (origin
5139 (method git-fetch)
5140 (uri (git-reference
5141 (url "https://github.com/codehaus-plexus/plexus-sec-dispatcher")
5142 (commit (string-append "sec-dispatcher-" version))))
5143 (sha256
5144 (base32
5145 "1ng4yliy4cqpjr4fxxjbpwyk1wkch5f8vblm1kvwf328s4gibszs"))
5146 (file-name (git-file-name "java-plexus-sec-dispatcher" version))))
5147 (arguments
5148 (substitute-keyword-arguments (package-arguments java-plexus-sec-dispatcher)
5149 ((#:phases phases)
5150 `(modify-phases ,phases
5151 (delete 'generate-javax.inject.Named)
5152 (add-before 'build 'generate-components.xml
5153 (lambda _
5154 (mkdir-p "build/classes/META-INF/plexus")
5155 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
5156 (lambda _
5157 (display
5158 "<component-set>\n
5159 <components>\n
5160 <component>\n
5161 <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role>\n
5162 <role-hint>default</role-hint>\n
5163 <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation>\n
5164 <description></description>\n
5165 <requirements>\n
5166 <requirement>\n
5167 <role>org.sonatype.plexus.components.cipher.PlexusCipher</role>\n
5168 <field-name>_cipher</field-name>\n
5169 </requirement>\n
5170 <requirement>\n
5171 <role>org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor</role>\n
5172 <field-name>_decryptors</field-name>\n
5173 </requirement>\n
5174 </requirements>\n
5175 <configuration>\n
5176 <_configuration-file>~/.settings-security.xml</_configuration-file>\n
5177 </configuration>\n
5178 </component>\n
5179 </components>\n
5180</component-set>\n")))))))))
5181 (propagated-inputs
5182 (list java-plexus-utils java-plexus-cipher-1.7
5183 java-sonatype-spice-parent-pom-12))))
5184
5185(define-public java-plexus-cli
5186 (package
5187 (name "java-plexus-cli")
5188 (version "1.7")
5189 (source (origin
5190 (method git-fetch)
5191 (uri (git-reference
5192 (url "https://github.com/sonatype/plexus-cli")
5193 (commit "a776afa6bca84e5107bedb69440329cdb24ed645")))
5194 (file-name (string-append name "-" version))
5195 (sha256
5196 (base32
5197 "0xjrlay605rypv3zd7y24vlwf0039bil3n2cqw54r1ddpysq46vx"))))
5198 (build-system ant-build-system)
5199 (arguments
5200 `(#:jar-name "plexus-cli.jar"
5201 #:source-dir "src/main/java"
5202 #:jdk ,icedtea-8
5203 #:test-dir "src/test"))
5204 (inputs
5205 (list java-commons-cli java-plexus-container-default
5206 java-plexus-classworlds))
5207 (native-inputs
5208 (list java-plexus-utils java-junit java-guava))
5209 (home-page "https://codehaus-plexus.github.io/plexus-cli")
5210 (synopsis "CLI building library for plexus")
5211 (description "This package is a library to help creating CLI around
5212Plexus components.")
5213 (license license:asl2.0)))
5214
5215(define-public java-plexus-build-api
5216 (package
5217 (name "java-plexus-build-api")
5218 (version "0.0.7")
5219 (source (origin
5220 (method git-fetch)
5221 (uri (git-reference
5222 (url "https://github.com/codehaus-plexus/plexus-build-api")
5223 (commit (string-append "plexus-build-api-" version))))
5224 (file-name (git-file-name name version))
5225 (sha256
5226 (base32
5227 "1d5w6c58gkx30d51v7qwv1xrhc0ly76848gihmgshj19yf6yhca0"))))
5228 (build-system ant-build-system)
5229 (arguments
5230 `(#:jar-name "plexus-build-api.jar"
5231 #:source-dir "src/main/java"
5232 #:jdk ,icedtea-8
5233 #:tests? #f; FIXME: how to run the tests?
5234 #:phases
5235 (modify-phases %standard-phases
5236 (add-before 'build 'copy-resources
5237 (lambda _
5238 (copy-recursively "src/main/resources" "build/classes")
5239 (substitute* (find-files "build/classes")
5240 (("\\$\\{project.version\\}") ,version))
5241 #t))
5242 (add-before 'build 'generate-plexus-compontent
5243 (lambda _
5244 (mkdir-p "build/classes/META-INF/plexus")
5245 ;; This file is required for plexus to inject this package.
5246 ;; FIXME: how is it generated?
5247 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
5248 (lambda _
5249 (display
5250 "<component-set>\n
5251 <components>\n
5252 <component>\n
5253 <role>org.sonatype.plexus.build.incremental.BuildContext</role>\n
5254 <role-hint>default</role-hint>\n
5255 <implementation>org.sonatype.plexus.build.incremental.DefaultBuildContext</implementation>\n
5256 <description>Filesystem based non-incremental build context implementation\n
5257which behaves as if all files were just created.</description>\n
5258 </component>\n
5259 </components>\n
5260</component-set>\n")))
5261 #t))
5262 (replace 'install
5263 (install-from-pom "pom.xml")))))
5264 (inputs
5265 (list java-plexus-utils-3.2.1 java-plexus-container-default))
5266 (home-page "https://github.com/codehaus-plexus/plexus-build-api/")
5267 (synopsis "Base build API for maven")
5268 (description "This package contains the base build API for maven and
5269a default implementation of it. This API is about scanning files in a
5270project and determining what files need to be rebuilt.")
5271 (license license:asl2.0)))
5272
5273(define-public java-modello-core
5274 (package
5275 (name "java-modello-core")
5276 (version "1.11")
5277 (source (origin
5278 (method git-fetch)
5279 (uri (git-reference
5280 (url "https://github.com/codehaus-plexus/modello")
5281 (commit (string-append "modello-" version))))
5282 (file-name (git-file-name name version))
5283 (sha256
5284 (base32
5285 "18885sim7z9j3wy19i9083y9kc8l9xxl2px823a96q4rnqj5z8s2"))))
5286 (build-system ant-build-system)
5287 (arguments
5288 `(#:jar-name "modello-core.jar"
5289 #:source-dir "modello-core/src/main/java"
5290 #:test-dir "modello-core/src/test"
5291 #:main-class "org.codehaus.modello.ModelloCli"
5292 #:jdk ,icedtea-8
5293 #:phases
5294 (modify-phases %standard-phases
5295 (add-before 'build 'copy-resources
5296 (lambda _
5297 (mkdir-p "build/classes/META-INF/plexus")
5298 (copy-file "modello-core/src/main/resources/META-INF/plexus/components.xml"
5299 "build/classes/META-INF/plexus/components.xml")
5300 #t))
5301 (add-before 'check 'fix-tests
5302 (lambda _
5303 (with-directory-excursion "modello-core/src/test/java/org/codehaus"
5304 (substitute* '("modello/core/DefaultModelloCoreTest.java"
5305 "modello/core/io/ModelReaderTest.java")
5306 (("src/test") "modello-core/src/test")))
5307 #t)))))
5308 (propagated-inputs
5309 (list java-plexus-utils java-plexus-container-default
5310 java-plexus-build-api))
5311 (native-inputs
5312 (list java-junit java-plexus-classworlds java-geronimo-xbean-reflect
5313 java-guava))
5314 (home-page "https://codehaus-plexus.github.io/modello/")
5315 (synopsis "Framework for code generation from a simple model")
5316 (description "Modello is a framework for code generation from a simple model.
5317
5318Modello generates code from a simple model format: based on a plugin
5319architecture, various types of code and descriptors can be generated from the
5320single model, including Java POJOs, XML/JSON/YAML marshallers/unmarshallers,
5321XSD and documentation.")
5322 (license (list
5323 license:expat
5324 ;; Although this package uses only files licensed under expat,
5325 ;; other parts of the source are licensed under different
5326 ;; licenses. We include them to be inherited by other packages.
5327 license:asl2.0
5328 ;; Some files in modello-plugin-java are licensed under a
5329 ;; 5-clause BSD license.
5330 (license:non-copyleft
5331 (string-append "file:///modello-plugins/modello-plugin-java/"
5332 "src/main/java/org/codehaus/modello/plugin/"
5333 "java/javasource/JNaming.java"))))))
5334
5335(define-public java-modello-plugins-java
5336 (package
5337 (inherit java-modello-core)
5338 (name "java-modello-plugins-java")
5339 (arguments
5340 `(#:jar-name "modello-plugins-java.jar"
5341 #:source-dir "modello-plugins/modello-plugin-java/src/main/java"
5342 #:test-dir "modello-plugins/modello-plugin-java/src/test"
5343 #:jdk ,icedtea-8
5344 #:tests? #f; requires maven-model, which depends on this package
5345 #:phases
5346 (modify-phases %standard-phases
5347 (add-before 'build 'copy-resources
5348 (lambda _
5349 (mkdir-p "build/classes")
5350 (copy-recursively "modello-plugins/modello-plugin-java/src/main/resources"
5351 "build/classes")
5352 #t)))))
5353 (inputs
5354 (list java-modello-core))
5355 (synopsis "Modello Java Plugin")
5356 (description "Modello Java Plugin generates Java objects for the model.")))
5357
5358(define-public java-modello-plugins-xml
5359 (package
5360 (inherit java-modello-core)
5361 (name "java-modello-plugins-xml")
5362 (arguments
5363 `(#:jar-name "modello-plugins-xml.jar"
5364 #:source-dir "modello-plugins/modello-plugin-xml/src/main/java"
5365 #:test-dir "modello-plugins/modello-plugin-xml/src/test"
5366 #:jdk ,icedtea-8
5367 #:phases
5368 (modify-phases %standard-phases
5369 (add-before 'build 'copy-resources
5370 (lambda _
5371 (mkdir-p "build/classes")
5372 (copy-recursively
5373 "modello-plugins/modello-plugin-xml/src/main/resources"
5374 "build/classes")
5375 #t))
5376 (add-before 'check 'fix-paths
5377 (lambda _
5378 (with-directory-excursion "modello-plugins/modello-plugin-xml/src/test"
5379 (substitute*
5380 "java/org/codehaus/modello/plugins/xml/XmlModelloPluginTest.java"
5381 (("src/test") "modello-plugins/modello-plugin-xml/src/test")))
5382 #t)))))
5383 (propagated-inputs
5384 (list java-modello-core java-modello-plugins-java))
5385 (synopsis "Modello XML Plugin")
5386 (description "Modello XML Plugin contains shared code for every plugins
5387working on XML representation of the model.")))
5388
5389(define-public java-modello-test
5390 (package
5391 (inherit java-modello-core)
5392 (name "java-modello-test")
5393 (arguments
5394 `(#:jar-name "modello-test.jar"
5395 #:source-dir "modello-test/src/main/java"
5396 #:tests? #f; no tests
5397 #:jdk ,icedtea-8))
5398 (inputs
5399 (list java-plexus-utils java-plexus-compiler-api
5400 java-plexus-compiler-javac java-plexus-container-default))
5401 (synopsis "Modello test package")
5402 (description "The modello test package contains the basis to create
5403Modello generator unit-tests, including sample models and xml files to test
5404every feature for every plugin.")))
5405
5406(define-public java-modello-plugins-xpp3
5407 (package
5408 (inherit java-modello-core)
5409 (name "java-modello-plugins-xpp3")
5410 (arguments
5411 `(#:jar-name "modello-plugins-xpp3.jar"
5412 #:source-dir "modello-plugins/modello-plugin-xpp3/src/main/java"
5413 #:test-dir "modello-plugins/modello-plugin-xpp3/src/test"
5414 ;; One of the test dependencies is maven-model which depends on this package.
5415 #:tests? #f
5416 #:jdk ,icedtea-8
5417 #:phases
5418 (modify-phases %standard-phases
5419 (add-before 'build 'copy-resources
5420 (lambda _
5421 (mkdir-p "build/classes")
5422 (copy-recursively "modello-plugins/modello-plugin-xpp3/src/main/resources"
5423 "build/classes")
5424 #t)))))
5425 (propagated-inputs
5426 (list java-modello-core java-modello-plugins-java
5427 java-modello-plugins-xml))
5428 (native-inputs
5429 (modify-inputs native-inputs
5430 (prepend java-xmlunit java-modello-test)))
5431 (synopsis "Modello XPP3 Plugin")
5432 (description "The modello XPP3 plugin generates XML readers and writers based
5433on the XPP3 API (XML Pull Parser).")))
5434
5435(define-public java-ow-util-ant-tasks
5436 (package
5437 (name "java-ow-util-ant-tasks")
5438 (version "1.3.2")
5439 (source (origin
5440 (method url-fetch)
5441 (uri (string-append
5442 "mirror://debian/pool/main/o/ow-util-ant-tasks/"
5443 "ow-util-ant-tasks_" version ".orig.tar.gz"))
5444 (sha256
5445 (base32
5446 "1y5ln1g36aligwcadqksdj18i5ghqnxn523wjbzy2zyd7w58fgy5"))))
5447 (build-system ant-build-system)
5448 (arguments
5449 `(#:jar-name "ow-util-ant-tasks.jar"
5450 #:tests? #f; no tests
5451 #:phases
5452 (modify-phases %standard-phases
5453 (add-before 'build 'delete-cyclic-dependency
5454 (lambda _
5455 ;; This file depends on asm-3, which depends on this package
5456 (delete-file "src/org/objectweb/util/ant/DependencyAnalyzer.java")
5457 ;; This file depends on xalan
5458 (delete-file "src/org/objectweb/util/ant/Xalan2Liaison.java")))
5459 (add-before 'build 'fix-new-ant
5460 (lambda _
5461 (substitute* "src/org/objectweb/util/ant/MultipleCopy.java"
5462 ((", destFile.getAbsolutePath\\(\\)")
5463 ", new String[] { destFile.getAbsolutePath() }")))))))
5464 (home-page "https://packages.debian.org/source/stretch/ow-util-ant-tasks")
5465 (synopsis "Replacement for base ant tasks")
5466 (description "This library is used in the legacy build process of several
5467key frameworks developed by ObjectWeb, among them legacy versions of the
5468ObjectWeb ASM bytecode manipulation framework.")
5469 (license license:lgpl2.0+)))
5470
5471(define-public java-asm
5472 (package
5473 (name "java-asm")
5474 (version "6.0")
5475 (source (origin
5476 (method url-fetch)
5477 (uri (string-append "https://download.forge.ow2.org/asm/"
5478 "asm-" version ".tar.gz"))
5479 (sha256
5480 (base32
5481 "115l5pqblirdkmzi32dxx7gbcm4jy0s14y5wircr6h8jdr9aix00"))))
5482 (build-system ant-build-system)
5483 (arguments
5484 `(#:build-target "compile"
5485 ;; The tests require an old version of Janino, which no longer compiles
5486 ;; with the JDK7.
5487 #:tests? #f
5488 #:make-flags
5489 (list
5490 ;; We don't need these extra ant tasks, but the build system asks us to
5491 ;; provide a path anyway.
5492 "-Dobjectweb.ant.tasks.path=dummy-path"
5493 ;; The java-aqute.bndlib JAR file will be put onto the classpath and
5494 ;; used during the build automatically by ant-build-system, but
5495 ;; java-asm's build.xml fails unless we provide something here.
5496 "-Dbiz.aQute.bnd.path=dummy-path")
5497 #:phases
5498 (modify-phases %standard-phases
5499 (add-before 'build 'remove-bnd-dependency
5500 (lambda _
5501 ;; This file is the only one to require bnd, and is not needed
5502 ;; because we don't build a bundle.
5503 (delete-file "src/org/objectweb/asm/tools/ModuleInfoBndPlugin.java")
5504 #t))
5505 (add-before 'install 'build-jars
5506 (lambda* (#:key make-flags #:allow-other-keys)
5507 ;; We cannot use the "jar" target because it depends on a couple
5508 ;; of unpackaged, complicated tools.
5509 (mkdir "dist")
5510 (invoke "jar"
5511 "-cf" (string-append "dist/asm-" ,version ".jar")
5512 "-C" "output/build/tmp" ".")))
5513 (add-before 'install 'fix-pom
5514 (lambda _
5515 (substitute* (find-files "archive" "\\.pom$")
5516 (("@product.artifact@") ,version))
5517 #t))
5518 (add-before 'install 'install-parent
5519 (install-pom-file "archive/asm-parent.pom"))
5520 (replace 'install
5521 (install-from-pom "archive/asm.pom")))))
5522 (native-inputs
5523 (list java-junit))
5524 (propagated-inputs
5525 (list java-org-ow2-parent-pom-1.3))
5526 (home-page "https://asm.ow2.io/")
5527 (synopsis "Very small and fast Java bytecode manipulation framework")
5528 (description "ASM is an all purpose Java bytecode manipulation and
5529analysis framework. It can be used to modify existing classes or dynamically
5530generate classes, directly in binary form. The provided common
5531transformations and analysis algorithms allow easily assembling custom
5532complex transformations and code analysis tools.")
5533 (license license:bsd-3)))
5534
5535(define-public java-org-ow2-parent-pom-1.3
5536 (package
5537 (name "java-org-ow2-parent-pom")
5538 (version "1.3")
5539 (source (origin
5540 (method url-fetch)
5541 (uri "https://repo1.maven.org/maven2/org/ow2/ow2/1.3/ow2-1.3.pom")
5542 (sha256
5543 (base32
5544 "1yr8hfx8gffpppa4ii6cvrsq029a6x8hzy7nsavxhs60s9kmq8ai"))))
5545 (build-system ant-build-system)
5546 (arguments
5547 `(#:tests? #f
5548 #:phases
5549 (modify-phases %standard-phases
5550 (delete 'unpack)
5551 (delete 'build)
5552 (delete 'configure)
5553 (replace 'install
5554 ,#~(install-pom-file #$source)))))
5555 (home-page "https://ow2.org")
5556 (synopsis "Ow2.org parent pom")
5557 (description "This package contains the parent pom for projects from ow2.org,
5558including java-asm.")
5559 (properties '((hidden? . #t)))
5560 (license license:lgpl2.1+)))
5561
5562(define-public java-asm-bootstrap
5563 (package
5564 (inherit java-asm)
5565 (name "java-asm-bootstrap")
5566 (properties '((hidden? . #t)))
5567 (arguments
5568 (substitute-keyword-arguments (package-arguments java-asm)
5569 ((#:tests? _) #f)))
5570 (native-inputs `())))
5571
5572(define-public java-asm-3
5573 (package
5574 (inherit java-asm)
5575 (version "3.1")
5576 (source (origin
5577 (method git-fetch)
5578 (uri (git-reference
5579 (url "https://gitlab.ow2.org/asm/asm")
5580 (commit "ASM_3_1")))
5581 (file-name (git-file-name "java-asm" version))
5582 (sha256
5583 (base32
5584 "0xbyf2sl8j6mrvfpg2da0vjdp906rac62l66gkk82x5cn3vc30h4"))
5585 (modules '((guix build utils)))
5586 (snippet `(for-each delete-file (find-files "." "\\.jar$")))))
5587 (arguments
5588 `(#:build-target "jar"
5589 #:test-target "test"
5590 #:tests? #f; require legacy test software
5591 #:phases
5592 (modify-phases %standard-phases
5593 (replace 'install (install-jars "output/dist"))
5594 (delete 'generate-jar-indices))))
5595 (native-inputs (list java-ow-util-ant-tasks))))
5596
5597(define-public java-asm-8
5598 (package
5599 (inherit java-asm)
5600 (version "8.0.1")
5601 (source (origin
5602 (method git-fetch)
5603 (uri (git-reference
5604 (url "https://gitlab.ow2.org/asm/asm")
5605 (commit (string-append
5606 "ASM_" (string-join (string-split version #\.)
5607 "_")))))
5608 (file-name (git-file-name "java-asm" version))
5609 (sha256
5610 (base32
5611 "1s6j27zc1i76gh891w2g48b1c3abp9w8zp5j54yb1vm5h8djkd69"))))
5612 (arguments
5613 `(#:jar-name "asm8.jar"
5614 #:source-dir "asm/src/main/java"
5615 #:test-dir "asm/src/test"
5616 ;; tests depend on junit5
5617 #:tests? #f))
5618 (propagated-inputs '())
5619 (native-inputs '())))
5620
5621(define-public java-asm-tree-8
5622 (package
5623 (inherit java-asm-8)
5624 (name "java-asm-tree")
5625 (arguments
5626 `(#:jar-name "asm-tree.jar"
5627 #:source-dir "asm-tree/src/main/java"
5628 #:test-dir "asm-tree/src/test"
5629 ;; tests depend on junit5
5630 #:tests? #f))
5631 (inputs
5632 (list java-asm-8))))
5633
5634(define-public java-asm-analysis-8
5635 (package
5636 (inherit java-asm-8)
5637 (name "java-asm-analysis")
5638 (arguments
5639 `(#:jar-name "asm-analysis.jar"
5640 #:source-dir "asm-analysis/src/main/java"
5641 #:test-dir "asm-analysis/src/test"
5642 ;; tests depend on junit5
5643 #:tests? #f))
5644 (inputs
5645 (list java-asm-8 java-asm-tree-8))))
5646
5647(define-public java-asm-util-8
5648 (package
5649 (inherit java-asm-8)
5650 (name "java-asm-util")
5651 (arguments
5652 `(#:jar-name "asm-util8.jar"
5653 #:source-dir "asm-util/src/main/java"
5654 #:test-dir "asm-util/src/test"
5655 ;; tests depend on junit5
5656 #:tests? #f))
5657 (inputs
5658 (list java-asm-8 java-asm-analysis-8 java-asm-tree-8))))
5659
5660(define-public java-asm-commons-8
5661 (package
5662 (inherit java-asm-8)
5663 (name "java-asm-commons")
5664 (arguments
5665 (list #:jar-name "asm-commons8.jar"
5666 #:source-dir "asm-commons/src/main/java"
5667 #:test-dir "asm-commons/src/test"
5668 ;; tests depend on junit5
5669 #:tests? #f))
5670 (inputs (list java-asm-8 java-asm-analysis-8 java-asm-tree-8))))
5671
5672(define-public java-asm-9
5673 (package
5674 (inherit java-asm)
5675 (version "9.4")
5676 (source (origin
5677 (method git-fetch)
5678 (uri (git-reference
5679 (url "https://gitlab.ow2.org/asm/asm")
5680 (commit (string-append
5681 "ASM_" (string-join (string-split version #\.)
5682 "_")))))
5683 (file-name (git-file-name "java-asm" version))
5684 (sha256
5685 (base32
5686 "0c00m638skr5md1p6y1c2xn11kj5w6sjapyvwp9mh70rw095bwzk"))))
5687 (arguments
5688 `(#:jar-name "asm9.jar"
5689 #:source-dir "asm/src/main/java"
5690 #:test-dir "asm/src/test"
5691 ;; tests depend on junit5
5692 #:tests? #f))
5693 (propagated-inputs '())
5694 (native-inputs '())))
5695
5696(define-public java-asm-tree-9
5697 (package
5698 (inherit java-asm-9)
5699 (name "java-asm-tree")
5700 (arguments
5701 `(#:jar-name "asm-tree.jar"
5702 #:source-dir "asm-tree/src/main/java"
5703 #:test-dir "asm-tree/src/test"
5704 ;; tests depend on junit5
5705 #:tests? #f))
5706 (inputs
5707 (list java-asm-9))))
5708
5709(define-public java-asm-analysis-9
5710 (package
5711 (inherit java-asm-9)
5712 (name "java-asm-analysis")
5713 (arguments
5714 `(#:jar-name "asm-analysis.jar"
5715 #:source-dir "asm-analysis/src/main/java"
5716 #:test-dir "asm-analysis/src/test"
5717 ;; tests depend on junit5
5718 #:tests? #f))
5719 (inputs
5720 (list java-asm-9 java-asm-tree-9))))
5721
5722(define-public java-asm-util-9
5723 (package
5724 (inherit java-asm-9)
5725 (name "java-asm-util")
5726 (arguments
5727 `(#:jar-name "asm-util8.jar"
5728 #:source-dir "asm-util/src/main/java"
5729 #:test-dir "asm-util/src/test"
5730 ;; tests depend on junit5
5731 #:tests? #f))
5732 (inputs
5733 (list java-asm-9 java-asm-analysis-9 java-asm-tree-9))))
5734
5735(define-public java-asm-commons-9
5736 (package
5737 (inherit java-asm-9)
5738 (name "java-asm-commons")
5739 (arguments
5740 (list #:jar-name "asm-commons8.jar"
5741 #:source-dir "asm-commons/src/main/java"
5742 #:test-dir "asm-commons/src/test"
5743 ;; tests depend on junit5
5744 #:tests? #f))
5745 (inputs (list java-asm-9 java-asm-analysis-9 java-asm-tree-9))))
5746
5747(define-public java-asm-9.7.1
5748 (package
5749 (inherit java-asm-9)
5750 (name "java-asm")
5751 (version "9.7.1")
5752 (source
5753 (origin
5754 (method git-fetch)
5755 (uri (git-reference
5756 (url "https://gitlab.ow2.org/asm/asm.git")
5757 (commit "ASM_9_7_1")))
5758 (file-name (git-file-name "java-asm" version))
5759 (sha256
5760 (base32 "0q1i01al9mpggf3256iwmhx9yj9pg52v4vi1gdni2x9jcikq65lf"))))))
5761
5762(define-public java-asm-tree-9.7.1
5763 (package
5764 (inherit java-asm-tree-9)
5765 (name "java-asm-tree")
5766 (version (package-version java-asm-9.7.1))
5767 (source (package-source java-asm-9.7.1))
5768 (inputs
5769 (list java-asm-9.7.1))))
5770
5771(define-public java-asm-analysis-9.7.1
5772 (package
5773 (inherit java-asm-analysis-9)
5774 (name "java-asm-analysis")
5775 (version (package-version java-asm-9.7.1))
5776 (source (package-source java-asm-9.7.1))
5777 (inputs
5778 (list java-asm-9.7.1
5779 java-asm-tree-9.7.1))))
5780
5781(define-public java-asm-commons-9.7.1
5782 (package
5783 (inherit java-asm-commons-9)
5784 (name "java-asm-commons")
5785 (version (package-version java-asm-9.7.1))
5786 (source (package-source java-asm-9.7.1))
5787 (inputs
5788 (list java-asm-9.7.1
5789 java-asm-analysis-9.7.1
5790 java-asm-tree-9.7.1))))
5791
5792(define-public java-cglib
5793 (package
5794 (name "java-cglib")
5795 (version "3.3.0")
5796 (source
5797 (origin
5798 (method git-fetch)
5799 (uri (git-reference
5800 (url "https://github.com/cglib/cglib")
5801 (commit (string-append
5802 "RELEASE_"
5803 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
5804 version)))))
5805 (file-name (git-file-name name version))
5806 (sha256
5807 (base32 "1lnscamc6bnhh7jgij5garxagp3zn2jp4cbq0rsn4xr3l0cnd014"))))
5808 (build-system ant-build-system)
5809 (arguments
5810 `(;; FIXME: tests fail because junit runs
5811 ;; "net.sf.cglib.transform.AbstractTransformTest", which does not seem
5812 ;; to describe a test at all.
5813 #:tests? #f
5814 #:jar-name "cglib.jar"
5815 #:phases
5816 (modify-phases %standard-phases
5817 (add-after 'unpack 'chdir
5818 (lambda _ (chdir "cglib") #t)))))
5819 (native-inputs (list java-junit))
5820 (propagated-inputs (list java-asm-8))
5821 (home-page "https://github.com/cglib/cglib/")
5822 (synopsis "Java byte code generation library")
5823 (description "The byte code generation library CGLIB is a high level API
5824to generate and transform Java byte code.")
5825 (license license:asl2.0)))
5826
5827(define-public java-objenesis
5828 (package
5829 (name "java-objenesis")
5830 (version "3.3")
5831 (source (origin
5832 (method git-fetch)
5833 (uri (git-reference
5834 (url "https://github.com/easymock/objenesis")
5835 (commit version)))
5836 (file-name (git-file-name name version))
5837 (sha256
5838 (base32
5839 "1brlcn536p4s1v1f3vzxhr38lvyhc33wjrbj2x06kdrd8agy90cr"))))
5840 (build-system ant-build-system)
5841 (arguments
5842 `(#:tests? #f; require junit-5
5843 #:jar-name "objenesis.jar"
5844 #:source-dir "main/src/main/java"
5845 #:test-dir "main/src/test/"))
5846 (native-inputs
5847 (list java-junit java-hamcrest-core))
5848 (home-page "http://objenesis.org/")
5849 (synopsis "Bypass the constructor when creating an object")
5850 (description "Objenesis is a small Java library that serves one purpose:
5851to instantiate a new object of a particular class. It is common to see
5852restrictions in libraries stating that classes must require a default
5853constructor. Objenesis aims to overcome these restrictions by bypassing the
5854constructor on object instantiation.")
5855 (license license:asl2.0)))
5856
5857(define-public java-easymock
5858 (package
5859 (name "java-easymock")
5860 (version "3.4")
5861 (source (origin
5862 (method git-fetch)
5863 (uri (git-reference
5864 (url "https://github.com/easymock/easymock/")
5865 (commit (string-append "easymock-" version))))
5866 (file-name (git-file-name name version))
5867 (sha256
5868 (base32
5869 "02vybm8hc0i0n9sp2f2iiqn54zwqhq835f76wc6b2m7819z5a8dq"))))
5870 (build-system ant-build-system)
5871 (arguments
5872 `(#:jar-name "easymock.jar"
5873 #:source-dir "core/src/main"
5874 #:test-dir "core/src/test"
5875 #:phases
5876 (modify-phases %standard-phases
5877 ;; FIXME: Android support requires the following packages to be
5878 ;; available: com.google.dexmaker.stock.ProxyBuilder
5879 (add-after 'unpack 'delete-android-support
5880 (lambda _
5881 (with-directory-excursion "core/src/main/java/org/easymock/internal"
5882 (substitute* "MocksControl.java"
5883 (("AndroidSupport.isAndroid\\(\\)") "false")
5884 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
5885 (delete-file "AndroidClassProxyFactory.java"))
5886 #t))
5887 (add-after 'unpack 'delete-broken-tests
5888 (lambda _
5889 (with-directory-excursion "core/src/test/java/org/easymock"
5890 ;; This test depends on dexmaker.
5891 (delete-file "tests2/ClassExtensionHelperTest.java")
5892
5893 ;; This is not a test.
5894 (delete-file "tests/BaseEasyMockRunnerTest.java")
5895
5896 ;; This test should be executed with a different runner...
5897 (delete-file "tests2/EasyMockAnnotationsTest.java")
5898 ;; ...but deleting it means that we also have to delete these
5899 ;; dependent files.
5900 (delete-file "tests2/EasyMockRunnerTest.java")
5901 (delete-file "tests2/EasyMockRuleTest.java")
5902
5903 ;; This test fails because the file "easymock.properties" does
5904 ;; not exist.
5905 (delete-file "tests2/EasyMockPropertiesTest.java"))
5906 #t)))))
5907 (inputs
5908 (list java-cglib java-objenesis))
5909 (native-inputs
5910 (list java-junit java-hamcrest-core))
5911 (home-page "https://easymock.org/")
5912 (synopsis "Java library providing mock objects for unit tests")
5913 (description "EasyMock is a Java library that provides an easy way to use
5914mock objects in unit testing.")
5915 (license license:asl2.0)))
5916
5917(define-public java-easymock-3.2
5918 (package
5919 (inherit java-easymock)
5920 (name "java-easymock")
5921 (version "3.2")
5922 (source (origin
5923 (method git-fetch)
5924 (uri (git-reference
5925 (url "https://github.com/easymock/easymock/")
5926 (commit (string-append "easymock-" version))))
5927 (file-name (git-file-name name version))
5928 (sha256
5929 (base32
5930 "0cn6qqa261mhk9mwxrsz39lkkknfv2h7iprr5zw7wpz9p96dwgv4"))))
5931 (arguments
5932 (list #:jar-name "easymock.jar"
5933 #:source-dir "easymock/src/main"
5934 #:test-dir "easymock/src/test"
5935 #:phases
5936 #~(modify-phases %standard-phases
5937 (add-after 'unpack 'delete-android-support
5938 (lambda _
5939 (with-directory-excursion "easymock/src/main/java/org/easymock/internal"
5940 (substitute* "MocksControl.java"
5941 (("AndroidSupport.isAndroid\\(\\)") "false")
5942 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
5943 (delete-file "AndroidClassProxyFactory.java"))))
5944 (add-after 'unpack 'delete-broken-tests
5945 (lambda _
5946 (with-directory-excursion "easymock/src/test/java/org/easymock"
5947 ;; This test depends on dexmaker.
5948 (delete-file "tests2/ClassExtensionHelperTest.java")
5949 ;; This is not a test.
5950 (delete-file "tests/BaseEasyMockRunnerTest.java")
5951 ;; ...but deleting it means that we also have to delete these
5952 ;; dependent files.
5953 (delete-file "tests2/EasyMockRunnerTest.java")
5954 ;; This test fails because the file "easymock.properties" does
5955 ;; not exist.
5956 (delete-file "tests2/EasyMockPropertiesTest.java")))))))))
5957
5958(define-public java-easymock-class-extension
5959 (package
5960 (inherit java-easymock-3.2)
5961 (name "java-easymock-class-extension")
5962 (build-system ant-build-system)
5963 (arguments
5964 (list #:jar-name "easymock-class-extensions.jar"
5965 #:source-dir "easymock-classextension/src/main/java"
5966 #:test-dir "easymock-classextension/src/test"))
5967 (inputs (list java-asm-8
5968 java-easymock-3.2
5969 java-cglib
5970 java-objenesis))
5971 (native-inputs
5972 (list java-junit java-hamcrest-core))
5973 (home-page "https://easymock.org/")
5974 (synopsis "Easymock extension to mock classes")
5975 (description "This package provides an extension to earlier versions of
5976easymock that allows mocking classes.")
5977 (license license:asl2.0)))
5978
5979(define-public java-jmock-1
5980 (package
5981 (name "java-jmock")
5982 (version "1.2.0")
5983 (source (origin
5984 (method git-fetch)
5985 (uri (git-reference
5986 (url "https://github.com/jmock-developers/jmock-library")
5987 (commit version)))
5988 (file-name (git-file-name name version))
5989 (sha256
5990 (base32
5991 "0lkga995xd9b9mmzxmcd301hlw83p1h78nibh7djlx7wydscr85z"))))
5992 (build-system ant-build-system)
5993 (arguments
5994 `(#:build-target "jars"
5995 #:test-target "run.tests"
5996 #:phases
5997 (modify-phases %standard-phases
5998 (replace 'install (install-jars "build")))))
5999 (home-page "http://jmock.org/")
6000 (synopsis "Mock object library for test-driven development")
6001 (description "JMock is a library that supports test-driven development of
6002Java code with mock objects. Mock objects help you design and test the
6003interactions between the objects in your programs.
6004
6005The jMock library
6006
6007@itemize
6008@item makes it quick and easy to define mock objects
6009@item lets you precisely specify the interactions between
6010 your objects, reducing the brittleness of your tests
6011@item plugs into your favourite test framework
6012@item is easy to extend.
6013@end itemize\n")
6014 (license license:bsd-3)))
6015
6016(define-public java-jmock
6017 (package
6018 (inherit java-jmock-1)
6019 (name "java-jmock")
6020 (version "2.8.2")
6021 (source (origin
6022 (method git-fetch)
6023 (uri (git-reference
6024 (url "https://github.com/jmock-developers/jmock-library")
6025 (commit version)))
6026 (file-name (git-file-name name version))
6027 (sha256
6028 (base32
6029 "12b7l22g3nrjvf2dzcw3z03fpd2chrgp0d8xkvn8w55rwb57pax6"))))
6030 (inputs
6031 (list java-hamcrest-all java-bsh java-junit))
6032 (native-inputs
6033 `(("cglib" ,java-cglib)))
6034 (arguments
6035 `(#:jar-name "java-jmock.jar"
6036 #:source-dir "jmock/src/main/java"
6037 #:test-dir "jmock/src/test"))))
6038
6039(define-public java-jmock-junit4
6040 (package
6041 (inherit java-jmock)
6042 (name "java-jmock-junit4")
6043 (arguments
6044 `(#:jar-name "java-jmock-junit4.jar"
6045 #:source-dir "jmock-junit4/src/main/java"
6046 #:test-dir "jmock-junit4/src/test"))
6047 (inputs
6048 `(("java-hamcrest-all" ,java-hamcrest-all)
6049 ("java-bsh" ,java-bsh)
6050 ("java-jmock" ,java-jmock)
6051 ("java-jumit" ,java-junit)))))
6052
6053(define-public java-jmock-legacy
6054 (package
6055 (inherit java-jmock)
6056 (name "java-jmock-legacy")
6057 (arguments
6058 `(#:jar-name "java-jmock-legacy.jar"
6059 #:source-dir "jmock-legacy/src/main/java"
6060 #:test-dir "jmock-legacy/src/test"
6061 #:phases
6062 (modify-phases %standard-phases
6063 (add-before 'check 'copy-tests
6064 (lambda _
6065 ;; This file is a dependancy of some tests
6066 (let ((file "org/jmock/test/acceptance/PackageProtectedType.java"))
6067 (copy-file (string-append "jmock/src/test/java/" file)
6068 (string-append "jmock-legacy/src/test/java/" file))
6069 #t))))))
6070 (inputs
6071 (list java-hamcrest-all
6072 java-objenesis
6073 java-cglib
6074 java-jmock
6075 java-bsh
6076 java-junit))
6077 (native-inputs
6078 (list java-jmock-junit4))))
6079
6080(define-public java-hamcrest-all
6081 (package (inherit java-hamcrest-core)
6082 (name "java-hamcrest-all")
6083 (properties `((superseded . ,java-hamcrest)))
6084 (arguments
6085 `(#:jdk ,icedtea-8
6086 ,@(substitute-keyword-arguments (package-arguments java-hamcrest-core)
6087 ((#:build-target _) "bigjar")
6088 ((#:phases phases)
6089 `(modify-phases ,phases
6090 ;; Some build targets override the classpath, so we need to patch
6091 ;; the build.xml to ensure that required dependencies are on the
6092 ;; classpath.
6093 (add-after 'unpack 'patch-classpath-for-integration
6094 (lambda* (#:key inputs #:allow-other-keys)
6095 (substitute* "build.xml"
6096 ((" build/hamcrest-library-\\$\\{version\\}.jar" line)
6097 (string-join
6098 (cons line
6099 (append
6100 (find-files (assoc-ref inputs "java-junit") "\\.jar$")
6101 (find-files (assoc-ref inputs "java-jmock") "\\.jar$")
6102 (find-files (assoc-ref inputs "java-easymock") "\\.jar$")))
6103 ";"))
6104 (("build/hamcrest-core-\\$\\{version\\}\\.jar")
6105 (car (find-files (assoc-ref inputs "java-hamcrest-core")
6106 "jar$"))))
6107 #t))
6108 (replace 'install
6109 (lambda* (#:key outputs #:allow-other-keys)
6110 (let* ((target (string-append (assoc-ref outputs "out")
6111 "/share/java/"))
6112 (version-suffix
6113 ,(string-append
6114 "-" (package-version java-hamcrest-core) ".jar"))
6115 (install-without-version-suffix
6116 (lambda (jar)
6117 (copy-file jar
6118 (string-append target
6119 (basename jar version-suffix)
6120 ".jar")))))
6121 (mkdir-p target)
6122 (for-each
6123 install-without-version-suffix
6124 (find-files "build"
6125 (lambda (name _)
6126 (and (string-suffix? ".jar" name)
6127 (not (string-suffix? "-sources.jar" name)))))))
6128 #t)))))))
6129 (inputs
6130 (modify-inputs inputs
6131 (prepend java-junit
6132 java-jmock-1
6133 ;; This is necessary because of what seems to be a race condition.
6134 ;; This package would sometimes fail to build because hamcrest-core.jar
6135 ;; could not be found, even though it is built as part of this package.
6136 ;; Adding java-hamcrest-core appears to fix this problem. See
6137 ;; https://debbugs.gnu.org/31390 for more information.
6138 java-hamcrest-core
6139 java-easymock)))))
6140
6141(define-public java-jopt-simple
6142 (package
6143 (name "java-jopt-simple")
6144 (version "5.0.3")
6145 (source (origin
6146 (method url-fetch)
6147 (uri (string-append "https://repo1.maven.org/maven2/"
6148 "net/sf/jopt-simple/jopt-simple/"
6149 version "/jopt-simple-"
6150 version "-sources.jar"))
6151 (sha256
6152 (base32
6153 "1v8bzmwmw6qq20gm42xyay6vrd567dra4vqwhgjnqqjz1gs9f8qa"))))
6154 (build-system ant-build-system)
6155 (arguments
6156 `(#:tests? #f ; there are no tests
6157 #:jar-name "jopt-simple.jar"
6158 #:phases
6159 (modify-phases %standard-phases
6160 (add-before 'install 'create-pom
6161 (generate-pom.xml "pom.xml" "net.sf.jopt-simple" "jopt-simple" ,version))
6162 (replace 'install
6163 (install-from-pom "pom.xml")))))
6164 (home-page "https://jopt-simple.github.io/jopt-simple/")
6165 (synopsis "Java library for parsing command line options")
6166 (description "JOpt Simple is a Java library for parsing command line
6167options, such as those you might pass to an invocation of @code{javac}. In
6168the interest of striving for simplicity, as closely as possible JOpt Simple
6169attempts to honor the command line option syntaxes of POSIX @code{getopt} and
6170GNU @code{getopt_long}. It also aims to make option parser configuration and
6171retrieval of options and their arguments simple and expressive, without being
6172overly clever.")
6173 (license license:expat)))
6174
6175;; Required by jmh
6176(define-public java-jopt-simple-4
6177 (package
6178 (inherit java-jopt-simple)
6179 (version "4.6")
6180 (source (origin
6181 (method url-fetch)
6182 (uri (string-append "https://repo1.maven.org/maven2/"
6183 "net/sf/jopt-simple/jopt-simple/"
6184 version "/jopt-simple-"
6185 version "-sources.jar"))
6186 (sha256
6187 (base32
6188 "0ny82zczxkn201ld0b7rps0ifzjhfs8m1ncdmy1f50145ciszkpd"))))
6189 (arguments
6190 (substitute-keyword-arguments (package-arguments java-jopt-simple)
6191 ((#:phases phases)
6192 `(modify-phases ,phases
6193 (replace 'create-pom
6194 (generate-pom.xml "pom.xml" "net.sf.jopt-simple" "jopt-simple"
6195 ,version))))))))
6196
6197(define-public java-commons-math3
6198 (package
6199 (name "java-commons-math3")
6200 (version "3.6.1")
6201 (source (origin
6202 (method url-fetch)
6203 (uri (string-append "mirror://apache/commons/math/source/"
6204 "commons-math3-" version "-src.tar.gz"))
6205 (sha256
6206 (base32
6207 "19l6yp44qc5g7wg816nbn5z3zq3xxzwimvbm4a8pczgvpi4i85s6"))))
6208 (build-system ant-build-system)
6209 (arguments
6210 `(#:build-target "jar"
6211 #:test-target "test"
6212 #:make-flags
6213 ,#~(let ((hamcrest #$(this-package-native-input "java-hamcrest-core"))
6214 (junit #$(this-package-native-input "java-junit")))
6215 (list (string-append "-Djunit.jar="
6216 (car (find-files junit "jar$")))
6217 (string-append "-Dhamcrest.jar="
6218 (car (find-files hamcrest ".*.jar$")))))
6219 #:phases
6220 (modify-phases %standard-phases
6221 ;; We want to build the jar in the build phase and run the tests
6222 ;; later in a separate phase.
6223 (add-after 'unpack 'untangle-targets
6224 (lambda _
6225 (substitute* "build.xml"
6226 (("name=\"jar\" depends=\"test\"")
6227 "name=\"jar\" depends=\"compile\""))))
6228 ;; There is no install target.
6229 (replace 'install
6230 (install-from-pom "pom.xml")))))
6231 (native-inputs
6232 (list java-junit java-hamcrest-core))
6233 (home-page "https://commons.apache.org/math/")
6234 (synopsis "Apache Commons mathematics library")
6235 (description "Commons Math is a library of lightweight, self-contained
6236mathematics and statistics components addressing the most common problems not
6237available in the Java programming language or Commons Lang.")
6238 (license license:asl2.0)))
6239
6240(define-public java-jmh
6241 (package
6242 (name "java-jmh")
6243 (version "1.32")
6244 (source (origin
6245 (method git-fetch)
6246 (uri (git-reference
6247 (url "https://github.com/openjdk/jmh")
6248 (commit version)))
6249 (file-name (git-file-name name version))
6250 (sha256
6251 (base32
6252 "0i7fa7l3gdqkkgz5ddayp6m46dgbj9rqlz35xffrcbyiz3gpljy0"))))
6253 (build-system maven-build-system)
6254 (arguments
6255 `(#:exclude
6256 (("org.apache.maven.plugins" .
6257 ("maven-source-plugin" "maven-archetype-plugin" "maven-shade-plugin"
6258 "maven-site-plugin" "maven-javadoc-plugin" "maven-eclipse-plugin"))
6259 ("com.mycila.maven-license-plugin" . ("maven-license-plugin"))
6260 ("org.apache.maven.wagon" . ("wagon-ssh")))
6261 #:maven-plugins
6262 (("maven-enforcer-plugin" ,maven-enforcer-plugin)
6263 ,@(default-maven-plugins))
6264 #:phases
6265 (modify-phases %standard-phases
6266 (add-after 'unpack 'remove-unnecessary
6267 (lambda _
6268 ;; requires org.apache.maven.archetype:archetype-packaging.
6269 ;; Its subprojects also require groovy, kotlin and scala,
6270 ;; respectively.
6271 (delete-file-recursively "jmh-archetypes"))))))
6272 (propagated-inputs
6273 (list java-jopt-simple-4 java-commons-math3))
6274 (native-inputs
6275 (list java-junit java-hamcrest-core))
6276 (home-page "https://openjdk.java.net/projects/code-tools/jmh/")
6277 (synopsis "Benchmark harness for the JVM")
6278 (description "JMH is a Java harness for building, running, and analysing
6279nano/micro/milli/macro benchmarks written in Java and other languages
6280targeting the JVM.")
6281 ;; GPLv2 only
6282 (license license:gpl2)))
6283
6284(define-public java-commons-collections4
6285 (package
6286 (name "java-commons-collections4")
6287 (version "4.1")
6288 (source (origin
6289 (method url-fetch)
6290 (uri (string-append "mirror://apache/commons/collections/source/"
6291 "commons-collections4-" version "-src.tar.gz"))
6292 (sha256
6293 (base32
6294 "1krfhvggympq4avk7gh6qafzf6b9ip6r1m4lmacikyx04039m0wl"))))
6295 (build-system ant-build-system)
6296 (arguments
6297 `(#:test-target "test"
6298 #:make-flags
6299 ,#~(let ((hamcrest #$(this-package-native-input "java-hamcrest-core"))
6300 (junit #$(this-package-native-input "java-junit"))
6301 (easymock #$(this-package-native-input "java-easymock")))
6302 (list (string-append "-Djunit.jar="
6303 (car (find-files junit "jar$")))
6304 (string-append "-Dhamcrest.jar="
6305 (car (find-files hamcrest "jar$")))
6306 (string-append "-Deasymock.jar=" easymock
6307 "/share/java/easymock.jar")))
6308 #:phases
6309 (modify-phases %standard-phases
6310 (replace 'install
6311 (install-jars "target")))))
6312 (native-inputs
6313 (list java-junit java-hamcrest-core java-easymock))
6314 (home-page "https://commons.apache.org/collections/")
6315 (synopsis "Collections framework")
6316 (description "The Java Collections Framework is the recognised standard
6317for collection handling in Java. Commons-Collections seek to build upon the
6318JDK classes by providing new interfaces, implementations and utilities. There
6319are many features, including:
6320
6321@itemize
6322@item @code{Bag} interface for collections that have a number of copies of
6323 each object
6324@item @code{BidiMap} interface for maps that can be looked up from value to
6325 key as well and key to value
6326@item @code{MapIterator} interface to provide simple and quick iteration over
6327 maps
6328@item Transforming decorators that alter each object as it is added to the
6329 collection
6330@item Composite collections that make multiple collections look like one
6331@item Ordered maps and sets that retain the order elements are added in,
6332 including an LRU based map
6333@item Reference map that allows keys and/or values to be garbage collected
6334 under close control
6335@item Many comparator implementations
6336@item Many iterator implementations
6337@item Adapter classes from array and enumerations to collections
6338@item Utilities to test or create typical set-theory properties of collections
6339 such as union, intersection, and closure.
6340@end itemize\n")
6341 (license license:asl2.0)))
6342
6343(define-public java-commons-collections
6344 (package
6345 (inherit java-commons-collections4)
6346 (name "java-commons-collections")
6347 (version "3.2.2")
6348 (source (origin
6349 (method url-fetch)
6350 (uri (string-append "mirror://apache/commons/collections/source/"
6351 "commons-collections-" version "-src.tar.gz"))
6352 (sha256
6353 (base32
6354 "055r51a5lfc3z7rkxnxmnn1npvkvda7636hjpm4qk7cnfzz98387"))
6355 (patches
6356 (search-patches "java-commons-collections-fix-java8.patch"))))
6357 (arguments
6358 (substitute-keyword-arguments (package-arguments java-commons-collections4)
6359 ((#:phases phases)
6360 `(modify-phases ,phases
6361 ;; The manifest is required by the build procedure
6362 (add-before 'build 'add-manifest
6363 (lambda _
6364 (mkdir-p "build/conf")
6365 (call-with-output-file "build/conf/MANIFEST.MF"
6366 (lambda (file)
6367 (format file "Manifest-Version: 1.0\n")))
6368 #t))
6369 (replace 'install
6370 (install-jars "build"))))))))
6371
6372(define java-commons-collections-test-classes
6373 (package
6374 (inherit java-commons-collections)
6375 (arguments
6376 `(#:jar-name "commons-collections-test-classes.jar"
6377 #:source-dir "src/test"
6378 #:tests? #f))
6379 (inputs
6380 `(("collection" ,java-commons-collections)))))
6381
6382(define-public java-commons-beanutils
6383 (package
6384 (name "java-commons-beanutils")
6385 (version "1.9.3")
6386 (source (origin
6387 (method url-fetch)
6388 (uri (string-append "mirror://apache/commons/beanutils/source/"
6389 "commons-beanutils-" version "-src.tar.gz"))
6390 (sha256
6391 (base32
6392 "03cs0bq3sl1sdc7py9g3qnf8n9h473nrkvd3d251kaqv6a2ab7qk"))))
6393 (build-system ant-build-system)
6394 (arguments
6395 `(#:test-target "test"
6396 #:tests? #f
6397 #:phases
6398 (modify-phases %standard-phases
6399 (replace 'install
6400 (lambda* (#:key outputs #:allow-other-keys)
6401 (rename-file (string-append "dist/commons-beanutils-" ,version
6402 "-SNAPSHOT.jar")
6403 "commons-beanutils.jar")
6404 (install-file "commons-beanutils.jar"
6405 (string-append (assoc-ref outputs "out") "/share/java/"))
6406 #t)))))
6407 (inputs
6408 `(("logging" ,java-commons-logging-minimal)
6409 ("collections" ,java-commons-collections)))
6410 (native-inputs
6411 `(("junit" ,java-junit)
6412 ("collections-test" ,java-commons-collections-test-classes)))
6413 (home-page "https://commons.apache.org/beanutils/")
6414 (synopsis "Dynamically set or get properties in Java")
6415 (description "BeanUtils provides a simplified interface to reflection and
6416introspection to set or get dynamically determined properties through their
6417setter and getter method.")
6418 (license license:asl2.0)))
6419
6420(define-public java-commons-io
6421 (package
6422 (name "java-commons-io")
6423 (version "2.5")
6424 (source
6425 (origin
6426 (method url-fetch)
6427 (uri (string-append "mirror://apache/commons/io/source/"
6428 "commons-io-" version "-src.tar.gz"))
6429 (sha256
6430 (base32
6431 "0q5y41jrcjvx9hzs47x5kdhnasdy6rm4bzqd2jxl02w717m7a7v3"))))
6432 (build-system ant-build-system)
6433 (outputs '("out" "doc"))
6434 (arguments
6435 `(#:test-target "test"
6436 #:make-flags
6437 ,#~(list (string-append "-Djunit.jar="
6438 (car (find-files #$(this-package-native-input "java-junit")
6439 "jar$"))))
6440 #:phases
6441 (modify-phases %standard-phases
6442 (add-after 'build 'build-javadoc ant-build-javadoc)
6443 (replace 'install (install-from-pom "pom.xml"))
6444 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
6445 (native-inputs
6446 (list java-junit java-hamcrest-core))
6447 (propagated-inputs
6448 (list apache-commons-parent-pom-39))
6449 (home-page "https://commons.apache.org/io/")
6450 (synopsis "Common useful IO related classes")
6451 (description "Commons-IO contains utility classes, stream implementations,
6452file filters and endian classes.")
6453 (license license:asl2.0)))
6454
6455(define-public java-commons-io-latest
6456 (package
6457 (inherit java-commons-io)
6458 (version "2.21.0")
6459 (source
6460 (origin
6461 (method url-fetch)
6462 (uri (string-append "mirror://apache/commons/io/source/"
6463 "commons-io-" version "-src.tar.gz"))
6464 (sha256
6465 (base32
6466 "0rr6hb8mm7fd6nrr8f81mvdpfalq01k03l3mzrlxx7g7lda40mb3"))))
6467 (outputs '("out"))
6468 (arguments
6469 `(#:tests? #f ;; tests require too many not yet packaged packages
6470 #:source-dir "src/main/java"
6471 #:jar-name "commons-io.jar"
6472 #:phases
6473 (modify-phases %standard-phases
6474 (replace 'install (install-from-pom "pom.xml")))))
6475 (native-inputs
6476 (list))
6477 (propagated-inputs
6478 (list apache-commons-parent-pom-78))))
6479
6480(define-public java-commons-exec-1.1
6481 (package
6482 (name "java-commons-exec")
6483 (version "1.1")
6484 (source
6485 (origin
6486 (method url-fetch)
6487 (uri (string-append "mirror://apache/commons/exec/source/"
6488 "commons-exec-" version "-src.tar.gz"))
6489 (sha256
6490 (base32
6491 "025dk8xgj10lxwwwqp0hng2rn7fr4vcirxzydqzx9k4dim667alk"))))
6492 (build-system ant-build-system)
6493 (arguments
6494 `(#:test-target "test"
6495 #:make-flags
6496 ,#~(list (string-append "-Dmaven.junit.jar="
6497 (car (find-files #$(this-package-native-input "java-junit")
6498 "jar$"))))
6499 #:phases
6500 (modify-phases %standard-phases
6501 (add-before 'build 'delete-network-tests
6502 (lambda _
6503 (delete-file "src/test/java/org/apache/commons/exec/DefaultExecutorTest.java")
6504 (substitute* "src/test/java/org/apache/commons/exec/TestRunner.java"
6505 (("suite\\.addTestSuite\\(DefaultExecutorTest\\.class\\);") ""))
6506 #t))
6507 ;; The "build" phase automatically tests.
6508 (delete 'check)
6509 (replace 'install (install-jars "target")))))
6510 (native-inputs
6511 (list java-junit))
6512 (home-page "https://commons.apache.org/proper/commons-exec/")
6513 (synopsis "Common program execution related classes")
6514 (description "Commons-Exec simplifies executing external processes.")
6515 (license license:asl2.0)))
6516
6517(define-public java-commons-exec
6518 (package
6519 (inherit java-commons-exec-1.1)
6520 (version "1.3")
6521 (source
6522 (origin
6523 (method url-fetch)
6524 (uri (string-append "mirror://apache/commons/exec/source/"
6525 "commons-exec-" version "-src.tar.gz"))
6526 (sha256
6527 (base32
6528 "17yb4h6f8l49c5iyyvda4z2nmw0bxrx857nrwmsr7mmpb7x441yv"))))
6529 (arguments
6530 `(#:test-target "test"
6531 #:make-flags
6532 ,#~(list (string-append "-Dmaven.junit.jar="
6533 (car (find-files #$(this-package-native-input "java-junit")
6534 "jar$")))
6535 "-Dmaven.compiler.source=1.7"
6536 "-Dmaven.compiler.target=1.7")
6537 #:phases
6538 (modify-phases %standard-phases
6539 (add-before 'build 'delete-network-tests
6540 (lambda* (#:key inputs #:allow-other-keys)
6541 ;; This test hangs indefinitely.
6542 (delete-file "src/test/java/org/apache/commons/exec/issues/Exec60Test.java")
6543 (substitute* "src/test/java/org/apache/commons/exec/issues/Exec41Test.java"
6544 (("ping -c 10 127.0.0.1") "sleep 10"))
6545 (substitute* "src/test/java/org/apache/commons/exec/issues/Exec49Test.java"
6546 (("/bin/ls") "ls"))
6547 (call-with-output-file "src/test/scripts/ping.sh"
6548 (lambda (port)
6549 (format port "#!~a/bin/sh\nsleep $1\n"
6550 (assoc-ref inputs "bash"))))
6551 #t))
6552 ;; The "build" phase automatically tests.
6553 (delete 'check)
6554 (replace 'install (install-jars "target")))))
6555 (native-inputs
6556 (list java-junit java-hamcrest-core))))
6557
6558(define-public java-commons-lang
6559 (package
6560 (name "java-commons-lang")
6561 (version "2.6")
6562 (source
6563 (origin
6564 (method url-fetch)
6565 (uri (string-append "mirror://apache/commons/lang/source/"
6566 "commons-lang-" version "-src.tar.gz"))
6567 (sha256
6568 (base32 "1mxwagqadzx1b2al7i0z1v0r235aj2njdyijf02szq0vhmqrfiq5"))))
6569 (build-system ant-build-system)
6570 (outputs '("out" "doc"))
6571 (arguments
6572 `(#:test-target "test"
6573 #:test-exclude (list "**/Abstract*.java" "**/Random*.java")
6574 #:phases
6575 (modify-phases %standard-phases
6576 (add-after 'build 'build-javadoc ant-build-javadoc)
6577 (add-before 'check 'disable-failing-test
6578 (lambda _
6579 ;; Disable a failing test
6580 (substitute* "src/test/java/org/apache/commons/lang/\
6581time/FastDateFormatTest.java"
6582 (("public void testFormat\\(\\)")
6583 "public void disabled_testFormat()"))
6584 #t))
6585 (replace 'install (install-jars "target"))
6586 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
6587 (native-inputs
6588 (list java-junit))
6589 (home-page "https://commons.apache.org/lang/")
6590 (synopsis "Extension of the java.lang package")
6591 (description "The Commons Lang components contains a set of Java classes
6592that provide helper methods for standard Java classes, especially those found
6593in the @code{java.lang} package in the Sun JDK. The following classes are
6594included:
6595
6596@itemize
6597@item StringUtils - Helper for @code{java.lang.String}.
6598@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets
6599 of characters such as @code{[a-z]} and @code{[abcdez]}.
6600@item RandomStringUtils - Helper for creating randomised strings.
6601@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
6602@item NumberRange - A range of numbers with an upper and lower bound.
6603@item ObjectUtils - Helper for @code{java.lang.Object}.
6604@item SerializationUtils - Helper for serializing objects.
6605@item SystemUtils - Utility class defining the Java system properties.
6606@item NestedException package - A sub-package for the creation of nested
6607 exceptions.
6608@item Enum package - A sub-package for the creation of enumerated types.
6609@item Builder package - A sub-package for the creation of @code{equals},
6610 @code{hashCode}, @code{compareTo} and @code{toString} methods.
6611@end itemize\n")
6612 (license license:asl2.0)))
6613
6614(define-public java-commons-lang3
6615 (package
6616 (name "java-commons-lang3")
6617 (version "3.20.0")
6618 (source
6619 (origin
6620 (method url-fetch)
6621 (uri (string-append "mirror://apache/commons/lang/source/"
6622 "commons-lang3-" version "-src.tar.gz"))
6623 (sha256
6624 (base32 "05b2zfmw1y6bnzf7v32zkhix0c0sab82lmr3ilxciza0l5w6nwya"))))
6625 (build-system ant-build-system)
6626 (arguments
6627 `(#:jar-name "commons-lang3.jar"
6628 #:source-dir "src/main/java"
6629 #:tests? #f; require junit5
6630 #:phases
6631 (modify-phases %standard-phases
6632 (replace 'install (install-from-pom "pom.xml")))))
6633 (propagated-inputs
6634 (list apache-commons-parent-pom-92))
6635 (home-page "https://commons.apache.org/lang/")
6636 (synopsis "Extension of the java.lang package")
6637 (description "The Commons Lang components contains a set of Java classes
6638that provide helper methods for standard Java classes, especially those found
6639in the @code{java.lang} package. The following classes are included:
6640
6641@itemize
6642@item StringUtils - Helper for @code{java.lang.String}.
6643@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets of
6644 characters such as @code{[a-z]} and @code{[abcdez]}.
6645@item RandomStringUtils - Helper for creating randomised strings.
6646@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
6647@item NumberRange - A range of numbers with an upper and lower bound.
6648@item ObjectUtils - Helper for @code{java.lang.Object}.
6649@item SerializationUtils - Helper for serializing objects.
6650@item SystemUtils - Utility class defining the Java system properties.
6651@item NestedException package - A sub-package for the creation of nested
6652 exceptions.
6653@item Enum package - A sub-package for the creation of enumerated types.
6654@item Builder package - A sub-package for the creation of @code{equals},
6655 @code{hashCode}, @code{compareTo} and @code{toString} methods.
6656@end itemize\n")
6657 (license license:asl2.0)))
6658
6659(define-public java-commons-bsf
6660 (package
6661 (name "java-commons-bsf")
6662 (version "2.4.0")
6663 (source (origin
6664 (method url-fetch)
6665 (uri (string-append "mirror://apache/commons/bsf/source/bsf-src-"
6666 version ".tar.gz"))
6667 (sha256
6668 (base32
6669 "1sbamr8jl32p1jgf59nw0b2w9qivyg145954hm6ly54cfgsqrdas"))
6670 (modules '((guix build utils)))
6671 (snippet
6672 '(begin
6673 (for-each delete-file
6674 (find-files "." "\\.jar$"))
6675 #t))))
6676 (build-system ant-build-system)
6677 (arguments
6678 `(#:build-target "jar"
6679 #:tests? #f; No test file
6680 #:modules ((guix build ant-build-system)
6681 (guix build utils)
6682 (guix build java-utils)
6683 (sxml simple))
6684 #:phases
6685 (modify-phases %standard-phases
6686 (add-before 'build 'create-properties
6687 (lambda _
6688 ;; This file is missing from the distribution
6689 (call-with-output-file "build-properties.xml"
6690 (lambda (port)
6691 (sxml->xml
6692 `(project (@ (basedir ".") (name "build-properties") (default ""))
6693 (property (@ (name "project.name") (value "bsf")))
6694 (property (@ (name "source.level") (value "1.5")))
6695 (property (@ (name "build.lib") (value "build/jar")))
6696 (property (@ (name "src.dir") (value "src")))
6697 (property (@ (name "tests.dir") (value "src/org/apache/bsf/test")))
6698 (property (@ (name "build.tests") (value "build/test-classes")))
6699 (property (@ (name "build.dest") (value "build/classes"))))
6700 port)))
6701 #t))
6702 (replace 'install (install-jars "build")))))
6703 (native-inputs
6704 (list java-junit))
6705 (inputs
6706 (list java-commons-logging-minimal))
6707 (home-page "https://commons.apache.org/proper/commons-bsf")
6708 (synopsis "Bean Scripting Framework")
6709 (description "The Bean Scripting Framework (BSF) is a set of Java classes
6710which provides scripting language support within Java applications, and access
6711to Java objects and methods from scripting languages. BSF allows one to write
6712JSPs in languages other than Java while providing access to the Java class
6713library. In addition, BSF permits any Java application to be implemented in
6714part (or dynamically extended) by a language that is embedded within it. This
6715is achieved by providing an API that permits calling scripting language engines
6716from within Java, as well as an object registry that exposes Java objects to
6717these scripting language engines.")
6718 (properties '((upstream-name . "bsf")))
6719 (license license:asl2.0)))
6720
6721(define-public java-commons-jxpath
6722 (package
6723 (name "java-commons-jxpath")
6724 (version "1.3")
6725 (source (origin
6726 (method url-fetch)
6727 (uri (string-append "mirror://apache/commons/jxpath/source/"
6728 "commons-jxpath-" version "-src.tar.gz"))
6729 (sha256
6730 (base32
6731 "1rpgg31ayn9fwr4bfi2i1ij0npcg79ad2fv0w9hacvawsyc42cfs"))))
6732 (build-system ant-build-system)
6733 (arguments
6734 `(#:jar-name "commons-jxpath.jar"
6735 ;; tests require more dependencies, including mockrunner which depends on old software
6736 #:tests? #f
6737 #:source-dir "src/java"))
6738 (inputs
6739 `(("servlet" ,java-classpathx-servletapi)
6740 ("java-jdom" ,java-jdom)
6741 ("java-commons-beanutils" ,java-commons-beanutils)))
6742 (native-inputs
6743 (list java-junit))
6744 (home-page "https://commons.apache.org/jxpath/")
6745 (synopsis "Simple interpreter of an expression language called XPath")
6746 (description "The org.apache.commons.jxpath package defines a simple
6747interpreter of an expression language called XPath. JXPath applies XPath
6748expressions to graphs of objects of all kinds: JavaBeans, Maps, Servlet
6749contexts, DOM etc, including mixtures thereof.")
6750 (license license:asl2.0)))
6751
6752(define-public java-commons-pool
6753 (package
6754 (name "java-commons-pool")
6755 (version "2.6.2")
6756 (source (origin
6757 (method url-fetch)
6758 (uri (string-append "mirror://apache/commons/pool/source/"
6759 "commons-pool2-" version "-src.tar.gz"))
6760 (sha256
6761 (base32
6762 "1fi1hgqmq01bs6azbj3sfswxzadp2r8sjjfiq6ryilz1m50kvrv6"))))
6763 (arguments
6764 `(#:jar-name "common-pool.jar"
6765 #:source-dir "src/main/java"
6766 #:test-exclude
6767 (list "**/PerformanceTest.java")))
6768 (build-system ant-build-system)
6769 (inputs
6770 (list java-cglib))
6771 (native-inputs
6772 (list java-junit java-hamcrest-core java-asm java-objenesis))
6773 (home-page "https://commons.apache.org/proper/commons-pool/")
6774 (synopsis "Object-pooling API in Java")
6775 (description "The commons-pool package provides an object-pooling API
6776and a number of object pool implementations. This package defines a
6777handful of pooling interfaces and some base classes that may be useful when
6778creating new pool implementations.")
6779 (properties '((upstream-name . "commons-pool2")))
6780 (license license:asl2.0)))
6781
6782(define-public java-commons-dbcp
6783 (package
6784 (name "java-commons-dbcp")
6785 (version "2.6.0")
6786 (source (origin
6787 (method url-fetch)
6788 (uri (string-append "mirror://apache/commons/dbcp/source/"
6789 "commons-dbcp2-" version "-src.tar.gz"))
6790 (sha256
6791 (base32
6792 "0axbvcbnf2l70fc3ybrlp3siw2w4ka9mia2pnx4py8gz54cpw3rc"))))
6793 (arguments
6794 `(#:source-dir "src/main/java"
6795 #:jar-name "java-commons-dbcp.jar"
6796 #:tests? #f)); requires apache-geronimo
6797 (inputs
6798 `(("java-commons-pool" ,java-commons-pool)
6799 ("java-commons-logging" ,java-commons-logging-minimal)
6800 ("java-jboss-transaction-api-spec" ,java-jboss-transaction-api-spec)))
6801 (native-inputs
6802 (list java-junit))
6803 (build-system ant-build-system)
6804 (home-page "https://commons.apache.org/proper/commons-dbcp/")
6805 (synopsis "Database Connection Pool for Java")
6806 (description "Commons-dbcp allows you to share a pool of database
6807connections between users. Creating a new connection for each user can be
6808time consuming and even unfeasible when the number of simultaneous users is
6809very large. This package provides a way to share a poole of connections to
6810reduce that load.")
6811 (properties '((upstream-name . "commons-dbcp2")))
6812 (license license:asl2.0)))
6813
6814(define-public java-commons-jcs
6815 (package
6816 (name "java-commons-jcs")
6817 (version "3.1")
6818 (source (origin
6819 (method url-fetch)
6820 (uri (string-append "mirror://apache/commons/jcs/source/"
6821 "commons-jcs3-dist-" version "-src.tar.gz"))
6822 (sha256
6823 (base32
6824 "0y1lm1xnsj99bf7y9mkvbzqfy8dr7ac8zcbkpsjgzb9vhabfsbac"))))
6825 (build-system ant-build-system)
6826 (arguments
6827 `(#:jar-name "commons-jcs.jar"
6828 #:source-dir "commons-jcs-core/src/main/java"
6829 #:test-dir "commons-jcs-core/src/test"
6830 #:tests? #f; requires hsqldb
6831 #:phases
6832 (modify-phases %standard-phases
6833 (add-before 'build 'copy-resources
6834 (lambda _
6835 (copy-recursively "commons-jcs-core/src/main/resources"
6836 "build/classes"))))))
6837 (propagated-inputs
6838 (list java-classpathx-servletapi
6839 java-commons-dbcp
6840 java-httpcomponents-httpclient
6841 java-httpcomponents-httpcore
6842 java-log4j-api))
6843 (native-inputs
6844 (list java-junit))
6845 (home-page "https://commons.apache.org/proper/commons-jcs/")
6846 (synopsis "Distributed caching system in Java")
6847 (description "JCS is a distributed caching system written in Java. It
6848is intended to speed up applications by providing a means to manage cached
6849data of various dynamic natures. Like any caching system, JCS is most useful
6850for high read, low put applications. Latency times drop sharply and
6851bottlenecks move away from the database in an effectively cached system.")
6852 (properties '((upstream-name . "commons-jcs3-dist")))
6853 (license license:asl2.0)))
6854
6855(define-public java-jsr250
6856 (package
6857 (name "java-jsr250")
6858 (version "1.3")
6859 (source (origin
6860 (method git-fetch)
6861 (uri (git-reference
6862 (url "https://github.com/javaee/javax.annotation")
6863 (commit version)))
6864 (file-name (git-file-name name version))
6865 (sha256
6866 (base32
6867 "1g22a9d75g01s9yxgdig0ss7i30j4ysnnp08gn4krn0wly4lpqq0"))))
6868 (build-system ant-build-system)
6869 (arguments
6870 `(#:tests? #f ; no tests included
6871 #:jdk ,icedtea-8
6872 #:jar-name "jsr250.jar"
6873 #:phases
6874 (modify-phases %standard-phases
6875 (replace 'install
6876 (install-from-pom "pom.xml")))))
6877 (propagated-inputs (list java-jvnet-parent-pom-3))
6878 (home-page "https://jcp.org/en/jsr/detail?id=250")
6879 (synopsis "Security-related annotations")
6880 (description "This package provides annotations for security. It provides
6881packages in the @code{javax.annotation} and @code{javax.annotation.security}
6882namespaces.")
6883 ;; either cddl or gpl2 only, with classpath exception
6884 (license (list license:cddl1.0
6885 license:gpl2))))
6886
6887(define-public java-jsr305
6888 (package
6889 (name "java-jsr305")
6890 (version "3.0.1")
6891 (source (origin
6892 (method url-fetch)
6893 (uri (string-append "https://repo1.maven.org/maven2/"
6894 "com/google/code/findbugs/"
6895 "jsr305/" version "/jsr305-"
6896 version "-sources.jar"))
6897 (sha256
6898 (base32
6899 "1rh6jin9v7jqpq3kf1swl868l8i94r636n03pzpsmgr8v0lh9j2n"))))
6900 (build-system ant-build-system)
6901 (arguments
6902 `(#:tests? #f ; no tests included
6903 #:jar-name "jsr305.jar"
6904 #:phases
6905 (modify-phases %standard-phases
6906 (add-before 'install 'create-pom
6907 (generate-pom.xml "pom.xml" "com.google.code.findbugs" "jsr305" ,version))
6908 (replace 'install
6909 (install-from-pom "pom.xml")))))
6910 (home-page "https://findbugs.sourceforge.net/")
6911 (synopsis "Annotations for the static analyzer called findbugs")
6912 (description "This package provides annotations for the findbugs package.
6913It provides packages in the @code{javax.annotations} namespace.")
6914 (license license:asl2.0)))
6915
6916(define-public java-error-prone-annotations
6917 (package
6918 (name "java-error-prone-annotations")
6919 (version "2.18.0")
6920 (source (origin
6921 (method git-fetch)
6922 (uri (git-reference
6923 (url "https://github.com/google/error-prone")
6924 (commit (string-append "v" version))))
6925 (file-name (git-file-name "java-error-prone" version))
6926 (sha256
6927 (base32
6928 "19sqsz0b308rhadr3ff10azdbqjq37nvrn9c06224dwpxap0931f"))))
6929 (build-system ant-build-system)
6930 (arguments
6931 `(#:tests? #f; no tests
6932 #:jar-name (string-append ,name "-" ,version ".jar")
6933 #:source-dir "annotations/src/main/java"
6934 #:test-dir "annotations/src/altest"
6935 #:phases
6936 (modify-phases %standard-phases
6937 (replace 'install (install-from-pom "annotations/pom.xml")))))
6938 (propagated-inputs (list java-error-prone-parent-pom java-jsr305))
6939 (home-page "https://errorprone.info")
6940 (synopsis "Java static analyzer at compile-time")
6941 (description "Error Prone is a static analysis tool for Java that catches
6942common programming mistakes at compile-time. This package contains annotations
6943used by programmers to guide the static analysis.")
6944 (license license:asl2.0)))
6945
6946(define java-error-prone-parent-pom
6947 (package
6948 (inherit java-error-prone-annotations)
6949 (name "java-error-prone-parent-pom")
6950 (arguments
6951 `(#:tests? #f
6952 #:phases
6953 (modify-phases %standard-phases
6954 (delete 'configure)
6955 (delete 'build)
6956 (replace 'install
6957 (install-pom-file "pom.xml")))))
6958 (propagated-inputs '())))
6959
6960(define-public java-guava
6961 (package
6962 (name "java-guava")
6963 (version "31.1")
6964 (source (origin
6965 (method git-fetch)
6966 (uri (git-reference
6967 (url "https://github.com/google/guava/")
6968 (commit (string-append "v" version))))
6969 (file-name (git-file-name name version))
6970 (sha256
6971 (base32
6972 "0sv1w5cnids9ad3l7qhrh3dh1wdqwc946iinsxryafr25wg5z1lp"))
6973 (patches
6974 (search-patches "java-guava-remove-annotation-deps.patch"))))
6975 (build-system ant-build-system)
6976 (arguments
6977 `(#:tests? #f ; no tests included
6978 #:jar-name "guava.jar"
6979 #:source-dir "guava/src"
6980 #:phases
6981 (modify-phases %standard-phases
6982 (add-after 'unpack 'trim-sources
6983 (lambda _
6984 (with-directory-excursion "guava/src/com/google/common"
6985 ;; Remove annotations to avoid extra dependencies:
6986 ;; * "j2objc" annotations are used when converting Java to
6987 ;; Objective C;
6988 ;; * "IgnoreJRERequirement" is used for Android.
6989 ;; * "Nullable" is used to catch NPE at build time.
6990 (substitute* (find-files "." "\\.java$")
6991 (("import com.google.j2objc.*") "")
6992 (("import org.checkerframework.checker.*") "")
6993 (("@ReflectionSupport.*") "")
6994 (("@WeakOuter") "")
6995 (("@RetainedWith") "")
6996 (("@Weak") "")
6997 (("@J2ObjCIncompatible") "")
6998 (("@IgnoreJRERequirement") "")
6999 (("@Nullable") "")))))
7000 ;; This is required by guava, but this is just an empty stub
7001 (add-before 'install 'install-listenablefuture-stub
7002 (install-pom-file "futures/listenablefuture9999/pom.xml"))
7003 (replace 'install (install-from-pom "guava/pom.xml")))))
7004 (inputs
7005 (list java-error-prone-annotations java-jsr305))
7006 (propagated-inputs
7007 (list java-guava-futures-failureaccess java-guava-parent-pom))
7008 (home-page "https://github.com/google/guava")
7009 (synopsis "Google core libraries for Java")
7010 (description "Guava is a set of core libraries that includes new
7011collection types (such as multimap and multiset), immutable collections, a
7012graph library, functional types, an in-memory cache, and APIs/utilities for
7013concurrency, I/O, hashing, primitives, reflection, string processing, and much
7014more!")
7015 (license license:asl2.0)))
7016
7017(define-public java-guava-futures-failureaccess
7018 (package
7019 (inherit java-guava)
7020 (name "java-guava-futures-failureaccess")
7021 (arguments
7022 `(#:tests? #f; no tests
7023 #:jar-name "guava-futures-failureaccess.jar"
7024 #:source-dir "futures/failureaccess/src"
7025 #:phases
7026 (modify-phases %standard-phases
7027 (replace 'install
7028 (install-from-pom "futures/failureaccess/pom.xml")))))
7029 (propagated-inputs
7030 `(("java-sonatype-oss-parent-pom" ,java-sonatype-oss-parent-pom-7)))))
7031
7032(define java-guava-parent-pom
7033 (package
7034 (inherit java-guava)
7035 (name "java-guava-parent-pom")
7036 (arguments
7037 `(#:tests? #f
7038 #:phases
7039 (modify-phases %standard-phases
7040 (delete 'configure)
7041 (delete 'build)
7042 (replace 'install
7043 (install-pom-file "pom.xml")))))
7044 (propagated-inputs
7045 `(("java-sonatype-oss-parent-pom" ,java-sonatype-oss-parent-pom-7)))))
7046
7047;; The java-commons-logging package provides adapters to many different
7048;; logging frameworks. To avoid an excessive dependency graph we try to build
7049;; it with only a minimal set of adapters.
7050(define-public java-commons-logging-minimal
7051 (package
7052 (name "java-commons-logging-minimal")
7053 (version "1.2")
7054 (source (origin
7055 (method url-fetch)
7056 (uri (string-append "mirror://apache/commons/logging/source/"
7057 "commons-logging-" version "-src.tar.gz"))
7058 (sha256
7059 (base32
7060 "10bwcy5w8d7y39n0krlwhnp8ds3kj5zhmzj0zxnkw0qdlsjmsrj9"))))
7061 (build-system ant-build-system)
7062 (arguments
7063 `(#:tests? #f ; avoid dependency on logging frameworks
7064 #:jar-name "commons-logging-minimal.jar"
7065 #:phases
7066 (modify-phases %standard-phases
7067 (add-after 'unpack 'delete-adapters-and-tests
7068 (lambda _
7069 ;; Delete all adapters except for NoOpLog, SimpleLog, and
7070 ;; LogFactoryImpl. NoOpLog is required to build; LogFactoryImpl
7071 ;; is used by applications; SimpleLog is the only actually usable
7072 ;; implementation that does not depend on another logging
7073 ;; framework.
7074 (for-each
7075 (lambda (file)
7076 (delete-file (string-append
7077 "src/main/java/org/apache/commons/logging/impl/" file)))
7078 (list "Jdk13LumberjackLogger.java"
7079 "WeakHashtable.java"
7080 "Log4JLogger.java"
7081 "ServletContextCleaner.java"
7082 "Jdk14Logger.java"
7083 "AvalonLogger.java"
7084 "LogKitLogger.java"))
7085 (delete-file-recursively "src/test")
7086 #t)))))
7087 (home-page "https://commons.apache.org/logging/")
7088 (synopsis "Common API for logging implementations")
7089 (description "The Logging package is a thin bridge between different
7090logging implementations. A library that uses the commons-logging API can be
7091used with any logging implementation at runtime.")
7092 (properties '((upstream-name . "commons-logging")))
7093 (license license:asl2.0)))
7094
7095;; This is the last release of the 1.x series.
7096(define-public java-mockito-1
7097 (package
7098 (name "java-mockito")
7099 (version "1.10.19")
7100 (source (origin
7101 (method url-fetch)
7102 (uri (string-append "https://repo1.maven.org/maven2/"
7103 "org/mockito/mockito-core/" version
7104 "/mockito-core-" version "-sources.jar"))
7105 (sha256
7106 (base32
7107 "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc"))))
7108 (build-system ant-build-system)
7109 (arguments
7110 `(#:jar-name "mockito.jar"
7111 #:tests? #f ; no tests included
7112 ;; FIXME: patch-and-repack does not support jars, so we have to apply
7113 ;; patches in build phases.
7114 #:phases
7115 (modify-phases %standard-phases
7116 ;; Mockito was developed against a different version of hamcrest,
7117 ;; which does not require matcher implementations to provide an
7118 ;; implementation of the "describeMismatch" method. We add this
7119 ;; simple definition to pass the build with our version of hamcrest.
7120 (add-after 'unpack 'fix-hamcrest-build-error
7121 (lambda _
7122 (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java"
7123 (("public Matcher getActualMatcher\\(\\) .*" line)
7124 (string-append "
7125 public void describeMismatch(Object item, Description description) {
7126 actualMatcher.describeMismatch(item, description);
7127 }"
7128 line)))
7129 #t))
7130 ;; Mockito bundles cglib. We have a cglib package, so let's use
7131 ;; that instead.
7132 (add-after 'unpack 'use-system-libraries
7133 (lambda _
7134 (with-directory-excursion "src/org/mockito/internal/creation/cglib"
7135 (substitute* '("CGLIBHacker.java"
7136 "CglibMockMaker.java"
7137 "ClassImposterizer.java"
7138 "DelegatingMockitoMethodProxy.java"
7139 "MethodInterceptorFilter.java"
7140 "MockitoNamingPolicy.java"
7141 "SerializableMockitoMethodProxy.java"
7142 "SerializableNoOp.java")
7143 (("import org.mockito.cglib") "import net.sf.cglib")))
7144 #t)))))
7145 (inputs
7146 (list java-junit java-objenesis java-cglib java-hamcrest-core))
7147 (home-page "http://mockito.org")
7148 (synopsis "Mockito is a mock library for Java")
7149 (description "Mockito is a mocking library for Java which lets you write
7150tests with a clean and simple API. It generates mocks using reflection, and
7151it records all mock invocations, including methods arguments.")
7152 (license license:asl2.0)))
7153
7154(define-public java-httpcomponents-httpcore
7155 (package
7156 (name "java-httpcomponents-httpcore")
7157 (version "4.4.6")
7158 (source (origin
7159 (method url-fetch)
7160 (uri (string-append "mirror://apache/httpcomponents/httpcore/"
7161 "source/httpcomponents-core-"
7162 version "-src.tar.gz"))
7163 (sha256
7164 (base32
7165 "02bwcf38y4vgwq7kj2s6q7qrmma641r5lacivm16kgxvb2j6h1vy"))))
7166 (build-system ant-build-system)
7167 (arguments
7168 `(#:jar-name "httpcomponents-httpcore.jar"
7169 #:phases
7170 (modify-phases %standard-phases
7171 (add-after 'unpack 'chdir
7172 (lambda _ (chdir "httpcore") #t)))))
7173 (inputs
7174 (list java-commons-logging-minimal java-commons-lang3))
7175 (native-inputs
7176 (list java-junit java-mockito-1))
7177 (home-page "https://hc.apache.org/httpcomponents-core-4.4.x/index.html")
7178 (synopsis "Low level HTTP transport components")
7179 (description "HttpCore is a set of low level HTTP transport components
7180that can be used to build custom client and server side HTTP services with a
7181minimal footprint. HttpCore supports two I/O models: blocking I/O model based
7182on the classic Java I/O and non-blocking, event driven I/O model based on Java
7183NIO.
7184
7185This package provides the blocking I/O model library.")
7186 (license license:asl2.0)))
7187
7188(define-public java-httpcomponents-httpcore-nio
7189 (package (inherit java-httpcomponents-httpcore)
7190 (name "java-httpcomponents-httpcore-nio")
7191 (arguments
7192 `(#:jar-name "httpcomponents-httpcore-nio.jar"
7193 #:phases
7194 (modify-phases %standard-phases
7195 (add-after 'unpack 'chdir
7196 (lambda _ (chdir "httpcore-nio") #t)))))
7197 (inputs
7198 (modify-inputs inputs
7199 (prepend java-httpcomponents-httpcore java-hamcrest-core)))
7200 (description "HttpCore is a set of low level HTTP transport components
7201that can be used to build custom client and server side HTTP services with a
7202minimal footprint. HttpCore supports two I/O models: blocking I/O model based
7203on the classic Java I/O and non-blocking, event driven I/O model based on Java
7204NIO.
7205
7206This package provides the non-blocking I/O model library based on Java
7207NIO.")))
7208
7209(define-public java-httpcomponents-httpcore-ab
7210 (package (inherit java-httpcomponents-httpcore)
7211 (name "java-httpcomponents-httpcore-ab")
7212 (arguments
7213 `(#:jar-name "httpcomponents-httpcore-ab.jar"
7214 #:phases
7215 (modify-phases %standard-phases
7216 (add-after 'unpack 'chdir
7217 (lambda _ (chdir "httpcore-ab") #t)))))
7218 (inputs
7219 (modify-inputs inputs
7220 (prepend java-httpcomponents-httpcore java-commons-cli
7221 java-hamcrest-core)))
7222 (synopsis "Apache HttpCore benchmarking tool")
7223 (description "This package provides the HttpCore benchmarking tool. It is
7224an Apache AB clone based on HttpCore.")))
7225
7226(define-public java-httpcomponents-httpcore-osgi
7227 (package (inherit java-httpcomponents-httpcore)
7228 (name "java-httpcomponents-httpcore-osgi")
7229 (arguments
7230 `(#:jar-name "httpcomponents-httpcore-osgi.jar"
7231 #:phases
7232 (modify-phases %standard-phases
7233 (add-after 'unpack 'chdir
7234 (lambda _ (chdir "httpcore-osgi"))))))
7235 (inputs
7236 (modify-inputs inputs
7237 (prepend java-httpcomponents-httpcore
7238 java-httpcomponents-httpcore-nio
7239 java-hamcrest-core)))
7240 (native-inputs (list java-ops4j-pax-exam-core
7241 java-ops4j-pax-exam-core-junit
7242 java-ops4j-pax-exam-core-spi
7243 java-junit))
7244 (description "HttpCore is a set of low level HTTP transport components
7245that can be used to build custom client and server side HTTP services with a
7246minimal footprint. HttpCore supports two I/O models: blocking I/O model based
7247on the classic Java I/O and non-blocking, event driven I/O model based on Java
7248NIO.
7249
7250This package provides... some tests.")))
7251
7252(define-public java-httpcomponents-httpclient
7253 (package
7254 (name "java-httpcomponents-httpclient")
7255 (version "4.5.12")
7256 (source (origin
7257 (method url-fetch)
7258 (uri (string-append "mirror://apache/httpcomponents/httpclient/"
7259 "source/httpcomponents-client-"
7260 version "-src.tar.gz"))
7261 (sha256
7262 (base32
7263 "1va99m2zc2liv0v9vn72p5ja8yz4s5wq7zpahaai5nr966kvxzkb"))))
7264 (build-system ant-build-system)
7265 (arguments
7266 `(#:jar-name "httpcomponents-httpclient.jar"
7267 #:phases
7268 (modify-phases %standard-phases
7269 (add-after 'unpack 'chdir
7270 (lambda _ (chdir "httpclient") #t)))))
7271 (inputs
7272 (list java-commons-logging-minimal
7273 java-commons-codec
7274 java-hamcrest-core
7275 java-httpcomponents-httpcore
7276 java-mockito-1
7277 java-junit))
7278 (home-page "https://hc.apache.org/httpcomponents-client-ga/")
7279 (synopsis "HTTP client library for Java")
7280 (description "Although the @code{java.net} package provides basic
7281functionality for accessing resources via HTTP, it doesn't provide the full
7282flexibility or functionality needed by many applications. @code{HttpClient}
7283seeks to fill this void by providing an efficient, up-to-date, and
7284feature-rich package implementing the client side of the most recent HTTP
7285standards and recommendations.")
7286 (properties '((upstream-name . "httpcomponents-client")))
7287 (license license:asl2.0)))
7288
7289(define-public java-httpcomponents-httpclient-cache
7290 (package (inherit java-httpcomponents-httpclient)
7291 (name "java-httpcomponents-httpclient-cache")
7292 (arguments
7293 `(#:jar-name "httpcomponents-httpclient-cache.jar"
7294 #:source-dir "src/main/java"
7295 #:test-dir "src/test"
7296 #:tests? #f; tests are broken with current cglib.
7297 #:phases
7298 (modify-phases %standard-phases
7299 (add-after 'unpack 'delete-unused-impls
7300 (lambda _
7301 (for-each
7302 delete-file-recursively
7303 '("src/main/java/org/apache/http/impl/client/cache/ehcache/"
7304 "src/main/java/org/apache/http/impl/client/cache/memcached/"
7305 "src/test/java/org/apache/http/impl/client/cache/ehcache/"
7306 "src/test/java/org/apache/http/impl/client/cache/memcached/"))))
7307 (add-after 'unpack 'chdir
7308 (lambda _ (chdir "httpclient-cache"))))))
7309 (inputs
7310 (modify-inputs inputs
7311 (prepend java-httpcomponents-httpclient
7312 java-httpcomponents-httpmime
7313 java-hamcrest-core)))
7314 (description "This package provides an API for caching accessed HTTP
7315resources.")))
7316
7317(define-public java-httpcomponents-httpclient-osgi
7318 (package (inherit java-httpcomponents-httpclient)
7319 (name "java-httpcomponents-httpclient-osgi")
7320 (arguments
7321 `(#:jar-name "httpcomponents-httpclient-osgi.jar"
7322 #:tests? #f; tests are broken with current cglib.
7323 #:phases
7324 (modify-phases %standard-phases
7325 (add-after 'unpack 'chdir
7326 (lambda _ (chdir "httpclient-osgi") #t)))))
7327 (inputs
7328 (modify-inputs inputs
7329 (prepend java-httpcomponents-httpclient
7330 java-httpcomponents-httpclient-cache
7331 java-osgi-framework
7332 java-osgi-service-cm
7333 java-hamcrest-core)))))
7334
7335(define-public java-httpcomponents-httpmime
7336 (package (inherit java-httpcomponents-httpclient)
7337 (name "java-httpcomponents-httpmime")
7338 (arguments
7339 `(#:jar-name "httpcomponents-httpmime.jar"
7340 #:phases
7341 (modify-phases %standard-phases
7342 (add-after 'unpack 'chdir
7343 (lambda _ (chdir "httpmime") #t)))))
7344 (inputs
7345 (list java-httpcomponents-httpclient java-httpcomponents-httpcore
7346 java-junit java-hamcrest-core))))
7347
7348(define-public java-commons-net
7349 (package
7350 (name "java-commons-net")
7351 (version "3.6")
7352 (source (origin
7353 (method url-fetch)
7354 (uri (string-append "mirror://apache/commons/net/source/"
7355 "commons-net-" version "-src.tar.gz"))
7356 (sha256
7357 (base32
7358 "0n0cmnddk9qdqhjvka8pc6hd9mn2qi3166f1s6xk32h7rfy1adxr"))))
7359 (build-system ant-build-system)
7360 (arguments
7361 `(;; FIXME: MainTest.java tries to read "examples.properties" (which
7362 ;; should be "resources/examples/examples.properties"), but gets "null"
7363 ;; instead.
7364 #:tests? #f
7365 #:jar-name "commons-net.jar"))
7366 (native-inputs
7367 (list java-junit java-hamcrest-core))
7368 (home-page "https://commons.apache.org/net/")
7369 (synopsis "Client library for many basic Internet protocols")
7370 (description "The Apache Commons Net library implements the client side of
7371many basic Internet protocols. The purpose of the library is to provide
7372fundamental protocol access, not higher-level abstractions.")
7373 (license license:asl2.0)))
7374
7375(define-public java-jsch
7376 (package
7377 (name "java-jsch")
7378 (version "0.1.55")
7379 (source (origin
7380 (method url-fetch)
7381 (uri (string-append "mirror://sourceforge/jsch/jsch/"
7382 version "/jsch-" version ".zip"))
7383 (sha256
7384 (base32
7385 "1lxyjwvmwa723wcf3bqn816hkvc03vz4xhbsi7bvfhrz2rpgcfq6"))))
7386 (build-system ant-build-system)
7387 (arguments
7388 `(#:build-target "dist"
7389 #:tests? #f ; no tests included
7390 #:phases
7391 (modify-phases %standard-phases
7392 (replace 'install (install-jars "dist")))))
7393 (native-inputs
7394 (list unzip))
7395 (home-page "http://www.jcraft.com/jsch/")
7396 (synopsis "Pure Java implementation of SSH2")
7397 (description "JSch is a pure Java implementation of SSH2. JSch allows you
7398to connect to an SSH server and use port forwarding, X11 forwarding, file
7399transfer, etc., and you can integrate its functionality into your own Java
7400programs.")
7401 (license license:bsd-3)))
7402
7403(define-public java-jsch-0.1.72
7404 (package
7405 (name "java-jsch")
7406 (version "0.1.72")
7407 (source
7408 (origin
7409 (method git-fetch)
7410 (uri (git-reference
7411 (url "https://github.com/mwiede/jsch.git")
7412 (commit (string-append "jsch-" version))))
7413 (file-name (git-file-name name version))
7414 (sha256
7415 (base32 "1xx50fw9wxnkm9yg8v8scr2c7781506flv0ivalpw7bg27w8sm59"))))
7416 (build-system ant-build-system)
7417 (arguments
7418 (list
7419 #:jdk openjdk17
7420 #:tests? #f
7421 #:modules
7422 '((guix build utils)
7423 (guix build ant-build-system)
7424 (guix build java-utils))
7425 #:phases
7426 #~(modify-phases %standard-phases
7427 (replace 'build
7428 (lambda* (#:key inputs #:allow-other-keys)
7429 (define classes-dir (string-append (getcwd) "/build/classes"))
7430 (define generated-dir (string-append (getcwd) "/build/generated"))
7431 (define manifest-file (string-append (getcwd) "/build/manifest.mf"))
7432 (define jar-file (string-append (getcwd) "/build/jsch-" #$version ".jar"))
7433 (define jna
7434 (car (find-files (assoc-ref inputs "java-native-access")
7435 "jna-jpms.*\\.jar$")))
7436 (define jna-platform
7437 (car (find-files (assoc-ref inputs "java-native-access-platform")
7438 "jna-platform-jpms.*\\.jar$")))
7439 (define bcprov
7440 (car (find-files (assoc-ref inputs "java-bouncycastle")
7441 "bcprov.*\\.jar$")))
7442 (define junixsocket
7443 (car (find-files (assoc-ref inputs "java-junixsocket-common")
7444 "\\.jar$")))
7445 (define classpath
7446 (string-append jna ":" jna-platform ":" bcprov
7447 ":" junixsocket))
7448 (define (java-sources source-root)
7449 (filter (lambda (file)
7450 (and (string-suffix? ".java" file)
7451 (not (string-suffix? "module-info.java" file))))
7452 (find-files source-root "\\.java$")))
7453 (define (compile-release source-root release)
7454 (let ((sources (java-sources source-root))
7455 (target (string-append classes-dir "/META-INF/versions/"
7456 release)))
7457 (when (pair? sources)
7458 (mkdir-p target)
7459 (apply invoke "javac"
7460 (append
7461 (list "--release" release
7462 "-cp" (string-append classes-dir ":" classpath)
7463 "-d" target)
7464 sources)))))
7465 (mkdir-p classes-dir)
7466 (mkdir-p (string-append generated-dir "/com/jcraft/jsch"))
7467 (copy-file "src/main/java-templates/com/jcraft/jsch/Version.java"
7468 (string-append generated-dir
7469 "/com/jcraft/jsch/Version.java"))
7470 (substitute* (string-append generated-dir
7471 "/com/jcraft/jsch/Version.java")
7472 (("\\$\\{project.version\\}") #$version))
7473 (apply invoke "javac"
7474 (append
7475 (list "--release" "8"
7476 "-cp" classpath
7477 "-d" classes-dir)
7478 (java-sources "src/main/java")
7479 (list (string-append generated-dir
7480 "/com/jcraft/jsch/Version.java"))))
7481 (for-each
7482 (lambda (release)
7483 (compile-release (string-append "src/main/java" release)
7484 release))
7485 '("9" "11" "15" "16"))
7486 (call-with-output-file manifest-file
7487 (lambda (port)
7488 (display "Multi-Release: true\n" port)))
7489 (invoke "jar" "--create"
7490 "--file" jar-file
7491 "--manifest" manifest-file
7492 "-C" classes-dir ".")))
7493 (add-before 'install 'create-pom
7494 (generate-pom.xml "pom.xml" "com.jcraft"
7495 "jsch" #$version))
7496 (replace 'install
7497 (install-from-pom "pom.xml")))))
7498 (inputs
7499 (list java-bouncycastle-1.77
7500 java-junixsocket-common-2
7501 java-native-access-5.14.0
7502 java-native-access-platform-5.14.0))
7503 (native-inputs
7504 (list java-kohlschutter-compiler-annotations-1
7505 unzip))
7506 (home-page "https://github.com/mwiede/jsch")
7507 (synopsis "Pure Java implementation of SSH2")
7508 (description
7509 "JSch is a pure Java implementation of SSH2. This package builds the
75100.1.72 release from source with bouncycastle and junixsocket support.")
7511 (license license:bsd-3)))
7512
7513(define-public java-jzlib-1.1.3
7514 (package
7515 (name "java-jzlib")
7516 (version "1.1.3")
7517 (source (origin
7518 (method git-fetch)
7519 (uri (git-reference
7520 (url "https://github.com/ymnk/jzlib")
7521 (commit version)))
7522 (file-name (git-file-name name version))
7523 (sha256
7524 (base32
7525 "1wma04qlx65ybyf49dngqb5db1xc7sya0g98frj5chhr4qc7fjs8"))))
7526 (build-system ant-build-system)
7527 (arguments
7528 `(#:jar-name "jzlib.jar"
7529 #:source-dir "src/main/java"
7530 #:tests? #f ; no tests
7531 #:phases
7532 (modify-phases %standard-phases
7533 (replace 'install
7534 (install-from-pom "pom.xml")))))
7535 (home-page "http://www.jcraft.com/jzlib/")
7536 (synopsis "Pure Java implementation of zlib")
7537 (description "JZlib is a re-implementation of zlib in pure Java. It
7538provides @code{Deflater}, @code{Inflater}, and streaming classes for
7539compression and decompression compatible with the zlib format.")
7540 (license license:bsd-3)))
7541
7542(define-public java-commons-compress
7543 (package
7544 (name "java-commons-compress")
7545 (version "1.28.0")
7546 (source (origin
7547 (method url-fetch)
7548 (uri (string-append "mirror://apache/commons/compress/source/"
7549 "commons-compress-" version "-src.tar.gz"))
7550 (sha256
7551 (base32
7552 "0qkn70dfb1f9xihc34mbpbr5ag8qm4qq18hh3p4286r2ajj0z1sw"))))
7553 (build-system ant-build-system)
7554 (arguments
7555 `(#:jar-name "commons-compress.jar"
7556 #:source-dir "src/main/java"
7557 #:tests? #f; requires java-mockito-3
7558 #:phases
7559 (modify-phases %standard-phases
7560 (replace 'install (install-from-pom "pom.xml")))))
7561 (propagated-inputs
7562 (list java-commons-lang3
7563 java-commons-io-latest
7564 java-commons-codec
7565 java-asm-9
7566 java-brotli
7567 java-xz
7568 java-zstd
7569 apache-commons-parent-pom-85))
7570 (home-page "https://commons.apache.org/proper/commons-compress/")
7571 (synopsis "Java library for working with compressed files")
7572 (description "The Apache Commons Compress library defines an API for
7573working with compressed files such as ar, cpio, Unix dump, tar, zip, gzip, XZ,
7574Pack200, bzip2, 7z, arj, lzma, snappy, DEFLATE, lz4 and Z files.")
7575 (license license:asl2.0)))
7576
7577(define-public java-commons-compress-1.21
7578 (package
7579 (inherit java-commons-compress)
7580 (version "1.21")
7581 (source (origin
7582 (method url-fetch)
7583 (uri (string-append "mirror://apache/commons/compress/source/"
7584 "commons-compress-" version "-src.tar.gz"))
7585 (sha256
7586 (base32
7587 "1rkpb6xcyly1wnbx4q6iq6p5hrr0h1d0ppb5r07psc75cbmizjry"))))
7588 (propagated-inputs
7589 (list java-asm-3
7590 java-brotli
7591 java-osgi-core
7592 java-xz
7593 java-zstd
7594 apache-commons-parent-pom-52))))
7595
7596(define-public java-commons-csv
7597 (package
7598 (name "java-commons-csv")
7599 (version "1.4")
7600 (source (origin
7601 (method url-fetch)
7602 (uri (string-append "mirror://apache/commons/csv/source/"
7603 "commons-csv-" version "-src.tar.gz"))
7604 (sha256
7605 (base32
7606 "1l89m0fm2s3xx3v3iynvangymfg2vlyngaj6fgsi457nmsw7m7ij"))))
7607 (build-system ant-build-system)
7608 (arguments
7609 `(#:jar-name "commons-csv.jar"
7610 #:source-dir "src/main/java"
7611 #:tests? #f)); FIXME: requires java-h2
7612 (inputs
7613 `(("java-hamcrest-core" ,java-hamcrest-core)
7614 ("java-commons-io" ,java-commons-io)
7615 ("java-commons-lang3" ,java-commons-lang3)
7616 ("junit" ,java-junit)))
7617 (home-page "https://commons.apache.org/proper/commons-csv/")
7618 (synopsis "Read and write CSV documents")
7619 (description "Commons CSV reads and writes files in variations of the Comma
7620Separated Value (CSV) format. The most common CSV formats are predefined in the
7621CSVFormat class:
7622
7623@itemize
7624@item Microsoft Excel
7625@item Informix UNLOAD
7626@item Informix UNLOAD CSV
7627@item MySQL
7628@item RFC 4180
7629@item TDF
7630@end itemize
7631
7632Custom formats can be created using a fluent style API.")
7633 (license license:asl2.0)))
7634
7635(define-public java-jaxrs-api-2
7636 (package
7637 (name "java-jaxrs-api")
7638 (version "2.1.1")
7639 (source (origin
7640 (method git-fetch)
7641 (uri (git-reference
7642 (url "https://github.com/jakartaee/rest")
7643 (commit version)))
7644 (file-name (git-file-name name version))
7645 (sha256
7646 (base32
7647 "1sa490sag5r23hx84haddkbbyn4dlhav4m445k53y53jzs64cs4c"))))
7648 (build-system ant-build-system)
7649 (arguments
7650 (list
7651 #:tests? #f
7652 #:jdk openjdk9
7653 #:jar-name "javax.ws.rs-api.jar"
7654 #:source-dir "jaxrs-api/src/main/java"
7655 #:phases
7656 #~(modify-phases %standard-phases
7657 (add-before 'install 'create-pom
7658 (generate-pom.xml "pom.xml" "javax.ws.rs" "javax.ws.rs-api"
7659 #$version))
7660 (replace 'install (install-from-pom "pom.xml")))))
7661 (home-page "https://github.com/jax-rs")
7662 (synopsis "Java API for RESTful Web Services")
7663 (description "JAX-RS provides a standardized API for building RESTful
7664web services in Java.")
7665 (license license:cddl1.1)))
7666
7667(define-public java-osgi-annotation
7668 (package
7669 (name "java-osgi-annotation")
7670 (version "6.0.0")
7671 (source (origin
7672 (method url-fetch)
7673 (uri (string-append "https://repo1.maven.org/maven2/"
7674 "org/osgi/org.osgi.annotation/" version "/"
7675 "org.osgi.annotation-" version "-sources.jar"))
7676 (sha256
7677 (base32
7678 "1q718mb7gqg726rh6pc2hcisn8v50nv35abbir0jypmffhiii85w"))))
7679 (build-system ant-build-system)
7680 (arguments
7681 `(#:tests? #f ; no tests
7682 #:jar-name "osgi-annotation.jar"
7683 #:phases
7684 (modify-phases %standard-phases
7685 (add-before 'install 'create-pom
7686 (generate-pom.xml "pom.xml" "osgi" "osgi-annotation" ,version))
7687 (replace 'install (install-from-pom "pom.xml")))))
7688 (home-page "https://www.osgi.org")
7689 (synopsis "Annotation module of OSGi framework")
7690 (description
7691 "OSGi, for Open Services Gateway initiative framework, is a module system
7692and service platform for the Java programming language. This package contains
7693the OSGi annotation module, providing additional services to help dynamic
7694components.")
7695 (license license:asl2.0)))
7696
7697(define-public java-osgi-annotation-8.1.0
7698 ;; Upstream tags the monorepo as 8.0.0.1, but osgi.annotation/bnd.bnd sets
7699 ;; the annotation artifact's release/minor version to 8.1, yielding 8.1.0.
7700 (let ((tag "8.0.0.1"))
7701 (package
7702 (name "java-osgi-annotation")
7703 (version "8.1.0")
7704 (source (origin
7705 (method git-fetch)
7706 (uri (git-reference
7707 (url "https://github.com/osgi/osgi")
7708 (commit tag)))
7709 (modules '((guix build utils)))
7710 (snippet
7711 '(begin
7712 (for-each delete-file
7713 (find-files "." "\\.jar$"))
7714 #t))
7715 (file-name (git-file-name name version))
7716 (sha256
7717 (base32
7718 "0s0ig6prnkvjp9159087mf16ihbqc91qlwdi1l0n5afhh2z5cnn5"))))
7719 (build-system ant-build-system)
7720 (arguments
7721 (list
7722 #:tests? #f
7723 #:jar-name "osgi-annotation.jar"
7724 #:phases
7725 #~(modify-phases %standard-phases
7726 (add-after 'unpack 'prepare-source-layout
7727 (lambda _
7728 (mkdir-p "src")
7729 (for-each
7730 (lambda (directory)
7731 (invoke "cp" "-r" (string-append directory "/.") "src/"))
7732 '("org.osgi.annotation.bundle/src"
7733 "org.osgi.annotation.versioning/src"))))
7734 (add-before 'install 'create-pom
7735 (generate-pom.xml "pom.xml" "org.osgi" "osgi.annotation"
7736 #$version))
7737 (replace 'install (install-from-pom "pom.xml")))))
7738 (home-page "https://www.osgi.org")
7739 (synopsis "Annotations for use in compiling OSGi bundles")
7740 (description "OSGi, for Open Services Gateway initiative framework, is a
7741module system and service platform for the Java programming language. This
7742package contains the annotation classes used at compile time.")
7743 (license license:asl2.0))))
7744
7745(define-public java-osgi-core
7746 (package
7747 (name "java-osgi-core")
7748 (version "6.0.0")
7749 (source (origin
7750 (method url-fetch)
7751 (uri (string-append "https://repo1.maven.org/maven2/"
7752 "org/osgi/org.osgi.core/" version "/"
7753 "org.osgi.core-" version "-sources.jar"))
7754 (sha256
7755 (base32
7756 "19bpf5jx32jq9789gyhin35q5v7flmw0p9mk7wbgqpxqfmxyiabv"))))
7757 (build-system ant-build-system)
7758 (arguments
7759 `(#:tests? #f ; no tests
7760 #:jar-name "osgi-core.jar"
7761 #:phases
7762 (modify-phases %standard-phases
7763 (add-before 'install 'create-pom
7764 (generate-pom.xml "pom.xml" "org.osgi" "org.osgi.core" ,version))
7765 (replace 'install (install-from-pom "pom.xml")))))
7766 (inputs
7767 (list java-osgi-annotation))
7768 (home-page "https://www.osgi.org")
7769 (synopsis "Core module of OSGi framework")
7770 (description
7771 "OSGi, for Open Services Gateway initiative framework, is a module system
7772and service platform for the Java programming language. This package contains
7773the OSGi Core module.")
7774 (license license:asl2.0)))
7775
7776(define-public java-osgi-core-8.0.0
7777 ;; Upstream uses release-train tags for the monorepo; osgi.core/bnd.bnd
7778 ;; emits artifact version 8.0.0 from the r8-core-final checkout.
7779 (let ((tag "r8-core-final"))
7780 (package
7781 (name "java-osgi-core")
7782 (version "8.0.0")
7783 (source (origin
7784 (method git-fetch)
7785 (uri (git-reference
7786 (url "https://github.com/osgi/osgi")
7787 (commit tag)))
7788 (modules '((guix build utils)))
7789 (snippet
7790 '(begin
7791 (for-each delete-file
7792 (find-files "." "\\.jar$"))
7793 #t))
7794 (file-name (git-file-name name version))
7795 (sha256
7796 (base32
7797 "01z4c3jakzjdh4m0j71shppa1nfgaqgxwajnhyv56s1l1a9hxb6x"))))
7798 (build-system ant-build-system)
7799 (arguments
7800 (list
7801 #:tests? #f
7802 #:jar-name "osgi-core.jar"
7803 #:phases
7804 #~(modify-phases %standard-phases
7805 (add-after 'unpack 'prepare-source-layout
7806 (lambda _
7807 (mkdir-p "src")
7808 (for-each
7809 (lambda (directory)
7810 (invoke "cp" "-r" (string-append directory "/.") "src/"))
7811 '("org.osgi.dto/src"
7812 "org.osgi.framework/src"
7813 "org.osgi.resource/src"
7814 "org.osgi.service.condition/src"
7815 "org.osgi.service.condpermadmin/src"
7816 "org.osgi.service.log/src"
7817 "org.osgi.service.packageadmin/src"
7818 "org.osgi.service.permissionadmin/src"
7819 "org.osgi.service.resolver/src"
7820 "org.osgi.service.startlevel/src"
7821 "org.osgi.service.url/src"
7822 "org.osgi.util.tracker/src"))))
7823 (add-before 'install 'create-pom
7824 (generate-pom.xml "pom.xml" "org.osgi" "osgi.core" #$version))
7825 (replace 'install (install-from-pom "pom.xml")))))
7826 (inputs (list java-osgi-annotation-8.1.0))
7827 (home-page "https://www.osgi.org")
7828 (synopsis "Core module of OSGi framework")
7829 (description "OSGi, for Open Services Gateway initiative framework, is a
7830module system and service platform for the Java programming language. This
7831package contains the OSGi Core module.")
7832 (license license:asl2.0))))
7833
7834(define-public java-osgi-service-event
7835 (package
7836 (name "java-osgi-service-event")
7837 (version "1.3.1")
7838 (source (origin
7839 (method url-fetch)
7840 (uri (string-append "https://repo1.maven.org/maven2/"
7841 "org/osgi/org.osgi.service.event/"
7842 version "/org.osgi.service.event-"
7843 version "-sources.jar"))
7844 (sha256
7845 (base32
7846 "1nyhlgagwym75bycnjczwbnpymv2iw84zbhvvzk84g9q736i6qxm"))))
7847 (build-system ant-build-system)
7848 (arguments
7849 `(#:tests? #f ; no tests
7850 #:jar-name "osgi-service-event.jar"))
7851 (inputs
7852 (list java-osgi-annotation java-osgi-core))
7853 (home-page "https://www.osgi.org")
7854 (synopsis "OSGi service event module")
7855 (description
7856 "OSGi, for Open Services Gateway initiative framework, is a module system
7857and service platform for the Java programming language. This package contains
7858the OSGi @code{org.osgi.service.event} module.")
7859 (license license:asl2.0)))
7860
7861(define-public java-eclipse-osgi
7862 (package
7863 (name "java-eclipse-osgi")
7864 (version "3.11.3")
7865 (source (origin
7866 (method url-fetch)
7867 (uri (string-append "https://repo1.maven.org/maven2/"
7868 "org/eclipse/platform/org.eclipse.osgi/"
7869 version "/org.eclipse.osgi-"
7870 version "-sources.jar"))
7871 (sha256
7872 (base32
7873 "00cqc6lb29n0zv68b4l842vzkwawvbr7gshfdygsk8sicvcq2c7b"))))
7874 (build-system ant-build-system)
7875 (arguments
7876 `(#:tests? #f ; no tests included
7877 #:jar-name "eclipse-equinox-osgi.jar"))
7878 (inputs
7879 (list java-osgi-annotation))
7880 (home-page "https://www.eclipse.org/equinox/")
7881 (synopsis "Eclipse Equinox OSGi framework")
7882 (description "This package provides an implementation of the OSGi Core
7883specification.")
7884 (license license:epl1.0)))
7885
7886(define-public java-eclipse-equinox-common
7887 (package
7888 (name "java-eclipse-equinox-common")
7889 (version "3.10.200")
7890 (source (origin
7891 (method url-fetch)
7892 (uri (string-append "https://repo1.maven.org/maven2/"
7893 "org/eclipse/platform/org.eclipse.equinox.common/"
7894 version "/org.eclipse.equinox.common-"
7895 version "-sources.jar"))
7896 (sha256
7897 (base32
7898 "1yn8ij6xsljlf35sr2l7wvyvc0ss4n1rv0ry5zkgb49dj4hyrqrj"))))
7899 (build-system ant-build-system)
7900 (arguments
7901 `(#:tests? #f ; no tests included
7902 #:jar-name "eclipse-equinox-common.jar"))
7903 (inputs
7904 (list java-eclipse-osgi))
7905 (home-page "https://www.eclipse.org/equinox/")
7906 (synopsis "Common Eclipse runtime")
7907 (description "This package provides the common Eclipse runtime.")
7908 (license license:epl1.0)))
7909
7910(define-public java-eclipse-core-jobs
7911 (package
7912 (name "java-eclipse-core-jobs")
7913 (version "3.8.0")
7914 (source (origin
7915 (method url-fetch)
7916 (uri (string-append "https://repo1.maven.org/maven2/"
7917 "org/eclipse/platform/org.eclipse.core.jobs/"
7918 version "/org.eclipse.core.jobs-"
7919 version "-sources.jar"))
7920 (sha256
7921 (base32
7922 "0395b8lh0km8vhzjnchvs1rii1qz48hyvb2wqfaq4yhklbwihq4b"))))
7923 (build-system ant-build-system)
7924 (arguments
7925 `(#:tests? #f ; no tests included
7926 #:jar-name "eclipse-core-jobs.jar"))
7927 (inputs
7928 (list java-eclipse-equinox-common java-eclipse-osgi))
7929 (home-page "https://www.eclipse.org/equinox/")
7930 (synopsis "Eclipse jobs mechanism")
7931 (description "This package provides the Eclipse jobs mechanism.")
7932 (license license:epl1.0)))
7933
7934(define-public java-eclipse-equinox-registry
7935 (package
7936 (name "java-eclipse-equinox-registry")
7937 (version "3.6.100")
7938 (source (origin
7939 (method url-fetch)
7940 (uri (string-append "https://repo1.maven.org/maven2/"
7941 "org/eclipse/platform/org.eclipse.equinox.registry/"
7942 version "/org.eclipse.equinox.registry-"
7943 version "-sources.jar"))
7944 (sha256
7945 (base32
7946 "1i9sgymh2fy5vdgk5y7s3qvrlbgh4l93ddqi3v4zmca7hwrlhf9k"))))
7947 (build-system ant-build-system)
7948 (arguments
7949 `(#:tests? #f ; no tests included
7950 #:jar-name "eclipse-equinox-registry.jar"))
7951 (inputs
7952 (list java-eclipse-core-jobs java-eclipse-equinox-common
7953 java-eclipse-osgi))
7954 (home-page "https://www.eclipse.org/equinox/")
7955 (synopsis "Eclipse extension registry support")
7956 (description "This package provides support for the Eclipse extension
7957registry.")
7958 (license license:epl1.0)))
7959
7960(define-public java-eclipse-equinox-app
7961 (package
7962 (name "java-eclipse-equinox-app")
7963 (version "1.3.400")
7964 (source (origin
7965 (method url-fetch)
7966 (uri (string-append "https://repo1.maven.org/maven2/"
7967 "org/eclipse/platform/org.eclipse.equinox.app/"
7968 version "/org.eclipse.equinox.app-"
7969 version "-sources.jar"))
7970 (sha256
7971 (base32
7972 "0nhvbp93y203ar7y59gb0mz3w2d3jlqhr0c9hii9bcfpmr7imdab"))))
7973 (build-system ant-build-system)
7974 (arguments
7975 `(#:tests? #f ; no tests included
7976 #:jar-name "eclipse-equinox-app.jar"))
7977 (inputs
7978 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7979 java-eclipse-osgi java-osgi-service-event))
7980 (home-page "https://www.eclipse.org/equinox/")
7981 (synopsis "Equinox application container")
7982 (description "This package provides the Equinox application container for
7983Eclipse.")
7984 (license license:epl1.0)))
7985
7986(define-public java-eclipse-equinox-preferences
7987 (package
7988 (name "java-eclipse-equinox-preferences")
7989 (version "3.6.1")
7990 (source (origin
7991 (method url-fetch)
7992 (uri (string-append "https://repo1.maven.org/maven2/"
7993 "org/eclipse/platform/org.eclipse.equinox.preferences/"
7994 version "/org.eclipse.equinox.preferences-"
7995 version "-sources.jar"))
7996 (sha256
7997 (base32
7998 "0k7w6c141sqym4fy3af0qkwpy4pdh2vsjpjba6rp5fxyqa24v0a2"))))
7999 (build-system ant-build-system)
8000 (arguments
8001 `(#:tests? #f ; no tests included
8002 #:jar-name "eclipse-equinox-preferences.jar"))
8003 (inputs
8004 (list java-eclipse-equinox-common java-eclipse-equinox-registry
8005 java-eclipse-osgi))
8006 (home-page "https://www.eclipse.org/equinox/")
8007 (synopsis "Eclipse preferences mechanism")
8008 (description "This package provides the Eclipse preferences mechanism with
8009the module @code{org.eclipse.equinox.preferences}.")
8010 (license license:epl1.0)))
8011
8012(define-public java-eclipse-core-contenttype
8013 (package
8014 (name "java-eclipse-core-contenttype")
8015 (version "3.5.100")
8016 (source (origin
8017 (method url-fetch)
8018 (uri (string-append "https://repo1.maven.org/maven2/"
8019 "org/eclipse/platform/org.eclipse.core.contenttype/"
8020 version "/org.eclipse.core.contenttype-"
8021 version "-sources.jar"))
8022 (sha256
8023 (base32
8024 "1wcqcv7ijwv5rh748vz3x9pkmjl9w1r0k0026k56n8yjl4rrmspi"))))
8025 (build-system ant-build-system)
8026 (arguments
8027 `(#:tests? #f ; no tests included
8028 #:jar-name "eclipse-core-contenttype.jar"))
8029 (inputs
8030 (list java-eclipse-equinox-common java-eclipse-equinox-preferences
8031 java-eclipse-equinox-registry java-eclipse-osgi))
8032 (home-page "https://www.eclipse.org/")
8033 (synopsis "Eclipse content mechanism")
8034 (description "This package provides the Eclipse content mechanism in the
8035@code{org.eclipse.core.contenttype} module.")
8036 (license license:epl1.0)))
8037
8038(define-public java-eclipse-core-runtime
8039 (package
8040 (name "java-eclipse-core-runtime")
8041 (version "3.15.100")
8042 (source (origin
8043 (method url-fetch)
8044 (uri (string-append "https://repo1.maven.org/maven2/"
8045 "org/eclipse/platform/org.eclipse.core.runtime/"
8046 version "/org.eclipse.core.runtime-"
8047 version "-sources.jar"))
8048 (sha256
8049 (base32
8050 "0l8xayacsbjvz5hypx2fv47vpw2n4dspamcfb3hx30x9hj8vmg7r"))))
8051 (build-system ant-build-system)
8052 (arguments
8053 `(#:tests? #f ; no tests included
8054 #:jar-name "eclipse-core-runtime.jar"))
8055 (inputs
8056 (list java-eclipse-core-contenttype
8057 java-eclipse-core-jobs
8058 java-eclipse-equinox-app
8059 java-eclipse-equinox-common
8060 java-eclipse-equinox-registry
8061 java-eclipse-equinox-preferences
8062 java-eclipse-osgi))
8063 (home-page "https://www.eclipse.org/")
8064 (synopsis "Eclipse core runtime")
8065 (description "This package provides the Eclipse core runtime with the
8066module @code{org.eclipse.core.runtime}.")
8067 (license license:epl1.0)))
8068
8069(define-public java-eclipse-core-filesystem
8070 (package
8071 (name "java-eclipse-core-filesystem")
8072 (version "1.6.1")
8073 (source (origin
8074 (method url-fetch)
8075 (uri (string-append "https://repo1.maven.org/maven2/"
8076 "org/eclipse/platform/org.eclipse.core.filesystem/"
8077 version "/org.eclipse.core.filesystem-"
8078 version "-sources.jar"))
8079 (sha256
8080 (base32
8081 "0km1bhwjim4rfy3pkvjhvy31kgsyf2ncx0mlkmbf5n6g57pphdyj"))))
8082 (build-system ant-build-system)
8083 (arguments
8084 `(#:tests? #f ; no tests included
8085 #:jar-name "eclipse-core-filesystem.jar"))
8086 (inputs
8087 (list java-eclipse-equinox-common java-eclipse-equinox-registry
8088 java-eclipse-osgi))
8089 (home-page "https://www.eclipse.org/")
8090 (synopsis "Eclipse core file system")
8091 (description "This package provides the Eclipse core file system with the
8092module @code{org.eclipse.core.filesystem}.")
8093 (license license:epl1.0)))
8094
8095(define-public java-eclipse-core-expressions
8096 (package
8097 (name "java-eclipse-core-expressions")
8098 (version "3.5.100")
8099 (source (origin
8100 (method url-fetch)
8101 (uri (string-append "https://repo1.maven.org/maven2/"
8102 "org/eclipse/platform/org.eclipse.core.expressions/"
8103 version "/org.eclipse.core.expressions-"
8104 version "-sources.jar"))
8105 (sha256
8106 (base32
8107 "18bw2l875gmygvpagpgk9l24qzbdjia4ag12nw6fi8v8yaq4987f"))))
8108 (build-system ant-build-system)
8109 (arguments
8110 `(#:tests? #f ; no tests included
8111 #:jar-name "eclipse-core-expressions.jar"))
8112 (inputs
8113 (list java-eclipse-equinox-common java-eclipse-equinox-registry
8114 java-eclipse-equinox-preferences java-eclipse-core-runtime
8115 java-eclipse-osgi))
8116 (home-page "https://www.eclipse.org/")
8117 (synopsis "Eclipse core expression language")
8118 (description "This package provides the Eclipse core expression language
8119with the @code{org.eclipse.core.expressions} module.")
8120 (license license:epl1.0)))
8121
8122(define-public java-eclipse-core-variables
8123 (package
8124 (name "java-eclipse-core-variables")
8125 (version "3.3.0")
8126 (source (origin
8127 (method url-fetch)
8128 (uri (string-append "https://repo1.maven.org/maven2/"
8129 "org/eclipse/platform/org.eclipse.core.variables/"
8130 version "/org.eclipse.core.variables-"
8131 version "-sources.jar"))
8132 (sha256
8133 (base32
8134 "12dirh03zi4n5x5cj07vzrhkmnqy6h9q10h9j605pagmpmifyxmy"))))
8135 (build-system ant-build-system)
8136 (arguments
8137 `(#:tests? #f ; no tests included
8138 #:jar-name "eclipse-core-variables.jar"))
8139 (inputs
8140 (list java-eclipse-equinox-common java-eclipse-equinox-registry
8141 java-eclipse-equinox-preferences java-eclipse-core-runtime
8142 java-eclipse-osgi))
8143 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
8144 (synopsis "Eclipse core variables")
8145 (description "This package provides the Eclipse core variables module
8146@code{org.eclipse.core.variables}.")
8147 (license license:epl1.0)))
8148
8149(define-public java-eclipse-ant-core
8150 (package
8151 (name "java-eclipse-ant-core")
8152 (version "3.4.100")
8153 (source (origin
8154 (method url-fetch)
8155 (uri (string-append "https://repo1.maven.org/maven2/"
8156 "org/eclipse/platform/org.eclipse.ant.core/"
8157 version "/org.eclipse.ant.core-"
8158 version "-sources.jar"))
8159 (sha256
8160 (base32
8161 "11g3if794qjlk98mz9zch22rr56sd7z63vn4i7k2icr8cq5bfqg7"))))
8162 (build-system ant-build-system)
8163 (arguments
8164 `(#:tests? #f ; no tests included
8165 #:jar-name "eclipse-ant-core.jar"))
8166 (inputs
8167 (list java-eclipse-equinox-app
8168 java-eclipse-equinox-common
8169 java-eclipse-equinox-registry
8170 java-eclipse-equinox-preferences
8171 java-eclipse-core-contenttype
8172 java-eclipse-core-runtime
8173 java-eclipse-core-variables
8174 java-eclipse-osgi))
8175 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
8176 (synopsis "Ant build tool core libraries")
8177 (description "This package provides the ant build tool core libraries with
8178the module @code{org.eclipse.ant.core}.")
8179 (license license:epl1.0)))
8180
8181(define-public java-eclipse-core-resources
8182 (package
8183 (name "java-eclipse-core-resources")
8184 (version "3.13.200")
8185 (source (origin
8186 (method url-fetch)
8187 (uri (string-append "https://repo1.maven.org/maven2/"
8188 "org/eclipse/platform/org.eclipse.core.resources/"
8189 version "/org.eclipse.core.resources-"
8190 version "-sources.jar"))
8191 (sha256
8192 (base32
8193 "1sn3b6ky72hkvxcgf9b2jkpbdh3y8lbhi9xxwv1dsiddpkkq91hs"))))
8194 (build-system ant-build-system)
8195 (arguments
8196 `(#:tests? #f ; no tests included
8197 #:jar-name "eclipse-core-resources.jar"))
8198 (inputs
8199 (list java-eclipse-equinox-common
8200 java-eclipse-equinox-preferences
8201 java-eclipse-equinox-registry
8202 java-eclipse-core-contenttype
8203 java-eclipse-core-expressions
8204 java-eclipse-core-filesystem
8205 java-eclipse-core-jobs
8206 java-eclipse-core-runtime
8207 java-eclipse-ant-core
8208 java-eclipse-osgi))
8209 (home-page "https://www.eclipse.org/")
8210 (synopsis "Eclipse core resource management")
8211 (description "This package provides the Eclipse core resource management
8212module @code{org.eclipse.core.resources}.")
8213 (license license:epl1.0)))
8214
8215(define-public java-eclipse-compare-core
8216 (package
8217 (name "java-eclipse-compare-core")
8218 (version "3.6.0")
8219 (source (origin
8220 (method url-fetch)
8221 (uri (string-append "https://repo1.maven.org/maven2/"
8222 "org/eclipse/platform/org.eclipse.compare.core/"
8223 version "/org.eclipse.compare.core-"
8224 version "-sources.jar"))
8225 (sha256
8226 (base32
8227 "10g37r0pbiffyv2wk35c6g5lwzkdipkl0kkjp41v84dln46xm4dg"))))
8228 (build-system ant-build-system)
8229 (arguments
8230 `(#:tests? #f ; no tests included
8231 #:jar-name "eclipse-compare-core.jar"))
8232 (inputs
8233 (list java-eclipse-core-runtime java-eclipse-equinox-common
8234 java-eclipse-osgi java-icu4j))
8235 (home-page "https://www.eclipse.org/")
8236 (synopsis "Eclipse core compare support")
8237 (description "This package provides the Eclipse core compare support
8238module @code{org.eclipse.compare.core}.")
8239 (license license:epl1.0)))
8240
8241(define-public java-eclipse-team-core
8242 (package
8243 (name "java-eclipse-team-core")
8244 (version "3.8.0")
8245 (source (origin
8246 (method url-fetch)
8247 (uri (string-append "https://repo1.maven.org/maven2/"
8248 "org/eclipse/platform/org.eclipse.team.core/"
8249 version "/org.eclipse.team.core-"
8250 version "-sources.jar"))
8251 (sha256
8252 (base32
8253 "02j2jzqgb26zx2d5ahxmvijw6j4r0la90zl5c3i65x6z19ciyam7"))))
8254 (build-system ant-build-system)
8255 (arguments
8256 `(#:tests? #f ; no tests included
8257 #:jar-name "eclipse-team-core.jar"))
8258 (inputs
8259 (list java-eclipse-compare-core
8260 java-eclipse-core-contenttype
8261 java-eclipse-core-filesystem
8262 java-eclipse-core-jobs
8263 java-eclipse-core-resources
8264 java-eclipse-core-runtime
8265 java-eclipse-equinox-common
8266 java-eclipse-equinox-registry
8267 java-eclipse-equinox-preferences
8268 java-eclipse-osgi))
8269 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
8270 (synopsis "Eclipse team support core")
8271 (description "This package provides the Eclipse team support core module
8272@code{org.eclipse.team.core}.")
8273 (license license:epl1.0)))
8274
8275(define-public java-eclipse-core-commands
8276 (package
8277 (name "java-eclipse-core-commands")
8278 (version "3.8.1")
8279 (source (origin
8280 (method url-fetch)
8281 (uri (string-append "https://repo1.maven.org/maven2/"
8282 "org/eclipse/platform/org.eclipse.core.commands/"
8283 version "/org.eclipse.core.commands-"
8284 version "-sources.jar"))
8285 (sha256
8286 (base32
8287 "0yjn482qndcfrsq3jd6vnhcylp16420f5aqkrwr8spsprjigjcr9"))))
8288 (build-system ant-build-system)
8289 (arguments
8290 `(#:tests? #f ; no tests included
8291 #:jar-name "eclipse-core-commands.jar"))
8292 (inputs
8293 (list java-eclipse-equinox-common))
8294 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
8295 (synopsis "Eclipse core commands")
8296 (description "This package provides Eclipse core commands in the module
8297@code{org.eclipse.core.commands}.")
8298 (license license:epl1.0)))
8299
8300(define-public java-eclipse-text
8301 (package
8302 (name "java-eclipse-text")
8303 (version "3.6.0")
8304 (source (origin
8305 (method url-fetch)
8306 (uri (string-append "https://repo1.maven.org/maven2/"
8307 "org/eclipse/platform/org.eclipse.text/"
8308 version "/org.eclipse.text-"
8309 version "-sources.jar"))
8310 (sha256
8311 (base32
8312 "0scz70vzz5qs5caji9f5q01vkqnvip7dpri1q07l8wbbdcxn4cq1"))))
8313 (build-system ant-build-system)
8314 (arguments
8315 `(#:tests? #f ; no tests included
8316 #:jar-name "eclipse-text.jar"
8317 #:phases
8318 (modify-phases %standard-phases
8319 ;; When creating a new category we must make sure that the new list
8320 ;; matches List<Position>. By default it seems to be too generic
8321 ;; (ArrayList<Object>), so we specialize it to ArrayList<Position>.
8322 ;; Without this we get this error:
8323 ;;
8324 ;; [javac] .../src/org/eclipse/jface/text/AbstractDocument.java:376:
8325 ;; error: method put in interface Map<K,V> cannot be applied to given types;
8326 ;; [javac] fPositions.put(category, new ArrayList<>());
8327 ;; [javac] ^
8328 ;; [javac] required: String,List<Position>
8329 ;; [javac] found: String,ArrayList<Object>
8330 ;; [javac] reason: actual argument ArrayList<Object> cannot be converted
8331 ;; to List<Position> by method invocation conversion
8332 ;; [javac] where K,V are type-variables:
8333 ;; [javac] K extends Object declared in interface Map
8334 ;; [javac] V extends Object declared in interface Map
8335 ;;
8336 ;; I don't know if this is a good fix. I suspect it is not, but it
8337 ;; seems to work.
8338 (add-after 'unpack 'fix-compilation-error
8339 (lambda _
8340 (substitute* "src/org/eclipse/jface/text/AbstractDocument.java"
8341 (("Positions.put\\(category, new ArrayList<>\\(\\)\\);")
8342 "Positions.put(category, new ArrayList<Position>());"))
8343 #t)))))
8344 (inputs
8345 (list java-eclipse-equinox-common java-eclipse-core-commands
8346 java-icu4j))
8347 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
8348 (synopsis "Eclipse text library")
8349 (description "Platform Text is part of the Platform UI project and
8350provides the basic building blocks for text and text editors within Eclipse
8351and contributes the Eclipse default text editor.")
8352 (license license:epl1.0)))
8353
8354(define-public java-eclipse-jdt-core
8355 (package
8356 (name "java-eclipse-jdt-core")
8357 (version "3.16.0")
8358 (source (origin
8359 (method url-fetch)
8360 (uri (string-append "https://repo1.maven.org/maven2/"
8361 "org/eclipse/jdt/org.eclipse.jdt.core/"
8362 version "/org.eclipse.jdt.core-"
8363 version "-sources.jar"))
8364 (sha256
8365 (base32
8366 "1g560yr9v2kzv34gc2m3ifpgnj7krcdd6h4gd4z83pwqacwkfz0k"))))
8367 (build-system ant-build-system)
8368 (arguments
8369 `(#:tests? #f ; no tests included
8370 #:jar-name "eclipse-jdt-core.jar"
8371 #:phases
8372 (modify-phases %standard-phases
8373 (add-after 'unpack 'move-sources
8374 (lambda _
8375 (with-directory-excursion "src/jdtCompilerAdaptersrc/"
8376 (for-each (lambda (file)
8377 (install-file file (string-append "../" (dirname file))))
8378 (find-files "." ".*")))
8379 (delete-file-recursively "src/jdtCompilerAdaptersrc/")
8380 #t))
8381 (add-before 'build 'copy-resources
8382 (lambda _
8383 (with-directory-excursion "src"
8384 (for-each (lambda (file)
8385 (install-file file (string-append "../build/classes/" (dirname file))))
8386 (find-files "." ".*.(props|properties|rsc)")))
8387 #t)))))
8388 (inputs
8389 (list java-eclipse-core-contenttype
8390 java-eclipse-core-filesystem
8391 java-eclipse-core-jobs
8392 java-eclipse-core-resources
8393 java-eclipse-core-runtime
8394 java-eclipse-equinox-app
8395 java-eclipse-equinox-common
8396 java-eclipse-equinox-preferences
8397 java-eclipse-equinox-registry
8398 java-eclipse-osgi
8399 java-eclipse-text))
8400 (home-page "https://www.eclipse.org/jdt")
8401 (synopsis "Java development tools core libraries")
8402 (description "This package provides the core libraries of the Eclipse Java
8403development tools.")
8404 (license license:epl1.0)))
8405
8406(define-public java-eclipse-jdt-compiler-apt
8407 (package
8408 (name "java-eclipse-jdt-compiler-apt")
8409 (version "1.3.400")
8410 (source (origin
8411 (method url-fetch)
8412 (uri (string-append "https://repo1.maven.org/maven2/"
8413 "org/eclipse/jdt/org.eclipse.jdt.compiler.apt/"
8414 version "/org.eclipse.jdt.compiler.apt-"
8415 version "-sources.jar"))
8416 (sha256
8417 (base32
8418 "1s285k9p2ixdqrknb40jbbvw682n9a7l5lqpn583a8pvlzg2l6r8"))))
8419 (build-system ant-build-system)
8420 (arguments
8421 `(#:tests? #f ; no tests included
8422 #:jar-name "eclipse-jdt-compiler-apt.jar"
8423 #:jdk ,openjdk11))
8424 (inputs
8425 (list java-eclipse-jdt-core))
8426 (home-page "https://www.eclipse.org/jdt/apt/")
8427 (synopsis "Annotation processing tool")
8428 (description "APT stands for Annotation Processing Tool. APT provides a
8429means for generating files and compiling new Java classes based on annotations
8430found in your source code.")
8431 (license license:epl2.0)))
8432
8433(define-public java-eclipse-lsp4j-common
8434 (package
8435 (name "java-eclipse-lsp4j-common")
8436 (version "0.10.0")
8437 (source (origin
8438 (method git-fetch)
8439 (uri (git-reference
8440 (url "https://github.com/eclipse/lsp4j")
8441 (commit (string-append "v" version))))
8442 (file-name (git-file-name name version))
8443 (sha256
8444 (base32
8445 "17srrac0pkpybwwc21rzdvn762zzl9m80rlqihc9b4l55hkqpk98"))))
8446 (build-system ant-build-system)
8447 (home-page "https://eclipse.org/lsp4j/")
8448 (synopsis "LSP4J common package")
8449 (description "Eclipse LSP4J provides Java bindings for the Language
8450Server Protocol and the Debug Adapter Protocol. This package is a common
8451definition intended to be inherited by other packages.")
8452 (license license:epl2.0)))
8453
8454(define-public java-eclipse-lsp4j-debug
8455 (package
8456 (inherit java-eclipse-lsp4j-common)
8457 (name "java-eclipse-lsp4j-debug")
8458 (arguments
8459 `(#:jar-name "eclipse-lsp4j-debug.jar"
8460 #:jdk ,openjdk11
8461 #:tests? #f; tests fail with reflection errors
8462 #:source-dir "org.eclipse.lsp4j.debug/src/main/java"
8463 #:test-dir "org.eclipse.lsp4j.debug/src/test"
8464 #:phases
8465 (modify-phases %standard-phases
8466 (add-before 'build 'copy-xtend
8467 (lambda _
8468 (copy-recursively "org.eclipse.lsp4j.debug/src/main/xtend-gen"
8469 "org.eclipse.lsp4j.debug/src/main/java"))))))
8470 (native-inputs
8471 (list java-junit))
8472 (inputs
8473 `(("java-gson" ,java-gson-2.8.6)
8474 ("java-eclipse-lsp4j-generaor" ,java-eclipse-lsp4j-generator)
8475 ("java-eclipse-lsp4j-jsonrpc" ,java-eclipse-lsp4j-jsonrpc)
8476 ("java-eclipse-lsp4j-jsonrpc-debug" ,java-eclipse-lsp4j-jsonrpc-debug)
8477 ("java-eclipse-xtext-xbase-lib" ,java-eclipse-xtext-xbase-lib)))
8478 (synopsis "Eclipse LSP4J Java bindings for the Debug Server Protocol")
8479 (description "Eclipse LSP4J provides Java bindings for the Language
8480Server Protocol and the Debug Adapter Protocol. This package contains its
8481LSP4J Java bindings for the Debug Server Protocol.")))
8482
8483(define-public java-eclipse-lsp4j-generator
8484 (package
8485 (inherit java-eclipse-lsp4j-common)
8486 (name "java-eclipse-lsp4j-generator")
8487 (arguments
8488 `(#:jar-name "eclipse-lsp4j-generator.jar"
8489 #:jdk ,openjdk11
8490 #:tests? #f; no tests
8491 #:source-dir "org.eclipse.lsp4j.generator/src/main/java"))
8492 (inputs
8493 (list java-eclipse-lsp4j-jsonrpc))
8494 (synopsis "Eclipse LSP4J Generator")
8495 (description "Eclipse LSP4J provides Java bindings for the Language
8496Server Protocol and the Debug Adapter Protocol. This package contains its
8497LSP4J code generator for Language Server Protocol classes.")))
8498
8499(define-public java-eclipse-lsp4j-jsonrpc
8500 (package
8501 (inherit java-eclipse-lsp4j-common)
8502 (name "java-eclipse-lsp4j-jsonrpc")
8503 (arguments
8504 `(#:jar-name "eclipse-lsp4j-jsonrpc.jar"
8505 #:jdk ,openjdk11
8506 #:source-dir "org.eclipse.lsp4j.jsonrpc/src/main/java"
8507 #:test-dir "org.eclipse.lsp4j.jsonrpc/src/test"))
8508 (native-inputs
8509 (list java-junit))
8510 (inputs
8511 (list java-gson-2.8.6))
8512 (synopsis "Java JSON-RPC implementation")
8513 (description "Eclipse LSP4J provides Java bindings for the Language
8514Server Protocol and the Debug Adapter Protocol. This package contains its
8515JSON-RPC implementation.")))
8516
8517(define-public java-eclipse-lsp4j-jsonrpc-debug
8518 (package
8519 (inherit java-eclipse-lsp4j-common)
8520 (name "java-eclipse-lsp4j-jsonrpc-debug")
8521 (arguments
8522 `(#:jar-name "eclipse-lsp4j-jsonrpc-debug.jar"
8523 #:jdk ,openjdk11
8524 #:source-dir "org.eclipse.lsp4j.jsonrpc.debug/src/main/java"
8525 #:test-dir "org.eclipse.lsp4j.jsonrpc.debug/src/test"))
8526 (native-inputs
8527 (list java-junit))
8528 (inputs
8529 (list java-eclipse-lsp4j-jsonrpc java-gson-2.8.6))
8530 (synopsis "Java JSON-RPC implementation (debug protocol)")
8531 (description "Eclipse LSP4J provides Java bindings for the Language
8532Server Protocol and the Debug Adapter Protocol. This package contains its
8533JSON-RPC implementation's debug protocol.")))
8534
8535(define-public java-eclipse-xtext-xbase-lib
8536 (package
8537 (name "java-eclipse-xtext-xbase-lib")
8538 (version "2.25.0")
8539 (source (origin
8540 (method git-fetch)
8541 (uri (git-reference
8542 (url "https://github.com/eclipse/xtext-lib")
8543 (commit (string-append "v" version))))
8544 (file-name (git-file-name name version))
8545 (sha256
8546 (base32
8547 "13b9lf6lnsprkik665m1qcyyc8cs16k33xm7as4rjcfcpn4pln71"))))
8548 (build-system ant-build-system)
8549 (arguments
8550 `(#:jar-name "eclipse-xtext-xbase-lib.jar"
8551 #:jdk ,openjdk11
8552 #:tests? #f; TODO (maybe needs newer guava version?)
8553 #:source-dir "org.eclipse.xtext.xbase.lib/src"
8554 #:test-dir "org.eclipse.xtext.xbase.lib.tests/src"))
8555 (native-inputs
8556 (list java-junit))
8557 (inputs
8558 (list java-guava))
8559 (home-page "https://www.eclipse.org/Xtext/")
8560 (synopsis "Eclipse Xbase Runtime Library")
8561 (description "This package contains runtime libraries for Xbase languages
8562such as Xtend.")
8563 (license license:epl2.0)))
8564
8565(define-public java-javax-mail
8566 (package
8567 (name "java-javax-mail")
8568 (version "1.6.2")
8569 (source (origin
8570 (method url-fetch)
8571 (uri (string-append "https://repo1.maven.org/maven2/"
8572 "com/sun/mail/javax.mail/"
8573 version "/javax.mail-"
8574 version "-sources.jar"))
8575 (sha256
8576 (base32
8577 "15cryjf398x7sy42j5gzlj5cmc2nx05b175b4gclwxj6qg5ly0li"))))
8578 (build-system ant-build-system)
8579 (arguments
8580 `(#:tests? #f ; no tests
8581 #:jar-name "javax-mail.jar"))
8582 (home-page "https://javamail.java.net")
8583 (synopsis "Reference implementation of the JavaMail API")
8584 (description
8585 "This package provides versions of the JavaMail API implementation, IMAP,
8586SMTP, and POP3 service providers, some examples, and documentation for the
8587JavaMail API.")
8588 ;; GPLv2 only with "classpath exception".
8589 (license license:gpl2)))
8590
8591(define-public java-log4j-api
8592 (package
8593 (name "java-log4j-api")
8594 (version "2.17.1")
8595 (source (origin
8596 (method url-fetch)
8597 (uri (string-append "mirror://apache/logging/log4j/" version
8598 "/apache-log4j-" version "-src.tar.gz"))
8599 (sha256
8600 (base32
8601 "05xssljdgxfv8ql42db8ydjfsvvbdqmsgip75phybm259ydzbsd6"))))
8602 (build-system ant-build-system)
8603 (arguments
8604 `(#:tests? #f ; tests require unpackaged software
8605 #:jar-name "log4j-api.jar"
8606 #:make-flags
8607 ,#~(list (string-append "-Ddist.dir=" #$output "/share/java"))
8608 #:phases
8609 (modify-phases %standard-phases
8610 (add-after 'unpack 'enter-dir
8611 (lambda _ (chdir "log4j-api") #t))
8612 ;; FIXME: The tests require additional software that has not been
8613 ;; packaged yet, such as
8614 ;; * org.apache.maven
8615 ;; * org.apache.felix
8616 (add-after 'enter-dir 'delete-tests
8617 (lambda _ (delete-file-recursively "src/test") #t)))))
8618 (inputs
8619 (list java-osgi-core java-hamcrest-core java-junit))
8620 (properties '((cpe-name . "log4j")))
8621 (home-page "https://logging.apache.org/log4j/2.x/")
8622 (synopsis "API module of the Log4j logging framework for Java")
8623 (description
8624 "This package provides the API module of the Log4j logging framework for
8625Java.")
8626 (license license:asl2.0)))
8627
8628(define-public java-log4j-core
8629 (package
8630 (inherit java-log4j-api)
8631 (name "java-log4j-core")
8632 (inputs
8633 `(("java-osgi-core" ,java-osgi-core)
8634 ("java-hamcrest-core" ,java-hamcrest-core)
8635 ("java-log4j-api" ,java-log4j-api)
8636 ("java-mail" ,java-mail)
8637 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
8638 ("java-conversant-disruptor" ,java-conversant-disruptor)
8639 ("java-lmax-disruptor" ,java-lmax-disruptor)
8640 ("java-jctools-core" ,java-jctools-core-1)
8641 ("java-stax2-api" ,java-stax2-api)
8642 ("java-jansi" ,java-jansi)
8643 ("java-kafka" ,java-kafka-clients)
8644 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
8645 ("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
8646 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
8647 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
8648 ("java-fasterxml-jackson-dataformat-xml" ,java-fasterxml-jackson-dataformat-xml)
8649 ("java-fasterxml-jackson-dataformat-yaml" ,java-fasterxml-jackson-dataformat-yaml)
8650 ("java-commons-compress" ,java-commons-compress)
8651 ("java-commons-csv" ,java-commons-csv)
8652 ("java-jeromq" ,java-jeromq)
8653 ("java-junit" ,java-junit)))
8654 (native-inputs
8655 `(("hamcrest" ,java-hamcrest-all)
8656 ("java-commons-io" ,java-commons-io)
8657 ("java-commons-lang3" ,java-commons-lang3)
8658 ("slf4j" ,java-slf4j-api)))
8659 (arguments
8660 `(#:tests? #f ; tests require more dependencies
8661 #:test-dir "src/test"
8662 #:source-dir "src/main/java"
8663 #:jar-name "log4j-core.jar"
8664 #:jdk ,icedtea-8
8665 #:make-flags
8666 ,#~(list (string-append "-Ddist.dir=" #$output "/share/java"))
8667 #:phases
8668 (modify-phases %standard-phases
8669 (add-after 'unpack 'enter-dir
8670 (lambda _ (chdir "log4j-core") #t)))))
8671 (synopsis "Core component of the Log4j framework")
8672 (description "This package provides the core component of the Log4j
8673logging framework for Java.")))
8674
8675(define-public java-log4j-1.2-api
8676 (package
8677 (inherit java-log4j-api)
8678 (name "java-log4j-1.2-api")
8679 (arguments
8680 `(#:jar-name "java-log4j-1.2-api.jar"
8681 #:source-dir "log4j-1.2-api/src/main/java"
8682 #:jdk ,icedtea-8
8683 ;; Tests require maven-model (and other maven subprojects), which is a
8684 ;; cyclic dependency.
8685 #:tests? #f))
8686 (inputs
8687 `(("log4j-api" ,java-log4j-api)
8688 ("log4j-core" ,java-log4j-core)
8689 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
8690 ("osgi-core" ,java-osgi-core)
8691 ("eclipse-osgi" ,java-eclipse-osgi)
8692 ("java-lmax-disruptor" ,java-lmax-disruptor)))))
8693
8694(define-public java-commons-cli
8695 (package
8696 (name "java-commons-cli")
8697 (version "1.4")
8698 (source (origin
8699 (method url-fetch)
8700 (uri (string-append "mirror://apache/commons/cli/source/"
8701 "commons-cli-" version "-src.tar.gz"))
8702 (sha256
8703 (base32
8704 "05hgi2z01fqz374y719gl1dxzqvzci5af071zm7vxrjg9vczipm1"))))
8705 (build-system ant-build-system)
8706 ;; TODO: javadoc
8707 (arguments
8708 `(#:jar-name "commons-cli.jar"
8709 #:phases
8710 (modify-phases %standard-phases
8711 (replace 'install
8712 (install-from-pom "pom.xml")))))
8713 (native-inputs
8714 (list java-junit java-hamcrest-core))
8715 (home-page "https://commons.apache.org/cli/")
8716 (synopsis "Command line arguments and options parsing library")
8717 (description "The Apache Commons CLI library provides an API for parsing
8718command line options passed to programs. It is also able to print help
8719messages detailing the options available for a command line tool.
8720
8721Commons CLI supports different types of options:
8722
8723@itemize
8724@item POSIX like options (ie. tar -zxvf foo.tar.gz)
8725@item GNU like long options (ie. du --human-readable --max-depth=1)
8726@item Java like properties (ie. java -Djava.awt.headless=true Foo)
8727@item Short options with value attached (ie. gcc -O2 foo.c)
8728@item long options with single hyphen (ie. ant -projecthelp)
8729@end itemize
8730
8731This is a part of the Apache Commons Project.")
8732 (license license:asl2.0)))
8733
8734(define-public java-commons-text
8735 (package
8736 (name "java-commons-text")
8737 (version "1.15.0")
8738 (source (origin
8739 (method url-fetch)
8740 (uri (string-append "mirror://apache/commons/text/source/"
8741 "commons-text-" version "-src.tar.gz"))
8742 (sha256
8743 (base32
8744 "0k0y3pkgrzm84a0z1ifi4b9ydaglzm9pgvaw9phxdcwmcqxjbkc8"))))
8745 (build-system ant-build-system)
8746 (arguments
8747 (list #:jar-name "java-commons-text.jar"
8748 #:source-dir "src/main/java"
8749 #:test-dir "src/test"
8750 #:tests? #f ; Tests require JUnit5.
8751 #:phases
8752 #~(modify-phases %standard-phases
8753 (replace 'install
8754 (install-from-pom "pom.xml")))))
8755 (inputs
8756 (list java-commons-io))
8757 (propagated-inputs
8758 (list java-commons-lang3
8759 apache-commons-parent-pom-51))
8760 (home-page "https://commons.apache.org/text/")
8761 (synopsis "Library focused on algorithms working on strings")
8762 (description "Apache Commons Text is a library focused on algorithms
8763working on strings.
8764
8765This is a part of the Apache Commons Project.")
8766 (license license:asl2.0)))
8767
8768(define-public java-commons-codec
8769 (package
8770 (name "java-commons-codec")
8771 (version "1.15")
8772 (source (origin
8773 (method url-fetch)
8774 (uri (string-append "mirror://apache/commons/codec/source/"
8775 "commons-codec-" version "-src.tar.gz"))
8776 (sha256
8777 (base32
8778 "01z9qmg8fd8d7p7xxipwj1vi9bmvpgqyi29kldjz2x6vzwm171jj"))))
8779 (build-system ant-build-system)
8780 (arguments
8781 `(#:jar-name "java-commons-codec.jar"
8782 #:source-dir "src/main/java"
8783 #:test-dir "src/test"
8784 #:test-exclude (list "**/*AbstractTest.java")
8785 #:phases
8786 (modify-phases %standard-phases
8787 (add-before 'build 'copy-resources
8788 (lambda _
8789 (copy-recursively "src/main/resources"
8790 "build/classes")))
8791 (add-before 'check 'copy-test-resources
8792 (lambda _
8793 (copy-recursively "src/test/resources"
8794 "build/test-classes")))
8795 (add-before 'check 'skip-ravenous-test
8796 (lambda _
8797 ;; This test admits to being "memory hungry", but reliably fails
8798 ;; even on a machine that should have plenty (12 GiB). Skip it.
8799 (substitute*
8800 "src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java"
8801 (("\\bassertEnsureBufferSizeExpandsToMaxBufferSize.*;")
8802 "return;"))))
8803 (replace 'install (install-from-pom "pom.xml")))))
8804 (native-inputs
8805 (list java-commons-lang3 java-junit))
8806 (propagated-inputs
8807 (list apache-commons-parent-pom-52))
8808 (home-page "https://commons.apache.org/codec/")
8809 (synopsis "Common encoders and decoders such as Base64, Hex, Phonetic and URLs")
8810 (description "The codec package contains simple encoder and decoders for
8811various formats such as Base64 and Hexadecimal. In addition to these widely
8812used encoders and decoders, the codec package also maintains a collection of
8813phonetic encoding utilities.
8814
8815This is a part of the Apache Commons Project.")
8816 (license license:asl2.0)))
8817
8818(define-public java-commons-codec-1.17.1
8819 (package
8820 (inherit java-commons-codec)
8821 (version "1.17.1")
8822 (source (origin
8823 (method url-fetch)
8824 (uri (string-append "mirror://apache/commons/codec/source/"
8825 "commons-codec-" version "-src.tar.gz"))
8826 (sha256
8827 (base32
8828 "0f9f80azc13phkwa2fdkmpj5fkh85hf081fz5mmm6rqflmk83wp9"))))
8829 (arguments
8830 (substitute-keyword-arguments (package-arguments java-commons-codec)
8831 ;; Tests require JUnit 5 (org.junit.jupiter) which is not
8832 ;; yet available in Guix.
8833 ((#:tests? _ #t) #f)))))
8834
8835(define-public java-commons-daemon
8836 (package
8837 (name "java-commons-daemon")
8838 (version "1.1.0")
8839 (source (origin
8840 (method url-fetch)
8841 (uri (string-append "mirror://apache/commons/daemon/source/"
8842 "commons-daemon-" version "-src.tar.gz"))
8843 (sha256
8844 (base32
8845 "141gkhfzv5v3pdhic6y4ardq2dhsa3v36j8wmmhy6f8mac48fp7n"))))
8846 (build-system ant-build-system)
8847 (arguments
8848 `(#:test-target "test"
8849 #:phases
8850 (modify-phases %standard-phases
8851 (add-after 'build 'build-javadoc ant-build-javadoc)
8852 (replace 'install (install-jars "dist"))
8853 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
8854 (native-inputs
8855 (list java-junit))
8856 (home-page "https://commons.apache.org/daemon/")
8857 (synopsis "Library to launch Java applications as daemons")
8858 (description "The Daemon package from Apache Commons can be used to
8859implement Java applications which can be launched as daemons. For example the
8860program will be notified about a shutdown so that it can perform cleanup tasks
8861before its process of execution is destroyed by the operation system.
8862
8863This package contains the Java library. You will also need the actual binary
8864for your architecture which is provided by the jsvc package.
8865
8866This is a part of the Apache Commons Project.")
8867 (license license:asl2.0)))
8868
8869(define-public java-javaewah
8870 (package
8871 (name "java-javaewah")
8872 (version "1.1.6")
8873 (source (origin
8874 (method git-fetch)
8875 (uri (git-reference
8876 (url "https://github.com/lemire/javaewah/")
8877 (commit (string-append "JavaEWAH-" version))))
8878 (file-name (git-file-name name version))
8879 (sha256
8880 (base32
8881 "1m8qcb1py76v7avbjjrkvyy6fhr5dk2ywy73gbsxqry04gkm2nhw"))))
8882 (build-system ant-build-system)
8883 (arguments `(#:jar-name "javaewah.jar"))
8884 (inputs
8885 (list java-junit java-hamcrest-core))
8886 (home-page "https://github.com/lemire/javaewah")
8887 (synopsis "Compressed alternative to the Java @code{BitSet} class")
8888 (description "This is a word-aligned compressed variant of the Java
8889@code{Bitset} class. It provides both a 64-bit and a 32-bit RLE-like
8890compression scheme. It can be used to implement bitmap indexes.
8891
8892The goal of word-aligned compression is not to achieve the best compression,
8893but rather to improve query processing time. Hence, JavaEWAH tries to save CPU
8894cycles, maybe at the expense of storage. However, the EWAH scheme is always
8895more efficient storage-wise than an uncompressed bitmap (as implemented in the
8896@code{BitSet} class by Sun).")
8897 ;; GPL2.0 derivates are explicitly allowed.
8898 (license license:asl2.0)))
8899
8900(define-public java-javaewah-1.2.3
8901 (package
8902 (inherit java-javaewah)
8903 (version "1.2.3")
8904 (source (origin
8905 (method git-fetch)
8906 (uri (git-reference
8907 (url "https://github.com/lemire/javaewah/")
8908 (commit (string-append "JavaEWAH-" version))))
8909 (file-name (git-file-name "java-javaewah" version))
8910 (sha256
8911 (base32
8912 "0bl1702pkzr8c8ygprmdc47lrb3m4yn4097jf6liiin54d4km8j5"))))
8913 (arguments
8914 `(#:jar-name "javaewah.jar"
8915 #:phases
8916 (modify-phases %standard-phases
8917 (add-before 'check 'enable-assertions
8918 (lambda _
8919 ;; FuzzEWAHTest requires assertions enabled in the JVM.
8920 (substitute* "build.xml"
8921 (("haltonfailure=\"yes\">")
8922 "haltonfailure=\"yes\"><jvmarg value=\"-ea\" />"))))
8923 (add-after 'build 'add-osgi-manifest
8924 (lambda _
8925 ;; The Maven Central jar has OSGi manifest attributes set by
8926 ;; Maven Bundle Plugin. The NetBeans build uses
8927 ;; Bundle-SymbolicName as a fallback for OpenIDE-Module when
8928 ;; wrapping external libraries as modules.
8929 (call-with-output-file "osgi-manifest.mf"
8930 (lambda (port)
8931 (display (string-append
8932 "Bundle-ManifestVersion: 2\n"
8933 "Bundle-SymbolicName: com.googlecode.javaewah.JavaEWAH\n"
8934 "Bundle-Version: " ,version "\n"
8935 "Export-Package: com.googlecode.javaewah,"
8936 "com.googlecode.javaewah.datastructure,"
8937 "com.googlecode.javaewah.symmetric\n"
8938 "Import-Package: com.googlecode.javaewah,"
8939 "com.googlecode.javaewah.datastructure\n"
8940 "Multi-Release: true\n")
8941 port)))
8942 (invoke "jar" "ufm" "build/jar/javaewah.jar"
8943 "osgi-manifest.mf")))
8944 (replace 'install (install-from-pom "pom.xml")))))))
8945
8946(define-public java-slf4j-api
8947 (package
8948 (name "java-slf4j-api")
8949 (version "1.7.25")
8950 (source (origin
8951 (method git-fetch)
8952 (uri (git-reference
8953 (url "https://github.com/qos-ch/slf4j")
8954 (commit (string-append "v_" version))))
8955 (file-name (git-file-name name version))
8956 (sha256
8957 (base32
8958 "15n42zq3k1iyn752nwdcbs44hxns2rmxhglwjfr4np7lxx56apjl"))
8959 (modules '((guix build utils)))
8960 ;; Delete bundled jars.
8961 (snippet
8962 '(begin
8963 (for-each delete-file (find-files "." "\\.jar$"))
8964 #t))))
8965 (build-system ant-build-system)
8966 (arguments
8967 `(#:jar-name "slf4j-api.jar"
8968 #:source-dir "slf4j-api/src/main"
8969 #:test-dir "slf4j-api/src/test"
8970 #:phases
8971 (modify-phases %standard-phases
8972 (add-after 'build 'regenerate-jar
8973 (lambda _
8974 ;; pom.xml ignores these files in the jar creation process. If we don't,
8975 ;; we get the error "This code should have never made it into slf4j-api.jar"
8976 (delete-file-recursively "build/classes/org/slf4j/impl")
8977 (invoke "jar" "-cf" "build/jar/slf4j-api.jar" "-C"
8978 "build/classes" ".")
8979 ;; The NetBeans wrapper module has an empty jar target and
8980 ;; relies on Bundle-SymbolicName from the Maven Central jar.
8981 (call-with-output-file "osgi-manifest.mf"
8982 (lambda (port)
8983 (display (string-append
8984 "Bundle-ManifestVersion: 2\n"
8985 "Bundle-SymbolicName: slf4j.api\n"
8986 "Bundle-Version: " ,version "\n"
8987 "Export-Package: org.slf4j,org.slf4j.spi,"
8988 "org.slf4j.helpers,org.slf4j.event\n"
8989 "Import-Package: org.slf4j.impl\n")
8990 port)))
8991 (invoke "jar" "ufm" "build/jar/slf4j-api.jar"
8992 "osgi-manifest.mf")))
8993 (add-before 'check 'dont-test-abstract-classes
8994 (lambda _
8995 ;; abstract classes are not meant to be run with junit
8996 (substitute* "build.xml"
8997 (("<include name=\"\\*\\*/\\*Test.java\" />")
8998 (string-append "<include name=\"**/*Test.java\" />"
8999 "<exclude name=\"**/MultithreadedInitializationTest"
9000 ".java\" />")))
9001 #t))
9002 (replace 'install
9003 (install-from-pom "slf4j-api/pom.xml")))))
9004 (propagated-inputs
9005 (list java-slf4j-parent))
9006 (native-inputs
9007 (list java-junit java-hamcrest-core))
9008 (home-page "https://www.slf4j.org/")
9009 (synopsis "Simple logging facade for Java")
9010 (description "The Simple Logging Facade for Java (SLF4J) serves as a
9011simple facade or abstraction for various logging
9012frameworks (e.g. @code{java.util.logging}, @code{logback}, @code{log4j})
9013allowing the end user to plug in the desired logging framework at deployment
9014time.")
9015 (license license:expat)))
9016
9017(define java-slf4j-parent
9018 (package
9019 (inherit java-slf4j-api)
9020 (name "java-slf4j-parent")
9021 (native-inputs `())
9022 (propagated-inputs '())
9023 (arguments
9024 `(#:tests? #f
9025 #:phases
9026 (modify-phases %standard-phases
9027 (delete 'build)
9028 (delete 'configure)
9029 (replace 'install
9030 (install-pom-file "pom.xml")))))))
9031
9032(define-public java-slf4j-simple
9033 (package
9034 (name "java-slf4j-simple")
9035 (version "1.7.25")
9036 (source (package-source java-slf4j-api))
9037 (build-system ant-build-system)
9038 (arguments
9039 `(#:jar-name "slf4j-simple.jar"
9040 #:source-dir "slf4j-simple/src/main"
9041 #:test-dir "slf4j-simple/src/test"
9042 #:test-exclude (list "**/*SimpleLoggerMultithreadedInitializationTest.java")
9043 #:phases
9044 (modify-phases %standard-phases
9045 ;; The tests need some test classes from slf4j-api
9046 (add-before 'check 'build-slf4j-api-test-helpers
9047 (lambda _
9048 ;; Add current dir to CLASSPATH ...
9049 (setenv "CLASSPATH"
9050 (string-append (getcwd) ":" (getenv "CLASSPATH")))
9051 ;; ... and build test helper classes here:
9052 (apply invoke
9053 `("javac" "-d" "."
9054 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
9055 (replace 'install
9056 (install-from-pom "slf4j-simple/pom.xml")))))
9057 (propagated-inputs
9058 (list java-slf4j-api))
9059 (native-inputs
9060 (list java-junit java-hamcrest-core))
9061 (home-page "https://www.slf4j.org/")
9062 (synopsis "Simple implementation of simple logging facade for Java")
9063 (description "SLF4J binding for the Simple implementation, which outputs
9064all events to System.err. Only messages of level INFO and higher are
9065printed.")
9066 (license license:expat)))
9067
9068(define-public java-slf4j-nop
9069 (package
9070 (name "java-slf4j-nop")
9071 (version "1.7.25")
9072 (source (package-source java-slf4j-api))
9073 (build-system ant-build-system)
9074 (arguments
9075 `(#:jar-name "slf4j-nop.jar"
9076 #:source-dir "slf4j-nop/src/main"
9077 #:test-dir "slf4j-nop/src/test"
9078 #:phases (modify-phases %standard-phases
9079 ;; The tests need some test classes from slf4j-api
9080 (add-before 'check 'build-slf4j-api-test-helpers
9081 (lambda _
9082 ;; Add current dir to CLASSPATH ...
9083 (setenv "CLASSPATH"
9084 (string-append (getcwd) ":"
9085 (getenv "CLASSPATH")))
9086 ;; ... and build test helper classes here:
9087 (apply invoke
9088 `("javac" "-d" "."
9089 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
9090 (replace 'install
9091 (install-from-pom "slf4j-nop/pom.xml")))))
9092 (propagated-inputs (list java-slf4j-api))
9093 (native-inputs (list java-junit java-hamcrest-core))
9094 (home-page "https://www.slf4j.org/")
9095 (synopsis "SLF4J binding that silently discards all logging messages")
9096 (description "Binding/provider for NOP, an implementation that silently
9097discards all logging messages.")
9098 (license license:expat)))
9099
9100(define-public java-slf4j-jdk14
9101 (package
9102 (name "java-slf4j-jdk14")
9103 (version "1.7.25")
9104 (source (package-source java-slf4j-api))
9105 (build-system ant-build-system)
9106 (arguments
9107 `(#:jar-name "slf4j-jdk14.jar"
9108 #:source-dir "slf4j-jdk14/src/main"
9109 #:test-dir "slf4j-jdk14/src/test"
9110 #:test-exclude (list "**/*MultithreadedInitializationTest.java")
9111 #:phases
9112 (modify-phases %standard-phases
9113 (add-after 'build 'add-osgi-manifest
9114 (lambda _
9115 ;; The NetBeans wrapper module has an empty jar target and
9116 ;; relies on Bundle-SymbolicName from the Maven Central jar.
9117 (call-with-output-file "osgi-manifest.mf"
9118 (lambda (port)
9119 (display (string-append
9120 "Bundle-ManifestVersion: 2\n"
9121 "Bundle-SymbolicName: slf4j.jdk14\n"
9122 "Bundle-Version: " ,version "\n"
9123 "Export-Package: org.slf4j.impl\n"
9124 "Import-Package: org.slf4j,org.slf4j.spi,"
9125 "org.slf4j.helpers,org.slf4j.event\n")
9126 port)))
9127 (invoke "jar" "ufm" "build/jar/slf4j-jdk14.jar"
9128 "osgi-manifest.mf")))
9129 (add-before 'check 'build-slf4j-api-test-helpers
9130 (lambda _
9131 (setenv "CLASSPATH"
9132 (string-append (getcwd) ":" (getenv "CLASSPATH")))
9133 (apply invoke
9134 `("javac" "-d" "."
9135 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
9136 (replace 'install
9137 (install-from-pom "slf4j-jdk14/pom.xml")))))
9138 (propagated-inputs (list java-slf4j-api))
9139 (native-inputs (list java-junit java-hamcrest-core))
9140 (home-page "https://www.slf4j.org/")
9141 (synopsis "SLF4J binding for @code{java.util.logging}")
9142 (description "SLF4J binding for the JDK14 @code{java.util.logging}
9143framework.")
9144 (license license:expat)))
9145
9146(define-public antlr2
9147 (package
9148 (name "antlr2")
9149 (version "2.7.7")
9150 (source (origin
9151 (method url-fetch)
9152 (uri (string-append "https://www.antlr2.org/download/antlr-"
9153 version ".tar.gz"))
9154 (sha256
9155 (base32
9156 "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5"))
9157 (modules '((guix build utils)))
9158 (snippet
9159 '(begin
9160 (delete-file "antlr.jar")
9161 (substitute* "lib/cpp/antlr/CharScanner.hpp"
9162 (("#include <map>")
9163 (string-append
9164 "#include <map>\n"
9165 "#define EOF (-1)\n"
9166 "#include <strings.h>")))
9167 (substitute* "configure"
9168 (("/bin/sh") "sh"))
9169 #t))))
9170 (build-system gnu-build-system)
9171 (arguments
9172 `(#:tests? #f ; no test target
9173 #:imported-modules ((guix build ant-build-system)
9174 ,@%default-gnu-imported-modules)
9175 #:modules (((guix build ant-build-system) #:prefix ant:)
9176 (guix build gnu-build-system)
9177 (guix build utils))
9178 #:phases
9179 (modify-phases %standard-phases
9180 (add-after 'install 'strip-jar-timestamps
9181 (assoc-ref ant:%standard-phases 'strip-jar-timestamps))
9182 (add-before 'configure 'fix-timestamp
9183 (lambda _
9184 (substitute* "configure"
9185 (("^TIMESTAMP.*") "TIMESTAMP=19700101\n"))
9186 #t))
9187 (add-after 'configure 'fix-bin-ls
9188 (lambda _
9189 (substitute* (find-files "." "Makefile")
9190 (("/bin/ls") "ls"))
9191 #t)))))
9192 (native-inputs
9193 `(("which" ,which)
9194 ("zip" ,zip)
9195 ("java" ,icedtea "jdk")))
9196 (inputs
9197 `(("java" ,icedtea)))
9198 (home-page "https://www.antlr2.org")
9199 (synopsis "Framework for constructing recognizers, compilers, and translators")
9200 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
9201is a language tool that provides a framework for constructing recognizers,
9202compilers, and translators from grammatical descriptions containing Java, C#,
9203C++, or Python actions. ANTLR provides excellent support for tree construction,
9204tree walking, and translation.")
9205 (license license:public-domain)))
9206
9207(define-public java-stringtemplate-3
9208 (package
9209 (name "java-stringtemplate")
9210 (version "3.2.1")
9211 (source (origin
9212 (method url-fetch)
9213 (uri (string-append "https://github.com/antlr/website-st4/raw/"
9214 "gh-pages/download/stringtemplate-"
9215 version ".tar.gz"))
9216 (sha256
9217 (base32
9218 "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is"))))
9219 (build-system ant-build-system)
9220 (arguments
9221 `(#:jar-name (string-append ,name "-" ,version ".jar")
9222 #:test-dir "test"
9223 #:modules ((guix build ant-build-system)
9224 (guix build utils)
9225 (srfi srfi-1))
9226 #:phases
9227 (modify-phases %standard-phases
9228 (add-before 'check 'fix-tests
9229 (lambda _
9230 (substitute* "build.xml"
9231 (("\\$\\{test.home\\}/java")
9232 "${test.home}/org"))
9233 #t))
9234 (add-before 'build 'generate-grammar
9235 (lambda _
9236 (with-directory-excursion "src/org/antlr/stringtemplate/language/"
9237 (for-each (lambda (file)
9238 (format #t "~a\n" file)
9239 (invoke "antlr" file))
9240 '("template.g" "angle.bracket.template.g" "action.g"
9241 "eval.g" "group.g" "interface.g")))
9242 #t)))))
9243 (native-inputs
9244 `(("antlr" ,antlr2)
9245 ("java-junit" ,java-junit)))
9246 (home-page "https://www.stringtemplate.org")
9247 (synopsis "Template engine to generate formatted text output")
9248 (description "StringTemplate is a java template engine (with ports for C#,
9249Objective-C, JavaScript, Scala) for generating source code, web pages, emails,
9250or any other formatted text output. StringTemplate is particularly good at
9251code generators, multiple site skins, and internationalization / localization.
9252StringTemplate also powers ANTLR.")
9253 (license license:bsd-3)))
9254
9255;; antlr3 is partially written using antlr3 grammar files. It also depends on
9256;; ST4 (stringtemplate4), which is also partially written using antlr3 grammar
9257;; files and uses antlr3 at runtime. The latest version requires a recent version
9258;; of antlr3 at runtime.
9259;; Fortunately, ST4 4.0.6 can be built with an older antlr3, and we use antlr3.3.
9260;; This version of ST4 is sufficient for the latest antlr3.
9261;; We use ST4 4.0.6 to build a boostrap antlr3 (latest version), and build
9262;; the latest ST4 with it. Then we build our final antlr3 that will be linked
9263;; against the latest ST4.
9264;; antlr3.3 still depends on antlr3 to generate some files, so we use an
9265;; even older version, antlr3.1, to generate them. Fortunately antlr3.1 uses
9266;; only grammar files with the antlr2 syntax.
9267;; So we build antlr3.1 -> antlr3.3 -> ST4.0.6 -> antlr3-bootstrap -> ST4 -> antlr3.
9268
9269(define-public java-stringtemplate
9270 (package (inherit java-stringtemplate-3)
9271 (name "java-stringtemplate")
9272 (version "4.0.8")
9273 (source (origin
9274 (method url-fetch)
9275 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/"
9276 version ".tar.gz"))
9277 (file-name (string-append name "-" version ".tar.gz"))
9278 (sha256
9279 (base32
9280 "1pri8hqa95rfdkjy55icl5q1m09zwp5k67ib14abas39s4v3w087"))))
9281 (build-system ant-build-system)
9282 (arguments
9283 `(#:jar-name (string-append ,name "-" ,version ".jar")
9284 #:tests? #f ; FIXME: tests fail for unknown reasons
9285 #:test-dir "test"
9286 #:modules ((guix build ant-build-system)
9287 (guix build utils)
9288 (srfi srfi-1))
9289 #:phases
9290 (modify-phases %standard-phases
9291 (add-before 'check 'fix-test-target
9292 (lambda _
9293 (substitute* "build.xml"
9294 (("\\$\\{test.home\\}/java") "${test.home}/")
9295 (("\\*Test.java") "Test*.java"))
9296 #t))
9297 (add-before 'build 'generate-grammar
9298 (lambda _
9299 (with-directory-excursion "src/org/stringtemplate/v4/compiler/"
9300 (for-each (lambda (file)
9301 (format #t "~a\n" file)
9302 (invoke "antlr3" file))
9303 '("STParser.g" "Group.g" "CodeGenerator.g")))
9304 #t)))))
9305 (inputs
9306 `(("antlr3" ,antlr3-bootstrap)
9307 ("antlr2" ,antlr2)
9308 ("java-stringtemplate" ,java-stringtemplate-3)
9309 ("java-junit" ,java-junit)))))
9310
9311(define-public java-stringtemplate-4.0.6
9312 (package (inherit java-stringtemplate)
9313 (name "java-stringtemplate")
9314 (version "4.0.6")
9315 (source (origin
9316 (method url-fetch)
9317 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/ST-"
9318 version ".tar.gz"))
9319 (file-name (string-append name "-" version ".tar.gz"))
9320 (sha256
9321 (base32
9322 "0hjmh1ahdsh3w825i67mli9l4nncc4l6hdbf9ma91jvlj590sljp"))))
9323 (inputs
9324 `(("antlr3" ,antlr3-3.3)
9325 ("antlr2" ,antlr2)
9326 ("java-stringtemplate" ,java-stringtemplate-3)))))
9327
9328(define-public antlr3
9329 (package
9330 (name "antlr3")
9331 (version "3.5.2")
9332 (source (origin
9333 (method git-fetch)
9334 (uri (git-reference
9335 (url "https://github.com/antlr/antlr3")
9336 (commit version)))
9337 (file-name (git-file-name name version))
9338 (sha256
9339 (base32
9340 "0cafavrjmzqhklghrk8c2jqxkdwxgzskm20pbrfd3r41cn00dpnf"))))
9341 (build-system ant-build-system)
9342 (arguments
9343 `(#:jar-name (string-append ,name "-" ,version ".jar")
9344 #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3"
9345 #:tests? #f
9346 #:phases
9347 (modify-phases %standard-phases
9348 (add-after 'install 'bin-install
9349 (lambda* (#:key inputs outputs #:allow-other-keys)
9350 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
9351 (bin (string-append (assoc-ref outputs "out") "/bin")))
9352 (mkdir-p bin)
9353 (with-output-to-file (string-append bin "/antlr3")
9354 (lambda _
9355 (display
9356 (string-append "#!" (which "sh") "\n"
9357 "java -cp " jar "/" ,name "-" ,version ".jar:"
9358 (string-concatenate
9359 (find-files (assoc-ref inputs "stringtemplate")
9360 ".*\\.jar"))
9361 ":"
9362 (string-concatenate
9363 (find-files (assoc-ref inputs "stringtemplate4")
9364 ".*\\.jar"))
9365 ":"
9366 (string-concatenate
9367 (find-files (string-append
9368 (assoc-ref inputs "antlr")
9369 "/lib")
9370 ".*\\.jar"))
9371 " org.antlr.Tool $*"))))
9372 (chmod (string-append bin "/antlr3") #o755))
9373 #t))
9374 (add-before 'build 'generate-grammar
9375 (lambda _
9376 (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/")
9377 (for-each (lambda (file)
9378 (display file)
9379 (newline)
9380 (invoke "antlr3" file))
9381 '("ANTLR.g" "ANTLRTreePrinter.g" "ActionAnalysis.g"
9382 "AssignTokenTypesWalker.g"
9383 "ActionTranslator.g" "TreeToNFAConverter.g"
9384 "ANTLRv3.g" "ANTLRv3Tree.g" "LeftRecursiveRuleWalker.g"
9385 "CodeGenTreeWalker.g" "DefineGrammarItemsWalker.g"))
9386 (substitute* "ANTLRParser.java"
9387 (("public Object getTree") "public GrammarAST getTree"))
9388 (substitute* "ANTLRv3Parser.java"
9389 (("public Object getTree") "public CommonTree getTree"))
9390 (chdir "../../../../../java")
9391 (substitute* "org/antlr/tool/LeftRecursiveRuleAnalyzer.java"
9392 (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*;
9393import org.antlr.grammar.v3.ANTLRTreePrinter;"))
9394 (substitute* "org/antlr/tool/ErrorManager.java"
9395 (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") ""))
9396 (chdir "../../../..")
9397 #t))
9398 (add-before 'build 'fix-build-xml
9399 (lambda _
9400 (substitute* "build.xml"
9401 (("target name=\"compile\">")
9402 "target name=\"compile\">
9403<copy todir=\"${classes.dir}\">
9404<fileset dir=\"tool/src/main/resources\">
9405<include name=\"**/*.stg\"/>
9406<include name=\"**/*.st\"/>
9407<include name=\"**/*.sti\"/>
9408<include name=\"**/STLexer.tokens\"/>
9409</fileset>
9410</copy>"))
9411 #t)))))
9412 (native-inputs
9413 `(("antlr" ,antlr2)
9414 ("antlr3" ,antlr3-bootstrap)))
9415 (inputs
9416 `(("junit" ,java-junit)
9417 ("stringtemplate" ,java-stringtemplate-3)
9418 ("stringtemplate4" ,java-stringtemplate)))
9419 (propagated-inputs
9420 `(("stringtemplate" ,java-stringtemplate-3)
9421 ("antlr" ,antlr2)
9422 ("stringtemplate4" ,java-stringtemplate-4.0.6)))
9423 (home-page "https://www.antlr3.org")
9424 (synopsis "Framework for constructing recognizers, compilers, and translators")
9425 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
9426is a language tool that provides a framework for constructing recognizers,
9427compilers, and translators from grammatical descriptions containing Java, C#,
9428C++, or Python actions. ANTLR provides excellent support for tree construction,
9429tree walking, and translation.")
9430 (license license:bsd-3)))
9431
9432(define-public antlr3-bootstrap
9433 (package
9434 (inherit antlr3)
9435 (name "antlr3-bootstrap")
9436 (native-inputs
9437 `(("antlr" ,antlr2)
9438 ("antlr3" ,antlr3-3.3)))
9439 (inputs
9440 `(("junit" ,java-junit)))
9441 (properties '((hidden? . #t))))) ;for bootstrapping purposes only
9442
9443(define-public antlr3-3.3
9444 (package
9445 (inherit antlr3)
9446 (name "antlr3")
9447 (version "3.3")
9448 (source (origin
9449 (method url-fetch)
9450 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
9451 "gh-pages/download/antlr-"
9452 version ".tar.gz"))
9453 (sha256
9454 (base32
9455 "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m"))
9456 (patches
9457 (search-patches "antlr3-3_3-fix-java8-compilation.patch"))))
9458 (arguments
9459 `(#:jar-name (string-append ,name "-" ,version ".jar")
9460 #:source-dir (string-join '("tool/src/main/java"
9461 "runtime/Java/src/main/java"
9462 "tool/src/main/antlr2"
9463 "tool/src/main/antlr3")
9464 ":")
9465 #:tests? #f ; FIXME: tests seem to require maven plugin
9466 #:modules ((guix build ant-build-system)
9467 (guix build utils)
9468 (srfi srfi-1))
9469 #:phases
9470 (modify-phases %standard-phases
9471 (add-after 'install 'bin-install
9472 (lambda* (#:key inputs outputs #:allow-other-keys)
9473 (let* ((out (assoc-ref outputs "out"))
9474 (jar (string-append out "/share/java"))
9475 (bin (string-append out "/bin")))
9476 (mkdir-p bin)
9477 (with-output-to-file (string-append bin "/antlr3")
9478 (lambda _
9479 (display
9480 (string-append
9481 "#!" (which "sh") "\n"
9482 "java -cp " jar "/antlr3-3.3.jar:"
9483 (string-join
9484 (append (find-files (assoc-ref inputs "java-stringtemplate")
9485 ".*\\.jar$")
9486 (find-files (string-append (assoc-ref inputs "antlr")
9487 "/lib")
9488 ".*\\.jar$"))
9489 ":")
9490 " org.antlr.Tool $*"))))
9491 (chmod (string-append bin "/antlr3") #o755)
9492 #t)))
9493 (add-before 'build 'generate-grammar
9494 (lambda _
9495 (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java"
9496 (("import org.antlr.grammar.v2.\\*;")
9497 "import org.antlr.grammar.v2.*;\n
9498import org.antlr.grammar.v2.TreeToNFAConverter;\n
9499import org.antlr.grammar.v2.DefineGrammarItemsWalker;\n
9500import org.antlr.grammar.v2.ANTLRTreePrinter;"))
9501 (with-directory-excursion "tool/src/main/antlr2/org/antlr/grammar/v2/"
9502 (for-each (lambda (file)
9503 (format #t "~a\n" file)
9504 (invoke "antlr" file))
9505 '("antlr.g" "antlr.print.g" "assign.types.g"
9506 "buildnfa.g" "codegen.g" "define.g")))
9507 (with-directory-excursion "tool/src/main/antlr3/org/antlr/grammar/v3/"
9508 (for-each (lambda (file)
9509 (format #t "~a\n" file)
9510 (invoke "antlr3" file))
9511 '("ActionAnalysis.g" "ActionTranslator.g" "ANTLRv3.g"
9512 "ANTLRv3Tree.g")))
9513 #t))
9514 (add-before 'build 'fix-build-xml
9515 (lambda _
9516 (substitute* "build.xml"
9517 (("target name=\"compile\">")
9518 "target name=\"compile\">
9519<copy todir=\"${classes.dir}\">
9520<fileset dir=\"tool/src/main/resources\">
9521<include name=\"**/*.stg\"/>
9522<include name=\"**/*.st\"/>
9523<include name=\"**/*.sti\"/>
9524<include name=\"**/STLexer.tokens\"/>
9525</fileset>
9526</copy>"))
9527 #t)))))
9528 (native-inputs
9529 `(("antlr" ,antlr2)
9530 ("antlr3" ,antlr3-3.1)))
9531 (inputs
9532 `(("junit" ,java-junit)))
9533 (propagated-inputs
9534 `(("java-stringtemplate" ,java-stringtemplate-3)
9535 ("antlr" ,antlr2)))
9536 (properties (alist-delete 'hidden? (package-properties antlr3)))))
9537
9538(define-public antlr3-3.1
9539 (package
9540 (inherit antlr3)
9541 (version "3.1")
9542 (source (origin
9543 (method url-fetch)
9544 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
9545 "gh-pages/download/antlr-"
9546 version ".tar.gz"))
9547 (sha256
9548 (base32
9549 "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z"))
9550 (patches
9551 (search-patches "antlr3-3_1-fix-java8-compilation.patch"))))
9552 (arguments
9553 `(#:jar-name (string-append "antlr3-" ,version ".jar")
9554 #:source-dir "src:runtime/Java/src"
9555 #:tests? #f
9556 #:phases
9557 (modify-phases %standard-phases
9558 (add-after 'install 'bin-install
9559 (lambda* (#:key inputs outputs #:allow-other-keys)
9560 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
9561 (bin (string-append (assoc-ref outputs "out") "/bin")))
9562 (mkdir-p bin)
9563 (with-output-to-file (string-append bin "/antlr3")
9564 (lambda _
9565 (display
9566 (string-append "#!" (which "sh") "\n"
9567 "java -cp " jar "/antlr3-3.1.jar:"
9568 (string-concatenate
9569 (find-files (assoc-ref inputs "stringtemplate")
9570 ".*\\.jar"))
9571 ":"
9572 (string-concatenate
9573 (find-files (string-append
9574 (assoc-ref inputs "antlr")
9575 "/lib")
9576 ".*\\.jar"))
9577 " org.antlr.Tool $*"))))
9578 (chmod (string-append bin "/antlr3") #o755))
9579 #t))
9580 (add-before 'build 'generate-grammar
9581 (lambda _
9582 (let ((dir "src/org/antlr/tool/"))
9583 (for-each (lambda (file)
9584 (display file)
9585 (newline)
9586 (invoke "antlr" "-o" dir (string-append dir file)))
9587 '("antlr.g" "antlr.print.g" "assign.types.g"
9588 "buildnfa.g" "define.g")))
9589 (format #t "codegen.g\n")
9590 (invoke "antlr" "-o" "src/org/antlr/codegen"
9591 "src/org/antlr/codegen/codegen.g")
9592 #t))
9593 (add-before 'build 'fix-build-xml
9594 (lambda _
9595 (substitute* "build.xml"
9596 (("target name=\"compile\">")
9597 "target name=\"compile\">
9598<copy todir=\"${classes.dir}\">
9599<fileset dir=\"src\">
9600<include name=\"**/*.stg\"/>
9601<include name=\"**/*.st\"/>
9602<include name=\"**/*.sti\"/>
9603<include name=\"**/STLexer.tokens\"/>
9604</fileset>
9605</copy>"))
9606 #t)))))
9607 (native-inputs
9608 `(("antlr" ,antlr2)))
9609 (inputs
9610 `(("junit" ,java-junit)))
9611 (propagated-inputs
9612 `(("stringtemplate" ,java-stringtemplate-3)))))
9613
9614(define-public java-treelayout
9615 (package
9616 (name "java-treelayout")
9617 (version "1.0.3")
9618 (source (origin
9619 (method git-fetch)
9620 (uri (git-reference
9621 (url "https://github.com/abego/treelayout")
9622 (commit (string-append "v" version))))
9623 (file-name (git-file-name name version))
9624 (sha256
9625 (base32
9626 "18my8ql9b1y0n0zrvkih7xfhf3dpgfhyfifvkcfhmwcvw3divxak"))))
9627 (build-system ant-build-system)
9628 (arguments
9629 `(#:jar-name (string-append ,name "-" ,version ".jar")
9630 #:source-dir "org.abego.treelayout/src/main/java"
9631 #:test-dir "org.abego.treelayout/src/test"))
9632 (inputs
9633 (list java-junit))
9634 (native-inputs
9635 (list java-hamcrest-core))
9636 (home-page "https://treelayout.sourceforge.net")
9637 (synopsis "Tree Layout Algorithm in Java")
9638 (description "TreeLayout creates tree layouts for arbitrary trees. It is
9639not restricted to a specific output or format, but can be used for any kind of
9640two dimensional diagram. Examples are Swing based components, SVG files, etc.
9641This is possible because TreeLayout separates the layout of a tree from the
9642actual rendering.")
9643 (license license:bsd-3)))
9644
9645(define-public java-antlr4-runtime
9646 (package
9647 (name "java-antlr4-runtime")
9648 (version "4.10.1")
9649 (source (origin
9650 (method git-fetch)
9651 (uri (git-reference
9652 (url "https://github.com/antlr/antlr4")
9653 (commit version)))
9654 (file-name (git-file-name name version))
9655 (sha256
9656 (base32
9657 "0ldvd9jm4nrivaw7i7wh1q40q6xgzmzirsywiakbhg8sppagqlv7"))
9658 (patches
9659 (search-patches "java-antlr4-Add-standalone-generator.patch"))))
9660 (build-system ant-build-system)
9661 (arguments
9662 `(#:jar-name "java-antlr4-runtime.jar"
9663 #:source-dir "runtime/Java/src/org"
9664 #:tests? #f; tests depend on java-antlr4 itself
9665 #:phases
9666 (modify-phases %standard-phases
9667 (add-before 'build 'copy-resources
9668 (lambda _
9669 (copy-recursively "runtime/Java/src/main/dot"
9670 "build/classes")
9671 #t)))))
9672 (home-page "https://www.antlr.org")
9673 (synopsis "ANTLR runtime library")
9674 (description "This package contains the runtime library used with generated
9675sources by ANTLR.")
9676 (license license:bsd-3)))
9677
9678(define-public cpp-antlr4-runtime
9679 (package
9680 (inherit java-antlr4-runtime)
9681 (name "cpp-antlr4-runtime")
9682 (properties '((upstream-name . "antlr4-cpp-runtime")))
9683 (outputs '("out" "static"))
9684 (build-system cmake-build-system)
9685 (arguments
9686 (list
9687 ;; TODO: try to run the tests under
9688 ;; runtime-testsuite/test/org/antlr/v4/test/runtime/cpp with antlr4.
9689 #:phases
9690 #~(modify-phases %standard-phases
9691 (add-after 'unpack 'chdir
9692 (lambda _
9693 (chdir "runtime/Cpp")))
9694 (add-after 'chdir 'unbundle-googletest
9695 (lambda _
9696 (substitute* "runtime/CMakeLists.txt"
9697 (("^ FetchContent_MakeAvailable.*")
9698 "")
9699 (("gtest_main" all)
9700 (string-append "gtest " all)))))
9701 (add-after 'install 'move-static-library
9702 (lambda* (#:key outputs #:allow-other-keys)
9703 (let ((static (assoc-ref outputs "static"))
9704 (libantlr4-runtime.a (search-input-file
9705 outputs "lib/libantlr4-runtime.a")))
9706 (mkdir-p (string-append static "/lib"))
9707 (rename-file
9708 libantlr4-runtime.a
9709 (string-append static "/lib/"
9710 (basename libantlr4-runtime.a)))))))))
9711 (native-inputs (list googletest pkg-config))
9712 (inputs (list `(,util-linux "lib"))) ;libuuid
9713 (synopsis "ANTLR C++ runtime library")
9714 (description "This package contains the C++ runtime library used with C++
9715generated sources by ANTLR.")))
9716
9717(define-deprecated-package java-antlr4-runtime-cpp
9718 cpp-antlr4-runtime)
9719
9720(define-public python-antlr4-runtime
9721 (package
9722 (inherit java-antlr4-runtime)
9723 (name "python-antlr4-runtime")
9724 (properties '((upstream-name . "antlr4-python3-runtime")))
9725 (build-system pyproject-build-system)
9726 (arguments
9727 (list
9728 #:test-backend #~'custom
9729 #:test-flags #~'("tests/run.py" "--verbose")
9730 #:phases
9731 #~(modify-phases %standard-phases
9732 (add-after 'unpack 'chdir
9733 (lambda _
9734 (chdir "runtime/Python3")))
9735 ;; TODO: Remove when updating ANTLR4:
9736 ;; https://github.com/antlr/antlr4/pull/4593
9737 (add-after 'chdir 'fix-python-3.12-compatibility
9738 (lambda _
9739 (substitute* "tests/TestIntervalSet.py"
9740 (("assertEquals") "assertEqual"))))
9741 (add-after 'chdir 'regenerate-parsers
9742 (lambda _
9743 (invoke "antlr4" "-no-listener" "-Dlanguage=Python3"
9744 "src/antlr4/xpath/XPathLexer.g4")
9745 (invoke "antlr4" "-no-listener" "-Dlanguage=Python3"
9746 "tests/expr/Expr.g4"))))))
9747 (native-inputs (list antlr4 python-setuptools))
9748 (synopsis "ANTLR Python runtime library")
9749 (description "This package contains the Python runtime library used with
9750Python generated sources by ANTLR.")))
9751
9752(define-deprecated-package java-antlr4-runtime-python
9753 python-antlr4-runtime)
9754
9755(define-public antlr4
9756 (package
9757 (inherit java-antlr4-runtime)
9758 (name "antlr4")
9759 (arguments
9760 `(#:jar-name "antlr4.jar"
9761 #:source-dir "tool/src"
9762 #:test-dir "tool-testsuite/test:runtime-testsuite/test"
9763 #:test-include (list "**/Test*.java")
9764 #:test-exclude (list
9765 ;; These have no runnable methods and fail because
9766 ;; test-include above is too broad.
9767 "**/TestContext.java"
9768 "**/TestOutputReading.java"
9769 ;; no @Test methods
9770 "**/TestParserErrors.java"
9771 "**/TestSemPredEvalParser.java"
9772 "**/TestSets.java"
9773 "**/TestListeners.java"
9774 "**/TestParseTrees.java"
9775 "**/TestParserExec.java"
9776 "**/TestLexerErrors.java"
9777 "**/TestPerformance.java"
9778 "**/TestCompositeParsers.java"
9779 "**/TestLexerExec.java"
9780 "**/TestSemPredEvalLexer.java"
9781 "**/TestLeftRecursion.java"
9782 "**/TestFullContextParsing.java"
9783 "**/TestCompositeLexers.java"
9784 ;; Null pointer exception
9785 "**/TestCompositeGrammars.java")
9786 #:phases
9787 (modify-phases %standard-phases
9788 (add-before 'build 'fix-build.xml
9789 (lambda _
9790 ;; tests are not in a java subdirectory
9791 (substitute* "build.xml"
9792 (("\\$\\{test.home\\}/java") "${test.home}"))
9793 #t))
9794 ;; tests require to have a working antlr4 binary
9795 (delete 'check)
9796 (add-after 'install 'check
9797 (lambda _
9798 (invoke "ant" "compile-tests")
9799 (invoke "ant" "check" "-Dtest.home=runtime-testsuite/test")
9800 (invoke "ant" "check" "-Dtest.home=tool-testsuite/test")
9801 #t))
9802 (add-before 'check 'remove-unrelated-languages
9803 (lambda _
9804 ;; There are tests for other languages that ANTLR can generate, but
9805 ;; we don't have the infrastructure for that yet. Let's test Java
9806 ;; generation only.
9807 (for-each
9808 (lambda (language)
9809 (delete-file-recursively
9810 (string-append "runtime-testsuite/test/org/antlr/v4/test/runtime/"
9811 language)))
9812 '("cpp" "csharp" "go" "javascript" "php" "python" "python2"
9813 "python3" "swift"))
9814 #t))
9815 (add-before 'check 'generate-test-parsers
9816 (lambda* (#:key outputs #:allow-other-keys)
9817 (define (run-antlr dir filename package)
9818 (invoke "antlr4" "-lib" dir "-visitor" "-no-listener"
9819 "-package" package (string-append dir "/" filename)
9820 "-Xlog"))
9821 (setenv "PATH" (string-append (getenv "PATH") ":"
9822 (assoc-ref outputs "out") "/bin"))
9823 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
9824 "Java.g4" "org.antlr.v4.test.runtime.java.api")
9825 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
9826 "VisitorBasic.g4" "org.antlr.v4.test.runtime.java.api")
9827 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
9828 "VisitorCalc.g4" "org.antlr.v4.test.runtime.java.api")
9829 #t))
9830 (add-before 'check 'remove-graphemes
9831 (lambda _
9832 ;; When running antlr on grahemes.g4, we get a runtime exception:
9833 ;; set is empty. So delete the file that depends on it.
9834 (delete-file
9835 "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/perf/TimeLexerSpeed.java")
9836 #t))
9837 (add-after 'install 'bin-install
9838 (lambda* (#:key inputs outputs #:allow-other-keys)
9839 (let* ((output (assoc-ref outputs "out"))
9840 (bin (string-append output "/bin"))
9841 (bin/antlr4 (string-append bin "/antlr4")))
9842 (mkdir-p bin)
9843 (with-output-to-file bin/antlr4
9844 (lambda _
9845 (display
9846 (string-append
9847 "#!"
9848 (search-input-file inputs "bin/sh")
9849 "\n"
9850 (string-append (assoc-ref inputs "openjdk")
9851 "/bin/java")
9852 " -cp "
9853 (string-append output "/share/java/antlr4.jar")
9854 ":"
9855 (string-join
9856 (apply append
9857 (map (lambda (input)
9858 (find-files (assoc-ref inputs input)
9859 "\\.jar$"))
9860 '("antlr3" "java-stringtemplate"
9861 "java-antlr4-runtime" "java-treelayout"
9862 "java-jsonp-api" "java-icu4j")))
9863 ":")
9864 " org.antlr.v4.Tool $*\n"))))
9865 (chmod bin/antlr4 #o755))))
9866 (add-before 'build 'copy-resources
9867 (lambda _
9868 (copy-recursively "tool/resources/" "build/classes")
9869 #t))
9870 (add-before 'build 'generate-unicode
9871 (lambda _
9872 ;; First: build the generator
9873 (invoke "javac" "-cp" (getenv "CLASSPATH")
9874 "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java"
9875 "tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java")
9876 ;; Then use it
9877 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
9878 ":tool/src:runtime/Java")
9879 "org.antlr.v4.unicode.UnicodeRenderer"
9880 "tool/resources/org/antlr/v4/tool/templates"
9881 "unicodedata"
9882 "tool/src/org/antlr/v4/unicode/UnicodeData.java")
9883 ;; It seems there is a bug with our ST4
9884 (substitute* "tool/src/org/antlr/v4/unicode/UnicodeData.java"
9885 (("\\\\>") ">"))
9886 ;; Remove the additional file
9887 (delete-file "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java")
9888 #t))
9889 (add-before 'build 'generate-grammar
9890 (lambda* (#:key inputs #:allow-other-keys)
9891 (with-directory-excursion "tool/src/org/antlr/v4/parse"
9892 (for-each (lambda (file)
9893 (display file)
9894 (newline)
9895 (invoke "antlr3" file))
9896 '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g"
9897 "GrammarTreeVisitor.g" "ATNBuilder.g"
9898 "ActionSplitter.g" "LeftRecursiveRuleWalker.g")))
9899 (with-directory-excursion "tool/src/org/antlr/v4/codegen"
9900 (install-file "../parse/ANTLRParser.tokens" ".")
9901 (display "SourceGenTriggers.g\n")
9902 (invoke "antlr3" "SourceGenTriggers.g"))
9903 #t)))))
9904 (inputs
9905 (list antlr3
9906 java-antlr4-runtime
9907 java-icu4j
9908 java-jsonp-api
9909 java-stringtemplate
9910 java-treelayout
9911 openjdk))
9912 (native-inputs
9913 (list java-junit))
9914 (synopsis "Parser and lexer generator in Java")
9915 (description "ANTLR (ANother Tool for Language Recognition) is a powerful
9916parser generator for reading, processing, executing, or translating structured
9917text or binary files. It's widely used to build languages, tools, and
9918frameworks. From a grammar, ANTLR generates a parser that can build and walk
9919parse trees.")))
9920
9921(define-public java-antlr4-runtime-4.1
9922 (package
9923 (inherit java-antlr4-runtime)
9924 (version "4.1")
9925 (source (origin
9926 (method git-fetch)
9927 (uri (git-reference
9928 (url "https://github.com/antlr/antlr4")
9929 (commit version)))
9930 (file-name (git-file-name "antlr4" version))
9931 (sha256
9932 (base32
9933 "1i8hmx5an58cjyvhji0xgpvd6lq00z1k1mjys025q2wqc25wv4c1"))))
9934 (arguments
9935 (substitute-keyword-arguments (package-arguments java-antlr4-runtime)
9936 ((#:phases phases)
9937 `(modify-phases ,phases
9938 (add-before 'configure 'chmod
9939 (lambda _
9940 (chmod "build.xml" #o644)
9941 #t))))))
9942 (inputs
9943 (list java-treelayout))))
9944
9945(define-public antlr4-4.1
9946 (package
9947 (inherit antlr4)
9948 (version (package-version java-antlr4-runtime-4.1))
9949 (source (package-source java-antlr4-runtime-4.1))
9950 (arguments
9951 (substitute-keyword-arguments (package-arguments antlr4)
9952 ((#:test-dir _)
9953 "tool/test")
9954 ((#:test-exclude excludes)
9955 `(list "**/TestParseErrors.java"
9956 "**/TestTopologicalSort.java"
9957 ,@excludes))
9958 ((#:phases phases)
9959 `(modify-phases ,phases
9960 (delete 'generate-unicode)
9961 (replace 'check
9962 (lambda _
9963 (invoke "ant" "check")
9964 #t))
9965 (add-before 'configure 'chmod
9966 (lambda _
9967 (chmod "build.xml" #o644)
9968 #t))
9969 (delete 'remove-graphemes)
9970 (delete 'remove-unrelated-languages)
9971 (delete 'generate-test-parsers)))))
9972 (inputs
9973 (alist-replace
9974 "java-antlr4-runtime" (list java-antlr4-runtime-4.1)
9975 (package-inputs antlr4)))))
9976
9977(define-public java-tunnelvisionlabs-antlr4-runtime-annotations
9978 (package
9979 (inherit java-antlr4-runtime)
9980 (name "java-tunnelvisionlabs-antlr4-runtime-annotations")
9981 (version "4.7.4")
9982 (source (origin
9983 (method git-fetch)
9984 (uri (git-reference
9985 (url "https://github.com/tunnelvisionlabs/antlr4")
9986 (commit (string-append version "-opt"))))
9987 (file-name (git-file-name "java-tunnelvisionlabs-antlr4" version))
9988 (sha256
9989 (base32
9990 "1mf2lvvsszpialsk23ma83pwp50nd32lrbjpa847zlm5gmranbr8"))
9991 (patches
9992 (search-patches "java-antlr4-Add-standalone-generator.patch"
9993 "java-tunnelvisionlabs-antlr-code-too-large.patch"))))
9994 (arguments
9995 `(#:jar-name "java-antlr4-runtime-annotations.jar"
9996 #:source-dir "runtime/JavaAnnotations/src"
9997 #:tests? #f; no tests
9998 #:phases
9999 (modify-phases %standard-phases
10000 (add-after 'build 'copy-resources
10001 (lambda _
10002 (copy-recursively "runtime/JavaAnnotations/resources"
10003 "build/classes")
10004 #t))
10005 (add-after 'copy-resources 'rebuild-jar
10006 (lambda _
10007 (invoke "ant" "jar")
10008 #t)))))
10009 (inputs '())
10010 (native-inputs '())
10011 (synopsis "Annotations for ANTLR's runtime library")
10012 (description "This package contains annotations used during the build of
10013the runtime library of ANTLR.")))
10014
10015;; the runtime of this library requires a lexer that is generated by antlr4.
10016;; However, antlr4 itself requires this library at build and run-time. We
10017;; use [email protected], the closest version of antlr that doesn't need this
10018;; bootstrap process, to generate the lexer. The generated lexer is built
10019;; for the 4.1 runtime, which is slightly different from this runtime.
10020;; So, we build the runtime with antlr 4.1, with a broken xml lexer, that we
10021;; use to build antlr4. We then re-use this antlr4 to build the runtime, and
10022;; the proper, working, runtime to build antlr4 again.
10023(define-public java-tunnelvisionlabs-antlr4-runtime-bootstrap
10024 (package
10025 (inherit java-antlr4-runtime)
10026 (name "java-tunnelvisionlabs-antlr4-runtime")
10027 (version (package-version java-tunnelvisionlabs-antlr4-runtime-annotations))
10028 (source (package-source java-tunnelvisionlabs-antlr4-runtime-annotations))
10029 (arguments
10030 `(#:jar-name "java-antlr4-runtime.jar"
10031 #:source-dir "runtime/Java/src"
10032 #:tests? #f; tests require antlr4, but antlr4 depends on this package
10033 #:phases
10034 (modify-phases %standard-phases
10035 (add-before 'build 'generate-xpath-lexer
10036 (lambda _
10037 (invoke "antlr4" "-lib" "runtime/Java/src/org/antlr/v4/runtime/tree/xpath"
10038 "-visitor" "-no-listener"
10039 "-package" "org.antlr.v4.runtime.tree.xpath"
10040 "runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.g4")
10041 ;; Generated code is for an incompatible version of the runtime
10042 (substitute* "runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.java"
10043 (("LexerATNSimulator\\(this,_ATN,_decisionToDFA,_sharedContextCache\\)")
10044 "LexerATNSimulator(this,_ATN)"))
10045 #t))
10046 (add-before 'build 'copy-resources
10047 (lambda _
10048 (copy-recursively "runtime/Java/src/main/dot"
10049 "build/classes")
10050 #t)))))
10051 (native-inputs
10052 `(("antlr4" ,antlr4-4.1)
10053 ("java-tunnelvisionlabs-antlr4-runtime-annotations"
10054 ,java-tunnelvisionlabs-antlr4-runtime-annotations)))
10055 (properties '((hidden? . #t))))) ;for bootstrapping purposes only
10056
10057(define-public java-tunnelvisionlabs-antlr4-bootstrap
10058 (package
10059 (inherit antlr4)
10060 (name "java-tunnelvisionlabs-antlr4")
10061 (version (package-version java-tunnelvisionlabs-antlr4-runtime-annotations))
10062 (source (package-source java-tunnelvisionlabs-antlr4-runtime-annotations))
10063 (arguments
10064 (substitute-keyword-arguments (package-arguments antlr4)
10065 ((#:test-dir _)
10066 "tool/test:runtime-testsuite/src")
10067 ((#:phases phases)
10068 `(modify-phases ,phases
10069 (delete 'remove-unrelated-languages)
10070 (delete 'remove-graphemes)
10071 (delete 'generate-test-parsers)
10072 (delete 'check)))))
10073 (native-inputs '())
10074 (inputs
10075 `(("antlr3" ,antlr3)
10076 ("java-antlr4-runtime" ,java-tunnelvisionlabs-antlr4-runtime-bootstrap)
10077 ("java-tunnelvisionlabs-antlr4-runtime-annotations"
10078 ,java-tunnelvisionlabs-antlr4-runtime-annotations)
10079 ("java-icu4j" ,java-icu4j)
10080 ("java-jsonp-api" ,java-jsonp-api)
10081 ("java-stringtemplate" ,java-stringtemplate)
10082 ("java-treelayout" ,java-treelayout)
10083 ("openjdk" ,openjdk)))
10084 (properties '((hidden? . #t))))) ;for bootstrapping purposes only
10085
10086(define-public java-tunnelvisionlabs-antlr4-runtime
10087 (package
10088 (inherit java-tunnelvisionlabs-antlr4-runtime-bootstrap)
10089 (native-inputs
10090 (alist-replace
10091 "antlr4" (list java-tunnelvisionlabs-antlr4-bootstrap)
10092 (package-native-inputs
10093 java-tunnelvisionlabs-antlr4-runtime-bootstrap)))
10094 (properties
10095 (alist-delete
10096 'hidden?
10097 (package-properties java-tunnelvisionlabs-antlr4-runtime-bootstrap)))))
10098
10099(define-public java-tunnelvisionlabs-antlr4
10100 (package
10101 (inherit java-tunnelvisionlabs-antlr4-bootstrap)
10102 (inputs
10103 (alist-replace
10104 "java-antlr4-runtime" (list java-tunnelvisionlabs-antlr4-runtime)
10105 (package-inputs java-tunnelvisionlabs-antlr4-bootstrap)))
10106 (properties
10107 (alist-delete
10108 'hidden?
10109 (package-properties java-tunnelvisionlabs-antlr4-bootstrap)))))
10110
10111(define-public java-commons-cli-1.2
10112 ;; This is a bootstrap dependency for Maven2.
10113 (package
10114 (inherit java-commons-cli)
10115 (version "1.2")
10116 (source (origin
10117 (method url-fetch)
10118 (uri (string-append "mirror://apache/commons/cli/source/"
10119 "commons-cli-" version "-src.tar.gz"))
10120 (sha256
10121 (base32
10122 "0rvfgzgv2pc1m091dfj3ih9ddsjjppr1f1wf0qmc3bk6b1kwv2dm"))))
10123 (arguments
10124 `(#:jar-name "commons-cli.jar"
10125 #:phases
10126 (modify-phases %standard-phases
10127 (add-before 'check 'fix-build-xml
10128 (lambda* (#:key inputs #:allow-other-keys)
10129 (substitute* "build.xml"
10130 (("dir=\"\\$\\{test.home\\}/java\"")
10131 "dir=\"${test.home}\""))
10132 #t)))))
10133 (native-inputs
10134 (list java-junit))))
10135
10136(define-public java-microemulator-cldc
10137 (package
10138 (name "java-microemulator-cldc")
10139 (version "2.0.4")
10140 (source (origin
10141 (method url-fetch)
10142 (uri (string-append "https://github.com/barteo/microemu/archive/"
10143 "microemulator_"
10144 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
10145 version)
10146 ".tar.gz"))
10147 (file-name (string-append name "-" version ".tar.gz"))
10148 (sha256
10149 (base32
10150 "1x1apmz38gkppxnwnygwmi12j54v4p258v8ddzn6dldkk7vak1ll"))))
10151 (build-system ant-build-system)
10152 (arguments
10153 `(#:jar-name "microemulator-cldc.jar"
10154 #:source-dir "microemu-cldc/src/main/java"
10155 #:tests? #f)); Requires even older software
10156 (home-page "https://github.com/barteo/microemu")
10157 (synopsis "J2ME CLDC emulator")
10158 (description "Microemulator is a Java 2 Micro Edition (J2ME) CLDC/MIDP
10159Emulator. It demonstrates MIDlet based applications in web browser
10160applet and can be run as a standalone java application.")
10161 (license (list license:asl2.0
10162 ;; or altenatively:
10163 license:lgpl2.1+))))
10164
10165(define-public java-datanucleus-javax-persistence
10166 (package
10167 (name "java-datanucleus-javax-persistence")
10168 (version "2.2.0")
10169 (source (origin
10170 (method url-fetch)
10171 (uri (string-append "https://github.com/datanucleus/"
10172 "javax.persistence/archive/javax.persistence-"
10173 version "-release.tar.gz"))
10174 (sha256
10175 (base32
10176 "11jx0fjwgc2hhbqqgdd6m1pf2fplf9vslppygax0y1z5csnqjhpx"))))
10177 (build-system ant-build-system)
10178 (arguments
10179 `(#:jar-name "java-datanucleus-javax-persistence.jar"
10180 #:jdk ,icedtea-8
10181 #:source-dir "src/main/java"
10182 #:tests? #f)); no tests
10183 (home-page "https://github.com/datanucleus/javax.persistence")
10184 (synopsis "JPA API")
10185 (description "This package contains a clean definition of JPA API intended
10186for use with DataNucleus JPA since the JCP haven't provided an official JPA API
10187jar. See @url{http://java.net/projects/jpa-spec/downloads} for the specification
10188used to generate this API.")
10189 (license (list license:edl1.0 license:epl1.0))))
10190
10191(define-public java-osgi-cmpn
10192 (package
10193 (name "java-osgi-cmpn")
10194 (version "6.0.0")
10195 (source (origin
10196 (method url-fetch)
10197 (uri (string-append "https://repo1.maven.org/maven2/"
10198 "org/osgi/osgi.cmpn/" version "/osgi.cmpn-"
10199 version "-sources.jar"))
10200 (sha256
10201 (base32
10202 "1lmb6xyrmkqdhv1kayf0514rlwq6ypvs4m44ibrck3snp8241wys"))))
10203 (build-system ant-build-system)
10204 (arguments
10205 `(#:jar-name "osgi-cmpn.jar"
10206 #:tests? #f)); no tests
10207 (inputs
10208 `(("annotation" ,java-osgi-annotation)
10209 ("core" ,java-osgi-core)
10210 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
10211 ("microemulator" ,java-microemulator-cldc)
10212 ("servlet" ,java-classpathx-servletapi)))
10213 (home-page "https://www.osgi.org")
10214 (synopsis "Compendium specification module of OSGi framework")
10215 (description
10216 "OSGi, for Open Services Gateway initiative framework, is a module system
10217and service platform for the Java programming language. This package contains
10218the compendium specification module, providing interfaces and classes for use
10219in compiling bundles.")
10220 (license license:asl2.0)))
10221
10222(define-public java-osgi-cmpn-7.0.0
10223 ;; Upstream uses release-train tags for the monorepo; osgi.cmpn/bnd.bnd
10224 ;; emits artifact version 7.0.0 from the r7-cmpn-spec-final checkout.
10225 (let ((tag "r7-cmpn-spec-final"))
10226 (package
10227 (name "java-osgi-cmpn")
10228 (version "7.0.0")
10229 (source (origin
10230 (method git-fetch)
10231 (uri (git-reference
10232 (url "https://github.com/osgi/osgi")
10233 (commit tag)))
10234 (modules '((guix build utils)))
10235 (snippet
10236 '(begin
10237 (for-each delete-file
10238 (find-files "." "\\.jar$"))
10239 #t))
10240 (file-name (git-file-name name version))
10241 (sha256
10242 (base32
10243 "08i8d2y7awr09809qwnv7l5hzqi5di3sv21bvgrmhibm07hr4ml9"))))
10244 (build-system ant-build-system)
10245 (arguments
10246 (list
10247 #:tests? #f
10248 #:jdk openjdk9
10249 #:jar-name "osgi-cmpn.jar"
10250 #:phases
10251 #~(modify-phases %standard-phases
10252 (add-after 'unpack 'prepare-source-layout
10253 (lambda _
10254 (mkdir-p "src")
10255 (for-each
10256 (lambda (directory)
10257 (invoke "cp" "-r" (string-append directory "/.") "src/"))
10258 '("org.osgi.application/src"
10259 "org.osgi.namespace.contract/src"
10260 "org.osgi.namespace.extender/src"
10261 "org.osgi.namespace.implementation/src"
10262 "org.osgi.namespace.service/src"
10263 "org.osgi.namespace.unresolvable/src"
10264 "org.osgi.service.async/src"
10265 "org.osgi.service.application/src"
10266 "org.osgi.service.blueprint/src"
10267 "org.osgi.service.cm/src"
10268 "org.osgi.service.component/src"
10269 "org.osgi.service.component.annotations/src"
10270 "org.osgi.service.configurator/src"
10271 "org.osgi.service.coordinator/src"
10272 "org.osgi.service.deploymentadmin/src"
10273 "org.osgi.service.device/src"
10274 "org.osgi.service.dmt/src"
10275 "org.osgi.service.event/src"
10276 "org.osgi.service.http/src"
10277 "org.osgi.service.http.whiteboard/src"
10278 "org.osgi.service.io/src"
10279 "org.osgi.service.jaxrs/src"
10280 "org.osgi.service.jdbc/src"
10281 "org.osgi.service.jndi/src"
10282 "org.osgi.service.jpa/src"
10283 "org.osgi.service.log/src"
10284 "org.osgi.service.metatype/src"
10285 "org.osgi.service.metatype.annotations/src"
10286 "org.osgi.service.monitor/src"
10287 "org.osgi.service.prefs/src"
10288 "org.osgi.service.provisioning/src"
10289 "org.osgi.service.remoteserviceadmin/src"
10290 "org.osgi.service.repository/src"
10291 "org.osgi.service.rest/src"
10292 "org.osgi.service.serviceloader/src"
10293 "org.osgi.service.subsystem/src"
10294 "org.osgi.service.transaction.control/src"
10295 "org.osgi.service.upnp/src"
10296 "org.osgi.service.useradmin/src"
10297 "org.osgi.service.wireadmin/src"
10298 "org.osgi.util.converter/src"
10299 "org.osgi.util.function/src"
10300 "org.osgi.util.measurement/src"
10301 "org.osgi.util.position/src"
10302 "org.osgi.util.promise/src"
10303 "org.osgi.util.pushstream/src"
10304 "org.osgi.util.xml/src"))))
10305 (add-before 'install 'create-pom
10306 (generate-pom.xml "pom.xml" "org.osgi" "osgi.cmpn" #$version))
10307 (replace 'install (install-from-pom "pom.xml")))))
10308 (inputs
10309 (list java-osgi-annotation-8.1.0
10310 java-osgi-core-8.0.0
10311 java-classpathx-servletapi
10312 java-microemulator-cldc
10313 java-datanucleus-javax-persistence
10314 java-jaxrs-api-2))
10315 (home-page "https://www.osgi.org")
10316 (synopsis "Compendium specification module of OSGi framework")
10317 (description "OSGi, for Open Services Gateway initiative framework, is a
10318module system and service platform for the Java programming language. This
10319package contains the compendium specification module, providing interfaces
10320and classes for use in compiling bundles.")
10321 (license license:asl2.0))))
10322
10323(define-public java-felix-resolver-2
10324 (package
10325 (name "java-felix-resolver")
10326 (version "2.0.4")
10327 (source (origin
10328 (method git-fetch)
10329 (uri (git-reference
10330 (url "https://github.com/apache/felix-dev")
10331 (commit (string-append "org.apache.felix.resolver-"
10332 version))))
10333 (modules '((guix build utils)))
10334 (snippet
10335 '(begin
10336 (for-each delete-file
10337 (find-files "." "\\.jar$"))
10338 #t))
10339 (file-name (git-file-name name version))
10340 (sha256
10341 (base32
10342 "1lkwh6q58vm0inll8zaqizwfvw8d7kzaff0x6lwa17j9k91yllyf"))))
10343 (build-system ant-build-system)
10344 (arguments
10345 (list
10346 #:tests? #f
10347 #:jar-name "org.apache.felix.resolver.jar"
10348 #:source-dir "resolver/src/main/java"
10349 #:phases
10350 #~(modify-phases %standard-phases
10351 (add-before 'install 'create-pom
10352 (generate-pom.xml "pom.xml" "org.apache.felix"
10353 "org.apache.felix.resolver" #$version))
10354 (replace 'install (install-from-pom "pom.xml")))))
10355 (inputs (list java-osgi-annotation java-osgi-core))
10356 (home-page "https://felix.apache.org/")
10357 (synopsis "Apache Felix OSGi resolver")
10358 (description "Apache Felix Resolver implements the OSGi resolver
10359specification, providing dependency resolution for OSGi bundles.")
10360 (license license:asl2.0)))
10361
10362(define-public java-felix-framework-7
10363 (package
10364 (name "java-felix-framework")
10365 (version "7.0.5")
10366 (source (origin
10367 (method git-fetch)
10368 (uri (git-reference
10369 (url "https://github.com/apache/felix-dev")
10370 (commit (string-append "org.apache.felix.framework-"
10371 version))))
10372 (modules '((guix build utils)))
10373 (snippet
10374 '(begin
10375 (for-each delete-file
10376 (find-files "." "\\.jar$"))
10377 #t))
10378 (file-name (git-file-name name version))
10379 (sha256
10380 (base32
10381 "1w4kdy0m4md2j0nf3shn76v9vxvjqa9sxl4j06bk08yn9icnj72k"))))
10382 (build-system ant-build-system)
10383 (arguments
10384 (list
10385 #:tests? #f
10386 #:jar-name "org.apache.felix.framework.jar"
10387 #:source-dir "framework/src/main/java"
10388 #:phases
10389 #~(modify-phases %standard-phases
10390 (add-after 'unpack 'create-animal-sniffer-stub
10391 (lambda _
10392 ;; Felix uses this compile-time Maven annotation to suppress
10393 ;; JRE compatibility warnings. It has no runtime effect.
10394 (mkdir-p "framework/src/main/java/org/codehaus/mojo/animal_sniffer")
10395 (call-with-output-file
10396 "framework/src/main/java/org/codehaus/mojo/animal_sniffer/IgnoreJRERequirement.java"
10397 (lambda (port)
10398 (display (string-append
10399 "package org.codehaus.mojo.animal_sniffer;\n"
10400 "import java.lang.annotation.*;\n"
10401 "@Retention(RetentionPolicy.CLASS)\n"
10402 "@Target({ElementType.METHOD,"
10403 " ElementType.CONSTRUCTOR,"
10404 " ElementType.TYPE})\n"
10405 "public @interface IgnoreJRERequirement {}\n")
10406 port)))))
10407 (add-after 'build 'add-service-descriptor-and-resources
10408 (lambda _
10409 ;; Include the upstream service descriptors and resources that
10410 ;; Felix expects in the framework jar.
10411 (invoke "jar" "uf" "build/jar/org.apache.felix.framework.jar"
10412 "-C" "framework/src/main/resources" "META-INF/services")
10413 ;; Felix reads default.properties at startup to determine
10414 ;; system packages. The source file uses Maven's ${dollar}
10415 ;; placeholder, so replace it here.
10416 (substitute* "framework/src/main/resources/default.properties"
10417 (("\\$\\{dollar\\}") "$"))
10418 (invoke "jar" "uf" "build/jar/org.apache.felix.framework.jar"
10419 "-C" "framework/src/main/resources" "default.properties")
10420 ;; Compile accessor.src (a java.net.Accessor class used by
10421 ;; SecureAction to bypass access controls) and include the
10422 ;; compiled bytecode as accessor.bytes.
10423 (mkdir-p "build/accessor-src/java/net")
10424 (copy-file
10425 "framework/src/main/resources/org/apache/felix/framework/util/accessor.src"
10426 "build/accessor-src/java/net/Accessor.java")
10427 (mkdir-p "build/accessor-out")
10428 (invoke "javac"
10429 "-d" "build/accessor-out"
10430 "build/accessor-src/java/net/Accessor.java")
10431 (copy-file "build/accessor-out/java/net/Accessor.class"
10432 "build/accessor.bytes")
10433 (invoke "jar" "uf" "build/jar/org.apache.felix.framework.jar"
10434 "-C" "build"
10435 "accessor.bytes")))
10436 (add-after 'add-service-descriptor-and-resources
10437 'fix-accessor-path
10438 (lambda _
10439 ;; accessor.bytes must be at
10440 ;; org/apache/felix/framework/util/accessor.bytes
10441 (let ((jar "build/jar/org.apache.felix.framework.jar"))
10442 (mkdir-p "build/accessor-pkg/org/apache/felix/framework/util")
10443 (copy-file "build/accessor.bytes"
10444 "build/accessor-pkg/org/apache/felix/framework/util/accessor.bytes")
10445 (invoke "jar" "uf" jar
10446 "-C" "build/accessor-pkg"
10447 "org/apache/felix/framework/util/accessor.bytes"))))
10448 (add-before 'install 'create-pom
10449 (generate-pom.xml "pom.xml" "org.apache.felix"
10450 "org.apache.felix.framework" #$version))
10451 (replace 'install (install-from-pom "pom.xml")))))
10452 (inputs (list java-osgi-annotation-8.1.0
10453 java-osgi-core-8.0.0
10454 java-felix-resolver-2))
10455 (home-page "https://felix.apache.org/")
10456 (synopsis "Apache Felix OSGi framework")
10457 (description "Apache Felix is a community effort to implement the OSGi
10458Framework and Service platform.")
10459 (license license:asl2.0)))
10460
10461(define-public java-felix-main-7.0.5
10462 (package
10463 (name "java-felix-main")
10464 (version "7.0.5")
10465 (source (origin
10466 (method git-fetch)
10467 (uri (git-reference
10468 (url "https://github.com/apache/felix-dev")
10469 (commit (string-append "org.apache.felix.main-"
10470 version))))
10471 (modules '((guix build utils)))
10472 (snippet
10473 '(begin
10474 (for-each delete-file
10475 (find-files "." "\\.jar$"))
10476 #t))
10477 (file-name (git-file-name name version))
10478 (sha256
10479 (base32
10480 "04miqvr8lqng4a0n6zry8rary8hrcbrq41652adyz85znmcp1z59"))))
10481 (build-system ant-build-system)
10482 (arguments
10483 (list
10484 #:tests? #f
10485 #:jar-name "org.apache.felix.main.jar"
10486 #:source-dir "main/src/main/java"
10487 #:phases
10488 #~(modify-phases %standard-phases
10489 (add-after 'build 'create-uber-jar
10490 (lambda* (#:key inputs #:allow-other-keys)
10491 ;; org.apache.felix.main is an uber jar combining framework,
10492 ;; resolver, and osgi-core classes with Main and AutoProcessor.
10493 (let ((jar (canonicalize-path
10494 "build/jar/org.apache.felix.main.jar"))
10495 (work-dir (mkdtemp "/tmp/felix-merge-XXXXXX")))
10496 (with-directory-excursion work-dir
10497 (for-each
10498 (lambda (input-name)
10499 (for-each
10500 (lambda (dep-jar)
10501 (invoke "jar" "xf" dep-jar))
10502 (find-files (assoc-ref inputs input-name)
10503 "\\.jar$")))
10504 '("java-felix-framework"
10505 "java-felix-resolver"
10506 "java-osgi-core"))
10507 ;; Remove metadata that would conflict with the
10508 ;; main jar's own manifest.
10509 (when (file-exists? "META-INF/MANIFEST.MF")
10510 (delete-file "META-INF/MANIFEST.MF"))
10511 (when (file-exists? "META-INF/maven")
10512 (delete-file-recursively "META-INF/maven"))
10513 (invoke "jar" "uf" jar "-C" work-dir ".")))))
10514 (add-after 'create-uber-jar 'add-service-descriptor
10515 (lambda _
10516 (let ((jar "build/jar/org.apache.felix.main.jar"))
10517 (mkdir-p "META-INF/services")
10518 (call-with-output-file
10519 "META-INF/services/org.osgi.framework.launch.FrameworkFactory"
10520 (lambda (port)
10521 (display
10522 "org.apache.felix.framework.FrameworkFactory\n" port)))
10523 (invoke "jar" "uf" jar "-C" "." "META-INF/services"))))
10524 (add-before 'install 'create-pom
10525 (generate-pom.xml "pom.xml" "org.apache.felix"
10526 "org.apache.felix.main" #$version))
10527 (replace 'install (install-from-pom "pom.xml")))))
10528 (inputs (list java-felix-framework-7
10529 java-felix-resolver-2
10530 java-osgi-core-8.0.0))
10531 (home-page "https://felix.apache.org/")
10532 (synopsis "Apache Felix Main distribution jar")
10533 (description "Apache Felix Main is the standard distribution jar for
10534the Apache Felix OSGi framework. It bundles the framework, resolver, and
10535OSGi core classes into a single jar with a standalone launcher.")
10536 (license license:asl2.0)))
10537
10538(define-public java-osgi-service-component-annotations
10539 (package
10540 (name "java-osgi-service-component-annotations")
10541 (version "1.3.0")
10542 (source (origin
10543 (method url-fetch)
10544 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10545 "org.osgi.service.component.annotations/"
10546 version "/org.osgi.service.component.annotations-"
10547 version "-sources.jar"))
10548 (sha256
10549 (base32
10550 "15rq9cmp4fpn74q44m4j35qsqmjf5lx3hcrk6pzvbhc08igic2f0"))))
10551 (build-system ant-build-system)
10552 (arguments
10553 `(#:jar-name "osgi-service-component-annotations.jar"
10554 #:tests? #f)); no tests
10555 (inputs
10556 `(("annotation" ,java-osgi-annotation)))
10557 (home-page "https://www.osgi.org")
10558 (synopsis "Support annotations for osgi-service-component")
10559 (description
10560 "OSGi, for Open Services Gateway initiative framework, is a module system
10561and service platform for the Java programming language. This package contains
10562the support annotations for osgi-service-component.")
10563 (license license:asl2.0)))
10564
10565(define-public java-osgi-dto
10566 (package
10567 (name "java-osgi-dto")
10568 (version "1.0.0")
10569 (source (origin
10570 (method url-fetch)
10571 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10572 "org.osgi.dto/" version "/org.osgi.dto-"
10573 version "-sources.jar"))
10574 (sha256
10575 (base32
10576 "0f4bqjzadn0hwk6sd3h5gvbyfp3yci1s6r0v770cc15p0pg627yr"))))
10577 (build-system ant-build-system)
10578 (arguments
10579 `(#:jar-name "osgi-dto.jar"
10580 #:tests? #f)); no tests
10581 (inputs
10582 `(("annotation" ,java-osgi-annotation)))
10583 (home-page "https://www.osgi.org")
10584 (synopsis "Data Transfer Objects")
10585 (description
10586 "OSGi, for Open Services Gateway initiative framework, is a module system
10587and service platform for the Java programming language. This package contains
10588the Data Transfer Objects. It is easily serializable having only public fields
10589of primitive types and their wrapper classes, Strings, and DTOs. List, Set,
10590Map and array aggregates may also be used. The aggregates must only hold
10591objects of the listed types or aggregates.")
10592 (license license:asl2.0)))
10593
10594(define-public java-osgi-resource
10595 (package
10596 (name "java-osgi-resource")
10597 (version "1.0.0")
10598 (source (origin
10599 (method url-fetch)
10600 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10601 "org.osgi.resource/"
10602 version "/org.osgi.resource-"
10603 version "-sources.jar"))
10604 (sha256
10605 (base32
10606 "0hi0fsc5v99q22bd7lrkvpz1y0ds4w9arjldpwsrcpqvz2js7q2d"))))
10607 (build-system ant-build-system)
10608 (arguments
10609 `(#:jar-name "osgi-resource.jar"
10610 #:tests? #f)); no tests
10611 (inputs
10612 `(("annotation" ,java-osgi-annotation)
10613 ("dto" ,java-osgi-dto)))
10614 (home-page "https://www.osgi.org")
10615 (synopsis "OSGI Resource")
10616 (description
10617 "OSGi, for Open Services Gateway initiative framework, is a module system
10618and service platform for the Java programming language. This package contains
10619the definition of common types in osgi packages.")
10620 (license license:asl2.0)))
10621
10622(define-public java-osgi-namespace-contract
10623 (package
10624 (name "java-osgi-namespace-contract")
10625 (version "1.0.0")
10626 (source (origin
10627 (method url-fetch)
10628 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10629 "org.osgi.namespace.contract/"
10630 version "/org.osgi.namespace.contract-"
10631 version "-sources.jar"))
10632 (sha256
10633 (base32
10634 "1iz4f2i0fvqrlq90ki9nfzcfpvy2av434ri25bglywqssx8mmp36"))))
10635 (build-system ant-build-system)
10636 (inputs
10637 `(("resource" ,java-osgi-resource)
10638 ("annotation" ,java-osgi-annotation)))
10639 (arguments
10640 `(#:jar-name "osgi-namespace-contract.jar"
10641 #:tests? #f)); no tests
10642 (home-page "https://www.osgi.org")
10643 (synopsis "Contract Capability and Requirement Namespace")
10644 (description
10645 "OSGi, for Open Services Gateway initiative framework, is a module system
10646and service platform for the Java programming language. This package contains
10647the names for the attributes and directives for a namespace with contracts.")
10648 (license license:asl2.0)))
10649
10650(define-public java-osgi-namespace-extender
10651 (package
10652 (name "java-osgi-namespace-extender")
10653 (version "1.0.1")
10654 (source (origin
10655 (method url-fetch)
10656 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10657 "org.osgi.namespace.extender/"
10658 version "/org.osgi.namespace.extender-"
10659 version "-sources.jar"))
10660 (sha256
10661 (base32
10662 "0jgqiak2i05qv6j3gd33xlaifzzc0ylxxk376v2x0apfg3vvixmz"))))
10663 (build-system ant-build-system)
10664 (inputs
10665 `(("resource" ,java-osgi-resource)
10666 ("annotation" ,java-osgi-annotation)))
10667 (arguments
10668 `(#:jar-name "osgi-namespace-extendent.jar"
10669 #:tests? #f)); no tests
10670 (home-page "https://www.osgi.org")
10671 (synopsis "Extender Capability and Requirement Namespace")
10672 (description
10673 "OSGi, for Open Services Gateway initiative framework, is a module system
10674and service platform for the Java programming language. This package contains
10675the names for the attributes and directives for an extender namespace.")
10676 (license license:asl2.0)))
10677
10678(define-public java-osgi-namespace-service
10679 (package
10680 (name "java-osgi-namespace-service")
10681 (version "1.0.0")
10682 (source (origin
10683 (method url-fetch)
10684 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10685 "org.osgi.namespace.service/"
10686 version "/org.osgi.namespace.service-"
10687 version "-sources.jar"))
10688 (sha256
10689 (base32
10690 "0qmw8n2449nkmm56d1znz9zhazb6ya3vsimd5bf5jg23zzhgl8c8"))))
10691 (build-system ant-build-system)
10692 (inputs
10693 `(("resource" ,java-osgi-resource)
10694 ("annotation" ,java-osgi-annotation)))
10695 (arguments
10696 `(#:jar-name "osgi-namespace-service.jar"
10697 #:tests? #f)); no tests
10698 (home-page "https://www.osgi.org")
10699 (synopsis "Service Capability and Requirement Namespace")
10700 (description
10701 "OSGi, for Open Services Gateway initiative framework, is a module system
10702and service platform for the Java programming language. This package contains
10703the names for the attributes and directives for a service namespace.")
10704 (license license:asl2.0)))
10705
10706(define-public java-osgi-util-function
10707 (package
10708 (name "java-osgi-util-function")
10709 (version "1.0.0")
10710 (source (origin
10711 (method url-fetch)
10712 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10713 "org.osgi.util.function/"
10714 version "/org.osgi.util.function-"
10715 version "-sources.jar"))
10716 (sha256
10717 (base32
10718 "04l7j3hwmmj28w23m7paca0afzncs42j2mdr3liqq8kvp548sc6x"))))
10719 (build-system ant-build-system)
10720 (arguments
10721 `(#:jar-name "osgi-util-function.jar"
10722 #:tests? #f)); no tests
10723 (inputs
10724 `(("annotation" ,java-osgi-annotation)))
10725 (home-page "https://www.osgi.org")
10726 (synopsis "OSGI Util Function")
10727 (description
10728 "OSGi, for Open Services Gateway initiative framework, is a module system
10729and service platform for the Java programming language. This package contains
10730an interface for a function that accepts a single argument and produces a result.")
10731 (license license:asl2.0)))
10732
10733(define-public java-osgi-util-promise
10734 (package
10735 (name "java-osgi-util-promise")
10736 (version "1.0.0")
10737 (source (origin
10738 (method url-fetch)
10739 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10740 "org.osgi.util.promise/"
10741 version "/org.osgi.util.promise-"
10742 version "-sources.jar"))
10743 (sha256
10744 (base32
10745 "0y34dwiflg1c4ahvkswpf9z02xph2sr9fm04ia5493x3lshpw22c"))))
10746 (build-system ant-build-system)
10747 (arguments
10748 `(#:jar-name "osgi-util-promise.jar"
10749 #:tests? #f)); no tests
10750 (inputs
10751 `(("annotation" ,java-osgi-annotation)
10752 ("function" ,java-osgi-util-function)))
10753 (home-page "https://www.osgi.org")
10754 (synopsis "Promise of a value")
10755 (description
10756 "OSGi, for Open Services Gateway initiative framework, is a module system
10757and service platform for the Java programming language. This package contains
10758an interface and utilitary classes for promises. A Promise represents a future
10759value. It handles the interactions for asynchronous processing.")
10760 (license license:asl2.0)))
10761
10762(define-public java-osgi-service-metatype-annotations
10763 (package
10764 (name "java-osgi-service-metatype-annotations")
10765 (version "1.3.0")
10766 (source (origin
10767 (method url-fetch)
10768 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10769 "org.osgi.service.metatype.annotations/"
10770 version "/org.osgi.service.metatype.annotations-"
10771 version "-sources.jar"))
10772 (sha256
10773 (base32
10774 "12rwm3349wk80vm88rcdgs4435m4jxkpkj5mrx326skkz2c6hyw6"))))
10775 (build-system ant-build-system)
10776 (arguments
10777 `(#:jar-name "osgi-service-metatype-annotations.jar"
10778 #:tests? #f)); no tests
10779 (inputs
10780 `(("annotation" ,java-osgi-annotation)))
10781 (home-page "https://www.osgi.org")
10782 (synopsis "Support annotations for metatype")
10783 (description
10784 "OSGi, for Open Services Gateway initiative framework, is a module system
10785and service platform for the Java programming language. This package contains
10786the support annotations for metatype.")
10787 (license license:asl2.0)))
10788
10789(define-public java-osgi-service-repository
10790 (package
10791 (name "java-osgi-service-repository")
10792 (version "1.1.0")
10793 (source (origin
10794 (method url-fetch)
10795 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10796 "org.osgi.service.repository/"
10797 version "/org.osgi.service.repository-"
10798 version "-sources.jar"))
10799 (sha256
10800 (base32
10801 "1k41mhg7b58pd8nsghr2qwcjrxdnf1p9spsw9v11k4257g6rl06n"))))
10802 (build-system ant-build-system)
10803 (arguments
10804 `(#:jar-name "osgi-service-repository.jar"
10805 #:tests? #f)); no tests
10806 (inputs
10807 `(("annotation" ,java-osgi-annotation)
10808 ("promise" ,java-osgi-util-promise)
10809 ("resource" ,java-osgi-resource)))
10810 (home-page "https://www.osgi.org")
10811 (synopsis "OSGI service repository")
10812 (description
10813 "OSGi, for Open Services Gateway initiative framework, is a module system
10814and service platform for the Java programming language. This package contains
10815a repository service that contains resources.")
10816 (license license:asl2.0)))
10817
10818(define-public java-osgi-framework
10819 (package
10820 (name "java-osgi-framework")
10821 (version "1.8.0")
10822 (source (origin
10823 (method url-fetch)
10824 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10825 "org.osgi.framework/" version "/org.osgi.framework-"
10826 version "-sources.jar"))
10827 (sha256
10828 (base32
10829 "1lwp2zfad3rybcc6q9bwz8xsgkc92ypzy5p6x54387f1qj65m73s"))))
10830 (build-system ant-build-system)
10831 (arguments
10832 `(#:jar-name "osgi-framework.jar"
10833 #:tests? #f)); no tests
10834 (inputs
10835 `(("annotation" ,java-osgi-annotation)
10836 ("resource" ,java-osgi-resource)
10837 ("dto" ,java-osgi-dto)))
10838 (home-page "https://www.osgi.org")
10839 (synopsis "OSGi framework")
10840 (description
10841 "OSGi, for Open Services Gateway initiative framework, is a module system
10842and service platform for the Java programming language.")
10843 (license license:asl2.0)))
10844
10845(define-public java-osgi-service-log
10846 (package
10847 (name "java-osgi-service-log")
10848 (version "1.3.0")
10849 (source (origin
10850 (method url-fetch)
10851 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10852 "org.osgi.service.log/"
10853 version "/org.osgi.service.log-"
10854 version "-sources.jar"))
10855 (sha256
10856 (base32
10857 "1029j30dzcwializzca0j3fkhwwz08kmmsha5agw1iccscimj6r0"))))
10858 (build-system ant-build-system)
10859 (arguments
10860 `(#:jar-name "osgi-service-log.jar"
10861 #:tests? #f)); no tests
10862 (inputs
10863 (list java-osgi-framework))
10864 (home-page "https://www.osgi.org")
10865 (synopsis "Provides methods for bundles to write messages to the log")
10866 (description
10867 "OSGi, for Open Services Gateway initiative framework, is a module system
10868and service platform for the Java programming language. This package contains
10869the log service.")
10870 (license license:asl2.0)))
10871
10872(define-public java-osgi-service-jdbc
10873 (package
10874 (name "java-osgi-service-jdbc")
10875 (version "1.0.0")
10876 (source (origin
10877 (method url-fetch)
10878 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10879 "org.osgi.service.jdbc/"
10880 version "/org.osgi.service.jdbc-"
10881 version "-sources.jar"))
10882 (sha256
10883 (base32
10884 "11iln5v7bk469cgb9ddkrz9sa95b3733gqgaqw9xf5g6wq652yjz"))))
10885 (build-system ant-build-system)
10886 (arguments
10887 `(#:jar-name "osgi-service-jdbc.jar"
10888 #:tests? #f)); no tests
10889 (home-page "https://www.osgi.org")
10890 (synopsis "Factory for JDBC connection factories")
10891 (description
10892 "OSGi, for Open Services Gateway initiative framework, is a module system
10893and service platform for the Java programming language. This package contains
10894a factory for JDBC connection factories. There are 3 preferred connection
10895factories for getting JDBC connections:
10896
10897@itemize
10898@item @code{javax.sql.DataSource};
10899@item @code{javax.sql.ConnectionPoolDataSource};
10900@item @code{javax.sql.XADataSource}.
10901@end itemize")
10902 (license license:asl2.0)))
10903
10904(define-public java-osgi-service-resolver
10905 (package
10906 (name "java-osgi-service-resolver")
10907 (version "1.0.1")
10908 (source (origin
10909 (method url-fetch)
10910 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10911 "org.osgi.service.resolver/"
10912 version "/org.osgi.service.resolver-"
10913 version "-sources.jar"))
10914 (sha256
10915 (base32
10916 "1dzqn1ryfi2rq4zwsgp44bmj2wlfydjg1qbxw2b0z4xdjjy55vxd"))))
10917 (build-system ant-build-system)
10918 (arguments
10919 `(#:jar-name "osgi-service-resolver.jar"
10920 #:tests? #f)); no tests
10921 (inputs
10922 `(("annotation" ,java-osgi-annotation)
10923 ("resource" ,java-osgi-resource)))
10924 (home-page "https://www.osgi.org")
10925 (synopsis "OSGI Resolver service")
10926 (description
10927 "OSGi, for Open Services Gateway initiative framework, is a module system
10928and service platform for the Java programming language. This package contains
10929a resolver service that resolves the specified resources in the context supplied
10930by the caller.")
10931 (license license:asl2.0)))
10932
10933(define-public java-osgi-util-tracker
10934 (package
10935 (name "java-osgi-util-tracker")
10936 (version "1.5.1")
10937 (source (origin
10938 (method url-fetch)
10939 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10940 "org.osgi.util.tracker/"
10941 version "/org.osgi.util.tracker-"
10942 version "-sources.jar"))
10943 (sha256
10944 (base32
10945 "0c4fh9vxwzsx59r8dygda0gq2gx3z5vfhc3jsphlqwf5w0h403lz"))))
10946 (build-system ant-build-system)
10947 (arguments
10948 `(#:jar-name "osgi-util-tracker.jar"
10949 #:tests? #f)); no tests
10950 (inputs
10951 `(("framework" ,java-osgi-framework)
10952 ("annotation" ,java-osgi-annotation)))
10953 (home-page "https://www.osgi.org")
10954 (synopsis "Bundle tracking")
10955 (description
10956 "OSGi, for Open Services Gateway initiative framework, is a module system
10957and service platform for the Java programming language. This package contains
10958bundle tracking utility classes.")
10959 (license license:asl2.0)))
10960
10961(define-public java-osgi-service-cm
10962 (package
10963 (name "java-osgi-service-cm")
10964 (version "1.5.0")
10965 (source (origin
10966 (method url-fetch)
10967 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10968 "org.osgi.service.cm/"
10969 version "/org.osgi.service.cm-"
10970 version "-sources.jar"))
10971 (sha256
10972 (base32
10973 "1z8kap48y3xi0ggj8v6czglfnpnd94mmismgi2wbqhj1nl5fzbp6"))))
10974 (build-system ant-build-system)
10975 (arguments
10976 `(#:jar-name "osgi-service-cm.jar"
10977 #:tests? #f)); no tests
10978 (inputs
10979 `(("framework" ,java-osgi-framework)
10980 ("annotation" ,java-osgi-annotation)))
10981 (home-page "https://www.osgi.org")
10982 (synopsis "OSGI Configuration Management")
10983 (description
10984 "OSGi, for Open Services Gateway initiative framework, is a module system
10985and service platform for the Java programming language. This package contains
10986utility classes for the configuration of services.")
10987 (license license:asl2.0)))
10988
10989(define-public java-osgi-service-packageadmin
10990 (package
10991 (name "java-osgi-service-packageadmin")
10992 (version "1.2.0")
10993 (source (origin
10994 (method url-fetch)
10995 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10996 "org.osgi.service.packageadmin/"
10997 version "/org.osgi.service.packageadmin-"
10998 version "-sources.jar"))
10999 (sha256
11000 (base32
11001 "041mpxzi7g36wmcily6y4ccn3jx15akpdy8gmhyb7m98x7qfvn52"))))
11002 (build-system ant-build-system)
11003 (arguments
11004 `(#:jar-name "osgi-service-packageadmin.jar"
11005 #:tests? #f)); no tests
11006 (inputs
11007 `(("framework" ,java-osgi-framework)))
11008 (home-page "https://www.osgi.org")
11009 (synopsis "OSGI Package Administration")
11010 (description
11011 "OSGi, for Open Services Gateway initiative framework, is a module system
11012and service platform for the Java programming language. This package contains
11013the packageadmin service.")
11014 (license license:asl2.0)))
11015
11016(define-public java-ops4j-base-lang
11017 (package
11018 (name "java-ops4j-base-lang")
11019 (version "1.5.0")
11020 (source (origin
11021 (method url-fetch)
11022 (uri (string-append "https://github.com/ops4j/org.ops4j.base/"
11023 "archive/base-" version ".tar.gz"))
11024 (sha256
11025 (base32
11026 "18hl3lpchgpv8yh5rlk39l2gif5dlfgb8gxjmncf39pr2dprkniw"))))
11027 (build-system ant-build-system)
11028 (arguments
11029 `(#:jar-name "java-ops4j-base-lang.jar"
11030 #:source-dir "ops4j-base-lang/src/main/java"
11031 #:tests? #f; no tests
11032 #:phases
11033 (modify-phases %standard-phases
11034 (add-before 'build 'add-test-file
11035 (lambda _
11036 ;; That file is required by a test in ops4j-pax-exam-core-spi
11037 (mkdir-p "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang")
11038 (with-output-to-file "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang/pom.properties"
11039 (lambda _
11040 (display
11041 (string-append
11042 "version=" ,version "\n"
11043 "groupId=org.ops4j.base"
11044 "artifactId=ops4j-base-lang\n"))))
11045 #t)))))
11046 (home-page "https://ops4j1.jira.com/wiki/spaces/base/overview")
11047 (synopsis "Utility classes and extensions to be used in OPS4J projects")
11048 (description "OPS4J stands for Open Participation Software for Java. This
11049package contains utilities and extensions related to @code{java.lang}.")
11050 (license license:asl2.0)))
11051
11052(define-public java-ops4j-base-monitors
11053 (package
11054 (inherit java-ops4j-base-lang)
11055 (name "java-ops4j-base-monitors")
11056 (arguments
11057 `(#:jar-name "java-ops4j-base-monitors.jar"
11058 #:source-dir "ops4j-base-monitors/src/main/java"
11059 #:tests? #f)); no tests
11060 (inputs
11061 `(("lang" ,java-ops4j-base-lang)))
11062 (description "OPS4J stands for Open Participation Software for Java. This
11063package contains utilities and extensions related to monitoring.")))
11064
11065(define-public java-ops4j-base-io
11066 (package
11067 (inherit java-ops4j-base-lang)
11068 (name "java-ops4j-base-io")
11069 (arguments
11070 `(#:jar-name "java-ops4j-base-io.jar"
11071 #:source-dir "ops4j-base-io/src/main/java"
11072 #:test-dir "ops4j-base-io/src/test"
11073 #:test-exclude
11074 (list "**/ListerTest.java")))
11075 (inputs
11076 `(("lang" ,java-ops4j-base-monitors)
11077 ("lang" ,java-ops4j-base-lang)))
11078 (native-inputs
11079 `(("junit" ,java-junit)
11080 ("hamcrest" ,java-hamcrest-core)))
11081 (description "OPS4J stands for Open Participation Software for Java. This
11082package contains utilities and extensions related to handling streams and files.")))
11083
11084(define-public java-ops4j-base-util
11085 (package
11086 (inherit java-ops4j-base-lang)
11087 (name "java-ops4j-base-util")
11088 (arguments
11089 `(#:jar-name "java-ops4j-base-util.jar"
11090 #:source-dir "ops4j-base-util/src/main/java"
11091 #:test-dir "ops4j-base-util/src/test"))
11092 (inputs
11093 `(("lang" ,java-ops4j-base-lang)))
11094 (native-inputs
11095 `(("junit" ,java-junit)))
11096 (description "OPS4J stands for Open Participation Software for Java. This
11097package contains utilities and extensions related to environment, i18n and
11098mime types.")))
11099
11100(define-public java-ops4j-base-util-property
11101 (package
11102 (inherit java-ops4j-base-lang)
11103 (name "java-ops4j-base-util-property")
11104 (arguments
11105 `(#:jar-name "java-ops4j-base-util-property.jar"
11106 #:source-dir "ops4j-base-util-property/src/main/java"
11107 #:tests? #f)); no tests
11108 (inputs
11109 `(("lang" ,java-ops4j-base-lang)
11110 ("util" ,java-ops4j-base-util)))
11111 (description "OPS4J stands for Open Participation Software for Java. This
11112package contains utilities and extensions related to resolving properties from
11113different sources.")))
11114
11115(define-public java-ops4j-base-store
11116 (package
11117 (inherit java-ops4j-base-lang)
11118 (name "java-ops4j-base-store")
11119 (arguments
11120 `(#:jar-name "java-ops4j-base-store.jar"
11121 #:source-dir "ops4j-base-store/src/main/java"
11122 #:tests? #f)); no tests
11123 (inputs
11124 `(("lang" ,java-ops4j-base-lang)
11125 ("slf4j" ,java-slf4j-api)
11126 ("io" ,java-ops4j-base-io)))
11127 (description "OPS4J stands for Open Participation Software for Java. This
11128package contains utilities for storing and retrieving data from an
11129@code{InputStream}.")))
11130
11131(define-public java-ops4j-base-spi
11132 (package
11133 (inherit java-ops4j-base-lang)
11134 (name "java-ops4j-base-spi")
11135 (arguments
11136 `(#:jar-name "java-ops4j-base-spi.jar"
11137 #:source-dir "ops4j-base-spi/src/main/java"
11138 #:test-dir "ops4j-base-spi/src/test"))
11139 (native-inputs
11140 `(("junit" ,java-junit)
11141 ("hamcrest" ,java-hamcrest-core)))
11142 (description "OPS4J stands for Open Participation Software for Java. This
11143package contains utilities for obtaining services via the Java SE 6
11144@code{ServiceLoader}.")))
11145
11146(define-public java-aqute-bnd-annotation
11147 (package
11148 (name "java-aqute-bnd-annotation")
11149 (version "3.5.0")
11150 (source (origin
11151 (method url-fetch)
11152 (uri (string-append "https://github.com/bndtools/bnd/archive/"
11153 version ".REL.tar.gz"))
11154 (file-name (string-append name "-" version ".tar.gz"))
11155 (sha256
11156 (base32
11157 "1ggyiq0as0f6cz333a0dh98j72kmvv5pf2s47v9554yh905lfqdl"))))
11158 (build-system ant-build-system)
11159 (arguments
11160 `(#:jar-name "java-aqute-bnd-annotation.jar"
11161 #:source-dir "biz.aQute.bnd.annotation/src"
11162 #:tests? #f)); empty test dir
11163 (home-page "https://bnd.bndtools.org/")
11164 (synopsis "Tools for OSGi")
11165 (description "Bnd is a swiss army knife for OSGi, it creates manifest
11166headers based on analyzing the class code, it verifies the project settings,
11167it manages project dependencies, gives diffs jars, and much more.")
11168 (license license:asl2.0)))
11169
11170(define-public java-aqute-libg
11171 (package
11172 (inherit java-aqute-bnd-annotation)
11173 (name "java-aqute-libg")
11174 (arguments
11175 `(#:jar-name "java-aqute-libg.jar"
11176 ;; The build fails when source/target more recent than 1.7. This
11177 ;; is a known issue. See: https://github.com/bndtools/bnd/issues/1327
11178 ;;
11179 ;; It is closed as won't fix. There is no way to change the source
11180 ;; so that it works on 1.8, and still works on 1.6, the upstream
11181 ;; target. It work fine on 1.7, so we use 1.7.
11182 #:make-flags (list "-Dant.build.javac.source=1.7"
11183 "-Dant.build.javac.target=1.7")
11184 #:phases
11185 (modify-phases %standard-phases
11186 (add-before 'configure 'chdir
11187 ;; Change to aQute.libg directory, so that the relative
11188 ;; paths in the tests aren't broken.
11189 (lambda _
11190 (chdir "aQute.libg")
11191 #t))
11192 (add-before 'check 'create-test-directory
11193 ;; Copy the test directory to test/java, since that's where
11194 ;; ant-build-system's default project in build.xml expects to find
11195 ;; the test classes. Leave a copy in the original place to not
11196 ;; break paths in tests.
11197 (lambda _
11198 (mkdir "src/test")
11199 (copy-recursively "test" "src/test/java")
11200 #t)))))
11201 (inputs
11202 `(("slf4j" ,java-slf4j-api)
11203 ("osgi-annot" ,java-osgi-annotation)
11204 ("java-osgi-cmpn" ,java-osgi-cmpn)
11205 ("osgi" ,java-osgi-core)))
11206 (native-inputs
11207 `(("hamcrest" ,java-hamcrest-core)
11208 ("java-junit" ,java-junit)))))
11209
11210(define-public java-aqute-bndlib
11211 (package
11212 (inherit java-aqute-bnd-annotation)
11213 (name "java-aqute-bndlib")
11214 (arguments
11215 `(#:jar-name "java-bndlib.jar"
11216 #:source-dir "biz.aQute.bndlib/src"
11217 #:tests? #f)); no tests
11218 (inputs
11219 `(("slf4j" ,java-slf4j-api)
11220 ("osgi-annot" ,java-osgi-annotation)
11221 ("java-aqute-libg" ,java-aqute-libg)
11222 ("java-aqute-bnd-annotation" ,java-aqute-bnd-annotation)
11223 ("java-osgi-service-component-annotations" ,java-osgi-service-component-annotations)
11224 ("java-osgi-service-repository" ,java-osgi-service-repository)
11225 ("java-osgi-service-log" ,java-osgi-service-log)
11226 ("java-osgi-service-metatype-annotations" ,java-osgi-service-metatype-annotations)
11227 ("java-osgi-namespace-contract" ,java-osgi-namespace-contract)
11228 ("java-osgi-namespace-extender" ,java-osgi-namespace-extender)
11229 ("java-osgi-namespace-service" ,java-osgi-namespace-service)
11230 ("promise" ,java-osgi-util-promise)
11231 ("osgi" ,java-osgi-core)))))
11232
11233(define-public java-ops4j-pax-tinybundles
11234 (package
11235 (name "java-ops4j-pax-tinybundles")
11236 (version "2.1.1")
11237 (source (origin
11238 (method url-fetch)
11239 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.tinybundles/"
11240 "archive/tinybundles-" version ".tar.gz"))
11241 (sha256
11242 (base32
11243 "0y0gq3pvv0iir2b885lmlwnvr724vv7vklzhhr4fs27d7mdkj871"))))
11244 (arguments
11245 `(#:jar-name "java-ops4j-pax-tinybundles.jar"
11246 #:source-dir "src/main/java"
11247 #:test-exclude
11248 ;; Abstract base classes for other tests
11249 (list "**/BndTest.java" "**/CoreTest.java")
11250 #:phases
11251 (modify-phases %standard-phases
11252 (add-before 'check 'fix-version
11253 (lambda _
11254 ;; This test has a reference to an old version of bndlib we are not
11255 ;; packaging. It uses the version referenced in pom.xml. We replace
11256 ;; it with our own version.
11257 (substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
11258 (("[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*")
11259 ,(package-version java-aqute-bndlib)))
11260 #t)))))
11261 (inputs
11262 `(("lang" ,java-ops4j-base-lang)
11263 ("io" ,java-ops4j-base-io)
11264 ("store" ,java-ops4j-base-store)
11265 ("slf4j" ,java-slf4j-api)
11266 ("libg" ,java-aqute-libg)
11267 ("bndlib" ,java-aqute-bndlib)))
11268 (native-inputs
11269 `(("junit" ,java-junit)
11270 ("hamcrest" ,java-hamcrest-core)
11271 ("log4j" ,java-log4j-api)
11272 ("bndannotation" ,java-aqute-bnd-annotation)
11273 ("framework" ,java-osgi-framework)))
11274 (build-system ant-build-system)
11275 (home-page "https://ops4j1.jira.com/wiki/spaces/ops4j/pages/12060312/Tinybundles")
11276 (synopsis "Java APIs to create OSGi related artifacts")
11277 (description "Tinybundles is all about creating OSGi related artifacts like
11278Bundles, Fragments and Deployment Packages with Java Api. It is very convenient
11279to create such artifacts on-the-fly inside Tests (like in Pax Exam). On the
11280other hand, this library can be a foundation of real end user tools that need
11281to create those artifacts.")
11282 (license license:asl2.0)))
11283
11284(define-public java-ops4j-pax-exam-core
11285 (package
11286 (name "java-ops4j-pax-exam-core")
11287 (version "4.11.0")
11288 (source (origin
11289 (method url-fetch)
11290 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.exam2/"
11291 "archive/exam-reactor-" version ".tar.gz"))
11292 (sha256
11293 (base32
11294 "1b0f89gawxyl0pkqx9sicp6n58pirkzhjw41y749bwrkb6h99i26"))))
11295 (arguments
11296 (list #:jar-name "java-ops4j-pax-exam-core.jar"
11297 #:source-dir "core/pax-exam/src/main/java"
11298 #:test-dir "core/pax-exam/src/test"))
11299 (inputs
11300 (list java-slf4j-api
11301 java-ops4j-base-lang
11302 java-ops4j-base-io
11303 java-ops4j-base-util-property
11304 java-ops4j-base-store
11305 java-osgi-core))
11306 (native-inputs
11307 (list java-junit
11308 java-hamcrest-core))
11309 (build-system ant-build-system)
11310 (home-page "https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/overview")
11311 (synopsis "In-Container Testing for OSGi, Java EE and CDI")
11312 (description "Pax Exam creates OSGi bundles for testing purposes. It lets
11313the user take control of the OSGi framework, the test framework (e.g. JUnit) and
11314the system under test at the same time.")
11315 (license license:asl2.0)))
11316
11317(define-public java-ops4j-pax-exam-core-spi
11318 (package
11319 (inherit java-ops4j-pax-exam-core)
11320 (name "java-ops4j-pax-exam-core-spi")
11321 (arguments
11322 `(#:jar-name "java-ops4j-pax-exam-spi.jar"
11323 #:source-dir "src/main/java"
11324 #:test-exclude
11325 (list
11326 ;; Abstract base class, not a test
11327 "**/BaseStagedReactorTest.java"
11328 ;; Depends on org.mortbay.jetty.testwars:test-war-dump
11329 "**/WarBuilderTest.java")
11330 #:phases
11331 (modify-phases %standard-phases
11332 (add-before 'configure 'chdir
11333 (lambda _
11334 ;; Tests assume we are in this directory
11335 (chdir "core/pax-exam-spi")
11336 #t))
11337 (add-before 'check 'fix-tests
11338 (lambda _
11339 ;; One test checks that this file is present.
11340 (mkdir-p "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi")
11341 (with-output-to-file
11342 "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi/pom.properties"
11343 (lambda _
11344 (display
11345 (string-append "artifactId = pax-exam-spi\n"
11346 "version = " ,(package-version java-ops4j-pax-exam-core-spi)))))
11347 ;; Maven puts compilation results in the target directory, while we
11348 ;; put them in the build directory.
11349 (substitute* '("src/test/java/org/ops4j/pax/exam/spi/war/WarBuilderTest.java"
11350 "src/test/java/org/ops4j/pax/exam/spi/war/WarTestProbeBuilderTest.java"
11351 "src/test/java/org/ops4j/pax/exam/spi/war/ZipBuilderTest.java")
11352 (("target") "build"))
11353 ;; One test is expected to fail, but it doesn't throw the expected exception
11354 (substitute* "src/test/java/org/ops4j/pax/exam/spi/reactors/BaseStagedReactorTest.java"
11355 (("AssertionError") "IllegalArgumentException"))
11356 #t)))))
11357 (inputs
11358 `(("java-ops4j-pax-exam-core" ,java-ops4j-pax-exam-core)
11359 ("lang" ,java-ops4j-base-lang)
11360 ("monitors" ,java-ops4j-base-monitors)
11361 ("store" ,java-ops4j-base-store)
11362 ("io" ,java-ops4j-base-io)
11363 ("spi" ,java-ops4j-base-spi)
11364 ("osgi" ,java-osgi-core)
11365 ("slf4j" ,java-slf4j-api)
11366 ("tinybundles" ,java-ops4j-pax-tinybundles)))
11367 (native-inputs
11368 `(("mockito" ,java-mockito-1)
11369 ("junit" ,java-junit)
11370 ("hamcrest" ,java-hamcrest-core)
11371 ("cglib" ,java-cglib)
11372 ("objenesis" ,java-objenesis)))))
11373
11374(define-public java-ops4j-pax-exam-core-junit
11375 (package
11376 (inherit java-ops4j-pax-exam-core)
11377 (name "java-ops4j-pax-exam-core-junit")
11378 (arguments
11379 `(#:jar-name "ops4j-pax-exam-core-junit.jar"
11380 #:source-dir "drivers/pax-exam-junit4/src/main/java"
11381 #:tests? #f)); no tests
11382 (inputs
11383 `(("junit" ,java-junit)
11384 ("slf4j" ,java-slf4j-api)
11385 ("core" ,java-ops4j-pax-exam-core)
11386 ("spi" ,java-ops4j-pax-exam-core-spi)))
11387 (native-inputs '())))
11388
11389(define-public java-fasterxml-jackson-annotations
11390 (package
11391 (name "java-fasterxml-jackson-annotations")
11392 (version "2.9.4")
11393 (source (origin
11394 (method url-fetch)
11395 (uri (string-append "https://github.com/FasterXML/"
11396 "jackson-annotations/archive/"
11397 "jackson-annotations-" version ".tar.gz"))
11398 (sha256
11399 (base32
11400 "0mr95xd0da6a4g95zvrl1ryk5n5zv2rc696w3xnsr5hxk2gicfc4"))))
11401 (build-system ant-build-system)
11402 (arguments
11403 `(#:jar-name "jackson-annotations.jar"
11404 #:source-dir "src/main/java"
11405 #:test-dir "src/test"))
11406 (native-inputs
11407 `(("junit" ,java-junit)))
11408 (home-page "https://github.com/FasterXML/jackson-annotations")
11409 (synopsis "General purpose annotations for the Jackson Data Processor")
11410 (description "This package contains general purpose annotations for the
11411Jackson Data Processor, used on value and handler types. The only annotations
11412not included are ones that require dependency to the Databind package.")
11413 (license license:asl2.0)))
11414
11415(define-public java-fasterxml-jackson-core
11416 (package
11417 (name "java-fasterxml-jackson-core")
11418 (version "2.9.4")
11419 (source (origin
11420 (method url-fetch)
11421 (uri (string-append "https://github.com/FasterXML/"
11422 "jackson-core/archive/"
11423 "jackson-core-" version ".tar.gz"))
11424 (sha256
11425 (base32
11426 "159hsnk17jr1gyzkf01cxvsn45srnk37g949r7364qlsr527gjgd"))))
11427 (build-system ant-build-system)
11428 (arguments
11429 `(#:jar-name "jackson-core.jar"
11430 #:source-dir "src/main/java"
11431 #:test-dir "src/test"
11432 #:test-exclude
11433 (list
11434 ;; Expected failure. pom.xml excludes these
11435 "**/failing/**"
11436 ;; Base classes that have no constructor for junit
11437 "**/BaseTest.java"
11438 "**/ConcurrencyReadTest.java"
11439 "**/ManualCharAccessTest.java"
11440 "**/ManualCharAccessTest.java"
11441 "**/TrailingCommasTest.java"
11442 "**/AsyncMissingValuesInObjectTest.java"
11443 "**/AsyncMissingValuesInArrayTest.java")
11444 #:phases
11445 (modify-phases %standard-phases
11446 (add-before 'configure 'generate-PackageVersion.java
11447 (lambda _
11448 (let* ((out "src/main/java/com/fasterxml/jackson/core/json/PackageVersion.java")
11449 (in (string-append out ".in")))
11450 (copy-file in out)
11451 (substitute* out
11452 (("@package@") "com.fasterxml.jackson.core.json")
11453 (("@projectversion@") ,version)
11454 (("@projectgroupid@") "com.fasterxml.jackson.core")
11455 (("@projectartifactid@") "jackson-core")))
11456 #t))
11457 (add-before 'build 'copy-resources
11458 (lambda _
11459 (copy-recursively "src/main/resources"
11460 "build/classes")
11461 #t))
11462 (add-before 'check 'copy-test-resources
11463 (lambda _
11464 (copy-recursively "src/test/resources"
11465 "build/test-classes")
11466 #t)))))
11467 (native-inputs
11468 `(("junit" ,java-junit)
11469 ("hamcrest" ,java-hamcrest-core)))
11470 (home-page "https://github.com/FasterXML/jackson-core")
11471 (synopsis "Low-level streaming parser and generator abstractions")
11472 (description "This package contains core low-level incremental
11473(streaming) parser and generator abstractions used by the Jackson Data
11474Processor. It also includes the default implementation of handler types
11475(parser, generator) that handle JSON format.")
11476 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11477
11478(define-public java-fasterxml-jackson-databind
11479 (package
11480 (name "java-fasterxml-jackson-databind")
11481 (version "2.9.4")
11482 (source (origin
11483 (method url-fetch)
11484 (uri (string-append "https://github.com/FasterXML/"
11485 "jackson-databind/archive/"
11486 "jackson-databind-" version ".tar.gz"))
11487 (sha256
11488 (base32
11489 "1zd2cw4z6kdkbx8za96xh9pyicv2a2l7y0rkcx2fqd8hv6d47s08"))))
11490 (build-system ant-build-system)
11491 (arguments
11492 `(#:jar-name "jackson-databind.jar"
11493 #:source-dir "src/main/java"
11494 #:tests? #f; requires javax.measures for which I can't find a free implementation
11495 #:phases
11496 (modify-phases %standard-phases
11497 (add-before 'configure 'generate-PackageVersion.java
11498 (lambda _
11499 (let* ((out "src/main/java/com/fasterxml/jackson/databind/cfg/PackageVersion.java")
11500 (in (string-append out ".in")))
11501 (copy-file in out)
11502 (substitute* out
11503 (("@package@") "com.fasterxml.jackson.databind.cfg")
11504 (("@projectversion@") ,version)
11505 (("@projectgroupid@") "com.fasterxml.jackson.databind")
11506 (("@projectartifactid@") "jackson-databind")))
11507 #t))
11508 (add-before 'build 'copy-resources
11509 (lambda _
11510 (copy-recursively "src/main/resources" "build/classes")
11511 #t)))))
11512 (inputs
11513 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core))
11514 (home-page "https://github.com/FasterXML/jackson-databind")
11515 (synopsis "Data-binding functionality and tree-model for the Jackson Data Processor")
11516 (description "This package contains the general-purpose data-binding
11517functionality and tree-model for Jackson Data Processor. It builds on core
11518streaming parser/generator package, and uses Jackson Annotations for
11519configuration.")
11520 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11521
11522(define-public java-fasterxml-jackson-modules-base-jaxb
11523 (package
11524 (name "java-fasterxml-jackson-modules-base-jaxb")
11525 (version "2.9.4")
11526 (source (origin
11527 (method url-fetch)
11528 (uri (string-append "https://github.com/FasterXML/"
11529 "jackson-modules-base/archive/"
11530 "jackson-modules-base-" version ".tar.gz"))
11531 (sha256
11532 (base32
11533 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
11534 (build-system ant-build-system)
11535 (arguments
11536 `(#:jar-name "jackson-modules-base-jaxb.jar"
11537 #:source-dir "jaxb/src/main/java"
11538 #:test-dir "jaxb/src/test"
11539 #:test-exclude
11540 ;; Base class for tests
11541 (list "**/BaseJaxbTest.java")
11542 #:phases
11543 (modify-phases %standard-phases
11544 (add-before 'configure 'generate-PackageVersion.java
11545 (lambda _
11546 (let* ((out (string-append "jaxb/src/main/java/com/fasterxml/"
11547 "jackson/module/jaxb/PackageVersion.java"))
11548 (in (string-append out ".in")))
11549 (copy-file in out)
11550 (substitute* out
11551 (("@package@") "com.fasterxml.jackson.module.jaxb")
11552 (("@projectversion@") ,version)
11553 (("@projectgroupid@") "com.fasterxml.jackson.module.jaxb")
11554 (("@projectartifactid@") "jackson-module-jaxb")))
11555 #t))
11556 (add-before 'build 'copy-resources
11557 (lambda _
11558 (copy-recursively "jaxb/src/main/resources" "build/classes")
11559 #t)))))
11560 (inputs
11561 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core
11562 java-fasterxml-jackson-databind))
11563 (native-inputs
11564 (list java-junit))
11565 (home-page "https://github.com/FasterXML/jackson-modules-base")
11566 (synopsis "Jaxb annotations jackson module")
11567 (description "This package is the jaxb annotations module for jackson.")
11568 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11569
11570(define-public java-fasterxml-jackson-modules-base-mrbean
11571 (package
11572 (name "java-fasterxml-jackson-modules-base-mrbean")
11573 (version "2.9.4")
11574 (source (origin
11575 (method url-fetch)
11576 (uri (string-append "https://github.com/FasterXML/"
11577 "jackson-modules-base/archive/"
11578 "jackson-modules-base-" version ".tar.gz"))
11579 (sha256
11580 (base32
11581 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
11582 (build-system ant-build-system)
11583 (arguments
11584 `(#:jar-name "jackson-modules-base-mrbean.jar"
11585 #:source-dir "mrbean/src/main/java"
11586 #:test-dir "mrbean/src/test"
11587 #:test-exclude
11588 ;; Base class for tests
11589 (list "**/BaseTest.java")
11590 #:phases
11591 (modify-phases %standard-phases
11592 (add-before 'configure 'generate-PackageVersion.java
11593 (lambda _
11594 (let* ((out (string-append "mrbean/src/main/java/com/fasterxml/"
11595 "jackson/module/mrbean/PackageVersion.java"))
11596 (in (string-append out ".in")))
11597 (copy-file in out)
11598 (substitute* out
11599 (("@package@") "com.fasterxml.jackson.module.mrbean")
11600 (("@projectversion@") ,version)
11601 (("@projectgroupid@") "com.fasterxml.jackson.module.mrbean")
11602 (("@projectartifactid@") "jackson-module-mrbean")))
11603 #t)))))
11604 (inputs
11605 (list java-asm java-fasterxml-jackson-annotations
11606 java-fasterxml-jackson-core java-fasterxml-jackson-databind))
11607 (native-inputs
11608 (list java-junit))
11609 (home-page "https://github.com/FasterXML/jackson-modules-base")
11610 (synopsis "POJO type materialization for Java")
11611 (description "This package implements POJO type materialization.
11612Databinders can construct implementation classes for Java interfaces as part
11613of deserialization.")
11614 (license license:asl2.0)))
11615
11616(define-public java-snakeyaml
11617 (package
11618 (name "java-snakeyaml")
11619 (version "1.18")
11620 (source (origin
11621 (method url-fetch)
11622 (uri (string-append "https://bitbucket.org/asomov/snakeyaml/get/v"
11623 version ".tar.gz"))
11624 (file-name (string-append name "-" version ".tar.gz"))
11625 (sha256
11626 (base32
11627 "0474cqcv46zgv9bhms2vgawakq1vyj0hp3h3f1bfys46msia90bh"))))
11628 (build-system ant-build-system)
11629 (arguments
11630 `(#:jar-name "java-snakeyaml.jar"
11631 #:source-dir "src/main/java"
11632 ;; Tests require velocity, a cyclic dependency, and
11633 ;; java-spring-framework-context which is not packaged.
11634 #:tests? #f))
11635 (home-page "https://bitbucket.org/asomov/snakeyaml")
11636 (synopsis "YAML processor")
11637 (description "SnakeYAML is a YAML processor for the Java Virtual Machine.")
11638 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11639
11640(define-public java-fasterxml-jackson-dataformat-yaml
11641 (package
11642 (name "java-fasterxml-jackson-dataformat-yaml")
11643 (version "2.9.4")
11644 (source (origin
11645 (method url-fetch)
11646 (uri (string-append "https://github.com/FasterXML/"
11647 "jackson-dataformats-text/archive/"
11648 "jackson-dataformats-text-" version ".tar.gz"))
11649 (sha256
11650 (base32
11651 "1hikl06khaxbg439avf442qifcadap8w0lx13f0nnhp2vh3dkbz7"))))
11652 (build-system ant-build-system)
11653 (arguments
11654 `(#:jar-name "jackson-dataformat-yaml.jar"
11655 #:source-dir "yaml/src/main/java"
11656 #:test-dir "yaml/src/test"
11657 #:test-exclude (list "**/failing/**.java")
11658 #:phases
11659 (modify-phases %standard-phases
11660 (add-before 'configure 'generate-PackageVersion.java
11661 (lambda _
11662 (let* ((out "yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/PackageVersion.java")
11663 (in (string-append out ".in")))
11664 (copy-file in out)
11665 (substitute* out
11666 (("@package@") "com.fasterxml.jackson.dataformat.yaml")
11667 (("@projectversion@") ,version)
11668 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.yaml")
11669 (("@projectartifactid@") "jackson-dataformat-yaml")))
11670 #t)))))
11671 (inputs
11672 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core
11673 java-fasterxml-jackson-databind java-snakeyaml))
11674 (native-inputs
11675 `(("junit" ,java-junit)
11676 ("hamcrest" ,java-hamcrest-core)
11677 ("java-ops4j-pax-exam-core-spi" ,java-ops4j-pax-exam-core-spi)
11678 ("java-ops4j-pax-exam-core-junit" ,java-ops4j-pax-exam-core-junit)
11679 ("java-ops4j-pax-exam" ,java-ops4j-pax-exam-core)))
11680 (home-page "https://github.com/FasterXML/jackson-dataformats-text")
11681 (synopsis "Yaml backend for Jackson")
11682 (description "Dataformat backends are used to support format alternatives
11683to JSON, supported by default. This is done by sub-classing Jackson core
11684abstractions.")
11685 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11686
11687(define-public java-stax2-api
11688 (package
11689 (name "java-stax2-api")
11690 (version "4.0.0")
11691 (source (origin
11692 (method url-fetch)
11693 (uri (string-append "https://github.com/FasterXML/stax2-api/archive/"
11694 "stax2-api-" version ".tar.gz"))
11695 (sha256
11696 (base32
11697 "1amc1si0l0hyyw2sawmnzy4hkna3z6fp195y4nm5m9wb9ld5awkq"))))
11698 (build-system ant-build-system)
11699 (arguments
11700 `(#:jar-name "java-stax2-api.jar"
11701 #:source-dir "src/main/java"
11702 #:tests? #f)); no tests
11703 (home-page "https://github.com/FasterXML/stax2-api")
11704 (synopsis "Stax2 API")
11705 (description "Stax2 API is an extension to basic Stax 1.0 API that adds
11706significant new functionalities, such as full-featured bi-direction validation
11707interface and high-performance Typed Access API.")
11708 (license license:bsd-2)))
11709
11710(define-public java-woodstox-core
11711 (package
11712 (name "java-woodstox-core")
11713 (version "5.0.3")
11714 (source (origin
11715 (method git-fetch)
11716 (uri (git-reference
11717 (url "https://github.com/FasterXML/woodstox")
11718 (commit (string-append "woodstox-core-" version))))
11719 (file-name (git-file-name name version))
11720 (sha256
11721 (base32
11722 "0bfylk24a967hwxprxqbg6cdvm6n4ldcarp54yg980viwvjiglyp"))))
11723 (build-system ant-build-system)
11724 (arguments
11725 `(#:jar-name "woodstox.jar"
11726 #:test-exclude
11727 (list "**/Base*.java" "failing/**")
11728 #:phases
11729 (modify-phases %standard-phases
11730 (add-before 'build 'remove-msv-dep
11731 (lambda _
11732 ;; we don't need osgi, and it depends on msv
11733 (delete-file-recursively "src/main/java/com/ctc/wstx/osgi")
11734 ;; msv's latest release is from 2011 and we don't need it
11735 (delete-file-recursively "src/main/java/com/ctc/wstx/msv")
11736 (delete-file-recursively "src/test/java/wstxtest/osgi")
11737 (delete-file-recursively "src/test/java/wstxtest/msv")
11738 #t))
11739 (add-before 'build 'copy-resources
11740 (lambda _
11741 (copy-recursively "src/main/resources" "build/classes")
11742 #t)))))
11743 (inputs
11744 `(("stax2" ,java-stax2-api)))
11745 (native-inputs
11746 `(("junit" ,java-junit)))
11747 (home-page "https://github.com/FasterXML/woodstox")
11748 (synopsis "Stax XML API implementation")
11749 (description "Woodstox is a stax XML API implementation.")
11750 (license license:asl2.0)))
11751
11752(define-public java-fasterxml-jackson-dataformat-xml
11753 (package
11754 (name "java-fasterxml-jackson-dataformat-xml")
11755 (version "2.9.4")
11756 (source (origin
11757 (method git-fetch)
11758 (uri (git-reference
11759 (url "https://github.com/FasterXML/jackson-dataformat-xml")
11760 (commit (string-append "jackson-dataformat-xml-" version))))
11761 (file-name (git-file-name name version))
11762 (sha256
11763 (base32
11764 "0s1wl65mbs57c2hz2v8rnh8i04y5lpyyvnjz562j5j6b83vwwpfx"))))
11765 (build-system ant-build-system)
11766 (arguments
11767 `(#:jar-name "jackson-dataformat-xml.jar"
11768 #:source-dir "src/main/java"
11769 #:test-exclude
11770 (list "**/failing/**")
11771 #:phases
11772 (modify-phases %standard-phases
11773 (add-before 'configure 'generate-PackageVersion.java
11774 (lambda _
11775 (let* ((out "src/main/java/com/fasterxml/jackson/dataformat/xml/PackageVersion.java")
11776 (in (string-append out ".in")))
11777 (copy-file in out)
11778 (newline)
11779 (substitute* out
11780 (("@package@") "com.fasterxml.jackson.dataformat.xml")
11781 (("@projectversion@") ,version)
11782 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.xml")
11783 (("@projectartifactid@") "jackson-dataformat-xml")))
11784 #t))
11785 (add-before 'build 'copy-resources
11786 (lambda _
11787 (copy-recursively "src/main/resources" "build/classes")
11788 #t)))))
11789 (inputs
11790 `(("jackson-annotations" ,java-fasterxml-jackson-annotations)
11791 ("jackson-core" ,java-fasterxml-jackson-core)
11792 ("jackson-modules-base-jaxb" ,java-fasterxml-jackson-modules-base-jaxb)
11793 ("jackson-databind" ,java-fasterxml-jackson-databind)
11794 ("stax2-api" ,java-stax2-api)
11795 ("woodstox" ,java-woodstox-core)))
11796 (native-inputs
11797 `(("junit" ,java-junit)
11798 ("hamcrest" ,java-hamcrest-core)))
11799 (home-page "https://github.com/FasterXML/jackson-dataformat-xml")
11800 (synopsis "Read and write XML")
11801 (description "This package contains Jackson extension component for reading
11802and writing XML encoded data.
11803
11804Further, the goal is to emulate how JAXB data-binding works with \"Code-first\"
11805approach (that is, no support is added for \"Schema-first\" approach). Support
11806for JAXB annotations is provided by JAXB annotation module; this module
11807provides low-level abstractions (@code{JsonParser}, @code{JsonGenerator},
11808@code{JsonFactory}) as well as small number of higher level overrides needed to
11809make data-binding work.")
11810 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11811
11812(define-public java-hdrhistogram
11813 (package
11814 (name "java-hdrhistogram")
11815 (version "2.1.9")
11816 (source (origin
11817 (method git-fetch)
11818 (uri (git-reference
11819 (url "https://github.com/HdrHistogram/HdrHistogram")
11820 (commit (string-append "HdrHistogram-" version))))
11821 (file-name (git-file-name name version))
11822 (sha256
11823 (base32
11824 "1cw8aa1vk258k42xs6wpy72m4gbai540jq032qsa7c5586iawx2d"))))
11825 (build-system ant-build-system)
11826 (arguments
11827 `(#:jar-name "java-hdrhistogram.jar"
11828 #:source-dir "src/main/java"
11829 #:phases
11830 (modify-phases %standard-phases
11831 (add-after 'unpack 'make-files-writable
11832 (lambda _
11833 (for-each make-file-writable (find-files "."))
11834 #t))
11835 (add-before 'configure 'set-version
11836 (lambda _
11837 (let* ((version-java "src/main/java/org/HdrHistogram/Version.java")
11838 (template (string-append version-java ".template")))
11839 (copy-file template version-java)
11840 (substitute* version-java
11841 (("\\$VERSION\\$") ,version)
11842 (("\\$BUILD_TIME\\$") "0"))
11843 #t))))))
11844 (native-inputs
11845 `(("junit" ,java-junit)
11846 ("hamcrest" ,java-hamcrest-core)))
11847 (home-page "https://hdrhistogram.github.io/HdrHistogram")
11848 (synopsis "High dynamic range histogram")
11849 (description "Hdrhistogram creates histograms that support
11850recording and analyzing sampled data value counts across a configurable integer
11851value range with configurable value precision within the range. Value precision
11852is expressed as the number of significant digits in the value recording, and
11853provides control over value quantization behavior across the value range and
11854the subsequent value resolution at any given level.")
11855 (license license:public-domain)))
11856
11857(define-public java-cofoja
11858 (package
11859 (name "java-cofoja")
11860 (version "1.3")
11861 (source (origin
11862 (method git-fetch)
11863 (uri (git-reference
11864 (url "https://github.com/nhatminhle/cofoja")
11865 (commit (string-append "v" version))))
11866 (file-name (string-append "java-cofoja-" version "-checkout"))
11867 (sha256
11868 (base32
11869 "0p7sz8y5xgpi5rx1qwn6587fkd52qr3ha3ybh14gqcyxhikl525w"))))
11870 (build-system ant-build-system)
11871 (arguments
11872 `(#:build-target "dist"
11873 #:test-target "test"
11874 #:jdk ,icedtea-8
11875 #:make-flags
11876 (list "-Ddist.dir=dist")
11877 #:modules ((guix build ant-build-system)
11878 (guix build java-utils)
11879 (guix build utils)
11880 (srfi srfi-1)
11881 (ice-9 match))
11882 #:phases
11883 (modify-phases %standard-phases
11884 ;; The bulid system ignores the class path the ant-build-system sets
11885 ;; up and instead expects to find all dependencies in the "lib"
11886 ;; directory.
11887 (add-after 'unpack 'create-libdir
11888 (lambda* (#:key inputs #:allow-other-keys)
11889 (mkdir-p "lib")
11890 (for-each
11891 (lambda (file)
11892 (let ((target (string-append "lib/" (basename file))))
11893 (unless (file-exists? target)
11894 (symlink file target))))
11895 (append-map (match-lambda
11896 ((label . dir)
11897 (find-files dir "\\.jar$")))
11898 inputs))
11899 #t))
11900 (replace 'install (install-jars "dist")))))
11901 (inputs
11902 (list java-asm))
11903 (native-inputs
11904 (list java-junit))
11905 (home-page "https://github.com/nhatminhle/cofoja")
11906 (synopsis "Contracts for Java")
11907 (description "Contracts for Java, or Cofoja for short, is a contract
11908programming framework and test tool for Java, which uses annotation processing
11909and bytecode instrumentation to provide run-time checking. (In particular,
11910this is not a static analysis tool.)")
11911 (license license:lgpl3+)))
11912
11913(define-public java-aopalliance
11914 (package
11915 (name "java-aopalliance")
11916 (version "1.0")
11917 (source (origin
11918 (method git-fetch)
11919 ;; Note: this git repository is not official, but contains the
11920 ;; source code that is in the CVS repository. Downloading the
11921 ;; tarball from sourceforge is undeterministic, and the cvs download
11922 ;; fails.
11923 (uri (git-reference
11924 (url "https://github.com/hoverruan/aopalliance")
11925 (commit "0d7757ae204e5876f69431421fe9bc2a4f01e8a0")))
11926 (file-name (string-append name "-" version))
11927 (sha256
11928 (base32
11929 "0rsg2b0v3hxlq2yk1i3m2gw3xwq689j3cwx9wbxvqfpdcjbca0qr"))))
11930 (build-system ant-build-system)
11931 (arguments
11932 `(#:jar-name "java-aopalliance.jar"
11933 #:jdk ,icedtea-8
11934 #:tests? #f; no tests
11935 #:source-dir "aopalliance/src/main"
11936 #:phases
11937 (modify-phases %standard-phases
11938 (add-before 'install 'create-pom
11939 (generate-pom.xml "pom.xml" "aopalliance" "aopalliance" ,version))
11940 (replace 'install
11941 (install-from-pom "pom.xml")))))
11942 (home-page "https://aopalliance.sourceforge.net")
11943 (synopsis "Aspect-Oriented Programming")
11944 (description "The AOP Alliance project is a joint project between several
11945software engineering people who are interested in Aspect-Oriented Programming
11946(AOP) and Java.")
11947 (license license:public-domain)))
11948
11949(define-public java-javax-inject
11950 (package
11951 (name "java-javax-inject")
11952 (version "1")
11953 (source (origin
11954 (method git-fetch)
11955 (uri (git-reference
11956 (url "https://github.com/javax-inject/javax-inject")
11957 (commit version)))
11958 (file-name (git-file-name name version))
11959 (sha256
11960 (base32
11961 "1rspl0nkvk1jif6nccikw93xic6ljj2b6kpy2mffwi2mnvc13j7x"))))
11962 (build-system ant-build-system)
11963 (arguments
11964 `(#:jar-name "java-javax-inject.jar"
11965 #:tests? #f; no tests
11966 #:phases
11967 (modify-phases %standard-phases
11968 (replace 'install
11969 (install-from-pom "pom.xml")))))
11970 (home-page "https://github.com/javax-inject/javax-inject")
11971 (synopsis "JSR-330: Dependency Injection for Java")
11972 (description "This package specifies a means for obtaining objects in such
11973a way as to maximize reusability, testability and maintainability compared to
11974traditional approaches such as constructors, factories, and service locators
11975(e.g., JNDI). This process, known as dependency injection, is beneficial to
11976most nontrivial applications.
11977
11978Many types depend on other types. For example, a @var{Stopwatch} might depend
11979on a @var{TimeSource}. The types on which a type depends are known as its
11980dependencies. The process of finding an instance of a dependency to use at run
11981time is known as resolving the dependency. If no such instance can be found,
11982the dependency is said to be unsatisfied, and the application is broken.")
11983 (license license:asl2.0)))
11984
11985(define-public java-guice
11986 (package
11987 (name "java-guice")
11988 (version "4.1")
11989 (source (origin
11990 (method git-fetch)
11991 (uri (git-reference
11992 (url "https://github.com/google/guice")
11993 (commit version)))
11994 (file-name (git-file-name name version))
11995 (modules '((guix build utils)))
11996 (snippet
11997 `(begin
11998 (for-each delete-file (find-files "." ".*.jar")) #t))
11999 (sha256
12000 (base32
12001 "18im5hdfl4q1b9chww2s1ii60sn3ydyyar32a2sf2p2g8zlbdswq"))))
12002 (build-system ant-build-system)
12003 (arguments
12004 `(#:jar-name "java-guice.jar"
12005 #:jdk ,icedtea-8
12006 #:tests? #f; FIXME: tests are not in a java sub directory
12007 #:source-dir "core/src"
12008 #:phases
12009 (modify-phases %standard-phases
12010 (add-after 'unpack 'make-files-writable
12011 (lambda _
12012 (for-each make-file-writable (find-files "."))
12013 #t))
12014 (replace 'install
12015 (install-from-pom "core/pom.xml")))))
12016 (propagated-inputs
12017 (list java-aopalliance
12018 java-cglib
12019 java-guava
12020 java-javax-inject
12021 java-guice-parent-pom))
12022 (home-page "https://github.com/google/guice")
12023 (synopsis "Lightweight dependency injection framework")
12024 (description "Guice is a lightweight dependency injection framework for
12025Java 6 and above.")
12026 (license license:asl2.0)))
12027
12028(define-public java-guice-servlet
12029 (package
12030 (inherit java-guice)
12031 (name "java-guice-servlet")
12032 (arguments
12033 `(#:jar-name "guice-servlet.jar"
12034 #:source-dir "extensions/servlet/src/"
12035 #:jdk ,icedtea-8
12036 #:tests? #f ; FIXME: not in a java subdir
12037 #:phases
12038 (modify-phases %standard-phases
12039 (add-after 'unpack 'make-files-writable
12040 (lambda _
12041 (for-each make-file-writable (find-files "."))
12042 #t)))))
12043 (inputs
12044 `(("guice" ,java-guice)
12045 ("servlet" ,java-classpathx-servletapi)
12046 ,@(package-inputs java-guice)))))
12047
12048(define java-guice-parent-pom
12049 (package
12050 (inherit java-guice)
12051 (name "java-guice-parent-pom")
12052 (arguments
12053 `(#:tests? #f
12054 #:phases
12055 (modify-phases %standard-phases
12056 (delete 'configure)
12057 (delete 'build)
12058 (add-after 'install 'install-extensions
12059 (install-pom-file "extensions/pom.xml"))
12060 (replace 'install
12061 (install-pom-file "pom.xml")))))
12062 (propagated-inputs
12063 `(("java-google-parent-pom" ,java-google-parent-pom-5)))))
12064
12065(define java-google-parent-pom-5
12066 (package
12067 (name "java-google-parent-pom")
12068 (version "5")
12069 (source (origin
12070 (method git-fetch)
12071 (uri (git-reference
12072 (url "https://github.com/google/google-maven-parents")
12073 (commit (string-append "google-" version))))
12074 (file-name (git-file-name name version))
12075 (sha256
12076 (base32
12077 "0zb7hx24p8k8rfdvix2vsbfqn73jhrycdndvhf8j5gbii9wbqibv"))))
12078 (build-system ant-build-system)
12079 (arguments
12080 `(#:tests? #f
12081 #:phases
12082 (modify-phases %standard-phases
12083 (delete 'configure)
12084 (delete 'build)
12085 (replace 'install
12086 (install-pom-file "pom.xml")))))
12087 (home-page "https://github.com/google/google-maven-parents")
12088 (synopsis "Google parent pom")
12089 (description "This package contains the Maven parent POM for other Google
12090Java projects.")
12091 (license license:asl2.0)))
12092
12093(define-public java-assertj
12094 (package
12095 (name "java-assertj")
12096 (version "3.8.0")
12097 (source (origin
12098 (method git-fetch)
12099 (uri (git-reference
12100 (url "https://github.com/joel-costigliola/assertj-core")
12101 (commit (string-append "assertj-core-" version))))
12102 (file-name (git-file-name name version))
12103 (sha256
12104 (base32
12105 "1k35cg2in7pzk4pbdjryr0pll5lgk1r6ngrn0j8cdlgi7w8zh2d1"))))
12106 (build-system ant-build-system)
12107 (arguments
12108 `(#:jar-name "java-assertj.jar"
12109 #:jdk ,icedtea-8
12110 #:source-dir "src/main/java"
12111 #:tests? #f)); depends on tng-junit which depends on assertj
12112 (inputs
12113 `(("cglib" ,java-cglib)
12114 ("junit" ,java-junit)
12115 ("hamcrest" ,java-hamcrest-core)))
12116 (native-inputs
12117 `(("mockito" ,java-mockito-1)))
12118 (home-page "https://joel-costigliola.github.io/assertj/index.html")
12119 (synopsis "Fluent assertions for java")
12120 (description "AssertJ core is a Java library that provides a fluent
12121interface for writing assertions. Its main goal is to improve test code
12122readability and make maintenance of tests easier.")
12123 (license license:asl2.0)))
12124
12125(define-public java-jboss-javassist
12126 (package
12127 (name "java-jboss-javassist")
12128 (version "3.21.0")
12129 (source (origin
12130 (method git-fetch)
12131 (uri (git-reference
12132 (url "https://github.com/jboss-javassist/javassist")
12133 (commit
12134 (string-append "rel_"
12135 (string-map
12136 (lambda (x) (if (eq? x #\.) #\_ x)) version)
12137 "_ga"))))
12138 (file-name (git-file-name name version))
12139 (sha256
12140 (base32
12141 "0h3zlcyqiaq01fspm69h7vki67raw305w89p4ha8vlhpzw02qifm"))
12142 (modules '((guix build utils)))
12143 (snippet
12144 '(begin
12145 (delete-file "javassist.jar")))))
12146 (build-system ant-build-system)
12147 (arguments
12148 `(#:jar-name "java-jboss-javassist.jar"
12149 #:jdk ,icedtea-8
12150 #:source-dir "src/main"
12151 #:tests? #f; FIXME: requires junit-awtui and junit-swingui from junit3
12152 #:phases
12153 (modify-phases %standard-phases
12154 (add-after 'unpack 'make-files-writable
12155 (lambda _
12156 (for-each make-file-writable (find-files "."))
12157 #t)))))
12158 (native-inputs
12159 `(("junit" ,java-junit)))
12160 (home-page "https://github.com/jboss-javassist/javassist")
12161 (synopsis "Java bytecode engineering toolkit")
12162 (description "Javassist (JAVA programming ASSISTant) makes Java bytecode
12163manipulation simple. It is a class library for editing bytecodes in Java; it
12164enables Java programs to define a new class at runtime and to modify a class
12165file when the JVM loads it.")
12166 (license (list license:gpl2 license:cddl1.0)))); either gpl2 only or cddl.
12167
12168(define-public java-jcommander
12169 (package
12170 (name "java-jcommander")
12171 (version "1.71")
12172 (source (origin
12173 (method git-fetch)
12174 (uri (git-reference
12175 (url "https://github.com/cbeust/jcommander")
12176 (commit version)))
12177 (file-name (git-file-name name version))
12178 (sha256
12179 (base32
12180 "12vcpc19sd7jhvjgp7xz1qjanfix162xb3x2q5zah93rjklj1h57"))))
12181 (build-system ant-build-system)
12182 (arguments
12183 `(#:jar-name "java-jcommander.jar"
12184 #:jdk ,icedtea-8
12185 #:tests? #f; requires testng which depends on jcommander
12186 #:source-dir "src/main/java"))
12187 (home-page "https://jcommander.org")
12188 (synopsis "Command line parameters parser")
12189 (description "JCommander is a very small Java framework that makes it
12190trivial to parse command line parameters. Parameters are declared with
12191annotations.")
12192 (license license:asl2.0)))
12193
12194(define-public java-bsh
12195 (package
12196 (name "java-bsh")
12197 (version "2.1.1")
12198 (source (origin
12199 (method git-fetch)
12200 (uri (git-reference
12201 (url "https://github.com/beanshell/beanshell")
12202 (commit version)))
12203 (file-name (git-file-name name version))
12204 (sha256
12205 (base32
12206 "1a6y46yz2ba4mnlfv4bpd5pmzhgxrzk3s10xp05jz377nbp2izwg"))
12207 (modules '((guix build utils)))
12208 (snippet
12209 '(begin
12210 ;; Delete bundled third-party jar archives.
12211 (for-each delete-file (find-files "." ".*.jar$"))
12212 (for-each (lambda (file) (chmod file #o644))
12213 (find-files "." "."))
12214 #t))))
12215 (build-system ant-build-system)
12216 (arguments
12217 `(#:build-target "jarall"
12218 #:test-target "junit-tests-all"
12219 #:make-flags (list "-DDATE" "(no date for reproducibility)")
12220 #:phases
12221 (modify-phases %standard-phases
12222 (add-before 'check 'fix-test
12223 (lambda _
12224 (substitute* "tests/junitTests/src/bsh/Issue_55_Test.java"
12225 ((" BshScriptEngineFactory") " bsh.engine.BshScriptEngineFactory"))))
12226 (replace 'install
12227 (install-from-pom "pom.xml")))))
12228 (inputs
12229 (list java-classpathx-servletapi java-commons-bsf))
12230 (native-inputs
12231 (list java-junit javacc-3))
12232 (home-page "http://beanshell.org/")
12233 (synopsis "Lightweight Scripting for Java")
12234 (description "BeanShell is a small, free, embeddable Java source
12235interpreter with object scripting language features, written in Java.
12236BeanShell dynamically executes standard Java syntax and extends it with common
12237scripting conveniences such as loose types, commands, and method closures like
12238those in Perl and JavaScript.")
12239 (license license:asl2.0)))
12240
12241(define-public java-fest-util
12242 (package
12243 (name "java-fest-util")
12244 (version "1.2.5")
12245 (source (origin
12246 (method git-fetch)
12247 (uri (git-reference
12248 (url "https://github.com/alexruiz/fest-util/")
12249 (commit (string-append "fest-util-" version))))
12250 (file-name (git-file-name name version))
12251 (sha256
12252 (base32
12253 "02kgal7v85snyyvcsxvn4qphid455f4smh2wri1il8d9asw0djbz"))))
12254 (build-system ant-build-system)
12255 (arguments
12256 `(#:jar-name "java-fest-util.jar"
12257 #:source-dir "src/main/java"))
12258 (native-inputs
12259 `(("junit" ,java-junit)
12260 ("hamcrest" ,java-hamcrest-core)))
12261 (home-page "https://github.com/alexruiz/fest-util")
12262 (synopsis "FEST common utilities")
12263 (description "Common utilities used in all FEST module.")
12264 (license license:asl2.0)))
12265
12266(define-public java-fest-test
12267 (package
12268 (name "java-fest-test")
12269 (version "2.1.0")
12270 (source (origin
12271 (method git-fetch)
12272 (uri (git-reference
12273 (url "https://github.com/alexruiz/fest-test/")
12274 (commit (string-append "fest-test-" version))))
12275 (file-name (git-file-name name version))
12276 (sha256
12277 (base32
12278 "0mg1d2jfh7kbx2c40dchbjr6d8pv59snsyb13mfxsr7xk5n69qbn"))))
12279 (build-system ant-build-system)
12280 (arguments
12281 `(#:jar-name "java-fest-test.jar"
12282 #:source-dir "src/main/java"
12283 #:tests? #f)); no tests
12284 (inputs
12285 `(("junit" ,java-junit)))
12286 (home-page "https://github.com/alexruiz/fest-test")
12287 (synopsis "Common FEST testing infrastructure")
12288 (description "Fest-test contains the common FEST testing infrastructure.")
12289 (license license:asl2.0)))
12290
12291(define-public java-fest-assert
12292 (package
12293 (name "java-fest-assert")
12294 (version "2.0M10")
12295 (source (origin
12296 (method git-fetch)
12297 (uri (git-reference
12298 (url "https://github.com/alexruiz/fest-assert-2.x/")
12299 (commit (string-append "fest-assert-core-" version))))
12300 (file-name (git-file-name name version))
12301 (sha256
12302 (base32
12303 "1cp8zzyag3s85fz2w68sda9zzaal1y5f9wl8g72wkm12an40w6by"))))
12304 (build-system ant-build-system)
12305 (arguments
12306 `(#:jar-name "java-fest-assert.jar"
12307 #:source-dir "src/main/java"
12308 #:test-exclude
12309 (list
12310 "**/Abstract*.java"
12311 "**/*BaseTest.java"
12312 ;; Unable to set MockitoNamingPolicy on cglib generator which creates FastClasses
12313 "**/MessageFormatter_format_Test.java"
12314 "**/internal/*/*_assert*_Test.java")))
12315 (inputs
12316 (list java-fest-util))
12317 (native-inputs
12318 (list java-junit
12319 java-fest-test
12320 java-hamcrest-core
12321 java-mockito-1
12322 java-cglib
12323 java-objenesis))
12324 (home-page "https://github.com/alexruiz/fest-assert-2.x")
12325 (synopsis "FEST fluent assertions")
12326 (description "FEST-Assert provides a fluent interface for assertions.")
12327 (license license:asl2.0)))
12328
12329(define-public java-testng
12330 (package
12331 (name "java-testng")
12332 (version "6.14.3")
12333 (source (origin
12334 (method git-fetch)
12335 (uri (git-reference
12336 (url "https://github.com/cbeust/testng")
12337 (commit version)))
12338 (file-name (string-append name "-" version "-checkout"))
12339 (sha256
12340 (base32
12341 "0y6vq30i5g276kw0v2bhbvci22ijg7ax49ap2611yqlhbs4d6dqv"))))
12342 (build-system ant-build-system)
12343 (arguments
12344 (list
12345 #:jdk icedtea-8; java.util.function
12346 #:jar-name "java-testng.jar"
12347 #:source-dir "src/main/java"
12348 #:phases
12349 '(modify-phases %standard-phases
12350 (add-after 'unpack 'delete-failing-tests
12351 (lambda _
12352 ;; FIXME: I don't know why these tests fail
12353 (substitute* "src/test/resources/testng.xml"
12354 ;; expected:<[0]> but was:<[3]>
12355 (("<class name=\"test.configuration.github1625.TestRunnerIssue1625\"/>") "")
12356 ;; expected [3] but found [2]
12357 (("<class name=\"test.serviceloader.ServiceLoaderTest\" />") "")
12358 ;; This is a parallel test and we've observed that it fails
12359 ;; sometimes.
12360 (("<class name=\"test.dataprovider.DataProviderTest\"/>") ""))))
12361 ;; We don't have groovy
12362 (add-after 'unpack 'delete-groovy-tests
12363 (lambda _
12364 (delete-file-recursively "src/test/java/test/dependent/issue1648/")
12365 (substitute* "src/test/resources/testng.xml"
12366 (("<class name=\"test.dependent.issue1648.TestRunner\"/>") ""))))
12367 (add-before 'build 'copy-resources
12368 (lambda _
12369 (copy-recursively "src/main/resources" "build/classes")))
12370 (add-before 'check 'copy-test-resources
12371 (lambda _
12372 (copy-recursively "src/test/resources" "build/test-classes")))
12373 (replace 'check
12374 (lambda _
12375 (invoke "ant" "compile-tests")
12376 ;; we don't have groovy
12377 (substitute* "src/test/resources/testng.xml"
12378 (("<class name=\"test.groovy.GroovyTest\" />") ""))
12379 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
12380 ":build/classes"
12381 ":build/test-classes")
12382 "-Dtest.resources.dir=src/test/resources"
12383 "org.testng.TestNG" "src/test/resources/testng.xml"))))))
12384 (propagated-inputs
12385 (list java-junit
12386 java-jsr305
12387 java-bsh
12388 java-jcommander
12389 java-guice
12390 java-snakeyaml))
12391 (native-inputs
12392 (list java-guava
12393 java-javax-inject
12394 java-hamcrest-all
12395 java-assertj
12396 java-mockito-1
12397 java-cglib
12398 java-aopalliance))
12399 (home-page "https://testng.org")
12400 (synopsis "Testing framework")
12401 (description "TestNG is a testing framework inspired from JUnit and NUnit
12402but introducing some new functionalities that make it more powerful and easier
12403to use.")
12404 (license license:asl2.0)))
12405
12406(define-public java-jnacl
12407 (let ((commit "094e819afdd63ea81a499b3bcb42a271006bebd9")
12408 (revision "2"))
12409 (package
12410 (name "java-jnacl")
12411 (version (string-append "0.1.0-" revision "." (string-take commit 7)))
12412 (source (origin
12413 (method git-fetch)
12414 (uri (git-reference
12415 (url "https://github.com/neilalexander/jnacl")
12416 (commit commit)))
12417 (file-name (git-file-name name version))
12418 (sha256
12419 (base32
12420 "1d6g6xhn83byv5943n7935wwjsk0ibk0qdvqgr699qqgqqmwisbb"))))
12421 (build-system ant-build-system)
12422 (arguments
12423 `(#:jar-name "jnacl.jar"
12424 #:source-dir "src/main/java"
12425 #:jdk ,icedtea-8
12426 #:phases
12427 (modify-phases %standard-phases
12428 (add-before 'build 'fix-tests
12429 (lambda _
12430 (substitute* '("src/test/java/com/neilalexander/jnacl/NaClTest.java"
12431 "src/test/java/com/neilalexander/jnacl/NaclSecretBoxTest.java")
12432 (("assertions.Assertions") "assertions.api.Assertions"))
12433 #t))
12434 (replace 'check
12435 (lambda _
12436 (invoke "ant" "compile-tests")
12437 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
12438 ":build/classes"
12439 ":build/test-classes")
12440 "org.testng.TestNG" "-testclass"
12441 "build/test-classes/com/neilalexander/jnacl/NaclSecretBoxTest.class")
12442 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
12443 ":build/classes"
12444 ":build/test-classes")
12445 "org.testng.TestNG" "-testclass"
12446 "build/test-classes/com/neilalexander/jnacl/NaClTest.class"))))))
12447 (native-inputs
12448 (list java-testng java-fest-util java-fest-assert))
12449 (home-page "https://github.com/neilalexander/jnacl")
12450 (synopsis "Java implementation of NaCl")
12451 (description "Pure Java implementation of the NaCl: Networking and
12452Cryptography library.")
12453 (license license:bsd-2))))
12454
12455(define-public java-mvel2
12456 (package
12457 (name "java-mvel2")
12458 (version "2.3.1")
12459 (source (origin
12460 (method url-fetch)
12461 (uri (string-append "https://github.com/mvel/mvel/archive/mvel2-"
12462 version ".Final.tar.gz"))
12463 (sha256
12464 (base32
12465 "01ph5s9gm16l2qz58lg21w6fna7xmmrj7f9bzqr1jim7h9557d3z"))))
12466 (build-system ant-build-system)
12467 (arguments
12468 `(#:jar-name "mvel2.jar"
12469 #:source-dir "src/main/java"
12470 #:test-exclude
12471 (list "**/Abstract*.java"
12472 ;; Base class with no tests
12473 "**/MVELThreadTest.java")
12474 #:phases
12475 (modify-phases %standard-phases
12476 (add-after 'install 'install-bin
12477 (lambda* (#:key outputs #:allow-other-keys)
12478 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
12479 (mkdir-p bin)
12480 (with-output-to-file (string-append bin "/mvel2")
12481 (lambda _
12482 (display
12483 (string-append
12484 "#!" (which "bash") "\n"
12485 "if [ \"$#\" -ne \"2\" ]; then\n"
12486 "echo 'Usage: mvel2 <script> <out.dir>'\n"
12487 "exit\n"
12488 "fi\n"
12489 "java -Dout.dir=$2 -cp " (getenv "CLASSPATH")
12490 ":" (assoc-ref outputs "out") "/share/java/mvel2.jar"
12491 " org.mvel2.sh.Main $1"))))
12492 (chmod (string-append bin "/mvel2") #o755))
12493 #t)))))
12494 (native-inputs
12495 `(("junit" ,java-junit)
12496 ("hamcrest" ,java-hamcrest-core)))
12497 (home-page "https://github.com/mvel/mvel")
12498 (synopsis "MVFLEX Expression Language")
12499 (description "MVEL has largely been inspired by Java syntax, but has some
12500fundamental differences aimed at making it more efficient as an expression
12501language, such as operators that directly support collection, array and string
12502matching, as well as regular expressions. MVEL is used to evaluate expressions
12503written using Java syntax.
12504
12505In addition to the expression language, MVEL serves as a templating language for
12506configuration and string construction.")
12507 (license license:asl2.0)))
12508
12509(define-public java-commons-jexl-2
12510 (package
12511 (name "java-commons-jexl")
12512 (version "2.1.1")
12513 (source (origin
12514 (method url-fetch)
12515 (uri (string-append "mirror://apache/commons/jexl/source/"
12516 "commons-jexl-" version "-src.tar.gz"))
12517 (sha256
12518 (base32
12519 "1ai7632bwwaxglb0nbpblpr2jw5g20afrsaq372ipkphi3ncy1jz"))))
12520 (build-system ant-build-system)
12521 (arguments
12522 `(#:jar-name "commons-jexl-2.jar"
12523 #:jdk ,icedtea-8
12524 #:source-dir "src/main/java"
12525 #:phases
12526 (modify-phases %standard-phases
12527 (add-before 'check 'disable-broken-tests
12528 (lambda* (#:key inputs #:allow-other-keys)
12529 (with-directory-excursion "src/test/java/org/apache/commons/jexl2/"
12530 (substitute* "ArithmeticTest.java"
12531 (("asserter.assertExpression\\(\"3 / 0\"") "//")
12532 (("asserter.assertExpression\\(\"imanull") "//"))
12533 ;; This test fails with "ambiguous method invocation"
12534 (delete-file "CacheTest.java")
12535 ;; This test doesn't have access to the temp directory
12536 (substitute* "ClassCreatorTest.java"
12537 (("java.io.tmpdir") "user.dir"))
12538 ;; This test fails in trying to detect whether it can run.
12539 (substitute* "ClassCreator.java"
12540 (("boolean canRun =.*") "boolean canRun = false;\n"))
12541 ;; ...and these tests depend on it.
12542 (delete-file "scripting/JexlScriptEngineOptionalTest.java")
12543 (delete-file "scripting/JexlScriptEngineTest.java"))
12544 #t))
12545 (add-before 'build 'run-javacc
12546 (lambda _
12547 (with-directory-excursion "src/main/java/org/apache/commons/jexl2/parser/"
12548 (invoke "java" "jjtree" "Parser.jjt")
12549 (invoke "java" "javacc" "Parser.jj"))
12550 #t)))))
12551 (inputs
12552 (list java-commons-logging-minimal))
12553 (native-inputs
12554 (list java-junit java-hamcrest-core javacc-4))
12555 (home-page "https://commons.apache.org/proper/commons-jexl/")
12556 (synopsis "Java Expression Language")
12557 (description "JEXL is a library intended to facilitate the implementation
12558of dynamic and scripting features in applications and frameworks written in
12559Java. JEXL implements an Expression Language based on some extensions to the
12560JSTL Expression Language supporting most of the constructs seen in
12561shell-script or ECMAScript. Its goal is to expose scripting features usable
12562by technical operatives or consultants working with enterprise platforms.")
12563 (license license:asl2.0)))
12564
12565(define-public java-lz4
12566 (package
12567 (name "java-lz4")
12568 (version "1.4.0")
12569 (source (origin
12570 (method git-fetch)
12571 (uri (git-reference
12572 (url "https://github.com/lz4/lz4-java")
12573 (commit version)))
12574 (file-name (git-file-name name version))
12575 (sha256
12576 (base32
12577 "0ydjakhv3cz34mfvv14qrh2ksdxifgjwwagjy7r46qr3f68hnf6y"))))
12578 (build-system ant-build-system)
12579 (arguments
12580 `(#:jar-name "lz4.jar"
12581 #:jdk ,icedtea-8
12582 #:source-dir "src/java:src/java-unsafe"
12583 #:tests? #f; FIXME: requires more dependencies
12584 #:phases
12585 (modify-phases %standard-phases
12586 (add-after 'unpack 'make-files-writable
12587 (lambda _
12588 (for-each make-file-writable (find-files "."))
12589 #t))
12590 (add-before 'configure 'generate-source
12591 (lambda _
12592 (with-directory-excursion "src/build/source_templates"
12593 (invoke "mvel2" "../gen_sources.mvel" "../../java"))
12594 #t)))))
12595 (native-inputs
12596 `(("mvel" ,java-mvel2)))
12597 (home-page "https://jpountz.github.io/lz4-java")
12598 (synopsis "Compression algorithm")
12599 (description "LZ4 - Java is a Java port of the popular lz4 compression
12600algorithms and xxHash hashing algorithm.")
12601 (license license:asl2.0)))
12602
12603(define-public java-bouncycastle
12604 (package
12605 (name "java-bouncycastle")
12606 (version "1.67")
12607 (source (origin
12608 (method git-fetch)
12609 (uri (git-reference
12610 (url "http://git.bouncycastle.org/repositories/bc-java")
12611 ;(url "https://github.com/bcgit/bc-java")
12612 (commit (string-append "r1rv" (substring version 2 4)))))
12613 (file-name (git-file-name name version))
12614 (sha256
12615 (base32
12616 "1449q7fyh03s1q0bqljcrhgacwcyqmg2bbvb3z084avgapwsainz"))
12617 (modules '((guix build utils)))
12618 (snippet
12619 '(begin
12620 (for-each delete-file
12621 (find-files "." "\\.jar$"))
12622 #t))))
12623 (build-system ant-build-system)
12624 (arguments
12625 `(#:jdk ,icedtea-8
12626 #:tests? #f
12627 #:phases
12628 (modify-phases %standard-phases
12629 (replace 'build
12630 (lambda _
12631 (invoke "ant" "-f" "ant/jdk15+.xml" "build-provider")
12632 (invoke "ant" "-f" "ant/jdk15+.xml" "build")))
12633 ;; FIXME: the tests freeze.
12634 ;; (replace 'check
12635 ;; (lambda _
12636 ;; (invoke "ant" "-f" "ant/jdk15+.xml" "test")))
12637 (replace 'install
12638 (install-jars "build/artifacts/jdk1.5/jars")))))
12639 (inputs
12640 (list java-javax-mail))
12641 (native-inputs
12642 `(("unzip" ,unzip)
12643 ("junit" ,java-junit)
12644 ("java-native-access" ,java-native-access)
12645 ("java-native-access-platform" ,java-native-access-platform)))
12646 (home-page "https://www.bouncycastle.org")
12647 (synopsis "Cryptographic library")
12648 (description "Bouncy Castle is a cryptographic library for the Java
12649programming language.")
12650 (license license:expat)))
12651
12652(define-public java-jakarta-activation-1.2
12653 (package
12654 (name "java-jakarta-activation")
12655 (version "1.2.2")
12656 (source (origin
12657 (method git-fetch)
12658 (uri (git-reference
12659 (url "https://github.com/jakartaee/jaf-api")
12660 (commit version)))
12661 (file-name (git-file-name name version))
12662 (sha256
12663 (base32
12664 "13kkr0kj9wp45vpfackcbyycilzs5r3sj33px5pny1k4hq09cyar"))))
12665 (build-system ant-build-system)
12666 (arguments
12667 `(#:tests? #f
12668 #:jar-name "jakarta.activation.jar"
12669 #:jdk ,openjdk9
12670 #:source-dir "activation/src/main/java"
12671 #:phases
12672 (modify-phases %standard-phases
12673 ;; Install under javax.activation:activation coordinates
12674 ;; so consumers like javax.mail can find it. The source
12675 ;; pom uses com.sun.activation:jakarta.activation but that's
12676 ;; the new coordinate; most existing poms reference the
12677 ;; old javax.activation:activation.
12678 (add-before 'install 'create-pom
12679 (generate-pom.xml "pom.xml" "javax.activation"
12680 "activation" ,version))
12681 (replace 'install
12682 (install-from-pom "pom.xml")))))
12683 (home-page "https://jakarta.ee/specifications/activation/")
12684 (synopsis "Jakarta Activation API (javax.activation)")
12685 (description "Jakarta Activation provides the @code{javax.activation}
12686package, which was removed from the JDK in Java 11. This is the 1.2.x
12687transitional release that still uses the @code{javax.activation} namespace.")
12688 (license license:edl1.0)))
12689
12690(define-public java-bouncycastle-1.77
12691 (package
12692 (inherit java-bouncycastle)
12693 (version "1.77")
12694 (source (origin
12695 (method git-fetch)
12696 (uri (git-reference
12697 (url "https://github.com/bcgit/bc-java")
12698 (commit (string-append "r1rv" (substring version 2 4)))))
12699 (file-name (git-file-name "java-bouncycastle" version))
12700 (sha256
12701 (base32
12702 "1adxic0pgb7gv2yflw72np7zilj6rrhgjcj3xvnmidwp2pc887k1"))
12703 (modules '((guix build utils)))
12704 (snippet
12705 '(begin
12706 (for-each delete-file
12707 (find-files "." "\\.jar$"))
12708 #t))))
12709 (arguments
12710 `(#:jdk ,openjdk17
12711 #:tests? #f
12712 #:phases
12713 (modify-phases %standard-phases
12714 (replace 'build
12715 (lambda _
12716 (let ((suffix (string-append
12717 "-Drelease.suffix="
12718 ,(string-join (string-split version #\.) ""))))
12719 (mkdir-p "ant/docs")
12720 ;; Build individual targets. Can't use the 'build'
12721 ;; target because it includes 'build-test' which needs
12722 ;; the UnboundID LDAP SDK.
12723 (invoke "ant" "-f" "ant/jdk18+.xml" suffix
12724 "build-provider")
12725 ;; The remaining targets are only in bc+-build.xml.
12726 ;; Call it via ant's -f but pass properties that
12727 ;; jdk18+.xml normally sets.
12728 (let ((props (list suffix
12729 "-Dtarget.prefix=jdk18on"
12730 "-Djdk.name=jdk1.8"
12731 "-Dbc.javac.source=1.8"
12732 "-Dbc.javac.target=1.8"
12733 "-Dbuild.dir=build"
12734 "-Djavadoc.args=-breakiterator"
12735 (string-append "-Dsrc.dir="
12736 (getcwd) "/build/jdk1.8")
12737 (string-append "-Dartifacts.dir="
12738 (getcwd) "/build/artifacts/jdk1.8"))))
12739 (for-each
12740 (lambda (target)
12741 (apply invoke "ant" "-f" "ant/bc+-build.xml"
12742 (append props (list target))))
12743 '("build-util" "build-pkix" "build-pg" "build-mail"))))))
12744 (add-after 'build 'add-osgi-manifests
12745 (lambda _
12746 ;; The Maven Central jars have OSGi manifest attributes
12747 ;; from maven-bundle-plugin. Add them since we build
12748 ;; with ant.
12749 (for-each
12750 (lambda (name)
12751 (let ((jar (car (find-files "build/artifacts"
12752 (string-append name "-jdk18on.*\\.jar$")))))
12753 (call-with-output-file "osgi-manifest.mf"
12754 (lambda (port)
12755 (display (string-append
12756 "Bundle-ManifestVersion: 2\n"
12757 "Bundle-SymbolicName: " name "\n"
12758 "Bundle-Version: " ,version "\n")
12759 port)))
12760 (invoke "jar" "ufm" jar "osgi-manifest.mf")))
12761 '("bcprov" "bcutil" "bcpkix" "bcpg"))))
12762 (add-after 'add-osgi-manifests 'rename-jars
12763 (lambda _
12764 ;; Ant produces e.g. bcprov-jdk18on-177.jar but
12765 ;; install-from-pom expects bcprov-jdk18on-1.77.jar.
12766 (for-each
12767 (lambda (name)
12768 (let ((src (car (find-files "build/artifacts"
12769 (string-append name "-jdk18on-.*\\.jar$"))))
12770 (dest (string-append "build/artifacts/jdk1.8/jars/"
12771 name "-jdk18on-" ,version ".jar")))
12772 (unless (string=? src dest)
12773 (rename-file src dest))))
12774 '("bcprov" "bcutil" "bcpkix" "bcpg"))))
12775 (replace 'install
12776 (lambda* (#:key inputs outputs jar-name #:allow-other-keys)
12777 (for-each
12778 (lambda (name)
12779 (let ((pom-file (string-append name "-pom.xml"))
12780 (artifact (string-append name "-jdk18on")))
12781 ((generate-pom.xml pom-file "org.bouncycastle"
12782 artifact ,version))
12783 ((install-from-pom pom-file)
12784 #:inputs inputs #:outputs outputs
12785 #:jar-name (string-append artifact "-" ,version "\\.jar$"))))
12786 '("bcprov" "bcutil" "bcpkix" "bcpg")))))))
12787 (inputs
12788 (list java-jakarta-activation-1.2
12789 java-javax-mail))
12790 (description "Bouncy Castle is a cryptographic library for the Java
12791programming language. This is version 1.77 which has breaking API changes
12792compared to 1.67 (removed classes in ASN1, CMC, and other packages).")))
12793
12794(define-public java-eclipse-jdt-annotation-2
12795 (package
12796 (name "java-eclipse-jdt-annotation")
12797 (version "2.2.600")
12798 (source (origin
12799 (method url-fetch)
12800 (uri (string-append "https://repo1.maven.org/maven2/"
12801 "org/eclipse/jdt/org.eclipse.jdt.annotation/"
12802 version "/org.eclipse.jdt.annotation-"
12803 version "-sources.jar"))
12804 (sha256
12805 (base32
12806 "1jlq14ivhj32i7glfdmk068ya1spm4wfa9h8h2p326y0fkkzwyp9"))))
12807 (build-system ant-build-system)
12808 (arguments
12809 `(#:tests? #f
12810 #:jar-name "org.eclipse.jdt.annotation.jar"
12811 #:source-dir "."
12812 #:phases
12813 (modify-phases %standard-phases
12814 (add-before 'install 'create-pom
12815 (generate-pom.xml "pom.xml" "org.eclipse.jdt"
12816 "org.eclipse.jdt.annotation" ,version))
12817 (replace 'install (install-from-pom "pom.xml")))))
12818 (native-inputs (list unzip))
12819 (home-page "https://www.eclipse.org/jdt/")
12820 (synopsis "Eclipse JDT null analysis annotations")
12821 (description "This package provides the @code{@@NonNull}, @code{@@Nullable},
12822and @code{@@NonNullByDefault} annotations used by Eclipse JDT for null
12823analysis.")
12824 (license license:epl2.0)))
12825
12826(define-public java-kohlschutter-compiler-annotations-1
12827 (package
12828 (name "java-kohlschutter-compiler-annotations")
12829 (version "1.4.2")
12830 (source (origin
12831 (method url-fetch)
12832 (uri (string-append "https://repo1.maven.org/maven2/"
12833 "com/kohlschutter/compiler-annotations/"
12834 version "/compiler-annotations-"
12835 version "-sources.jar"))
12836 (sha256
12837 (base32
12838 "0fzmhr9binv1ah410955m95w6lwwidy9sw06yy5cjcrcjx7v0455"))))
12839 (build-system ant-build-system)
12840 (arguments
12841 `(#:tests? #f
12842 #:jar-name "compiler-annotations.jar"
12843 #:jdk ,openjdk9
12844 #:source-dir "."
12845 #:phases
12846 (modify-phases %standard-phases
12847 (add-before 'install 'create-pom
12848 (generate-pom.xml "pom.xml" "com.kohlschutter"
12849 "compiler-annotations" ,version))
12850 (replace 'install (install-from-pom "pom.xml")))))
12851 (inputs (list java-eclipse-jdt-annotation-2))
12852 (native-inputs (list unzip))
12853 (home-page "https://github.com/kohlschutter/compiler-annotations")
12854 (synopsis "Compile-time annotations for Java")
12855 (description "This package provides compile-time annotations such as
12856@code{@@SuppressFBWarnings} and @code{@@ExcludeFromCodeCoverageGeneratedReport}.")
12857 (license license:asl2.0)))
12858
12859(define junixsocket-source
12860 (origin
12861 (method git-fetch)
12862 (uri (git-reference
12863 (url "https://github.com/kohlschutter/junixsocket")
12864 (commit "junixsocket-parent-2.5.1")))
12865 (file-name (git-file-name "java-junixsocket" "2.5.1"))
12866 (sha256
12867 (base32
12868 "1zc84qbl2zsi9ch6b12crbiqlrkbrlw1z09kqlj04zrmck4k4pzn"))))
12869
12870(define-public java-junixsocket-common-2
12871 (package
12872 (name "java-junixsocket-common")
12873 (version "2.5.1")
12874 (source junixsocket-source)
12875 (build-system ant-build-system)
12876 (arguments
12877 `(#:jar-name "junixsocket-common.jar"
12878 #:source-dir "junixsocket-common/src/main/java"
12879 #:jdk ,openjdk9
12880 #:tests? #f
12881 #:phases
12882 (modify-phases %standard-phases
12883 (add-after 'unpack 'delete-module-info
12884 (lambda _
12885 ;; module-info.java requires modules not available in
12886 ;; our build (com.kohlschutter.annotations.compiletime,
12887 ;; org.eclipse.jdt.annotation). The classes compile
12888 ;; and work without JPMS metadata.
12889 (delete-file
12890 "junixsocket-common/src/main/java/module-info.java")))
12891 (replace 'install
12892 (install-from-pom "junixsocket-common/pom.xml")))))
12893 (inputs (list java-eclipse-jdt-annotation-2
12894 java-kohlschutter-compiler-annotations-1))
12895 (home-page "https://github.com/kohlschutter/junixsocket")
12896 (synopsis "Java library for Unix domain sockets")
12897 (description "junixsocket is a Java library for Unix domain sockets
12898(AF_UNIX) and other address/protocol families, providing a Java Socket API
12899compatible interface.")
12900 (license license:asl2.0)))
12901
12902(define-public java-junixsocket-native-common-2.5.1
12903 (package
12904 (name "java-junixsocket-native-common")
12905 (version "2.5.1")
12906 (source junixsocket-source)
12907 (build-system ant-build-system)
12908 (arguments
12909 (list
12910 #:tests? #f
12911 #:jdk openjdk9
12912 #:jar-name "junixsocket-native-common.jar"
12913 #:source-dir "junixsocket-native-common/src/main/java"
12914 #:phases
12915 #~(modify-phases %standard-phases
12916 (add-before 'build 'set-module-path
12917 (lambda* (#:key inputs #:allow-other-keys)
12918 ;; javac needs compiler-annotations on the module path
12919 ;; (not classpath) for JPMS 'requires static' resolution.
12920 (let ((mod-dir (assoc-ref inputs
12921 "java-kohlschutter-compiler-annotations")))
12922 (setenv "JDK_JAVAC_OPTIONS"
12923 (string-append "--module-path="
12924 (car (find-files mod-dir "\\.jar$")))))))
12925 (add-before 'build 'build-native
12926 (lambda* (#:key inputs #:allow-other-keys)
12927 (let ((jdk (assoc-ref inputs "jdk"))
12928 (c-dir "junixsocket-native/src/main/c"))
12929 ;; Fix GCC incompatibility: _Pragma inside expressions
12930 ;; is a Clang extension, not supported by GCC.
12931 (substitute* (string-append c-dir "/ckmacros.h")
12932 (("# define CK_IGNORE_CAST_BEGIN \\\\")
12933 "# define CK_IGNORE_CAST_BEGIN")
12934 (("# define CK_IGNORE_CAST_END \\\\")
12935 "# define CK_IGNORE_CAST_END")
12936 (("_Pragma\\(\"GCC diagnostic.*cast.*\"\\)") "")
12937 (("_Pragma\\(\"GCC diagnostic push\"\\)") "")
12938 (("_Pragma\\(\"GCC diagnostic pop\"\\)") ""))
12939 (let ((so-file (string-append
12940 "junixsocket-native-common/src/main/"
12941 "resources/lib/amd64-Linux-clang/jni/"
12942 "libjunixsocket-native-" #$version ".so")))
12943 (mkdir-p (dirname so-file))
12944 (apply invoke "gcc" "-shared" "-fPIC" "-O2"
12945 "-Wno-int-to-pointer-cast"
12946 "-Wno-pointer-to-int-cast"
12947 "-Wno-bad-function-cast"
12948 "-Wno-cast-function-type"
12949 "-Wno-stringop-overflow"
12950 (string-append "-I" c-dir)
12951 (string-append "-I" c-dir "/jni")
12952 (string-append "-I" jdk "/include")
12953 (string-append "-I" jdk "/include/linux")
12954 "-o" so-file
12955 (find-files c-dir "\\.c$"))))))
12956 (add-after 'build 'add-native-to-jar
12957 (lambda _
12958 (invoke "jar" "uf"
12959 "build/jar/junixsocket-native-common.jar"
12960 "-C" "junixsocket-native-common/src/main/resources"
12961 "lib")))
12962 ;; The source pom.xml lists pre-built native library
12963 ;; NARs for every platform. We build the native code
12964 ;; from source, so none of those dependencies apply.
12965 (add-before 'install 'create-pom
12966 (generate-pom.xml "pom.xml"
12967 "com.kohlschutter.junixsocket"
12968 "junixsocket-native-common" #$version))
12969 (replace 'install
12970 (install-from-pom "pom.xml")))))
12971 (native-inputs (list java-kohlschutter-compiler-annotations-1))
12972 (home-page "https://github.com/kohlschutter/junixsocket")
12973 (synopsis "Native JNI library for junixsocket")
12974 (description "This package provides the native JNI library for
12975junixsocket, built from source for Linux.")
12976 (license license:asl2.0)))
12977
12978(define-public java-lmax-disruptor
12979 (package
12980 (name "java-lmax-disruptor")
12981 (version "3.4.4")
12982 (source (origin
12983 (method git-fetch)
12984 (uri (git-reference
12985 (url "https://github.com/LMAX-Exchange/disruptor")
12986 (commit version)))
12987 (file-name (git-file-name name version))
12988 (sha256
12989 (base32
12990 "02c5kp3n8a73dq9ay7ar53s1k3x61z9yzc5ikqb03m6snr1wpfqn"))))
12991 (build-system ant-build-system)
12992 (arguments
12993 `(#:jar-name "java-lmax-disruptor.jar"
12994 #:jdk ,icedtea-8
12995 #:tests? #f)); tests hang
12996 (inputs
12997 `(("junit" ,java-junit)
12998 ("java-hdrhistogram" ,java-hdrhistogram)
12999 ("java-jmock" ,java-jmock)
13000 ("java-jmock-legacy" ,java-jmock-legacy)
13001 ("java-jmock-junit4" ,java-jmock-junit4)
13002 ("java-hamcrest-all" ,java-hamcrest-all)))
13003 (native-inputs
13004 `(("cglib" ,java-cglib)
13005 ("objenesis" ,java-objenesis)))
13006 (home-page "https://www.lmax.com/disruptor")
13007 (synopsis "High performance inter-thread communication")
13008 (description "LMAX Disruptor is a software pattern and software component
13009for high performance inter-thread communication that avoids the need for
13010message queues or resource locking.")
13011 (license license:asl2.0)))
13012
13013(define-public java-conversant-disruptor
13014 (package
13015 (name "java-conversant-disruptor")
13016 (version "1.2.19")
13017 (source (origin
13018 (method git-fetch)
13019 (uri (git-reference
13020 (url "https://github.com/conversant/disruptor")
13021 (commit version)))
13022 (file-name (git-file-name name version))
13023 (sha256
13024 (base32
13025 "0gx1dm7sfg7pa05cs4qby10gfcplai5b5lf1f7ik1a76dh3vhl0g"))))
13026 (build-system ant-build-system)
13027 (arguments
13028 `(#:jar-name "java-conversant-disruptor.jar"
13029 #:source-dir "src/main/java"
13030 #:phases
13031 (modify-phases %standard-phases
13032 (add-before 'build 'copy-resources
13033 (lambda _
13034 (copy-recursively "src/main/resources" "build/classes")))
13035 (add-before 'build 'remove-module
13036 (lambda _
13037 (delete-file "src/main/java/module-info.java"))))))
13038 (native-inputs
13039 (list java-junit))
13040 (home-page "https://github.com/conversant/disruptor")
13041 (synopsis "High performance intra-thread communication")
13042 (description "Conversant Disruptor is the highest performing intra-thread
13043transfer mechanism available in Java. Conversant Disruptor is an implementation
13044of this type of ring buffer that has almost no overhead and that exploits a
13045particularly simple design.")
13046 (license license:asl2.0)))
13047
13048(define-public java-jctools-core-1
13049 (package
13050 (name "java-jctools-core")
13051 (version "1.2.1")
13052 (source (origin
13053 (method git-fetch)
13054 (uri (git-reference
13055 (url "https://github.com/JCTools/JCTools")
13056 (commit (string-append "v" version))))
13057 (file-name (git-file-name name version))
13058 (sha256
13059 (base32
13060 "105my29nwd4djvdllmq8s3jdzbyplbkxzwmddxiiilb4yqr1pghb"))))
13061 (build-system ant-build-system)
13062 (arguments
13063 `(#:jar-name "java-jctools-core.jar"
13064 #:source-dir "jctools-core/src/main/java"
13065 #:test-dir "jctools-core/src/test"
13066 ;; The tests timeout on some architectures.
13067 #:tests? ,(not (or (target-aarch64?)
13068 (%current-target-system)))))
13069 (native-inputs
13070 (list java-junit java-hamcrest-all))
13071 (home-page "https://github.com/JCTools/JCTools")
13072 (synopsis "Concurrency tools for Java")
13073 (description "This library implements concurrent data structures that are
13074not natively available in Java.")
13075 (license license:asl2.0)))
13076
13077(define-public java-commons-bcel
13078 (package
13079 (name "java-commons-bcel")
13080 (version "6.1")
13081 (source (origin
13082 (method url-fetch)
13083 (uri (string-append "mirror://apache/commons/bcel/source/bcel-"
13084 version "-src.tar.gz"))
13085 (sha256
13086 (base32
13087 "0j3x1rxd673k07psclk8k13rqh0x0mf2yy5qiwkiw4z3afa568jy"))))
13088 (build-system ant-build-system)
13089 (arguments
13090 `(#:jar-name "bcel.jar"
13091 #:jdk ,icedtea-8
13092 #:source-dir "src/main/java"
13093 #:test-dir "src/test/java"
13094 ;; FIXME: Tests require the unpackaged jna.
13095 #:tests? #f))
13096 (home-page "https://commons.apache.org/proper/commons-bcel/")
13097 (synopsis "Byte code engineering library")
13098 (description "The Byte Code Engineering Library (Apache Commons BCEL) is
13099intended to give users a convenient way to analyze, create, and
13100manipulate (binary) Java class files. Classes are represented by objects
13101which contain all the symbolic information of the given class: methods, fields
13102and byte code instructions, in particular.
13103
13104Such objects can be read from an existing file, be transformed by a
13105program (e.g. a class loader at run-time) and written to a file again. An
13106even more interesting application is the creation of classes from scratch at
13107run-time. The @dfn{Byte Code Engineering Library} (BCEL) may be also useful
13108if you want to learn about the @dfn{Java Virtual Machine} (JVM) and the format
13109of Java @code{.class} files.")
13110 (properties '((upstream-name . "bcel")))
13111 (license license:asl2.0)))
13112
13113(define-public java-xerial-core
13114 (package
13115 (name "java-xerial-core")
13116 (version "2.1")
13117 (source (origin
13118 (method url-fetch)
13119 (uri (string-append "https://github.com/xerial/xerial-java/archive/"
13120 version ".tar.gz"))
13121 (file-name (string-append name "-" version ".tar.gz"))
13122 (sha256
13123 (base32
13124 "0d3g863i41bgalpa4xr3vm1h140l091n8iwgq5qvby5yivns9y8d"))))
13125 (build-system ant-build-system)
13126 (arguments
13127 `(#:jar-name "xerial-core.jar"
13128 #:source-dir "xerial-core/src/main/java"
13129 #:test-dir "xerial-core/src/test"
13130 #:phases
13131 (modify-phases %standard-phases
13132 (add-before 'build 'copy-resources
13133 (lambda _
13134 (copy-recursively "xerial-core/src/main/resources"
13135 "build/classes")
13136 #t)))))
13137 (native-inputs
13138 `(("junit" ,java-junit)
13139 ("hamcrest" ,java-hamcrest-core)))
13140 (home-page "https://github.com/xerial/xerial-java")
13141 (synopsis "Data management libraries for Java")
13142 (description "Xerial is a set of data management libraries for the Java
13143programming language. The ultimate goal of the Xerial project is to manage
13144everything as database, including class objects, text format data, data
13145streams, etc.")
13146 (license license:asl2.0)))
13147
13148(define-public java-byte-buddy-dep
13149 (package
13150 (name "java-byte-buddy-dep")
13151 (version "1.14.0")
13152 (source (origin
13153 (method git-fetch)
13154 (uri (git-reference
13155 (url "https://github.com/raphw/byte-buddy")
13156 (commit (string-append "byte-buddy-" version))))
13157 (file-name (git-file-name name version))
13158 (sha256
13159 (base32
13160 "03jmsnkjb9d3z9brqs8fc512hhs5b5iab3a5wbax9zi03dskgvh2"))))
13161 (build-system ant-build-system)
13162 (arguments
13163 `(#:jar-name "byte-buddy-dep.jar"
13164 #:source-dir "byte-buddy-dep/src/main/java"
13165 #:test-dir "byte-buddy-dep/src/test"
13166 #:tests? #f; would build java files that are incompatible with current jdk
13167 #:phases
13168 (modify-phases %standard-phases
13169 (add-before 'build 'remove-annotations
13170 (lambda _
13171 (with-directory-excursion "byte-buddy-dep/src/main/java/net/bytebuddy"
13172 (substitute* (find-files "." ".*.java")
13173 (("@EqualsAndHashCode.*") "")
13174 (("import lombok.EqualsAndHashCode;") "")
13175 (("@SuppressFBWarnings.*") "")
13176 (("import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;") ""))
13177 (substitute* '("description/type/TypeDescription.java"
13178 "dynamic/loading/ClassInjector.java")
13179 (("^ *value = .*") "")
13180 (("^ *justification = .*") ""))))))))
13181 (inputs
13182 (list java-asm-9 java-asm-commons-9 java-jsr305 java-native-access))
13183 (home-page "http://bytebuddy.net/")
13184 (synopsis "Runtime code generation for the Java virtual machine")
13185 (description "Byte Buddy is a code generation and manipulation library for
13186creating and modifying Java classes during the runtime of a Java application
13187and without the help of a compiler.")
13188 (license license:asl2.0)))
13189
13190(define-public java-powermock-reflect
13191 (package
13192 (name "java-powermock-reflect")
13193 (version "2.0.9")
13194 (source (origin
13195 (method git-fetch)
13196 (uri (git-reference
13197 (url "https://github.com/powermock/powermock")
13198 (commit (string-append "powermock-" version))))
13199 (file-name (git-file-name name version))
13200 (sha256
13201 (base32
13202 "03y8szi9iwxnv431z2mn2ivc1ak30vcvfvkyrwmfq7wq93bj2c5v"))
13203 (patches
13204 (search-patches "java-powermock-fix-java-files.patch"))))
13205 (build-system ant-build-system)
13206 (arguments
13207 `(#:jar-name "java-powermock-reflect.jar"
13208 #:source-dir "powermock-reflect/src/main/java"
13209 #:test-dir "powermock-reflect/src/test"))
13210 (inputs
13211 (list java-asm-9 java-objenesis))
13212 (native-inputs
13213 (list java-assertj java-cglib java-hamcrest-core java-junit))
13214 (home-page "https://github.com/powermock/powermock")
13215 (synopsis "Mock library extension framework")
13216 (description "PowerMock is a framework that extends other mock libraries
13217such as EasyMock with more powerful capabilities. PowerMock uses a custom
13218classloader and bytecode manipulation to enable mocking of static methods,
13219constructors, final classes and methods, private methods, removal of static
13220initializers and more. By using a custom classloader no changes need to be
13221done to the IDE or continuous integration servers which simplifies adoption.")
13222 (license license:asl2.0)))
13223
13224(define-public java-powermock-core
13225 (package
13226 (inherit java-powermock-reflect)
13227 (name "java-powermock-core")
13228 (arguments
13229 `(#:jar-name "java-powermock-core.jar"
13230 #:source-dir "powermock-core/src/main/java"
13231 #:test-dir "powermock-core/src/test"
13232 #:tests? #f; requires powermock-api
13233 #:jdk ,icedtea-8
13234 #:phases
13235 (modify-phases %standard-phases
13236 (add-before 'build 'copy-resources
13237 (lambda _
13238 (copy-recursively "powermock-core/src/main/resources"
13239 "build/classes")
13240 #t)))))
13241 (inputs
13242 (list java-asm-9
13243 java-byte-buddy-dep
13244 java-jboss-javassist
13245 java-powermock-reflect))
13246 (native-inputs
13247 (list java-assertj java-mockito-1 java-junit))))
13248
13249(define-public java-powermock-api-support
13250 (package
13251 (inherit java-powermock-reflect)
13252 (name "java-powermock-api-support")
13253 (build-system ant-build-system)
13254 (arguments
13255 `(#:jar-name "java-powermock-api-support.jar"
13256 #:jdk ,icedtea-8
13257 #:source-dir "powermock-api/powermock-api-support/src/main/java"
13258 #:tests? #f)); no tests
13259 (inputs
13260 (list java-powermock-core java-powermock-reflect))))
13261
13262(define-public java-powermock-modules-junit4-common
13263 (package
13264 (inherit java-powermock-reflect)
13265 (name "java-powermock-modules-junit4-common")
13266 (build-system ant-build-system)
13267 (arguments
13268 `(#:jar-name "java-powermock-modules-junit4-common.jar"
13269 #:jdk ,icedtea-8
13270 #:source-dir "powermock-modules/powermock-module-junit4-common/src/main/java"
13271 #:test-dir "powermock-modules/powermock-module-junit4-common/src/test"))
13272 (inputs
13273 (list java-cglib
13274 java-easymock
13275 java-hamcrest-core
13276 java-powermock-core
13277 java-powermock-reflect))))
13278
13279(define-public java-powermock-modules-junit4
13280 (package
13281 (inherit java-powermock-reflect)
13282 (name "java-powermock-modules-junit4")
13283 (build-system ant-build-system)
13284 (arguments
13285 `(#:jar-name "java-powermock-modules-junit4.jar"
13286 #:tests? #f; require easymock 4, which introduces a loop with testng
13287 #:source-dir "powermock-modules/powermock-module-junit4/src/main/java"
13288 #:test-dir "powermock-modules/powermock-module-junit4/src/test"
13289 #:phases
13290 (modify-phases %standard-phases
13291 (add-before 'build 'fix-junit-detection
13292 (lambda _
13293 ;; Our junit version is 4.12-SNAPSHOT
13294 (substitute* (find-files "powermock-modules/powermock-module-junit4"
13295 "PowerMockJUnit4MethodValidator.java")
13296 (("4.12") "4.12-SNAPSHOT"))
13297 #t)))))
13298 (inputs
13299 (list java-cglib
13300 java-powermock-core
13301 java-powermock-reflect
13302 java-powermock-modules-junit4-common))
13303 (native-inputs
13304 (list java-easymock
13305 java-hamcrest-core
13306 java-junit
13307 java-objenesis))))
13308
13309(define-public java-powermock-api-easymock
13310 (package
13311 (inherit java-powermock-reflect)
13312 (name "java-powermock-api-easymock")
13313 (build-system ant-build-system)
13314 (arguments
13315 `(#:jar-name "java-powermock-api-easymock.jar"
13316 #:jdk ,icedtea-8
13317 #:source-dir "powermock-api/powermock-api-easymock/src/main/java"
13318 #:tests? #f; no tests
13319 #:phases
13320 (modify-phases %standard-phases
13321 (add-before 'build 'fix-file
13322 (lambda _
13323 ;; FIXME: This looks wrong, but it fixes a build error.
13324 (with-directory-excursion "powermock-api/powermock-api-easymock"
13325 (substitute* "src/main/java/org/powermock/api/easymock/PowerMock.java"
13326 (("classLoader instanceof MockClassLoader") "false")
13327 (("\\(\\(MockClassLoader\\) classLoader\\).*;") ";")))
13328 #t)))))
13329 (inputs
13330 (list java-cglib
13331 java-easymock
13332 java-powermock-api-support
13333 java-powermock-core
13334 java-powermock-reflect))))
13335
13336(define-public java-jboss-jms-api-spec
13337 (package
13338 (name "java-jboss-jms-api-spec")
13339 (version "2.0")
13340 (source (origin
13341 (method url-fetch)
13342 (uri (string-append "https://github.com/jboss/jboss-jms-api_spec/"
13343 "archive/jboss-jms-api_" version
13344 "_spec-1.0.1.Final.tar.gz"))
13345 (sha256
13346 (base32
13347 "07bqblw9kq2i8q92bz70fvavq5xjfkaixl8xa0m0cypjgy82rb7m"))))
13348 (build-system ant-build-system)
13349 (arguments
13350 `(#:jar-name "java-jboss-jms-api_spec.jar"
13351 #:jdk ,icedtea-8
13352 #:source-dir "."
13353 #:tests? #f)); no tests
13354 (home-page "https://github.com/jboss/jboss-jms-api_spec")
13355 (synopsis "Java Message Service API specification")
13356 (description "Java Message Service (JMS) API is used to send messages
13357messages between two or more clients. It is a messaging standard that allows
13358application components to create, send, receive, and read messages.")
13359 ; either gpl2 only with GPL Classpath Exception, or cddl.
13360 (license (list license:gpl2 license:cddl1.0))))
13361
13362(define-public java-mail
13363 (package
13364 (name "java-mail")
13365 (version "1.6.0")
13366 (source (origin
13367 (method url-fetch)
13368 (uri (string-append "https://github.com/javaee/javamail/archive/"
13369 "JAVAMAIL-1_6_0.tar.gz"))
13370 (sha256
13371 (base32
13372 "1b4rg7fpj50ld90a71iz2m4gm3f5cnw18p3q3rbrrryjip46kx92"))))
13373 (build-system ant-build-system)
13374 (arguments
13375 `(#:jar-name "java-mail.jar"
13376 #:jdk ,icedtea-8
13377 #:source-dir "mail/src/main/java"
13378 #:test-dir "mail/src/test"
13379 #:test-exclude
13380 (list "**/CollectorFormatterTest.java"
13381 "**/CompactFormatterTest.java"
13382 "**/DurationFilterTest.java"
13383 "**/MailHandlerTest.java"
13384 "**/GetLocalAddressTest.java"
13385 ;; SSLHandshakeException: No appropriate protocol
13386 "**/WriteTimeoutSocketTest.java"
13387 ;; FIXME: both end with:
13388 ;; java.lang.ClassNotFoundException:
13389 ;; javax.mail.internet.MimeMultipartParseTest
13390 "**/MimeMultipartParseTest.java"
13391 "**/SearchTermSerializationTest.java")
13392 #:phases
13393 (modify-phases %standard-phases
13394 (add-before 'configure 'move-version.java
13395 (lambda _
13396 (copy-file "mail/src/main/resources/javax/mail/Version.java"
13397 "mail/src/main/java/javax/mail/Version.java")))
13398 (add-before 'build 'copy-resources
13399 (lambda _
13400 (copy-recursively "mail/src/main/resources/META-INF"
13401 "build/classes/META-INF"))))))
13402 (native-inputs
13403 (list java-junit java-hamcrest-core))
13404 (home-page "https://javaee.github.io/javamail/")
13405 (synopsis "Mail-related functionality in Java")
13406 (description "The JavaMail API provides a platform-independent and
13407protocol-independent framework to build mail and messaging applications.")
13408 ;; General Public License Version 2 only ("GPL") or the Common Development
13409 ;; and Distribution License("CDDL")
13410 (license (list license:cddl1.1
13411 license:gpl2)))); with classpath exception
13412
13413(define-public java-mapdb
13414 (package
13415 (name "java-mapdb")
13416 (version "1.0.9")
13417 (source (origin
13418 (method git-fetch)
13419 (uri (git-reference
13420 (url "https://github.com/jankotek/mapdb")
13421 (commit (string-append "mapdb-" version))))
13422 (file-name (git-file-name name version))
13423 (sha256
13424 (base32
13425 "1slb4h282jqvk16896lcvgm65pj3v6crcp2wvjdvad7nx7d2f1kv"))))
13426 (build-system ant-build-system)
13427 (arguments
13428 (list #:jar-name "mapdb.jar"
13429 #:source-dir "src/main/java"
13430 #:test-dir "src/test"
13431 #:test-exclude (list "**/ClosedThrowsExceptionTest.java"
13432 "**/ConcurrentMapInterfaceTest.java"
13433 "**/EngineTest.java"
13434 "**/Issue664Test.java"
13435 "**/MapInterfaceTest.java")
13436 #:phases #~(modify-phases %standard-phases
13437 (replace 'install (install-from-pom "pom.xml")))))
13438 (native-inputs (list java-junit))
13439 (home-page "https://mapdb.org/")
13440 (synopsis "Concurrent data structures")
13441 (description "MapDB provides concurrent maps, sets and queues backed by
13442disk storage or off-heap memory.")
13443 (license license:bsd-3)))
13444
13445(define-public java-mime4j-core
13446 (package
13447 (name "java-mime4j-core")
13448 (version "0.8.13")
13449 (source (origin
13450 (method url-fetch)
13451 (uri (string-append "mirror://apache/james/mime4j/" version
13452 "/james-mime4j-sources-" version ".zip"))
13453 (sha256
13454 (base32
13455 "0f1r0ywa1qdw2b227c93v3fksqp9bgll00bqw1md1894v3szm9ca"))))
13456 (build-system ant-build-system)
13457 (arguments
13458 `(#:tests? #f ;; has no tests
13459 #:source-dir "core/src/main/java"
13460 #:jar-name "apache-mime4j-core.jar"))
13461 (native-inputs
13462 (list java-commons-io-latest ;; requries >= 2.7
13463 java-junit
13464 unzip))
13465 (home-page "https://james.apache.org/mime4j/apache-mime4j-core/")
13466 (synopsis "Java stream based MIME message parser")
13467 (description "Apache James Mime4J provides a parser, MimeStreamParser, for
13468e-mail message streams in plain rfc822 and MIME format. The parser uses a
13469callback mechanism to report parsing events such as the start of an entity
13470header, the start of a body, etc. If you are familiar with the SAX XML parser
13471interface you should have no problem getting started with mime4j.")
13472 (license license:asl2.0)))
13473
13474(define-public java-jeromq
13475 (package
13476 (name "java-jeromq")
13477 (version "0.4.3")
13478 (source (origin
13479 (method git-fetch)
13480 (uri (git-reference
13481 (url "https://github.com/zeromq/jeromq")
13482 (commit (string-append "v" version))))
13483 (file-name (string-append name "-" version "-checkout"))
13484 (sha256
13485 (base32
13486 "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj"))
13487 (patches (search-patches "java-jeromq-fix-tests.patch"))))
13488 (build-system ant-build-system)
13489 (arguments
13490 `(#:jar-name "java-jeromq.jar"
13491 #:source-dir "src/main/java"
13492 #:jdk ,icedtea-8
13493 #:test-exclude
13494 (list
13495 "**/Abstract*.java"
13496 ;; Requires network
13497 "**/ZBeaconTest.java"
13498 ;; Failures
13499 "**/DealerSpecTest.java"
13500 "**/CustomDecoderTest.java"
13501 "**/CustomEncoderTest.java"
13502 "**/ConnectRidTest.java"
13503 "**/ReqSpecTest.java"
13504 "**/PushPullSpecTest.java"
13505 "**/PubSubHwmTest.java"
13506 "**/RouterSpecTest.java"
13507 "**/ProxyTest.java")))
13508 (inputs
13509 (list java-jnacl))
13510 (native-inputs
13511 `(("java-hamcrest-core" ,java-hamcrest-core)
13512 ("junit" ,java-junit)))
13513 (home-page "https://zeromq.org/bindings:java")
13514 (synopsis "Java binding for 0MQ")
13515 (description "Jeromq provides the java bindings for 0MQ.")
13516 (license license:mpl2.0)))
13517
13518(define-public java-kafka-clients
13519 (package
13520 (name "java-kafka-clients")
13521 (version "1.1.1")
13522 (source (origin
13523 (method url-fetch)
13524 (uri (string-append "mirror://apache/kafka/" version "/kafka-"
13525 version "-src.tgz"))
13526 (sha256
13527 (base32
13528 "1jn62q7z383nwhzv4ippsddf98sa1gnkszjjncj4ii3r8rzgw566"))))
13529 (build-system ant-build-system)
13530 (arguments
13531 `(#:jar-name "java-kafka-clients.jar"
13532 #:jdk ,icedtea-8
13533 #:source-dir "clients/src/main/java"
13534 #:test-dir "clients/src/test"
13535 #:test-exclude
13536 (list
13537 ;; This file does not contain a class
13538 "**/IntegrationTest.java"
13539 ;; Requires network
13540 "**/ClientUtilsTest.java"
13541 ;; This test fails on i686
13542 "**/SerializationTest.java"
13543 ;; "protocol is disabled or cipher suites are inappropriate"
13544 "**/SslTransportLayerTest.java"
13545 ;; End with errors that seem related to our powermock
13546 "**/KafkaProducerTest.java"
13547 "**/BufferPoolTest.java"
13548 ;; Undeterministic failure, seems to affect mostly ci
13549 "**/GarbageCollectedMemoryPoolTest.java")))
13550 (inputs
13551 (list java-slf4j-api java-lz4))
13552 (native-inputs
13553 (list java-bouncycastle
13554 java-cglib
13555 java-easymock
13556 java-hamcrest-all
13557 java-jboss-javassist
13558 java-junit
13559 java-objenesis
13560 java-powermock-api-easymock
13561 java-powermock-api-support
13562 java-powermock-core
13563 java-powermock-modules-junit4
13564 java-powermock-modules-junit4-common
13565 java-snappy))
13566 (home-page "https://kafka.apache.org")
13567 (synopsis "Distributed streaming platform")
13568 (description "Kafka is a distributed streaming platform, which means:
13569@itemize
13570@item it can publish and subscribe to streams of records;
13571@item it can store streams of records in a fault-tolerant way;
13572@item it can process streams of records as they occur.
13573@end itemize")
13574 ;; Either cddl or gpl2 only.
13575 (license (list license:cddl1.1; actually cddl1.1
13576 license:gpl2)))); with classpath exception
13577
13578(define-public java-jdom
13579 (package
13580 (name "java-jdom")
13581 (version "1.1.3")
13582 (source (origin
13583 (method url-fetch)
13584 (uri (string-append "http://jdom.org/dist/binary/archive/jdom-"
13585 version ".tar.gz"))
13586 (sha256
13587 (base32
13588 "07wdpm3jwwc9q38kmdw40fvbmv6jzjrkrf8m0zqs58f79a672wfl"))))
13589 (build-system ant-build-system)
13590 (arguments
13591 `(#:build-target "package"
13592 #:tests? #f; tests are run as part of the build process
13593 #:phases
13594 (modify-phases %standard-phases
13595 (replace 'install
13596 (install-jars "build")))))
13597 (home-page "http://jdom.org/")
13598 (synopsis "Access, manipulate, and output XML data")
13599 (description "Java-based solution for accessing, manipulating, and
13600outputting XML data from Java code.")
13601 (license license:bsd-4)))
13602
13603(define-public java-geronimo-xbean-reflect
13604 (package
13605 (name "java-geronimo-xbean-reflect")
13606 (version "4.5")
13607 (source (origin
13608 (method svn-fetch)
13609 (uri (svn-reference
13610 (url "https://svn.apache.org/repos/asf/geronimo/xbean/tags/xbean-4.5/")
13611 (revision 1807396)))
13612 (file-name (string-append name "-" version))
13613 (sha256
13614 (base32
13615 "0zjqmsad4xk0iar23hdyvx19nxczybd2bh0i35xrafli5cmh720k"))))
13616 (build-system ant-build-system)
13617 (arguments
13618 `(#:jar-name "geronimo-xbean-reflect.jar"
13619 #:source-dir "xbean-reflect/src/main/java"
13620 #:test-dir "xbean-reflect/src/test"
13621 #:jdk ,icedtea-8
13622 #:test-exclude
13623 (list "**/Abstract*.java" "**/AsmParameterNameLoaderTest.java"
13624 "**/ObjectRecipeTest.java" "**/ParameterNameLoaderTest.java"
13625 "**/RecipeHelperTest.java" "**/XbeanAsmParameterNameLoaderTest.java")
13626 #:phases
13627 (modify-phases %standard-phases
13628 (add-before 'build 'fix-source
13629 (lambda _
13630 (let ((dir "xbean-reflect/src/main/java/org/apache/xbean/recipe/"))
13631 ;; org.apache.xbean.asm6 is actually repackaged java-asm
13632 (substitute* (string-append dir "XbeanAsmParameterNameLoader.java")
13633 (("org.apache.xbean.asm5") "org.objectweb.asm"))
13634 #t)))
13635 (replace 'install (install-from-pom "xbean-reflect/pom.xml")))))
13636 (inputs
13637 `(("asm" ,java-asm)
13638 ("log4j" ,java-log4j-api)
13639 ("log4j-1.2" ,java-log4j-1.2-api)
13640 ("log4j-core" ,java-log4j-core)
13641 ("logging" ,java-commons-logging-minimal)))
13642 (propagated-inputs
13643 (list java-geronimo-parent-pom))
13644 (native-inputs
13645 `(("junit" ,java-junit)))
13646 (home-page "https://geronimo.apache.org/maven/xbean/3.6/xbean-reflect/")
13647 (synopsis "Dependency injection helper")
13648 (description "Xbean-reflect provides very flexible ways to create objects
13649and graphs of objects for dependency injection frameworks")
13650 (license license:asl2.0)))
13651
13652(define-public java-geronimo-genesis-2.1
13653 (package
13654 (name "java-geronimo-genesis")
13655 (version "2.1")
13656 (source (origin
13657 (method svn-fetch)
13658 (uri (svn-reference
13659 (url (string-append "https://svn.apache.org/repos/asf/"
13660 "geronimo/genesis/tags/genesis-"
13661 version))
13662 (revision 1807396)))
13663 (file-name (string-append name "-" version "-source"))
13664 (sha256
13665 (base32
13666 "1mky4zyl2xsqlgrkairaj5971byvhwk2z9bq8snsgvlr11ydc0zf"))))
13667 (build-system ant-build-system)
13668 (arguments
13669 `(#:tests? #f
13670 #:phases
13671 (modify-phases %standard-phases
13672 (delete 'configure)
13673 (delete 'build)
13674 (replace 'install
13675 (install-pom-file "pom.xml"))
13676 (add-after 'install 'install-enforcer-rules
13677 (install-pom-file "genesis-enforcer-rules/pom.xml"))
13678 (add-after 'install 'install-flava
13679 (install-pom-file "genesis-default-flava/pom.xml"))
13680 (add-after 'install 'install-packaging
13681 (install-pom-file "genesis-packaging/pom.xml"))
13682 (add-after 'install-flava 'install-flava-java4
13683 (install-pom-file "genesis-default-flava/genesis-java1.4-flava/pom.xml"))
13684 (add-after 'install-flava 'install-flava-java5
13685 (install-pom-file "genesis-default-flava/genesis-java5-flava/pom.xml"))
13686 (add-after 'install-flava 'install-flava-java6
13687 (install-pom-file "genesis-default-flava/genesis-java6-flava/pom.xml")))))
13688 (propagated-inputs
13689 `(("apache-parent-pom" ,apache-parent-pom-13)))
13690 (home-page "https://geronimo.apache.org")
13691 (synopsis "Collection of maven POM files for the Geronimo project")
13692 (description "Apache Geronimo is a server runtime. This package contains
13693only pom files used by other components in the Geronimo project.")
13694 (license license:asl2.0)))
13695
13696(define java-geronimo-parent-pom
13697 (package
13698 (inherit java-geronimo-xbean-reflect)
13699 (name "java-geronimo-parent-pom")
13700 (arguments
13701 `(#:tests? #f
13702 #:phases
13703 (modify-phases %standard-phases
13704 (delete 'configure)
13705 (delete 'build)
13706 (replace 'install
13707 (install-pom-file "pom.xml")))))
13708 (propagated-inputs
13709 `(("java-geronimo-genesis" ,java-geronimo-genesis-2.1)))))
13710
13711(define-public java-geronimo-xbean-bundleutils
13712 (package
13713 (inherit java-geronimo-xbean-reflect)
13714 (name "java-geronimo-xbean-bundleutils")
13715 (arguments
13716 `(#:jar-name "geronimo-xbean-bundleutils.jar"
13717 #:source-dir "xbean-bundleutils/src/main/java"
13718 #:test-dir "xbean-bundleutils/src/test"
13719 #:phases
13720 (modify-phases %standard-phases
13721 (add-before 'build 'fix-java
13722 (lambda _
13723 ;; We use a more recent version of osgi, so this file requires
13724 ;; more interface method implementations.
13725 (substitute* "xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java"
13726 (("import org.osgi.framework.ServiceRegistration;")
13727 "import org.osgi.framework.ServiceRegistration;
13728import org.osgi.framework.ServiceFactory;
13729import java.util.Collection;
13730import org.osgi.framework.ServiceObjects;")
13731 (("public Bundle getBundle\\(\\)")
13732 "@Override
13733public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
13734 throw new UnsupportedOperationException();
13735}
13736@Override
13737public <S> ServiceRegistration<S> registerService(Class<S> clazz,
13738 ServiceFactory<S> factory, Dictionary<String, ?> properties) {
13739 throw new UnsupportedOperationException();
13740}
13741public Bundle getBundle()"))
13742 #t)))))
13743 (inputs
13744 `(("java-slf4j" ,java-slf4j-api)
13745 ("java-asm" ,java-asm)
13746 ("java-osgi-framework" ,java-osgi-framework)
13747 ("java-eclipse-osgi" ,java-eclipse-osgi)
13748 ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)))))
13749
13750(define-public java-geronimo-xbean-asm-util
13751 (package
13752 (inherit java-geronimo-xbean-reflect)
13753 (name "java-geronimo-xbean-asm-util")
13754 (arguments
13755 `(#:jar-name "geronimo-xbean-asm-util.jar"
13756 #:source-dir "xbean-asm-util/src/main/java"
13757 #:tests? #f)); no tests
13758 (inputs
13759 (list java-asm))
13760 (native-inputs '())))
13761
13762(define-public java-geronimo-xbean-finder
13763 (package
13764 (inherit java-geronimo-xbean-reflect)
13765 (name "java-geronimo-xbean-finder")
13766 (arguments
13767 `(#:jar-name "geronimo-xbean-finder.jar"
13768 #:source-dir "xbean-finder/src/main/java"
13769 #:test-dir "xbean-finder/src/test"))
13770 (inputs
13771 (list java-slf4j-api
13772 java-asm
13773 java-geronimo-xbean-bundleutils
13774 java-geronimo-xbean-asm-util
13775 java-osgi-service-packageadmin
13776 java-osgi-framework))
13777 (native-inputs
13778 (list java-junit java-hamcrest-core))))
13779
13780(define-public java-simplevalidation-1.14.1
13781 (package
13782 (name "java-simplevalidation")
13783 (version "1.14.1")
13784 (source
13785 (origin
13786 (method git-fetch)
13787 (uri (git-reference
13788 (url "https://github.com/timboudreau/simplevalidation.git")
13789 (commit "7a9d6adbac685b34746aaa72b20a1e639b89c733")))
13790 (file-name (git-file-name "java-simplevalidation" version))
13791 (sha256
13792 (base32 "1l0h2a6brzh4qrkjjxpiijjspapd1s7wr9pqzzwgh6qisjgb176w"))
13793 (patches
13794 (search-patches "java-simplevalidation-1.14.1.patch"))
13795 (modules '((guix build utils)))
13796 (snippet
13797 '(begin
13798 (for-each delete-file (find-files "." "\\.jar$"))
13799 #t))))
13800 (build-system ant-build-system)
13801 (arguments
13802 (list
13803 #:jdk openjdk17
13804 #:tests? #f
13805 #:modules
13806 '((guix build utils)
13807 (guix build ant-build-system)
13808 (guix build java-utils)
13809 (srfi srfi-13))
13810 #:phases
13811 #~(modify-phases %standard-phases
13812 (replace 'build
13813 (lambda _
13814 (define build-root (getcwd))
13815 (define (normalize-path file)
13816 (if (string-prefix? "./" file)
13817 (substring file 2)
13818 file))
13819 (define (copy-resources source-root class-root)
13820 (with-directory-excursion source-root
13821 (for-each
13822 (lambda (file)
13823 (unless (string-suffix? ".java" file)
13824 (let* ((relative (normalize-path file))
13825 (destination
13826 (string-append class-root "/" relative)))
13827 (mkdir-p (dirname destination))
13828 (copy-file file destination))))
13829 (find-files "." ".*"))))
13830 (define (compile-tree source-root class-root classpath)
13831 (mkdir-p class-root)
13832 (copy-resources source-root class-root)
13833 (with-directory-excursion source-root
13834 (let ((sources (find-files "." "\\.java$")))
13835 (apply invoke "javac"
13836 (append
13837 (list "-d" class-root)
13838 (if classpath
13839 (list "-cp" classpath)
13840 '())
13841 sources)))))
13842 (let* ((nbstubs-classes (string-append build-root "/build/nbstubs"))
13843 (core-classes (string-append build-root "/build/core"))
13844 (swing-classes (string-append build-root "/build/swing"))
13845 (nbstubs-jar (string-append build-root
13846 "/build/nbstubs-1.14.1.jar"))
13847 (core-jar (string-append build-root
13848 "/build/simplevalidation-1.14.1.jar"))
13849 (swing-jar
13850 (string-append build-root
13851 "/build/simplevalidation-swing-1.14.1.jar"))
13852 (converter-services
13853 (string-append
13854 swing-classes
13855 "/META-INF/services/org.netbeans.validation.api.conversion.Converter")))
13856 (compile-tree "nbstubs/src" nbstubs-classes #f)
13857 (invoke "jar" "-cf" nbstubs-jar "-C" nbstubs-classes ".")
13858 (compile-tree "ValidationAPI/src" core-classes #f)
13859 (invoke "jar" "-cf" core-jar "-C" core-classes ".")
13860 (compile-tree "simplevalidation-swing/src/main/java"
13861 swing-classes
13862 (string-append core-classes ":" nbstubs-classes))
13863 (mkdir-p (dirname converter-services))
13864 (call-with-output-file converter-services
13865 (lambda (port)
13866 (for-each
13867 (lambda (line)
13868 (display line port)
13869 (newline port))
13870 '("org.netbeans.validation.api.conversion.swing.SelectedIndicesToButtonModelArrayConverter"
13871 "org.netbeans.validation.api.conversion.swing.SelectedIndicesToListSelectionModelConverter"
13872 "org.netbeans.validation.api.conversion.swing.StringToComboBoxModelConverter"
13873 "org.netbeans.validation.api.conversion.swing.StringToDocumentConverter"))))
13874 (invoke "jar" "-cf" swing-jar "-C" swing-classes ".")
13875 #t)))
13876 (replace 'install
13877 (lambda* (#:key inputs outputs #:allow-other-keys)
13878 ((install-pom-file "pom.xml")
13879 #:inputs inputs
13880 #:outputs outputs)
13881 ((install-from-pom "nbstubs/pom.xml")
13882 #:inputs inputs
13883 #:outputs outputs)
13884 ((install-from-pom "ValidationAPI/pom.xml")
13885 #:inputs inputs
13886 #:outputs outputs)
13887 ((install-from-pom "simplevalidation-swing/pom.xml")
13888 #:inputs inputs
13889 #:outputs outputs)
13890 #t)))))
13891 (home-page "https://github.com/timboudreau/simplevalidation/")
13892 (synopsis "Simple Validation libraries for Swing forms")
13893 (description
13894 "This package builds the Simple Validation core and Swing adapter
13895libraries from source.")
13896 (license license:asl2.0)))
13897
13898(define-public java-lucene-core-3.6.2
13899 (package
13900 (name "java-lucene-core")
13901 (version "3.6.2")
13902 (source
13903 (origin
13904 (method url-fetch)
13905 (uri (string-append "https://archive.apache.org/dist/lucene/solr/"
13906 version "/apache-solr-" version "-src.tgz"))
13907 (sha256
13908 (base32 "032dfpk7likiwb9pnlr518wwlyxn57i5wyp18mi32320vsprd4r0"))))
13909 (build-system ant-build-system)
13910 (arguments
13911 (list
13912 #:tests? #f
13913 #:phases
13914 #~(modify-phases %standard-phases
13915 (replace 'build
13916 (lambda _
13917 (let ((jar-file (string-append (getcwd) "/build/lucene-core-"
13918 #$version ".jar")))
13919 (mkdir-p "build")
13920 (with-directory-excursion "lucene/core"
13921 (mkdir-p "build/classes")
13922 (apply invoke "javac" "-d" "build/classes"
13923 (find-files "src/java" "\\.java$"))
13924 (invoke "jar" "-cf" jar-file "-C" "build/classes" "."))
13925 #t)))
13926 (replace 'install
13927 (install-jars "build")))))
13928 (home-page "https://lucene.apache.org/core/")
13929 (synopsis "Apache Lucene core library")
13930 (description
13931 "This package provides the Apache Lucene 3.6.2 core library, built
13932entirely from source.")
13933 (license license:asl2.0)))
13934
13935(define-public java-json-simple-1.1.1
13936 (package
13937 (name "java-json-simple")
13938 (version "1.1.1")
13939 (source
13940 (origin
13941 (method git-fetch)
13942 (uri (git-reference
13943 (url "https://github.com/fangyidong/json-simple.git")
13944 (commit "tag_release_1_1_1")))
13945 (file-name (git-file-name name version))
13946 (sha256
13947 (base32 "1c598dvms70fs6w3l1dc0z7lqq3hndd5250ciwqm8xk3zbx465kf"))))
13948 (build-system ant-build-system)
13949 (arguments
13950 (list
13951 #:tests? #f
13952 #:build-target "jar"
13953 #:phases
13954 #~(modify-phases %standard-phases
13955 (replace 'install
13956 (install-from-pom "pom.xml")))))
13957 (home-page "https://github.com/fangyidong/json-simple")
13958 (synopsis "Simple JSON toolkit for Java")
13959 (description
13960 "JSON.simple is a small JSON parser and encoder for Java.")
13961 (license license:asl2.0)))
13962
13963(define-public java-gson
13964 (package
13965 (name "java-gson")
13966 (version "2.8.2")
13967 (source (origin
13968 (method url-fetch)
13969 (uri (string-append "https://github.com/google/gson/archive/"
13970 "gson-parent-" version ".tar.gz"))
13971 (sha256
13972 (base32
13973 "1j4qnp7v046q0k48c4kyf69sxaasx2h949d3cqwsm3kzxms3x0f9"))))
13974 (build-system ant-build-system)
13975 (arguments
13976 `(#:jar-name "gson.jar"
13977 #:source-dir "gson/src/main/java"
13978 #:test-dir "gson/src/test"))
13979 (native-inputs
13980 (list java-junit java-hamcrest-core))
13981 (home-page "https://github.com/google/gson")
13982 (synopsis "Java serialization/deserialization library from/to JSON")
13983 (description "Gson is a Java library that can be used to convert Java
13984Objects into their JSON representation. It can also be used to convert a JSON
13985string to an equivalent Java object. Gson can work with arbitrary Java objects
13986including pre-existing objects that you do not have source-code of.")
13987 (license license:asl2.0)))
13988
13989;; This requires a different Java version than 2.8.2 above
13990(define-public java-gson-2.8.6
13991 (package
13992 (inherit java-gson)
13993 (name "java-gson")
13994 (version "2.8.6")
13995 (source (origin
13996 (method git-fetch)
13997 (uri (git-reference
13998 (url "https://github.com/google/gson")
13999 (commit (string-append "gson-parent-" version))))
14000 (file-name (git-file-name name version))
14001 (sha256
14002 (base32
14003 "0kk5p3vichdb0ph1lzknrcpbklgnmq455mngmjpxvvj29p3rgpk3"))))
14004 (arguments
14005 `(#:jar-name "gson.jar"
14006 #:jdk ,openjdk11
14007 #:source-dir "gson/src/main/java"
14008 #:test-dir "gson/src/test"
14009 #:phases
14010 (modify-phases %standard-phases
14011 ;; avoid Maven dependency
14012 (add-before 'build 'fill-template
14013 (lambda _
14014 (with-directory-excursion "gson/src/main"
14015 (copy-file "java-templates/com/google/gson/internal/GsonBuildConfig.java"
14016 "java/com/google/gson/internal/GsonBuildConfig.java")
14017 (substitute* "java/com/google/gson/internal/GsonBuildConfig.java"
14018 (("\\$\\{project.version\\}") ,version))))))))))
14019
14020(define-public java-hawtjni
14021 (package
14022 (name "java-hawtjni")
14023 (version "1.15")
14024 (source (origin
14025 (method url-fetch)
14026 (uri (string-append "https://github.com/fusesource/hawtjni/archive/"
14027 "hawtjni-project-" version ".tar.gz"))
14028 (sha256
14029 (base32
14030 "1bqfd732rmh6svyx17fpw9175gc9gzkcbyps2yyrf50c3zzjas6g"))))
14031 (build-system ant-build-system)
14032 (arguments
14033 `(#:jar-name "hawtjni.jar"
14034 #:source-dir "hawtjni-generator/src/main/java:hawtjni-runtime/src/main/java"
14035 #:tests? #f; no tests
14036 #:phases
14037 (modify-phases %standard-phases
14038 (add-before 'build 'build-native
14039 (lambda* (#:key inputs #:allow-other-keys)
14040 (let ((include (string-append "-I" (assoc-ref inputs "jdk") "/include/linux")))
14041 (with-directory-excursion "hawtjni-generator/src/main/resources/"
14042 (invoke "gcc" "-c" "hawtjni.c" "-o" "hawtjni.o"
14043 "-fPIC" "-O2" include)
14044 (invoke "gcc" "-c" "hawtjni-callback.c" "-o" "hawtjni-callback.o"
14045 "-fPIC" "-O2" include)
14046 (invoke "gcc" "-o" "libhawtjni.so" "-shared"
14047 "hawtjni.o" "hawtjni-callback.o")))
14048 #t))
14049 (add-after 'install 'install-native
14050 (lambda* (#:key outputs #:allow-other-keys)
14051 (let* ((out (assoc-ref outputs "out"))
14052 (lib (string-append out "/lib"))
14053 (inc (string-append out "/include")))
14054 (with-directory-excursion "hawtjni-generator/src/main/resources/"
14055 (install-file "libhawtjni.so" lib)
14056 (install-file "hawtjni.h" inc)))
14057 #t))
14058 (add-before 'install 'install-parent
14059 (install-pom-file "pom.xml"))
14060 (replace 'install
14061 (install-from-pom "hawtjni-runtime/pom.xml")))))
14062 (inputs
14063 (list java-commons-cli java-asm java-geronimo-xbean-finder))
14064 (home-page "https://fusesource.github.io/hawtjni/")
14065 (synopsis "JNI code generator")
14066 (description "HawtJNI is a code generator that produces the JNI code needed
14067to implement Java native methods. It is based on the jnigen code generator
14068that is part of the SWT Tools project.")
14069 (license license:asl2.0)))
14070
14071(define-public java-jansi-native
14072 (package
14073 (name "java-jansi-native")
14074 (version "1.7")
14075 (source (origin
14076 (method url-fetch)
14077 (uri (string-append "https://github.com/fusesource/jansi-native/"
14078 "archive/jansi-native-" version ".tar.gz"))
14079 (sha256
14080 (base32
14081 "0j2ydlgxbzbgshqkwghbxxxnbnx1mmjgd6k5fw6xfvxw1z956yqf"))))
14082 (build-system ant-build-system)
14083 (arguments
14084 `(#:jar-name "jansi-native.jar"
14085 #:source-dir "src/main/java"
14086 #:tests? #f; no tests
14087 #:phases
14088 (modify-phases %standard-phases
14089 (add-before 'build 'build-native
14090 (lambda* (#:key inputs #:allow-other-keys)
14091 ;; there are more required files for windows in windows/
14092 (with-directory-excursion "src/main/native-package/src"
14093 (substitute* "jansi_ttyname.c"
14094 (("#include \"jansi_.*") ""))
14095 (invoke "gcc" "-c" "jansi_ttyname.c" "-o" "jansi_ttyname.o"
14096 (string-append "-I" (assoc-ref inputs "java-hawtjni")
14097 "/include")
14098 (string-append "-I" (assoc-ref inputs "jdk")
14099 "/include/linux")
14100 "-fPIC" "-O2")
14101 (invoke "gcc" "-o" "libjansi.so" "-shared" "jansi_ttyname.o"))))
14102 (add-before 'build 'install-native
14103 (lambda _
14104 (let ((dir (string-append "build/classes/META-INF/native/"
14105 ,(match (%current-system)
14106 ((or "i686-linux" "armhf-linux")
14107 "linux32")
14108 ((or "x86_64-linux" "aarch64-linux"
14109 "mips64el-linux")
14110 "linux64")
14111 (_ "unknown-kernel")))))
14112 (install-file "src/main/native-package/src/libjansi.so" dir))
14113 #t))
14114 (add-after 'install 'install-native
14115 (lambda* (#:key outputs #:allow-other-keys)
14116 (install-file "src/main/native-package/src/jansi.h"
14117 (string-append (assoc-ref outputs "out") "/include"))
14118 #t))
14119 (add-before 'install 'fix-pom
14120 (lambda _
14121 ;; pom contains variables to complete name, but we don't support that
14122 (substitute* "pom.xml"
14123 (("\\$\\{platform\\}") "native"))
14124 #t))
14125 (replace 'install
14126 (install-from-pom "pom.xml")))))
14127 (propagated-inputs
14128 (list java-hawtjni))
14129 (home-page "https://fusesource.github.io/jansi/")
14130 (synopsis "Native library for jansi")
14131 (description "This package provides the native library for jansi, a small
14132Java library that allows you to use ANSI escape sequences to format your
14133console output.")
14134 (license license:asl2.0)))
14135
14136(define-public java-jansi
14137 (package
14138 (name "java-jansi")
14139 (version "2.4.0")
14140 (source (origin
14141 (method git-fetch)
14142 (uri (git-reference
14143 (url "https://github.com/fusesource/jansi")
14144 (commit (string-append "jansi-" version))))
14145 (file-name (git-file-name name version))
14146 (sha256
14147 (base32
14148 "1s6fva06990798b5fyxqzr30zwyj1byq5wrm54j2larcydaryggf"))
14149 (modules '((guix build utils)))
14150 (snippet
14151 ;; contains pre-compiled libraries
14152 '(delete-file-recursively
14153 "src/main/resources/org/fusesource/jansi/internal"))))
14154 (build-system ant-build-system)
14155 (arguments
14156 `(#:jar-name "jansi.jar"
14157 #:source-dir "src/main/java"
14158 #:test-dir "src/test"
14159 #:tests? #f; require junit 3
14160 #:phases
14161 (modify-phases %standard-phases
14162 (add-before 'build 'build-native
14163 (lambda* (#:key inputs #:allow-other-keys)
14164 (with-directory-excursion "src/main/native"
14165 (for-each
14166 (lambda (cfile)
14167 (let ((cfile (basename cfile))
14168 (ofile (string-append (basename cfile ".c") ".o")))
14169 (invoke ,(cc-for-target) "-c" cfile "-o" ofile
14170 (string-append "-I" (assoc-ref inputs "jdk")
14171 "/include/linux")
14172 "-fPIC" "-O2")))
14173 (find-files "." "\\.c$"))
14174 (apply invoke ,(cc-for-target) "-o" "libjansi.so" "-shared"
14175 (find-files "." "\\.o$")))))
14176 (add-before 'build 'install-native
14177 (lambda _
14178 (let ((dir (string-append "build/classes/org/fusesource/"
14179 "jansi/internal/native/"
14180 ,(match (or (%current-target-system) (%current-system))
14181 ("i686-linux" "Linux/x86")
14182 ("x86_64-linux" "Linux/x86_64")
14183 ("armhf-linux" "Linux/armv7")
14184 ("aarch64-linux" "Linux/arm64")
14185 ("mips64el-linux" "Linux/mips64")
14186 (_ "unknown-kernel")))))
14187 (install-file "src/main/native/libjansi.so" dir))))
14188 (add-before 'build 'copy-resources
14189 (lambda _
14190 (copy-recursively "src/main/resources" "build/classes")))
14191 (replace 'install
14192 (install-from-pom "pom.xml")))))
14193 (home-page "https://fusesource.github.io/jansi/")
14194 (synopsis "Portable ANSI escape sequences")
14195 (description "Jansi is a Java library that allows you to use ANSI escape
14196sequences to format your console output which works on every platform.")
14197 (license license:asl2.0)))
14198
14199(define-public java-jansi-1
14200 (package
14201 (inherit java-jansi)
14202 (version "1.16")
14203 (source (origin
14204 (method git-fetch)
14205 (uri (git-reference
14206 (url "https://github.com/fusesource/jansi")
14207 (commit (string-append "jansi-project-" version))))
14208 (file-name (git-file-name "jansi" version))
14209 (sha256
14210 (base32
14211 "0ikk0x352gh30b42qn1jd89xwsjj0mavrc5kms7fss15bd8vsayx"))))
14212 (arguments
14213 `(#:jar-name "jansi.jar"
14214 #:source-dir "jansi/src/main/java"
14215 #:test-dir "jansi/src/test"
14216 #:phases
14217 (modify-phases %standard-phases
14218 (add-after 'check 'clear-term
14219 (lambda _
14220 (invoke "echo" "-e" "\\e[0m")))
14221 (add-before 'install 'install-parent
14222 (install-pom-file "pom.xml"))
14223 (add-before 'install 'fix-pom
14224 (lambda _
14225 ;; pom adds jansi native versions for different platforms, but we
14226 ;; only need one, so use native instead
14227 (substitute* "jansi/pom.xml"
14228 (("windows32") "native")
14229 (("windows64") "native")
14230 (("osx") "native")
14231 (("linux32") "native")
14232 (("linux64") "native")
14233 (("freebsd32") "native")
14234 (("freebsd64") "native"))
14235 #t))
14236 (replace 'install
14237 (install-from-pom "jansi/pom.xml")))))
14238 (propagated-inputs
14239 (list java-jansi-native))
14240 (native-inputs
14241 (list java-junit java-hamcrest-core))))
14242
14243(define-public java-jboss-el-api-spec
14244 (package
14245 (name "java-jboss-el-api-spec")
14246 (version "3.0")
14247 (source (origin
14248 (method url-fetch)
14249 (uri (string-append "https://github.com/jboss/jboss-el-api_spec/"
14250 "archive/jboss-el-api_" version
14251 "_spec-1.0.7.Final.tar.gz"))
14252 (sha256
14253 (base32
14254 "1j45ljxalwlibxl7g7iv952sjxkw275m8vyxxij8l6wdd5pf0pdh"))))
14255 (build-system ant-build-system)
14256 (arguments
14257 `(#:jar-name "java-jboss-el-api_spec.jar"
14258 #:phases
14259 (modify-phases %standard-phases
14260 ;; the origin of javax.el:javax.el-api is unknown, so we use this package
14261 ;; instead, which implements the same thing. We override the pom file
14262 ;; to "rename" the package so it can be found by maven.
14263 (add-before 'install 'override-pom
14264 (generate-pom.xml "pom.xml" "javax.el" "javax.el-api" "3.0"
14265 #:name "el-api"))
14266 (replace 'install
14267 (install-from-pom "pom.xml")))))
14268 (inputs
14269 (list java-junit))
14270 (home-page "https://github.com/jboss/jboss-el-api_spec")
14271 (synopsis "JSR-341 expression language 3.0 API")
14272 (description "This package contains an implementation of the JSR-341
14273specification for the expression language 3.0. It implements an expression
14274language inspired by ECMAScript and XPath. This language is used with
14275JavaServer Pages (JSP).")
14276 ;; Either GPL2 only or CDDL.
14277 (license (list license:gpl2 license:cddl1.1))))
14278
14279(define-public java-jboss-interceptors-api-spec
14280 (package
14281 (name "java-jboss-interceptors-api-spec")
14282 (version "1.2")
14283 (source (origin
14284 (method url-fetch)
14285 (uri (string-append "https://github.com/jboss/jboss-interceptors-api_spec/"
14286 "archive/jboss-interceptors-api_" version
14287 "_spec-1.0.0.Final.tar.gz"))
14288 (sha256
14289 (base32
14290 "0wv8x0jp9a5qxlrgkhb5jdk2gr6vi87b4j4kjb8ryxiy9gn8g51z"))))
14291 (build-system ant-build-system)
14292 (arguments
14293 `(#:jar-name "java-jboss-interceptors-api_spec.jar"
14294 #:jdk ,icedtea-8
14295 #:source-dir "."
14296 #:tests? #f; no tests
14297 #:phases
14298 (modify-phases %standard-phases
14299 ;; the origin of javax.interceptor:javax.interceptor-api is unknown,
14300 ;; so we use this package instead, which implements the same thing.
14301 ;; We override the pom file to "rename" the package so it can be found
14302 ;; by maven.
14303 (add-before 'install 'override-pom
14304 (generate-pom.xml "pom.xml" "javax.interceptor" "javax.interceptor-api"
14305 "3.0" #:name "interceptor-api"))
14306 (replace 'install
14307 (install-from-pom "pom.xml")))))
14308 (home-page "https://github.com/jboss/jboss-interceptors-api_spec")
14309 (synopsis "Interceptors 1.2 API classes from JSR 318")
14310 (description "Java-jboss-interceptors-api-spec implements the Interceptors
14311API. Interceptors are used to interpose on business method invocations and
14312specific events.")
14313 ;; Either GPL2 only or CDDL.
14314 (license (list license:gpl2 license:cddl1.1))))
14315
14316(define-public java-cdi-api
14317 (package
14318 (name "java-cdi-api")
14319 (version "2.0")
14320 (source (origin
14321 (method url-fetch)
14322 (uri (string-append "https://github.com/cdi-spec/cdi/archive/"
14323 version ".tar.gz"))
14324 (file-name (string-append name "-" version ".tar.gz"))
14325 (sha256
14326 (base32
14327 "1iv8b8bp07c5kmqic14jsr868vycjv4qv02lf3pkgp9z21mnfg5y"))))
14328 (build-system ant-build-system)
14329 (arguments
14330 `(#:source-dir "api/src/main/java"
14331 #:jar-name "java-cdi-api.jar"
14332 #:test-dir "api/src/test"
14333 #:jdk ,icedtea-8
14334 #:tests? #f; Tests fail because we don't have a CDI provider yet
14335 #:phases
14336 (modify-phases %standard-phases
14337 (replace 'install
14338 (install-from-pom "api/pom.xml")))))
14339 (propagated-inputs
14340 (list java-javax-inject java-jboss-el-api-spec
14341 java-jboss-interceptors-api-spec java-weld-parent-pom))
14342 (native-inputs
14343 (list java-testng java-hamcrest-core))
14344 (home-page "https://cdi-spec.org/")
14345 (synopsis "Contexts and Dependency Injection APIs")
14346 (description "Java-cdi-api contains the required APIs for Contexts and
14347Dependency Injection (CDI).")
14348 (license license:asl2.0)))
14349
14350(define-public java-joda-convert
14351 (package
14352 (name "java-joda-convert")
14353 (version "1.9.2")
14354 (source (origin
14355 (method url-fetch)
14356 (uri (string-append "https://github.com/JodaOrg/joda-convert/archive/v"
14357 version ".tar.gz"))
14358 (file-name (string-append name "-" version ".tar.gz"))
14359 (sha256
14360 (base32
14361 "0vp346xz7dh9br4q7xazhc7hvzf76a6hf95fki9bg67q5jr0kjh7"))))
14362 (build-system ant-build-system)
14363 (arguments
14364 `(#:jar-name (string-append ,name "-" ,version ".jar")
14365 #:source-dir "src/main/java"
14366 #:test-include (list "**/Test*.java")
14367 ;; Contains only interfaces and base classes (no test)
14368 #:test-exclude (list "**/test*/**.java")))
14369 (inputs
14370 (list java-guava))
14371 (native-inputs
14372 (list java-junit java-hamcrest-core))
14373 (home-page "https://www.joda.org/joda-convert/")
14374 (synopsis "Conversion between Objects and Strings")
14375 (description "Joda-Convert provides a small set of classes to aid
14376conversion between Objects and Strings. It is not intended to tackle the
14377wider problem of Object to Object transformation.")
14378 (license license:asl2.0)))
14379
14380(define-public java-joda-time
14381 (package
14382 (name "java-joda-time")
14383 (version "2.9.9")
14384 (source (origin
14385 (method url-fetch)
14386 (uri (string-append "https://github.com/JodaOrg/joda-time/archive/v"
14387 version ".tar.gz"))
14388 (file-name (string-append name "-" version ".tar.gz"))
14389 (sha256
14390 (base32
14391 "1i9x91mi7yg2pasl0k3912f1pg46n37sps6rdb0v1gs8hj9ppwc1"))))
14392 (build-system ant-build-system)
14393 (arguments
14394 `(#:jar-name "java-joda-time.jar"
14395 #:source-dir "src/main/java"
14396 #:test-include (list "**/Test*.java")
14397 ;; There is no runnable test in these files
14398 #:test-exclude (list "**/Test*Chronology.java" "**/Test*Field.java")
14399 #:phases
14400 (modify-phases %standard-phases
14401 (add-after 'build 'build-resources
14402 (lambda _
14403 (mkdir-p "build/classes/org/joda/time/tz/data")
14404 (mkdir-p "build/classes/org/joda/time/format")
14405 ;; This will produce the following exception:
14406 ;; java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap"
14407 ;; which is normal, because it doesn't exist yet. It still generates
14408 ;; the same file as in the binary one can find on maven.
14409 (invoke "java" "-cp"
14410 (string-append "build/classes:" (getenv "CLASSPATH"))
14411 "org.joda.time.tz.ZoneInfoCompiler"
14412 "-src" "src/main/java/org/joda/time/tz/src"
14413 "-dst" "build/classes/org/joda/time/tz/data"
14414 "africa" "antarctica" "asia" "australasia"
14415 "europe" "northamerica" "southamerica"
14416 "pacificnew" "etcetera" "backward" "systemv")
14417 (for-each (lambda (f)
14418 (copy-file f (string-append
14419 "build/classes/org/joda/time/format/"
14420 (basename f))))
14421 (find-files "src/main/java/org/joda/time/format" ".*.properties"))
14422 #t))
14423 (add-before 'install 'regenerate-jar
14424 (lambda _
14425 ;; We need to regenerate the jar file to add generated data.
14426 (delete-file "build/jar/java-joda-time.jar")
14427 (invoke "ant" "jar")))
14428 (add-before 'check 'copy-test-resources
14429 (lambda _
14430 (mkdir-p "build/test-classes/org/joda/time/tz/data")
14431 (copy-file "src/test/resources/tzdata/ZoneInfoMap"
14432 "build/test-classes/org/joda/time/tz/data/ZoneInfoMap")
14433 (copy-recursively "src/test/resources" "build/test-classes")
14434 #t)))))
14435 (inputs
14436 (list java-joda-convert))
14437 (native-inputs
14438 (list java-junit java-hamcrest-core tzdata))
14439 (home-page "https://www.joda.org/joda-time/")
14440 (synopsis "Replacement for the Java date and time classes")
14441 (description "Joda-Time is a replacement for the Java date and time
14442classes prior to Java SE 8.")
14443 (license license:asl2.0)))
14444
14445(define-public java-xerces
14446 (package
14447 (name "java-xerces")
14448 (version "2.12.2")
14449 (source
14450 (origin
14451 (method url-fetch)
14452 (uri (string-append "mirror://apache/xerces/j/source/"
14453 "Xerces-J-src." version ".tar.gz"))
14454 (sha256
14455 (base32 "1s2fnfx5flmhs3q30bxdsa6vs52m6vbnqd3m4cc5r4wfr3afplbd"))
14456 (patches (search-patches
14457 "java-xerces-xjavac_taskdef.patch"
14458 "java-xerces-build_dont_unzip.patch"
14459 "java-xerces-bootclasspath.patch"))))
14460 (build-system ant-build-system)
14461 (arguments
14462 `(#:tests? #f;; Test files are not present
14463 #:test-target "test"
14464 #:jdk ,icedtea-8
14465 #:phases
14466 (modify-phases %standard-phases
14467 (add-after 'unpack 'create-build.properties
14468 (lambda* (#:key inputs #:allow-other-keys)
14469 (let ((jaxp (assoc-ref inputs "java-jaxp"))
14470 (resolver (assoc-ref inputs "java-apache-xml-commons-resolver")))
14471 (with-output-to-file "build.properties"
14472 (lambda _
14473 (format #t
14474 "jar.jaxp = ~a/share/java/jaxp.jar~@
14475 jar.apis-ext = ~a/share/java/jaxp.jar~@
14476 jar.resolver = ~a/share/java/xml-resolver.jar~%"
14477 jaxp jaxp resolver)))
14478 ;; Make xerces use our version of jaxp in tests
14479 (substitute* "build.xml"
14480 (("xml-apis.jar")
14481 (string-append jaxp "/share/java/jaxp.jar"))
14482 (("\\$\\{tools.dir\\}/\\$\\{jar.apis\\}")
14483 "${jar.apis}")))
14484 #t))
14485 (replace 'install (install-jars "build")))))
14486 (inputs
14487 (list java-apache-xml-commons-resolver java-jaxp))
14488 (home-page "https://xerces.apache.org/xerces2-j/")
14489 (synopsis "Validating XML parser for Java with DOM level 3 support")
14490 (description "The Xerces2 Java parser is the reference implementation of
14491XNI, the Xerces Native Interface, and also a fully conforming XML Schema
14492processor.
14493
14494Xerces2-J supports the following standards and APIs:
14495
14496@itemize
14497@item eXtensible Markup Language (XML) 1.0 Second Edition Recommendation
14498@item Namespaces in XML Recommendation
14499@item Document Object Model (DOM) Level 2 Core, Events, and Traversal and
14500 Range Recommendations
14501@item Simple API for XML (SAX) 2.0.1 Core and Extension
14502@item Java APIs for XML Processing (JAXP) 1.2.01
14503@item XML Schema 1.0 Structures and Datatypes Recommendations
14504@item Experimental implementation of the Document Object Model (DOM) Level 3
14505 Core and Load/Save Working Drafts
14506@item Provides a partial implementation of the XML Inclusions (XInclude) W3C
14507 Candidate Recommendation
14508@end itemize
14509
14510Xerces is now able to parse documents written according to the XML 1.1
14511Candidate Recommendation, except that it does not yet provide an option to
14512enable normalization checking as described in section 2.13 of this
14513specification. It also handles namespaces according to the XML Namespaces 1.1
14514Candidate Recommendation, and will correctly serialize XML 1.1 documents if
14515the DOM level 3 load/save API's are in use.")
14516 (license license:asl2.0)))
14517
14518(define-public java-jakarta-regexp
14519 (package
14520 (name "java-jakarta-regexp")
14521 (version "1.5")
14522 (source
14523 (origin
14524 (method url-fetch)
14525 (uri (string-append
14526 "https://archive.apache.org/dist/jakarta/regexp/jakarta-regexp-"
14527 version ".tar.gz"))
14528 (sha256
14529 (base32
14530 "0zg9rmyif48dck0cv6ynpxv23mmcsx265am1fnnxss7brgw0ms3r"))))
14531 (build-system ant-build-system)
14532 (arguments
14533 `(#:test-target "test"
14534 #:phases
14535 (modify-phases %standard-phases
14536 (replace 'install
14537 (lambda* (#:key outputs #:allow-other-keys)
14538 (let* ((out (assoc-ref outputs "out"))
14539 (out-share (string-append out "/share/java")))
14540 (mkdir-p out-share)
14541 (for-each (lambda (name)
14542 (install-file name out-share))
14543 (find-files "build" "^jakarta-regexp-.*\\.jar$"))
14544 #t))))))
14545 (home-page "https://attic.apache.org/projects/jakarta-regexp.html")
14546 (synopsis "Regular expression parser generator for Java")
14547 (description "@code{jakarta-regexp} is an old regular expression parser
14548generator for Java.")
14549 (license license:asl2.0)))
14550
14551(define-public java-jline
14552 (package
14553 (name "java-jline")
14554 (version "1.0")
14555 (source (origin
14556 (method url-fetch)
14557 (uri (string-append "https://github.com/jline/jline1/archive/jline-"
14558 version ".tar.gz"))
14559 (sha256
14560 (base32
14561 "0bi3p6vrh7a6v0fbpb6rx9plpmx5zk3lr352xzdbz2jcxg499wir"))))
14562 (build-system ant-build-system)
14563 (arguments
14564 `(#:jar-name "jline.jar"
14565 #:source-dir "src/main/java"
14566 #:test-dir "src/test"
14567 #:phases
14568 (modify-phases %standard-phases
14569 (add-before 'build 'copy-resources
14570 (lambda _
14571 (copy-recursively "src/main/resources" "build/classes")
14572 #t)))))
14573 (native-inputs
14574 (list java-junit))
14575 (home-page "https://jline.github.io")
14576 (synopsis "Console input handling library")
14577 (description "JLine is a Java library for handling console input. It is
14578similar in functionality to BSD editline and GNU readline but with additional
14579features that bring it on par with the Z shell line editor.")
14580 (license license:bsd-3)))
14581
14582(define-public java-jline-2
14583 (package
14584 (inherit java-jline)
14585 (version "2.14.5")
14586 (source (origin
14587 (method url-fetch)
14588 (uri (string-append "https://github.com/jline/jline2/archive/jline-"
14589 version ".tar.gz"))
14590 (sha256
14591 (base32
14592 "1c6qa26mf0viw8hg4jnv72s7i1qb1gh1l8rrzcdvqhqhx82rkdlf"))))
14593 (arguments
14594 `(#:jdk ,icedtea-8
14595 ,@(package-arguments java-jline)))
14596 (inputs
14597 (list java-jansi-1 java-jansi-native))
14598 (native-inputs
14599 (list java-powermock-modules-junit4
14600 java-powermock-modules-junit4-common
14601 java-powermock-api-easymock
14602 java-powermock-api-support
14603 java-powermock-core
14604 java-powermock-reflect
14605 java-easymock
14606 java-jboss-javassist
14607 java-objenesis
14608 java-hamcrest-core
14609 java-cglib
14610 java-junit
14611 java-hawtjni))))
14612
14613(define-public java-jline-terminal
14614 (package
14615 (name "java-jline-terminal")
14616 (version "3.14.1")
14617 (source (origin
14618 (method git-fetch)
14619 (uri (git-reference
14620 (url "https://github.com/jline/jline3")
14621 (commit (string-append "jline-parent-" version))))
14622 (file-name (git-file-name name version))
14623 (sha256
14624 (base32
14625 "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr"))))
14626 (build-system ant-build-system)
14627 (arguments
14628 `(#:jar-name "jline-terminal.jar"
14629 #:jdk ,openjdk11
14630 #:tests? #f; TODO: tests fail on *.caps resource lookups
14631 #:source-dir "terminal/src/main/java"
14632 #:test-dir "terminal/src/test"
14633 #:phases
14634 (modify-phases %standard-phases
14635 (add-after 'unpack 'remove-build-file
14636 (lambda _
14637 ;; Conflicts with build directory generated by ant-build-system.
14638 (delete-file "build")))
14639 (add-after 'unpack 'patch-paths
14640 (lambda* (#:key inputs #:allow-other-keys)
14641 (substitute* "terminal/src/main/java/org/jline/utils/OSUtils.java"
14642 (("= \"infocmp\"")
14643 (string-append "= \"" (assoc-ref inputs "ncurses")
14644 "/bin/infocmp\""))
14645 (("= \"(s?tty)\"" _ cmd)
14646 (string-append "= \"" (assoc-ref inputs "coreutils")
14647 "/bin/" cmd "\"")))))
14648 ;; Resources are not added to the JAR by ant-build-system.
14649 (add-after 'build 'add-resources
14650 (lambda* (#:key jar-name source-dir #:allow-other-keys)
14651 (let ((build (string-append (getcwd) "/build")))
14652 (with-directory-excursion
14653 (string-append source-dir "/../resources")
14654 (apply invoke "jar" "-uvf"
14655 (string-append build "/jar/" jar-name)
14656 (find-files ".")))))))))
14657 (inputs
14658 (list ncurses)); infocmp
14659 (home-page "https://github.com/jline/jline3")
14660 (synopsis "Java JLine Terminal API and implementations")
14661 (description "JLine is a Java library for handling console input. It is
14662similar in functionality to BSD editline and GNU readline but with additional
14663features that bring it in par with ZSH line editor. People familiar with the
14664readline/editline capabilities for modern shells (such as bash and tcsh) will
14665find most of the command editing features of JLine to be familiar.
14666
14667This package includes the @var{Terminal} API and implementations.")
14668 (license license:bsd-3)))
14669
14670(define-public java-jline-reader
14671 (package
14672 (name "java-jline-reader")
14673 (version "3.14.1")
14674 (source (origin
14675 (method git-fetch)
14676 (uri (git-reference
14677 (url "https://github.com/jline/jline3")
14678 (commit (string-append "jline-parent-" version))))
14679 (file-name (git-file-name name version))
14680 (sha256
14681 (base32
14682 "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr"))))
14683 (build-system ant-build-system)
14684 (arguments
14685 `(#:jar-name "jline-reader.jar"
14686 #:jdk ,openjdk11
14687 #:source-dir "reader/src/main/java"
14688 #:test-dir "reader/src/test"
14689 #:phases
14690 (modify-phases %standard-phases
14691 (add-before 'build 'remove-build-file
14692 (lambda _
14693 ;; conflicts with build directory generated by ant-build-system
14694 (delete-file "build"))))))
14695 (native-inputs
14696 (list java-junit java-easymock))
14697 (inputs
14698 (list java-jline-terminal))
14699 (home-page "https://github.com/jline/jline3")
14700 (synopsis "Java JLine line reader")
14701 (description "JLine is a Java library for handling console input. It is
14702similar in functionality to BSD editline and GNU readline but with additional
14703features that bring it in par with ZSH line editor. People familiar with the
14704readline/editline capabilities for modern shells (such as bash and tcsh) will
14705find most of the command editing features of JLine to be familiar.
14706
14707This package includes the line reader.")
14708 (license license:bsd-3)))
14709
14710(define-public java-xmlunit
14711 (package
14712 (name "java-xmlunit")
14713 (version "2.5.1")
14714 (source (origin
14715 (method url-fetch)
14716 (uri (string-append "https://github.com/xmlunit/xmlunit/archive/v"
14717 version ".tar.gz"))
14718 (file-name (string-append name "-" version ".tar.gz"))
14719 (sha256
14720 (base32
14721 "035rivlnmwhfqj0fzviciv0bkh1h95ps1iwnh2kjcvdbk5nccm4z"))))
14722 (build-system ant-build-system)
14723 (arguments
14724 `(#:jar-name "java-xmlunit.jar"
14725 #:source-dir "xmlunit-core/src/main/java"
14726 #:test-dir "xmlunit-core/src/test"
14727 #:phases
14728 (modify-phases %standard-phases
14729 (add-before 'check 'copy-test-resources
14730 (lambda* (#:key inputs #:allow-other-keys)
14731 (copy-recursively (assoc-ref inputs "resources") "../test-resources")
14732 #t)))))
14733 (native-inputs
14734 `(("java-junit" ,java-junit)
14735 ("java-mockito-1" ,java-mockito-1)
14736 ("java-hamcrest-all" ,java-hamcrest-all)
14737 ("java-objenesis" ,java-objenesis)
14738 ("java-cglib" ,java-cglib)
14739 ("resources"
14740 ,(origin
14741 (method git-fetch)
14742 (uri (git-reference
14743 (url "https://github.com/xmlunit/test-resources")
14744 (commit "a590d2ae865c3e0455691d76ba8eefccc2215aec")))
14745 (file-name "java-xmlunit-test-resources")
14746 (sha256
14747 (base32
14748 "0r0glj37pg5l868yjz78gckr91cs8fysxxbp9p328dssssi91agr"))))))
14749 (home-page "https://www.xmlunit.org/")
14750 (synopsis "XML output testing")
14751 (description "XMLUnit provides you with the tools to verify the XML you
14752emit is the one you want to create. It provides helpers to validate against
14753an XML Schema, assert the values of XPath queries or compare XML documents
14754against expected outcomes.")
14755 (license license:asl2.0)))
14756
14757(define-public java-xmlunit-legacy
14758 (package
14759 (inherit java-xmlunit)
14760 (name "java-xmlunit-legacy")
14761 (arguments
14762 `(#:jar-name "java-xmlunit-legacy.jar"
14763 #:source-dir "xmlunit-legacy/src/main/java"
14764 #:test-dir "xmlunit-legacy/src/test"))
14765 (inputs
14766 (list java-xmlunit java-junit))
14767 (native-inputs
14768 `(("java-mockito-1" ,java-mockito-1)))))
14769
14770(define-public java-xmlunit-matchers
14771 (package
14772 (inherit java-xmlunit)
14773 (name "java-xmlunit-matchers")
14774 (arguments
14775 `(#:jar-name "java-xmlunit-matchers.jar"
14776 #:source-dir "xmlunit-matchers/src/main/java"
14777 #:test-dir "xmlunit-matchers/src/test"
14778 #:test-exclude
14779 ;; Cannot open xsd for http://www.xmlunit.org/test-support/Book.xsd
14780 (list "**/ValidationMatcherTest.java")
14781 #:phases
14782 (modify-phases %standard-phases
14783 (add-before 'build 'copy-test-class
14784 (lambda _
14785 (copy-file "xmlunit-core/src/test/java/org/xmlunit/TestResources.java"
14786 "xmlunit-matchers/src/test/java/org/xmlunit/TestResources.java")
14787 #t))
14788 (add-before 'build 'fix-test-resources-path
14789 (lambda _
14790 (substitute* (find-files "xmlunit-matchers/src/test" ".*.java")
14791 (("../test-resources") "test-resources"))
14792 #t))
14793 (add-before 'check 'copy-test-resources
14794 (lambda* (#:key inputs #:allow-other-keys)
14795 (copy-recursively (assoc-ref inputs "resources") "test-resources")
14796 #t)))))
14797 (inputs
14798 (list java-xmlunit java-junit))))
14799
14800(define-public java-openchart2
14801 (package
14802 (name "java-openchart2")
14803 (version "1.4.3")
14804 (source (origin
14805 (method url-fetch)
14806 (uri (string-append "http://download.approximatrix.com/openchart2/"
14807 "openchart2-" version ".source.zip"))
14808 (sha256
14809 (base32
14810 "1xq96zm5r02n1blja0072jmmsifmxc40lbyfbnmcnr6mw42frh4g"))))
14811 (build-system ant-build-system)
14812 (arguments
14813 `(#:test-target "test"
14814 #:phases
14815 (modify-phases %standard-phases
14816 (add-after 'unpack 'fix-junit-errors
14817 (lambda _
14818 (with-directory-excursion "unittest/src/com/approximatrix/charting/"
14819 (substitute* '("coordsystem/ticklocator/NumericXTickLocatorTest.java"
14820 "coordsystem/ticklocator/NumericYTickLocatorTest.java"
14821 "coordsystem/ticklocator/ObjectXTickLocatorTest.java"
14822 "model/DefaultChartDataModelConstraintsTest.java"
14823 "model/MultiScatterDataModelConstraintsTest.java"
14824 "model/threedimensional/DotPlotDataModelConstraintsTest.java")
14825 (("(assertEquals[^;]+);" before _)
14826 (string-append (string-drop-right before 2) ", 1E-6);"))))
14827 #t))
14828 (replace 'install (install-jars ".")))))
14829 (native-inputs
14830 (list unzip java-junit java-hamcrest-core))
14831 (home-page "https://approximatrix.com/products/openchart2/")
14832 (synopsis "Simple plotting for Java")
14833 (description "Openchart2 provides a simple, yet powerful, interface for
14834Java programmers to create two-dimensional charts and plots. The library
14835features an assortment of graph styles, including advanced scatter plots, bar
14836graphs, and pie charts.")
14837 (license license:lgpl2.1+)))
14838
14839(define-public java-commons-httpclient
14840 (package
14841 (name "java-commons-httpclient")
14842 (version "3.1")
14843 (source (origin
14844 (method url-fetch)
14845 (uri (string-append "mirror://apache/httpcomponents/"
14846 "commons-httpclient/source/commons-httpclient-"
14847 version "-src.tar.gz"))
14848 (sha256
14849 (base32
14850 "1wlpn3cfy3d4inxy6g7wxcsa8p7sshn6aldk9y4ia3lb879rd97r"))))
14851 (build-system ant-build-system)
14852 (arguments
14853 `(#:build-target "compile"
14854 #:test-target "test"
14855 #:tests? #f; requires junit-textui (junit 3)
14856 #:phases
14857 (modify-phases %standard-phases
14858 (add-before 'build 'fix-accent
14859 (lambda _
14860 (for-each (lambda (file)
14861 (with-fluids ((%default-port-encoding "ISO-8859-1"))
14862 (substitute* file
14863 (("\\* @author Ortwin .*") "* @author Ortwin Glueck\n"))))
14864 '("src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java"
14865 "src/examples/TrivialApp.java" "src/examples/ClientApp.java"
14866 "src/test/org/apache/commons/httpclient/TestHttps.java"
14867 "src/test/org/apache/commons/httpclient/TestURIUtil2.java"))
14868 #t))
14869 (replace 'install
14870 (lambda* (#:key outputs #:allow-other-keys)
14871 (invoke "ant" "dist"
14872 (string-append "-Ddist.home=" (assoc-ref outputs "out")
14873 "/share/java"))
14874 #t)))))
14875 (propagated-inputs
14876 `(("java-commons-logging" ,java-commons-logging-minimal)
14877 ("java-commons-codec" ,java-commons-codec)))
14878 (home-page "https://hc.apache.org")
14879 (synopsis "HTTP/1.1 compliant HTTP agent implementation")
14880 (description "This package contains an HTTP/1.1 compliant HTTP agent
14881implementation. It also provides reusable components for client-side
14882authentication, HTTP state management, and HTTP connection management.")
14883 (license license:asl2.0)))
14884
14885(define-public java-commons-vfs
14886 (package
14887 (name "java-commons-vfs")
14888 (version "2.2")
14889 (source (origin
14890 (method url-fetch)
14891 (uri (string-append "mirror://apache/commons/vfs/source/"
14892 "commons-vfs2-distribution-" version "-src.tar.gz"))
14893 (file-name (string-append name "-" version ".tar.gz"))
14894 (sha256
14895 (base32
14896 "1cnq1iaghbp4cslpnvwbp83i5v234x87irssqynhwpfgw7caf1s3"))
14897 (modules '((guix build utils)))
14898 (snippet
14899 '(begin
14900 (for-each delete-file
14901 (find-files "." "\\.jar$"))
14902 #t))))
14903 (build-system ant-build-system)
14904 (arguments
14905 `(#:jar-name "commons-vfs.jar"
14906 #:source-dir "commons-vfs2/src/main/java"
14907 #:test-dir "commons-vfs2/src/test"
14908 ; FIXME: tests depend on many things: apache sshd, hadoop, ftpserver, ...
14909 #:tests? #f
14910 #:phases
14911 (modify-phases %standard-phases
14912 (add-before 'build 'remove-hadoop-and-webdav
14913 ; Remove these files as they are not required and depend on difficult
14914 ; packages.
14915 (lambda _
14916 (for-each delete-file-recursively
14917 '("commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/webdav"
14918 "commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs"))
14919 #t)))))
14920 (inputs
14921 (list java-commons-collections4
14922 java-commons-compress
14923 java-commons-httpclient
14924 java-commons-logging-minimal
14925 java-commons-net
14926 java-jsch))
14927 (home-page "https://commons.apache.org/proper/commons-vfs/")
14928 (synopsis "Java file system library")
14929 (description "Commons VFS provides a single API for accessing various
14930different file systems. It presents a uniform view of the files from various
14931different sources, such as the files on local disk, on an HTTP server, or
14932inside a Zip archive.")
14933 (license license:asl2.0)))
14934
14935(define-public java-jakarta-oro
14936 (package
14937 (name "java-jakarta-oro")
14938 (version "2.0.8")
14939 (source (origin
14940 (method url-fetch)
14941 (uri (string-append "mirror://apache/jakarta/oro/"
14942 "jakarta-oro-" version ".tar.gz"))
14943 (sha256
14944 (base32
14945 "0rpmnsskiwmsy8r0sckz5n5dbvh3vkxx8hpm177c754r8xy3qksc"))
14946 (modules '((guix build utils)))
14947 (snippet
14948 `(begin
14949 (delete-file (string-append "jakarta-oro-" ,version ".jar"))
14950 #t))))
14951 (build-system ant-build-system)
14952 (arguments
14953 `(#:build-target "package"
14954 #:make-flags (list "-DDATE" "(no recorded date for reproducibility)")
14955 #:tests? #f; tests are run as part of the build process
14956 #:phases
14957 (modify-phases %standard-phases
14958 (replace 'install
14959 (install-jars ,(string-append "jakarta-oro-" version))))))
14960 (home-page "https://jakarta.apache.org/oro/")
14961 (synopsis "Text-processing for Java")
14962 (description "The Jakarta-ORO Java classes are a set of text-processing
14963Java classes that provide Perl5 compatible regular expressions, AWK-like
14964regular expressions, glob expressions, and utility classes for performing
14965substitutions, splits, filtering filenames, etc. This library is the successor
14966of the OROMatcher, AwkTools, PerlTools, and TextTools libraries originally
14967from ORO, Inc.")
14968 (license license:asl1.1)))
14969
14970(define-public java-native-access
14971 (package
14972 (name "java-native-access")
14973 (version "4.5.1")
14974 (source (origin
14975 (method url-fetch)
14976 (uri (string-append "https://github.com/java-native-access/jna/"
14977 "archive/" version ".tar.gz"))
14978 (file-name (string-append name "-" version ".tar.gz"))
14979 (sha256
14980 (base32
14981 "0zrpzkib6b905i018a9pqlzkqinphywr6y4jwv6mwp63jjqvqkd9"))
14982 (modules '((guix build utils)))
14983 (snippet
14984 `(begin
14985 (for-each delete-file (find-files "." ".*.jar"))
14986 (delete-file-recursively "native/libffi")
14987 (delete-file-recursively "dist")
14988 #t))))
14989 (build-system ant-build-system)
14990 (arguments
14991 `(#:tests? #f; FIXME: tests require reflections.jar
14992 #:test-target "test"
14993 #:make-flags (list "-Ddynlink.native=true")
14994 #:phases
14995 (modify-phases %standard-phases
14996 (add-before 'build 'fix-build.xml
14997 (lambda* (#:key inputs #:allow-other-keys)
14998 (substitute* "build.xml"
14999 ;; Since we removed the bundled ant.jar, give the correct path
15000 (("lib/ant.jar") (search-input-file inputs "/lib/ant.jar"))
15001 ;; We removed generated native libraries. We can only rebuild one
15002 ;; so don't fail if we can't find a native library for another architecture.
15003 (("zipfileset") "zipfileset erroronmissingarchive=\"false\""))
15004 ;; Copy test dependencies
15005 (copy-file (car (find-files (assoc-ref inputs "java-junit") "jar$"))
15006 "lib/junit.jar")
15007 (copy-file (car (find-files (assoc-ref inputs "java-hamcrest-core")
15008 "jar$"))
15009 "lib/hamcrest-core.jar")
15010 ;; FIXME: once reflections.jar is built, copy it to lib/test.
15011 #t))
15012 (add-before 'build 'build-native
15013 (lambda _
15014 (invoke "ant" "-Ddynlink.native=true" "native")
15015 #t))
15016 (replace 'install
15017 (install-jars "build")))))
15018 (inputs
15019 (list libffi libx11 libxt))
15020 (native-inputs
15021 (list gcc-7 java-junit java-hamcrest-core))
15022 (home-page "https://github.com/java-native-access/jna")
15023 (synopsis "Access to native shared libraries from Java")
15024 (description "JNA provides Java programs easy access to native shared
15025libraries without writing anything but Java code - no JNI or native code is
15026required. JNA allows you to call directly into native functions using natural
15027Java method invocation.")
15028 ;; Java Native Access project (JNA) is dual-licensed under 2
15029 ;; alternative Free licenses: LGPL 2.1 or later and Apache License 2.0.
15030 (license (list
15031 license:asl2.0
15032 license:lgpl2.1+))))
15033
15034(define-public java-native-access-5.14.0
15035 (package
15036 (inherit java-native-access)
15037 (name "java-native-access")
15038 (version "5.14.0")
15039 (source
15040 (origin
15041 (method git-fetch)
15042 (uri (git-reference
15043 (url "https://github.com/java-native-access/jna.git")
15044 (commit version)))
15045 (file-name (git-file-name name version))
15046 (sha256
15047 (base32 "0blf6ka69c3zywa74fjh8gykhzn3vgbvlxzy3v9znncb2a97v6bb"))
15048 (modules '((guix build utils)))
15049 (snippet
15050 `(begin
15051 (for-each delete-file (find-files "." ".*.jar"))
15052 (delete-file-recursively "native/libffi")
15053 (delete-file-recursively "dist")))))
15054 (arguments
15055 `(#:tests? #f
15056 #:test-target "test"
15057 #:make-flags (list "-Ddynlink.native=true")
15058 #:phases
15059 (modify-phases %standard-phases
15060 (add-before 'build 'fix-build.xml
15061 (lambda* (#:key inputs #:allow-other-keys)
15062 (let ((ant-jar (search-input-file inputs "/lib/ant.jar"))
15063 (asm-jar (search-input-file inputs "/share/java/asm9.jar")))
15064 (substitute* "build.xml"
15065 (("lib/ant\\.jar") ant-jar)
15066 (("\\$lib/asm-8\\.0\\.1\\.jar") asm-jar)
15067 (("lib/asm-8\\.0\\.1\\.jar") asm-jar)
15068 (("<zipfileset") "<zipfileset erroronmissingarchive=\"false\""))
15069 (substitute* "build-ant-tools.xml"
15070 (("lib/ant\\.jar") ant-jar)
15071 (("lib/asm-8\\.0\\.1\\.jar") asm-jar)))
15072 (copy-file (car (find-files (assoc-ref inputs "java-junit") "jar$"))
15073 "lib/junit.jar")
15074 (copy-file (car (find-files (assoc-ref inputs "java-hamcrest-core")
15075 "jar$"))
15076 "lib/hamcrest-core.jar")))
15077 (add-before 'build 'build-native
15078 (lambda _
15079 (invoke "ant" "-Ddynlink.native=true" "native")))
15080 (add-before 'install 'create-pom
15081 (generate-pom.xml "pom.xml" "net.java.dev.jna"
15082 "jna-jpms" ,version))
15083 (add-before 'install 'keep-only-jna-jpms
15084 (lambda _
15085 ;; The build produces multiple jars. install-from-pom
15086 ;; expects exactly one. Remove all except jna-jpms.jar.
15087 (for-each delete-file
15088 (filter (lambda (f)
15089 (not (string-contains f "jna-jpms")))
15090 (find-files "build" "\\.jar$")))
15091 (for-each delete-file
15092 (find-files "lib" "\\.jar$"))))
15093 (replace 'install
15094 (install-from-pom "pom.xml")))))
15095 (native-inputs
15096 (modify-inputs (package-native-inputs java-native-access)
15097 (prepend java-asm-9)))))
15098
15099(define-public java-native-access-platform
15100 (package
15101 (inherit java-native-access)
15102 (name "java-native-access-platform")
15103 (arguments
15104 `(#:test-target "test"
15105 #:tests? #f; require jna-test.jar
15106 #:phases
15107 (modify-phases %standard-phases
15108 (add-before 'build 'chdir
15109 (lambda _
15110 (chdir "contrib/platform")
15111 #t))
15112 (add-after 'chdir 'fix-ant
15113 (lambda* (#:key inputs #:allow-other-keys)
15114 (substitute* "nbproject/project.properties"
15115 (("../../build/jna.jar")
15116 (search-input-file inputs "/share/java/jna.jar"))
15117 (("../../lib/hamcrest-core-.*.jar")
15118 (car (find-files (assoc-ref inputs "java-hamcrest-core")
15119 "jar$")))
15120 (("../../lib/junit.jar")
15121 (car (find-files (assoc-ref inputs "java-junit")
15122 "jar$"))))
15123 #t))
15124 (replace 'install
15125 (install-jars "dist")))))
15126 (inputs
15127 (list java-native-access))
15128 (synopsis "Cross-platform mappings for jna")
15129 (description "java-native-access-platform has cross-platform mappings
15130and mappings for a number of commonly used platform functions, including a
15131large number of Win32 mappings as well as a set of utility classes that
15132simplify native access.")))
15133
15134(define-public java-native-access-platform-5.14.0
15135 (package
15136 (inherit java-native-access-platform)
15137 (name "java-native-access-platform")
15138 (version (package-version java-native-access-5.14.0))
15139 (source (package-source java-native-access-5.14.0))
15140 (arguments
15141 `(#:build-target "jar"
15142 #:tests? #f
15143 #:modules ((guix build ant-build-system)
15144 (guix build utils)
15145 (guix build java-utils)
15146 (sxml simple))
15147 #:phases
15148 (modify-phases %standard-phases
15149 (add-before 'build 'chdir
15150 (lambda _
15151 (chdir "contrib/platform")
15152 #t))
15153 (add-after 'chdir 'fix-ant
15154 (lambda* (#:key inputs #:allow-other-keys)
15155 (let ((jna-jar (car (find-files (assoc-ref inputs "java-native-access")
15156 "jna-jpms.*\\.jar$")))
15157 (asm-jar (search-input-file inputs "/share/java/asm9.jar"))
15158 (ant-jar (search-input-file inputs "/lib/ant.jar")))
15159 (mkdir-p "../../build")
15160 (mkdir-p "../../lib")
15161 (copy-file jna-jar "../../build/jna.jar")
15162 (copy-file asm-jar "../../lib/asm-8.0.1.jar")
15163 (copy-file ant-jar "../../lib/ant.jar")
15164 (substitute* "build.xml"
15165 (("../../build/jna\\.jar") jna-jar)
15166 (("../../lib/asm-8\\.0\\.1\\.jar") asm-jar))
15167 (substitute* "../../build-ant-tools.xml"
15168 (("lib/ant\\.jar") ant-jar)
15169 (("lib/asm-8\\.0\\.1\\.jar") asm-jar))
15170 #t)))
15171 (add-before 'install 'create-pom
15172 (lambda _
15173 (call-with-output-file "pom.xml"
15174 (lambda (port)
15175 (sxml->xml
15176 `(*TOP*
15177 (*PI* xml "version=\"1.0\" encoding=\"UTF-8\"")
15178 (project
15179 (modelVersion "4.0.0")
15180 (groupId "net.java.dev.jna")
15181 (artifactId "jna-platform-jpms")
15182 (version ,,version)
15183 (dependencies
15184 (dependency
15185 (groupId "net.java.dev.jna")
15186 (artifactId "jna-jpms")
15187 (version ,,version)))))
15188 port)))))
15189 (add-before 'install 'keep-only-jna-platform-jpms
15190 (lambda _
15191 (for-each delete-file
15192 (filter (lambda (f)
15193 (not (string-contains f "jna-platform-jpms")))
15194 (append (find-files "build" "\\.jar$")
15195 (find-files "dist" "\\.jar$"))))))
15196 (replace 'install
15197 (install-from-pom "pom.xml")))))
15198 (native-inputs
15199 (modify-inputs (package-native-inputs java-native-access-platform)
15200 (prepend java-asm-9)))
15201 (inputs
15202 (list java-native-access-5.14.0))))
15203
15204(define-public java-jsch-agentproxy-core
15205 (package
15206 (name "java-jsch-agentproxy-core")
15207 (version "0.0.8")
15208 (source (origin
15209 (method url-fetch)
15210 (uri (string-append "https://github.com/ymnk/jsch-agent-proxy/archive/"
15211 version ".tar.gz"))
15212 (file-name (string-append name "-" version ".tar.gz"))
15213 (sha256
15214 (base32
15215 "02iqg6jbc1kxvfzqcg6wy9ygqxfm82bw5rf6vnswqy4y572niz4q"))))
15216 (build-system ant-build-system)
15217 (arguments
15218 `(#:jar-name "jsch-agentproxy-core.jar"
15219 #:source-dir "jsch-agent-proxy-core/src/main/java"
15220 #:tests? #f)); no tests
15221 (home-page "https://github.com/ymnk/jsch-agent-proxy")
15222 (synopsis "Core component of the proxy to ssh-agent and Pageant in Java")
15223 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15224and Pageant included Putty. It will be easily integrated into JSch, and users
15225will be allowed to use these programs for authentication.")
15226 (license license:bsd-3)))
15227
15228(define-public java-jsch-agentproxy-sshagent
15229 (package
15230 (inherit java-jsch-agentproxy-core)
15231 (name "java-jsch-agentproxy-sshagent")
15232 (arguments
15233 `(#:jar-name "jsch-agentproxy-sshagent.jar"
15234 #:source-dir "jsch-agent-proxy-sshagent/src/main/java"
15235 #:tests? #f)); no tests
15236 (inputs
15237 (list java-jsch-agentproxy-core))
15238 (synopsis "Proxy to ssh-agent")
15239 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15240and Pageant included in Putty. This component contains the code for a proxy to
15241ssh-agent.")))
15242
15243(define-public java-jsch-agentproxy-usocket-jna
15244 (package
15245 (inherit java-jsch-agentproxy-core)
15246 (name "java-jsch-agentproxy-usocket-jna")
15247 (arguments
15248 `(#:jar-name "jsch-agentproxy-usocket-jna.jar"
15249 #:source-dir "jsch-agent-proxy-usocket-jna/src/main/java"
15250 #:tests? #f)); no tests
15251 (inputs
15252 (list java-jsch-agentproxy-core java-native-access))
15253 (synopsis "USocketFactory implementation using JNA")
15254 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15255and Pageant included in Putty. This component contains an implementation of
15256USocketFactory using @dfn{JNA} (Java Native Access).")))
15257
15258(define-public java-jsch-agentproxy-pageant
15259 (package
15260 (inherit java-jsch-agentproxy-core)
15261 (name "java-jsch-agentproxy-pageant")
15262 (arguments
15263 `(#:jar-name "jsch-agentproxy-pageant.jar"
15264 #:source-dir "jsch-agent-proxy-pageant/src/main/java"
15265 #:tests? #f)); no tests
15266 (inputs
15267 (list java-jsch-agentproxy-core java-native-access
15268 java-native-access-platform))
15269 (synopsis "Proxy to pageant")
15270 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15271and Pageant included in Putty. This component contains the code for a proxy to
15272pageant.")))
15273
15274(define-public java-jsch-agentproxy-usocket-nc
15275 (package
15276 (inherit java-jsch-agentproxy-core)
15277 (name "java-jsch-agentproxy-usocket-nc")
15278 (arguments
15279 `(#:jar-name "jsch-agentproxy-usocket-nc.jar"
15280 #:source-dir "jsch-agent-proxy-usocket-nc/src/main/java"
15281 #:tests? #f)); no tests
15282 (inputs
15283 (list java-jsch-agentproxy-core))
15284 (synopsis "USocketFactory implementation using netcat")
15285 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15286and Pageant included in Putty. This component contains an implementation of
15287USocketFactory using netcat.")))
15288
15289(define-public java-jsch-agentproxy-connector-factory
15290 (package
15291 (inherit java-jsch-agentproxy-core)
15292 (name "java-jsch-agentproxy-connector-factory")
15293 (arguments
15294 `(#:jar-name "jsch-agentproxy-connector-factory.jar"
15295 #:source-dir "jsch-agent-proxy-connector-factory/src/main/java"
15296 #:tests? #f)); no tests
15297 (inputs
15298 (list java-jsch-agentproxy-core java-jsch-agentproxy-sshagent
15299 java-jsch-agentproxy-usocket-jna java-jsch-agentproxy-pageant
15300 java-jsch-agentproxy-usocket-nc))
15301 (synopsis "Connector factory for jsch agent proxy")
15302 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15303and Pageant included in Putty. This component contains a connector factory.")))
15304
15305(define-public java-jsch-agentproxy-jsch
15306 (package
15307 (inherit java-jsch-agentproxy-core)
15308 (name "java-jsch-agentproxy-jsch")
15309 (arguments
15310 `(#:jar-name "jsch-agentproxy-jsch.jar"
15311 #:source-dir "jsch-agent-proxy-jsch/src/main/java"
15312 #:tests? #f)); no tests
15313 (inputs
15314 (list java-jsch java-jsch-agentproxy-core))
15315 (synopsis "JSch integration library for agentproxy")
15316 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15317and Pageant included in Putty. This component contains a library to use
15318jsch-agent-proxy with JSch.")))
15319
15320(define-public java-apache-ivy
15321 (package
15322 (name "java-apache-ivy")
15323 (version "2.4.0")
15324 (source (origin
15325 (method url-fetch)
15326 (uri (string-append "mirror://apache/ant/ivy/" version
15327 "/apache-ivy-" version "-src.tar.gz"))
15328 (sha256
15329 (base32
15330 "1xkfn57g2m7l6y0xdq75x5rnrgk52m9jx2xah70g3ggl8750hbr0"))
15331 (patches
15332 (search-patches
15333 "java-apache-ivy-port-to-latest-bouncycastle.patch"))))
15334 (build-system ant-build-system)
15335 (arguments
15336 `(#:jar-name "ivy.jar"
15337 #:tests? #f
15338 #:phases
15339 (modify-phases %standard-phases
15340 (add-before 'build 'remove-example
15341 (lambda _
15342 (delete-file-recursively "src/example")
15343 #t))
15344 (add-before 'build 'copy-resources
15345 (lambda _
15346 (with-directory-excursion "src/java"
15347 (for-each (lambda (file)
15348 (install-file file (string-append "../../build/classes/" (dirname file))))
15349 (append
15350 (find-files "." ".*.css")
15351 (find-files "." ".*.ent")
15352 (find-files "." ".*.html")
15353 (find-files "." ".*.properties")
15354 (find-files "." ".*.xsd")
15355 (find-files "." ".*.xsl")
15356 (find-files "." ".*.xml"))))
15357 #t))
15358 (add-before 'build 'fix-vfs
15359 (lambda _
15360 (substitute*
15361 '("src/java/org/apache/ivy/plugins/repository/vfs/VfsRepository.java"
15362 "src/java/org/apache/ivy/plugins/repository/vfs/VfsResource.java")
15363 (("import org.apache.commons.vfs") "import org.apache.commons.vfs2"))
15364 #t))
15365 (add-before 'install 'copy-manifest
15366 (lambda _
15367 (install-file "META-INF/MANIFEST.MF" "build/classes/META-INF")
15368 #t))
15369 (add-before 'install 'repack
15370 (lambda _
15371 (invoke "jar" "-cmf" "build/classes/META-INF/MANIFEST.MF" "build/jar/ivy.jar"
15372 "-C" "build/classes" ".")))
15373 (add-after 'install 'install-bin
15374 (lambda* (#:key outputs #:allow-other-keys)
15375 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
15376 (ivy (string-append bin "/ivy"))
15377 (jar (string-append (assoc-ref outputs "out") "/share/java/ivy.jar")))
15378 (mkdir-p bin)
15379 (with-output-to-file ivy
15380 (lambda _
15381 (display (string-append
15382 "#!" (which "sh") "\n"
15383 "if [[ -z $CLASSPATH ]]; then\n"
15384 " cp=\"" (getenv "CLASSPATH") ":" jar "\"\n"
15385 "else\n"
15386 " cp=\"" (getenv "CLASSPATH") ":" jar ":$CLASSPATH\"\n"
15387 "fi\n"
15388 (which "java") " -cp $cp org.apache.ivy.Main $@\n"))))
15389 (chmod ivy #o755)
15390 #t))))))
15391 (inputs
15392 (list java-bouncycastle
15393 java-commons-cli
15394 java-commons-collections
15395 java-commons-httpclient
15396 java-commons-lang
15397 java-commons-vfs
15398 java-jakarta-oro
15399 java-jsch
15400 java-jsch-agentproxy-core
15401 java-jsch-agentproxy-connector-factory
15402 java-jsch-agentproxy-jsch
15403 java-junit))
15404 (home-page "https://ant.apache.org/ivy")
15405 (synopsis "Dependency manager for the Java programming language")
15406 (description "Ivy is a tool for managing (recording, tracking, resolving
15407and reporting) project dependencies. It is characterized by the following:
15408
15409@itemize
15410@item flexibility and configurability - Ivy is essentially process agnostic
15411 and is not tied to any methodology or structure. Instead it provides the
15412 necessary flexibility and configurability to be adapted to a broad range
15413 of dependency management and build processes.
15414@item tight integration with Apache Ant - while available as a standalone tool,
15415 Ivy works particularly well with Apache Ant providing a number of
15416 powerful Ant tasks ranging from dependency resolution to dependency
15417 reporting and publication.
15418@end itemize")
15419 (license license:asl2.0)))
15420
15421(define-public java-eclipse-sisu-inject
15422 (package
15423 (name "java-eclipse-sisu-inject")
15424 (version "0.3.5")
15425 (source (origin
15426 (method git-fetch)
15427 (uri (git-reference
15428 (url "https://github.com/eclipse/sisu.inject/")
15429 (commit (string-append "releases/" version))))
15430 (file-name (git-file-name name version))
15431 (sha256
15432 (base32
15433 "1yh434b8pi8cwmpk825fbvbnkkk2cwd4gxxjaygg8i9j0q3l9zp3"))))
15434 (build-system ant-build-system)
15435 (arguments
15436 `(#:jar-name "eclipse-sisu-inject.jar"
15437 #:source-dir "org.eclipse.sisu.inject/src"
15438 #:tests? #f; no tests
15439 #:phases
15440 (modify-phases %standard-phases
15441 (replace 'install
15442 (install-from-pom "org.eclipse.sisu.inject/pom.xml")))))
15443 (propagated-inputs
15444 (list java-guice java-sisu-inject-parent-pom))
15445 (inputs
15446 (list java-guice-servlet
15447 java-javax-inject
15448 java-javaee-servletapi
15449 java-junit
15450 java-slf4j-api
15451 java-jsr305
15452 java-jsr250
15453 java-cdi-api
15454 java-osgi-framework
15455 java-osgi-util-tracker
15456 java-testng))
15457 (home-page "https://www.eclipse.org/sisu/")
15458 (synopsis "Classpath scanning, auto-binding, and dynamic auto-wiring")
15459 (description "Sisu is a modular JSR330-based container that supports
15460classpath scanning, auto-binding, and dynamic auto-wiring. Sisu uses
15461Google-Guice to perform dependency injection and provide the core JSR330
15462support, but removes the need to write explicit bindings in Guice modules.
15463Integration with other containers via the Eclipse Extension Registry and the
15464OSGi Service Registry is a goal of this project.")
15465 (license license:epl1.0)))
15466
15467(define java-sisu-inject-parent-pom
15468 (package
15469 (inherit java-eclipse-sisu-inject)
15470 (name "java-sisu-inject-parent-pom")
15471 (arguments
15472 `(#:tests? #f
15473 #:phases
15474 (modify-phases %standard-phases
15475 (delete 'configure)
15476 (delete 'build)
15477 (replace 'install
15478 (install-pom-file "pom.xml")))))
15479 (propagated-inputs '())))
15480
15481(define-public java-eclipse-sisu-plexus
15482 (package
15483 (name "java-eclipse-sisu-plexus")
15484 (version "0.3.5")
15485 (source (origin
15486 (method git-fetch)
15487 (uri (git-reference
15488 (url "https://github.com/eclipse/sisu.plexus")
15489 (commit (string-append "releases/" version))))
15490 (file-name (git-file-name name version))
15491 (sha256
15492 (base32
15493 "0lm5h0dmh41ffcwd32qnk3a87d360am36yq7168ikkyqa8jxkx28"))
15494 (modules '((guix build utils)))
15495 (snippet
15496 '(begin
15497 (for-each delete-file (find-files "." ".*.jar"))
15498 (rename-file "org.eclipse.sisu.plexus.tests/src"
15499 "org.eclipse.sisu.plexus.tests/java")
15500 #t))))
15501 (build-system ant-build-system)
15502 (arguments
15503 `(#:jar-name "eclipse-sisu-plexus.jar"
15504 #:source-dir "org.eclipse.sisu.plexus/src"
15505 #:test-dir "org.eclipse.sisu.plexus.tests"
15506 #:test-exclude
15507 (list
15508 ;; This test fails probably because we can't generate the necessary
15509 ;; meta-inf files.
15510 "**/PlexusLoggingTest.*"
15511 ;; FIXME: This test fails because of some injection error
15512 "**/PlexusRequirementTest.*")
15513 #:jdk ,icedtea-8
15514 #:phases
15515 (modify-phases %standard-phases
15516 (add-before 'build 'copy-resources
15517 (lambda _
15518 (install-file "org.eclipse.sisu.plexus/META-INF/plexus/components.xml"
15519 "build/classes/META-INF/plexus")
15520 #t))
15521 (add-before 'check 'build-test-jar
15522 (lambda _
15523 (with-directory-excursion "org.eclipse.sisu.plexus.tests/resources/component-jar/src/main/"
15524 (mkdir "build")
15525 (with-directory-excursion "java"
15526 (apply invoke "javac" "-cp"
15527 (string-append (getenv "CLASSPATH")
15528 ":../../../../../build/classes")
15529 (find-files "." ".*.java"))
15530 (for-each (lambda (file) (install-file file (string-append "../build/" file)))
15531 (find-files "." ".*.jar")))
15532 (mkdir-p "build/META-INF/plexus")
15533 (copy-file "resources/META-INF/plexus/components.xml"
15534 "build/META-INF/plexus/components.xml")
15535 (with-directory-excursion "build"
15536 (invoke "jar" "cf" "../../../component-jar-0.1.jar" ".")))
15537 (with-directory-excursion "org.eclipse.sisu.plexus.tests/"
15538 (copy-recursively "META-INF" "../build/test-classes/META-INF")
15539 (substitute* "java/org/eclipse/sisu/plexus/DefaultPlexusContainerTest.java"
15540 (("resources/component-jar")
15541 "org.eclipse.sisu.plexus.tests/resources/component-jar")))
15542 #t))
15543 (replace 'install
15544 (install-from-pom "org.eclipse.sisu.plexus/pom.xml")))))
15545 (propagated-inputs
15546 (list java-jsr250
15547 java-plexus-classworlds
15548 java-plexus-utils
15549 java-plexus-component-annotations
15550 java-cdi-api
15551 java-eclipse-sisu-inject
15552 java-sisu-plexus-parent-pom))
15553 (inputs
15554 (list java-osgi-framework
15555 java-slf4j-api
15556 java-javax-inject
15557 java-guice
15558 java-guava
15559 java-aopalliance
15560 java-cglib))
15561 (native-inputs
15562 (list java-junit))
15563 (home-page "https://www.eclipse.org/sisu/")
15564 (synopsis "Plexus support for the sisu container")
15565 (description "Sisu is a modular JSR330-based container that supports
15566classpath scanning, auto-binding, and dynamic auto-wiring. This package
15567adds Plexus support to the Sisu-Inject container.")
15568 (license license:epl1.0)))
15569
15570(define java-sisu-plexus-parent-pom
15571 (package
15572 (inherit java-eclipse-sisu-plexus)
15573 (name "java-sisu-plexus-parent-pom")
15574 (arguments
15575 `(#:tests? #f
15576 #:phases
15577 (modify-phases %standard-phases
15578 (delete 'configure)
15579 (delete 'build)
15580 (replace 'install
15581 (install-pom-file "pom.xml")))))
15582 (propagated-inputs
15583 `(("java-sonatype-oss-parent-pom-9" ,java-sonatype-oss-parent-pom-9)))))
15584
15585(define-public java-commons-compiler
15586 (package
15587 (name "java-commons-compiler")
15588 (version "3.0.8")
15589 (source (origin
15590 (method git-fetch)
15591 (uri (git-reference
15592 (url "https://github.com/janino-compiler/janino")
15593 (commit "91aa95686d1e4ca3b16a984a03a38686572331b2")))
15594 (file-name (string-append name "-" version))
15595 (sha256
15596 (base32
15597 "04hfdl59sgh20qkxzgnibvs8f9hy6n7znxwpk611y5d89977y62r"))
15598 (modules '((guix build utils)))
15599 (snippet
15600 '(begin
15601 (for-each delete-file
15602 (find-files "." "\\.jar$"))
15603 #t))))
15604 (build-system ant-build-system)
15605 (arguments
15606 `(#:jar-name "commons-compiler.jar"
15607 #:source-dir "commons-compiler/src/main"
15608 #:tests? #f)); no tests
15609 (home-page "https://github.com/janino-compiler/janino")
15610 (synopsis "Java compiler")
15611 (description "Commons-compiler contains an API for janino, including the
15612@code{IExpressionEvaluator}, @code{IScriptEvaluator}, @code{IClassBodyEvaluator}
15613and @code{ISimpleCompiler} interfaces.")
15614 (license license:bsd-3)))
15615
15616(define-public java-janino
15617 (package
15618 (inherit java-commons-compiler)
15619 (name "java-janino")
15620 (arguments
15621 `(#:jar-name "janino.jar"
15622 #:source-dir "src/main/java"
15623 #:phases
15624 (modify-phases %standard-phases
15625 (add-before 'configure 'chdir
15626 (lambda _
15627 (chdir "janino")
15628 #t)))))
15629 (inputs
15630 (list java-commons-compiler))
15631 (native-inputs
15632 (list java-junit java-hamcrest-core))
15633 (description "Janino is a Java compiler. Janino can compile a set of
15634source files to a set of class files like @code{javac}, but also compile a
15635Java expression, block, class body or source file in memory, load the bytecode
15636and execute it directly in the same JVM. @code{janino} can also be used for
15637static code analysis or code manipulation.")))
15638
15639(define-public java-logback-core
15640 (package
15641 (name "java-logback-core")
15642 (version "1.2.3")
15643 (source (origin
15644 (method git-fetch)
15645 (uri (git-reference
15646 (url "https://github.com/qos-ch/logback/")
15647 (commit (string-append "v_" version))))
15648 (file-name (git-file-name name version))
15649 (sha256
15650 (base32
15651 "055jbfpg3l5qw7pw2snkdag0gjkb4vcxfg9110cqqyc40k2nd17z"))
15652 (modules '((guix build utils)))
15653 (snippet
15654 '(delete-file-recursively "logback-access/lib"))))
15655 (build-system ant-build-system)
15656 (arguments
15657 `(#:jar-name "logback.jar"
15658 #:source-dir "src/main/java"
15659 #:test-dir "src/test"
15660 #:test-exclude
15661 ;; These tests fail with Unable to set MockitoNamingPolicy on cglib generator
15662 ;; which creates FastClasses
15663 (list "**/AllCoreTest.*"
15664 "**/AutoFlushingObjectWriterTest.*"
15665 "**/PackageTest.*"
15666 "**/ResilientOutputStreamTest.*"
15667 ;; And we still don't want to run abstract classes
15668 "**/Abstract*.*")
15669 #:phases
15670 (modify-phases %standard-phases
15671 (add-before 'configure 'chdir
15672 (lambda _ (chdir "logback-core"))))))
15673 (inputs
15674 (list java-javax-mail
15675 java-javaee-servletapi
15676 java-commons-compiler
15677 java-janino))
15678 (native-inputs
15679 (list java-junit
15680 java-hamcrest-core
15681 java-mockito-1
15682 java-cglib
15683 java-objenesis
15684 java-joda-time))
15685 (home-page "https://logback.qos.ch")
15686 (synopsis "Logging for java")
15687 (description "Logback is intended as a successor to the popular log4j project.
15688This module lays the groundwork for the other two modules.")
15689 ;; Either epl1.0 or lgpl2.1
15690 (license (list license:epl1.0
15691 license:lgpl2.1))))
15692
15693(define-public java-logback-classic
15694 (package
15695 (inherit java-logback-core)
15696 (name "java-logback-classic")
15697 (arguments
15698 `(#:jar-name "logback-classic.jar"
15699 #:source-dir "src/main/java"
15700 #:test-dir "src/test"
15701 #:tests? #f; tests require more packages: h2, greenmail, hsql, subethamail, slf4j, log4j, felix
15702 #:jdk ,icedtea-8
15703 #:phases
15704 (modify-phases %standard-phases
15705 (add-before 'configure 'chdir
15706 (lambda _
15707 (chdir "logback-classic")
15708 #t))
15709 (replace 'build
15710 (lambda* (#:key inputs #:allow-other-keys)
15711 (mkdir-p "build/classes")
15712 (setenv "CLASSPATH"
15713 (string-join
15714 (apply append (map (lambda (input)
15715 (find-files (assoc-ref inputs input)
15716 ".*.jar"))
15717 '("java-logback-core" "java-slf4j-api"
15718 "java-commons-compiler" "java-javaee-servletapi"
15719 "groovy")))
15720 ":"))
15721 (apply invoke "groovyc" "-d" "build/classes" "-j"
15722 (find-files "src/main/" ".*\\.(groovy|java)$"))
15723 (invoke "ant" "jar")
15724 #t)))))
15725 (inputs
15726 (modify-inputs inputs
15727 (prepend java-logback-core java-slf4j-api)))
15728 (native-inputs
15729 (list groovy))
15730 (description "Logback is intended as a successor to the popular log4j project.
15731This module can be assimilated to a significantly improved version of log4j.
15732Moreover, @code{logback-classic} natively implements the slf4j API so that you
15733can readily switch back and forth between logback and other logging frameworks
15734such as log4j or @code{java.util.logging} (JUL).")))
15735
15736(define-public java-jgit
15737 (package
15738 (name "java-jgit")
15739 (version "4.7.0.201704051617-r")
15740 (source (origin
15741 (method url-fetch)
15742 (uri (string-append "https://repo1.maven.org/maven2/"
15743 "org/eclipse/jgit/org.eclipse.jgit/"
15744 version "/org.eclipse.jgit-"
15745 version "-sources.jar"))
15746 (sha256
15747 (base32
15748 "13ii4jn02ynzq6i7gsyi21k2i94jpc85wf6bcm31q4cyvzv0mk4k"))))
15749 (build-system ant-build-system)
15750 (arguments
15751 `(#:tests? #f ; There are no tests to run.
15752 #:jar-name "jgit.jar"
15753 ;; JGit must be built with a JDK supporting Java 8.
15754 #:jdk ,icedtea-8
15755 ;; Target our older default JDK.
15756 #:make-flags (list "-Dtarget=1.7")
15757 #:phases
15758 (modify-phases %standard-phases
15759 ;; The jar file generated by the default build.xml does not include
15760 ;; the text properties files, so we need to add them.
15761 (add-after 'build 'add-properties
15762 (lambda* (#:key jar-name #:allow-other-keys)
15763 (with-directory-excursion "src"
15764 (apply invoke "jar" "-uf"
15765 (string-append "../build/jar/" jar-name)
15766 (find-files "." "\\.properties$")))
15767 #t)))))
15768 (inputs
15769 (list java-classpathx-servletapi java-javaewah java-jsch
15770 java-slf4j-api))
15771 (home-page "https://eclipse.org/jgit/")
15772 (synopsis "Java library implementing the Git version control system")
15773 (description "JGit is a lightweight, pure Java library implementing the
15774Git version control system, providing repository access routines, support for
15775network protocols, and core version control algorithms.")
15776 (license license:edl1.0)))
15777
15778;; For axoloti.
15779(define-public java-jgit-4.2
15780 (package (inherit java-jgit)
15781 (version "4.2.0.201601211800-r")
15782 (source (origin
15783 (method url-fetch)
15784 (uri (string-append "https://repo1.maven.org/maven2/"
15785 "org/eclipse/jgit/org.eclipse.jgit/"
15786 version "/org.eclipse.jgit-"
15787 version "-sources.jar"))
15788 (sha256
15789 (base32
15790 "15gm537iivhnzlkjym4x3wn5jqdjdragsw9pdpzqqg21nrc817mm"))))
15791 (build-system ant-build-system)
15792 (arguments
15793 (substitute-keyword-arguments (package-arguments java-jgit)
15794 ((#:phases phases)
15795 `(modify-phases ,phases
15796 (add-after 'unpack 'use-latest-javaewah-API
15797 (lambda _
15798 (substitute* "src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java"
15799 (("wordinbits") "WORD_IN_BITS"))))))))
15800 (inputs
15801 (list java-javaewah java-jsch java-slf4j-api))))
15802
15803(define-public java-jgit-7
15804 (package
15805 (name "java-jgit")
15806 (version "7.0.0.202409031743-r")
15807 (source (origin
15808 (method url-fetch)
15809 (uri (string-append "https://repo1.maven.org/maven2/"
15810 "org/eclipse/jgit/org.eclipse.jgit/"
15811 version "/org.eclipse.jgit-"
15812 version "-sources.jar"))
15813 (sha256
15814 (base32
15815 "0hdl11cbb6zy39zw4jpg0ip00nikilw7dajrqky6d3l18khjby5k"))))
15816 (build-system ant-build-system)
15817 (arguments
15818 `(#:tests? #f ; sources jar has no tests
15819 #:jar-name "jgit.jar"
15820 #:jdk ,openjdk17
15821 #:modules ((guix build ant-build-system)
15822 (guix build utils)
15823 (guix build java-utils)
15824 (srfi srfi-1))
15825 #:phases
15826 (modify-phases %standard-phases
15827 (add-after 'build 'add-properties
15828 (lambda* (#:key jar-name #:allow-other-keys)
15829 (with-directory-excursion "src"
15830 (apply invoke "jar" "-uf"
15831 (string-append "../build/jar/" jar-name)
15832 (find-files "." "\\.properties$")))
15833 (let* ((pkgs (delete-duplicates
15834 (filter-map
15835 (lambda (f)
15836 (let* ((d (dirname f))
15837 (d (if (string-prefix? "./" d)
15838 (substring d 2)
15839 d)))
15840 (and (not (string-null? d))
15841 (not (string=? d "."))
15842 (string-map
15843 (lambda (c)
15844 (if (char=? c #\/) #\. c))
15845 d))))
15846 (with-directory-excursion "build/classes"
15847 (find-files "." "\\.class$")))))
15848 (export-pkg (string-join (sort pkgs string<?) ",")))
15849 ;; Write manifest with continuation lines for long values.
15850 ;; Manifest spec: max 72 bytes per line, continuation
15851 ;; lines start with a single space.
15852 (call-with-output-file "osgi-manifest.mf"
15853 (lambda (port)
15854 (for-each
15855 (lambda (line)
15856 (let loop ((s line))
15857 (if (<= (string-length s) 70)
15858 (begin (display s port) (newline port))
15859 (begin (display (substring s 0 70) port)
15860 (newline port)
15861 (loop (string-append
15862 " " (substring s 70)))))))
15863 (list
15864 "Bundle-ManifestVersion: 2"
15865 "Bundle-SymbolicName: org.eclipse.jgit"
15866 (string-append "Bundle-Version: " ,version)
15867 (string-append "Export-Package: " export-pkg)
15868 (string-append
15869 "Import-Package: com.googlecode.javaewah,"
15870 "javax.crypto,javax.management,javax.net.ssl,"
15871 "org.apache.commons.codec.digest,"
15872 "org.slf4j,org.xml.sax,org.xml.sax.helpers")))
15873 (newline port))))
15874 (invoke "jar" "ufm" (string-append "build/jar/" jar-name)
15875 "osgi-manifest.mf")))
15876 (replace 'install
15877 (install-from-pom
15878 "src/META-INF/maven/org.eclipse.jgit/org.eclipse.jgit/pom.xml")))))
15879 (inputs
15880 (list java-commons-codec java-javaewah-1.2.3 java-slf4j-api))
15881 (home-page "https://eclipse.org/jgit/")
15882 (synopsis "Java library implementing the Git version control system")
15883 (description "JGit is a lightweight, pure Java library implementing the
15884Git version control system, providing repository access routines, support for
15885network protocols, and core version control algorithms.")
15886 (license license:edl1.0)))
15887
15888(define-public java-jgit-ssh-jsch-7
15889 (package
15890 (name "java-jgit-ssh-jsch")
15891 (version "7.0.0.202409031743-r")
15892 (source (origin
15893 (method url-fetch)
15894 (uri (string-append "https://repo1.maven.org/maven2/"
15895 "org/eclipse/jgit/org.eclipse.jgit.ssh.jsch/"
15896 version "/org.eclipse.jgit.ssh.jsch-"
15897 version "-sources.jar"))
15898 (sha256
15899 (base32
15900 "1vb3zkd2iz6bpz2nq8xxi5d5jdb8hy8jq7gka2ck22azm9bb6p94"))))
15901 (build-system ant-build-system)
15902 (arguments
15903 `(#:tests? #f ; sources jar has no tests
15904 #:jar-name "jgit-ssh-jsch.jar"
15905 #:jdk ,openjdk17
15906 #:phases
15907 (modify-phases %standard-phases
15908 (add-after 'build 'add-osgi-manifest
15909 (lambda _
15910 ;; The NetBeans wrapper module has an empty jar target and
15911 ;; relies on Bundle-SymbolicName from the Maven Central jar.
15912 (call-with-output-file "osgi-manifest.mf"
15913 (lambda (port)
15914 (display (string-append
15915 "Bundle-ManifestVersion: 2\n"
15916 "Bundle-SymbolicName: org.eclipse.jgit.ssh.jsch\n"
15917 "Bundle-Version: " ,version "\n"
15918 "Export-Package: org.eclipse.jgit.transport.ssh"
15919 ".jsch\n"
15920 "Import-Package: com.jcraft.jsch,"
15921 "org.eclipse.jgit.errors,"
15922 "org.eclipse.jgit.internal,"
15923 "org.eclipse.jgit.internal.transport.ssh,"
15924 "org.eclipse.jgit.nls,"
15925 "org.eclipse.jgit.transport,"
15926 "org.eclipse.jgit.util,"
15927 "org.eclipse.jgit.util.io,"
15928 "org.slf4j\n")
15929 port)))
15930 (invoke "jar" "ufm" "build/jar/jgit-ssh-jsch.jar"
15931 "osgi-manifest.mf")))
15932 (replace 'install
15933 (install-from-pom
15934 "src/META-INF/maven/org.eclipse.jgit/org.eclipse.jgit.ssh.jsch/pom.xml")))))
15935 (inputs
15936 (list java-jgit-7 java-jsch-0.1.72 java-jzlib-1.1.3 java-slf4j-api))
15937 (home-page "https://eclipse.org/jgit/")
15938 (synopsis "SSH support for JGit using JSch")
15939 (description "This package provides SSH transport support for JGit
15940using the JSch library.")
15941 (license license:edl1.0)))
15942
15943(define-public java-jgit-gpg-bc-7
15944 (package
15945 (name "java-jgit-gpg-bc")
15946 (version "7.0.0.202409031743-r")
15947 (source (origin
15948 (method url-fetch)
15949 (uri (string-append "https://repo1.maven.org/maven2/"
15950 "org/eclipse/jgit/org.eclipse.jgit.gpg.bc/"
15951 version "/org.eclipse.jgit.gpg.bc-"
15952 version "-sources.jar"))
15953 (sha256
15954 (base32
15955 "1123x1i19h3a674mc44csdx7spn5qh6qk3klkfih4am9ak81w27n"))))
15956 (build-system ant-build-system)
15957 (arguments
15958 `(#:tests? #f
15959 #:jar-name "jgit-gpg-bc.jar"
15960 #:jdk ,openjdk17
15961 #:phases
15962 (modify-phases %standard-phases
15963 (add-after 'build 'add-osgi-manifest
15964 (lambda _
15965 (call-with-output-file "osgi-manifest.mf"
15966 (lambda (port)
15967 (display (string-append
15968 "Bundle-ManifestVersion: 2\n"
15969 "Bundle-SymbolicName: org.eclipse.jgit.gpg.bc\n"
15970 "Bundle-Version: " ,version "\n"
15971 "Export-Package: org.eclipse.jgit.gpg.bc.internal\n"
15972 "Import-Package: org.bouncycastle.asn1,"
15973 "org.bouncycastle.bcpg,"
15974 "org.bouncycastle.gpg,"
15975 "org.bouncycastle.gpg.keybox,"
15976 "org.bouncycastle.openpgp,"
15977 "org.bouncycastle.openpgp.operator,"
15978 "org.bouncycastle.openpgp.operator.jcajce,"
15979 "org.bouncycastle.util.encoders,"
15980 "org.eclipse.jgit.api.errors,"
15981 "org.eclipse.jgit.lib,"
15982 "org.eclipse.jgit.nls,"
15983 "org.eclipse.jgit.transport,"
15984 "org.eclipse.jgit.util,"
15985 "org.slf4j\n")
15986 port)))
15987 (invoke "jar" "ufm" "build/jar/jgit-gpg-bc.jar"
15988 "osgi-manifest.mf")))
15989 (replace 'install
15990 (install-from-pom
15991 "src/META-INF/maven/org.eclipse.jgit/org.eclipse.jgit.gpg.bc/pom.xml")))))
15992 (inputs
15993 (list java-bouncycastle-1.77 java-jgit-7 java-slf4j-api))
15994 (native-inputs (list unzip))
15995 (home-page "https://eclipse.org/jgit/")
15996 (synopsis "GPG support for JGit using Bouncy Castle")
15997 (description "This package provides GPG commit signing support for
15998JGit using the Bouncy Castle cryptographic library.")
15999 (license license:edl1.0)))
16000
16001(define-public abcl
16002 (package
16003 (name "abcl")
16004 (version "1.9.3")
16005 (source
16006 (origin
16007 (method url-fetch)
16008 (uri (string-append "https://abcl.org/releases/"
16009 version "/abcl-src-" version ".tar.gz"))
16010 (sha256
16011 (base32
16012 "1zxjpwv98bq2yd5qg08sbkajj17m7b8xmzqhw296161s7lia215v"))
16013 (patches
16014 (search-patches
16015 "abcl-fix-build-xml.patch"))))
16016 (build-system ant-build-system)
16017 (native-inputs
16018 (list java-junit))
16019 (arguments
16020 `(#:build-target "abcl.jar"
16021 #:test-target "abcl.test"
16022 #:phases
16023 (modify-phases %standard-phases
16024 (replace 'install
16025 (lambda* (#:key outputs #:allow-other-keys)
16026 (let ((share (string-append (assoc-ref outputs "out")
16027 "/share/java/"))
16028 (bin (string-append (assoc-ref outputs "out")
16029 "/bin/")))
16030 (mkdir-p share)
16031 (install-file "dist/abcl.jar" share)
16032 (install-file "dist/abcl-contrib.jar" share)
16033 (mkdir-p bin)
16034 (with-output-to-file (string-append bin "abcl")
16035 (lambda _
16036 (let ((classpath (string-append
16037 share "abcl.jar"
16038 ":"
16039 share "abcl-contrib.jar")))
16040 (display (string-append
16041 "#!" (which "bash") "\n"
16042 "if [[ -z $CLASSPATH ]]; then\n"
16043 " cp=\"" classpath "\"\n"
16044 "else\n"
16045 " cp=\"" classpath ":$CLASSPATH\"\n"
16046 "fi\n"
16047 "exec " (which "java")
16048 " -cp \"$cp\" org.armedbear.lisp.Main \"$@\"\n")))))
16049 (chmod (string-append bin "abcl") #o755)
16050 #t))))))
16051 (home-page "https://abcl.org/")
16052 (synopsis "Common Lisp Implementation on the JVM")
16053 (description
16054 "@dfn{Armed Bear Common Lisp} (ABCL) is a full implementation of the Common
16055Lisp language featuring both an interpreter and a compiler, running in the
16056JVM. It supports JSR-223 (Java scripting API): it can be a scripting engine
16057in any Java application. Additionally, it can be used to implement (parts of)
16058the application using Java to Lisp integration APIs.")
16059 (native-search-paths
16060 (list (search-path-specification
16061 (variable "XDG_DATA_DIRS")
16062 (files '("share")))))
16063 (license (list license:gpl2+
16064 ;; named-readtables is released under 3 clause BSD
16065 license:bsd-3
16066 ;; jfli is released under CPL 1.0
16067 license:cpl1.0))))
16068
16069(define-public java-jsonp-api
16070 (package
16071 (name "java-jsonp-api")
16072 (version "1.1.6")
16073 (source (origin
16074 (method git-fetch)
16075 (uri (git-reference
16076 (url "https://github.com/eclipse-ee4j/jsonp")
16077 (commit (string-append "1.1-" version "-RELEASE"))))
16078 (file-name (git-file-name name version))
16079 (sha256
16080 (base32
16081 "0zrj03hkr3jdmqlb4ipjr37cqpp2q2814qpmxi7srlwpdqs0ibgc"))))
16082 (build-system ant-build-system)
16083 (arguments
16084 `(#:jar-name "jsonp-api.jar"
16085 #:tests? #f
16086 #:source-dir "api/src/main/java"
16087 #:test-dir "api/src/test"))
16088 (home-page "https://eclipse-ee4j.github.io/jsonp/")
16089 (synopsis "JSON Processing in Java")
16090 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
16091parse, generate, transform and query) JSON messages. It produces and
16092consumes JSON text in a streaming fashion (similar to StAX API for XML)
16093and allows building a Java object model for JSON text using API classes
16094(similar to DOM API for XML).")
16095 ;; either gpl2 only with classpath exception, or epl2.0.
16096 (license (list license:gpl2
16097 license:epl2.0))))
16098
16099(define-public java-jsonp-impl
16100 (package
16101 (inherit java-jsonp-api)
16102 (name "java-jsonp-impl")
16103 (arguments
16104 `(#:jar-name "jsonp-impl.jar"
16105 #:tests? #f
16106 #:source-dir "impl/src/main/java"
16107 #:test-dir "impl/src/test"
16108 #:phases
16109 (modify-phases %standard-phases
16110 (add-before 'build 'copy-resources
16111 (lambda _
16112 (copy-recursively
16113 "impl/src/main/resources/"
16114 "build/classes")
16115 #t)))))
16116 (propagated-inputs
16117 (list java-jsonp-api))
16118 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
16119parse, generate, transform and query) JSON messages. This package contains
16120a reference implementation of that API.")))
16121
16122(define-public java-jakarta-json
16123 (package
16124 (name "java-jakarta-json")
16125 (version "2.1.3")
16126 (source (origin
16127 (method git-fetch)
16128 (uri (git-reference
16129 (url "https://github.com/jakartaee/jsonp-api")
16130 (commit (string-append version "-RELEASE"))))
16131 (file-name (git-file-name name version))
16132 (sha256
16133 (base32
16134 "1q600harqfhlf763l75j4fx7ai7ybp7ga06aiky2a2hg8mhz0s5f"))))
16135 (build-system ant-build-system)
16136 (arguments
16137 `(#:jar-name "jakarta-json.jar"
16138 #:source-dir "api/src/main/java"
16139 #:tests? #f; no tests
16140 #:jdk ,openjdk11))
16141 (home-page "https://github.com/jakartaee/jsonp-api")
16142 (synopsis "Portable API for JSON handling in Java")
16143 (description "This project contains API and Compatible Implementation of
16144Jakarta JSON Processing specification. Jakarta JSON Processing provides
16145portable APIs to parse, generate, transform, and query JSON documents.")
16146 ;; with classpath exception
16147 (license license:epl2.0)))
16148
16149(define-public java-parsson
16150 (package
16151 (name "java-parsson")
16152 (version "1.1.5")
16153 (source (origin
16154 (method git-fetch)
16155 (uri (git-reference
16156 (url "https://github.com/eclipse-ee4j/parsson")
16157 (commit version)))
16158 (file-name (git-file-name name version))
16159 (sha256
16160 (base32
16161 "06vvr6qv1ihnk212gdxg4x0sd61lgxk7wf062s7gym5k2h7fms0p"))))
16162 (build-system ant-build-system)
16163 (arguments
16164 `(#:jar-name "parsson.jar"
16165 #:source-dir "impl/src/main/java"
16166 #:test-dir "impl/src/test"
16167 #:use-java-modules? #t
16168 #:jdk ,openjdk11
16169 #:phases
16170 (modify-phases %standard-phases
16171 (add-after 'unpack 'copy-resources
16172 (lambda _
16173 (copy-recursively "impl/src/main/resources"
16174 "build/classes"))))))
16175 (inputs
16176 (list java-jakarta-json))
16177 (native-inputs
16178 (list java-junit))
16179 (home-page "https://github.com/eclipse-ee4j/parsson")
16180 (synopsis "Implementation of Jakarta JSON API")
16181 (description "Eclipse Parsson is an implementation of the Jakarta JSON
16182Processing specification.")
16183 ;; with classpath exception
16184 (license license:epl2.0)))
16185
16186(define-public java-jakarta-activation-api
16187 (package
16188 (name "java-jakarta-activation-api")
16189 (version "2.1.4")
16190 (source (origin
16191 (method git-fetch)
16192 (uri (git-reference
16193 (url "https://github.com/jakartaee/jaf-api")
16194 (commit version)))
16195 (file-name (git-file-name name version))
16196 (sha256
16197 (base32
16198 "125bf475cb0mdyhn1lj3c8gbwngbd28x10vnknq86zrc1vq4m6gx"))))
16199 (build-system ant-build-system)
16200 (arguments
16201 `(#:jar-name "jakarta-activation-api.jar"
16202 #:source-dir "api/src/main/java"
16203 #:tests? #f ;; has no tests
16204 #:jdk ,openjdk11))
16205 (home-page "https://github.com/jakartaee/jaf-api")
16206 (synopsis "Collection of Java activation")
16207 (description "Jakarta Activation lets you take advantage of standard
16208services to: determine the type of arbitrary piece of data; encapsulate access
16209to it; discover the operations available on it; and instantiate the
16210appropriate bean to perform the operation(s).")
16211 (license license:bsd-3)))
16212
16213(define-public java-jakarta-annotations-api
16214 (package
16215 (name "java-jakarta-annotations-api")
16216 (version "2.1.1")
16217 (source (origin
16218 (method git-fetch)
16219 (uri (git-reference
16220 (url "https://github.com/jakartaee/common-annotations-api")
16221 (commit version)))
16222 (file-name (git-file-name name version))
16223 (sha256
16224 (base32
16225 "0xq2n2pijal5p75vl9dz10i6hhdmaxw5q8j3aza717xkpxxby9p6"))))
16226 (build-system ant-build-system)
16227 (arguments
16228 `(#:jar-name "jakarta-annotations-api.jar"
16229 #:source-dir "api/src/main/java"
16230 #:tests? #f; no tests
16231 #:jdk ,openjdk11))
16232 (home-page "https://github.com/jakartaee/common-annotations-api")
16233 (synopsis "Collection of Java annotations")
16234 (description "Jakarta Annotations defines a collection of annotations
16235representing common semantic concepts that enable a declarative style of
16236programming that applies across a variety of Java technologies.")
16237 ;; with classpath exception
16238 (license (list license:epl2.0
16239 license:gpl2))))
16240
16241(define-public java-xmp
16242 (package
16243 (name "java-xmp")
16244 (version "5.1.3")
16245 (source (origin
16246 (method url-fetch)
16247 (uri (string-append "http://download.macromedia.com/pub/developer"
16248 "/xmp/sdk/XMPCoreJava-" version ".zip"))
16249 (sha256
16250 (base32
16251 "14nai2mmsg7l5ya2y5mx4w4lr1az3sk2fjz6hiy4zdrsavgvl1g7"))))
16252 (build-system ant-build-system)
16253 (arguments
16254 `(#:build-target "build"
16255 #:tests? #f; no tests
16256 #:phases
16257 (modify-phases %standard-phases
16258 (add-after 'unpack 'chdir
16259 (lambda _
16260 (chdir "XMPCore")
16261 #t))
16262 (add-before 'build 'fix-timestamp
16263 (lambda _
16264 (substitute* "build.xml"
16265 (("\\$\\{BuildDate\\}") "1970 Jan 01 00:00:00-GMT"))
16266 #t))
16267 (replace 'install
16268 (install-jars "."))
16269 (add-after 'install 'install-doc
16270 (lambda* (#:key outputs #:allow-other-keys)
16271 (copy-recursively
16272 "docs"
16273 (string-append (assoc-ref outputs "out") "/share/doc/java-xmp"))
16274 #t)))))
16275 (native-inputs
16276 (list unzip))
16277 (home-page "https://www.adobe.com/devnet/xmp.html")
16278 (synopsis "Extensible Metadat Platform (XMP) support in Java")
16279 (description "Adobe's Extensible Metadata Platform (XMP) is a labeling
16280technology that allows you to embed data about a file, known as metadata,
16281into the file itself. The XMP Toolkit for Java is based on the C++ XMPCore
16282library and the API is similar.")
16283 (license license:bsd-3)))
16284
16285(define-public java-args4j
16286 (package
16287 (name "java-args4j")
16288 (version "2.33")
16289 (source (origin
16290 (method git-fetch)
16291 (uri (git-reference
16292 (url "https://github.com/kohsuke/args4j")
16293 (commit (string-append "args4j-site-" version))))
16294 (file-name (git-file-name name version))
16295 (sha256
16296 (base32
16297 "0w061fg65qrsm1a0lz0vyprsyidj31krjb459qi2lw0y78xza26s"))))
16298 (build-system ant-build-system)
16299 (arguments
16300 `(#:jar-name "args4j.jar"
16301 #:source-dir "args4j/src"
16302 #:test-dir "args4j/test"
16303 #:test-exclude
16304 (list "**/ExampleTest.*"
16305 "**/ExternalConfiguredTest.*" ; fails to find a file
16306 ;; We still don't want to run abstract classes
16307 "**/Abstract*.*")
16308 #:phases
16309 (modify-phases %standard-phases
16310 (add-before 'check 'fix-test-dir
16311 (lambda _
16312 (substitute* "build.xml"
16313 (("/java\">") "\">"))
16314 #t))
16315 (add-before 'build 'copy-resources
16316 (lambda _
16317 (let ((from-prefix "args4j/src/org/kohsuke/args4j/")
16318 (to-prefix "build/classes/org/kohsuke/args4j/"))
16319 (for-each (lambda (f)
16320 (install-file
16321 (string-append from-prefix f)
16322 (string-append to-prefix (dirname f))))
16323 (list "Messages.properties"
16324 "Messages_de.properties"
16325 "Messages_en.properties"
16326 "Messages_ru.properties"
16327 "spi/Messages.properties"
16328 "spi/Messages_de.properties"
16329 "spi/Messages_en.properties"
16330 "spi/Messages_ru.properties")))
16331 #t)))))
16332 (native-inputs
16333 (list java-junit))
16334 (home-page "https://args4j.kohsuke.org/")
16335 (synopsis "Command line parser library")
16336 (description "Args4j is a small Java class library that makes it easy to
16337parse command line options/arguments in your CUI application.")
16338 (license license:expat)))
16339
16340(define-public java-argparse4j
16341 (package
16342 (name "java-argparse4j")
16343 (version "0.9.0")
16344 (source (origin
16345 (method git-fetch)
16346 (uri (git-reference
16347 (url "https://github.com/argparse4j/argparse4j")
16348 (commit (string-append "argparse4j-" version))))
16349 (file-name (git-file-name name version))
16350 (sha256
16351 (base32
16352 "1i0j3zs1ln48n0g8a90vqbv6528mcswhzys6252yp0c8w1ai64fb"))))
16353 (build-system ant-build-system)
16354 (arguments
16355 (list #:jar-name "java-argparse4j.jar"
16356 #:source-dir "main/src/main/"
16357 #:test-dir "main/src/test/"
16358 #:jdk openjdk11
16359 #:phases #~(modify-phases %standard-phases
16360 (add-after 'unpack 'copy-resources
16361 (lambda _
16362 (copy-recursively "main/src/test/resources"
16363 "target/test-classes")
16364 (copy-recursively "main/src/main/resources"
16365 "build/classes")))
16366 (replace 'install
16367 (install-from-pom "pom.xml")))))
16368 (inputs (list java-junit))
16369 (home-page "https://argparse4j.github.io/")
16370 (synopsis "Java command-line argument parser library")
16371 (description "Argparse4j is a command line argument parser library for
16372Java based on Python's @code{argparse} module.")
16373 (license license:expat)))
16374
16375(define-public java-metadata-extractor
16376 (package
16377 (name "java-metadata-extractor")
16378 (version "2.19.0")
16379 (source (origin
16380 (method git-fetch)
16381 (uri (git-reference
16382 (url "https://github.com/drewnoakes/metadata-extractor")
16383 (commit version)))
16384 (file-name (git-file-name name version))
16385 (sha256
16386 (base32
16387 "1axnw47n06a116g8bml2l6rxx92grxp935gspyhz4pz868m7hrna"))))
16388 (build-system ant-build-system)
16389 (arguments
16390 `(#:jar-name "metadata-extractor.jar"
16391 #:source-dir "Source"
16392 #:test-dir "Tests"
16393 #:phases
16394 (modify-phases %standard-phases
16395 (add-before 'build 'fix-xmp-path
16396 (lambda _
16397 ;; This version of metadata-extractor depends on java-xmp 6, which
16398 ;; is non-free. These changes allow using java-xmp 5, which is
16399 ;; the last free-software version of java-xmp.
16400 (substitute* (find-files "." ".*.java")
16401 (("com.adobe.internal.xmp") "com.adobe.xmp"))
16402 (substitute* "Source/com/drew/metadata/xmp/XmpReader.java"
16403 (("\\.setXMPNodesToLimit.*") ";"))
16404 ;; Test failure, most likely because we use a different java-xmp
16405 ;; version.
16406 (delete-file "Tests/com/drew/metadata/xmp/XmpReaderTest.java")))
16407 (add-before 'check 'fix-test-dir
16408 (lambda _
16409 (substitute* "build.xml"
16410 (("/java\">") "\">"))
16411 #t)))))
16412 (propagated-inputs
16413 (list java-xmp))
16414 (native-inputs
16415 (list java-hamcrest-core java-junit))
16416 (home-page "https://github.com/drewnoakes/metadata-extractor")
16417 (synopsis "Extract metadata from image and video files")
16418 (description "Metadata-extractor is a straightforward Java library for
16419reading metadata from image files. It is able to read metadata in Exif,
16420IPTC, XMP, ICC and more formats.")
16421 (license license:asl2.0)))
16422
16423(define-public java-svg-salamander
16424 (package
16425 (name "java-svg-salamander")
16426 (version "1.1.2")
16427 (source (origin
16428 (method git-fetch)
16429 (uri (git-reference
16430 (url "https://github.com/blackears/svgSalamander")
16431 (commit (string-append "v" version))))
16432 (file-name (git-file-name name version))
16433 (sha256
16434 (base32
16435 "1zv3kjdkf6iqf02x6ln76254y634j2ji448y706a65lsbfjmmicf"))
16436 (modules '((guix build utils)))
16437 (snippet
16438 '(begin
16439 (for-each delete-file (find-files "." ".*.jar"))
16440 #t))
16441 (patches
16442 (search-patches "java-svg-salamander-Fix-non-det.patch"))))
16443 (build-system ant-build-system)
16444 (arguments
16445 `(#:tests? #f; no tests
16446 #:phases
16447 (modify-phases %standard-phases
16448 (add-after 'unpack 'chdir
16449 (lambda _
16450 (chdir "svg-core")
16451 #t))
16452 (add-before 'build 'copy-jars
16453 (lambda* (#:key inputs #:allow-other-keys)
16454 (copy-file (car (find-files (assoc-ref inputs "javacc") "\\.jar$"))
16455 "../libraries/javacc.jar")
16456 (copy-file (car (find-files (assoc-ref inputs "ant") "ant\\.jar$"))
16457 "../libraries/ant.jar")
16458 #t))
16459 (replace 'install
16460 (install-jars "dist")))))
16461 (native-inputs
16462 (list javacc))
16463 (home-page "https://github.com/blackears/svgSalamander")
16464 (synopsis "SVG engine for Java")
16465 (description "SVG Salamander is an SVG engine for Java that's designed
16466to be small, fast, and allow programmers to use it with a minimum of fuss.
16467It's in particular targeted for making it easy to integrate SVG into Java
16468games and making it much easier for artists to design 2D game content - from
16469rich interactive menus to charts and graphcs to complex animations.")
16470 (license license:bsd-2)))
16471
16472(define-public java-jboss-transaction-api-spec
16473 (package
16474 (name "java-jboss-transaction-api-spec")
16475 (version "1.2+1.1.1")
16476 (source (origin
16477 (method git-fetch)
16478 (uri (git-reference
16479 (url "https://github.com/jboss/jboss-transaction-api_spec")
16480 (commit "jboss-transaction-api_1.2_spec-1.1.1.Final")))
16481 (file-name (git-file-name name version))
16482 (sha256
16483 (base32
16484 "1xbfq5hvb86izflydxrqqv3k26c1ba2m0ap6m97shqrsdi9by4wy"))))
16485 (build-system ant-build-system)
16486 (arguments
16487 `(#:jar-name "java-jboss-transaction-api_spec.jar"
16488 #:source-dir "src/main/java"
16489 #:tests? #f)); no tests
16490 (inputs
16491 (list java-cdi-api java-jboss-interceptors-api-spec))
16492 (home-page "https://github.com/jboss/jboss-transaction-api_spec")
16493 (synopsis "Generic transaction management API in Java")
16494 (description "Java-jboss-transaction-api-spec implements the Transactions
16495API. A transaction is a unit of work containing one or more operations
16496involving one or more shared resources having ACID (Atomicity, Consistency,
16497Isolation and Durability) properties.")
16498 ;; either gpl2 only with classpath exception or cddl.
16499 (license (list license:gpl2 license:cddl1.0))))
16500
16501(define-public java-picocli
16502 (package
16503 (name "java-picocli")
16504 (version "4.3.2")
16505 (source (origin
16506 (method git-fetch)
16507 (uri (git-reference
16508 (url "https://github.com/remkop/picocli")
16509 (commit (string-append "v" version))))
16510 (file-name (git-file-name name version))
16511 (sha256
16512 (base32
16513 "1sxp6rxjfgjd98ly14b3d15dvxkm5wg4g46w12jyhmr0kmkaca3c"))))
16514 (build-system ant-build-system)
16515 (arguments
16516 `(#:jar-name "picocli.jar"
16517 #:source-dir "src/main/java"
16518 ;; Tests require missing dependencies (junitparams, system-rules)
16519 #:tests? #f))
16520 (home-page "https://picocli.info")
16521 (synopsis "REPL for the JVM")
16522 (description "Picocli is a framework for building command line applications
16523for the JVM. It supports colors, autocompletion, subcommands, and more. Written
16524in Java, usable from Groovy, Kotlin, Scala, etc.")
16525 (license license:asl2.0)))
16526
16527(define-public java-pj
16528 (package
16529 (name "java-pj")
16530 (version "20150107")
16531 (source (origin
16532 (method url-fetch)
16533 (uri (string-append "https://www.cs.rit.edu/~ark/pjsrc"
16534 version ".jar"))
16535 (sha256
16536 (base32
16537 "078xwaivl2qqjc07r0vk6kzpqlcb1bcar80p8r5qigh34hpr86d3"))
16538 (modules '((guix build utils)))
16539 (snippet
16540 '(for-each delete-file
16541 (find-files "." "\\.class$")))))
16542 (build-system ant-build-system)
16543 (arguments
16544 (list
16545 #:tests? #false ;there are none
16546 #:phases
16547 #~(modify-phases %standard-phases
16548 (add-after 'unpack 'chdir
16549 (lambda _ (chdir "src/pj")))
16550 (add-after 'chdir 'patch-source-directory
16551 (lambda _
16552 (substitute* "compile"
16553 (("SRCDIR1=/home/ark/public_html/pj/lib")
16554 (string-append "SRCDIR1=" (getcwd) "/lib")))))
16555 (replace 'build
16556 (lambda _
16557 (invoke "bash" "./compile" "linux")
16558 (with-directory-excursion "lib"
16559 (apply invoke "jar" "cf" (string-append "pj" #$version ".jar")
16560 (find-files "." "\\.class$")))))
16561 (replace 'install (install-jars ".")))))
16562 (home-page "https://www.cs.rit.edu/~ark/pj.shtml")
16563 (synopsis "Parallel programming in Java")
16564 (description "Parallel Java (PJ) is an API and middleware for parallel
16565programming in 100% Java on shared memory multiprocessor (SMP) parallel
16566computers, cluster parallel computers, and hybrid SMP cluster parallel
16567computers.")
16568 (license license:gpl3+)))
16569
16570(define-public java-jetbrains-annotations
16571 (package
16572 (name "java-jetbrains-annotations")
16573 (version "19.0.0")
16574 (source (origin
16575 (method git-fetch)
16576 (uri (git-reference
16577 (url "https://github.com/JetBrains/java-annotations")
16578 (commit version)))
16579 (file-name (git-file-name name version))
16580 (sha256
16581 (base32
16582 "0z6i1xs60cd5ffz23c49sq68wn5mphhs3xpar1n93ppama2ng80v"))))
16583 (build-system ant-build-system)
16584 (arguments
16585 `(#:jar-name "jetbrains-annotations.jar"
16586 #:source-dir "common/src/main/java:java8/src/main/java"
16587 #:tests? #f)); no tests
16588 (home-page "https://github.com/JetBrains/java-annotations")
16589 (synopsis "Annotations for Java and other JVM languages")
16590 (description "This package contains a set of Java annotations which can be
16591used in JVM-based languages. They serve as an additional documentation and
16592can be interpreted by IDEs and static analysis tools to improve code analysis.")
16593 (license license:expat)))
16594
16595(define-public java-javaparser
16596 (package
16597 (name "java-javaparser")
16598 (version "3.16.1")
16599 (source (origin
16600 (method git-fetch)
16601 (uri (git-reference
16602 (url "https://github.com/javaparser/javaparser")
16603 (commit (string-append "javaparser-parent-" version))))
16604 (file-name (git-file-name name version))
16605 (sha256
16606 (base32
16607 "1a4jk12ffa31fa0y8vda0739vpfj1206p0nha842b7bixbvwamv9"))
16608 (modules '((guix build utils)))
16609 (snippet
16610 '(begin
16611 (for-each delete-file
16612 (find-files "." "\\.jar$"))
16613 #t))))
16614 (build-system ant-build-system)
16615 (arguments
16616 `(#:tests? #f; tests require jbehave and junit5
16617 #:phases
16618 (modify-phases %standard-phases
16619 (add-before 'build 'fill-template
16620 (lambda _
16621 (with-directory-excursion "javaparser-core/src/main"
16622 (copy-file "java-templates/com/github/javaparser/JavaParserBuild.java"
16623 "java/com/github/javaparser/JavaParserBuild.java")
16624 (substitute* "java/com/github/javaparser/JavaParserBuild.java"
16625 (("\\$\\{project.version\\}") ,version)
16626 (("\\$\\{project.name\\}") "javaparser")
16627 (("\\$\\{project.build.finalName\\}") "javaparser")
16628 (("\\$\\{maven.version\\}") "fake")
16629 (("\\$\\{maven.build.version\\}") "fake")
16630 (("\\$\\{build.timestamp\\}") "0")
16631 (("\\$\\{java.vendor\\}") "Guix")
16632 (("\\$\\{java.vendor.url\\}") "https://gnu.org/software/guix")
16633 (("\\$\\{java.version\\}") "1.8")
16634 (("\\$\\{os.arch\\}") "any")
16635 (("\\$\\{os.name\\}") "Guix")
16636 (("\\$\\{os.version\\}") "not available")))
16637 #t))
16638 (add-before 'build 'generate-javacc
16639 (lambda _
16640 (with-directory-excursion "javaparser-core/src/main/java"
16641 (invoke "java" "javacc" "../javacc/java.jj"))
16642 #t))
16643 (add-before 'build 'copy-javacc-support
16644 (lambda _
16645 (with-directory-excursion "javaparser-core/src/main"
16646 (copy-recursively "javacc-support" "java"))
16647 #t))
16648 (replace 'build
16649 (lambda _
16650 (define (build name)
16651 (format #t "Building ~a~%" name)
16652 (delete-file-recursively "build/classes")
16653 (mkdir-p "build/classes")
16654 (apply invoke "javac"
16655 "-cp" (string-append (getenv "CLASSPATH") ":"
16656 (string-join (find-files "build/jar" ".")
16657 ":"))
16658 "-d" "build/classes"
16659 (find-files (string-append name "/src/main/java")
16660 ".*.java"))
16661 (invoke "jar" "-cf" (string-append "build/jar/" name ".jar")
16662 "-C" "build/classes" "."))
16663 (mkdir-p "build/classes")
16664 (mkdir-p "build/test-classes")
16665 (mkdir-p "build/jar")
16666 (build "javaparser-core")
16667 (build "javaparser-core-serialization")
16668 (build "javaparser-core-generators")
16669 (build "javaparser-core-metamodel-generator")
16670 (build "javaparser-symbol-solver-core")
16671 #t))
16672 (replace 'install
16673 (install-jars "build/jar")))))
16674 (inputs
16675 (list java-guava java-jboss-javassist java-jsonp-api))
16676 (native-inputs
16677 (list javacc))
16678 (home-page "https://javaparser.org/")
16679 (synopsis "Parser for Java")
16680 (description
16681 "This project contains a set of libraries implementing a Java 1.0 - Java
1668211 Parser with advanced analysis functionalities.")
16683 (license (list
16684 ;; either lgpl or asl
16685 license:lgpl3+
16686 license:asl2.0))))
16687
16688(define-public tla2tools
16689 ;; This package was originally based on the "v1.8.0" tag, but that merely
16690 ;; points to the moving master branch. That might be because the ‘latest
16691 ;; release’ at GitHub is currently 1.7.1. We'll see! For now, rather than
16692 ;; downgrade to 1.7.1 proper, use the commit that we originally dubbed 1.8.0.
16693 (let* ((release "1.7.1")
16694 (revision "0")
16695 (commit "6932e19083fc6df42473464857fc1280cb5aaecc"))
16696 (package
16697 (name "tla2tools")
16698 (version (git-version release revision commit))
16699 (source (origin
16700 (method git-fetch)
16701 (uri (git-reference
16702 (url "https://github.com/tlaplus/tlaplus")
16703 (commit commit)))
16704 (file-name (git-file-name name version))
16705 (sha256
16706 (base32
16707 "1hhx8gmn81k8qrkx4p7ppinmygxga9fqffd626wkvhjgg2ky8lhs"))
16708 (patches
16709 (search-patches "tla2tools-build-xml.patch"))
16710 (modules '((guix build utils)))
16711 (snippet
16712 '(begin
16713 ;; Remove packaged libraries (see 'replace-libs below)
16714 (for-each delete-file (find-files "." ".*.jar$"))))))
16715 (build-system ant-build-system)
16716 (arguments
16717 (let* ((tlatools "tlatools/org.lamport.tlatools/")
16718 (build-xml (string-append tlatools "customBuild.xml")))
16719 `(#:jdk ,openjdk11
16720 #:modules ((guix build ant-build-system)
16721 (guix build utils)
16722 (ice-9 match)
16723 (srfi srfi-26))
16724 #:make-flags '("-f" ,build-xml)
16725 #:phases
16726 (modify-phases %standard-phases
16727 ;; Replace packed libs with references to jars in store
16728 (add-after 'unpack 'replace-libs
16729 (lambda* (#:key inputs #:allow-other-keys)
16730 (define (input-jar input)
16731 (car (find-files (assoc-ref inputs input) "\\.jar$")))
16732 (for-each
16733 (match-lambda
16734 ((file . input)
16735 (symlink (input-jar input)
16736 (string-append ,tlatools "/lib/" file))))
16737 '(("gson/gson-2.8.6.jar" . "java-gson")
16738 ("javax.mail/mailapi-1.6.3.jar" . "java-javax-mail")
16739 ("jline/jline-terminal-3.14.1.jar" . "java-jline-terminal")
16740 ("jline/jline-reader-3.14.1.jar" . "java-jline-reader")
16741 ("lsp/org.eclipse.lsp4j.debug-0.10.0.jar" .
16742 "java-eclipse-lsp4j-debug")
16743 ("lsp/org.eclipse.lsp4j.jsonrpc-0.10.0.jar" .
16744 "java-eclipse-lsp4j-jsonrpc")
16745 ("lsp/org.eclipse.lsp4j.jsonrpc.debug-0.10.0.jar" .
16746 "java-eclipse-lsp4j-jsonrpc-debug")
16747 ("junit-4.12.jar" . "java-junit")
16748 ("easymock-3.3.1.jar" . "java-easymock")))
16749 ;; Retain a tiny subset of the original X-Git-*
16750 ;; manifest values just to aid in debugging.
16751 (substitute* ,build-xml
16752 (("\\$\\{git.tag\\}") (string-append "v" ,release)))))
16753 (add-before 'check 'prepare-tests
16754 (lambda _
16755 ;; The pcal tests write to .cfg files.
16756 (for-each (cut chmod <> #o644)
16757 (find-files (string-append ,tlatools
16758 "/test-model/pcal")
16759 "\\.cfg$"))))
16760 (replace 'install
16761 (lambda* (#:key inputs outputs #:allow-other-keys)
16762 (let* ((share (string-append (assoc-ref outputs "out") "/share/java"))
16763 (jar-name "tla2tools.jar"); set in project.properties
16764 (jar (string-append ,tlatools
16765 "/dist/" jar-name))
16766 (java-cp (string-append share "/" jar-name))
16767 (bin (string-append (assoc-ref outputs "out") "/bin"))
16768 (java (search-input-file inputs "/bin/java")))
16769 (install-file jar share)
16770 (mkdir-p bin)
16771 ;; Generate wrapper scripts for bin/, which invoke common
16772 ;; commands within tla2tools.jar. Users can still invoke
16773 ;; tla2tools.jar for the rest.
16774 (for-each
16775 (match-lambda
16776 ((wrapper . class)
16777 (let ((file (string-append bin "/" wrapper)))
16778 (begin
16779 (with-output-to-file file
16780 (lambda _
16781 (display
16782 (string-append
16783 "#!/bin/sh\n"
16784 java " -XX:+UseParallelGC " " -cp " java-cp " " class " \"$@\""))))
16785 (chmod file #o755)))))
16786 ;; bin/wrapper . java-class
16787 '(("pcal" . "pcal.trans")
16788 ("tlatex" . "tla2tex.TLA")
16789 ("tla2sany" . "tla2sany.SANY")
16790 ("tlc2" . "tlc2.TLC")
16791 ("tlc2-repl" . "tlc2.REPL"))))))))))
16792 (native-inputs
16793 (list java-junit java-easymock))
16794 (inputs
16795 (list java-javax-mail
16796 java-gson-2.8.6
16797 java-jline-terminal
16798 java-jline-reader
16799 java-eclipse-lsp4j-jsonrpc
16800 java-eclipse-lsp4j-jsonrpc-debug
16801 java-eclipse-lsp4j-debug))
16802 (home-page "https://lamport.azurewebsites.net/tla/tools.html")
16803 (synopsis "TLA+ tools (analyzer, TLC, TLATeX, PlusCal translator)")
16804 (description "TLA+ is a high-level language for modeling programs and
16805systems---especially concurrent and distributed ones. It's based on the idea
16806that the best way to describe things precisely is with simple
16807mathematics. TLA+ and its tools are useful for eliminating fundamental design
16808errors, which are hard to find and expensive to correct in code.
16809
16810The following TLA+ tools are available in this distribution:
16811
16812@itemize
16813@item The Syntactic Analyzer: A parser and syntax checker for
16814 TLA+ specifications;
16815@item TLC: A model checker and simulator for a subclass of \"executable\" TLA+
16816 specifications;
16817@item TLATeX: A program for typesetting TLA+ specifications;
16818@item Beta test versions of 1-3 for the TLA+2 language; and
16819@item The PlusCal translator.
16820@end itemize")
16821 (license license:expat))))
16822
16823;;;
16824;;; Avoid adding new packages to the end of this file. To reduce the chances
16825;;; of a merge conflict, place them above by existing packages with similar
16826;;; functionality or similar names.
16827;;;