projects/guix·blob hurd-team · refs

16821 lines · 702.7 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 (add-after 'chdir 'regenerate-parsers
9736 (lambda _
9737 (invoke "antlr4" "-no-listener" "-Dlanguage=Python3"
9738 "src/antlr4/xpath/XPathLexer.g4")
9739 (invoke "antlr4" "-no-listener" "-Dlanguage=Python3"
9740 "tests/expr/Expr.g4"))))))
9741 (native-inputs (list antlr4 python-setuptools))
9742 (synopsis "ANTLR Python runtime library")
9743 (description "This package contains the Python runtime library used with
9744Python generated sources by ANTLR.")))
9745
9746(define-deprecated-package java-antlr4-runtime-python
9747 python-antlr4-runtime)
9748
9749(define-public antlr4
9750 (package
9751 (inherit java-antlr4-runtime)
9752 (name "antlr4")
9753 (arguments
9754 `(#:jar-name "antlr4.jar"
9755 #:source-dir "tool/src"
9756 #:test-dir "tool-testsuite/test:runtime-testsuite/test"
9757 #:test-include (list "**/Test*.java")
9758 #:test-exclude (list
9759 ;; These have no runnable methods and fail because
9760 ;; test-include above is too broad.
9761 "**/TestContext.java"
9762 "**/TestOutputReading.java"
9763 ;; no @Test methods
9764 "**/TestParserErrors.java"
9765 "**/TestSemPredEvalParser.java"
9766 "**/TestSets.java"
9767 "**/TestListeners.java"
9768 "**/TestParseTrees.java"
9769 "**/TestParserExec.java"
9770 "**/TestLexerErrors.java"
9771 "**/TestPerformance.java"
9772 "**/TestCompositeParsers.java"
9773 "**/TestLexerExec.java"
9774 "**/TestSemPredEvalLexer.java"
9775 "**/TestLeftRecursion.java"
9776 "**/TestFullContextParsing.java"
9777 "**/TestCompositeLexers.java"
9778 ;; Null pointer exception
9779 "**/TestCompositeGrammars.java")
9780 #:phases
9781 (modify-phases %standard-phases
9782 (add-before 'build 'fix-build.xml
9783 (lambda _
9784 ;; tests are not in a java subdirectory
9785 (substitute* "build.xml"
9786 (("\\$\\{test.home\\}/java") "${test.home}"))
9787 #t))
9788 ;; tests require to have a working antlr4 binary
9789 (delete 'check)
9790 (add-after 'install 'check
9791 (lambda _
9792 (invoke "ant" "compile-tests")
9793 (invoke "ant" "check" "-Dtest.home=runtime-testsuite/test")
9794 (invoke "ant" "check" "-Dtest.home=tool-testsuite/test")
9795 #t))
9796 (add-before 'check 'remove-unrelated-languages
9797 (lambda _
9798 ;; There are tests for other languages that ANTLR can generate, but
9799 ;; we don't have the infrastructure for that yet. Let's test Java
9800 ;; generation only.
9801 (for-each
9802 (lambda (language)
9803 (delete-file-recursively
9804 (string-append "runtime-testsuite/test/org/antlr/v4/test/runtime/"
9805 language)))
9806 '("cpp" "csharp" "go" "javascript" "php" "python" "python2"
9807 "python3" "swift"))
9808 #t))
9809 (add-before 'check 'generate-test-parsers
9810 (lambda* (#:key outputs #:allow-other-keys)
9811 (define (run-antlr dir filename package)
9812 (invoke "antlr4" "-lib" dir "-visitor" "-no-listener"
9813 "-package" package (string-append dir "/" filename)
9814 "-Xlog"))
9815 (setenv "PATH" (string-append (getenv "PATH") ":"
9816 (assoc-ref outputs "out") "/bin"))
9817 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
9818 "Java.g4" "org.antlr.v4.test.runtime.java.api")
9819 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
9820 "VisitorBasic.g4" "org.antlr.v4.test.runtime.java.api")
9821 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
9822 "VisitorCalc.g4" "org.antlr.v4.test.runtime.java.api")
9823 #t))
9824 (add-before 'check 'remove-graphemes
9825 (lambda _
9826 ;; When running antlr on grahemes.g4, we get a runtime exception:
9827 ;; set is empty. So delete the file that depends on it.
9828 (delete-file
9829 "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/perf/TimeLexerSpeed.java")
9830 #t))
9831 (add-after 'install 'bin-install
9832 (lambda* (#:key inputs outputs #:allow-other-keys)
9833 (let* ((output (assoc-ref outputs "out"))
9834 (bin (string-append output "/bin"))
9835 (bin/antlr4 (string-append bin "/antlr4")))
9836 (mkdir-p bin)
9837 (with-output-to-file bin/antlr4
9838 (lambda _
9839 (display
9840 (string-append
9841 "#!"
9842 (search-input-file inputs "bin/sh")
9843 "\n"
9844 (string-append (assoc-ref inputs "openjdk")
9845 "/bin/java")
9846 " -cp "
9847 (string-append output "/share/java/antlr4.jar")
9848 ":"
9849 (string-join
9850 (apply append
9851 (map (lambda (input)
9852 (find-files (assoc-ref inputs input)
9853 "\\.jar$"))
9854 '("antlr3" "java-stringtemplate"
9855 "java-antlr4-runtime" "java-treelayout"
9856 "java-jsonp-api" "java-icu4j")))
9857 ":")
9858 " org.antlr.v4.Tool $*\n"))))
9859 (chmod bin/antlr4 #o755))))
9860 (add-before 'build 'copy-resources
9861 (lambda _
9862 (copy-recursively "tool/resources/" "build/classes")
9863 #t))
9864 (add-before 'build 'generate-unicode
9865 (lambda _
9866 ;; First: build the generator
9867 (invoke "javac" "-cp" (getenv "CLASSPATH")
9868 "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java"
9869 "tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java")
9870 ;; Then use it
9871 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
9872 ":tool/src:runtime/Java")
9873 "org.antlr.v4.unicode.UnicodeRenderer"
9874 "tool/resources/org/antlr/v4/tool/templates"
9875 "unicodedata"
9876 "tool/src/org/antlr/v4/unicode/UnicodeData.java")
9877 ;; It seems there is a bug with our ST4
9878 (substitute* "tool/src/org/antlr/v4/unicode/UnicodeData.java"
9879 (("\\\\>") ">"))
9880 ;; Remove the additional file
9881 (delete-file "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java")
9882 #t))
9883 (add-before 'build 'generate-grammar
9884 (lambda* (#:key inputs #:allow-other-keys)
9885 (with-directory-excursion "tool/src/org/antlr/v4/parse"
9886 (for-each (lambda (file)
9887 (display file)
9888 (newline)
9889 (invoke "antlr3" file))
9890 '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g"
9891 "GrammarTreeVisitor.g" "ATNBuilder.g"
9892 "ActionSplitter.g" "LeftRecursiveRuleWalker.g")))
9893 (with-directory-excursion "tool/src/org/antlr/v4/codegen"
9894 (install-file "../parse/ANTLRParser.tokens" ".")
9895 (display "SourceGenTriggers.g\n")
9896 (invoke "antlr3" "SourceGenTriggers.g"))
9897 #t)))))
9898 (inputs
9899 (list antlr3
9900 java-antlr4-runtime
9901 java-icu4j
9902 java-jsonp-api
9903 java-stringtemplate
9904 java-treelayout
9905 openjdk))
9906 (native-inputs
9907 (list java-junit))
9908 (synopsis "Parser and lexer generator in Java")
9909 (description "ANTLR (ANother Tool for Language Recognition) is a powerful
9910parser generator for reading, processing, executing, or translating structured
9911text or binary files. It's widely used to build languages, tools, and
9912frameworks. From a grammar, ANTLR generates a parser that can build and walk
9913parse trees.")))
9914
9915(define-public java-antlr4-runtime-4.1
9916 (package
9917 (inherit java-antlr4-runtime)
9918 (version "4.1")
9919 (source (origin
9920 (method git-fetch)
9921 (uri (git-reference
9922 (url "https://github.com/antlr/antlr4")
9923 (commit version)))
9924 (file-name (git-file-name "antlr4" version))
9925 (sha256
9926 (base32
9927 "1i8hmx5an58cjyvhji0xgpvd6lq00z1k1mjys025q2wqc25wv4c1"))))
9928 (arguments
9929 (substitute-keyword-arguments (package-arguments java-antlr4-runtime)
9930 ((#:phases phases)
9931 `(modify-phases ,phases
9932 (add-before 'configure 'chmod
9933 (lambda _
9934 (chmod "build.xml" #o644)
9935 #t))))))
9936 (inputs
9937 (list java-treelayout))))
9938
9939(define-public antlr4-4.1
9940 (package
9941 (inherit antlr4)
9942 (version (package-version java-antlr4-runtime-4.1))
9943 (source (package-source java-antlr4-runtime-4.1))
9944 (arguments
9945 (substitute-keyword-arguments (package-arguments antlr4)
9946 ((#:test-dir _)
9947 "tool/test")
9948 ((#:test-exclude excludes)
9949 `(list "**/TestParseErrors.java"
9950 "**/TestTopologicalSort.java"
9951 ,@excludes))
9952 ((#:phases phases)
9953 `(modify-phases ,phases
9954 (delete 'generate-unicode)
9955 (replace 'check
9956 (lambda _
9957 (invoke "ant" "check")
9958 #t))
9959 (add-before 'configure 'chmod
9960 (lambda _
9961 (chmod "build.xml" #o644)
9962 #t))
9963 (delete 'remove-graphemes)
9964 (delete 'remove-unrelated-languages)
9965 (delete 'generate-test-parsers)))))
9966 (inputs
9967 (alist-replace
9968 "java-antlr4-runtime" (list java-antlr4-runtime-4.1)
9969 (package-inputs antlr4)))))
9970
9971(define-public java-tunnelvisionlabs-antlr4-runtime-annotations
9972 (package
9973 (inherit java-antlr4-runtime)
9974 (name "java-tunnelvisionlabs-antlr4-runtime-annotations")
9975 (version "4.7.4")
9976 (source (origin
9977 (method git-fetch)
9978 (uri (git-reference
9979 (url "https://github.com/tunnelvisionlabs/antlr4")
9980 (commit (string-append version "-opt"))))
9981 (file-name (git-file-name "java-tunnelvisionlabs-antlr4" version))
9982 (sha256
9983 (base32
9984 "1mf2lvvsszpialsk23ma83pwp50nd32lrbjpa847zlm5gmranbr8"))
9985 (patches
9986 (search-patches "java-antlr4-Add-standalone-generator.patch"
9987 "java-tunnelvisionlabs-antlr-code-too-large.patch"))))
9988 (arguments
9989 `(#:jar-name "java-antlr4-runtime-annotations.jar"
9990 #:source-dir "runtime/JavaAnnotations/src"
9991 #:tests? #f; no tests
9992 #:phases
9993 (modify-phases %standard-phases
9994 (add-after 'build 'copy-resources
9995 (lambda _
9996 (copy-recursively "runtime/JavaAnnotations/resources"
9997 "build/classes")
9998 #t))
9999 (add-after 'copy-resources 'rebuild-jar
10000 (lambda _
10001 (invoke "ant" "jar")
10002 #t)))))
10003 (inputs '())
10004 (native-inputs '())
10005 (synopsis "Annotations for ANTLR's runtime library")
10006 (description "This package contains annotations used during the build of
10007the runtime library of ANTLR.")))
10008
10009;; the runtime of this library requires a lexer that is generated by antlr4.
10010;; However, antlr4 itself requires this library at build and run-time. We
10011;; use [email protected], the closest version of antlr that doesn't need this
10012;; bootstrap process, to generate the lexer. The generated lexer is built
10013;; for the 4.1 runtime, which is slightly different from this runtime.
10014;; So, we build the runtime with antlr 4.1, with a broken xml lexer, that we
10015;; use to build antlr4. We then re-use this antlr4 to build the runtime, and
10016;; the proper, working, runtime to build antlr4 again.
10017(define-public java-tunnelvisionlabs-antlr4-runtime-bootstrap
10018 (package
10019 (inherit java-antlr4-runtime)
10020 (name "java-tunnelvisionlabs-antlr4-runtime")
10021 (version (package-version java-tunnelvisionlabs-antlr4-runtime-annotations))
10022 (source (package-source java-tunnelvisionlabs-antlr4-runtime-annotations))
10023 (arguments
10024 `(#:jar-name "java-antlr4-runtime.jar"
10025 #:source-dir "runtime/Java/src"
10026 #:tests? #f; tests require antlr4, but antlr4 depends on this package
10027 #:phases
10028 (modify-phases %standard-phases
10029 (add-before 'build 'generate-xpath-lexer
10030 (lambda _
10031 (invoke "antlr4" "-lib" "runtime/Java/src/org/antlr/v4/runtime/tree/xpath"
10032 "-visitor" "-no-listener"
10033 "-package" "org.antlr.v4.runtime.tree.xpath"
10034 "runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.g4")
10035 ;; Generated code is for an incompatible version of the runtime
10036 (substitute* "runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.java"
10037 (("LexerATNSimulator\\(this,_ATN,_decisionToDFA,_sharedContextCache\\)")
10038 "LexerATNSimulator(this,_ATN)"))
10039 #t))
10040 (add-before 'build 'copy-resources
10041 (lambda _
10042 (copy-recursively "runtime/Java/src/main/dot"
10043 "build/classes")
10044 #t)))))
10045 (native-inputs
10046 `(("antlr4" ,antlr4-4.1)
10047 ("java-tunnelvisionlabs-antlr4-runtime-annotations"
10048 ,java-tunnelvisionlabs-antlr4-runtime-annotations)))
10049 (properties '((hidden? . #t))))) ;for bootstrapping purposes only
10050
10051(define-public java-tunnelvisionlabs-antlr4-bootstrap
10052 (package
10053 (inherit antlr4)
10054 (name "java-tunnelvisionlabs-antlr4")
10055 (version (package-version java-tunnelvisionlabs-antlr4-runtime-annotations))
10056 (source (package-source java-tunnelvisionlabs-antlr4-runtime-annotations))
10057 (arguments
10058 (substitute-keyword-arguments (package-arguments antlr4)
10059 ((#:test-dir _)
10060 "tool/test:runtime-testsuite/src")
10061 ((#:phases phases)
10062 `(modify-phases ,phases
10063 (delete 'remove-unrelated-languages)
10064 (delete 'remove-graphemes)
10065 (delete 'generate-test-parsers)
10066 (delete 'check)))))
10067 (native-inputs '())
10068 (inputs
10069 `(("antlr3" ,antlr3)
10070 ("java-antlr4-runtime" ,java-tunnelvisionlabs-antlr4-runtime-bootstrap)
10071 ("java-tunnelvisionlabs-antlr4-runtime-annotations"
10072 ,java-tunnelvisionlabs-antlr4-runtime-annotations)
10073 ("java-icu4j" ,java-icu4j)
10074 ("java-jsonp-api" ,java-jsonp-api)
10075 ("java-stringtemplate" ,java-stringtemplate)
10076 ("java-treelayout" ,java-treelayout)
10077 ("openjdk" ,openjdk)))
10078 (properties '((hidden? . #t))))) ;for bootstrapping purposes only
10079
10080(define-public java-tunnelvisionlabs-antlr4-runtime
10081 (package
10082 (inherit java-tunnelvisionlabs-antlr4-runtime-bootstrap)
10083 (native-inputs
10084 (alist-replace
10085 "antlr4" (list java-tunnelvisionlabs-antlr4-bootstrap)
10086 (package-native-inputs
10087 java-tunnelvisionlabs-antlr4-runtime-bootstrap)))
10088 (properties
10089 (alist-delete
10090 'hidden?
10091 (package-properties java-tunnelvisionlabs-antlr4-runtime-bootstrap)))))
10092
10093(define-public java-tunnelvisionlabs-antlr4
10094 (package
10095 (inherit java-tunnelvisionlabs-antlr4-bootstrap)
10096 (inputs
10097 (alist-replace
10098 "java-antlr4-runtime" (list java-tunnelvisionlabs-antlr4-runtime)
10099 (package-inputs java-tunnelvisionlabs-antlr4-bootstrap)))
10100 (properties
10101 (alist-delete
10102 'hidden?
10103 (package-properties java-tunnelvisionlabs-antlr4-bootstrap)))))
10104
10105(define-public java-commons-cli-1.2
10106 ;; This is a bootstrap dependency for Maven2.
10107 (package
10108 (inherit java-commons-cli)
10109 (version "1.2")
10110 (source (origin
10111 (method url-fetch)
10112 (uri (string-append "mirror://apache/commons/cli/source/"
10113 "commons-cli-" version "-src.tar.gz"))
10114 (sha256
10115 (base32
10116 "0rvfgzgv2pc1m091dfj3ih9ddsjjppr1f1wf0qmc3bk6b1kwv2dm"))))
10117 (arguments
10118 `(#:jar-name "commons-cli.jar"
10119 #:phases
10120 (modify-phases %standard-phases
10121 (add-before 'check 'fix-build-xml
10122 (lambda* (#:key inputs #:allow-other-keys)
10123 (substitute* "build.xml"
10124 (("dir=\"\\$\\{test.home\\}/java\"")
10125 "dir=\"${test.home}\""))
10126 #t)))))
10127 (native-inputs
10128 (list java-junit))))
10129
10130(define-public java-microemulator-cldc
10131 (package
10132 (name "java-microemulator-cldc")
10133 (version "2.0.4")
10134 (source (origin
10135 (method url-fetch)
10136 (uri (string-append "https://github.com/barteo/microemu/archive/"
10137 "microemulator_"
10138 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
10139 version)
10140 ".tar.gz"))
10141 (file-name (string-append name "-" version ".tar.gz"))
10142 (sha256
10143 (base32
10144 "1x1apmz38gkppxnwnygwmi12j54v4p258v8ddzn6dldkk7vak1ll"))))
10145 (build-system ant-build-system)
10146 (arguments
10147 `(#:jar-name "microemulator-cldc.jar"
10148 #:source-dir "microemu-cldc/src/main/java"
10149 #:tests? #f)); Requires even older software
10150 (home-page "https://github.com/barteo/microemu")
10151 (synopsis "J2ME CLDC emulator")
10152 (description "Microemulator is a Java 2 Micro Edition (J2ME) CLDC/MIDP
10153Emulator. It demonstrates MIDlet based applications in web browser
10154applet and can be run as a standalone java application.")
10155 (license (list license:asl2.0
10156 ;; or altenatively:
10157 license:lgpl2.1+))))
10158
10159(define-public java-datanucleus-javax-persistence
10160 (package
10161 (name "java-datanucleus-javax-persistence")
10162 (version "2.2.0")
10163 (source (origin
10164 (method url-fetch)
10165 (uri (string-append "https://github.com/datanucleus/"
10166 "javax.persistence/archive/javax.persistence-"
10167 version "-release.tar.gz"))
10168 (sha256
10169 (base32
10170 "11jx0fjwgc2hhbqqgdd6m1pf2fplf9vslppygax0y1z5csnqjhpx"))))
10171 (build-system ant-build-system)
10172 (arguments
10173 `(#:jar-name "java-datanucleus-javax-persistence.jar"
10174 #:jdk ,icedtea-8
10175 #:source-dir "src/main/java"
10176 #:tests? #f)); no tests
10177 (home-page "https://github.com/datanucleus/javax.persistence")
10178 (synopsis "JPA API")
10179 (description "This package contains a clean definition of JPA API intended
10180for use with DataNucleus JPA since the JCP haven't provided an official JPA API
10181jar. See @url{http://java.net/projects/jpa-spec/downloads} for the specification
10182used to generate this API.")
10183 (license (list license:edl1.0 license:epl1.0))))
10184
10185(define-public java-osgi-cmpn
10186 (package
10187 (name "java-osgi-cmpn")
10188 (version "6.0.0")
10189 (source (origin
10190 (method url-fetch)
10191 (uri (string-append "https://repo1.maven.org/maven2/"
10192 "org/osgi/osgi.cmpn/" version "/osgi.cmpn-"
10193 version "-sources.jar"))
10194 (sha256
10195 (base32
10196 "1lmb6xyrmkqdhv1kayf0514rlwq6ypvs4m44ibrck3snp8241wys"))))
10197 (build-system ant-build-system)
10198 (arguments
10199 `(#:jar-name "osgi-cmpn.jar"
10200 #:tests? #f)); no tests
10201 (inputs
10202 `(("annotation" ,java-osgi-annotation)
10203 ("core" ,java-osgi-core)
10204 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
10205 ("microemulator" ,java-microemulator-cldc)
10206 ("servlet" ,java-classpathx-servletapi)))
10207 (home-page "https://www.osgi.org")
10208 (synopsis "Compendium specification module of OSGi framework")
10209 (description
10210 "OSGi, for Open Services Gateway initiative framework, is a module system
10211and service platform for the Java programming language. This package contains
10212the compendium specification module, providing interfaces and classes for use
10213in compiling bundles.")
10214 (license license:asl2.0)))
10215
10216(define-public java-osgi-cmpn-7.0.0
10217 ;; Upstream uses release-train tags for the monorepo; osgi.cmpn/bnd.bnd
10218 ;; emits artifact version 7.0.0 from the r7-cmpn-spec-final checkout.
10219 (let ((tag "r7-cmpn-spec-final"))
10220 (package
10221 (name "java-osgi-cmpn")
10222 (version "7.0.0")
10223 (source (origin
10224 (method git-fetch)
10225 (uri (git-reference
10226 (url "https://github.com/osgi/osgi")
10227 (commit tag)))
10228 (modules '((guix build utils)))
10229 (snippet
10230 '(begin
10231 (for-each delete-file
10232 (find-files "." "\\.jar$"))
10233 #t))
10234 (file-name (git-file-name name version))
10235 (sha256
10236 (base32
10237 "08i8d2y7awr09809qwnv7l5hzqi5di3sv21bvgrmhibm07hr4ml9"))))
10238 (build-system ant-build-system)
10239 (arguments
10240 (list
10241 #:tests? #f
10242 #:jdk openjdk9
10243 #:jar-name "osgi-cmpn.jar"
10244 #:phases
10245 #~(modify-phases %standard-phases
10246 (add-after 'unpack 'prepare-source-layout
10247 (lambda _
10248 (mkdir-p "src")
10249 (for-each
10250 (lambda (directory)
10251 (invoke "cp" "-r" (string-append directory "/.") "src/"))
10252 '("org.osgi.application/src"
10253 "org.osgi.namespace.contract/src"
10254 "org.osgi.namespace.extender/src"
10255 "org.osgi.namespace.implementation/src"
10256 "org.osgi.namespace.service/src"
10257 "org.osgi.namespace.unresolvable/src"
10258 "org.osgi.service.async/src"
10259 "org.osgi.service.application/src"
10260 "org.osgi.service.blueprint/src"
10261 "org.osgi.service.cm/src"
10262 "org.osgi.service.component/src"
10263 "org.osgi.service.component.annotations/src"
10264 "org.osgi.service.configurator/src"
10265 "org.osgi.service.coordinator/src"
10266 "org.osgi.service.deploymentadmin/src"
10267 "org.osgi.service.device/src"
10268 "org.osgi.service.dmt/src"
10269 "org.osgi.service.event/src"
10270 "org.osgi.service.http/src"
10271 "org.osgi.service.http.whiteboard/src"
10272 "org.osgi.service.io/src"
10273 "org.osgi.service.jaxrs/src"
10274 "org.osgi.service.jdbc/src"
10275 "org.osgi.service.jndi/src"
10276 "org.osgi.service.jpa/src"
10277 "org.osgi.service.log/src"
10278 "org.osgi.service.metatype/src"
10279 "org.osgi.service.metatype.annotations/src"
10280 "org.osgi.service.monitor/src"
10281 "org.osgi.service.prefs/src"
10282 "org.osgi.service.provisioning/src"
10283 "org.osgi.service.remoteserviceadmin/src"
10284 "org.osgi.service.repository/src"
10285 "org.osgi.service.rest/src"
10286 "org.osgi.service.serviceloader/src"
10287 "org.osgi.service.subsystem/src"
10288 "org.osgi.service.transaction.control/src"
10289 "org.osgi.service.upnp/src"
10290 "org.osgi.service.useradmin/src"
10291 "org.osgi.service.wireadmin/src"
10292 "org.osgi.util.converter/src"
10293 "org.osgi.util.function/src"
10294 "org.osgi.util.measurement/src"
10295 "org.osgi.util.position/src"
10296 "org.osgi.util.promise/src"
10297 "org.osgi.util.pushstream/src"
10298 "org.osgi.util.xml/src"))))
10299 (add-before 'install 'create-pom
10300 (generate-pom.xml "pom.xml" "org.osgi" "osgi.cmpn" #$version))
10301 (replace 'install (install-from-pom "pom.xml")))))
10302 (inputs
10303 (list java-osgi-annotation-8.1.0
10304 java-osgi-core-8.0.0
10305 java-classpathx-servletapi
10306 java-microemulator-cldc
10307 java-datanucleus-javax-persistence
10308 java-jaxrs-api-2))
10309 (home-page "https://www.osgi.org")
10310 (synopsis "Compendium specification module of OSGi framework")
10311 (description "OSGi, for Open Services Gateway initiative framework, is a
10312module system and service platform for the Java programming language. This
10313package contains the compendium specification module, providing interfaces
10314and classes for use in compiling bundles.")
10315 (license license:asl2.0))))
10316
10317(define-public java-felix-resolver-2
10318 (package
10319 (name "java-felix-resolver")
10320 (version "2.0.4")
10321 (source (origin
10322 (method git-fetch)
10323 (uri (git-reference
10324 (url "https://github.com/apache/felix-dev")
10325 (commit (string-append "org.apache.felix.resolver-"
10326 version))))
10327 (modules '((guix build utils)))
10328 (snippet
10329 '(begin
10330 (for-each delete-file
10331 (find-files "." "\\.jar$"))
10332 #t))
10333 (file-name (git-file-name name version))
10334 (sha256
10335 (base32
10336 "1lkwh6q58vm0inll8zaqizwfvw8d7kzaff0x6lwa17j9k91yllyf"))))
10337 (build-system ant-build-system)
10338 (arguments
10339 (list
10340 #:tests? #f
10341 #:jar-name "org.apache.felix.resolver.jar"
10342 #:source-dir "resolver/src/main/java"
10343 #:phases
10344 #~(modify-phases %standard-phases
10345 (add-before 'install 'create-pom
10346 (generate-pom.xml "pom.xml" "org.apache.felix"
10347 "org.apache.felix.resolver" #$version))
10348 (replace 'install (install-from-pom "pom.xml")))))
10349 (inputs (list java-osgi-annotation java-osgi-core))
10350 (home-page "https://felix.apache.org/")
10351 (synopsis "Apache Felix OSGi resolver")
10352 (description "Apache Felix Resolver implements the OSGi resolver
10353specification, providing dependency resolution for OSGi bundles.")
10354 (license license:asl2.0)))
10355
10356(define-public java-felix-framework-7
10357 (package
10358 (name "java-felix-framework")
10359 (version "7.0.5")
10360 (source (origin
10361 (method git-fetch)
10362 (uri (git-reference
10363 (url "https://github.com/apache/felix-dev")
10364 (commit (string-append "org.apache.felix.framework-"
10365 version))))
10366 (modules '((guix build utils)))
10367 (snippet
10368 '(begin
10369 (for-each delete-file
10370 (find-files "." "\\.jar$"))
10371 #t))
10372 (file-name (git-file-name name version))
10373 (sha256
10374 (base32
10375 "1w4kdy0m4md2j0nf3shn76v9vxvjqa9sxl4j06bk08yn9icnj72k"))))
10376 (build-system ant-build-system)
10377 (arguments
10378 (list
10379 #:tests? #f
10380 #:jar-name "org.apache.felix.framework.jar"
10381 #:source-dir "framework/src/main/java"
10382 #:phases
10383 #~(modify-phases %standard-phases
10384 (add-after 'unpack 'create-animal-sniffer-stub
10385 (lambda _
10386 ;; Felix uses this compile-time Maven annotation to suppress
10387 ;; JRE compatibility warnings. It has no runtime effect.
10388 (mkdir-p "framework/src/main/java/org/codehaus/mojo/animal_sniffer")
10389 (call-with-output-file
10390 "framework/src/main/java/org/codehaus/mojo/animal_sniffer/IgnoreJRERequirement.java"
10391 (lambda (port)
10392 (display (string-append
10393 "package org.codehaus.mojo.animal_sniffer;\n"
10394 "import java.lang.annotation.*;\n"
10395 "@Retention(RetentionPolicy.CLASS)\n"
10396 "@Target({ElementType.METHOD,"
10397 " ElementType.CONSTRUCTOR,"
10398 " ElementType.TYPE})\n"
10399 "public @interface IgnoreJRERequirement {}\n")
10400 port)))))
10401 (add-after 'build 'add-service-descriptor-and-resources
10402 (lambda _
10403 ;; Include the upstream service descriptors and resources that
10404 ;; Felix expects in the framework jar.
10405 (invoke "jar" "uf" "build/jar/org.apache.felix.framework.jar"
10406 "-C" "framework/src/main/resources" "META-INF/services")
10407 ;; Felix reads default.properties at startup to determine
10408 ;; system packages. The source file uses Maven's ${dollar}
10409 ;; placeholder, so replace it here.
10410 (substitute* "framework/src/main/resources/default.properties"
10411 (("\\$\\{dollar\\}") "$"))
10412 (invoke "jar" "uf" "build/jar/org.apache.felix.framework.jar"
10413 "-C" "framework/src/main/resources" "default.properties")
10414 ;; Compile accessor.src (a java.net.Accessor class used by
10415 ;; SecureAction to bypass access controls) and include the
10416 ;; compiled bytecode as accessor.bytes.
10417 (mkdir-p "build/accessor-src/java/net")
10418 (copy-file
10419 "framework/src/main/resources/org/apache/felix/framework/util/accessor.src"
10420 "build/accessor-src/java/net/Accessor.java")
10421 (mkdir-p "build/accessor-out")
10422 (invoke "javac"
10423 "-d" "build/accessor-out"
10424 "build/accessor-src/java/net/Accessor.java")
10425 (copy-file "build/accessor-out/java/net/Accessor.class"
10426 "build/accessor.bytes")
10427 (invoke "jar" "uf" "build/jar/org.apache.felix.framework.jar"
10428 "-C" "build"
10429 "accessor.bytes")))
10430 (add-after 'add-service-descriptor-and-resources
10431 'fix-accessor-path
10432 (lambda _
10433 ;; accessor.bytes must be at
10434 ;; org/apache/felix/framework/util/accessor.bytes
10435 (let ((jar "build/jar/org.apache.felix.framework.jar"))
10436 (mkdir-p "build/accessor-pkg/org/apache/felix/framework/util")
10437 (copy-file "build/accessor.bytes"
10438 "build/accessor-pkg/org/apache/felix/framework/util/accessor.bytes")
10439 (invoke "jar" "uf" jar
10440 "-C" "build/accessor-pkg"
10441 "org/apache/felix/framework/util/accessor.bytes"))))
10442 (add-before 'install 'create-pom
10443 (generate-pom.xml "pom.xml" "org.apache.felix"
10444 "org.apache.felix.framework" #$version))
10445 (replace 'install (install-from-pom "pom.xml")))))
10446 (inputs (list java-osgi-annotation-8.1.0
10447 java-osgi-core-8.0.0
10448 java-felix-resolver-2))
10449 (home-page "https://felix.apache.org/")
10450 (synopsis "Apache Felix OSGi framework")
10451 (description "Apache Felix is a community effort to implement the OSGi
10452Framework and Service platform.")
10453 (license license:asl2.0)))
10454
10455(define-public java-felix-main-7.0.5
10456 (package
10457 (name "java-felix-main")
10458 (version "7.0.5")
10459 (source (origin
10460 (method git-fetch)
10461 (uri (git-reference
10462 (url "https://github.com/apache/felix-dev")
10463 (commit (string-append "org.apache.felix.main-"
10464 version))))
10465 (modules '((guix build utils)))
10466 (snippet
10467 '(begin
10468 (for-each delete-file
10469 (find-files "." "\\.jar$"))
10470 #t))
10471 (file-name (git-file-name name version))
10472 (sha256
10473 (base32
10474 "04miqvr8lqng4a0n6zry8rary8hrcbrq41652adyz85znmcp1z59"))))
10475 (build-system ant-build-system)
10476 (arguments
10477 (list
10478 #:tests? #f
10479 #:jar-name "org.apache.felix.main.jar"
10480 #:source-dir "main/src/main/java"
10481 #:phases
10482 #~(modify-phases %standard-phases
10483 (add-after 'build 'create-uber-jar
10484 (lambda* (#:key inputs #:allow-other-keys)
10485 ;; org.apache.felix.main is an uber jar combining framework,
10486 ;; resolver, and osgi-core classes with Main and AutoProcessor.
10487 (let ((jar (canonicalize-path
10488 "build/jar/org.apache.felix.main.jar"))
10489 (work-dir (mkdtemp "/tmp/felix-merge-XXXXXX")))
10490 (with-directory-excursion work-dir
10491 (for-each
10492 (lambda (input-name)
10493 (for-each
10494 (lambda (dep-jar)
10495 (invoke "jar" "xf" dep-jar))
10496 (find-files (assoc-ref inputs input-name)
10497 "\\.jar$")))
10498 '("java-felix-framework"
10499 "java-felix-resolver"
10500 "java-osgi-core"))
10501 ;; Remove metadata that would conflict with the
10502 ;; main jar's own manifest.
10503 (when (file-exists? "META-INF/MANIFEST.MF")
10504 (delete-file "META-INF/MANIFEST.MF"))
10505 (when (file-exists? "META-INF/maven")
10506 (delete-file-recursively "META-INF/maven"))
10507 (invoke "jar" "uf" jar "-C" work-dir ".")))))
10508 (add-after 'create-uber-jar 'add-service-descriptor
10509 (lambda _
10510 (let ((jar "build/jar/org.apache.felix.main.jar"))
10511 (mkdir-p "META-INF/services")
10512 (call-with-output-file
10513 "META-INF/services/org.osgi.framework.launch.FrameworkFactory"
10514 (lambda (port)
10515 (display
10516 "org.apache.felix.framework.FrameworkFactory\n" port)))
10517 (invoke "jar" "uf" jar "-C" "." "META-INF/services"))))
10518 (add-before 'install 'create-pom
10519 (generate-pom.xml "pom.xml" "org.apache.felix"
10520 "org.apache.felix.main" #$version))
10521 (replace 'install (install-from-pom "pom.xml")))))
10522 (inputs (list java-felix-framework-7
10523 java-felix-resolver-2
10524 java-osgi-core-8.0.0))
10525 (home-page "https://felix.apache.org/")
10526 (synopsis "Apache Felix Main distribution jar")
10527 (description "Apache Felix Main is the standard distribution jar for
10528the Apache Felix OSGi framework. It bundles the framework, resolver, and
10529OSGi core classes into a single jar with a standalone launcher.")
10530 (license license:asl2.0)))
10531
10532(define-public java-osgi-service-component-annotations
10533 (package
10534 (name "java-osgi-service-component-annotations")
10535 (version "1.3.0")
10536 (source (origin
10537 (method url-fetch)
10538 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10539 "org.osgi.service.component.annotations/"
10540 version "/org.osgi.service.component.annotations-"
10541 version "-sources.jar"))
10542 (sha256
10543 (base32
10544 "15rq9cmp4fpn74q44m4j35qsqmjf5lx3hcrk6pzvbhc08igic2f0"))))
10545 (build-system ant-build-system)
10546 (arguments
10547 `(#:jar-name "osgi-service-component-annotations.jar"
10548 #:tests? #f)); no tests
10549 (inputs
10550 `(("annotation" ,java-osgi-annotation)))
10551 (home-page "https://www.osgi.org")
10552 (synopsis "Support annotations for osgi-service-component")
10553 (description
10554 "OSGi, for Open Services Gateway initiative framework, is a module system
10555and service platform for the Java programming language. This package contains
10556the support annotations for osgi-service-component.")
10557 (license license:asl2.0)))
10558
10559(define-public java-osgi-dto
10560 (package
10561 (name "java-osgi-dto")
10562 (version "1.0.0")
10563 (source (origin
10564 (method url-fetch)
10565 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10566 "org.osgi.dto/" version "/org.osgi.dto-"
10567 version "-sources.jar"))
10568 (sha256
10569 (base32
10570 "0f4bqjzadn0hwk6sd3h5gvbyfp3yci1s6r0v770cc15p0pg627yr"))))
10571 (build-system ant-build-system)
10572 (arguments
10573 `(#:jar-name "osgi-dto.jar"
10574 #:tests? #f)); no tests
10575 (inputs
10576 `(("annotation" ,java-osgi-annotation)))
10577 (home-page "https://www.osgi.org")
10578 (synopsis "Data Transfer Objects")
10579 (description
10580 "OSGi, for Open Services Gateway initiative framework, is a module system
10581and service platform for the Java programming language. This package contains
10582the Data Transfer Objects. It is easily serializable having only public fields
10583of primitive types and their wrapper classes, Strings, and DTOs. List, Set,
10584Map and array aggregates may also be used. The aggregates must only hold
10585objects of the listed types or aggregates.")
10586 (license license:asl2.0)))
10587
10588(define-public java-osgi-resource
10589 (package
10590 (name "java-osgi-resource")
10591 (version "1.0.0")
10592 (source (origin
10593 (method url-fetch)
10594 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10595 "org.osgi.resource/"
10596 version "/org.osgi.resource-"
10597 version "-sources.jar"))
10598 (sha256
10599 (base32
10600 "0hi0fsc5v99q22bd7lrkvpz1y0ds4w9arjldpwsrcpqvz2js7q2d"))))
10601 (build-system ant-build-system)
10602 (arguments
10603 `(#:jar-name "osgi-resource.jar"
10604 #:tests? #f)); no tests
10605 (inputs
10606 `(("annotation" ,java-osgi-annotation)
10607 ("dto" ,java-osgi-dto)))
10608 (home-page "https://www.osgi.org")
10609 (synopsis "OSGI Resource")
10610 (description
10611 "OSGi, for Open Services Gateway initiative framework, is a module system
10612and service platform for the Java programming language. This package contains
10613the definition of common types in osgi packages.")
10614 (license license:asl2.0)))
10615
10616(define-public java-osgi-namespace-contract
10617 (package
10618 (name "java-osgi-namespace-contract")
10619 (version "1.0.0")
10620 (source (origin
10621 (method url-fetch)
10622 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10623 "org.osgi.namespace.contract/"
10624 version "/org.osgi.namespace.contract-"
10625 version "-sources.jar"))
10626 (sha256
10627 (base32
10628 "1iz4f2i0fvqrlq90ki9nfzcfpvy2av434ri25bglywqssx8mmp36"))))
10629 (build-system ant-build-system)
10630 (inputs
10631 `(("resource" ,java-osgi-resource)
10632 ("annotation" ,java-osgi-annotation)))
10633 (arguments
10634 `(#:jar-name "osgi-namespace-contract.jar"
10635 #:tests? #f)); no tests
10636 (home-page "https://www.osgi.org")
10637 (synopsis "Contract Capability and Requirement Namespace")
10638 (description
10639 "OSGi, for Open Services Gateway initiative framework, is a module system
10640and service platform for the Java programming language. This package contains
10641the names for the attributes and directives for a namespace with contracts.")
10642 (license license:asl2.0)))
10643
10644(define-public java-osgi-namespace-extender
10645 (package
10646 (name "java-osgi-namespace-extender")
10647 (version "1.0.1")
10648 (source (origin
10649 (method url-fetch)
10650 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10651 "org.osgi.namespace.extender/"
10652 version "/org.osgi.namespace.extender-"
10653 version "-sources.jar"))
10654 (sha256
10655 (base32
10656 "0jgqiak2i05qv6j3gd33xlaifzzc0ylxxk376v2x0apfg3vvixmz"))))
10657 (build-system ant-build-system)
10658 (inputs
10659 `(("resource" ,java-osgi-resource)
10660 ("annotation" ,java-osgi-annotation)))
10661 (arguments
10662 `(#:jar-name "osgi-namespace-extendent.jar"
10663 #:tests? #f)); no tests
10664 (home-page "https://www.osgi.org")
10665 (synopsis "Extender Capability and Requirement Namespace")
10666 (description
10667 "OSGi, for Open Services Gateway initiative framework, is a module system
10668and service platform for the Java programming language. This package contains
10669the names for the attributes and directives for an extender namespace.")
10670 (license license:asl2.0)))
10671
10672(define-public java-osgi-namespace-service
10673 (package
10674 (name "java-osgi-namespace-service")
10675 (version "1.0.0")
10676 (source (origin
10677 (method url-fetch)
10678 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10679 "org.osgi.namespace.service/"
10680 version "/org.osgi.namespace.service-"
10681 version "-sources.jar"))
10682 (sha256
10683 (base32
10684 "0qmw8n2449nkmm56d1znz9zhazb6ya3vsimd5bf5jg23zzhgl8c8"))))
10685 (build-system ant-build-system)
10686 (inputs
10687 `(("resource" ,java-osgi-resource)
10688 ("annotation" ,java-osgi-annotation)))
10689 (arguments
10690 `(#:jar-name "osgi-namespace-service.jar"
10691 #:tests? #f)); no tests
10692 (home-page "https://www.osgi.org")
10693 (synopsis "Service Capability and Requirement Namespace")
10694 (description
10695 "OSGi, for Open Services Gateway initiative framework, is a module system
10696and service platform for the Java programming language. This package contains
10697the names for the attributes and directives for a service namespace.")
10698 (license license:asl2.0)))
10699
10700(define-public java-osgi-util-function
10701 (package
10702 (name "java-osgi-util-function")
10703 (version "1.0.0")
10704 (source (origin
10705 (method url-fetch)
10706 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10707 "org.osgi.util.function/"
10708 version "/org.osgi.util.function-"
10709 version "-sources.jar"))
10710 (sha256
10711 (base32
10712 "04l7j3hwmmj28w23m7paca0afzncs42j2mdr3liqq8kvp548sc6x"))))
10713 (build-system ant-build-system)
10714 (arguments
10715 `(#:jar-name "osgi-util-function.jar"
10716 #:tests? #f)); no tests
10717 (inputs
10718 `(("annotation" ,java-osgi-annotation)))
10719 (home-page "https://www.osgi.org")
10720 (synopsis "OSGI Util Function")
10721 (description
10722 "OSGi, for Open Services Gateway initiative framework, is a module system
10723and service platform for the Java programming language. This package contains
10724an interface for a function that accepts a single argument and produces a result.")
10725 (license license:asl2.0)))
10726
10727(define-public java-osgi-util-promise
10728 (package
10729 (name "java-osgi-util-promise")
10730 (version "1.0.0")
10731 (source (origin
10732 (method url-fetch)
10733 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10734 "org.osgi.util.promise/"
10735 version "/org.osgi.util.promise-"
10736 version "-sources.jar"))
10737 (sha256
10738 (base32
10739 "0y34dwiflg1c4ahvkswpf9z02xph2sr9fm04ia5493x3lshpw22c"))))
10740 (build-system ant-build-system)
10741 (arguments
10742 `(#:jar-name "osgi-util-promise.jar"
10743 #:tests? #f)); no tests
10744 (inputs
10745 `(("annotation" ,java-osgi-annotation)
10746 ("function" ,java-osgi-util-function)))
10747 (home-page "https://www.osgi.org")
10748 (synopsis "Promise of a value")
10749 (description
10750 "OSGi, for Open Services Gateway initiative framework, is a module system
10751and service platform for the Java programming language. This package contains
10752an interface and utilitary classes for promises. A Promise represents a future
10753value. It handles the interactions for asynchronous processing.")
10754 (license license:asl2.0)))
10755
10756(define-public java-osgi-service-metatype-annotations
10757 (package
10758 (name "java-osgi-service-metatype-annotations")
10759 (version "1.3.0")
10760 (source (origin
10761 (method url-fetch)
10762 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10763 "org.osgi.service.metatype.annotations/"
10764 version "/org.osgi.service.metatype.annotations-"
10765 version "-sources.jar"))
10766 (sha256
10767 (base32
10768 "12rwm3349wk80vm88rcdgs4435m4jxkpkj5mrx326skkz2c6hyw6"))))
10769 (build-system ant-build-system)
10770 (arguments
10771 `(#:jar-name "osgi-service-metatype-annotations.jar"
10772 #:tests? #f)); no tests
10773 (inputs
10774 `(("annotation" ,java-osgi-annotation)))
10775 (home-page "https://www.osgi.org")
10776 (synopsis "Support annotations for metatype")
10777 (description
10778 "OSGi, for Open Services Gateway initiative framework, is a module system
10779and service platform for the Java programming language. This package contains
10780the support annotations for metatype.")
10781 (license license:asl2.0)))
10782
10783(define-public java-osgi-service-repository
10784 (package
10785 (name "java-osgi-service-repository")
10786 (version "1.1.0")
10787 (source (origin
10788 (method url-fetch)
10789 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10790 "org.osgi.service.repository/"
10791 version "/org.osgi.service.repository-"
10792 version "-sources.jar"))
10793 (sha256
10794 (base32
10795 "1k41mhg7b58pd8nsghr2qwcjrxdnf1p9spsw9v11k4257g6rl06n"))))
10796 (build-system ant-build-system)
10797 (arguments
10798 `(#:jar-name "osgi-service-repository.jar"
10799 #:tests? #f)); no tests
10800 (inputs
10801 `(("annotation" ,java-osgi-annotation)
10802 ("promise" ,java-osgi-util-promise)
10803 ("resource" ,java-osgi-resource)))
10804 (home-page "https://www.osgi.org")
10805 (synopsis "OSGI service repository")
10806 (description
10807 "OSGi, for Open Services Gateway initiative framework, is a module system
10808and service platform for the Java programming language. This package contains
10809a repository service that contains resources.")
10810 (license license:asl2.0)))
10811
10812(define-public java-osgi-framework
10813 (package
10814 (name "java-osgi-framework")
10815 (version "1.8.0")
10816 (source (origin
10817 (method url-fetch)
10818 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10819 "org.osgi.framework/" version "/org.osgi.framework-"
10820 version "-sources.jar"))
10821 (sha256
10822 (base32
10823 "1lwp2zfad3rybcc6q9bwz8xsgkc92ypzy5p6x54387f1qj65m73s"))))
10824 (build-system ant-build-system)
10825 (arguments
10826 `(#:jar-name "osgi-framework.jar"
10827 #:tests? #f)); no tests
10828 (inputs
10829 `(("annotation" ,java-osgi-annotation)
10830 ("resource" ,java-osgi-resource)
10831 ("dto" ,java-osgi-dto)))
10832 (home-page "https://www.osgi.org")
10833 (synopsis "OSGi framework")
10834 (description
10835 "OSGi, for Open Services Gateway initiative framework, is a module system
10836and service platform for the Java programming language.")
10837 (license license:asl2.0)))
10838
10839(define-public java-osgi-service-log
10840 (package
10841 (name "java-osgi-service-log")
10842 (version "1.3.0")
10843 (source (origin
10844 (method url-fetch)
10845 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10846 "org.osgi.service.log/"
10847 version "/org.osgi.service.log-"
10848 version "-sources.jar"))
10849 (sha256
10850 (base32
10851 "1029j30dzcwializzca0j3fkhwwz08kmmsha5agw1iccscimj6r0"))))
10852 (build-system ant-build-system)
10853 (arguments
10854 `(#:jar-name "osgi-service-log.jar"
10855 #:tests? #f)); no tests
10856 (inputs
10857 (list java-osgi-framework))
10858 (home-page "https://www.osgi.org")
10859 (synopsis "Provides methods for bundles to write messages to the log")
10860 (description
10861 "OSGi, for Open Services Gateway initiative framework, is a module system
10862and service platform for the Java programming language. This package contains
10863the log service.")
10864 (license license:asl2.0)))
10865
10866(define-public java-osgi-service-jdbc
10867 (package
10868 (name "java-osgi-service-jdbc")
10869 (version "1.0.0")
10870 (source (origin
10871 (method url-fetch)
10872 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10873 "org.osgi.service.jdbc/"
10874 version "/org.osgi.service.jdbc-"
10875 version "-sources.jar"))
10876 (sha256
10877 (base32
10878 "11iln5v7bk469cgb9ddkrz9sa95b3733gqgaqw9xf5g6wq652yjz"))))
10879 (build-system ant-build-system)
10880 (arguments
10881 `(#:jar-name "osgi-service-jdbc.jar"
10882 #:tests? #f)); no tests
10883 (home-page "https://www.osgi.org")
10884 (synopsis "Factory for JDBC connection factories")
10885 (description
10886 "OSGi, for Open Services Gateway initiative framework, is a module system
10887and service platform for the Java programming language. This package contains
10888a factory for JDBC connection factories. There are 3 preferred connection
10889factories for getting JDBC connections:
10890
10891@itemize
10892@item @code{javax.sql.DataSource};
10893@item @code{javax.sql.ConnectionPoolDataSource};
10894@item @code{javax.sql.XADataSource}.
10895@end itemize")
10896 (license license:asl2.0)))
10897
10898(define-public java-osgi-service-resolver
10899 (package
10900 (name "java-osgi-service-resolver")
10901 (version "1.0.1")
10902 (source (origin
10903 (method url-fetch)
10904 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10905 "org.osgi.service.resolver/"
10906 version "/org.osgi.service.resolver-"
10907 version "-sources.jar"))
10908 (sha256
10909 (base32
10910 "1dzqn1ryfi2rq4zwsgp44bmj2wlfydjg1qbxw2b0z4xdjjy55vxd"))))
10911 (build-system ant-build-system)
10912 (arguments
10913 `(#:jar-name "osgi-service-resolver.jar"
10914 #:tests? #f)); no tests
10915 (inputs
10916 `(("annotation" ,java-osgi-annotation)
10917 ("resource" ,java-osgi-resource)))
10918 (home-page "https://www.osgi.org")
10919 (synopsis "OSGI Resolver service")
10920 (description
10921 "OSGi, for Open Services Gateway initiative framework, is a module system
10922and service platform for the Java programming language. This package contains
10923a resolver service that resolves the specified resources in the context supplied
10924by the caller.")
10925 (license license:asl2.0)))
10926
10927(define-public java-osgi-util-tracker
10928 (package
10929 (name "java-osgi-util-tracker")
10930 (version "1.5.1")
10931 (source (origin
10932 (method url-fetch)
10933 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10934 "org.osgi.util.tracker/"
10935 version "/org.osgi.util.tracker-"
10936 version "-sources.jar"))
10937 (sha256
10938 (base32
10939 "0c4fh9vxwzsx59r8dygda0gq2gx3z5vfhc3jsphlqwf5w0h403lz"))))
10940 (build-system ant-build-system)
10941 (arguments
10942 `(#:jar-name "osgi-util-tracker.jar"
10943 #:tests? #f)); no tests
10944 (inputs
10945 `(("framework" ,java-osgi-framework)
10946 ("annotation" ,java-osgi-annotation)))
10947 (home-page "https://www.osgi.org")
10948 (synopsis "Bundle tracking")
10949 (description
10950 "OSGi, for Open Services Gateway initiative framework, is a module system
10951and service platform for the Java programming language. This package contains
10952bundle tracking utility classes.")
10953 (license license:asl2.0)))
10954
10955(define-public java-osgi-service-cm
10956 (package
10957 (name "java-osgi-service-cm")
10958 (version "1.5.0")
10959 (source (origin
10960 (method url-fetch)
10961 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10962 "org.osgi.service.cm/"
10963 version "/org.osgi.service.cm-"
10964 version "-sources.jar"))
10965 (sha256
10966 (base32
10967 "1z8kap48y3xi0ggj8v6czglfnpnd94mmismgi2wbqhj1nl5fzbp6"))))
10968 (build-system ant-build-system)
10969 (arguments
10970 `(#:jar-name "osgi-service-cm.jar"
10971 #:tests? #f)); no tests
10972 (inputs
10973 `(("framework" ,java-osgi-framework)
10974 ("annotation" ,java-osgi-annotation)))
10975 (home-page "https://www.osgi.org")
10976 (synopsis "OSGI Configuration Management")
10977 (description
10978 "OSGi, for Open Services Gateway initiative framework, is a module system
10979and service platform for the Java programming language. This package contains
10980utility classes for the configuration of services.")
10981 (license license:asl2.0)))
10982
10983(define-public java-osgi-service-packageadmin
10984 (package
10985 (name "java-osgi-service-packageadmin")
10986 (version "1.2.0")
10987 (source (origin
10988 (method url-fetch)
10989 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
10990 "org.osgi.service.packageadmin/"
10991 version "/org.osgi.service.packageadmin-"
10992 version "-sources.jar"))
10993 (sha256
10994 (base32
10995 "041mpxzi7g36wmcily6y4ccn3jx15akpdy8gmhyb7m98x7qfvn52"))))
10996 (build-system ant-build-system)
10997 (arguments
10998 `(#:jar-name "osgi-service-packageadmin.jar"
10999 #:tests? #f)); no tests
11000 (inputs
11001 `(("framework" ,java-osgi-framework)))
11002 (home-page "https://www.osgi.org")
11003 (synopsis "OSGI Package Administration")
11004 (description
11005 "OSGi, for Open Services Gateway initiative framework, is a module system
11006and service platform for the Java programming language. This package contains
11007the packageadmin service.")
11008 (license license:asl2.0)))
11009
11010(define-public java-ops4j-base-lang
11011 (package
11012 (name "java-ops4j-base-lang")
11013 (version "1.5.0")
11014 (source (origin
11015 (method url-fetch)
11016 (uri (string-append "https://github.com/ops4j/org.ops4j.base/"
11017 "archive/base-" version ".tar.gz"))
11018 (sha256
11019 (base32
11020 "18hl3lpchgpv8yh5rlk39l2gif5dlfgb8gxjmncf39pr2dprkniw"))))
11021 (build-system ant-build-system)
11022 (arguments
11023 `(#:jar-name "java-ops4j-base-lang.jar"
11024 #:source-dir "ops4j-base-lang/src/main/java"
11025 #:tests? #f; no tests
11026 #:phases
11027 (modify-phases %standard-phases
11028 (add-before 'build 'add-test-file
11029 (lambda _
11030 ;; That file is required by a test in ops4j-pax-exam-core-spi
11031 (mkdir-p "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang")
11032 (with-output-to-file "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang/pom.properties"
11033 (lambda _
11034 (display
11035 (string-append
11036 "version=" ,version "\n"
11037 "groupId=org.ops4j.base"
11038 "artifactId=ops4j-base-lang\n"))))
11039 #t)))))
11040 (home-page "https://ops4j1.jira.com/wiki/spaces/base/overview")
11041 (synopsis "Utility classes and extensions to be used in OPS4J projects")
11042 (description "OPS4J stands for Open Participation Software for Java. This
11043package contains utilities and extensions related to @code{java.lang}.")
11044 (license license:asl2.0)))
11045
11046(define-public java-ops4j-base-monitors
11047 (package
11048 (inherit java-ops4j-base-lang)
11049 (name "java-ops4j-base-monitors")
11050 (arguments
11051 `(#:jar-name "java-ops4j-base-monitors.jar"
11052 #:source-dir "ops4j-base-monitors/src/main/java"
11053 #:tests? #f)); no tests
11054 (inputs
11055 `(("lang" ,java-ops4j-base-lang)))
11056 (description "OPS4J stands for Open Participation Software for Java. This
11057package contains utilities and extensions related to monitoring.")))
11058
11059(define-public java-ops4j-base-io
11060 (package
11061 (inherit java-ops4j-base-lang)
11062 (name "java-ops4j-base-io")
11063 (arguments
11064 `(#:jar-name "java-ops4j-base-io.jar"
11065 #:source-dir "ops4j-base-io/src/main/java"
11066 #:test-dir "ops4j-base-io/src/test"
11067 #:test-exclude
11068 (list "**/ListerTest.java")))
11069 (inputs
11070 `(("lang" ,java-ops4j-base-monitors)
11071 ("lang" ,java-ops4j-base-lang)))
11072 (native-inputs
11073 `(("junit" ,java-junit)
11074 ("hamcrest" ,java-hamcrest-core)))
11075 (description "OPS4J stands for Open Participation Software for Java. This
11076package contains utilities and extensions related to handling streams and files.")))
11077
11078(define-public java-ops4j-base-util
11079 (package
11080 (inherit java-ops4j-base-lang)
11081 (name "java-ops4j-base-util")
11082 (arguments
11083 `(#:jar-name "java-ops4j-base-util.jar"
11084 #:source-dir "ops4j-base-util/src/main/java"
11085 #:test-dir "ops4j-base-util/src/test"))
11086 (inputs
11087 `(("lang" ,java-ops4j-base-lang)))
11088 (native-inputs
11089 `(("junit" ,java-junit)))
11090 (description "OPS4J stands for Open Participation Software for Java. This
11091package contains utilities and extensions related to environment, i18n and
11092mime types.")))
11093
11094(define-public java-ops4j-base-util-property
11095 (package
11096 (inherit java-ops4j-base-lang)
11097 (name "java-ops4j-base-util-property")
11098 (arguments
11099 `(#:jar-name "java-ops4j-base-util-property.jar"
11100 #:source-dir "ops4j-base-util-property/src/main/java"
11101 #:tests? #f)); no tests
11102 (inputs
11103 `(("lang" ,java-ops4j-base-lang)
11104 ("util" ,java-ops4j-base-util)))
11105 (description "OPS4J stands for Open Participation Software for Java. This
11106package contains utilities and extensions related to resolving properties from
11107different sources.")))
11108
11109(define-public java-ops4j-base-store
11110 (package
11111 (inherit java-ops4j-base-lang)
11112 (name "java-ops4j-base-store")
11113 (arguments
11114 `(#:jar-name "java-ops4j-base-store.jar"
11115 #:source-dir "ops4j-base-store/src/main/java"
11116 #:tests? #f)); no tests
11117 (inputs
11118 `(("lang" ,java-ops4j-base-lang)
11119 ("slf4j" ,java-slf4j-api)
11120 ("io" ,java-ops4j-base-io)))
11121 (description "OPS4J stands for Open Participation Software for Java. This
11122package contains utilities for storing and retrieving data from an
11123@code{InputStream}.")))
11124
11125(define-public java-ops4j-base-spi
11126 (package
11127 (inherit java-ops4j-base-lang)
11128 (name "java-ops4j-base-spi")
11129 (arguments
11130 `(#:jar-name "java-ops4j-base-spi.jar"
11131 #:source-dir "ops4j-base-spi/src/main/java"
11132 #:test-dir "ops4j-base-spi/src/test"))
11133 (native-inputs
11134 `(("junit" ,java-junit)
11135 ("hamcrest" ,java-hamcrest-core)))
11136 (description "OPS4J stands for Open Participation Software for Java. This
11137package contains utilities for obtaining services via the Java SE 6
11138@code{ServiceLoader}.")))
11139
11140(define-public java-aqute-bnd-annotation
11141 (package
11142 (name "java-aqute-bnd-annotation")
11143 (version "3.5.0")
11144 (source (origin
11145 (method url-fetch)
11146 (uri (string-append "https://github.com/bndtools/bnd/archive/"
11147 version ".REL.tar.gz"))
11148 (file-name (string-append name "-" version ".tar.gz"))
11149 (sha256
11150 (base32
11151 "1ggyiq0as0f6cz333a0dh98j72kmvv5pf2s47v9554yh905lfqdl"))))
11152 (build-system ant-build-system)
11153 (arguments
11154 `(#:jar-name "java-aqute-bnd-annotation.jar"
11155 #:source-dir "biz.aQute.bnd.annotation/src"
11156 #:tests? #f)); empty test dir
11157 (home-page "https://bnd.bndtools.org/")
11158 (synopsis "Tools for OSGi")
11159 (description "Bnd is a swiss army knife for OSGi, it creates manifest
11160headers based on analyzing the class code, it verifies the project settings,
11161it manages project dependencies, gives diffs jars, and much more.")
11162 (license license:asl2.0)))
11163
11164(define-public java-aqute-libg
11165 (package
11166 (inherit java-aqute-bnd-annotation)
11167 (name "java-aqute-libg")
11168 (arguments
11169 `(#:jar-name "java-aqute-libg.jar"
11170 ;; The build fails when source/target more recent than 1.7. This
11171 ;; is a known issue. See: https://github.com/bndtools/bnd/issues/1327
11172 ;;
11173 ;; It is closed as won't fix. There is no way to change the source
11174 ;; so that it works on 1.8, and still works on 1.6, the upstream
11175 ;; target. It work fine on 1.7, so we use 1.7.
11176 #:make-flags (list "-Dant.build.javac.source=1.7"
11177 "-Dant.build.javac.target=1.7")
11178 #:phases
11179 (modify-phases %standard-phases
11180 (add-before 'configure 'chdir
11181 ;; Change to aQute.libg directory, so that the relative
11182 ;; paths in the tests aren't broken.
11183 (lambda _
11184 (chdir "aQute.libg")
11185 #t))
11186 (add-before 'check 'create-test-directory
11187 ;; Copy the test directory to test/java, since that's where
11188 ;; ant-build-system's default project in build.xml expects to find
11189 ;; the test classes. Leave a copy in the original place to not
11190 ;; break paths in tests.
11191 (lambda _
11192 (mkdir "src/test")
11193 (copy-recursively "test" "src/test/java")
11194 #t)))))
11195 (inputs
11196 `(("slf4j" ,java-slf4j-api)
11197 ("osgi-annot" ,java-osgi-annotation)
11198 ("java-osgi-cmpn" ,java-osgi-cmpn)
11199 ("osgi" ,java-osgi-core)))
11200 (native-inputs
11201 `(("hamcrest" ,java-hamcrest-core)
11202 ("java-junit" ,java-junit)))))
11203
11204(define-public java-aqute-bndlib
11205 (package
11206 (inherit java-aqute-bnd-annotation)
11207 (name "java-aqute-bndlib")
11208 (arguments
11209 `(#:jar-name "java-bndlib.jar"
11210 #:source-dir "biz.aQute.bndlib/src"
11211 #:tests? #f)); no tests
11212 (inputs
11213 `(("slf4j" ,java-slf4j-api)
11214 ("osgi-annot" ,java-osgi-annotation)
11215 ("java-aqute-libg" ,java-aqute-libg)
11216 ("java-aqute-bnd-annotation" ,java-aqute-bnd-annotation)
11217 ("java-osgi-service-component-annotations" ,java-osgi-service-component-annotations)
11218 ("java-osgi-service-repository" ,java-osgi-service-repository)
11219 ("java-osgi-service-log" ,java-osgi-service-log)
11220 ("java-osgi-service-metatype-annotations" ,java-osgi-service-metatype-annotations)
11221 ("java-osgi-namespace-contract" ,java-osgi-namespace-contract)
11222 ("java-osgi-namespace-extender" ,java-osgi-namespace-extender)
11223 ("java-osgi-namespace-service" ,java-osgi-namespace-service)
11224 ("promise" ,java-osgi-util-promise)
11225 ("osgi" ,java-osgi-core)))))
11226
11227(define-public java-ops4j-pax-tinybundles
11228 (package
11229 (name "java-ops4j-pax-tinybundles")
11230 (version "2.1.1")
11231 (source (origin
11232 (method url-fetch)
11233 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.tinybundles/"
11234 "archive/tinybundles-" version ".tar.gz"))
11235 (sha256
11236 (base32
11237 "0y0gq3pvv0iir2b885lmlwnvr724vv7vklzhhr4fs27d7mdkj871"))))
11238 (arguments
11239 `(#:jar-name "java-ops4j-pax-tinybundles.jar"
11240 #:source-dir "src/main/java"
11241 #:test-exclude
11242 ;; Abstract base classes for other tests
11243 (list "**/BndTest.java" "**/CoreTest.java")
11244 #:phases
11245 (modify-phases %standard-phases
11246 (add-before 'check 'fix-version
11247 (lambda _
11248 ;; This test has a reference to an old version of bndlib we are not
11249 ;; packaging. It uses the version referenced in pom.xml. We replace
11250 ;; it with our own version.
11251 (substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
11252 (("[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*")
11253 ,(package-version java-aqute-bndlib)))
11254 #t)))))
11255 (inputs
11256 `(("lang" ,java-ops4j-base-lang)
11257 ("io" ,java-ops4j-base-io)
11258 ("store" ,java-ops4j-base-store)
11259 ("slf4j" ,java-slf4j-api)
11260 ("libg" ,java-aqute-libg)
11261 ("bndlib" ,java-aqute-bndlib)))
11262 (native-inputs
11263 `(("junit" ,java-junit)
11264 ("hamcrest" ,java-hamcrest-core)
11265 ("log4j" ,java-log4j-api)
11266 ("bndannotation" ,java-aqute-bnd-annotation)
11267 ("framework" ,java-osgi-framework)))
11268 (build-system ant-build-system)
11269 (home-page "https://ops4j1.jira.com/wiki/spaces/ops4j/pages/12060312/Tinybundles")
11270 (synopsis "Java APIs to create OSGi related artifacts")
11271 (description "Tinybundles is all about creating OSGi related artifacts like
11272Bundles, Fragments and Deployment Packages with Java Api. It is very convenient
11273to create such artifacts on-the-fly inside Tests (like in Pax Exam). On the
11274other hand, this library can be a foundation of real end user tools that need
11275to create those artifacts.")
11276 (license license:asl2.0)))
11277
11278(define-public java-ops4j-pax-exam-core
11279 (package
11280 (name "java-ops4j-pax-exam-core")
11281 (version "4.11.0")
11282 (source (origin
11283 (method url-fetch)
11284 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.exam2/"
11285 "archive/exam-reactor-" version ".tar.gz"))
11286 (sha256
11287 (base32
11288 "1b0f89gawxyl0pkqx9sicp6n58pirkzhjw41y749bwrkb6h99i26"))))
11289 (arguments
11290 (list #:jar-name "java-ops4j-pax-exam-core.jar"
11291 #:source-dir "core/pax-exam/src/main/java"
11292 #:test-dir "core/pax-exam/src/test"))
11293 (inputs
11294 (list java-slf4j-api
11295 java-ops4j-base-lang
11296 java-ops4j-base-io
11297 java-ops4j-base-util-property
11298 java-ops4j-base-store
11299 java-osgi-core))
11300 (native-inputs
11301 (list java-junit
11302 java-hamcrest-core))
11303 (build-system ant-build-system)
11304 (home-page "https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/overview")
11305 (synopsis "In-Container Testing for OSGi, Java EE and CDI")
11306 (description "Pax Exam creates OSGi bundles for testing purposes. It lets
11307the user take control of the OSGi framework, the test framework (e.g. JUnit) and
11308the system under test at the same time.")
11309 (license license:asl2.0)))
11310
11311(define-public java-ops4j-pax-exam-core-spi
11312 (package
11313 (inherit java-ops4j-pax-exam-core)
11314 (name "java-ops4j-pax-exam-core-spi")
11315 (arguments
11316 `(#:jar-name "java-ops4j-pax-exam-spi.jar"
11317 #:source-dir "src/main/java"
11318 #:test-exclude
11319 (list
11320 ;; Abstract base class, not a test
11321 "**/BaseStagedReactorTest.java"
11322 ;; Depends on org.mortbay.jetty.testwars:test-war-dump
11323 "**/WarBuilderTest.java")
11324 #:phases
11325 (modify-phases %standard-phases
11326 (add-before 'configure 'chdir
11327 (lambda _
11328 ;; Tests assume we are in this directory
11329 (chdir "core/pax-exam-spi")
11330 #t))
11331 (add-before 'check 'fix-tests
11332 (lambda _
11333 ;; One test checks that this file is present.
11334 (mkdir-p "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi")
11335 (with-output-to-file
11336 "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi/pom.properties"
11337 (lambda _
11338 (display
11339 (string-append "artifactId = pax-exam-spi\n"
11340 "version = " ,(package-version java-ops4j-pax-exam-core-spi)))))
11341 ;; Maven puts compilation results in the target directory, while we
11342 ;; put them in the build directory.
11343 (substitute* '("src/test/java/org/ops4j/pax/exam/spi/war/WarBuilderTest.java"
11344 "src/test/java/org/ops4j/pax/exam/spi/war/WarTestProbeBuilderTest.java"
11345 "src/test/java/org/ops4j/pax/exam/spi/war/ZipBuilderTest.java")
11346 (("target") "build"))
11347 ;; One test is expected to fail, but it doesn't throw the expected exception
11348 (substitute* "src/test/java/org/ops4j/pax/exam/spi/reactors/BaseStagedReactorTest.java"
11349 (("AssertionError") "IllegalArgumentException"))
11350 #t)))))
11351 (inputs
11352 `(("java-ops4j-pax-exam-core" ,java-ops4j-pax-exam-core)
11353 ("lang" ,java-ops4j-base-lang)
11354 ("monitors" ,java-ops4j-base-monitors)
11355 ("store" ,java-ops4j-base-store)
11356 ("io" ,java-ops4j-base-io)
11357 ("spi" ,java-ops4j-base-spi)
11358 ("osgi" ,java-osgi-core)
11359 ("slf4j" ,java-slf4j-api)
11360 ("tinybundles" ,java-ops4j-pax-tinybundles)))
11361 (native-inputs
11362 `(("mockito" ,java-mockito-1)
11363 ("junit" ,java-junit)
11364 ("hamcrest" ,java-hamcrest-core)
11365 ("cglib" ,java-cglib)
11366 ("objenesis" ,java-objenesis)))))
11367
11368(define-public java-ops4j-pax-exam-core-junit
11369 (package
11370 (inherit java-ops4j-pax-exam-core)
11371 (name "java-ops4j-pax-exam-core-junit")
11372 (arguments
11373 `(#:jar-name "ops4j-pax-exam-core-junit.jar"
11374 #:source-dir "drivers/pax-exam-junit4/src/main/java"
11375 #:tests? #f)); no tests
11376 (inputs
11377 `(("junit" ,java-junit)
11378 ("slf4j" ,java-slf4j-api)
11379 ("core" ,java-ops4j-pax-exam-core)
11380 ("spi" ,java-ops4j-pax-exam-core-spi)))
11381 (native-inputs '())))
11382
11383(define-public java-fasterxml-jackson-annotations
11384 (package
11385 (name "java-fasterxml-jackson-annotations")
11386 (version "2.9.4")
11387 (source (origin
11388 (method url-fetch)
11389 (uri (string-append "https://github.com/FasterXML/"
11390 "jackson-annotations/archive/"
11391 "jackson-annotations-" version ".tar.gz"))
11392 (sha256
11393 (base32
11394 "0mr95xd0da6a4g95zvrl1ryk5n5zv2rc696w3xnsr5hxk2gicfc4"))))
11395 (build-system ant-build-system)
11396 (arguments
11397 `(#:jar-name "jackson-annotations.jar"
11398 #:source-dir "src/main/java"
11399 #:test-dir "src/test"))
11400 (native-inputs
11401 `(("junit" ,java-junit)))
11402 (home-page "https://github.com/FasterXML/jackson-annotations")
11403 (synopsis "General purpose annotations for the Jackson Data Processor")
11404 (description "This package contains general purpose annotations for the
11405Jackson Data Processor, used on value and handler types. The only annotations
11406not included are ones that require dependency to the Databind package.")
11407 (license license:asl2.0)))
11408
11409(define-public java-fasterxml-jackson-core
11410 (package
11411 (name "java-fasterxml-jackson-core")
11412 (version "2.9.4")
11413 (source (origin
11414 (method url-fetch)
11415 (uri (string-append "https://github.com/FasterXML/"
11416 "jackson-core/archive/"
11417 "jackson-core-" version ".tar.gz"))
11418 (sha256
11419 (base32
11420 "159hsnk17jr1gyzkf01cxvsn45srnk37g949r7364qlsr527gjgd"))))
11421 (build-system ant-build-system)
11422 (arguments
11423 `(#:jar-name "jackson-core.jar"
11424 #:source-dir "src/main/java"
11425 #:test-dir "src/test"
11426 #:test-exclude
11427 (list
11428 ;; Expected failure. pom.xml excludes these
11429 "**/failing/**"
11430 ;; Base classes that have no constructor for junit
11431 "**/BaseTest.java"
11432 "**/ConcurrencyReadTest.java"
11433 "**/ManualCharAccessTest.java"
11434 "**/ManualCharAccessTest.java"
11435 "**/TrailingCommasTest.java"
11436 "**/AsyncMissingValuesInObjectTest.java"
11437 "**/AsyncMissingValuesInArrayTest.java")
11438 #:phases
11439 (modify-phases %standard-phases
11440 (add-before 'configure 'generate-PackageVersion.java
11441 (lambda _
11442 (let* ((out "src/main/java/com/fasterxml/jackson/core/json/PackageVersion.java")
11443 (in (string-append out ".in")))
11444 (copy-file in out)
11445 (substitute* out
11446 (("@package@") "com.fasterxml.jackson.core.json")
11447 (("@projectversion@") ,version)
11448 (("@projectgroupid@") "com.fasterxml.jackson.core")
11449 (("@projectartifactid@") "jackson-core")))
11450 #t))
11451 (add-before 'build 'copy-resources
11452 (lambda _
11453 (copy-recursively "src/main/resources"
11454 "build/classes")
11455 #t))
11456 (add-before 'check 'copy-test-resources
11457 (lambda _
11458 (copy-recursively "src/test/resources"
11459 "build/test-classes")
11460 #t)))))
11461 (native-inputs
11462 `(("junit" ,java-junit)
11463 ("hamcrest" ,java-hamcrest-core)))
11464 (home-page "https://github.com/FasterXML/jackson-core")
11465 (synopsis "Low-level streaming parser and generator abstractions")
11466 (description "This package contains core low-level incremental
11467(streaming) parser and generator abstractions used by the Jackson Data
11468Processor. It also includes the default implementation of handler types
11469(parser, generator) that handle JSON format.")
11470 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11471
11472(define-public java-fasterxml-jackson-databind
11473 (package
11474 (name "java-fasterxml-jackson-databind")
11475 (version "2.9.4")
11476 (source (origin
11477 (method url-fetch)
11478 (uri (string-append "https://github.com/FasterXML/"
11479 "jackson-databind/archive/"
11480 "jackson-databind-" version ".tar.gz"))
11481 (sha256
11482 (base32
11483 "1zd2cw4z6kdkbx8za96xh9pyicv2a2l7y0rkcx2fqd8hv6d47s08"))))
11484 (build-system ant-build-system)
11485 (arguments
11486 `(#:jar-name "jackson-databind.jar"
11487 #:source-dir "src/main/java"
11488 #:tests? #f; requires javax.measures for which I can't find a free implementation
11489 #:phases
11490 (modify-phases %standard-phases
11491 (add-before 'configure 'generate-PackageVersion.java
11492 (lambda _
11493 (let* ((out "src/main/java/com/fasterxml/jackson/databind/cfg/PackageVersion.java")
11494 (in (string-append out ".in")))
11495 (copy-file in out)
11496 (substitute* out
11497 (("@package@") "com.fasterxml.jackson.databind.cfg")
11498 (("@projectversion@") ,version)
11499 (("@projectgroupid@") "com.fasterxml.jackson.databind")
11500 (("@projectartifactid@") "jackson-databind")))
11501 #t))
11502 (add-before 'build 'copy-resources
11503 (lambda _
11504 (copy-recursively "src/main/resources" "build/classes")
11505 #t)))))
11506 (inputs
11507 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core))
11508 (home-page "https://github.com/FasterXML/jackson-databind")
11509 (synopsis "Data-binding functionality and tree-model for the Jackson Data Processor")
11510 (description "This package contains the general-purpose data-binding
11511functionality and tree-model for Jackson Data Processor. It builds on core
11512streaming parser/generator package, and uses Jackson Annotations for
11513configuration.")
11514 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11515
11516(define-public java-fasterxml-jackson-modules-base-jaxb
11517 (package
11518 (name "java-fasterxml-jackson-modules-base-jaxb")
11519 (version "2.9.4")
11520 (source (origin
11521 (method url-fetch)
11522 (uri (string-append "https://github.com/FasterXML/"
11523 "jackson-modules-base/archive/"
11524 "jackson-modules-base-" version ".tar.gz"))
11525 (sha256
11526 (base32
11527 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
11528 (build-system ant-build-system)
11529 (arguments
11530 `(#:jar-name "jackson-modules-base-jaxb.jar"
11531 #:source-dir "jaxb/src/main/java"
11532 #:test-dir "jaxb/src/test"
11533 #:test-exclude
11534 ;; Base class for tests
11535 (list "**/BaseJaxbTest.java")
11536 #:phases
11537 (modify-phases %standard-phases
11538 (add-before 'configure 'generate-PackageVersion.java
11539 (lambda _
11540 (let* ((out (string-append "jaxb/src/main/java/com/fasterxml/"
11541 "jackson/module/jaxb/PackageVersion.java"))
11542 (in (string-append out ".in")))
11543 (copy-file in out)
11544 (substitute* out
11545 (("@package@") "com.fasterxml.jackson.module.jaxb")
11546 (("@projectversion@") ,version)
11547 (("@projectgroupid@") "com.fasterxml.jackson.module.jaxb")
11548 (("@projectartifactid@") "jackson-module-jaxb")))
11549 #t))
11550 (add-before 'build 'copy-resources
11551 (lambda _
11552 (copy-recursively "jaxb/src/main/resources" "build/classes")
11553 #t)))))
11554 (inputs
11555 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core
11556 java-fasterxml-jackson-databind))
11557 (native-inputs
11558 (list java-junit))
11559 (home-page "https://github.com/FasterXML/jackson-modules-base")
11560 (synopsis "Jaxb annotations jackson module")
11561 (description "This package is the jaxb annotations module for jackson.")
11562 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11563
11564(define-public java-fasterxml-jackson-modules-base-mrbean
11565 (package
11566 (name "java-fasterxml-jackson-modules-base-mrbean")
11567 (version "2.9.4")
11568 (source (origin
11569 (method url-fetch)
11570 (uri (string-append "https://github.com/FasterXML/"
11571 "jackson-modules-base/archive/"
11572 "jackson-modules-base-" version ".tar.gz"))
11573 (sha256
11574 (base32
11575 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
11576 (build-system ant-build-system)
11577 (arguments
11578 `(#:jar-name "jackson-modules-base-mrbean.jar"
11579 #:source-dir "mrbean/src/main/java"
11580 #:test-dir "mrbean/src/test"
11581 #:test-exclude
11582 ;; Base class for tests
11583 (list "**/BaseTest.java")
11584 #:phases
11585 (modify-phases %standard-phases
11586 (add-before 'configure 'generate-PackageVersion.java
11587 (lambda _
11588 (let* ((out (string-append "mrbean/src/main/java/com/fasterxml/"
11589 "jackson/module/mrbean/PackageVersion.java"))
11590 (in (string-append out ".in")))
11591 (copy-file in out)
11592 (substitute* out
11593 (("@package@") "com.fasterxml.jackson.module.mrbean")
11594 (("@projectversion@") ,version)
11595 (("@projectgroupid@") "com.fasterxml.jackson.module.mrbean")
11596 (("@projectartifactid@") "jackson-module-mrbean")))
11597 #t)))))
11598 (inputs
11599 (list java-asm java-fasterxml-jackson-annotations
11600 java-fasterxml-jackson-core java-fasterxml-jackson-databind))
11601 (native-inputs
11602 (list java-junit))
11603 (home-page "https://github.com/FasterXML/jackson-modules-base")
11604 (synopsis "POJO type materialization for Java")
11605 (description "This package implements POJO type materialization.
11606Databinders can construct implementation classes for Java interfaces as part
11607of deserialization.")
11608 (license license:asl2.0)))
11609
11610(define-public java-snakeyaml
11611 (package
11612 (name "java-snakeyaml")
11613 (version "1.18")
11614 (source (origin
11615 (method url-fetch)
11616 (uri (string-append "https://bitbucket.org/asomov/snakeyaml/get/v"
11617 version ".tar.gz"))
11618 (file-name (string-append name "-" version ".tar.gz"))
11619 (sha256
11620 (base32
11621 "0474cqcv46zgv9bhms2vgawakq1vyj0hp3h3f1bfys46msia90bh"))))
11622 (build-system ant-build-system)
11623 (arguments
11624 `(#:jar-name "java-snakeyaml.jar"
11625 #:source-dir "src/main/java"
11626 ;; Tests require velocity, a cyclic dependency, and
11627 ;; java-spring-framework-context which is not packaged.
11628 #:tests? #f))
11629 (home-page "https://bitbucket.org/asomov/snakeyaml")
11630 (synopsis "YAML processor")
11631 (description "SnakeYAML is a YAML processor for the Java Virtual Machine.")
11632 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11633
11634(define-public java-fasterxml-jackson-dataformat-yaml
11635 (package
11636 (name "java-fasterxml-jackson-dataformat-yaml")
11637 (version "2.9.4")
11638 (source (origin
11639 (method url-fetch)
11640 (uri (string-append "https://github.com/FasterXML/"
11641 "jackson-dataformats-text/archive/"
11642 "jackson-dataformats-text-" version ".tar.gz"))
11643 (sha256
11644 (base32
11645 "1hikl06khaxbg439avf442qifcadap8w0lx13f0nnhp2vh3dkbz7"))))
11646 (build-system ant-build-system)
11647 (arguments
11648 `(#:jar-name "jackson-dataformat-yaml.jar"
11649 #:source-dir "yaml/src/main/java"
11650 #:test-dir "yaml/src/test"
11651 #:test-exclude (list "**/failing/**.java")
11652 #:phases
11653 (modify-phases %standard-phases
11654 (add-before 'configure 'generate-PackageVersion.java
11655 (lambda _
11656 (let* ((out "yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/PackageVersion.java")
11657 (in (string-append out ".in")))
11658 (copy-file in out)
11659 (substitute* out
11660 (("@package@") "com.fasterxml.jackson.dataformat.yaml")
11661 (("@projectversion@") ,version)
11662 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.yaml")
11663 (("@projectartifactid@") "jackson-dataformat-yaml")))
11664 #t)))))
11665 (inputs
11666 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core
11667 java-fasterxml-jackson-databind java-snakeyaml))
11668 (native-inputs
11669 `(("junit" ,java-junit)
11670 ("hamcrest" ,java-hamcrest-core)
11671 ("java-ops4j-pax-exam-core-spi" ,java-ops4j-pax-exam-core-spi)
11672 ("java-ops4j-pax-exam-core-junit" ,java-ops4j-pax-exam-core-junit)
11673 ("java-ops4j-pax-exam" ,java-ops4j-pax-exam-core)))
11674 (home-page "https://github.com/FasterXML/jackson-dataformats-text")
11675 (synopsis "Yaml backend for Jackson")
11676 (description "Dataformat backends are used to support format alternatives
11677to JSON, supported by default. This is done by sub-classing Jackson core
11678abstractions.")
11679 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11680
11681(define-public java-stax2-api
11682 (package
11683 (name "java-stax2-api")
11684 (version "4.0.0")
11685 (source (origin
11686 (method url-fetch)
11687 (uri (string-append "https://github.com/FasterXML/stax2-api/archive/"
11688 "stax2-api-" version ".tar.gz"))
11689 (sha256
11690 (base32
11691 "1amc1si0l0hyyw2sawmnzy4hkna3z6fp195y4nm5m9wb9ld5awkq"))))
11692 (build-system ant-build-system)
11693 (arguments
11694 `(#:jar-name "java-stax2-api.jar"
11695 #:source-dir "src/main/java"
11696 #:tests? #f)); no tests
11697 (home-page "https://github.com/FasterXML/stax2-api")
11698 (synopsis "Stax2 API")
11699 (description "Stax2 API is an extension to basic Stax 1.0 API that adds
11700significant new functionalities, such as full-featured bi-direction validation
11701interface and high-performance Typed Access API.")
11702 (license license:bsd-2)))
11703
11704(define-public java-woodstox-core
11705 (package
11706 (name "java-woodstox-core")
11707 (version "5.0.3")
11708 (source (origin
11709 (method git-fetch)
11710 (uri (git-reference
11711 (url "https://github.com/FasterXML/woodstox")
11712 (commit (string-append "woodstox-core-" version))))
11713 (file-name (git-file-name name version))
11714 (sha256
11715 (base32
11716 "0bfylk24a967hwxprxqbg6cdvm6n4ldcarp54yg980viwvjiglyp"))))
11717 (build-system ant-build-system)
11718 (arguments
11719 `(#:jar-name "woodstox.jar"
11720 #:test-exclude
11721 (list "**/Base*.java" "failing/**")
11722 #:phases
11723 (modify-phases %standard-phases
11724 (add-before 'build 'remove-msv-dep
11725 (lambda _
11726 ;; we don't need osgi, and it depends on msv
11727 (delete-file-recursively "src/main/java/com/ctc/wstx/osgi")
11728 ;; msv's latest release is from 2011 and we don't need it
11729 (delete-file-recursively "src/main/java/com/ctc/wstx/msv")
11730 (delete-file-recursively "src/test/java/wstxtest/osgi")
11731 (delete-file-recursively "src/test/java/wstxtest/msv")
11732 #t))
11733 (add-before 'build 'copy-resources
11734 (lambda _
11735 (copy-recursively "src/main/resources" "build/classes")
11736 #t)))))
11737 (inputs
11738 `(("stax2" ,java-stax2-api)))
11739 (native-inputs
11740 `(("junit" ,java-junit)))
11741 (home-page "https://github.com/FasterXML/woodstox")
11742 (synopsis "Stax XML API implementation")
11743 (description "Woodstox is a stax XML API implementation.")
11744 (license license:asl2.0)))
11745
11746(define-public java-fasterxml-jackson-dataformat-xml
11747 (package
11748 (name "java-fasterxml-jackson-dataformat-xml")
11749 (version "2.9.4")
11750 (source (origin
11751 (method git-fetch)
11752 (uri (git-reference
11753 (url "https://github.com/FasterXML/jackson-dataformat-xml")
11754 (commit (string-append "jackson-dataformat-xml-" version))))
11755 (file-name (git-file-name name version))
11756 (sha256
11757 (base32
11758 "0s1wl65mbs57c2hz2v8rnh8i04y5lpyyvnjz562j5j6b83vwwpfx"))))
11759 (build-system ant-build-system)
11760 (arguments
11761 `(#:jar-name "jackson-dataformat-xml.jar"
11762 #:source-dir "src/main/java"
11763 #:test-exclude
11764 (list "**/failing/**")
11765 #:phases
11766 (modify-phases %standard-phases
11767 (add-before 'configure 'generate-PackageVersion.java
11768 (lambda _
11769 (let* ((out "src/main/java/com/fasterxml/jackson/dataformat/xml/PackageVersion.java")
11770 (in (string-append out ".in")))
11771 (copy-file in out)
11772 (newline)
11773 (substitute* out
11774 (("@package@") "com.fasterxml.jackson.dataformat.xml")
11775 (("@projectversion@") ,version)
11776 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.xml")
11777 (("@projectartifactid@") "jackson-dataformat-xml")))
11778 #t))
11779 (add-before 'build 'copy-resources
11780 (lambda _
11781 (copy-recursively "src/main/resources" "build/classes")
11782 #t)))))
11783 (inputs
11784 `(("jackson-annotations" ,java-fasterxml-jackson-annotations)
11785 ("jackson-core" ,java-fasterxml-jackson-core)
11786 ("jackson-modules-base-jaxb" ,java-fasterxml-jackson-modules-base-jaxb)
11787 ("jackson-databind" ,java-fasterxml-jackson-databind)
11788 ("stax2-api" ,java-stax2-api)
11789 ("woodstox" ,java-woodstox-core)))
11790 (native-inputs
11791 `(("junit" ,java-junit)
11792 ("hamcrest" ,java-hamcrest-core)))
11793 (home-page "https://github.com/FasterXML/jackson-dataformat-xml")
11794 (synopsis "Read and write XML")
11795 (description "This package contains Jackson extension component for reading
11796and writing XML encoded data.
11797
11798Further, the goal is to emulate how JAXB data-binding works with \"Code-first\"
11799approach (that is, no support is added for \"Schema-first\" approach). Support
11800for JAXB annotations is provided by JAXB annotation module; this module
11801provides low-level abstractions (@code{JsonParser}, @code{JsonGenerator},
11802@code{JsonFactory}) as well as small number of higher level overrides needed to
11803make data-binding work.")
11804 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
11805
11806(define-public java-hdrhistogram
11807 (package
11808 (name "java-hdrhistogram")
11809 (version "2.1.9")
11810 (source (origin
11811 (method git-fetch)
11812 (uri (git-reference
11813 (url "https://github.com/HdrHistogram/HdrHistogram")
11814 (commit (string-append "HdrHistogram-" version))))
11815 (file-name (git-file-name name version))
11816 (sha256
11817 (base32
11818 "1cw8aa1vk258k42xs6wpy72m4gbai540jq032qsa7c5586iawx2d"))))
11819 (build-system ant-build-system)
11820 (arguments
11821 `(#:jar-name "java-hdrhistogram.jar"
11822 #:source-dir "src/main/java"
11823 #:phases
11824 (modify-phases %standard-phases
11825 (add-after 'unpack 'make-files-writable
11826 (lambda _
11827 (for-each make-file-writable (find-files "."))
11828 #t))
11829 (add-before 'configure 'set-version
11830 (lambda _
11831 (let* ((version-java "src/main/java/org/HdrHistogram/Version.java")
11832 (template (string-append version-java ".template")))
11833 (copy-file template version-java)
11834 (substitute* version-java
11835 (("\\$VERSION\\$") ,version)
11836 (("\\$BUILD_TIME\\$") "0"))
11837 #t))))))
11838 (native-inputs
11839 `(("junit" ,java-junit)
11840 ("hamcrest" ,java-hamcrest-core)))
11841 (home-page "https://hdrhistogram.github.io/HdrHistogram")
11842 (synopsis "High dynamic range histogram")
11843 (description "Hdrhistogram creates histograms that support
11844recording and analyzing sampled data value counts across a configurable integer
11845value range with configurable value precision within the range. Value precision
11846is expressed as the number of significant digits in the value recording, and
11847provides control over value quantization behavior across the value range and
11848the subsequent value resolution at any given level.")
11849 (license license:public-domain)))
11850
11851(define-public java-cofoja
11852 (package
11853 (name "java-cofoja")
11854 (version "1.3")
11855 (source (origin
11856 (method git-fetch)
11857 (uri (git-reference
11858 (url "https://github.com/nhatminhle/cofoja")
11859 (commit (string-append "v" version))))
11860 (file-name (string-append "java-cofoja-" version "-checkout"))
11861 (sha256
11862 (base32
11863 "0p7sz8y5xgpi5rx1qwn6587fkd52qr3ha3ybh14gqcyxhikl525w"))))
11864 (build-system ant-build-system)
11865 (arguments
11866 `(#:build-target "dist"
11867 #:test-target "test"
11868 #:jdk ,icedtea-8
11869 #:make-flags
11870 (list "-Ddist.dir=dist")
11871 #:modules ((guix build ant-build-system)
11872 (guix build java-utils)
11873 (guix build utils)
11874 (srfi srfi-1)
11875 (ice-9 match))
11876 #:phases
11877 (modify-phases %standard-phases
11878 ;; The bulid system ignores the class path the ant-build-system sets
11879 ;; up and instead expects to find all dependencies in the "lib"
11880 ;; directory.
11881 (add-after 'unpack 'create-libdir
11882 (lambda* (#:key inputs #:allow-other-keys)
11883 (mkdir-p "lib")
11884 (for-each
11885 (lambda (file)
11886 (let ((target (string-append "lib/" (basename file))))
11887 (unless (file-exists? target)
11888 (symlink file target))))
11889 (append-map (match-lambda
11890 ((label . dir)
11891 (find-files dir "\\.jar$")))
11892 inputs))
11893 #t))
11894 (replace 'install (install-jars "dist")))))
11895 (inputs
11896 (list java-asm))
11897 (native-inputs
11898 (list java-junit))
11899 (home-page "https://github.com/nhatminhle/cofoja")
11900 (synopsis "Contracts for Java")
11901 (description "Contracts for Java, or Cofoja for short, is a contract
11902programming framework and test tool for Java, which uses annotation processing
11903and bytecode instrumentation to provide run-time checking. (In particular,
11904this is not a static analysis tool.)")
11905 (license license:lgpl3+)))
11906
11907(define-public java-aopalliance
11908 (package
11909 (name "java-aopalliance")
11910 (version "1.0")
11911 (source (origin
11912 (method git-fetch)
11913 ;; Note: this git repository is not official, but contains the
11914 ;; source code that is in the CVS repository. Downloading the
11915 ;; tarball from sourceforge is undeterministic, and the cvs download
11916 ;; fails.
11917 (uri (git-reference
11918 (url "https://github.com/hoverruan/aopalliance")
11919 (commit "0d7757ae204e5876f69431421fe9bc2a4f01e8a0")))
11920 (file-name (string-append name "-" version))
11921 (sha256
11922 (base32
11923 "0rsg2b0v3hxlq2yk1i3m2gw3xwq689j3cwx9wbxvqfpdcjbca0qr"))))
11924 (build-system ant-build-system)
11925 (arguments
11926 `(#:jar-name "java-aopalliance.jar"
11927 #:jdk ,icedtea-8
11928 #:tests? #f; no tests
11929 #:source-dir "aopalliance/src/main"
11930 #:phases
11931 (modify-phases %standard-phases
11932 (add-before 'install 'create-pom
11933 (generate-pom.xml "pom.xml" "aopalliance" "aopalliance" ,version))
11934 (replace 'install
11935 (install-from-pom "pom.xml")))))
11936 (home-page "https://aopalliance.sourceforge.net")
11937 (synopsis "Aspect-Oriented Programming")
11938 (description "The AOP Alliance project is a joint project between several
11939software engineering people who are interested in Aspect-Oriented Programming
11940(AOP) and Java.")
11941 (license license:public-domain)))
11942
11943(define-public java-javax-inject
11944 (package
11945 (name "java-javax-inject")
11946 (version "1")
11947 (source (origin
11948 (method git-fetch)
11949 (uri (git-reference
11950 (url "https://github.com/javax-inject/javax-inject")
11951 (commit version)))
11952 (file-name (git-file-name name version))
11953 (sha256
11954 (base32
11955 "1rspl0nkvk1jif6nccikw93xic6ljj2b6kpy2mffwi2mnvc13j7x"))))
11956 (build-system ant-build-system)
11957 (arguments
11958 `(#:jar-name "java-javax-inject.jar"
11959 #:tests? #f; no tests
11960 #:phases
11961 (modify-phases %standard-phases
11962 (replace 'install
11963 (install-from-pom "pom.xml")))))
11964 (home-page "https://github.com/javax-inject/javax-inject")
11965 (synopsis "JSR-330: Dependency Injection for Java")
11966 (description "This package specifies a means for obtaining objects in such
11967a way as to maximize reusability, testability and maintainability compared to
11968traditional approaches such as constructors, factories, and service locators
11969(e.g., JNDI). This process, known as dependency injection, is beneficial to
11970most nontrivial applications.
11971
11972Many types depend on other types. For example, a @var{Stopwatch} might depend
11973on a @var{TimeSource}. The types on which a type depends are known as its
11974dependencies. The process of finding an instance of a dependency to use at run
11975time is known as resolving the dependency. If no such instance can be found,
11976the dependency is said to be unsatisfied, and the application is broken.")
11977 (license license:asl2.0)))
11978
11979(define-public java-guice
11980 (package
11981 (name "java-guice")
11982 (version "4.1")
11983 (source (origin
11984 (method git-fetch)
11985 (uri (git-reference
11986 (url "https://github.com/google/guice")
11987 (commit version)))
11988 (file-name (git-file-name name version))
11989 (modules '((guix build utils)))
11990 (snippet
11991 `(begin
11992 (for-each delete-file (find-files "." ".*.jar")) #t))
11993 (sha256
11994 (base32
11995 "18im5hdfl4q1b9chww2s1ii60sn3ydyyar32a2sf2p2g8zlbdswq"))))
11996 (build-system ant-build-system)
11997 (arguments
11998 `(#:jar-name "java-guice.jar"
11999 #:jdk ,icedtea-8
12000 #:tests? #f; FIXME: tests are not in a java sub directory
12001 #:source-dir "core/src"
12002 #:phases
12003 (modify-phases %standard-phases
12004 (add-after 'unpack 'make-files-writable
12005 (lambda _
12006 (for-each make-file-writable (find-files "."))
12007 #t))
12008 (replace 'install
12009 (install-from-pom "core/pom.xml")))))
12010 (propagated-inputs
12011 (list java-aopalliance
12012 java-cglib
12013 java-guava
12014 java-javax-inject
12015 java-guice-parent-pom))
12016 (home-page "https://github.com/google/guice")
12017 (synopsis "Lightweight dependency injection framework")
12018 (description "Guice is a lightweight dependency injection framework for
12019Java 6 and above.")
12020 (license license:asl2.0)))
12021
12022(define-public java-guice-servlet
12023 (package
12024 (inherit java-guice)
12025 (name "java-guice-servlet")
12026 (arguments
12027 `(#:jar-name "guice-servlet.jar"
12028 #:source-dir "extensions/servlet/src/"
12029 #:jdk ,icedtea-8
12030 #:tests? #f ; FIXME: not in a java subdir
12031 #:phases
12032 (modify-phases %standard-phases
12033 (add-after 'unpack 'make-files-writable
12034 (lambda _
12035 (for-each make-file-writable (find-files "."))
12036 #t)))))
12037 (inputs
12038 `(("guice" ,java-guice)
12039 ("servlet" ,java-classpathx-servletapi)
12040 ,@(package-inputs java-guice)))))
12041
12042(define java-guice-parent-pom
12043 (package
12044 (inherit java-guice)
12045 (name "java-guice-parent-pom")
12046 (arguments
12047 `(#:tests? #f
12048 #:phases
12049 (modify-phases %standard-phases
12050 (delete 'configure)
12051 (delete 'build)
12052 (add-after 'install 'install-extensions
12053 (install-pom-file "extensions/pom.xml"))
12054 (replace 'install
12055 (install-pom-file "pom.xml")))))
12056 (propagated-inputs
12057 `(("java-google-parent-pom" ,java-google-parent-pom-5)))))
12058
12059(define java-google-parent-pom-5
12060 (package
12061 (name "java-google-parent-pom")
12062 (version "5")
12063 (source (origin
12064 (method git-fetch)
12065 (uri (git-reference
12066 (url "https://github.com/google/google-maven-parents")
12067 (commit (string-append "google-" version))))
12068 (file-name (git-file-name name version))
12069 (sha256
12070 (base32
12071 "0zb7hx24p8k8rfdvix2vsbfqn73jhrycdndvhf8j5gbii9wbqibv"))))
12072 (build-system ant-build-system)
12073 (arguments
12074 `(#:tests? #f
12075 #:phases
12076 (modify-phases %standard-phases
12077 (delete 'configure)
12078 (delete 'build)
12079 (replace 'install
12080 (install-pom-file "pom.xml")))))
12081 (home-page "https://github.com/google/google-maven-parents")
12082 (synopsis "Google parent pom")
12083 (description "This package contains the Maven parent POM for other Google
12084Java projects.")
12085 (license license:asl2.0)))
12086
12087(define-public java-assertj
12088 (package
12089 (name "java-assertj")
12090 (version "3.8.0")
12091 (source (origin
12092 (method git-fetch)
12093 (uri (git-reference
12094 (url "https://github.com/joel-costigliola/assertj-core")
12095 (commit (string-append "assertj-core-" version))))
12096 (file-name (git-file-name name version))
12097 (sha256
12098 (base32
12099 "1k35cg2in7pzk4pbdjryr0pll5lgk1r6ngrn0j8cdlgi7w8zh2d1"))))
12100 (build-system ant-build-system)
12101 (arguments
12102 `(#:jar-name "java-assertj.jar"
12103 #:jdk ,icedtea-8
12104 #:source-dir "src/main/java"
12105 #:tests? #f)); depends on tng-junit which depends on assertj
12106 (inputs
12107 `(("cglib" ,java-cglib)
12108 ("junit" ,java-junit)
12109 ("hamcrest" ,java-hamcrest-core)))
12110 (native-inputs
12111 `(("mockito" ,java-mockito-1)))
12112 (home-page "https://joel-costigliola.github.io/assertj/index.html")
12113 (synopsis "Fluent assertions for java")
12114 (description "AssertJ core is a Java library that provides a fluent
12115interface for writing assertions. Its main goal is to improve test code
12116readability and make maintenance of tests easier.")
12117 (license license:asl2.0)))
12118
12119(define-public java-jboss-javassist
12120 (package
12121 (name "java-jboss-javassist")
12122 (version "3.21.0")
12123 (source (origin
12124 (method git-fetch)
12125 (uri (git-reference
12126 (url "https://github.com/jboss-javassist/javassist")
12127 (commit
12128 (string-append "rel_"
12129 (string-map
12130 (lambda (x) (if (eq? x #\.) #\_ x)) version)
12131 "_ga"))))
12132 (file-name (git-file-name name version))
12133 (sha256
12134 (base32
12135 "0h3zlcyqiaq01fspm69h7vki67raw305w89p4ha8vlhpzw02qifm"))
12136 (modules '((guix build utils)))
12137 (snippet
12138 '(begin
12139 (delete-file "javassist.jar")))))
12140 (build-system ant-build-system)
12141 (arguments
12142 `(#:jar-name "java-jboss-javassist.jar"
12143 #:jdk ,icedtea-8
12144 #:source-dir "src/main"
12145 #:tests? #f; FIXME: requires junit-awtui and junit-swingui from junit3
12146 #:phases
12147 (modify-phases %standard-phases
12148 (add-after 'unpack 'make-files-writable
12149 (lambda _
12150 (for-each make-file-writable (find-files "."))
12151 #t)))))
12152 (native-inputs
12153 `(("junit" ,java-junit)))
12154 (home-page "https://github.com/jboss-javassist/javassist")
12155 (synopsis "Java bytecode engineering toolkit")
12156 (description "Javassist (JAVA programming ASSISTant) makes Java bytecode
12157manipulation simple. It is a class library for editing bytecodes in Java; it
12158enables Java programs to define a new class at runtime and to modify a class
12159file when the JVM loads it.")
12160 (license (list license:gpl2 license:cddl1.0)))); either gpl2 only or cddl.
12161
12162(define-public java-jcommander
12163 (package
12164 (name "java-jcommander")
12165 (version "1.71")
12166 (source (origin
12167 (method git-fetch)
12168 (uri (git-reference
12169 (url "https://github.com/cbeust/jcommander")
12170 (commit version)))
12171 (file-name (git-file-name name version))
12172 (sha256
12173 (base32
12174 "12vcpc19sd7jhvjgp7xz1qjanfix162xb3x2q5zah93rjklj1h57"))))
12175 (build-system ant-build-system)
12176 (arguments
12177 `(#:jar-name "java-jcommander.jar"
12178 #:jdk ,icedtea-8
12179 #:tests? #f; requires testng which depends on jcommander
12180 #:source-dir "src/main/java"))
12181 (home-page "https://jcommander.org")
12182 (synopsis "Command line parameters parser")
12183 (description "JCommander is a very small Java framework that makes it
12184trivial to parse command line parameters. Parameters are declared with
12185annotations.")
12186 (license license:asl2.0)))
12187
12188(define-public java-bsh
12189 (package
12190 (name "java-bsh")
12191 (version "2.1.1")
12192 (source (origin
12193 (method git-fetch)
12194 (uri (git-reference
12195 (url "https://github.com/beanshell/beanshell")
12196 (commit version)))
12197 (file-name (git-file-name name version))
12198 (sha256
12199 (base32
12200 "1a6y46yz2ba4mnlfv4bpd5pmzhgxrzk3s10xp05jz377nbp2izwg"))
12201 (modules '((guix build utils)))
12202 (snippet
12203 '(begin
12204 ;; Delete bundled third-party jar archives.
12205 (for-each delete-file (find-files "." ".*.jar$"))
12206 (for-each (lambda (file) (chmod file #o644))
12207 (find-files "." "."))
12208 #t))))
12209 (build-system ant-build-system)
12210 (arguments
12211 `(#:build-target "jarall"
12212 #:test-target "junit-tests-all"
12213 #:make-flags (list "-DDATE" "(no date for reproducibility)")
12214 #:phases
12215 (modify-phases %standard-phases
12216 (add-before 'check 'fix-test
12217 (lambda _
12218 (substitute* "tests/junitTests/src/bsh/Issue_55_Test.java"
12219 ((" BshScriptEngineFactory") " bsh.engine.BshScriptEngineFactory"))))
12220 (replace 'install
12221 (install-from-pom "pom.xml")))))
12222 (inputs
12223 (list java-classpathx-servletapi java-commons-bsf))
12224 (native-inputs
12225 (list java-junit javacc-3))
12226 (home-page "http://beanshell.org/")
12227 (synopsis "Lightweight Scripting for Java")
12228 (description "BeanShell is a small, free, embeddable Java source
12229interpreter with object scripting language features, written in Java.
12230BeanShell dynamically executes standard Java syntax and extends it with common
12231scripting conveniences such as loose types, commands, and method closures like
12232those in Perl and JavaScript.")
12233 (license license:asl2.0)))
12234
12235(define-public java-fest-util
12236 (package
12237 (name "java-fest-util")
12238 (version "1.2.5")
12239 (source (origin
12240 (method git-fetch)
12241 (uri (git-reference
12242 (url "https://github.com/alexruiz/fest-util/")
12243 (commit (string-append "fest-util-" version))))
12244 (file-name (git-file-name name version))
12245 (sha256
12246 (base32
12247 "02kgal7v85snyyvcsxvn4qphid455f4smh2wri1il8d9asw0djbz"))))
12248 (build-system ant-build-system)
12249 (arguments
12250 `(#:jar-name "java-fest-util.jar"
12251 #:source-dir "src/main/java"))
12252 (native-inputs
12253 `(("junit" ,java-junit)
12254 ("hamcrest" ,java-hamcrest-core)))
12255 (home-page "https://github.com/alexruiz/fest-util")
12256 (synopsis "FEST common utilities")
12257 (description "Common utilities used in all FEST module.")
12258 (license license:asl2.0)))
12259
12260(define-public java-fest-test
12261 (package
12262 (name "java-fest-test")
12263 (version "2.1.0")
12264 (source (origin
12265 (method git-fetch)
12266 (uri (git-reference
12267 (url "https://github.com/alexruiz/fest-test/")
12268 (commit (string-append "fest-test-" version))))
12269 (file-name (git-file-name name version))
12270 (sha256
12271 (base32
12272 "0mg1d2jfh7kbx2c40dchbjr6d8pv59snsyb13mfxsr7xk5n69qbn"))))
12273 (build-system ant-build-system)
12274 (arguments
12275 `(#:jar-name "java-fest-test.jar"
12276 #:source-dir "src/main/java"
12277 #:tests? #f)); no tests
12278 (inputs
12279 `(("junit" ,java-junit)))
12280 (home-page "https://github.com/alexruiz/fest-test")
12281 (synopsis "Common FEST testing infrastructure")
12282 (description "Fest-test contains the common FEST testing infrastructure.")
12283 (license license:asl2.0)))
12284
12285(define-public java-fest-assert
12286 (package
12287 (name "java-fest-assert")
12288 (version "2.0M10")
12289 (source (origin
12290 (method git-fetch)
12291 (uri (git-reference
12292 (url "https://github.com/alexruiz/fest-assert-2.x/")
12293 (commit (string-append "fest-assert-core-" version))))
12294 (file-name (git-file-name name version))
12295 (sha256
12296 (base32
12297 "1cp8zzyag3s85fz2w68sda9zzaal1y5f9wl8g72wkm12an40w6by"))))
12298 (build-system ant-build-system)
12299 (arguments
12300 `(#:jar-name "java-fest-assert.jar"
12301 #:source-dir "src/main/java"
12302 #:test-exclude
12303 (list
12304 "**/Abstract*.java"
12305 "**/*BaseTest.java"
12306 ;; Unable to set MockitoNamingPolicy on cglib generator which creates FastClasses
12307 "**/MessageFormatter_format_Test.java"
12308 "**/internal/*/*_assert*_Test.java")))
12309 (inputs
12310 (list java-fest-util))
12311 (native-inputs
12312 (list java-junit
12313 java-fest-test
12314 java-hamcrest-core
12315 java-mockito-1
12316 java-cglib
12317 java-objenesis))
12318 (home-page "https://github.com/alexruiz/fest-assert-2.x")
12319 (synopsis "FEST fluent assertions")
12320 (description "FEST-Assert provides a fluent interface for assertions.")
12321 (license license:asl2.0)))
12322
12323(define-public java-testng
12324 (package
12325 (name "java-testng")
12326 (version "6.14.3")
12327 (source (origin
12328 (method git-fetch)
12329 (uri (git-reference
12330 (url "https://github.com/cbeust/testng")
12331 (commit version)))
12332 (file-name (string-append name "-" version "-checkout"))
12333 (sha256
12334 (base32
12335 "0y6vq30i5g276kw0v2bhbvci22ijg7ax49ap2611yqlhbs4d6dqv"))))
12336 (build-system ant-build-system)
12337 (arguments
12338 (list
12339 #:jdk icedtea-8; java.util.function
12340 #:jar-name "java-testng.jar"
12341 #:source-dir "src/main/java"
12342 #:phases
12343 '(modify-phases %standard-phases
12344 (add-after 'unpack 'delete-failing-tests
12345 (lambda _
12346 ;; FIXME: I don't know why these tests fail
12347 (substitute* "src/test/resources/testng.xml"
12348 ;; expected:<[0]> but was:<[3]>
12349 (("<class name=\"test.configuration.github1625.TestRunnerIssue1625\"/>") "")
12350 ;; expected [3] but found [2]
12351 (("<class name=\"test.serviceloader.ServiceLoaderTest\" />") "")
12352 ;; This is a parallel test and we've observed that it fails
12353 ;; sometimes.
12354 (("<class name=\"test.dataprovider.DataProviderTest\"/>") ""))))
12355 ;; We don't have groovy
12356 (add-after 'unpack 'delete-groovy-tests
12357 (lambda _
12358 (delete-file-recursively "src/test/java/test/dependent/issue1648/")
12359 (substitute* "src/test/resources/testng.xml"
12360 (("<class name=\"test.dependent.issue1648.TestRunner\"/>") ""))))
12361 (add-before 'build 'copy-resources
12362 (lambda _
12363 (copy-recursively "src/main/resources" "build/classes")))
12364 (add-before 'check 'copy-test-resources
12365 (lambda _
12366 (copy-recursively "src/test/resources" "build/test-classes")))
12367 (replace 'check
12368 (lambda _
12369 (invoke "ant" "compile-tests")
12370 ;; we don't have groovy
12371 (substitute* "src/test/resources/testng.xml"
12372 (("<class name=\"test.groovy.GroovyTest\" />") ""))
12373 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
12374 ":build/classes"
12375 ":build/test-classes")
12376 "-Dtest.resources.dir=src/test/resources"
12377 "org.testng.TestNG" "src/test/resources/testng.xml"))))))
12378 (propagated-inputs
12379 (list java-junit
12380 java-jsr305
12381 java-bsh
12382 java-jcommander
12383 java-guice
12384 java-snakeyaml))
12385 (native-inputs
12386 (list java-guava
12387 java-javax-inject
12388 java-hamcrest-all
12389 java-assertj
12390 java-mockito-1
12391 java-cglib
12392 java-aopalliance))
12393 (home-page "https://testng.org")
12394 (synopsis "Testing framework")
12395 (description "TestNG is a testing framework inspired from JUnit and NUnit
12396but introducing some new functionalities that make it more powerful and easier
12397to use.")
12398 (license license:asl2.0)))
12399
12400(define-public java-jnacl
12401 (let ((commit "094e819afdd63ea81a499b3bcb42a271006bebd9")
12402 (revision "2"))
12403 (package
12404 (name "java-jnacl")
12405 (version (string-append "0.1.0-" revision "." (string-take commit 7)))
12406 (source (origin
12407 (method git-fetch)
12408 (uri (git-reference
12409 (url "https://github.com/neilalexander/jnacl")
12410 (commit commit)))
12411 (file-name (git-file-name name version))
12412 (sha256
12413 (base32
12414 "1d6g6xhn83byv5943n7935wwjsk0ibk0qdvqgr699qqgqqmwisbb"))))
12415 (build-system ant-build-system)
12416 (arguments
12417 `(#:jar-name "jnacl.jar"
12418 #:source-dir "src/main/java"
12419 #:jdk ,icedtea-8
12420 #:phases
12421 (modify-phases %standard-phases
12422 (add-before 'build 'fix-tests
12423 (lambda _
12424 (substitute* '("src/test/java/com/neilalexander/jnacl/NaClTest.java"
12425 "src/test/java/com/neilalexander/jnacl/NaclSecretBoxTest.java")
12426 (("assertions.Assertions") "assertions.api.Assertions"))
12427 #t))
12428 (replace 'check
12429 (lambda _
12430 (invoke "ant" "compile-tests")
12431 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
12432 ":build/classes"
12433 ":build/test-classes")
12434 "org.testng.TestNG" "-testclass"
12435 "build/test-classes/com/neilalexander/jnacl/NaclSecretBoxTest.class")
12436 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
12437 ":build/classes"
12438 ":build/test-classes")
12439 "org.testng.TestNG" "-testclass"
12440 "build/test-classes/com/neilalexander/jnacl/NaClTest.class"))))))
12441 (native-inputs
12442 (list java-testng java-fest-util java-fest-assert))
12443 (home-page "https://github.com/neilalexander/jnacl")
12444 (synopsis "Java implementation of NaCl")
12445 (description "Pure Java implementation of the NaCl: Networking and
12446Cryptography library.")
12447 (license license:bsd-2))))
12448
12449(define-public java-mvel2
12450 (package
12451 (name "java-mvel2")
12452 (version "2.3.1")
12453 (source (origin
12454 (method url-fetch)
12455 (uri (string-append "https://github.com/mvel/mvel/archive/mvel2-"
12456 version ".Final.tar.gz"))
12457 (sha256
12458 (base32
12459 "01ph5s9gm16l2qz58lg21w6fna7xmmrj7f9bzqr1jim7h9557d3z"))))
12460 (build-system ant-build-system)
12461 (arguments
12462 `(#:jar-name "mvel2.jar"
12463 #:source-dir "src/main/java"
12464 #:test-exclude
12465 (list "**/Abstract*.java"
12466 ;; Base class with no tests
12467 "**/MVELThreadTest.java")
12468 #:phases
12469 (modify-phases %standard-phases
12470 (add-after 'install 'install-bin
12471 (lambda* (#:key outputs #:allow-other-keys)
12472 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
12473 (mkdir-p bin)
12474 (with-output-to-file (string-append bin "/mvel2")
12475 (lambda _
12476 (display
12477 (string-append
12478 "#!" (which "bash") "\n"
12479 "if [ \"$#\" -ne \"2\" ]; then\n"
12480 "echo 'Usage: mvel2 <script> <out.dir>'\n"
12481 "exit\n"
12482 "fi\n"
12483 "java -Dout.dir=$2 -cp " (getenv "CLASSPATH")
12484 ":" (assoc-ref outputs "out") "/share/java/mvel2.jar"
12485 " org.mvel2.sh.Main $1"))))
12486 (chmod (string-append bin "/mvel2") #o755))
12487 #t)))))
12488 (native-inputs
12489 `(("junit" ,java-junit)
12490 ("hamcrest" ,java-hamcrest-core)))
12491 (home-page "https://github.com/mvel/mvel")
12492 (synopsis "MVFLEX Expression Language")
12493 (description "MVEL has largely been inspired by Java syntax, but has some
12494fundamental differences aimed at making it more efficient as an expression
12495language, such as operators that directly support collection, array and string
12496matching, as well as regular expressions. MVEL is used to evaluate expressions
12497written using Java syntax.
12498
12499In addition to the expression language, MVEL serves as a templating language for
12500configuration and string construction.")
12501 (license license:asl2.0)))
12502
12503(define-public java-commons-jexl-2
12504 (package
12505 (name "java-commons-jexl")
12506 (version "2.1.1")
12507 (source (origin
12508 (method url-fetch)
12509 (uri (string-append "mirror://apache/commons/jexl/source/"
12510 "commons-jexl-" version "-src.tar.gz"))
12511 (sha256
12512 (base32
12513 "1ai7632bwwaxglb0nbpblpr2jw5g20afrsaq372ipkphi3ncy1jz"))))
12514 (build-system ant-build-system)
12515 (arguments
12516 `(#:jar-name "commons-jexl-2.jar"
12517 #:jdk ,icedtea-8
12518 #:source-dir "src/main/java"
12519 #:phases
12520 (modify-phases %standard-phases
12521 (add-before 'check 'disable-broken-tests
12522 (lambda* (#:key inputs #:allow-other-keys)
12523 (with-directory-excursion "src/test/java/org/apache/commons/jexl2/"
12524 (substitute* "ArithmeticTest.java"
12525 (("asserter.assertExpression\\(\"3 / 0\"") "//")
12526 (("asserter.assertExpression\\(\"imanull") "//"))
12527 ;; This test fails with "ambiguous method invocation"
12528 (delete-file "CacheTest.java")
12529 ;; This test doesn't have access to the temp directory
12530 (substitute* "ClassCreatorTest.java"
12531 (("java.io.tmpdir") "user.dir"))
12532 ;; This test fails in trying to detect whether it can run.
12533 (substitute* "ClassCreator.java"
12534 (("boolean canRun =.*") "boolean canRun = false;\n"))
12535 ;; ...and these tests depend on it.
12536 (delete-file "scripting/JexlScriptEngineOptionalTest.java")
12537 (delete-file "scripting/JexlScriptEngineTest.java"))
12538 #t))
12539 (add-before 'build 'run-javacc
12540 (lambda _
12541 (with-directory-excursion "src/main/java/org/apache/commons/jexl2/parser/"
12542 (invoke "java" "jjtree" "Parser.jjt")
12543 (invoke "java" "javacc" "Parser.jj"))
12544 #t)))))
12545 (inputs
12546 (list java-commons-logging-minimal))
12547 (native-inputs
12548 (list java-junit java-hamcrest-core javacc-4))
12549 (home-page "https://commons.apache.org/proper/commons-jexl/")
12550 (synopsis "Java Expression Language")
12551 (description "JEXL is a library intended to facilitate the implementation
12552of dynamic and scripting features in applications and frameworks written in
12553Java. JEXL implements an Expression Language based on some extensions to the
12554JSTL Expression Language supporting most of the constructs seen in
12555shell-script or ECMAScript. Its goal is to expose scripting features usable
12556by technical operatives or consultants working with enterprise platforms.")
12557 (license license:asl2.0)))
12558
12559(define-public java-lz4
12560 (package
12561 (name "java-lz4")
12562 (version "1.4.0")
12563 (source (origin
12564 (method git-fetch)
12565 (uri (git-reference
12566 (url "https://github.com/lz4/lz4-java")
12567 (commit version)))
12568 (file-name (git-file-name name version))
12569 (sha256
12570 (base32
12571 "0ydjakhv3cz34mfvv14qrh2ksdxifgjwwagjy7r46qr3f68hnf6y"))))
12572 (build-system ant-build-system)
12573 (arguments
12574 `(#:jar-name "lz4.jar"
12575 #:jdk ,icedtea-8
12576 #:source-dir "src/java:src/java-unsafe"
12577 #:tests? #f; FIXME: requires more dependencies
12578 #:phases
12579 (modify-phases %standard-phases
12580 (add-after 'unpack 'make-files-writable
12581 (lambda _
12582 (for-each make-file-writable (find-files "."))
12583 #t))
12584 (add-before 'configure 'generate-source
12585 (lambda _
12586 (with-directory-excursion "src/build/source_templates"
12587 (invoke "mvel2" "../gen_sources.mvel" "../../java"))
12588 #t)))))
12589 (native-inputs
12590 `(("mvel" ,java-mvel2)))
12591 (home-page "https://jpountz.github.io/lz4-java")
12592 (synopsis "Compression algorithm")
12593 (description "LZ4 - Java is a Java port of the popular lz4 compression
12594algorithms and xxHash hashing algorithm.")
12595 (license license:asl2.0)))
12596
12597(define-public java-bouncycastle
12598 (package
12599 (name "java-bouncycastle")
12600 (version "1.67")
12601 (source (origin
12602 (method git-fetch)
12603 (uri (git-reference
12604 (url "http://git.bouncycastle.org/repositories/bc-java")
12605 ;(url "https://github.com/bcgit/bc-java")
12606 (commit (string-append "r1rv" (substring version 2 4)))))
12607 (file-name (git-file-name name version))
12608 (sha256
12609 (base32
12610 "1449q7fyh03s1q0bqljcrhgacwcyqmg2bbvb3z084avgapwsainz"))
12611 (modules '((guix build utils)))
12612 (snippet
12613 '(begin
12614 (for-each delete-file
12615 (find-files "." "\\.jar$"))
12616 #t))))
12617 (build-system ant-build-system)
12618 (arguments
12619 `(#:jdk ,icedtea-8
12620 #:tests? #f
12621 #:phases
12622 (modify-phases %standard-phases
12623 (replace 'build
12624 (lambda _
12625 (invoke "ant" "-f" "ant/jdk15+.xml" "build-provider")
12626 (invoke "ant" "-f" "ant/jdk15+.xml" "build")))
12627 ;; FIXME: the tests freeze.
12628 ;; (replace 'check
12629 ;; (lambda _
12630 ;; (invoke "ant" "-f" "ant/jdk15+.xml" "test")))
12631 (replace 'install
12632 (install-jars "build/artifacts/jdk1.5/jars")))))
12633 (inputs
12634 (list java-javax-mail))
12635 (native-inputs
12636 `(("unzip" ,unzip)
12637 ("junit" ,java-junit)
12638 ("java-native-access" ,java-native-access)
12639 ("java-native-access-platform" ,java-native-access-platform)))
12640 (home-page "https://www.bouncycastle.org")
12641 (synopsis "Cryptographic library")
12642 (description "Bouncy Castle is a cryptographic library for the Java
12643programming language.")
12644 (license license:expat)))
12645
12646(define-public java-jakarta-activation-1.2
12647 (package
12648 (name "java-jakarta-activation")
12649 (version "1.2.2")
12650 (source (origin
12651 (method git-fetch)
12652 (uri (git-reference
12653 (url "https://github.com/jakartaee/jaf-api")
12654 (commit version)))
12655 (file-name (git-file-name name version))
12656 (sha256
12657 (base32
12658 "13kkr0kj9wp45vpfackcbyycilzs5r3sj33px5pny1k4hq09cyar"))))
12659 (build-system ant-build-system)
12660 (arguments
12661 `(#:tests? #f
12662 #:jar-name "jakarta.activation.jar"
12663 #:jdk ,openjdk9
12664 #:source-dir "activation/src/main/java"
12665 #:phases
12666 (modify-phases %standard-phases
12667 ;; Install under javax.activation:activation coordinates
12668 ;; so consumers like javax.mail can find it. The source
12669 ;; pom uses com.sun.activation:jakarta.activation but that's
12670 ;; the new coordinate; most existing poms reference the
12671 ;; old javax.activation:activation.
12672 (add-before 'install 'create-pom
12673 (generate-pom.xml "pom.xml" "javax.activation"
12674 "activation" ,version))
12675 (replace 'install
12676 (install-from-pom "pom.xml")))))
12677 (home-page "https://jakarta.ee/specifications/activation/")
12678 (synopsis "Jakarta Activation API (javax.activation)")
12679 (description "Jakarta Activation provides the @code{javax.activation}
12680package, which was removed from the JDK in Java 11. This is the 1.2.x
12681transitional release that still uses the @code{javax.activation} namespace.")
12682 (license license:edl1.0)))
12683
12684(define-public java-bouncycastle-1.77
12685 (package
12686 (inherit java-bouncycastle)
12687 (version "1.77")
12688 (source (origin
12689 (method git-fetch)
12690 (uri (git-reference
12691 (url "https://github.com/bcgit/bc-java")
12692 (commit (string-append "r1rv" (substring version 2 4)))))
12693 (file-name (git-file-name "java-bouncycastle" version))
12694 (sha256
12695 (base32
12696 "1adxic0pgb7gv2yflw72np7zilj6rrhgjcj3xvnmidwp2pc887k1"))
12697 (modules '((guix build utils)))
12698 (snippet
12699 '(begin
12700 (for-each delete-file
12701 (find-files "." "\\.jar$"))
12702 #t))))
12703 (arguments
12704 `(#:jdk ,openjdk17
12705 #:tests? #f
12706 #:phases
12707 (modify-phases %standard-phases
12708 (replace 'build
12709 (lambda _
12710 (let ((suffix (string-append
12711 "-Drelease.suffix="
12712 ,(string-join (string-split version #\.) ""))))
12713 (mkdir-p "ant/docs")
12714 ;; Build individual targets. Can't use the 'build'
12715 ;; target because it includes 'build-test' which needs
12716 ;; the UnboundID LDAP SDK.
12717 (invoke "ant" "-f" "ant/jdk18+.xml" suffix
12718 "build-provider")
12719 ;; The remaining targets are only in bc+-build.xml.
12720 ;; Call it via ant's -f but pass properties that
12721 ;; jdk18+.xml normally sets.
12722 (let ((props (list suffix
12723 "-Dtarget.prefix=jdk18on"
12724 "-Djdk.name=jdk1.8"
12725 "-Dbc.javac.source=1.8"
12726 "-Dbc.javac.target=1.8"
12727 "-Dbuild.dir=build"
12728 "-Djavadoc.args=-breakiterator"
12729 (string-append "-Dsrc.dir="
12730 (getcwd) "/build/jdk1.8")
12731 (string-append "-Dartifacts.dir="
12732 (getcwd) "/build/artifacts/jdk1.8"))))
12733 (for-each
12734 (lambda (target)
12735 (apply invoke "ant" "-f" "ant/bc+-build.xml"
12736 (append props (list target))))
12737 '("build-util" "build-pkix" "build-pg" "build-mail"))))))
12738 (add-after 'build 'add-osgi-manifests
12739 (lambda _
12740 ;; The Maven Central jars have OSGi manifest attributes
12741 ;; from maven-bundle-plugin. Add them since we build
12742 ;; with ant.
12743 (for-each
12744 (lambda (name)
12745 (let ((jar (car (find-files "build/artifacts"
12746 (string-append name "-jdk18on.*\\.jar$")))))
12747 (call-with-output-file "osgi-manifest.mf"
12748 (lambda (port)
12749 (display (string-append
12750 "Bundle-ManifestVersion: 2\n"
12751 "Bundle-SymbolicName: " name "\n"
12752 "Bundle-Version: " ,version "\n")
12753 port)))
12754 (invoke "jar" "ufm" jar "osgi-manifest.mf")))
12755 '("bcprov" "bcutil" "bcpkix" "bcpg"))))
12756 (add-after 'add-osgi-manifests 'rename-jars
12757 (lambda _
12758 ;; Ant produces e.g. bcprov-jdk18on-177.jar but
12759 ;; install-from-pom expects bcprov-jdk18on-1.77.jar.
12760 (for-each
12761 (lambda (name)
12762 (let ((src (car (find-files "build/artifacts"
12763 (string-append name "-jdk18on-.*\\.jar$"))))
12764 (dest (string-append "build/artifacts/jdk1.8/jars/"
12765 name "-jdk18on-" ,version ".jar")))
12766 (unless (string=? src dest)
12767 (rename-file src dest))))
12768 '("bcprov" "bcutil" "bcpkix" "bcpg"))))
12769 (replace 'install
12770 (lambda* (#:key inputs outputs jar-name #:allow-other-keys)
12771 (for-each
12772 (lambda (name)
12773 (let ((pom-file (string-append name "-pom.xml"))
12774 (artifact (string-append name "-jdk18on")))
12775 ((generate-pom.xml pom-file "org.bouncycastle"
12776 artifact ,version))
12777 ((install-from-pom pom-file)
12778 #:inputs inputs #:outputs outputs
12779 #:jar-name (string-append artifact "-" ,version "\\.jar$"))))
12780 '("bcprov" "bcutil" "bcpkix" "bcpg")))))))
12781 (inputs
12782 (list java-jakarta-activation-1.2
12783 java-javax-mail))
12784 (description "Bouncy Castle is a cryptographic library for the Java
12785programming language. This is version 1.77 which has breaking API changes
12786compared to 1.67 (removed classes in ASN1, CMC, and other packages).")))
12787
12788(define-public java-eclipse-jdt-annotation-2
12789 (package
12790 (name "java-eclipse-jdt-annotation")
12791 (version "2.2.600")
12792 (source (origin
12793 (method url-fetch)
12794 (uri (string-append "https://repo1.maven.org/maven2/"
12795 "org/eclipse/jdt/org.eclipse.jdt.annotation/"
12796 version "/org.eclipse.jdt.annotation-"
12797 version "-sources.jar"))
12798 (sha256
12799 (base32
12800 "1jlq14ivhj32i7glfdmk068ya1spm4wfa9h8h2p326y0fkkzwyp9"))))
12801 (build-system ant-build-system)
12802 (arguments
12803 `(#:tests? #f
12804 #:jar-name "org.eclipse.jdt.annotation.jar"
12805 #:source-dir "."
12806 #:phases
12807 (modify-phases %standard-phases
12808 (add-before 'install 'create-pom
12809 (generate-pom.xml "pom.xml" "org.eclipse.jdt"
12810 "org.eclipse.jdt.annotation" ,version))
12811 (replace 'install (install-from-pom "pom.xml")))))
12812 (native-inputs (list unzip))
12813 (home-page "https://www.eclipse.org/jdt/")
12814 (synopsis "Eclipse JDT null analysis annotations")
12815 (description "This package provides the @code{@@NonNull}, @code{@@Nullable},
12816and @code{@@NonNullByDefault} annotations used by Eclipse JDT for null
12817analysis.")
12818 (license license:epl2.0)))
12819
12820(define-public java-kohlschutter-compiler-annotations-1
12821 (package
12822 (name "java-kohlschutter-compiler-annotations")
12823 (version "1.4.2")
12824 (source (origin
12825 (method url-fetch)
12826 (uri (string-append "https://repo1.maven.org/maven2/"
12827 "com/kohlschutter/compiler-annotations/"
12828 version "/compiler-annotations-"
12829 version "-sources.jar"))
12830 (sha256
12831 (base32
12832 "0fzmhr9binv1ah410955m95w6lwwidy9sw06yy5cjcrcjx7v0455"))))
12833 (build-system ant-build-system)
12834 (arguments
12835 `(#:tests? #f
12836 #:jar-name "compiler-annotations.jar"
12837 #:jdk ,openjdk9
12838 #:source-dir "."
12839 #:phases
12840 (modify-phases %standard-phases
12841 (add-before 'install 'create-pom
12842 (generate-pom.xml "pom.xml" "com.kohlschutter"
12843 "compiler-annotations" ,version))
12844 (replace 'install (install-from-pom "pom.xml")))))
12845 (inputs (list java-eclipse-jdt-annotation-2))
12846 (native-inputs (list unzip))
12847 (home-page "https://github.com/kohlschutter/compiler-annotations")
12848 (synopsis "Compile-time annotations for Java")
12849 (description "This package provides compile-time annotations such as
12850@code{@@SuppressFBWarnings} and @code{@@ExcludeFromCodeCoverageGeneratedReport}.")
12851 (license license:asl2.0)))
12852
12853(define junixsocket-source
12854 (origin
12855 (method git-fetch)
12856 (uri (git-reference
12857 (url "https://github.com/kohlschutter/junixsocket")
12858 (commit "junixsocket-parent-2.5.1")))
12859 (file-name (git-file-name "java-junixsocket" "2.5.1"))
12860 (sha256
12861 (base32
12862 "1zc84qbl2zsi9ch6b12crbiqlrkbrlw1z09kqlj04zrmck4k4pzn"))))
12863
12864(define-public java-junixsocket-common-2
12865 (package
12866 (name "java-junixsocket-common")
12867 (version "2.5.1")
12868 (source junixsocket-source)
12869 (build-system ant-build-system)
12870 (arguments
12871 `(#:jar-name "junixsocket-common.jar"
12872 #:source-dir "junixsocket-common/src/main/java"
12873 #:jdk ,openjdk9
12874 #:tests? #f
12875 #:phases
12876 (modify-phases %standard-phases
12877 (add-after 'unpack 'delete-module-info
12878 (lambda _
12879 ;; module-info.java requires modules not available in
12880 ;; our build (com.kohlschutter.annotations.compiletime,
12881 ;; org.eclipse.jdt.annotation). The classes compile
12882 ;; and work without JPMS metadata.
12883 (delete-file
12884 "junixsocket-common/src/main/java/module-info.java")))
12885 (replace 'install
12886 (install-from-pom "junixsocket-common/pom.xml")))))
12887 (inputs (list java-eclipse-jdt-annotation-2
12888 java-kohlschutter-compiler-annotations-1))
12889 (home-page "https://github.com/kohlschutter/junixsocket")
12890 (synopsis "Java library for Unix domain sockets")
12891 (description "junixsocket is a Java library for Unix domain sockets
12892(AF_UNIX) and other address/protocol families, providing a Java Socket API
12893compatible interface.")
12894 (license license:asl2.0)))
12895
12896(define-public java-junixsocket-native-common-2.5.1
12897 (package
12898 (name "java-junixsocket-native-common")
12899 (version "2.5.1")
12900 (source junixsocket-source)
12901 (build-system ant-build-system)
12902 (arguments
12903 (list
12904 #:tests? #f
12905 #:jdk openjdk9
12906 #:jar-name "junixsocket-native-common.jar"
12907 #:source-dir "junixsocket-native-common/src/main/java"
12908 #:phases
12909 #~(modify-phases %standard-phases
12910 (add-before 'build 'set-module-path
12911 (lambda* (#:key inputs #:allow-other-keys)
12912 ;; javac needs compiler-annotations on the module path
12913 ;; (not classpath) for JPMS 'requires static' resolution.
12914 (let ((mod-dir (assoc-ref inputs
12915 "java-kohlschutter-compiler-annotations")))
12916 (setenv "JDK_JAVAC_OPTIONS"
12917 (string-append "--module-path="
12918 (car (find-files mod-dir "\\.jar$")))))))
12919 (add-before 'build 'build-native
12920 (lambda* (#:key inputs #:allow-other-keys)
12921 (let ((jdk (assoc-ref inputs "jdk"))
12922 (c-dir "junixsocket-native/src/main/c"))
12923 ;; Fix GCC incompatibility: _Pragma inside expressions
12924 ;; is a Clang extension, not supported by GCC.
12925 (substitute* (string-append c-dir "/ckmacros.h")
12926 (("# define CK_IGNORE_CAST_BEGIN \\\\")
12927 "# define CK_IGNORE_CAST_BEGIN")
12928 (("# define CK_IGNORE_CAST_END \\\\")
12929 "# define CK_IGNORE_CAST_END")
12930 (("_Pragma\\(\"GCC diagnostic.*cast.*\"\\)") "")
12931 (("_Pragma\\(\"GCC diagnostic push\"\\)") "")
12932 (("_Pragma\\(\"GCC diagnostic pop\"\\)") ""))
12933 (let ((so-file (string-append
12934 "junixsocket-native-common/src/main/"
12935 "resources/lib/amd64-Linux-clang/jni/"
12936 "libjunixsocket-native-" #$version ".so")))
12937 (mkdir-p (dirname so-file))
12938 (apply invoke "gcc" "-shared" "-fPIC" "-O2"
12939 "-Wno-int-to-pointer-cast"
12940 "-Wno-pointer-to-int-cast"
12941 "-Wno-bad-function-cast"
12942 "-Wno-cast-function-type"
12943 "-Wno-stringop-overflow"
12944 (string-append "-I" c-dir)
12945 (string-append "-I" c-dir "/jni")
12946 (string-append "-I" jdk "/include")
12947 (string-append "-I" jdk "/include/linux")
12948 "-o" so-file
12949 (find-files c-dir "\\.c$"))))))
12950 (add-after 'build 'add-native-to-jar
12951 (lambda _
12952 (invoke "jar" "uf"
12953 "build/jar/junixsocket-native-common.jar"
12954 "-C" "junixsocket-native-common/src/main/resources"
12955 "lib")))
12956 ;; The source pom.xml lists pre-built native library
12957 ;; NARs for every platform. We build the native code
12958 ;; from source, so none of those dependencies apply.
12959 (add-before 'install 'create-pom
12960 (generate-pom.xml "pom.xml"
12961 "com.kohlschutter.junixsocket"
12962 "junixsocket-native-common" #$version))
12963 (replace 'install
12964 (install-from-pom "pom.xml")))))
12965 (native-inputs (list java-kohlschutter-compiler-annotations-1))
12966 (home-page "https://github.com/kohlschutter/junixsocket")
12967 (synopsis "Native JNI library for junixsocket")
12968 (description "This package provides the native JNI library for
12969junixsocket, built from source for Linux.")
12970 (license license:asl2.0)))
12971
12972(define-public java-lmax-disruptor
12973 (package
12974 (name "java-lmax-disruptor")
12975 (version "3.4.4")
12976 (source (origin
12977 (method git-fetch)
12978 (uri (git-reference
12979 (url "https://github.com/LMAX-Exchange/disruptor")
12980 (commit version)))
12981 (file-name (git-file-name name version))
12982 (sha256
12983 (base32
12984 "02c5kp3n8a73dq9ay7ar53s1k3x61z9yzc5ikqb03m6snr1wpfqn"))))
12985 (build-system ant-build-system)
12986 (arguments
12987 `(#:jar-name "java-lmax-disruptor.jar"
12988 #:jdk ,icedtea-8
12989 #:tests? #f)); tests hang
12990 (inputs
12991 `(("junit" ,java-junit)
12992 ("java-hdrhistogram" ,java-hdrhistogram)
12993 ("java-jmock" ,java-jmock)
12994 ("java-jmock-legacy" ,java-jmock-legacy)
12995 ("java-jmock-junit4" ,java-jmock-junit4)
12996 ("java-hamcrest-all" ,java-hamcrest-all)))
12997 (native-inputs
12998 `(("cglib" ,java-cglib)
12999 ("objenesis" ,java-objenesis)))
13000 (home-page "https://www.lmax.com/disruptor")
13001 (synopsis "High performance inter-thread communication")
13002 (description "LMAX Disruptor is a software pattern and software component
13003for high performance inter-thread communication that avoids the need for
13004message queues or resource locking.")
13005 (license license:asl2.0)))
13006
13007(define-public java-conversant-disruptor
13008 (package
13009 (name "java-conversant-disruptor")
13010 (version "1.2.19")
13011 (source (origin
13012 (method git-fetch)
13013 (uri (git-reference
13014 (url "https://github.com/conversant/disruptor")
13015 (commit version)))
13016 (file-name (git-file-name name version))
13017 (sha256
13018 (base32
13019 "0gx1dm7sfg7pa05cs4qby10gfcplai5b5lf1f7ik1a76dh3vhl0g"))))
13020 (build-system ant-build-system)
13021 (arguments
13022 `(#:jar-name "java-conversant-disruptor.jar"
13023 #:source-dir "src/main/java"
13024 #:phases
13025 (modify-phases %standard-phases
13026 (add-before 'build 'copy-resources
13027 (lambda _
13028 (copy-recursively "src/main/resources" "build/classes")))
13029 (add-before 'build 'remove-module
13030 (lambda _
13031 (delete-file "src/main/java/module-info.java"))))))
13032 (native-inputs
13033 (list java-junit))
13034 (home-page "https://github.com/conversant/disruptor")
13035 (synopsis "High performance intra-thread communication")
13036 (description "Conversant Disruptor is the highest performing intra-thread
13037transfer mechanism available in Java. Conversant Disruptor is an implementation
13038of this type of ring buffer that has almost no overhead and that exploits a
13039particularly simple design.")
13040 (license license:asl2.0)))
13041
13042(define-public java-jctools-core-1
13043 (package
13044 (name "java-jctools-core")
13045 (version "1.2.1")
13046 (source (origin
13047 (method git-fetch)
13048 (uri (git-reference
13049 (url "https://github.com/JCTools/JCTools")
13050 (commit (string-append "v" version))))
13051 (file-name (git-file-name name version))
13052 (sha256
13053 (base32
13054 "105my29nwd4djvdllmq8s3jdzbyplbkxzwmddxiiilb4yqr1pghb"))))
13055 (build-system ant-build-system)
13056 (arguments
13057 `(#:jar-name "java-jctools-core.jar"
13058 #:source-dir "jctools-core/src/main/java"
13059 #:test-dir "jctools-core/src/test"
13060 ;; The tests timeout on some architectures.
13061 #:tests? ,(not (or (target-aarch64?)
13062 (%current-target-system)))))
13063 (native-inputs
13064 (list java-junit java-hamcrest-all))
13065 (home-page "https://github.com/JCTools/JCTools")
13066 (synopsis "Concurrency tools for Java")
13067 (description "This library implements concurrent data structures that are
13068not natively available in Java.")
13069 (license license:asl2.0)))
13070
13071(define-public java-commons-bcel
13072 (package
13073 (name "java-commons-bcel")
13074 (version "6.1")
13075 (source (origin
13076 (method url-fetch)
13077 (uri (string-append "mirror://apache/commons/bcel/source/bcel-"
13078 version "-src.tar.gz"))
13079 (sha256
13080 (base32
13081 "0j3x1rxd673k07psclk8k13rqh0x0mf2yy5qiwkiw4z3afa568jy"))))
13082 (build-system ant-build-system)
13083 (arguments
13084 `(#:jar-name "bcel.jar"
13085 #:jdk ,icedtea-8
13086 #:source-dir "src/main/java"
13087 #:test-dir "src/test/java"
13088 ;; FIXME: Tests require the unpackaged jna.
13089 #:tests? #f))
13090 (home-page "https://commons.apache.org/proper/commons-bcel/")
13091 (synopsis "Byte code engineering library")
13092 (description "The Byte Code Engineering Library (Apache Commons BCEL) is
13093intended to give users a convenient way to analyze, create, and
13094manipulate (binary) Java class files. Classes are represented by objects
13095which contain all the symbolic information of the given class: methods, fields
13096and byte code instructions, in particular.
13097
13098Such objects can be read from an existing file, be transformed by a
13099program (e.g. a class loader at run-time) and written to a file again. An
13100even more interesting application is the creation of classes from scratch at
13101run-time. The @dfn{Byte Code Engineering Library} (BCEL) may be also useful
13102if you want to learn about the @dfn{Java Virtual Machine} (JVM) and the format
13103of Java @code{.class} files.")
13104 (properties '((upstream-name . "bcel")))
13105 (license license:asl2.0)))
13106
13107(define-public java-xerial-core
13108 (package
13109 (name "java-xerial-core")
13110 (version "2.1")
13111 (source (origin
13112 (method url-fetch)
13113 (uri (string-append "https://github.com/xerial/xerial-java/archive/"
13114 version ".tar.gz"))
13115 (file-name (string-append name "-" version ".tar.gz"))
13116 (sha256
13117 (base32
13118 "0d3g863i41bgalpa4xr3vm1h140l091n8iwgq5qvby5yivns9y8d"))))
13119 (build-system ant-build-system)
13120 (arguments
13121 `(#:jar-name "xerial-core.jar"
13122 #:source-dir "xerial-core/src/main/java"
13123 #:test-dir "xerial-core/src/test"
13124 #:phases
13125 (modify-phases %standard-phases
13126 (add-before 'build 'copy-resources
13127 (lambda _
13128 (copy-recursively "xerial-core/src/main/resources"
13129 "build/classes")
13130 #t)))))
13131 (native-inputs
13132 `(("junit" ,java-junit)
13133 ("hamcrest" ,java-hamcrest-core)))
13134 (home-page "https://github.com/xerial/xerial-java")
13135 (synopsis "Data management libraries for Java")
13136 (description "Xerial is a set of data management libraries for the Java
13137programming language. The ultimate goal of the Xerial project is to manage
13138everything as database, including class objects, text format data, data
13139streams, etc.")
13140 (license license:asl2.0)))
13141
13142(define-public java-byte-buddy-dep
13143 (package
13144 (name "java-byte-buddy-dep")
13145 (version "1.14.0")
13146 (source (origin
13147 (method git-fetch)
13148 (uri (git-reference
13149 (url "https://github.com/raphw/byte-buddy")
13150 (commit (string-append "byte-buddy-" version))))
13151 (file-name (git-file-name name version))
13152 (sha256
13153 (base32
13154 "03jmsnkjb9d3z9brqs8fc512hhs5b5iab3a5wbax9zi03dskgvh2"))))
13155 (build-system ant-build-system)
13156 (arguments
13157 `(#:jar-name "byte-buddy-dep.jar"
13158 #:source-dir "byte-buddy-dep/src/main/java"
13159 #:test-dir "byte-buddy-dep/src/test"
13160 #:tests? #f; would build java files that are incompatible with current jdk
13161 #:phases
13162 (modify-phases %standard-phases
13163 (add-before 'build 'remove-annotations
13164 (lambda _
13165 (with-directory-excursion "byte-buddy-dep/src/main/java/net/bytebuddy"
13166 (substitute* (find-files "." ".*.java")
13167 (("@EqualsAndHashCode.*") "")
13168 (("import lombok.EqualsAndHashCode;") "")
13169 (("@SuppressFBWarnings.*") "")
13170 (("import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;") ""))
13171 (substitute* '("description/type/TypeDescription.java"
13172 "dynamic/loading/ClassInjector.java")
13173 (("^ *value = .*") "")
13174 (("^ *justification = .*") ""))))))))
13175 (inputs
13176 (list java-asm-9 java-asm-commons-9 java-jsr305 java-native-access))
13177 (home-page "http://bytebuddy.net/")
13178 (synopsis "Runtime code generation for the Java virtual machine")
13179 (description "Byte Buddy is a code generation and manipulation library for
13180creating and modifying Java classes during the runtime of a Java application
13181and without the help of a compiler.")
13182 (license license:asl2.0)))
13183
13184(define-public java-powermock-reflect
13185 (package
13186 (name "java-powermock-reflect")
13187 (version "2.0.9")
13188 (source (origin
13189 (method git-fetch)
13190 (uri (git-reference
13191 (url "https://github.com/powermock/powermock")
13192 (commit (string-append "powermock-" version))))
13193 (file-name (git-file-name name version))
13194 (sha256
13195 (base32
13196 "03y8szi9iwxnv431z2mn2ivc1ak30vcvfvkyrwmfq7wq93bj2c5v"))
13197 (patches
13198 (search-patches "java-powermock-fix-java-files.patch"))))
13199 (build-system ant-build-system)
13200 (arguments
13201 `(#:jar-name "java-powermock-reflect.jar"
13202 #:source-dir "powermock-reflect/src/main/java"
13203 #:test-dir "powermock-reflect/src/test"))
13204 (inputs
13205 (list java-asm-9 java-objenesis))
13206 (native-inputs
13207 (list java-assertj java-cglib java-hamcrest-core java-junit))
13208 (home-page "https://github.com/powermock/powermock")
13209 (synopsis "Mock library extension framework")
13210 (description "PowerMock is a framework that extends other mock libraries
13211such as EasyMock with more powerful capabilities. PowerMock uses a custom
13212classloader and bytecode manipulation to enable mocking of static methods,
13213constructors, final classes and methods, private methods, removal of static
13214initializers and more. By using a custom classloader no changes need to be
13215done to the IDE or continuous integration servers which simplifies adoption.")
13216 (license license:asl2.0)))
13217
13218(define-public java-powermock-core
13219 (package
13220 (inherit java-powermock-reflect)
13221 (name "java-powermock-core")
13222 (arguments
13223 `(#:jar-name "java-powermock-core.jar"
13224 #:source-dir "powermock-core/src/main/java"
13225 #:test-dir "powermock-core/src/test"
13226 #:tests? #f; requires powermock-api
13227 #:jdk ,icedtea-8
13228 #:phases
13229 (modify-phases %standard-phases
13230 (add-before 'build 'copy-resources
13231 (lambda _
13232 (copy-recursively "powermock-core/src/main/resources"
13233 "build/classes")
13234 #t)))))
13235 (inputs
13236 (list java-asm-9
13237 java-byte-buddy-dep
13238 java-jboss-javassist
13239 java-powermock-reflect))
13240 (native-inputs
13241 (list java-assertj java-mockito-1 java-junit))))
13242
13243(define-public java-powermock-api-support
13244 (package
13245 (inherit java-powermock-reflect)
13246 (name "java-powermock-api-support")
13247 (build-system ant-build-system)
13248 (arguments
13249 `(#:jar-name "java-powermock-api-support.jar"
13250 #:jdk ,icedtea-8
13251 #:source-dir "powermock-api/powermock-api-support/src/main/java"
13252 #:tests? #f)); no tests
13253 (inputs
13254 (list java-powermock-core java-powermock-reflect))))
13255
13256(define-public java-powermock-modules-junit4-common
13257 (package
13258 (inherit java-powermock-reflect)
13259 (name "java-powermock-modules-junit4-common")
13260 (build-system ant-build-system)
13261 (arguments
13262 `(#:jar-name "java-powermock-modules-junit4-common.jar"
13263 #:jdk ,icedtea-8
13264 #:source-dir "powermock-modules/powermock-module-junit4-common/src/main/java"
13265 #:test-dir "powermock-modules/powermock-module-junit4-common/src/test"))
13266 (inputs
13267 (list java-cglib
13268 java-easymock
13269 java-hamcrest-core
13270 java-powermock-core
13271 java-powermock-reflect))))
13272
13273(define-public java-powermock-modules-junit4
13274 (package
13275 (inherit java-powermock-reflect)
13276 (name "java-powermock-modules-junit4")
13277 (build-system ant-build-system)
13278 (arguments
13279 `(#:jar-name "java-powermock-modules-junit4.jar"
13280 #:tests? #f; require easymock 4, which introduces a loop with testng
13281 #:source-dir "powermock-modules/powermock-module-junit4/src/main/java"
13282 #:test-dir "powermock-modules/powermock-module-junit4/src/test"
13283 #:phases
13284 (modify-phases %standard-phases
13285 (add-before 'build 'fix-junit-detection
13286 (lambda _
13287 ;; Our junit version is 4.12-SNAPSHOT
13288 (substitute* (find-files "powermock-modules/powermock-module-junit4"
13289 "PowerMockJUnit4MethodValidator.java")
13290 (("4.12") "4.12-SNAPSHOT"))
13291 #t)))))
13292 (inputs
13293 (list java-cglib
13294 java-powermock-core
13295 java-powermock-reflect
13296 java-powermock-modules-junit4-common))
13297 (native-inputs
13298 (list java-easymock
13299 java-hamcrest-core
13300 java-junit
13301 java-objenesis))))
13302
13303(define-public java-powermock-api-easymock
13304 (package
13305 (inherit java-powermock-reflect)
13306 (name "java-powermock-api-easymock")
13307 (build-system ant-build-system)
13308 (arguments
13309 `(#:jar-name "java-powermock-api-easymock.jar"
13310 #:jdk ,icedtea-8
13311 #:source-dir "powermock-api/powermock-api-easymock/src/main/java"
13312 #:tests? #f; no tests
13313 #:phases
13314 (modify-phases %standard-phases
13315 (add-before 'build 'fix-file
13316 (lambda _
13317 ;; FIXME: This looks wrong, but it fixes a build error.
13318 (with-directory-excursion "powermock-api/powermock-api-easymock"
13319 (substitute* "src/main/java/org/powermock/api/easymock/PowerMock.java"
13320 (("classLoader instanceof MockClassLoader") "false")
13321 (("\\(\\(MockClassLoader\\) classLoader\\).*;") ";")))
13322 #t)))))
13323 (inputs
13324 (list java-cglib
13325 java-easymock
13326 java-powermock-api-support
13327 java-powermock-core
13328 java-powermock-reflect))))
13329
13330(define-public java-jboss-jms-api-spec
13331 (package
13332 (name "java-jboss-jms-api-spec")
13333 (version "2.0")
13334 (source (origin
13335 (method url-fetch)
13336 (uri (string-append "https://github.com/jboss/jboss-jms-api_spec/"
13337 "archive/jboss-jms-api_" version
13338 "_spec-1.0.1.Final.tar.gz"))
13339 (sha256
13340 (base32
13341 "07bqblw9kq2i8q92bz70fvavq5xjfkaixl8xa0m0cypjgy82rb7m"))))
13342 (build-system ant-build-system)
13343 (arguments
13344 `(#:jar-name "java-jboss-jms-api_spec.jar"
13345 #:jdk ,icedtea-8
13346 #:source-dir "."
13347 #:tests? #f)); no tests
13348 (home-page "https://github.com/jboss/jboss-jms-api_spec")
13349 (synopsis "Java Message Service API specification")
13350 (description "Java Message Service (JMS) API is used to send messages
13351messages between two or more clients. It is a messaging standard that allows
13352application components to create, send, receive, and read messages.")
13353 ; either gpl2 only with GPL Classpath Exception, or cddl.
13354 (license (list license:gpl2 license:cddl1.0))))
13355
13356(define-public java-mail
13357 (package
13358 (name "java-mail")
13359 (version "1.6.0")
13360 (source (origin
13361 (method url-fetch)
13362 (uri (string-append "https://github.com/javaee/javamail/archive/"
13363 "JAVAMAIL-1_6_0.tar.gz"))
13364 (sha256
13365 (base32
13366 "1b4rg7fpj50ld90a71iz2m4gm3f5cnw18p3q3rbrrryjip46kx92"))))
13367 (build-system ant-build-system)
13368 (arguments
13369 `(#:jar-name "java-mail.jar"
13370 #:jdk ,icedtea-8
13371 #:source-dir "mail/src/main/java"
13372 #:test-dir "mail/src/test"
13373 #:test-exclude
13374 (list "**/CollectorFormatterTest.java"
13375 "**/CompactFormatterTest.java"
13376 "**/DurationFilterTest.java"
13377 "**/MailHandlerTest.java"
13378 "**/GetLocalAddressTest.java"
13379 ;; SSLHandshakeException: No appropriate protocol
13380 "**/WriteTimeoutSocketTest.java"
13381 ;; FIXME: both end with:
13382 ;; java.lang.ClassNotFoundException:
13383 ;; javax.mail.internet.MimeMultipartParseTest
13384 "**/MimeMultipartParseTest.java"
13385 "**/SearchTermSerializationTest.java")
13386 #:phases
13387 (modify-phases %standard-phases
13388 (add-before 'configure 'move-version.java
13389 (lambda _
13390 (copy-file "mail/src/main/resources/javax/mail/Version.java"
13391 "mail/src/main/java/javax/mail/Version.java")))
13392 (add-before 'build 'copy-resources
13393 (lambda _
13394 (copy-recursively "mail/src/main/resources/META-INF"
13395 "build/classes/META-INF"))))))
13396 (native-inputs
13397 (list java-junit java-hamcrest-core))
13398 (home-page "https://javaee.github.io/javamail/")
13399 (synopsis "Mail-related functionality in Java")
13400 (description "The JavaMail API provides a platform-independent and
13401protocol-independent framework to build mail and messaging applications.")
13402 ;; General Public License Version 2 only ("GPL") or the Common Development
13403 ;; and Distribution License("CDDL")
13404 (license (list license:cddl1.1
13405 license:gpl2)))); with classpath exception
13406
13407(define-public java-mapdb
13408 (package
13409 (name "java-mapdb")
13410 (version "1.0.9")
13411 (source (origin
13412 (method git-fetch)
13413 (uri (git-reference
13414 (url "https://github.com/jankotek/mapdb")
13415 (commit (string-append "mapdb-" version))))
13416 (file-name (git-file-name name version))
13417 (sha256
13418 (base32
13419 "1slb4h282jqvk16896lcvgm65pj3v6crcp2wvjdvad7nx7d2f1kv"))))
13420 (build-system ant-build-system)
13421 (arguments
13422 (list #:jar-name "mapdb.jar"
13423 #:source-dir "src/main/java"
13424 #:test-dir "src/test"
13425 #:test-exclude (list "**/ClosedThrowsExceptionTest.java"
13426 "**/ConcurrentMapInterfaceTest.java"
13427 "**/EngineTest.java"
13428 "**/Issue664Test.java"
13429 "**/MapInterfaceTest.java")
13430 #:phases #~(modify-phases %standard-phases
13431 (replace 'install (install-from-pom "pom.xml")))))
13432 (native-inputs (list java-junit))
13433 (home-page "https://mapdb.org/")
13434 (synopsis "Concurrent data structures")
13435 (description "MapDB provides concurrent maps, sets and queues backed by
13436disk storage or off-heap memory.")
13437 (license license:bsd-3)))
13438
13439(define-public java-mime4j-core
13440 (package
13441 (name "java-mime4j-core")
13442 (version "0.8.13")
13443 (source (origin
13444 (method url-fetch)
13445 (uri (string-append "mirror://apache/james/mime4j/" version
13446 "/james-mime4j-sources-" version ".zip"))
13447 (sha256
13448 (base32
13449 "0f1r0ywa1qdw2b227c93v3fksqp9bgll00bqw1md1894v3szm9ca"))))
13450 (build-system ant-build-system)
13451 (arguments
13452 `(#:tests? #f ;; has no tests
13453 #:source-dir "core/src/main/java"
13454 #:jar-name "apache-mime4j-core.jar"))
13455 (native-inputs
13456 (list java-commons-io-latest ;; requries >= 2.7
13457 java-junit
13458 unzip))
13459 (home-page "https://james.apache.org/mime4j/apache-mime4j-core/")
13460 (synopsis "Java stream based MIME message parser")
13461 (description "Apache James Mime4J provides a parser, MimeStreamParser, for
13462e-mail message streams in plain rfc822 and MIME format. The parser uses a
13463callback mechanism to report parsing events such as the start of an entity
13464header, the start of a body, etc. If you are familiar with the SAX XML parser
13465interface you should have no problem getting started with mime4j.")
13466 (license license:asl2.0)))
13467
13468(define-public java-jeromq
13469 (package
13470 (name "java-jeromq")
13471 (version "0.4.3")
13472 (source (origin
13473 (method git-fetch)
13474 (uri (git-reference
13475 (url "https://github.com/zeromq/jeromq")
13476 (commit (string-append "v" version))))
13477 (file-name (string-append name "-" version "-checkout"))
13478 (sha256
13479 (base32
13480 "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj"))
13481 (patches (search-patches "java-jeromq-fix-tests.patch"))))
13482 (build-system ant-build-system)
13483 (arguments
13484 `(#:jar-name "java-jeromq.jar"
13485 #:source-dir "src/main/java"
13486 #:jdk ,icedtea-8
13487 #:test-exclude
13488 (list
13489 "**/Abstract*.java"
13490 ;; Requires network
13491 "**/ZBeaconTest.java"
13492 ;; Failures
13493 "**/DealerSpecTest.java"
13494 "**/CustomDecoderTest.java"
13495 "**/CustomEncoderTest.java"
13496 "**/ConnectRidTest.java"
13497 "**/ReqSpecTest.java"
13498 "**/PushPullSpecTest.java"
13499 "**/PubSubHwmTest.java"
13500 "**/RouterSpecTest.java"
13501 "**/ProxyTest.java")))
13502 (inputs
13503 (list java-jnacl))
13504 (native-inputs
13505 `(("java-hamcrest-core" ,java-hamcrest-core)
13506 ("junit" ,java-junit)))
13507 (home-page "https://zeromq.org/bindings:java")
13508 (synopsis "Java binding for 0MQ")
13509 (description "Jeromq provides the java bindings for 0MQ.")
13510 (license license:mpl2.0)))
13511
13512(define-public java-kafka-clients
13513 (package
13514 (name "java-kafka-clients")
13515 (version "1.1.1")
13516 (source (origin
13517 (method url-fetch)
13518 (uri (string-append "mirror://apache/kafka/" version "/kafka-"
13519 version "-src.tgz"))
13520 (sha256
13521 (base32
13522 "1jn62q7z383nwhzv4ippsddf98sa1gnkszjjncj4ii3r8rzgw566"))))
13523 (build-system ant-build-system)
13524 (arguments
13525 `(#:jar-name "java-kafka-clients.jar"
13526 #:jdk ,icedtea-8
13527 #:source-dir "clients/src/main/java"
13528 #:test-dir "clients/src/test"
13529 #:test-exclude
13530 (list
13531 ;; This file does not contain a class
13532 "**/IntegrationTest.java"
13533 ;; Requires network
13534 "**/ClientUtilsTest.java"
13535 ;; This test fails on i686
13536 "**/SerializationTest.java"
13537 ;; "protocol is disabled or cipher suites are inappropriate"
13538 "**/SslTransportLayerTest.java"
13539 ;; End with errors that seem related to our powermock
13540 "**/KafkaProducerTest.java"
13541 "**/BufferPoolTest.java"
13542 ;; Undeterministic failure, seems to affect mostly ci
13543 "**/GarbageCollectedMemoryPoolTest.java")))
13544 (inputs
13545 (list java-slf4j-api java-lz4))
13546 (native-inputs
13547 (list java-bouncycastle
13548 java-cglib
13549 java-easymock
13550 java-hamcrest-all
13551 java-jboss-javassist
13552 java-junit
13553 java-objenesis
13554 java-powermock-api-easymock
13555 java-powermock-api-support
13556 java-powermock-core
13557 java-powermock-modules-junit4
13558 java-powermock-modules-junit4-common
13559 java-snappy))
13560 (home-page "https://kafka.apache.org")
13561 (synopsis "Distributed streaming platform")
13562 (description "Kafka is a distributed streaming platform, which means:
13563@itemize
13564@item it can publish and subscribe to streams of records;
13565@item it can store streams of records in a fault-tolerant way;
13566@item it can process streams of records as they occur.
13567@end itemize")
13568 ;; Either cddl or gpl2 only.
13569 (license (list license:cddl1.1; actually cddl1.1
13570 license:gpl2)))); with classpath exception
13571
13572(define-public java-jdom
13573 (package
13574 (name "java-jdom")
13575 (version "1.1.3")
13576 (source (origin
13577 (method url-fetch)
13578 (uri (string-append "http://jdom.org/dist/binary/archive/jdom-"
13579 version ".tar.gz"))
13580 (sha256
13581 (base32
13582 "07wdpm3jwwc9q38kmdw40fvbmv6jzjrkrf8m0zqs58f79a672wfl"))))
13583 (build-system ant-build-system)
13584 (arguments
13585 `(#:build-target "package"
13586 #:tests? #f; tests are run as part of the build process
13587 #:phases
13588 (modify-phases %standard-phases
13589 (replace 'install
13590 (install-jars "build")))))
13591 (home-page "http://jdom.org/")
13592 (synopsis "Access, manipulate, and output XML data")
13593 (description "Java-based solution for accessing, manipulating, and
13594outputting XML data from Java code.")
13595 (license license:bsd-4)))
13596
13597(define-public java-geronimo-xbean-reflect
13598 (package
13599 (name "java-geronimo-xbean-reflect")
13600 (version "4.5")
13601 (source (origin
13602 (method svn-fetch)
13603 (uri (svn-reference
13604 (url "https://svn.apache.org/repos/asf/geronimo/xbean/tags/xbean-4.5/")
13605 (revision 1807396)))
13606 (file-name (string-append name "-" version))
13607 (sha256
13608 (base32
13609 "0zjqmsad4xk0iar23hdyvx19nxczybd2bh0i35xrafli5cmh720k"))))
13610 (build-system ant-build-system)
13611 (arguments
13612 `(#:jar-name "geronimo-xbean-reflect.jar"
13613 #:source-dir "xbean-reflect/src/main/java"
13614 #:test-dir "xbean-reflect/src/test"
13615 #:jdk ,icedtea-8
13616 #:test-exclude
13617 (list "**/Abstract*.java" "**/AsmParameterNameLoaderTest.java"
13618 "**/ObjectRecipeTest.java" "**/ParameterNameLoaderTest.java"
13619 "**/RecipeHelperTest.java" "**/XbeanAsmParameterNameLoaderTest.java")
13620 #:phases
13621 (modify-phases %standard-phases
13622 (add-before 'build 'fix-source
13623 (lambda _
13624 (let ((dir "xbean-reflect/src/main/java/org/apache/xbean/recipe/"))
13625 ;; org.apache.xbean.asm6 is actually repackaged java-asm
13626 (substitute* (string-append dir "XbeanAsmParameterNameLoader.java")
13627 (("org.apache.xbean.asm5") "org.objectweb.asm"))
13628 #t)))
13629 (replace 'install (install-from-pom "xbean-reflect/pom.xml")))))
13630 (inputs
13631 `(("asm" ,java-asm)
13632 ("log4j" ,java-log4j-api)
13633 ("log4j-1.2" ,java-log4j-1.2-api)
13634 ("log4j-core" ,java-log4j-core)
13635 ("logging" ,java-commons-logging-minimal)))
13636 (propagated-inputs
13637 (list java-geronimo-parent-pom))
13638 (native-inputs
13639 `(("junit" ,java-junit)))
13640 (home-page "https://geronimo.apache.org/maven/xbean/3.6/xbean-reflect/")
13641 (synopsis "Dependency injection helper")
13642 (description "Xbean-reflect provides very flexible ways to create objects
13643and graphs of objects for dependency injection frameworks")
13644 (license license:asl2.0)))
13645
13646(define-public java-geronimo-genesis-2.1
13647 (package
13648 (name "java-geronimo-genesis")
13649 (version "2.1")
13650 (source (origin
13651 (method svn-fetch)
13652 (uri (svn-reference
13653 (url (string-append "https://svn.apache.org/repos/asf/"
13654 "geronimo/genesis/tags/genesis-"
13655 version))
13656 (revision 1807396)))
13657 (file-name (string-append name "-" version "-source"))
13658 (sha256
13659 (base32
13660 "1mky4zyl2xsqlgrkairaj5971byvhwk2z9bq8snsgvlr11ydc0zf"))))
13661 (build-system ant-build-system)
13662 (arguments
13663 `(#:tests? #f
13664 #:phases
13665 (modify-phases %standard-phases
13666 (delete 'configure)
13667 (delete 'build)
13668 (replace 'install
13669 (install-pom-file "pom.xml"))
13670 (add-after 'install 'install-enforcer-rules
13671 (install-pom-file "genesis-enforcer-rules/pom.xml"))
13672 (add-after 'install 'install-flava
13673 (install-pom-file "genesis-default-flava/pom.xml"))
13674 (add-after 'install 'install-packaging
13675 (install-pom-file "genesis-packaging/pom.xml"))
13676 (add-after 'install-flava 'install-flava-java4
13677 (install-pom-file "genesis-default-flava/genesis-java1.4-flava/pom.xml"))
13678 (add-after 'install-flava 'install-flava-java5
13679 (install-pom-file "genesis-default-flava/genesis-java5-flava/pom.xml"))
13680 (add-after 'install-flava 'install-flava-java6
13681 (install-pom-file "genesis-default-flava/genesis-java6-flava/pom.xml")))))
13682 (propagated-inputs
13683 `(("apache-parent-pom" ,apache-parent-pom-13)))
13684 (home-page "https://geronimo.apache.org")
13685 (synopsis "Collection of maven POM files for the Geronimo project")
13686 (description "Apache Geronimo is a server runtime. This package contains
13687only pom files used by other components in the Geronimo project.")
13688 (license license:asl2.0)))
13689
13690(define java-geronimo-parent-pom
13691 (package
13692 (inherit java-geronimo-xbean-reflect)
13693 (name "java-geronimo-parent-pom")
13694 (arguments
13695 `(#:tests? #f
13696 #:phases
13697 (modify-phases %standard-phases
13698 (delete 'configure)
13699 (delete 'build)
13700 (replace 'install
13701 (install-pom-file "pom.xml")))))
13702 (propagated-inputs
13703 `(("java-geronimo-genesis" ,java-geronimo-genesis-2.1)))))
13704
13705(define-public java-geronimo-xbean-bundleutils
13706 (package
13707 (inherit java-geronimo-xbean-reflect)
13708 (name "java-geronimo-xbean-bundleutils")
13709 (arguments
13710 `(#:jar-name "geronimo-xbean-bundleutils.jar"
13711 #:source-dir "xbean-bundleutils/src/main/java"
13712 #:test-dir "xbean-bundleutils/src/test"
13713 #:phases
13714 (modify-phases %standard-phases
13715 (add-before 'build 'fix-java
13716 (lambda _
13717 ;; We use a more recent version of osgi, so this file requires
13718 ;; more interface method implementations.
13719 (substitute* "xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java"
13720 (("import org.osgi.framework.ServiceRegistration;")
13721 "import org.osgi.framework.ServiceRegistration;
13722import org.osgi.framework.ServiceFactory;
13723import java.util.Collection;
13724import org.osgi.framework.ServiceObjects;")
13725 (("public Bundle getBundle\\(\\)")
13726 "@Override
13727public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
13728 throw new UnsupportedOperationException();
13729}
13730@Override
13731public <S> ServiceRegistration<S> registerService(Class<S> clazz,
13732 ServiceFactory<S> factory, Dictionary<String, ?> properties) {
13733 throw new UnsupportedOperationException();
13734}
13735public Bundle getBundle()"))
13736 #t)))))
13737 (inputs
13738 `(("java-slf4j" ,java-slf4j-api)
13739 ("java-asm" ,java-asm)
13740 ("java-osgi-framework" ,java-osgi-framework)
13741 ("java-eclipse-osgi" ,java-eclipse-osgi)
13742 ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)))))
13743
13744(define-public java-geronimo-xbean-asm-util
13745 (package
13746 (inherit java-geronimo-xbean-reflect)
13747 (name "java-geronimo-xbean-asm-util")
13748 (arguments
13749 `(#:jar-name "geronimo-xbean-asm-util.jar"
13750 #:source-dir "xbean-asm-util/src/main/java"
13751 #:tests? #f)); no tests
13752 (inputs
13753 (list java-asm))
13754 (native-inputs '())))
13755
13756(define-public java-geronimo-xbean-finder
13757 (package
13758 (inherit java-geronimo-xbean-reflect)
13759 (name "java-geronimo-xbean-finder")
13760 (arguments
13761 `(#:jar-name "geronimo-xbean-finder.jar"
13762 #:source-dir "xbean-finder/src/main/java"
13763 #:test-dir "xbean-finder/src/test"))
13764 (inputs
13765 (list java-slf4j-api
13766 java-asm
13767 java-geronimo-xbean-bundleutils
13768 java-geronimo-xbean-asm-util
13769 java-osgi-service-packageadmin
13770 java-osgi-framework))
13771 (native-inputs
13772 (list java-junit java-hamcrest-core))))
13773
13774(define-public java-simplevalidation-1.14.1
13775 (package
13776 (name "java-simplevalidation")
13777 (version "1.14.1")
13778 (source
13779 (origin
13780 (method git-fetch)
13781 (uri (git-reference
13782 (url "https://github.com/timboudreau/simplevalidation.git")
13783 (commit "7a9d6adbac685b34746aaa72b20a1e639b89c733")))
13784 (file-name (git-file-name "java-simplevalidation" version))
13785 (sha256
13786 (base32 "1l0h2a6brzh4qrkjjxpiijjspapd1s7wr9pqzzwgh6qisjgb176w"))
13787 (patches
13788 (search-patches "java-simplevalidation-1.14.1.patch"))
13789 (modules '((guix build utils)))
13790 (snippet
13791 '(begin
13792 (for-each delete-file (find-files "." "\\.jar$"))
13793 #t))))
13794 (build-system ant-build-system)
13795 (arguments
13796 (list
13797 #:jdk openjdk17
13798 #:tests? #f
13799 #:modules
13800 '((guix build utils)
13801 (guix build ant-build-system)
13802 (guix build java-utils)
13803 (srfi srfi-13))
13804 #:phases
13805 #~(modify-phases %standard-phases
13806 (replace 'build
13807 (lambda _
13808 (define build-root (getcwd))
13809 (define (normalize-path file)
13810 (if (string-prefix? "./" file)
13811 (substring file 2)
13812 file))
13813 (define (copy-resources source-root class-root)
13814 (with-directory-excursion source-root
13815 (for-each
13816 (lambda (file)
13817 (unless (string-suffix? ".java" file)
13818 (let* ((relative (normalize-path file))
13819 (destination
13820 (string-append class-root "/" relative)))
13821 (mkdir-p (dirname destination))
13822 (copy-file file destination))))
13823 (find-files "." ".*"))))
13824 (define (compile-tree source-root class-root classpath)
13825 (mkdir-p class-root)
13826 (copy-resources source-root class-root)
13827 (with-directory-excursion source-root
13828 (let ((sources (find-files "." "\\.java$")))
13829 (apply invoke "javac"
13830 (append
13831 (list "-d" class-root)
13832 (if classpath
13833 (list "-cp" classpath)
13834 '())
13835 sources)))))
13836 (let* ((nbstubs-classes (string-append build-root "/build/nbstubs"))
13837 (core-classes (string-append build-root "/build/core"))
13838 (swing-classes (string-append build-root "/build/swing"))
13839 (nbstubs-jar (string-append build-root
13840 "/build/nbstubs-1.14.1.jar"))
13841 (core-jar (string-append build-root
13842 "/build/simplevalidation-1.14.1.jar"))
13843 (swing-jar
13844 (string-append build-root
13845 "/build/simplevalidation-swing-1.14.1.jar"))
13846 (converter-services
13847 (string-append
13848 swing-classes
13849 "/META-INF/services/org.netbeans.validation.api.conversion.Converter")))
13850 (compile-tree "nbstubs/src" nbstubs-classes #f)
13851 (invoke "jar" "-cf" nbstubs-jar "-C" nbstubs-classes ".")
13852 (compile-tree "ValidationAPI/src" core-classes #f)
13853 (invoke "jar" "-cf" core-jar "-C" core-classes ".")
13854 (compile-tree "simplevalidation-swing/src/main/java"
13855 swing-classes
13856 (string-append core-classes ":" nbstubs-classes))
13857 (mkdir-p (dirname converter-services))
13858 (call-with-output-file converter-services
13859 (lambda (port)
13860 (for-each
13861 (lambda (line)
13862 (display line port)
13863 (newline port))
13864 '("org.netbeans.validation.api.conversion.swing.SelectedIndicesToButtonModelArrayConverter"
13865 "org.netbeans.validation.api.conversion.swing.SelectedIndicesToListSelectionModelConverter"
13866 "org.netbeans.validation.api.conversion.swing.StringToComboBoxModelConverter"
13867 "org.netbeans.validation.api.conversion.swing.StringToDocumentConverter"))))
13868 (invoke "jar" "-cf" swing-jar "-C" swing-classes ".")
13869 #t)))
13870 (replace 'install
13871 (lambda* (#:key inputs outputs #:allow-other-keys)
13872 ((install-pom-file "pom.xml")
13873 #:inputs inputs
13874 #:outputs outputs)
13875 ((install-from-pom "nbstubs/pom.xml")
13876 #:inputs inputs
13877 #:outputs outputs)
13878 ((install-from-pom "ValidationAPI/pom.xml")
13879 #:inputs inputs
13880 #:outputs outputs)
13881 ((install-from-pom "simplevalidation-swing/pom.xml")
13882 #:inputs inputs
13883 #:outputs outputs)
13884 #t)))))
13885 (home-page "https://github.com/timboudreau/simplevalidation/")
13886 (synopsis "Simple Validation libraries for Swing forms")
13887 (description
13888 "This package builds the Simple Validation core and Swing adapter
13889libraries from source.")
13890 (license license:asl2.0)))
13891
13892(define-public java-lucene-core-3.6.2
13893 (package
13894 (name "java-lucene-core")
13895 (version "3.6.2")
13896 (source
13897 (origin
13898 (method url-fetch)
13899 (uri (string-append "https://archive.apache.org/dist/lucene/solr/"
13900 version "/apache-solr-" version "-src.tgz"))
13901 (sha256
13902 (base32 "032dfpk7likiwb9pnlr518wwlyxn57i5wyp18mi32320vsprd4r0"))))
13903 (build-system ant-build-system)
13904 (arguments
13905 (list
13906 #:tests? #f
13907 #:phases
13908 #~(modify-phases %standard-phases
13909 (replace 'build
13910 (lambda _
13911 (let ((jar-file (string-append (getcwd) "/build/lucene-core-"
13912 #$version ".jar")))
13913 (mkdir-p "build")
13914 (with-directory-excursion "lucene/core"
13915 (mkdir-p "build/classes")
13916 (apply invoke "javac" "-d" "build/classes"
13917 (find-files "src/java" "\\.java$"))
13918 (invoke "jar" "-cf" jar-file "-C" "build/classes" "."))
13919 #t)))
13920 (replace 'install
13921 (install-jars "build")))))
13922 (home-page "https://lucene.apache.org/core/")
13923 (synopsis "Apache Lucene core library")
13924 (description
13925 "This package provides the Apache Lucene 3.6.2 core library, built
13926entirely from source.")
13927 (license license:asl2.0)))
13928
13929(define-public java-json-simple-1.1.1
13930 (package
13931 (name "java-json-simple")
13932 (version "1.1.1")
13933 (source
13934 (origin
13935 (method git-fetch)
13936 (uri (git-reference
13937 (url "https://github.com/fangyidong/json-simple.git")
13938 (commit "tag_release_1_1_1")))
13939 (file-name (git-file-name name version))
13940 (sha256
13941 (base32 "1c598dvms70fs6w3l1dc0z7lqq3hndd5250ciwqm8xk3zbx465kf"))))
13942 (build-system ant-build-system)
13943 (arguments
13944 (list
13945 #:tests? #f
13946 #:build-target "jar"
13947 #:phases
13948 #~(modify-phases %standard-phases
13949 (replace 'install
13950 (install-from-pom "pom.xml")))))
13951 (home-page "https://github.com/fangyidong/json-simple")
13952 (synopsis "Simple JSON toolkit for Java")
13953 (description
13954 "JSON.simple is a small JSON parser and encoder for Java.")
13955 (license license:asl2.0)))
13956
13957(define-public java-gson
13958 (package
13959 (name "java-gson")
13960 (version "2.8.2")
13961 (source (origin
13962 (method url-fetch)
13963 (uri (string-append "https://github.com/google/gson/archive/"
13964 "gson-parent-" version ".tar.gz"))
13965 (sha256
13966 (base32
13967 "1j4qnp7v046q0k48c4kyf69sxaasx2h949d3cqwsm3kzxms3x0f9"))))
13968 (build-system ant-build-system)
13969 (arguments
13970 `(#:jar-name "gson.jar"
13971 #:source-dir "gson/src/main/java"
13972 #:test-dir "gson/src/test"))
13973 (native-inputs
13974 (list java-junit java-hamcrest-core))
13975 (home-page "https://github.com/google/gson")
13976 (synopsis "Java serialization/deserialization library from/to JSON")
13977 (description "Gson is a Java library that can be used to convert Java
13978Objects into their JSON representation. It can also be used to convert a JSON
13979string to an equivalent Java object. Gson can work with arbitrary Java objects
13980including pre-existing objects that you do not have source-code of.")
13981 (license license:asl2.0)))
13982
13983;; This requires a different Java version than 2.8.2 above
13984(define-public java-gson-2.8.6
13985 (package
13986 (inherit java-gson)
13987 (name "java-gson")
13988 (version "2.8.6")
13989 (source (origin
13990 (method git-fetch)
13991 (uri (git-reference
13992 (url "https://github.com/google/gson")
13993 (commit (string-append "gson-parent-" version))))
13994 (file-name (git-file-name name version))
13995 (sha256
13996 (base32
13997 "0kk5p3vichdb0ph1lzknrcpbklgnmq455mngmjpxvvj29p3rgpk3"))))
13998 (arguments
13999 `(#:jar-name "gson.jar"
14000 #:jdk ,openjdk11
14001 #:source-dir "gson/src/main/java"
14002 #:test-dir "gson/src/test"
14003 #:phases
14004 (modify-phases %standard-phases
14005 ;; avoid Maven dependency
14006 (add-before 'build 'fill-template
14007 (lambda _
14008 (with-directory-excursion "gson/src/main"
14009 (copy-file "java-templates/com/google/gson/internal/GsonBuildConfig.java"
14010 "java/com/google/gson/internal/GsonBuildConfig.java")
14011 (substitute* "java/com/google/gson/internal/GsonBuildConfig.java"
14012 (("\\$\\{project.version\\}") ,version))))))))))
14013
14014(define-public java-hawtjni
14015 (package
14016 (name "java-hawtjni")
14017 (version "1.15")
14018 (source (origin
14019 (method url-fetch)
14020 (uri (string-append "https://github.com/fusesource/hawtjni/archive/"
14021 "hawtjni-project-" version ".tar.gz"))
14022 (sha256
14023 (base32
14024 "1bqfd732rmh6svyx17fpw9175gc9gzkcbyps2yyrf50c3zzjas6g"))))
14025 (build-system ant-build-system)
14026 (arguments
14027 `(#:jar-name "hawtjni.jar"
14028 #:source-dir "hawtjni-generator/src/main/java:hawtjni-runtime/src/main/java"
14029 #:tests? #f; no tests
14030 #:phases
14031 (modify-phases %standard-phases
14032 (add-before 'build 'build-native
14033 (lambda* (#:key inputs #:allow-other-keys)
14034 (let ((include (string-append "-I" (assoc-ref inputs "jdk") "/include/linux")))
14035 (with-directory-excursion "hawtjni-generator/src/main/resources/"
14036 (invoke "gcc" "-c" "hawtjni.c" "-o" "hawtjni.o"
14037 "-fPIC" "-O2" include)
14038 (invoke "gcc" "-c" "hawtjni-callback.c" "-o" "hawtjni-callback.o"
14039 "-fPIC" "-O2" include)
14040 (invoke "gcc" "-o" "libhawtjni.so" "-shared"
14041 "hawtjni.o" "hawtjni-callback.o")))
14042 #t))
14043 (add-after 'install 'install-native
14044 (lambda* (#:key outputs #:allow-other-keys)
14045 (let* ((out (assoc-ref outputs "out"))
14046 (lib (string-append out "/lib"))
14047 (inc (string-append out "/include")))
14048 (with-directory-excursion "hawtjni-generator/src/main/resources/"
14049 (install-file "libhawtjni.so" lib)
14050 (install-file "hawtjni.h" inc)))
14051 #t))
14052 (add-before 'install 'install-parent
14053 (install-pom-file "pom.xml"))
14054 (replace 'install
14055 (install-from-pom "hawtjni-runtime/pom.xml")))))
14056 (inputs
14057 (list java-commons-cli java-asm java-geronimo-xbean-finder))
14058 (home-page "https://fusesource.github.io/hawtjni/")
14059 (synopsis "JNI code generator")
14060 (description "HawtJNI is a code generator that produces the JNI code needed
14061to implement Java native methods. It is based on the jnigen code generator
14062that is part of the SWT Tools project.")
14063 (license license:asl2.0)))
14064
14065(define-public java-jansi-native
14066 (package
14067 (name "java-jansi-native")
14068 (version "1.7")
14069 (source (origin
14070 (method url-fetch)
14071 (uri (string-append "https://github.com/fusesource/jansi-native/"
14072 "archive/jansi-native-" version ".tar.gz"))
14073 (sha256
14074 (base32
14075 "0j2ydlgxbzbgshqkwghbxxxnbnx1mmjgd6k5fw6xfvxw1z956yqf"))))
14076 (build-system ant-build-system)
14077 (arguments
14078 `(#:jar-name "jansi-native.jar"
14079 #:source-dir "src/main/java"
14080 #:tests? #f; no tests
14081 #:phases
14082 (modify-phases %standard-phases
14083 (add-before 'build 'build-native
14084 (lambda* (#:key inputs #:allow-other-keys)
14085 ;; there are more required files for windows in windows/
14086 (with-directory-excursion "src/main/native-package/src"
14087 (substitute* "jansi_ttyname.c"
14088 (("#include \"jansi_.*") ""))
14089 (invoke "gcc" "-c" "jansi_ttyname.c" "-o" "jansi_ttyname.o"
14090 (string-append "-I" (assoc-ref inputs "java-hawtjni")
14091 "/include")
14092 (string-append "-I" (assoc-ref inputs "jdk")
14093 "/include/linux")
14094 "-fPIC" "-O2")
14095 (invoke "gcc" "-o" "libjansi.so" "-shared" "jansi_ttyname.o"))))
14096 (add-before 'build 'install-native
14097 (lambda _
14098 (let ((dir (string-append "build/classes/META-INF/native/"
14099 ,(match (%current-system)
14100 ((or "i686-linux" "armhf-linux")
14101 "linux32")
14102 ((or "x86_64-linux" "aarch64-linux"
14103 "mips64el-linux")
14104 "linux64")
14105 (_ "unknown-kernel")))))
14106 (install-file "src/main/native-package/src/libjansi.so" dir))
14107 #t))
14108 (add-after 'install 'install-native
14109 (lambda* (#:key outputs #:allow-other-keys)
14110 (install-file "src/main/native-package/src/jansi.h"
14111 (string-append (assoc-ref outputs "out") "/include"))
14112 #t))
14113 (add-before 'install 'fix-pom
14114 (lambda _
14115 ;; pom contains variables to complete name, but we don't support that
14116 (substitute* "pom.xml"
14117 (("\\$\\{platform\\}") "native"))
14118 #t))
14119 (replace 'install
14120 (install-from-pom "pom.xml")))))
14121 (propagated-inputs
14122 (list java-hawtjni))
14123 (home-page "https://fusesource.github.io/jansi/")
14124 (synopsis "Native library for jansi")
14125 (description "This package provides the native library for jansi, a small
14126Java library that allows you to use ANSI escape sequences to format your
14127console output.")
14128 (license license:asl2.0)))
14129
14130(define-public java-jansi
14131 (package
14132 (name "java-jansi")
14133 (version "2.4.0")
14134 (source (origin
14135 (method git-fetch)
14136 (uri (git-reference
14137 (url "https://github.com/fusesource/jansi")
14138 (commit (string-append "jansi-" version))))
14139 (file-name (git-file-name name version))
14140 (sha256
14141 (base32
14142 "1s6fva06990798b5fyxqzr30zwyj1byq5wrm54j2larcydaryggf"))
14143 (modules '((guix build utils)))
14144 (snippet
14145 ;; contains pre-compiled libraries
14146 '(delete-file-recursively
14147 "src/main/resources/org/fusesource/jansi/internal"))))
14148 (build-system ant-build-system)
14149 (arguments
14150 `(#:jar-name "jansi.jar"
14151 #:source-dir "src/main/java"
14152 #:test-dir "src/test"
14153 #:tests? #f; require junit 3
14154 #:phases
14155 (modify-phases %standard-phases
14156 (add-before 'build 'build-native
14157 (lambda* (#:key inputs #:allow-other-keys)
14158 (with-directory-excursion "src/main/native"
14159 (for-each
14160 (lambda (cfile)
14161 (let ((cfile (basename cfile))
14162 (ofile (string-append (basename cfile ".c") ".o")))
14163 (invoke ,(cc-for-target) "-c" cfile "-o" ofile
14164 (string-append "-I" (assoc-ref inputs "jdk")
14165 "/include/linux")
14166 "-fPIC" "-O2")))
14167 (find-files "." "\\.c$"))
14168 (apply invoke ,(cc-for-target) "-o" "libjansi.so" "-shared"
14169 (find-files "." "\\.o$")))))
14170 (add-before 'build 'install-native
14171 (lambda _
14172 (let ((dir (string-append "build/classes/org/fusesource/"
14173 "jansi/internal/native/"
14174 ,(match (or (%current-target-system) (%current-system))
14175 ("i686-linux" "Linux/x86")
14176 ("x86_64-linux" "Linux/x86_64")
14177 ("armhf-linux" "Linux/armv7")
14178 ("aarch64-linux" "Linux/arm64")
14179 ("mips64el-linux" "Linux/mips64")
14180 (_ "unknown-kernel")))))
14181 (install-file "src/main/native/libjansi.so" dir))))
14182 (add-before 'build 'copy-resources
14183 (lambda _
14184 (copy-recursively "src/main/resources" "build/classes")))
14185 (replace 'install
14186 (install-from-pom "pom.xml")))))
14187 (home-page "https://fusesource.github.io/jansi/")
14188 (synopsis "Portable ANSI escape sequences")
14189 (description "Jansi is a Java library that allows you to use ANSI escape
14190sequences to format your console output which works on every platform.")
14191 (license license:asl2.0)))
14192
14193(define-public java-jansi-1
14194 (package
14195 (inherit java-jansi)
14196 (version "1.16")
14197 (source (origin
14198 (method git-fetch)
14199 (uri (git-reference
14200 (url "https://github.com/fusesource/jansi")
14201 (commit (string-append "jansi-project-" version))))
14202 (file-name (git-file-name "jansi" version))
14203 (sha256
14204 (base32
14205 "0ikk0x352gh30b42qn1jd89xwsjj0mavrc5kms7fss15bd8vsayx"))))
14206 (arguments
14207 `(#:jar-name "jansi.jar"
14208 #:source-dir "jansi/src/main/java"
14209 #:test-dir "jansi/src/test"
14210 #:phases
14211 (modify-phases %standard-phases
14212 (add-after 'check 'clear-term
14213 (lambda _
14214 (invoke "echo" "-e" "\\e[0m")))
14215 (add-before 'install 'install-parent
14216 (install-pom-file "pom.xml"))
14217 (add-before 'install 'fix-pom
14218 (lambda _
14219 ;; pom adds jansi native versions for different platforms, but we
14220 ;; only need one, so use native instead
14221 (substitute* "jansi/pom.xml"
14222 (("windows32") "native")
14223 (("windows64") "native")
14224 (("osx") "native")
14225 (("linux32") "native")
14226 (("linux64") "native")
14227 (("freebsd32") "native")
14228 (("freebsd64") "native"))
14229 #t))
14230 (replace 'install
14231 (install-from-pom "jansi/pom.xml")))))
14232 (propagated-inputs
14233 (list java-jansi-native))
14234 (native-inputs
14235 (list java-junit java-hamcrest-core))))
14236
14237(define-public java-jboss-el-api-spec
14238 (package
14239 (name "java-jboss-el-api-spec")
14240 (version "3.0")
14241 (source (origin
14242 (method url-fetch)
14243 (uri (string-append "https://github.com/jboss/jboss-el-api_spec/"
14244 "archive/jboss-el-api_" version
14245 "_spec-1.0.7.Final.tar.gz"))
14246 (sha256
14247 (base32
14248 "1j45ljxalwlibxl7g7iv952sjxkw275m8vyxxij8l6wdd5pf0pdh"))))
14249 (build-system ant-build-system)
14250 (arguments
14251 `(#:jar-name "java-jboss-el-api_spec.jar"
14252 #:phases
14253 (modify-phases %standard-phases
14254 ;; the origin of javax.el:javax.el-api is unknown, so we use this package
14255 ;; instead, which implements the same thing. We override the pom file
14256 ;; to "rename" the package so it can be found by maven.
14257 (add-before 'install 'override-pom
14258 (generate-pom.xml "pom.xml" "javax.el" "javax.el-api" "3.0"
14259 #:name "el-api"))
14260 (replace 'install
14261 (install-from-pom "pom.xml")))))
14262 (inputs
14263 (list java-junit))
14264 (home-page "https://github.com/jboss/jboss-el-api_spec")
14265 (synopsis "JSR-341 expression language 3.0 API")
14266 (description "This package contains an implementation of the JSR-341
14267specification for the expression language 3.0. It implements an expression
14268language inspired by ECMAScript and XPath. This language is used with
14269JavaServer Pages (JSP).")
14270 ;; Either GPL2 only or CDDL.
14271 (license (list license:gpl2 license:cddl1.1))))
14272
14273(define-public java-jboss-interceptors-api-spec
14274 (package
14275 (name "java-jboss-interceptors-api-spec")
14276 (version "1.2")
14277 (source (origin
14278 (method url-fetch)
14279 (uri (string-append "https://github.com/jboss/jboss-interceptors-api_spec/"
14280 "archive/jboss-interceptors-api_" version
14281 "_spec-1.0.0.Final.tar.gz"))
14282 (sha256
14283 (base32
14284 "0wv8x0jp9a5qxlrgkhb5jdk2gr6vi87b4j4kjb8ryxiy9gn8g51z"))))
14285 (build-system ant-build-system)
14286 (arguments
14287 `(#:jar-name "java-jboss-interceptors-api_spec.jar"
14288 #:jdk ,icedtea-8
14289 #:source-dir "."
14290 #:tests? #f; no tests
14291 #:phases
14292 (modify-phases %standard-phases
14293 ;; the origin of javax.interceptor:javax.interceptor-api is unknown,
14294 ;; so we use this package instead, which implements the same thing.
14295 ;; We override the pom file to "rename" the package so it can be found
14296 ;; by maven.
14297 (add-before 'install 'override-pom
14298 (generate-pom.xml "pom.xml" "javax.interceptor" "javax.interceptor-api"
14299 "3.0" #:name "interceptor-api"))
14300 (replace 'install
14301 (install-from-pom "pom.xml")))))
14302 (home-page "https://github.com/jboss/jboss-interceptors-api_spec")
14303 (synopsis "Interceptors 1.2 API classes from JSR 318")
14304 (description "Java-jboss-interceptors-api-spec implements the Interceptors
14305API. Interceptors are used to interpose on business method invocations and
14306specific events.")
14307 ;; Either GPL2 only or CDDL.
14308 (license (list license:gpl2 license:cddl1.1))))
14309
14310(define-public java-cdi-api
14311 (package
14312 (name "java-cdi-api")
14313 (version "2.0")
14314 (source (origin
14315 (method url-fetch)
14316 (uri (string-append "https://github.com/cdi-spec/cdi/archive/"
14317 version ".tar.gz"))
14318 (file-name (string-append name "-" version ".tar.gz"))
14319 (sha256
14320 (base32
14321 "1iv8b8bp07c5kmqic14jsr868vycjv4qv02lf3pkgp9z21mnfg5y"))))
14322 (build-system ant-build-system)
14323 (arguments
14324 `(#:source-dir "api/src/main/java"
14325 #:jar-name "java-cdi-api.jar"
14326 #:test-dir "api/src/test"
14327 #:jdk ,icedtea-8
14328 #:tests? #f; Tests fail because we don't have a CDI provider yet
14329 #:phases
14330 (modify-phases %standard-phases
14331 (replace 'install
14332 (install-from-pom "api/pom.xml")))))
14333 (propagated-inputs
14334 (list java-javax-inject java-jboss-el-api-spec
14335 java-jboss-interceptors-api-spec java-weld-parent-pom))
14336 (native-inputs
14337 (list java-testng java-hamcrest-core))
14338 (home-page "https://cdi-spec.org/")
14339 (synopsis "Contexts and Dependency Injection APIs")
14340 (description "Java-cdi-api contains the required APIs for Contexts and
14341Dependency Injection (CDI).")
14342 (license license:asl2.0)))
14343
14344(define-public java-joda-convert
14345 (package
14346 (name "java-joda-convert")
14347 (version "1.9.2")
14348 (source (origin
14349 (method url-fetch)
14350 (uri (string-append "https://github.com/JodaOrg/joda-convert/archive/v"
14351 version ".tar.gz"))
14352 (file-name (string-append name "-" version ".tar.gz"))
14353 (sha256
14354 (base32
14355 "0vp346xz7dh9br4q7xazhc7hvzf76a6hf95fki9bg67q5jr0kjh7"))))
14356 (build-system ant-build-system)
14357 (arguments
14358 `(#:jar-name (string-append ,name "-" ,version ".jar")
14359 #:source-dir "src/main/java"
14360 #:test-include (list "**/Test*.java")
14361 ;; Contains only interfaces and base classes (no test)
14362 #:test-exclude (list "**/test*/**.java")))
14363 (inputs
14364 (list java-guava))
14365 (native-inputs
14366 (list java-junit java-hamcrest-core))
14367 (home-page "https://www.joda.org/joda-convert/")
14368 (synopsis "Conversion between Objects and Strings")
14369 (description "Joda-Convert provides a small set of classes to aid
14370conversion between Objects and Strings. It is not intended to tackle the
14371wider problem of Object to Object transformation.")
14372 (license license:asl2.0)))
14373
14374(define-public java-joda-time
14375 (package
14376 (name "java-joda-time")
14377 (version "2.9.9")
14378 (source (origin
14379 (method url-fetch)
14380 (uri (string-append "https://github.com/JodaOrg/joda-time/archive/v"
14381 version ".tar.gz"))
14382 (file-name (string-append name "-" version ".tar.gz"))
14383 (sha256
14384 (base32
14385 "1i9x91mi7yg2pasl0k3912f1pg46n37sps6rdb0v1gs8hj9ppwc1"))))
14386 (build-system ant-build-system)
14387 (arguments
14388 `(#:jar-name "java-joda-time.jar"
14389 #:source-dir "src/main/java"
14390 #:test-include (list "**/Test*.java")
14391 ;; There is no runnable test in these files
14392 #:test-exclude (list "**/Test*Chronology.java" "**/Test*Field.java")
14393 #:phases
14394 (modify-phases %standard-phases
14395 (add-after 'build 'build-resources
14396 (lambda _
14397 (mkdir-p "build/classes/org/joda/time/tz/data")
14398 (mkdir-p "build/classes/org/joda/time/format")
14399 ;; This will produce the following exception:
14400 ;; java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap"
14401 ;; which is normal, because it doesn't exist yet. It still generates
14402 ;; the same file as in the binary one can find on maven.
14403 (invoke "java" "-cp"
14404 (string-append "build/classes:" (getenv "CLASSPATH"))
14405 "org.joda.time.tz.ZoneInfoCompiler"
14406 "-src" "src/main/java/org/joda/time/tz/src"
14407 "-dst" "build/classes/org/joda/time/tz/data"
14408 "africa" "antarctica" "asia" "australasia"
14409 "europe" "northamerica" "southamerica"
14410 "pacificnew" "etcetera" "backward" "systemv")
14411 (for-each (lambda (f)
14412 (copy-file f (string-append
14413 "build/classes/org/joda/time/format/"
14414 (basename f))))
14415 (find-files "src/main/java/org/joda/time/format" ".*.properties"))
14416 #t))
14417 (add-before 'install 'regenerate-jar
14418 (lambda _
14419 ;; We need to regenerate the jar file to add generated data.
14420 (delete-file "build/jar/java-joda-time.jar")
14421 (invoke "ant" "jar")))
14422 (add-before 'check 'copy-test-resources
14423 (lambda _
14424 (mkdir-p "build/test-classes/org/joda/time/tz/data")
14425 (copy-file "src/test/resources/tzdata/ZoneInfoMap"
14426 "build/test-classes/org/joda/time/tz/data/ZoneInfoMap")
14427 (copy-recursively "src/test/resources" "build/test-classes")
14428 #t)))))
14429 (inputs
14430 (list java-joda-convert))
14431 (native-inputs
14432 (list java-junit java-hamcrest-core tzdata))
14433 (home-page "https://www.joda.org/joda-time/")
14434 (synopsis "Replacement for the Java date and time classes")
14435 (description "Joda-Time is a replacement for the Java date and time
14436classes prior to Java SE 8.")
14437 (license license:asl2.0)))
14438
14439(define-public java-xerces
14440 (package
14441 (name "java-xerces")
14442 (version "2.12.2")
14443 (source
14444 (origin
14445 (method url-fetch)
14446 (uri (string-append "mirror://apache/xerces/j/source/"
14447 "Xerces-J-src." version ".tar.gz"))
14448 (sha256
14449 (base32 "1s2fnfx5flmhs3q30bxdsa6vs52m6vbnqd3m4cc5r4wfr3afplbd"))
14450 (patches (search-patches
14451 "java-xerces-xjavac_taskdef.patch"
14452 "java-xerces-build_dont_unzip.patch"
14453 "java-xerces-bootclasspath.patch"))))
14454 (build-system ant-build-system)
14455 (arguments
14456 `(#:tests? #f;; Test files are not present
14457 #:test-target "test"
14458 #:jdk ,icedtea-8
14459 #:phases
14460 (modify-phases %standard-phases
14461 (add-after 'unpack 'create-build.properties
14462 (lambda* (#:key inputs #:allow-other-keys)
14463 (let ((jaxp (assoc-ref inputs "java-jaxp"))
14464 (resolver (assoc-ref inputs "java-apache-xml-commons-resolver")))
14465 (with-output-to-file "build.properties"
14466 (lambda _
14467 (format #t
14468 "jar.jaxp = ~a/share/java/jaxp.jar~@
14469 jar.apis-ext = ~a/share/java/jaxp.jar~@
14470 jar.resolver = ~a/share/java/xml-resolver.jar~%"
14471 jaxp jaxp resolver)))
14472 ;; Make xerces use our version of jaxp in tests
14473 (substitute* "build.xml"
14474 (("xml-apis.jar")
14475 (string-append jaxp "/share/java/jaxp.jar"))
14476 (("\\$\\{tools.dir\\}/\\$\\{jar.apis\\}")
14477 "${jar.apis}")))
14478 #t))
14479 (replace 'install (install-jars "build")))))
14480 (inputs
14481 (list java-apache-xml-commons-resolver java-jaxp))
14482 (home-page "https://xerces.apache.org/xerces2-j/")
14483 (synopsis "Validating XML parser for Java with DOM level 3 support")
14484 (description "The Xerces2 Java parser is the reference implementation of
14485XNI, the Xerces Native Interface, and also a fully conforming XML Schema
14486processor.
14487
14488Xerces2-J supports the following standards and APIs:
14489
14490@itemize
14491@item eXtensible Markup Language (XML) 1.0 Second Edition Recommendation
14492@item Namespaces in XML Recommendation
14493@item Document Object Model (DOM) Level 2 Core, Events, and Traversal and
14494 Range Recommendations
14495@item Simple API for XML (SAX) 2.0.1 Core and Extension
14496@item Java APIs for XML Processing (JAXP) 1.2.01
14497@item XML Schema 1.0 Structures and Datatypes Recommendations
14498@item Experimental implementation of the Document Object Model (DOM) Level 3
14499 Core and Load/Save Working Drafts
14500@item Provides a partial implementation of the XML Inclusions (XInclude) W3C
14501 Candidate Recommendation
14502@end itemize
14503
14504Xerces is now able to parse documents written according to the XML 1.1
14505Candidate Recommendation, except that it does not yet provide an option to
14506enable normalization checking as described in section 2.13 of this
14507specification. It also handles namespaces according to the XML Namespaces 1.1
14508Candidate Recommendation, and will correctly serialize XML 1.1 documents if
14509the DOM level 3 load/save API's are in use.")
14510 (license license:asl2.0)))
14511
14512(define-public java-jakarta-regexp
14513 (package
14514 (name "java-jakarta-regexp")
14515 (version "1.5")
14516 (source
14517 (origin
14518 (method url-fetch)
14519 (uri (string-append
14520 "https://archive.apache.org/dist/jakarta/regexp/jakarta-regexp-"
14521 version ".tar.gz"))
14522 (sha256
14523 (base32
14524 "0zg9rmyif48dck0cv6ynpxv23mmcsx265am1fnnxss7brgw0ms3r"))))
14525 (build-system ant-build-system)
14526 (arguments
14527 `(#:test-target "test"
14528 #:phases
14529 (modify-phases %standard-phases
14530 (replace 'install
14531 (lambda* (#:key outputs #:allow-other-keys)
14532 (let* ((out (assoc-ref outputs "out"))
14533 (out-share (string-append out "/share/java")))
14534 (mkdir-p out-share)
14535 (for-each (lambda (name)
14536 (install-file name out-share))
14537 (find-files "build" "^jakarta-regexp-.*\\.jar$"))
14538 #t))))))
14539 (home-page "https://attic.apache.org/projects/jakarta-regexp.html")
14540 (synopsis "Regular expression parser generator for Java")
14541 (description "@code{jakarta-regexp} is an old regular expression parser
14542generator for Java.")
14543 (license license:asl2.0)))
14544
14545(define-public java-jline
14546 (package
14547 (name "java-jline")
14548 (version "1.0")
14549 (source (origin
14550 (method url-fetch)
14551 (uri (string-append "https://github.com/jline/jline1/archive/jline-"
14552 version ".tar.gz"))
14553 (sha256
14554 (base32
14555 "0bi3p6vrh7a6v0fbpb6rx9plpmx5zk3lr352xzdbz2jcxg499wir"))))
14556 (build-system ant-build-system)
14557 (arguments
14558 `(#:jar-name "jline.jar"
14559 #:source-dir "src/main/java"
14560 #:test-dir "src/test"
14561 #:phases
14562 (modify-phases %standard-phases
14563 (add-before 'build 'copy-resources
14564 (lambda _
14565 (copy-recursively "src/main/resources" "build/classes")
14566 #t)))))
14567 (native-inputs
14568 (list java-junit))
14569 (home-page "https://jline.github.io")
14570 (synopsis "Console input handling library")
14571 (description "JLine is a Java library for handling console input. It is
14572similar in functionality to BSD editline and GNU readline but with additional
14573features that bring it on par with the Z shell line editor.")
14574 (license license:bsd-3)))
14575
14576(define-public java-jline-2
14577 (package
14578 (inherit java-jline)
14579 (version "2.14.5")
14580 (source (origin
14581 (method url-fetch)
14582 (uri (string-append "https://github.com/jline/jline2/archive/jline-"
14583 version ".tar.gz"))
14584 (sha256
14585 (base32
14586 "1c6qa26mf0viw8hg4jnv72s7i1qb1gh1l8rrzcdvqhqhx82rkdlf"))))
14587 (arguments
14588 `(#:jdk ,icedtea-8
14589 ,@(package-arguments java-jline)))
14590 (inputs
14591 (list java-jansi-1 java-jansi-native))
14592 (native-inputs
14593 (list java-powermock-modules-junit4
14594 java-powermock-modules-junit4-common
14595 java-powermock-api-easymock
14596 java-powermock-api-support
14597 java-powermock-core
14598 java-powermock-reflect
14599 java-easymock
14600 java-jboss-javassist
14601 java-objenesis
14602 java-hamcrest-core
14603 java-cglib
14604 java-junit
14605 java-hawtjni))))
14606
14607(define-public java-jline-terminal
14608 (package
14609 (name "java-jline-terminal")
14610 (version "3.14.1")
14611 (source (origin
14612 (method git-fetch)
14613 (uri (git-reference
14614 (url "https://github.com/jline/jline3")
14615 (commit (string-append "jline-parent-" version))))
14616 (file-name (git-file-name name version))
14617 (sha256
14618 (base32
14619 "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr"))))
14620 (build-system ant-build-system)
14621 (arguments
14622 `(#:jar-name "jline-terminal.jar"
14623 #:jdk ,openjdk11
14624 #:tests? #f; TODO: tests fail on *.caps resource lookups
14625 #:source-dir "terminal/src/main/java"
14626 #:test-dir "terminal/src/test"
14627 #:phases
14628 (modify-phases %standard-phases
14629 (add-after 'unpack 'remove-build-file
14630 (lambda _
14631 ;; Conflicts with build directory generated by ant-build-system.
14632 (delete-file "build")))
14633 (add-after 'unpack 'patch-paths
14634 (lambda* (#:key inputs #:allow-other-keys)
14635 (substitute* "terminal/src/main/java/org/jline/utils/OSUtils.java"
14636 (("= \"infocmp\"")
14637 (string-append "= \"" (assoc-ref inputs "ncurses")
14638 "/bin/infocmp\""))
14639 (("= \"(s?tty)\"" _ cmd)
14640 (string-append "= \"" (assoc-ref inputs "coreutils")
14641 "/bin/" cmd "\"")))))
14642 ;; Resources are not added to the JAR by ant-build-system.
14643 (add-after 'build 'add-resources
14644 (lambda* (#:key jar-name source-dir #:allow-other-keys)
14645 (let ((build (string-append (getcwd) "/build")))
14646 (with-directory-excursion
14647 (string-append source-dir "/../resources")
14648 (apply invoke "jar" "-uvf"
14649 (string-append build "/jar/" jar-name)
14650 (find-files ".")))))))))
14651 (inputs
14652 (list ncurses)); infocmp
14653 (home-page "https://github.com/jline/jline3")
14654 (synopsis "Java JLine Terminal API and implementations")
14655 (description "JLine is a Java library for handling console input. It is
14656similar in functionality to BSD editline and GNU readline but with additional
14657features that bring it in par with ZSH line editor. People familiar with the
14658readline/editline capabilities for modern shells (such as bash and tcsh) will
14659find most of the command editing features of JLine to be familiar.
14660
14661This package includes the @var{Terminal} API and implementations.")
14662 (license license:bsd-3)))
14663
14664(define-public java-jline-reader
14665 (package
14666 (name "java-jline-reader")
14667 (version "3.14.1")
14668 (source (origin
14669 (method git-fetch)
14670 (uri (git-reference
14671 (url "https://github.com/jline/jline3")
14672 (commit (string-append "jline-parent-" version))))
14673 (file-name (git-file-name name version))
14674 (sha256
14675 (base32
14676 "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr"))))
14677 (build-system ant-build-system)
14678 (arguments
14679 `(#:jar-name "jline-reader.jar"
14680 #:jdk ,openjdk11
14681 #:source-dir "reader/src/main/java"
14682 #:test-dir "reader/src/test"
14683 #:phases
14684 (modify-phases %standard-phases
14685 (add-before 'build 'remove-build-file
14686 (lambda _
14687 ;; conflicts with build directory generated by ant-build-system
14688 (delete-file "build"))))))
14689 (native-inputs
14690 (list java-junit java-easymock))
14691 (inputs
14692 (list java-jline-terminal))
14693 (home-page "https://github.com/jline/jline3")
14694 (synopsis "Java JLine line reader")
14695 (description "JLine is a Java library for handling console input. It is
14696similar in functionality to BSD editline and GNU readline but with additional
14697features that bring it in par with ZSH line editor. People familiar with the
14698readline/editline capabilities for modern shells (such as bash and tcsh) will
14699find most of the command editing features of JLine to be familiar.
14700
14701This package includes the line reader.")
14702 (license license:bsd-3)))
14703
14704(define-public java-xmlunit
14705 (package
14706 (name "java-xmlunit")
14707 (version "2.5.1")
14708 (source (origin
14709 (method url-fetch)
14710 (uri (string-append "https://github.com/xmlunit/xmlunit/archive/v"
14711 version ".tar.gz"))
14712 (file-name (string-append name "-" version ".tar.gz"))
14713 (sha256
14714 (base32
14715 "035rivlnmwhfqj0fzviciv0bkh1h95ps1iwnh2kjcvdbk5nccm4z"))))
14716 (build-system ant-build-system)
14717 (arguments
14718 `(#:jar-name "java-xmlunit.jar"
14719 #:source-dir "xmlunit-core/src/main/java"
14720 #:test-dir "xmlunit-core/src/test"
14721 #:phases
14722 (modify-phases %standard-phases
14723 (add-before 'check 'copy-test-resources
14724 (lambda* (#:key inputs #:allow-other-keys)
14725 (copy-recursively (assoc-ref inputs "resources") "../test-resources")
14726 #t)))))
14727 (native-inputs
14728 `(("java-junit" ,java-junit)
14729 ("java-mockito-1" ,java-mockito-1)
14730 ("java-hamcrest-all" ,java-hamcrest-all)
14731 ("java-objenesis" ,java-objenesis)
14732 ("java-cglib" ,java-cglib)
14733 ("resources"
14734 ,(origin
14735 (method git-fetch)
14736 (uri (git-reference
14737 (url "https://github.com/xmlunit/test-resources")
14738 (commit "a590d2ae865c3e0455691d76ba8eefccc2215aec")))
14739 (file-name "java-xmlunit-test-resources")
14740 (sha256
14741 (base32
14742 "0r0glj37pg5l868yjz78gckr91cs8fysxxbp9p328dssssi91agr"))))))
14743 (home-page "https://www.xmlunit.org/")
14744 (synopsis "XML output testing")
14745 (description "XMLUnit provides you with the tools to verify the XML you
14746emit is the one you want to create. It provides helpers to validate against
14747an XML Schema, assert the values of XPath queries or compare XML documents
14748against expected outcomes.")
14749 (license license:asl2.0)))
14750
14751(define-public java-xmlunit-legacy
14752 (package
14753 (inherit java-xmlunit)
14754 (name "java-xmlunit-legacy")
14755 (arguments
14756 `(#:jar-name "java-xmlunit-legacy.jar"
14757 #:source-dir "xmlunit-legacy/src/main/java"
14758 #:test-dir "xmlunit-legacy/src/test"))
14759 (inputs
14760 (list java-xmlunit java-junit))
14761 (native-inputs
14762 `(("java-mockito-1" ,java-mockito-1)))))
14763
14764(define-public java-xmlunit-matchers
14765 (package
14766 (inherit java-xmlunit)
14767 (name "java-xmlunit-matchers")
14768 (arguments
14769 `(#:jar-name "java-xmlunit-matchers.jar"
14770 #:source-dir "xmlunit-matchers/src/main/java"
14771 #:test-dir "xmlunit-matchers/src/test"
14772 #:test-exclude
14773 ;; Cannot open xsd for http://www.xmlunit.org/test-support/Book.xsd
14774 (list "**/ValidationMatcherTest.java")
14775 #:phases
14776 (modify-phases %standard-phases
14777 (add-before 'build 'copy-test-class
14778 (lambda _
14779 (copy-file "xmlunit-core/src/test/java/org/xmlunit/TestResources.java"
14780 "xmlunit-matchers/src/test/java/org/xmlunit/TestResources.java")
14781 #t))
14782 (add-before 'build 'fix-test-resources-path
14783 (lambda _
14784 (substitute* (find-files "xmlunit-matchers/src/test" ".*.java")
14785 (("../test-resources") "test-resources"))
14786 #t))
14787 (add-before 'check 'copy-test-resources
14788 (lambda* (#:key inputs #:allow-other-keys)
14789 (copy-recursively (assoc-ref inputs "resources") "test-resources")
14790 #t)))))
14791 (inputs
14792 (list java-xmlunit java-junit))))
14793
14794(define-public java-openchart2
14795 (package
14796 (name "java-openchart2")
14797 (version "1.4.3")
14798 (source (origin
14799 (method url-fetch)
14800 (uri (string-append "http://download.approximatrix.com/openchart2/"
14801 "openchart2-" version ".source.zip"))
14802 (sha256
14803 (base32
14804 "1xq96zm5r02n1blja0072jmmsifmxc40lbyfbnmcnr6mw42frh4g"))))
14805 (build-system ant-build-system)
14806 (arguments
14807 `(#:test-target "test"
14808 #:phases
14809 (modify-phases %standard-phases
14810 (add-after 'unpack 'fix-junit-errors
14811 (lambda _
14812 (with-directory-excursion "unittest/src/com/approximatrix/charting/"
14813 (substitute* '("coordsystem/ticklocator/NumericXTickLocatorTest.java"
14814 "coordsystem/ticklocator/NumericYTickLocatorTest.java"
14815 "coordsystem/ticklocator/ObjectXTickLocatorTest.java"
14816 "model/DefaultChartDataModelConstraintsTest.java"
14817 "model/MultiScatterDataModelConstraintsTest.java"
14818 "model/threedimensional/DotPlotDataModelConstraintsTest.java")
14819 (("(assertEquals[^;]+);" before _)
14820 (string-append (string-drop-right before 2) ", 1E-6);"))))
14821 #t))
14822 (replace 'install (install-jars ".")))))
14823 (native-inputs
14824 (list unzip java-junit java-hamcrest-core))
14825 (home-page "https://approximatrix.com/products/openchart2/")
14826 (synopsis "Simple plotting for Java")
14827 (description "Openchart2 provides a simple, yet powerful, interface for
14828Java programmers to create two-dimensional charts and plots. The library
14829features an assortment of graph styles, including advanced scatter plots, bar
14830graphs, and pie charts.")
14831 (license license:lgpl2.1+)))
14832
14833(define-public java-commons-httpclient
14834 (package
14835 (name "java-commons-httpclient")
14836 (version "3.1")
14837 (source (origin
14838 (method url-fetch)
14839 (uri (string-append "mirror://apache/httpcomponents/"
14840 "commons-httpclient/source/commons-httpclient-"
14841 version "-src.tar.gz"))
14842 (sha256
14843 (base32
14844 "1wlpn3cfy3d4inxy6g7wxcsa8p7sshn6aldk9y4ia3lb879rd97r"))))
14845 (build-system ant-build-system)
14846 (arguments
14847 `(#:build-target "compile"
14848 #:test-target "test"
14849 #:tests? #f; requires junit-textui (junit 3)
14850 #:phases
14851 (modify-phases %standard-phases
14852 (add-before 'build 'fix-accent
14853 (lambda _
14854 (for-each (lambda (file)
14855 (with-fluids ((%default-port-encoding "ISO-8859-1"))
14856 (substitute* file
14857 (("\\* @author Ortwin .*") "* @author Ortwin Glueck\n"))))
14858 '("src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java"
14859 "src/examples/TrivialApp.java" "src/examples/ClientApp.java"
14860 "src/test/org/apache/commons/httpclient/TestHttps.java"
14861 "src/test/org/apache/commons/httpclient/TestURIUtil2.java"))
14862 #t))
14863 (replace 'install
14864 (lambda* (#:key outputs #:allow-other-keys)
14865 (invoke "ant" "dist"
14866 (string-append "-Ddist.home=" (assoc-ref outputs "out")
14867 "/share/java"))
14868 #t)))))
14869 (propagated-inputs
14870 `(("java-commons-logging" ,java-commons-logging-minimal)
14871 ("java-commons-codec" ,java-commons-codec)))
14872 (home-page "https://hc.apache.org")
14873 (synopsis "HTTP/1.1 compliant HTTP agent implementation")
14874 (description "This package contains an HTTP/1.1 compliant HTTP agent
14875implementation. It also provides reusable components for client-side
14876authentication, HTTP state management, and HTTP connection management.")
14877 (license license:asl2.0)))
14878
14879(define-public java-commons-vfs
14880 (package
14881 (name "java-commons-vfs")
14882 (version "2.2")
14883 (source (origin
14884 (method url-fetch)
14885 (uri (string-append "mirror://apache/commons/vfs/source/"
14886 "commons-vfs2-distribution-" version "-src.tar.gz"))
14887 (file-name (string-append name "-" version ".tar.gz"))
14888 (sha256
14889 (base32
14890 "1cnq1iaghbp4cslpnvwbp83i5v234x87irssqynhwpfgw7caf1s3"))
14891 (modules '((guix build utils)))
14892 (snippet
14893 '(begin
14894 (for-each delete-file
14895 (find-files "." "\\.jar$"))
14896 #t))))
14897 (build-system ant-build-system)
14898 (arguments
14899 `(#:jar-name "commons-vfs.jar"
14900 #:source-dir "commons-vfs2/src/main/java"
14901 #:test-dir "commons-vfs2/src/test"
14902 ; FIXME: tests depend on many things: apache sshd, hadoop, ftpserver, ...
14903 #:tests? #f
14904 #:phases
14905 (modify-phases %standard-phases
14906 (add-before 'build 'remove-hadoop-and-webdav
14907 ; Remove these files as they are not required and depend on difficult
14908 ; packages.
14909 (lambda _
14910 (for-each delete-file-recursively
14911 '("commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/webdav"
14912 "commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs"))
14913 #t)))))
14914 (inputs
14915 (list java-commons-collections4
14916 java-commons-compress
14917 java-commons-httpclient
14918 java-commons-logging-minimal
14919 java-commons-net
14920 java-jsch))
14921 (home-page "https://commons.apache.org/proper/commons-vfs/")
14922 (synopsis "Java file system library")
14923 (description "Commons VFS provides a single API for accessing various
14924different file systems. It presents a uniform view of the files from various
14925different sources, such as the files on local disk, on an HTTP server, or
14926inside a Zip archive.")
14927 (license license:asl2.0)))
14928
14929(define-public java-jakarta-oro
14930 (package
14931 (name "java-jakarta-oro")
14932 (version "2.0.8")
14933 (source (origin
14934 (method url-fetch)
14935 (uri (string-append "mirror://apache/jakarta/oro/"
14936 "jakarta-oro-" version ".tar.gz"))
14937 (sha256
14938 (base32
14939 "0rpmnsskiwmsy8r0sckz5n5dbvh3vkxx8hpm177c754r8xy3qksc"))
14940 (modules '((guix build utils)))
14941 (snippet
14942 `(begin
14943 (delete-file (string-append "jakarta-oro-" ,version ".jar"))
14944 #t))))
14945 (build-system ant-build-system)
14946 (arguments
14947 `(#:build-target "package"
14948 #:make-flags (list "-DDATE" "(no recorded date for reproducibility)")
14949 #:tests? #f; tests are run as part of the build process
14950 #:phases
14951 (modify-phases %standard-phases
14952 (replace 'install
14953 (install-jars ,(string-append "jakarta-oro-" version))))))
14954 (home-page "https://jakarta.apache.org/oro/")
14955 (synopsis "Text-processing for Java")
14956 (description "The Jakarta-ORO Java classes are a set of text-processing
14957Java classes that provide Perl5 compatible regular expressions, AWK-like
14958regular expressions, glob expressions, and utility classes for performing
14959substitutions, splits, filtering filenames, etc. This library is the successor
14960of the OROMatcher, AwkTools, PerlTools, and TextTools libraries originally
14961from ORO, Inc.")
14962 (license license:asl1.1)))
14963
14964(define-public java-native-access
14965 (package
14966 (name "java-native-access")
14967 (version "4.5.1")
14968 (source (origin
14969 (method url-fetch)
14970 (uri (string-append "https://github.com/java-native-access/jna/"
14971 "archive/" version ".tar.gz"))
14972 (file-name (string-append name "-" version ".tar.gz"))
14973 (sha256
14974 (base32
14975 "0zrpzkib6b905i018a9pqlzkqinphywr6y4jwv6mwp63jjqvqkd9"))
14976 (modules '((guix build utils)))
14977 (snippet
14978 `(begin
14979 (for-each delete-file (find-files "." ".*.jar"))
14980 (delete-file-recursively "native/libffi")
14981 (delete-file-recursively "dist")
14982 #t))))
14983 (build-system ant-build-system)
14984 (arguments
14985 `(#:tests? #f; FIXME: tests require reflections.jar
14986 #:test-target "test"
14987 #:make-flags (list "-Ddynlink.native=true")
14988 #:phases
14989 (modify-phases %standard-phases
14990 (add-before 'build 'fix-build.xml
14991 (lambda* (#:key inputs #:allow-other-keys)
14992 (substitute* "build.xml"
14993 ;; Since we removed the bundled ant.jar, give the correct path
14994 (("lib/ant.jar") (search-input-file inputs "/lib/ant.jar"))
14995 ;; We removed generated native libraries. We can only rebuild one
14996 ;; so don't fail if we can't find a native library for another architecture.
14997 (("zipfileset") "zipfileset erroronmissingarchive=\"false\""))
14998 ;; Copy test dependencies
14999 (copy-file (car (find-files (assoc-ref inputs "java-junit") "jar$"))
15000 "lib/junit.jar")
15001 (copy-file (car (find-files (assoc-ref inputs "java-hamcrest-core")
15002 "jar$"))
15003 "lib/hamcrest-core.jar")
15004 ;; FIXME: once reflections.jar is built, copy it to lib/test.
15005 #t))
15006 (add-before 'build 'build-native
15007 (lambda _
15008 (invoke "ant" "-Ddynlink.native=true" "native")
15009 #t))
15010 (replace 'install
15011 (install-jars "build")))))
15012 (inputs
15013 (list libffi libx11 libxt))
15014 (native-inputs
15015 (list gcc-7 java-junit java-hamcrest-core))
15016 (home-page "https://github.com/java-native-access/jna")
15017 (synopsis "Access to native shared libraries from Java")
15018 (description "JNA provides Java programs easy access to native shared
15019libraries without writing anything but Java code - no JNI or native code is
15020required. JNA allows you to call directly into native functions using natural
15021Java method invocation.")
15022 ;; Java Native Access project (JNA) is dual-licensed under 2
15023 ;; alternative Free licenses: LGPL 2.1 or later and Apache License 2.0.
15024 (license (list
15025 license:asl2.0
15026 license:lgpl2.1+))))
15027
15028(define-public java-native-access-5.14.0
15029 (package
15030 (inherit java-native-access)
15031 (name "java-native-access")
15032 (version "5.14.0")
15033 (source
15034 (origin
15035 (method git-fetch)
15036 (uri (git-reference
15037 (url "https://github.com/java-native-access/jna.git")
15038 (commit version)))
15039 (file-name (git-file-name name version))
15040 (sha256
15041 (base32 "0blf6ka69c3zywa74fjh8gykhzn3vgbvlxzy3v9znncb2a97v6bb"))
15042 (modules '((guix build utils)))
15043 (snippet
15044 `(begin
15045 (for-each delete-file (find-files "." ".*.jar"))
15046 (delete-file-recursively "native/libffi")
15047 (delete-file-recursively "dist")))))
15048 (arguments
15049 `(#:tests? #f
15050 #:test-target "test"
15051 #:make-flags (list "-Ddynlink.native=true")
15052 #:phases
15053 (modify-phases %standard-phases
15054 (add-before 'build 'fix-build.xml
15055 (lambda* (#:key inputs #:allow-other-keys)
15056 (let ((ant-jar (search-input-file inputs "/lib/ant.jar"))
15057 (asm-jar (search-input-file inputs "/share/java/asm9.jar")))
15058 (substitute* "build.xml"
15059 (("lib/ant\\.jar") ant-jar)
15060 (("\\$lib/asm-8\\.0\\.1\\.jar") asm-jar)
15061 (("lib/asm-8\\.0\\.1\\.jar") asm-jar)
15062 (("<zipfileset") "<zipfileset erroronmissingarchive=\"false\""))
15063 (substitute* "build-ant-tools.xml"
15064 (("lib/ant\\.jar") ant-jar)
15065 (("lib/asm-8\\.0\\.1\\.jar") asm-jar)))
15066 (copy-file (car (find-files (assoc-ref inputs "java-junit") "jar$"))
15067 "lib/junit.jar")
15068 (copy-file (car (find-files (assoc-ref inputs "java-hamcrest-core")
15069 "jar$"))
15070 "lib/hamcrest-core.jar")))
15071 (add-before 'build 'build-native
15072 (lambda _
15073 (invoke "ant" "-Ddynlink.native=true" "native")))
15074 (add-before 'install 'create-pom
15075 (generate-pom.xml "pom.xml" "net.java.dev.jna"
15076 "jna-jpms" ,version))
15077 (add-before 'install 'keep-only-jna-jpms
15078 (lambda _
15079 ;; The build produces multiple jars. install-from-pom
15080 ;; expects exactly one. Remove all except jna-jpms.jar.
15081 (for-each delete-file
15082 (filter (lambda (f)
15083 (not (string-contains f "jna-jpms")))
15084 (find-files "build" "\\.jar$")))
15085 (for-each delete-file
15086 (find-files "lib" "\\.jar$"))))
15087 (replace 'install
15088 (install-from-pom "pom.xml")))))
15089 (native-inputs
15090 (modify-inputs (package-native-inputs java-native-access)
15091 (prepend java-asm-9)))))
15092
15093(define-public java-native-access-platform
15094 (package
15095 (inherit java-native-access)
15096 (name "java-native-access-platform")
15097 (arguments
15098 `(#:test-target "test"
15099 #:tests? #f; require jna-test.jar
15100 #:phases
15101 (modify-phases %standard-phases
15102 (add-before 'build 'chdir
15103 (lambda _
15104 (chdir "contrib/platform")
15105 #t))
15106 (add-after 'chdir 'fix-ant
15107 (lambda* (#:key inputs #:allow-other-keys)
15108 (substitute* "nbproject/project.properties"
15109 (("../../build/jna.jar")
15110 (search-input-file inputs "/share/java/jna.jar"))
15111 (("../../lib/hamcrest-core-.*.jar")
15112 (car (find-files (assoc-ref inputs "java-hamcrest-core")
15113 "jar$")))
15114 (("../../lib/junit.jar")
15115 (car (find-files (assoc-ref inputs "java-junit")
15116 "jar$"))))
15117 #t))
15118 (replace 'install
15119 (install-jars "dist")))))
15120 (inputs
15121 (list java-native-access))
15122 (synopsis "Cross-platform mappings for jna")
15123 (description "java-native-access-platform has cross-platform mappings
15124and mappings for a number of commonly used platform functions, including a
15125large number of Win32 mappings as well as a set of utility classes that
15126simplify native access.")))
15127
15128(define-public java-native-access-platform-5.14.0
15129 (package
15130 (inherit java-native-access-platform)
15131 (name "java-native-access-platform")
15132 (version (package-version java-native-access-5.14.0))
15133 (source (package-source java-native-access-5.14.0))
15134 (arguments
15135 `(#:build-target "jar"
15136 #:tests? #f
15137 #:modules ((guix build ant-build-system)
15138 (guix build utils)
15139 (guix build java-utils)
15140 (sxml simple))
15141 #:phases
15142 (modify-phases %standard-phases
15143 (add-before 'build 'chdir
15144 (lambda _
15145 (chdir "contrib/platform")
15146 #t))
15147 (add-after 'chdir 'fix-ant
15148 (lambda* (#:key inputs #:allow-other-keys)
15149 (let ((jna-jar (car (find-files (assoc-ref inputs "java-native-access")
15150 "jna-jpms.*\\.jar$")))
15151 (asm-jar (search-input-file inputs "/share/java/asm9.jar"))
15152 (ant-jar (search-input-file inputs "/lib/ant.jar")))
15153 (mkdir-p "../../build")
15154 (mkdir-p "../../lib")
15155 (copy-file jna-jar "../../build/jna.jar")
15156 (copy-file asm-jar "../../lib/asm-8.0.1.jar")
15157 (copy-file ant-jar "../../lib/ant.jar")
15158 (substitute* "build.xml"
15159 (("../../build/jna\\.jar") jna-jar)
15160 (("../../lib/asm-8\\.0\\.1\\.jar") asm-jar))
15161 (substitute* "../../build-ant-tools.xml"
15162 (("lib/ant\\.jar") ant-jar)
15163 (("lib/asm-8\\.0\\.1\\.jar") asm-jar))
15164 #t)))
15165 (add-before 'install 'create-pom
15166 (lambda _
15167 (call-with-output-file "pom.xml"
15168 (lambda (port)
15169 (sxml->xml
15170 `(*TOP*
15171 (*PI* xml "version=\"1.0\" encoding=\"UTF-8\"")
15172 (project
15173 (modelVersion "4.0.0")
15174 (groupId "net.java.dev.jna")
15175 (artifactId "jna-platform-jpms")
15176 (version ,,version)
15177 (dependencies
15178 (dependency
15179 (groupId "net.java.dev.jna")
15180 (artifactId "jna-jpms")
15181 (version ,,version)))))
15182 port)))))
15183 (add-before 'install 'keep-only-jna-platform-jpms
15184 (lambda _
15185 (for-each delete-file
15186 (filter (lambda (f)
15187 (not (string-contains f "jna-platform-jpms")))
15188 (append (find-files "build" "\\.jar$")
15189 (find-files "dist" "\\.jar$"))))))
15190 (replace 'install
15191 (install-from-pom "pom.xml")))))
15192 (native-inputs
15193 (modify-inputs (package-native-inputs java-native-access-platform)
15194 (prepend java-asm-9)))
15195 (inputs
15196 (list java-native-access-5.14.0))))
15197
15198(define-public java-jsch-agentproxy-core
15199 (package
15200 (name "java-jsch-agentproxy-core")
15201 (version "0.0.8")
15202 (source (origin
15203 (method url-fetch)
15204 (uri (string-append "https://github.com/ymnk/jsch-agent-proxy/archive/"
15205 version ".tar.gz"))
15206 (file-name (string-append name "-" version ".tar.gz"))
15207 (sha256
15208 (base32
15209 "02iqg6jbc1kxvfzqcg6wy9ygqxfm82bw5rf6vnswqy4y572niz4q"))))
15210 (build-system ant-build-system)
15211 (arguments
15212 `(#:jar-name "jsch-agentproxy-core.jar"
15213 #:source-dir "jsch-agent-proxy-core/src/main/java"
15214 #:tests? #f)); no tests
15215 (home-page "https://github.com/ymnk/jsch-agent-proxy")
15216 (synopsis "Core component of the proxy to ssh-agent and Pageant in Java")
15217 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15218and Pageant included Putty. It will be easily integrated into JSch, and users
15219will be allowed to use these programs for authentication.")
15220 (license license:bsd-3)))
15221
15222(define-public java-jsch-agentproxy-sshagent
15223 (package
15224 (inherit java-jsch-agentproxy-core)
15225 (name "java-jsch-agentproxy-sshagent")
15226 (arguments
15227 `(#:jar-name "jsch-agentproxy-sshagent.jar"
15228 #:source-dir "jsch-agent-proxy-sshagent/src/main/java"
15229 #:tests? #f)); no tests
15230 (inputs
15231 (list java-jsch-agentproxy-core))
15232 (synopsis "Proxy to ssh-agent")
15233 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15234and Pageant included in Putty. This component contains the code for a proxy to
15235ssh-agent.")))
15236
15237(define-public java-jsch-agentproxy-usocket-jna
15238 (package
15239 (inherit java-jsch-agentproxy-core)
15240 (name "java-jsch-agentproxy-usocket-jna")
15241 (arguments
15242 `(#:jar-name "jsch-agentproxy-usocket-jna.jar"
15243 #:source-dir "jsch-agent-proxy-usocket-jna/src/main/java"
15244 #:tests? #f)); no tests
15245 (inputs
15246 (list java-jsch-agentproxy-core java-native-access))
15247 (synopsis "USocketFactory implementation using JNA")
15248 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15249and Pageant included in Putty. This component contains an implementation of
15250USocketFactory using @dfn{JNA} (Java Native Access).")))
15251
15252(define-public java-jsch-agentproxy-pageant
15253 (package
15254 (inherit java-jsch-agentproxy-core)
15255 (name "java-jsch-agentproxy-pageant")
15256 (arguments
15257 `(#:jar-name "jsch-agentproxy-pageant.jar"
15258 #:source-dir "jsch-agent-proxy-pageant/src/main/java"
15259 #:tests? #f)); no tests
15260 (inputs
15261 (list java-jsch-agentproxy-core java-native-access
15262 java-native-access-platform))
15263 (synopsis "Proxy to pageant")
15264 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15265and Pageant included in Putty. This component contains the code for a proxy to
15266pageant.")))
15267
15268(define-public java-jsch-agentproxy-usocket-nc
15269 (package
15270 (inherit java-jsch-agentproxy-core)
15271 (name "java-jsch-agentproxy-usocket-nc")
15272 (arguments
15273 `(#:jar-name "jsch-agentproxy-usocket-nc.jar"
15274 #:source-dir "jsch-agent-proxy-usocket-nc/src/main/java"
15275 #:tests? #f)); no tests
15276 (inputs
15277 (list java-jsch-agentproxy-core))
15278 (synopsis "USocketFactory implementation using netcat")
15279 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15280and Pageant included in Putty. This component contains an implementation of
15281USocketFactory using netcat.")))
15282
15283(define-public java-jsch-agentproxy-connector-factory
15284 (package
15285 (inherit java-jsch-agentproxy-core)
15286 (name "java-jsch-agentproxy-connector-factory")
15287 (arguments
15288 `(#:jar-name "jsch-agentproxy-connector-factory.jar"
15289 #:source-dir "jsch-agent-proxy-connector-factory/src/main/java"
15290 #:tests? #f)); no tests
15291 (inputs
15292 (list java-jsch-agentproxy-core java-jsch-agentproxy-sshagent
15293 java-jsch-agentproxy-usocket-jna java-jsch-agentproxy-pageant
15294 java-jsch-agentproxy-usocket-nc))
15295 (synopsis "Connector factory for jsch agent proxy")
15296 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15297and Pageant included in Putty. This component contains a connector factory.")))
15298
15299(define-public java-jsch-agentproxy-jsch
15300 (package
15301 (inherit java-jsch-agentproxy-core)
15302 (name "java-jsch-agentproxy-jsch")
15303 (arguments
15304 `(#:jar-name "jsch-agentproxy-jsch.jar"
15305 #:source-dir "jsch-agent-proxy-jsch/src/main/java"
15306 #:tests? #f)); no tests
15307 (inputs
15308 (list java-jsch java-jsch-agentproxy-core))
15309 (synopsis "JSch integration library for agentproxy")
15310 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
15311and Pageant included in Putty. This component contains a library to use
15312jsch-agent-proxy with JSch.")))
15313
15314(define-public java-apache-ivy
15315 (package
15316 (name "java-apache-ivy")
15317 (version "2.4.0")
15318 (source (origin
15319 (method url-fetch)
15320 (uri (string-append "mirror://apache/ant/ivy/" version
15321 "/apache-ivy-" version "-src.tar.gz"))
15322 (sha256
15323 (base32
15324 "1xkfn57g2m7l6y0xdq75x5rnrgk52m9jx2xah70g3ggl8750hbr0"))
15325 (patches
15326 (search-patches
15327 "java-apache-ivy-port-to-latest-bouncycastle.patch"))))
15328 (build-system ant-build-system)
15329 (arguments
15330 `(#:jar-name "ivy.jar"
15331 #:tests? #f
15332 #:phases
15333 (modify-phases %standard-phases
15334 (add-before 'build 'remove-example
15335 (lambda _
15336 (delete-file-recursively "src/example")
15337 #t))
15338 (add-before 'build 'copy-resources
15339 (lambda _
15340 (with-directory-excursion "src/java"
15341 (for-each (lambda (file)
15342 (install-file file (string-append "../../build/classes/" (dirname file))))
15343 (append
15344 (find-files "." ".*.css")
15345 (find-files "." ".*.ent")
15346 (find-files "." ".*.html")
15347 (find-files "." ".*.properties")
15348 (find-files "." ".*.xsd")
15349 (find-files "." ".*.xsl")
15350 (find-files "." ".*.xml"))))
15351 #t))
15352 (add-before 'build 'fix-vfs
15353 (lambda _
15354 (substitute*
15355 '("src/java/org/apache/ivy/plugins/repository/vfs/VfsRepository.java"
15356 "src/java/org/apache/ivy/plugins/repository/vfs/VfsResource.java")
15357 (("import org.apache.commons.vfs") "import org.apache.commons.vfs2"))
15358 #t))
15359 (add-before 'install 'copy-manifest
15360 (lambda _
15361 (install-file "META-INF/MANIFEST.MF" "build/classes/META-INF")
15362 #t))
15363 (add-before 'install 'repack
15364 (lambda _
15365 (invoke "jar" "-cmf" "build/classes/META-INF/MANIFEST.MF" "build/jar/ivy.jar"
15366 "-C" "build/classes" ".")))
15367 (add-after 'install 'install-bin
15368 (lambda* (#:key outputs #:allow-other-keys)
15369 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
15370 (ivy (string-append bin "/ivy"))
15371 (jar (string-append (assoc-ref outputs "out") "/share/java/ivy.jar")))
15372 (mkdir-p bin)
15373 (with-output-to-file ivy
15374 (lambda _
15375 (display (string-append
15376 "#!" (which "sh") "\n"
15377 "if [[ -z $CLASSPATH ]]; then\n"
15378 " cp=\"" (getenv "CLASSPATH") ":" jar "\"\n"
15379 "else\n"
15380 " cp=\"" (getenv "CLASSPATH") ":" jar ":$CLASSPATH\"\n"
15381 "fi\n"
15382 (which "java") " -cp $cp org.apache.ivy.Main $@\n"))))
15383 (chmod ivy #o755)
15384 #t))))))
15385 (inputs
15386 (list java-bouncycastle
15387 java-commons-cli
15388 java-commons-collections
15389 java-commons-httpclient
15390 java-commons-lang
15391 java-commons-vfs
15392 java-jakarta-oro
15393 java-jsch
15394 java-jsch-agentproxy-core
15395 java-jsch-agentproxy-connector-factory
15396 java-jsch-agentproxy-jsch
15397 java-junit))
15398 (home-page "https://ant.apache.org/ivy")
15399 (synopsis "Dependency manager for the Java programming language")
15400 (description "Ivy is a tool for managing (recording, tracking, resolving
15401and reporting) project dependencies. It is characterized by the following:
15402
15403@itemize
15404@item flexibility and configurability - Ivy is essentially process agnostic
15405 and is not tied to any methodology or structure. Instead it provides the
15406 necessary flexibility and configurability to be adapted to a broad range
15407 of dependency management and build processes.
15408@item tight integration with Apache Ant - while available as a standalone tool,
15409 Ivy works particularly well with Apache Ant providing a number of
15410 powerful Ant tasks ranging from dependency resolution to dependency
15411 reporting and publication.
15412@end itemize")
15413 (license license:asl2.0)))
15414
15415(define-public java-eclipse-sisu-inject
15416 (package
15417 (name "java-eclipse-sisu-inject")
15418 (version "0.3.5")
15419 (source (origin
15420 (method git-fetch)
15421 (uri (git-reference
15422 (url "https://github.com/eclipse/sisu.inject/")
15423 (commit (string-append "releases/" version))))
15424 (file-name (git-file-name name version))
15425 (sha256
15426 (base32
15427 "1yh434b8pi8cwmpk825fbvbnkkk2cwd4gxxjaygg8i9j0q3l9zp3"))))
15428 (build-system ant-build-system)
15429 (arguments
15430 `(#:jar-name "eclipse-sisu-inject.jar"
15431 #:source-dir "org.eclipse.sisu.inject/src"
15432 #:tests? #f; no tests
15433 #:phases
15434 (modify-phases %standard-phases
15435 (replace 'install
15436 (install-from-pom "org.eclipse.sisu.inject/pom.xml")))))
15437 (propagated-inputs
15438 (list java-guice java-sisu-inject-parent-pom))
15439 (inputs
15440 (list java-guice-servlet
15441 java-javax-inject
15442 java-javaee-servletapi
15443 java-junit
15444 java-slf4j-api
15445 java-jsr305
15446 java-jsr250
15447 java-cdi-api
15448 java-osgi-framework
15449 java-osgi-util-tracker
15450 java-testng))
15451 (home-page "https://www.eclipse.org/sisu/")
15452 (synopsis "Classpath scanning, auto-binding, and dynamic auto-wiring")
15453 (description "Sisu is a modular JSR330-based container that supports
15454classpath scanning, auto-binding, and dynamic auto-wiring. Sisu uses
15455Google-Guice to perform dependency injection and provide the core JSR330
15456support, but removes the need to write explicit bindings in Guice modules.
15457Integration with other containers via the Eclipse Extension Registry and the
15458OSGi Service Registry is a goal of this project.")
15459 (license license:epl1.0)))
15460
15461(define java-sisu-inject-parent-pom
15462 (package
15463 (inherit java-eclipse-sisu-inject)
15464 (name "java-sisu-inject-parent-pom")
15465 (arguments
15466 `(#:tests? #f
15467 #:phases
15468 (modify-phases %standard-phases
15469 (delete 'configure)
15470 (delete 'build)
15471 (replace 'install
15472 (install-pom-file "pom.xml")))))
15473 (propagated-inputs '())))
15474
15475(define-public java-eclipse-sisu-plexus
15476 (package
15477 (name "java-eclipse-sisu-plexus")
15478 (version "0.3.5")
15479 (source (origin
15480 (method git-fetch)
15481 (uri (git-reference
15482 (url "https://github.com/eclipse/sisu.plexus")
15483 (commit (string-append "releases/" version))))
15484 (file-name (git-file-name name version))
15485 (sha256
15486 (base32
15487 "0lm5h0dmh41ffcwd32qnk3a87d360am36yq7168ikkyqa8jxkx28"))
15488 (modules '((guix build utils)))
15489 (snippet
15490 '(begin
15491 (for-each delete-file (find-files "." ".*.jar"))
15492 (rename-file "org.eclipse.sisu.plexus.tests/src"
15493 "org.eclipse.sisu.plexus.tests/java")
15494 #t))))
15495 (build-system ant-build-system)
15496 (arguments
15497 `(#:jar-name "eclipse-sisu-plexus.jar"
15498 #:source-dir "org.eclipse.sisu.plexus/src"
15499 #:test-dir "org.eclipse.sisu.plexus.tests"
15500 #:test-exclude
15501 (list
15502 ;; This test fails probably because we can't generate the necessary
15503 ;; meta-inf files.
15504 "**/PlexusLoggingTest.*"
15505 ;; FIXME: This test fails because of some injection error
15506 "**/PlexusRequirementTest.*")
15507 #:jdk ,icedtea-8
15508 #:phases
15509 (modify-phases %standard-phases
15510 (add-before 'build 'copy-resources
15511 (lambda _
15512 (install-file "org.eclipse.sisu.plexus/META-INF/plexus/components.xml"
15513 "build/classes/META-INF/plexus")
15514 #t))
15515 (add-before 'check 'build-test-jar
15516 (lambda _
15517 (with-directory-excursion "org.eclipse.sisu.plexus.tests/resources/component-jar/src/main/"
15518 (mkdir "build")
15519 (with-directory-excursion "java"
15520 (apply invoke "javac" "-cp"
15521 (string-append (getenv "CLASSPATH")
15522 ":../../../../../build/classes")
15523 (find-files "." ".*.java"))
15524 (for-each (lambda (file) (install-file file (string-append "../build/" file)))
15525 (find-files "." ".*.jar")))
15526 (mkdir-p "build/META-INF/plexus")
15527 (copy-file "resources/META-INF/plexus/components.xml"
15528 "build/META-INF/plexus/components.xml")
15529 (with-directory-excursion "build"
15530 (invoke "jar" "cf" "../../../component-jar-0.1.jar" ".")))
15531 (with-directory-excursion "org.eclipse.sisu.plexus.tests/"
15532 (copy-recursively "META-INF" "../build/test-classes/META-INF")
15533 (substitute* "java/org/eclipse/sisu/plexus/DefaultPlexusContainerTest.java"
15534 (("resources/component-jar")
15535 "org.eclipse.sisu.plexus.tests/resources/component-jar")))
15536 #t))
15537 (replace 'install
15538 (install-from-pom "org.eclipse.sisu.plexus/pom.xml")))))
15539 (propagated-inputs
15540 (list java-jsr250
15541 java-plexus-classworlds
15542 java-plexus-utils
15543 java-plexus-component-annotations
15544 java-cdi-api
15545 java-eclipse-sisu-inject
15546 java-sisu-plexus-parent-pom))
15547 (inputs
15548 (list java-osgi-framework
15549 java-slf4j-api
15550 java-javax-inject
15551 java-guice
15552 java-guava
15553 java-aopalliance
15554 java-cglib))
15555 (native-inputs
15556 (list java-junit))
15557 (home-page "https://www.eclipse.org/sisu/")
15558 (synopsis "Plexus support for the sisu container")
15559 (description "Sisu is a modular JSR330-based container that supports
15560classpath scanning, auto-binding, and dynamic auto-wiring. This package
15561adds Plexus support to the Sisu-Inject container.")
15562 (license license:epl1.0)))
15563
15564(define java-sisu-plexus-parent-pom
15565 (package
15566 (inherit java-eclipse-sisu-plexus)
15567 (name "java-sisu-plexus-parent-pom")
15568 (arguments
15569 `(#:tests? #f
15570 #:phases
15571 (modify-phases %standard-phases
15572 (delete 'configure)
15573 (delete 'build)
15574 (replace 'install
15575 (install-pom-file "pom.xml")))))
15576 (propagated-inputs
15577 `(("java-sonatype-oss-parent-pom-9" ,java-sonatype-oss-parent-pom-9)))))
15578
15579(define-public java-commons-compiler
15580 (package
15581 (name "java-commons-compiler")
15582 (version "3.0.8")
15583 (source (origin
15584 (method git-fetch)
15585 (uri (git-reference
15586 (url "https://github.com/janino-compiler/janino")
15587 (commit "91aa95686d1e4ca3b16a984a03a38686572331b2")))
15588 (file-name (string-append name "-" version))
15589 (sha256
15590 (base32
15591 "04hfdl59sgh20qkxzgnibvs8f9hy6n7znxwpk611y5d89977y62r"))
15592 (modules '((guix build utils)))
15593 (snippet
15594 '(begin
15595 (for-each delete-file
15596 (find-files "." "\\.jar$"))
15597 #t))))
15598 (build-system ant-build-system)
15599 (arguments
15600 `(#:jar-name "commons-compiler.jar"
15601 #:source-dir "commons-compiler/src/main"
15602 #:tests? #f)); no tests
15603 (home-page "https://github.com/janino-compiler/janino")
15604 (synopsis "Java compiler")
15605 (description "Commons-compiler contains an API for janino, including the
15606@code{IExpressionEvaluator}, @code{IScriptEvaluator}, @code{IClassBodyEvaluator}
15607and @code{ISimpleCompiler} interfaces.")
15608 (license license:bsd-3)))
15609
15610(define-public java-janino
15611 (package
15612 (inherit java-commons-compiler)
15613 (name "java-janino")
15614 (arguments
15615 `(#:jar-name "janino.jar"
15616 #:source-dir "src/main/java"
15617 #:phases
15618 (modify-phases %standard-phases
15619 (add-before 'configure 'chdir
15620 (lambda _
15621 (chdir "janino")
15622 #t)))))
15623 (inputs
15624 (list java-commons-compiler))
15625 (native-inputs
15626 (list java-junit java-hamcrest-core))
15627 (description "Janino is a Java compiler. Janino can compile a set of
15628source files to a set of class files like @code{javac}, but also compile a
15629Java expression, block, class body or source file in memory, load the bytecode
15630and execute it directly in the same JVM. @code{janino} can also be used for
15631static code analysis or code manipulation.")))
15632
15633(define-public java-logback-core
15634 (package
15635 (name "java-logback-core")
15636 (version "1.2.3")
15637 (source (origin
15638 (method git-fetch)
15639 (uri (git-reference
15640 (url "https://github.com/qos-ch/logback/")
15641 (commit (string-append "v_" version))))
15642 (file-name (git-file-name name version))
15643 (sha256
15644 (base32
15645 "055jbfpg3l5qw7pw2snkdag0gjkb4vcxfg9110cqqyc40k2nd17z"))
15646 (modules '((guix build utils)))
15647 (snippet
15648 '(delete-file-recursively "logback-access/lib"))))
15649 (build-system ant-build-system)
15650 (arguments
15651 `(#:jar-name "logback.jar"
15652 #:source-dir "src/main/java"
15653 #:test-dir "src/test"
15654 #:test-exclude
15655 ;; These tests fail with Unable to set MockitoNamingPolicy on cglib generator
15656 ;; which creates FastClasses
15657 (list "**/AllCoreTest.*"
15658 "**/AutoFlushingObjectWriterTest.*"
15659 "**/PackageTest.*"
15660 "**/ResilientOutputStreamTest.*"
15661 ;; And we still don't want to run abstract classes
15662 "**/Abstract*.*")
15663 #:phases
15664 (modify-phases %standard-phases
15665 (add-before 'configure 'chdir
15666 (lambda _ (chdir "logback-core"))))))
15667 (inputs
15668 (list java-javax-mail
15669 java-javaee-servletapi
15670 java-commons-compiler
15671 java-janino))
15672 (native-inputs
15673 (list java-junit
15674 java-hamcrest-core
15675 java-mockito-1
15676 java-cglib
15677 java-objenesis
15678 java-joda-time))
15679 (home-page "https://logback.qos.ch")
15680 (synopsis "Logging for java")
15681 (description "Logback is intended as a successor to the popular log4j project.
15682This module lays the groundwork for the other two modules.")
15683 ;; Either epl1.0 or lgpl2.1
15684 (license (list license:epl1.0
15685 license:lgpl2.1))))
15686
15687(define-public java-logback-classic
15688 (package
15689 (inherit java-logback-core)
15690 (name "java-logback-classic")
15691 (arguments
15692 `(#:jar-name "logback-classic.jar"
15693 #:source-dir "src/main/java"
15694 #:test-dir "src/test"
15695 #:tests? #f; tests require more packages: h2, greenmail, hsql, subethamail, slf4j, log4j, felix
15696 #:jdk ,icedtea-8
15697 #:phases
15698 (modify-phases %standard-phases
15699 (add-before 'configure 'chdir
15700 (lambda _
15701 (chdir "logback-classic")
15702 #t))
15703 (replace 'build
15704 (lambda* (#:key inputs #:allow-other-keys)
15705 (mkdir-p "build/classes")
15706 (setenv "CLASSPATH"
15707 (string-join
15708 (apply append (map (lambda (input)
15709 (find-files (assoc-ref inputs input)
15710 ".*.jar"))
15711 '("java-logback-core" "java-slf4j-api"
15712 "java-commons-compiler" "java-javaee-servletapi"
15713 "groovy")))
15714 ":"))
15715 (apply invoke "groovyc" "-d" "build/classes" "-j"
15716 (find-files "src/main/" ".*\\.(groovy|java)$"))
15717 (invoke "ant" "jar")
15718 #t)))))
15719 (inputs
15720 (modify-inputs inputs
15721 (prepend java-logback-core java-slf4j-api)))
15722 (native-inputs
15723 (list groovy))
15724 (description "Logback is intended as a successor to the popular log4j project.
15725This module can be assimilated to a significantly improved version of log4j.
15726Moreover, @code{logback-classic} natively implements the slf4j API so that you
15727can readily switch back and forth between logback and other logging frameworks
15728such as log4j or @code{java.util.logging} (JUL).")))
15729
15730(define-public java-jgit
15731 (package
15732 (name "java-jgit")
15733 (version "4.7.0.201704051617-r")
15734 (source (origin
15735 (method url-fetch)
15736 (uri (string-append "https://repo1.maven.org/maven2/"
15737 "org/eclipse/jgit/org.eclipse.jgit/"
15738 version "/org.eclipse.jgit-"
15739 version "-sources.jar"))
15740 (sha256
15741 (base32
15742 "13ii4jn02ynzq6i7gsyi21k2i94jpc85wf6bcm31q4cyvzv0mk4k"))))
15743 (build-system ant-build-system)
15744 (arguments
15745 `(#:tests? #f ; There are no tests to run.
15746 #:jar-name "jgit.jar"
15747 ;; JGit must be built with a JDK supporting Java 8.
15748 #:jdk ,icedtea-8
15749 ;; Target our older default JDK.
15750 #:make-flags (list "-Dtarget=1.7")
15751 #:phases
15752 (modify-phases %standard-phases
15753 ;; The jar file generated by the default build.xml does not include
15754 ;; the text properties files, so we need to add them.
15755 (add-after 'build 'add-properties
15756 (lambda* (#:key jar-name #:allow-other-keys)
15757 (with-directory-excursion "src"
15758 (apply invoke "jar" "-uf"
15759 (string-append "../build/jar/" jar-name)
15760 (find-files "." "\\.properties$")))
15761 #t)))))
15762 (inputs
15763 (list java-classpathx-servletapi java-javaewah java-jsch
15764 java-slf4j-api))
15765 (home-page "https://eclipse.org/jgit/")
15766 (synopsis "Java library implementing the Git version control system")
15767 (description "JGit is a lightweight, pure Java library implementing the
15768Git version control system, providing repository access routines, support for
15769network protocols, and core version control algorithms.")
15770 (license license:edl1.0)))
15771
15772;; For axoloti.
15773(define-public java-jgit-4.2
15774 (package (inherit java-jgit)
15775 (version "4.2.0.201601211800-r")
15776 (source (origin
15777 (method url-fetch)
15778 (uri (string-append "https://repo1.maven.org/maven2/"
15779 "org/eclipse/jgit/org.eclipse.jgit/"
15780 version "/org.eclipse.jgit-"
15781 version "-sources.jar"))
15782 (sha256
15783 (base32
15784 "15gm537iivhnzlkjym4x3wn5jqdjdragsw9pdpzqqg21nrc817mm"))))
15785 (build-system ant-build-system)
15786 (arguments
15787 (substitute-keyword-arguments (package-arguments java-jgit)
15788 ((#:phases phases)
15789 `(modify-phases ,phases
15790 (add-after 'unpack 'use-latest-javaewah-API
15791 (lambda _
15792 (substitute* "src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java"
15793 (("wordinbits") "WORD_IN_BITS"))))))))
15794 (inputs
15795 (list java-javaewah java-jsch java-slf4j-api))))
15796
15797(define-public java-jgit-7
15798 (package
15799 (name "java-jgit")
15800 (version "7.0.0.202409031743-r")
15801 (source (origin
15802 (method url-fetch)
15803 (uri (string-append "https://repo1.maven.org/maven2/"
15804 "org/eclipse/jgit/org.eclipse.jgit/"
15805 version "/org.eclipse.jgit-"
15806 version "-sources.jar"))
15807 (sha256
15808 (base32
15809 "0hdl11cbb6zy39zw4jpg0ip00nikilw7dajrqky6d3l18khjby5k"))))
15810 (build-system ant-build-system)
15811 (arguments
15812 `(#:tests? #f ; sources jar has no tests
15813 #:jar-name "jgit.jar"
15814 #:jdk ,openjdk17
15815 #:modules ((guix build ant-build-system)
15816 (guix build utils)
15817 (guix build java-utils)
15818 (srfi srfi-1))
15819 #:phases
15820 (modify-phases %standard-phases
15821 (add-after 'build 'add-properties
15822 (lambda* (#:key jar-name #:allow-other-keys)
15823 (with-directory-excursion "src"
15824 (apply invoke "jar" "-uf"
15825 (string-append "../build/jar/" jar-name)
15826 (find-files "." "\\.properties$")))
15827 (let* ((pkgs (delete-duplicates
15828 (filter-map
15829 (lambda (f)
15830 (let* ((d (dirname f))
15831 (d (if (string-prefix? "./" d)
15832 (substring d 2)
15833 d)))
15834 (and (not (string-null? d))
15835 (not (string=? d "."))
15836 (string-map
15837 (lambda (c)
15838 (if (char=? c #\/) #\. c))
15839 d))))
15840 (with-directory-excursion "build/classes"
15841 (find-files "." "\\.class$")))))
15842 (export-pkg (string-join (sort pkgs string<?) ",")))
15843 ;; Write manifest with continuation lines for long values.
15844 ;; Manifest spec: max 72 bytes per line, continuation
15845 ;; lines start with a single space.
15846 (call-with-output-file "osgi-manifest.mf"
15847 (lambda (port)
15848 (for-each
15849 (lambda (line)
15850 (let loop ((s line))
15851 (if (<= (string-length s) 70)
15852 (begin (display s port) (newline port))
15853 (begin (display (substring s 0 70) port)
15854 (newline port)
15855 (loop (string-append
15856 " " (substring s 70)))))))
15857 (list
15858 "Bundle-ManifestVersion: 2"
15859 "Bundle-SymbolicName: org.eclipse.jgit"
15860 (string-append "Bundle-Version: " ,version)
15861 (string-append "Export-Package: " export-pkg)
15862 (string-append
15863 "Import-Package: com.googlecode.javaewah,"
15864 "javax.crypto,javax.management,javax.net.ssl,"
15865 "org.apache.commons.codec.digest,"
15866 "org.slf4j,org.xml.sax,org.xml.sax.helpers")))
15867 (newline port))))
15868 (invoke "jar" "ufm" (string-append "build/jar/" jar-name)
15869 "osgi-manifest.mf")))
15870 (replace 'install
15871 (install-from-pom
15872 "src/META-INF/maven/org.eclipse.jgit/org.eclipse.jgit/pom.xml")))))
15873 (inputs
15874 (list java-commons-codec java-javaewah-1.2.3 java-slf4j-api))
15875 (home-page "https://eclipse.org/jgit/")
15876 (synopsis "Java library implementing the Git version control system")
15877 (description "JGit is a lightweight, pure Java library implementing the
15878Git version control system, providing repository access routines, support for
15879network protocols, and core version control algorithms.")
15880 (license license:edl1.0)))
15881
15882(define-public java-jgit-ssh-jsch-7
15883 (package
15884 (name "java-jgit-ssh-jsch")
15885 (version "7.0.0.202409031743-r")
15886 (source (origin
15887 (method url-fetch)
15888 (uri (string-append "https://repo1.maven.org/maven2/"
15889 "org/eclipse/jgit/org.eclipse.jgit.ssh.jsch/"
15890 version "/org.eclipse.jgit.ssh.jsch-"
15891 version "-sources.jar"))
15892 (sha256
15893 (base32
15894 "1vb3zkd2iz6bpz2nq8xxi5d5jdb8hy8jq7gka2ck22azm9bb6p94"))))
15895 (build-system ant-build-system)
15896 (arguments
15897 `(#:tests? #f ; sources jar has no tests
15898 #:jar-name "jgit-ssh-jsch.jar"
15899 #:jdk ,openjdk17
15900 #:phases
15901 (modify-phases %standard-phases
15902 (add-after 'build 'add-osgi-manifest
15903 (lambda _
15904 ;; The NetBeans wrapper module has an empty jar target and
15905 ;; relies on Bundle-SymbolicName from the Maven Central jar.
15906 (call-with-output-file "osgi-manifest.mf"
15907 (lambda (port)
15908 (display (string-append
15909 "Bundle-ManifestVersion: 2\n"
15910 "Bundle-SymbolicName: org.eclipse.jgit.ssh.jsch\n"
15911 "Bundle-Version: " ,version "\n"
15912 "Export-Package: org.eclipse.jgit.transport.ssh"
15913 ".jsch\n"
15914 "Import-Package: com.jcraft.jsch,"
15915 "org.eclipse.jgit.errors,"
15916 "org.eclipse.jgit.internal,"
15917 "org.eclipse.jgit.internal.transport.ssh,"
15918 "org.eclipse.jgit.nls,"
15919 "org.eclipse.jgit.transport,"
15920 "org.eclipse.jgit.util,"
15921 "org.eclipse.jgit.util.io,"
15922 "org.slf4j\n")
15923 port)))
15924 (invoke "jar" "ufm" "build/jar/jgit-ssh-jsch.jar"
15925 "osgi-manifest.mf")))
15926 (replace 'install
15927 (install-from-pom
15928 "src/META-INF/maven/org.eclipse.jgit/org.eclipse.jgit.ssh.jsch/pom.xml")))))
15929 (inputs
15930 (list java-jgit-7 java-jsch-0.1.72 java-jzlib-1.1.3 java-slf4j-api))
15931 (home-page "https://eclipse.org/jgit/")
15932 (synopsis "SSH support for JGit using JSch")
15933 (description "This package provides SSH transport support for JGit
15934using the JSch library.")
15935 (license license:edl1.0)))
15936
15937(define-public java-jgit-gpg-bc-7
15938 (package
15939 (name "java-jgit-gpg-bc")
15940 (version "7.0.0.202409031743-r")
15941 (source (origin
15942 (method url-fetch)
15943 (uri (string-append "https://repo1.maven.org/maven2/"
15944 "org/eclipse/jgit/org.eclipse.jgit.gpg.bc/"
15945 version "/org.eclipse.jgit.gpg.bc-"
15946 version "-sources.jar"))
15947 (sha256
15948 (base32
15949 "1123x1i19h3a674mc44csdx7spn5qh6qk3klkfih4am9ak81w27n"))))
15950 (build-system ant-build-system)
15951 (arguments
15952 `(#:tests? #f
15953 #:jar-name "jgit-gpg-bc.jar"
15954 #:jdk ,openjdk17
15955 #:phases
15956 (modify-phases %standard-phases
15957 (add-after 'build 'add-osgi-manifest
15958 (lambda _
15959 (call-with-output-file "osgi-manifest.mf"
15960 (lambda (port)
15961 (display (string-append
15962 "Bundle-ManifestVersion: 2\n"
15963 "Bundle-SymbolicName: org.eclipse.jgit.gpg.bc\n"
15964 "Bundle-Version: " ,version "\n"
15965 "Export-Package: org.eclipse.jgit.gpg.bc.internal\n"
15966 "Import-Package: org.bouncycastle.asn1,"
15967 "org.bouncycastle.bcpg,"
15968 "org.bouncycastle.gpg,"
15969 "org.bouncycastle.gpg.keybox,"
15970 "org.bouncycastle.openpgp,"
15971 "org.bouncycastle.openpgp.operator,"
15972 "org.bouncycastle.openpgp.operator.jcajce,"
15973 "org.bouncycastle.util.encoders,"
15974 "org.eclipse.jgit.api.errors,"
15975 "org.eclipse.jgit.lib,"
15976 "org.eclipse.jgit.nls,"
15977 "org.eclipse.jgit.transport,"
15978 "org.eclipse.jgit.util,"
15979 "org.slf4j\n")
15980 port)))
15981 (invoke "jar" "ufm" "build/jar/jgit-gpg-bc.jar"
15982 "osgi-manifest.mf")))
15983 (replace 'install
15984 (install-from-pom
15985 "src/META-INF/maven/org.eclipse.jgit/org.eclipse.jgit.gpg.bc/pom.xml")))))
15986 (inputs
15987 (list java-bouncycastle-1.77 java-jgit-7 java-slf4j-api))
15988 (native-inputs (list unzip))
15989 (home-page "https://eclipse.org/jgit/")
15990 (synopsis "GPG support for JGit using Bouncy Castle")
15991 (description "This package provides GPG commit signing support for
15992JGit using the Bouncy Castle cryptographic library.")
15993 (license license:edl1.0)))
15994
15995(define-public abcl
15996 (package
15997 (name "abcl")
15998 (version "1.9.3")
15999 (source
16000 (origin
16001 (method url-fetch)
16002 (uri (string-append "https://abcl.org/releases/"
16003 version "/abcl-src-" version ".tar.gz"))
16004 (sha256
16005 (base32
16006 "1zxjpwv98bq2yd5qg08sbkajj17m7b8xmzqhw296161s7lia215v"))
16007 (patches
16008 (search-patches
16009 "abcl-fix-build-xml.patch"))))
16010 (build-system ant-build-system)
16011 (native-inputs
16012 (list java-junit))
16013 (arguments
16014 `(#:build-target "abcl.jar"
16015 #:test-target "abcl.test"
16016 #:phases
16017 (modify-phases %standard-phases
16018 (replace 'install
16019 (lambda* (#:key outputs #:allow-other-keys)
16020 (let ((share (string-append (assoc-ref outputs "out")
16021 "/share/java/"))
16022 (bin (string-append (assoc-ref outputs "out")
16023 "/bin/")))
16024 (mkdir-p share)
16025 (install-file "dist/abcl.jar" share)
16026 (install-file "dist/abcl-contrib.jar" share)
16027 (mkdir-p bin)
16028 (with-output-to-file (string-append bin "abcl")
16029 (lambda _
16030 (let ((classpath (string-append
16031 share "abcl.jar"
16032 ":"
16033 share "abcl-contrib.jar")))
16034 (display (string-append
16035 "#!" (which "bash") "\n"
16036 "if [[ -z $CLASSPATH ]]; then\n"
16037 " cp=\"" classpath "\"\n"
16038 "else\n"
16039 " cp=\"" classpath ":$CLASSPATH\"\n"
16040 "fi\n"
16041 "exec " (which "java")
16042 " -cp \"$cp\" org.armedbear.lisp.Main \"$@\"\n")))))
16043 (chmod (string-append bin "abcl") #o755)
16044 #t))))))
16045 (home-page "https://abcl.org/")
16046 (synopsis "Common Lisp Implementation on the JVM")
16047 (description
16048 "@dfn{Armed Bear Common Lisp} (ABCL) is a full implementation of the Common
16049Lisp language featuring both an interpreter and a compiler, running in the
16050JVM. It supports JSR-223 (Java scripting API): it can be a scripting engine
16051in any Java application. Additionally, it can be used to implement (parts of)
16052the application using Java to Lisp integration APIs.")
16053 (native-search-paths
16054 (list (search-path-specification
16055 (variable "XDG_DATA_DIRS")
16056 (files '("share")))))
16057 (license (list license:gpl2+
16058 ;; named-readtables is released under 3 clause BSD
16059 license:bsd-3
16060 ;; jfli is released under CPL 1.0
16061 license:cpl1.0))))
16062
16063(define-public java-jsonp-api
16064 (package
16065 (name "java-jsonp-api")
16066 (version "1.1.6")
16067 (source (origin
16068 (method git-fetch)
16069 (uri (git-reference
16070 (url "https://github.com/eclipse-ee4j/jsonp")
16071 (commit (string-append "1.1-" version "-RELEASE"))))
16072 (file-name (git-file-name name version))
16073 (sha256
16074 (base32
16075 "0zrj03hkr3jdmqlb4ipjr37cqpp2q2814qpmxi7srlwpdqs0ibgc"))))
16076 (build-system ant-build-system)
16077 (arguments
16078 `(#:jar-name "jsonp-api.jar"
16079 #:tests? #f
16080 #:source-dir "api/src/main/java"
16081 #:test-dir "api/src/test"))
16082 (home-page "https://eclipse-ee4j.github.io/jsonp/")
16083 (synopsis "JSON Processing in Java")
16084 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
16085parse, generate, transform and query) JSON messages. It produces and
16086consumes JSON text in a streaming fashion (similar to StAX API for XML)
16087and allows building a Java object model for JSON text using API classes
16088(similar to DOM API for XML).")
16089 ;; either gpl2 only with classpath exception, or epl2.0.
16090 (license (list license:gpl2
16091 license:epl2.0))))
16092
16093(define-public java-jsonp-impl
16094 (package
16095 (inherit java-jsonp-api)
16096 (name "java-jsonp-impl")
16097 (arguments
16098 `(#:jar-name "jsonp-impl.jar"
16099 #:tests? #f
16100 #:source-dir "impl/src/main/java"
16101 #:test-dir "impl/src/test"
16102 #:phases
16103 (modify-phases %standard-phases
16104 (add-before 'build 'copy-resources
16105 (lambda _
16106 (copy-recursively
16107 "impl/src/main/resources/"
16108 "build/classes")
16109 #t)))))
16110 (propagated-inputs
16111 (list java-jsonp-api))
16112 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
16113parse, generate, transform and query) JSON messages. This package contains
16114a reference implementation of that API.")))
16115
16116(define-public java-jakarta-json
16117 (package
16118 (name "java-jakarta-json")
16119 (version "2.1.3")
16120 (source (origin
16121 (method git-fetch)
16122 (uri (git-reference
16123 (url "https://github.com/jakartaee/jsonp-api")
16124 (commit (string-append version "-RELEASE"))))
16125 (file-name (git-file-name name version))
16126 (sha256
16127 (base32
16128 "1q600harqfhlf763l75j4fx7ai7ybp7ga06aiky2a2hg8mhz0s5f"))))
16129 (build-system ant-build-system)
16130 (arguments
16131 `(#:jar-name "jakarta-json.jar"
16132 #:source-dir "api/src/main/java"
16133 #:tests? #f; no tests
16134 #:jdk ,openjdk11))
16135 (home-page "https://github.com/jakartaee/jsonp-api")
16136 (synopsis "Portable API for JSON handling in Java")
16137 (description "This project contains API and Compatible Implementation of
16138Jakarta JSON Processing specification. Jakarta JSON Processing provides
16139portable APIs to parse, generate, transform, and query JSON documents.")
16140 ;; with classpath exception
16141 (license license:epl2.0)))
16142
16143(define-public java-parsson
16144 (package
16145 (name "java-parsson")
16146 (version "1.1.5")
16147 (source (origin
16148 (method git-fetch)
16149 (uri (git-reference
16150 (url "https://github.com/eclipse-ee4j/parsson")
16151 (commit version)))
16152 (file-name (git-file-name name version))
16153 (sha256
16154 (base32
16155 "06vvr6qv1ihnk212gdxg4x0sd61lgxk7wf062s7gym5k2h7fms0p"))))
16156 (build-system ant-build-system)
16157 (arguments
16158 `(#:jar-name "parsson.jar"
16159 #:source-dir "impl/src/main/java"
16160 #:test-dir "impl/src/test"
16161 #:use-java-modules? #t
16162 #:jdk ,openjdk11
16163 #:phases
16164 (modify-phases %standard-phases
16165 (add-after 'unpack 'copy-resources
16166 (lambda _
16167 (copy-recursively "impl/src/main/resources"
16168 "build/classes"))))))
16169 (inputs
16170 (list java-jakarta-json))
16171 (native-inputs
16172 (list java-junit))
16173 (home-page "https://github.com/eclipse-ee4j/parsson")
16174 (synopsis "Implementation of Jakarta JSON API")
16175 (description "Eclipse Parsson is an implementation of the Jakarta JSON
16176Processing specification.")
16177 ;; with classpath exception
16178 (license license:epl2.0)))
16179
16180(define-public java-jakarta-activation-api
16181 (package
16182 (name "java-jakarta-activation-api")
16183 (version "2.1.4")
16184 (source (origin
16185 (method git-fetch)
16186 (uri (git-reference
16187 (url "https://github.com/jakartaee/jaf-api")
16188 (commit version)))
16189 (file-name (git-file-name name version))
16190 (sha256
16191 (base32
16192 "125bf475cb0mdyhn1lj3c8gbwngbd28x10vnknq86zrc1vq4m6gx"))))
16193 (build-system ant-build-system)
16194 (arguments
16195 `(#:jar-name "jakarta-activation-api.jar"
16196 #:source-dir "api/src/main/java"
16197 #:tests? #f ;; has no tests
16198 #:jdk ,openjdk11))
16199 (home-page "https://github.com/jakartaee/jaf-api")
16200 (synopsis "Collection of Java activation")
16201 (description "Jakarta Activation lets you take advantage of standard
16202services to: determine the type of arbitrary piece of data; encapsulate access
16203to it; discover the operations available on it; and instantiate the
16204appropriate bean to perform the operation(s).")
16205 (license license:bsd-3)))
16206
16207(define-public java-jakarta-annotations-api
16208 (package
16209 (name "java-jakarta-annotations-api")
16210 (version "2.1.1")
16211 (source (origin
16212 (method git-fetch)
16213 (uri (git-reference
16214 (url "https://github.com/jakartaee/common-annotations-api")
16215 (commit version)))
16216 (file-name (git-file-name name version))
16217 (sha256
16218 (base32
16219 "0xq2n2pijal5p75vl9dz10i6hhdmaxw5q8j3aza717xkpxxby9p6"))))
16220 (build-system ant-build-system)
16221 (arguments
16222 `(#:jar-name "jakarta-annotations-api.jar"
16223 #:source-dir "api/src/main/java"
16224 #:tests? #f; no tests
16225 #:jdk ,openjdk11))
16226 (home-page "https://github.com/jakartaee/common-annotations-api")
16227 (synopsis "Collection of Java annotations")
16228 (description "Jakarta Annotations defines a collection of annotations
16229representing common semantic concepts that enable a declarative style of
16230programming that applies across a variety of Java technologies.")
16231 ;; with classpath exception
16232 (license (list license:epl2.0
16233 license:gpl2))))
16234
16235(define-public java-xmp
16236 (package
16237 (name "java-xmp")
16238 (version "5.1.3")
16239 (source (origin
16240 (method url-fetch)
16241 (uri (string-append "http://download.macromedia.com/pub/developer"
16242 "/xmp/sdk/XMPCoreJava-" version ".zip"))
16243 (sha256
16244 (base32
16245 "14nai2mmsg7l5ya2y5mx4w4lr1az3sk2fjz6hiy4zdrsavgvl1g7"))))
16246 (build-system ant-build-system)
16247 (arguments
16248 `(#:build-target "build"
16249 #:tests? #f; no tests
16250 #:phases
16251 (modify-phases %standard-phases
16252 (add-after 'unpack 'chdir
16253 (lambda _
16254 (chdir "XMPCore")
16255 #t))
16256 (add-before 'build 'fix-timestamp
16257 (lambda _
16258 (substitute* "build.xml"
16259 (("\\$\\{BuildDate\\}") "1970 Jan 01 00:00:00-GMT"))
16260 #t))
16261 (replace 'install
16262 (install-jars "."))
16263 (add-after 'install 'install-doc
16264 (lambda* (#:key outputs #:allow-other-keys)
16265 (copy-recursively
16266 "docs"
16267 (string-append (assoc-ref outputs "out") "/share/doc/java-xmp"))
16268 #t)))))
16269 (native-inputs
16270 (list unzip))
16271 (home-page "https://www.adobe.com/devnet/xmp.html")
16272 (synopsis "Extensible Metadat Platform (XMP) support in Java")
16273 (description "Adobe's Extensible Metadata Platform (XMP) is a labeling
16274technology that allows you to embed data about a file, known as metadata,
16275into the file itself. The XMP Toolkit for Java is based on the C++ XMPCore
16276library and the API is similar.")
16277 (license license:bsd-3)))
16278
16279(define-public java-args4j
16280 (package
16281 (name "java-args4j")
16282 (version "2.33")
16283 (source (origin
16284 (method git-fetch)
16285 (uri (git-reference
16286 (url "https://github.com/kohsuke/args4j")
16287 (commit (string-append "args4j-site-" version))))
16288 (file-name (git-file-name name version))
16289 (sha256
16290 (base32
16291 "0w061fg65qrsm1a0lz0vyprsyidj31krjb459qi2lw0y78xza26s"))))
16292 (build-system ant-build-system)
16293 (arguments
16294 `(#:jar-name "args4j.jar"
16295 #:source-dir "args4j/src"
16296 #:test-dir "args4j/test"
16297 #:test-exclude
16298 (list "**/ExampleTest.*"
16299 "**/ExternalConfiguredTest.*" ; fails to find a file
16300 ;; We still don't want to run abstract classes
16301 "**/Abstract*.*")
16302 #:phases
16303 (modify-phases %standard-phases
16304 (add-before 'check 'fix-test-dir
16305 (lambda _
16306 (substitute* "build.xml"
16307 (("/java\">") "\">"))
16308 #t))
16309 (add-before 'build 'copy-resources
16310 (lambda _
16311 (let ((from-prefix "args4j/src/org/kohsuke/args4j/")
16312 (to-prefix "build/classes/org/kohsuke/args4j/"))
16313 (for-each (lambda (f)
16314 (install-file
16315 (string-append from-prefix f)
16316 (string-append to-prefix (dirname f))))
16317 (list "Messages.properties"
16318 "Messages_de.properties"
16319 "Messages_en.properties"
16320 "Messages_ru.properties"
16321 "spi/Messages.properties"
16322 "spi/Messages_de.properties"
16323 "spi/Messages_en.properties"
16324 "spi/Messages_ru.properties")))
16325 #t)))))
16326 (native-inputs
16327 (list java-junit))
16328 (home-page "https://args4j.kohsuke.org/")
16329 (synopsis "Command line parser library")
16330 (description "Args4j is a small Java class library that makes it easy to
16331parse command line options/arguments in your CUI application.")
16332 (license license:expat)))
16333
16334(define-public java-argparse4j
16335 (package
16336 (name "java-argparse4j")
16337 (version "0.9.0")
16338 (source (origin
16339 (method git-fetch)
16340 (uri (git-reference
16341 (url "https://github.com/argparse4j/argparse4j")
16342 (commit (string-append "argparse4j-" version))))
16343 (file-name (git-file-name name version))
16344 (sha256
16345 (base32
16346 "1i0j3zs1ln48n0g8a90vqbv6528mcswhzys6252yp0c8w1ai64fb"))))
16347 (build-system ant-build-system)
16348 (arguments
16349 (list #:jar-name "java-argparse4j.jar"
16350 #:source-dir "main/src/main/"
16351 #:test-dir "main/src/test/"
16352 #:jdk openjdk11
16353 #:phases #~(modify-phases %standard-phases
16354 (add-after 'unpack 'copy-resources
16355 (lambda _
16356 (copy-recursively "main/src/test/resources"
16357 "target/test-classes")
16358 (copy-recursively "main/src/main/resources"
16359 "build/classes")))
16360 (replace 'install
16361 (install-from-pom "pom.xml")))))
16362 (inputs (list java-junit))
16363 (home-page "https://argparse4j.github.io/")
16364 (synopsis "Java command-line argument parser library")
16365 (description "Argparse4j is a command line argument parser library for
16366Java based on Python's @code{argparse} module.")
16367 (license license:expat)))
16368
16369(define-public java-metadata-extractor
16370 (package
16371 (name "java-metadata-extractor")
16372 (version "2.19.0")
16373 (source (origin
16374 (method git-fetch)
16375 (uri (git-reference
16376 (url "https://github.com/drewnoakes/metadata-extractor")
16377 (commit version)))
16378 (file-name (git-file-name name version))
16379 (sha256
16380 (base32
16381 "1axnw47n06a116g8bml2l6rxx92grxp935gspyhz4pz868m7hrna"))))
16382 (build-system ant-build-system)
16383 (arguments
16384 `(#:jar-name "metadata-extractor.jar"
16385 #:source-dir "Source"
16386 #:test-dir "Tests"
16387 #:phases
16388 (modify-phases %standard-phases
16389 (add-before 'build 'fix-xmp-path
16390 (lambda _
16391 ;; This version of metadata-extractor depends on java-xmp 6, which
16392 ;; is non-free. These changes allow using java-xmp 5, which is
16393 ;; the last free-software version of java-xmp.
16394 (substitute* (find-files "." ".*.java")
16395 (("com.adobe.internal.xmp") "com.adobe.xmp"))
16396 (substitute* "Source/com/drew/metadata/xmp/XmpReader.java"
16397 (("\\.setXMPNodesToLimit.*") ";"))
16398 ;; Test failure, most likely because we use a different java-xmp
16399 ;; version.
16400 (delete-file "Tests/com/drew/metadata/xmp/XmpReaderTest.java")))
16401 (add-before 'check 'fix-test-dir
16402 (lambda _
16403 (substitute* "build.xml"
16404 (("/java\">") "\">"))
16405 #t)))))
16406 (propagated-inputs
16407 (list java-xmp))
16408 (native-inputs
16409 (list java-hamcrest-core java-junit))
16410 (home-page "https://github.com/drewnoakes/metadata-extractor")
16411 (synopsis "Extract metadata from image and video files")
16412 (description "Metadata-extractor is a straightforward Java library for
16413reading metadata from image files. It is able to read metadata in Exif,
16414IPTC, XMP, ICC and more formats.")
16415 (license license:asl2.0)))
16416
16417(define-public java-svg-salamander
16418 (package
16419 (name "java-svg-salamander")
16420 (version "1.1.2")
16421 (source (origin
16422 (method git-fetch)
16423 (uri (git-reference
16424 (url "https://github.com/blackears/svgSalamander")
16425 (commit (string-append "v" version))))
16426 (file-name (git-file-name name version))
16427 (sha256
16428 (base32
16429 "1zv3kjdkf6iqf02x6ln76254y634j2ji448y706a65lsbfjmmicf"))
16430 (modules '((guix build utils)))
16431 (snippet
16432 '(begin
16433 (for-each delete-file (find-files "." ".*.jar"))
16434 #t))
16435 (patches
16436 (search-patches "java-svg-salamander-Fix-non-det.patch"))))
16437 (build-system ant-build-system)
16438 (arguments
16439 `(#:tests? #f; no tests
16440 #:phases
16441 (modify-phases %standard-phases
16442 (add-after 'unpack 'chdir
16443 (lambda _
16444 (chdir "svg-core")
16445 #t))
16446 (add-before 'build 'copy-jars
16447 (lambda* (#:key inputs #:allow-other-keys)
16448 (copy-file (car (find-files (assoc-ref inputs "javacc") "\\.jar$"))
16449 "../libraries/javacc.jar")
16450 (copy-file (car (find-files (assoc-ref inputs "ant") "ant\\.jar$"))
16451 "../libraries/ant.jar")
16452 #t))
16453 (replace 'install
16454 (install-jars "dist")))))
16455 (native-inputs
16456 (list javacc))
16457 (home-page "https://github.com/blackears/svgSalamander")
16458 (synopsis "SVG engine for Java")
16459 (description "SVG Salamander is an SVG engine for Java that's designed
16460to be small, fast, and allow programmers to use it with a minimum of fuss.
16461It's in particular targeted for making it easy to integrate SVG into Java
16462games and making it much easier for artists to design 2D game content - from
16463rich interactive menus to charts and graphcs to complex animations.")
16464 (license license:bsd-2)))
16465
16466(define-public java-jboss-transaction-api-spec
16467 (package
16468 (name "java-jboss-transaction-api-spec")
16469 (version "1.2+1.1.1")
16470 (source (origin
16471 (method git-fetch)
16472 (uri (git-reference
16473 (url "https://github.com/jboss/jboss-transaction-api_spec")
16474 (commit "jboss-transaction-api_1.2_spec-1.1.1.Final")))
16475 (file-name (git-file-name name version))
16476 (sha256
16477 (base32
16478 "1xbfq5hvb86izflydxrqqv3k26c1ba2m0ap6m97shqrsdi9by4wy"))))
16479 (build-system ant-build-system)
16480 (arguments
16481 `(#:jar-name "java-jboss-transaction-api_spec.jar"
16482 #:source-dir "src/main/java"
16483 #:tests? #f)); no tests
16484 (inputs
16485 (list java-cdi-api java-jboss-interceptors-api-spec))
16486 (home-page "https://github.com/jboss/jboss-transaction-api_spec")
16487 (synopsis "Generic transaction management API in Java")
16488 (description "Java-jboss-transaction-api-spec implements the Transactions
16489API. A transaction is a unit of work containing one or more operations
16490involving one or more shared resources having ACID (Atomicity, Consistency,
16491Isolation and Durability) properties.")
16492 ;; either gpl2 only with classpath exception or cddl.
16493 (license (list license:gpl2 license:cddl1.0))))
16494
16495(define-public java-picocli
16496 (package
16497 (name "java-picocli")
16498 (version "4.3.2")
16499 (source (origin
16500 (method git-fetch)
16501 (uri (git-reference
16502 (url "https://github.com/remkop/picocli")
16503 (commit (string-append "v" version))))
16504 (file-name (git-file-name name version))
16505 (sha256
16506 (base32
16507 "1sxp6rxjfgjd98ly14b3d15dvxkm5wg4g46w12jyhmr0kmkaca3c"))))
16508 (build-system ant-build-system)
16509 (arguments
16510 `(#:jar-name "picocli.jar"
16511 #:source-dir "src/main/java"
16512 ;; Tests require missing dependencies (junitparams, system-rules)
16513 #:tests? #f))
16514 (home-page "https://picocli.info")
16515 (synopsis "REPL for the JVM")
16516 (description "Picocli is a framework for building command line applications
16517for the JVM. It supports colors, autocompletion, subcommands, and more. Written
16518in Java, usable from Groovy, Kotlin, Scala, etc.")
16519 (license license:asl2.0)))
16520
16521(define-public java-pj
16522 (package
16523 (name "java-pj")
16524 (version "20150107")
16525 (source (origin
16526 (method url-fetch)
16527 (uri (string-append "https://www.cs.rit.edu/~ark/pjsrc"
16528 version ".jar"))
16529 (sha256
16530 (base32
16531 "078xwaivl2qqjc07r0vk6kzpqlcb1bcar80p8r5qigh34hpr86d3"))
16532 (modules '((guix build utils)))
16533 (snippet
16534 '(for-each delete-file
16535 (find-files "." "\\.class$")))))
16536 (build-system ant-build-system)
16537 (arguments
16538 (list
16539 #:tests? #false ;there are none
16540 #:phases
16541 #~(modify-phases %standard-phases
16542 (add-after 'unpack 'chdir
16543 (lambda _ (chdir "src/pj")))
16544 (add-after 'chdir 'patch-source-directory
16545 (lambda _
16546 (substitute* "compile"
16547 (("SRCDIR1=/home/ark/public_html/pj/lib")
16548 (string-append "SRCDIR1=" (getcwd) "/lib")))))
16549 (replace 'build
16550 (lambda _
16551 (invoke "bash" "./compile" "linux")
16552 (with-directory-excursion "lib"
16553 (apply invoke "jar" "cf" (string-append "pj" #$version ".jar")
16554 (find-files "." "\\.class$")))))
16555 (replace 'install (install-jars ".")))))
16556 (home-page "https://www.cs.rit.edu/~ark/pj.shtml")
16557 (synopsis "Parallel programming in Java")
16558 (description "Parallel Java (PJ) is an API and middleware for parallel
16559programming in 100% Java on shared memory multiprocessor (SMP) parallel
16560computers, cluster parallel computers, and hybrid SMP cluster parallel
16561computers.")
16562 (license license:gpl3+)))
16563
16564(define-public java-jetbrains-annotations
16565 (package
16566 (name "java-jetbrains-annotations")
16567 (version "19.0.0")
16568 (source (origin
16569 (method git-fetch)
16570 (uri (git-reference
16571 (url "https://github.com/JetBrains/java-annotations")
16572 (commit version)))
16573 (file-name (git-file-name name version))
16574 (sha256
16575 (base32
16576 "0z6i1xs60cd5ffz23c49sq68wn5mphhs3xpar1n93ppama2ng80v"))))
16577 (build-system ant-build-system)
16578 (arguments
16579 `(#:jar-name "jetbrains-annotations.jar"
16580 #:source-dir "common/src/main/java:java8/src/main/java"
16581 #:tests? #f)); no tests
16582 (home-page "https://github.com/JetBrains/java-annotations")
16583 (synopsis "Annotations for Java and other JVM languages")
16584 (description "This package contains a set of Java annotations which can be
16585used in JVM-based languages. They serve as an additional documentation and
16586can be interpreted by IDEs and static analysis tools to improve code analysis.")
16587 (license license:expat)))
16588
16589(define-public java-javaparser
16590 (package
16591 (name "java-javaparser")
16592 (version "3.16.1")
16593 (source (origin
16594 (method git-fetch)
16595 (uri (git-reference
16596 (url "https://github.com/javaparser/javaparser")
16597 (commit (string-append "javaparser-parent-" version))))
16598 (file-name (git-file-name name version))
16599 (sha256
16600 (base32
16601 "1a4jk12ffa31fa0y8vda0739vpfj1206p0nha842b7bixbvwamv9"))
16602 (modules '((guix build utils)))
16603 (snippet
16604 '(begin
16605 (for-each delete-file
16606 (find-files "." "\\.jar$"))
16607 #t))))
16608 (build-system ant-build-system)
16609 (arguments
16610 `(#:tests? #f; tests require jbehave and junit5
16611 #:phases
16612 (modify-phases %standard-phases
16613 (add-before 'build 'fill-template
16614 (lambda _
16615 (with-directory-excursion "javaparser-core/src/main"
16616 (copy-file "java-templates/com/github/javaparser/JavaParserBuild.java"
16617 "java/com/github/javaparser/JavaParserBuild.java")
16618 (substitute* "java/com/github/javaparser/JavaParserBuild.java"
16619 (("\\$\\{project.version\\}") ,version)
16620 (("\\$\\{project.name\\}") "javaparser")
16621 (("\\$\\{project.build.finalName\\}") "javaparser")
16622 (("\\$\\{maven.version\\}") "fake")
16623 (("\\$\\{maven.build.version\\}") "fake")
16624 (("\\$\\{build.timestamp\\}") "0")
16625 (("\\$\\{java.vendor\\}") "Guix")
16626 (("\\$\\{java.vendor.url\\}") "https://gnu.org/software/guix")
16627 (("\\$\\{java.version\\}") "1.8")
16628 (("\\$\\{os.arch\\}") "any")
16629 (("\\$\\{os.name\\}") "Guix")
16630 (("\\$\\{os.version\\}") "not available")))
16631 #t))
16632 (add-before 'build 'generate-javacc
16633 (lambda _
16634 (with-directory-excursion "javaparser-core/src/main/java"
16635 (invoke "java" "javacc" "../javacc/java.jj"))
16636 #t))
16637 (add-before 'build 'copy-javacc-support
16638 (lambda _
16639 (with-directory-excursion "javaparser-core/src/main"
16640 (copy-recursively "javacc-support" "java"))
16641 #t))
16642 (replace 'build
16643 (lambda _
16644 (define (build name)
16645 (format #t "Building ~a~%" name)
16646 (delete-file-recursively "build/classes")
16647 (mkdir-p "build/classes")
16648 (apply invoke "javac"
16649 "-cp" (string-append (getenv "CLASSPATH") ":"
16650 (string-join (find-files "build/jar" ".")
16651 ":"))
16652 "-d" "build/classes"
16653 (find-files (string-append name "/src/main/java")
16654 ".*.java"))
16655 (invoke "jar" "-cf" (string-append "build/jar/" name ".jar")
16656 "-C" "build/classes" "."))
16657 (mkdir-p "build/classes")
16658 (mkdir-p "build/test-classes")
16659 (mkdir-p "build/jar")
16660 (build "javaparser-core")
16661 (build "javaparser-core-serialization")
16662 (build "javaparser-core-generators")
16663 (build "javaparser-core-metamodel-generator")
16664 (build "javaparser-symbol-solver-core")
16665 #t))
16666 (replace 'install
16667 (install-jars "build/jar")))))
16668 (inputs
16669 (list java-guava java-jboss-javassist java-jsonp-api))
16670 (native-inputs
16671 (list javacc))
16672 (home-page "https://javaparser.org/")
16673 (synopsis "Parser for Java")
16674 (description
16675 "This project contains a set of libraries implementing a Java 1.0 - Java
1667611 Parser with advanced analysis functionalities.")
16677 (license (list
16678 ;; either lgpl or asl
16679 license:lgpl3+
16680 license:asl2.0))))
16681
16682(define-public tla2tools
16683 ;; This package was originally based on the "v1.8.0" tag, but that merely
16684 ;; points to the moving master branch. That might be because the ‘latest
16685 ;; release’ at GitHub is currently 1.7.1. We'll see! For now, rather than
16686 ;; downgrade to 1.7.1 proper, use the commit that we originally dubbed 1.8.0.
16687 (let* ((release "1.7.1")
16688 (revision "0")
16689 (commit "6932e19083fc6df42473464857fc1280cb5aaecc"))
16690 (package
16691 (name "tla2tools")
16692 (version (git-version release revision commit))
16693 (source (origin
16694 (method git-fetch)
16695 (uri (git-reference
16696 (url "https://github.com/tlaplus/tlaplus")
16697 (commit commit)))
16698 (file-name (git-file-name name version))
16699 (sha256
16700 (base32
16701 "1hhx8gmn81k8qrkx4p7ppinmygxga9fqffd626wkvhjgg2ky8lhs"))
16702 (patches
16703 (search-patches "tla2tools-build-xml.patch"))
16704 (modules '((guix build utils)))
16705 (snippet
16706 '(begin
16707 ;; Remove packaged libraries (see 'replace-libs below)
16708 (for-each delete-file (find-files "." ".*.jar$"))))))
16709 (build-system ant-build-system)
16710 (arguments
16711 (let* ((tlatools "tlatools/org.lamport.tlatools/")
16712 (build-xml (string-append tlatools "customBuild.xml")))
16713 `(#:jdk ,openjdk11
16714 #:modules ((guix build ant-build-system)
16715 (guix build utils)
16716 (ice-9 match)
16717 (srfi srfi-26))
16718 #:make-flags '("-f" ,build-xml)
16719 #:phases
16720 (modify-phases %standard-phases
16721 ;; Replace packed libs with references to jars in store
16722 (add-after 'unpack 'replace-libs
16723 (lambda* (#:key inputs #:allow-other-keys)
16724 (define (input-jar input)
16725 (car (find-files (assoc-ref inputs input) "\\.jar$")))
16726 (for-each
16727 (match-lambda
16728 ((file . input)
16729 (symlink (input-jar input)
16730 (string-append ,tlatools "/lib/" file))))
16731 '(("gson/gson-2.8.6.jar" . "java-gson")
16732 ("javax.mail/mailapi-1.6.3.jar" . "java-javax-mail")
16733 ("jline/jline-terminal-3.14.1.jar" . "java-jline-terminal")
16734 ("jline/jline-reader-3.14.1.jar" . "java-jline-reader")
16735 ("lsp/org.eclipse.lsp4j.debug-0.10.0.jar" .
16736 "java-eclipse-lsp4j-debug")
16737 ("lsp/org.eclipse.lsp4j.jsonrpc-0.10.0.jar" .
16738 "java-eclipse-lsp4j-jsonrpc")
16739 ("lsp/org.eclipse.lsp4j.jsonrpc.debug-0.10.0.jar" .
16740 "java-eclipse-lsp4j-jsonrpc-debug")
16741 ("junit-4.12.jar" . "java-junit")
16742 ("easymock-3.3.1.jar" . "java-easymock")))
16743 ;; Retain a tiny subset of the original X-Git-*
16744 ;; manifest values just to aid in debugging.
16745 (substitute* ,build-xml
16746 (("\\$\\{git.tag\\}") (string-append "v" ,release)))))
16747 (add-before 'check 'prepare-tests
16748 (lambda _
16749 ;; The pcal tests write to .cfg files.
16750 (for-each (cut chmod <> #o644)
16751 (find-files (string-append ,tlatools
16752 "/test-model/pcal")
16753 "\\.cfg$"))))
16754 (replace 'install
16755 (lambda* (#:key inputs outputs #:allow-other-keys)
16756 (let* ((share (string-append (assoc-ref outputs "out") "/share/java"))
16757 (jar-name "tla2tools.jar"); set in project.properties
16758 (jar (string-append ,tlatools
16759 "/dist/" jar-name))
16760 (java-cp (string-append share "/" jar-name))
16761 (bin (string-append (assoc-ref outputs "out") "/bin"))
16762 (java (search-input-file inputs "/bin/java")))
16763 (install-file jar share)
16764 (mkdir-p bin)
16765 ;; Generate wrapper scripts for bin/, which invoke common
16766 ;; commands within tla2tools.jar. Users can still invoke
16767 ;; tla2tools.jar for the rest.
16768 (for-each
16769 (match-lambda
16770 ((wrapper . class)
16771 (let ((file (string-append bin "/" wrapper)))
16772 (begin
16773 (with-output-to-file file
16774 (lambda _
16775 (display
16776 (string-append
16777 "#!/bin/sh\n"
16778 java " -XX:+UseParallelGC " " -cp " java-cp " " class " \"$@\""))))
16779 (chmod file #o755)))))
16780 ;; bin/wrapper . java-class
16781 '(("pcal" . "pcal.trans")
16782 ("tlatex" . "tla2tex.TLA")
16783 ("tla2sany" . "tla2sany.SANY")
16784 ("tlc2" . "tlc2.TLC")
16785 ("tlc2-repl" . "tlc2.REPL"))))))))))
16786 (native-inputs
16787 (list java-junit java-easymock))
16788 (inputs
16789 (list java-javax-mail
16790 java-gson-2.8.6
16791 java-jline-terminal
16792 java-jline-reader
16793 java-eclipse-lsp4j-jsonrpc
16794 java-eclipse-lsp4j-jsonrpc-debug
16795 java-eclipse-lsp4j-debug))
16796 (home-page "https://lamport.azurewebsites.net/tla/tools.html")
16797 (synopsis "TLA+ tools (analyzer, TLC, TLATeX, PlusCal translator)")
16798 (description "TLA+ is a high-level language for modeling programs and
16799systems---especially concurrent and distributed ones. It's based on the idea
16800that the best way to describe things precisely is with simple
16801mathematics. TLA+ and its tools are useful for eliminating fundamental design
16802errors, which are hard to find and expensive to correct in code.
16803
16804The following TLA+ tools are available in this distribution:
16805
16806@itemize
16807@item The Syntactic Analyzer: A parser and syntax checker for
16808 TLA+ specifications;
16809@item TLC: A model checker and simulator for a subclass of \"executable\" TLA+
16810 specifications;
16811@item TLATeX: A program for typesetting TLA+ specifications;
16812@item Beta test versions of 1-3 for the TLA+2 language; and
16813@item The PlusCal translator.
16814@end itemize")
16815 (license license:expat))))
16816
16817;;;
16818;;; Avoid adding new packages to the end of this file. To reduce the chances
16819;;; of a merge conflict, place them above by existing packages with similar
16820;;; functionality or similar names.
16821;;;