projects/guix·blob next-master · refs

14797 lines · 616.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015-2024 Ricardo Wurmus <[email protected]>
3;;; Copyright © 2016 Leo Famulari <[email protected]>
4;;; Copyright © 2016, 2017 Roel Janssen <[email protected]>
5;;; Copyright © 2017, 2019, 2021 Carlo Zancanaro <[email protected]>
6;;; Copyright © 2017-2022 Julien Lepiller <[email protected]>
7;;; Copyright © 2017 Thomas Danckaert <[email protected]>
8;;; Copyright © 2016, 2017, 2018 Alex Vong <[email protected]>
9;;; Copyright © 2017, 2019, 2021 Tobias Geerinckx-Rice <[email protected]>
10;;; Copyright © 2018, 2019 Gábor Boskovits <[email protected]>
11;;; Copyright © 2018 Chris Marusich <[email protected]>
12;;; Copyright © 2018-2024 Efraim Flashner <[email protected]>
13;;; Copyright © 2019, 2020, 2021 Björn Höfling <[email protected]>
14;;; Copyright © 2020, 2025 Janneke Nieuwenhuizen <[email protected]>
15;;; Copyright © 2020 Raghav Gururajan <[email protected]>
16;;; Copyright © 2020, 2022, 2025 Maxim Cournoyer <[email protected]>
17;;; Copyright © 2021 Vincent Legoll <[email protected]>
18;;; Copyright © 2021 Mike Gerwitz <[email protected]>
19;;; Copyright © 2021 Pierre Langlois <[email protected]>
20;;; Copyright © 2021 Guillaume Le Vaillant <[email protected]>
21;;; Copyright © 2022, 2024, 2025 Artyom V. Poptsov <[email protected]>
22;;; Copyright © 2024 Paul A. Patience <[email protected]>
23;;; Copyright © 2024 Raven Hallsby <[email protected]>
24;;; Copyright © 2024 Hartmut Goebel <[email protected]>
25;;; Copyright © 2025 Zheng Junjie <[email protected]>
26;;; Copyright © 2025 Julian Flake <[email protected]>
27;;;
28;;; This file is part of GNU Guix.
29;;;
30;;; GNU Guix is free software; you can redistribute it and/or modify it
31;;; under the terms of the GNU General Public License as published by
32;;; the Free Software Foundation; either version 3 of the License, or (at
33;;; your option) any later version.
34;;;
35;;; GNU Guix is distributed in the hope that it will be useful, but
36;;; WITHOUT ANY WARRANTY; without even the implied warranty of
37;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38;;; GNU General Public License for more details.
39;;;
40;;; You should have received a copy of the GNU General Public License
41;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
42
43(define-module (gnu packages java)
44 #:use-module ((guix licenses) #:prefix license:)
45 #:use-module (guix packages)
46 #:use-module (guix download)
47 #:use-module (guix hg-download)
48 #:use-module (guix git-download)
49 #:use-module (guix svn-download)
50 #:use-module ((guix build utils) #:select (alist-replace))
51 #:use-module (guix utils)
52 #:use-module (guix gexp)
53 #:use-module (guix build-system ant)
54 #:use-module (guix build-system cmake)
55 #:use-module (guix build-system gnu)
56 #:use-module (guix build-system maven)
57 #:use-module (guix build-system pyproject)
58 #:use-module (gnu packages)
59 #:use-module (gnu packages attr)
60 #:use-module (gnu packages autotools)
61 #:use-module (gnu packages base)
62 #:use-module (gnu packages bash)
63 #:use-module (gnu packages nss)
64 #:use-module (gnu packages cpio)
65 #:use-module (gnu packages cups)
66 #:use-module (gnu packages compression)
67 #:use-module (gnu packages elf)
68 #:use-module (gnu packages fontutils)
69 #:use-module (gnu packages freedesktop) ; wayland
70 #:use-module (gnu packages gawk)
71 #:use-module (gnu packages gcc)
72 #:use-module (gnu packages gettext)
73 #:use-module (gnu packages gl)
74 #:use-module (gnu packages ghostscript) ;lcms
75 #:use-module (gnu packages gnome)
76 #:use-module (gnu packages groovy)
77 #:use-module (gnu packages gtk)
78 #:use-module (gnu packages guile)
79 #:use-module (gnu packages icu4c)
80 #:use-module (gnu packages image)
81 #:use-module (gnu packages java-bootstrap)
82 #:use-module (gnu packages java-compression)
83 #:use-module (gnu packages java-xml)
84 #:use-module (gnu packages libffi)
85 #:use-module (gnu packages linux) ;alsa
86 #:use-module (gnu packages maths)
87 #:use-module (gnu packages maven)
88 #:use-module (gnu packages maven-parent-pom)
89 #:use-module (gnu packages ncurses)
90 #:use-module (gnu packages nss)
91 #:use-module (gnu packages onc-rpc)
92 #:use-module (gnu packages web)
93 #:use-module (gnu packages wget)
94 #:use-module (gnu packages pkg-config)
95 #:use-module (gnu packages perl)
96 #:use-module (gnu packages popt)
97 #:use-module (gnu packages python-build)
98 #:use-module (gnu packages kerberos)
99 #:use-module (gnu packages security-token)
100 #:use-module (gnu packages xml)
101 #:use-module (gnu packages xdisorg)
102 #:use-module (gnu packages xorg)
103 #:use-module (gnu packages texinfo)
104 #:use-module ((srfi srfi-1) #:select (fold alist-delete))
105 #:use-module (srfi srfi-11)
106 #:use-module (ice-9 match))
107
108(define-public icedtea-7
109 (let* ((version "2.6.13")
110 (drop (lambda* (name hash #:optional (patches '()))
111 (origin
112 (method url-fetch)
113 (uri (string-append
114 "http://icedtea.classpath.org/download/drops"
115 "/icedtea7/" version "/" name ".tar.bz2"))
116 (sha256 (base32 hash))
117 (patches patches)))))
118 (package
119 (name "icedtea")
120 (version version)
121 (source (origin
122 (method url-fetch)
123 (uri (string-append
124 "http://icedtea.wildebeest.org/download/source/icedtea-"
125 version ".tar.xz"))
126 (sha256
127 (base32
128 "1w331rdqx1dcx2xb0fmjmrkdc71xqn20fxsgw8by4xhiblh88khh"))
129 (modules '((guix build utils)))
130 (snippet
131 '(begin
132 (substitute* "Makefile.in"
133 ;; do not leak information about the build host
134 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
135 "DISTRIBUTION_ID=\"\\\"guix\\\"\""))
136 #t))))
137 (build-system gnu-build-system)
138 (outputs '("out" ; Java Runtime Environment
139 "jdk" ; Java Development Kit
140 "doc")) ; all documentation
141 (arguments
142 `(;; There are many test failures. Some are known to
143 ;; fail upstream, others relate to not having an X
144 ;; server running at test time, yet others are a
145 ;; complete mystery to me.
146
147 ;; hotspot: passed: 241; failed: 45; error: 2
148 ;; langtools: passed: 1,934; failed: 26
149 ;; jdk: unknown
150 #:tests? #f
151
152 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
153 ;; gremlin) doesn't support it yet, so skip this phase.
154 #:validate-runpath? #f
155
156 #:modules ((guix build utils)
157 (guix build gnu-build-system)
158 (ice-9 match)
159 (ice-9 popen)
160 (srfi srfi-19)
161 (srfi srfi-26))
162
163 #:configure-flags
164 ;; TODO: package sctp and add to inputs
165 `("--disable-system-sctp"
166 "--enable-system-pcsc"
167 "--enable-system-lcms"
168 "--enable-bootstrap"
169 "--enable-nss"
170 "--without-rhino"
171 ,(string-append "--with-parallel-jobs="
172 (number->string (parallel-job-count)))
173 "--disable-downloading"
174 "--disable-tests" ;they are run in the check phase instead
175 "--with-openjdk-src-dir=./openjdk.src"
176 ,(string-append "--with-ecj="
177 (assoc-ref %build-inputs "ecj4-javac-wrapper")
178 "/bin/javac")
179 ,(string-append "--with-jdk-home="
180 (assoc-ref %build-inputs "classpath"))
181 ,(string-append "--with-java="
182 (assoc-ref %build-inputs "jamvm")
183 "/bin/jamvm")
184 ,(string-append "--with-jar="
185 (assoc-ref %build-inputs "classpath")
186 "/bin/gjar"))
187 #:phases
188 (modify-phases %standard-phases
189 (replace 'unpack
190 (lambda* (#:key source inputs #:allow-other-keys)
191 (let ((target (string-append "icedtea-" ,version))
192 (unpack (lambda* (name #:optional dir)
193 (let ((dir (or dir
194 (string-drop-right name 5))))
195 (mkdir dir)
196 (invoke "tar" "xvf"
197 (assoc-ref inputs name)
198 "-C" dir
199 "--strip-components=1")))))
200 (mkdir target)
201 (invoke "tar" "xvf" source
202 "-C" target "--strip-components=1")
203 (chdir target)
204 (unpack "openjdk-src" "openjdk.src")
205 (with-directory-excursion "openjdk.src"
206 (for-each unpack
207 (filter (cut string-suffix? "-drop" <>)
208 (map (match-lambda
209 ((name . _) name))
210 inputs)))))))
211 (add-after 'unpack 'use-classpath
212 (lambda* (#:key inputs #:allow-other-keys)
213 (let ((tools (search-input-file inputs "/share/classpath/tools.zip"))
214 (rt.jar (search-input-file inputs "/lib/rt.jar")))
215 ;; GNU Classpath does not provide rt.jar, but jamvm provides
216 ;; Classpath's glibj.zip as rt.jar, so we just use that.
217 (substitute* "Makefile.in"
218 (("\\$\\(SYSTEM_JDK_DIR\\)/jre/lib/rt.jar") rt.jar))
219 ;; Make sure we can find all classes.
220 (setenv "CLASSPATH"
221 (string-append rt.jar ":" tools))
222 (setenv "JAVACFLAGS"
223 (string-append "-cp " rt.jar ":" tools)))))
224 (add-after 'unpack 'patch-bitrot
225 (lambda _
226 (substitute* '("patches/boot/revert-6973616.patch"
227 "openjdk.src/jdk/make/common/shared/Defs-versions.gmk")
228 (("REQUIRED_FREETYPE_VERSION = 2.2.1")
229 "REQUIRED_FREETYPE_VERSION = 2.10.1"))
230 ;; As of attr 2.4.48 this header is no longer
231 ;; included. It is provided by the libc instead.
232 (substitute* '("configure"
233 "openjdk.src/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c")
234 (("attr/xattr.h") "sys/xattr.h"))))
235 (add-after 'unpack 'fix-openjdk
236 (lambda _
237 (substitute* "openjdk.src/jdk/make/common/Defs-linux.gmk"
238 (("CFLAGS_COMMON = -fno-strict-aliasing" all)
239 (string-append all
240 " -fcommon"
241 " -Wno-error=implicit-function-declaration"
242 " -Wno-error=implicit-int"
243 " -Wno-error=incompatible-pointer-types"
244 " -Wno-error=int-conversion")))
245 (substitute*
246 '("openjdk.src/jdk/src/solaris/native/java/net/PlainSocketImpl.c"
247 "openjdk.src/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c")
248 (("#include <sys/sysctl.h>")
249 "#include <linux/sysctl.h>"))
250
251 ;; XXX 'ldd' in glibc 2.35 segfaults upon reading
252 ;; openjdk.build-boot/lib/amd64/libnio.so (!).
253 ;; It is only used as a verification step, so ignore it;
254 ;; try removing this substitution for newer versions of glibc.
255 (substitute* "openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
256 (("\\$\\(LDD\\) \\$1 &&")
257 ""))
258
259 ;; It looks like the "h = 31 * h + c" line of the jsum()
260 ;; function gets miscompiled. After a few iterations of the loop
261 ;; the result of "31 * h" is always 0x8000000000000000.
262 ;; Disable optimizations of dump.cpp as a workaround.
263 (substitute* "openjdk.src/hotspot/make/linux/makefiles/gcc.make"
264 (("OPT_CFLAGS/NOOPT.*" all)
265 (string-append all "\n"
266 "OPT_CFLAGS/dump.o += -O0")))))
267 (add-after 'unpack 'fix-x11-extension-include-path
268 (lambda* (#:key inputs #:allow-other-keys)
269 (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
270 (((string-append "\\$\\(firstword \\$\\(wildcard "
271 "\\$\\(OPENWIN_HOME\\)"
272 "/include/X11/extensions\\).*$"))
273 (string-append (assoc-ref inputs "libxrender")
274 "/include/X11/extensions"
275 " -I" (assoc-ref inputs "libxtst")
276 "/include/X11/extensions"
277 " -I" (assoc-ref inputs "libxinerama")
278 "/include/X11/extensions"))
279 (("\\$\\(wildcard /usr/include/X11/extensions\\)\\)") ""))))
280 (add-after 'unpack 'patch-paths
281 (lambda* (#:key inputs #:allow-other-keys)
282 ;; buildtree.make generates shell scripts, so we need to replace
283 ;; the generated shebang
284 (substitute* '("openjdk.src/hotspot/make/linux/makefiles/buildtree.make")
285 (("/bin/sh") (which "bash")))
286
287 (let ((corebin (string-append
288 (assoc-ref inputs "coreutils") "/bin/"))
289 (binbin (string-append
290 (assoc-ref inputs "binutils") "/bin/"))
291 (grepbin (string-append
292 (assoc-ref inputs "grep") "/bin/")))
293 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
294 "openjdk.src/corba/make/common/shared/Defs-linux.gmk")
295 (("UNIXCOMMAND_PATH = /bin/")
296 (string-append "UNIXCOMMAND_PATH = " corebin))
297 (("USRBIN_PATH = /usr/bin/")
298 (string-append "USRBIN_PATH = " corebin))
299 (("DEVTOOLS_PATH *= */usr/bin/")
300 (string-append "DEVTOOLS_PATH = " corebin))
301 (("COMPILER_PATH *= */usr/bin/")
302 (string-append "COMPILER_PATH = "
303 (assoc-ref inputs "gcc") "/bin/"))
304 (("DEF_OBJCOPY *=.*objcopy")
305 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
306
307 ;; fix path to alsa header
308 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
309 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
310 (string-append "ALSA_INCLUDE="
311 (assoc-ref inputs "alsa-lib")
312 "/include/alsa/version.h")))
313
314 ;; fix hard-coded utility paths
315 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-utils.gmk"
316 "openjdk.src/corba/make/common/shared/Defs-utils.gmk")
317 (("ECHO *=.*echo")
318 (string-append "ECHO = " (which "echo")))
319 (("^GREP *=.*grep")
320 (string-append "GREP = " (which "grep")))
321 (("EGREP *=.*egrep")
322 (string-append "EGREP = " (which "egrep")))
323 (("CPIO *=.*cpio")
324 (string-append "CPIO = " (which "cpio")))
325 (("READELF *=.*readelf")
326 (string-append "READELF = " (which "readelf")))
327 (("^ *AR *=.*ar")
328 (string-append "AR = " (which "ar")))
329 (("^ *TAR *=.*tar")
330 (string-append "TAR = " (which "tar")))
331 (("AS *=.*as")
332 (string-append "AS = " (which "as")))
333 (("LD *=.*ld")
334 (string-append "LD = " (which "ld")))
335 (("STRIP *=.*strip")
336 (string-append "STRIP = " (which "strip")))
337 (("NM *=.*nm")
338 (string-append "NM = " (which "nm")))
339 (("^SH *=.*sh")
340 (string-append "SH = " (which "bash")))
341 (("^FIND *=.*find")
342 (string-append "FIND = " (which "find")))
343 (("LDD *=.*ldd")
344 (string-append "LDD = " (which "ldd")))
345 (("NAWK *=.*(n|g)awk")
346 (string-append "NAWK = " (which "gawk")))
347 (("XARGS *=.*xargs")
348 (string-append "XARGS = " (which "xargs")))
349 (("UNZIP *=.*unzip")
350 (string-append "UNZIP = " (which "unzip")))
351 (("ZIPEXE *=.*zip")
352 (string-append "ZIPEXE = " (which "zip")))
353 (("SED *=.*sed")
354 (string-append "SED = " (which "sed"))))
355
356 ;; Some of these timestamps cause problems as they are more than
357 ;; 10 years ago, failing the build process.
358 (substitute*
359 "openjdk.src/jdk/src/share/classes/java/util/CurrencyData.properties"
360 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
361 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
362 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
363 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY")))))
364 (add-before 'configure 'set-additional-paths
365 (lambda* (#:key inputs #:allow-other-keys)
366 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
367 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
368 (string-append "ALSA_INCLUDE="
369 (assoc-ref inputs "alsa-lib")
370 "/include/alsa/version.h")))
371 (setenv "CC" "gcc")
372 (setenv "CPATH"
373 (string-append (assoc-ref inputs "libxcomposite")
374 "/include/X11/extensions" ":"
375 (assoc-ref inputs "libxrender")
376 "/include/X11/extensions" ":"
377 (assoc-ref inputs "libxtst")
378 "/include/X11/extensions" ":"
379 (assoc-ref inputs "libxinerama")
380 "/include/X11/extensions" ":"
381 (or (getenv "CPATH") "")))
382 (setenv "ALT_OBJCOPY" (which "objcopy"))
383 (setenv "ALT_CUPS_HEADERS_PATH"
384 (string-append (assoc-ref inputs "cups")
385 "/include"))
386 (setenv "ALT_FREETYPE_HEADERS_PATH"
387 (string-append (assoc-ref inputs "freetype")
388 "/include"))
389 (setenv "ALT_FREETYPE_LIB_PATH"
390 (string-append (assoc-ref inputs "freetype")
391 "/lib"))))
392 (add-before 'build 'disable-os-version-check
393 ;; allow build on linux major version change
394 (lambda _
395 (setenv "DISABLE_HOTSPOT_OS_VERSION_CHECK" "ok")))
396 (add-before 'check 'fix-test-framework
397 (lambda _
398 ;; Fix PATH in test environment
399 (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
400 (("PATH=/bin:/usr/bin")
401 (string-append "PATH=" (getenv "PATH"))))
402 (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
403 (("/usr/bin/env") (which "env")))
404 (substitute* "openjdk.src/hotspot/test/test_env.sh"
405 (("/bin/rm") (which "rm"))
406 (("/bin/cp") (which "cp"))
407 (("/bin/mv") (which "mv")))))
408 (add-before 'check 'fix-hotspot-tests
409 (lambda _
410 (with-directory-excursion "openjdk.src/hotspot/test/"
411 (substitute* "jprt.config"
412 (("PATH=\"\\$\\{path4sdk\\}\"")
413 (string-append "PATH=" (getenv "PATH")))
414 (("make=/usr/bin/make")
415 (string-append "make=" (which "make"))))
416 (substitute* '("runtime/6626217/Test6626217.sh"
417 "runtime/7110720/Test7110720.sh")
418 (("/bin/rm") (which "rm"))
419 (("/bin/cp") (which "cp"))
420 (("/bin/mv") (which "mv"))))))
421 (add-before 'check 'fix-jdk-tests
422 (lambda _
423 (with-directory-excursion "openjdk.src/jdk/test/"
424 (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
425 (("/bin/pwd") (which "pwd")))
426 (substitute* "com/sun/jdi/ShellScaffold.sh"
427 (("/bin/kill") (which "kill")))
428 (substitute* "start-Xvfb.sh"
429 ;;(("/usr/bin/X11/Xvfb") (which "Xvfb"))
430 (("/usr/bin/nohup") (which "nohup")))
431 (substitute* "javax/security/auth/Subject/doAs/Test.sh"
432 (("/bin/rm") (which "rm")))
433 (substitute* "tools/launcher/MultipleJRE.sh"
434 (("echo \"#!/bin/sh\"")
435 (string-append "echo \"#!" (which "rm") "\""))
436 (("/usr/bin/zip") (which "zip")))
437 (substitute* "com/sun/jdi/OnThrowTest.java"
438 (("#!/bin/sh") (string-append "#!" (which "sh"))))
439 (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
440 (("/usr/bin/uptime") (which "uptime")))
441 (substitute* "java/lang/ProcessBuilder/Basic.java"
442 (("/usr/bin/env") (which "env"))
443 (("/bin/false") (which "false"))
444 (("/bin/true") (which "true"))
445 (("/bin/cp") (which "cp"))
446 (("/bin/sh") (which "sh")))
447 (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
448 (("/bin/sh") (which "sh")))
449 (substitute* "java/lang/ProcessBuilder/Zombies.java"
450 (("/usr/bin/perl") (which "perl"))
451 (("/bin/ps") (which "ps"))
452 (("/bin/true") (which "true")))
453 (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
454 (("/usr/bin/tee") (which "tee")))
455 (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
456 (("/bin/true") (which "true")))
457 (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
458 (("/bin/cat") (which "cat")))
459 (substitute* "java/lang/Runtime/exec/ExitValue.java"
460 (("/bin/sh") (which "sh"))
461 (("/bin/true") (which "true"))
462 (("/bin/kill") (which "kill")))
463 (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
464 (("/usr/bin/echo") (which "echo")))
465 (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
466 (("/usr/bin/cat") (which "cat")))
467 (substitute* "java/lang/Runtime/exec/SleepyCat.java"
468 (("/bin/cat") (which "cat"))
469 (("/bin/sleep") (which "sleep"))
470 (("/bin/sh") (which "sh")))
471 (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
472 (("/bin/cat") (which "cat")))
473 (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
474 (("/bin/chmod") (which "chmod")))
475 (substitute* "java/util/zip/ZipFile/Assortment.java"
476 (("/bin/sh") (which "sh"))))))
477 (replace 'check
478 (lambda* (#:key tests? #:allow-other-keys)
479 ;; The "make check-*" targets always return zero, so we need to
480 ;; check for errors in the associated log files to determine
481 ;; whether any tests have failed.
482 (when tests?
483 (use-modules (ice-9 rdelim))
484 (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
485 (checker (lambda (port)
486 (let loop ()
487 (let ((line (read-line port)))
488 (cond
489 ((eof-object? line) #t)
490 ((regexp-exec error-pattern line)
491 (error "test failed"))
492 (else (loop)))))))
493 (run-test (lambda (test)
494 (invoke "make" test)
495 (call-with-input-file
496 (string-append "test/" test ".log")
497 checker))))
498 (run-test "check-hotspot")
499 (run-test "check-langtools")
500 (run-test "check-jdk")))))
501 (replace 'install
502 (lambda* (#:key outputs #:allow-other-keys)
503 (let ((doc (string-append (assoc-ref outputs "doc")
504 "/share/doc/icedtea"))
505 (jre (assoc-ref outputs "out"))
506 (jdk (assoc-ref outputs "jdk")))
507 (copy-recursively "openjdk.build/docs" doc)
508 (copy-recursively "openjdk.build/j2re-image" jre)
509 (copy-recursively "openjdk.build/j2sdk-image" jdk))))
510 ;; Some of the libraries in the lib/amd64 folder link to libjvm.so.
511 ;; But that shared object is located in the server/ folder, so it
512 ;; cannot be found. This phase creates a symbolic link in the
513 ;; lib/amd64 folder so that the other libraries can find it.
514 ;;
515 ;; See:
516 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
517 ;;
518 ;; FIXME: Find the bug in the build system, so that this symlink is
519 ;; not needed.
520 (add-after 'install 'install-libjvm
521 (lambda* (#:key inputs outputs #:allow-other-keys)
522 (let* ((lib-path (string-append (assoc-ref outputs "out")
523 ;; See 'INSTALL_ARCH_DIR' in
524 ;; 'configure'.
525 ,(match (%current-system)
526 ("i686-linux"
527 "/lib/i386")
528 ("x86_64-linux"
529 "/lib/amd64")
530 ("armhf-linux"
531 "/lib/arm")
532 ("aarch64-linux"
533 "/lib/aarch64")
534 ("powerpc-linux"
535 "/lib/ppc")
536 ;; We need a catch-all, dropping
537 ;; '-linux' works in most cases.
538 (_
539 (string-append
540 "/lib/"
541 (string-drop-right
542 (%current-system) 6)))))))
543 (symlink (string-append lib-path "/server/libjvm.so")
544 (string-append lib-path "/libjvm.so")))))
545 ;; By default IcedTea only generates an empty keystore. In order to
546 ;; be able to use certificates in Java programs we need to generate a
547 ;; keystore from a set of certificates. For convenience we use the
548 ;; certificates from the nss-certs package.
549 (add-after 'install 'install-keystore
550 (lambda* (#:key inputs outputs #:allow-other-keys)
551 (use-modules (ice-9 rdelim))
552 (let* ((keystore "cacerts")
553 (certs-dir (search-input-directory inputs
554 "etc/ssl/certs"))
555 (keytool (string-append (assoc-ref outputs "jdk")
556 "/bin/keytool")))
557 (define (extract-cert file target)
558 (call-with-input-file file
559 (lambda (in)
560 (call-with-output-file target
561 (lambda (out)
562 (let loop ((line (read-line in 'concat))
563 (copying? #f))
564 (cond
565 ((eof-object? line) #t)
566 ((string-prefix? "-----BEGIN" line)
567 (display line out)
568 (loop (read-line in 'concat) #t))
569 ((string-prefix? "-----END" line)
570 (display line out)
571 #t)
572 (else
573 (when copying? (display line out))
574 (loop (read-line in 'concat) copying?)))))))))
575 (define (import-cert cert)
576 (format #t "Importing certificate ~a\n" (basename cert))
577 (let ((temp "tmpcert"))
578 (extract-cert cert temp)
579 (let ((port (open-pipe* OPEN_WRITE keytool
580 "-import"
581 "-alias" (basename cert)
582 "-keystore" keystore
583 "-storepass" "changeit"
584 "-file" temp)))
585 (display "yes\n" port)
586 (when (not (zero? (status:exit-val (close-pipe port))))
587 (format #t "failed to import ~a\n" cert)))
588 (delete-file temp)))
589
590 ;; This is necessary because the certificate directory contains
591 ;; files with non-ASCII characters in their names.
592 (setlocale LC_ALL "C.UTF-8")
593 (setenv "LC_ALL" "C.UTF-8")
594
595 (for-each import-cert (find-files certs-dir "\\.pem$"))
596 (mkdir-p (string-append (assoc-ref outputs "out")
597 "/lib/security"))
598 (mkdir-p (string-append (assoc-ref outputs "jdk")
599 "/jre/lib/security"))
600
601 ;; The cacerts files we are going to overwrite are chmod'ed as
602 ;; read-only (444) in icedtea-8 (which derives from this
603 ;; package). We have to change this so we can overwrite them.
604 (chmod (string-append (assoc-ref outputs "out")
605 "/lib/security/" keystore) #o644)
606 (chmod (string-append (assoc-ref outputs "jdk")
607 "/jre/lib/security/" keystore) #o644)
608
609 (install-file keystore
610 (string-append (assoc-ref outputs "out")
611 "/lib/security"))
612 (install-file keystore
613 (string-append (assoc-ref outputs "jdk")
614 "/jre/lib/security"))))))))
615 (native-inputs
616 ;; XXX: Compiling with gcc-14 will encounter the following error:
617 ;; BUILD FAILED:
618 ;; /tmp/guix-build-icedtea-2.6.13.drv-0/icedtea-2.6.13/openjdk/langtools/
619 ;; make/build.xml:452: The following error occurred while executing this
620 ;; line:
621 ;; java.lang.AbstractMethodError: java.lang.Throwable.toString()Ljava/lang/String;
622 `(("gcc" ,gcc-13)
623 ("openjdk-src"
624 ,(drop "openjdk"
625 "0l34ikyf62hbzlf9032alzkkqvf7bpmckz4gvirvph755w7gka8l"))
626 ("corba-drop"
627 ,(drop "corba"
628 "050gv2jbg1pi6qkn8w18bwpbklfa5b0kymjvan9pncddbj8m84fz"))
629 ("jaxp-drop"
630 ,(drop "jaxp"
631 "1k6yldwnxfzdg5926r1nlfv8d1r1j7rlp2nkz6gqh05vgyamnfhl"))
632 ("jaxws-drop"
633 ,(drop "jaxws"
634 "110j7jlz47x2gg6f7653x12mssan5kvj9l9h1m1c8c92drfxbqyk"))
635 ("jdk-drop"
636 ,(drop "jdk"
637 "0d1mca38ksxvdskp9im3pp7fdijhj1n3lwq9w13r9s4v3qyskgdd"
638 (search-patches "jdk-currency-time-bomb.patch")))
639 ("langtools-drop"
640 ,(drop "langtools"
641 "0nq5236fzxn3p6x8cgncl56mzcmsj07q9gymysnws4c8byc6n0qj"))
642 ("hotspot-drop"
643 ,(origin
644 (method url-fetch)
645 (uri (string-append
646 "http://icedtea.classpath.org/downloads/drops"
647 "/icedtea7/" version "/hotspot.tar.bz2"))
648 (sha256
649 (base32
650 "17bdv39n4lh8l5737c96f3xgamx4y305m067p01cywgp7zaddqws"))
651 (patches (search-patches
652 "icedtea-7-hotspot-aarch64-use-c++98.patch"
653 "icedtea-7-hotspot-pointer-comparison.patch"))))
654 ("ant" ,ant-bootstrap)
655 ("attr" ,attr)
656 ("classpath" ,classpath-devel)
657 ("coreutils" ,coreutils)
658 ("diffutils" ,diffutils) ;for tests
659 ("ecj4-javac-wrapper" ,ecj4-javac-wrapper)
660 ("fastjar" ,fastjar) ;only for the configure phase; we actually use gjar
661 ("gawk" ,gawk)
662 ("grep" ,grep)
663 ("jamvm" ,jamvm-with-ecj4)
664 ("libtool" ,libtool)
665 ("pkg-config" ,pkg-config)
666 ("wget" ,wget)
667 ("which" ,which)
668 ("cpio" ,cpio)
669 ("zip" ,zip)
670 ("unzip" ,unzip)
671 ("libxslt" ,libxslt) ;for xsltproc
672 ("nss-certs" ,nss-certs)
673 ("perl" ,perl)
674 ("procps" ,procps))) ;for "free", even though I'm not sure we should use it
675 (inputs
676 (list alsa-lib
677 cups
678 fontconfig
679 freetype
680 giflib
681 gtk+-2
682 lcms
683 libjpeg-turbo
684 libpng
685 libx11
686 libxcomposite
687 libxi
688 libxinerama
689 libxrender
690 libxt
691 libxtst
692 mit-krb5
693 nss
694 pcsc-lite
695 zlib))
696 (home-page "https://icedtea.classpath.org")
697 (synopsis "Java development kit")
698 (description
699 "This package provides the Java development kit OpenJDK built with the
700IcedTea build harness.")
701
702 ;; 'configure' lists "mips" and "mipsel", but not "mips64el'.
703 (supported-systems (delete "mips64el-linux" %supported-systems))
704
705 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
706 ;; same license as both GNU Classpath and OpenJDK.
707 (license license:gpl2+))))
708
709(define-public icedtea-8
710 (let* ((version "3.19.0")
711 (drop (lambda* (name hash #:optional (patches '()))
712 (origin
713 (method url-fetch)
714 (uri (string-append
715 "http://icedtea.classpath.org/download/drops"
716 "/icedtea8/" version "/" name ".tar.xz"))
717 (sha256 (base32 hash))
718 (patches patches)))))
719 (package (inherit icedtea-7)
720 (version "3.19.0")
721 (source (origin
722 (method url-fetch)
723 (uri (string-append
724 "http://icedtea.wildebeest.org/download/source/icedtea-"
725 version ".tar.xz"))
726 (sha256
727 (base32
728 "1cmms7cb2sav3ywc36ynqmybzx73sl279rm6j8i5nqrmp98ixmpf"))
729 (modules '((guix build utils)))
730 (snippet
731 '(substitute* '("configure"
732 "acinclude.m4")
733 ;; Do not embed build time
734 (("(DIST_ID=\"Custom build).*$" _ prefix)
735 (string-append prefix "\"\n"))
736 ;; Do not leak information about the build host
737 (("DIST_NAME=\"\\$build_os\"")
738 "DIST_NAME=\"guix\"")))))
739 (arguments
740 `(#:imported-modules
741 ((guix build ant-build-system)
742 ,@%default-gnu-imported-modules)
743
744 #:disallowed-references ,(list (gexp-input
745 (this-package-native-input "jdk")
746 "jdk"))
747
748 ,@(substitute-keyword-arguments (package-arguments icedtea-7)
749 ((#:modules modules)
750 `((guix build utils)
751 (guix build gnu-build-system)
752 ((guix build ant-build-system) #:prefix ant:)
753 (ice-9 match)
754 (ice-9 popen)
755 (srfi srfi-19)
756 (srfi srfi-26)))
757 ((#:configure-flags flags)
758 `(let ((jdk (assoc-ref %build-inputs "jdk")))
759 `(,(string-append "CFLAGS=-fcommon"
760 " -Wno-error=implicit-function-declaration"
761 " -Wno-error=implicit-int"
762 " -Wno-error=incompatible-pointer-types"
763 " -Wno-error=int-conversion")
764 "CXXFLAGS=-fcommon"
765 "--enable-bootstrap"
766 "--enable-nss"
767 ,(string-append "--with-parallel-jobs="
768 (number->string (parallel-job-count)))
769 ;; Java Flight Recorder isn't supported on some architectures.
770 ,@(if ,(target-ppc32?)
771 `("--enable-jfr=no")
772 '())
773 "--disable-docs" ; This phase can take hours on slow machines.
774 "--disable-downloading"
775 "--disable-system-pcsc"
776 "--disable-system-sctp"
777 "--disable-tests" ;they are run in the check phase instead
778 "--with-openjdk-src-dir=./openjdk.src"
779 ,(string-append "--with-jdk-home=" jdk))))
780 ((#:phases phases)
781 `(modify-phases ,phases
782 (delete 'fix-x11-extension-include-path)
783 (delete 'patch-paths)
784 (delete 'set-additional-paths)
785 (delete 'patch-patches)
786 (delete 'patch-bitrot)
787 (delete 'use-classpath)
788 ;; Prevent passing -j (parallel-job-count) to make
789 (replace 'build
790 (lambda* (#:key (make-flags '()) #:allow-other-keys)
791 (apply invoke "make" make-flags)))
792 ;; Prevent the keytool from recording the current time when
793 ;; adding certificates at build time.
794 (add-after 'unpack 'patch-keystore
795 (lambda _
796 (substitute* "openjdk.src/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java"
797 (("date = new Date\\(\\);")
798 "\
799date = (System.getenv(\"SOURCE_DATE_EPOCH\") != null) ?\
800new Date(Long.parseLong(System.getenv(\"SOURCE_DATE_EPOCH\"))) :\
801new Date();"))
802 #t))
803 (add-after 'unpack 'patch-jni-libs
804 ;; Hardcode dynamically loaded libraries.
805 (lambda _
806 (define remove
807 (@ (srfi srfi-1) remove))
808
809 (define (icedtea-or-openjdk? path)
810 (or (string-contains path "openjdk")
811 (string-contains path "icedtea")))
812
813 (let* ((library-path (remove icedtea-or-openjdk?
814 (search-path-as-string->list
815 (getenv "LIBRARY_PATH"))))
816 (find-library (lambda (name)
817 (or (search-path
818 library-path
819 (string-append "lib" name ".so"))
820 (string-append "lib" name ".so")))))
821 (for-each
822 (lambda (file)
823 (catch 'decoding-error
824 (lambda ()
825 (substitute* file
826 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
827 _ name version)
828 (string-append "\"" (find-library name) "\""))
829 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
830 (string-append "\"" (find-library name) "\""))))
831 (lambda _
832 ;; Those are safe to skip.
833 (format (current-error-port)
834 "warning: failed to substitute: ~a~%"
835 file))))
836 (find-files "openjdk.src/jdk/src/solaris/native"
837 "\\.c|\\.h")))))
838 (replace 'fix-openjdk
839 (lambda _
840 (substitute*
841 '("openjdk.src/jdk/src/solaris/native/java/net/PlainSocketImpl.c"
842 "openjdk.src/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c")
843 (("#include <sys/sysctl.h>")
844 "#include <linux/sysctl.h>"))))
845 (replace 'install
846 (lambda* (#:key outputs #:allow-other-keys)
847 (let ((doc (string-append (assoc-ref outputs "doc")
848 "/share/doc/icedtea"))
849 (jre (assoc-ref outputs "out"))
850 (jdk (assoc-ref outputs "jdk")))
851 (copy-recursively "openjdk.build/docs" doc)
852 (copy-recursively "openjdk.build/images/j2re-image" jre)
853 (copy-recursively "openjdk.build/images/j2sdk-image" jdk)
854 ;; Install the nss.cfg file to JRE to enable SSL/TLS
855 ;; support via NSS.
856 (copy-file (string-append jdk "/jre/lib/security/nss.cfg")
857 (string-append jre "/lib/security/nss.cfg")))))
858 (add-after 'install 'strip-jar-timestamps
859 (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))))
860 (native-inputs
861 `(("jdk" ,icedtea-7 "jdk")
862 ("openjdk-src"
863 ,(drop "openjdk"
864 "1l3bzmd3s38scxpwamfhnwbv7vndgjq6hz3bl58437fgl9kgbl69"))
865 ("aarch32-drop"
866 ,(drop "aarch32"
867 "0k4dwpi3x3lj41rj32xyxbn76r7cb2g2whh44r1z4iwhw1xd2lpq"))
868 ("corba-drop"
869 ,(drop "corba"
870 "0xhh6gf5gh5c6vf1607xcy49wnp5prch2rim13x14wvsn817xf0r"))
871 ("jaxp-drop"
872 ,(drop "jaxp"
873 "043g335rgi5ipl8dp3q2cc3gcfhxk77ipxs43sv344z71bn8xmxr"))
874 ("jaxws-drop"
875 ,(drop "jaxws"
876 "1pc0pv4v2mn2mjc0vp19d94v2150xigyhxsmckqasy647zcm6w0r"))
877 ("jdk-drop"
878 ,(drop "jdk"
879 "1742lcm55l8zhi522x83v65ccr0rd6511q9rj7crw44x3ymdrhrv"
880 (search-patches "jdk-currency-time-bomb2.patch")))
881 ("langtools-drop"
882 ,(drop "langtools"
883 "08iz7p2xcddlphipf6gahyabr5cawlnydap12p1n4f0md069b50b"))
884 ("hotspot-drop"
885 ,(drop "hotspot"
886 "1ffaxfnb3yn1i7crivqigc1r1q0z6cp044i6nfring4z6c8pfhd2"))
887 ("nashorn-drop"
888 ,(drop "nashorn"
889 "15fn7cpm2i1npa88h57njxg0f8qkrqhrc30pb54d3hxlx5zyjl94"))
890 ("shenandoah-drop"
891 ,(drop "shenandoah"
892 "1jjzjjx1ykyhbc4llh8249dlr8j5g1ki6r7g9baj2mxyb9whc5nq"))
893 ,@(fold alist-delete (package-native-inputs icedtea-7)
894 '("openjdk-src" "corba-drop" "jaxp-drop" "jaxws-drop"
895 "jdk-drop" "langtools-drop" "hotspot-drop"
896 "classpath" "ecj4-javac-wrapper" "jamvm" "fastjar")))))))
897
898(define-public icedtea icedtea-8)
899
900(define-public openjdk9
901 (package
902 (name "openjdk")
903 (version "9.181")
904 (source (origin
905 (method hg-fetch)
906 (uri (hg-reference (url "https://hg.openjdk.org/jdk/jdk")
907 (changeset "jdk-9+181")))
908 (file-name (hg-file-name name version))
909 (modules '((guix build utils)))
910 (snippet '(for-each delete-file
911 (find-files "." ".*.(bin|exe|jar)$")))
912 (sha256
913 (base32
914 "1v92nzdqx07c35x945awzir4yk0fk22vky6fpp8mq9js930sxsz0"))
915 (patches
916 (search-patches "openjdk-9-pointer-comparison.patch"
917 "openjdk-9-classlist-reproducibility.patch"
918 "openjdk-currency-time-bomb.patch"
919 "openjdk-9-jar-reproducibility.patch"
920 "openjdk-9-module-reproducibility.patch"
921 "openjdk-9-module2-reproducibility.patch"
922 "openjdk-9-module3-reproducibility.patch"
923 "openjdk-9-idlj-reproducibility.patch"
924 "openjdk-9-setsignalhandler.patch"))))
925 (build-system gnu-build-system)
926 (outputs '("out" "jdk" "doc"))
927 (arguments
928 `(#:imported-modules
929 ((guix build ant-build-system)
930 ,@%default-gnu-imported-modules)
931 #:modules
932 ((guix build utils)
933 (guix build gnu-build-system)
934 (ice-9 popen))
935 #:tests? #f ; require jtreg
936 #:make-flags '("all")
937 #:disallowed-references
938 ,(list (this-package-native-input "icedtea")
939 (gexp-input (this-package-native-input "icedtea") "jdk"))
940
941 #:phases
942 (modify-phases %standard-phases
943 ,@(if (target-aarch64?)
944 `((add-after 'unpack 'patch-for-aarch64
945 (lambda _
946 (substitute* "hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp"
947 ;; This line is duplicated, so remove both occurrences,
948 ;; then add back one occurrence by substituting a
949 ;; comment that occurs once.
950 (("using MacroAssembler::call_VM_leaf_base;") "")
951 (("Interpreter specific version of call_VM_base")
952 "Interpreter specific version of call_VM_base
953 using MacroAssembler::call_VM_leaf_base;")))))
954 '())
955 (add-after 'patch-source-shebangs 'fix-java-shebangs
956 (lambda _
957 ;; This file was "fixed" by patch-source-shebangs, but it requires
958 ;; this exact first line.
959 (substitute* "jdk/make/data/blacklistedcertsconverter/blacklisted.certs.pem"
960 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))))
961 (replace 'configure
962 (lambda* (#:key inputs outputs #:allow-other-keys)
963 ;; TODO: unbundle libpng and lcms
964 (invoke "bash" "./configure"
965 ;; Add flags for compilation with gcc >= 10
966 ,(string-append "--with-extra-cflags=-fcommon"
967 " -fno-delete-null-pointer-checks"
968 " -fno-lifetime-dse"
969 ;; flags for compilation with gcc >= 14.
970 " -Wno-error=int-conversion")
971 (string-append "--with-freetype="
972 (assoc-ref inputs "freetype"))
973 "--disable-freetype-bundling"
974 "--disable-warnings-as-errors"
975 "--disable-hotspot-gtest"
976 "--with-giflib=system"
977 "--with-libjpeg=system"
978 (string-append "--prefix=" (assoc-ref outputs "out")))))
979 (add-before 'build 'write-source-revision-file
980 (lambda _
981 (with-output-to-file ".src-rev"
982 (lambda _
983 (display ,version)))))
984 (replace 'build
985 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
986 (apply invoke "make"
987 `(,@(if parallel-build?
988 (list (string-append "JOBS="
989 (number->string (parallel-job-count))))
990 '("JOBS=1"))
991 ,@make-flags))))
992 (add-after 'unpack 'patch-jni-libs
993 ;; Hardcode dynamically loaded libraries.
994 (lambda _
995 (define remove
996 (@ (srfi srfi-1) remove))
997
998 (define (icedtea-or-openjdk? path)
999 (or (string-contains path "openjdk")
1000 (string-contains path "icedtea")))
1001
1002 (let* ((library-path (remove icedtea-or-openjdk?
1003 (search-path-as-string->list
1004 (getenv "LIBRARY_PATH"))))
1005 (find-library (lambda (name)
1006 (or (search-path
1007 library-path
1008 (string-append "lib" name ".so"))
1009 (string-append "lib" name ".so")))))
1010 (for-each
1011 (lambda (file)
1012 (catch 'decoding-error
1013 (lambda ()
1014 (substitute* file
1015 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
1016 _ name version)
1017 (string-append "\"" (find-library name) "\""))
1018 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
1019 (string-append "\"" (find-library name) "\""))))
1020 (lambda _
1021 ;; Those are safe to skip.
1022 (format (current-error-port)
1023 "warning: failed to substitute: ~a~%"
1024 file))))
1025 (find-files "."
1026 "\\.c$|\\.h$")))))
1027 ;; By default OpenJDK only generates an empty keystore. In order to
1028 ;; be able to use certificates in Java programs we need to generate a
1029 ;; keystore from a set of certificates. For convenience we use the
1030 ;; certificates from the nss-certs package.
1031 (add-after 'install 'install-keystore
1032 (lambda* (#:key inputs outputs #:allow-other-keys)
1033 (use-modules (ice-9 rdelim))
1034 (let* ((keystore "cacerts")
1035 (certs-dir (search-input-directory inputs
1036 "etc/ssl/certs"))
1037 (keytool (string-append (assoc-ref outputs "jdk")
1038 "/bin/keytool")))
1039 (define (extract-cert file target)
1040 (call-with-input-file file
1041 (lambda (in)
1042 (call-with-output-file target
1043 (lambda (out)
1044 (let loop ((line (read-line in 'concat))
1045 (copying? #f))
1046 (cond
1047 ((eof-object? line) #t)
1048 ((string-prefix? "-----BEGIN" line)
1049 (display line out)
1050 (loop (read-line in 'concat) #t))
1051 ((string-prefix? "-----END" line)
1052 (display line out)
1053 #t)
1054 (else
1055 (when copying? (display line out))
1056 (loop (read-line in 'concat) copying?)))))))))
1057 (define (import-cert cert)
1058 (format #t "Importing certificate ~a\n" (basename cert))
1059 (let ((temp "tmpcert"))
1060 (extract-cert cert temp)
1061 (let ((port (open-pipe* OPEN_WRITE keytool
1062 "-import"
1063 "-alias" (basename cert)
1064 "-keystore" keystore
1065 "-storepass" "changeit"
1066 "-file" temp)))
1067 (display "yes\n" port)
1068 (when (not (zero? (status:exit-val (close-pipe port))))
1069 (format #t "failed to import ~a\n" cert)))
1070 (delete-file temp)))
1071
1072 ;; This is necessary because the certificate directory contains
1073 ;; files with non-ASCII characters in their names.
1074 (setlocale LC_ALL "C.UTF-8")
1075 (setenv "LC_ALL" "C.UTF-8")
1076
1077 (copy-file (string-append (assoc-ref outputs "out")
1078 "/lib/security/cacerts")
1079 keystore)
1080 (chmod keystore #o644)
1081 (for-each import-cert (find-files certs-dir "\\.pem$"))
1082 (mkdir-p (string-append (assoc-ref outputs "out")
1083 "/lib/security"))
1084 (mkdir-p (string-append (assoc-ref outputs "jdk")
1085 "/lib/security"))
1086
1087 ;; The cacerts files we are going to overwrite are chmod'ed as
1088 ;; read-only (444) in icedtea-8 (which derives from this
1089 ;; package). We have to change this so we can overwrite them.
1090 (chmod (string-append (assoc-ref outputs "out")
1091 "/lib/security/" keystore) #o644)
1092 (chmod (string-append (assoc-ref outputs "jdk")
1093 "/lib/security/" keystore) #o644)
1094
1095 (install-file keystore
1096 (string-append (assoc-ref outputs "out")
1097 "/lib/security"))
1098 (install-file keystore
1099 (string-append (assoc-ref outputs "jdk")
1100 "/lib/security")))))
1101 ;; Some of the libraries in the lib/ folder link to libjvm.so.
1102 ;; But that shared object is located in the server/ folder, so it
1103 ;; cannot be found. This phase creates a symbolic link in the
1104 ;; lib/ folder so that the other libraries can find it.
1105 ;;
1106 ;; See:
1107 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1108 ;;
1109 ;; FIXME: Find the bug in the build system, so that this symlink is
1110 ;; not needed.
1111 (add-after 'install 'install-libjvm
1112 (lambda* (#:key inputs outputs #:allow-other-keys)
1113 (let* ((lib-out (string-append (assoc-ref outputs "out")
1114 "/lib"))
1115 (lib-jdk (string-append (assoc-ref outputs "jdk")
1116 "/lib")))
1117 (symlink (string-append lib-jdk "/server/libjvm.so")
1118 (string-append lib-jdk "/libjvm.so"))
1119 (symlink (string-append lib-out "/server/libjvm.so")
1120 (string-append lib-out "/libjvm.so")))))
1121 (replace 'install
1122 (lambda* (#:key outputs #:allow-other-keys)
1123 (let ((out (assoc-ref outputs "out"))
1124 (jdk (assoc-ref outputs "jdk"))
1125 (doc (assoc-ref outputs "doc"))
1126 (images (car (find-files "build" ".*-server-release"
1127 #:directories? #t))))
1128 (copy-recursively (string-append images "/images/jdk") jdk)
1129 (copy-recursively (string-append images "/images/jre") out)
1130 (copy-recursively (string-append images "/images/docs") doc))))
1131 (add-after 'install 'strip-zip-timestamps
1132 (lambda* (#:key outputs #:allow-other-keys)
1133 (for-each
1134 (lambda (zip)
1135 (let ((dir (mkdtemp "zip-contents.XXXXXX")))
1136 (with-directory-excursion dir
1137 ;; This is an exact copy of the implementation of invoke,
1138 ;; but this accepts exit code 1 as OK.
1139 (let ((code (system* "unzip" "--" zip)))
1140 ;; jmod files are zip files with an extra header in
1141 ;; front. unzip will warn about that -- but otherwise
1142 ;; work.
1143 (when (> (status:exit-val code) 1) ; 1 is just a warning
1144 (raise
1145 (condition
1146 (&invoke-error
1147 (program "unzip")
1148 (arguments (list "--" zip))
1149 (exit-status (status:exit-val code))
1150 (term-signal (status:term-sig code))
1151 (stop-signal (status:stop-sig code))))))))
1152 (delete-file zip)
1153 (for-each (lambda (file)
1154 (let ((s (lstat file)))
1155 (format #t "reset ~a~%" file)
1156 (utime file 1 1 0 0
1157 AT_SYMLINK_NOFOLLOW)))
1158 (find-files dir #:directories? #t))
1159 (with-directory-excursion dir
1160 (let ((files (cons "./META-INF/MANIFEST.MF"
1161 (append
1162 (find-files "./META-INF" ".*")
1163 ;; for jmod:
1164 (list "./classes/module-info.class")
1165 (find-files "." ".*")))))
1166 (apply invoke "zip" "--symlinks" "-0" "-X" zip files)
1167 (when (string-suffix? ".jmod" zip)
1168 (let ((new-zip (string-append zip "n"))
1169 (contents (call-with-input-file zip
1170 (@ (ice-9 binary-ports)
1171 get-bytevector-all))))
1172 (call-with-output-file new-zip
1173 (lambda (output-port)
1174 ((@ (ice-9 binary-ports) put-bytevector)
1175 output-port
1176 #vu8(#x4a #x4d #x01 #x00)) ; JM
1177 ((@ (ice-9 binary-ports) put-bytevector)
1178 output-port
1179 contents)))
1180 (rename-file new-zip zip)))))))
1181 (append (find-files (string-append
1182 (assoc-ref outputs "doc")
1183 "/api")
1184 "\\.zip$")
1185 (find-files (assoc-ref outputs "doc") "src\\.zip$")
1186 (find-files (assoc-ref outputs "jdk") "src\\.zip$")
1187 (find-files (assoc-ref outputs "jdk") "\\.jmod$")
1188 (find-files (assoc-ref outputs "jdk") "\\.diz$")
1189 (find-files (assoc-ref outputs "out") "\\.diz$")
1190
1191 (list (string-append (assoc-ref outputs "jdk")
1192 "/lib/jrt-fs.jar"))
1193 (find-files (string-append (assoc-ref outputs "jdk")
1194 "/demo")
1195 "\\.jar$"))))))))
1196 (inputs
1197 (list alsa-lib
1198 cups
1199 fontconfig
1200 freetype
1201 giflib
1202 lcms
1203 elfutils
1204 libjpeg-turbo
1205 libice
1206 libpng
1207 libx11
1208 libxcomposite
1209 libxi
1210 libxinerama
1211 libxrender
1212 libxt
1213 libxtst))
1214 (native-inputs
1215 (list icedtea-8
1216 `(,icedtea-8 "jdk")
1217 ;; XXX: The build system fails with newer versions of GNU Make.
1218 gnu-make-4.2
1219 nss-certs
1220 unzip
1221 which
1222 zip))
1223 (home-page "https://openjdk.org/projects/jdk9/")
1224 (synopsis "Java development kit")
1225 (description
1226 "This package provides the Java development kit OpenJDK.")
1227 (license license:gpl2+)))
1228
1229(define-public openjdk10
1230 (package
1231 (inherit openjdk9)
1232 (name "openjdk")
1233 (version "10.46")
1234 (source (origin
1235 (method hg-fetch)
1236 (uri (hg-reference (url "https://hg.openjdk.org/jdk/jdk")
1237 (changeset "jdk-10+46")))
1238 (file-name (hg-file-name name version))
1239 (modules '((guix build utils)))
1240 (snippet `(begin
1241 (for-each delete-file
1242 (find-files "." ".*.(bin|exe|jar)$"))))
1243 (sha256
1244 (base32
1245 "0i47ar8lxzjrkkiwbzybfxs473390h4jq9ahm3xqdvy5zpchxy3y"))
1246 (patches (search-patches
1247 "openjdk-10-char-reproducibility.patch"
1248 "openjdk-10-classlist-reproducibility.patch"
1249 "openjdk-10-corba-reproducibility.patch"
1250 "openjdk-10-idlj-reproducibility.patch"
1251 "openjdk-10-module-reproducibility.patch"
1252 "openjdk-10-module3-reproducibility.patch"
1253 "openjdk-10-module4-reproducibility.patch"
1254 "openjdk-10-jar-reproducibility.patch"
1255 "openjdk-10-jtask-reproducibility.patch"
1256 "openjdk-10-pointer-comparison.patch"
1257 "openjdk-10-setsignalhandler.patch"
1258 "openjdk-currency-time-bomb2.patch"))))
1259 (arguments
1260 (substitute-keyword-arguments (package-arguments openjdk9)
1261 ((#:phases phases)
1262 `(modify-phases ,phases
1263 ,@(if (target-aarch64?)
1264 `((replace 'patch-for-aarch64
1265 (lambda _
1266 (substitute* "src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp"
1267 ;; This line is duplicated, so remove both occurrences,
1268 ;; then add back one occurrence by substituting a
1269 ;; comment that occurs once.
1270 (("using MacroAssembler::call_VM_leaf_base;") "")
1271 (("Interpreter specific version of call_VM_base")
1272 (string-append "Interpreter specific version of call_VM_base\n"
1273 " using MacroAssembler::call_VM_leaf_base;"))))))
1274 '())
1275 (replace 'fix-java-shebangs
1276 (lambda _
1277 ;; This file was "fixed" by patch-source-shebangs, but it requires
1278 ;; this exact first line.
1279 (substitute* "make/data/blacklistedcertsconverter/blacklisted.certs.pem"
1280 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))))
1281 (add-after 'unpack 'remove-timestamping
1282 (lambda _
1283 (substitute* "./src/hotspot/share/runtime/vm_version.cpp"
1284 (("__DATE__") "")
1285 (("__TIME__") ""))))
1286 (replace 'configure
1287 (lambda* (#:key inputs outputs #:allow-other-keys)
1288 (invoke "bash" "./configure"
1289 ;; Add flags for compilation with gcc >= 10
1290 ,(string-append "--with-extra-cflags=-fcommon"
1291 " -fno-delete-null-pointer-checks"
1292 " -fno-lifetime-dse"
1293 ;; flags for compilation with gcc >= 14.
1294 " -Wno-error=int-conversion")
1295 (string-append "--with-freetype="
1296 (assoc-ref inputs "freetype"))
1297 "--disable-freetype-bundling"
1298 "--disable-warnings-as-errors"
1299 "--disable-hotspot-gtest"
1300 "--with-giflib=system"
1301 "--with-libjpeg=system"
1302 "--with-native-debug-symbols=zipped"
1303 (string-append "--prefix=" (assoc-ref outputs "out")))))
1304 (add-after 'unpack 'disable-warnings-as-errors
1305 (lambda _
1306 ;; It looks like the "--disable-warnings-as-errors" option of
1307 ;; the 'configure' phase is not working.
1308 (substitute* "make/autoconf/generated-configure.sh"
1309 (("-Werror") ""))))))
1310 ((#:disallowed-references _ '())
1311 `(,(this-package-native-input "openjdk9")
1312 ,(gexp-input (this-package-native-input "openjdk9") "jdk")))))
1313 (native-inputs
1314 `(("openjdk9" ,openjdk9)
1315 ("openjdk9:jdk" ,openjdk9 "jdk")
1316 ("[email protected]" ,gnu-make-4.2)
1317 ("nss-certs" ,nss-certs)
1318 ("unzip" ,unzip)
1319 ("which" ,which)
1320 ("zip" ,zip)))))
1321
1322(define-public openjdk11
1323 (package
1324 (name "openjdk")
1325 (version "11.0.22")
1326 (source (origin
1327 (method url-fetch)
1328 (uri (string-append "https://openjdk-sources.osci.io/openjdk11/openjdk-"
1329 version "-ga.tar.xz"))
1330 (file-name (string-append name "-" version ".tar.xz"))
1331 (sha256
1332 (base32
1333 "18ca4syp9xlrqjgyjkb1sp9835riy6aym5xs81r8byrz6jlb2473"))
1334 (modules '((guix build utils)))
1335 (snippet
1336 '(for-each delete-file (find-files "." "\\.(bin|exe|jar)$")))
1337 (patches
1338 (search-patches "openjdk-10-module3-reproducibility.patch"
1339 "openjdk-10-module4-reproducibility.patch"
1340 "openjdk-10-char-reproducibility.patch"
1341 "openjdk-11-classlist-reproducibility.patch"
1342 "openjdk-10-jar-reproducibility.patch"
1343 "openjdk-10-jtask-reproducibility.patch"
1344 "openjdk-currency-time-bomb2.patch"))))
1345 (build-system gnu-build-system)
1346 (outputs '("out" "jdk" "doc"))
1347 (arguments
1348 (list
1349 ;; Prevent a java.util.ConcurrentModificationException.
1350 #:parallel-build? #f
1351 #:modules `((guix build gnu-build-system)
1352 (guix build utils)
1353 (ice-9 match)
1354 (ice-9 popen)
1355 (srfi srfi-1)
1356 (srfi srfi-26))
1357
1358 #:disallowed-references
1359 (list (this-package-native-input "openjdk")
1360 (gexp-input (this-package-native-input "openjdk")
1361 "jdk"))
1362
1363 #:tests? #f ; requires jtreg
1364 ;; TODO package jtreg
1365 #:configure-flags
1366 #~(list
1367 ;; Add flags for compilation with gcc >= 10.
1368 #$(string-append "--with-extra-cflags=-fcommon"
1369 " -fno-delete-null-pointer-checks"
1370 " -fno-lifetime-dse"
1371 ;; flags for compilation with gcc >= 14.
1372 " -Wno-error=int-conversion")
1373 ;; Otherwise, the '--enable-fast-install' causes an error.
1374 "--disable-option-checking"
1375 "--disable-warnings-as-errors"
1376 ;; Make validate-runpath pass (see:
1377 ;; http://issues.guix.info/issue/32894).
1378 "--with-native-debug-symbols=zipped"
1379 ;; Do not use the bundled libraries.
1380 "--with-giflib=system"
1381 "--with-lcms=system"
1382 "--with-libjpeg=system"
1383 "--with-libpng=system"
1384 "--with-version-pre="
1385 ;; Should be set by SOURCE_DATE_EPOCH handler, but isn't being
1386 ;; set; do it manually.
1387 "--with-hotspot-build-time=1970-01-01T00:00:01"
1388 "--enable-reproducible-build" ; to be sure
1389 ;; Allow the build system to locate the system freetype.
1390 (string-append "--with-freetype-include="
1391 #$(this-package-input "freetype") "/include")
1392 (string-append "--with-freetype-lib="
1393 #$(this-package-input "freetype") "/lib"))
1394 #:phases
1395 #~(modify-phases %standard-phases
1396 (add-after 'patch-source-shebangs 'fix-java-shebangs
1397 (lambda _
1398 ;; This file was "fixed" by patch-source-shebangs, but it requires
1399 ;; this exact first line.
1400 (substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
1401 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))
1402 (add-after 'unpack 'remove-timestamping
1403 (lambda _
1404 (substitute* "src/hotspot/share/runtime/abstract_vm_version.cpp"
1405 (("__DATE__") "")
1406 (("__TIME__") ""))))
1407 (add-after 'unpack 'patch-jni-libs
1408 ;; Hardcode dynamically loaded libraries.
1409 (lambda _
1410 (define remove
1411 (@ (srfi srfi-1) remove))
1412
1413 (define (icedtea-or-openjdk? path)
1414 (or (string-contains path "openjdk")
1415 (string-contains path "icedtea")))
1416
1417 (let* ((library-path (remove icedtea-or-openjdk?
1418 (search-path-as-string->list
1419 (getenv "LIBRARY_PATH"))))
1420 (find-library (lambda (name)
1421 (or (search-path
1422 library-path
1423 (string-append "lib" name ".so"))
1424 (string-append "lib" name ".so")))))
1425 (for-each
1426 (lambda (file)
1427 (catch 'decoding-error
1428 (lambda ()
1429 (substitute* file
1430 (("VERSIONED_JNI_LIB_NAME\\(\"([^\"]*)\", \"([^\"]*)\"\\)"
1431 _ name version)
1432 (string-append "\"" (find-library name) "\""))
1433 (("JNI_LIB_NAME\\(\"([^\"]*)\"\\)" _ name)
1434 (string-append "\"" (find-library name) "\""))))
1435 (lambda _
1436 ;; Those are safe to skip.
1437 (format (current-error-port)
1438 "warning: failed to substitute: ~a~%"
1439 file))))
1440 (find-files "." "\\.c$|\\.h$")))))
1441 (add-before 'build 'write-source-revision-file
1442 (lambda _
1443 (with-output-to-file ".src-rev"
1444 (lambda _
1445 (display #$version)))))
1446 (replace 'build
1447 (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
1448 (apply invoke "make" "all"
1449 `(,@(if parallel-build?
1450 (list (string-append "JOBS="
1451 (number->string (parallel-job-count))))
1452 '("JOBS=1"))
1453 ,@make-flags))))
1454 ;; jdk 11 does not build jre by default any more; so explicitly build
1455 ;; it (see:
1456 ;; https://github.com/AdoptOpenJDK/openjdk-build/issues/356).
1457 (add-after 'build 'build-jre
1458 (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
1459 (apply invoke "make" "legacy-jre-image"
1460 `(,@(if parallel-build?
1461 (list (string-append "JOBS="
1462 (number->string (parallel-job-count))))
1463 '("JOBS=1"))
1464 ,@make-flags))))
1465 (replace 'install
1466 (lambda _
1467 (let ((images (car (find-files "build" "-server-release"
1468 #:directories? #t))))
1469 (copy-recursively (string-append images "/images/jdk")
1470 #$output:jdk)
1471 (copy-recursively (string-append images "/images/jre")
1472 #$output)
1473 (copy-recursively (string-append images "/images/docs")
1474 #$output:doc))))
1475 ;; Some of the libraries in the lib/ folder link to libjvm.so.
1476 ;; But that shared object is located in the server/ folder, so it
1477 ;; cannot be found. This phase creates a symbolic link in the
1478 ;; lib/ folder so that the other libraries can find it.
1479 ;;
1480 ;; See:
1481 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1482 ;;
1483 ;; FIXME: Find the bug in the build system, so that this symlink is
1484 ;; not needed.
1485 (add-after 'install 'install-libjvm
1486 (lambda _
1487 (let ((lib-out (string-append #$output "/lib"))
1488 (lib-jdk (string-append #$output:jdk "/lib")))
1489 (symlink (string-append lib-jdk "/server/libjvm.so")
1490 (string-append lib-jdk "/libjvm.so"))
1491 (symlink (string-append lib-out "/server/libjvm.so")
1492 (string-append lib-out "/libjvm.so")))))
1493 (add-after 'install 'strip-character-data-timestamps
1494 (lambda _
1495 (let ((archive (string-append #$output:jdk "/lib/src.zip"))
1496 (dir (mkdtemp "zip-contents.XXXXXX")))
1497 (with-directory-excursion dir
1498 (invoke "unzip" archive))
1499 (delete-file archive)
1500 (with-directory-excursion dir
1501 (let ((char-data-files (find-files "." "CharacterData")))
1502 (for-each (lambda (file)
1503 (substitute* file
1504 (((string-append "This file was generated "
1505 "AUTOMATICALLY from a template "
1506 "file.*"))
1507 (string-append "This file was generated "
1508 "AUTOMATICALLY from a template "
1509 "file"))))
1510 char-data-files)))
1511 (with-directory-excursion dir
1512 (let ((files (find-files "." #:directories? #t)))
1513 (apply invoke "zip" "-0" "-X" archive files))))))
1514 (add-after 'strip-character-data-timestamps 'remove-extraneous-files
1515 (lambda* (#:key outputs #:allow-other-keys)
1516 ;; Remove the *.diz and src.zip files for space considerations.
1517 ;; The former are compressed debuginfo files not typically
1518 ;; shipped with Java distributions, while the later corresponds
1519 ;; to Java core API source files.
1520 (for-each delete-file
1521 (append-map (cut find-files <> "(^src\\.zip|\\.diz)$")
1522 (map (match-lambda
1523 ((name . dir)
1524 dir))
1525 outputs)))))
1526 (add-after 'remove-extraneous-files 'strip-archive-timestamps
1527 (lambda _
1528 (use-modules (ice-9 binary-ports)
1529 (rnrs bytevectors))
1530 (letrec ((repack-archive
1531 (lambda (archive)
1532 (let ((dir (mkdtemp "zip-contents.XXXXXX")))
1533 (with-directory-excursion dir
1534 (invoke "unzip" archive))
1535 (delete-file archive)
1536 (for-each (compose repack-archive canonicalize-path)
1537 (find-files dir "(ct\\.sym|\\.jar)$"))
1538 (let ((reset-file-timestamp
1539 (lambda (file)
1540 (let ((s (lstat file)))
1541 (unless (eq? (stat:type s) 'symlink)
1542 (format #t "reset ~a~%" file)
1543 (utime file 0 0 0 0))))))
1544 (for-each reset-file-timestamp
1545 (find-files dir #:directories? #t)))
1546 (with-directory-excursion dir
1547 (let ((files (find-files "." #:directories? #t)))
1548 (apply invoke "zip" "-0" "-X" archive files)))))))
1549 (for-each repack-archive
1550 (find-files #$output:doc "\\.zip$"))
1551 (for-each repack-archive
1552 (find-files #$output:jdk "\\.(zip|jar)$"))
1553 (repack-archive (string-append #$output:jdk "/lib/ct.sym"))
1554 (let ((repack-jmod
1555 (lambda (file-name)
1556 (call-with-input-file file-name
1557 (lambda (file)
1558 (let ((header #vu8(#x4a #x4d #x01 #x00)))
1559 (if (equal? (get-bytevector-n
1560 file (bytevector-length header))
1561 header)
1562 (let* ((header-length (bytevector-length header))
1563 (temp-file (mkstemp!
1564 (string-copy
1565 "temp-file.XXXXXX")))
1566 (temp-filename (port-filename temp-file))
1567 (content-length
1568 (- (stat:size (stat file))
1569 header-length)))
1570 (sendfile temp-file file content-length header-length)
1571 (delete-file file-name)
1572 (close-port temp-file)
1573 (repack-archive (canonicalize-path temp-filename))
1574 (call-with-output-file file-name
1575 (lambda (file)
1576 (put-bytevector file header)
1577 (call-with-input-file temp-filename
1578 (lambda (temp-file)
1579 (sendfile
1580 file temp-file
1581 (stat:size (stat temp-file)) 0)))))))))))))
1582 (for-each repack-jmod
1583 (find-files #$output:jdk "\\.jmod$"))))))
1584 (add-after 'install 'remove-timestamp-from-api-summary
1585 (lambda _
1586 (substitute* (string-append #$output:doc
1587 "/api/overview-summary.html")
1588 (("Generated by javadoc \\(11-internal\\).*$")
1589 "Generated by javadoc (11-internal) -->\n")))))))
1590 (inputs
1591 (list alsa-lib
1592 cups
1593 fontconfig
1594 freetype
1595 giflib
1596 lcms
1597 libjpeg-turbo
1598 libpng
1599 libx11
1600 libxext
1601 libxrandr
1602 libxrender
1603 libxt
1604 libxtst))
1605 (native-inputs
1606 (list autoconf
1607 bash ; not bash-minimal, needs ulimit
1608 openjdk10
1609 `(,openjdk10 "jdk")
1610 gnu-make-4.2
1611 nss-certs
1612 pkg-config
1613 unzip
1614 which
1615 zip))
1616 (home-page "https://openjdk.org/projects/jdk/11/")
1617 (synopsis "Java development kit")
1618 (description
1619 "This package provides the Java development kit OpenJDK.")
1620 (license license:gpl2+)))
1621
1622(define-syntax make-openjdk
1623 ;; Return an OpenJDK package at VERSION with checksum HASH, using BOOTSTRAP,
1624 ;; the bootstrap package. One or more FIELD can be provided to further
1625 ;; refine the package definition; for convenience, the BASE, NAME and
1626 ;; VERSION are defined in their scope.
1627 (lambda (x)
1628 (syntax-case x ()
1629 ((_ bootstrap version* hash field ...)
1630 (with-syntax ((base (datum->syntax x 'base))
1631 (name (datum->syntax x 'name))
1632 (version (datum->syntax x 'version)))
1633 #'(let ((base (package
1634 (inherit bootstrap)
1635 (name "openjdk")
1636 (version version*)
1637 (source
1638 (origin
1639 (inherit (package-source bootstrap))
1640 (method git-fetch)
1641 (uri (git-reference
1642 (url (format
1643 #f "https://github.com/openjdk/jdk~au"
1644 (version-major version*)))
1645 (commit (string-append "jdk-" version*
1646 "-ga"))))
1647 (file-name (git-file-name name version))
1648 (sha256 (base32 hash))))
1649 (properties
1650 '((release-tag-prefix . "jdk-")
1651 (release-tag-suffix . "-ga")
1652 (release-tag-version-delimiter . ".")))
1653 (native-inputs
1654 (modify-inputs (package-native-inputs bootstrap)
1655 (replace "openjdk" bootstrap)))
1656 (home-page (string-append
1657 "https://openjdk.java.net/projects/jdk/"
1658 (version-major version)))))
1659 (name "openjdk")
1660 (version version*))
1661 (package
1662 (inherit base)
1663 field
1664 ...)))))))
1665
1666(define-public openjdk12
1667 (make-openjdk
1668 openjdk11 "12.33" "0pi2gwib3j2imi4l623iaywrmvfh9rqzh82lj2gxqbrmg55swvjf"
1669 (source
1670 (origin
1671 (method url-fetch)
1672 (uri "http://hg.openjdk.java.net/jdk/jdk/archive/0276cba45aac.tar.bz2")
1673 (file-name (string-append name "-" version ".tar.bz2"))
1674 (sha256
1675 (base32
1676 "0pi2gwib3j2imi4l623iaywrmvfh9rqzh82lj2gxqbrmg55swvjf"))
1677 (modules '((guix build utils)))
1678 (snippet
1679 '(for-each delete-file (find-files "." "\\.(bin|exe|jar)$")))
1680 (patches (search-patches "openjdk-10-setsignalhandler.patch"))))
1681 (arguments
1682 (substitute-keyword-arguments (package-arguments openjdk11)
1683 ;; Re-enable parallel build.
1684 ((#:parallel-build? _ #t) #t)
1685 ((#:phases phases)
1686 #~(modify-phases #$phases
1687 #$@(if (target-aarch64?)
1688 #~((add-after 'unpack 'patch-for-aarch64
1689 (lambda _
1690 (substitute* "src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp"
1691 ;; This line is duplicated, so remove both occurrences,
1692 ;; then add back one occurrence by substituting a
1693 ;; comment that occurs once.
1694 (("using MacroAssembler::call_VM_leaf_base;") "")
1695 (("Interpreter specific version of call_VM_base")
1696 (string-append "Interpreter specific version of call_VM_base\n"
1697 " using MacroAssembler::call_VM_leaf_base;"))))))
1698 #~())
1699 (replace 'remove-timestamping
1700 (lambda _
1701 (substitute* "src/hotspot/share/runtime/vm_version.cpp"
1702 (("__DATE__") "")
1703 (("__TIME__") ""))))
1704 (replace 'fix-java-shebangs
1705 (lambda _
1706 ;; 'blocked' was renamed to 'blacklisted' in this version for
1707 ;; some reason.
1708 (substitute* "make/data/blacklistedcertsconverter/\
1709blacklisted.certs.pem"
1710 (("^#!.*")
1711 "#! java BlacklistedCertsConverter SHA-256\n"))))))))))
1712
1713(define-public openjdk13
1714 (make-openjdk openjdk12 "13.0.14"
1715 "1v92i5rhahqkjw8mz09c9qasnxqc67ygy0y266kdmm534z0da755"
1716 (source (origin
1717 (inherit (package-source base))
1718 (patches (search-patches "openjdk-13-classlist-reproducibility.patch"
1719 "openjdk-10-jtask-reproducibility.patch"))))
1720 (arguments
1721 (substitute-keyword-arguments (package-arguments openjdk12)
1722 ((#:phases phases)
1723 #~(modify-phases #$phases
1724 (replace 'remove-timestamping
1725 (lambda _
1726 (substitute*
1727 "src/hotspot/share/runtime/abstract_vm_version.cpp"
1728 (("__DATE__") "")
1729 (("__TIME__") ""))))))))))
1730
1731(define-public openjdk14
1732 (make-openjdk
1733 openjdk13 "14.0.2"
1734 "07k9bsbxwyf2z2n50z96nvhsdai916mxdxcr5lm44jz7f6xrwfq6"
1735 (source (origin
1736 (inherit (package-source base))
1737 (snippet ;override snippet
1738 '(begin
1739 ;; The m4 macro uses 'help' to search for builtins, which is
1740 ;; not available in bash-minimal
1741 (substitute* "make/autoconf/basics.m4"
1742 (("if help") "if command -v"))
1743 (for-each delete-file (find-files "." "\\.(bin|exe|jar)$"))))
1744 (patches (search-patches "openjdk-10-setsignalhandler.patch"
1745 "openjdk-10-jtask-reproducibility.patch"
1746 "openjdk-13-classlist-reproducibility.patch"))))))
1747
1748(define-public openjdk15
1749 (make-openjdk
1750 openjdk14 "15.0.10"
1751 "0hdllv348bws6m992bh73jik18x0sv0k2m9l817b3zb7q802sp7x"
1752 (source (origin
1753 (inherit (package-source base))
1754 (modules '())
1755 (snippet #f)
1756 (patches
1757 (search-patches "openjdk-15-jtask-reproducibility.patch"
1758 "openjdk-15-xcursor-no-dynamic.patch"))))
1759 (inputs
1760 (modify-inputs (package-inputs base)
1761 (append libxcursor))) ;for our patch to work
1762 (native-inputs
1763 (modify-inputs (package-native-inputs base)
1764 (delete "make" ;remove old gnu-make-4.2
1765 "openjdk") ;to remove non-jdk output
1766 (append `(,openjdk14 "jdk"))))))
1767
1768(define-public openjdk16
1769 (make-openjdk openjdk15 "16.0.2"
1770 "0587px2qbz07g3xi4a3ya6m630p72dvkxcn0bj1813pxnwvcgigz"
1771 (source (origin
1772 (inherit (package-source base))
1773 (patches (search-patches "openjdk-15-xcursor-no-dynamic.patch"
1774 "openjdk-10-setsignalhandler.patch"))))))
1775
1776(define-public openjdk17
1777 (make-openjdk
1778 openjdk16 "17.0.10"
1779 "1bq1rqnipz6wdr05s20gm8nlpb3328ljxckzvc5ag0gf7fzlhn5f"
1780 (source (origin
1781 (inherit (package-source base))
1782 (patches (search-patches "openjdk-15-xcursor-no-dynamic.patch"))))
1783 (arguments
1784 (substitute-keyword-arguments (package-arguments openjdk16)
1785 ((#:phases phases)
1786 #~(modify-phases #$phases
1787 (replace 'fix-java-shebangs
1788 (lambda _
1789 ;; 'blacklisted' was renamed back to 'blocked'.
1790 (substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
1791 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))))
1792
1793(define-public openjdk18
1794 (make-openjdk openjdk17 "18.0.2.1"
1795 "0zxanjzz4p3psqahlidh55vx1ldanq70c2ygk3gcfn9a94vnr9rg"))
1796
1797(define-public openjdk19
1798 (make-openjdk openjdk18 "19.0.2"
1799 "08kvx7n8qhhfl25pig966881j5h4x7y0pf4brq16x0283fc0f4d4"
1800 (arguments
1801 (substitute-keyword-arguments (package-arguments openjdk18)
1802 ((#:phases phases)
1803 #~(modify-phases #$phases
1804 (replace 'fix-java-shebangs
1805 (lambda _
1806 ;; Update file path.
1807 (substitute* "src/java.base/share/data/blockedcertsconverter/blocked.certs.pem"
1808 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))
1809 (add-before 'configure 'define-java-environment-variables
1810 (lambda* (#:key inputs #:allow-other-keys)
1811 ;; Fix for "valid range 1980-01-01T00:00:02Z to 2099-12-31T23:59:59Z".
1812 (setenv "SOURCE_DATE_EPOCH" "1234567890")))))))))
1813
1814(define-public openjdk20
1815 (make-openjdk openjdk19 "20.0.2"
1816 "1af1v2c3d8x4c6shzl6cv9qwq7a4hn5map5pjh9vjcky0hkzd489"))
1817
1818(define-public openjdk21
1819 (make-openjdk openjdk20 "21.0.2"
1820 "0d1g3wnzr5whjpq8gvxq0h7kd7lxd3xgc6bh3kg8vzz096asn0kj"
1821 (source (origin
1822 (inherit (package-source base))
1823 (patches (search-patches "openjdk-21-fix-rpath.patch"
1824 "openjdk-15-xcursor-no-dynamic.patch"))))
1825 (arguments
1826 (substitute-keyword-arguments (package-arguments base)
1827 ((#:phases phases)
1828 #~(modify-phases #$phases
1829 (replace 'fix-java-shebangs
1830 (lambda _
1831 ;; 'blacklisted' was renamed back to 'blocked'.
1832 (substitute* "src/java.base/share/data/blockedcertsconverter/blocked.certs.pem"
1833 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))))
1834
1835(define-public openjdk22
1836 (make-openjdk
1837 openjdk21 "22.0.2"
1838 "1nj414yj6v9qrlm48yv5llr4jmgj9g20v6zsd39xrdx4x4x4p3b6"
1839 (arguments
1840 (substitute-keyword-arguments (package-arguments base)
1841 ((#:phases phases)
1842 #~(modify-phases #$phases
1843 (add-after 'unpack 'do-not-disable-new-dtags
1844 (lambda _
1845 ;; Our validate-runpath phases checks for RUNPATH, not RPATH.
1846 (substitute* "make/autoconf/flags-cflags.m4"
1847 ((" -Wl,--disable-new-dtags") ""))))))))))
1848
1849(define-public openjdk23
1850 (make-openjdk
1851 openjdk22 "23.0.2"
1852 "0kxllznzhgqfn8b97krg2yp1ag41g4phmgqahrvzafd2bq6zclnf"
1853 (source (origin
1854 (inherit (package-source base))
1855 ;; The 'openjdk-21-fix-rpath.patch' no longer applies, and it
1856 ;; appears not needed anymore. The
1857 ;; 'openjdk-15-xcursor-no-dynamic.patch' doesn't apply anymore;
1858 ;; the fix should be pursued in libx11 (see:
1859 ;; https://issues.guix.gnu.org/54654)
1860 (patches '())))))
1861
1862(define-public openjdk24
1863 (make-openjdk
1864 openjdk23 "24.0.1"
1865 "0h6sbzbjyqg85iml41pswdh2z3d7h2hhb0sd5yll37r1mj5lsxmx"))
1866
1867(define-public openjdk25
1868 (make-openjdk
1869 openjdk24 "25"
1870 "15yzj370qgkh7jfcm2jzr8g7ah9x0p8m85ang7q4y6lnzk23ni76"))
1871
1872;;; Convenience alias to point to the latest version of OpenJDK.
1873(define-public openjdk openjdk25)
1874
1875
1876;; This version of JBR is here in order to be able to build custom
1877;; IntelliJ plugins. Those usually need both jbr11 and jbr17 for
1878;; tests.
1879(define-public jbr11
1880 (package
1881 (inherit openjdk11)
1882 (name "jbr")
1883 (version "11_0_16-b2248")
1884 (source (origin
1885 (method git-fetch)
1886 (uri (git-reference
1887 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1888 (commit (string-append "jb" version))))
1889 (file-name (string-append name "-" version "-checkout"))
1890 (sha256
1891 (base32
1892 "1fnrdx0wb21ghm6jczjzk7b9fz9hbdzd62512xhwpzvca57v2z09"))))
1893 (arguments
1894 (substitute-keyword-arguments (package-arguments openjdk11)
1895 ((#:configure-flags configure-flags)
1896 #~(append #$configure-flags
1897 (list "--with-jvm-features=shenandoahgc"
1898 "--enable-cds=yes"
1899 "--with-vendor-name=JetBrains s.r.o"
1900 "--with-vendor-url=https://www.jetbrains.com/"
1901 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
1902 (synopsis "JetBrains Java Runtime")
1903 (description "This package provides a Java runtime environment for
1904and Java development kit. It supports enhanced class redefinition (DCEVM),
1905includes a number of improvements in font rendering, keyboards support,
1906windowing/focus subsystems, HiDPI, accessibility, and performance,
1907provides better desktop integration and bugfixes not yet present in
1908OpenJDK.")
1909 (home-page "https://www.jetbrains.com/")
1910 (license license:gpl2+)))
1911
1912(define-public jbr17
1913 (package
1914 (inherit openjdk17)
1915 (name "jbr")
1916 (version "17.0.11b1207.30")
1917 (source (origin
1918 (method git-fetch)
1919 (uri (git-reference
1920 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1921 (commit (string-append "jbr-release-" version))))
1922 (file-name (string-append name "-" version "-checkout"))
1923 (sha256
1924 (base32
1925 "5bbf5z8faf9sdkig2fwkj06hb7hs9s3bpzzvbqn2i75lbwqk3bln"))
1926 (patches (search-patches "jbr-17-xcursor-no-dynamic.patch"))))
1927 (arguments
1928 (substitute-keyword-arguments (package-arguments openjdk17)
1929 ((#:configure-flags configure-flags)
1930 #~(append #$configure-flags
1931 (list "--with-jvm-features=shenandoahgc"
1932 "--enable-cds=yes"
1933 "--with-vendor-name=JetBrains s.r.o"
1934 "--with-vendor-url=https://www.jetbrains.com/"
1935 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
1936 (synopsis "JetBrains Java Runtime")
1937 (description "This package provides a Java runtime environment for
1938and Java development kit. It supports enhanced class redefinition (DCEVM),
1939includes a number of improvements in font rendering, keyboards support,
1940windowing/focus subsystems, HiDPI, accessibility, and performance,
1941provides better desktop integration and bugfixes not yet present in
1942OpenJDK.")
1943 (home-page "https://www.jetbrains.com/")
1944 (license license:gpl2+)))
1945
1946(define-public jbr21
1947 (package
1948 (inherit openjdk21)
1949 (name "jbr")
1950 (version "21.0.3b509.11")
1951 (source (origin
1952 (method git-fetch)
1953 (uri (git-reference
1954 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1955 (commit (string-append "jbr-release-" version))))
1956 (file-name (string-append name "-" version "-checkout"))
1957 (sha256
1958 (base32
1959 "03xkghbp0b1czc2ags9n8ilprf9sy4bhsma0wf8xfapqn6d2sfyd"))
1960 (patches (search-patches "openjdk-21-fix-rpath.patch"
1961 "jbr-17-xcursor-no-dynamic.patch"))))
1962 (inputs
1963 `(("wayland" ,wayland)
1964 ("libxkbcommon" ,libxkbcommon) ; for wayland
1965 ,@(package-inputs openjdk21)))
1966 (arguments
1967 (substitute-keyword-arguments (package-arguments openjdk21)
1968 ((#:configure-flags configure-flags)
1969 #~(append #$configure-flags
1970 (list "--with-jvm-features=shenandoahgc"
1971 "--enable-cds=yes"
1972 "--with-vendor-name=JetBrains s.r.o"
1973 "--with-vendor-url=https://www.jetbrains.com/"
1974 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
1975 (synopsis "JetBrains Java Runtime")
1976 (description "This package provides a Java runtime environment for
1977and Java development kit. It supports enhanced class redefinition (DCEVM),
1978includes a number of improvements in font rendering, keyboards support,
1979windowing/focus subsystems, HiDPI, accessibility, and performance,
1980provides better desktop integration and bugfixes not yet present in
1981OpenJDK.")
1982 (home-page "https://www.jetbrains.com/")
1983 (license license:gpl2+)))
1984
1985
1986(define-public ant/java8
1987 (package
1988 (name "ant")
1989 (version "1.10.15")
1990 (source (origin
1991 (method url-fetch)
1992 (uri (string-append "mirror://apache/ant/source/apache-ant-"
1993 version "-src.tar.gz"))
1994 (sha256
1995 (base32
1996 "1ccr852dxg5affdqafg04gi3l89q5c6l9lqrz50jhj05kidljax2"))
1997 (modules '((guix build utils)))
1998 (snippet
1999 '(begin
2000 (for-each delete-file
2001 (find-files "lib/optional" "\\.jar$"))
2002 #t))))
2003 (build-system gnu-build-system)
2004 (arguments
2005 (list
2006 #:modules '((srfi srfi-1)
2007 (guix build gnu-build-system)
2008 (guix build utils))
2009 #:tests? #f ;no "check" target
2010 #:phases
2011 #~(modify-phases %standard-phases
2012 (add-after 'unpack 'remove-scripts
2013 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
2014 ;; wrappers.
2015 (lambda _
2016 (for-each delete-file
2017 (find-files "src/script"
2018 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))))
2019 (delete 'bootstrap)
2020 (delete 'configure)
2021 (replace 'build
2022 (lambda* (#:key inputs #:allow-other-keys)
2023 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
2024
2025 ;; Disable tests to avoid dependency on hamcrest-core, which needs
2026 ;; Ant to build. This is necessary in addition to disabling the
2027 ;; "check" phase, because the dependency on "test-jar" would always
2028 ;; result in the tests to be run.
2029 (substitute* "build.xml"
2030 (("depends=\"jars,test-jar") "depends=\"jars"))
2031 (invoke "bash" "bootstrap.sh"
2032 (string-append "-Ddist.dir=" #$output))))
2033 (add-after 'build 'strip-jar-timestamps ;based on ant-build-system
2034 (lambda _
2035 (define (repack-archive jar)
2036 (let* ((dir (mkdtemp "jar-contents.XXXXXX"))
2037 (manifest (string-append dir "/META-INF/MANIFESTS.MF")))
2038 (with-directory-excursion dir
2039 (invoke "unzip" jar))
2040 (delete-file jar)
2041 ;; XXX: copied from (gnu build install)
2042 (for-each (lambda (file)
2043 (let ((s (lstat file)))
2044 (unless (eq? (stat:type s) 'symlink)
2045 (utime file 0 0 0 0))))
2046 (find-files dir #:directories? #t))
2047 ;; It is important that the manifest appears first.
2048 (with-directory-excursion dir
2049 (let* ((files (find-files "." ".*" #:directories? #t))
2050 ;; To ensure that the reference scanner can
2051 ;; detect all store references in the jars
2052 ;; we disable compression with the "-0" option.
2053 (command (if (file-exists? manifest)
2054 `("zip" "-0" "-X" ,jar ,manifest
2055 ,@files)
2056 `("zip" "-0" "-X" ,jar ,@files))))
2057 (apply invoke command)))))
2058 (for-each repack-archive
2059 (find-files
2060 (string-append #$output "/lib")
2061 "\\.jar$"))))
2062 (delete 'install))))
2063 (native-inputs
2064 `(("jdk" ,icedtea-8 "jdk")
2065 ("zip" ,zip)
2066 ("unzip" ,unzip)))
2067 (home-page "https://ant.apache.org")
2068 (synopsis "Build tool for Java")
2069 (description
2070 "Ant is a platform-independent build tool for Java. It is similar to
2071make but is implemented using the Java language, requires the Java platform,
2072and is best suited to building Java projects. Ant uses XML to describe the
2073build process and its dependencies, whereas Make uses Makefile format.")
2074 (license license:asl2.0)))
2075
2076;; The 1.9.x series is the last that can be built with GCJ. The 1.10.x series
2077;; requires Java 8.
2078(define-public ant
2079 (package (inherit ant/java8)
2080 (version "1.9.15")
2081 (source (origin
2082 (method url-fetch)
2083 (uri (string-append "mirror://apache/ant/source/apache-ant-"
2084 version "-src.tar.gz"))
2085 (sha256
2086 (base32
2087 "1xy30f1w5gaqk6g3f0vw7ygix4rb6032qkcw42y4z8wd9jihgygd"))))
2088 ;; XXX: we do this to avoid a rebuild. This mess will be cleaned up
2089 ;; later.
2090 (arguments
2091 (substitute-keyword-arguments
2092 `(#:modules ((srfi srfi-1)
2093 (guix build gnu-build-system)
2094 (guix build utils))
2095 #:tests? #f ; no "check" target
2096 #:phases
2097 (modify-phases %standard-phases
2098 (delete 'bootstrap)
2099 (delete 'configure)
2100 (add-before 'build 'define-java-environment-variables
2101 (lambda* (#:key inputs #:allow-other-keys)
2102 ;; First, set environment variables (eases debugging on -K).
2103 (setenv "JAVA_HOME" (assoc-ref inputs "jamvm"))
2104 (setenv "JAVACMD" (search-input-file inputs "/bin/jamvm"))
2105 (setenv "JAVAC" (search-input-file inputs "/bin/jikes"))
2106 (setenv "CLASSPATH" (search-input-file inputs "/lib/rt.jar"))))
2107 (replace 'build
2108 (lambda* (#:key inputs outputs #:allow-other-keys)
2109 ;; Ant complains if this file doesn't exist.
2110 (setenv "HOME" "/tmp")
2111 (with-output-to-file "/tmp/.ant.properties"
2112 (lambda _ (display "")))
2113
2114 ;; Use jikes instead of javac for <javac ...> tags in build.xml
2115 (setenv "ANT_OPTS" "-Dbuild.compiler=jikes")
2116
2117 ;; jikes produces lots of warnings, but they are not very
2118 ;; interesting, so we silence them.
2119 (setenv "$BOOTJAVAC_OPTS" "-nowarn")
2120
2121 ;; Without these JamVM options the build may freeze.
2122 (substitute* "bootstrap.sh"
2123 (("^\"\\$\\{JAVACMD\\}\" " m)
2124 ,@(if (string-prefix? "armhf" (or (%current-system)
2125 (%current-target-system)))
2126 `((string-append m "-Xnocompact "))
2127 `((string-append m "-Xnocompact -Xnoinlining ")))))
2128
2129 ;; Disable tests because we are bootstrapping and thus don't have
2130 ;; any of the dependencies required to build and run the tests.
2131 (substitute* "build.xml"
2132 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
2133 (invoke "bash" "bootstrap.sh"
2134 (string-append "-Ddist.dir="
2135 (assoc-ref outputs "out")))))
2136 (add-after 'build 'strip-jar-timestamps ;based on ant-build-system
2137 (lambda* (#:key outputs #:allow-other-keys)
2138 (define (repack-archive jar)
2139 (let* ((dir (mkdtemp "jar-contents.XXXXXX"))
2140 (manifest (string-append dir "/META-INF/MANIFESTS.MF")))
2141 (with-directory-excursion dir
2142 (invoke "unzip" jar))
2143 (delete-file jar)
2144 ;; XXX: copied from (gnu build install)
2145 (for-each (lambda (file)
2146 (let ((s (lstat file)))
2147 (unless (eq? (stat:type s) 'symlink)
2148 (utime file 0 0 0 0))))
2149 (find-files dir #:directories? #t))
2150 ;; It is important that the manifest appears first.
2151 (with-directory-excursion dir
2152 (let* ((files (find-files "." ".*" #:directories? #t))
2153 ;; To ensure that the reference scanner can
2154 ;; detect all store references in the jars
2155 ;; we disable compression with the "-0" option.
2156 (command (if (file-exists? manifest)
2157 `("zip" "-0" "-X" ,jar ,manifest
2158 ,@files)
2159 `("zip" "-0" "-X" ,jar ,@files))))
2160 (apply invoke command)))))
2161 (for-each repack-archive
2162 (find-files
2163 (string-append (assoc-ref %outputs "out") "/lib")
2164 "\\.jar$"))))
2165 (delete 'install)))
2166 ((#:phases phases)
2167 `(modify-phases ,phases
2168 (delete 'define-java-environment-variables)
2169 (add-after 'unpack 'remove-scripts
2170 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
2171 ;; wrappers.
2172 (lambda _
2173 (for-each delete-file
2174 (find-files "src/script"
2175 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))
2176 #t))
2177 (replace 'build
2178 (lambda* (#:key inputs outputs #:allow-other-keys)
2179 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
2180
2181 ;; Disable tests to avoid dependency on hamcrest-core, which needs
2182 ;; Ant to build. This is necessary in addition to disabling the
2183 ;; "check" phase, because the dependency on "test-jar" would always
2184 ;; result in the tests to be run.
2185 (substitute* "build.xml"
2186 (("depends=\"jars,test-jar") "depends=\"jars"))
2187 (invoke "bash" "bootstrap.sh"
2188 (string-append "-Ddist.dir="
2189 (assoc-ref outputs "out")))))))))
2190 (native-inputs
2191 `(("jdk" ,icedtea-7 "jdk")
2192 ("zip" ,zip)
2193 ("unzip" ,unzip)))))
2194
2195(define-public ant-apache-bcel
2196 (package
2197 (inherit ant/java8)
2198 (name "ant-apache-bcel")
2199 (arguments
2200 (substitute-keyword-arguments (package-arguments ant/java8)
2201 ((#:phases phases)
2202 #~(modify-phases #$phases
2203 (add-after 'unpack 'link-bcel
2204 (lambda* (#:key inputs #:allow-other-keys)
2205 (for-each (lambda (file)
2206 (symlink file
2207 (string-append "lib/optional/"
2208 (basename file))))
2209 (find-files (assoc-ref inputs "java-commons-bcel")
2210 "\\.jar$"))))
2211 (add-after 'build 'install
2212 (lambda _
2213 (let ((share (string-append #$output "/share/java"))
2214 (bin (string-append #$output "/bin"))
2215 (lib (string-append #$output "/lib")))
2216 (mkdir-p share)
2217 (install-file (string-append lib "/ant-apache-bcel.jar") share)
2218 (delete-file-recursively bin)
2219 (delete-file-recursively lib))))))))
2220 (inputs
2221 (modify-inputs (package-inputs ant/java8)
2222 (prepend java-commons-bcel)))))
2223
2224(define-public ant-junit
2225 (package
2226 (inherit ant/java8)
2227 (name "ant-junit")
2228 (arguments
2229 (substitute-keyword-arguments (package-arguments ant/java8)
2230 ((#:phases phases)
2231 #~(modify-phases #$phases
2232 (add-after 'unpack 'link-junit
2233 (lambda* (#:key inputs #:allow-other-keys)
2234 (for-each (lambda (file)
2235 (symlink file
2236 (string-append "lib/optional/"
2237 (basename file))))
2238 (find-files (assoc-ref inputs "java-junit")
2239 "\\.jar$"))))
2240 (add-after 'build 'install
2241 (lambda _
2242 (let ((share (string-append #$output "/share/java"))
2243 (bin (string-append #$output "/bin"))
2244 (lib (string-append #$output "/lib")))
2245 (mkdir-p share)
2246 (install-file (string-append lib "/ant-junit.jar") share)
2247 (delete-file-recursively bin)
2248 (delete-file-recursively lib))))))))
2249 (inputs
2250 (modify-inputs (package-inputs ant/java8)
2251 (prepend java-junit)))))
2252
2253(define-public libantlr3c
2254 (package
2255 (name "libantlr3c")
2256 (version "3.4")
2257 (source
2258 (origin
2259 (method url-fetch)
2260 (uri
2261 (string-append "https://www.antlr3.org/download/C/"
2262 name "-" version ".tar.gz"))
2263 (sha256
2264 (base32 "0lpbnb4dq4azmsvlhp6khq1gy42kyqyjv8gww74g5lm2y6blm4fa"))))
2265 (build-system gnu-build-system)
2266 (arguments
2267 (list #:configure-flags
2268 #~(list "--enable-debuginfo"
2269 "--disable-static"
2270 #$@(if (target-64bit?)
2271 #~("--enable-64bit")
2272 #~())
2273 #$@(if (target-riscv64?)
2274 #~("--disable-abiflags")
2275 #~()))))
2276 (synopsis "ANTLR C Library")
2277 (description "LIBANTLR3C provides run-time C libraries for ANTLR3 (ANother
2278Tool for Language Recognition v3).")
2279 (home-page "https://www.antlr3.org/")
2280 (license license:bsd-3)))
2281
2282(define-public drip
2283 ;; Last release is from 2014, with a few important commits afterwards.
2284 (let ((commit "a4bd00df0199e78243847f06cc04ecaea31f8f08"))
2285 (package
2286 (name "drip")
2287 (version (git-version "0.2.4" "1" commit))
2288 (source (origin
2289 (method git-fetch)
2290 (uri (git-reference
2291 (url "https://github.com/ninjudd/drip")
2292 (commit commit)))
2293 (file-name (git-file-name name version))
2294 (sha256
2295 (base32
2296 "0wzmjwfyldr3jn49517xd8yn7dgdk8h88qkga3kjyg1zc375ylg2"))))
2297 (build-system gnu-build-system)
2298 (native-inputs
2299 `(("jdk" ,icedtea "jdk")))
2300 (arguments
2301 (list #:tests? #f ; No tests.
2302 #:phases
2303 #~(modify-phases %standard-phases
2304 (delete 'configure)
2305 (add-before 'build 'relax-gcc-14-strictness
2306 (lambda _
2307 (substitute* "Makefile"
2308 ((" gcc(.*)$" all options)
2309 (string-append
2310 " gcc"
2311 " -Wno-error=incompatible-pointer-types"
2312 " -Wno-error=implicit-function-declaration"
2313 options)))))
2314 (add-before 'install 'fix-wrapper
2315 (lambda* (#:key inputs #:allow-other-keys)
2316 (let ((jps (search-input-file inputs "/bin/jps")))
2317 (substitute* "bin/drip"
2318 (("jps") jps)
2319 (("brew update && brew upgrade drip") "guix pull && guix install drip")
2320 ;; No need to make:
2321 (("\\(cd -- \"\\$drip_dir\" && make -s\\) \\|\\| exit 1") "")
2322 ;; No need to include source:
2323 (("\\[\\[ -r \\$drip_dir/src/org/flatland/drip/Main\\.java \\]\\]")
2324 "true")))))
2325 (replace 'install
2326 (lambda* (#:key outputs #:allow-other-keys)
2327 (let* ((bin (string-append #$output "/bin"))
2328 (share (string-append #$output "/share/drip")))
2329 (mkdir-p bin)
2330 (for-each
2331 (lambda (file)
2332 (install-file (string-append "bin/" file) bin))
2333 '("drip" "drip_daemon" "drip_proxy"))
2334 (install-file "drip.jar" share)
2335 (substitute* (string-append bin "/drip")
2336 (("drip_dir=\\$bin_dir/..")
2337 (string-append "drip_dir=" share)))))))))
2338 (home-page "https://github.com/ninjudd/drip")
2339 (synopsis "Faster Java Virtual Machine launching")
2340 (description "Drip is a launcher for the Java Virtual Machine that
2341provides much faster startup times than the @command{java} command. The @command{drip}
2342script is intended to be a drop-in replacement for the @command{java} command,
2343only faster.")
2344 (license license:epl1.0))))
2345
2346(define-public java-openjfx-build
2347 (package
2348 (name "java-openjfx-build")
2349 ;; This is a java-8 version
2350 (version "8.202")
2351 (source (origin
2352 (method hg-fetch)
2353 (uri (hg-reference
2354 (url "http://hg.openjdk.java.net/openjfx/8u-dev/rt")
2355 (changeset (string-append
2356 (string-join (string-split version #\.) "u")
2357 "-ga"))))
2358 (file-name (string-append name "-" version "-checkout"))
2359 (modules '((guix build utils)))
2360 (snippet
2361 '(begin
2362 ;; Delete included gradle jar
2363 (delete-file-recursively "gradle/wrapper")
2364 #t))
2365 (sha256
2366 (base32
2367 "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))
2368 (patches (search-patches "java-openjfx-build-jdk_version.patch"))))
2369 (build-system ant-build-system)
2370 (arguments
2371 `(#:jar-name "java-openjfx.jar"
2372 #:source-dir "buildSrc/src/main/java"
2373 #:test-dir "buildSrc/src/test"
2374 #:phases
2375 (modify-phases %standard-phases
2376 (add-before 'configure 'generate-jsl-parser
2377 (lambda _
2378 (invoke "antlr3" "-o"
2379 "buildSrc/src/main/java/com/sun/scenario/effect/compiler"
2380 "buildSrc/src/main/antlr/JSL.g"))))))
2381 (inputs
2382 (list antlr3 java-stringtemplate))
2383 (native-inputs
2384 (list java-junit java-hamcrest-core))
2385 (home-page "https://openjfx.io")
2386 (synopsis "Graphical application toolkit in Java")
2387 (description "OpenJFX is a client application platform for desktop,
2388mobile and embedded systems built on Java. Its goal is to produce a
2389modern, efficient, and fully featured toolkit for developing rich client
2390applications. This package contains base classes for the OpenJFX
2391distribution and helper classes for building other parts of the
2392distribution.")
2393 (license license:gpl2))) ;gpl2 only, with classpath exception
2394
2395(define-public java-openjfx-base
2396 (package (inherit java-openjfx-build)
2397 (name "java-openjfx-base")
2398 (arguments
2399 `(#:jar-name "java-openjfx-base.jar"
2400 #:source-dir "modules/base/src/main/java:modules/base/src/main/java8:modules/base/src/main/version-info"
2401 #:test-dir "modules/base/src/test"
2402 #:phases
2403 (modify-phases %standard-phases
2404 (add-before 'check 'remove-empty-file
2405 (lambda _
2406 (with-directory-excursion "modules/base/src/test/java"
2407 ;; These files are completely commented, but junit expects them to
2408 ;; contain a class, so tests fail.
2409 (delete-file
2410 "com/sun/javafx/property/adapter/PropertyDescriptorTest.java")
2411 (delete-file
2412 "com/sun/javafx/property/adapter/ReadOnlyPropertyDescriptorTest.java")
2413 (delete-file "javafx/beans/property/PropertiesTest.java")
2414 (delete-file
2415 "javafx/beans/property/adapter/ReadOnlyJavaBeanPropertyBuilder_General_Test.java")
2416 ;; This one fails
2417 (delete-file "com/sun/javafx/runtime/VersionInfoTest.java"))
2418 #t)))))
2419 (propagated-inputs
2420 (list java-openjfx-build))
2421 (description "OpenJFX is a client application platform for desktop,
2422mobile and embedded systems built on Java. Its goal is to produce a
2423modern, efficient, and fully featured toolkit for developing rich client
2424applications. This package contains base classes for the OpenJFX
2425distribution.")))
2426
2427(define-public java-openjfx-graphics
2428 (package (inherit java-openjfx-build)
2429 (name "java-openjfx-graphics")
2430 (arguments
2431 `(#:jar-name "java-openjfx-graphics.jar"
2432 #:source-dir "modules/graphics/src/main/java"
2433 #:tests? #f; require X
2434 #:test-dir "modules/graphics/src/test"
2435 #:phases
2436 (modify-phases %standard-phases
2437 (add-after 'unpack 'copy-missing-file
2438 (lambda* (#:key inputs #:allow-other-keys)
2439 (let ((target "modules/graphics/src/main/native-prism-sw/JNativeSurface.c"))
2440 (copy-file (assoc-ref inputs "JNativeSurface.c") target)
2441 ;; XXX: looks like the missing file we found isn't *quite*
2442 ;; compatible...
2443 (substitute* target
2444 (("case TYPE_INT_ARGB:") "")))))
2445 (add-after 'build 'build-native
2446 (lambda* (#:key inputs outputs #:allow-other-keys)
2447 (let ((jdk (assoc-ref inputs "jdk"))
2448 (class-file->class-name
2449 (lambda (class-file)
2450 (string-map (lambda (c)
2451 (if (char=? c #\/) #\. c))
2452 (string-drop-right class-file
2453 (string-length ".class"))))))
2454 (setenv "CPPFLAGS"
2455 (string-append "-DINLINE=inline "
2456 "-DLINUX "
2457 "-I" jdk "/include "
2458 "-I" jdk "/include/linux "
2459 "-I " (getcwd) "/build/classes/include "
2460 "-I " (getcwd) "/modules/graphics/src/main/native-prism-sw"))
2461
2462 ;; Instructions have been adapted from buildSrc/linux.gradle
2463 (with-directory-excursion "build/classes"
2464 ;; Build prism
2465 (mkdir-p "include")
2466
2467 ;; Generate headers for prism
2468 (apply invoke "javah" "-d" "include" "-cp" "."
2469 (map class-file->class-name
2470 (append (find-files "com/sun/prism/impl" "\\.class$")
2471 (find-files "com/sun/prism" "PresentableState.*\\.class$"))))
2472
2473 ;; ...then for prism_sw
2474 (apply invoke "javah" "-d" "include" "-cp" "."
2475 (map class-file->class-name
2476 (find-files "com/sun/pisces" "\\.class$")))
2477
2478 ;; ...and for prism_es2
2479 (apply invoke "javah" "-d" "include" "-cp" "."
2480 (map class-file->class-name
2481 (find-files "com/sun/prism/es2" "\\.class$")))))
2482
2483 (with-directory-excursion "netbeans/native-prism"
2484 (invoke "make" "CONF=Release"))
2485 (with-directory-excursion "netbeans/native-prism-sw"
2486 (invoke "make" "CONF=Release"))
2487 ;; TODO: This fails due to unknown EGL procedure names
2488 #;
2489 (with-directory-excursion "netbeans/native-prism-es2"
2490 (invoke "make" "CONF=Release"))
2491
2492 (let* ((out (assoc-ref outputs "out"))
2493 (dir ,(match (%current-system)
2494 ("i686-linux"
2495 "i386")
2496 ((or "armhf-linux" "aarch64-linux")
2497 "arm")
2498 ((or "x86_64-linux")
2499 "amd64")
2500 (_ "unknown")))
2501 (target (string-append out "/share/" dir "/")))
2502 (mkdir-p target)
2503 (for-each (lambda (file)
2504 (let ((new-name
2505 (string-append "lib"
2506 (string-map
2507 (lambda (c)
2508 (if (char=? c #\-) #\_ c))
2509 (string-drop (basename file)
2510 (string-length "libnative-"))))))
2511 (copy-file file
2512 (string-append target new-name))))
2513 (find-files "netbeans" "\\.so$"))))))))
2514 (propagated-inputs
2515 (list java-openjfx-base))
2516 (inputs
2517 (list java-swt))
2518 ;; XXX: for unknown reasons
2519 ;; modules/graphics/src/main/native-prism-sw/JNativeSurface.c is missing
2520 ;; in this revision.
2521 (native-inputs
2522 `(("JNativeSurface.c"
2523 ,(origin
2524 (method url-fetch)
2525 (uri "https://raw.githubusercontent.com/openjdk/jfx/8u20-b02\
2526/modules/graphics/src/main/native-prism-sw/JNativeSurface.c")
2527 (sha256
2528 (base32
2529 "1kp15wbnd6rn0nciczp5ibq0ikby2yysvx1gnz5fa05vl2mm8mbm"))))))
2530 (description "OpenJFX is a client application platform for desktop,
2531mobile and embedded systems built on Java. Its goal is to produce a
2532modern, efficient, and fully featured toolkit for developing rich client
2533applications. This package contains graphics-related classes for the
2534OpenJFX distribution.")))
2535
2536(define-public java-openjfx-media
2537 (package (inherit java-openjfx-build)
2538 (name "java-openjfx-media")
2539 (propagated-inputs
2540 `(("java-openjxf-graphics" ,java-openjfx-graphics)))
2541 (arguments
2542 `(#:jar-name "java-openjfx-media.jar"
2543 #:source-dir "modules/media/src/main/java"
2544 #:tests? #f)); no tests
2545 (description "OpenJFX is a client application platform for desktop,
2546mobile and embedded systems built on Java. Its goal is to produce a
2547modern, efficient, and fully featured toolkit for developing rich client
2548applications. This package contains media-related classes for the
2549OpenJFX distribution.")))
2550
2551(define-public java-openjfx-controls
2552 (package (inherit java-openjfx-build)
2553 (name "java-openjfx-controls")
2554 (propagated-inputs
2555 `(("java-openjxf-graphics" ,java-openjfx-graphics)))
2556 (arguments
2557 `(#:jar-name "java-openjfx-controls.jar"
2558 #:source-dir "modules/controls/src/main/java"
2559 #:test-dir "modules/controls/src/test"
2560 ;; TODO: tests require com.sun.javafx.pgstub,
2561 ;; javafx.collections.MockSetObserver, and
2562 ;; com.sun.javafx.binding.ExpressionHelperUtility
2563 #:tests? #false
2564 #:phases
2565 (modify-phases %standard-phases
2566 (add-after 'unpack 'copy-resources
2567 (lambda _
2568 (copy-recursively "modules/controls/src/test/resources"
2569 "build/test-classes")
2570 (copy-recursively "modules/controls/src/main/resources"
2571 "build/classes"))))))
2572 (description "OpenJFX is a client application platform for desktop,
2573mobile and embedded systems built on Java. Its goal is to produce a
2574modern, efficient, and fully featured toolkit for developing rich client
2575applications. This package contains UI control classes for the
2576OpenJFX distribution.")))
2577
2578(define-public javacc-4
2579 (package
2580 (name "javacc")
2581 (version "4.1")
2582 (source (origin
2583 (method git-fetch)
2584 (uri (git-reference
2585 (url "https://github.com/javacc/javacc")
2586 (commit "release_41")))
2587 (file-name (string-append "javacc-" version "-checkout"))
2588 (sha256
2589 (base32
2590 "07ysav7j8r1c6h8qxrgqk6lwdp74ly0ad1935lragxml0qqc3ka0"))
2591 (modules '((guix build utils)))
2592 ;; delete bundled jars
2593 (snippet '(begin (delete-file-recursively "lib") #t))))
2594 (build-system ant-build-system)
2595 ;; Tests fail with
2596 ;; /tmp/guix-build-javacc-4.1.drv-0/source/test/javacodeLA/build.xml:60:
2597 ;; JAVACODE failed
2598 (arguments
2599 `(#:tests? #f
2600 #:phases
2601 (modify-phases %standard-phases
2602 ;; Delete tests to avoid build failure (we don't run them anyway).
2603 (add-after 'unpack 'delete-tests
2604 (lambda _
2605 (for-each delete-file
2606 '("src/org/javacc/JavaCCTestCase.java"
2607 "src/org/javacc/parser/ExpansionTest.java"
2608 "src/org/javacc/parser/OptionsTest.java"
2609 "src/org/javacc/jjtree/JJTreeOptionsTest.java"))
2610 (for-each delete-file-recursively
2611 '("src/org/javacc/parser/test"
2612 "src/org/javacc/jjdoc/test"))
2613 #t))
2614 (replace 'install (install-jars "bin/lib")))))
2615 (home-page "https://javacc.org/")
2616 (synopsis "Java parser generator")
2617 (description "Java Compiler Compiler (JavaCC) is the most popular parser
2618generator for use with Java applications. A parser generator is a tool that
2619reads a grammar specification and converts it to a Java program that can
2620recognize matches to the grammar. In addition to the parser generator itself,
2621JavaCC provides other standard capabilities related to parser generation such
2622as tree building (via a tool called JJTree included with JavaCC), actions,
2623debugging, etc.")
2624 (license license:bsd-3)))
2625
2626;; javacc-3, as javacc-4 is not properly bootstrapped: is contains a javacc.jar
2627;; in the bootstrap/ directory.
2628(define-public javacc-3
2629 (package
2630 (inherit javacc-4)
2631 (version "3.2")
2632 (source (origin
2633 (method git-fetch)
2634 (uri (git-reference
2635 (url "https://github.com/javacc/javacc")
2636 (commit "release_32")))
2637 (file-name (string-append "javacc-" version "-checkout"))
2638 (sha256
2639 (base32
2640 "1pyf1xyh8gk83nxqn2v2mdws32l68ydznha41cxa4l2kkbq1v1g3"))))
2641 (arguments
2642 `(#:tests? #f
2643 #:phases
2644 (modify-phases %standard-phases
2645 (add-before 'build 'set-java-version
2646 (lambda _
2647 (for-each
2648 (lambda (file)
2649 (substitute* file
2650 (("debug=") "source=\"1.4\" debug=")))
2651 (find-files "." "build.xml"))
2652 #t))
2653 (replace 'install (install-jars "bin/lib")))))))
2654
2655(define-public javacc
2656 (package
2657 (inherit javacc-4)
2658 (version "7.0.4")
2659 (source
2660 (origin
2661 (method git-fetch)
2662 (uri (git-reference
2663 (url "https://github.com/javacc/javacc")
2664 (commit version)))
2665 (file-name (git-file-name "javacc" version))
2666 (sha256
2667 (base32 "18kkak3gda93gr25jrgy6q00g0jr8i24ri2wk4kybz1v234fxx9i"))
2668 (modules '((guix build utils)))
2669 ;; Delete bundled jars.
2670 (snippet '(begin (for-each delete-file-recursively
2671 '("bootstrap" "lib"))))))
2672 (arguments
2673 `(#:make-flags ; bootstrap from javacc-4
2674 ,#~(list (string-append "-Dbootstrap-jar="
2675 #$(this-package-native-input "javacc")
2676 "/share/java/javacc.jar"))
2677 #:test-target "test"
2678 #:phases
2679 (modify-phases %standard-phases
2680 (replace 'install (install-jars "target"))
2681 (add-after 'install 'install-bin
2682 (lambda* (#:key outputs inputs #:allow-other-keys)
2683 (let* ((out (assoc-ref outputs "out"))
2684 (dir (string-append out "/share/java"))
2685 (bin (string-append out "/bin"))
2686 (javacc (string-append bin "/javacc")))
2687 (mkdir-p bin)
2688 (with-output-to-file javacc
2689 (lambda _
2690 (display
2691 (string-append "#!/bin/sh\n"
2692 (assoc-ref inputs "icedtea") "/bin/java"
2693 " -cp " dir "/javacc.jar" " `basename $0`" " $*"))))
2694 (chmod javacc #o755)
2695 ;; symlink to different names to affect the first argument and
2696 ;; change the behavior of the jar file.
2697 (symlink javacc (string-append bin "/jjdoc"))
2698 (symlink javacc (string-append bin "/jjtree"))))))))
2699 (native-inputs
2700 (list javacc-4))
2701 (inputs (list icedtea-8))))
2702
2703(define-public java-ecj
2704 (package
2705 (name "java-ecj")
2706 (version "4.6.3")
2707 (source
2708 (origin
2709 (method url-fetch)
2710 (uri (string-append "http://archive.eclipse.org/eclipse/"
2711 "downloads/drops4/R-" version "-201703010400/"
2712 "ecjsrc-" version ".jar"))
2713 (sha256
2714 (base32
2715 "11cfgsdgznja1pvlxkjbqykxd7pcd5655vkm7s44xmahmap15gpl"))))
2716 (build-system ant-build-system)
2717 (arguments
2718 `(#:tests? #f ; none included
2719 #:build-target "build"
2720 #:phases
2721 (modify-phases %standard-phases
2722 (add-after 'unpack 'fix-build.xml
2723 (lambda _
2724 (substitute* "src/build.xml"
2725 (("^.*MANIFEST.*$")
2726 "")
2727 (("^.*properties.*$")
2728 "<include name=\"**/*.properties\"/>
2729 <include name=\"**/*.props\"/>"))))
2730 (add-before 'build 'chdir
2731 (lambda _ (chdir "src")))
2732 (replace 'install (install-jars ".")))))
2733 (home-page "https://eclipse.org")
2734 (synopsis "Eclipse Java development tools core batch compiler")
2735 (description "This package provides the Eclipse Java core batch compiler.")
2736 (license license:epl1.0)))
2737
2738(define-public java-cisd-base
2739 (let ((revision 38938)
2740 (base-version "14.12.0"))
2741 (package
2742 (name "java-cisd-base")
2743 (version (string-append base-version "-" (number->string revision)))
2744 (source (origin
2745 (method svn-fetch)
2746 (uri (svn-reference
2747 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2748 "base/tags/release/"
2749 (version-major+minor base-version)
2750 ".x/" base-version "/base/"))
2751 (revision revision)))
2752 (file-name (string-append "java-cisd-base-" version "-checkout"))
2753 (sha256
2754 (base32
2755 "1i5adyf7nzclb0wydgwa1az04qliid8035vpahaandmkmigbnxiy"))
2756 (modules '((guix build utils)))
2757 (snippet
2758 '(begin
2759 ;; Delete included gradle jar
2760 (delete-file-recursively "gradle/wrapper")
2761 ;; Delete pre-built native libraries
2762 (delete-file-recursively "libs")
2763 #t))))
2764 (build-system ant-build-system)
2765 (arguments
2766 `(#:make-flags '("-file" "build/build.xml")
2767 #:test-target "jar-test"
2768 #:jdk ,icedtea-8
2769 #:phases
2770 (modify-phases %standard-phases
2771 (add-after 'unpack 'unpack-build-resources
2772 (lambda* (#:key inputs #:allow-other-keys)
2773 (copy-recursively (assoc-ref inputs "build-resources")
2774 "../build_resources")
2775 #t))
2776 (add-after 'unpack-build-resources 'fix-dependencies
2777 (lambda* (#:key inputs #:allow-other-keys)
2778 (substitute* "build/build.xml"
2779 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
2780 (search-input-file inputs
2781 "/share/java/java-testng.jar"))
2782 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
2783 (search-input-file inputs
2784 (string-append
2785 "/share/java/commons-lang-"
2786 ,(package-version java-commons-lang)
2787 ".jar")))
2788 (("\\$\\{lib\\}/commons-io/commons-io.jar")
2789 (search-input-file inputs
2790 (string-append
2791 "/lib/m2/commons-io/commons-io/"
2792 ,(package-version java-commons-io)
2793 "/commons-io-"
2794 ,(package-version java-commons-io)
2795 ".jar")))
2796 ;; Remove dependency on svn
2797 (("<build-info.*") "")
2798 (("\\$\\{revision.number\\}")
2799 ,(number->string revision))
2800 (("\\$\\{version.number\\}") ,base-version))
2801 ;; Remove dependency on classycle
2802 (substitute* "../build_resources/ant/build-common.xml"
2803 (("<taskdef name=\"dependency-checker.*") "")
2804 (("classname=\"classycle.*") "")
2805 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
2806 #t))
2807 ;; A few tests fail because of the lack of a proper /etc/groups and
2808 ;; /etc/passwd file in the build container.
2809 (add-after 'unpack 'disable-broken-tests
2810 (lambda _
2811 (substitute* "sourceTest/java/ch/systemsx/cisd/base/AllTests.java"
2812 (("Unix.isOperational\\(\\)") "false"))
2813 #t))
2814 ;; These decorators are almost useless and pull in an unpackaged
2815 ;; dependency.
2816 (add-after 'unpack 'remove-useless-decorators
2817 (lambda _
2818 (substitute* "source/java/ch/systemsx/cisd/base/unix/Unix.java"
2819 (("@Private") "")
2820 (("import ch.rinn.restrictions.Private;") ""))
2821 (substitute* "sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java"
2822 (("@Friend.*") "")
2823 (("import ch.rinn.restrictions.Friend;") ""))
2824 #t))
2825 (add-before 'configure 'build-native-code
2826 (lambda* (#:key inputs #:allow-other-keys)
2827 (let ((jdk (assoc-ref inputs "jdk"))
2828 (dir ,(match (%current-system)
2829 ("i686-linux"
2830 "i386-Linux")
2831 ((or "armhf-linux" "aarch64-linux")
2832 "arm-Linux")
2833 ((or "x86_64-linux")
2834 "amd64-Linux")
2835 (_ "unknown-Linux"))))
2836 (with-directory-excursion "source/c"
2837 (invoke "gcc" "-shared" "-O3" "-fPIC" "unix.c"
2838 (string-append "-I" jdk "/include")
2839 (string-append "-I" jdk "/include/linux")
2840 "-o" "libunix.so")
2841 (invoke "gcc" "-shared" "-O3" "-fPIC"
2842 "-DMACHINE_BYTE_ORDER=1"
2843 "copyCommon.c"
2844 "copyByteChar.c"
2845 "copyByteDouble.c"
2846 "copyByteFloat.c"
2847 "copyByteInt.c"
2848 "copyByteLong.c"
2849 "copyByteShort.c"
2850 (string-append "-I" jdk "/include")
2851 (string-append "-I" jdk "/include/linux")
2852 "-o" "libnativedata.so"))
2853 (install-file "source/c/libunix.so"
2854 (string-append "libs/native/unix/" dir))
2855 (install-file "source/c/libnativedata.so"
2856 (string-append "libs/native/nativedata/" dir))
2857 #t)))
2858 ;; In the "check" phase we only build the test executable.
2859 (add-after 'check 'run-tests
2860 (lambda _
2861 (invoke "java" "-jar" "targets/dist/sis-base-test.jar")
2862 (delete-file "targets/dist/sis-base-test.jar")
2863 #t))
2864 (replace 'install (install-jars "targets/dist")))))
2865 (native-inputs
2866 `(("jdk" ,icedtea-8)
2867 ("java-commons-lang" ,java-commons-lang)
2868 ("java-commons-io" ,java-commons-io)
2869 ("java-testng" ,java-testng)
2870 ("build-resources"
2871 ,(origin
2872 (method svn-fetch)
2873 (uri (svn-reference
2874 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2875 "base/tags/release/"
2876 (version-major+minor base-version)
2877 ".x/" base-version
2878 "/build_resources/"))
2879 (revision revision)))
2880 (sha256
2881 (base32
2882 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
2883 (home-page "https://svnsis.ethz.ch")
2884 (synopsis "Utility classes for libraries from ETH Zurich")
2885 (description "This library supplies some utility classes needed for
2886libraries from the SIS division at ETH Zurich like jHDF5.")
2887 ;; The C sources are under a non-copyleft license, which looks like a
2888 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
2889 (license (list license:asl2.0
2890 (license:non-copyleft "file://source/c/COPYING"))))))
2891
2892(define-public java-cisd-args4j
2893 (let ((revision 39162)
2894 (base-version "9.11.2"))
2895 (package
2896 (name "java-cisd-args4j")
2897 (version (string-append base-version "-" (number->string revision)))
2898 (source (origin
2899 (method svn-fetch)
2900 (uri (svn-reference
2901 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2902 "args4j/tags/release/"
2903 (version-major+minor base-version)
2904 ".x/" base-version "/args4j/"))
2905 (revision revision)))
2906 (file-name (string-append "java-cisd-args4j-" version "-checkout"))
2907 (sha256
2908 (base32
2909 "0hhqznjaivq7ips7mkwas78z42s6djsm20rrs7g1zd59rcsakxn2"))))
2910 (build-system ant-build-system)
2911 (arguments
2912 `(#:make-flags '("-file" "build/build.xml")
2913 #:tests? #f ; there are no tests
2914 #:modules ((guix build ant-build-system)
2915 (guix build utils)
2916 (guix build java-utils)
2917 (sxml simple)
2918 (sxml transform)
2919 (sxml xpath))
2920 #:phases
2921 (modify-phases %standard-phases
2922 (add-after 'unpack 'unpack-build-resources
2923 (lambda* (#:key inputs #:allow-other-keys)
2924 (mkdir-p "../build_resources")
2925 (copy-recursively (assoc-ref inputs "build-resources")
2926 "../build_resources")
2927 (mkdir-p "../build_resources/lib")))
2928 (add-after 'unpack-build-resources 'fix-dependencies
2929 (lambda* (#:key inputs #:allow-other-keys)
2930 ;; FIXME: There should be a more convenient abstraction for
2931 ;; editing XML files.
2932 (with-directory-excursion "../build_resources/ant/"
2933 (chmod "build-common.xml" #o664)
2934 (call-with-output-file "build-common.xml.new"
2935 (lambda (port)
2936 (sxml->xml
2937 (pre-post-order
2938 (with-input-from-file "build-common.xml"
2939 (lambda _ (xml->sxml #:trim-whitespace? #t)))
2940 `(;; Remove dependency on classycle and custom ant tasks
2941 (taskdef . ,(lambda (tag . kids)
2942 (let ((name ((sxpath '(name *text*)) kids)))
2943 (if (or (member "build-info" name)
2944 (member "dependency-checker" name)
2945 (member "build-java-subprojects" name)
2946 (member "project-classpath" name))
2947 '() ; skip
2948 `(,tag ,@kids)))))
2949 (typedef . ,(lambda (tag . kids)
2950 (let ((name ((sxpath '(name *text*)) kids)))
2951 (if (member "recursive-jar" name)
2952 '() ; skip
2953 `(,tag ,@kids)))))
2954 (build-java-subprojects . ,(lambda _ '()))
2955 ;; Ignore everything else
2956 (*default* . ,(lambda (tag . kids) `(,tag ,@kids)))
2957 (*text* . ,(lambda (_ txt) txt))))
2958 port)))
2959 (rename-file "build-common.xml.new" "build-common.xml"))
2960 (substitute* "build/build.xml"
2961 (("\\$\\{lib\\}/cisd-base/cisd-base.jar")
2962 (search-input-file inputs "/share/java/sis-base.jar"))
2963 ;; Remove dependency on svn
2964 (("<build-info.*") "")
2965 (("\\$\\{revision.number\\}")
2966 ,(number->string revision))
2967 (("\\$\\{version.number\\}") ,base-version)
2968 ;; Don't use custom ant tasks.
2969 (("recursive-jar") "jar")
2970 (("<project-classpath.*") ""))))
2971 (replace 'install (install-jars "targets/dist")))))
2972 (inputs
2973 (list java-cisd-base))
2974 (native-inputs
2975 `(("ecj" ,java-ecj)
2976 ("build-resources"
2977 ,(origin
2978 (method svn-fetch)
2979 (uri (svn-reference
2980 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2981 "args4j/tags/release/"
2982 (version-major+minor base-version)
2983 ".x/" base-version
2984 "/build_resources/"))
2985 (revision revision)))
2986 (sha256
2987 (base32
2988 "056cam4k8pll7ass31sy6gwn8g8719njc41yf4l02b0342nilkyf"))
2989 (modules '((guix build utils)))
2990 ;; Delete bundled pre-built jars.
2991 (snippet
2992 '(begin (delete-file-recursively "lib/") #t))))))
2993 (home-page "https://svnsis.ethz.ch")
2994 (synopsis "Command line parser library")
2995 (description "This package provides a parser for command line arguments.")
2996 (license license:asl2.0))))
2997
2998(define-public java-cisd-jhdf5
2999 (let ((revision 39162)
3000 (base-version "14.12.6"))
3001 (package
3002 (name "java-cisd-jhdf5")
3003 (version (string-append base-version "-" (number->string revision)))
3004 (source (origin
3005 (method svn-fetch)
3006 (uri (svn-reference
3007 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3008 "jhdf5/tags/release/"
3009 (version-major+minor base-version)
3010 ".x/" base-version "/jhdf5/"))
3011 (revision revision)))
3012 (file-name (string-append "java-cisd-jhdf5-" version "-checkout"))
3013 (sha256
3014 (base32
3015 "13i17s2hn0q9drdqvp8csy7770p3hdbh9rp30ihln2ldkfawdmz0"))
3016 (modules '((guix build utils)))
3017 (snippet
3018 '(begin
3019 ;; Delete included gradle jar
3020 (delete-file-recursively "gradle/wrapper")
3021 ;; Delete pre-built native libraries
3022 (delete-file-recursively "libs")))))
3023 (build-system ant-build-system)
3024 (arguments
3025 `(#:make-flags '("-file" "build/build.xml")
3026 #:build-target "jar-all"
3027 #:test-target "jar-test"
3028 #:phases
3029 (modify-phases %standard-phases
3030 ;; FIXME: this build phase fails.
3031 (delete 'generate-jar-indices)
3032 ;; Don't erase results from the build phase when building tests.
3033 (add-after 'unpack 'separate-test-target-from-clean
3034 (lambda _
3035 (substitute* "build/build.xml"
3036 (("\"jar-test\" depends=\"clean, ")
3037 "\"jar-test\" depends=\""))))
3038 (add-after 'unpack 'unpack-build-resources
3039 (lambda* (#:key inputs #:allow-other-keys)
3040 (copy-recursively (assoc-ref inputs "build-resources")
3041 "../build_resources")
3042 (delete-file-recursively "../build_resources/lib/")
3043 (mkdir-p "../build_resources/lib")
3044 ;; Remove dependency on classycle
3045 (substitute* "../build_resources/ant/build-common.xml"
3046 (("<taskdef name=\"dependency-checker.*") "")
3047 (("classname=\"classycle.*") "")
3048 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
3049 ;; Remove dependency on svn
3050 (substitute* "build/build.xml"
3051 (("<build-info.*") "")
3052 (("\\$\\{revision.number\\}")
3053 ,(number->string revision))
3054 (("\\$\\{version.number\\}") ,base-version))))
3055 (add-after 'unpack-build-resources 'fix-dependencies
3056 (lambda* (#:key inputs #:allow-other-keys)
3057 (substitute* "../build_resources/ant/build-common.xml"
3058 (("../libraries/testng/testng-jdk15.jar")
3059 (search-input-file inputs
3060 "/share/java/java-testng.jar")))
3061 (substitute* "build/build.xml"
3062 (("\\$\\{lib\\}/sis-base/sis-base.jar")
3063 (search-input-file inputs
3064 "/share/java/sis-base.jar"))
3065 (("\\$\\{lib\\}/cisd-args4j/cisd-args4j.jar")
3066 (search-input-file inputs
3067 "/share/java/cisd-args4j.jar"))
3068 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
3069 (search-input-file inputs
3070 (string-append
3071 "/share/java/commons-lang-"
3072 ,(package-version java-commons-lang)
3073 ".jar")))
3074 (("\\$\\{lib\\}/commons-io/commons-io.jar")
3075 (search-input-file inputs
3076 (string-append
3077 "/lib/m2/commons-io/commons-io/"
3078 ,(package-version java-commons-io)
3079 "/commons-io-"
3080 ,(package-version java-commons-io)
3081 ".jar")))
3082 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
3083 (search-input-file inputs
3084 "/share/java/java-testng.jar"))
3085 (("\\$\\{lib\\}/junit4/junit.jar")
3086 (car (find-files (assoc-ref inputs "java-junit") "jar$")))
3087 (("\\$\\{lib\\}/jmock/hamcrest/hamcrest-core.jar")
3088 (car (find-files (assoc-ref inputs "java-hamcrest-core")
3089 "jar$"))))
3090 ;; Remove dependency on ch.rinn.restrictions
3091 (with-directory-excursion "source/java/ch/systemsx/cisd/hdf5/"
3092 (substitute* '("BitSetConversionUtils.java"
3093 "HDF5Utils.java")
3094 (("import ch.rinn.restrictions.Private;") "")
3095 (("@Private") "")))
3096 (with-directory-excursion "sourceTest/java/ch/systemsx/cisd/hdf5/"
3097 (substitute* '("BitSetConversionTest.java"
3098 "h5ar/HDF5ArchiverTest.java")
3099 (("import ch.rinn.restrictions.Friend;") "")
3100 (("@Friend.*") ""))
3101 ;; Remove leftovers from removing @Friend
3102 (substitute* "h5ar/HDF5ArchiverTest.java"
3103 (("\\{ HDF5Archiver.class, IdCache.class, LinkRecord.class \\}\\)")
3104 "")))))
3105 (add-before 'configure 'build-native-library
3106 (lambda* (#:key inputs #:allow-other-keys)
3107 (let ((jdk (assoc-ref inputs "jdk"))
3108 (hdf5 (assoc-ref inputs "hdf5"))
3109 (dir ,(match (%current-system)
3110 ("i686-linux"
3111 "i386-Linux")
3112 ((or "armhf-linux" "aarch64-linux")
3113 "arm-Linux")
3114 ((or "x86_64-linux")
3115 "amd64-Linux")
3116 (_ "unknown-Linux"))))
3117 (with-directory-excursion "source/c"
3118 (apply invoke `("gcc" "-shared" "-O3"
3119 "-fPIC"
3120 "-Wl,--exclude-libs,ALL"
3121 "-Wno-error=implicit-function-declaration"
3122 ,@(find-files "jhdf5" "\\.c$")
3123 ,@(find-files "hdf-java" "\\.c$")
3124 ,(string-append "-I" hdf5 "/include")
3125 ,(string-append "-I" jdk "/include")
3126 ,(string-append "-I" jdk "/include/linux")
3127 ,(string-append hdf5 "/lib/libhdf5.a")
3128 "-o" "libjhdf5.so" "-lz")))
3129 (install-file "source/c/libjhdf5.so"
3130 (string-append "libs/native/jhdf5/" dir)))))
3131 ;; In the "check" phase we only build the test executable.
3132 (add-after 'check 'run-tests
3133 (lambda _
3134 (invoke "java" "-jar" "targets/dist/sis-jhdf5-test.jar")
3135 (delete-file "targets/dist/sis-jhdf5-test.jar")))
3136 (replace 'install
3137 (install-jars "targets/dist")))))
3138 (inputs
3139 (list java-cisd-base
3140 java-cisd-args4j
3141 java-commons-lang
3142 java-commons-io
3143 hdf5-1.8
3144 zlib))
3145 (native-inputs
3146 `(("jdk" ,icedtea-8)
3147 ("java-testng" ,java-testng)
3148 ("java-junit" ,java-junit)
3149 ("java-jmock" ,java-jmock)
3150 ("java-hamcrest-core" ,java-hamcrest-core)
3151 ("build-resources"
3152 ,(origin
3153 (method svn-fetch)
3154 (uri (svn-reference
3155 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3156 "jhdf5/tags/release/"
3157 (version-major+minor base-version)
3158 ".x/" base-version
3159 "/build_resources/"))
3160 (revision revision)))
3161 (sha256
3162 (base32
3163 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
3164 (home-page "https://wiki-bsse.ethz.ch/display/JHDF5/")
3165 (synopsis "Java binding for HDF5")
3166 (description "JHDF5 is a high-level API in Java for reading and writing
3167HDF5 files, building on the libraries provided by the HDF Group.")
3168 ;; The C sources are under a non-copyleft license, which looks like a
3169 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
3170 (license (list license:asl2.0
3171 (license:non-copyleft "file://source/c/COPYING"))))))
3172
3173(define-public java-classpathx-servletapi
3174 (package
3175 (name "java-classpathx-servletapi")
3176 (version "3.0.1")
3177 (source (origin
3178 (method url-fetch)
3179 (uri (string-append "mirror://gnu/classpathx/servletapi/"
3180 "servletapi-" version ".tar.gz"))
3181 (sha256
3182 (base32
3183 "07d8h051siga2f33fra72hk12sbq1bxa4jifjg0qj0vfazjjff0x"))))
3184 (build-system ant-build-system)
3185 (arguments
3186 `(#:tests? #f ; there is no test target
3187 #:build-target "compile"
3188 #:make-flags
3189 ,#~(list "-Dbuild.compiler=javac1.8"
3190 (string-append "-Ddist=" #$output))
3191 #:phases
3192 (modify-phases %standard-phases
3193 (replace 'install
3194 (lambda* (#:key make-flags #:allow-other-keys)
3195 (apply invoke `("ant" "dist" ,@make-flags)))))))
3196 (home-page "https://www.gnu.org/software/classpathx/")
3197 (synopsis "Java servlet API implementation")
3198 (description "This is the GNU servlet API distribution, part of the
3199ClasspathX project. It provides implementations of version 3.0 of the servlet
3200API and version 2.1 of the Java ServerPages API.")
3201 (license license:gpl3+)))
3202
3203(define-public java-javaee-servletapi
3204 (package
3205 (name "java-javaee-servletapi")
3206 (version "3.1.0")
3207 (source (origin
3208 (method git-fetch)
3209 (uri (git-reference
3210 (url "https://github.com/javaee/servlet-spec")
3211 (commit version)))
3212 (file-name (git-file-name name version))
3213 (sha256
3214 (base32
3215 "0s03lj8w5an70lkqbjycgfrfk0kc07vbfav91jzk87gh3awf9ksl"))))
3216 (build-system ant-build-system)
3217 (arguments
3218 `(#:jar-name "javax-servletapi.jar"
3219 ;; no tests
3220 #:tests? #f
3221 #:source-dir "src/main/java"
3222 #:phases
3223 (modify-phases %standard-phases
3224 (add-before 'build 'copy-resources
3225 (lambda _
3226 (mkdir-p "build/classes/javax/servlet/http")
3227 (let ((from-prefix "src/main/java/javax/servlet/")
3228 (to-prefix "build/classes/javax/servlet/"))
3229 (for-each (lambda (f)
3230 (copy-file (string-append from-prefix f)
3231 (string-append to-prefix f)))
3232 (list "LocalStrings_ja.properties"
3233 "LocalStrings.properties"
3234 "LocalStrings_fr.properties"
3235 "http/LocalStrings_es.properties"
3236 "http/LocalStrings_ja.properties"
3237 "http/LocalStrings.properties"
3238 "http/LocalStrings_fr.properties")))
3239 #t)))))
3240 (native-inputs
3241 (list unzip))
3242 (home-page "https://javaee.github.io/servlet-spec/")
3243 (synopsis "Java servlet API")
3244 (description "Java Servlet is the foundation web specification in the
3245Java Enterprise Platform. Developers can build web applications using the
3246Servlet API to interact with the request/response workflow. This project
3247provides information on the continued development of the Java Servlet
3248specification.")
3249 ;; Main code is dual-licensed by Oracle under either GLP2 or CDDL 1.1.
3250 ;; Some files are licensed under ASL 2.0.
3251 (license (list license:asl2.0 license:gpl2 license:cddl1.1))))
3252
3253(define-public java-swt
3254 (package
3255 (name "java-swt")
3256 (version "4.7.1a")
3257 (source
3258 ;; The types of many variables and procedures differ in the sources
3259 ;; dependent on whether the target architecture is a 32-bit system or a
3260 ;; 64-bit system. Instead of patching the sources on demand in a build
3261 ;; phase we download either the 32-bit archive (which mostly uses "int"
3262 ;; types) or the 64-bit archive (which mostly uses "long" types).
3263 (let ((hash32 "09q0cbh90d90q3a7dx9430kc4m6bijrkr4lajrmzzvi0jjdpq4v9")
3264 (hash64 "17k5hs75a87ssmc5xhwdfdm2gn4zba0r837l2455za01krnkaa2q")
3265 (file32 "x86")
3266 (file64 "x86_64"))
3267 (let-values (((hash file)
3268 (match (or (%current-target-system) (%current-system))
3269 ("x86_64-linux" (values hash64 file64))
3270 (_ (values hash32 file32)))))
3271 (origin
3272 (method url-fetch)
3273 (uri (string-append
3274 "https://archive.eclipse.org/eclipse/downloads/drops4/"
3275 "R-" version "-201710090410/swt-" version
3276 "-gtk-linux-" file ".zip"))
3277 (sha256 (base32 hash))))))
3278 (build-system ant-build-system)
3279 (arguments
3280 `(#:jar-name "swt.jar"
3281 #:jdk ,icedtea-8
3282 #:tests? #f ; no "check" target
3283 #:phases
3284 (modify-phases %standard-phases
3285 (replace 'unpack
3286 (lambda* (#:key source #:allow-other-keys)
3287 (mkdir "swt")
3288 (invoke "unzip" source "-d" "swt")
3289 (chdir "swt")
3290 (mkdir "src")
3291 (invoke "unzip" "src.zip" "-d" "src")))
3292 ;; The classpath contains invalid icecat jars. Since we don't need
3293 ;; anything other than the JDK on the classpath, we can simply unset
3294 ;; it.
3295 (add-after 'configure 'unset-classpath
3296 (lambda _ (unsetenv "CLASSPATH") #t))
3297 (add-before 'build 'build-native
3298 (lambda* (#:key inputs outputs #:allow-other-keys)
3299 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3300 ;; Build shared libraries. Users of SWT have to set the system
3301 ;; property swt.library.path to the "lib" directory of this
3302 ;; package output.
3303 (mkdir-p lib)
3304 (setenv "OUTPUT_DIR" lib)
3305 (setenv "CC" ,(cc-for-target))
3306 (with-directory-excursion "src"
3307 (invoke "bash" "build.sh")))))
3308 (add-after 'install 'install-native
3309 (lambda* (#:key outputs #:allow-other-keys)
3310 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3311 (for-each (lambda (file)
3312 (install-file file lib))
3313 (find-files "." "\\.so$"))
3314 #t))))))
3315 (inputs
3316 `(("gtk" ,gtk+-2)
3317 ("libxtst" ,libxtst)
3318 ("libxt" ,libxt)
3319 ("mesa" ,mesa)
3320 ("glu" ,glu)))
3321 (native-inputs
3322 (list pkg-config unzip))
3323 (home-page "https://www.eclipse.org/swt/")
3324 (synopsis "Widget toolkit for Java")
3325 (description
3326 "SWT is a widget toolkit for Java designed to provide efficient, portable
3327access to the user-interface facilities of the operating systems on which it
3328is implemented.")
3329 ;; SWT code is licensed under EPL1.0
3330 ;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
3331 ;; Cairo bindings contain code under MPL1.1
3332 ;; XULRunner 1.9 bindings contain code under MPL2.0
3333 (license (list
3334 license:epl1.0
3335 license:mpl1.1
3336 license:mpl2.0
3337 license:lgpl2.1+))))
3338
3339;; java-hamcrest-core uses qdox version 1.12. We package this version instead
3340;; of the latest release.
3341(define-public java-qdox-1.12
3342 (package
3343 (name "java-qdox")
3344 (version "1.12.1")
3345 (source (origin
3346 (method url-fetch)
3347 (uri (string-append "https://repo1.maven.org/maven2/"
3348 "com/thoughtworks/qdox/qdox/" version
3349 "/qdox-" version "-sources.jar"))
3350 (sha256
3351 (base32
3352 "0hlfbqq2avf5s26wxkksqmkdyk6zp9ggqn37c468m96mjv0n9xfl"))))
3353 (build-system ant-build-system)
3354 (arguments
3355 `(;; Tests require junit
3356 #:tests? #f
3357 #:jar-name "qdox.jar"
3358 #:phases
3359 (modify-phases %standard-phases
3360 (replace 'unpack
3361 (lambda* (#:key source #:allow-other-keys)
3362 (mkdir "src")
3363 (with-directory-excursion "src"
3364 (invoke "jar" "-xf" source))))
3365 ;; At this point we don't have junit, so we must remove the API
3366 ;; tests.
3367 (add-after 'unpack 'delete-tests
3368 (lambda _
3369 (delete-file-recursively "src/com/thoughtworks/qdox/junit")
3370 #t)))))
3371 (home-page "https://github.com/codehaus/qdox")
3372 (synopsis "Parse definitions from Java source files")
3373 (description
3374 "QDox is a high speed, small footprint parser for extracting
3375class/interface/method definitions from source files complete with JavaDoc
3376@code{@@tags}. It is designed to be used by active code generators or
3377documentation tools.")
3378 (license license:asl2.0)))
3379
3380(define-public java-qdox
3381 (package
3382 (name "java-qdox")
3383 ; Newer version exists, but this version is required by java-plexus-component-metadata
3384 (version "2.0-M2")
3385 (source (origin
3386 (method url-fetch)
3387 ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
3388 ;; Older releases at https://github.com/codehaus/qdox/
3389 ;; Note: The release at maven is pre-generated. The release at
3390 ;; github requires jflex.
3391 (uri (string-append "https://repo1.maven.org/maven2/"
3392 "com/thoughtworks/qdox/qdox/" version
3393 "/qdox-" version "-sources.jar"))
3394 (sha256
3395 (base32
3396 "10xxrcaicq6axszcr2jpygisa4ch4sinyx5q7kqqxv4lknrmxp5x"))))
3397 (build-system ant-build-system)
3398 (arguments
3399 `(#:jar-name "qdox.jar"
3400 #:tests? #f; no tests
3401 #:phases
3402 (modify-phases %standard-phases
3403 (add-before 'install 'create-pom
3404 (generate-pom.xml "pom.xml" "com.thoughtworks.qdox" "qdox" ,version
3405 #:name "QDox"))
3406 (replace 'install
3407 (install-from-pom "pom.xml")))))
3408 (home-page "https://github.com/codehaus/qdox")
3409 (synopsis "Parse definitions from Java source files")
3410 (description "QDox is a high speed, small footprint parser for extracting
3411class/interface/method definitions from source files complete with JavaDoc
3412@code{@@tags}. It is designed to be used by active code generators or
3413documentation tools.")
3414 (license license:asl2.0)))
3415
3416(define-public java-qdox-2-M9
3417 (package
3418 (inherit java-qdox)
3419 (version "2.0-M9"); required by plexus-java
3420 (source (origin
3421 (method url-fetch)
3422 ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
3423 ;; Older releases at https://github.com/codehaus/qdox/
3424 ;; Note: The release at maven is pre-generated. The release at
3425 ;; github requires jflex.
3426 (uri (string-append "https://repo1.maven.org/maven2/"
3427 "com/thoughtworks/qdox/qdox/" version
3428 "/qdox-" version "-sources.jar"))
3429 (sha256
3430 (base32
3431 "1s2jnmx2dkwnaha12lcj26aynywgwa8sslc47z82wx8xai13y4fg"))))
3432 (arguments
3433 (substitute-keyword-arguments (package-arguments java-qdox)
3434 ((#:phases phases)
3435 `(modify-phases ,phases
3436 (replace 'create-pom
3437 (generate-pom.xml "pom.xml" "com.thoughtworks.qdox" "qdox" ,version
3438 #:name "QDox"))))))))
3439
3440(define-public java-jarjar
3441 (package
3442 (name "java-jarjar")
3443 (version "1.4")
3444 (source (origin
3445 (method url-fetch)
3446 (uri (string-append
3447 "https://storage.googleapis.com/google-code-archive-downloads/v2/"
3448 "code.google.com/jarjar/jarjar-src-" version ".zip"))
3449 (sha256
3450 (base32
3451 "1v8irhni9cndcw1l1wxqgry013s2kpj0qqn57lj2ji28xjq8ndjl"))
3452 (modules '((guix build utils)))
3453 (snippet
3454 '(begin
3455 ;; Delete bundled thirds-party jar archives.
3456 (delete-file-recursively "lib")
3457 (delete-file "src/test/enumtest.jar")
3458 ;; the CLASSPATH needs this directory, create an empty one
3459 (mkdir-p "lib")
3460 #t))))
3461 (build-system ant-build-system)
3462 (arguments
3463 `(;; Tests require junit, which ultimately depends on this package.
3464 #:tests? #f
3465 #:build-target "jar"
3466 #:phases
3467 (modify-phases %standard-phases
3468 (add-before 'build 'do-not-use-bundled-asm
3469 (lambda* (#:key inputs #:allow-other-keys)
3470 (substitute* "build.xml"
3471 (("<path id=\"path.build\">")
3472 (string-append "<path id=\"path.build\"><fileset dir=\""
3473 (assoc-ref inputs "java-asm-bootstrap")
3474 "/lib/m2\" includes=\"**/*.jar\"/>"))
3475 (("<zipfileset src=\"lib/asm-4.0.jar\"/>") "")
3476 (("lib/asm-commons-4.0.jar")
3477 (car (find-files (assoc-ref inputs "java-asm-bootstrap")
3478 "asm-6.0.jar")))
3479 (("<include name=\"org/objectweb/asm/commons/Remap\\*\\.class\"/>")
3480 (string-append "<include name=\"org/objectweb/asm/"
3481 "commons/Remap*.class\"/>"
3482 "<include name=\"org/objectweb/asm/*.class\"/>"
3483 "<include name=\"org/objectweb/asm/"
3484 "signature/*.class\"/>"
3485 "<include name=\"org/objectweb/asm/"
3486 "commons/SignatureRemapper.class\"/>")))
3487 #t))
3488 (add-before 'build 'remove-maven-dependency
3489 (lambda _
3490 ;; We do not need to build jarjar as a maven plugin just yet, so
3491 ;; remove this file. Maven requires jarjar (but not that plugin),
3492 ;; so removing it improves the bootstrap.
3493 (delete-file "src/main/com/tonicsystems/jarjar/JarJarMojo.java")
3494 #t))
3495 (replace 'install
3496 (lambda* (#:key outputs #:allow-other-keys)
3497 (let ((target (string-append (assoc-ref outputs "out")
3498 "/share/java")))
3499 (install-file (string-append "dist/jarjar-" ,version ".jar")
3500 target))
3501 #t)))))
3502 (inputs
3503 (list java-asm-bootstrap))
3504 (native-inputs
3505 (list unzip))
3506 (home-page "https://code.google.com/archive/p/jarjar/")
3507 (synopsis "Repackage Java libraries")
3508 (description
3509 "Jar Jar Links is a utility that makes it easy to repackage Java
3510libraries and embed them into your own distribution. Jar Jar Links includes
3511an Ant task that extends the built-in @code{jar} task.")
3512 (license license:asl2.0)))
3513
3514(define-public java-hamcrest-core
3515 (package
3516 (name "java-hamcrest-core")
3517 (version "1.3")
3518 (source (origin
3519 (method git-fetch)
3520 (uri (git-reference
3521 (url "https://github.com/hamcrest/JavaHamcrest/")
3522 (commit (string-append "hamcrest-java-" version))))
3523 (file-name (git-file-name name version))
3524 (sha256
3525 (base32
3526 "16fxxkrd31ahqvcaby30jgh3z1i0zxh51m24hxgz0z2agxj6bc63"))
3527 (modules '((guix build utils)))
3528 (snippet
3529 '(begin
3530 ;; Delete bundled thirds-party jar archives.
3531 (delete-file-recursively "lib")
3532 #t))))
3533 (build-system ant-build-system)
3534 (arguments
3535 `(#:tests? #f ; Tests require junit
3536 #:modules ((guix build ant-build-system)
3537 (guix build java-utils)
3538 (guix build utils)
3539 (srfi srfi-1))
3540 #:make-flags (list (string-append "-Dversion=" ,version))
3541 #:test-target "unit-test"
3542 #:build-target "core"
3543 #:phases
3544 (modify-phases %standard-phases
3545 ;; Disable unit tests, because they require junit, which requires
3546 ;; hamcrest-core. We also give a fixed value to the "Built-Date"
3547 ;; attribute from the manifest for reproducibility.
3548 (add-before 'configure 'patch-build.xml
3549 (lambda _
3550 (substitute* "build.xml"
3551 (("unit-test, ") "")
3552 (("\\$\\{build.timestamp\\}") "guix"))
3553 #t))
3554 ;; Java's "getMethods()" returns methods in an unpredictable order.
3555 ;; To make the output of the generated code deterministic we must
3556 ;; sort the array of methods.
3557 (add-after 'unpack 'make-method-order-deterministic
3558 (lambda _
3559 (substitute* "hamcrest-generator/src/main/java/org/hamcrest/generator/ReflectiveFactoryReader.java"
3560 (("import java\\.util\\.Iterator;" line)
3561 (string-append line "\n"
3562 "import java.util.Arrays; import java.util.Comparator;"))
3563 (("allMethods = cls\\.getMethods\\(\\);" line)
3564 (string-append "_" line
3565 "
3566private Method[] getSortedMethods() {
3567 Arrays.sort(_allMethods, new Comparator<Method>() {
3568 @Override
3569 public int compare(Method a, Method b) {
3570 return a.toString().compareTo(b.toString());
3571 }
3572 });
3573 return _allMethods;
3574}
3575
3576private Method[] allMethods = getSortedMethods();")))
3577 #t))
3578 (add-before 'build 'do-not-use-bundled-qdox
3579 (lambda* (#:key inputs #:allow-other-keys)
3580 (substitute* "build.xml"
3581 (("lib/generator/qdox-1.12.jar")
3582 (string-append (assoc-ref inputs "java-qdox-1.12")
3583 "/share/java/qdox.jar")))
3584 #t))
3585 ;; build.xml searches for .jar files in this directoy, which
3586 ;; we remove from the source archive.
3587 (add-before 'build 'create-dummy-directories
3588 (lambda _
3589 (mkdir-p "lib/integration")
3590 #t))
3591 (add-before 'build 'create-pom
3592 (lambda _
3593 (substitute* "pom/hamcrest-core.pom"
3594 (("@VERSION@") ,version))
3595 #t))
3596 (replace 'install
3597 (install-from-pom "pom/hamcrest-core.pom")))))
3598 (native-inputs
3599 `(("java-qdox-1.12" ,java-qdox-1.12)
3600 ("java-jarjar" ,java-jarjar)))
3601 (propagated-inputs
3602 (list java-hamcrest-parent-pom))
3603 (home-page "https://hamcrest.org/")
3604 (synopsis "Library of matchers for building test expressions")
3605 (description
3606 "This package provides a library of matcher objects (also known as
3607constraints or predicates) allowing @code{match} rules to be defined
3608declaratively, to be used in other frameworks. Typical scenarios include
3609testing frameworks, mocking libraries and UI validation rules.")
3610 (license license:bsd-2)))
3611
3612(define-public java-hamcrest-parent-pom
3613 (package
3614 (inherit java-hamcrest-core)
3615 (properties '((hidden? . #t)))
3616 (name "java-hamcrest-parent-pom")
3617 (propagated-inputs '())
3618 (native-inputs '())
3619 (arguments
3620 `(#:tests? #f
3621 #:phases
3622 (modify-phases %standard-phases
3623 (delete 'configure)
3624 (replace 'build
3625 (lambda _
3626 (substitute* "pom/hamcrest-parent.pom"
3627 (("@VERSION@") ,(package-version java-hamcrest-core)))
3628 #t))
3629 (replace 'install
3630 (install-pom-file "pom/hamcrest-parent.pom")))))))
3631
3632(define-public java-hamcrest-library
3633 (package
3634 (inherit java-hamcrest-core)
3635 (name "java-hamcrest-library")
3636 (arguments
3637 (substitute-keyword-arguments (package-arguments java-hamcrest-core)
3638 ((#:build-target _) "library")
3639 ((#:phases phases)
3640 `(modify-phases ,phases
3641 (add-after 'unpack 'patch-classpath-for-integration
3642 (lambda* (#:key inputs #:allow-other-keys)
3643 (substitute* "build.xml"
3644 (("build/hamcrest-core-\\$\\{version\\}\\.jar")
3645 (car (find-files (assoc-ref inputs "java-hamcrest-core")
3646 "jar$"))))
3647 #t))
3648 (replace 'create-pom
3649 (lambda _
3650 (substitute* "pom/hamcrest-library.pom"
3651 (("@VERSION@") ,(package-version java-hamcrest-core)))
3652 #t))
3653 (replace 'install
3654 (install-from-pom "pom/hamcrest-library.pom"))))))
3655 (propagated-inputs
3656 (list java-hamcrest-core java-hamcrest-parent-pom))))
3657
3658(define-public java-junit
3659 (package
3660 (name "java-junit")
3661 (version "4.12")
3662 (source (origin
3663 (method git-fetch)
3664 (uri (git-reference
3665 (url "https://github.com/junit-team/junit/")
3666 (commit (string-append "r" version))))
3667 (file-name (git-file-name name version))
3668 (sha256
3669 (base32
3670 "1j8avi91px1z8rjc89cfikwrvfifdmmsarwiyrcnr59ynvpz0v8h"))
3671 (modules '((guix build utils)))
3672 (snippet
3673 '(begin
3674 ;; Delete bundled jar archives.
3675 (delete-file-recursively "lib")
3676 #t))))
3677 (build-system ant-build-system)
3678 (arguments
3679 `(#:jar-name "junit.jar"
3680 #:source-dir "src/main/java"
3681 #:test-dir "src/test"
3682 #:test-exclude (list "**/SimpleTest.java" "**/StackTracesTest.java"
3683 "**/RuleChainTest.java" "**/TestWatchmanTest.java")
3684 #:phases
3685 (modify-phases %standard-phases
3686 (add-before 'check 'copy-test-resources
3687 (lambda _
3688 (copy-recursively "src/test/resources" "build/test-classes")
3689 #t))
3690 (replace 'install
3691 (install-from-pom "pom.xml")))))
3692 (propagated-inputs
3693 (list java-hamcrest-core))
3694 (native-inputs
3695 (list java-hamcrest-library))
3696 (home-page "https://junit.org/junit4/")
3697 (synopsis "Test framework for Java")
3698 (description
3699 "JUnit is a simple framework to write repeatable tests for Java projects.
3700JUnit provides assertions for testing expected results, test fixtures for
3701sharing common test data, and test runners for running tests.")
3702 (license license:epl1.0)))
3703
3704(define-public java-junitparams
3705 (package
3706 (name "java-junitparams")
3707 (version "1.1.1")
3708 (source (origin
3709 (method git-fetch)
3710 (uri (git-reference
3711 (url "https://github.com/Pragmatists/JUnitParams")
3712 (commit (string-append "JUnitParams-" version))))
3713 (file-name (git-file-name name version))
3714 (sha256
3715 (base32
3716 "0rb52xdfp99invyjrras3w0bf0a81cz30yd47rkkiyqcqj0y1q9b"))))
3717 (build-system ant-build-system)
3718 (arguments
3719 `(#:jar-name "junitparams.jar"
3720 #:source-dir "src/main/java"
3721 #:test-dir "src/test"
3722 #:test-exclude (list "**/SuperclassTest.java")))
3723 (inputs
3724 (list java-junit))
3725 (native-inputs
3726 (list java-junit java-hamcrest-core java-assertj))
3727 (home-page "https://github.com/Pragmatists/JUnitParams")
3728 (synopsis "Parameterised test support for JUnit")
3729 (description "The JUnitParams project adds a new runner to JUnit and
3730provides much easier and readable parametrised tests for JUnit.")
3731 (license license:asl2.0)))
3732
3733(define-public java-plexus-utils
3734 (package
3735 (name "java-plexus-utils")
3736 (version "3.3.0")
3737 (source (origin
3738 (method git-fetch)
3739 (uri (git-reference
3740 (url "https://github.com/codehaus-plexus/plexus-utils")
3741 (commit (string-append "plexus-utils-" version))))
3742 (file-name (git-file-name name version))
3743 (sha256
3744 (base32
3745 "0d0fq21rzjy0j55kcp8w9k1rbq9rwr0r7cc8239p9jbz54vihp0g"))))
3746 (build-system ant-build-system)
3747 ;; FIXME: The default build.xml does not include a target to install
3748 ;; javadoc files.
3749 (arguments
3750 `(#:jar-name "plexus-utils.jar"
3751 #:source-dir "src/main"
3752 #:phases
3753 (modify-phases %standard-phases
3754 (add-after 'unpack 'fix-reference-to-/bin-and-/usr
3755 (lambda _
3756 (substitute* "src/main/java/org/codehaus/plexus/util/\
3757cli/shell/BourneShell.java"
3758 (("/bin/sh") (which "sh"))
3759 (("/usr/") (getcwd)))
3760 #t))
3761 (add-after 'unpack 'fix-or-disable-broken-tests
3762 (lambda _
3763 (with-directory-excursion "src/test/java/org/codehaus/plexus/util"
3764 (substitute* '("cli/CommandlineTest.java"
3765 "cli/shell/BourneShellTest.java")
3766 (("/bin/sh") (which "sh"))
3767 (("/bin/echo") (which "echo")))
3768
3769 ;; This test depends on MavenProjectStub, but we don't have
3770 ;; a package for Maven.
3771 (delete-file "introspection/ReflectionValueExtractorTest.java")
3772
3773 ;; FIXME: The command line tests fail, maybe because they use
3774 ;; absolute paths.
3775 (delete-file "cli/CommandlineTest.java")
3776
3777 ;; These tests require openjdk jmh, which is not packaged yet
3778 (for-each delete-file (find-files "." "PerfTest.java$")))
3779 #t))
3780 (add-before 'build 'copy-resources
3781 (lambda _
3782 (copy-recursively "src/main/resources" "build/classes")
3783 #t))
3784 (replace 'install (install-from-pom "pom.xml")))))
3785 (native-inputs
3786 (list java-hamcrest-core java-junit))
3787 (propagated-inputs
3788 (list plexus-parent-pom-5.1))
3789 (home-page "https://codehaus-plexus.github.io/plexus-utils/")
3790 (synopsis "Common utilities for the Plexus framework")
3791 (description "This package provides various Java utility classes for the
3792Plexus framework to ease working with strings, files, command lines, XML and
3793more.")
3794 (license license:asl2.0)))
3795
3796(define-public java-plexus-utils-3.2.1
3797 (package
3798 (inherit java-plexus-utils)
3799 ;; plexus-build-api needs this version, later versions don't work
3800 (version "3.2.1")
3801 (source (origin
3802 (method git-fetch)
3803 (uri (git-reference
3804 (url "https://github.com/codehaus-plexus/plexus-utils")
3805 (commit (string-append "plexus-utils-" version))))
3806 (file-name (git-file-name "java-plexus-utils" version))
3807 (sha256
3808 (base32
3809 "1w169glixyk94jbczj8jzg897lsab46jihiaa3dhw0p06g35va8b"))))))
3810
3811(define-public java-plexus-interpolation
3812 (package
3813 (name "java-plexus-interpolation")
3814 (version "1.26")
3815 (source (origin
3816 (method git-fetch)
3817 (uri (git-reference
3818 (url "https://github.com/codehaus-plexus/plexus-interpolation")
3819 (commit (string-append "plexus-interpolation-" version))))
3820 (file-name (git-file-name name version))
3821 (sha256
3822 (base32
3823 "1rahjmhywf6d5m32qzlc9izawyvcd71abfm9k03f13rs2xmfxzlh"))))
3824 (build-system ant-build-system)
3825 (arguments
3826 `(#:jar-name "plexus-interpolation.jar"
3827 #:source-dir "src/main"
3828 #:phases
3829 (modify-phases %standard-phases
3830 (replace 'install (install-from-pom "pom.xml")))))
3831 (propagated-inputs
3832 `(("plexus-parent-pom-5.1" ,plexus-parent-pom-5.1)))
3833 (native-inputs
3834 (list java-junit java-hamcrest-core))
3835 (home-page "https://codehaus-plexus.github.io/plexus-interpolation/")
3836 (synopsis "Java components for interpolating ${} strings and the like")
3837 (description "Plexus interpolator is a modular, flexible interpolation
3838framework for the expression language style commonly seen in Maven, Plexus,
3839and other related projects.
3840
3841It has its foundation in the @code{org.codehaus.plexus.utils.interpolation}
3842package within @code{plexus-utils}, but has been separated in order to allow
3843these two libraries to vary independently of one another.")
3844 (license license:asl2.0)))
3845
3846(define-public java-plexus-classworlds
3847 (package
3848 (name "java-plexus-classworlds")
3849 (version "2.6.0")
3850 (source (origin
3851 (method git-fetch)
3852 (uri (git-reference
3853 (url "https://github.com/codehaus-plexus/plexus-classworlds")
3854 (commit (string-append "plexus-classworlds-" version))))
3855 (file-name (git-file-name name version))
3856 (sha256
3857 (base32
3858 "034k2hgvj1saalwbnzrbg4n0zgzwcpz1lhlb8q4kgglsp9pmm03s"))))
3859 (build-system ant-build-system)
3860 (arguments
3861 `(#:jar-name "plexus-classworlds.jar"
3862 #:source-dir "src/main"
3863 #:tests? #f;; FIXME: we need to generate some resources as in pom.xml
3864 #:phases
3865 (modify-phases %standard-phases
3866 (replace 'install (install-from-pom "pom.xml")))))
3867 (propagated-inputs
3868 `(("plexus-parent-pom-5.1" ,plexus-parent-pom-5.1)))
3869 (native-inputs
3870 (list java-junit))
3871 (home-page "https://codehaus-plexus.github.io/plexus-classworlds/")
3872 (synopsis "Java class loader framework")
3873 (description "Plexus classworlds replaces the native @code{ClassLoader}
3874mechanism of Java. It is especially useful for dynamic loading of application
3875components.")
3876 (license license:asl2.0)))
3877
3878(define java-plexus-container-default-bootstrap
3879 (package
3880 (name "java-plexus-container-default-bootstrap")
3881 (version "2.1.0")
3882 (source (origin
3883 (method git-fetch)
3884 (uri (git-reference
3885 (url "https://github.com/codehaus-plexus/plexus-containers")
3886 (commit (string-append "plexus-containers-" version))))
3887 (file-name (git-file-name name version))
3888 (sha256
3889 (base32
3890 "0r9yq67c1hvi1pz5wmx6x6hk5fmavp8a7yal3j5hkaad757firn1"))))
3891 (build-system ant-build-system)
3892 (arguments
3893 `(#:jar-name "container-default.jar"
3894 #:source-dir "plexus-container-default/src/main/java"
3895 #:test-dir "plexus-container-default/src/test"
3896 #:tests? #f; requires plexus-archiver, which depends on this package
3897 #:phases
3898 (modify-phases %standard-phases
3899 (add-before 'build 'fix-google-collections
3900 (lambda _
3901 ;; Google collections are now replaced with guava
3902 (substitute* "plexus-container-default/pom.xml"
3903 (("google-collections") "guava")
3904 (("com.google.collections") "com.google.guava"))
3905 #t))
3906 (add-before 'build 'copy-resources
3907 (lambda _
3908 (copy-recursively
3909 "plexus-container-default/src/main/resources/"
3910 "build/classes")
3911 #t))
3912 (replace 'install
3913 (install-from-pom "plexus-container-default/pom.xml")))))
3914 (propagated-inputs
3915 `(("java-plexus-worldclass" ,java-plexus-classworlds)
3916 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
3917 ("java-plexus-utils" ,java-plexus-utils)
3918 ("java-junit" ,java-junit)
3919 ("java-guava" ,java-guava)
3920 ("java-plexus-containers-parent-pom" ,java-plexus-containers-parent-pom)))
3921 (home-page "https://github.com/codehaus-plexus/plexus-containers")
3922 (synopsis "Inversion-of-control container")
3923 (description "Plexus-default-container is Plexus' inversion-of-control
3924(@dfn{IoC}) container. It is composed of its public API and its default
3925implementation.")
3926 (license license:asl2.0)))
3927
3928(define java-plexus-containers-parent-pom
3929 (package
3930 (inherit java-plexus-container-default-bootstrap)
3931 (name "java-plexus-containers-parent-pom")
3932 (arguments
3933 `(#:tests? #f
3934 #:phases
3935 (modify-phases %standard-phases
3936 (delete 'configure)
3937 (delete 'build)
3938 (replace 'install
3939 (install-pom-file "pom.xml")))))
3940 (propagated-inputs
3941 `(("plexus-parent-pom" ,plexus-parent-pom-4.0)))))
3942
3943(define-public java-plexus-io
3944 (package
3945 (name "java-plexus-io")
3946 (version "3.2.0")
3947 (source (origin
3948 (method git-fetch)
3949 (uri (git-reference
3950 (url "https://github.com/codehaus-plexus/plexus-io")
3951 (commit (string-append "plexus-io-" version))))
3952 (file-name (git-file-name name version))
3953 (sha256
3954 (base32
3955 "1r3wqfpbxq8vp4p914i8p88r0994rmcjw02hz14n11cfb6gsyvlr"))))
3956 (build-system ant-build-system)
3957 (arguments
3958 `(#:jar-name "plexus-io.jar"
3959 #:source-dir "src/main/java"
3960 #:test-dir "src/test"
3961 #:phases
3962 (modify-phases %standard-phases
3963 (add-before 'build 'copy-resources
3964 (lambda _
3965 (mkdir-p "build/classes")
3966 (copy-recursively "src/main/resources" "build/classes")
3967 (mkdir-p "build/test-classes")
3968 (copy-recursively "src/test/resources" "build/test-classes")
3969 #t))
3970 (replace 'install (install-from-pom "pom.xml")))))
3971 (propagated-inputs
3972 (list java-plexus-utils java-commons-io plexus-parent-pom-5.1))
3973 (inputs
3974 (list java-jsr305))
3975 (native-inputs
3976 `(("junit" ,java-junit)
3977 ("hamcrest" ,java-hamcrest-core)
3978 ("guava" ,java-guava)
3979 ("classworlds" ,java-plexus-classworlds)
3980 ("xbean" ,java-geronimo-xbean-reflect)
3981 ("container-default" ,java-plexus-container-default-bootstrap)))
3982 (home-page "https://github.com/codehaus-plexus/plexus-io")
3983 (synopsis "I/O plexus components")
3984 (description "Plexus IO is a set of plexus components, which are designed
3985for use in I/O operations. This implementation using plexus components allows
3986reusing it in maven.")
3987 (license license:asl2.0)))
3988
3989(define-public java-plexus-archiver
3990 (package
3991 (name "java-plexus-archiver")
3992 (version "4.2.2")
3993 (source (origin
3994 (method url-fetch)
3995 (uri (string-append "https://github.com/codehaus-plexus/plexus-archiver"
3996 "/archive/plexus-archiver-" version ".tar.gz"))
3997 (sha256
3998 (base32
3999 "144n971r3lfrx3l12nf2scm80x4xdvgbkk4bjpa4vcvvdrll6qys"))))
4000 (build-system ant-build-system)
4001 (arguments
4002 `(#:jar-name "plexus-archiver.jar"
4003 #:source-dir "src/main/java"
4004 #:test-dir "src/test"
4005 #:test-exclude (list "**/Abstract*.java" "**/Base*.java")
4006 #:phases
4007 (modify-phases %standard-phases
4008 (add-before 'check 'remove-failing
4009 (lambda _
4010 ;; Requires an older version of plexus container
4011 (delete-file
4012 "src/test/java/org/codehaus/plexus/archiver/DuplicateFilesTest.java")
4013 #t))
4014 (add-before 'check 'fix-test-building
4015 (lambda _
4016 (substitute* "build.xml"
4017 (("srcdir=\"src/test\"") "srcdir=\"src/test/java\""))
4018 #t))
4019 (add-before 'build 'copy-resources
4020 (lambda _
4021 (mkdir-p "build/classes")
4022 (copy-recursively "src/main/resources" "build/classes")
4023 (mkdir-p "build/test-classes")
4024 (copy-recursively "src/test/resources" "build/test-classes")
4025 #t))
4026 (replace 'install (install-from-pom "pom.xml")))))
4027 (propagated-inputs
4028 (list java-plexus-utils java-plexus-io java-iq80-snappy
4029 java-commons-compress plexus-parent-pom-6.1))
4030 (inputs
4031 `(("java-jsr305" ,java-jsr305)
4032 ("java-plexus-container-default"
4033 ,java-plexus-container-default-bootstrap)))
4034 (native-inputs
4035 `(("java-hamcrest-core" ,java-hamcrest-core)
4036 ("junit" ,java-junit)
4037 ("classworld" ,java-plexus-classworlds)
4038 ("xbean" ,java-geronimo-xbean-reflect)
4039 ("xz" ,java-xz)
4040 ("guava" ,java-guava)))
4041 (home-page "https://github.com/codehaus-plexus/plexus-archiver")
4042 (synopsis "Archiver component of the Plexus project")
4043 (description "Plexus-archiver contains a component to deal with project
4044archives (jar).")
4045 (license license:asl2.0)))
4046
4047(define-public java-plexus-container-default
4048 (package
4049 (inherit java-plexus-container-default-bootstrap)
4050 (name "java-plexus-container-default")
4051 (arguments
4052 `(#:jar-name "container-default.jar"
4053 #:source-dir "plexus-container-default/src/main/java"
4054 #:test-dir "plexus-container-default/src/test"
4055 #:test-exclude (list ;"**/*Test.java"
4056 "**/Abstract*.java"
4057 ;; Requires plexus-hierarchy
4058 "**/PlexusHierarchyTest.java"
4059 ;; Failures
4060 "**/ComponentRealmCompositionTest.java"
4061 "**/PlexusContainerTest.java")
4062 #:phases
4063 (modify-phases %standard-phases
4064 (add-before 'build 'fix-google-collections
4065 (lambda _
4066 ;; Google collections are now replaced with guava
4067 (substitute* "plexus-container-default/pom.xml"
4068 (("google-collections") "guava")
4069 (("com.google.collections") "com.google.guava"))
4070 #t))
4071 (add-before 'build 'copy-resources
4072 (lambda _
4073 (copy-recursively
4074 "plexus-container-default/src/main/resources/"
4075 "build/classes")
4076 #t))
4077 (add-before 'check 'fix-paths
4078 (lambda _
4079 (let ((dir "plexus-container-default/src/test/java/org/codehaus"))
4080 (substitute*
4081 (string-append
4082 dir "/plexus/component/composition/"
4083 "ComponentRealmCompositionTest.java")
4084 (("src/test") "plexus-container-default/src/test"))
4085 #t)))
4086 (replace 'install
4087 (install-from-pom "plexus-container-default/pom.xml")))))
4088 (inputs
4089 `(("worldclass" ,java-plexus-classworlds)
4090 ("xbean" ,java-geronimo-xbean-reflect)
4091 ("utils" ,java-plexus-utils)
4092 ("junit" ,java-junit)
4093 ("guava" ,java-guava)))
4094 (native-inputs
4095 `(("archiver" ,java-plexus-archiver)
4096 ("hamcrest" ,java-hamcrest-core)))))
4097
4098(define-public java-plexus-component-annotations
4099 (package
4100 (inherit java-plexus-container-default)
4101 (name "java-plexus-component-annotations")
4102 (arguments
4103 `(#:jar-name "plexus-component-annotations.jar"
4104 #:source-dir "plexus-component-annotations/src/main/java"
4105 #:tests? #f; no tests
4106 #:phases
4107 (modify-phases %standard-phases
4108 (replace 'install
4109 (install-from-pom "plexus-component-annotations/pom.xml")))))
4110 (propagated-inputs
4111 (list java-plexus-containers-parent-pom))
4112 (inputs '())
4113 (native-inputs '())
4114 (synopsis "Plexus descriptors generator")
4115 (description "This package is a Maven plugin to generate Plexus descriptors
4116from source tags and class annotations.")))
4117
4118(define-public java-plexus-component-metadata
4119 (package
4120 (inherit java-plexus-container-default)
4121 (name "java-plexus-component-metadata")
4122 (arguments
4123 `(#:jar-name "plexus-component-metadata.jar"
4124 #:source-dir "src/main/java"
4125 #:test-dir "src/test"
4126 #:jdk ,icedtea-8
4127 #:phases
4128 (modify-phases %standard-phases
4129 (add-before 'configure 'chdir
4130 (lambda _
4131 (chdir "plexus-component-metadata")
4132 #t))
4133 (add-before 'build 'copy-resources
4134 (lambda _
4135 (copy-recursively "src/main/resources"
4136 "build/classes/")
4137 #t))
4138 (add-before 'build 'fix-jdom
4139 (lambda _
4140 ;; The newer version of jdom now sets multiple features by default
4141 ;; that are not supported.
4142 ;; Skip these features
4143 (substitute* "src/main/java/org/codehaus/plexus/metadata/merge/MXParser.java"
4144 (("throw new XmlPullParserException\\(\"unsupporte feature \"\\+name\\);")
4145 "// skip"))))
4146 (add-before 'build 'reinstate-cli
4147 ;; The CLI was removed in 2.1.0, but we still need it to build some
4148 ;; maven dependencies, and some parts of maven itself. We can't use
4149 ;; the maven plugin for that yet.
4150 (lambda _
4151 (with-output-to-file "src/main/java/org/codehaus/plexus/metadata/PlexusMetadataGeneratorCli.java"
4152 (lambda _
4153 ;; Copied from a previous version of this package.
4154 (display "package org.codehaus.plexus.metadata;
4155
4156import java.io.File;
4157import java.util.Arrays;
4158import java.util.Collections;
4159
4160import org.apache.commons.cli.CommandLine;
4161import org.apache.commons.cli.OptionBuilder;
4162import org.apache.commons.cli.Options;
4163import org.codehaus.plexus.PlexusContainer;
4164import org.codehaus.plexus.tools.cli.AbstractCli;
4165
4166public class PlexusMetadataGeneratorCli
4167 extends AbstractCli
4168{
4169 public static final char SOURCE_DIRECTORY = 's';
4170 public static final char SOURCE_ENCODING = 'e';
4171 public static final char CLASSES_DIRECTORY = 'c';
4172 public static final char OUTPUT_FILE = 'o';
4173 public static final char DESCRIPTORS_DIRECTORY = 'm';
4174
4175 public static void main( String[] args )
4176 throws Exception
4177 {
4178 new PlexusMetadataGeneratorCli().execute( args );
4179 }
4180
4181 @Override
4182 public String getPomPropertiesPath()
4183 {
4184 return \"META-INF/maven/org.codehaus.plexus/plexus-metadata-generator/pom.properties\";
4185 }
4186
4187 @Override
4188 @SuppressWarnings(\"static-access\")
4189 public Options buildCliOptions( Options options )
4190 {
4191 options.addOption( OptionBuilder.withLongOpt( \"source\" ).hasArg().withDescription( \"Source directory.\" ).create( SOURCE_DIRECTORY ) );
4192 options.addOption( OptionBuilder.withLongOpt( \"encoding\" ).hasArg().withDescription( \"Source file encoding.\" ).create( SOURCE_ENCODING ) );
4193 options.addOption( OptionBuilder.withLongOpt( \"classes\" ).hasArg().withDescription( \"Classes directory.\" ).create( CLASSES_DIRECTORY ) );
4194 options.addOption( OptionBuilder.withLongOpt( \"output\" ).hasArg().withDescription( \"Output directory.\" ).create( OUTPUT_FILE ) );
4195 options.addOption( OptionBuilder.withLongOpt( \"descriptors\" ).hasArg().withDescription( \"Descriptors directory.\" ).create( DESCRIPTORS_DIRECTORY ) );
4196 return options;
4197 }
4198
4199 public void invokePlexusComponent( CommandLine cli, PlexusContainer plexus )
4200 throws Exception
4201 {
4202 MetadataGenerator metadataGenerator = plexus.lookup( MetadataGenerator.class );
4203
4204 MetadataGenerationRequest request = new MetadataGenerationRequest();
4205 request.classesDirectory = new File( cli.getOptionValue( CLASSES_DIRECTORY ) );
4206 request.classpath = Collections.emptyList();
4207 request.sourceDirectories = Arrays.asList( new String[]{ new File( cli.getOptionValue( SOURCE_DIRECTORY ) ).getAbsolutePath() } );
4208 request.sourceEncoding = cli.getOptionValue( SOURCE_ENCODING );
4209 request.useContextClassLoader = true;
4210 request.outputFile = new File( cli.getOptionValue( OUTPUT_FILE ) );
4211 request.componentDescriptorDirectory = new File( cli.getOptionValue( DESCRIPTORS_DIRECTORY ) );
4212
4213 metadataGenerator.generateDescriptor( request );
4214 }
4215}")))))
4216 (add-before 'check 'fix-test-location
4217 (lambda _
4218 (substitute* '("src/test/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriterTest.java"
4219 "src/test/java/org/codehaus/plexus/metadata/merge/ComponentsXmlMergerTest.java")
4220 (("target") "build")))))))
4221 (propagated-inputs
4222 `(("java-plexus-container-default" ,java-plexus-container-default)
4223 ("java-plexu-component-annotations" ,java-plexus-component-annotations)
4224 ("java-plexus-utils" ,java-plexus-utils)
4225 ("java-plexus-cli" ,java-plexus-cli)
4226 ("java-plexus-classworlds" ,java-plexus-classworlds)
4227 ("maven-plugin-api" ,maven-plugin-api)
4228 ("maven-plugin-annotations" ,maven-plugin-annotations)
4229 ("maven-core-bootstrap" ,maven-core-bootstrap)
4230 ("maven-model" ,maven-model)
4231 ("java-commons-cli" ,java-commons-cli)
4232 ("java-qdox" ,java-qdox)
4233 ("java-jdom2" ,java-jdom2)
4234 ("java-asm-8" ,java-asm-8)))
4235 (native-inputs
4236 (list java-junit java-guava java-geronimo-xbean-reflect))
4237 (synopsis "Inversion-of-control container for Maven")
4238 (description "The Plexus project provides a full software stack for creating
4239and executing software projects. Based on the Plexus container, the
4240applications can utilise component-oriented programming to build modular,
4241reusable components that can easily be assembled and reused. This package
4242provides the Maven plugin generating the component metadata.")))
4243
4244(define-public java-plexus-container-default-1.7
4245 (package
4246 (inherit java-plexus-container-default)
4247 (version "1.7.1")
4248 (source (origin
4249 (method git-fetch)
4250 (uri (git-reference
4251 (url "https://github.com/codehaus-plexus/plexus-containers")
4252 (commit (string-append "plexus-containers-" version))))
4253 (file-name (git-file-name "java-plexus-container-default" version))
4254 (sha256
4255 (base32
4256 "1316hrp5vqfv0aw7miq2fp0wwy833h66h502h29vnh5sxj27x228"))))))
4257
4258(define java-plexus-containers-parent-pom-1.7
4259 (package
4260 (inherit java-plexus-container-default-1.7)
4261 (name "java-plexus-containers-parent-pom")
4262 (arguments
4263 `(#:tests? #f
4264 #:phases
4265 (modify-phases %standard-phases
4266 (delete 'configure)
4267 (delete 'build)
4268 (replace 'install
4269 (install-pom-file "pom.xml")))))
4270 (propagated-inputs
4271 `(("plexus-parent-pom" ,plexus-parent-pom-4.0)))))
4272
4273(define-public java-plexus-component-annotations-1.7
4274 (package
4275 (inherit java-plexus-container-default-1.7)
4276 (name "java-plexus-component-annotations")
4277 (arguments
4278 `(#:jar-name "plexus-component-annotations.jar"
4279 #:source-dir "plexus-component-annotations/src/main/java"
4280 #:tests? #f; no tests
4281 #:phases
4282 (modify-phases %standard-phases
4283 (replace 'install
4284 (install-from-pom "plexus-component-annotations/pom.xml")))))
4285 (propagated-inputs
4286 `(("java-plexus-containers-parent-pom-1.7" ,java-plexus-containers-parent-pom-1.7)))
4287 (inputs '())
4288 (native-inputs '())
4289 (synopsis "Plexus descriptors generator")
4290 (description "This package is a Maven plugin to generate Plexus descriptors
4291from source tags and class annotations.")))
4292
4293(define-public java-plexus-component-metadata-1.7
4294 (package
4295 (inherit java-plexus-container-default-1.7)
4296 (name "java-plexus-component-metadata")
4297 (arguments
4298 `(#:jar-name "plexus-component-metadata.jar"
4299 #:source-dir "src/main/java"
4300 #:test-dir "src/test"
4301 #:phases
4302 (modify-phases %standard-phases
4303 (add-before 'configure 'chdir
4304 (lambda _
4305 (chdir "plexus-component-metadata")
4306 #t))
4307 (add-before 'build 'copy-resources
4308 (lambda _
4309 (copy-recursively "src/main/resources"
4310 "build/classes/")
4311 #t))
4312 (add-before 'build 'fix-jdom
4313 (lambda _
4314 ;; The newer version of jdom now sets multiple features by default
4315 ;; that are not supported.
4316 ;; Skip these features
4317 (substitute* "src/main/java/org/codehaus/plexus/metadata/merge/MXParser.java"
4318 (("throw new XmlPullParserException\\(\"unsupporte feature \"\\+name\\);")
4319 "// skip"))))
4320 (add-before 'check 'fix-test-location
4321 (lambda _
4322 (substitute* '("src/test/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriterTest.java"
4323 "src/test/java/org/codehaus/plexus/metadata/merge/ComponentsXmlMergerTest.java")
4324 (("target") "build")))))))
4325 (propagated-inputs
4326 (list java-plexus-container-default-1.7
4327 java-plexus-component-annotations-1.7
4328 java-plexus-utils
4329 java-plexus-cli
4330 java-plexus-cli
4331 java-plexus-classworlds
4332 maven-plugin-api
4333 maven-plugin-annotations
4334 maven-core-bootstrap
4335 maven-model
4336 java-commons-cli
4337 java-qdox
4338 java-jdom2
4339 java-asm-8))
4340 (native-inputs
4341 (list java-junit java-guava java-geronimo-xbean-reflect))
4342 (synopsis "Inversion-of-control container for Maven")
4343 (description "The Plexus project provides a full software stack for creating
4344and executing software projects. Based on the Plexus container, the
4345applications can utilise component-oriented programming to build modular,
4346reusable components that can easily be assembled and reused. This package
4347provides the Maven plugin generating the component metadata.")))
4348
4349(define-public java-plexus-cipher
4350 (package
4351 (name "java-plexus-cipher")
4352 (version "2.0")
4353 (source (origin
4354 (method git-fetch)
4355 (uri (git-reference
4356 (url "https://github.com/codehaus-plexus/plexus-cipher")
4357 (commit (string-append "plexus-cipher-" version))))
4358 (file-name (git-file-name name version))
4359 (sha256
4360 (base32
4361 "01fipdsm090n8j4207fl8kbxznkgkmkkgyazf53hm1nwn6na5aai"))))
4362 (build-system ant-build-system)
4363 (arguments
4364 `(#:jar-name "plexus-cipher.jar"
4365 #:source-dir "src/main/java"
4366 #:phases
4367 (modify-phases %standard-phases
4368 (add-before 'build 'generate-javax.inject.Named
4369 (lambda _
4370 (mkdir-p "build/classes/META-INF/sisu")
4371 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4372 (lambda _
4373 (display
4374 "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
4375 #t))
4376 (replace 'install (install-from-pom "pom.xml")))))
4377 (inputs
4378 `(("java-cdi-api" ,java-cdi-api)
4379 ("java-javax-inject" ,java-javax-inject)))
4380 (propagated-inputs
4381 `(("java-sonatype-spice-parent-pom" ,java-sonatype-spice-parent-pom-15)
4382 ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)))
4383 (native-inputs
4384 `(("java-junit" ,java-junit)))
4385 (home-page "https://github.com/sonatype/plexus-cipher")
4386 (synopsis "Encryption/decryption Component")
4387 (description "Plexus-cipher contains a component to deal with encryption
4388and decryption.")
4389 (license license:asl2.0)))
4390
4391(define-public java-plexus-cipher-1.7
4392 (package
4393 (inherit java-plexus-cipher)
4394 (version "1.7")
4395 (source (origin
4396 (method git-fetch)
4397 (uri (git-reference
4398 (url "https://github.com/codehaus-plexus/plexus-cipher")
4399 (commit (string-append "plexus-cipher-" version))))
4400 (file-name (git-file-name "java-plexus-cipher" version))
4401 (sha256
4402 (base32
4403 "0m638nzlxbmnbcj5cwdpgs326ab584yv0k803zlx37r6iqwvf6b0"))))
4404 (arguments
4405 `(#:jar-name "plexus-cipher.jar"
4406 #:source-dir "src/main/java"
4407 #:tests? #f; FIXME: requires sisu-inject-bean
4408 #:phases
4409 (modify-phases %standard-phases
4410 (add-before 'build 'copy-resources
4411 (lambda _
4412 (copy-recursively "src/main/resources" "build/classes")
4413 (mkdir-p "build/classes/META-INF/sisu")
4414 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4415 (lambda _
4416 (display "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
4417 #t))
4418 (add-before 'install 'fix-test-dependency
4419 (lambda _
4420 ;; sisu-inject-bean is only used for tests, but its scope is "provided".
4421 (substitute* "pom.xml"
4422 (("provided") "test"))
4423 #t))
4424 (replace 'install (install-from-pom "pom.xml")))))
4425 (propagated-inputs
4426 (list java-sonatype-spice-parent-pom-15))))
4427
4428(define-public java-plexus-java
4429 (package
4430 (name "java-plexus-java")
4431 (version "0.9.10")
4432 (source (origin
4433 (method git-fetch)
4434 (uri (git-reference
4435 (url "https://github.com/codehaus-plexus/plexus-languages")
4436 (commit (string-append "plexus-languages-" version))))
4437 (file-name (git-file-name name version))
4438 (sha256
4439 (base32
4440 "0vmvgq5hfxs90yyxgssfpwq78l7vwx1ljwpkk594mrdr8sm668b5"))
4441 (modules '((guix build utils)))
4442 (snippet
4443 `(begin
4444 (for-each delete-file (find-files "." ".*.jar$"))
4445 #t))))
4446 (build-system ant-build-system)
4447 (arguments
4448 `(#:jar-name "plexus-java.java"
4449 #:source-dir "plexus-java/src/main/java"
4450 #:test-dir "plexus-java/src/test"
4451 #:tests? #f; require mockito 2
4452 #:phases
4453 (modify-phases %standard-phases
4454 (add-after 'build 'generate-metadata
4455 (lambda _
4456 (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
4457 "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
4458 "--source" "plexus-java/src/main/java"
4459 "--output" "build/classes/META-INF/plexus/components.xml"
4460 "--classes" "build/classes"
4461 "--descriptors" "build/classes/META-INF")
4462 (invoke "ant" "jar")
4463 #t))
4464 (add-before 'install 'install-parent
4465 (install-pom-file "pom.xml"))
4466 (replace 'install
4467 (install-from-pom "plexus-java/pom.xml")))))
4468 (propagated-inputs
4469 (list java-asm java-qdox-2-M9 java-javax-inject
4470 plexus-parent-pom-4.0))
4471 (inputs
4472 (list java-plexus-component-annotations-1.7))
4473 (native-inputs
4474 (list java-plexus-component-metadata-1.7 java-junit))
4475 (home-page "https://codehaus-plexus.github.io/plexus-languages/plexus-java")
4476 (synopsis "Shared language features for Java")
4477 (description "This package contains shared language features of the Java
4478language, for the plexus project.")
4479 (license license:asl2.0)))
4480
4481(define-public java-plexus-compiler-api
4482 (package
4483 (name "java-plexus-compiler-api")
4484 (version "2.8.4")
4485 (source (origin
4486 (method git-fetch)
4487 (uri (git-reference
4488 (url "https://github.com/codehaus-plexus/plexus-compiler")
4489 (commit (string-append "plexus-compiler-" version))))
4490 (file-name (git-file-name name version))
4491 (sha256
4492 (base32
4493 "1nq1gnn3s6z1j29gmi1hqbklsmm8b1lmnafb0191914f95mn18gk"))))
4494 (build-system ant-build-system)
4495 (arguments
4496 `(#:jar-name "plexus-compiler-api.jar"
4497 #:source-dir "plexus-compiler-api/src/main/java"
4498 #:test-dir "plexus-compiler-api/src/test"
4499 #:phases
4500 (modify-phases %standard-phases
4501 (replace 'install
4502 (install-from-pom "plexus-compiler-api/pom.xml")))))
4503 (propagated-inputs
4504 `(("java-plexus-container-default" ,java-plexus-container-default)
4505 ("java-plexus-compiler-pom" ,java-plexus-compiler-pom)
4506 ("java-plexus-util" ,java-plexus-utils)))
4507 (native-inputs
4508 (list java-junit))
4509 (home-page "https://github.com/codehaus-plexus/plexus-compiler")
4510 (synopsis "Plexus Compilers component's API to manipulate compilers")
4511 (description "This package contains the API used by components to manipulate
4512compilers.")
4513 (license (list license:asl2.0
4514 license:expat))))
4515
4516(define java-plexus-compiler-pom
4517 (package
4518 (inherit java-plexus-compiler-api)
4519 (name "java-plexus-compiler-pom")
4520 (arguments
4521 `(#:tests? #f
4522 #:phases
4523 (modify-phases %standard-phases
4524 (delete 'configure)
4525 (delete 'build)
4526 (replace 'install
4527 (install-pom-file "pom.xml"))
4528 (add-after 'install 'install-compilers
4529 (install-pom-file "plexus-compilers/pom.xml")))))
4530 (propagated-inputs
4531 `(("plexus-components-parent-pom-4.0" ,plexus-components-parent-pom-4.0)))))
4532
4533(define plexus-components-parent-pom-4.0
4534 (package
4535 (name "plexus-components-parent-pom")
4536 (version "4.0")
4537 (source (origin
4538 (method git-fetch)
4539 (uri (git-reference
4540 (url "https://github.com/codehaus-plexus/plexus-components")
4541 (commit (string-append "plexus-components-" version))))
4542 (file-name (git-file-name name version))
4543 (sha256
4544 (base32
4545 "041bm8yv0m2i17mqg8zljib4ykpha7ijls2qfdwvkma4d39lhysi"))))
4546 (build-system ant-build-system)
4547 (arguments
4548 `(#:tests? #f
4549 #:phases
4550 (modify-phases %standard-phases
4551 (delete 'configure)
4552 (delete 'build)
4553 (replace 'install
4554 (install-pom-file "pom.xml")))))
4555 (propagated-inputs
4556 `(("plexus-parent-pom-4.0" ,plexus-parent-pom-4.0)))
4557 (home-page "https://codehaus-plexus.github.io/plexus-components")
4558 (synopsis "Plexus parent pom")
4559 (description "This package contains the Plexus components parent POM.")
4560 (license license:asl2.0)))
4561
4562(define-public java-plexus-compiler-manager
4563 (package
4564 (inherit java-plexus-compiler-api)
4565 (name "java-plexus-compiler-manager")
4566 (arguments
4567 `(#:jar-name "compiler-compiler-manager.java"
4568 #:source-dir "plexus-compiler-manager/src/main/java"
4569 #:test-dir "plexus-compiler-manager/src/test"
4570 #:tests? #f
4571 #:phases
4572 (modify-phases %standard-phases
4573 (add-after 'build 'generate-metadata
4574 (lambda _
4575 (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
4576 "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
4577 "--source" "plexus-compiler-manager/src/main/java"
4578 "--output" "build/classes/META-INF/plexus/components.xml"
4579 "--classes" "build/classes"
4580 "--descriptors" "build/classes/META-INF")
4581 (invoke "ant" "jar")
4582 #t))
4583 (add-after 'generate-metadata 'rebuild
4584 (lambda _
4585 (invoke "ant" "jar")
4586 #t))
4587 (replace 'install
4588 (install-from-pom "plexus-compiler-manager/pom.xml")))))
4589 (propagated-inputs
4590 (list java-plexus-compiler-api java-plexus-compiler-pom
4591 java-plexus-container-default-1.7))
4592 (native-inputs
4593 (list unzip java-plexus-component-metadata-1.7))
4594 (synopsis "Compiler management for Plexus Compiler component")
4595 (description "Plexus Compiler is a Plexus component to use different
4596compilers through a uniform API. This component chooses the compiler
4597implementation to use in a project.")))
4598
4599(define-public java-plexus-compiler-javac
4600 (package
4601 (inherit java-plexus-compiler-api)
4602 (name "java-plexus-compiler-javac")
4603 (arguments
4604 `(#:jar-name "plexus-compiler-javac.jar"
4605 #:source-dir "plexus-compilers/plexus-compiler-javac/src/main/java"
4606 #:jdk ,icedtea-8
4607 #:tests? #f; depends on compiler-test -> maven-core -> ... -> this package.
4608 #:test-dir "plexus-compilers/plexus-compiler-javac/src/test"
4609 #:modules ((guix build ant-build-system)
4610 (guix build utils)
4611 (guix build java-utils)
4612 (sxml simple))
4613 #:phases
4614 (modify-phases %standard-phases
4615 ;; We cannot use java-plexus-component-metadata to generate the metadata
4616 ;; because it ultimately depends on this package.
4617 ;; Create it manually instead
4618 (add-before 'build 'create-metadata
4619 (lambda _
4620 (let* ((dir "build/classes/META-INF/plexus")
4621 (file (string-append dir "/components.xml")))
4622 (mkdir-p dir)
4623 (with-output-to-file file
4624 (lambda _
4625 (sxml->xml
4626 `(component-set
4627 (components
4628 (component
4629 (role "org.codehaus.plexus.compiler.Compiler")
4630 (role-hint "javac")
4631 (implementation "org.codehaus.plexus.compiler.javac.JavacCompiler")
4632 (isolated-realm "false"))))))))
4633 #t))
4634 (replace 'install
4635 (install-from-pom "plexus-compilers/plexus-compiler-javac/pom.xml")))))
4636 (propagated-inputs
4637 (list java-plexus-compiler-api java-plexus-utils
4638 java-plexus-container-default))
4639 (synopsis "Javac Compiler support for Plexus Compiler component")
4640 (description "This package contains the Javac Compiler support for Plexus
4641Compiler component.")))
4642
4643(define plexus-components-pom-1.1.20
4644 (package
4645 (name "plexus-components-pom-1.1.20")
4646 (version "1.1.20")
4647 (source (origin
4648 (method git-fetch)
4649 (uri (git-reference
4650 (url "https://github.com/codehaus-plexus/plexus-components")
4651 (commit (string-append "plexus-components-" version))))
4652 (file-name (git-file-name name version))
4653 (sha256
4654 (base32
4655 "1q254k95m9icyfsvaw8c226midg8v6v436wvivhv7im825mnp5yb"))))
4656 (build-system ant-build-system)
4657 (arguments
4658 `(#:tests? #f
4659 #:phases
4660 (modify-phases %standard-phases
4661 (delete 'configure)
4662 (delete 'build)
4663 (replace 'install
4664 (install-pom-file "pom.xml")))))
4665 (propagated-inputs
4666 `(("plexus-parent-pom" ,plexus-parent-pom-3.1)))
4667 (home-page "https://github.com/codehaus-plexus/plexus-components")
4668 (synopsis "Maven parent pom for plexus packages")
4669 (description "This package contains the parent pom for plexus component
4670packages.")
4671 (license license:asl2.0)))
4672
4673(define-public java-plexus-digest
4674 (package
4675 (name "java-plexus-digest")
4676 (version "1.2")
4677 (source (origin
4678 (method git-fetch)
4679 (uri (git-reference
4680 (url "https://github.com/codehaus-plexus/plexus-digest")
4681 (commit "2a52ad1bda8297fa0e287163d2fa37245ec6a430")))
4682 (file-name (git-file-name name version))
4683 (sha256
4684 (base32
4685 "19w5wxsliz8r42niry68qa665kvjsb8081dazg9vgd3pca72w07x"))))
4686 (build-system ant-build-system)
4687 (arguments
4688 `(#:jar-name "plexus-digest.jar"
4689 #:source-dir "src/main/java"
4690 #:tests? #f
4691 #:phases
4692 (modify-phases %standard-phases
4693 (replace 'install
4694 (install-from-pom "pom.xml")))))
4695 (propagated-inputs
4696 (list java-plexus-utils plexus-components-pom-1.1.20))
4697 (native-inputs
4698 (list java-junit))
4699 (home-page "https://github.com/codehaus-plexus/plexus-digest")
4700 (synopsis "Hash function utilities for Java")
4701 (description "This package is a plexus component that contains hash
4702function utilities.")
4703 (license license:asl2.0)))
4704
4705(define-public java-plexus-sec-dispatcher
4706 (package
4707 (name "java-plexus-sec-dispatcher")
4708 (version "2.0")
4709 (source (origin
4710 (method git-fetch)
4711 (uri (git-reference
4712 (url "https://github.com/codehaus-plexus/plexus-sec-dispatcher")
4713 (commit (string-append "plexus-sec-dispatcher-" version))))
4714 (sha256
4715 (base32
4716 "0665zcyxkv2knydxgv2dn64zvy1dx9j9af12ds9s64qmzd1rk6pk"))
4717 (file-name (git-file-name name version))))
4718 (arguments
4719 `(#:jar-name "plexus-sec-dispatcher.jar"
4720 #:source-dir "src/main/java"
4721 #:phases
4722 (modify-phases %standard-phases
4723 (add-before 'build 'generate-models
4724 (lambda* (#:key inputs #:allow-other-keys)
4725 (define (modello-single-mode file version mode)
4726 (invoke "java"
4727 "org.codehaus.modello.ModelloCli"
4728 file mode "src/main/java" version
4729 "false" "true"))
4730 (let ((file "src/main/mdo/settings-security.mdo"))
4731 (modello-single-mode file "1.0.0" "java")
4732 (modello-single-mode file "1.0.0" "xpp3-reader")
4733 (modello-single-mode file "1.0.0" "xpp3-writer"))
4734 #t))
4735 (add-before 'build 'generate-javax.inject.Named
4736 (lambda _
4737 (mkdir-p "build/classes/META-INF/sisu")
4738 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4739 (lambda _
4740 (display
4741 "org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher\n")))
4742 #t))
4743 (add-before 'check 'fix-paths
4744 (lambda _
4745 (copy-recursively "src/test/resources" "target")
4746 #t))
4747 (replace 'install (install-from-pom "pom.xml")))))
4748 (propagated-inputs
4749 (list java-plexus-utils java-plexus-cipher plexus-parent-pom-8))
4750 (native-inputs
4751 (list java-javax-inject
4752 java-modello-core
4753 ;; for modello
4754 java-plexus-container-default
4755 java-plexus-classworlds
4756 java-plexus-utils
4757 java-guava
4758 java-geronimo-xbean-reflect
4759 ;; modello plugins
4760 java-modello-plugins-java
4761 java-modello-plugins-xml
4762 java-modello-plugins-xpp3
4763 ;; for tests
4764 java-junit))
4765 (build-system ant-build-system)
4766 (home-page "https://github.com/sonatype/plexus-sec-dispatcher")
4767 (synopsis "Plexus Security Dispatcher Component")
4768 (description "This package is the Plexus Security Dispatcher Component.
4769This component decrypts a string passed to it.")
4770 (license license:asl2.0)))
4771
4772(define-public java-plexus-sec-dispatcher-1.4
4773 (package
4774 (inherit java-plexus-sec-dispatcher)
4775 (version "1.4")
4776 (source (origin
4777 (method git-fetch)
4778 (uri (git-reference
4779 (url "https://github.com/codehaus-plexus/plexus-sec-dispatcher")
4780 (commit (string-append "sec-dispatcher-" version))))
4781 (sha256
4782 (base32
4783 "1ng4yliy4cqpjr4fxxjbpwyk1wkch5f8vblm1kvwf328s4gibszs"))
4784 (file-name (git-file-name "java-plexus-sec-dispatcher" version))))
4785 (arguments
4786 (substitute-keyword-arguments (package-arguments java-plexus-sec-dispatcher)
4787 ((#:phases phases)
4788 `(modify-phases ,phases
4789 (delete 'generate-javax.inject.Named)
4790 (add-before 'build 'generate-components.xml
4791 (lambda _
4792 (mkdir-p "build/classes/META-INF/plexus")
4793 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
4794 (lambda _
4795 (display
4796 "<component-set>\n
4797 <components>\n
4798 <component>\n
4799 <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role>\n
4800 <role-hint>default</role-hint>\n
4801 <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation>\n
4802 <description></description>\n
4803 <requirements>\n
4804 <requirement>\n
4805 <role>org.sonatype.plexus.components.cipher.PlexusCipher</role>\n
4806 <field-name>_cipher</field-name>\n
4807 </requirement>\n
4808 <requirement>\n
4809 <role>org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor</role>\n
4810 <field-name>_decryptors</field-name>\n
4811 </requirement>\n
4812 </requirements>\n
4813 <configuration>\n
4814 <_configuration-file>~/.settings-security.xml</_configuration-file>\n
4815 </configuration>\n
4816 </component>\n
4817 </components>\n
4818</component-set>\n")))))))))
4819 (propagated-inputs
4820 (list java-plexus-utils java-plexus-cipher-1.7
4821 java-sonatype-spice-parent-pom-12))))
4822
4823(define-public java-plexus-cli
4824 (package
4825 (name "java-plexus-cli")
4826 (version "1.7")
4827 (source (origin
4828 (method git-fetch)
4829 (uri (git-reference
4830 (url "https://github.com/sonatype/plexus-cli")
4831 (commit "a776afa6bca84e5107bedb69440329cdb24ed645")))
4832 (file-name (string-append name "-" version))
4833 (sha256
4834 (base32
4835 "0xjrlay605rypv3zd7y24vlwf0039bil3n2cqw54r1ddpysq46vx"))))
4836 (build-system ant-build-system)
4837 (arguments
4838 `(#:jar-name "plexus-cli.jar"
4839 #:source-dir "src/main/java"
4840 #:jdk ,icedtea-8
4841 #:test-dir "src/test"))
4842 (inputs
4843 (list java-commons-cli java-plexus-container-default
4844 java-plexus-classworlds))
4845 (native-inputs
4846 (list java-plexus-utils java-junit java-guava))
4847 (home-page "https://codehaus-plexus.github.io/plexus-cli")
4848 (synopsis "CLI building library for plexus")
4849 (description "This package is a library to help creating CLI around
4850Plexus components.")
4851 (license license:asl2.0)))
4852
4853(define-public java-plexus-build-api
4854 (package
4855 (name "java-plexus-build-api")
4856 (version "0.0.7")
4857 (source (origin
4858 (method git-fetch)
4859 (uri (git-reference
4860 (url "https://github.com/codehaus-plexus/plexus-build-api")
4861 (commit (string-append "plexus-build-api-" version))))
4862 (file-name (git-file-name name version))
4863 (sha256
4864 (base32
4865 "1d5w6c58gkx30d51v7qwv1xrhc0ly76848gihmgshj19yf6yhca0"))))
4866 (build-system ant-build-system)
4867 (arguments
4868 `(#:jar-name "plexus-build-api.jar"
4869 #:source-dir "src/main/java"
4870 #:jdk ,icedtea-8
4871 #:tests? #f; FIXME: how to run the tests?
4872 #:phases
4873 (modify-phases %standard-phases
4874 (add-before 'build 'copy-resources
4875 (lambda _
4876 (copy-recursively "src/main/resources" "build/classes")
4877 (substitute* (find-files "build/classes")
4878 (("\\$\\{project.version\\}") ,version))
4879 #t))
4880 (add-before 'build 'generate-plexus-compontent
4881 (lambda _
4882 (mkdir-p "build/classes/META-INF/plexus")
4883 ;; This file is required for plexus to inject this package.
4884 ;; FIXME: how is it generated?
4885 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
4886 (lambda _
4887 (display
4888 "<component-set>\n
4889 <components>\n
4890 <component>\n
4891 <role>org.sonatype.plexus.build.incremental.BuildContext</role>\n
4892 <role-hint>default</role-hint>\n
4893 <implementation>org.sonatype.plexus.build.incremental.DefaultBuildContext</implementation>\n
4894 <description>Filesystem based non-incremental build context implementation\n
4895which behaves as if all files were just created.</description>\n
4896 </component>\n
4897 </components>\n
4898</component-set>\n")))
4899 #t))
4900 (replace 'install
4901 (install-from-pom "pom.xml")))))
4902 (inputs
4903 (list java-plexus-utils-3.2.1 java-plexus-container-default))
4904 (home-page "https://github.com/codehaus-plexus/plexus-build-api/")
4905 (synopsis "Base build API for maven")
4906 (description "This package contains the base build API for maven and
4907a default implementation of it. This API is about scanning files in a
4908project and determining what files need to be rebuilt.")
4909 (license license:asl2.0)))
4910
4911(define-public java-modello-core
4912 (package
4913 (name "java-modello-core")
4914 (version "1.11")
4915 (source (origin
4916 (method git-fetch)
4917 (uri (git-reference
4918 (url "https://github.com/codehaus-plexus/modello")
4919 (commit (string-append "modello-" version))))
4920 (file-name (git-file-name name version))
4921 (sha256
4922 (base32
4923 "18885sim7z9j3wy19i9083y9kc8l9xxl2px823a96q4rnqj5z8s2"))))
4924 (build-system ant-build-system)
4925 (arguments
4926 `(#:jar-name "modello-core.jar"
4927 #:source-dir "modello-core/src/main/java"
4928 #:test-dir "modello-core/src/test"
4929 #:main-class "org.codehaus.modello.ModelloCli"
4930 #:jdk ,icedtea-8
4931 #:phases
4932 (modify-phases %standard-phases
4933 (add-before 'build 'copy-resources
4934 (lambda _
4935 (mkdir-p "build/classes/META-INF/plexus")
4936 (copy-file "modello-core/src/main/resources/META-INF/plexus/components.xml"
4937 "build/classes/META-INF/plexus/components.xml")
4938 #t))
4939 (add-before 'check 'fix-tests
4940 (lambda _
4941 (with-directory-excursion "modello-core/src/test/java/org/codehaus"
4942 (substitute* '("modello/core/DefaultModelloCoreTest.java"
4943 "modello/core/io/ModelReaderTest.java")
4944 (("src/test") "modello-core/src/test")))
4945 #t)))))
4946 (propagated-inputs
4947 (list java-plexus-utils java-plexus-container-default
4948 java-plexus-build-api))
4949 (native-inputs
4950 (list java-junit java-plexus-classworlds java-geronimo-xbean-reflect
4951 java-guava))
4952 (home-page "https://codehaus-plexus.github.io/modello/")
4953 (synopsis "Framework for code generation from a simple model")
4954 (description "Modello is a framework for code generation from a simple model.
4955
4956Modello generates code from a simple model format: based on a plugin
4957architecture, various types of code and descriptors can be generated from the
4958single model, including Java POJOs, XML/JSON/YAML marshallers/unmarshallers,
4959XSD and documentation.")
4960 (license (list
4961 license:expat
4962 ;; Although this package uses only files licensed under expat,
4963 ;; other parts of the source are licensed under different
4964 ;; licenses. We include them to be inherited by other packages.
4965 license:asl2.0
4966 ;; Some files in modello-plugin-java are licensed under a
4967 ;; 5-clause BSD license.
4968 (license:non-copyleft
4969 (string-append "file:///modello-plugins/modello-plugin-java/"
4970 "src/main/java/org/codehaus/modello/plugin/"
4971 "java/javasource/JNaming.java"))))))
4972
4973(define-public java-modello-plugins-java
4974 (package
4975 (inherit java-modello-core)
4976 (name "java-modello-plugins-java")
4977 (arguments
4978 `(#:jar-name "modello-plugins-java.jar"
4979 #:source-dir "modello-plugins/modello-plugin-java/src/main/java"
4980 #:test-dir "modello-plugins/modello-plugin-java/src/test"
4981 #:jdk ,icedtea-8
4982 #:tests? #f; requires maven-model, which depends on this package
4983 #:phases
4984 (modify-phases %standard-phases
4985 (add-before 'build 'copy-resources
4986 (lambda _
4987 (mkdir-p "build/classes")
4988 (copy-recursively "modello-plugins/modello-plugin-java/src/main/resources"
4989 "build/classes")
4990 #t)))))
4991 (inputs
4992 (list java-modello-core))
4993 (synopsis "Modello Java Plugin")
4994 (description "Modello Java Plugin generates Java objects for the model.")))
4995
4996(define-public java-modello-plugins-xml
4997 (package
4998 (inherit java-modello-core)
4999 (name "java-modello-plugins-xml")
5000 (arguments
5001 `(#:jar-name "modello-plugins-xml.jar"
5002 #:source-dir "modello-plugins/modello-plugin-xml/src/main/java"
5003 #:test-dir "modello-plugins/modello-plugin-xml/src/test"
5004 #:jdk ,icedtea-8
5005 #:phases
5006 (modify-phases %standard-phases
5007 (add-before 'build 'copy-resources
5008 (lambda _
5009 (mkdir-p "build/classes")
5010 (copy-recursively
5011 "modello-plugins/modello-plugin-xml/src/main/resources"
5012 "build/classes")
5013 #t))
5014 (add-before 'check 'fix-paths
5015 (lambda _
5016 (with-directory-excursion "modello-plugins/modello-plugin-xml/src/test"
5017 (substitute*
5018 "java/org/codehaus/modello/plugins/xml/XmlModelloPluginTest.java"
5019 (("src/test") "modello-plugins/modello-plugin-xml/src/test")))
5020 #t)))))
5021 (propagated-inputs
5022 (list java-modello-core java-modello-plugins-java))
5023 (synopsis "Modello XML Plugin")
5024 (description "Modello XML Plugin contains shared code for every plugins
5025working on XML representation of the model.")))
5026
5027(define-public java-modello-test
5028 (package
5029 (inherit java-modello-core)
5030 (name "java-modello-test")
5031 (arguments
5032 `(#:jar-name "modello-test.jar"
5033 #:source-dir "modello-test/src/main/java"
5034 #:tests? #f; no tests
5035 #:jdk ,icedtea-8))
5036 (inputs
5037 (list java-plexus-utils java-plexus-compiler-api
5038 java-plexus-compiler-javac java-plexus-container-default))
5039 (synopsis "Modello test package")
5040 (description "The modello test package contains the basis to create
5041Modello generator unit-tests, including sample models and xml files to test
5042every feature for every plugin.")))
5043
5044(define-public java-modello-plugins-xpp3
5045 (package
5046 (inherit java-modello-core)
5047 (name "java-modello-plugins-xpp3")
5048 (arguments
5049 `(#:jar-name "modello-plugins-xpp3.jar"
5050 #:source-dir "modello-plugins/modello-plugin-xpp3/src/main/java"
5051 #:test-dir "modello-plugins/modello-plugin-xpp3/src/test"
5052 ;; One of the test dependencies is maven-model which depends on this package.
5053 #:tests? #f
5054 #:jdk ,icedtea-8
5055 #:phases
5056 (modify-phases %standard-phases
5057 (add-before 'build 'copy-resources
5058 (lambda _
5059 (mkdir-p "build/classes")
5060 (copy-recursively "modello-plugins/modello-plugin-xpp3/src/main/resources"
5061 "build/classes")
5062 #t)))))
5063 (propagated-inputs
5064 (list java-modello-core java-modello-plugins-java
5065 java-modello-plugins-xml))
5066 (native-inputs
5067 (modify-inputs (package-native-inputs java-modello-core)
5068 (prepend java-xmlunit java-modello-test)))
5069 (synopsis "Modello XPP3 Plugin")
5070 (description "The modello XPP3 plugin generates XML readers and writers based
5071on the XPP3 API (XML Pull Parser).")))
5072
5073(define-public java-ow-util-ant-tasks
5074 (package
5075 (name "java-ow-util-ant-tasks")
5076 (version "1.3.2")
5077 (source (origin
5078 (method url-fetch)
5079 (uri (string-append
5080 "mirror://debian/pool/main/o/ow-util-ant-tasks/"
5081 "ow-util-ant-tasks_" version ".orig.tar.gz"))
5082 (sha256
5083 (base32
5084 "1y5ln1g36aligwcadqksdj18i5ghqnxn523wjbzy2zyd7w58fgy5"))))
5085 (build-system ant-build-system)
5086 (arguments
5087 `(#:jar-name "ow-util-ant-tasks.jar"
5088 #:tests? #f; no tests
5089 #:phases
5090 (modify-phases %standard-phases
5091 (add-before 'build 'delete-cyclic-dependency
5092 (lambda _
5093 ;; This file depends on asm-3, which depends on this package
5094 (delete-file "src/org/objectweb/util/ant/DependencyAnalyzer.java")
5095 ;; This file depends on xalan
5096 (delete-file "src/org/objectweb/util/ant/Xalan2Liaison.java")))
5097 (add-before 'build 'fix-new-ant
5098 (lambda _
5099 (substitute* "src/org/objectweb/util/ant/MultipleCopy.java"
5100 ((", destFile.getAbsolutePath\\(\\)")
5101 ", new String[] { destFile.getAbsolutePath() }")))))))
5102 (home-page "https://packages.debian.org/source/stretch/ow-util-ant-tasks")
5103 (synopsis "Replacement for base ant tasks")
5104 (description "This library is used in the legacy build process of several
5105key frameworks developed by ObjectWeb, among them legacy versions of the
5106ObjectWeb ASM bytecode manipulation framework.")
5107 (license license:lgpl2.0+)))
5108
5109(define-public java-asm
5110 (package
5111 (name "java-asm")
5112 (version "6.0")
5113 (source (origin
5114 (method url-fetch)
5115 (uri (string-append "https://download.forge.ow2.org/asm/"
5116 "asm-" version ".tar.gz"))
5117 (sha256
5118 (base32
5119 "115l5pqblirdkmzi32dxx7gbcm4jy0s14y5wircr6h8jdr9aix00"))))
5120 (build-system ant-build-system)
5121 (arguments
5122 `(#:build-target "compile"
5123 ;; The tests require an old version of Janino, which no longer compiles
5124 ;; with the JDK7.
5125 #:tests? #f
5126 #:make-flags
5127 (list
5128 ;; We don't need these extra ant tasks, but the build system asks us to
5129 ;; provide a path anyway.
5130 "-Dobjectweb.ant.tasks.path=dummy-path"
5131 ;; The java-aqute.bndlib JAR file will be put onto the classpath and
5132 ;; used during the build automatically by ant-build-system, but
5133 ;; java-asm's build.xml fails unless we provide something here.
5134 "-Dbiz.aQute.bnd.path=dummy-path")
5135 #:phases
5136 (modify-phases %standard-phases
5137 (add-before 'build 'remove-bnd-dependency
5138 (lambda _
5139 ;; This file is the only one to require bnd, and is not needed
5140 ;; because we don't build a bundle.
5141 (delete-file "src/org/objectweb/asm/tools/ModuleInfoBndPlugin.java")
5142 #t))
5143 (add-before 'install 'build-jars
5144 (lambda* (#:key make-flags #:allow-other-keys)
5145 ;; We cannot use the "jar" target because it depends on a couple
5146 ;; of unpackaged, complicated tools.
5147 (mkdir "dist")
5148 (invoke "jar"
5149 "-cf" (string-append "dist/asm-" ,version ".jar")
5150 "-C" "output/build/tmp" ".")))
5151 (add-before 'install 'fix-pom
5152 (lambda _
5153 (substitute* (find-files "archive" "\\.pom$")
5154 (("@product.artifact@") ,version))
5155 #t))
5156 (add-before 'install 'install-parent
5157 (install-pom-file "archive/asm-parent.pom"))
5158 (replace 'install
5159 (install-from-pom "archive/asm.pom")))))
5160 (native-inputs
5161 (list java-junit))
5162 (propagated-inputs
5163 (list java-org-ow2-parent-pom-1.3))
5164 (home-page "https://asm.ow2.io/")
5165 (synopsis "Very small and fast Java bytecode manipulation framework")
5166 (description "ASM is an all purpose Java bytecode manipulation and
5167analysis framework. It can be used to modify existing classes or dynamically
5168generate classes, directly in binary form. The provided common
5169transformations and analysis algorithms allow easily assembling custom
5170complex transformations and code analysis tools.")
5171 (license license:bsd-3)))
5172
5173(define-public java-org-ow2-parent-pom-1.3
5174 (package
5175 (name "java-org-ow2-parent-pom")
5176 (version "1.3")
5177 (source (origin
5178 (method url-fetch)
5179 (uri "https://repo1.maven.org/maven2/org/ow2/ow2/1.3/ow2-1.3.pom")
5180 (sha256
5181 (base32
5182 "1yr8hfx8gffpppa4ii6cvrsq029a6x8hzy7nsavxhs60s9kmq8ai"))))
5183 (build-system ant-build-system)
5184 (arguments
5185 `(#:tests? #f
5186 #:phases
5187 (modify-phases %standard-phases
5188 (delete 'unpack)
5189 (delete 'build)
5190 (delete 'configure)
5191 (replace 'install
5192 ,#~(install-pom-file #$source)))))
5193 (home-page "https://ow2.org")
5194 (synopsis "Ow2.org parent pom")
5195 (description "This package contains the parent pom for projects from ow2.org,
5196including java-asm.")
5197 (properties '((hidden? . #t)))
5198 (license license:lgpl2.1+)))
5199
5200(define-public java-asm-bootstrap
5201 (package
5202 (inherit java-asm)
5203 (name "java-asm-bootstrap")
5204 (properties '((hidden? . #t)))
5205 (arguments
5206 (substitute-keyword-arguments (package-arguments java-asm)
5207 ((#:tests? _) #f)))
5208 (native-inputs `())))
5209
5210(define-public java-asm-3
5211 (package
5212 (inherit java-asm)
5213 (version "3.1")
5214 (source (origin
5215 (method git-fetch)
5216 (uri (git-reference
5217 (url "https://gitlab.ow2.org/asm/asm")
5218 (commit "ASM_3_1")))
5219 (file-name (git-file-name "java-asm" version))
5220 (sha256
5221 (base32
5222 "0xbyf2sl8j6mrvfpg2da0vjdp906rac62l66gkk82x5cn3vc30h4"))
5223 (modules '((guix build utils)))
5224 (snippet `(for-each delete-file (find-files "." "\\.jar$")))))
5225 (arguments
5226 `(#:build-target "jar"
5227 #:test-target "test"
5228 #:tests? #f; require legacy test software
5229 #:phases
5230 (modify-phases %standard-phases
5231 (replace 'install (install-jars "output/dist"))
5232 (delete 'generate-jar-indices))))
5233 (native-inputs (list java-ow-util-ant-tasks))))
5234
5235(define-public java-asm-8
5236 (package
5237 (inherit java-asm)
5238 (version "8.0.1")
5239 (source (origin
5240 (method git-fetch)
5241 (uri (git-reference
5242 (url "https://gitlab.ow2.org/asm/asm")
5243 (commit (string-append
5244 "ASM_" (string-join (string-split version #\.)
5245 "_")))))
5246 (file-name (git-file-name "java-asm" version))
5247 (sha256
5248 (base32
5249 "1s6j27zc1i76gh891w2g48b1c3abp9w8zp5j54yb1vm5h8djkd69"))))
5250 (arguments
5251 `(#:jar-name "asm8.jar"
5252 #:source-dir "asm/src/main/java"
5253 #:test-dir "asm/src/test"
5254 ;; tests depend on junit5
5255 #:tests? #f))
5256 (propagated-inputs '())
5257 (native-inputs '())))
5258
5259(define-public java-asm-tree-8
5260 (package
5261 (inherit java-asm-8)
5262 (name "java-asm-tree")
5263 (arguments
5264 `(#:jar-name "asm-tree.jar"
5265 #:source-dir "asm-tree/src/main/java"
5266 #:test-dir "asm-tree/src/test"
5267 ;; tests depend on junit5
5268 #:tests? #f))
5269 (inputs
5270 (list java-asm-8))))
5271
5272(define-public java-asm-analysis-8
5273 (package
5274 (inherit java-asm-8)
5275 (name "java-asm-analysis")
5276 (arguments
5277 `(#:jar-name "asm-analysis.jar"
5278 #:source-dir "asm-analysis/src/main/java"
5279 #:test-dir "asm-analysis/src/test"
5280 ;; tests depend on junit5
5281 #:tests? #f))
5282 (inputs
5283 (list java-asm-8 java-asm-tree-8))))
5284
5285(define-public java-asm-util-8
5286 (package
5287 (inherit java-asm-8)
5288 (name "java-asm-util")
5289 (arguments
5290 `(#:jar-name "asm-util8.jar"
5291 #:source-dir "asm-util/src/main/java"
5292 #:test-dir "asm-util/src/test"
5293 ;; tests depend on junit5
5294 #:tests? #f))
5295 (inputs
5296 (list java-asm-8 java-asm-analysis-8 java-asm-tree-8))))
5297
5298(define-public java-asm-commons-8
5299 (package
5300 (inherit java-asm-8)
5301 (name "java-asm-commons")
5302 (arguments
5303 (list #:jar-name "asm-commons8.jar"
5304 #:source-dir "asm-commons/src/main/java"
5305 #:test-dir "asm-commons/src/test"
5306 ;; tests depend on junit5
5307 #:tests? #f))
5308 (inputs (list java-asm-8 java-asm-analysis-8 java-asm-tree-8))))
5309
5310(define-public java-asm-9
5311 (package
5312 (inherit java-asm)
5313 (version "9.4")
5314 (source (origin
5315 (method git-fetch)
5316 (uri (git-reference
5317 (url "https://gitlab.ow2.org/asm/asm")
5318 (commit (string-append
5319 "ASM_" (string-join (string-split version #\.)
5320 "_")))))
5321 (file-name (git-file-name "java-asm" version))
5322 (sha256
5323 (base32
5324 "0c00m638skr5md1p6y1c2xn11kj5w6sjapyvwp9mh70rw095bwzk"))))
5325 (arguments
5326 `(#:jar-name "asm9.jar"
5327 #:source-dir "asm/src/main/java"
5328 #:test-dir "asm/src/test"
5329 ;; tests depend on junit5
5330 #:tests? #f))
5331 (propagated-inputs '())
5332 (native-inputs '())))
5333
5334(define-public java-asm-tree-9
5335 (package
5336 (inherit java-asm-9)
5337 (name "java-asm-tree")
5338 (arguments
5339 `(#:jar-name "asm-tree.jar"
5340 #:source-dir "asm-tree/src/main/java"
5341 #:test-dir "asm-tree/src/test"
5342 ;; tests depend on junit5
5343 #:tests? #f))
5344 (inputs
5345 (list java-asm-9))))
5346
5347(define-public java-asm-analysis-9
5348 (package
5349 (inherit java-asm-9)
5350 (name "java-asm-analysis")
5351 (arguments
5352 `(#:jar-name "asm-analysis.jar"
5353 #:source-dir "asm-analysis/src/main/java"
5354 #:test-dir "asm-analysis/src/test"
5355 ;; tests depend on junit5
5356 #:tests? #f))
5357 (inputs
5358 (list java-asm-9 java-asm-tree-9))))
5359
5360(define-public java-asm-util-9
5361 (package
5362 (inherit java-asm-9)
5363 (name "java-asm-util")
5364 (arguments
5365 `(#:jar-name "asm-util8.jar"
5366 #:source-dir "asm-util/src/main/java"
5367 #:test-dir "asm-util/src/test"
5368 ;; tests depend on junit5
5369 #:tests? #f))
5370 (inputs
5371 (list java-asm-9 java-asm-analysis-9 java-asm-tree-9))))
5372
5373(define-public java-asm-commons-9
5374 (package
5375 (inherit java-asm-9)
5376 (name "java-asm-commons")
5377 (arguments
5378 (list #:jar-name "asm-commons8.jar"
5379 #:source-dir "asm-commons/src/main/java"
5380 #:test-dir "asm-commons/src/test"
5381 ;; tests depend on junit5
5382 #:tests? #f))
5383 (inputs (list java-asm-9 java-asm-analysis-9 java-asm-tree-9))))
5384
5385(define-public java-cglib
5386 (package
5387 (name "java-cglib")
5388 (version "3.3.0")
5389 (source
5390 (origin
5391 (method git-fetch)
5392 (uri (git-reference
5393 (url "https://github.com/cglib/cglib")
5394 (commit (string-append
5395 "RELEASE_"
5396 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
5397 version)))))
5398 (file-name (git-file-name name version))
5399 (sha256
5400 (base32 "1lnscamc6bnhh7jgij5garxagp3zn2jp4cbq0rsn4xr3l0cnd014"))))
5401 (build-system ant-build-system)
5402 (arguments
5403 `(;; FIXME: tests fail because junit runs
5404 ;; "net.sf.cglib.transform.AbstractTransformTest", which does not seem
5405 ;; to describe a test at all.
5406 #:tests? #f
5407 #:jar-name "cglib.jar"
5408 #:phases
5409 (modify-phases %standard-phases
5410 (add-after 'unpack 'chdir
5411 (lambda _ (chdir "cglib") #t)))))
5412 (native-inputs (list java-junit))
5413 (propagated-inputs (list java-asm-8))
5414 (home-page "https://github.com/cglib/cglib/")
5415 (synopsis "Java byte code generation library")
5416 (description "The byte code generation library CGLIB is a high level API
5417to generate and transform Java byte code.")
5418 (license license:asl2.0)))
5419
5420(define-public java-objenesis
5421 (package
5422 (name "java-objenesis")
5423 (version "3.3")
5424 (source (origin
5425 (method git-fetch)
5426 (uri (git-reference
5427 (url "https://github.com/easymock/objenesis")
5428 (commit version)))
5429 (file-name (git-file-name name version))
5430 (sha256
5431 (base32
5432 "1brlcn536p4s1v1f3vzxhr38lvyhc33wjrbj2x06kdrd8agy90cr"))))
5433 (build-system ant-build-system)
5434 (arguments
5435 `(#:tests? #f; require junit-5
5436 #:jar-name "objenesis.jar"
5437 #:source-dir "main/src/main/java"
5438 #:test-dir "main/src/test/"))
5439 (native-inputs
5440 (list java-junit java-hamcrest-core))
5441 (home-page "http://objenesis.org/")
5442 (synopsis "Bypass the constructor when creating an object")
5443 (description "Objenesis is a small Java library that serves one purpose:
5444to instantiate a new object of a particular class. It is common to see
5445restrictions in libraries stating that classes must require a default
5446constructor. Objenesis aims to overcome these restrictions by bypassing the
5447constructor on object instantiation.")
5448 (license license:asl2.0)))
5449
5450(define-public java-easymock
5451 (package
5452 (name "java-easymock")
5453 (version "3.4")
5454 (source (origin
5455 (method git-fetch)
5456 (uri (git-reference
5457 (url "https://github.com/easymock/easymock/")
5458 (commit (string-append "easymock-" version))))
5459 (file-name (git-file-name name version))
5460 (sha256
5461 (base32
5462 "02vybm8hc0i0n9sp2f2iiqn54zwqhq835f76wc6b2m7819z5a8dq"))))
5463 (build-system ant-build-system)
5464 (arguments
5465 `(#:jar-name "easymock.jar"
5466 #:source-dir "core/src/main"
5467 #:test-dir "core/src/test"
5468 #:phases
5469 (modify-phases %standard-phases
5470 ;; FIXME: Android support requires the following packages to be
5471 ;; available: com.google.dexmaker.stock.ProxyBuilder
5472 (add-after 'unpack 'delete-android-support
5473 (lambda _
5474 (with-directory-excursion "core/src/main/java/org/easymock/internal"
5475 (substitute* "MocksControl.java"
5476 (("AndroidSupport.isAndroid\\(\\)") "false")
5477 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
5478 (delete-file "AndroidClassProxyFactory.java"))
5479 #t))
5480 (add-after 'unpack 'delete-broken-tests
5481 (lambda _
5482 (with-directory-excursion "core/src/test/java/org/easymock"
5483 ;; This test depends on dexmaker.
5484 (delete-file "tests2/ClassExtensionHelperTest.java")
5485
5486 ;; This is not a test.
5487 (delete-file "tests/BaseEasyMockRunnerTest.java")
5488
5489 ;; This test should be executed with a different runner...
5490 (delete-file "tests2/EasyMockAnnotationsTest.java")
5491 ;; ...but deleting it means that we also have to delete these
5492 ;; dependent files.
5493 (delete-file "tests2/EasyMockRunnerTest.java")
5494 (delete-file "tests2/EasyMockRuleTest.java")
5495
5496 ;; This test fails because the file "easymock.properties" does
5497 ;; not exist.
5498 (delete-file "tests2/EasyMockPropertiesTest.java"))
5499 #t)))))
5500 (inputs
5501 (list java-cglib java-objenesis))
5502 (native-inputs
5503 (list java-junit java-hamcrest-core))
5504 (home-page "https://easymock.org/")
5505 (synopsis "Java library providing mock objects for unit tests")
5506 (description "EasyMock is a Java library that provides an easy way to use
5507mock objects in unit testing.")
5508 (license license:asl2.0)))
5509
5510(define-public java-easymock-3.2
5511 (package
5512 (inherit java-easymock)
5513 (name "java-easymock")
5514 (version "3.2")
5515 (source (origin
5516 (method git-fetch)
5517 (uri (git-reference
5518 (url "https://github.com/easymock/easymock/")
5519 (commit (string-append "easymock-" version))))
5520 (file-name (git-file-name name version))
5521 (sha256
5522 (base32
5523 "0cn6qqa261mhk9mwxrsz39lkkknfv2h7iprr5zw7wpz9p96dwgv4"))))
5524 (arguments
5525 (list #:jar-name "easymock.jar"
5526 #:source-dir "easymock/src/main"
5527 #:test-dir "easymock/src/test"
5528 #:phases
5529 #~(modify-phases %standard-phases
5530 (add-after 'unpack 'delete-android-support
5531 (lambda _
5532 (with-directory-excursion "easymock/src/main/java/org/easymock/internal"
5533 (substitute* "MocksControl.java"
5534 (("AndroidSupport.isAndroid\\(\\)") "false")
5535 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
5536 (delete-file "AndroidClassProxyFactory.java"))))
5537 (add-after 'unpack 'delete-broken-tests
5538 (lambda _
5539 (with-directory-excursion "easymock/src/test/java/org/easymock"
5540 ;; This test depends on dexmaker.
5541 (delete-file "tests2/ClassExtensionHelperTest.java")
5542 ;; This is not a test.
5543 (delete-file "tests/BaseEasyMockRunnerTest.java")
5544 ;; ...but deleting it means that we also have to delete these
5545 ;; dependent files.
5546 (delete-file "tests2/EasyMockRunnerTest.java")
5547 ;; This test fails because the file "easymock.properties" does
5548 ;; not exist.
5549 (delete-file "tests2/EasyMockPropertiesTest.java")))))))))
5550
5551(define-public java-easymock-class-extension
5552 (package
5553 (inherit java-easymock-3.2)
5554 (name "java-easymock-class-extension")
5555 (build-system ant-build-system)
5556 (arguments
5557 (list #:jar-name "easymock-class-extensions.jar"
5558 #:source-dir "easymock-classextension/src/main/java"
5559 #:test-dir "easymock-classextension/src/test"))
5560 (inputs (list java-asm-8
5561 java-easymock-3.2
5562 java-cglib
5563 java-objenesis))
5564 (native-inputs
5565 (list java-junit java-hamcrest-core))
5566 (home-page "https://easymock.org/")
5567 (synopsis "Easymock extension to mock classes")
5568 (description "This package provides an extension to earlier versions of
5569easymock that allows mocking classes.")
5570 (license license:asl2.0)))
5571
5572(define-public java-jmock-1
5573 (package
5574 (name "java-jmock")
5575 (version "1.2.0")
5576 (source (origin
5577 (method git-fetch)
5578 (uri (git-reference
5579 (url "https://github.com/jmock-developers/jmock-library")
5580 (commit version)))
5581 (file-name (git-file-name name version))
5582 (sha256
5583 (base32
5584 "0lkga995xd9b9mmzxmcd301hlw83p1h78nibh7djlx7wydscr85z"))))
5585 (build-system ant-build-system)
5586 (arguments
5587 `(#:build-target "jars"
5588 #:test-target "run.tests"
5589 #:phases
5590 (modify-phases %standard-phases
5591 (replace 'install (install-jars "build")))))
5592 (home-page "http://jmock.org/")
5593 (synopsis "Mock object library for test-driven development")
5594 (description "JMock is a library that supports test-driven development of
5595Java code with mock objects. Mock objects help you design and test the
5596interactions between the objects in your programs.
5597
5598The jMock library
5599
5600@itemize
5601@item makes it quick and easy to define mock objects
5602@item lets you precisely specify the interactions between
5603 your objects, reducing the brittleness of your tests
5604@item plugs into your favourite test framework
5605@item is easy to extend.
5606@end itemize\n")
5607 (license license:bsd-3)))
5608
5609(define-public java-jmock
5610 (package
5611 (inherit java-jmock-1)
5612 (name "java-jmock")
5613 (version "2.8.2")
5614 (source (origin
5615 (method git-fetch)
5616 (uri (git-reference
5617 (url "https://github.com/jmock-developers/jmock-library")
5618 (commit version)))
5619 (file-name (git-file-name name version))
5620 (sha256
5621 (base32
5622 "12b7l22g3nrjvf2dzcw3z03fpd2chrgp0d8xkvn8w55rwb57pax6"))))
5623 (inputs
5624 (list java-hamcrest-all java-bsh java-junit))
5625 (native-inputs
5626 `(("cglib" ,java-cglib)))
5627 (arguments
5628 `(#:jar-name "java-jmock.jar"
5629 #:source-dir "jmock/src/main/java"
5630 #:test-dir "jmock/src/test"))))
5631
5632(define-public java-jmock-junit4
5633 (package
5634 (inherit java-jmock)
5635 (name "java-jmock-junit4")
5636 (arguments
5637 `(#:jar-name "java-jmock-junit4.jar"
5638 #:source-dir "jmock-junit4/src/main/java"
5639 #:test-dir "jmock-junit4/src/test"))
5640 (inputs
5641 `(("java-hamcrest-all" ,java-hamcrest-all)
5642 ("java-bsh" ,java-bsh)
5643 ("java-jmock" ,java-jmock)
5644 ("java-jumit" ,java-junit)))))
5645
5646(define-public java-jmock-legacy
5647 (package
5648 (inherit java-jmock)
5649 (name "java-jmock-legacy")
5650 (arguments
5651 `(#:jar-name "java-jmock-legacy.jar"
5652 #:source-dir "jmock-legacy/src/main/java"
5653 #:test-dir "jmock-legacy/src/test"
5654 #:phases
5655 (modify-phases %standard-phases
5656 (add-before 'check 'copy-tests
5657 (lambda _
5658 ;; This file is a dependancy of some tests
5659 (let ((file "org/jmock/test/acceptance/PackageProtectedType.java"))
5660 (copy-file (string-append "jmock/src/test/java/" file)
5661 (string-append "jmock-legacy/src/test/java/" file))
5662 #t))))))
5663 (inputs
5664 (list java-hamcrest-all
5665 java-objenesis
5666 java-cglib
5667 java-jmock
5668 java-bsh
5669 java-junit))
5670 (native-inputs
5671 (list java-jmock-junit4))))
5672
5673(define-public java-hamcrest-all
5674 (package (inherit java-hamcrest-core)
5675 (name "java-hamcrest-all")
5676 (arguments
5677 `(#:jdk ,icedtea-8
5678 ,@(substitute-keyword-arguments (package-arguments java-hamcrest-core)
5679 ((#:build-target _) "bigjar")
5680 ((#:phases phases)
5681 `(modify-phases ,phases
5682 ;; Some build targets override the classpath, so we need to patch
5683 ;; the build.xml to ensure that required dependencies are on the
5684 ;; classpath.
5685 (add-after 'unpack 'patch-classpath-for-integration
5686 (lambda* (#:key inputs #:allow-other-keys)
5687 (substitute* "build.xml"
5688 ((" build/hamcrest-library-\\$\\{version\\}.jar" line)
5689 (string-join
5690 (cons line
5691 (append
5692 (find-files (assoc-ref inputs "java-junit") "\\.jar$")
5693 (find-files (assoc-ref inputs "java-jmock") "\\.jar$")
5694 (find-files (assoc-ref inputs "java-easymock") "\\.jar$")))
5695 ";"))
5696 (("build/hamcrest-core-\\$\\{version\\}\\.jar")
5697 (car (find-files (assoc-ref inputs "java-hamcrest-core")
5698 "jar$"))))
5699 #t))
5700 (replace 'install
5701 (lambda* (#:key outputs #:allow-other-keys)
5702 (let* ((target (string-append (assoc-ref outputs "out")
5703 "/share/java/"))
5704 (version-suffix
5705 ,(string-append
5706 "-" (package-version java-hamcrest-core) ".jar"))
5707 (install-without-version-suffix
5708 (lambda (jar)
5709 (copy-file jar
5710 (string-append target
5711 (basename jar version-suffix)
5712 ".jar")))))
5713 (mkdir-p target)
5714 (for-each
5715 install-without-version-suffix
5716 (find-files "build"
5717 (lambda (name _)
5718 (and (string-suffix? ".jar" name)
5719 (not (string-suffix? "-sources.jar" name)))))))
5720 #t)))))))
5721 (inputs
5722 (modify-inputs (package-inputs java-hamcrest-core)
5723 (prepend java-junit
5724 java-jmock-1
5725 ;; This is necessary because of what seems to be a race condition.
5726 ;; This package would sometimes fail to build because hamcrest-core.jar
5727 ;; could not be found, even though it is built as part of this package.
5728 ;; Adding java-hamcrest-core appears to fix this problem. See
5729 ;; https://debbugs.gnu.org/31390 for more information.
5730 java-hamcrest-core
5731 java-easymock)))))
5732
5733(define-public java-jopt-simple
5734 (package
5735 (name "java-jopt-simple")
5736 (version "5.0.3")
5737 (source (origin
5738 (method url-fetch)
5739 (uri (string-append "https://repo1.maven.org/maven2/"
5740 "net/sf/jopt-simple/jopt-simple/"
5741 version "/jopt-simple-"
5742 version "-sources.jar"))
5743 (sha256
5744 (base32
5745 "1v8bzmwmw6qq20gm42xyay6vrd567dra4vqwhgjnqqjz1gs9f8qa"))))
5746 (build-system ant-build-system)
5747 (arguments
5748 `(#:tests? #f ; there are no tests
5749 #:jar-name "jopt-simple.jar"
5750 #:phases
5751 (modify-phases %standard-phases
5752 (add-before 'install 'create-pom
5753 (generate-pom.xml "pom.xml" "net.sf.jopt-simple" "jopt-simple" ,version))
5754 (replace 'install
5755 (install-from-pom "pom.xml")))))
5756 (home-page "https://jopt-simple.github.io/jopt-simple/")
5757 (synopsis "Java library for parsing command line options")
5758 (description "JOpt Simple is a Java library for parsing command line
5759options, such as those you might pass to an invocation of @code{javac}. In
5760the interest of striving for simplicity, as closely as possible JOpt Simple
5761attempts to honor the command line option syntaxes of POSIX @code{getopt} and
5762GNU @code{getopt_long}. It also aims to make option parser configuration and
5763retrieval of options and their arguments simple and expressive, without being
5764overly clever.")
5765 (license license:expat)))
5766
5767;; Required by jmh
5768(define-public java-jopt-simple-4
5769 (package
5770 (inherit java-jopt-simple)
5771 (version "4.6")
5772 (source (origin
5773 (method url-fetch)
5774 (uri (string-append "https://repo1.maven.org/maven2/"
5775 "net/sf/jopt-simple/jopt-simple/"
5776 version "/jopt-simple-"
5777 version "-sources.jar"))
5778 (sha256
5779 (base32
5780 "0ny82zczxkn201ld0b7rps0ifzjhfs8m1ncdmy1f50145ciszkpd"))))
5781 (arguments
5782 (substitute-keyword-arguments (package-arguments java-jopt-simple)
5783 ((#:phases phases)
5784 `(modify-phases ,phases
5785 (replace 'create-pom
5786 (generate-pom.xml "pom.xml" "net.sf.jopt-simple" "jopt-simple"
5787 ,version))))))))
5788
5789(define-public java-commons-math3
5790 (package
5791 (name "java-commons-math3")
5792 (version "3.6.1")
5793 (source (origin
5794 (method url-fetch)
5795 (uri (string-append "mirror://apache/commons/math/source/"
5796 "commons-math3-" version "-src.tar.gz"))
5797 (sha256
5798 (base32
5799 "19l6yp44qc5g7wg816nbn5z3zq3xxzwimvbm4a8pczgvpi4i85s6"))))
5800 (build-system ant-build-system)
5801 (arguments
5802 `(#:build-target "jar"
5803 #:test-target "test"
5804 #:make-flags
5805 ,#~(let ((hamcrest #$(this-package-native-input "java-hamcrest-core"))
5806 (junit #$(this-package-native-input "java-junit")))
5807 (list (string-append "-Djunit.jar="
5808 (car (find-files junit "jar$")))
5809 (string-append "-Dhamcrest.jar="
5810 (car (find-files hamcrest ".*.jar$")))))
5811 #:phases
5812 (modify-phases %standard-phases
5813 ;; We want to build the jar in the build phase and run the tests
5814 ;; later in a separate phase.
5815 (add-after 'unpack 'untangle-targets
5816 (lambda _
5817 (substitute* "build.xml"
5818 (("name=\"jar\" depends=\"test\"")
5819 "name=\"jar\" depends=\"compile\""))))
5820 ;; There is no install target.
5821 (replace 'install
5822 (install-from-pom "pom.xml")))))
5823 (native-inputs
5824 (list java-junit java-hamcrest-core))
5825 (home-page "https://commons.apache.org/math/")
5826 (synopsis "Apache Commons mathematics library")
5827 (description "Commons Math is a library of lightweight, self-contained
5828mathematics and statistics components addressing the most common problems not
5829available in the Java programming language or Commons Lang.")
5830 (license license:asl2.0)))
5831
5832(define-public java-jmh
5833 (package
5834 (name "java-jmh")
5835 (version "1.32")
5836 (source (origin
5837 (method git-fetch)
5838 (uri (git-reference
5839 (url "https://github.com/openjdk/jmh")
5840 (commit version)))
5841 (file-name (git-file-name name version))
5842 (sha256
5843 (base32
5844 "0i7fa7l3gdqkkgz5ddayp6m46dgbj9rqlz35xffrcbyiz3gpljy0"))))
5845 (build-system maven-build-system)
5846 (arguments
5847 `(#:exclude
5848 (("org.apache.maven.plugins" .
5849 ("maven-source-plugin" "maven-archetype-plugin" "maven-shade-plugin"
5850 "maven-site-plugin" "maven-javadoc-plugin" "maven-eclipse-plugin"))
5851 ("com.mycila.maven-license-plugin" . ("maven-license-plugin"))
5852 ("org.apache.maven.wagon" . ("wagon-ssh")))
5853 #:maven-plugins
5854 (("maven-enforcer-plugin" ,maven-enforcer-plugin)
5855 ,@(default-maven-plugins))
5856 #:phases
5857 (modify-phases %standard-phases
5858 (add-after 'unpack 'remove-unnecessary
5859 (lambda _
5860 ;; requires org.apache.maven.archetype:archetype-packaging.
5861 ;; Its subprojects also require groovy, kotlin and scala,
5862 ;; respectively.
5863 (delete-file-recursively "jmh-archetypes"))))))
5864 (propagated-inputs
5865 (list java-jopt-simple-4 java-commons-math3))
5866 (native-inputs
5867 (list java-junit java-hamcrest-core))
5868 (home-page "https://openjdk.java.net/projects/code-tools/jmh/")
5869 (synopsis "Benchmark harness for the JVM")
5870 (description "JMH is a Java harness for building, running, and analysing
5871nano/micro/milli/macro benchmarks written in Java and other languages
5872targeting the JVM.")
5873 ;; GPLv2 only
5874 (license license:gpl2)))
5875
5876(define-public java-commons-collections4
5877 (package
5878 (name "java-commons-collections4")
5879 (version "4.1")
5880 (source (origin
5881 (method url-fetch)
5882 (uri (string-append "mirror://apache/commons/collections/source/"
5883 "commons-collections4-" version "-src.tar.gz"))
5884 (sha256
5885 (base32
5886 "1krfhvggympq4avk7gh6qafzf6b9ip6r1m4lmacikyx04039m0wl"))))
5887 (build-system ant-build-system)
5888 (arguments
5889 `(#:test-target "test"
5890 #:make-flags
5891 ,#~(let ((hamcrest #$(this-package-native-input "java-hamcrest-core"))
5892 (junit #$(this-package-native-input "java-junit"))
5893 (easymock #$(this-package-native-input "java-easymock")))
5894 (list (string-append "-Djunit.jar="
5895 (car (find-files junit "jar$")))
5896 (string-append "-Dhamcrest.jar="
5897 (car (find-files hamcrest "jar$")))
5898 (string-append "-Deasymock.jar=" easymock
5899 "/share/java/easymock.jar")))
5900 #:phases
5901 (modify-phases %standard-phases
5902 (replace 'install
5903 (install-jars "target")))))
5904 (native-inputs
5905 (list java-junit java-hamcrest-core java-easymock))
5906 (home-page "https://commons.apache.org/collections/")
5907 (synopsis "Collections framework")
5908 (description "The Java Collections Framework is the recognised standard
5909for collection handling in Java. Commons-Collections seek to build upon the
5910JDK classes by providing new interfaces, implementations and utilities. There
5911are many features, including:
5912
5913@itemize
5914@item @code{Bag} interface for collections that have a number of copies of
5915 each object
5916@item @code{BidiMap} interface for maps that can be looked up from value to
5917 key as well and key to value
5918@item @code{MapIterator} interface to provide simple and quick iteration over
5919 maps
5920@item Transforming decorators that alter each object as it is added to the
5921 collection
5922@item Composite collections that make multiple collections look like one
5923@item Ordered maps and sets that retain the order elements are added in,
5924 including an LRU based map
5925@item Reference map that allows keys and/or values to be garbage collected
5926 under close control
5927@item Many comparator implementations
5928@item Many iterator implementations
5929@item Adapter classes from array and enumerations to collections
5930@item Utilities to test or create typical set-theory properties of collections
5931 such as union, intersection, and closure.
5932@end itemize\n")
5933 (license license:asl2.0)))
5934
5935(define-public java-commons-collections
5936 (package
5937 (inherit java-commons-collections4)
5938 (name "java-commons-collections")
5939 (version "3.2.2")
5940 (source (origin
5941 (method url-fetch)
5942 (uri (string-append "mirror://apache/commons/collections/source/"
5943 "commons-collections-" version "-src.tar.gz"))
5944 (sha256
5945 (base32
5946 "055r51a5lfc3z7rkxnxmnn1npvkvda7636hjpm4qk7cnfzz98387"))
5947 (patches
5948 (search-patches "java-commons-collections-fix-java8.patch"))))
5949 (arguments
5950 (substitute-keyword-arguments (package-arguments java-commons-collections4)
5951 ((#:phases phases)
5952 `(modify-phases ,phases
5953 ;; The manifest is required by the build procedure
5954 (add-before 'build 'add-manifest
5955 (lambda _
5956 (mkdir-p "build/conf")
5957 (call-with-output-file "build/conf/MANIFEST.MF"
5958 (lambda (file)
5959 (format file "Manifest-Version: 1.0\n")))
5960 #t))
5961 (replace 'install
5962 (install-jars "build"))))))))
5963
5964(define java-commons-collections-test-classes
5965 (package
5966 (inherit java-commons-collections)
5967 (arguments
5968 `(#:jar-name "commons-collections-test-classes.jar"
5969 #:source-dir "src/test"
5970 #:tests? #f))
5971 (inputs
5972 `(("collection" ,java-commons-collections)))))
5973
5974(define-public java-commons-beanutils
5975 (package
5976 (name "java-commons-beanutils")
5977 (version "1.9.3")
5978 (source (origin
5979 (method url-fetch)
5980 (uri (string-append "mirror://apache/commons/beanutils/source/"
5981 "commons-beanutils-" version "-src.tar.gz"))
5982 (sha256
5983 (base32
5984 "03cs0bq3sl1sdc7py9g3qnf8n9h473nrkvd3d251kaqv6a2ab7qk"))))
5985 (build-system ant-build-system)
5986 (arguments
5987 `(#:test-target "test"
5988 #:tests? #f
5989 #:phases
5990 (modify-phases %standard-phases
5991 (replace 'install
5992 (lambda* (#:key outputs #:allow-other-keys)
5993 (rename-file (string-append "dist/commons-beanutils-" ,version
5994 "-SNAPSHOT.jar")
5995 "commons-beanutils.jar")
5996 (install-file "commons-beanutils.jar"
5997 (string-append (assoc-ref outputs "out") "/share/java/"))
5998 #t)))))
5999 (inputs
6000 `(("logging" ,java-commons-logging-minimal)
6001 ("collections" ,java-commons-collections)))
6002 (native-inputs
6003 `(("junit" ,java-junit)
6004 ("collections-test" ,java-commons-collections-test-classes)))
6005 (home-page "https://commons.apache.org/beanutils/")
6006 (synopsis "Dynamically set or get properties in Java")
6007 (description "BeanUtils provides a simplified interface to reflection and
6008introspection to set or get dynamically determined properties through their
6009setter and getter method.")
6010 (license license:asl2.0)))
6011
6012(define-public java-commons-io
6013 (package
6014 (name "java-commons-io")
6015 (version "2.5")
6016 (source
6017 (origin
6018 (method url-fetch)
6019 (uri (string-append "mirror://apache/commons/io/source/"
6020 "commons-io-" version "-src.tar.gz"))
6021 (sha256
6022 (base32
6023 "0q5y41jrcjvx9hzs47x5kdhnasdy6rm4bzqd2jxl02w717m7a7v3"))))
6024 (build-system ant-build-system)
6025 (outputs '("out" "doc"))
6026 (arguments
6027 `(#:test-target "test"
6028 #:make-flags
6029 ,#~(list (string-append "-Djunit.jar="
6030 (car (find-files #$(this-package-native-input "java-junit")
6031 "jar$"))))
6032 #:phases
6033 (modify-phases %standard-phases
6034 (add-after 'build 'build-javadoc ant-build-javadoc)
6035 (replace 'install (install-from-pom "pom.xml"))
6036 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
6037 (native-inputs
6038 (list java-junit java-hamcrest-core))
6039 (propagated-inputs
6040 (list apache-commons-parent-pom-39))
6041 (home-page "https://commons.apache.org/io/")
6042 (synopsis "Common useful IO related classes")
6043 (description "Commons-IO contains utility classes, stream implementations,
6044file filters and endian classes.")
6045 (license license:asl2.0)))
6046
6047(define-public java-commons-io-latest
6048 (package
6049 (inherit java-commons-io)
6050 (version "2.21.0")
6051 (source
6052 (origin
6053 (method url-fetch)
6054 (uri (string-append "mirror://apache/commons/io/source/"
6055 "commons-io-" version "-src.tar.gz"))
6056 (sha256
6057 (base32
6058 "0rr6hb8mm7fd6nrr8f81mvdpfalq01k03l3mzrlxx7g7lda40mb3"))))
6059 (outputs '("out"))
6060 (arguments
6061 `(#:tests? #f ;; tests require too many not yet packaged packages
6062 #:source-dir "src/main/java"
6063 #:jar-name "commons-io.jar"
6064 #:phases
6065 (modify-phases %standard-phases
6066 (replace 'install (install-from-pom "pom.xml")))))
6067 (native-inputs
6068 (list))
6069 (propagated-inputs
6070 (list apache-commons-parent-pom-78))))
6071
6072(define-public java-commons-exec-1.1
6073 (package
6074 (name "java-commons-exec")
6075 (version "1.1")
6076 (source
6077 (origin
6078 (method url-fetch)
6079 (uri (string-append "mirror://apache/commons/exec/source/"
6080 "commons-exec-" version "-src.tar.gz"))
6081 (sha256
6082 (base32
6083 "025dk8xgj10lxwwwqp0hng2rn7fr4vcirxzydqzx9k4dim667alk"))))
6084 (build-system ant-build-system)
6085 (arguments
6086 `(#:test-target "test"
6087 #:make-flags
6088 ,#~(list (string-append "-Dmaven.junit.jar="
6089 (car (find-files #$(this-package-native-input "java-junit")
6090 "jar$"))))
6091 #:phases
6092 (modify-phases %standard-phases
6093 (add-before 'build 'delete-network-tests
6094 (lambda _
6095 (delete-file "src/test/java/org/apache/commons/exec/DefaultExecutorTest.java")
6096 (substitute* "src/test/java/org/apache/commons/exec/TestRunner.java"
6097 (("suite\\.addTestSuite\\(DefaultExecutorTest\\.class\\);") ""))
6098 #t))
6099 ;; The "build" phase automatically tests.
6100 (delete 'check)
6101 (replace 'install (install-jars "target")))))
6102 (native-inputs
6103 (list java-junit))
6104 (home-page "https://commons.apache.org/proper/commons-exec/")
6105 (synopsis "Common program execution related classes")
6106 (description "Commons-Exec simplifies executing external processes.")
6107 (license license:asl2.0)))
6108
6109(define-public java-commons-exec
6110 (package
6111 (inherit java-commons-exec-1.1)
6112 (version "1.3")
6113 (source
6114 (origin
6115 (method url-fetch)
6116 (uri (string-append "mirror://apache/commons/exec/source/"
6117 "commons-exec-" version "-src.tar.gz"))
6118 (sha256
6119 (base32
6120 "17yb4h6f8l49c5iyyvda4z2nmw0bxrx857nrwmsr7mmpb7x441yv"))))
6121 (arguments
6122 `(#:test-target "test"
6123 #:make-flags
6124 ,#~(list (string-append "-Dmaven.junit.jar="
6125 (car (find-files #$(this-package-native-input "java-junit")
6126 "jar$")))
6127 "-Dmaven.compiler.source=1.7"
6128 "-Dmaven.compiler.target=1.7")
6129 #:phases
6130 (modify-phases %standard-phases
6131 (add-before 'build 'delete-network-tests
6132 (lambda* (#:key inputs #:allow-other-keys)
6133 ;; This test hangs indefinitely.
6134 (delete-file "src/test/java/org/apache/commons/exec/issues/Exec60Test.java")
6135 (substitute* "src/test/java/org/apache/commons/exec/issues/Exec41Test.java"
6136 (("ping -c 10 127.0.0.1") "sleep 10"))
6137 (substitute* "src/test/java/org/apache/commons/exec/issues/Exec49Test.java"
6138 (("/bin/ls") "ls"))
6139 (call-with-output-file "src/test/scripts/ping.sh"
6140 (lambda (port)
6141 (format port "#!~a/bin/sh\nsleep $1\n"
6142 (assoc-ref inputs "bash"))))
6143 #t))
6144 ;; The "build" phase automatically tests.
6145 (delete 'check)
6146 (replace 'install (install-jars "target")))))
6147 (native-inputs
6148 (list java-junit java-hamcrest-core))))
6149
6150(define-public java-commons-lang
6151 (package
6152 (name "java-commons-lang")
6153 (version "2.6")
6154 (source
6155 (origin
6156 (method url-fetch)
6157 (uri (string-append "mirror://apache/commons/lang/source/"
6158 "commons-lang-" version "-src.tar.gz"))
6159 (sha256
6160 (base32 "1mxwagqadzx1b2al7i0z1v0r235aj2njdyijf02szq0vhmqrfiq5"))))
6161 (build-system ant-build-system)
6162 (outputs '("out" "doc"))
6163 (arguments
6164 `(#:test-target "test"
6165 #:test-exclude (list "**/Abstract*.java" "**/Random*.java")
6166 #:phases
6167 (modify-phases %standard-phases
6168 (add-after 'build 'build-javadoc ant-build-javadoc)
6169 (add-before 'check 'disable-failing-test
6170 (lambda _
6171 ;; Disable a failing test
6172 (substitute* "src/test/java/org/apache/commons/lang/\
6173time/FastDateFormatTest.java"
6174 (("public void testFormat\\(\\)")
6175 "public void disabled_testFormat()"))
6176 #t))
6177 (replace 'install (install-jars "target"))
6178 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
6179 (native-inputs
6180 (list java-junit))
6181 (home-page "https://commons.apache.org/lang/")
6182 (synopsis "Extension of the java.lang package")
6183 (description "The Commons Lang components contains a set of Java classes
6184that provide helper methods for standard Java classes, especially those found
6185in the @code{java.lang} package in the Sun JDK. The following classes are
6186included:
6187
6188@itemize
6189@item StringUtils - Helper for @code{java.lang.String}.
6190@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets
6191 of characters such as @code{[a-z]} and @code{[abcdez]}.
6192@item RandomStringUtils - Helper for creating randomised strings.
6193@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
6194@item NumberRange - A range of numbers with an upper and lower bound.
6195@item ObjectUtils - Helper for @code{java.lang.Object}.
6196@item SerializationUtils - Helper for serializing objects.
6197@item SystemUtils - Utility class defining the Java system properties.
6198@item NestedException package - A sub-package for the creation of nested
6199 exceptions.
6200@item Enum package - A sub-package for the creation of enumerated types.
6201@item Builder package - A sub-package for the creation of @code{equals},
6202 @code{hashCode}, @code{compareTo} and @code{toString} methods.
6203@end itemize\n")
6204 (license license:asl2.0)))
6205
6206(define-public java-commons-lang3
6207 (package
6208 (name "java-commons-lang3")
6209 (version "3.20.0")
6210 (source
6211 (origin
6212 (method url-fetch)
6213 (uri (string-append "mirror://apache/commons/lang/source/"
6214 "commons-lang3-" version "-src.tar.gz"))
6215 (sha256
6216 (base32 "05b2zfmw1y6bnzf7v32zkhix0c0sab82lmr3ilxciza0l5w6nwya"))))
6217 (build-system ant-build-system)
6218 (arguments
6219 `(#:jar-name "commons-lang3.jar"
6220 #:source-dir "src/main/java"
6221 #:tests? #f; require junit5
6222 #:phases
6223 (modify-phases %standard-phases
6224 (replace 'install (install-from-pom "pom.xml")))))
6225 (propagated-inputs
6226 (list apache-commons-parent-pom-48))
6227 (home-page "https://commons.apache.org/lang/")
6228 (synopsis "Extension of the java.lang package")
6229 (description "The Commons Lang components contains a set of Java classes
6230that provide helper methods for standard Java classes, especially those found
6231in the @code{java.lang} package. The following classes are included:
6232
6233@itemize
6234@item StringUtils - Helper for @code{java.lang.String}.
6235@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets of
6236 characters such as @code{[a-z]} and @code{[abcdez]}.
6237@item RandomStringUtils - Helper for creating randomised strings.
6238@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
6239@item NumberRange - A range of numbers with an upper and lower bound.
6240@item ObjectUtils - Helper for @code{java.lang.Object}.
6241@item SerializationUtils - Helper for serializing objects.
6242@item SystemUtils - Utility class defining the Java system properties.
6243@item NestedException package - A sub-package for the creation of nested
6244 exceptions.
6245@item Enum package - A sub-package for the creation of enumerated types.
6246@item Builder package - A sub-package for the creation of @code{equals},
6247 @code{hashCode}, @code{compareTo} and @code{toString} methods.
6248@end itemize\n")
6249 (license license:asl2.0)))
6250
6251(define-public java-commons-bsf
6252 (package
6253 (name "java-commons-bsf")
6254 (version "2.4.0")
6255 (source (origin
6256 (method url-fetch)
6257 (uri (string-append "mirror://apache/commons/bsf/source/bsf-src-"
6258 version ".tar.gz"))
6259 (sha256
6260 (base32
6261 "1sbamr8jl32p1jgf59nw0b2w9qivyg145954hm6ly54cfgsqrdas"))
6262 (modules '((guix build utils)))
6263 (snippet
6264 '(begin
6265 (for-each delete-file
6266 (find-files "." "\\.jar$"))
6267 #t))))
6268 (build-system ant-build-system)
6269 (arguments
6270 `(#:build-target "jar"
6271 #:tests? #f; No test file
6272 #:modules ((guix build ant-build-system)
6273 (guix build utils)
6274 (guix build java-utils)
6275 (sxml simple))
6276 #:phases
6277 (modify-phases %standard-phases
6278 (add-before 'build 'create-properties
6279 (lambda _
6280 ;; This file is missing from the distribution
6281 (call-with-output-file "build-properties.xml"
6282 (lambda (port)
6283 (sxml->xml
6284 `(project (@ (basedir ".") (name "build-properties") (default ""))
6285 (property (@ (name "project.name") (value "bsf")))
6286 (property (@ (name "source.level") (value "1.5")))
6287 (property (@ (name "build.lib") (value "build/jar")))
6288 (property (@ (name "src.dir") (value "src")))
6289 (property (@ (name "tests.dir") (value "src/org/apache/bsf/test")))
6290 (property (@ (name "build.tests") (value "build/test-classes")))
6291 (property (@ (name "build.dest") (value "build/classes"))))
6292 port)))
6293 #t))
6294 (replace 'install (install-jars "build")))))
6295 (native-inputs
6296 (list java-junit))
6297 (inputs
6298 (list java-commons-logging-minimal))
6299 (home-page "https://commons.apache.org/proper/commons-bsf")
6300 (synopsis "Bean Scripting Framework")
6301 (description "The Bean Scripting Framework (BSF) is a set of Java classes
6302which provides scripting language support within Java applications, and access
6303to Java objects and methods from scripting languages. BSF allows one to write
6304JSPs in languages other than Java while providing access to the Java class
6305library. In addition, BSF permits any Java application to be implemented in
6306part (or dynamically extended) by a language that is embedded within it. This
6307is achieved by providing an API that permits calling scripting language engines
6308from within Java, as well as an object registry that exposes Java objects to
6309these scripting language engines.")
6310 (properties '((upstream-name . "bsf")))
6311 (license license:asl2.0)))
6312
6313(define-public java-commons-jxpath
6314 (package
6315 (name "java-commons-jxpath")
6316 (version "1.3")
6317 (source (origin
6318 (method url-fetch)
6319 (uri (string-append "mirror://apache/commons/jxpath/source/"
6320 "commons-jxpath-" version "-src.tar.gz"))
6321 (sha256
6322 (base32
6323 "1rpgg31ayn9fwr4bfi2i1ij0npcg79ad2fv0w9hacvawsyc42cfs"))))
6324 (build-system ant-build-system)
6325 (arguments
6326 `(#:jar-name "commons-jxpath.jar"
6327 ;; tests require more dependencies, including mockrunner which depends on old software
6328 #:tests? #f
6329 #:source-dir "src/java"))
6330 (inputs
6331 `(("servlet" ,java-classpathx-servletapi)
6332 ("java-jdom" ,java-jdom)
6333 ("java-commons-beanutils" ,java-commons-beanutils)))
6334 (native-inputs
6335 (list java-junit))
6336 (home-page "https://commons.apache.org/jxpath/")
6337 (synopsis "Simple interpreter of an expression language called XPath")
6338 (description "The org.apache.commons.jxpath package defines a simple
6339interpreter of an expression language called XPath. JXPath applies XPath
6340expressions to graphs of objects of all kinds: JavaBeans, Maps, Servlet
6341contexts, DOM etc, including mixtures thereof.")
6342 (license license:asl2.0)))
6343
6344(define-public java-commons-pool
6345 (package
6346 (name "java-commons-pool")
6347 (version "2.6.2")
6348 (source (origin
6349 (method url-fetch)
6350 (uri (string-append "mirror://apache/commons/pool/source/"
6351 "commons-pool2-" version "-src.tar.gz"))
6352 (sha256
6353 (base32
6354 "1fi1hgqmq01bs6azbj3sfswxzadp2r8sjjfiq6ryilz1m50kvrv6"))))
6355 (arguments
6356 `(#:jar-name "common-pool.jar"
6357 #:source-dir "src/main/java"
6358 #:test-exclude
6359 (list "**/PerformanceTest.java")))
6360 (build-system ant-build-system)
6361 (inputs
6362 (list java-cglib))
6363 (native-inputs
6364 (list java-junit java-hamcrest-core java-asm java-objenesis))
6365 (home-page "https://commons.apache.org/proper/commons-pool/")
6366 (synopsis "Object-pooling API in Java")
6367 (description "The commons-pool package provides an object-pooling API
6368and a number of object pool implementations. This package defines a
6369handful of pooling interfaces and some base classes that may be useful when
6370creating new pool implementations.")
6371 (properties '((upstream-name . "commons-pool2")))
6372 (license license:asl2.0)))
6373
6374(define-public java-commons-dbcp
6375 (package
6376 (name "java-commons-dbcp")
6377 (version "2.6.0")
6378 (source (origin
6379 (method url-fetch)
6380 (uri (string-append "mirror://apache/commons/dbcp/source/"
6381 "commons-dbcp2-" version "-src.tar.gz"))
6382 (sha256
6383 (base32
6384 "0axbvcbnf2l70fc3ybrlp3siw2w4ka9mia2pnx4py8gz54cpw3rc"))))
6385 (arguments
6386 `(#:source-dir "src/main/java"
6387 #:jar-name "java-commons-dbcp.jar"
6388 #:tests? #f)); requires apache-geronimo
6389 (inputs
6390 `(("java-commons-pool" ,java-commons-pool)
6391 ("java-commons-logging" ,java-commons-logging-minimal)
6392 ("java-jboss-transaction-api-spec" ,java-jboss-transaction-api-spec)))
6393 (native-inputs
6394 (list java-junit))
6395 (build-system ant-build-system)
6396 (home-page "https://commons.apache.org/proper/commons-dbcp/")
6397 (synopsis "Database Connection Pool for Java")
6398 (description "Commons-dbcp allows you to share a pool of database
6399connections between users. Creating a new connection for each user can be
6400time consuming and even unfeasible when the number of simultaneous users is
6401very large. This package provides a way to share a poole of connections to
6402reduce that load.")
6403 (properties '((upstream-name . "commons-dbcp2")))
6404 (license license:asl2.0)))
6405
6406(define-public java-commons-jcs
6407 (package
6408 (name "java-commons-jcs")
6409 (version "3.1")
6410 (source (origin
6411 (method url-fetch)
6412 (uri (string-append "mirror://apache/commons/jcs/source/"
6413 "commons-jcs3-dist-" version "-src.tar.gz"))
6414 (sha256
6415 (base32
6416 "0y1lm1xnsj99bf7y9mkvbzqfy8dr7ac8zcbkpsjgzb9vhabfsbac"))))
6417 (build-system ant-build-system)
6418 (arguments
6419 `(#:jar-name "commons-jcs.jar"
6420 #:source-dir "commons-jcs-core/src/main/java"
6421 #:test-dir "commons-jcs-core/src/test"
6422 #:tests? #f; requires hsqldb
6423 #:phases
6424 (modify-phases %standard-phases
6425 (add-before 'build 'copy-resources
6426 (lambda _
6427 (copy-recursively "commons-jcs-core/src/main/resources"
6428 "build/classes"))))))
6429 (propagated-inputs
6430 (list java-classpathx-servletapi
6431 java-commons-dbcp
6432 java-httpcomponents-httpclient
6433 java-httpcomponents-httpcore
6434 java-log4j-api))
6435 (native-inputs
6436 (list java-junit))
6437 (home-page "https://commons.apache.org/proper/commons-jcs/")
6438 (synopsis "Distributed caching system in Java")
6439 (description "JCS is a distributed caching system written in Java. It
6440is intended to speed up applications by providing a means to manage cached
6441data of various dynamic natures. Like any caching system, JCS is most useful
6442for high read, low put applications. Latency times drop sharply and
6443bottlenecks move away from the database in an effectively cached system.")
6444 (properties '((upstream-name . "commons-jcs3-dist")))
6445 (license license:asl2.0)))
6446
6447(define-public java-jsr250
6448 (package
6449 (name "java-jsr250")
6450 (version "1.3")
6451 (source (origin
6452 (method git-fetch)
6453 (uri (git-reference
6454 (url "https://github.com/javaee/javax.annotation")
6455 (commit version)))
6456 (file-name (git-file-name name version))
6457 (sha256
6458 (base32
6459 "1g22a9d75g01s9yxgdig0ss7i30j4ysnnp08gn4krn0wly4lpqq0"))))
6460 (build-system ant-build-system)
6461 (arguments
6462 `(#:tests? #f ; no tests included
6463 #:jdk ,icedtea-8
6464 #:jar-name "jsr250.jar"
6465 #:phases
6466 (modify-phases %standard-phases
6467 (replace 'install
6468 (install-from-pom "pom.xml")))))
6469 (propagated-inputs (list java-jvnet-parent-pom-3))
6470 (home-page "https://jcp.org/en/jsr/detail?id=250")
6471 (synopsis "Security-related annotations")
6472 (description "This package provides annotations for security. It provides
6473packages in the @code{javax.annotation} and @code{javax.annotation.security}
6474namespaces.")
6475 ;; either cddl or gpl2 only, with classpath exception
6476 (license (list license:cddl1.0
6477 license:gpl2))))
6478
6479(define-public java-jsr305
6480 (package
6481 (name "java-jsr305")
6482 (version "3.0.1")
6483 (source (origin
6484 (method url-fetch)
6485 (uri (string-append "https://repo1.maven.org/maven2/"
6486 "com/google/code/findbugs/"
6487 "jsr305/" version "/jsr305-"
6488 version "-sources.jar"))
6489 (sha256
6490 (base32
6491 "1rh6jin9v7jqpq3kf1swl868l8i94r636n03pzpsmgr8v0lh9j2n"))))
6492 (build-system ant-build-system)
6493 (arguments
6494 `(#:tests? #f ; no tests included
6495 #:jar-name "jsr305.jar"
6496 #:phases
6497 (modify-phases %standard-phases
6498 (add-before 'install 'create-pom
6499 (generate-pom.xml "pom.xml" "com.google.code.findbugs" "jsr305" ,version))
6500 (replace 'install
6501 (install-from-pom "pom.xml")))))
6502 (home-page "https://findbugs.sourceforge.net/")
6503 (synopsis "Annotations for the static analyzer called findbugs")
6504 (description "This package provides annotations for the findbugs package.
6505It provides packages in the @code{javax.annotations} namespace.")
6506 (license license:asl2.0)))
6507
6508(define-public java-error-prone-annotations
6509 (package
6510 (name "java-error-prone-annotations")
6511 (version "2.18.0")
6512 (source (origin
6513 (method git-fetch)
6514 (uri (git-reference
6515 (url "https://github.com/google/error-prone")
6516 (commit (string-append "v" version))))
6517 (file-name (git-file-name "java-error-prone" version))
6518 (sha256
6519 (base32
6520 "19sqsz0b308rhadr3ff10azdbqjq37nvrn9c06224dwpxap0931f"))))
6521 (build-system ant-build-system)
6522 (arguments
6523 `(#:tests? #f; no tests
6524 #:jar-name (string-append ,name "-" ,version ".jar")
6525 #:source-dir "annotations/src/main/java"
6526 #:test-dir "annotations/src/altest"
6527 #:phases
6528 (modify-phases %standard-phases
6529 (replace 'install (install-from-pom "annotations/pom.xml")))))
6530 (propagated-inputs (list java-error-prone-parent-pom java-jsr305))
6531 (home-page "https://errorprone.info")
6532 (synopsis "Java static analyzer at compile-time")
6533 (description "Error Prone is a static analysis tool for Java that catches
6534common programming mistakes at compile-time. This package contains annotations
6535used by programmers to guide the static analysis.")
6536 (license license:asl2.0)))
6537
6538(define java-error-prone-parent-pom
6539 (package
6540 (inherit java-error-prone-annotations)
6541 (name "java-error-prone-parent-pom")
6542 (arguments
6543 `(#:tests? #f
6544 #:phases
6545 (modify-phases %standard-phases
6546 (delete 'configure)
6547 (delete 'build)
6548 (replace 'install
6549 (install-pom-file "pom.xml")))))
6550 (propagated-inputs '())))
6551
6552(define-public java-guava
6553 (package
6554 (name "java-guava")
6555 (version "31.1")
6556 (source (origin
6557 (method git-fetch)
6558 (uri (git-reference
6559 (url "https://github.com/google/guava/")
6560 (commit (string-append "v" version))))
6561 (file-name (git-file-name name version))
6562 (sha256
6563 (base32
6564 "0sv1w5cnids9ad3l7qhrh3dh1wdqwc946iinsxryafr25wg5z1lp"))
6565 (patches
6566 (search-patches "java-guava-remove-annotation-deps.patch"))))
6567 (build-system ant-build-system)
6568 (arguments
6569 `(#:tests? #f ; no tests included
6570 #:jar-name "guava.jar"
6571 #:source-dir "guava/src"
6572 #:phases
6573 (modify-phases %standard-phases
6574 (add-after 'unpack 'trim-sources
6575 (lambda _
6576 (with-directory-excursion "guava/src/com/google/common"
6577 ;; Remove annotations to avoid extra dependencies:
6578 ;; * "j2objc" annotations are used when converting Java to
6579 ;; Objective C;
6580 ;; * "IgnoreJRERequirement" is used for Android.
6581 ;; * "Nullable" is used to catch NPE at build time.
6582 (substitute* (find-files "." "\\.java$")
6583 (("import com.google.j2objc.*") "")
6584 (("import org.checkerframework.checker.*") "")
6585 (("@ReflectionSupport.*") "")
6586 (("@WeakOuter") "")
6587 (("@RetainedWith") "")
6588 (("@Weak") "")
6589 (("@J2ObjCIncompatible") "")
6590 (("@IgnoreJRERequirement") "")
6591 (("@Nullable") "")))))
6592 ;; This is required by guava, but this is just an empty stub
6593 (add-before 'install 'install-listenablefuture-stub
6594 (install-pom-file "futures/listenablefuture9999/pom.xml"))
6595 (replace 'install (install-from-pom "guava/pom.xml")))))
6596 (inputs
6597 (list java-error-prone-annotations java-jsr305))
6598 (propagated-inputs
6599 (list java-guava-futures-failureaccess java-guava-parent-pom))
6600 (home-page "https://github.com/google/guava")
6601 (synopsis "Google core libraries for Java")
6602 (description "Guava is a set of core libraries that includes new
6603collection types (such as multimap and multiset), immutable collections, a
6604graph library, functional types, an in-memory cache, and APIs/utilities for
6605concurrency, I/O, hashing, primitives, reflection, string processing, and much
6606more!")
6607 (license license:asl2.0)))
6608
6609(define-public java-guava-futures-failureaccess
6610 (package
6611 (inherit java-guava)
6612 (name "java-guava-futures-failureaccess")
6613 (arguments
6614 `(#:tests? #f; no tests
6615 #:jar-name "guava-futures-failureaccess.jar"
6616 #:source-dir "futures/failureaccess/src"
6617 #:phases
6618 (modify-phases %standard-phases
6619 (replace 'install
6620 (install-from-pom "futures/failureaccess/pom.xml")))))
6621 (propagated-inputs
6622 `(("java-sonatype-oss-parent-pom" ,java-sonatype-oss-parent-pom-7)))))
6623
6624(define java-guava-parent-pom
6625 (package
6626 (inherit java-guava)
6627 (name "java-guava-parent-pom")
6628 (arguments
6629 `(#:tests? #f
6630 #:phases
6631 (modify-phases %standard-phases
6632 (delete 'configure)
6633 (delete 'build)
6634 (replace 'install
6635 (install-pom-file "pom.xml")))))
6636 (propagated-inputs
6637 `(("java-sonatype-oss-parent-pom" ,java-sonatype-oss-parent-pom-7)))))
6638
6639;; The java-commons-logging package provides adapters to many different
6640;; logging frameworks. To avoid an excessive dependency graph we try to build
6641;; it with only a minimal set of adapters.
6642(define-public java-commons-logging-minimal
6643 (package
6644 (name "java-commons-logging-minimal")
6645 (version "1.2")
6646 (source (origin
6647 (method url-fetch)
6648 (uri (string-append "mirror://apache/commons/logging/source/"
6649 "commons-logging-" version "-src.tar.gz"))
6650 (sha256
6651 (base32
6652 "10bwcy5w8d7y39n0krlwhnp8ds3kj5zhmzj0zxnkw0qdlsjmsrj9"))))
6653 (build-system ant-build-system)
6654 (arguments
6655 `(#:tests? #f ; avoid dependency on logging frameworks
6656 #:jar-name "commons-logging-minimal.jar"
6657 #:phases
6658 (modify-phases %standard-phases
6659 (add-after 'unpack 'delete-adapters-and-tests
6660 (lambda _
6661 ;; Delete all adapters except for NoOpLog, SimpleLog, and
6662 ;; LogFactoryImpl. NoOpLog is required to build; LogFactoryImpl
6663 ;; is used by applications; SimpleLog is the only actually usable
6664 ;; implementation that does not depend on another logging
6665 ;; framework.
6666 (for-each
6667 (lambda (file)
6668 (delete-file (string-append
6669 "src/main/java/org/apache/commons/logging/impl/" file)))
6670 (list "Jdk13LumberjackLogger.java"
6671 "WeakHashtable.java"
6672 "Log4JLogger.java"
6673 "ServletContextCleaner.java"
6674 "Jdk14Logger.java"
6675 "AvalonLogger.java"
6676 "LogKitLogger.java"))
6677 (delete-file-recursively "src/test")
6678 #t)))))
6679 (home-page "https://commons.apache.org/logging/")
6680 (synopsis "Common API for logging implementations")
6681 (description "The Logging package is a thin bridge between different
6682logging implementations. A library that uses the commons-logging API can be
6683used with any logging implementation at runtime.")
6684 (properties '((upstream-name . "commons-logging")))
6685 (license license:asl2.0)))
6686
6687;; This is the last release of the 1.x series.
6688(define-public java-mockito-1
6689 (package
6690 (name "java-mockito")
6691 (version "1.10.19")
6692 (source (origin
6693 (method url-fetch)
6694 (uri (string-append "https://repo1.maven.org/maven2/"
6695 "org/mockito/mockito-core/" version
6696 "/mockito-core-" version "-sources.jar"))
6697 (sha256
6698 (base32
6699 "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc"))))
6700 (build-system ant-build-system)
6701 (arguments
6702 `(#:jar-name "mockito.jar"
6703 #:tests? #f ; no tests included
6704 ;; FIXME: patch-and-repack does not support jars, so we have to apply
6705 ;; patches in build phases.
6706 #:phases
6707 (modify-phases %standard-phases
6708 ;; Mockito was developed against a different version of hamcrest,
6709 ;; which does not require matcher implementations to provide an
6710 ;; implementation of the "describeMismatch" method. We add this
6711 ;; simple definition to pass the build with our version of hamcrest.
6712 (add-after 'unpack 'fix-hamcrest-build-error
6713 (lambda _
6714 (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java"
6715 (("public Matcher getActualMatcher\\(\\) .*" line)
6716 (string-append "
6717 public void describeMismatch(Object item, Description description) {
6718 actualMatcher.describeMismatch(item, description);
6719 }"
6720 line)))
6721 #t))
6722 ;; Mockito bundles cglib. We have a cglib package, so let's use
6723 ;; that instead.
6724 (add-after 'unpack 'use-system-libraries
6725 (lambda _
6726 (with-directory-excursion "src/org/mockito/internal/creation/cglib"
6727 (substitute* '("CGLIBHacker.java"
6728 "CglibMockMaker.java"
6729 "ClassImposterizer.java"
6730 "DelegatingMockitoMethodProxy.java"
6731 "MethodInterceptorFilter.java"
6732 "MockitoNamingPolicy.java"
6733 "SerializableMockitoMethodProxy.java"
6734 "SerializableNoOp.java")
6735 (("import org.mockito.cglib") "import net.sf.cglib")))
6736 #t)))))
6737 (inputs
6738 (list java-junit java-objenesis java-cglib java-hamcrest-core))
6739 (home-page "http://mockito.org")
6740 (synopsis "Mockito is a mock library for Java")
6741 (description "Mockito is a mocking library for Java which lets you write
6742tests with a clean and simple API. It generates mocks using reflection, and
6743it records all mock invocations, including methods arguments.")
6744 (license license:asl2.0)))
6745
6746(define-public java-httpcomponents-httpcore
6747 (package
6748 (name "java-httpcomponents-httpcore")
6749 (version "4.4.6")
6750 (source (origin
6751 (method url-fetch)
6752 (uri (string-append "mirror://apache/httpcomponents/httpcore/"
6753 "source/httpcomponents-core-"
6754 version "-src.tar.gz"))
6755 (sha256
6756 (base32
6757 "02bwcf38y4vgwq7kj2s6q7qrmma641r5lacivm16kgxvb2j6h1vy"))))
6758 (build-system ant-build-system)
6759 (arguments
6760 `(#:jar-name "httpcomponents-httpcore.jar"
6761 #:phases
6762 (modify-phases %standard-phases
6763 (add-after 'unpack 'chdir
6764 (lambda _ (chdir "httpcore") #t)))))
6765 (inputs
6766 (list java-commons-logging-minimal java-commons-lang3))
6767 (native-inputs
6768 (list java-junit java-mockito-1))
6769 (home-page "https://hc.apache.org/httpcomponents-core-4.4.x/index.html")
6770 (synopsis "Low level HTTP transport components")
6771 (description "HttpCore is a set of low level HTTP transport components
6772that can be used to build custom client and server side HTTP services with a
6773minimal footprint. HttpCore supports two I/O models: blocking I/O model based
6774on the classic Java I/O and non-blocking, event driven I/O model based on Java
6775NIO.
6776
6777This package provides the blocking I/O model library.")
6778 (license license:asl2.0)))
6779
6780(define-public java-httpcomponents-httpcore-nio
6781 (package (inherit java-httpcomponents-httpcore)
6782 (name "java-httpcomponents-httpcore-nio")
6783 (arguments
6784 `(#:jar-name "httpcomponents-httpcore-nio.jar"
6785 #:phases
6786 (modify-phases %standard-phases
6787 (add-after 'unpack 'chdir
6788 (lambda _ (chdir "httpcore-nio") #t)))))
6789 (inputs
6790 (modify-inputs (package-inputs java-httpcomponents-httpcore)
6791 (prepend java-httpcomponents-httpcore java-hamcrest-core)))
6792 (description "HttpCore is a set of low level HTTP transport components
6793that can be used to build custom client and server side HTTP services with a
6794minimal footprint. HttpCore supports two I/O models: blocking I/O model based
6795on the classic Java I/O and non-blocking, event driven I/O model based on Java
6796NIO.
6797
6798This package provides the non-blocking I/O model library based on Java
6799NIO.")))
6800
6801(define-public java-httpcomponents-httpcore-ab
6802 (package (inherit java-httpcomponents-httpcore)
6803 (name "java-httpcomponents-httpcore-ab")
6804 (arguments
6805 `(#:jar-name "httpcomponents-httpcore-ab.jar"
6806 #:phases
6807 (modify-phases %standard-phases
6808 (add-after 'unpack 'chdir
6809 (lambda _ (chdir "httpcore-ab") #t)))))
6810 (inputs
6811 (modify-inputs (package-inputs java-httpcomponents-httpcore)
6812 (prepend java-httpcomponents-httpcore java-commons-cli
6813 java-hamcrest-core)))
6814 (synopsis "Apache HttpCore benchmarking tool")
6815 (description "This package provides the HttpCore benchmarking tool. It is
6816an Apache AB clone based on HttpCore.")))
6817
6818(define-public java-httpcomponents-httpcore-osgi
6819 (package (inherit java-httpcomponents-httpcore)
6820 (name "java-httpcomponents-httpcore-osgi")
6821 (arguments
6822 `(#:jar-name "httpcomponents-httpcore-osgi.jar"
6823 #:phases
6824 (modify-phases %standard-phases
6825 (add-after 'unpack 'chdir
6826 (lambda _ (chdir "httpcore-osgi"))))))
6827 (inputs
6828 (modify-inputs (package-inputs java-httpcomponents-httpcore)
6829 (prepend java-httpcomponents-httpcore
6830 java-httpcomponents-httpcore-nio
6831 java-hamcrest-core)))
6832 (native-inputs (list java-ops4j-pax-exam-core
6833 java-ops4j-pax-exam-core-junit
6834 java-ops4j-pax-exam-core-spi
6835 java-junit))
6836 (description "HttpCore is a set of low level HTTP transport components
6837that can be used to build custom client and server side HTTP services with a
6838minimal footprint. HttpCore supports two I/O models: blocking I/O model based
6839on the classic Java I/O and non-blocking, event driven I/O model based on Java
6840NIO.
6841
6842This package provides... some tests.")))
6843
6844(define-public java-httpcomponents-httpclient
6845 (package
6846 (name "java-httpcomponents-httpclient")
6847 (version "4.5.12")
6848 (source (origin
6849 (method url-fetch)
6850 (uri (string-append "mirror://apache/httpcomponents/httpclient/"
6851 "source/httpcomponents-client-"
6852 version "-src.tar.gz"))
6853 (sha256
6854 (base32
6855 "1va99m2zc2liv0v9vn72p5ja8yz4s5wq7zpahaai5nr966kvxzkb"))))
6856 (build-system ant-build-system)
6857 (arguments
6858 `(#:jar-name "httpcomponents-httpclient.jar"
6859 #:phases
6860 (modify-phases %standard-phases
6861 (add-after 'unpack 'chdir
6862 (lambda _ (chdir "httpclient") #t)))))
6863 (inputs
6864 (list java-commons-logging-minimal
6865 java-commons-codec
6866 java-hamcrest-core
6867 java-httpcomponents-httpcore
6868 java-mockito-1
6869 java-junit))
6870 (home-page "https://hc.apache.org/httpcomponents-client-ga/")
6871 (synopsis "HTTP client library for Java")
6872 (description "Although the @code{java.net} package provides basic
6873functionality for accessing resources via HTTP, it doesn't provide the full
6874flexibility or functionality needed by many applications. @code{HttpClient}
6875seeks to fill this void by providing an efficient, up-to-date, and
6876feature-rich package implementing the client side of the most recent HTTP
6877standards and recommendations.")
6878 (properties '((upstream-name . "httpcomponents-client")))
6879 (license license:asl2.0)))
6880
6881(define-public java-httpcomponents-httpclient-cache
6882 (package (inherit java-httpcomponents-httpclient)
6883 (name "java-httpcomponents-httpclient-cache")
6884 (arguments
6885 `(#:jar-name "httpcomponents-httpclient-cache.jar"
6886 #:source-dir "src/main/java"
6887 #:test-dir "src/test"
6888 #:tests? #f; tests are broken with current cglib.
6889 #:phases
6890 (modify-phases %standard-phases
6891 (add-after 'unpack 'delete-unused-impls
6892 (lambda _
6893 (for-each
6894 delete-file-recursively
6895 '("src/main/java/org/apache/http/impl/client/cache/ehcache/"
6896 "src/main/java/org/apache/http/impl/client/cache/memcached/"
6897 "src/test/java/org/apache/http/impl/client/cache/ehcache/"
6898 "src/test/java/org/apache/http/impl/client/cache/memcached/"))))
6899 (add-after 'unpack 'chdir
6900 (lambda _ (chdir "httpclient-cache"))))))
6901 (inputs
6902 (modify-inputs (package-inputs java-httpcomponents-httpclient)
6903 (prepend java-httpcomponents-httpclient
6904 java-httpcomponents-httpmime
6905 java-hamcrest-core)))
6906 (description "This package provides an API for caching accessed HTTP
6907resources.")))
6908
6909(define-public java-httpcomponents-httpclient-osgi
6910 (package (inherit java-httpcomponents-httpclient)
6911 (name "java-httpcomponents-httpclient-osgi")
6912 (arguments
6913 `(#:jar-name "httpcomponents-httpclient-osgi.jar"
6914 #:tests? #f; tests are broken with current cglib.
6915 #:phases
6916 (modify-phases %standard-phases
6917 (add-after 'unpack 'chdir
6918 (lambda _ (chdir "httpclient-osgi") #t)))))
6919 (inputs
6920 (modify-inputs (package-inputs java-httpcomponents-httpclient)
6921 (prepend java-httpcomponents-httpclient
6922 java-httpcomponents-httpclient-cache
6923 java-osgi-framework
6924 java-osgi-service-cm
6925 java-hamcrest-core)))))
6926
6927(define-public java-httpcomponents-httpmime
6928 (package (inherit java-httpcomponents-httpclient)
6929 (name "java-httpcomponents-httpmime")
6930 (arguments
6931 `(#:jar-name "httpcomponents-httpmime.jar"
6932 #:phases
6933 (modify-phases %standard-phases
6934 (add-after 'unpack 'chdir
6935 (lambda _ (chdir "httpmime") #t)))))
6936 (inputs
6937 (list java-httpcomponents-httpclient java-httpcomponents-httpcore
6938 java-junit java-hamcrest-core))))
6939
6940(define-public java-commons-net
6941 (package
6942 (name "java-commons-net")
6943 (version "3.6")
6944 (source (origin
6945 (method url-fetch)
6946 (uri (string-append "mirror://apache/commons/net/source/"
6947 "commons-net-" version "-src.tar.gz"))
6948 (sha256
6949 (base32
6950 "0n0cmnddk9qdqhjvka8pc6hd9mn2qi3166f1s6xk32h7rfy1adxr"))))
6951 (build-system ant-build-system)
6952 (arguments
6953 `(;; FIXME: MainTest.java tries to read "examples.properties" (which
6954 ;; should be "resources/examples/examples.properties"), but gets "null"
6955 ;; instead.
6956 #:tests? #f
6957 #:jar-name "commons-net.jar"))
6958 (native-inputs
6959 (list java-junit java-hamcrest-core))
6960 (home-page "https://commons.apache.org/net/")
6961 (synopsis "Client library for many basic Internet protocols")
6962 (description "The Apache Commons Net library implements the client side of
6963many basic Internet protocols. The purpose of the library is to provide
6964fundamental protocol access, not higher-level abstractions.")
6965 (license license:asl2.0)))
6966
6967(define-public java-jsch
6968 (package
6969 (name "java-jsch")
6970 (version "0.1.55")
6971 (source (origin
6972 (method url-fetch)
6973 (uri (string-append "mirror://sourceforge/jsch/jsch/"
6974 version "/jsch-" version ".zip"))
6975 (sha256
6976 (base32
6977 "1lxyjwvmwa723wcf3bqn816hkvc03vz4xhbsi7bvfhrz2rpgcfq6"))))
6978 (build-system ant-build-system)
6979 (arguments
6980 `(#:build-target "dist"
6981 #:tests? #f ; no tests included
6982 #:phases
6983 (modify-phases %standard-phases
6984 (replace 'install (install-jars "dist")))))
6985 (native-inputs
6986 (list unzip))
6987 (home-page "http://www.jcraft.com/jsch/")
6988 (synopsis "Pure Java implementation of SSH2")
6989 (description "JSch is a pure Java implementation of SSH2. JSch allows you
6990to connect to an SSH server and use port forwarding, X11 forwarding, file
6991transfer, etc., and you can integrate its functionality into your own Java
6992programs.")
6993 (license license:bsd-3)))
6994
6995(define-public java-commons-compress
6996 (package
6997 (name "java-commons-compress")
6998 (version "1.21")
6999 (source (origin
7000 (method url-fetch)
7001 (uri (string-append "mirror://apache/commons/compress/source/"
7002 "commons-compress-" version "-src.tar.gz"))
7003 (sha256
7004 (base32
7005 "1rkpb6xcyly1wnbx4q6iq6p5hrr0h1d0ppb5r07psc75cbmizjry"))))
7006 (build-system ant-build-system)
7007 (arguments
7008 `(#:jar-name "commons-compress.jar"
7009 #:source-dir "src/main/java"
7010 #:tests? #f; requires java-mockito-3
7011 #:phases
7012 (modify-phases %standard-phases
7013 (replace 'install (install-from-pom "pom.xml")))))
7014 (propagated-inputs
7015 (list java-asm-3
7016 java-brotli
7017 java-osgi-core
7018 java-xz
7019 java-zstd
7020 apache-commons-parent-pom-52))
7021 (home-page "https://commons.apache.org/proper/commons-compress/")
7022 (synopsis "Java library for working with compressed files")
7023 (description "The Apache Commons Compress library defines an API for
7024working with compressed files such as ar, cpio, Unix dump, tar, zip, gzip, XZ,
7025Pack200, bzip2, 7z, arj, lzma, snappy, DEFLATE, lz4 and Z files.")
7026 (license license:asl2.0)))
7027
7028(define-public java-commons-csv
7029 (package
7030 (name "java-commons-csv")
7031 (version "1.4")
7032 (source (origin
7033 (method url-fetch)
7034 (uri (string-append "mirror://apache/commons/csv/source/"
7035 "commons-csv-" version "-src.tar.gz"))
7036 (sha256
7037 (base32
7038 "1l89m0fm2s3xx3v3iynvangymfg2vlyngaj6fgsi457nmsw7m7ij"))))
7039 (build-system ant-build-system)
7040 (arguments
7041 `(#:jar-name "commons-csv.jar"
7042 #:source-dir "src/main/java"
7043 #:tests? #f)); FIXME: requires java-h2
7044 (inputs
7045 `(("java-hamcrest-core" ,java-hamcrest-core)
7046 ("java-commons-io" ,java-commons-io)
7047 ("java-commons-lang3" ,java-commons-lang3)
7048 ("junit" ,java-junit)))
7049 (home-page "https://commons.apache.org/proper/commons-csv/")
7050 (synopsis "Read and write CSV documents")
7051 (description "Commons CSV reads and writes files in variations of the Comma
7052Separated Value (CSV) format. The most common CSV formats are predefined in the
7053CSVFormat class:
7054
7055@itemize
7056@item Microsoft Excel
7057@item Informix UNLOAD
7058@item Informix UNLOAD CSV
7059@item MySQL
7060@item RFC 4180
7061@item TDF
7062@end itemize
7063
7064Custom formats can be created using a fluent style API.")
7065 (license license:asl2.0)))
7066
7067(define-public java-osgi-annotation
7068 (package
7069 (name "java-osgi-annotation")
7070 (version "6.0.0")
7071 (source (origin
7072 (method url-fetch)
7073 (uri (string-append "https://repo1.maven.org/maven2/"
7074 "org/osgi/org.osgi.annotation/" version "/"
7075 "org.osgi.annotation-" version "-sources.jar"))
7076 (sha256
7077 (base32
7078 "1q718mb7gqg726rh6pc2hcisn8v50nv35abbir0jypmffhiii85w"))))
7079 (build-system ant-build-system)
7080 (arguments
7081 `(#:tests? #f ; no tests
7082 #:jar-name "osgi-annotation.jar"
7083 #:phases
7084 (modify-phases %standard-phases
7085 (add-before 'install 'create-pom
7086 (generate-pom.xml "pom.xml" "osgi" "osgi-annotation" ,version))
7087 (replace 'install (install-from-pom "pom.xml")))))
7088 (home-page "https://www.osgi.org")
7089 (synopsis "Annotation module of OSGi framework")
7090 (description
7091 "OSGi, for Open Services Gateway initiative framework, is a module system
7092and service platform for the Java programming language. This package contains
7093the OSGi annotation module, providing additional services to help dynamic
7094components.")
7095 (license license:asl2.0)))
7096
7097(define-public java-osgi-core
7098 (package
7099 (name "java-osgi-core")
7100 (version "6.0.0")
7101 (source (origin
7102 (method url-fetch)
7103 (uri (string-append "https://repo1.maven.org/maven2/"
7104 "org/osgi/org.osgi.core/" version "/"
7105 "org.osgi.core-" version "-sources.jar"))
7106 (sha256
7107 (base32
7108 "19bpf5jx32jq9789gyhin35q5v7flmw0p9mk7wbgqpxqfmxyiabv"))))
7109 (build-system ant-build-system)
7110 (arguments
7111 `(#:tests? #f ; no tests
7112 #:jar-name "osgi-core.jar"
7113 #:phases
7114 (modify-phases %standard-phases
7115 (add-before 'install 'create-pom
7116 (generate-pom.xml "pom.xml" "org.osgi" "org.osgi.core" ,version))
7117 (replace 'install (install-from-pom "pom.xml")))))
7118 (inputs
7119 (list java-osgi-annotation))
7120 (home-page "https://www.osgi.org")
7121 (synopsis "Core module of OSGi framework")
7122 (description
7123 "OSGi, for Open Services Gateway initiative framework, is a module system
7124and service platform for the Java programming language. This package contains
7125the OSGi Core module.")
7126 (license license:asl2.0)))
7127
7128(define-public java-osgi-service-event
7129 (package
7130 (name "java-osgi-service-event")
7131 (version "1.3.1")
7132 (source (origin
7133 (method url-fetch)
7134 (uri (string-append "https://repo1.maven.org/maven2/"
7135 "org/osgi/org.osgi.service.event/"
7136 version "/org.osgi.service.event-"
7137 version "-sources.jar"))
7138 (sha256
7139 (base32
7140 "1nyhlgagwym75bycnjczwbnpymv2iw84zbhvvzk84g9q736i6qxm"))))
7141 (build-system ant-build-system)
7142 (arguments
7143 `(#:tests? #f ; no tests
7144 #:jar-name "osgi-service-event.jar"))
7145 (inputs
7146 (list java-osgi-annotation java-osgi-core))
7147 (home-page "https://www.osgi.org")
7148 (synopsis "OSGi service event module")
7149 (description
7150 "OSGi, for Open Services Gateway initiative framework, is a module system
7151and service platform for the Java programming language. This package contains
7152the OSGi @code{org.osgi.service.event} module.")
7153 (license license:asl2.0)))
7154
7155(define-public java-eclipse-osgi
7156 (package
7157 (name "java-eclipse-osgi")
7158 (version "3.11.3")
7159 (source (origin
7160 (method url-fetch)
7161 (uri (string-append "https://repo1.maven.org/maven2/"
7162 "org/eclipse/platform/org.eclipse.osgi/"
7163 version "/org.eclipse.osgi-"
7164 version "-sources.jar"))
7165 (sha256
7166 (base32
7167 "00cqc6lb29n0zv68b4l842vzkwawvbr7gshfdygsk8sicvcq2c7b"))))
7168 (build-system ant-build-system)
7169 (arguments
7170 `(#:tests? #f ; no tests included
7171 #:jar-name "eclipse-equinox-osgi.jar"))
7172 (inputs
7173 (list java-osgi-annotation))
7174 (home-page "https://www.eclipse.org/equinox/")
7175 (synopsis "Eclipse Equinox OSGi framework")
7176 (description "This package provides an implementation of the OSGi Core
7177specification.")
7178 (license license:epl1.0)))
7179
7180(define-public java-eclipse-equinox-common
7181 (package
7182 (name "java-eclipse-equinox-common")
7183 (version "3.10.200")
7184 (source (origin
7185 (method url-fetch)
7186 (uri (string-append "https://repo1.maven.org/maven2/"
7187 "org/eclipse/platform/org.eclipse.equinox.common/"
7188 version "/org.eclipse.equinox.common-"
7189 version "-sources.jar"))
7190 (sha256
7191 (base32
7192 "1yn8ij6xsljlf35sr2l7wvyvc0ss4n1rv0ry5zkgb49dj4hyrqrj"))))
7193 (build-system ant-build-system)
7194 (arguments
7195 `(#:tests? #f ; no tests included
7196 #:jar-name "eclipse-equinox-common.jar"))
7197 (inputs
7198 (list java-eclipse-osgi))
7199 (home-page "https://www.eclipse.org/equinox/")
7200 (synopsis "Common Eclipse runtime")
7201 (description "This package provides the common Eclipse runtime.")
7202 (license license:epl1.0)))
7203
7204(define-public java-eclipse-core-jobs
7205 (package
7206 (name "java-eclipse-core-jobs")
7207 (version "3.8.0")
7208 (source (origin
7209 (method url-fetch)
7210 (uri (string-append "https://repo1.maven.org/maven2/"
7211 "org/eclipse/platform/org.eclipse.core.jobs/"
7212 version "/org.eclipse.core.jobs-"
7213 version "-sources.jar"))
7214 (sha256
7215 (base32
7216 "0395b8lh0km8vhzjnchvs1rii1qz48hyvb2wqfaq4yhklbwihq4b"))))
7217 (build-system ant-build-system)
7218 (arguments
7219 `(#:tests? #f ; no tests included
7220 #:jar-name "eclipse-core-jobs.jar"))
7221 (inputs
7222 (list java-eclipse-equinox-common java-eclipse-osgi))
7223 (home-page "https://www.eclipse.org/equinox/")
7224 (synopsis "Eclipse jobs mechanism")
7225 (description "This package provides the Eclipse jobs mechanism.")
7226 (license license:epl1.0)))
7227
7228(define-public java-eclipse-equinox-registry
7229 (package
7230 (name "java-eclipse-equinox-registry")
7231 (version "3.6.100")
7232 (source (origin
7233 (method url-fetch)
7234 (uri (string-append "https://repo1.maven.org/maven2/"
7235 "org/eclipse/platform/org.eclipse.equinox.registry/"
7236 version "/org.eclipse.equinox.registry-"
7237 version "-sources.jar"))
7238 (sha256
7239 (base32
7240 "1i9sgymh2fy5vdgk5y7s3qvrlbgh4l93ddqi3v4zmca7hwrlhf9k"))))
7241 (build-system ant-build-system)
7242 (arguments
7243 `(#:tests? #f ; no tests included
7244 #:jar-name "eclipse-equinox-registry.jar"))
7245 (inputs
7246 (list java-eclipse-core-jobs java-eclipse-equinox-common
7247 java-eclipse-osgi))
7248 (home-page "https://www.eclipse.org/equinox/")
7249 (synopsis "Eclipse extension registry support")
7250 (description "This package provides support for the Eclipse extension
7251registry.")
7252 (license license:epl1.0)))
7253
7254(define-public java-eclipse-equinox-app
7255 (package
7256 (name "java-eclipse-equinox-app")
7257 (version "1.3.400")
7258 (source (origin
7259 (method url-fetch)
7260 (uri (string-append "https://repo1.maven.org/maven2/"
7261 "org/eclipse/platform/org.eclipse.equinox.app/"
7262 version "/org.eclipse.equinox.app-"
7263 version "-sources.jar"))
7264 (sha256
7265 (base32
7266 "0nhvbp93y203ar7y59gb0mz3w2d3jlqhr0c9hii9bcfpmr7imdab"))))
7267 (build-system ant-build-system)
7268 (arguments
7269 `(#:tests? #f ; no tests included
7270 #:jar-name "eclipse-equinox-app.jar"))
7271 (inputs
7272 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7273 java-eclipse-osgi java-osgi-service-event))
7274 (home-page "https://www.eclipse.org/equinox/")
7275 (synopsis "Equinox application container")
7276 (description "This package provides the Equinox application container for
7277Eclipse.")
7278 (license license:epl1.0)))
7279
7280(define-public java-eclipse-equinox-preferences
7281 (package
7282 (name "java-eclipse-equinox-preferences")
7283 (version "3.6.1")
7284 (source (origin
7285 (method url-fetch)
7286 (uri (string-append "https://repo1.maven.org/maven2/"
7287 "org/eclipse/platform/org.eclipse.equinox.preferences/"
7288 version "/org.eclipse.equinox.preferences-"
7289 version "-sources.jar"))
7290 (sha256
7291 (base32
7292 "0k7w6c141sqym4fy3af0qkwpy4pdh2vsjpjba6rp5fxyqa24v0a2"))))
7293 (build-system ant-build-system)
7294 (arguments
7295 `(#:tests? #f ; no tests included
7296 #:jar-name "eclipse-equinox-preferences.jar"))
7297 (inputs
7298 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7299 java-eclipse-osgi))
7300 (home-page "https://www.eclipse.org/equinox/")
7301 (synopsis "Eclipse preferences mechanism")
7302 (description "This package provides the Eclipse preferences mechanism with
7303the module @code{org.eclipse.equinox.preferences}.")
7304 (license license:epl1.0)))
7305
7306(define-public java-eclipse-core-contenttype
7307 (package
7308 (name "java-eclipse-core-contenttype")
7309 (version "3.5.100")
7310 (source (origin
7311 (method url-fetch)
7312 (uri (string-append "https://repo1.maven.org/maven2/"
7313 "org/eclipse/platform/org.eclipse.core.contenttype/"
7314 version "/org.eclipse.core.contenttype-"
7315 version "-sources.jar"))
7316 (sha256
7317 (base32
7318 "1wcqcv7ijwv5rh748vz3x9pkmjl9w1r0k0026k56n8yjl4rrmspi"))))
7319 (build-system ant-build-system)
7320 (arguments
7321 `(#:tests? #f ; no tests included
7322 #:jar-name "eclipse-core-contenttype.jar"))
7323 (inputs
7324 (list java-eclipse-equinox-common java-eclipse-equinox-preferences
7325 java-eclipse-equinox-registry java-eclipse-osgi))
7326 (home-page "https://www.eclipse.org/")
7327 (synopsis "Eclipse content mechanism")
7328 (description "This package provides the Eclipse content mechanism in the
7329@code{org.eclipse.core.contenttype} module.")
7330 (license license:epl1.0)))
7331
7332(define-public java-eclipse-core-runtime
7333 (package
7334 (name "java-eclipse-core-runtime")
7335 (version "3.15.100")
7336 (source (origin
7337 (method url-fetch)
7338 (uri (string-append "https://repo1.maven.org/maven2/"
7339 "org/eclipse/platform/org.eclipse.core.runtime/"
7340 version "/org.eclipse.core.runtime-"
7341 version "-sources.jar"))
7342 (sha256
7343 (base32
7344 "0l8xayacsbjvz5hypx2fv47vpw2n4dspamcfb3hx30x9hj8vmg7r"))))
7345 (build-system ant-build-system)
7346 (arguments
7347 `(#:tests? #f ; no tests included
7348 #:jar-name "eclipse-core-runtime.jar"))
7349 (inputs
7350 (list java-eclipse-core-contenttype
7351 java-eclipse-core-jobs
7352 java-eclipse-equinox-app
7353 java-eclipse-equinox-common
7354 java-eclipse-equinox-registry
7355 java-eclipse-equinox-preferences
7356 java-eclipse-osgi))
7357 (home-page "https://www.eclipse.org/")
7358 (synopsis "Eclipse core runtime")
7359 (description "This package provides the Eclipse core runtime with the
7360module @code{org.eclipse.core.runtime}.")
7361 (license license:epl1.0)))
7362
7363(define-public java-eclipse-core-filesystem
7364 (package
7365 (name "java-eclipse-core-filesystem")
7366 (version "1.6.1")
7367 (source (origin
7368 (method url-fetch)
7369 (uri (string-append "https://repo1.maven.org/maven2/"
7370 "org/eclipse/platform/org.eclipse.core.filesystem/"
7371 version "/org.eclipse.core.filesystem-"
7372 version "-sources.jar"))
7373 (sha256
7374 (base32
7375 "0km1bhwjim4rfy3pkvjhvy31kgsyf2ncx0mlkmbf5n6g57pphdyj"))))
7376 (build-system ant-build-system)
7377 (arguments
7378 `(#:tests? #f ; no tests included
7379 #:jar-name "eclipse-core-filesystem.jar"))
7380 (inputs
7381 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7382 java-eclipse-osgi))
7383 (home-page "https://www.eclipse.org/")
7384 (synopsis "Eclipse core file system")
7385 (description "This package provides the Eclipse core file system with the
7386module @code{org.eclipse.core.filesystem}.")
7387 (license license:epl1.0)))
7388
7389(define-public java-eclipse-core-expressions
7390 (package
7391 (name "java-eclipse-core-expressions")
7392 (version "3.5.100")
7393 (source (origin
7394 (method url-fetch)
7395 (uri (string-append "https://repo1.maven.org/maven2/"
7396 "org/eclipse/platform/org.eclipse.core.expressions/"
7397 version "/org.eclipse.core.expressions-"
7398 version "-sources.jar"))
7399 (sha256
7400 (base32
7401 "18bw2l875gmygvpagpgk9l24qzbdjia4ag12nw6fi8v8yaq4987f"))))
7402 (build-system ant-build-system)
7403 (arguments
7404 `(#:tests? #f ; no tests included
7405 #:jar-name "eclipse-core-expressions.jar"))
7406 (inputs
7407 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7408 java-eclipse-equinox-preferences java-eclipse-core-runtime
7409 java-eclipse-osgi))
7410 (home-page "https://www.eclipse.org/")
7411 (synopsis "Eclipse core expression language")
7412 (description "This package provides the Eclipse core expression language
7413with the @code{org.eclipse.core.expressions} module.")
7414 (license license:epl1.0)))
7415
7416(define-public java-eclipse-core-variables
7417 (package
7418 (name "java-eclipse-core-variables")
7419 (version "3.3.0")
7420 (source (origin
7421 (method url-fetch)
7422 (uri (string-append "https://repo1.maven.org/maven2/"
7423 "org/eclipse/platform/org.eclipse.core.variables/"
7424 version "/org.eclipse.core.variables-"
7425 version "-sources.jar"))
7426 (sha256
7427 (base32
7428 "12dirh03zi4n5x5cj07vzrhkmnqy6h9q10h9j605pagmpmifyxmy"))))
7429 (build-system ant-build-system)
7430 (arguments
7431 `(#:tests? #f ; no tests included
7432 #:jar-name "eclipse-core-variables.jar"))
7433 (inputs
7434 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7435 java-eclipse-equinox-preferences java-eclipse-core-runtime
7436 java-eclipse-osgi))
7437 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
7438 (synopsis "Eclipse core variables")
7439 (description "This package provides the Eclipse core variables module
7440@code{org.eclipse.core.variables}.")
7441 (license license:epl1.0)))
7442
7443(define-public java-eclipse-ant-core
7444 (package
7445 (name "java-eclipse-ant-core")
7446 (version "3.4.100")
7447 (source (origin
7448 (method url-fetch)
7449 (uri (string-append "https://repo1.maven.org/maven2/"
7450 "org/eclipse/platform/org.eclipse.ant.core/"
7451 version "/org.eclipse.ant.core-"
7452 version "-sources.jar"))
7453 (sha256
7454 (base32
7455 "11g3if794qjlk98mz9zch22rr56sd7z63vn4i7k2icr8cq5bfqg7"))))
7456 (build-system ant-build-system)
7457 (arguments
7458 `(#:tests? #f ; no tests included
7459 #:jar-name "eclipse-ant-core.jar"))
7460 (inputs
7461 (list java-eclipse-equinox-app
7462 java-eclipse-equinox-common
7463 java-eclipse-equinox-registry
7464 java-eclipse-equinox-preferences
7465 java-eclipse-core-contenttype
7466 java-eclipse-core-runtime
7467 java-eclipse-core-variables
7468 java-eclipse-osgi))
7469 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
7470 (synopsis "Ant build tool core libraries")
7471 (description "This package provides the ant build tool core libraries with
7472the module @code{org.eclipse.ant.core}.")
7473 (license license:epl1.0)))
7474
7475(define-public java-eclipse-core-resources
7476 (package
7477 (name "java-eclipse-core-resources")
7478 (version "3.13.200")
7479 (source (origin
7480 (method url-fetch)
7481 (uri (string-append "https://repo1.maven.org/maven2/"
7482 "org/eclipse/platform/org.eclipse.core.resources/"
7483 version "/org.eclipse.core.resources-"
7484 version "-sources.jar"))
7485 (sha256
7486 (base32
7487 "1sn3b6ky72hkvxcgf9b2jkpbdh3y8lbhi9xxwv1dsiddpkkq91hs"))))
7488 (build-system ant-build-system)
7489 (arguments
7490 `(#:tests? #f ; no tests included
7491 #:jar-name "eclipse-core-resources.jar"))
7492 (inputs
7493 (list java-eclipse-equinox-common
7494 java-eclipse-equinox-preferences
7495 java-eclipse-equinox-registry
7496 java-eclipse-core-contenttype
7497 java-eclipse-core-expressions
7498 java-eclipse-core-filesystem
7499 java-eclipse-core-jobs
7500 java-eclipse-core-runtime
7501 java-eclipse-ant-core
7502 java-eclipse-osgi))
7503 (home-page "https://www.eclipse.org/")
7504 (synopsis "Eclipse core resource management")
7505 (description "This package provides the Eclipse core resource management
7506module @code{org.eclipse.core.resources}.")
7507 (license license:epl1.0)))
7508
7509(define-public java-eclipse-compare-core
7510 (package
7511 (name "java-eclipse-compare-core")
7512 (version "3.6.0")
7513 (source (origin
7514 (method url-fetch)
7515 (uri (string-append "https://repo1.maven.org/maven2/"
7516 "org/eclipse/platform/org.eclipse.compare.core/"
7517 version "/org.eclipse.compare.core-"
7518 version "-sources.jar"))
7519 (sha256
7520 (base32
7521 "10g37r0pbiffyv2wk35c6g5lwzkdipkl0kkjp41v84dln46xm4dg"))))
7522 (build-system ant-build-system)
7523 (arguments
7524 `(#:tests? #f ; no tests included
7525 #:jar-name "eclipse-compare-core.jar"))
7526 (inputs
7527 (list java-eclipse-core-runtime java-eclipse-equinox-common
7528 java-eclipse-osgi java-icu4j))
7529 (home-page "https://www.eclipse.org/")
7530 (synopsis "Eclipse core compare support")
7531 (description "This package provides the Eclipse core compare support
7532module @code{org.eclipse.compare.core}.")
7533 (license license:epl1.0)))
7534
7535(define-public java-eclipse-team-core
7536 (package
7537 (name "java-eclipse-team-core")
7538 (version "3.8.0")
7539 (source (origin
7540 (method url-fetch)
7541 (uri (string-append "https://repo1.maven.org/maven2/"
7542 "org/eclipse/platform/org.eclipse.team.core/"
7543 version "/org.eclipse.team.core-"
7544 version "-sources.jar"))
7545 (sha256
7546 (base32
7547 "02j2jzqgb26zx2d5ahxmvijw6j4r0la90zl5c3i65x6z19ciyam7"))))
7548 (build-system ant-build-system)
7549 (arguments
7550 `(#:tests? #f ; no tests included
7551 #:jar-name "eclipse-team-core.jar"))
7552 (inputs
7553 (list java-eclipse-compare-core
7554 java-eclipse-core-contenttype
7555 java-eclipse-core-filesystem
7556 java-eclipse-core-jobs
7557 java-eclipse-core-resources
7558 java-eclipse-core-runtime
7559 java-eclipse-equinox-common
7560 java-eclipse-equinox-registry
7561 java-eclipse-equinox-preferences
7562 java-eclipse-osgi))
7563 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
7564 (synopsis "Eclipse team support core")
7565 (description "This package provides the Eclipse team support core module
7566@code{org.eclipse.team.core}.")
7567 (license license:epl1.0)))
7568
7569(define-public java-eclipse-core-commands
7570 (package
7571 (name "java-eclipse-core-commands")
7572 (version "3.8.1")
7573 (source (origin
7574 (method url-fetch)
7575 (uri (string-append "https://repo1.maven.org/maven2/"
7576 "org/eclipse/platform/org.eclipse.core.commands/"
7577 version "/org.eclipse.core.commands-"
7578 version "-sources.jar"))
7579 (sha256
7580 (base32
7581 "0yjn482qndcfrsq3jd6vnhcylp16420f5aqkrwr8spsprjigjcr9"))))
7582 (build-system ant-build-system)
7583 (arguments
7584 `(#:tests? #f ; no tests included
7585 #:jar-name "eclipse-core-commands.jar"))
7586 (inputs
7587 (list java-eclipse-equinox-common))
7588 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
7589 (synopsis "Eclipse core commands")
7590 (description "This package provides Eclipse core commands in the module
7591@code{org.eclipse.core.commands}.")
7592 (license license:epl1.0)))
7593
7594(define-public java-eclipse-text
7595 (package
7596 (name "java-eclipse-text")
7597 (version "3.6.0")
7598 (source (origin
7599 (method url-fetch)
7600 (uri (string-append "https://repo1.maven.org/maven2/"
7601 "org/eclipse/platform/org.eclipse.text/"
7602 version "/org.eclipse.text-"
7603 version "-sources.jar"))
7604 (sha256
7605 (base32
7606 "0scz70vzz5qs5caji9f5q01vkqnvip7dpri1q07l8wbbdcxn4cq1"))))
7607 (build-system ant-build-system)
7608 (arguments
7609 `(#:tests? #f ; no tests included
7610 #:jar-name "eclipse-text.jar"
7611 #:phases
7612 (modify-phases %standard-phases
7613 ;; When creating a new category we must make sure that the new list
7614 ;; matches List<Position>. By default it seems to be too generic
7615 ;; (ArrayList<Object>), so we specialize it to ArrayList<Position>.
7616 ;; Without this we get this error:
7617 ;;
7618 ;; [javac] .../src/org/eclipse/jface/text/AbstractDocument.java:376:
7619 ;; error: method put in interface Map<K,V> cannot be applied to given types;
7620 ;; [javac] fPositions.put(category, new ArrayList<>());
7621 ;; [javac] ^
7622 ;; [javac] required: String,List<Position>
7623 ;; [javac] found: String,ArrayList<Object>
7624 ;; [javac] reason: actual argument ArrayList<Object> cannot be converted
7625 ;; to List<Position> by method invocation conversion
7626 ;; [javac] where K,V are type-variables:
7627 ;; [javac] K extends Object declared in interface Map
7628 ;; [javac] V extends Object declared in interface Map
7629 ;;
7630 ;; I don't know if this is a good fix. I suspect it is not, but it
7631 ;; seems to work.
7632 (add-after 'unpack 'fix-compilation-error
7633 (lambda _
7634 (substitute* "src/org/eclipse/jface/text/AbstractDocument.java"
7635 (("Positions.put\\(category, new ArrayList<>\\(\\)\\);")
7636 "Positions.put(category, new ArrayList<Position>());"))
7637 #t)))))
7638 (inputs
7639 (list java-eclipse-equinox-common java-eclipse-core-commands
7640 java-icu4j))
7641 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
7642 (synopsis "Eclipse text library")
7643 (description "Platform Text is part of the Platform UI project and
7644provides the basic building blocks for text and text editors within Eclipse
7645and contributes the Eclipse default text editor.")
7646 (license license:epl1.0)))
7647
7648(define-public java-eclipse-jdt-core
7649 (package
7650 (name "java-eclipse-jdt-core")
7651 (version "3.16.0")
7652 (source (origin
7653 (method url-fetch)
7654 (uri (string-append "https://repo1.maven.org/maven2/"
7655 "org/eclipse/jdt/org.eclipse.jdt.core/"
7656 version "/org.eclipse.jdt.core-"
7657 version "-sources.jar"))
7658 (sha256
7659 (base32
7660 "1g560yr9v2kzv34gc2m3ifpgnj7krcdd6h4gd4z83pwqacwkfz0k"))))
7661 (build-system ant-build-system)
7662 (arguments
7663 `(#:tests? #f ; no tests included
7664 #:jar-name "eclipse-jdt-core.jar"
7665 #:phases
7666 (modify-phases %standard-phases
7667 (add-after 'unpack 'move-sources
7668 (lambda _
7669 (with-directory-excursion "src/jdtCompilerAdaptersrc/"
7670 (for-each (lambda (file)
7671 (install-file file (string-append "../" (dirname file))))
7672 (find-files "." ".*")))
7673 (delete-file-recursively "src/jdtCompilerAdaptersrc/")
7674 #t))
7675 (add-before 'build 'copy-resources
7676 (lambda _
7677 (with-directory-excursion "src"
7678 (for-each (lambda (file)
7679 (install-file file (string-append "../build/classes/" (dirname file))))
7680 (find-files "." ".*.(props|properties|rsc)")))
7681 #t)))))
7682 (inputs
7683 (list java-eclipse-core-contenttype
7684 java-eclipse-core-filesystem
7685 java-eclipse-core-jobs
7686 java-eclipse-core-resources
7687 java-eclipse-core-runtime
7688 java-eclipse-equinox-app
7689 java-eclipse-equinox-common
7690 java-eclipse-equinox-preferences
7691 java-eclipse-equinox-registry
7692 java-eclipse-osgi
7693 java-eclipse-text))
7694 (home-page "https://www.eclipse.org/jdt")
7695 (synopsis "Java development tools core libraries")
7696 (description "This package provides the core libraries of the Eclipse Java
7697development tools.")
7698 (license license:epl1.0)))
7699
7700(define-public java-eclipse-jdt-compiler-apt
7701 (package
7702 (name "java-eclipse-jdt-compiler-apt")
7703 (version "1.3.400")
7704 (source (origin
7705 (method url-fetch)
7706 (uri (string-append "https://repo1.maven.org/maven2/"
7707 "org/eclipse/jdt/org.eclipse.jdt.compiler.apt/"
7708 version "/org.eclipse.jdt.compiler.apt-"
7709 version "-sources.jar"))
7710 (sha256
7711 (base32
7712 "1s285k9p2ixdqrknb40jbbvw682n9a7l5lqpn583a8pvlzg2l6r8"))))
7713 (build-system ant-build-system)
7714 (arguments
7715 `(#:tests? #f ; no tests included
7716 #:jar-name "eclipse-jdt-compiler-apt.jar"
7717 #:jdk ,openjdk11))
7718 (inputs
7719 (list java-eclipse-jdt-core))
7720 (home-page "https://www.eclipse.org/jdt/apt/")
7721 (synopsis "Annotation processing tool")
7722 (description "APT stands for Annotation Processing Tool. APT provides a
7723means for generating files and compiling new Java classes based on annotations
7724found in your source code.")
7725 (license license:epl2.0)))
7726
7727(define-public java-eclipse-lsp4j-common
7728 (package
7729 (name "java-eclipse-lsp4j-common")
7730 (version "0.10.0")
7731 (source (origin
7732 (method git-fetch)
7733 (uri (git-reference
7734 (url "https://github.com/eclipse/lsp4j")
7735 (commit (string-append "v" version))))
7736 (file-name (git-file-name name version))
7737 (sha256
7738 (base32
7739 "17srrac0pkpybwwc21rzdvn762zzl9m80rlqihc9b4l55hkqpk98"))))
7740 (build-system ant-build-system)
7741 (home-page "https://eclipse.org/lsp4j/")
7742 (synopsis "LSP4J common package")
7743 (description "Eclipse LSP4J provides Java bindings for the Language
7744Server Protocol and the Debug Adapter Protocol. This package is a common
7745definition intended to be inherited by other packages.")
7746 (license license:epl2.0)))
7747
7748(define-public java-eclipse-lsp4j-debug
7749 (package
7750 (inherit java-eclipse-lsp4j-common)
7751 (name "java-eclipse-lsp4j-debug")
7752 (arguments
7753 `(#:jar-name "eclipse-lsp4j-debug.jar"
7754 #:jdk ,openjdk11
7755 #:tests? #f; tests fail with reflection errors
7756 #:source-dir "org.eclipse.lsp4j.debug/src/main/java"
7757 #:test-dir "org.eclipse.lsp4j.debug/src/test"
7758 #:phases
7759 (modify-phases %standard-phases
7760 (add-before 'build 'copy-xtend
7761 (lambda _
7762 (copy-recursively "org.eclipse.lsp4j.debug/src/main/xtend-gen"
7763 "org.eclipse.lsp4j.debug/src/main/java"))))))
7764 (native-inputs
7765 (list java-junit))
7766 (inputs
7767 `(("java-gson" ,java-gson-2.8.6)
7768 ("java-eclipse-lsp4j-generaor" ,java-eclipse-lsp4j-generator)
7769 ("java-eclipse-lsp4j-jsonrpc" ,java-eclipse-lsp4j-jsonrpc)
7770 ("java-eclipse-lsp4j-jsonrpc-debug" ,java-eclipse-lsp4j-jsonrpc-debug)
7771 ("java-eclipse-xtext-xbase-lib" ,java-eclipse-xtext-xbase-lib)))
7772 (synopsis "Eclipse LSP4J Java bindings for the Debug Server Protocol")
7773 (description "Eclipse LSP4J provides Java bindings for the Language
7774Server Protocol and the Debug Adapter Protocol. This package contains its
7775LSP4J Java bindings for the Debug Server Protocol.")))
7776
7777(define-public java-eclipse-lsp4j-generator
7778 (package
7779 (inherit java-eclipse-lsp4j-common)
7780 (name "java-eclipse-lsp4j-generator")
7781 (arguments
7782 `(#:jar-name "eclipse-lsp4j-generator.jar"
7783 #:jdk ,openjdk11
7784 #:tests? #f; no tests
7785 #:source-dir "org.eclipse.lsp4j.generator/src/main/java"))
7786 (inputs
7787 (list java-eclipse-lsp4j-jsonrpc))
7788 (synopsis "Eclipse LSP4J Generator")
7789 (description "Eclipse LSP4J provides Java bindings for the Language
7790Server Protocol and the Debug Adapter Protocol. This package contains its
7791LSP4J code generator for Language Server Protocol classes.")))
7792
7793(define-public java-eclipse-lsp4j-jsonrpc
7794 (package
7795 (inherit java-eclipse-lsp4j-common)
7796 (name "java-eclipse-lsp4j-jsonrpc")
7797 (arguments
7798 `(#:jar-name "eclipse-lsp4j-jsonrpc.jar"
7799 #:jdk ,openjdk11
7800 #:source-dir "org.eclipse.lsp4j.jsonrpc/src/main/java"
7801 #:test-dir "org.eclipse.lsp4j.jsonrpc/src/test"))
7802 (native-inputs
7803 (list java-junit))
7804 (inputs
7805 (list java-gson-2.8.6))
7806 (synopsis "Java JSON-RPC implementation")
7807 (description "Eclipse LSP4J provides Java bindings for the Language
7808Server Protocol and the Debug Adapter Protocol. This package contains its
7809JSON-RPC implementation.")))
7810
7811(define-public java-eclipse-lsp4j-jsonrpc-debug
7812 (package
7813 (inherit java-eclipse-lsp4j-common)
7814 (name "java-eclipse-lsp4j-jsonrpc-debug")
7815 (arguments
7816 `(#:jar-name "eclipse-lsp4j-jsonrpc-debug.jar"
7817 #:jdk ,openjdk11
7818 #:source-dir "org.eclipse.lsp4j.jsonrpc.debug/src/main/java"
7819 #:test-dir "org.eclipse.lsp4j.jsonrpc.debug/src/test"))
7820 (native-inputs
7821 (list java-junit))
7822 (inputs
7823 (list java-eclipse-lsp4j-jsonrpc java-gson-2.8.6))
7824 (synopsis "Java JSON-RPC implementation (debug protocol)")
7825 (description "Eclipse LSP4J provides Java bindings for the Language
7826Server Protocol and the Debug Adapter Protocol. This package contains its
7827JSON-RPC implementation's debug protocol.")))
7828
7829(define-public java-eclipse-xtext-xbase-lib
7830 (package
7831 (name "java-eclipse-xtext-xbase-lib")
7832 (version "2.25.0")
7833 (source (origin
7834 (method git-fetch)
7835 (uri (git-reference
7836 (url "https://github.com/eclipse/xtext-lib")
7837 (commit (string-append "v" version))))
7838 (file-name (git-file-name name version))
7839 (sha256
7840 (base32
7841 "13b9lf6lnsprkik665m1qcyyc8cs16k33xm7as4rjcfcpn4pln71"))))
7842 (build-system ant-build-system)
7843 (arguments
7844 `(#:jar-name "eclipse-xtext-xbase-lib.jar"
7845 #:jdk ,openjdk11
7846 #:tests? #f; TODO (maybe needs newer guava version?)
7847 #:source-dir "org.eclipse.xtext.xbase.lib/src"
7848 #:test-dir "org.eclipse.xtext.xbase.lib.tests/src"))
7849 (native-inputs
7850 (list java-junit))
7851 (inputs
7852 (list java-guava))
7853 (home-page "https://www.eclipse.org/Xtext/")
7854 (synopsis "Eclipse Xbase Runtime Library")
7855 (description "This package contains runtime libraries for Xbase languages
7856such as Xtend.")
7857 (license license:epl2.0)))
7858
7859(define-public java-javax-mail
7860 (package
7861 (name "java-javax-mail")
7862 (version "1.5.6")
7863 (source (origin
7864 (method url-fetch)
7865 (uri (string-append "https://repo1.maven.org/maven2/"
7866 "com/sun/mail/javax.mail/"
7867 version "/javax.mail-"
7868 version "-sources.jar"))
7869 (sha256
7870 (base32
7871 "0sdlfgsc2b5s89xv1261y8i0jijcja019k2x1c8ngfn582w4jly9"))))
7872 (build-system ant-build-system)
7873 (arguments
7874 `(#:tests? #f ; no tests
7875 #:jar-name "javax-mail.jar"))
7876 (home-page "https://javamail.java.net")
7877 (synopsis "Reference implementation of the JavaMail API")
7878 (description
7879 "This package provides versions of the JavaMail API implementation, IMAP,
7880SMTP, and POP3 service providers, some examples, and documentation for the
7881JavaMail API.")
7882 ;; GPLv2 only with "classpath exception".
7883 (license license:gpl2)))
7884
7885(define-public java-log4j-api
7886 (package
7887 (name "java-log4j-api")
7888 (version "2.17.1")
7889 (source (origin
7890 (method url-fetch)
7891 (uri (string-append "mirror://apache/logging/log4j/" version
7892 "/apache-log4j-" version "-src.tar.gz"))
7893 (sha256
7894 (base32
7895 "05xssljdgxfv8ql42db8ydjfsvvbdqmsgip75phybm259ydzbsd6"))))
7896 (build-system ant-build-system)
7897 (arguments
7898 `(#:tests? #f ; tests require unpackaged software
7899 #:jar-name "log4j-api.jar"
7900 #:make-flags
7901 ,#~(list (string-append "-Ddist.dir=" #$output "/share/java"))
7902 #:phases
7903 (modify-phases %standard-phases
7904 (add-after 'unpack 'enter-dir
7905 (lambda _ (chdir "log4j-api") #t))
7906 ;; FIXME: The tests require additional software that has not been
7907 ;; packaged yet, such as
7908 ;; * org.apache.maven
7909 ;; * org.apache.felix
7910 (add-after 'enter-dir 'delete-tests
7911 (lambda _ (delete-file-recursively "src/test") #t)))))
7912 (inputs
7913 (list java-osgi-core java-hamcrest-core java-junit))
7914 (properties '((cpe-name . "log4j")))
7915 (home-page "https://logging.apache.org/log4j/2.x/")
7916 (synopsis "API module of the Log4j logging framework for Java")
7917 (description
7918 "This package provides the API module of the Log4j logging framework for
7919Java.")
7920 (license license:asl2.0)))
7921
7922(define-public java-log4j-core
7923 (package
7924 (inherit java-log4j-api)
7925 (name "java-log4j-core")
7926 (inputs
7927 `(("java-osgi-core" ,java-osgi-core)
7928 ("java-hamcrest-core" ,java-hamcrest-core)
7929 ("java-log4j-api" ,java-log4j-api)
7930 ("java-mail" ,java-mail)
7931 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
7932 ("java-conversant-disruptor" ,java-conversant-disruptor)
7933 ("java-lmax-disruptor" ,java-lmax-disruptor)
7934 ("java-jctools-core" ,java-jctools-core-1)
7935 ("java-stax2-api" ,java-stax2-api)
7936 ("java-jansi" ,java-jansi)
7937 ("java-kafka" ,java-kafka-clients)
7938 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
7939 ("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
7940 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
7941 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
7942 ("java-fasterxml-jackson-dataformat-xml" ,java-fasterxml-jackson-dataformat-xml)
7943 ("java-fasterxml-jackson-dataformat-yaml" ,java-fasterxml-jackson-dataformat-yaml)
7944 ("java-commons-compress" ,java-commons-compress)
7945 ("java-commons-csv" ,java-commons-csv)
7946 ("java-jeromq" ,java-jeromq)
7947 ("java-junit" ,java-junit)))
7948 (native-inputs
7949 `(("hamcrest" ,java-hamcrest-all)
7950 ("java-commons-io" ,java-commons-io)
7951 ("java-commons-lang3" ,java-commons-lang3)
7952 ("slf4j" ,java-slf4j-api)))
7953 (arguments
7954 `(#:tests? #f ; tests require more dependencies
7955 #:test-dir "src/test"
7956 #:source-dir "src/main/java"
7957 #:jar-name "log4j-core.jar"
7958 #:jdk ,icedtea-8
7959 #:make-flags
7960 ,#~(list (string-append "-Ddist.dir=" #$output "/share/java"))
7961 #:phases
7962 (modify-phases %standard-phases
7963 (add-after 'unpack 'enter-dir
7964 (lambda _ (chdir "log4j-core") #t)))))
7965 (synopsis "Core component of the Log4j framework")
7966 (description "This package provides the core component of the Log4j
7967logging framework for Java.")))
7968
7969(define-public java-log4j-1.2-api
7970 (package
7971 (inherit java-log4j-api)
7972 (name "java-log4j-1.2-api")
7973 (arguments
7974 `(#:jar-name "java-log4j-1.2-api.jar"
7975 #:source-dir "log4j-1.2-api/src/main/java"
7976 #:jdk ,icedtea-8
7977 ;; Tests require maven-model (and other maven subprojects), which is a
7978 ;; cyclic dependency.
7979 #:tests? #f))
7980 (inputs
7981 `(("log4j-api" ,java-log4j-api)
7982 ("log4j-core" ,java-log4j-core)
7983 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
7984 ("osgi-core" ,java-osgi-core)
7985 ("eclipse-osgi" ,java-eclipse-osgi)
7986 ("java-lmax-disruptor" ,java-lmax-disruptor)))))
7987
7988(define-public java-commons-cli
7989 (package
7990 (name "java-commons-cli")
7991 (version "1.4")
7992 (source (origin
7993 (method url-fetch)
7994 (uri (string-append "mirror://apache/commons/cli/source/"
7995 "commons-cli-" version "-src.tar.gz"))
7996 (sha256
7997 (base32
7998 "05hgi2z01fqz374y719gl1dxzqvzci5af071zm7vxrjg9vczipm1"))))
7999 (build-system ant-build-system)
8000 ;; TODO: javadoc
8001 (arguments
8002 `(#:jar-name "commons-cli.jar"
8003 #:phases
8004 (modify-phases %standard-phases
8005 (replace 'install
8006 (install-from-pom "pom.xml")))))
8007 (native-inputs
8008 (list java-junit java-hamcrest-core))
8009 (home-page "https://commons.apache.org/cli/")
8010 (synopsis "Command line arguments and options parsing library")
8011 (description "The Apache Commons CLI library provides an API for parsing
8012command line options passed to programs. It is also able to print help
8013messages detailing the options available for a command line tool.
8014
8015Commons CLI supports different types of options:
8016
8017@itemize
8018@item POSIX like options (ie. tar -zxvf foo.tar.gz)
8019@item GNU like long options (ie. du --human-readable --max-depth=1)
8020@item Java like properties (ie. java -Djava.awt.headless=true Foo)
8021@item Short options with value attached (ie. gcc -O2 foo.c)
8022@item long options with single hyphen (ie. ant -projecthelp)
8023@end itemize
8024
8025This is a part of the Apache Commons Project.")
8026 (license license:asl2.0)))
8027
8028(define-public java-commons-text
8029 (package
8030 (name "java-commons-text")
8031 (version "1.15.0")
8032 (source (origin
8033 (method url-fetch)
8034 (uri (string-append "mirror://apache/commons/text/source/"
8035 "commons-text-" version "-src.tar.gz"))
8036 (sha256
8037 (base32
8038 "0k0y3pkgrzm84a0z1ifi4b9ydaglzm9pgvaw9phxdcwmcqxjbkc8"))))
8039 (build-system ant-build-system)
8040 (arguments
8041 (list #:jar-name "java-commons-text.jar"
8042 #:source-dir "src/main/java"
8043 #:test-dir "src/test"
8044 #:tests? #f ; Tests require JUnit5.
8045 #:phases
8046 #~(modify-phases %standard-phases
8047 (replace 'install
8048 (install-from-pom "pom.xml")))))
8049 (inputs
8050 (list java-commons-io))
8051 (propagated-inputs
8052 (list java-commons-lang3
8053 apache-commons-parent-pom-51))
8054 (home-page "https://commons.apache.org/text/")
8055 (synopsis "Library focused on algorithms working on strings")
8056 (description "Apache Commons Text is a library focused on algorithms
8057working on strings.
8058
8059This is a part of the Apache Commons Project.")
8060 (license license:asl2.0)))
8061
8062(define-public java-commons-codec
8063 (package
8064 (name "java-commons-codec")
8065 (version "1.15")
8066 (source (origin
8067 (method url-fetch)
8068 (uri (string-append "mirror://apache/commons/codec/source/"
8069 "commons-codec-" version "-src.tar.gz"))
8070 (sha256
8071 (base32
8072 "01z9qmg8fd8d7p7xxipwj1vi9bmvpgqyi29kldjz2x6vzwm171jj"))))
8073 (build-system ant-build-system)
8074 (arguments
8075 `(#:jar-name "java-commons-codec.jar"
8076 #:source-dir "src/main/java"
8077 #:test-dir "src/test"
8078 #:test-exclude (list "**/*AbstractTest.java")
8079 #:phases
8080 (modify-phases %standard-phases
8081 (add-before 'build 'copy-resources
8082 (lambda _
8083 (copy-recursively "src/main/resources"
8084 "build/classes")))
8085 (add-before 'check 'copy-test-resources
8086 (lambda _
8087 (copy-recursively "src/test/resources"
8088 "build/test-classes")))
8089 (add-before 'check 'skip-ravenous-test
8090 (lambda _
8091 ;; This test admits to being "memory hungry", but reliably fails
8092 ;; even on a machine that should have plenty (12 GiB). Skip it.
8093 (substitute*
8094 "src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java"
8095 (("\\bassertEnsureBufferSizeExpandsToMaxBufferSize.*;")
8096 "return;"))))
8097 (replace 'install (install-from-pom "pom.xml")))))
8098 (native-inputs
8099 (list java-commons-lang3 java-junit))
8100 (propagated-inputs
8101 (list apache-commons-parent-pom-52))
8102 (home-page "https://commons.apache.org/codec/")
8103 (synopsis "Common encoders and decoders such as Base64, Hex, Phonetic and URLs")
8104 (description "The codec package contains simple encoder and decoders for
8105various formats such as Base64 and Hexadecimal. In addition to these widely
8106used encoders and decoders, the codec package also maintains a collection of
8107phonetic encoding utilities.
8108
8109This is a part of the Apache Commons Project.")
8110 (license license:asl2.0)))
8111
8112(define-public java-commons-daemon
8113 (package
8114 (name "java-commons-daemon")
8115 (version "1.1.0")
8116 (source (origin
8117 (method url-fetch)
8118 (uri (string-append "mirror://apache/commons/daemon/source/"
8119 "commons-daemon-" version "-src.tar.gz"))
8120 (sha256
8121 (base32
8122 "141gkhfzv5v3pdhic6y4ardq2dhsa3v36j8wmmhy6f8mac48fp7n"))))
8123 (build-system ant-build-system)
8124 (arguments
8125 `(#:test-target "test"
8126 #:phases
8127 (modify-phases %standard-phases
8128 (add-after 'build 'build-javadoc ant-build-javadoc)
8129 (replace 'install (install-jars "dist"))
8130 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
8131 (native-inputs
8132 (list java-junit))
8133 (home-page "https://commons.apache.org/daemon/")
8134 (synopsis "Library to launch Java applications as daemons")
8135 (description "The Daemon package from Apache Commons can be used to
8136implement Java applications which can be launched as daemons. For example the
8137program will be notified about a shutdown so that it can perform cleanup tasks
8138before its process of execution is destroyed by the operation system.
8139
8140This package contains the Java library. You will also need the actual binary
8141for your architecture which is provided by the jsvc package.
8142
8143This is a part of the Apache Commons Project.")
8144 (license license:asl2.0)))
8145
8146(define-public java-javaewah
8147 (package
8148 (name "java-javaewah")
8149 (version "1.1.6")
8150 (source (origin
8151 (method git-fetch)
8152 (uri (git-reference
8153 (url "https://github.com/lemire/javaewah/")
8154 (commit (string-append "JavaEWAH-" version))))
8155 (file-name (git-file-name name version))
8156 (sha256
8157 (base32
8158 "1m8qcb1py76v7avbjjrkvyy6fhr5dk2ywy73gbsxqry04gkm2nhw"))))
8159 (build-system ant-build-system)
8160 (arguments `(#:jar-name "javaewah.jar"))
8161 (inputs
8162 (list java-junit java-hamcrest-core))
8163 (home-page "https://github.com/lemire/javaewah")
8164 (synopsis "Compressed alternative to the Java @code{BitSet} class")
8165 (description "This is a word-aligned compressed variant of the Java
8166@code{Bitset} class. It provides both a 64-bit and a 32-bit RLE-like
8167compression scheme. It can be used to implement bitmap indexes.
8168
8169The goal of word-aligned compression is not to achieve the best compression,
8170but rather to improve query processing time. Hence, JavaEWAH tries to save CPU
8171cycles, maybe at the expense of storage. However, the EWAH scheme is always
8172more efficient storage-wise than an uncompressed bitmap (as implemented in the
8173@code{BitSet} class by Sun).")
8174 ;; GPL2.0 derivates are explicitly allowed.
8175 (license license:asl2.0)))
8176
8177(define-public java-slf4j-api
8178 (package
8179 (name "java-slf4j-api")
8180 (version "1.7.25")
8181 (source (origin
8182 (method git-fetch)
8183 (uri (git-reference
8184 (url "https://github.com/qos-ch/slf4j")
8185 (commit (string-append "v_" version))))
8186 (file-name (git-file-name name version))
8187 (sha256
8188 (base32
8189 "15n42zq3k1iyn752nwdcbs44hxns2rmxhglwjfr4np7lxx56apjl"))
8190 (modules '((guix build utils)))
8191 ;; Delete bundled jars.
8192 (snippet
8193 '(begin
8194 (for-each delete-file (find-files "." "\\.jar$"))
8195 #t))))
8196 (build-system ant-build-system)
8197 (arguments
8198 `(#:jar-name "slf4j-api.jar"
8199 #:source-dir "slf4j-api/src/main"
8200 #:test-dir "slf4j-api/src/test"
8201 #:phases
8202 (modify-phases %standard-phases
8203 (add-after 'build 'regenerate-jar
8204 (lambda _
8205 ;; pom.xml ignores these files in the jar creation process. If we don't,
8206 ;; we get the error "This code should have never made it into slf4j-api.jar"
8207 (delete-file-recursively "build/classes/org/slf4j/impl")
8208 (invoke "jar" "-cf" "build/jar/slf4j-api.jar" "-C"
8209 "build/classes" ".")))
8210 (add-before 'check 'dont-test-abstract-classes
8211 (lambda _
8212 ;; abstract classes are not meant to be run with junit
8213 (substitute* "build.xml"
8214 (("<include name=\"\\*\\*/\\*Test.java\" />")
8215 (string-append "<include name=\"**/*Test.java\" />"
8216 "<exclude name=\"**/MultithreadedInitializationTest"
8217 ".java\" />")))
8218 #t))
8219 (replace 'install
8220 (install-from-pom "slf4j-api/pom.xml")))))
8221 (propagated-inputs
8222 (list java-slf4j-parent))
8223 (native-inputs
8224 (list java-junit java-hamcrest-core))
8225 (home-page "https://www.slf4j.org/")
8226 (synopsis "Simple logging facade for Java")
8227 (description "The Simple Logging Facade for Java (SLF4J) serves as a
8228simple facade or abstraction for various logging
8229frameworks (e.g. @code{java.util.logging}, @code{logback}, @code{log4j})
8230allowing the end user to plug in the desired logging framework at deployment
8231time.")
8232 (license license:expat)))
8233
8234(define java-slf4j-parent
8235 (package
8236 (inherit java-slf4j-api)
8237 (name "java-slf4j-parent")
8238 (native-inputs `())
8239 (propagated-inputs '())
8240 (arguments
8241 `(#:tests? #f
8242 #:phases
8243 (modify-phases %standard-phases
8244 (delete 'build)
8245 (delete 'configure)
8246 (replace 'install
8247 (install-pom-file "pom.xml")))))))
8248
8249(define-public java-slf4j-simple
8250 (package
8251 (name "java-slf4j-simple")
8252 (version "1.7.25")
8253 (source (package-source java-slf4j-api))
8254 (build-system ant-build-system)
8255 (arguments
8256 `(#:jar-name "slf4j-simple.jar"
8257 #:source-dir "slf4j-simple/src/main"
8258 #:test-dir "slf4j-simple/src/test"
8259 #:test-exclude (list "**/*SimpleLoggerMultithreadedInitializationTest.java")
8260 #:phases
8261 (modify-phases %standard-phases
8262 ;; The tests need some test classes from slf4j-api
8263 (add-before 'check 'build-slf4j-api-test-helpers
8264 (lambda _
8265 ;; Add current dir to CLASSPATH ...
8266 (setenv "CLASSPATH"
8267 (string-append (getcwd) ":" (getenv "CLASSPATH")))
8268 ;; ... and build test helper classes here:
8269 (apply invoke
8270 `("javac" "-d" "."
8271 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
8272 (replace 'install
8273 (install-from-pom "slf4j-simple/pom.xml")))))
8274 (propagated-inputs
8275 (list java-slf4j-api))
8276 (native-inputs
8277 (list java-junit java-hamcrest-core))
8278 (home-page "https://www.slf4j.org/")
8279 (synopsis "Simple implementation of simple logging facade for Java")
8280 (description "SLF4J binding for the Simple implementation, which outputs
8281all events to System.err. Only messages of level INFO and higher are
8282printed.")
8283 (license license:expat)))
8284
8285(define-public java-slf4j-nop
8286 (package
8287 (name "java-slf4j-nop")
8288 (version "1.7.25")
8289 (source (package-source java-slf4j-api))
8290 (build-system ant-build-system)
8291 (arguments
8292 `(#:jar-name "slf4j-nop.jar"
8293 #:source-dir "slf4j-nop/src/main"
8294 #:test-dir "slf4j-nop/src/test"
8295 #:phases (modify-phases %standard-phases
8296 ;; The tests need some test classes from slf4j-api
8297 (add-before 'check 'build-slf4j-api-test-helpers
8298 (lambda _
8299 ;; Add current dir to CLASSPATH ...
8300 (setenv "CLASSPATH"
8301 (string-append (getcwd) ":"
8302 (getenv "CLASSPATH")))
8303 ;; ... and build test helper classes here:
8304 (apply invoke
8305 `("javac" "-d" "."
8306 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
8307 (replace 'install
8308 (install-from-pom "slf4j-nop/pom.xml")))))
8309 (propagated-inputs (list java-slf4j-api))
8310 (native-inputs (list java-junit java-hamcrest-core))
8311 (home-page "https://www.slf4j.org/")
8312 (synopsis "SLF4J binding that silently discards all logging messages")
8313 (description "Binding/provider for NOP, an implementation that silently
8314discards all logging messages.")
8315 (license license:expat)))
8316
8317(define-public antlr2
8318 (package
8319 (name "antlr2")
8320 (version "2.7.7")
8321 (source (origin
8322 (method url-fetch)
8323 (uri (string-append "https://www.antlr2.org/download/antlr-"
8324 version ".tar.gz"))
8325 (sha256
8326 (base32
8327 "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5"))
8328 (modules '((guix build utils)))
8329 (snippet
8330 '(begin
8331 (delete-file "antlr.jar")
8332 (substitute* "lib/cpp/antlr/CharScanner.hpp"
8333 (("#include <map>")
8334 (string-append
8335 "#include <map>\n"
8336 "#define EOF (-1)\n"
8337 "#include <strings.h>")))
8338 (substitute* "configure"
8339 (("/bin/sh") "sh"))
8340 #t))))
8341 (build-system gnu-build-system)
8342 (arguments
8343 `(#:tests? #f ; no test target
8344 #:imported-modules ((guix build ant-build-system)
8345 ,@%default-gnu-imported-modules)
8346 #:modules (((guix build ant-build-system) #:prefix ant:)
8347 (guix build gnu-build-system)
8348 (guix build utils))
8349 #:phases
8350 (modify-phases %standard-phases
8351 (add-after 'install 'strip-jar-timestamps
8352 (assoc-ref ant:%standard-phases 'strip-jar-timestamps))
8353 (add-before 'configure 'fix-timestamp
8354 (lambda _
8355 (substitute* "configure"
8356 (("^TIMESTAMP.*") "TIMESTAMP=19700101\n"))
8357 #t))
8358 (add-after 'configure 'fix-bin-ls
8359 (lambda _
8360 (substitute* (find-files "." "Makefile")
8361 (("/bin/ls") "ls"))
8362 #t)))))
8363 (native-inputs
8364 `(("which" ,which)
8365 ("zip" ,zip)
8366 ("java" ,icedtea "jdk")))
8367 (inputs
8368 `(("java" ,icedtea)))
8369 (home-page "https://www.antlr2.org")
8370 (synopsis "Framework for constructing recognizers, compilers, and translators")
8371 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
8372is a language tool that provides a framework for constructing recognizers,
8373compilers, and translators from grammatical descriptions containing Java, C#,
8374C++, or Python actions. ANTLR provides excellent support for tree construction,
8375tree walking, and translation.")
8376 (license license:public-domain)))
8377
8378(define-public java-stringtemplate-3
8379 (package
8380 (name "java-stringtemplate")
8381 (version "3.2.1")
8382 (source (origin
8383 (method url-fetch)
8384 (uri (string-append "https://github.com/antlr/website-st4/raw/"
8385 "gh-pages/download/stringtemplate-"
8386 version ".tar.gz"))
8387 (sha256
8388 (base32
8389 "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is"))))
8390 (build-system ant-build-system)
8391 (arguments
8392 `(#:jar-name (string-append ,name "-" ,version ".jar")
8393 #:test-dir "test"
8394 #:modules ((guix build ant-build-system)
8395 (guix build utils)
8396 (srfi srfi-1))
8397 #:phases
8398 (modify-phases %standard-phases
8399 (add-before 'check 'fix-tests
8400 (lambda _
8401 (substitute* "build.xml"
8402 (("\\$\\{test.home\\}/java")
8403 "${test.home}/org"))
8404 #t))
8405 (add-before 'build 'generate-grammar
8406 (lambda _
8407 (with-directory-excursion "src/org/antlr/stringtemplate/language/"
8408 (for-each (lambda (file)
8409 (format #t "~a\n" file)
8410 (invoke "antlr" file))
8411 '("template.g" "angle.bracket.template.g" "action.g"
8412 "eval.g" "group.g" "interface.g")))
8413 #t)))))
8414 (native-inputs
8415 `(("antlr" ,antlr2)
8416 ("java-junit" ,java-junit)))
8417 (home-page "https://www.stringtemplate.org")
8418 (synopsis "Template engine to generate formatted text output")
8419 (description "StringTemplate is a java template engine (with ports for C#,
8420Objective-C, JavaScript, Scala) for generating source code, web pages, emails,
8421or any other formatted text output. StringTemplate is particularly good at
8422code generators, multiple site skins, and internationalization / localization.
8423StringTemplate also powers ANTLR.")
8424 (license license:bsd-3)))
8425
8426;; antlr3 is partially written using antlr3 grammar files. It also depends on
8427;; ST4 (stringtemplate4), which is also partially written using antlr3 grammar
8428;; files and uses antlr3 at runtime. The latest version requires a recent version
8429;; of antlr3 at runtime.
8430;; Fortunately, ST4 4.0.6 can be built with an older antlr3, and we use antlr3.3.
8431;; This version of ST4 is sufficient for the latest antlr3.
8432;; We use ST4 4.0.6 to build a boostrap antlr3 (latest version), and build
8433;; the latest ST4 with it. Then we build our final antlr3 that will be linked
8434;; against the latest ST4.
8435;; antlr3.3 still depends on antlr3 to generate some files, so we use an
8436;; even older version, antlr3.1, to generate them. Fortunately antlr3.1 uses
8437;; only grammar files with the antlr2 syntax.
8438;; So we build antlr3.1 -> antlr3.3 -> ST4.0.6 -> antlr3-bootstrap -> ST4 -> antlr3.
8439
8440(define-public java-stringtemplate
8441 (package (inherit java-stringtemplate-3)
8442 (name "java-stringtemplate")
8443 (version "4.0.8")
8444 (source (origin
8445 (method url-fetch)
8446 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/"
8447 version ".tar.gz"))
8448 (file-name (string-append name "-" version ".tar.gz"))
8449 (sha256
8450 (base32
8451 "1pri8hqa95rfdkjy55icl5q1m09zwp5k67ib14abas39s4v3w087"))))
8452 (build-system ant-build-system)
8453 (arguments
8454 `(#:jar-name (string-append ,name "-" ,version ".jar")
8455 #:tests? #f ; FIXME: tests fail for unknown reasons
8456 #:test-dir "test"
8457 #:modules ((guix build ant-build-system)
8458 (guix build utils)
8459 (srfi srfi-1))
8460 #:phases
8461 (modify-phases %standard-phases
8462 (add-before 'check 'fix-test-target
8463 (lambda _
8464 (substitute* "build.xml"
8465 (("\\$\\{test.home\\}/java") "${test.home}/")
8466 (("\\*Test.java") "Test*.java"))
8467 #t))
8468 (add-before 'build 'generate-grammar
8469 (lambda _
8470 (with-directory-excursion "src/org/stringtemplate/v4/compiler/"
8471 (for-each (lambda (file)
8472 (format #t "~a\n" file)
8473 (invoke "antlr3" file))
8474 '("STParser.g" "Group.g" "CodeGenerator.g")))
8475 #t)))))
8476 (inputs
8477 `(("antlr3" ,antlr3-bootstrap)
8478 ("antlr2" ,antlr2)
8479 ("java-stringtemplate" ,java-stringtemplate-3)
8480 ("java-junit" ,java-junit)))))
8481
8482(define java-stringtemplate-4.0.6
8483 (package (inherit java-stringtemplate)
8484 (name "java-stringtemplate")
8485 (version "4.0.6")
8486 (source (origin
8487 (method url-fetch)
8488 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/ST-"
8489 version ".tar.gz"))
8490 (file-name (string-append name "-" version ".tar.gz"))
8491 (sha256
8492 (base32
8493 "0hjmh1ahdsh3w825i67mli9l4nncc4l6hdbf9ma91jvlj590sljp"))))
8494 (inputs
8495 `(("antlr3" ,antlr3-3.3)
8496 ("antlr2" ,antlr2)
8497 ("java-stringtemplate" ,java-stringtemplate-3)))))
8498
8499(define-public antlr3
8500 (package
8501 (name "antlr3")
8502 (version "3.5.2")
8503 (source (origin
8504 (method git-fetch)
8505 (uri (git-reference
8506 (url "https://github.com/antlr/antlr3")
8507 (commit version)))
8508 (file-name (git-file-name name version))
8509 (sha256
8510 (base32
8511 "0cafavrjmzqhklghrk8c2jqxkdwxgzskm20pbrfd3r41cn00dpnf"))))
8512 (build-system ant-build-system)
8513 (arguments
8514 `(#:jar-name (string-append ,name "-" ,version ".jar")
8515 #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3"
8516 #:tests? #f
8517 #:phases
8518 (modify-phases %standard-phases
8519 (add-after 'install 'bin-install
8520 (lambda* (#:key inputs outputs #:allow-other-keys)
8521 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
8522 (bin (string-append (assoc-ref outputs "out") "/bin")))
8523 (mkdir-p bin)
8524 (with-output-to-file (string-append bin "/antlr3")
8525 (lambda _
8526 (display
8527 (string-append "#!" (which "sh") "\n"
8528 "java -cp " jar "/" ,name "-" ,version ".jar:"
8529 (string-concatenate
8530 (find-files (assoc-ref inputs "stringtemplate")
8531 ".*\\.jar"))
8532 ":"
8533 (string-concatenate
8534 (find-files (assoc-ref inputs "stringtemplate4")
8535 ".*\\.jar"))
8536 ":"
8537 (string-concatenate
8538 (find-files (string-append
8539 (assoc-ref inputs "antlr")
8540 "/lib")
8541 ".*\\.jar"))
8542 " org.antlr.Tool $*"))))
8543 (chmod (string-append bin "/antlr3") #o755))
8544 #t))
8545 (add-before 'build 'generate-grammar
8546 (lambda _
8547 (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/")
8548 (for-each (lambda (file)
8549 (display file)
8550 (newline)
8551 (invoke "antlr3" file))
8552 '("ANTLR.g" "ANTLRTreePrinter.g" "ActionAnalysis.g"
8553 "AssignTokenTypesWalker.g"
8554 "ActionTranslator.g" "TreeToNFAConverter.g"
8555 "ANTLRv3.g" "ANTLRv3Tree.g" "LeftRecursiveRuleWalker.g"
8556 "CodeGenTreeWalker.g" "DefineGrammarItemsWalker.g"))
8557 (substitute* "ANTLRParser.java"
8558 (("public Object getTree") "public GrammarAST getTree"))
8559 (substitute* "ANTLRv3Parser.java"
8560 (("public Object getTree") "public CommonTree getTree"))
8561 (chdir "../../../../../java")
8562 (substitute* "org/antlr/tool/LeftRecursiveRuleAnalyzer.java"
8563 (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*;
8564import org.antlr.grammar.v3.ANTLRTreePrinter;"))
8565 (substitute* "org/antlr/tool/ErrorManager.java"
8566 (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") ""))
8567 (chdir "../../../..")
8568 #t))
8569 (add-before 'build 'fix-build-xml
8570 (lambda _
8571 (substitute* "build.xml"
8572 (("target name=\"compile\">")
8573 "target name=\"compile\">
8574<copy todir=\"${classes.dir}\">
8575<fileset dir=\"tool/src/main/resources\">
8576<include name=\"**/*.stg\"/>
8577<include name=\"**/*.st\"/>
8578<include name=\"**/*.sti\"/>
8579<include name=\"**/STLexer.tokens\"/>
8580</fileset>
8581</copy>"))
8582 #t)))))
8583 (native-inputs
8584 `(("antlr" ,antlr2)
8585 ("antlr3" ,antlr3-bootstrap)))
8586 (inputs
8587 `(("junit" ,java-junit)
8588 ("stringtemplate" ,java-stringtemplate-3)
8589 ("stringtemplate4" ,java-stringtemplate)))
8590 (propagated-inputs
8591 `(("stringtemplate" ,java-stringtemplate-3)
8592 ("antlr" ,antlr2)
8593 ("stringtemplate4" ,java-stringtemplate-4.0.6)))
8594 (home-page "https://www.antlr3.org")
8595 (synopsis "Framework for constructing recognizers, compilers, and translators")
8596 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
8597is a language tool that provides a framework for constructing recognizers,
8598compilers, and translators from grammatical descriptions containing Java, C#,
8599C++, or Python actions. ANTLR provides excellent support for tree construction,
8600tree walking, and translation.")
8601 (license license:bsd-3)))
8602
8603(define antlr3-bootstrap
8604 (package
8605 (inherit antlr3)
8606 (name "antlr3-bootstrap")
8607 (native-inputs
8608 `(("antlr" ,antlr2)
8609 ("antlr3" ,antlr3-3.3)))
8610 (inputs
8611 `(("junit" ,java-junit)))))
8612
8613(define-public antlr3-3.3
8614 (package
8615 (inherit antlr3)
8616 (name "antlr3")
8617 (version "3.3")
8618 (source (origin
8619 (method url-fetch)
8620 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
8621 "gh-pages/download/antlr-"
8622 version ".tar.gz"))
8623 (sha256
8624 (base32
8625 "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m"))
8626 (patches
8627 (search-patches "antlr3-3_3-fix-java8-compilation.patch"))))
8628 (arguments
8629 `(#:jar-name (string-append ,name "-" ,version ".jar")
8630 #:source-dir (string-join '("tool/src/main/java"
8631 "runtime/Java/src/main/java"
8632 "tool/src/main/antlr2"
8633 "tool/src/main/antlr3")
8634 ":")
8635 #:tests? #f ; FIXME: tests seem to require maven plugin
8636 #:modules ((guix build ant-build-system)
8637 (guix build utils)
8638 (srfi srfi-1))
8639 #:phases
8640 (modify-phases %standard-phases
8641 (add-after 'install 'bin-install
8642 (lambda* (#:key inputs outputs #:allow-other-keys)
8643 (let* ((out (assoc-ref outputs "out"))
8644 (jar (string-append out "/share/java"))
8645 (bin (string-append out "/bin")))
8646 (mkdir-p bin)
8647 (with-output-to-file (string-append bin "/antlr3")
8648 (lambda _
8649 (display
8650 (string-append
8651 "#!" (which "sh") "\n"
8652 "java -cp " jar "/antlr3-3.3.jar:"
8653 (string-join
8654 (append (find-files (assoc-ref inputs "java-stringtemplate")
8655 ".*\\.jar$")
8656 (find-files (string-append (assoc-ref inputs "antlr")
8657 "/lib")
8658 ".*\\.jar$"))
8659 ":")
8660 " org.antlr.Tool $*"))))
8661 (chmod (string-append bin "/antlr3") #o755)
8662 #t)))
8663 (add-before 'build 'generate-grammar
8664 (lambda _
8665 (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java"
8666 (("import org.antlr.grammar.v2.\\*;")
8667 "import org.antlr.grammar.v2.*;\n
8668import org.antlr.grammar.v2.TreeToNFAConverter;\n
8669import org.antlr.grammar.v2.DefineGrammarItemsWalker;\n
8670import org.antlr.grammar.v2.ANTLRTreePrinter;"))
8671 (with-directory-excursion "tool/src/main/antlr2/org/antlr/grammar/v2/"
8672 (for-each (lambda (file)
8673 (format #t "~a\n" file)
8674 (invoke "antlr" file))
8675 '("antlr.g" "antlr.print.g" "assign.types.g"
8676 "buildnfa.g" "codegen.g" "define.g")))
8677 (with-directory-excursion "tool/src/main/antlr3/org/antlr/grammar/v3/"
8678 (for-each (lambda (file)
8679 (format #t "~a\n" file)
8680 (invoke "antlr3" file))
8681 '("ActionAnalysis.g" "ActionTranslator.g" "ANTLRv3.g"
8682 "ANTLRv3Tree.g")))
8683 #t))
8684 (add-before 'build 'fix-build-xml
8685 (lambda _
8686 (substitute* "build.xml"
8687 (("target name=\"compile\">")
8688 "target name=\"compile\">
8689<copy todir=\"${classes.dir}\">
8690<fileset dir=\"tool/src/main/resources\">
8691<include name=\"**/*.stg\"/>
8692<include name=\"**/*.st\"/>
8693<include name=\"**/*.sti\"/>
8694<include name=\"**/STLexer.tokens\"/>
8695</fileset>
8696</copy>"))
8697 #t)))))
8698 (native-inputs
8699 `(("antlr" ,antlr2)
8700 ("antlr3" ,antlr3-3.1)))
8701 (inputs
8702 `(("junit" ,java-junit)))
8703 (propagated-inputs
8704 `(("java-stringtemplate" ,java-stringtemplate-3)
8705 ("antlr" ,antlr2)))))
8706
8707(define-public antlr3-3.1
8708 (package
8709 (inherit antlr3)
8710 (version "3.1")
8711 (source (origin
8712 (method url-fetch)
8713 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
8714 "gh-pages/download/antlr-"
8715 version ".tar.gz"))
8716 (sha256
8717 (base32
8718 "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z"))
8719 (patches
8720 (search-patches "antlr3-3_1-fix-java8-compilation.patch"))))
8721 (arguments
8722 `(#:jar-name (string-append "antlr3-" ,version ".jar")
8723 #:source-dir "src:runtime/Java/src"
8724 #:tests? #f
8725 #:phases
8726 (modify-phases %standard-phases
8727 (add-after 'install 'bin-install
8728 (lambda* (#:key inputs outputs #:allow-other-keys)
8729 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
8730 (bin (string-append (assoc-ref outputs "out") "/bin")))
8731 (mkdir-p bin)
8732 (with-output-to-file (string-append bin "/antlr3")
8733 (lambda _
8734 (display
8735 (string-append "#!" (which "sh") "\n"
8736 "java -cp " jar "/antlr3-3.1.jar:"
8737 (string-concatenate
8738 (find-files (assoc-ref inputs "stringtemplate")
8739 ".*\\.jar"))
8740 ":"
8741 (string-concatenate
8742 (find-files (string-append
8743 (assoc-ref inputs "antlr")
8744 "/lib")
8745 ".*\\.jar"))
8746 " org.antlr.Tool $*"))))
8747 (chmod (string-append bin "/antlr3") #o755))
8748 #t))
8749 (add-before 'build 'generate-grammar
8750 (lambda _
8751 (let ((dir "src/org/antlr/tool/"))
8752 (for-each (lambda (file)
8753 (display file)
8754 (newline)
8755 (invoke "antlr" "-o" dir (string-append dir file)))
8756 '("antlr.g" "antlr.print.g" "assign.types.g"
8757 "buildnfa.g" "define.g")))
8758 (format #t "codegen.g\n")
8759 (invoke "antlr" "-o" "src/org/antlr/codegen"
8760 "src/org/antlr/codegen/codegen.g")
8761 #t))
8762 (add-before 'build 'fix-build-xml
8763 (lambda _
8764 (substitute* "build.xml"
8765 (("target name=\"compile\">")
8766 "target name=\"compile\">
8767<copy todir=\"${classes.dir}\">
8768<fileset dir=\"src\">
8769<include name=\"**/*.stg\"/>
8770<include name=\"**/*.st\"/>
8771<include name=\"**/*.sti\"/>
8772<include name=\"**/STLexer.tokens\"/>
8773</fileset>
8774</copy>"))
8775 #t)))))
8776 (native-inputs
8777 `(("antlr" ,antlr2)))
8778 (inputs
8779 `(("junit" ,java-junit)))
8780 (propagated-inputs
8781 `(("stringtemplate" ,java-stringtemplate-3)))))
8782
8783(define-public java-treelayout
8784 (package
8785 (name "java-treelayout")
8786 (version "1.0.3")
8787 (source (origin
8788 (method git-fetch)
8789 (uri (git-reference
8790 (url "https://github.com/abego/treelayout")
8791 (commit (string-append "v" version))))
8792 (file-name (git-file-name name version))
8793 (sha256
8794 (base32
8795 "18my8ql9b1y0n0zrvkih7xfhf3dpgfhyfifvkcfhmwcvw3divxak"))))
8796 (build-system ant-build-system)
8797 (arguments
8798 `(#:jar-name (string-append ,name "-" ,version ".jar")
8799 #:source-dir "org.abego.treelayout/src/main/java"
8800 #:test-dir "org.abego.treelayout/src/test"))
8801 (inputs
8802 (list java-junit))
8803 (native-inputs
8804 (list java-hamcrest-core))
8805 (home-page "https://treelayout.sourceforge.net")
8806 (synopsis "Tree Layout Algorithm in Java")
8807 (description "TreeLayout creates tree layouts for arbitrary trees. It is
8808not restricted to a specific output or format, but can be used for any kind of
8809two dimensional diagram. Examples are Swing based components, SVG files, etc.
8810This is possible because TreeLayout separates the layout of a tree from the
8811actual rendering.")
8812 (license license:bsd-3)))
8813
8814(define-public java-antlr4-runtime
8815 (package
8816 (name "java-antlr4-runtime")
8817 (version "4.10.1")
8818 (source (origin
8819 (method git-fetch)
8820 (uri (git-reference
8821 (url "https://github.com/antlr/antlr4")
8822 (commit version)))
8823 (file-name (git-file-name name version))
8824 (sha256
8825 (base32
8826 "0ldvd9jm4nrivaw7i7wh1q40q6xgzmzirsywiakbhg8sppagqlv7"))
8827 (patches
8828 (search-patches "java-antlr4-Add-standalone-generator.patch"))))
8829 (build-system ant-build-system)
8830 (arguments
8831 `(#:jar-name "java-antlr4-runtime.jar"
8832 #:source-dir "runtime/Java/src/org"
8833 #:tests? #f; tests depend on java-antlr4 itself
8834 #:phases
8835 (modify-phases %standard-phases
8836 (add-before 'build 'copy-resources
8837 (lambda _
8838 (copy-recursively "runtime/Java/src/main/dot"
8839 "build/classes")
8840 #t)))))
8841 (home-page "https://www.antlr.org")
8842 (synopsis "ANTLR runtime library")
8843 (description "This package contains the runtime library used with generated
8844sources by ANTLR.")
8845 (license license:bsd-3)))
8846
8847(define-public java-antlr4-runtime-cpp
8848 (package
8849 (inherit java-antlr4-runtime)
8850 (name "java-antlr4-runtime-cpp")
8851 (outputs '("out" "static"))
8852 (build-system cmake-build-system)
8853 (arguments
8854 (list
8855 ;; TODO: try to run the tests under
8856 ;; runtime-testsuite/test/org/antlr/v4/test/runtime/cpp with antlr4.
8857 #:tests? #f ;no CMake test target
8858 ;; TODO: Building the tests wants to download googletest.
8859 #:configure-flags #~'("-DANTLR_BUILD_CPP_TESTS=OFF")
8860 #:phases
8861 #~(modify-phases %standard-phases
8862 (add-after 'unpack 'chdir
8863 (lambda _
8864 (chdir "runtime/Cpp")))
8865 (add-after 'install 'move-static-library
8866 (lambda* (#:key outputs #:allow-other-keys)
8867 (let ((static (assoc-ref outputs "static"))
8868 (libantlr4-runtime.a (search-input-file
8869 outputs "lib/libantlr4-runtime.a")))
8870 (mkdir-p (string-append static "/lib"))
8871 (rename-file
8872 libantlr4-runtime.a
8873 (string-append static "/lib/"
8874 (basename libantlr4-runtime.a)))))))))
8875 (native-inputs (list pkg-config))
8876 (inputs (list `(,util-linux "lib"))) ;libuuid
8877 (synopsis "ANTL C++ runtime library")
8878 (description "This package contains the C++ runtime library used with C++
8879generated sources by ANTLR.")))
8880
8881(define-public java-antlr4-runtime-python
8882 (package
8883 (inherit java-antlr4-runtime)
8884 (name "java-antlr4-runtime-python")
8885 (outputs '("out"))
8886 (build-system pyproject-build-system)
8887 (arguments
8888 (list
8889 #:tests? #f ; tests require antlr
8890 #:phases
8891 #~(modify-phases %standard-phases
8892 (add-after 'unpack 'chdir
8893 (lambda _
8894 (chdir "runtime/Python3"))))))
8895 (native-inputs (list pkg-config python-setuptools))
8896 (inputs (list `(,util-linux "lib"))) ; libuuid
8897 (synopsis "ANTLR Python runtime library")
8898 (description "This package contains the Python runtime library used with
8899Python generated sources by ANTLR.")))
8900
8901(define-public antlr4
8902 (package
8903 (inherit java-antlr4-runtime)
8904 (name "antlr4")
8905 (arguments
8906 `(#:jar-name "antlr4.jar"
8907 #:source-dir "tool/src"
8908 #:test-dir "tool-testsuite/test:runtime-testsuite/test"
8909 #:test-include (list "**/Test*.java")
8910 #:test-exclude (list
8911 ;; These have no runnable methods and fail because
8912 ;; test-include above is too broad.
8913 "**/TestContext.java"
8914 "**/TestOutputReading.java"
8915 ;; no @Test methods
8916 "**/TestParserErrors.java"
8917 "**/TestSemPredEvalParser.java"
8918 "**/TestSets.java"
8919 "**/TestListeners.java"
8920 "**/TestParseTrees.java"
8921 "**/TestParserExec.java"
8922 "**/TestLexerErrors.java"
8923 "**/TestPerformance.java"
8924 "**/TestCompositeParsers.java"
8925 "**/TestLexerExec.java"
8926 "**/TestSemPredEvalLexer.java"
8927 "**/TestLeftRecursion.java"
8928 "**/TestFullContextParsing.java"
8929 "**/TestCompositeLexers.java"
8930 ;; Null pointer exception
8931 "**/TestCompositeGrammars.java")
8932 #:phases
8933 (modify-phases %standard-phases
8934 (add-before 'build 'fix-build.xml
8935 (lambda _
8936 ;; tests are not in a java subdirectory
8937 (substitute* "build.xml"
8938 (("\\$\\{test.home\\}/java") "${test.home}"))
8939 #t))
8940 ;; tests require to have a working antlr4 binary
8941 (delete 'check)
8942 (add-after 'install 'check
8943 (lambda _
8944 (invoke "ant" "compile-tests")
8945 (invoke "ant" "check" "-Dtest.home=runtime-testsuite/test")
8946 (invoke "ant" "check" "-Dtest.home=tool-testsuite/test")
8947 #t))
8948 (add-before 'check 'remove-unrelated-languages
8949 (lambda _
8950 ;; There are tests for other languages that ANTLR can generate, but
8951 ;; we don't have the infrastructure for that yet. Let's test Java
8952 ;; generation only.
8953 (for-each
8954 (lambda (language)
8955 (delete-file-recursively
8956 (string-append "runtime-testsuite/test/org/antlr/v4/test/runtime/"
8957 language)))
8958 '("cpp" "csharp" "go" "javascript" "php" "python" "python2"
8959 "python3" "swift"))
8960 #t))
8961 (add-before 'check 'generate-test-parsers
8962 (lambda* (#:key outputs #:allow-other-keys)
8963 (define (run-antlr dir filename package)
8964 (invoke "antlr4" "-lib" dir "-visitor" "-no-listener"
8965 "-package" package (string-append dir "/" filename)
8966 "-Xlog"))
8967 (setenv "PATH" (string-append (getenv "PATH") ":"
8968 (assoc-ref outputs "out") "/bin"))
8969 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
8970 "Java.g4" "org.antlr.v4.test.runtime.java.api")
8971 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
8972 "VisitorBasic.g4" "org.antlr.v4.test.runtime.java.api")
8973 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
8974 "VisitorCalc.g4" "org.antlr.v4.test.runtime.java.api")
8975 #t))
8976 (add-before 'check 'remove-graphemes
8977 (lambda _
8978 ;; When running antlr on grahemes.g4, we get a runtime exception:
8979 ;; set is empty. So delete the file that depends on it.
8980 (delete-file
8981 "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/perf/TimeLexerSpeed.java")
8982 #t))
8983 (add-after 'install 'bin-install
8984 (lambda* (#:key inputs outputs #:allow-other-keys)
8985 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
8986 (bin (string-append (assoc-ref outputs "out") "/bin")))
8987 (mkdir-p bin)
8988 (with-output-to-file (string-append bin "/antlr4")
8989 (lambda _
8990 (display
8991 (string-append "#!" (which "sh") "\n"
8992 "java -cp " jar "/antlr4.jar:"
8993 (string-join
8994 (apply
8995 append
8996 (map
8997 (lambda (input)
8998 (find-files (assoc-ref inputs input)
8999 ".*\\.jar"))
9000 '("antlr3" "java-stringtemplate"
9001 "java-antlr4-runtime" "java-treelayout"
9002 "java-jsonp-api" "java-icu4j")))
9003 ":")
9004 " org.antlr.v4.Tool $*"))))
9005 (chmod (string-append bin "/antlr4") #o755)
9006 #t)))
9007 (add-before 'build 'copy-resources
9008 (lambda _
9009 (copy-recursively "tool/resources/" "build/classes")
9010 #t))
9011 (add-before 'build 'generate-unicode
9012 (lambda _
9013 ;; First: build the generator
9014 (invoke "javac" "-cp" (getenv "CLASSPATH")
9015 "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java"
9016 "tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java")
9017 ;; Then use it
9018 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
9019 ":tool/src:runtime/Java")
9020 "org.antlr.v4.unicode.UnicodeRenderer"
9021 "tool/resources/org/antlr/v4/tool/templates"
9022 "unicodedata"
9023 "tool/src/org/antlr/v4/unicode/UnicodeData.java")
9024 ;; It seems there is a bug with our ST4
9025 (substitute* "tool/src/org/antlr/v4/unicode/UnicodeData.java"
9026 (("\\\\>") ">"))
9027 ;; Remove the additional file
9028 (delete-file "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java")
9029 #t))
9030 (add-before 'build 'generate-grammar
9031 (lambda* (#:key inputs #:allow-other-keys)
9032 (with-directory-excursion "tool/src/org/antlr/v4/parse"
9033 (for-each (lambda (file)
9034 (display file)
9035 (newline)
9036 (invoke "antlr3" file))
9037 '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g"
9038 "GrammarTreeVisitor.g" "ATNBuilder.g"
9039 "ActionSplitter.g" "LeftRecursiveRuleWalker.g")))
9040 (with-directory-excursion "tool/src/org/antlr/v4/codegen"
9041 (install-file "../parse/ANTLRParser.tokens" ".")
9042 (display "SourceGenTriggers.g\n")
9043 (invoke "antlr3" "SourceGenTriggers.g"))
9044 #t)))))
9045 (inputs
9046 (list antlr3
9047 java-antlr4-runtime
9048 java-icu4j
9049 java-jsonp-api
9050 java-stringtemplate
9051 java-treelayout))
9052 (native-inputs
9053 (list java-junit))
9054 (synopsis "Parser and lexer generator in Java")
9055 (description "ANTLR (ANother Tool for Language Recognition) is a powerful
9056parser generator for reading, processing, executing, or translating structured
9057text or binary files. It's widely used to build languages, tools, and
9058frameworks. From a grammar, ANTLR generates a parser that can build and walk
9059parse trees.")))
9060
9061(define-public java-antlr4-runtime-4.1
9062 (package
9063 (inherit java-antlr4-runtime)
9064 (version "4.1")
9065 (source (origin
9066 (method git-fetch)
9067 (uri (git-reference
9068 (url "https://github.com/antlr/antlr4")
9069 (commit version)))
9070 (file-name (git-file-name "antlr4" version))
9071 (sha256
9072 (base32
9073 "1i8hmx5an58cjyvhji0xgpvd6lq00z1k1mjys025q2wqc25wv4c1"))))
9074 (arguments
9075 (substitute-keyword-arguments (package-arguments java-antlr4-runtime)
9076 ((#:phases phases)
9077 `(modify-phases ,phases
9078 (add-before 'configure 'chmod
9079 (lambda _
9080 (chmod "build.xml" #o644)
9081 #t))))))
9082 (inputs
9083 (list java-treelayout))))
9084
9085(define-public antlr4-4.1
9086 (package
9087 (inherit antlr4)
9088 (version (package-version java-antlr4-runtime-4.1))
9089 (source (package-source java-antlr4-runtime-4.1))
9090 (arguments
9091 (substitute-keyword-arguments (package-arguments antlr4)
9092 ((#:test-dir _)
9093 "tool/test")
9094 ((#:test-exclude excludes)
9095 `(list "**/TestParseErrors.java"
9096 "**/TestTopologicalSort.java"
9097 ,@excludes))
9098 ((#:phases phases)
9099 `(modify-phases ,phases
9100 (delete 'generate-unicode)
9101 (replace 'check
9102 (lambda _
9103 (invoke "ant" "check")
9104 #t))
9105 (add-before 'configure 'chmod
9106 (lambda _
9107 (chmod "build.xml" #o644)
9108 #t))
9109 (delete 'remove-graphemes)
9110 (delete 'remove-unrelated-languages)
9111 (delete 'generate-test-parsers)))))
9112 (inputs
9113 (alist-replace
9114 "java-antlr4-runtime" (list java-antlr4-runtime-4.1)
9115 (package-inputs antlr4)))))
9116
9117(define-public java-tunnelvisionlabs-antlr4-runtime-annotations
9118 (package
9119 (inherit java-antlr4-runtime)
9120 (name "java-tunnelvisionlabs-antlr4-runtime-annotations")
9121 (version "4.7.4")
9122 (source (origin
9123 (method git-fetch)
9124 (uri (git-reference
9125 (url "https://github.com/tunnelvisionlabs/antlr4")
9126 (commit (string-append version "-opt"))))
9127 (file-name (git-file-name "java-tunnelvisionlabs-antlr4" version))
9128 (sha256
9129 (base32
9130 "1mf2lvvsszpialsk23ma83pwp50nd32lrbjpa847zlm5gmranbr8"))
9131 (patches
9132 (search-patches "java-antlr4-Add-standalone-generator.patch"
9133 "java-tunnelvisionlabs-antlr-code-too-large.patch"))))
9134 (arguments
9135 `(#:jar-name "java-antlr4-runtime-annotations.jar"
9136 #:source-dir "runtime/JavaAnnotations/src"
9137 #:tests? #f; no tests
9138 #:phases
9139 (modify-phases %standard-phases
9140 (add-after 'build 'copy-resources
9141 (lambda _
9142 (copy-recursively "runtime/JavaAnnotations/resources"
9143 "build/classes")
9144 #t))
9145 (add-after 'copy-resources 'rebuild-jar
9146 (lambda _
9147 (invoke "ant" "jar")
9148 #t)))))
9149 (inputs '())
9150 (native-inputs '())
9151 (synopsis "Annotations for ANTLR's runtime library")
9152 (description "This package contains annotations used during the build of
9153the runtime library of ANTLR.")))
9154
9155;; the runtime of this library requires a lexer that is generated by antlr4.
9156;; However, antlr4 itself requires this library at build and run-time. We
9157;; use [email protected], the closest version of antlr that doesn't need this
9158;; bootstrap process, to generate the lexer. The generated lexer is built
9159;; for the 4.1 runtime, which is slightly different from this runtime.
9160;; So, we build the runtime with antlr 4.1, with a broken xml lexer, that we
9161;; use to build antlr4. We then re-use this antlr4 to build the runtime, and
9162;; the proper, working, runtime to build antlr4 again.
9163(define java-tunnelvisionlabs-antlr4-runtime-bootstrap
9164 (package
9165 (inherit java-antlr4-runtime)
9166 (name "java-tunnelvisionlabs-antlr4-runtime")
9167 (version (package-version java-tunnelvisionlabs-antlr4-runtime-annotations))
9168 (source (package-source java-tunnelvisionlabs-antlr4-runtime-annotations))
9169 (arguments
9170 `(#:jar-name "java-antlr4-runtime.jar"
9171 #:source-dir "runtime/Java/src"
9172 #:tests? #f; tests require antlr4, but antlr4 depends on this package
9173 #:phases
9174 (modify-phases %standard-phases
9175 (add-before 'build 'generate-xpath-lexer
9176 (lambda _
9177 (invoke "antlr4" "-lib" "runtime/Java/src/org/antlr/v4/runtime/tree/xpath"
9178 "-visitor" "-no-listener"
9179 "-package" "org.antlr.v4.runtime.tree.xpath"
9180 "runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.g4")
9181 ;; Generated code is for an incompatible version of the runtime
9182 (substitute* "runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.java"
9183 (("LexerATNSimulator\\(this,_ATN,_decisionToDFA,_sharedContextCache\\)")
9184 "LexerATNSimulator(this,_ATN)"))
9185 #t))
9186 (add-before 'build 'copy-resources
9187 (lambda _
9188 (copy-recursively "runtime/Java/src/main/dot"
9189 "build/classes")
9190 #t)))))
9191 (native-inputs
9192 `(("antlr4" ,antlr4-4.1)
9193 ("java-tunnelvisionlabs-antlr4-runtime-annotations"
9194 ,java-tunnelvisionlabs-antlr4-runtime-annotations)))))
9195
9196(define java-tunnelvisionlabs-antlr4-bootstrap
9197 (package
9198 (inherit antlr4)
9199 (name "java-tunnelvisionlabs-antlr4")
9200 (version (package-version java-tunnelvisionlabs-antlr4-runtime-annotations))
9201 (source (package-source java-tunnelvisionlabs-antlr4-runtime-annotations))
9202 (arguments
9203 (substitute-keyword-arguments (package-arguments antlr4)
9204 ((#:test-dir _)
9205 "tool/test:runtime-testsuite/src")
9206 ((#:phases phases)
9207 `(modify-phases ,phases
9208 (delete 'remove-unrelated-languages)
9209 (delete 'remove-graphemes)
9210 (delete 'generate-test-parsers)
9211 (delete 'check)))))
9212 (native-inputs '())
9213 (inputs
9214 `(("antlr3" ,antlr3)
9215 ("java-antlr4-runtime" ,java-tunnelvisionlabs-antlr4-runtime-bootstrap)
9216 ("java-tunnelvisionlabs-antlr4-runtime-annotations"
9217 ,java-tunnelvisionlabs-antlr4-runtime-annotations)
9218 ("java-icu4j" ,java-icu4j)
9219 ("java-jsonp-api" ,java-jsonp-api)
9220 ("java-stringtemplate" ,java-stringtemplate)
9221 ("java-treelayout" ,java-treelayout)))))
9222
9223(define-public java-tunnelvisionlabs-antlr4-runtime
9224 (package
9225 (inherit java-tunnelvisionlabs-antlr4-runtime-bootstrap)
9226 (native-inputs
9227 (alist-replace
9228 "antlr4" (list java-tunnelvisionlabs-antlr4-bootstrap)
9229 (package-native-inputs java-tunnelvisionlabs-antlr4-runtime-bootstrap)))))
9230
9231(define-public java-tunnelvisionlabs-antlr4
9232 (package
9233 (inherit java-tunnelvisionlabs-antlr4-bootstrap)
9234 (inputs
9235 (alist-replace
9236 "java-antlr4-runtime" (list java-tunnelvisionlabs-antlr4-runtime)
9237 (package-inputs java-tunnelvisionlabs-antlr4-bootstrap)))))
9238
9239(define-public java-commons-cli-1.2
9240 ;; This is a bootstrap dependency for Maven2.
9241 (package
9242 (inherit java-commons-cli)
9243 (version "1.2")
9244 (source (origin
9245 (method url-fetch)
9246 (uri (string-append "mirror://apache/commons/cli/source/"
9247 "commons-cli-" version "-src.tar.gz"))
9248 (sha256
9249 (base32
9250 "0rvfgzgv2pc1m091dfj3ih9ddsjjppr1f1wf0qmc3bk6b1kwv2dm"))))
9251 (arguments
9252 `(#:jar-name "commons-cli.jar"
9253 #:phases
9254 (modify-phases %standard-phases
9255 (add-before 'check 'fix-build-xml
9256 (lambda* (#:key inputs #:allow-other-keys)
9257 (substitute* "build.xml"
9258 (("dir=\"\\$\\{test.home\\}/java\"")
9259 "dir=\"${test.home}\""))
9260 #t)))))
9261 (native-inputs
9262 (list java-junit))))
9263
9264(define-public java-microemulator-cldc
9265 (package
9266 (name "java-microemulator-cldc")
9267 (version "2.0.4")
9268 (source (origin
9269 (method url-fetch)
9270 (uri (string-append "https://github.com/barteo/microemu/archive/"
9271 "microemulator_"
9272 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
9273 version)
9274 ".tar.gz"))
9275 (file-name (string-append name "-" version ".tar.gz"))
9276 (sha256
9277 (base32
9278 "1x1apmz38gkppxnwnygwmi12j54v4p258v8ddzn6dldkk7vak1ll"))))
9279 (build-system ant-build-system)
9280 (arguments
9281 `(#:jar-name "microemulator-cldc.jar"
9282 #:source-dir "microemu-cldc/src/main/java"
9283 #:tests? #f)); Requires even older software
9284 (home-page "https://github.com/barteo/microemu")
9285 (synopsis "J2ME CLDC emulator")
9286 (description "Microemulator is a Java 2 Micro Edition (J2ME) CLDC/MIDP
9287Emulator. It demonstrates MIDlet based applications in web browser
9288applet and can be run as a standalone java application.")
9289 (license (list license:asl2.0
9290 ;; or altenatively:
9291 license:lgpl2.1+))))
9292
9293(define-public java-datanucleus-javax-persistence
9294 (package
9295 (name "java-datanucleus-javax-persistence")
9296 (version "2.2.0")
9297 (source (origin
9298 (method url-fetch)
9299 (uri (string-append "https://github.com/datanucleus/"
9300 "javax.persistence/archive/javax.persistence-"
9301 version "-release.tar.gz"))
9302 (sha256
9303 (base32
9304 "11jx0fjwgc2hhbqqgdd6m1pf2fplf9vslppygax0y1z5csnqjhpx"))))
9305 (build-system ant-build-system)
9306 (arguments
9307 `(#:jar-name "java-datanucleus-javax-persistence.jar"
9308 #:jdk ,icedtea-8
9309 #:source-dir "src/main/java"
9310 #:tests? #f)); no tests
9311 (home-page "https://github.com/datanucleus/javax.persistence")
9312 (synopsis "JPA API")
9313 (description "This package contains a clean definition of JPA API intended
9314for use with DataNucleus JPA since the JCP haven't provided an official JPA API
9315jar. See @url{http://java.net/projects/jpa-spec/downloads} for the specification
9316used to generate this API.")
9317 (license (list license:edl1.0 license:epl1.0))))
9318
9319(define-public java-osgi-cmpn
9320 (package
9321 (name "java-osgi-cmpn")
9322 (version "6.0.0")
9323 (source (origin
9324 (method url-fetch)
9325 (uri (string-append "https://repo1.maven.org/maven2/"
9326 "org/osgi/osgi.cmpn/" version "/osgi.cmpn-"
9327 version "-sources.jar"))
9328 (sha256
9329 (base32
9330 "1lmb6xyrmkqdhv1kayf0514rlwq6ypvs4m44ibrck3snp8241wys"))))
9331 (build-system ant-build-system)
9332 (arguments
9333 `(#:jar-name "osgi-cmpn.jar"
9334 #:tests? #f)); no tests
9335 (inputs
9336 `(("annotation" ,java-osgi-annotation)
9337 ("core" ,java-osgi-core)
9338 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
9339 ("microemulator" ,java-microemulator-cldc)
9340 ("servlet" ,java-classpathx-servletapi)))
9341 (home-page "https://www.osgi.org")
9342 (synopsis "Compendium specification module of OSGi framework")
9343 (description
9344 "OSGi, for Open Services Gateway initiative framework, is a module system
9345and service platform for the Java programming language. This package contains
9346the compendium specification module, providing interfaces and classes for use
9347in compiling bundles.")
9348 (license license:asl2.0)))
9349
9350(define-public java-osgi-service-component-annotations
9351 (package
9352 (name "java-osgi-service-component-annotations")
9353 (version "1.3.0")
9354 (source (origin
9355 (method url-fetch)
9356 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9357 "org.osgi.service.component.annotations/"
9358 version "/org.osgi.service.component.annotations-"
9359 version "-sources.jar"))
9360 (sha256
9361 (base32
9362 "15rq9cmp4fpn74q44m4j35qsqmjf5lx3hcrk6pzvbhc08igic2f0"))))
9363 (build-system ant-build-system)
9364 (arguments
9365 `(#:jar-name "osgi-service-component-annotations.jar"
9366 #:tests? #f)); no tests
9367 (inputs
9368 `(("annotation" ,java-osgi-annotation)))
9369 (home-page "https://www.osgi.org")
9370 (synopsis "Support annotations for osgi-service-component")
9371 (description
9372 "OSGi, for Open Services Gateway initiative framework, is a module system
9373and service platform for the Java programming language. This package contains
9374the support annotations for osgi-service-component.")
9375 (license license:asl2.0)))
9376
9377(define-public java-osgi-dto
9378 (package
9379 (name "java-osgi-dto")
9380 (version "1.0.0")
9381 (source (origin
9382 (method url-fetch)
9383 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9384 "org.osgi.dto/" version "/org.osgi.dto-"
9385 version "-sources.jar"))
9386 (sha256
9387 (base32
9388 "0f4bqjzadn0hwk6sd3h5gvbyfp3yci1s6r0v770cc15p0pg627yr"))))
9389 (build-system ant-build-system)
9390 (arguments
9391 `(#:jar-name "osgi-dto.jar"
9392 #:tests? #f)); no tests
9393 (inputs
9394 `(("annotation" ,java-osgi-annotation)))
9395 (home-page "https://www.osgi.org")
9396 (synopsis "Data Transfer Objects")
9397 (description
9398 "OSGi, for Open Services Gateway initiative framework, is a module system
9399and service platform for the Java programming language. This package contains
9400the Data Transfer Objects. It is easily serializable having only public fields
9401of primitive types and their wrapper classes, Strings, and DTOs. List, Set,
9402Map and array aggregates may also be used. The aggregates must only hold
9403objects of the listed types or aggregates.")
9404 (license license:asl2.0)))
9405
9406(define-public java-osgi-resource
9407 (package
9408 (name "java-osgi-resource")
9409 (version "1.0.0")
9410 (source (origin
9411 (method url-fetch)
9412 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9413 "org.osgi.resource/"
9414 version "/org.osgi.resource-"
9415 version "-sources.jar"))
9416 (sha256
9417 (base32
9418 "0hi0fsc5v99q22bd7lrkvpz1y0ds4w9arjldpwsrcpqvz2js7q2d"))))
9419 (build-system ant-build-system)
9420 (arguments
9421 `(#:jar-name "osgi-resource.jar"
9422 #:tests? #f)); no tests
9423 (inputs
9424 `(("annotation" ,java-osgi-annotation)
9425 ("dto" ,java-osgi-dto)))
9426 (home-page "https://www.osgi.org")
9427 (synopsis "OSGI Resource")
9428 (description
9429 "OSGi, for Open Services Gateway initiative framework, is a module system
9430and service platform for the Java programming language. This package contains
9431the definition of common types in osgi packages.")
9432 (license license:asl2.0)))
9433
9434(define-public java-osgi-namespace-contract
9435 (package
9436 (name "java-osgi-namespace-contract")
9437 (version "1.0.0")
9438 (source (origin
9439 (method url-fetch)
9440 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9441 "org.osgi.namespace.contract/"
9442 version "/org.osgi.namespace.contract-"
9443 version "-sources.jar"))
9444 (sha256
9445 (base32
9446 "1iz4f2i0fvqrlq90ki9nfzcfpvy2av434ri25bglywqssx8mmp36"))))
9447 (build-system ant-build-system)
9448 (inputs
9449 `(("resource" ,java-osgi-resource)
9450 ("annotation" ,java-osgi-annotation)))
9451 (arguments
9452 `(#:jar-name "osgi-namespace-contract.jar"
9453 #:tests? #f)); no tests
9454 (home-page "https://www.osgi.org")
9455 (synopsis "Contract Capability and Requirement Namespace")
9456 (description
9457 "OSGi, for Open Services Gateway initiative framework, is a module system
9458and service platform for the Java programming language. This package contains
9459the names for the attributes and directives for a namespace with contracts.")
9460 (license license:asl2.0)))
9461
9462(define-public java-osgi-namespace-extender
9463 (package
9464 (name "java-osgi-namespace-extender")
9465 (version "1.0.1")
9466 (source (origin
9467 (method url-fetch)
9468 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9469 "org.osgi.namespace.extender/"
9470 version "/org.osgi.namespace.extender-"
9471 version "-sources.jar"))
9472 (sha256
9473 (base32
9474 "0jgqiak2i05qv6j3gd33xlaifzzc0ylxxk376v2x0apfg3vvixmz"))))
9475 (build-system ant-build-system)
9476 (inputs
9477 `(("resource" ,java-osgi-resource)
9478 ("annotation" ,java-osgi-annotation)))
9479 (arguments
9480 `(#:jar-name "osgi-namespace-extendent.jar"
9481 #:tests? #f)); no tests
9482 (home-page "https://www.osgi.org")
9483 (synopsis "Extender Capability and Requirement Namespace")
9484 (description
9485 "OSGi, for Open Services Gateway initiative framework, is a module system
9486and service platform for the Java programming language. This package contains
9487the names for the attributes and directives for an extender namespace.")
9488 (license license:asl2.0)))
9489
9490(define-public java-osgi-namespace-service
9491 (package
9492 (name "java-osgi-namespace-service")
9493 (version "1.0.0")
9494 (source (origin
9495 (method url-fetch)
9496 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9497 "org.osgi.namespace.service/"
9498 version "/org.osgi.namespace.service-"
9499 version "-sources.jar"))
9500 (sha256
9501 (base32
9502 "0qmw8n2449nkmm56d1znz9zhazb6ya3vsimd5bf5jg23zzhgl8c8"))))
9503 (build-system ant-build-system)
9504 (inputs
9505 `(("resource" ,java-osgi-resource)
9506 ("annotation" ,java-osgi-annotation)))
9507 (arguments
9508 `(#:jar-name "osgi-namespace-service.jar"
9509 #:tests? #f)); no tests
9510 (home-page "https://www.osgi.org")
9511 (synopsis "Service Capability and Requirement Namespace")
9512 (description
9513 "OSGi, for Open Services Gateway initiative framework, is a module system
9514and service platform for the Java programming language. This package contains
9515the names for the attributes and directives for a service namespace.")
9516 (license license:asl2.0)))
9517
9518(define-public java-osgi-util-function
9519 (package
9520 (name "java-osgi-util-function")
9521 (version "1.0.0")
9522 (source (origin
9523 (method url-fetch)
9524 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9525 "org.osgi.util.function/"
9526 version "/org.osgi.util.function-"
9527 version "-sources.jar"))
9528 (sha256
9529 (base32
9530 "04l7j3hwmmj28w23m7paca0afzncs42j2mdr3liqq8kvp548sc6x"))))
9531 (build-system ant-build-system)
9532 (arguments
9533 `(#:jar-name "osgi-util-function.jar"
9534 #:tests? #f)); no tests
9535 (inputs
9536 `(("annotation" ,java-osgi-annotation)))
9537 (home-page "https://www.osgi.org")
9538 (synopsis "OSGI Util Function")
9539 (description
9540 "OSGi, for Open Services Gateway initiative framework, is a module system
9541and service platform for the Java programming language. This package contains
9542an interface for a function that accepts a single argument and produces a result.")
9543 (license license:asl2.0)))
9544
9545(define-public java-osgi-util-promise
9546 (package
9547 (name "java-osgi-util-promise")
9548 (version "1.0.0")
9549 (source (origin
9550 (method url-fetch)
9551 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9552 "org.osgi.util.promise/"
9553 version "/org.osgi.util.promise-"
9554 version "-sources.jar"))
9555 (sha256
9556 (base32
9557 "0y34dwiflg1c4ahvkswpf9z02xph2sr9fm04ia5493x3lshpw22c"))))
9558 (build-system ant-build-system)
9559 (arguments
9560 `(#:jar-name "osgi-util-promise.jar"
9561 #:tests? #f)); no tests
9562 (inputs
9563 `(("annotation" ,java-osgi-annotation)
9564 ("function" ,java-osgi-util-function)))
9565 (home-page "https://www.osgi.org")
9566 (synopsis "Promise of a value")
9567 (description
9568 "OSGi, for Open Services Gateway initiative framework, is a module system
9569and service platform for the Java programming language. This package contains
9570an interface and utilitary classes for promises. A Promise represents a future
9571value. It handles the interactions for asynchronous processing.")
9572 (license license:asl2.0)))
9573
9574(define-public java-osgi-service-metatype-annotations
9575 (package
9576 (name "java-osgi-service-metatype-annotations")
9577 (version "1.3.0")
9578 (source (origin
9579 (method url-fetch)
9580 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9581 "org.osgi.service.metatype.annotations/"
9582 version "/org.osgi.service.metatype.annotations-"
9583 version "-sources.jar"))
9584 (sha256
9585 (base32
9586 "12rwm3349wk80vm88rcdgs4435m4jxkpkj5mrx326skkz2c6hyw6"))))
9587 (build-system ant-build-system)
9588 (arguments
9589 `(#:jar-name "osgi-service-metatype-annotations.jar"
9590 #:tests? #f)); no tests
9591 (inputs
9592 `(("annotation" ,java-osgi-annotation)))
9593 (home-page "https://www.osgi.org")
9594 (synopsis "Support annotations for metatype")
9595 (description
9596 "OSGi, for Open Services Gateway initiative framework, is a module system
9597and service platform for the Java programming language. This package contains
9598the support annotations for metatype.")
9599 (license license:asl2.0)))
9600
9601(define-public java-osgi-service-repository
9602 (package
9603 (name "java-osgi-service-repository")
9604 (version "1.1.0")
9605 (source (origin
9606 (method url-fetch)
9607 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9608 "org.osgi.service.repository/"
9609 version "/org.osgi.service.repository-"
9610 version "-sources.jar"))
9611 (sha256
9612 (base32
9613 "1k41mhg7b58pd8nsghr2qwcjrxdnf1p9spsw9v11k4257g6rl06n"))))
9614 (build-system ant-build-system)
9615 (arguments
9616 `(#:jar-name "osgi-service-repository.jar"
9617 #:tests? #f)); no tests
9618 (inputs
9619 `(("annotation" ,java-osgi-annotation)
9620 ("promise" ,java-osgi-util-promise)
9621 ("resource" ,java-osgi-resource)))
9622 (home-page "https://www.osgi.org")
9623 (synopsis "OSGI service repository")
9624 (description
9625 "OSGi, for Open Services Gateway initiative framework, is a module system
9626and service platform for the Java programming language. This package contains
9627a repository service that contains resources.")
9628 (license license:asl2.0)))
9629
9630(define-public java-osgi-framework
9631 (package
9632 (name "java-osgi-framework")
9633 (version "1.8.0")
9634 (source (origin
9635 (method url-fetch)
9636 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9637 "org.osgi.framework/" version "/org.osgi.framework-"
9638 version "-sources.jar"))
9639 (sha256
9640 (base32
9641 "1lwp2zfad3rybcc6q9bwz8xsgkc92ypzy5p6x54387f1qj65m73s"))))
9642 (build-system ant-build-system)
9643 (arguments
9644 `(#:jar-name "osgi-framework.jar"
9645 #:tests? #f)); no tests
9646 (inputs
9647 `(("annotation" ,java-osgi-annotation)
9648 ("resource" ,java-osgi-resource)
9649 ("dto" ,java-osgi-dto)))
9650 (home-page "https://www.osgi.org")
9651 (synopsis "OSGi framework")
9652 (description
9653 "OSGi, for Open Services Gateway initiative framework, is a module system
9654and service platform for the Java programming language.")
9655 (license license:asl2.0)))
9656
9657(define-public java-osgi-service-log
9658 (package
9659 (name "java-osgi-service-log")
9660 (version "1.3.0")
9661 (source (origin
9662 (method url-fetch)
9663 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9664 "org.osgi.service.log/"
9665 version "/org.osgi.service.log-"
9666 version "-sources.jar"))
9667 (sha256
9668 (base32
9669 "1029j30dzcwializzca0j3fkhwwz08kmmsha5agw1iccscimj6r0"))))
9670 (build-system ant-build-system)
9671 (arguments
9672 `(#:jar-name "osgi-service-log.jar"
9673 #:tests? #f)); no tests
9674 (inputs
9675 (list java-osgi-framework))
9676 (home-page "https://www.osgi.org")
9677 (synopsis "Provides methods for bundles to write messages to the log")
9678 (description
9679 "OSGi, for Open Services Gateway initiative framework, is a module system
9680and service platform for the Java programming language. This package contains
9681the log service.")
9682 (license license:asl2.0)))
9683
9684(define-public java-osgi-service-jdbc
9685 (package
9686 (name "java-osgi-service-jdbc")
9687 (version "1.0.0")
9688 (source (origin
9689 (method url-fetch)
9690 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9691 "org.osgi.service.jdbc/"
9692 version "/org.osgi.service.jdbc-"
9693 version "-sources.jar"))
9694 (sha256
9695 (base32
9696 "11iln5v7bk469cgb9ddkrz9sa95b3733gqgaqw9xf5g6wq652yjz"))))
9697 (build-system ant-build-system)
9698 (arguments
9699 `(#:jar-name "osgi-service-jdbc.jar"
9700 #:tests? #f)); no tests
9701 (home-page "https://www.osgi.org")
9702 (synopsis "Factory for JDBC connection factories")
9703 (description
9704 "OSGi, for Open Services Gateway initiative framework, is a module system
9705and service platform for the Java programming language. This package contains
9706a factory for JDBC connection factories. There are 3 preferred connection
9707factories for getting JDBC connections:
9708
9709@itemize
9710@item @code{javax.sql.DataSource};
9711@item @code{javax.sql.ConnectionPoolDataSource};
9712@item @code{javax.sql.XADataSource}.
9713@end itemize")
9714 (license license:asl2.0)))
9715
9716(define-public java-osgi-service-resolver
9717 (package
9718 (name "java-osgi-service-resolver")
9719 (version "1.0.1")
9720 (source (origin
9721 (method url-fetch)
9722 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9723 "org.osgi.service.resolver/"
9724 version "/org.osgi.service.resolver-"
9725 version "-sources.jar"))
9726 (sha256
9727 (base32
9728 "1dzqn1ryfi2rq4zwsgp44bmj2wlfydjg1qbxw2b0z4xdjjy55vxd"))))
9729 (build-system ant-build-system)
9730 (arguments
9731 `(#:jar-name "osgi-service-resolver.jar"
9732 #:tests? #f)); no tests
9733 (inputs
9734 `(("annotation" ,java-osgi-annotation)
9735 ("resource" ,java-osgi-resource)))
9736 (home-page "https://www.osgi.org")
9737 (synopsis "OSGI Resolver service")
9738 (description
9739 "OSGi, for Open Services Gateway initiative framework, is a module system
9740and service platform for the Java programming language. This package contains
9741a resolver service that resolves the specified resources in the context supplied
9742by the caller.")
9743 (license license:asl2.0)))
9744
9745(define-public java-osgi-util-tracker
9746 (package
9747 (name "java-osgi-util-tracker")
9748 (version "1.5.1")
9749 (source (origin
9750 (method url-fetch)
9751 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9752 "org.osgi.util.tracker/"
9753 version "/org.osgi.util.tracker-"
9754 version "-sources.jar"))
9755 (sha256
9756 (base32
9757 "0c4fh9vxwzsx59r8dygda0gq2gx3z5vfhc3jsphlqwf5w0h403lz"))))
9758 (build-system ant-build-system)
9759 (arguments
9760 `(#:jar-name "osgi-util-tracker.jar"
9761 #:tests? #f)); no tests
9762 (inputs
9763 `(("framework" ,java-osgi-framework)
9764 ("annotation" ,java-osgi-annotation)))
9765 (home-page "https://www.osgi.org")
9766 (synopsis "Bundle tracking")
9767 (description
9768 "OSGi, for Open Services Gateway initiative framework, is a module system
9769and service platform for the Java programming language. This package contains
9770bundle tracking utility classes.")
9771 (license license:asl2.0)))
9772
9773(define-public java-osgi-service-cm
9774 (package
9775 (name "java-osgi-service-cm")
9776 (version "1.5.0")
9777 (source (origin
9778 (method url-fetch)
9779 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9780 "org.osgi.service.cm/"
9781 version "/org.osgi.service.cm-"
9782 version "-sources.jar"))
9783 (sha256
9784 (base32
9785 "1z8kap48y3xi0ggj8v6czglfnpnd94mmismgi2wbqhj1nl5fzbp6"))))
9786 (build-system ant-build-system)
9787 (arguments
9788 `(#:jar-name "osgi-service-cm.jar"
9789 #:tests? #f)); no tests
9790 (inputs
9791 `(("framework" ,java-osgi-framework)
9792 ("annotation" ,java-osgi-annotation)))
9793 (home-page "https://www.osgi.org")
9794 (synopsis "OSGI Configuration Management")
9795 (description
9796 "OSGi, for Open Services Gateway initiative framework, is a module system
9797and service platform for the Java programming language. This package contains
9798utility classes for the configuration of services.")
9799 (license license:asl2.0)))
9800
9801(define-public java-osgi-service-packageadmin
9802 (package
9803 (name "java-osgi-service-packageadmin")
9804 (version "1.2.0")
9805 (source (origin
9806 (method url-fetch)
9807 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9808 "org.osgi.service.packageadmin/"
9809 version "/org.osgi.service.packageadmin-"
9810 version "-sources.jar"))
9811 (sha256
9812 (base32
9813 "041mpxzi7g36wmcily6y4ccn3jx15akpdy8gmhyb7m98x7qfvn52"))))
9814 (build-system ant-build-system)
9815 (arguments
9816 `(#:jar-name "osgi-service-packageadmin.jar"
9817 #:tests? #f)); no tests
9818 (inputs
9819 `(("framework" ,java-osgi-framework)))
9820 (home-page "https://www.osgi.org")
9821 (synopsis "OSGI Package Administration")
9822 (description
9823 "OSGi, for Open Services Gateway initiative framework, is a module system
9824and service platform for the Java programming language. This package contains
9825the packageadmin service.")
9826 (license license:asl2.0)))
9827
9828(define-public java-ops4j-base-lang
9829 (package
9830 (name "java-ops4j-base-lang")
9831 (version "1.5.0")
9832 (source (origin
9833 (method url-fetch)
9834 (uri (string-append "https://github.com/ops4j/org.ops4j.base/"
9835 "archive/base-" version ".tar.gz"))
9836 (sha256
9837 (base32
9838 "18hl3lpchgpv8yh5rlk39l2gif5dlfgb8gxjmncf39pr2dprkniw"))))
9839 (build-system ant-build-system)
9840 (arguments
9841 `(#:jar-name "java-ops4j-base-lang.jar"
9842 #:source-dir "ops4j-base-lang/src/main/java"
9843 #:tests? #f; no tests
9844 #:phases
9845 (modify-phases %standard-phases
9846 (add-before 'build 'add-test-file
9847 (lambda _
9848 ;; That file is required by a test in ops4j-pax-exam-core-spi
9849 (mkdir-p "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang")
9850 (with-output-to-file "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang/pom.properties"
9851 (lambda _
9852 (display
9853 (string-append
9854 "version=" ,version "\n"
9855 "groupId=org.ops4j.base"
9856 "artifactId=ops4j-base-lang\n"))))
9857 #t)))))
9858 (home-page "https://ops4j1.jira.com/wiki/spaces/base/overview")
9859 (synopsis "Utility classes and extensions to be used in OPS4J projects")
9860 (description "OPS4J stands for Open Participation Software for Java. This
9861package contains utilities and extensions related to @code{java.lang}.")
9862 (license license:asl2.0)))
9863
9864(define-public java-ops4j-base-monitors
9865 (package
9866 (inherit java-ops4j-base-lang)
9867 (name "java-ops4j-base-monitors")
9868 (arguments
9869 `(#:jar-name "java-ops4j-base-monitors.jar"
9870 #:source-dir "ops4j-base-monitors/src/main/java"
9871 #:tests? #f)); no tests
9872 (inputs
9873 `(("lang" ,java-ops4j-base-lang)))
9874 (description "OPS4J stands for Open Participation Software for Java. This
9875package contains utilities and extensions related to monitoring.")))
9876
9877(define-public java-ops4j-base-io
9878 (package
9879 (inherit java-ops4j-base-lang)
9880 (name "java-ops4j-base-io")
9881 (arguments
9882 `(#:jar-name "java-ops4j-base-io.jar"
9883 #:source-dir "ops4j-base-io/src/main/java"
9884 #:test-dir "ops4j-base-io/src/test"
9885 #:test-exclude
9886 (list "**/ListerTest.java")))
9887 (inputs
9888 `(("lang" ,java-ops4j-base-monitors)
9889 ("lang" ,java-ops4j-base-lang)))
9890 (native-inputs
9891 `(("junit" ,java-junit)
9892 ("hamcrest" ,java-hamcrest-core)))
9893 (description "OPS4J stands for Open Participation Software for Java. This
9894package contains utilities and extensions related to handling streams and files.")))
9895
9896(define-public java-ops4j-base-util
9897 (package
9898 (inherit java-ops4j-base-lang)
9899 (name "java-ops4j-base-util")
9900 (arguments
9901 `(#:jar-name "java-ops4j-base-util.jar"
9902 #:source-dir "ops4j-base-util/src/main/java"
9903 #:test-dir "ops4j-base-util/src/test"))
9904 (inputs
9905 `(("lang" ,java-ops4j-base-lang)))
9906 (native-inputs
9907 `(("junit" ,java-junit)))
9908 (description "OPS4J stands for Open Participation Software for Java. This
9909package contains utilities and extensions related to environment, i18n and
9910mime types.")))
9911
9912(define-public java-ops4j-base-util-property
9913 (package
9914 (inherit java-ops4j-base-lang)
9915 (name "java-ops4j-base-util-property")
9916 (arguments
9917 `(#:jar-name "java-ops4j-base-util-property.jar"
9918 #:source-dir "ops4j-base-util-property/src/main/java"
9919 #:tests? #f)); no tests
9920 (inputs
9921 `(("lang" ,java-ops4j-base-lang)
9922 ("util" ,java-ops4j-base-util)))
9923 (description "OPS4J stands for Open Participation Software for Java. This
9924package contains utilities and extensions related to resolving properties from
9925different sources.")))
9926
9927(define-public java-ops4j-base-store
9928 (package
9929 (inherit java-ops4j-base-lang)
9930 (name "java-ops4j-base-store")
9931 (arguments
9932 `(#:jar-name "java-ops4j-base-store.jar"
9933 #:source-dir "ops4j-base-store/src/main/java"
9934 #:tests? #f)); no tests
9935 (inputs
9936 `(("lang" ,java-ops4j-base-lang)
9937 ("slf4j" ,java-slf4j-api)
9938 ("io" ,java-ops4j-base-io)))
9939 (description "OPS4J stands for Open Participation Software for Java. This
9940package contains utilities for storing and retrieving data from an
9941@code{InputStream}.")))
9942
9943(define-public java-ops4j-base-spi
9944 (package
9945 (inherit java-ops4j-base-lang)
9946 (name "java-ops4j-base-spi")
9947 (arguments
9948 `(#:jar-name "java-ops4j-base-spi.jar"
9949 #:source-dir "ops4j-base-spi/src/main/java"
9950 #:test-dir "ops4j-base-spi/src/test"))
9951 (native-inputs
9952 `(("junit" ,java-junit)
9953 ("hamcrest" ,java-hamcrest-core)))
9954 (description "OPS4J stands for Open Participation Software for Java. This
9955package contains utilities for obtaining services via the Java SE 6
9956@code{ServiceLoader}.")))
9957
9958(define-public java-aqute-bnd-annotation
9959 (package
9960 (name "java-aqute-bnd-annotation")
9961 (version "3.5.0")
9962 (source (origin
9963 (method url-fetch)
9964 (uri (string-append "https://github.com/bndtools/bnd/archive/"
9965 version ".REL.tar.gz"))
9966 (file-name (string-append name "-" version ".tar.gz"))
9967 (sha256
9968 (base32
9969 "1ggyiq0as0f6cz333a0dh98j72kmvv5pf2s47v9554yh905lfqdl"))))
9970 (build-system ant-build-system)
9971 (arguments
9972 `(#:jar-name "java-aqute-bnd-annotation.jar"
9973 #:source-dir "biz.aQute.bnd.annotation/src"
9974 #:tests? #f)); empty test dir
9975 (home-page "https://bnd.bndtools.org/")
9976 (synopsis "Tools for OSGi")
9977 (description "Bnd is a swiss army knife for OSGi, it creates manifest
9978headers based on analyzing the class code, it verifies the project settings,
9979it manages project dependencies, gives diffs jars, and much more.")
9980 (license license:asl2.0)))
9981
9982(define-public java-aqute-libg
9983 (package
9984 (inherit java-aqute-bnd-annotation)
9985 (name "java-aqute-libg")
9986 (arguments
9987 `(#:jar-name "java-aqute-libg.jar"
9988 ;; The build fails when source/target more recent than 1.7. This
9989 ;; is a known issue. See: https://github.com/bndtools/bnd/issues/1327
9990 ;;
9991 ;; It is closed as won't fix. There is no way to change the source
9992 ;; so that it works on 1.8, and still works on 1.6, the upstream
9993 ;; target. It work fine on 1.7, so we use 1.7.
9994 #:make-flags (list "-Dant.build.javac.source=1.7"
9995 "-Dant.build.javac.target=1.7")
9996 #:phases
9997 (modify-phases %standard-phases
9998 (add-before 'configure 'chdir
9999 ;; Change to aQute.libg directory, so that the relative
10000 ;; paths in the tests aren't broken.
10001 (lambda _
10002 (chdir "aQute.libg")
10003 #t))
10004 (add-before 'check 'create-test-directory
10005 ;; Copy the test directory to test/java, since that's where
10006 ;; ant-build-system's default project in build.xml expects to find
10007 ;; the test classes. Leave a copy in the original place to not
10008 ;; break paths in tests.
10009 (lambda _
10010 (mkdir "src/test")
10011 (copy-recursively "test" "src/test/java")
10012 #t)))))
10013 (inputs
10014 `(("slf4j" ,java-slf4j-api)
10015 ("osgi-annot" ,java-osgi-annotation)
10016 ("java-osgi-cmpn" ,java-osgi-cmpn)
10017 ("osgi" ,java-osgi-core)))
10018 (native-inputs
10019 `(("hamcrest" ,java-hamcrest-core)
10020 ("java-junit" ,java-junit)))))
10021
10022(define-public java-aqute-bndlib
10023 (package
10024 (inherit java-aqute-bnd-annotation)
10025 (name "java-aqute-bndlib")
10026 (arguments
10027 `(#:jar-name "java-bndlib.jar"
10028 #:source-dir "biz.aQute.bndlib/src"
10029 #:tests? #f)); no tests
10030 (inputs
10031 `(("slf4j" ,java-slf4j-api)
10032 ("osgi-annot" ,java-osgi-annotation)
10033 ("java-aqute-libg" ,java-aqute-libg)
10034 ("java-aqute-bnd-annotation" ,java-aqute-bnd-annotation)
10035 ("java-osgi-service-component-annotations" ,java-osgi-service-component-annotations)
10036 ("java-osgi-service-repository" ,java-osgi-service-repository)
10037 ("java-osgi-service-log" ,java-osgi-service-log)
10038 ("java-osgi-service-metatype-annotations" ,java-osgi-service-metatype-annotations)
10039 ("java-osgi-namespace-contract" ,java-osgi-namespace-contract)
10040 ("java-osgi-namespace-extender" ,java-osgi-namespace-extender)
10041 ("java-osgi-namespace-service" ,java-osgi-namespace-service)
10042 ("promise" ,java-osgi-util-promise)
10043 ("osgi" ,java-osgi-core)))))
10044
10045(define-public java-ops4j-pax-tinybundles
10046 (package
10047 (name "java-ops4j-pax-tinybundles")
10048 (version "2.1.1")
10049 (source (origin
10050 (method url-fetch)
10051 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.tinybundles/"
10052 "archive/tinybundles-" version ".tar.gz"))
10053 (sha256
10054 (base32
10055 "0y0gq3pvv0iir2b885lmlwnvr724vv7vklzhhr4fs27d7mdkj871"))))
10056 (arguments
10057 `(#:jar-name "java-ops4j-pax-tinybundles.jar"
10058 #:source-dir "src/main/java"
10059 #:test-exclude
10060 ;; Abstract base classes for other tests
10061 (list "**/BndTest.java" "**/CoreTest.java")
10062 #:phases
10063 (modify-phases %standard-phases
10064 (add-before 'check 'fix-version
10065 (lambda _
10066 ;; This test has a reference to an old version of bndlib we are not
10067 ;; packaging. It uses the version referenced in pom.xml. We replace
10068 ;; it with our own version.
10069 (substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
10070 (("[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*")
10071 ,(package-version java-aqute-bndlib)))
10072 #t)))))
10073 (inputs
10074 `(("lang" ,java-ops4j-base-lang)
10075 ("io" ,java-ops4j-base-io)
10076 ("store" ,java-ops4j-base-store)
10077 ("slf4j" ,java-slf4j-api)
10078 ("libg" ,java-aqute-libg)
10079 ("bndlib" ,java-aqute-bndlib)))
10080 (native-inputs
10081 `(("junit" ,java-junit)
10082 ("hamcrest" ,java-hamcrest-core)
10083 ("log4j" ,java-log4j-api)
10084 ("bndannotation" ,java-aqute-bnd-annotation)
10085 ("framework" ,java-osgi-framework)))
10086 (build-system ant-build-system)
10087 (home-page "https://ops4j1.jira.com/wiki/spaces/ops4j/pages/12060312/Tinybundles")
10088 (synopsis "Java APIs to create OSGi related artifacts")
10089 (description "Tinybundles is all about creating OSGi related artifacts like
10090Bundles, Fragments and Deployment Packages with Java Api. It is very convenient
10091to create such artifacts on-the-fly inside Tests (like in Pax Exam). On the
10092other hand, this library can be a foundation of real end user tools that need
10093to create those artifacts.")
10094 (license license:asl2.0)))
10095
10096(define-public java-ops4j-pax-exam-core
10097 (package
10098 (name "java-ops4j-pax-exam-core")
10099 (version "4.11.0")
10100 (source (origin
10101 (method url-fetch)
10102 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.exam2/"
10103 "archive/exam-reactor-" version ".tar.gz"))
10104 (sha256
10105 (base32
10106 "1b0f89gawxyl0pkqx9sicp6n58pirkzhjw41y749bwrkb6h99i26"))))
10107 (arguments
10108 (list #:jar-name "java-ops4j-pax-exam-core.jar"
10109 #:source-dir "core/pax-exam/src/main/java"
10110 #:test-dir "core/pax-exam/src/test"))
10111 (inputs
10112 (list java-slf4j-api
10113 java-ops4j-base-lang
10114 java-ops4j-base-io
10115 java-ops4j-base-util-property
10116 java-ops4j-base-store
10117 java-osgi-core))
10118 (native-inputs
10119 (list java-junit
10120 java-hamcrest-core))
10121 (build-system ant-build-system)
10122 (home-page "https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/overview")
10123 (synopsis "In-Container Testing for OSGi, Java EE and CDI")
10124 (description "Pax Exam creates OSGi bundles for testing purposes. It lets
10125the user take control of the OSGi framework, the test framework (e.g. JUnit) and
10126the system under test at the same time.")
10127 (license license:asl2.0)))
10128
10129(define-public java-ops4j-pax-exam-core-spi
10130 (package
10131 (inherit java-ops4j-pax-exam-core)
10132 (name "java-ops4j-pax-exam-core-spi")
10133 (arguments
10134 `(#:jar-name "java-ops4j-pax-exam-spi.jar"
10135 #:source-dir "src/main/java"
10136 #:test-exclude
10137 (list
10138 ;; Abstract base class, not a test
10139 "**/BaseStagedReactorTest.java"
10140 ;; Depends on org.mortbay.jetty.testwars:test-war-dump
10141 "**/WarBuilderTest.java")
10142 #:phases
10143 (modify-phases %standard-phases
10144 (add-before 'configure 'chdir
10145 (lambda _
10146 ;; Tests assume we are in this directory
10147 (chdir "core/pax-exam-spi")
10148 #t))
10149 (add-before 'check 'fix-tests
10150 (lambda _
10151 ;; One test checks that this file is present.
10152 (mkdir-p "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi")
10153 (with-output-to-file
10154 "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi/pom.properties"
10155 (lambda _
10156 (display
10157 (string-append "artifactId = pax-exam-spi\n"
10158 "version = " ,(package-version java-ops4j-pax-exam-core-spi)))))
10159 ;; Maven puts compilation results in the target directory, while we
10160 ;; put them in the build directory.
10161 (substitute* '("src/test/java/org/ops4j/pax/exam/spi/war/WarBuilderTest.java"
10162 "src/test/java/org/ops4j/pax/exam/spi/war/WarTestProbeBuilderTest.java"
10163 "src/test/java/org/ops4j/pax/exam/spi/war/ZipBuilderTest.java")
10164 (("target") "build"))
10165 ;; One test is expected to fail, but it doesn't throw the expected exception
10166 (substitute* "src/test/java/org/ops4j/pax/exam/spi/reactors/BaseStagedReactorTest.java"
10167 (("AssertionError") "IllegalArgumentException"))
10168 #t)))))
10169 (inputs
10170 `(("java-ops4j-pax-exam-core" ,java-ops4j-pax-exam-core)
10171 ("lang" ,java-ops4j-base-lang)
10172 ("monitors" ,java-ops4j-base-monitors)
10173 ("store" ,java-ops4j-base-store)
10174 ("io" ,java-ops4j-base-io)
10175 ("spi" ,java-ops4j-base-spi)
10176 ("osgi" ,java-osgi-core)
10177 ("slf4j" ,java-slf4j-api)
10178 ("tinybundles" ,java-ops4j-pax-tinybundles)))
10179 (native-inputs
10180 `(("mockito" ,java-mockito-1)
10181 ("junit" ,java-junit)
10182 ("hamcrest" ,java-hamcrest-core)
10183 ("cglib" ,java-cglib)
10184 ("objenesis" ,java-objenesis)))))
10185
10186(define-public java-ops4j-pax-exam-core-junit
10187 (package
10188 (inherit java-ops4j-pax-exam-core)
10189 (name "java-ops4j-pax-exam-core-junit")
10190 (arguments
10191 `(#:jar-name "ops4j-pax-exam-core-junit.jar"
10192 #:source-dir "drivers/pax-exam-junit4/src/main/java"
10193 #:tests? #f)); no tests
10194 (inputs
10195 `(("junit" ,java-junit)
10196 ("slf4j" ,java-slf4j-api)
10197 ("core" ,java-ops4j-pax-exam-core)
10198 ("spi" ,java-ops4j-pax-exam-core-spi)))
10199 (native-inputs '())))
10200
10201(define-public java-fasterxml-jackson-annotations
10202 (package
10203 (name "java-fasterxml-jackson-annotations")
10204 (version "2.9.4")
10205 (source (origin
10206 (method url-fetch)
10207 (uri (string-append "https://github.com/FasterXML/"
10208 "jackson-annotations/archive/"
10209 "jackson-annotations-" version ".tar.gz"))
10210 (sha256
10211 (base32
10212 "0mr95xd0da6a4g95zvrl1ryk5n5zv2rc696w3xnsr5hxk2gicfc4"))))
10213 (build-system ant-build-system)
10214 (arguments
10215 `(#:jar-name "jackson-annotations.jar"
10216 #:source-dir "src/main/java"
10217 #:test-dir "src/test"))
10218 (native-inputs
10219 `(("junit" ,java-junit)))
10220 (home-page "https://github.com/FasterXML/jackson-annotations")
10221 (synopsis "General purpose annotations for the Jackson Data Processor")
10222 (description "This package contains general purpose annotations for the
10223Jackson Data Processor, used on value and handler types. The only annotations
10224not included are ones that require dependency to the Databind package.")
10225 (license license:asl2.0)))
10226
10227(define-public java-fasterxml-jackson-core
10228 (package
10229 (name "java-fasterxml-jackson-core")
10230 (version "2.9.4")
10231 (source (origin
10232 (method url-fetch)
10233 (uri (string-append "https://github.com/FasterXML/"
10234 "jackson-core/archive/"
10235 "jackson-core-" version ".tar.gz"))
10236 (sha256
10237 (base32
10238 "159hsnk17jr1gyzkf01cxvsn45srnk37g949r7364qlsr527gjgd"))))
10239 (build-system ant-build-system)
10240 (arguments
10241 `(#:jar-name "jackson-core.jar"
10242 #:source-dir "src/main/java"
10243 #:test-dir "src/test"
10244 #:test-exclude
10245 (list
10246 ;; Expected failure. pom.xml excludes these
10247 "**/failing/**"
10248 ;; Base classes that have no constructor for junit
10249 "**/BaseTest.java"
10250 "**/ConcurrencyReadTest.java"
10251 "**/ManualCharAccessTest.java"
10252 "**/ManualCharAccessTest.java"
10253 "**/TrailingCommasTest.java"
10254 "**/AsyncMissingValuesInObjectTest.java"
10255 "**/AsyncMissingValuesInArrayTest.java")
10256 #:phases
10257 (modify-phases %standard-phases
10258 (add-before 'configure 'generate-PackageVersion.java
10259 (lambda _
10260 (let* ((out "src/main/java/com/fasterxml/jackson/core/json/PackageVersion.java")
10261 (in (string-append out ".in")))
10262 (copy-file in out)
10263 (substitute* out
10264 (("@package@") "com.fasterxml.jackson.core.json")
10265 (("@projectversion@") ,version)
10266 (("@projectgroupid@") "com.fasterxml.jackson.core")
10267 (("@projectartifactid@") "jackson-core")))
10268 #t))
10269 (add-before 'build 'copy-resources
10270 (lambda _
10271 (copy-recursively "src/main/resources"
10272 "build/classes")
10273 #t))
10274 (add-before 'check 'copy-test-resources
10275 (lambda _
10276 (copy-recursively "src/test/resources"
10277 "build/test-classes")
10278 #t)))))
10279 (native-inputs
10280 `(("junit" ,java-junit)
10281 ("hamcrest" ,java-hamcrest-core)))
10282 (home-page "https://github.com/FasterXML/jackson-core")
10283 (synopsis "Low-level streaming parser and generator abstractions")
10284 (description "This package contains core low-level incremental
10285(streaming) parser and generator abstractions used by the Jackson Data
10286Processor. It also includes the default implementation of handler types
10287(parser, generator) that handle JSON format.")
10288 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10289
10290(define-public java-fasterxml-jackson-databind
10291 (package
10292 (name "java-fasterxml-jackson-databind")
10293 (version "2.9.4")
10294 (source (origin
10295 (method url-fetch)
10296 (uri (string-append "https://github.com/FasterXML/"
10297 "jackson-databind/archive/"
10298 "jackson-databind-" version ".tar.gz"))
10299 (sha256
10300 (base32
10301 "1zd2cw4z6kdkbx8za96xh9pyicv2a2l7y0rkcx2fqd8hv6d47s08"))))
10302 (build-system ant-build-system)
10303 (arguments
10304 `(#:jar-name "jackson-databind.jar"
10305 #:source-dir "src/main/java"
10306 #:tests? #f; requires javax.measures for which I can't find a free implementation
10307 #:phases
10308 (modify-phases %standard-phases
10309 (add-before 'configure 'generate-PackageVersion.java
10310 (lambda _
10311 (let* ((out "src/main/java/com/fasterxml/jackson/databind/cfg/PackageVersion.java")
10312 (in (string-append out ".in")))
10313 (copy-file in out)
10314 (substitute* out
10315 (("@package@") "com.fasterxml.jackson.databind.cfg")
10316 (("@projectversion@") ,version)
10317 (("@projectgroupid@") "com.fasterxml.jackson.databind")
10318 (("@projectartifactid@") "jackson-databind")))
10319 #t))
10320 (add-before 'build 'copy-resources
10321 (lambda _
10322 (copy-recursively "src/main/resources" "build/classes")
10323 #t)))))
10324 (inputs
10325 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core))
10326 (home-page "https://github.com/FasterXML/jackson-databind")
10327 (synopsis "Data-binding functionality and tree-model for the Jackson Data Processor")
10328 (description "This package contains the general-purpose data-binding
10329functionality and tree-model for Jackson Data Processor. It builds on core
10330streaming parser/generator package, and uses Jackson Annotations for
10331configuration.")
10332 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10333
10334(define-public java-fasterxml-jackson-modules-base-jaxb
10335 (package
10336 (name "java-fasterxml-jackson-modules-base-jaxb")
10337 (version "2.9.4")
10338 (source (origin
10339 (method url-fetch)
10340 (uri (string-append "https://github.com/FasterXML/"
10341 "jackson-modules-base/archive/"
10342 "jackson-modules-base-" version ".tar.gz"))
10343 (sha256
10344 (base32
10345 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
10346 (build-system ant-build-system)
10347 (arguments
10348 `(#:jar-name "jackson-modules-base-jaxb.jar"
10349 #:source-dir "jaxb/src/main/java"
10350 #:test-dir "jaxb/src/test"
10351 #:test-exclude
10352 ;; Base class for tests
10353 (list "**/BaseJaxbTest.java")
10354 #:phases
10355 (modify-phases %standard-phases
10356 (add-before 'configure 'generate-PackageVersion.java
10357 (lambda _
10358 (let* ((out (string-append "jaxb/src/main/java/com/fasterxml/"
10359 "jackson/module/jaxb/PackageVersion.java"))
10360 (in (string-append out ".in")))
10361 (copy-file in out)
10362 (substitute* out
10363 (("@package@") "com.fasterxml.jackson.module.jaxb")
10364 (("@projectversion@") ,version)
10365 (("@projectgroupid@") "com.fasterxml.jackson.module.jaxb")
10366 (("@projectartifactid@") "jackson-module-jaxb")))
10367 #t))
10368 (add-before 'build 'copy-resources
10369 (lambda _
10370 (copy-recursively "jaxb/src/main/resources" "build/classes")
10371 #t)))))
10372 (inputs
10373 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core
10374 java-fasterxml-jackson-databind))
10375 (native-inputs
10376 (list java-junit))
10377 (home-page "https://github.com/FasterXML/jackson-modules-base")
10378 (synopsis "Jaxb annotations jackson module")
10379 (description "This package is the jaxb annotations module for jackson.")
10380 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10381
10382(define-public java-fasterxml-jackson-modules-base-mrbean
10383 (package
10384 (name "java-fasterxml-jackson-modules-base-mrbean")
10385 (version "2.9.4")
10386 (source (origin
10387 (method url-fetch)
10388 (uri (string-append "https://github.com/FasterXML/"
10389 "jackson-modules-base/archive/"
10390 "jackson-modules-base-" version ".tar.gz"))
10391 (sha256
10392 (base32
10393 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
10394 (build-system ant-build-system)
10395 (arguments
10396 `(#:jar-name "jackson-modules-base-mrbean.jar"
10397 #:source-dir "mrbean/src/main/java"
10398 #:test-dir "mrbean/src/test"
10399 #:test-exclude
10400 ;; Base class for tests
10401 (list "**/BaseTest.java")
10402 #:phases
10403 (modify-phases %standard-phases
10404 (add-before 'configure 'generate-PackageVersion.java
10405 (lambda _
10406 (let* ((out (string-append "mrbean/src/main/java/com/fasterxml/"
10407 "jackson/module/mrbean/PackageVersion.java"))
10408 (in (string-append out ".in")))
10409 (copy-file in out)
10410 (substitute* out
10411 (("@package@") "com.fasterxml.jackson.module.mrbean")
10412 (("@projectversion@") ,version)
10413 (("@projectgroupid@") "com.fasterxml.jackson.module.mrbean")
10414 (("@projectartifactid@") "jackson-module-mrbean")))
10415 #t)))))
10416 (inputs
10417 (list java-asm java-fasterxml-jackson-annotations
10418 java-fasterxml-jackson-core java-fasterxml-jackson-databind))
10419 (native-inputs
10420 (list java-junit))
10421 (home-page "https://github.com/FasterXML/jackson-modules-base")
10422 (synopsis "POJO type materialization for Java")
10423 (description "This package implements POJO type materialization.
10424Databinders can construct implementation classes for Java interfaces as part
10425of deserialization.")
10426 (license license:asl2.0)))
10427
10428(define-public java-snakeyaml
10429 (package
10430 (name "java-snakeyaml")
10431 (version "1.18")
10432 (source (origin
10433 (method url-fetch)
10434 (uri (string-append "https://bitbucket.org/asomov/snakeyaml/get/v"
10435 version ".tar.gz"))
10436 (file-name (string-append name "-" version ".tar.gz"))
10437 (sha256
10438 (base32
10439 "0474cqcv46zgv9bhms2vgawakq1vyj0hp3h3f1bfys46msia90bh"))))
10440 (build-system ant-build-system)
10441 (arguments
10442 `(#:jar-name "java-snakeyaml.jar"
10443 #:source-dir "src/main/java"
10444 ;; Tests require velocity, a cyclic dependency, and
10445 ;; java-spring-framework-context which is not packaged.
10446 #:tests? #f))
10447 (home-page "https://bitbucket.org/asomov/snakeyaml")
10448 (synopsis "YAML processor")
10449 (description "SnakeYAML is a YAML processor for the Java Virtual Machine.")
10450 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10451
10452(define-public java-fasterxml-jackson-dataformat-yaml
10453 (package
10454 (name "java-fasterxml-jackson-dataformat-yaml")
10455 (version "2.9.4")
10456 (source (origin
10457 (method url-fetch)
10458 (uri (string-append "https://github.com/FasterXML/"
10459 "jackson-dataformats-text/archive/"
10460 "jackson-dataformats-text-" version ".tar.gz"))
10461 (sha256
10462 (base32
10463 "1hikl06khaxbg439avf442qifcadap8w0lx13f0nnhp2vh3dkbz7"))))
10464 (build-system ant-build-system)
10465 (arguments
10466 `(#:jar-name "jackson-dataformat-yaml.jar"
10467 #:source-dir "yaml/src/main/java"
10468 #:test-dir "yaml/src/test"
10469 #:test-exclude (list "**/failing/**.java")
10470 #:phases
10471 (modify-phases %standard-phases
10472 (add-before 'configure 'generate-PackageVersion.java
10473 (lambda _
10474 (let* ((out "yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/PackageVersion.java")
10475 (in (string-append out ".in")))
10476 (copy-file in out)
10477 (substitute* out
10478 (("@package@") "com.fasterxml.jackson.dataformat.yaml")
10479 (("@projectversion@") ,version)
10480 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.yaml")
10481 (("@projectartifactid@") "jackson-dataformat-yaml")))
10482 #t)))))
10483 (inputs
10484 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core
10485 java-fasterxml-jackson-databind java-snakeyaml))
10486 (native-inputs
10487 `(("junit" ,java-junit)
10488 ("hamcrest" ,java-hamcrest-core)
10489 ("java-ops4j-pax-exam-core-spi" ,java-ops4j-pax-exam-core-spi)
10490 ("java-ops4j-pax-exam-core-junit" ,java-ops4j-pax-exam-core-junit)
10491 ("java-ops4j-pax-exam" ,java-ops4j-pax-exam-core)))
10492 (home-page "https://github.com/FasterXML/jackson-dataformats-text")
10493 (synopsis "Yaml backend for Jackson")
10494 (description "Dataformat backends are used to support format alternatives
10495to JSON, supported by default. This is done by sub-classing Jackson core
10496abstractions.")
10497 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10498
10499(define-public java-stax2-api
10500 (package
10501 (name "java-stax2-api")
10502 (version "4.0.0")
10503 (source (origin
10504 (method url-fetch)
10505 (uri (string-append "https://github.com/FasterXML/stax2-api/archive/"
10506 "stax2-api-" version ".tar.gz"))
10507 (sha256
10508 (base32
10509 "1amc1si0l0hyyw2sawmnzy4hkna3z6fp195y4nm5m9wb9ld5awkq"))))
10510 (build-system ant-build-system)
10511 (arguments
10512 `(#:jar-name "java-stax2-api.jar"
10513 #:source-dir "src/main/java"
10514 #:tests? #f)); no tests
10515 (home-page "https://github.com/FasterXML/stax2-api")
10516 (synopsis "Stax2 API")
10517 (description "Stax2 API is an extension to basic Stax 1.0 API that adds
10518significant new functionalities, such as full-featured bi-direction validation
10519interface and high-performance Typed Access API.")
10520 (license license:bsd-2)))
10521
10522(define-public java-woodstox-core
10523 (package
10524 (name "java-woodstox-core")
10525 (version "5.0.3")
10526 (source (origin
10527 (method git-fetch)
10528 (uri (git-reference
10529 (url "https://github.com/FasterXML/woodstox")
10530 (commit (string-append "woodstox-core-" version))))
10531 (file-name (git-file-name name version))
10532 (sha256
10533 (base32
10534 "0bfylk24a967hwxprxqbg6cdvm6n4ldcarp54yg980viwvjiglyp"))))
10535 (build-system ant-build-system)
10536 (arguments
10537 `(#:jar-name "woodstox.jar"
10538 #:test-exclude
10539 (list "**/Base*.java" "failing/**")
10540 #:phases
10541 (modify-phases %standard-phases
10542 (add-before 'build 'remove-msv-dep
10543 (lambda _
10544 ;; we don't need osgi, and it depends on msv
10545 (delete-file-recursively "src/main/java/com/ctc/wstx/osgi")
10546 ;; msv's latest release is from 2011 and we don't need it
10547 (delete-file-recursively "src/main/java/com/ctc/wstx/msv")
10548 (delete-file-recursively "src/test/java/wstxtest/osgi")
10549 (delete-file-recursively "src/test/java/wstxtest/msv")
10550 #t))
10551 (add-before 'build 'copy-resources
10552 (lambda _
10553 (copy-recursively "src/main/resources" "build/classes")
10554 #t)))))
10555 (inputs
10556 `(("stax2" ,java-stax2-api)))
10557 (native-inputs
10558 `(("junit" ,java-junit)))
10559 (home-page "https://github.com/FasterXML/woodstox")
10560 (synopsis "Stax XML API implementation")
10561 (description "Woodstox is a stax XML API implementation.")
10562 (license license:asl2.0)))
10563
10564(define-public java-fasterxml-jackson-dataformat-xml
10565 (package
10566 (name "java-fasterxml-jackson-dataformat-xml")
10567 (version "2.9.4")
10568 (source (origin
10569 (method git-fetch)
10570 (uri (git-reference
10571 (url "https://github.com/FasterXML/jackson-dataformat-xml")
10572 (commit (string-append "jackson-dataformat-xml-" version))))
10573 (file-name (git-file-name name version))
10574 (sha256
10575 (base32
10576 "0s1wl65mbs57c2hz2v8rnh8i04y5lpyyvnjz562j5j6b83vwwpfx"))))
10577 (build-system ant-build-system)
10578 (arguments
10579 `(#:jar-name "jackson-dataformat-xml.jar"
10580 #:source-dir "src/main/java"
10581 #:test-exclude
10582 (list "**/failing/**")
10583 #:phases
10584 (modify-phases %standard-phases
10585 (add-before 'configure 'generate-PackageVersion.java
10586 (lambda _
10587 (let* ((out "src/main/java/com/fasterxml/jackson/dataformat/xml/PackageVersion.java")
10588 (in (string-append out ".in")))
10589 (copy-file in out)
10590 (newline)
10591 (substitute* out
10592 (("@package@") "com.fasterxml.jackson.dataformat.xml")
10593 (("@projectversion@") ,version)
10594 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.xml")
10595 (("@projectartifactid@") "jackson-dataformat-xml")))
10596 #t))
10597 (add-before 'build 'copy-resources
10598 (lambda _
10599 (copy-recursively "src/main/resources" "build/classes")
10600 #t)))))
10601 (inputs
10602 `(("jackson-annotations" ,java-fasterxml-jackson-annotations)
10603 ("jackson-core" ,java-fasterxml-jackson-core)
10604 ("jackson-modules-base-jaxb" ,java-fasterxml-jackson-modules-base-jaxb)
10605 ("jackson-databind" ,java-fasterxml-jackson-databind)
10606 ("stax2-api" ,java-stax2-api)
10607 ("woodstox" ,java-woodstox-core)))
10608 (native-inputs
10609 `(("junit" ,java-junit)
10610 ("hamcrest" ,java-hamcrest-core)))
10611 (home-page "https://github.com/FasterXML/jackson-dataformat-xml")
10612 (synopsis "Read and write XML")
10613 (description "This package contains Jackson extension component for reading
10614and writing XML encoded data.
10615
10616Further, the goal is to emulate how JAXB data-binding works with \"Code-first\"
10617approach (that is, no support is added for \"Schema-first\" approach). Support
10618for JAXB annotations is provided by JAXB annotation module; this module
10619provides low-level abstractions (@code{JsonParser}, @code{JsonGenerator},
10620@code{JsonFactory}) as well as small number of higher level overrides needed to
10621make data-binding work.")
10622 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10623
10624(define-public java-hdrhistogram
10625 (package
10626 (name "java-hdrhistogram")
10627 (version "2.1.9")
10628 (source (origin
10629 (method git-fetch)
10630 (uri (git-reference
10631 (url "https://github.com/HdrHistogram/HdrHistogram")
10632 (commit (string-append "HdrHistogram-" version))))
10633 (file-name (git-file-name name version))
10634 (sha256
10635 (base32
10636 "1cw8aa1vk258k42xs6wpy72m4gbai540jq032qsa7c5586iawx2d"))))
10637 (build-system ant-build-system)
10638 (arguments
10639 `(#:jar-name "java-hdrhistogram.jar"
10640 #:source-dir "src/main/java"
10641 #:phases
10642 (modify-phases %standard-phases
10643 (add-after 'unpack 'make-files-writable
10644 (lambda _
10645 (for-each make-file-writable (find-files "."))
10646 #t))
10647 (add-before 'configure 'set-version
10648 (lambda _
10649 (let* ((version-java "src/main/java/org/HdrHistogram/Version.java")
10650 (template (string-append version-java ".template")))
10651 (copy-file template version-java)
10652 (substitute* version-java
10653 (("\\$VERSION\\$") ,version)
10654 (("\\$BUILD_TIME\\$") "0"))
10655 #t))))))
10656 (native-inputs
10657 `(("junit" ,java-junit)
10658 ("hamcrest" ,java-hamcrest-core)))
10659 (home-page "https://hdrhistogram.github.io/HdrHistogram")
10660 (synopsis "High dynamic range histogram")
10661 (description "Hdrhistogram creates histograms that support
10662recording and analyzing sampled data value counts across a configurable integer
10663value range with configurable value precision within the range. Value precision
10664is expressed as the number of significant digits in the value recording, and
10665provides control over value quantization behavior across the value range and
10666the subsequent value resolution at any given level.")
10667 (license license:public-domain)))
10668
10669(define-public java-cofoja
10670 (package
10671 (name "java-cofoja")
10672 (version "1.3")
10673 (source (origin
10674 (method git-fetch)
10675 (uri (git-reference
10676 (url "https://github.com/nhatminhle/cofoja")
10677 (commit (string-append "v" version))))
10678 (file-name (string-append "java-cofoja-" version "-checkout"))
10679 (sha256
10680 (base32
10681 "0p7sz8y5xgpi5rx1qwn6587fkd52qr3ha3ybh14gqcyxhikl525w"))))
10682 (build-system ant-build-system)
10683 (arguments
10684 `(#:build-target "dist"
10685 #:test-target "test"
10686 #:jdk ,icedtea-8
10687 #:make-flags
10688 (list "-Ddist.dir=dist")
10689 #:modules ((guix build ant-build-system)
10690 (guix build java-utils)
10691 (guix build utils)
10692 (srfi srfi-1)
10693 (ice-9 match))
10694 #:phases
10695 (modify-phases %standard-phases
10696 ;; The bulid system ignores the class path the ant-build-system sets
10697 ;; up and instead expects to find all dependencies in the "lib"
10698 ;; directory.
10699 (add-after 'unpack 'create-libdir
10700 (lambda* (#:key inputs #:allow-other-keys)
10701 (mkdir-p "lib")
10702 (for-each
10703 (lambda (file)
10704 (let ((target (string-append "lib/" (basename file))))
10705 (unless (file-exists? target)
10706 (symlink file target))))
10707 (append-map (match-lambda
10708 ((label . dir)
10709 (find-files dir "\\.jar$")))
10710 inputs))
10711 #t))
10712 (replace 'install (install-jars "dist")))))
10713 (inputs
10714 (list java-asm))
10715 (native-inputs
10716 (list java-junit))
10717 (home-page "https://github.com/nhatminhle/cofoja")
10718 (synopsis "Contracts for Java")
10719 (description "Contracts for Java, or Cofoja for short, is a contract
10720programming framework and test tool for Java, which uses annotation processing
10721and bytecode instrumentation to provide run-time checking. (In particular,
10722this is not a static analysis tool.)")
10723 (license license:lgpl3+)))
10724
10725(define-public java-aopalliance
10726 (package
10727 (name "java-aopalliance")
10728 (version "1.0")
10729 (source (origin
10730 (method git-fetch)
10731 ;; Note: this git repository is not official, but contains the
10732 ;; source code that is in the CVS repository. Downloading the
10733 ;; tarball from sourceforge is undeterministic, and the cvs download
10734 ;; fails.
10735 (uri (git-reference
10736 (url "https://github.com/hoverruan/aopalliance")
10737 (commit "0d7757ae204e5876f69431421fe9bc2a4f01e8a0")))
10738 (file-name (string-append name "-" version))
10739 (sha256
10740 (base32
10741 "0rsg2b0v3hxlq2yk1i3m2gw3xwq689j3cwx9wbxvqfpdcjbca0qr"))))
10742 (build-system ant-build-system)
10743 (arguments
10744 `(#:jar-name "java-aopalliance.jar"
10745 #:jdk ,icedtea-8
10746 #:tests? #f; no tests
10747 #:source-dir "aopalliance/src/main"
10748 #:phases
10749 (modify-phases %standard-phases
10750 (add-before 'install 'create-pom
10751 (generate-pom.xml "pom.xml" "aopalliance" "aopalliance" ,version))
10752 (replace 'install
10753 (install-from-pom "pom.xml")))))
10754 (home-page "https://aopalliance.sourceforge.net")
10755 (synopsis "Aspect-Oriented Programming")
10756 (description "The AOP Alliance project is a joint project between several
10757software engineering people who are interested in Aspect-Oriented Programming
10758(AOP) and Java.")
10759 (license license:public-domain)))
10760
10761(define-public java-javax-inject
10762 (package
10763 (name "java-javax-inject")
10764 (version "1")
10765 (source (origin
10766 (method git-fetch)
10767 (uri (git-reference
10768 (url "https://github.com/javax-inject/javax-inject")
10769 (commit version)))
10770 (file-name (git-file-name name version))
10771 (sha256
10772 (base32
10773 "1rspl0nkvk1jif6nccikw93xic6ljj2b6kpy2mffwi2mnvc13j7x"))))
10774 (build-system ant-build-system)
10775 (arguments
10776 `(#:jar-name "java-javax-inject.jar"
10777 #:tests? #f; no tests
10778 #:phases
10779 (modify-phases %standard-phases
10780 (replace 'install
10781 (install-from-pom "pom.xml")))))
10782 (home-page "https://github.com/javax-inject/javax-inject")
10783 (synopsis "JSR-330: Dependency Injection for Java")
10784 (description "This package specifies a means for obtaining objects in such
10785a way as to maximize reusability, testability and maintainability compared to
10786traditional approaches such as constructors, factories, and service locators
10787(e.g., JNDI). This process, known as dependency injection, is beneficial to
10788most nontrivial applications.
10789
10790Many types depend on other types. For example, a @var{Stopwatch} might depend
10791on a @var{TimeSource}. The types on which a type depends are known as its
10792dependencies. The process of finding an instance of a dependency to use at run
10793time is known as resolving the dependency. If no such instance can be found,
10794the dependency is said to be unsatisfied, and the application is broken.")
10795 (license license:asl2.0)))
10796
10797(define-public java-guice
10798 (package
10799 (name "java-guice")
10800 (version "4.1")
10801 (source (origin
10802 (method git-fetch)
10803 (uri (git-reference
10804 (url "https://github.com/google/guice")
10805 (commit version)))
10806 (file-name (git-file-name name version))
10807 (modules '((guix build utils)))
10808 (snippet
10809 `(begin
10810 (for-each delete-file (find-files "." ".*.jar")) #t))
10811 (sha256
10812 (base32
10813 "18im5hdfl4q1b9chww2s1ii60sn3ydyyar32a2sf2p2g8zlbdswq"))))
10814 (build-system ant-build-system)
10815 (arguments
10816 `(#:jar-name "java-guice.jar"
10817 #:jdk ,icedtea-8
10818 #:tests? #f; FIXME: tests are not in a java sub directory
10819 #:source-dir "core/src"
10820 #:phases
10821 (modify-phases %standard-phases
10822 (add-after 'unpack 'make-files-writable
10823 (lambda _
10824 (for-each make-file-writable (find-files "."))
10825 #t))
10826 (replace 'install
10827 (install-from-pom "core/pom.xml")))))
10828 (propagated-inputs
10829 (list java-aopalliance
10830 java-cglib
10831 java-guava
10832 java-javax-inject
10833 java-guice-parent-pom))
10834 (home-page "https://github.com/google/guice")
10835 (synopsis "Lightweight dependency injection framework")
10836 (description "Guice is a lightweight dependency injection framework for
10837Java 6 and above.")
10838 (license license:asl2.0)))
10839
10840(define-public java-guice-servlet
10841 (package
10842 (inherit java-guice)
10843 (name "java-guice-servlet")
10844 (arguments
10845 `(#:jar-name "guice-servlet.jar"
10846 #:source-dir "extensions/servlet/src/"
10847 #:jdk ,icedtea-8
10848 #:tests? #f ; FIXME: not in a java subdir
10849 #:phases
10850 (modify-phases %standard-phases
10851 (add-after 'unpack 'make-files-writable
10852 (lambda _
10853 (for-each make-file-writable (find-files "."))
10854 #t)))))
10855 (inputs
10856 `(("guice" ,java-guice)
10857 ("servlet" ,java-classpathx-servletapi)
10858 ,@(package-inputs java-guice)))))
10859
10860(define java-guice-parent-pom
10861 (package
10862 (inherit java-guice)
10863 (name "java-guice-parent-pom")
10864 (arguments
10865 `(#:tests? #f
10866 #:phases
10867 (modify-phases %standard-phases
10868 (delete 'configure)
10869 (delete 'build)
10870 (add-after 'install 'install-extensions
10871 (install-pom-file "extensions/pom.xml"))
10872 (replace 'install
10873 (install-pom-file "pom.xml")))))
10874 (propagated-inputs
10875 `(("java-google-parent-pom" ,java-google-parent-pom-5)))))
10876
10877(define java-google-parent-pom-5
10878 (package
10879 (name "java-google-parent-pom")
10880 (version "5")
10881 (source (origin
10882 (method git-fetch)
10883 (uri (git-reference
10884 (url "https://github.com/google/google-maven-parents")
10885 (commit (string-append "google-" version))))
10886 (file-name (git-file-name name version))
10887 (sha256
10888 (base32
10889 "0zb7hx24p8k8rfdvix2vsbfqn73jhrycdndvhf8j5gbii9wbqibv"))))
10890 (build-system ant-build-system)
10891 (arguments
10892 `(#:tests? #f
10893 #:phases
10894 (modify-phases %standard-phases
10895 (delete 'configure)
10896 (delete 'build)
10897 (replace 'install
10898 (install-pom-file "pom.xml")))))
10899 (home-page "https://github.com/google/google-maven-parents")
10900 (synopsis "Google parent pom")
10901 (description "This package contains the Maven parent POM for other Google
10902Java projects.")
10903 (license license:asl2.0)))
10904
10905(define-public java-assertj
10906 (package
10907 (name "java-assertj")
10908 (version "3.8.0")
10909 (source (origin
10910 (method git-fetch)
10911 (uri (git-reference
10912 (url "https://github.com/joel-costigliola/assertj-core")
10913 (commit (string-append "assertj-core-" version))))
10914 (file-name (git-file-name name version))
10915 (sha256
10916 (base32
10917 "1k35cg2in7pzk4pbdjryr0pll5lgk1r6ngrn0j8cdlgi7w8zh2d1"))))
10918 (build-system ant-build-system)
10919 (arguments
10920 `(#:jar-name "java-assertj.jar"
10921 #:jdk ,icedtea-8
10922 #:source-dir "src/main/java"
10923 #:tests? #f)); depends on tng-junit which depends on assertj
10924 (inputs
10925 `(("cglib" ,java-cglib)
10926 ("junit" ,java-junit)
10927 ("hamcrest" ,java-hamcrest-core)))
10928 (native-inputs
10929 `(("mockito" ,java-mockito-1)))
10930 (home-page "https://joel-costigliola.github.io/assertj/index.html")
10931 (synopsis "Fluent assertions for java")
10932 (description "AssertJ core is a Java library that provides a fluent
10933interface for writing assertions. Its main goal is to improve test code
10934readability and make maintenance of tests easier.")
10935 (license license:asl2.0)))
10936
10937(define-public java-jboss-javassist
10938 (package
10939 (name "java-jboss-javassist")
10940 (version "3.21.0")
10941 (source (origin
10942 (method git-fetch)
10943 (uri (git-reference
10944 (url "https://github.com/jboss-javassist/javassist")
10945 (commit
10946 (string-append "rel_"
10947 (string-map
10948 (lambda (x) (if (eq? x #\.) #\_ x)) version)
10949 "_ga"))))
10950 (file-name (git-file-name name version))
10951 (sha256
10952 (base32
10953 "0h3zlcyqiaq01fspm69h7vki67raw305w89p4ha8vlhpzw02qifm"))
10954 (modules '((guix build utils)))
10955 (snippet
10956 '(begin
10957 (delete-file "javassist.jar")))))
10958 (build-system ant-build-system)
10959 (arguments
10960 `(#:jar-name "java-jboss-javassist.jar"
10961 #:jdk ,icedtea-8
10962 #:source-dir "src/main"
10963 #:tests? #f; FIXME: requires junit-awtui and junit-swingui from junit3
10964 #:phases
10965 (modify-phases %standard-phases
10966 (add-after 'unpack 'make-files-writable
10967 (lambda _
10968 (for-each make-file-writable (find-files "."))
10969 #t)))))
10970 (native-inputs
10971 `(("junit" ,java-junit)))
10972 (home-page "https://github.com/jboss-javassist/javassist")
10973 (synopsis "Java bytecode engineering toolkit")
10974 (description "Javassist (JAVA programming ASSISTant) makes Java bytecode
10975manipulation simple. It is a class library for editing bytecodes in Java; it
10976enables Java programs to define a new class at runtime and to modify a class
10977file when the JVM loads it.")
10978 (license (list license:gpl2 license:cddl1.0)))); either gpl2 only or cddl.
10979
10980(define-public java-jcommander
10981 (package
10982 (name "java-jcommander")
10983 (version "1.71")
10984 (source (origin
10985 (method git-fetch)
10986 (uri (git-reference
10987 (url "https://github.com/cbeust/jcommander")
10988 (commit version)))
10989 (file-name (git-file-name name version))
10990 (sha256
10991 (base32
10992 "12vcpc19sd7jhvjgp7xz1qjanfix162xb3x2q5zah93rjklj1h57"))))
10993 (build-system ant-build-system)
10994 (arguments
10995 `(#:jar-name "java-jcommander.jar"
10996 #:jdk ,icedtea-8
10997 #:tests? #f; requires testng which depends on jcommander
10998 #:source-dir "src/main/java"))
10999 (home-page "https://jcommander.org")
11000 (synopsis "Command line parameters parser")
11001 (description "JCommander is a very small Java framework that makes it
11002trivial to parse command line parameters. Parameters are declared with
11003annotations.")
11004 (license license:asl2.0)))
11005
11006(define-public java-bsh
11007 (package
11008 (name "java-bsh")
11009 (version "2.1.1")
11010 (source (origin
11011 (method git-fetch)
11012 (uri (git-reference
11013 (url "https://github.com/beanshell/beanshell")
11014 (commit version)))
11015 (file-name (git-file-name name version))
11016 (sha256
11017 (base32
11018 "1a6y46yz2ba4mnlfv4bpd5pmzhgxrzk3s10xp05jz377nbp2izwg"))
11019 (modules '((guix build utils)))
11020 (snippet
11021 '(begin
11022 ;; Delete bundled third-party jar archives.
11023 (for-each delete-file (find-files "." ".*.jar$"))
11024 (for-each (lambda (file) (chmod file #o644))
11025 (find-files "." "."))
11026 #t))))
11027 (build-system ant-build-system)
11028 (arguments
11029 `(#:build-target "jarall"
11030 #:test-target "junit-tests-all"
11031 #:make-flags (list "-DDATE" "(no date for reproducibility)")
11032 #:phases
11033 (modify-phases %standard-phases
11034 (add-before 'check 'fix-test
11035 (lambda _
11036 (substitute* "tests/junitTests/src/bsh/Issue_55_Test.java"
11037 ((" BshScriptEngineFactory") " bsh.engine.BshScriptEngineFactory"))))
11038 (replace 'install
11039 (install-from-pom "pom.xml")))))
11040 (inputs
11041 (list java-classpathx-servletapi java-commons-bsf))
11042 (native-inputs
11043 (list java-junit javacc-3))
11044 (home-page "http://beanshell.org/")
11045 (synopsis "Lightweight Scripting for Java")
11046 (description "BeanShell is a small, free, embeddable Java source
11047interpreter with object scripting language features, written in Java.
11048BeanShell dynamically executes standard Java syntax and extends it with common
11049scripting conveniences such as loose types, commands, and method closures like
11050those in Perl and JavaScript.")
11051 (license license:asl2.0)))
11052
11053(define-public java-fest-util
11054 (package
11055 (name "java-fest-util")
11056 (version "1.2.5")
11057 (source (origin
11058 (method git-fetch)
11059 (uri (git-reference
11060 (url "https://github.com/alexruiz/fest-util/")
11061 (commit (string-append "fest-util-" version))))
11062 (file-name (git-file-name name version))
11063 (sha256
11064 (base32
11065 "02kgal7v85snyyvcsxvn4qphid455f4smh2wri1il8d9asw0djbz"))))
11066 (build-system ant-build-system)
11067 (arguments
11068 `(#:jar-name "java-fest-util.jar"
11069 #:source-dir "src/main/java"))
11070 (native-inputs
11071 `(("junit" ,java-junit)
11072 ("hamcrest" ,java-hamcrest-core)))
11073 (home-page "https://github.com/alexruiz/fest-util")
11074 (synopsis "FEST common utilities")
11075 (description "Common utilities used in all FEST module.")
11076 (license license:asl2.0)))
11077
11078(define-public java-fest-test
11079 (package
11080 (name "java-fest-test")
11081 (version "2.1.0")
11082 (source (origin
11083 (method git-fetch)
11084 (uri (git-reference
11085 (url "https://github.com/alexruiz/fest-test/")
11086 (commit (string-append "fest-test-" version))))
11087 (file-name (git-file-name name version))
11088 (sha256
11089 (base32
11090 "0mg1d2jfh7kbx2c40dchbjr6d8pv59snsyb13mfxsr7xk5n69qbn"))))
11091 (build-system ant-build-system)
11092 (arguments
11093 `(#:jar-name "java-fest-test.jar"
11094 #:source-dir "src/main/java"
11095 #:tests? #f)); no tests
11096 (inputs
11097 `(("junit" ,java-junit)))
11098 (home-page "https://github.com/alexruiz/fest-test")
11099 (synopsis "Common FEST testing infrastructure")
11100 (description "Fest-test contains the common FEST testing infrastructure.")
11101 (license license:asl2.0)))
11102
11103(define-public java-fest-assert
11104 (package
11105 (name "java-fest-assert")
11106 (version "2.0M10")
11107 (source (origin
11108 (method git-fetch)
11109 (uri (git-reference
11110 (url "https://github.com/alexruiz/fest-assert-2.x/")
11111 (commit (string-append "fest-assert-core-" version))))
11112 (file-name (git-file-name name version))
11113 (sha256
11114 (base32
11115 "1cp8zzyag3s85fz2w68sda9zzaal1y5f9wl8g72wkm12an40w6by"))))
11116 (build-system ant-build-system)
11117 (arguments
11118 `(#:jar-name "java-fest-assert.jar"
11119 #:source-dir "src/main/java"
11120 #:test-exclude
11121 (list
11122 "**/Abstract*.java"
11123 "**/*BaseTest.java"
11124 ;; Unable to set MockitoNamingPolicy on cglib generator which creates FastClasses
11125 "**/MessageFormatter_format_Test.java"
11126 "**/internal/*/*_assert*_Test.java")))
11127 (inputs
11128 (list java-fest-util))
11129 (native-inputs
11130 (list java-junit
11131 java-fest-test
11132 java-hamcrest-core
11133 java-mockito-1
11134 java-cglib
11135 java-objenesis))
11136 (home-page "https://github.com/alexruiz/fest-assert-2.x")
11137 (synopsis "FEST fluent assertions")
11138 (description "FEST-Assert provides a fluent interface for assertions.")
11139 (license license:asl2.0)))
11140
11141(define-public java-testng
11142 (package
11143 (name "java-testng")
11144 (version "6.14.3")
11145 (source (origin
11146 (method git-fetch)
11147 (uri (git-reference
11148 (url "https://github.com/cbeust/testng")
11149 (commit version)))
11150 (file-name (string-append name "-" version "-checkout"))
11151 (sha256
11152 (base32
11153 "0y6vq30i5g276kw0v2bhbvci22ijg7ax49ap2611yqlhbs4d6dqv"))))
11154 (build-system ant-build-system)
11155 (arguments
11156 (list
11157 #:jdk icedtea-8; java.util.function
11158 #:jar-name "java-testng.jar"
11159 #:source-dir "src/main/java"
11160 #:phases
11161 '(modify-phases %standard-phases
11162 (add-after 'unpack 'delete-failing-tests
11163 (lambda _
11164 ;; FIXME: I don't know why these tests fail
11165 (substitute* "src/test/resources/testng.xml"
11166 ;; expected:<[0]> but was:<[3]>
11167 (("<class name=\"test.configuration.github1625.TestRunnerIssue1625\"/>") "")
11168 ;; expected [3] but found [2]
11169 (("<class name=\"test.serviceloader.ServiceLoaderTest\" />") "")
11170 ;; This is a parallel test and we've observed that it fails
11171 ;; sometimes.
11172 (("<class name=\"test.dataprovider.DataProviderTest\"/>") ""))))
11173 ;; We don't have groovy
11174 (add-after 'unpack 'delete-groovy-tests
11175 (lambda _
11176 (delete-file-recursively "src/test/java/test/dependent/issue1648/")
11177 (substitute* "src/test/resources/testng.xml"
11178 (("<class name=\"test.dependent.issue1648.TestRunner\"/>") ""))))
11179 (add-before 'build 'copy-resources
11180 (lambda _
11181 (copy-recursively "src/main/resources" "build/classes")))
11182 (add-before 'check 'copy-test-resources
11183 (lambda _
11184 (copy-recursively "src/test/resources" "build/test-classes")))
11185 (replace 'check
11186 (lambda _
11187 (invoke "ant" "compile-tests")
11188 ;; we don't have groovy
11189 (substitute* "src/test/resources/testng.xml"
11190 (("<class name=\"test.groovy.GroovyTest\" />") ""))
11191 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
11192 ":build/classes"
11193 ":build/test-classes")
11194 "-Dtest.resources.dir=src/test/resources"
11195 "org.testng.TestNG" "src/test/resources/testng.xml"))))))
11196 (propagated-inputs
11197 (list java-junit
11198 java-jsr305
11199 java-bsh
11200 java-jcommander
11201 java-guice
11202 java-snakeyaml))
11203 (native-inputs
11204 (list java-guava
11205 java-javax-inject
11206 java-hamcrest-all
11207 java-assertj
11208 java-mockito-1
11209 java-cglib
11210 java-aopalliance))
11211 (home-page "https://testng.org")
11212 (synopsis "Testing framework")
11213 (description "TestNG is a testing framework inspired from JUnit and NUnit
11214but introducing some new functionalities that make it more powerful and easier
11215to use.")
11216 (license license:asl2.0)))
11217
11218(define-public java-jnacl
11219 (let ((commit "094e819afdd63ea81a499b3bcb42a271006bebd9")
11220 (revision "2"))
11221 (package
11222 (name "java-jnacl")
11223 (version (string-append "0.1.0-" revision "." (string-take commit 7)))
11224 (source (origin
11225 (method git-fetch)
11226 (uri (git-reference
11227 (url "https://github.com/neilalexander/jnacl")
11228 (commit commit)))
11229 (file-name (git-file-name name version))
11230 (sha256
11231 (base32
11232 "1d6g6xhn83byv5943n7935wwjsk0ibk0qdvqgr699qqgqqmwisbb"))))
11233 (build-system ant-build-system)
11234 (arguments
11235 `(#:jar-name "jnacl.jar"
11236 #:source-dir "src/main/java"
11237 #:jdk ,icedtea-8
11238 #:phases
11239 (modify-phases %standard-phases
11240 (add-before 'build 'fix-tests
11241 (lambda _
11242 (substitute* '("src/test/java/com/neilalexander/jnacl/NaClTest.java"
11243 "src/test/java/com/neilalexander/jnacl/NaclSecretBoxTest.java")
11244 (("assertions.Assertions") "assertions.api.Assertions"))
11245 #t))
11246 (replace 'check
11247 (lambda _
11248 (invoke "ant" "compile-tests")
11249 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
11250 ":build/classes"
11251 ":build/test-classes")
11252 "org.testng.TestNG" "-testclass"
11253 "build/test-classes/com/neilalexander/jnacl/NaclSecretBoxTest.class")
11254 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
11255 ":build/classes"
11256 ":build/test-classes")
11257 "org.testng.TestNG" "-testclass"
11258 "build/test-classes/com/neilalexander/jnacl/NaClTest.class"))))))
11259 (native-inputs
11260 (list java-testng java-fest-util java-fest-assert))
11261 (home-page "https://github.com/neilalexander/jnacl")
11262 (synopsis "Java implementation of NaCl")
11263 (description "Pure Java implementation of the NaCl: Networking and
11264Cryptography library.")
11265 (license license:bsd-2))))
11266
11267(define-public java-mvel2
11268 (package
11269 (name "java-mvel2")
11270 (version "2.3.1")
11271 (source (origin
11272 (method url-fetch)
11273 (uri (string-append "https://github.com/mvel/mvel/archive/mvel2-"
11274 version ".Final.tar.gz"))
11275 (sha256
11276 (base32
11277 "01ph5s9gm16l2qz58lg21w6fna7xmmrj7f9bzqr1jim7h9557d3z"))))
11278 (build-system ant-build-system)
11279 (arguments
11280 `(#:jar-name "mvel2.jar"
11281 #:source-dir "src/main/java"
11282 #:test-exclude
11283 (list "**/Abstract*.java"
11284 ;; Base class with no tests
11285 "**/MVELThreadTest.java")
11286 #:phases
11287 (modify-phases %standard-phases
11288 (add-after 'install 'install-bin
11289 (lambda* (#:key outputs #:allow-other-keys)
11290 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
11291 (mkdir-p bin)
11292 (with-output-to-file (string-append bin "/mvel2")
11293 (lambda _
11294 (display
11295 (string-append
11296 "#!" (which "bash") "\n"
11297 "if [ \"$#\" -ne \"2\" ]; then\n"
11298 "echo 'Usage: mvel2 <script> <out.dir>'\n"
11299 "exit\n"
11300 "fi\n"
11301 "java -Dout.dir=$2 -cp " (getenv "CLASSPATH")
11302 ":" (assoc-ref outputs "out") "/share/java/mvel2.jar"
11303 " org.mvel2.sh.Main $1"))))
11304 (chmod (string-append bin "/mvel2") #o755))
11305 #t)))))
11306 (native-inputs
11307 `(("junit" ,java-junit)
11308 ("hamcrest" ,java-hamcrest-core)))
11309 (home-page "https://github.com/mvel/mvel")
11310 (synopsis "MVFLEX Expression Language")
11311 (description "MVEL has largely been inspired by Java syntax, but has some
11312fundamental differences aimed at making it more efficient as an expression
11313language, such as operators that directly support collection, array and string
11314matching, as well as regular expressions. MVEL is used to evaluate expressions
11315written using Java syntax.
11316
11317In addition to the expression language, MVEL serves as a templating language for
11318configuration and string construction.")
11319 (license license:asl2.0)))
11320
11321(define-public java-commons-jexl-2
11322 (package
11323 (name "java-commons-jexl")
11324 (version "2.1.1")
11325 (source (origin
11326 (method url-fetch)
11327 (uri (string-append "mirror://apache/commons/jexl/source/"
11328 "commons-jexl-" version "-src.tar.gz"))
11329 (sha256
11330 (base32
11331 "1ai7632bwwaxglb0nbpblpr2jw5g20afrsaq372ipkphi3ncy1jz"))))
11332 (build-system ant-build-system)
11333 (arguments
11334 `(#:jar-name "commons-jexl-2.jar"
11335 #:jdk ,icedtea-8
11336 #:source-dir "src/main/java"
11337 #:phases
11338 (modify-phases %standard-phases
11339 (add-before 'check 'disable-broken-tests
11340 (lambda* (#:key inputs #:allow-other-keys)
11341 (with-directory-excursion "src/test/java/org/apache/commons/jexl2/"
11342 (substitute* "ArithmeticTest.java"
11343 (("asserter.assertExpression\\(\"3 / 0\"") "//")
11344 (("asserter.assertExpression\\(\"imanull") "//"))
11345 ;; This test fails with "ambiguous method invocation"
11346 (delete-file "CacheTest.java")
11347 ;; This test doesn't have access to the temp directory
11348 (substitute* "ClassCreatorTest.java"
11349 (("java.io.tmpdir") "user.dir"))
11350 ;; This test fails in trying to detect whether it can run.
11351 (substitute* "ClassCreator.java"
11352 (("boolean canRun =.*") "boolean canRun = false;\n"))
11353 ;; ...and these tests depend on it.
11354 (delete-file "scripting/JexlScriptEngineOptionalTest.java")
11355 (delete-file "scripting/JexlScriptEngineTest.java"))
11356 #t))
11357 (add-before 'build 'run-javacc
11358 (lambda _
11359 (with-directory-excursion "src/main/java/org/apache/commons/jexl2/parser/"
11360 (invoke "java" "jjtree" "Parser.jjt")
11361 (invoke "java" "javacc" "Parser.jj"))
11362 #t)))))
11363 (inputs
11364 (list java-commons-logging-minimal))
11365 (native-inputs
11366 (list java-junit java-hamcrest-core javacc-4))
11367 (home-page "https://commons.apache.org/proper/commons-jexl/")
11368 (synopsis "Java Expression Language")
11369 (description "JEXL is a library intended to facilitate the implementation
11370of dynamic and scripting features in applications and frameworks written in
11371Java. JEXL implements an Expression Language based on some extensions to the
11372JSTL Expression Language supporting most of the constructs seen in
11373shell-script or ECMAScript. Its goal is to expose scripting features usable
11374by technical operatives or consultants working with enterprise platforms.")
11375 (license license:asl2.0)))
11376
11377(define-public java-lz4
11378 (package
11379 (name "java-lz4")
11380 (version "1.4.0")
11381 (source (origin
11382 (method git-fetch)
11383 (uri (git-reference
11384 (url "https://github.com/lz4/lz4-java")
11385 (commit version)))
11386 (file-name (git-file-name name version))
11387 (sha256
11388 (base32
11389 "0ydjakhv3cz34mfvv14qrh2ksdxifgjwwagjy7r46qr3f68hnf6y"))))
11390 (build-system ant-build-system)
11391 (arguments
11392 `(#:jar-name "lz4.jar"
11393 #:jdk ,icedtea-8
11394 #:source-dir "src/java:src/java-unsafe"
11395 #:tests? #f; FIXME: requires more dependencies
11396 #:phases
11397 (modify-phases %standard-phases
11398 (add-after 'unpack 'make-files-writable
11399 (lambda _
11400 (for-each make-file-writable (find-files "."))
11401 #t))
11402 (add-before 'configure 'generate-source
11403 (lambda _
11404 (with-directory-excursion "src/build/source_templates"
11405 (invoke "mvel2" "../gen_sources.mvel" "../../java"))
11406 #t)))))
11407 (native-inputs
11408 `(("mvel" ,java-mvel2)))
11409 (home-page "https://jpountz.github.io/lz4-java")
11410 (synopsis "Compression algorithm")
11411 (description "LZ4 - Java is a Java port of the popular lz4 compression
11412algorithms and xxHash hashing algorithm.")
11413 (license license:asl2.0)))
11414
11415(define-public java-bouncycastle
11416 (package
11417 (name "java-bouncycastle")
11418 (version "1.67")
11419 (source (origin
11420 (method git-fetch)
11421 (uri (git-reference
11422 (url "http://git.bouncycastle.org/repositories/bc-java")
11423 ;(url "https://github.com/bcgit/bc-java")
11424 (commit (string-append "r1rv" (substring version 2 4)))))
11425 (file-name (git-file-name name version))
11426 (sha256
11427 (base32
11428 "1449q7fyh03s1q0bqljcrhgacwcyqmg2bbvb3z084avgapwsainz"))
11429 (modules '((guix build utils)))
11430 (snippet
11431 '(begin
11432 (for-each delete-file
11433 (find-files "." "\\.jar$"))
11434 #t))))
11435 (build-system ant-build-system)
11436 (arguments
11437 `(#:jdk ,icedtea-8
11438 #:tests? #f
11439 #:phases
11440 (modify-phases %standard-phases
11441 (replace 'build
11442 (lambda _
11443 (invoke "ant" "-f" "ant/jdk15+.xml" "build-provider")
11444 (invoke "ant" "-f" "ant/jdk15+.xml" "build")))
11445 ;; FIXME: the tests freeze.
11446 ;; (replace 'check
11447 ;; (lambda _
11448 ;; (invoke "ant" "-f" "ant/jdk15+.xml" "test")))
11449 (replace 'install
11450 (install-jars "build/artifacts/jdk1.5/jars")))))
11451 (inputs
11452 (list java-javax-mail))
11453 (native-inputs
11454 `(("unzip" ,unzip)
11455 ("junit" ,java-junit)
11456 ("java-native-access" ,java-native-access)
11457 ("java-native-access-platform" ,java-native-access-platform)))
11458 (home-page "https://www.bouncycastle.org")
11459 (synopsis "Cryptographic library")
11460 (description "Bouncy Castle is a cryptographic library for the Java
11461programming language.")
11462 (license license:expat)))
11463
11464(define-public java-lmax-disruptor
11465 (package
11466 (name "java-lmax-disruptor")
11467 (version "3.4.4")
11468 (source (origin
11469 (method git-fetch)
11470 (uri (git-reference
11471 (url "https://github.com/LMAX-Exchange/disruptor")
11472 (commit version)))
11473 (file-name (git-file-name name version))
11474 (sha256
11475 (base32
11476 "02c5kp3n8a73dq9ay7ar53s1k3x61z9yzc5ikqb03m6snr1wpfqn"))))
11477 (build-system ant-build-system)
11478 (arguments
11479 `(#:jar-name "java-lmax-disruptor.jar"
11480 #:jdk ,icedtea-8
11481 #:tests? #f)); tests hang
11482 (inputs
11483 `(("junit" ,java-junit)
11484 ("java-hdrhistogram" ,java-hdrhistogram)
11485 ("java-jmock" ,java-jmock)
11486 ("java-jmock-legacy" ,java-jmock-legacy)
11487 ("java-jmock-junit4" ,java-jmock-junit4)
11488 ("java-hamcrest-all" ,java-hamcrest-all)))
11489 (native-inputs
11490 `(("cglib" ,java-cglib)
11491 ("objenesis" ,java-objenesis)))
11492 (home-page "https://www.lmax.com/disruptor")
11493 (synopsis "High performance inter-thread communication")
11494 (description "LMAX Disruptor is a software pattern and software component
11495for high performance inter-thread communication that avoids the need for
11496message queues or resource locking.")
11497 (license license:asl2.0)))
11498
11499(define-public java-conversant-disruptor
11500 (package
11501 (name "java-conversant-disruptor")
11502 (version "1.2.19")
11503 (source (origin
11504 (method git-fetch)
11505 (uri (git-reference
11506 (url "https://github.com/conversant/disruptor")
11507 (commit version)))
11508 (file-name (git-file-name name version))
11509 (sha256
11510 (base32
11511 "0gx1dm7sfg7pa05cs4qby10gfcplai5b5lf1f7ik1a76dh3vhl0g"))))
11512 (build-system ant-build-system)
11513 (arguments
11514 `(#:jar-name "java-conversant-disruptor.jar"
11515 #:source-dir "src/main/java"
11516 #:phases
11517 (modify-phases %standard-phases
11518 (add-before 'build 'copy-resources
11519 (lambda _
11520 (copy-recursively "src/main/resources" "build/classes")))
11521 (add-before 'build 'remove-module
11522 (lambda _
11523 (delete-file "src/main/java/module-info.java"))))))
11524 (native-inputs
11525 (list java-junit))
11526 (home-page "https://github.com/conversant/disruptor")
11527 (synopsis "High performance intra-thread communication")
11528 (description "Conversant Disruptor is the highest performing intra-thread
11529transfer mechanism available in Java. Conversant Disruptor is an implementation
11530of this type of ring buffer that has almost no overhead and that exploits a
11531particularly simple design.")
11532 (license license:asl2.0)))
11533
11534(define-public java-jctools-core-1
11535 (package
11536 (name "java-jctools-core")
11537 (version "1.2.1")
11538 (source (origin
11539 (method git-fetch)
11540 (uri (git-reference
11541 (url "https://github.com/JCTools/JCTools")
11542 (commit (string-append "v" version))))
11543 (file-name (git-file-name name version))
11544 (sha256
11545 (base32
11546 "105my29nwd4djvdllmq8s3jdzbyplbkxzwmddxiiilb4yqr1pghb"))))
11547 (build-system ant-build-system)
11548 (arguments
11549 `(#:jar-name "java-jctools-core.jar"
11550 #:source-dir "jctools-core/src/main/java"
11551 #:test-dir "jctools-core/src/test"
11552 ;; The tests timeout on some architectures.
11553 #:tests? ,(not (or (target-aarch64?)
11554 (%current-target-system)))))
11555 (native-inputs
11556 (list java-junit java-hamcrest-all))
11557 (home-page "https://github.com/JCTools/JCTools")
11558 (synopsis "Concurrency tools for Java")
11559 (description "This library implements concurrent data structures that are
11560not natively available in Java.")
11561 (license license:asl2.0)))
11562
11563(define-public java-commons-bcel
11564 (package
11565 (name "java-commons-bcel")
11566 (version "6.1")
11567 (source (origin
11568 (method url-fetch)
11569 (uri (string-append "mirror://apache/commons/bcel/source/bcel-"
11570 version "-src.tar.gz"))
11571 (sha256
11572 (base32
11573 "0j3x1rxd673k07psclk8k13rqh0x0mf2yy5qiwkiw4z3afa568jy"))))
11574 (build-system ant-build-system)
11575 (arguments
11576 `(#:jar-name "bcel.jar"
11577 #:jdk ,icedtea-8
11578 #:source-dir "src/main/java"
11579 #:test-dir "src/test/java"
11580 ;; FIXME: Tests require the unpackaged jna.
11581 #:tests? #f))
11582 (home-page "https://commons.apache.org/proper/commons-bcel/")
11583 (synopsis "Byte code engineering library")
11584 (description "The Byte Code Engineering Library (Apache Commons BCEL) is
11585intended to give users a convenient way to analyze, create, and
11586manipulate (binary) Java class files. Classes are represented by objects
11587which contain all the symbolic information of the given class: methods, fields
11588and byte code instructions, in particular.
11589
11590Such objects can be read from an existing file, be transformed by a
11591program (e.g. a class loader at run-time) and written to a file again. An
11592even more interesting application is the creation of classes from scratch at
11593run-time. The @dfn{Byte Code Engineering Library} (BCEL) may be also useful
11594if you want to learn about the @dfn{Java Virtual Machine} (JVM) and the format
11595of Java @code{.class} files.")
11596 (properties '((upstream-name . "bcel")))
11597 (license license:asl2.0)))
11598
11599(define-public java-xerial-core
11600 (package
11601 (name "java-xerial-core")
11602 (version "2.1")
11603 (source (origin
11604 (method url-fetch)
11605 (uri (string-append "https://github.com/xerial/xerial-java/archive/"
11606 version ".tar.gz"))
11607 (file-name (string-append name "-" version ".tar.gz"))
11608 (sha256
11609 (base32
11610 "0d3g863i41bgalpa4xr3vm1h140l091n8iwgq5qvby5yivns9y8d"))))
11611 (build-system ant-build-system)
11612 (arguments
11613 `(#:jar-name "xerial-core.jar"
11614 #:source-dir "xerial-core/src/main/java"
11615 #:test-dir "xerial-core/src/test"
11616 #:phases
11617 (modify-phases %standard-phases
11618 (add-before 'build 'copy-resources
11619 (lambda _
11620 (copy-recursively "xerial-core/src/main/resources"
11621 "build/classes")
11622 #t)))))
11623 (native-inputs
11624 `(("junit" ,java-junit)
11625 ("hamcrest" ,java-hamcrest-core)))
11626 (home-page "https://github.com/xerial/xerial-java")
11627 (synopsis "Data management libraries for Java")
11628 (description "Xerial is a set of data management libraries for the Java
11629programming language. The ultimate goal of the Xerial project is to manage
11630everything as database, including class objects, text format data, data
11631streams, etc.")
11632 (license license:asl2.0)))
11633
11634(define-public java-byte-buddy-dep
11635 (package
11636 (name "java-byte-buddy-dep")
11637 (version "1.14.0")
11638 (source (origin
11639 (method git-fetch)
11640 (uri (git-reference
11641 (url "https://github.com/raphw/byte-buddy")
11642 (commit (string-append "byte-buddy-" version))))
11643 (file-name (git-file-name name version))
11644 (sha256
11645 (base32
11646 "03jmsnkjb9d3z9brqs8fc512hhs5b5iab3a5wbax9zi03dskgvh2"))))
11647 (build-system ant-build-system)
11648 (arguments
11649 `(#:jar-name "byte-buddy-dep.jar"
11650 #:source-dir "byte-buddy-dep/src/main/java"
11651 #:test-dir "byte-buddy-dep/src/test"
11652 #:tests? #f; would build java files that are incompatible with current jdk
11653 #:phases
11654 (modify-phases %standard-phases
11655 (add-before 'build 'remove-annotations
11656 (lambda _
11657 (with-directory-excursion "byte-buddy-dep/src/main/java/net/bytebuddy"
11658 (substitute* (find-files "." ".*.java")
11659 (("@EqualsAndHashCode.*") "")
11660 (("import lombok.EqualsAndHashCode;") "")
11661 (("@SuppressFBWarnings.*") "")
11662 (("import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;") ""))
11663 (substitute* '("description/type/TypeDescription.java"
11664 "dynamic/loading/ClassInjector.java")
11665 (("^ *value = .*") "")
11666 (("^ *justification = .*") ""))))))))
11667 (inputs
11668 (list java-asm-9 java-asm-commons-9 java-jsr305 java-native-access))
11669 (home-page "http://bytebuddy.net/")
11670 (synopsis "Runtime code generation for the Java virtual machine")
11671 (description "Byte Buddy is a code generation and manipulation library for
11672creating and modifying Java classes during the runtime of a Java application
11673and without the help of a compiler.")
11674 (license license:asl2.0)))
11675
11676(define-public java-powermock-reflect
11677 (package
11678 (name "java-powermock-reflect")
11679 (version "2.0.9")
11680 (source (origin
11681 (method git-fetch)
11682 (uri (git-reference
11683 (url "https://github.com/powermock/powermock")
11684 (commit (string-append "powermock-" version))))
11685 (file-name (git-file-name name version))
11686 (sha256
11687 (base32
11688 "03y8szi9iwxnv431z2mn2ivc1ak30vcvfvkyrwmfq7wq93bj2c5v"))
11689 (patches
11690 (search-patches "java-powermock-fix-java-files.patch"))))
11691 (build-system ant-build-system)
11692 (arguments
11693 `(#:jar-name "java-powermock-reflect.jar"
11694 #:source-dir "powermock-reflect/src/main/java"
11695 #:test-dir "powermock-reflect/src/test"))
11696 (inputs
11697 (list java-asm-9 java-objenesis))
11698 (native-inputs
11699 (list java-assertj java-cglib java-hamcrest-core java-junit))
11700 (home-page "https://github.com/powermock/powermock")
11701 (synopsis "Mock library extension framework")
11702 (description "PowerMock is a framework that extends other mock libraries
11703such as EasyMock with more powerful capabilities. PowerMock uses a custom
11704classloader and bytecode manipulation to enable mocking of static methods,
11705constructors, final classes and methods, private methods, removal of static
11706initializers and more. By using a custom classloader no changes need to be
11707done to the IDE or continuous integration servers which simplifies adoption.")
11708 (license license:asl2.0)))
11709
11710(define-public java-powermock-core
11711 (package
11712 (inherit java-powermock-reflect)
11713 (name "java-powermock-core")
11714 (arguments
11715 `(#:jar-name "java-powermock-core.jar"
11716 #:source-dir "powermock-core/src/main/java"
11717 #:test-dir "powermock-core/src/test"
11718 #:tests? #f; requires powermock-api
11719 #:jdk ,icedtea-8
11720 #:phases
11721 (modify-phases %standard-phases
11722 (add-before 'build 'copy-resources
11723 (lambda _
11724 (copy-recursively "powermock-core/src/main/resources"
11725 "build/classes")
11726 #t)))))
11727 (inputs
11728 (list java-asm-9
11729 java-byte-buddy-dep
11730 java-jboss-javassist
11731 java-powermock-reflect))
11732 (native-inputs
11733 (list java-assertj java-mockito-1 java-junit))))
11734
11735(define-public java-powermock-api-support
11736 (package
11737 (inherit java-powermock-reflect)
11738 (name "java-powermock-api-support")
11739 (build-system ant-build-system)
11740 (arguments
11741 `(#:jar-name "java-powermock-api-support.jar"
11742 #:jdk ,icedtea-8
11743 #:source-dir "powermock-api/powermock-api-support/src/main/java"
11744 #:tests? #f)); no tests
11745 (inputs
11746 (list java-powermock-core java-powermock-reflect))))
11747
11748(define-public java-powermock-modules-junit4-common
11749 (package
11750 (inherit java-powermock-reflect)
11751 (name "java-powermock-modules-junit4-common")
11752 (build-system ant-build-system)
11753 (arguments
11754 `(#:jar-name "java-powermock-modules-junit4-common.jar"
11755 #:jdk ,icedtea-8
11756 #:source-dir "powermock-modules/powermock-module-junit4-common/src/main/java"
11757 #:test-dir "powermock-modules/powermock-module-junit4-common/src/test"))
11758 (inputs
11759 (list java-cglib
11760 java-easymock
11761 java-hamcrest-core
11762 java-powermock-core
11763 java-powermock-reflect))))
11764
11765(define-public java-powermock-modules-junit4
11766 (package
11767 (inherit java-powermock-reflect)
11768 (name "java-powermock-modules-junit4")
11769 (build-system ant-build-system)
11770 (arguments
11771 `(#:jar-name "java-powermock-modules-junit4.jar"
11772 #:tests? #f; require easymock 4, which introduces a loop with testng
11773 #:source-dir "powermock-modules/powermock-module-junit4/src/main/java"
11774 #:test-dir "powermock-modules/powermock-module-junit4/src/test"
11775 #:phases
11776 (modify-phases %standard-phases
11777 (add-before 'build 'fix-junit-detection
11778 (lambda _
11779 ;; Our junit version is 4.12-SNAPSHOT
11780 (substitute* (find-files "powermock-modules/powermock-module-junit4"
11781 "PowerMockJUnit4MethodValidator.java")
11782 (("4.12") "4.12-SNAPSHOT"))
11783 #t)))))
11784 (inputs
11785 (list java-cglib
11786 java-powermock-core
11787 java-powermock-reflect
11788 java-powermock-modules-junit4-common))
11789 (native-inputs
11790 (list java-easymock
11791 java-hamcrest-core
11792 java-junit
11793 java-objenesis))))
11794
11795(define-public java-powermock-api-easymock
11796 (package
11797 (inherit java-powermock-reflect)
11798 (name "java-powermock-api-easymock")
11799 (build-system ant-build-system)
11800 (arguments
11801 `(#:jar-name "java-powermock-api-easymock.jar"
11802 #:jdk ,icedtea-8
11803 #:source-dir "powermock-api/powermock-api-easymock/src/main/java"
11804 #:tests? #f; no tests
11805 #:phases
11806 (modify-phases %standard-phases
11807 (add-before 'build 'fix-file
11808 (lambda _
11809 ;; FIXME: This looks wrong, but it fixes a build error.
11810 (with-directory-excursion "powermock-api/powermock-api-easymock"
11811 (substitute* "src/main/java/org/powermock/api/easymock/PowerMock.java"
11812 (("classLoader instanceof MockClassLoader") "false")
11813 (("\\(\\(MockClassLoader\\) classLoader\\).*;") ";")))
11814 #t)))))
11815 (inputs
11816 (list java-cglib
11817 java-easymock
11818 java-powermock-api-support
11819 java-powermock-core
11820 java-powermock-reflect))))
11821
11822(define-public java-jboss-jms-api-spec
11823 (package
11824 (name "java-jboss-jms-api-spec")
11825 (version "2.0")
11826 (source (origin
11827 (method url-fetch)
11828 (uri (string-append "https://github.com/jboss/jboss-jms-api_spec/"
11829 "archive/jboss-jms-api_" version
11830 "_spec-1.0.1.Final.tar.gz"))
11831 (sha256
11832 (base32
11833 "07bqblw9kq2i8q92bz70fvavq5xjfkaixl8xa0m0cypjgy82rb7m"))))
11834 (build-system ant-build-system)
11835 (arguments
11836 `(#:jar-name "java-jboss-jms-api_spec.jar"
11837 #:jdk ,icedtea-8
11838 #:source-dir "."
11839 #:tests? #f)); no tests
11840 (home-page "https://github.com/jboss/jboss-jms-api_spec")
11841 (synopsis "Java Message Service API specification")
11842 (description "Java Message Service (JMS) API is used to send messages
11843messages between two or more clients. It is a messaging standard that allows
11844application components to create, send, receive, and read messages.")
11845 ; either gpl2 only with GPL Classpath Exception, or cddl.
11846 (license (list license:gpl2 license:cddl1.0))))
11847
11848(define-public java-mail
11849 (package
11850 (name "java-mail")
11851 (version "1.6.0")
11852 (source (origin
11853 (method url-fetch)
11854 (uri (string-append "https://github.com/javaee/javamail/archive/"
11855 "JAVAMAIL-1_6_0.tar.gz"))
11856 (sha256
11857 (base32
11858 "1b4rg7fpj50ld90a71iz2m4gm3f5cnw18p3q3rbrrryjip46kx92"))))
11859 (build-system ant-build-system)
11860 (arguments
11861 `(#:jar-name "java-mail.jar"
11862 #:jdk ,icedtea-8
11863 #:source-dir "mail/src/main/java"
11864 #:test-dir "mail/src/test"
11865 #:test-exclude
11866 (list "**/CollectorFormatterTest.java"
11867 "**/CompactFormatterTest.java"
11868 "**/DurationFilterTest.java"
11869 "**/MailHandlerTest.java"
11870 "**/GetLocalAddressTest.java"
11871 ;; SSLHandshakeException: No appropriate protocol
11872 "**/WriteTimeoutSocketTest.java"
11873 ;; FIXME: both end with:
11874 ;; java.lang.ClassNotFoundException:
11875 ;; javax.mail.internet.MimeMultipartParseTest
11876 "**/MimeMultipartParseTest.java"
11877 "**/SearchTermSerializationTest.java")
11878 #:phases
11879 (modify-phases %standard-phases
11880 (add-before 'configure 'move-version.java
11881 (lambda _
11882 (copy-file "mail/src/main/resources/javax/mail/Version.java"
11883 "mail/src/main/java/javax/mail/Version.java")))
11884 (add-before 'build 'copy-resources
11885 (lambda _
11886 (copy-recursively "mail/src/main/resources/META-INF"
11887 "build/classes/META-INF"))))))
11888 (native-inputs
11889 (list java-junit java-hamcrest-core))
11890 (home-page "https://javaee.github.io/javamail/")
11891 (synopsis "Mail-related functionality in Java")
11892 (description "The JavaMail API provides a platform-independent and
11893protocol-independent framework to build mail and messaging applications.")
11894 ;; General Public License Version 2 only ("GPL") or the Common Development
11895 ;; and Distribution License("CDDL")
11896 (license (list license:cddl1.1
11897 license:gpl2)))); with classpath exception
11898
11899(define-public java-mapdb
11900 (package
11901 (name "java-mapdb")
11902 (version "1.0.9")
11903 (source (origin
11904 (method git-fetch)
11905 (uri (git-reference
11906 (url "https://github.com/jankotek/mapdb")
11907 (commit (string-append "mapdb-" version))))
11908 (file-name (git-file-name name version))
11909 (sha256
11910 (base32
11911 "1slb4h282jqvk16896lcvgm65pj3v6crcp2wvjdvad7nx7d2f1kv"))))
11912 (build-system ant-build-system)
11913 (arguments
11914 (list #:jar-name "mapdb.jar"
11915 #:source-dir "src/main/java"
11916 #:test-dir "src/test"
11917 #:test-exclude (list "**/ClosedThrowsExceptionTest.java"
11918 "**/ConcurrentMapInterfaceTest.java"
11919 "**/EngineTest.java"
11920 "**/Issue664Test.java"
11921 "**/MapInterfaceTest.java")
11922 #:phases #~(modify-phases %standard-phases
11923 (replace 'install (install-from-pom "pom.xml")))))
11924 (native-inputs (list java-junit))
11925 (home-page "https://mapdb.org/")
11926 (synopsis "Concurrent data structures")
11927 (description "MapDB provides concurrent maps, sets and queues backed by
11928disk storage or off-heap memory.")
11929 (license license:bsd-3)))
11930
11931(define-public java-mime4j-core
11932 (package
11933 (name "java-mime4j-core")
11934 (version "0.8.13")
11935 (source (origin
11936 (method url-fetch)
11937 (uri (string-append "mirror://apache/james/mime4j/" version
11938 "/james-mime4j-sources-" version ".zip"))
11939 (sha256
11940 (base32
11941 "0f1r0ywa1qdw2b227c93v3fksqp9bgll00bqw1md1894v3szm9ca"))))
11942 (build-system ant-build-system)
11943 (arguments
11944 `(#:tests? #f ;; has no tests
11945 #:source-dir "core/src/main/java"
11946 #:jar-name "apache-mime4j-core.jar"))
11947 (native-inputs
11948 (list java-commons-io-latest ;; requries >= 2.7
11949 java-junit
11950 unzip))
11951 (home-page "https://james.apache.org/mime4j/apache-mime4j-core/")
11952 (synopsis "Java stream based MIME message parser")
11953 (description "Apache James Mime4J provides a parser, MimeStreamParser, for
11954e-mail message streams in plain rfc822 and MIME format. The parser uses a
11955callback mechanism to report parsing events such as the start of an entity
11956header, the start of a body, etc. If you are familiar with the SAX XML parser
11957interface you should have no problem getting started with mime4j.")
11958 (license license:asl2.0)))
11959
11960(define-public java-jeromq
11961 (package
11962 (name "java-jeromq")
11963 (version "0.4.3")
11964 (source (origin
11965 (method git-fetch)
11966 (uri (git-reference
11967 (url "https://github.com/zeromq/jeromq")
11968 (commit (string-append "v" version))))
11969 (file-name (string-append name "-" version "-checkout"))
11970 (sha256
11971 (base32
11972 "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj"))
11973 (patches (search-patches "java-jeromq-fix-tests.patch"))))
11974 (build-system ant-build-system)
11975 (arguments
11976 `(#:jar-name "java-jeromq.jar"
11977 #:source-dir "src/main/java"
11978 #:jdk ,icedtea-8
11979 #:test-exclude
11980 (list
11981 "**/Abstract*.java"
11982 ;; Requires network
11983 "**/ZBeaconTest.java"
11984 ;; Failures
11985 "**/DealerSpecTest.java"
11986 "**/CustomDecoderTest.java"
11987 "**/CustomEncoderTest.java"
11988 "**/ConnectRidTest.java"
11989 "**/ReqSpecTest.java"
11990 "**/PushPullSpecTest.java"
11991 "**/PubSubHwmTest.java"
11992 "**/RouterSpecTest.java"
11993 "**/ProxyTest.java")))
11994 (inputs
11995 (list java-jnacl))
11996 (native-inputs
11997 `(("java-hamcrest-core" ,java-hamcrest-core)
11998 ("junit" ,java-junit)))
11999 (home-page "https://zeromq.org/bindings:java")
12000 (synopsis "Java binding for 0MQ")
12001 (description "Jeromq provides the java bindings for 0MQ.")
12002 (license license:mpl2.0)))
12003
12004(define-public java-kafka-clients
12005 (package
12006 (name "java-kafka-clients")
12007 (version "1.1.1")
12008 (source (origin
12009 (method url-fetch)
12010 (uri (string-append "mirror://apache/kafka/" version "/kafka-"
12011 version "-src.tgz"))
12012 (sha256
12013 (base32
12014 "1jn62q7z383nwhzv4ippsddf98sa1gnkszjjncj4ii3r8rzgw566"))))
12015 (build-system ant-build-system)
12016 (arguments
12017 `(#:jar-name "java-kafka-clients.jar"
12018 #:jdk ,icedtea-8
12019 #:source-dir "clients/src/main/java"
12020 #:test-dir "clients/src/test"
12021 #:test-exclude
12022 (list
12023 ;; This file does not contain a class
12024 "**/IntegrationTest.java"
12025 ;; Requires network
12026 "**/ClientUtilsTest.java"
12027 ;; This test fails on i686
12028 "**/SerializationTest.java"
12029 ;; "protocol is disabled or cipher suites are inappropriate"
12030 "**/SslTransportLayerTest.java"
12031 ;; End with errors that seem related to our powermock
12032 "**/KafkaProducerTest.java"
12033 "**/BufferPoolTest.java"
12034 ;; Undeterministic failure, seems to affect mostly ci
12035 "**/GarbageCollectedMemoryPoolTest.java")))
12036 (inputs
12037 (list java-slf4j-api java-lz4))
12038 (native-inputs
12039 (list java-bouncycastle
12040 java-cglib
12041 java-easymock
12042 java-hamcrest-all
12043 java-jboss-javassist
12044 java-junit
12045 java-objenesis
12046 java-powermock-api-easymock
12047 java-powermock-api-support
12048 java-powermock-core
12049 java-powermock-modules-junit4
12050 java-powermock-modules-junit4-common
12051 java-snappy))
12052 (home-page "https://kafka.apache.org")
12053 (synopsis "Distributed streaming platform")
12054 (description "Kafka is a distributed streaming platform, which means:
12055@itemize
12056@item it can publish and subscribe to streams of records;
12057@item it can store streams of records in a fault-tolerant way;
12058@item it can process streams of records as they occur.
12059@end itemize")
12060 ;; Either cddl or gpl2 only.
12061 (license (list license:cddl1.1; actually cddl1.1
12062 license:gpl2)))); with classpath exception
12063
12064(define-public java-jdom
12065 (package
12066 (name "java-jdom")
12067 (version "1.1.3")
12068 (source (origin
12069 (method url-fetch)
12070 (uri (string-append "http://jdom.org/dist/binary/archive/jdom-"
12071 version ".tar.gz"))
12072 (sha256
12073 (base32
12074 "07wdpm3jwwc9q38kmdw40fvbmv6jzjrkrf8m0zqs58f79a672wfl"))))
12075 (build-system ant-build-system)
12076 (arguments
12077 `(#:build-target "package"
12078 #:tests? #f; tests are run as part of the build process
12079 #:phases
12080 (modify-phases %standard-phases
12081 (replace 'install
12082 (install-jars "build")))))
12083 (home-page "http://jdom.org/")
12084 (synopsis "Access, manipulate, and output XML data")
12085 (description "Java-based solution for accessing, manipulating, and
12086outputting XML data from Java code.")
12087 (license license:bsd-4)))
12088
12089(define-public java-geronimo-xbean-reflect
12090 (package
12091 (name "java-geronimo-xbean-reflect")
12092 (version "4.5")
12093 (source (origin
12094 (method svn-fetch)
12095 (uri (svn-reference
12096 (url "https://svn.apache.org/repos/asf/geronimo/xbean/tags/xbean-4.5/")
12097 (revision 1807396)))
12098 (file-name (string-append name "-" version))
12099 (sha256
12100 (base32
12101 "0zjqmsad4xk0iar23hdyvx19nxczybd2bh0i35xrafli5cmh720k"))))
12102 (build-system ant-build-system)
12103 (arguments
12104 `(#:jar-name "geronimo-xbean-reflect.jar"
12105 #:source-dir "xbean-reflect/src/main/java"
12106 #:test-dir "xbean-reflect/src/test"
12107 #:jdk ,icedtea-8
12108 #:test-exclude
12109 (list "**/Abstract*.java" "**/AsmParameterNameLoaderTest.java"
12110 "**/ObjectRecipeTest.java" "**/ParameterNameLoaderTest.java"
12111 "**/RecipeHelperTest.java" "**/XbeanAsmParameterNameLoaderTest.java")
12112 #:phases
12113 (modify-phases %standard-phases
12114 (add-before 'build 'fix-source
12115 (lambda _
12116 (let ((dir "xbean-reflect/src/main/java/org/apache/xbean/recipe/"))
12117 ;; org.apache.xbean.asm6 is actually repackaged java-asm
12118 (substitute* (string-append dir "XbeanAsmParameterNameLoader.java")
12119 (("org.apache.xbean.asm5") "org.objectweb.asm"))
12120 #t)))
12121 (replace 'install (install-from-pom "xbean-reflect/pom.xml")))))
12122 (inputs
12123 `(("asm" ,java-asm)
12124 ("log4j" ,java-log4j-api)
12125 ("log4j-1.2" ,java-log4j-1.2-api)
12126 ("log4j-core" ,java-log4j-core)
12127 ("logging" ,java-commons-logging-minimal)))
12128 (propagated-inputs
12129 (list java-geronimo-parent-pom))
12130 (native-inputs
12131 `(("junit" ,java-junit)))
12132 (home-page "https://geronimo.apache.org/maven/xbean/3.6/xbean-reflect/")
12133 (synopsis "Dependency injection helper")
12134 (description "Xbean-reflect provides very flexible ways to create objects
12135and graphs of objects for dependency injection frameworks")
12136 (license license:asl2.0)))
12137
12138(define java-geronimo-genesis-2.1
12139 (package
12140 (name "java-geronimo-genesis")
12141 (version "2.1")
12142 (source (origin
12143 (method svn-fetch)
12144 (uri (svn-reference
12145 (url (string-append "https://svn.apache.org/repos/asf/"
12146 "geronimo/genesis/tags/genesis-"
12147 version))
12148 (revision 1807396)))
12149 (file-name (string-append name "-" version "-source"))
12150 (sha256
12151 (base32
12152 "1mky4zyl2xsqlgrkairaj5971byvhwk2z9bq8snsgvlr11ydc0zf"))))
12153 (build-system ant-build-system)
12154 (arguments
12155 `(#:tests? #f
12156 #:phases
12157 (modify-phases %standard-phases
12158 (delete 'configure)
12159 (delete 'build)
12160 (replace 'install
12161 (install-pom-file "pom.xml"))
12162 (add-after 'install 'install-enforcer-rules
12163 (install-pom-file "genesis-enforcer-rules/pom.xml"))
12164 (add-after 'install 'install-flava
12165 (install-pom-file "genesis-default-flava/pom.xml"))
12166 (add-after 'install 'install-packaging
12167 (install-pom-file "genesis-packaging/pom.xml"))
12168 (add-after 'install-flava 'install-flava-java4
12169 (install-pom-file "genesis-default-flava/genesis-java1.4-flava/pom.xml"))
12170 (add-after 'install-flava 'install-flava-java5
12171 (install-pom-file "genesis-default-flava/genesis-java5-flava/pom.xml"))
12172 (add-after 'install-flava 'install-flava-java6
12173 (install-pom-file "genesis-default-flava/genesis-java6-flava/pom.xml")))))
12174 (propagated-inputs
12175 `(("apache-parent-pom" ,apache-parent-pom-13)))
12176 (home-page "https://geronimo.apache.org")
12177 (synopsis "Collection of maven POM files for the Geronimo project")
12178 (description "Apache Geronimo is a server runtime. This package contains
12179only pom files used by other components in the Geronimo project.")
12180 (license license:asl2.0)))
12181
12182(define java-geronimo-parent-pom
12183 (package
12184 (inherit java-geronimo-xbean-reflect)
12185 (name "java-geronimo-parent-pom")
12186 (arguments
12187 `(#:tests? #f
12188 #:phases
12189 (modify-phases %standard-phases
12190 (delete 'configure)
12191 (delete 'build)
12192 (replace 'install
12193 (install-pom-file "pom.xml")))))
12194 (propagated-inputs
12195 `(("java-geronimo-genesis" ,java-geronimo-genesis-2.1)))))
12196
12197(define-public java-geronimo-xbean-bundleutils
12198 (package
12199 (inherit java-geronimo-xbean-reflect)
12200 (name "java-geronimo-xbean-bundleutils")
12201 (arguments
12202 `(#:jar-name "geronimo-xbean-bundleutils.jar"
12203 #:source-dir "xbean-bundleutils/src/main/java"
12204 #:test-dir "xbean-bundleutils/src/test"
12205 #:phases
12206 (modify-phases %standard-phases
12207 (add-before 'build 'fix-java
12208 (lambda _
12209 ;; We use a more recent version of osgi, so this file requires
12210 ;; more interface method implementations.
12211 (substitute* "xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java"
12212 (("import org.osgi.framework.ServiceRegistration;")
12213 "import org.osgi.framework.ServiceRegistration;
12214import org.osgi.framework.ServiceFactory;
12215import java.util.Collection;
12216import org.osgi.framework.ServiceObjects;")
12217 (("public Bundle getBundle\\(\\)")
12218 "@Override
12219public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
12220 throw new UnsupportedOperationException();
12221}
12222@Override
12223public <S> ServiceRegistration<S> registerService(Class<S> clazz,
12224 ServiceFactory<S> factory, Dictionary<String, ?> properties) {
12225 throw new UnsupportedOperationException();
12226}
12227public Bundle getBundle()"))
12228 #t)))))
12229 (inputs
12230 `(("java-slf4j" ,java-slf4j-api)
12231 ("java-asm" ,java-asm)
12232 ("java-osgi-framework" ,java-osgi-framework)
12233 ("java-eclipse-osgi" ,java-eclipse-osgi)
12234 ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)))))
12235
12236(define-public java-geronimo-xbean-asm-util
12237 (package
12238 (inherit java-geronimo-xbean-reflect)
12239 (name "java-geronimo-xbean-asm-util")
12240 (arguments
12241 `(#:jar-name "geronimo-xbean-asm-util.jar"
12242 #:source-dir "xbean-asm-util/src/main/java"
12243 #:tests? #f)); no tests
12244 (inputs
12245 (list java-asm))
12246 (native-inputs '())))
12247
12248(define-public java-geronimo-xbean-finder
12249 (package
12250 (inherit java-geronimo-xbean-reflect)
12251 (name "java-geronimo-xbean-finder")
12252 (arguments
12253 `(#:jar-name "geronimo-xbean-finder.jar"
12254 #:source-dir "xbean-finder/src/main/java"
12255 #:test-dir "xbean-finder/src/test"))
12256 (inputs
12257 (list java-slf4j-api
12258 java-asm
12259 java-geronimo-xbean-bundleutils
12260 java-geronimo-xbean-asm-util
12261 java-osgi-service-packageadmin
12262 java-osgi-framework))
12263 (native-inputs
12264 (list java-junit java-hamcrest-core))))
12265
12266(define-public java-gson
12267 (package
12268 (name "java-gson")
12269 (version "2.8.2")
12270 (source (origin
12271 (method url-fetch)
12272 (uri (string-append "https://github.com/google/gson/archive/"
12273 "gson-parent-" version ".tar.gz"))
12274 (sha256
12275 (base32
12276 "1j4qnp7v046q0k48c4kyf69sxaasx2h949d3cqwsm3kzxms3x0f9"))))
12277 (build-system ant-build-system)
12278 (arguments
12279 `(#:jar-name "gson.jar"
12280 #:source-dir "gson/src/main/java"
12281 #:test-dir "gson/src/test"))
12282 (native-inputs
12283 (list java-junit java-hamcrest-core))
12284 (home-page "https://github.com/google/gson")
12285 (synopsis "Java serialization/deserialization library from/to JSON")
12286 (description "Gson is a Java library that can be used to convert Java
12287Objects into their JSON representation. It can also be used to convert a JSON
12288string to an equivalent Java object. Gson can work with arbitrary Java objects
12289including pre-existing objects that you do not have source-code of.")
12290 (license license:asl2.0)))
12291
12292;; This requires a different Java version than 2.8.2 above
12293(define-public java-gson-2.8.6
12294 (package
12295 (inherit java-gson)
12296 (name "java-gson")
12297 (version "2.8.6")
12298 (source (origin
12299 (method git-fetch)
12300 (uri (git-reference
12301 (url "https://github.com/google/gson")
12302 (commit (string-append "gson-parent-" version))))
12303 (file-name (git-file-name name version))
12304 (sha256
12305 (base32
12306 "0kk5p3vichdb0ph1lzknrcpbklgnmq455mngmjpxvvj29p3rgpk3"))))
12307 (arguments
12308 `(#:jar-name "gson.jar"
12309 #:jdk ,openjdk11
12310 #:source-dir "gson/src/main/java"
12311 #:test-dir "gson/src/test"
12312 #:phases
12313 (modify-phases %standard-phases
12314 ;; avoid Maven dependency
12315 (add-before 'build 'fill-template
12316 (lambda _
12317 (with-directory-excursion "gson/src/main"
12318 (copy-file "java-templates/com/google/gson/internal/GsonBuildConfig.java"
12319 "java/com/google/gson/internal/GsonBuildConfig.java")
12320 (substitute* "java/com/google/gson/internal/GsonBuildConfig.java"
12321 (("\\$\\{project.version\\}") ,version))))))))))
12322
12323(define-public java-hawtjni
12324 (package
12325 (name "java-hawtjni")
12326 (version "1.15")
12327 (source (origin
12328 (method url-fetch)
12329 (uri (string-append "https://github.com/fusesource/hawtjni/archive/"
12330 "hawtjni-project-" version ".tar.gz"))
12331 (sha256
12332 (base32
12333 "1bqfd732rmh6svyx17fpw9175gc9gzkcbyps2yyrf50c3zzjas6g"))))
12334 (build-system ant-build-system)
12335 (arguments
12336 `(#:jar-name "hawtjni.jar"
12337 #:source-dir "hawtjni-generator/src/main/java:hawtjni-runtime/src/main/java"
12338 #:tests? #f; no tests
12339 #:phases
12340 (modify-phases %standard-phases
12341 (add-before 'build 'build-native
12342 (lambda* (#:key inputs #:allow-other-keys)
12343 (let ((include (string-append "-I" (assoc-ref inputs "jdk") "/include/linux")))
12344 (with-directory-excursion "hawtjni-generator/src/main/resources/"
12345 (invoke "gcc" "-c" "hawtjni.c" "-o" "hawtjni.o"
12346 "-fPIC" "-O2" include)
12347 (invoke "gcc" "-c" "hawtjni-callback.c" "-o" "hawtjni-callback.o"
12348 "-fPIC" "-O2" include)
12349 (invoke "gcc" "-o" "libhawtjni.so" "-shared"
12350 "hawtjni.o" "hawtjni-callback.o")))
12351 #t))
12352 (add-after 'install 'install-native
12353 (lambda* (#:key outputs #:allow-other-keys)
12354 (let* ((out (assoc-ref outputs "out"))
12355 (lib (string-append out "/lib"))
12356 (inc (string-append out "/include")))
12357 (with-directory-excursion "hawtjni-generator/src/main/resources/"
12358 (install-file "libhawtjni.so" lib)
12359 (install-file "hawtjni.h" inc)))
12360 #t))
12361 (add-before 'install 'install-parent
12362 (install-pom-file "pom.xml"))
12363 (replace 'install
12364 (install-from-pom "hawtjni-runtime/pom.xml")))))
12365 (inputs
12366 (list java-commons-cli java-asm java-geronimo-xbean-finder))
12367 (home-page "https://fusesource.github.io/hawtjni/")
12368 (synopsis "JNI code generator")
12369 (description "HawtJNI is a code generator that produces the JNI code needed
12370to implement Java native methods. It is based on the jnigen code generator
12371that is part of the SWT Tools project.")
12372 (license license:asl2.0)))
12373
12374(define-public java-jansi-native
12375 (package
12376 (name "java-jansi-native")
12377 (version "1.7")
12378 (source (origin
12379 (method url-fetch)
12380 (uri (string-append "https://github.com/fusesource/jansi-native/"
12381 "archive/jansi-native-" version ".tar.gz"))
12382 (sha256
12383 (base32
12384 "0j2ydlgxbzbgshqkwghbxxxnbnx1mmjgd6k5fw6xfvxw1z956yqf"))))
12385 (build-system ant-build-system)
12386 (arguments
12387 `(#:jar-name "jansi-native.jar"
12388 #:source-dir "src/main/java"
12389 #:tests? #f; no tests
12390 #:phases
12391 (modify-phases %standard-phases
12392 (add-before 'build 'build-native
12393 (lambda* (#:key inputs #:allow-other-keys)
12394 ;; there are more required files for windows in windows/
12395 (with-directory-excursion "src/main/native-package/src"
12396 (substitute* "jansi_ttyname.c"
12397 (("#include \"jansi_.*") ""))
12398 (invoke "gcc" "-c" "jansi_ttyname.c" "-o" "jansi_ttyname.o"
12399 (string-append "-I" (assoc-ref inputs "java-hawtjni")
12400 "/include")
12401 (string-append "-I" (assoc-ref inputs "jdk")
12402 "/include/linux")
12403 "-fPIC" "-O2")
12404 (invoke "gcc" "-o" "libjansi.so" "-shared" "jansi_ttyname.o"))))
12405 (add-before 'build 'install-native
12406 (lambda _
12407 (let ((dir (string-append "build/classes/META-INF/native/"
12408 ,(match (%current-system)
12409 ((or "i686-linux" "armhf-linux")
12410 "linux32")
12411 ((or "x86_64-linux" "aarch64-linux"
12412 "mips64el-linux")
12413 "linux64")
12414 (_ "unknown-kernel")))))
12415 (install-file "src/main/native-package/src/libjansi.so" dir))
12416 #t))
12417 (add-after 'install 'install-native
12418 (lambda* (#:key outputs #:allow-other-keys)
12419 (install-file "src/main/native-package/src/jansi.h"
12420 (string-append (assoc-ref outputs "out") "/include"))
12421 #t))
12422 (add-before 'install 'fix-pom
12423 (lambda _
12424 ;; pom contains variables to complete name, but we don't support that
12425 (substitute* "pom.xml"
12426 (("\\$\\{platform\\}") "native"))
12427 #t))
12428 (replace 'install
12429 (install-from-pom "pom.xml")))))
12430 (propagated-inputs
12431 (list java-hawtjni))
12432 (home-page "https://fusesource.github.io/jansi/")
12433 (synopsis "Native library for jansi")
12434 (description "This package provides the native library for jansi, a small
12435Java library that allows you to use ANSI escape sequences to format your
12436console output.")
12437 (license license:asl2.0)))
12438
12439(define-public java-jansi
12440 (package
12441 (name "java-jansi")
12442 (version "2.4.0")
12443 (source (origin
12444 (method git-fetch)
12445 (uri (git-reference
12446 (url "https://github.com/fusesource/jansi")
12447 (commit (string-append "jansi-" version))))
12448 (file-name (git-file-name name version))
12449 (sha256
12450 (base32
12451 "1s6fva06990798b5fyxqzr30zwyj1byq5wrm54j2larcydaryggf"))
12452 (modules '((guix build utils)))
12453 (snippet
12454 ;; contains pre-compiled libraries
12455 '(delete-file-recursively
12456 "src/main/resources/org/fusesource/jansi/internal"))))
12457 (build-system ant-build-system)
12458 (arguments
12459 `(#:jar-name "jansi.jar"
12460 #:source-dir "src/main/java"
12461 #:test-dir "src/test"
12462 #:tests? #f; require junit 3
12463 #:phases
12464 (modify-phases %standard-phases
12465 (add-before 'build 'build-native
12466 (lambda* (#:key inputs #:allow-other-keys)
12467 (with-directory-excursion "src/main/native"
12468 (for-each
12469 (lambda (cfile)
12470 (let ((cfile (basename cfile))
12471 (ofile (string-append (basename cfile ".c") ".o")))
12472 (invoke ,(cc-for-target) "-c" cfile "-o" ofile
12473 (string-append "-I" (assoc-ref inputs "jdk")
12474 "/include/linux")
12475 "-fPIC" "-O2")))
12476 (find-files "." "\\.c$"))
12477 (apply invoke ,(cc-for-target) "-o" "libjansi.so" "-shared"
12478 (find-files "." "\\.o$")))))
12479 (add-before 'build 'install-native
12480 (lambda _
12481 (let ((dir (string-append "build/classes/org/fusesource/"
12482 "jansi/internal/native/"
12483 ,(match (or (%current-target-system) (%current-system))
12484 ("i686-linux" "Linux/x86")
12485 ("x86_64-linux" "Linux/x86_64")
12486 ("armhf-linux" "Linux/armv7")
12487 ("aarch64-linux" "Linux/arm64")
12488 ("mips64el-linux" "Linux/mips64")
12489 (_ "unknown-kernel")))))
12490 (install-file "src/main/native/libjansi.so" dir))))
12491 (add-before 'build 'copy-resources
12492 (lambda _
12493 (copy-recursively "src/main/resources" "build/classes")))
12494 (replace 'install
12495 (install-from-pom "pom.xml")))))
12496 (home-page "https://fusesource.github.io/jansi/")
12497 (synopsis "Portable ANSI escape sequences")
12498 (description "Jansi is a Java library that allows you to use ANSI escape
12499sequences to format your console output which works on every platform.")
12500 (license license:asl2.0)))
12501
12502(define-public java-jansi-1
12503 (package
12504 (inherit java-jansi)
12505 (version "1.16")
12506 (source (origin
12507 (method git-fetch)
12508 (uri (git-reference
12509 (url "https://github.com/fusesource/jansi")
12510 (commit (string-append "jansi-project-" version))))
12511 (file-name (git-file-name "jansi" version))
12512 (sha256
12513 (base32
12514 "0ikk0x352gh30b42qn1jd89xwsjj0mavrc5kms7fss15bd8vsayx"))))
12515 (arguments
12516 `(#:jar-name "jansi.jar"
12517 #:source-dir "jansi/src/main/java"
12518 #:test-dir "jansi/src/test"
12519 #:phases
12520 (modify-phases %standard-phases
12521 (add-after 'check 'clear-term
12522 (lambda _
12523 (invoke "echo" "-e" "\\e[0m")))
12524 (add-before 'install 'install-parent
12525 (install-pom-file "pom.xml"))
12526 (add-before 'install 'fix-pom
12527 (lambda _
12528 ;; pom adds jansi native versions for different platforms, but we
12529 ;; only need one, so use native instead
12530 (substitute* "jansi/pom.xml"
12531 (("windows32") "native")
12532 (("windows64") "native")
12533 (("osx") "native")
12534 (("linux32") "native")
12535 (("linux64") "native")
12536 (("freebsd32") "native")
12537 (("freebsd64") "native"))
12538 #t))
12539 (replace 'install
12540 (install-from-pom "jansi/pom.xml")))))
12541 (propagated-inputs
12542 (list java-jansi-native))
12543 (native-inputs
12544 (list java-junit java-hamcrest-core))))
12545
12546(define-public java-jboss-el-api-spec
12547 (package
12548 (name "java-jboss-el-api-spec")
12549 (version "3.0")
12550 (source (origin
12551 (method url-fetch)
12552 (uri (string-append "https://github.com/jboss/jboss-el-api_spec/"
12553 "archive/jboss-el-api_" version
12554 "_spec-1.0.7.Final.tar.gz"))
12555 (sha256
12556 (base32
12557 "1j45ljxalwlibxl7g7iv952sjxkw275m8vyxxij8l6wdd5pf0pdh"))))
12558 (build-system ant-build-system)
12559 (arguments
12560 `(#:jar-name "java-jboss-el-api_spec.jar"
12561 #:phases
12562 (modify-phases %standard-phases
12563 ;; the origin of javax.el:javax.el-api is unknown, so we use this package
12564 ;; instead, which implements the same thing. We override the pom file
12565 ;; to "rename" the package so it can be found by maven.
12566 (add-before 'install 'override-pom
12567 (generate-pom.xml "pom.xml" "javax.el" "javax.el-api" "3.0"
12568 #:name "el-api"))
12569 (replace 'install
12570 (install-from-pom "pom.xml")))))
12571 (inputs
12572 (list java-junit))
12573 (home-page "https://github.com/jboss/jboss-el-api_spec")
12574 (synopsis "JSR-341 expression language 3.0 API")
12575 (description "This package contains an implementation of the JSR-341
12576specification for the expression language 3.0. It implements an expression
12577language inspired by ECMAScript and XPath. This language is used with
12578JavaServer Pages (JSP).")
12579 ;; Either GPL2 only or CDDL.
12580 (license (list license:gpl2 license:cddl1.1))))
12581
12582(define-public java-jboss-interceptors-api-spec
12583 (package
12584 (name "java-jboss-interceptors-api-spec")
12585 (version "1.2")
12586 (source (origin
12587 (method url-fetch)
12588 (uri (string-append "https://github.com/jboss/jboss-interceptors-api_spec/"
12589 "archive/jboss-interceptors-api_" version
12590 "_spec-1.0.0.Final.tar.gz"))
12591 (sha256
12592 (base32
12593 "0wv8x0jp9a5qxlrgkhb5jdk2gr6vi87b4j4kjb8ryxiy9gn8g51z"))))
12594 (build-system ant-build-system)
12595 (arguments
12596 `(#:jar-name "java-jboss-interceptors-api_spec.jar"
12597 #:jdk ,icedtea-8
12598 #:source-dir "."
12599 #:tests? #f; no tests
12600 #:phases
12601 (modify-phases %standard-phases
12602 ;; the origin of javax.interceptor:javax.interceptor-api is unknown,
12603 ;; so we use this package instead, which implements the same thing.
12604 ;; We override the pom file to "rename" the package so it can be found
12605 ;; by maven.
12606 (add-before 'install 'override-pom
12607 (generate-pom.xml "pom.xml" "javax.interceptor" "javax.interceptor-api"
12608 "3.0" #:name "interceptor-api"))
12609 (replace 'install
12610 (install-from-pom "pom.xml")))))
12611 (home-page "https://github.com/jboss/jboss-interceptors-api_spec")
12612 (synopsis "Interceptors 1.2 API classes from JSR 318")
12613 (description "Java-jboss-interceptors-api-spec implements the Interceptors
12614API. Interceptors are used to interpose on business method invocations and
12615specific events.")
12616 ;; Either GPL2 only or CDDL.
12617 (license (list license:gpl2 license:cddl1.1))))
12618
12619(define-public java-cdi-api
12620 (package
12621 (name "java-cdi-api")
12622 (version "2.0")
12623 (source (origin
12624 (method url-fetch)
12625 (uri (string-append "https://github.com/cdi-spec/cdi/archive/"
12626 version ".tar.gz"))
12627 (file-name (string-append name "-" version ".tar.gz"))
12628 (sha256
12629 (base32
12630 "1iv8b8bp07c5kmqic14jsr868vycjv4qv02lf3pkgp9z21mnfg5y"))))
12631 (build-system ant-build-system)
12632 (arguments
12633 `(#:source-dir "api/src/main/java"
12634 #:jar-name "java-cdi-api.jar"
12635 #:test-dir "api/src/test"
12636 #:jdk ,icedtea-8
12637 #:tests? #f; Tests fail because we don't have a CDI provider yet
12638 #:phases
12639 (modify-phases %standard-phases
12640 (replace 'install
12641 (install-from-pom "api/pom.xml")))))
12642 (propagated-inputs
12643 (list java-javax-inject java-jboss-el-api-spec
12644 java-jboss-interceptors-api-spec java-weld-parent-pom))
12645 (native-inputs
12646 (list java-testng java-hamcrest-core))
12647 (home-page "https://cdi-spec.org/")
12648 (synopsis "Contexts and Dependency Injection APIs")
12649 (description "Java-cdi-api contains the required APIs for Contexts and
12650Dependency Injection (CDI).")
12651 (license license:asl2.0)))
12652
12653(define-public java-joda-convert
12654 (package
12655 (name "java-joda-convert")
12656 (version "1.9.2")
12657 (source (origin
12658 (method url-fetch)
12659 (uri (string-append "https://github.com/JodaOrg/joda-convert/archive/v"
12660 version ".tar.gz"))
12661 (file-name (string-append name "-" version ".tar.gz"))
12662 (sha256
12663 (base32
12664 "0vp346xz7dh9br4q7xazhc7hvzf76a6hf95fki9bg67q5jr0kjh7"))))
12665 (build-system ant-build-system)
12666 (arguments
12667 `(#:jar-name (string-append ,name "-" ,version ".jar")
12668 #:source-dir "src/main/java"
12669 #:test-include (list "**/Test*.java")
12670 ;; Contains only interfaces and base classes (no test)
12671 #:test-exclude (list "**/test*/**.java")))
12672 (inputs
12673 (list java-guava))
12674 (native-inputs
12675 (list java-junit java-hamcrest-core))
12676 (home-page "https://www.joda.org/joda-convert/")
12677 (synopsis "Conversion between Objects and Strings")
12678 (description "Joda-Convert provides a small set of classes to aid
12679conversion between Objects and Strings. It is not intended to tackle the
12680wider problem of Object to Object transformation.")
12681 (license license:asl2.0)))
12682
12683(define-public java-joda-time
12684 (package
12685 (name "java-joda-time")
12686 (version "2.9.9")
12687 (source (origin
12688 (method url-fetch)
12689 (uri (string-append "https://github.com/JodaOrg/joda-time/archive/v"
12690 version ".tar.gz"))
12691 (file-name (string-append name "-" version ".tar.gz"))
12692 (sha256
12693 (base32
12694 "1i9x91mi7yg2pasl0k3912f1pg46n37sps6rdb0v1gs8hj9ppwc1"))))
12695 (build-system ant-build-system)
12696 (arguments
12697 `(#:jar-name "java-joda-time.jar"
12698 #:source-dir "src/main/java"
12699 #:test-include (list "**/Test*.java")
12700 ;; There is no runnable test in these files
12701 #:test-exclude (list "**/Test*Chronology.java" "**/Test*Field.java")
12702 #:phases
12703 (modify-phases %standard-phases
12704 (add-after 'build 'build-resources
12705 (lambda _
12706 (mkdir-p "build/classes/org/joda/time/tz/data")
12707 (mkdir-p "build/classes/org/joda/time/format")
12708 ;; This will produce the following exception:
12709 ;; java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap"
12710 ;; which is normal, because it doesn't exist yet. It still generates
12711 ;; the same file as in the binary one can find on maven.
12712 (invoke "java" "-cp"
12713 (string-append "build/classes:" (getenv "CLASSPATH"))
12714 "org.joda.time.tz.ZoneInfoCompiler"
12715 "-src" "src/main/java/org/joda/time/tz/src"
12716 "-dst" "build/classes/org/joda/time/tz/data"
12717 "africa" "antarctica" "asia" "australasia"
12718 "europe" "northamerica" "southamerica"
12719 "pacificnew" "etcetera" "backward" "systemv")
12720 (for-each (lambda (f)
12721 (copy-file f (string-append
12722 "build/classes/org/joda/time/format/"
12723 (basename f))))
12724 (find-files "src/main/java/org/joda/time/format" ".*.properties"))
12725 #t))
12726 (add-before 'install 'regenerate-jar
12727 (lambda _
12728 ;; We need to regenerate the jar file to add generated data.
12729 (delete-file "build/jar/java-joda-time.jar")
12730 (invoke "ant" "jar")))
12731 (add-before 'check 'copy-test-resources
12732 (lambda _
12733 (mkdir-p "build/test-classes/org/joda/time/tz/data")
12734 (copy-file "src/test/resources/tzdata/ZoneInfoMap"
12735 "build/test-classes/org/joda/time/tz/data/ZoneInfoMap")
12736 (copy-recursively "src/test/resources" "build/test-classes")
12737 #t)))))
12738 (inputs
12739 (list java-joda-convert))
12740 (native-inputs
12741 (list java-junit java-hamcrest-core tzdata))
12742 (home-page "https://www.joda.org/joda-time/")
12743 (synopsis "Replacement for the Java date and time classes")
12744 (description "Joda-Time is a replacement for the Java date and time
12745classes prior to Java SE 8.")
12746 (license license:asl2.0)))
12747
12748(define-public java-xerces
12749 (package
12750 (name "java-xerces")
12751 (version "2.12.2")
12752 (source
12753 (origin
12754 (method url-fetch)
12755 (uri (string-append "mirror://apache/xerces/j/source/"
12756 "Xerces-J-src." version ".tar.gz"))
12757 (sha256
12758 (base32 "1s2fnfx5flmhs3q30bxdsa6vs52m6vbnqd3m4cc5r4wfr3afplbd"))
12759 (patches (search-patches
12760 "java-xerces-xjavac_taskdef.patch"
12761 "java-xerces-build_dont_unzip.patch"
12762 "java-xerces-bootclasspath.patch"))))
12763 (build-system ant-build-system)
12764 (arguments
12765 `(#:tests? #f;; Test files are not present
12766 #:test-target "test"
12767 #:jdk ,icedtea-8
12768 #:phases
12769 (modify-phases %standard-phases
12770 (add-after 'unpack 'create-build.properties
12771 (lambda* (#:key inputs #:allow-other-keys)
12772 (let ((jaxp (assoc-ref inputs "java-jaxp"))
12773 (resolver (assoc-ref inputs "java-apache-xml-commons-resolver")))
12774 (with-output-to-file "build.properties"
12775 (lambda _
12776 (format #t
12777 "jar.jaxp = ~a/share/java/jaxp.jar~@
12778 jar.apis-ext = ~a/share/java/jaxp.jar~@
12779 jar.resolver = ~a/share/java/xml-resolver.jar~%"
12780 jaxp jaxp resolver)))
12781 ;; Make xerces use our version of jaxp in tests
12782 (substitute* "build.xml"
12783 (("xml-apis.jar")
12784 (string-append jaxp "/share/java/jaxp.jar"))
12785 (("\\$\\{tools.dir\\}/\\$\\{jar.apis\\}")
12786 "${jar.apis}")))
12787 #t))
12788 (replace 'install (install-jars "build")))))
12789 (inputs
12790 (list java-apache-xml-commons-resolver java-jaxp))
12791 (home-page "https://xerces.apache.org/xerces2-j/")
12792 (synopsis "Validating XML parser for Java with DOM level 3 support")
12793 (description "The Xerces2 Java parser is the reference implementation of
12794XNI, the Xerces Native Interface, and also a fully conforming XML Schema
12795processor.
12796
12797Xerces2-J supports the following standards and APIs:
12798
12799@itemize
12800@item eXtensible Markup Language (XML) 1.0 Second Edition Recommendation
12801@item Namespaces in XML Recommendation
12802@item Document Object Model (DOM) Level 2 Core, Events, and Traversal and
12803 Range Recommendations
12804@item Simple API for XML (SAX) 2.0.1 Core and Extension
12805@item Java APIs for XML Processing (JAXP) 1.2.01
12806@item XML Schema 1.0 Structures and Datatypes Recommendations
12807@item Experimental implementation of the Document Object Model (DOM) Level 3
12808 Core and Load/Save Working Drafts
12809@item Provides a partial implementation of the XML Inclusions (XInclude) W3C
12810 Candidate Recommendation
12811@end itemize
12812
12813Xerces is now able to parse documents written according to the XML 1.1
12814Candidate Recommendation, except that it does not yet provide an option to
12815enable normalization checking as described in section 2.13 of this
12816specification. It also handles namespaces according to the XML Namespaces 1.1
12817Candidate Recommendation, and will correctly serialize XML 1.1 documents if
12818the DOM level 3 load/save API's are in use.")
12819 (license license:asl2.0)))
12820
12821(define-public java-jakarta-regexp
12822 (package
12823 (name "java-jakarta-regexp")
12824 (version "1.5")
12825 (source
12826 (origin
12827 (method url-fetch)
12828 (uri (string-append
12829 "https://archive.apache.org/dist/jakarta/regexp/jakarta-regexp-"
12830 version ".tar.gz"))
12831 (sha256
12832 (base32
12833 "0zg9rmyif48dck0cv6ynpxv23mmcsx265am1fnnxss7brgw0ms3r"))))
12834 (build-system ant-build-system)
12835 (arguments
12836 `(#:test-target "test"
12837 #:phases
12838 (modify-phases %standard-phases
12839 (replace 'install
12840 (lambda* (#:key outputs #:allow-other-keys)
12841 (let* ((out (assoc-ref outputs "out"))
12842 (out-share (string-append out "/share/java")))
12843 (mkdir-p out-share)
12844 (for-each (lambda (name)
12845 (install-file name out-share))
12846 (find-files "build" "^jakarta-regexp-.*\\.jar$"))
12847 #t))))))
12848 (home-page "https://attic.apache.org/projects/jakarta-regexp.html")
12849 (synopsis "Regular expression parser generator for Java")
12850 (description "@code{jakarta-regexp} is an old regular expression parser
12851generator for Java.")
12852 (license license:asl2.0)))
12853
12854(define-public java-jline
12855 (package
12856 (name "java-jline")
12857 (version "1.0")
12858 (source (origin
12859 (method url-fetch)
12860 (uri (string-append "https://github.com/jline/jline1/archive/jline-"
12861 version ".tar.gz"))
12862 (sha256
12863 (base32
12864 "0bi3p6vrh7a6v0fbpb6rx9plpmx5zk3lr352xzdbz2jcxg499wir"))))
12865 (build-system ant-build-system)
12866 (arguments
12867 `(#:jar-name "jline.jar"
12868 #:source-dir "src/main/java"
12869 #:test-dir "src/test"
12870 #:phases
12871 (modify-phases %standard-phases
12872 (add-before 'build 'copy-resources
12873 (lambda _
12874 (copy-recursively "src/main/resources" "build/classes")
12875 #t)))))
12876 (native-inputs
12877 (list java-junit))
12878 (home-page "https://jline.github.io")
12879 (synopsis "Console input handling library")
12880 (description "JLine is a Java library for handling console input. It is
12881similar in functionality to BSD editline and GNU readline but with additional
12882features that bring it on par with the Z shell line editor.")
12883 (license license:bsd-3)))
12884
12885(define-public java-jline-2
12886 (package
12887 (inherit java-jline)
12888 (version "2.14.5")
12889 (source (origin
12890 (method url-fetch)
12891 (uri (string-append "https://github.com/jline/jline2/archive/jline-"
12892 version ".tar.gz"))
12893 (sha256
12894 (base32
12895 "1c6qa26mf0viw8hg4jnv72s7i1qb1gh1l8rrzcdvqhqhx82rkdlf"))))
12896 (arguments
12897 `(#:jdk ,icedtea-8
12898 ,@(package-arguments java-jline)))
12899 (inputs
12900 (list java-jansi-1 java-jansi-native))
12901 (native-inputs
12902 (list java-powermock-modules-junit4
12903 java-powermock-modules-junit4-common
12904 java-powermock-api-easymock
12905 java-powermock-api-support
12906 java-powermock-core
12907 java-powermock-reflect
12908 java-easymock
12909 java-jboss-javassist
12910 java-objenesis
12911 java-hamcrest-core
12912 java-cglib
12913 java-junit
12914 java-hawtjni))))
12915
12916(define-public java-jline-terminal
12917 (package
12918 (name "java-jline-terminal")
12919 (version "3.14.1")
12920 (source (origin
12921 (method git-fetch)
12922 (uri (git-reference
12923 (url "https://github.com/jline/jline3")
12924 (commit (string-append "jline-parent-" version))))
12925 (file-name (git-file-name name version))
12926 (sha256
12927 (base32
12928 "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr"))))
12929 (build-system ant-build-system)
12930 (arguments
12931 `(#:jar-name "jline-terminal.jar"
12932 #:jdk ,openjdk11
12933 #:tests? #f; TODO: tests fail on *.caps resource lookups
12934 #:source-dir "terminal/src/main/java"
12935 #:test-dir "terminal/src/test"
12936 #:phases
12937 (modify-phases %standard-phases
12938 (add-after 'unpack 'remove-build-file
12939 (lambda _
12940 ;; Conflicts with build directory generated by ant-build-system.
12941 (delete-file "build")))
12942 (add-after 'unpack 'patch-paths
12943 (lambda* (#:key inputs #:allow-other-keys)
12944 (substitute* "terminal/src/main/java/org/jline/utils/OSUtils.java"
12945 (("= \"infocmp\"")
12946 (string-append "= \"" (assoc-ref inputs "ncurses")
12947 "/bin/infocmp\""))
12948 (("= \"(s?tty)\"" _ cmd)
12949 (string-append "= \"" (assoc-ref inputs "coreutils")
12950 "/bin/" cmd "\"")))))
12951 ;; Resources are not added to the JAR by ant-build-system.
12952 (add-after 'build 'add-resources
12953 (lambda* (#:key jar-name source-dir #:allow-other-keys)
12954 (let ((build (string-append (getcwd) "/build")))
12955 (with-directory-excursion
12956 (string-append source-dir "/../resources")
12957 (apply invoke "jar" "-uvf"
12958 (string-append build "/jar/" jar-name)
12959 (find-files ".")))))))))
12960 (inputs
12961 (list ncurses)); infocmp
12962 (home-page "https://github.com/jline/jline3")
12963 (synopsis "Java JLine Terminal API and implementations")
12964 (description "JLine is a Java library for handling console input. It is
12965similar in functionality to BSD editline and GNU readline but with additional
12966features that bring it in par with ZSH line editor. People familiar with the
12967readline/editline capabilities for modern shells (such as bash and tcsh) will
12968find most of the command editing features of JLine to be familiar.
12969
12970This package includes the @var{Terminal} API and implementations.")
12971 (license license:bsd-3)))
12972
12973(define-public java-jline-reader
12974 (package
12975 (name "java-jline-reader")
12976 (version "3.14.1")
12977 (source (origin
12978 (method git-fetch)
12979 (uri (git-reference
12980 (url "https://github.com/jline/jline3")
12981 (commit (string-append "jline-parent-" version))))
12982 (file-name (git-file-name name version))
12983 (sha256
12984 (base32
12985 "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr"))))
12986 (build-system ant-build-system)
12987 (arguments
12988 `(#:jar-name "jline-reader.jar"
12989 #:jdk ,openjdk11
12990 #:source-dir "reader/src/main/java"
12991 #:test-dir "reader/src/test"
12992 #:phases
12993 (modify-phases %standard-phases
12994 (add-before 'build 'remove-build-file
12995 (lambda _
12996 ;; conflicts with build directory generated by ant-build-system
12997 (delete-file "build"))))))
12998 (native-inputs
12999 (list java-junit java-easymock))
13000 (inputs
13001 (list java-jline-terminal))
13002 (home-page "https://github.com/jline/jline3")
13003 (synopsis "Java JLine line reader")
13004 (description "JLine is a Java library for handling console input. It is
13005similar in functionality to BSD editline and GNU readline but with additional
13006features that bring it in par with ZSH line editor. People familiar with the
13007readline/editline capabilities for modern shells (such as bash and tcsh) will
13008find most of the command editing features of JLine to be familiar.
13009
13010This package includes the line reader.")
13011 (license license:bsd-3)))
13012
13013(define-public java-xmlunit
13014 (package
13015 (name "java-xmlunit")
13016 (version "2.5.1")
13017 (source (origin
13018 (method url-fetch)
13019 (uri (string-append "https://github.com/xmlunit/xmlunit/archive/v"
13020 version ".tar.gz"))
13021 (file-name (string-append name "-" version ".tar.gz"))
13022 (sha256
13023 (base32
13024 "035rivlnmwhfqj0fzviciv0bkh1h95ps1iwnh2kjcvdbk5nccm4z"))))
13025 (build-system ant-build-system)
13026 (arguments
13027 `(#:jar-name "java-xmlunit.jar"
13028 #:source-dir "xmlunit-core/src/main/java"
13029 #:test-dir "xmlunit-core/src/test"
13030 #:phases
13031 (modify-phases %standard-phases
13032 (add-before 'check 'copy-test-resources
13033 (lambda* (#:key inputs #:allow-other-keys)
13034 (copy-recursively (assoc-ref inputs "resources") "../test-resources")
13035 #t)))))
13036 (native-inputs
13037 `(("java-junit" ,java-junit)
13038 ("java-mockito-1" ,java-mockito-1)
13039 ("java-hamcrest-all" ,java-hamcrest-all)
13040 ("java-objenesis" ,java-objenesis)
13041 ("java-cglib" ,java-cglib)
13042 ("resources"
13043 ,(origin
13044 (method git-fetch)
13045 (uri (git-reference
13046 (url "https://github.com/xmlunit/test-resources")
13047 (commit "a590d2ae865c3e0455691d76ba8eefccc2215aec")))
13048 (file-name "java-xmlunit-test-resources")
13049 (sha256
13050 (base32
13051 "0r0glj37pg5l868yjz78gckr91cs8fysxxbp9p328dssssi91agr"))))))
13052 (home-page "https://www.xmlunit.org/")
13053 (synopsis "XML output testing")
13054 (description "XMLUnit provides you with the tools to verify the XML you
13055emit is the one you want to create. It provides helpers to validate against
13056an XML Schema, assert the values of XPath queries or compare XML documents
13057against expected outcomes.")
13058 (license license:asl2.0)))
13059
13060(define-public java-xmlunit-legacy
13061 (package
13062 (inherit java-xmlunit)
13063 (name "java-xmlunit-legacy")
13064 (arguments
13065 `(#:jar-name "java-xmlunit-legacy.jar"
13066 #:source-dir "xmlunit-legacy/src/main/java"
13067 #:test-dir "xmlunit-legacy/src/test"))
13068 (inputs
13069 (list java-xmlunit java-junit))
13070 (native-inputs
13071 `(("java-mockito-1" ,java-mockito-1)))))
13072
13073(define-public java-xmlunit-matchers
13074 (package
13075 (inherit java-xmlunit)
13076 (name "java-xmlunit-matchers")
13077 (arguments
13078 `(#:jar-name "java-xmlunit-matchers.jar"
13079 #:source-dir "xmlunit-matchers/src/main/java"
13080 #:test-dir "xmlunit-matchers/src/test"
13081 #:test-exclude
13082 ;; Cannot open xsd for http://www.xmlunit.org/test-support/Book.xsd
13083 (list "**/ValidationMatcherTest.java")
13084 #:phases
13085 (modify-phases %standard-phases
13086 (add-before 'build 'copy-test-class
13087 (lambda _
13088 (copy-file "xmlunit-core/src/test/java/org/xmlunit/TestResources.java"
13089 "xmlunit-matchers/src/test/java/org/xmlunit/TestResources.java")
13090 #t))
13091 (add-before 'build 'fix-test-resources-path
13092 (lambda _
13093 (substitute* (find-files "xmlunit-matchers/src/test" ".*.java")
13094 (("../test-resources") "test-resources"))
13095 #t))
13096 (add-before 'check 'copy-test-resources
13097 (lambda* (#:key inputs #:allow-other-keys)
13098 (copy-recursively (assoc-ref inputs "resources") "test-resources")
13099 #t)))))
13100 (inputs
13101 (list java-xmlunit java-junit))))
13102
13103(define-public java-openchart2
13104 (package
13105 (name "java-openchart2")
13106 (version "1.4.3")
13107 (source (origin
13108 (method url-fetch)
13109 (uri (string-append "http://download.approximatrix.com/openchart2/"
13110 "openchart2-" version ".source.zip"))
13111 (sha256
13112 (base32
13113 "1xq96zm5r02n1blja0072jmmsifmxc40lbyfbnmcnr6mw42frh4g"))))
13114 (build-system ant-build-system)
13115 (arguments
13116 `(#:test-target "test"
13117 #:phases
13118 (modify-phases %standard-phases
13119 (add-after 'unpack 'fix-junit-errors
13120 (lambda _
13121 (with-directory-excursion "unittest/src/com/approximatrix/charting/"
13122 (substitute* '("coordsystem/ticklocator/NumericXTickLocatorTest.java"
13123 "coordsystem/ticklocator/NumericYTickLocatorTest.java"
13124 "coordsystem/ticklocator/ObjectXTickLocatorTest.java"
13125 "model/DefaultChartDataModelConstraintsTest.java"
13126 "model/MultiScatterDataModelConstraintsTest.java"
13127 "model/threedimensional/DotPlotDataModelConstraintsTest.java")
13128 (("(assertEquals[^;]+);" before _)
13129 (string-append (string-drop-right before 2) ", 1E-6);"))))
13130 #t))
13131 (replace 'install (install-jars ".")))))
13132 (native-inputs
13133 (list unzip java-junit java-hamcrest-core))
13134 (home-page "https://approximatrix.com/products/openchart2/")
13135 (synopsis "Simple plotting for Java")
13136 (description "Openchart2 provides a simple, yet powerful, interface for
13137Java programmers to create two-dimensional charts and plots. The library
13138features an assortment of graph styles, including advanced scatter plots, bar
13139graphs, and pie charts.")
13140 (license license:lgpl2.1+)))
13141
13142(define-public java-commons-httpclient
13143 (package
13144 (name "java-commons-httpclient")
13145 (version "3.1")
13146 (source (origin
13147 (method url-fetch)
13148 (uri (string-append "mirror://apache/httpcomponents/"
13149 "commons-httpclient/source/commons-httpclient-"
13150 version "-src.tar.gz"))
13151 (sha256
13152 (base32
13153 "1wlpn3cfy3d4inxy6g7wxcsa8p7sshn6aldk9y4ia3lb879rd97r"))))
13154 (build-system ant-build-system)
13155 (arguments
13156 `(#:build-target "compile"
13157 #:test-target "test"
13158 #:tests? #f; requires junit-textui (junit 3)
13159 #:phases
13160 (modify-phases %standard-phases
13161 (add-before 'build 'fix-accent
13162 (lambda _
13163 (for-each (lambda (file)
13164 (with-fluids ((%default-port-encoding "ISO-8859-1"))
13165 (substitute* file
13166 (("\\* @author Ortwin .*") "* @author Ortwin Glueck\n"))))
13167 '("src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java"
13168 "src/examples/TrivialApp.java" "src/examples/ClientApp.java"
13169 "src/test/org/apache/commons/httpclient/TestHttps.java"
13170 "src/test/org/apache/commons/httpclient/TestURIUtil2.java"))
13171 #t))
13172 (replace 'install
13173 (lambda* (#:key outputs #:allow-other-keys)
13174 (invoke "ant" "dist"
13175 (string-append "-Ddist.home=" (assoc-ref outputs "out")
13176 "/share/java"))
13177 #t)))))
13178 (propagated-inputs
13179 `(("java-commons-logging" ,java-commons-logging-minimal)
13180 ("java-commons-codec" ,java-commons-codec)))
13181 (home-page "https://hc.apache.org")
13182 (synopsis "HTTP/1.1 compliant HTTP agent implementation")
13183 (description "This package contains an HTTP/1.1 compliant HTTP agent
13184implementation. It also provides reusable components for client-side
13185authentication, HTTP state management, and HTTP connection management.")
13186 (license license:asl2.0)))
13187
13188(define-public java-commons-vfs
13189 (package
13190 (name "java-commons-vfs")
13191 (version "2.2")
13192 (source (origin
13193 (method url-fetch)
13194 (uri (string-append "mirror://apache/commons/vfs/source/"
13195 "commons-vfs2-distribution-" version "-src.tar.gz"))
13196 (file-name (string-append name "-" version ".tar.gz"))
13197 (sha256
13198 (base32
13199 "1cnq1iaghbp4cslpnvwbp83i5v234x87irssqynhwpfgw7caf1s3"))
13200 (modules '((guix build utils)))
13201 (snippet
13202 '(begin
13203 (for-each delete-file
13204 (find-files "." "\\.jar$"))
13205 #t))))
13206 (build-system ant-build-system)
13207 (arguments
13208 `(#:jar-name "commons-vfs.jar"
13209 #:source-dir "commons-vfs2/src/main/java"
13210 #:test-dir "commons-vfs2/src/test"
13211 ; FIXME: tests depend on many things: apache sshd, hadoop, ftpserver, ...
13212 #:tests? #f
13213 #:phases
13214 (modify-phases %standard-phases
13215 (add-before 'build 'remove-hadoop-and-webdav
13216 ; Remove these files as they are not required and depend on difficult
13217 ; packages.
13218 (lambda _
13219 (for-each delete-file-recursively
13220 '("commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/webdav"
13221 "commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs"))
13222 #t)))))
13223 (inputs
13224 (list java-commons-collections4
13225 java-commons-compress
13226 java-commons-httpclient
13227 java-commons-logging-minimal
13228 java-commons-net
13229 java-jsch))
13230 (home-page "https://commons.apache.org/proper/commons-vfs/")
13231 (synopsis "Java file system library")
13232 (description "Commons VFS provides a single API for accessing various
13233different file systems. It presents a uniform view of the files from various
13234different sources, such as the files on local disk, on an HTTP server, or
13235inside a Zip archive.")
13236 (license license:asl2.0)))
13237
13238(define-public java-jakarta-oro
13239 (package
13240 (name "java-jakarta-oro")
13241 (version "2.0.8")
13242 (source (origin
13243 (method url-fetch)
13244 (uri (string-append "mirror://apache/jakarta/oro/"
13245 "jakarta-oro-" version ".tar.gz"))
13246 (sha256
13247 (base32
13248 "0rpmnsskiwmsy8r0sckz5n5dbvh3vkxx8hpm177c754r8xy3qksc"))
13249 (modules '((guix build utils)))
13250 (snippet
13251 `(begin
13252 (delete-file (string-append "jakarta-oro-" ,version ".jar"))
13253 #t))))
13254 (build-system ant-build-system)
13255 (arguments
13256 `(#:build-target "package"
13257 #:make-flags (list "-DDATE" "(no recorded date for reproducibility)")
13258 #:tests? #f; tests are run as part of the build process
13259 #:phases
13260 (modify-phases %standard-phases
13261 (replace 'install
13262 (install-jars ,(string-append "jakarta-oro-" version))))))
13263 (home-page "https://jakarta.apache.org/oro/")
13264 (synopsis "Text-processing for Java")
13265 (description "The Jakarta-ORO Java classes are a set of text-processing
13266Java classes that provide Perl5 compatible regular expressions, AWK-like
13267regular expressions, glob expressions, and utility classes for performing
13268substitutions, splits, filtering filenames, etc. This library is the successor
13269of the OROMatcher, AwkTools, PerlTools, and TextTools libraries originally
13270from ORO, Inc.")
13271 (license license:asl1.1)))
13272
13273(define-public java-native-access
13274 (package
13275 (name "java-native-access")
13276 (version "4.5.1")
13277 (source (origin
13278 (method url-fetch)
13279 (uri (string-append "https://github.com/java-native-access/jna/"
13280 "archive/" version ".tar.gz"))
13281 (file-name (string-append name "-" version ".tar.gz"))
13282 (sha256
13283 (base32
13284 "0zrpzkib6b905i018a9pqlzkqinphywr6y4jwv6mwp63jjqvqkd9"))
13285 (modules '((guix build utils)))
13286 (snippet
13287 `(begin
13288 (for-each delete-file (find-files "." ".*.jar"))
13289 (delete-file-recursively "native/libffi")
13290 (delete-file-recursively "dist")
13291 #t))))
13292 (build-system ant-build-system)
13293 (arguments
13294 `(#:tests? #f; FIXME: tests require reflections.jar
13295 #:test-target "test"
13296 #:make-flags (list "-Ddynlink.native=true")
13297 #:phases
13298 (modify-phases %standard-phases
13299 (add-before 'build 'fix-build.xml
13300 (lambda* (#:key inputs #:allow-other-keys)
13301 (substitute* "build.xml"
13302 ;; Since we removed the bundled ant.jar, give the correct path
13303 (("lib/ant.jar") (search-input-file inputs "/lib/ant.jar"))
13304 ;; We removed generated native libraries. We can only rebuild one
13305 ;; so don't fail if we can't find a native library for another architecture.
13306 (("zipfileset") "zipfileset erroronmissingarchive=\"false\""))
13307 ;; Copy test dependencies
13308 (copy-file (car (find-files (assoc-ref inputs "java-junit") "jar$"))
13309 "lib/junit.jar")
13310 (copy-file (car (find-files (assoc-ref inputs "java-hamcrest-core")
13311 "jar$"))
13312 "lib/hamcrest-core.jar")
13313 ;; FIXME: once reflections.jar is built, copy it to lib/test.
13314 #t))
13315 (add-before 'build 'build-native
13316 (lambda _
13317 (invoke "ant" "-Ddynlink.native=true" "native")
13318 #t))
13319 (replace 'install
13320 (install-jars "build")))))
13321 (inputs
13322 (list libffi libx11 libxt))
13323 (native-inputs
13324 (list gcc-7 java-junit java-hamcrest-core))
13325 (home-page "https://github.com/java-native-access/jna")
13326 (synopsis "Access to native shared libraries from Java")
13327 (description "JNA provides Java programs easy access to native shared
13328libraries without writing anything but Java code - no JNI or native code is
13329required. JNA allows you to call directly into native functions using natural
13330Java method invocation.")
13331 ;; Java Native Access project (JNA) is dual-licensed under 2
13332 ;; alternative Free licenses: LGPL 2.1 or later and Apache License 2.0.
13333 (license (list
13334 license:asl2.0
13335 license:lgpl2.1+))))
13336
13337(define-public java-native-access-platform
13338 (package
13339 (inherit java-native-access)
13340 (name "java-native-access-platform")
13341 (arguments
13342 `(#:test-target "test"
13343 #:tests? #f; require jna-test.jar
13344 #:phases
13345 (modify-phases %standard-phases
13346 (add-before 'build 'chdir
13347 (lambda _
13348 (chdir "contrib/platform")
13349 #t))
13350 (add-after 'chdir 'fix-ant
13351 (lambda* (#:key inputs #:allow-other-keys)
13352 (substitute* "nbproject/project.properties"
13353 (("../../build/jna.jar")
13354 (search-input-file inputs "/share/java/jna.jar"))
13355 (("../../lib/hamcrest-core-.*.jar")
13356 (car (find-files (assoc-ref inputs "java-hamcrest-core")
13357 "jar$")))
13358 (("../../lib/junit.jar")
13359 (car (find-files (assoc-ref inputs "java-junit")
13360 "jar$"))))
13361 #t))
13362 (replace 'install
13363 (install-jars "dist")))))
13364 (inputs
13365 (list java-native-access))
13366 (synopsis "Cross-platform mappings for jna")
13367 (description "java-native-access-platform has cross-platform mappings
13368and mappings for a number of commonly used platform functions, including a
13369large number of Win32 mappings as well as a set of utility classes that
13370simplify native access.")))
13371
13372(define-public java-jsch-agentproxy-core
13373 (package
13374 (name "java-jsch-agentproxy-core")
13375 (version "0.0.8")
13376 (source (origin
13377 (method url-fetch)
13378 (uri (string-append "https://github.com/ymnk/jsch-agent-proxy/archive/"
13379 version ".tar.gz"))
13380 (file-name (string-append name "-" version ".tar.gz"))
13381 (sha256
13382 (base32
13383 "02iqg6jbc1kxvfzqcg6wy9ygqxfm82bw5rf6vnswqy4y572niz4q"))))
13384 (build-system ant-build-system)
13385 (arguments
13386 `(#:jar-name "jsch-agentproxy-core.jar"
13387 #:source-dir "jsch-agent-proxy-core/src/main/java"
13388 #:tests? #f)); no tests
13389 (home-page "https://github.com/ymnk/jsch-agent-proxy")
13390 (synopsis "Core component of the proxy to ssh-agent and Pageant in Java")
13391 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13392and Pageant included Putty. It will be easily integrated into JSch, and users
13393will be allowed to use these programs for authentication.")
13394 (license license:bsd-3)))
13395
13396(define-public java-jsch-agentproxy-sshagent
13397 (package
13398 (inherit java-jsch-agentproxy-core)
13399 (name "java-jsch-agentproxy-sshagent")
13400 (arguments
13401 `(#:jar-name "jsch-agentproxy-sshagent.jar"
13402 #:source-dir "jsch-agent-proxy-sshagent/src/main/java"
13403 #:tests? #f)); no tests
13404 (inputs
13405 (list java-jsch-agentproxy-core))
13406 (synopsis "Proxy to ssh-agent")
13407 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13408and Pageant included in Putty. This component contains the code for a proxy to
13409ssh-agent.")))
13410
13411(define-public java-jsch-agentproxy-usocket-jna
13412 (package
13413 (inherit java-jsch-agentproxy-core)
13414 (name "java-jsch-agentproxy-usocket-jna")
13415 (arguments
13416 `(#:jar-name "jsch-agentproxy-usocket-jna.jar"
13417 #:source-dir "jsch-agent-proxy-usocket-jna/src/main/java"
13418 #:tests? #f)); no tests
13419 (inputs
13420 (list java-jsch-agentproxy-core java-native-access))
13421 (synopsis "USocketFactory implementation using JNA")
13422 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13423and Pageant included in Putty. This component contains an implementation of
13424USocketFactory using @dfn{JNA} (Java Native Access).")))
13425
13426(define-public java-jsch-agentproxy-pageant
13427 (package
13428 (inherit java-jsch-agentproxy-core)
13429 (name "java-jsch-agentproxy-pageant")
13430 (arguments
13431 `(#:jar-name "jsch-agentproxy-pageant.jar"
13432 #:source-dir "jsch-agent-proxy-pageant/src/main/java"
13433 #:tests? #f)); no tests
13434 (inputs
13435 (list java-jsch-agentproxy-core java-native-access
13436 java-native-access-platform))
13437 (synopsis "Proxy to pageant")
13438 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13439and Pageant included in Putty. This component contains the code for a proxy to
13440pageant.")))
13441
13442(define-public java-jsch-agentproxy-usocket-nc
13443 (package
13444 (inherit java-jsch-agentproxy-core)
13445 (name "java-jsch-agentproxy-usocket-nc")
13446 (arguments
13447 `(#:jar-name "jsch-agentproxy-usocket-nc.jar"
13448 #:source-dir "jsch-agent-proxy-usocket-nc/src/main/java"
13449 #:tests? #f)); no tests
13450 (inputs
13451 (list java-jsch-agentproxy-core))
13452 (synopsis "USocketFactory implementation using netcat")
13453 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13454and Pageant included in Putty. This component contains an implementation of
13455USocketFactory using netcat.")))
13456
13457(define-public java-jsch-agentproxy-connector-factory
13458 (package
13459 (inherit java-jsch-agentproxy-core)
13460 (name "java-jsch-agentproxy-connector-factory")
13461 (arguments
13462 `(#:jar-name "jsch-agentproxy-connector-factory.jar"
13463 #:source-dir "jsch-agent-proxy-connector-factory/src/main/java"
13464 #:tests? #f)); no tests
13465 (inputs
13466 (list java-jsch-agentproxy-core java-jsch-agentproxy-sshagent
13467 java-jsch-agentproxy-usocket-jna java-jsch-agentproxy-pageant
13468 java-jsch-agentproxy-usocket-nc))
13469 (synopsis "Connector factory for jsch agent proxy")
13470 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13471and Pageant included in Putty. This component contains a connector factory.")))
13472
13473(define-public java-jsch-agentproxy-jsch
13474 (package
13475 (inherit java-jsch-agentproxy-core)
13476 (name "java-jsch-agentproxy-jsch")
13477 (arguments
13478 `(#:jar-name "jsch-agentproxy-jsch.jar"
13479 #:source-dir "jsch-agent-proxy-jsch/src/main/java"
13480 #:tests? #f)); no tests
13481 (inputs
13482 (list java-jsch java-jsch-agentproxy-core))
13483 (synopsis "JSch integration library for agentproxy")
13484 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13485and Pageant included in Putty. This component contains a library to use
13486jsch-agent-proxy with JSch.")))
13487
13488(define-public java-apache-ivy
13489 (package
13490 (name "java-apache-ivy")
13491 (version "2.4.0")
13492 (source (origin
13493 (method url-fetch)
13494 (uri (string-append "mirror://apache/ant/ivy/" version
13495 "/apache-ivy-" version "-src.tar.gz"))
13496 (sha256
13497 (base32
13498 "1xkfn57g2m7l6y0xdq75x5rnrgk52m9jx2xah70g3ggl8750hbr0"))
13499 (patches
13500 (search-patches
13501 "java-apache-ivy-port-to-latest-bouncycastle.patch"))))
13502 (build-system ant-build-system)
13503 (arguments
13504 `(#:jar-name "ivy.jar"
13505 #:tests? #f
13506 #:phases
13507 (modify-phases %standard-phases
13508 (add-before 'build 'remove-example
13509 (lambda _
13510 (delete-file-recursively "src/example")
13511 #t))
13512 (add-before 'build 'copy-resources
13513 (lambda _
13514 (with-directory-excursion "src/java"
13515 (for-each (lambda (file)
13516 (install-file file (string-append "../../build/classes/" (dirname file))))
13517 (append
13518 (find-files "." ".*.css")
13519 (find-files "." ".*.ent")
13520 (find-files "." ".*.html")
13521 (find-files "." ".*.properties")
13522 (find-files "." ".*.xsd")
13523 (find-files "." ".*.xsl")
13524 (find-files "." ".*.xml"))))
13525 #t))
13526 (add-before 'build 'fix-vfs
13527 (lambda _
13528 (substitute*
13529 '("src/java/org/apache/ivy/plugins/repository/vfs/VfsRepository.java"
13530 "src/java/org/apache/ivy/plugins/repository/vfs/VfsResource.java")
13531 (("import org.apache.commons.vfs") "import org.apache.commons.vfs2"))
13532 #t))
13533 (add-before 'install 'copy-manifest
13534 (lambda _
13535 (install-file "META-INF/MANIFEST.MF" "build/classes/META-INF")
13536 #t))
13537 (add-before 'install 'repack
13538 (lambda _
13539 (invoke "jar" "-cmf" "build/classes/META-INF/MANIFEST.MF" "build/jar/ivy.jar"
13540 "-C" "build/classes" ".")))
13541 (add-after 'install 'install-bin
13542 (lambda* (#:key outputs #:allow-other-keys)
13543 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
13544 (ivy (string-append bin "/ivy"))
13545 (jar (string-append (assoc-ref outputs "out") "/share/java/ivy.jar")))
13546 (mkdir-p bin)
13547 (with-output-to-file ivy
13548 (lambda _
13549 (display (string-append
13550 "#!" (which "sh") "\n"
13551 "if [[ -z $CLASSPATH ]]; then\n"
13552 " cp=\"" (getenv "CLASSPATH") ":" jar "\"\n"
13553 "else\n"
13554 " cp=\"" (getenv "CLASSPATH") ":" jar ":$CLASSPATH\"\n"
13555 "fi\n"
13556 (which "java") " -cp $cp org.apache.ivy.Main $@\n"))))
13557 (chmod ivy #o755)
13558 #t))))))
13559 (inputs
13560 (list java-bouncycastle
13561 java-commons-cli
13562 java-commons-collections
13563 java-commons-httpclient
13564 java-commons-lang
13565 java-commons-vfs
13566 java-jakarta-oro
13567 java-jsch
13568 java-jsch-agentproxy-core
13569 java-jsch-agentproxy-connector-factory
13570 java-jsch-agentproxy-jsch
13571 java-junit))
13572 (home-page "https://ant.apache.org/ivy")
13573 (synopsis "Dependency manager for the Java programming language")
13574 (description "Ivy is a tool for managing (recording, tracking, resolving
13575and reporting) project dependencies. It is characterized by the following:
13576
13577@itemize
13578@item flexibility and configurability - Ivy is essentially process agnostic
13579 and is not tied to any methodology or structure. Instead it provides the
13580 necessary flexibility and configurability to be adapted to a broad range
13581 of dependency management and build processes.
13582@item tight integration with Apache Ant - while available as a standalone tool,
13583 Ivy works particularly well with Apache Ant providing a number of
13584 powerful Ant tasks ranging from dependency resolution to dependency
13585 reporting and publication.
13586@end itemize")
13587 (license license:asl2.0)))
13588
13589(define-public java-eclipse-sisu-inject
13590 (package
13591 (name "java-eclipse-sisu-inject")
13592 (version "0.3.5")
13593 (source (origin
13594 (method git-fetch)
13595 (uri (git-reference
13596 (url "https://github.com/eclipse/sisu.inject/")
13597 (commit (string-append "releases/" version))))
13598 (file-name (git-file-name name version))
13599 (sha256
13600 (base32
13601 "1yh434b8pi8cwmpk825fbvbnkkk2cwd4gxxjaygg8i9j0q3l9zp3"))))
13602 (build-system ant-build-system)
13603 (arguments
13604 `(#:jar-name "eclipse-sisu-inject.jar"
13605 #:source-dir "org.eclipse.sisu.inject/src"
13606 #:tests? #f; no tests
13607 #:phases
13608 (modify-phases %standard-phases
13609 (replace 'install
13610 (install-from-pom "org.eclipse.sisu.inject/pom.xml")))))
13611 (propagated-inputs
13612 (list java-guice java-sisu-inject-parent-pom))
13613 (inputs
13614 (list java-guice-servlet
13615 java-javax-inject
13616 java-javaee-servletapi
13617 java-junit
13618 java-slf4j-api
13619 java-jsr305
13620 java-jsr250
13621 java-cdi-api
13622 java-osgi-framework
13623 java-osgi-util-tracker
13624 java-testng))
13625 (home-page "https://www.eclipse.org/sisu/")
13626 (synopsis "Classpath scanning, auto-binding, and dynamic auto-wiring")
13627 (description "Sisu is a modular JSR330-based container that supports
13628classpath scanning, auto-binding, and dynamic auto-wiring. Sisu uses
13629Google-Guice to perform dependency injection and provide the core JSR330
13630support, but removes the need to write explicit bindings in Guice modules.
13631Integration with other containers via the Eclipse Extension Registry and the
13632OSGi Service Registry is a goal of this project.")
13633 (license license:epl1.0)))
13634
13635(define java-sisu-inject-parent-pom
13636 (package
13637 (inherit java-eclipse-sisu-inject)
13638 (name "java-sisu-inject-parent-pom")
13639 (arguments
13640 `(#:tests? #f
13641 #:phases
13642 (modify-phases %standard-phases
13643 (delete 'configure)
13644 (delete 'build)
13645 (replace 'install
13646 (install-pom-file "pom.xml")))))
13647 (propagated-inputs '())))
13648
13649(define-public java-eclipse-sisu-plexus
13650 (package
13651 (name "java-eclipse-sisu-plexus")
13652 (version "0.3.5")
13653 (source (origin
13654 (method git-fetch)
13655 (uri (git-reference
13656 (url "https://github.com/eclipse/sisu.plexus")
13657 (commit (string-append "releases/" version))))
13658 (file-name (git-file-name name version))
13659 (sha256
13660 (base32
13661 "0lm5h0dmh41ffcwd32qnk3a87d360am36yq7168ikkyqa8jxkx28"))
13662 (modules '((guix build utils)))
13663 (snippet
13664 '(begin
13665 (for-each delete-file (find-files "." ".*.jar"))
13666 (rename-file "org.eclipse.sisu.plexus.tests/src"
13667 "org.eclipse.sisu.plexus.tests/java")
13668 #t))))
13669 (build-system ant-build-system)
13670 (arguments
13671 `(#:jar-name "eclipse-sisu-plexus.jar"
13672 #:source-dir "org.eclipse.sisu.plexus/src"
13673 #:test-dir "org.eclipse.sisu.plexus.tests"
13674 #:test-exclude
13675 (list
13676 ;; This test fails probably because we can't generate the necessary
13677 ;; meta-inf files.
13678 "**/PlexusLoggingTest.*"
13679 ;; FIXME: This test fails because of some injection error
13680 "**/PlexusRequirementTest.*")
13681 #:jdk ,icedtea-8
13682 #:phases
13683 (modify-phases %standard-phases
13684 (add-before 'build 'copy-resources
13685 (lambda _
13686 (install-file "org.eclipse.sisu.plexus/META-INF/plexus/components.xml"
13687 "build/classes/META-INF/plexus")
13688 #t))
13689 (add-before 'check 'build-test-jar
13690 (lambda _
13691 (with-directory-excursion "org.eclipse.sisu.plexus.tests/resources/component-jar/src/main/"
13692 (mkdir "build")
13693 (with-directory-excursion "java"
13694 (apply invoke "javac" "-cp"
13695 (string-append (getenv "CLASSPATH")
13696 ":../../../../../build/classes")
13697 (find-files "." ".*.java"))
13698 (for-each (lambda (file) (install-file file (string-append "../build/" file)))
13699 (find-files "." ".*.jar")))
13700 (mkdir-p "build/META-INF/plexus")
13701 (copy-file "resources/META-INF/plexus/components.xml"
13702 "build/META-INF/plexus/components.xml")
13703 (with-directory-excursion "build"
13704 (invoke "jar" "cf" "../../../component-jar-0.1.jar" ".")))
13705 (with-directory-excursion "org.eclipse.sisu.plexus.tests/"
13706 (copy-recursively "META-INF" "../build/test-classes/META-INF")
13707 (substitute* "java/org/eclipse/sisu/plexus/DefaultPlexusContainerTest.java"
13708 (("resources/component-jar")
13709 "org.eclipse.sisu.plexus.tests/resources/component-jar")))
13710 #t))
13711 (replace 'install
13712 (install-from-pom "org.eclipse.sisu.plexus/pom.xml")))))
13713 (propagated-inputs
13714 (list java-jsr250
13715 java-plexus-classworlds
13716 java-plexus-utils
13717 java-plexus-component-annotations
13718 java-cdi-api
13719 java-eclipse-sisu-inject
13720 java-sisu-plexus-parent-pom))
13721 (inputs
13722 (list java-osgi-framework
13723 java-slf4j-api
13724 java-javax-inject
13725 java-guice
13726 java-guava
13727 java-aopalliance
13728 java-cglib))
13729 (native-inputs
13730 (list java-junit))
13731 (home-page "https://www.eclipse.org/sisu/")
13732 (synopsis "Plexus support for the sisu container")
13733 (description "Sisu is a modular JSR330-based container that supports
13734classpath scanning, auto-binding, and dynamic auto-wiring. This package
13735adds Plexus support to the Sisu-Inject container.")
13736 (license license:epl1.0)))
13737
13738(define java-sisu-plexus-parent-pom
13739 (package
13740 (inherit java-eclipse-sisu-plexus)
13741 (name "java-sisu-plexus-parent-pom")
13742 (arguments
13743 `(#:tests? #f
13744 #:phases
13745 (modify-phases %standard-phases
13746 (delete 'configure)
13747 (delete 'build)
13748 (replace 'install
13749 (install-pom-file "pom.xml")))))
13750 (propagated-inputs
13751 `(("java-sonatype-oss-parent-pom-9" ,java-sonatype-oss-parent-pom-9)))))
13752
13753(define-public java-commons-compiler
13754 (package
13755 (name "java-commons-compiler")
13756 (version "3.0.8")
13757 (source (origin
13758 (method git-fetch)
13759 (uri (git-reference
13760 (url "https://github.com/janino-compiler/janino")
13761 (commit "91aa95686d1e4ca3b16a984a03a38686572331b2")))
13762 (file-name (string-append name "-" version))
13763 (sha256
13764 (base32
13765 "04hfdl59sgh20qkxzgnibvs8f9hy6n7znxwpk611y5d89977y62r"))
13766 (modules '((guix build utils)))
13767 (snippet
13768 '(begin
13769 (for-each delete-file
13770 (find-files "." "\\.jar$"))
13771 #t))))
13772 (build-system ant-build-system)
13773 (arguments
13774 `(#:jar-name "commons-compiler.jar"
13775 #:source-dir "commons-compiler/src/main"
13776 #:tests? #f)); no tests
13777 (home-page "https://github.com/janino-compiler/janino")
13778 (synopsis "Java compiler")
13779 (description "Commons-compiler contains an API for janino, including the
13780@code{IExpressionEvaluator}, @code{IScriptEvaluator}, @code{IClassBodyEvaluator}
13781and @code{ISimpleCompiler} interfaces.")
13782 (license license:bsd-3)))
13783
13784(define-public java-janino
13785 (package
13786 (inherit java-commons-compiler)
13787 (name "java-janino")
13788 (arguments
13789 `(#:jar-name "janino.jar"
13790 #:source-dir "src/main/java"
13791 #:phases
13792 (modify-phases %standard-phases
13793 (add-before 'configure 'chdir
13794 (lambda _
13795 (chdir "janino")
13796 #t)))))
13797 (inputs
13798 (list java-commons-compiler))
13799 (native-inputs
13800 (list java-junit java-hamcrest-core))
13801 (description "Janino is a Java compiler. Janino can compile a set of
13802source files to a set of class files like @code{javac}, but also compile a
13803Java expression, block, class body or source file in memory, load the bytecode
13804and execute it directly in the same JVM. @code{janino} can also be used for
13805static code analysis or code manipulation.")))
13806
13807(define-public java-logback-core
13808 (package
13809 (name "java-logback-core")
13810 (version "1.2.3")
13811 (source (origin
13812 (method git-fetch)
13813 (uri (git-reference
13814 (url "https://github.com/qos-ch/logback/")
13815 (commit (string-append "v_" version))))
13816 (file-name (git-file-name name version))
13817 (sha256
13818 (base32
13819 "055jbfpg3l5qw7pw2snkdag0gjkb4vcxfg9110cqqyc40k2nd17z"))
13820 (modules '((guix build utils)))
13821 (snippet
13822 '(delete-file-recursively "logback-access/lib"))))
13823 (build-system ant-build-system)
13824 (arguments
13825 `(#:jar-name "logback.jar"
13826 #:source-dir "src/main/java"
13827 #:test-dir "src/test"
13828 #:test-exclude
13829 ;; These tests fail with Unable to set MockitoNamingPolicy on cglib generator
13830 ;; which creates FastClasses
13831 (list "**/AllCoreTest.*"
13832 "**/AutoFlushingObjectWriterTest.*"
13833 "**/PackageTest.*"
13834 "**/ResilientOutputStreamTest.*"
13835 ;; And we still don't want to run abstract classes
13836 "**/Abstract*.*")
13837 #:phases
13838 (modify-phases %standard-phases
13839 (add-before 'configure 'chdir
13840 (lambda _ (chdir "logback-core"))))))
13841 (inputs
13842 (list java-javax-mail
13843 java-javaee-servletapi
13844 java-commons-compiler
13845 java-janino))
13846 (native-inputs
13847 (list java-junit
13848 java-hamcrest-core
13849 java-mockito-1
13850 java-cglib
13851 java-objenesis
13852 java-joda-time))
13853 (home-page "https://logback.qos.ch")
13854 (synopsis "Logging for java")
13855 (description "Logback is intended as a successor to the popular log4j project.
13856This module lays the groundwork for the other two modules.")
13857 ;; Either epl1.0 or lgpl2.1
13858 (license (list license:epl1.0
13859 license:lgpl2.1))))
13860
13861(define-public java-logback-classic
13862 (package
13863 (inherit java-logback-core)
13864 (name "java-logback-classic")
13865 (arguments
13866 `(#:jar-name "logback-classic.jar"
13867 #:source-dir "src/main/java"
13868 #:test-dir "src/test"
13869 #:tests? #f; tests require more packages: h2, greenmail, hsql, subethamail, slf4j, log4j, felix
13870 #:jdk ,icedtea-8
13871 #:phases
13872 (modify-phases %standard-phases
13873 (add-before 'configure 'chdir
13874 (lambda _
13875 (chdir "logback-classic")
13876 #t))
13877 (replace 'build
13878 (lambda* (#:key inputs #:allow-other-keys)
13879 (mkdir-p "build/classes")
13880 (setenv "CLASSPATH"
13881 (string-join
13882 (apply append (map (lambda (input)
13883 (find-files (assoc-ref inputs input)
13884 ".*.jar"))
13885 '("java-logback-core" "java-slf4j-api"
13886 "java-commons-compiler" "java-javaee-servletapi"
13887 "groovy")))
13888 ":"))
13889 (apply invoke "groovyc" "-d" "build/classes" "-j"
13890 (find-files "src/main/" ".*\\.(groovy|java)$"))
13891 (invoke "ant" "jar")
13892 #t)))))
13893 (inputs
13894 (modify-inputs (package-inputs java-logback-core)
13895 (prepend java-logback-core java-slf4j-api)))
13896 (native-inputs
13897 (list groovy))
13898 (description "Logback is intended as a successor to the popular log4j project.
13899This module can be assimilated to a significantly improved version of log4j.
13900Moreover, @code{logback-classic} natively implements the slf4j API so that you
13901can readily switch back and forth between logback and other logging frameworks
13902such as log4j or @code{java.util.logging} (JUL).")))
13903
13904(define-public java-jgit
13905 (package
13906 (name "java-jgit")
13907 (version "4.7.0.201704051617-r")
13908 (source (origin
13909 (method url-fetch)
13910 (uri (string-append "https://repo1.maven.org/maven2/"
13911 "org/eclipse/jgit/org.eclipse.jgit/"
13912 version "/org.eclipse.jgit-"
13913 version "-sources.jar"))
13914 (sha256
13915 (base32
13916 "13ii4jn02ynzq6i7gsyi21k2i94jpc85wf6bcm31q4cyvzv0mk4k"))))
13917 (build-system ant-build-system)
13918 (arguments
13919 `(#:tests? #f ; There are no tests to run.
13920 #:jar-name "jgit.jar"
13921 ;; JGit must be built with a JDK supporting Java 8.
13922 #:jdk ,icedtea-8
13923 ;; Target our older default JDK.
13924 #:make-flags (list "-Dtarget=1.7")
13925 #:phases
13926 (modify-phases %standard-phases
13927 ;; The jar file generated by the default build.xml does not include
13928 ;; the text properties files, so we need to add them.
13929 (add-after 'build 'add-properties
13930 (lambda* (#:key jar-name #:allow-other-keys)
13931 (with-directory-excursion "src"
13932 (apply invoke "jar" "-uf"
13933 (string-append "../build/jar/" jar-name)
13934 (find-files "." "\\.properties$")))
13935 #t)))))
13936 (inputs
13937 (list java-classpathx-servletapi java-javaewah java-jsch
13938 java-slf4j-api))
13939 (home-page "https://eclipse.org/jgit/")
13940 (synopsis "Java library implementing the Git version control system")
13941 (description "JGit is a lightweight, pure Java library implementing the
13942Git version control system, providing repository access routines, support for
13943network protocols, and core version control algorithms.")
13944 (license license:edl1.0)))
13945
13946;; For axoloti.
13947(define-public java-jgit-4.2
13948 (package (inherit java-jgit)
13949 (version "4.2.0.201601211800-r")
13950 (source (origin
13951 (method url-fetch)
13952 (uri (string-append "https://repo1.maven.org/maven2/"
13953 "org/eclipse/jgit/org.eclipse.jgit/"
13954 version "/org.eclipse.jgit-"
13955 version "-sources.jar"))
13956 (sha256
13957 (base32
13958 "15gm537iivhnzlkjym4x3wn5jqdjdragsw9pdpzqqg21nrc817mm"))))
13959 (build-system ant-build-system)
13960 (arguments
13961 (substitute-keyword-arguments (package-arguments java-jgit)
13962 ((#:phases phases)
13963 `(modify-phases ,phases
13964 (add-after 'unpack 'use-latest-javaewah-API
13965 (lambda _
13966 (substitute* "src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java"
13967 (("wordinbits") "WORD_IN_BITS"))))))))
13968 (inputs
13969 (list java-javaewah java-jsch java-slf4j-api))))
13970
13971(define-public abcl
13972 (package
13973 (name "abcl")
13974 (version "1.9.3")
13975 (source
13976 (origin
13977 (method url-fetch)
13978 (uri (string-append "https://abcl.org/releases/"
13979 version "/abcl-src-" version ".tar.gz"))
13980 (sha256
13981 (base32
13982 "1zxjpwv98bq2yd5qg08sbkajj17m7b8xmzqhw296161s7lia215v"))
13983 (patches
13984 (search-patches
13985 "abcl-fix-build-xml.patch"))))
13986 (build-system ant-build-system)
13987 (native-inputs
13988 (list java-junit))
13989 (arguments
13990 `(#:build-target "abcl.jar"
13991 #:test-target "abcl.test"
13992 #:phases
13993 (modify-phases %standard-phases
13994 (replace 'install
13995 (lambda* (#:key outputs #:allow-other-keys)
13996 (let ((share (string-append (assoc-ref outputs "out")
13997 "/share/java/"))
13998 (bin (string-append (assoc-ref outputs "out")
13999 "/bin/")))
14000 (mkdir-p share)
14001 (install-file "dist/abcl.jar" share)
14002 (install-file "dist/abcl-contrib.jar" share)
14003 (mkdir-p bin)
14004 (with-output-to-file (string-append bin "abcl")
14005 (lambda _
14006 (let ((classpath (string-append
14007 share "abcl.jar"
14008 ":"
14009 share "abcl-contrib.jar")))
14010 (display (string-append
14011 "#!" (which "bash") "\n"
14012 "if [[ -z $CLASSPATH ]]; then\n"
14013 " cp=\"" classpath "\"\n"
14014 "else\n"
14015 " cp=\"" classpath ":$CLASSPATH\"\n"
14016 "fi\n"
14017 "exec " (which "java")
14018 " -cp \"$cp\" org.armedbear.lisp.Main \"$@\"\n")))))
14019 (chmod (string-append bin "abcl") #o755)
14020 #t))))))
14021 (home-page "https://abcl.org/")
14022 (synopsis "Common Lisp Implementation on the JVM")
14023 (description
14024 "@dfn{Armed Bear Common Lisp} (ABCL) is a full implementation of the Common
14025Lisp language featuring both an interpreter and a compiler, running in the
14026JVM. It supports JSR-223 (Java scripting API): it can be a scripting engine
14027in any Java application. Additionally, it can be used to implement (parts of)
14028the application using Java to Lisp integration APIs.")
14029 (native-search-paths
14030 (list (search-path-specification
14031 (variable "XDG_DATA_DIRS")
14032 (files '("share")))))
14033 (license (list license:gpl2+
14034 ;; named-readtables is released under 3 clause BSD
14035 license:bsd-3
14036 ;; jfli is released under CPL 1.0
14037 license:cpl1.0))))
14038
14039(define-public java-jsonp-api
14040 (package
14041 (name "java-jsonp-api")
14042 (version "1.1.6")
14043 (source (origin
14044 (method git-fetch)
14045 (uri (git-reference
14046 (url "https://github.com/eclipse-ee4j/jsonp")
14047 (commit (string-append "1.1-" version "-RELEASE"))))
14048 (file-name (git-file-name name version))
14049 (sha256
14050 (base32
14051 "0zrj03hkr3jdmqlb4ipjr37cqpp2q2814qpmxi7srlwpdqs0ibgc"))))
14052 (build-system ant-build-system)
14053 (arguments
14054 `(#:jar-name "jsonp-api.jar"
14055 #:tests? #f
14056 #:source-dir "api/src/main/java"
14057 #:test-dir "api/src/test"))
14058 (home-page "https://eclipse-ee4j.github.io/jsonp/")
14059 (synopsis "JSON Processing in Java")
14060 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
14061parse, generate, transform and query) JSON messages. It produces and
14062consumes JSON text in a streaming fashion (similar to StAX API for XML)
14063and allows building a Java object model for JSON text using API classes
14064(similar to DOM API for XML).")
14065 ;; either gpl2 only with classpath exception, or epl2.0.
14066 (license (list license:gpl2
14067 license:epl2.0))))
14068
14069(define-public java-jsonp-impl
14070 (package
14071 (inherit java-jsonp-api)
14072 (name "java-jsonp-impl")
14073 (arguments
14074 `(#:jar-name "jsonp-impl.jar"
14075 #:tests? #f
14076 #:source-dir "impl/src/main/java"
14077 #:test-dir "impl/src/test"
14078 #:phases
14079 (modify-phases %standard-phases
14080 (add-before 'build 'copy-resources
14081 (lambda _
14082 (copy-recursively
14083 "impl/src/main/resources/"
14084 "build/classes")
14085 #t)))))
14086 (propagated-inputs
14087 (list java-jsonp-api))
14088 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
14089parse, generate, transform and query) JSON messages. This package contains
14090a reference implementation of that API.")))
14091
14092(define-public java-jakarta-json
14093 (package
14094 (name "java-jakarta-json")
14095 (version "2.1.3")
14096 (source (origin
14097 (method git-fetch)
14098 (uri (git-reference
14099 (url "https://github.com/jakartaee/jsonp-api")
14100 (commit (string-append version "-RELEASE"))))
14101 (file-name (git-file-name name version))
14102 (sha256
14103 (base32
14104 "1q600harqfhlf763l75j4fx7ai7ybp7ga06aiky2a2hg8mhz0s5f"))))
14105 (build-system ant-build-system)
14106 (arguments
14107 `(#:jar-name "jakarta-json.jar"
14108 #:source-dir "api/src/main/java"
14109 #:tests? #f; no tests
14110 #:jdk ,openjdk11))
14111 (home-page "https://github.com/jakartaee/jsonp-api")
14112 (synopsis "Portable API for JSON handling in Java")
14113 (description "This project contains API and Compatible Implementation of
14114Jakarta JSON Processing specification. Jakarta JSON Processing provides
14115portable APIs to parse, generate, transform, and query JSON documents.")
14116 ;; with classpath exception
14117 (license license:epl2.0)))
14118
14119(define-public java-parsson
14120 (package
14121 (name "java-parsson")
14122 (version "1.1.5")
14123 (source (origin
14124 (method git-fetch)
14125 (uri (git-reference
14126 (url "https://github.com/eclipse-ee4j/parsson")
14127 (commit version)))
14128 (file-name (git-file-name name version))
14129 (sha256
14130 (base32
14131 "06vvr6qv1ihnk212gdxg4x0sd61lgxk7wf062s7gym5k2h7fms0p"))))
14132 (build-system ant-build-system)
14133 (arguments
14134 `(#:jar-name "parsson.jar"
14135 #:source-dir "impl/src/main/java"
14136 #:test-dir "impl/src/test"
14137 #:use-java-modules? #t
14138 #:jdk ,openjdk11
14139 #:phases
14140 (modify-phases %standard-phases
14141 (add-after 'unpack 'copy-resources
14142 (lambda _
14143 (copy-recursively "impl/src/main/resources"
14144 "build/classes"))))))
14145 (inputs
14146 (list java-jakarta-json))
14147 (native-inputs
14148 (list java-junit))
14149 (home-page "https://github.com/eclipse-ee4j/parsson")
14150 (synopsis "Implementation of Jakarta JSON API")
14151 (description "Eclipse Parsson is an implementation of the Jakarta JSON
14152Processing specification.")
14153 ;; with classpath exception
14154 (license license:epl2.0)))
14155
14156(define-public java-jakarta-activation-api
14157 (package
14158 (name "java-jakarta-activation-api")
14159 (version "2.1.4")
14160 (source (origin
14161 (method git-fetch)
14162 (uri (git-reference
14163 (url "https://github.com/jakartaee/jaf-api")
14164 (commit version)))
14165 (file-name (git-file-name name version))
14166 (sha256
14167 (base32
14168 "125bf475cb0mdyhn1lj3c8gbwngbd28x10vnknq86zrc1vq4m6gx"))))
14169 (build-system ant-build-system)
14170 (arguments
14171 `(#:jar-name "jakarta-activation-api.jar"
14172 #:source-dir "api/src/main/java"
14173 #:tests? #f ;; has no tests
14174 #:jdk ,openjdk11))
14175 (home-page "https://github.com/jakartaee/jaf-api")
14176 (synopsis "Collection of Java activation")
14177 (description "Jakarta Activation lets you take advantage of standard
14178services to: determine the type of arbitrary piece of data; encapsulate access
14179to it; discover the operations available on it; and instantiate the
14180appropriate bean to perform the operation(s).")
14181 (license license:bsd-3)))
14182
14183(define-public java-jakarta-annotations-api
14184 (package
14185 (name "java-jakarta-annotations-api")
14186 (version "2.1.1")
14187 (source (origin
14188 (method git-fetch)
14189 (uri (git-reference
14190 (url "https://github.com/jakartaee/common-annotations-api")
14191 (commit version)))
14192 (file-name (git-file-name name version))
14193 (sha256
14194 (base32
14195 "0xq2n2pijal5p75vl9dz10i6hhdmaxw5q8j3aza717xkpxxby9p6"))))
14196 (build-system ant-build-system)
14197 (arguments
14198 `(#:jar-name "jakarta-annotations-api.jar"
14199 #:source-dir "api/src/main/java"
14200 #:tests? #f; no tests
14201 #:jdk ,openjdk11))
14202 (home-page "https://github.com/jakartaee/common-annotations-api")
14203 (synopsis "Collection of Java annotations")
14204 (description "Jakarta Annotations defines a collection of annotations
14205representing common semantic concepts that enable a declarative style of
14206programming that applies across a variety of Java technologies.")
14207 ;; with classpath exception
14208 (license (list license:epl2.0
14209 license:gpl2))))
14210
14211(define-public java-xmp
14212 (package
14213 (name "java-xmp")
14214 (version "5.1.3")
14215 (source (origin
14216 (method url-fetch)
14217 (uri (string-append "http://download.macromedia.com/pub/developer"
14218 "/xmp/sdk/XMPCoreJava-" version ".zip"))
14219 (sha256
14220 (base32
14221 "14nai2mmsg7l5ya2y5mx4w4lr1az3sk2fjz6hiy4zdrsavgvl1g7"))))
14222 (build-system ant-build-system)
14223 (arguments
14224 `(#:build-target "build"
14225 #:tests? #f; no tests
14226 #:phases
14227 (modify-phases %standard-phases
14228 (add-after 'unpack 'chdir
14229 (lambda _
14230 (chdir "XMPCore")
14231 #t))
14232 (add-before 'build 'fix-timestamp
14233 (lambda _
14234 (substitute* "build.xml"
14235 (("\\$\\{BuildDate\\}") "1970 Jan 01 00:00:00-GMT"))
14236 #t))
14237 (replace 'install
14238 (install-jars "."))
14239 (add-after 'install 'install-doc
14240 (lambda* (#:key outputs #:allow-other-keys)
14241 (copy-recursively
14242 "docs"
14243 (string-append (assoc-ref outputs "out") "/share/doc/java-xmp"))
14244 #t)))))
14245 (native-inputs
14246 (list unzip))
14247 (home-page "https://www.adobe.com/devnet/xmp.html")
14248 (synopsis "Extensible Metadat Platform (XMP) support in Java")
14249 (description "Adobe's Extensible Metadata Platform (XMP) is a labeling
14250technology that allows you to embed data about a file, known as metadata,
14251into the file itself. The XMP Toolkit for Java is based on the C++ XMPCore
14252library and the API is similar.")
14253 (license license:bsd-3)))
14254
14255(define-public java-args4j
14256 (package
14257 (name "java-args4j")
14258 (version "2.33")
14259 (source (origin
14260 (method git-fetch)
14261 (uri (git-reference
14262 (url "https://github.com/kohsuke/args4j")
14263 (commit (string-append "args4j-site-" version))))
14264 (file-name (git-file-name name version))
14265 (sha256
14266 (base32
14267 "0w061fg65qrsm1a0lz0vyprsyidj31krjb459qi2lw0y78xza26s"))))
14268 (build-system ant-build-system)
14269 (arguments
14270 `(#:jar-name "args4j.jar"
14271 #:source-dir "args4j/src"
14272 #:test-dir "args4j/test"
14273 #:test-exclude
14274 (list "**/ExampleTest.*"
14275 "**/ExternalConfiguredTest.*" ; fails to find a file
14276 ;; We still don't want to run abstract classes
14277 "**/Abstract*.*")
14278 #:phases
14279 (modify-phases %standard-phases
14280 (add-before 'check 'fix-test-dir
14281 (lambda _
14282 (substitute* "build.xml"
14283 (("/java\">") "\">"))
14284 #t))
14285 (add-before 'build 'copy-resources
14286 (lambda _
14287 (let ((from-prefix "args4j/src/org/kohsuke/args4j/")
14288 (to-prefix "build/classes/org/kohsuke/args4j/"))
14289 (for-each (lambda (f)
14290 (install-file
14291 (string-append from-prefix f)
14292 (string-append to-prefix (dirname f))))
14293 (list "Messages.properties"
14294 "Messages_de.properties"
14295 "Messages_en.properties"
14296 "Messages_ru.properties"
14297 "spi/Messages.properties"
14298 "spi/Messages_de.properties"
14299 "spi/Messages_en.properties"
14300 "spi/Messages_ru.properties")))
14301 #t)))))
14302 (native-inputs
14303 (list java-junit))
14304 (home-page "https://args4j.kohsuke.org/")
14305 (synopsis "Command line parser library")
14306 (description "Args4j is a small Java class library that makes it easy to
14307parse command line options/arguments in your CUI application.")
14308 (license license:expat)))
14309
14310(define-public java-argparse4j
14311 (package
14312 (name "java-argparse4j")
14313 (version "0.9.0")
14314 (source (origin
14315 (method git-fetch)
14316 (uri (git-reference
14317 (url "https://github.com/argparse4j/argparse4j")
14318 (commit (string-append "argparse4j-" version))))
14319 (file-name (git-file-name name version))
14320 (sha256
14321 (base32
14322 "1i0j3zs1ln48n0g8a90vqbv6528mcswhzys6252yp0c8w1ai64fb"))))
14323 (build-system ant-build-system)
14324 (arguments
14325 (list #:jar-name "java-argparse4j.jar"
14326 #:source-dir "main/src/main/"
14327 #:test-dir "main/src/test/"
14328 #:jdk openjdk11
14329 #:phases #~(modify-phases %standard-phases
14330 (add-after 'unpack 'copy-resources
14331 (lambda _
14332 (copy-recursively "main/src/test/resources"
14333 "target/test-classes")
14334 (copy-recursively "main/src/main/resources"
14335 "build/classes")))
14336 (replace 'install
14337 (install-from-pom "pom.xml")))))
14338 (inputs (list java-junit))
14339 (home-page "https://argparse4j.github.io/")
14340 (synopsis "Java command-line argument parser library")
14341 (description "Argparse4j is a command line argument parser library for
14342Java based on Python's @code{argparse} module.")
14343 (license license:expat)))
14344
14345(define-public java-metadata-extractor
14346 (package
14347 (name "java-metadata-extractor")
14348 (version "2.19.0")
14349 (source (origin
14350 (method git-fetch)
14351 (uri (git-reference
14352 (url "https://github.com/drewnoakes/metadata-extractor")
14353 (commit version)))
14354 (file-name (git-file-name name version))
14355 (sha256
14356 (base32
14357 "1axnw47n06a116g8bml2l6rxx92grxp935gspyhz4pz868m7hrna"))))
14358 (build-system ant-build-system)
14359 (arguments
14360 `(#:jar-name "metadata-extractor.jar"
14361 #:source-dir "Source"
14362 #:test-dir "Tests"
14363 #:phases
14364 (modify-phases %standard-phases
14365 (add-before 'build 'fix-xmp-path
14366 (lambda _
14367 ;; This version of metadata-extractor depends on java-xmp 6, which
14368 ;; is non-free. These changes allow using java-xmp 5, which is
14369 ;; the last free-software version of java-xmp.
14370 (substitute* (find-files "." ".*.java")
14371 (("com.adobe.internal.xmp") "com.adobe.xmp"))
14372 (substitute* "Source/com/drew/metadata/xmp/XmpReader.java"
14373 (("\\.setXMPNodesToLimit.*") ";"))
14374 ;; Test failure, most likely because we use a different java-xmp
14375 ;; version.
14376 (delete-file "Tests/com/drew/metadata/xmp/XmpReaderTest.java")))
14377 (add-before 'check 'fix-test-dir
14378 (lambda _
14379 (substitute* "build.xml"
14380 (("/java\">") "\">"))
14381 #t)))))
14382 (propagated-inputs
14383 (list java-xmp))
14384 (native-inputs
14385 (list java-hamcrest-core java-junit))
14386 (home-page "https://github.com/drewnoakes/metadata-extractor")
14387 (synopsis "Extract metadata from image and video files")
14388 (description "Metadata-extractor is a straightforward Java library for
14389reading metadata from image files. It is able to read metadata in Exif,
14390IPTC, XMP, ICC and more formats.")
14391 (license license:asl2.0)))
14392
14393(define-public java-svg-salamander
14394 (package
14395 (name "java-svg-salamander")
14396 (version "1.1.2")
14397 (source (origin
14398 (method git-fetch)
14399 (uri (git-reference
14400 (url "https://github.com/blackears/svgSalamander")
14401 (commit (string-append "v" version))))
14402 (file-name (git-file-name name version))
14403 (sha256
14404 (base32
14405 "1zv3kjdkf6iqf02x6ln76254y634j2ji448y706a65lsbfjmmicf"))
14406 (modules '((guix build utils)))
14407 (snippet
14408 '(begin
14409 (for-each delete-file (find-files "." ".*.jar"))
14410 #t))
14411 (patches
14412 (search-patches "java-svg-salamander-Fix-non-det.patch"))))
14413 (build-system ant-build-system)
14414 (arguments
14415 `(#:tests? #f; no tests
14416 #:phases
14417 (modify-phases %standard-phases
14418 (add-after 'unpack 'chdir
14419 (lambda _
14420 (chdir "svg-core")
14421 #t))
14422 (add-before 'build 'copy-jars
14423 (lambda* (#:key inputs #:allow-other-keys)
14424 (copy-file (car (find-files (assoc-ref inputs "javacc") "\\.jar$"))
14425 "../libraries/javacc.jar")
14426 (copy-file (car (find-files (assoc-ref inputs "ant") "ant\\.jar$"))
14427 "../libraries/ant.jar")
14428 #t))
14429 (replace 'install
14430 (install-jars "dist")))))
14431 (native-inputs
14432 (list javacc))
14433 (home-page "https://github.com/blackears/svgSalamander")
14434 (synopsis "SVG engine for Java")
14435 (description "SVG Salamander is an SVG engine for Java that's designed
14436to be small, fast, and allow programmers to use it with a minimum of fuss.
14437It's in particular targeted for making it easy to integrate SVG into Java
14438games and making it much easier for artists to design 2D game content - from
14439rich interactive menus to charts and graphcs to complex animations.")
14440 (license license:bsd-2)))
14441
14442(define-public java-jboss-transaction-api-spec
14443 (package
14444 (name "java-jboss-transaction-api-spec")
14445 (version "1.2+1.1.1")
14446 (source (origin
14447 (method git-fetch)
14448 (uri (git-reference
14449 (url "https://github.com/jboss/jboss-transaction-api_spec")
14450 (commit "jboss-transaction-api_1.2_spec-1.1.1.Final")))
14451 (file-name (git-file-name name version))
14452 (sha256
14453 (base32
14454 "1xbfq5hvb86izflydxrqqv3k26c1ba2m0ap6m97shqrsdi9by4wy"))))
14455 (build-system ant-build-system)
14456 (arguments
14457 `(#:jar-name "java-jboss-transaction-api_spec.jar"
14458 #:source-dir "src/main/java"
14459 #:tests? #f)); no tests
14460 (inputs
14461 (list java-cdi-api java-jboss-interceptors-api-spec))
14462 (home-page "https://github.com/jboss/jboss-transaction-api_spec")
14463 (synopsis "Generic transaction management API in Java")
14464 (description "Java-jboss-transaction-api-spec implements the Transactions
14465API. A transaction is a unit of work containing one or more operations
14466involving one or more shared resources having ACID (Atomicity, Consistency,
14467Isolation and Durability) properties.")
14468 ;; either gpl2 only with classpath exception or cddl.
14469 (license (list license:gpl2 license:cddl1.0))))
14470
14471(define-public java-picocli
14472 (package
14473 (name "java-picocli")
14474 (version "4.3.2")
14475 (source (origin
14476 (method git-fetch)
14477 (uri (git-reference
14478 (url "https://github.com/remkop/picocli")
14479 (commit (string-append "v" version))))
14480 (file-name (git-file-name name version))
14481 (sha256
14482 (base32
14483 "1sxp6rxjfgjd98ly14b3d15dvxkm5wg4g46w12jyhmr0kmkaca3c"))))
14484 (build-system ant-build-system)
14485 (arguments
14486 `(#:jar-name "picocli.jar"
14487 #:source-dir "src/main/java"
14488 ;; Tests require missing dependencies (junitparams, system-rules)
14489 #:tests? #f))
14490 (home-page "https://picocli.info")
14491 (synopsis "REPL for the JVM")
14492 (description "Picocli is a framework for building command line applications
14493for the JVM. It supports colors, autocompletion, subcommands, and more. Written
14494in Java, usable from Groovy, Kotlin, Scala, etc.")
14495 (license license:asl2.0)))
14496
14497(define-public java-pj
14498 (package
14499 (name "java-pj")
14500 (version "20150107")
14501 (source (origin
14502 (method url-fetch)
14503 (uri (string-append "https://www.cs.rit.edu/~ark/pjsrc"
14504 version ".jar"))
14505 (sha256
14506 (base32
14507 "078xwaivl2qqjc07r0vk6kzpqlcb1bcar80p8r5qigh34hpr86d3"))
14508 (modules '((guix build utils)))
14509 (snippet
14510 '(for-each delete-file
14511 (find-files "." "\\.class$")))))
14512 (build-system ant-build-system)
14513 (arguments
14514 (list
14515 #:tests? #false ;there are none
14516 #:phases
14517 #~(modify-phases %standard-phases
14518 (add-after 'unpack 'chdir
14519 (lambda _ (chdir "src/pj")))
14520 (add-after 'chdir 'patch-source-directory
14521 (lambda _
14522 (substitute* "compile"
14523 (("SRCDIR1=/home/ark/public_html/pj/lib")
14524 (string-append "SRCDIR1=" (getcwd) "/lib")))))
14525 (replace 'build
14526 (lambda _
14527 (invoke "bash" "./compile" "linux")
14528 (with-directory-excursion "lib"
14529 (apply invoke "jar" "cf" (string-append "pj" #$version ".jar")
14530 (find-files "." "\\.class$")))))
14531 (replace 'install (install-jars ".")))))
14532 (home-page "https://www.cs.rit.edu/~ark/pj.shtml")
14533 (synopsis "Parallel programming in Java")
14534 (description "Parallel Java (PJ) is an API and middleware for parallel
14535programming in 100% Java on shared memory multiprocessor (SMP) parallel
14536computers, cluster parallel computers, and hybrid SMP cluster parallel
14537computers.")
14538 (license license:gpl3+)))
14539
14540(define-public java-jetbrains-annotations
14541 (package
14542 (name "java-jetbrains-annotations")
14543 (version "19.0.0")
14544 (source (origin
14545 (method git-fetch)
14546 (uri (git-reference
14547 (url "https://github.com/JetBrains/java-annotations")
14548 (commit version)))
14549 (file-name (git-file-name name version))
14550 (sha256
14551 (base32
14552 "0z6i1xs60cd5ffz23c49sq68wn5mphhs3xpar1n93ppama2ng80v"))))
14553 (build-system ant-build-system)
14554 (arguments
14555 `(#:jar-name "jetbrains-annotations.jar"
14556 #:source-dir "common/src/main/java:java8/src/main/java"
14557 #:tests? #f)); no tests
14558 (home-page "https://github.com/JetBrains/java-annotations")
14559 (synopsis "Annotations for Java and other JVM languages")
14560 (description "This package contains a set of Java annotations which can be
14561used in JVM-based languages. They serve as an additional documentation and
14562can be interpreted by IDEs and static analysis tools to improve code analysis.")
14563 (license license:expat)))
14564
14565(define-public java-javaparser
14566 (package
14567 (name "java-javaparser")
14568 (version "3.16.1")
14569 (source (origin
14570 (method git-fetch)
14571 (uri (git-reference
14572 (url "https://github.com/javaparser/javaparser")
14573 (commit (string-append "javaparser-parent-" version))))
14574 (file-name (git-file-name name version))
14575 (sha256
14576 (base32
14577 "1a4jk12ffa31fa0y8vda0739vpfj1206p0nha842b7bixbvwamv9"))
14578 (modules '((guix build utils)))
14579 (snippet
14580 '(begin
14581 (for-each delete-file
14582 (find-files "." "\\.jar$"))
14583 #t))))
14584 (build-system ant-build-system)
14585 (arguments
14586 `(#:tests? #f; tests require jbehave and junit5
14587 #:phases
14588 (modify-phases %standard-phases
14589 (add-before 'build 'fill-template
14590 (lambda _
14591 (with-directory-excursion "javaparser-core/src/main"
14592 (copy-file "java-templates/com/github/javaparser/JavaParserBuild.java"
14593 "java/com/github/javaparser/JavaParserBuild.java")
14594 (substitute* "java/com/github/javaparser/JavaParserBuild.java"
14595 (("\\$\\{project.version\\}") ,version)
14596 (("\\$\\{project.name\\}") "javaparser")
14597 (("\\$\\{project.build.finalName\\}") "javaparser")
14598 (("\\$\\{maven.version\\}") "fake")
14599 (("\\$\\{maven.build.version\\}") "fake")
14600 (("\\$\\{build.timestamp\\}") "0")
14601 (("\\$\\{java.vendor\\}") "Guix")
14602 (("\\$\\{java.vendor.url\\}") "https://gnu.org/software/guix")
14603 (("\\$\\{java.version\\}") "1.8")
14604 (("\\$\\{os.arch\\}") "any")
14605 (("\\$\\{os.name\\}") "Guix")
14606 (("\\$\\{os.version\\}") "not available")))
14607 #t))
14608 (add-before 'build 'generate-javacc
14609 (lambda _
14610 (with-directory-excursion "javaparser-core/src/main/java"
14611 (invoke "java" "javacc" "../javacc/java.jj"))
14612 #t))
14613 (add-before 'build 'copy-javacc-support
14614 (lambda _
14615 (with-directory-excursion "javaparser-core/src/main"
14616 (copy-recursively "javacc-support" "java"))
14617 #t))
14618 (replace 'build
14619 (lambda _
14620 (define (build name)
14621 (format #t "Building ~a~%" name)
14622 (delete-file-recursively "build/classes")
14623 (mkdir-p "build/classes")
14624 (apply invoke "javac"
14625 "-cp" (string-append (getenv "CLASSPATH") ":"
14626 (string-join (find-files "build/jar" ".")
14627 ":"))
14628 "-d" "build/classes"
14629 (find-files (string-append name "/src/main/java")
14630 ".*.java"))
14631 (invoke "jar" "-cf" (string-append "build/jar/" name ".jar")
14632 "-C" "build/classes" "."))
14633 (mkdir-p "build/classes")
14634 (mkdir-p "build/test-classes")
14635 (mkdir-p "build/jar")
14636 (build "javaparser-core")
14637 (build "javaparser-core-serialization")
14638 (build "javaparser-core-generators")
14639 (build "javaparser-core-metamodel-generator")
14640 (build "javaparser-symbol-solver-core")
14641 #t))
14642 (replace 'install
14643 (install-jars "build/jar")))))
14644 (inputs
14645 (list java-guava java-jboss-javassist java-jsonp-api))
14646 (native-inputs
14647 (list javacc))
14648 (home-page "https://javaparser.org/")
14649 (synopsis "Parser for Java")
14650 (description
14651 "This project contains a set of libraries implementing a Java 1.0 - Java
1465211 Parser with advanced analysis functionalities.")
14653 (license (list
14654 ;; either lgpl or asl
14655 license:lgpl3+
14656 license:asl2.0))))
14657
14658(define-public tla2tools
14659 ;; This package was originally based on the "v1.8.0" tag, but that merely
14660 ;; points to the moving master branch. That might be because the ‘latest
14661 ;; release’ at GitHub is currently 1.7.1. We'll see! For now, rather than
14662 ;; downgrade to 1.7.1 proper, use the commit that we originally dubbed 1.8.0.
14663 (let* ((release "1.7.1")
14664 (revision "0")
14665 (commit "6932e19083fc6df42473464857fc1280cb5aaecc"))
14666 (package
14667 (name "tla2tools")
14668 (version (git-version release revision commit))
14669 (source (origin
14670 (method git-fetch)
14671 (uri (git-reference
14672 (url "https://github.com/tlaplus/tlaplus")
14673 (commit commit)))
14674 (file-name (git-file-name name version))
14675 (sha256
14676 (base32
14677 "1hhx8gmn81k8qrkx4p7ppinmygxga9fqffd626wkvhjgg2ky8lhs"))
14678 (patches
14679 (search-patches "tla2tools-build-xml.patch"))
14680 (modules '((guix build utils)))
14681 (snippet
14682 '(begin
14683 ;; Remove packaged libraries (see 'replace-libs below)
14684 (for-each delete-file (find-files "." ".*.jar$"))))))
14685 (build-system ant-build-system)
14686 (arguments
14687 (let* ((tlatools "tlatools/org.lamport.tlatools/")
14688 (build-xml (string-append tlatools "customBuild.xml")))
14689 `(#:jdk ,openjdk11
14690 #:modules ((guix build ant-build-system)
14691 (guix build utils)
14692 (ice-9 match)
14693 (srfi srfi-26))
14694 #:make-flags '("-f" ,build-xml)
14695 #:phases
14696 (modify-phases %standard-phases
14697 ;; Replace packed libs with references to jars in store
14698 (add-after 'unpack 'replace-libs
14699 (lambda* (#:key inputs #:allow-other-keys)
14700 (define (input-jar input)
14701 (car (find-files (assoc-ref inputs input) "\\.jar$")))
14702 (for-each
14703 (match-lambda
14704 ((file . input)
14705 (symlink (input-jar input)
14706 (string-append ,tlatools "/lib/" file))))
14707 '(("gson/gson-2.8.6.jar" . "java-gson")
14708 ("javax.mail/mailapi-1.6.3.jar" . "java-javax-mail")
14709 ("jline/jline-terminal-3.14.1.jar" . "java-jline-terminal")
14710 ("jline/jline-reader-3.14.1.jar" . "java-jline-reader")
14711 ("lsp/org.eclipse.lsp4j.debug-0.10.0.jar" .
14712 "java-eclipse-lsp4j-debug")
14713 ("lsp/org.eclipse.lsp4j.jsonrpc-0.10.0.jar" .
14714 "java-eclipse-lsp4j-jsonrpc")
14715 ("lsp/org.eclipse.lsp4j.jsonrpc.debug-0.10.0.jar" .
14716 "java-eclipse-lsp4j-jsonrpc-debug")
14717 ("junit-4.12.jar" . "java-junit")
14718 ("easymock-3.3.1.jar" . "java-easymock")))
14719 ;; Retain a tiny subset of the original X-Git-*
14720 ;; manifest values just to aid in debugging.
14721 (substitute* ,build-xml
14722 (("\\$\\{git.tag\\}") (string-append "v" ,release)))))
14723 (add-before 'check 'prepare-tests
14724 (lambda _
14725 ;; The pcal tests write to .cfg files.
14726 (for-each (cut chmod <> #o644)
14727 (find-files (string-append ,tlatools
14728 "/test-model/pcal")
14729 "\\.cfg$"))))
14730 (replace 'install
14731 (lambda* (#:key inputs outputs #:allow-other-keys)
14732 (let* ((share (string-append (assoc-ref outputs "out") "/share/java"))
14733 (jar-name "tla2tools.jar"); set in project.properties
14734 (jar (string-append ,tlatools
14735 "/dist/" jar-name))
14736 (java-cp (string-append share "/" jar-name))
14737 (bin (string-append (assoc-ref outputs "out") "/bin"))
14738 (java (search-input-file inputs "/bin/java")))
14739 (install-file jar share)
14740 (mkdir-p bin)
14741 ;; Generate wrapper scripts for bin/, which invoke common
14742 ;; commands within tla2tools.jar. Users can still invoke
14743 ;; tla2tools.jar for the rest.
14744 (for-each
14745 (match-lambda
14746 ((wrapper . class)
14747 (let ((file (string-append bin "/" wrapper)))
14748 (begin
14749 (with-output-to-file file
14750 (lambda _
14751 (display
14752 (string-append
14753 "#!/bin/sh\n"
14754 java " -XX:+UseParallelGC " " -cp " java-cp " " class " \"$@\""))))
14755 (chmod file #o755)))))
14756 ;; bin/wrapper . java-class
14757 '(("pcal" . "pcal.trans")
14758 ("tlatex" . "tla2tex.TLA")
14759 ("tla2sany" . "tla2sany.SANY")
14760 ("tlc2" . "tlc2.TLC")
14761 ("tlc2-repl" . "tlc2.REPL"))))))))))
14762 (native-inputs
14763 (list java-junit java-easymock))
14764 (inputs
14765 (list java-javax-mail
14766 java-gson-2.8.6
14767 java-jline-terminal
14768 java-jline-reader
14769 java-eclipse-lsp4j-jsonrpc
14770 java-eclipse-lsp4j-jsonrpc-debug
14771 java-eclipse-lsp4j-debug))
14772 (home-page "https://lamport.azurewebsites.net/tla/tools.html")
14773 (synopsis "TLA+ tools (analyzer, TLC, TLATeX, PlusCal translator)")
14774 (description "TLA+ is a high-level language for modeling programs and
14775systems---especially concurrent and distributed ones. It's based on the idea
14776that the best way to describe things precisely is with simple
14777mathematics. TLA+ and its tools are useful for eliminating fundamental design
14778errors, which are hard to find and expensive to correct in code.
14779
14780The following TLA+ tools are available in this distribution:
14781
14782@itemize
14783@item The Syntactic Analyzer: A parser and syntax checker for
14784 TLA+ specifications;
14785@item TLC: A model checker and simulator for a subclass of \"executable\" TLA+
14786 specifications;
14787@item TLATeX: A program for typesetting TLA+ specifications;
14788@item Beta test versions of 1-3 for the TLA+2 language; and
14789@item The PlusCal translator.
14790@end itemize")
14791 (license license:expat))))
14792
14793;;;
14794;;; Avoid adding new packages to the end of this file. To reduce the chances
14795;;; of a merge conflict, place them above by existing packages with similar
14796;;; functionality or similar names.
14797;;;